mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-08-07 22:12:15 -04:00
Merge branch 'simpledo' into qa
This commit is contained in:
commit
c9982e8727
1 changed files with 11 additions and 1 deletions
|
@ -3,7 +3,7 @@
|
||||||
* acting on elements matching templatized css selector,
|
* acting on elements matching templatized css selector,
|
||||||
* based on simpleclicks.js.template and mouseovers.js.template
|
* based on simpleclicks.js.template and mouseovers.js.template
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 Internet Archive
|
* Copyright (C) 2017 Internet Archive
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -22,6 +22,13 @@ var umbraBehavior = {
|
||||||
IDLE_TIMEOUT_SEC : 10,
|
IDLE_TIMEOUT_SEC : 10,
|
||||||
idleSince : null,
|
idleSince : null,
|
||||||
|
|
||||||
|
// https://github.com/jquery/jquery/blob/master/src/css/hiddenVisibleSelectors.js
|
||||||
|
// n.b. returns true for elements with visibility:hidden, which occupy
|
||||||
|
// screen real estate but are not visible, or clickable with the ui
|
||||||
|
isVisible : function(elem) {
|
||||||
|
return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
|
||||||
|
},
|
||||||
|
|
||||||
intervalFunc : function() {
|
intervalFunc : function() {
|
||||||
var didSomething = false;
|
var didSomething = false;
|
||||||
var somethingLeftBelow = false;
|
var somethingLeftBelow = false;
|
||||||
|
@ -43,6 +50,9 @@ var umbraBehavior = {
|
||||||
var doTargets = documents[j].querySelectorAll(cssSelector);
|
var doTargets = documents[j].querySelectorAll(cssSelector);
|
||||||
|
|
||||||
for ( var i = 0; i < doTargets.length; i++) {
|
for ( var i = 0; i < doTargets.length; i++) {
|
||||||
|
if (!this.isVisible(doTargets[i])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (doTargets[i].umbraDone && !doUntilTimeout) {
|
if (doTargets[i].umbraDone && !doUntilTimeout) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue