mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-08-09 06:52:46 -04:00
Merge branch 'noguchi' into qa
This commit is contained in:
commit
b93c86d9c8
2 changed files with 3 additions and 31 deletions
|
@ -32,8 +32,7 @@ var UMBRA_N_USER_NAME = "${parameter_username}";
|
||||||
var UMBRA_N_PASSWORD = "${parameter_password}";
|
var UMBRA_N_PASSWORD = "${parameter_password}";
|
||||||
|
|
||||||
var umbraState = {'idleSince':null};
|
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 umbraIntervalFunc = function() {
|
||||||
var clickedSomething = false;
|
var clickedSomething = false;
|
||||||
|
@ -54,15 +53,10 @@ var umbraIntervalFunc = function() {
|
||||||
if (target) {
|
if (target) {
|
||||||
var where = umbraAboveBelowOrOnScreen(target);
|
var where = umbraAboveBelowOrOnScreen(target);
|
||||||
if (where === 0) {
|
if (where === 0) {
|
||||||
var mouseOverEvent = document.createEvent('Events');
|
|
||||||
mouseOverEvent.initEvent("mouseover", true, false);
|
|
||||||
target.dispatchEvent(mouseOverEvent);
|
|
||||||
target.click();
|
|
||||||
clickedSomething = true;
|
|
||||||
umbraState.idleSince = null;
|
umbraState.idleSince = null;
|
||||||
var target_page = re.exec(document.querySelector("div.nav").textContent);
|
var target_page = re.exec(document.querySelector("div.nav").textContent);
|
||||||
console.log('clicked ' + target_page[1]);
|
console.log('loaded ' + target_page[1]);
|
||||||
umbraAlreadyClicked[target_page] = true;
|
jQuery("#resultBox").load("/index.php/Search/Index/page/" + (+target_page[2] + 1));
|
||||||
} else if (where > 0) {
|
} else if (where > 0) {
|
||||||
somethingLeftBelow = true;
|
somethingLeftBelow = true;
|
||||||
} else if (where < 0) {
|
} 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) {
|
if (umbraState.idleSince == null) {
|
||||||
umbraState.idleSince = Date.now();
|
umbraState.idleSince = Date.now();
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,10 +45,6 @@ behaviors:
|
||||||
url_regex: '^https?://(?:www\.)?instagram\.com/.*$'
|
url_regex: '^https?://(?:www\.)?instagram\.com/.*$'
|
||||||
behavior_js: instagram.js
|
behavior_js: instagram.js
|
||||||
request_idle_timeout_sec: 10
|
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$'
|
url_regex: '^https?://catalogue\.noguchi\.org/index.php/LoginReg/form$'
|
||||||
behavior_js_template: noguchi.js.template
|
behavior_js_template: noguchi.js.template
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue