diff --git a/brozzler/behaviors.d/noguchi.js.template b/brozzler/behaviors.d/noguchi.js.template index 7f1e9f1..5010c06 100644 --- a/brozzler/behaviors.d/noguchi.js.template +++ b/brozzler/behaviors.d/noguchi.js.template @@ -32,8 +32,7 @@ var UMBRA_N_USER_NAME = "${parameter_username}"; var UMBRA_N_PASSWORD = "${parameter_password}"; var umbraState = {'idleSince':null}; -var umbraAlreadyClicked = {}; -var re = /(?:Previous){0,1}\s+(page \d+\/\d+)\s+(?:Next){0,1}/; +var re = /(?:Previous){0,1}\s+(page (\d+)\/\d+)\s+(?:Next){0,1}/; var umbraIntervalFunc = function() { var clickedSomething = false; @@ -54,15 +53,10 @@ var umbraIntervalFunc = function() { if (target) { var where = umbraAboveBelowOrOnScreen(target); if (where === 0) { - var mouseOverEvent = document.createEvent('Events'); - mouseOverEvent.initEvent("mouseover", true, false); - target.dispatchEvent(mouseOverEvent); - target.click(); - clickedSomething = true; umbraState.idleSince = null; var target_page = re.exec(document.querySelector("div.nav").textContent); - console.log('clicked ' + target_page[1]); - umbraAlreadyClicked[target_page] = true; + console.log('loaded ' + target_page[1]); + jQuery("#resultBox").load("/index.php/Search/Index/page/" + (+target_page[2] + 1)); } else if (where > 0) { somethingLeftBelow = true; } else if (where < 0) { @@ -70,24 +64,6 @@ var umbraIntervalFunc = function() { } } - if (!clickedSomething) { - if (somethingLeftAbove) { - // console.log("scrolling UP because everything on this screen has been clicked but we missed something above"); - window.scrollBy(0, -500); - umbraState.idleSince = null; - } else if (somethingLeftBelow) { - // console.log("scrolling because everything on this screen has been clicked but there's more below document.body.clientHeight=" - // + document.body.clientHeight); - window.scrollBy(0, 200); - umbraState.idleSince = null; - } else if (window.scrollY + window.innerHeight < document.documentElement.scrollHeight) { - window.scrollBy(0, 200); - umbraState.idleSince = null; - } else if (umbraState.idleSince == null) { - umbraState.idleSince = Date.now(); - } - } - if (umbraState.idleSince == null) { umbraState.idleSince = Date.now(); } diff --git a/brozzler/behaviors.yaml b/brozzler/behaviors.yaml index ba47af9..90322e6 100644 --- a/brozzler/behaviors.yaml +++ b/brozzler/behaviors.yaml @@ -45,10 +45,6 @@ behaviors: url_regex: '^https?://(?:www\.)?instagram\.com/.*$' behavior_js: instagram.js request_idle_timeout_sec: 10 - - - url_regex: '^https?://catalogue\.noguchi\.org/index.php$' - behavior_js_template: noguchi.js.template - request_idle_timeout_sec: 10 - url_regex: '^https?://catalogue\.noguchi\.org/index.php/LoginReg/form$' behavior_js_template: noguchi.js.template