mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-02-24 08:39:59 -05:00
More changes
This commit is contained in:
parent
3467670900
commit
5ccc535f51
@ -44,13 +44,11 @@ var umbraSimpleScrollsAndClicksBehavior = {
|
||||
|
||||
if (umbraEndConditionTarget) {
|
||||
if (cssSelectorClickComputedStyleEndCondition != "") {
|
||||
var dynamicCode = umbraCreateDynamicCodeToCheckSelectorCondition(cssSelectorClickComputedStyleEndCondition);
|
||||
|
||||
if (eval(dynamicCode)) {
|
||||
if (umbraCheckSelectorEndCondition(cssSelectorClickComputedStyleEndCondition)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (cssSelectorClickComputedStyleEndCondition == "") {
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -89,19 +87,16 @@ var umbraSimpleScrollsAndClicksBehavior = {
|
||||
|
||||
if (!clickedSomething) {
|
||||
if (somethingLeftAbove) {
|
||||
console
|
||||
.log("scrolling UP because everything on this screen has been clicked but we missed something above");
|
||||
console.log("scrolling UP because everything on this screen has been clicked but we missed something above");
|
||||
window.scrollBy(0, -500);
|
||||
this.idleSince = null;
|
||||
} else if (somethingLeftBelow) {
|
||||
console
|
||||
.log("scrolling because everything on this screen has been clicked but there's more below document.body.clientHeight="
|
||||
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);
|
||||
this.idleSince = null;
|
||||
} else if (window.scrollY + window.innerHeight < document.documentElement.scrollHeight) {
|
||||
console
|
||||
.log("scrolling because we're not to the bottom yet document.body.clientHeight="
|
||||
console.log("scrolling because we're not to the bottom yet document.body.clientHeight="
|
||||
+ document.body.clientHeight);
|
||||
window.scrollBy(0, 200);
|
||||
this.idleSince = null;
|
||||
@ -133,7 +128,7 @@ var umbraSimpleScrollsAndClicksBehavior = {
|
||||
},
|
||||
};
|
||||
|
||||
var umbraCreateDynamicCodeToCheckSelectorCondition = function(condition) {
|
||||
var umbraCheckSelectorEndCondition = function(condition) {
|
||||
if (!condition || condition == "") return;
|
||||
|
||||
return eval("var dynamicFunction = new Function('return function testCondition(target){ if (!target) return false; var computedStyle=window.getComputedStyle(target); return computedStyle." + condition + " }' )(); dynamicFunction(umbraEndConditionTarget);");
|
||||
|
Loading…
x
Reference in New Issue
Block a user