mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-08-09 06:52:46 -04:00
Merge branch 'ARI-5617' into qa
This commit is contained in:
commit
e79f8154d6
3 changed files with 6 additions and 6 deletions
|
@ -105,7 +105,7 @@ def behavior_script(url, template_parameters=None, behaviors_dir=None):
|
||||||
'''
|
'''
|
||||||
Returns the javascript behavior string populated with template_parameters.
|
Returns the javascript behavior string populated with template_parameters.
|
||||||
'''
|
'''
|
||||||
import re, logging
|
import re, logging, json
|
||||||
behavior_timeout_custom = None
|
behavior_timeout_custom = None
|
||||||
for behavior in behaviors(behaviors_dir=behaviors_dir):
|
for behavior in behaviors(behaviors_dir=behaviors_dir):
|
||||||
if re.match(behavior['url_regex'], url):
|
if re.match(behavior['url_regex'], url):
|
||||||
|
@ -119,7 +119,7 @@ def behavior_script(url, template_parameters=None, behaviors_dir=None):
|
||||||
script = template.render(parameters)
|
script = template.render(parameters)
|
||||||
logging.info(
|
logging.info(
|
||||||
'using template=%r populated with parameters=%r for %r',
|
'using template=%r populated with parameters=%r for %r',
|
||||||
behavior['behavior_js_template'], parameters, url)
|
behavior['behavior_js_template'], json.dumps(parameters), url)
|
||||||
if 'behavior_timeout_sec' in parameters:
|
if 'behavior_timeout_sec' in parameters:
|
||||||
behavior_timeout_custom = int(parameters['behavior_timeout_sec'])
|
behavior_timeout_custom = int(parameters['behavior_timeout_sec'])
|
||||||
return script, behavior_timeout_custom
|
return script, behavior_timeout_custom
|
||||||
|
|
|
@ -28,9 +28,9 @@
|
||||||
interval: 2500
|
interval: 2500
|
||||||
actions:
|
actions:
|
||||||
- selector: div.see-more
|
- selector: div.see-more
|
||||||
firstMatchOnly: 1
|
firstMatchOnly: true
|
||||||
- selector: li.next
|
- selector: li.next
|
||||||
repeatSameElement: 1
|
repeatSameElement: true
|
||||||
-
|
-
|
||||||
url_regex: '^https?://(?:www\.)?marquette\.edu/.*$'
|
url_regex: '^https?://(?:www\.)?marquette\.edu/.*$'
|
||||||
behavior_js_template: marquette_edu.js
|
behavior_js_template: marquette_edu.js
|
||||||
|
|
|
@ -33,8 +33,8 @@ class UmbraBehavior {
|
||||||
// should match older default and simpleclicks behavior, and more
|
// should match older default and simpleclicks behavior, and more
|
||||||
var k = this.index;
|
var k = this.index;
|
||||||
var selector = this.actions[k].selector;
|
var selector = this.actions[k].selector;
|
||||||
var repeatSameElement = this.actions[k].repeatSameElement ? this.actions[k].repeatSameElement != false : false;
|
var repeatSameElement = this.actions[k].repeatSameElement ? this.actions[k].repeatSameElement : false;
|
||||||
var firstMatchOnly = this.actions[k].firstMatchOnly ? this.actions[k].firstMatchOnly != false: false;
|
var firstMatchOnly = this.actions[k].firstMatchOnly ? this.actions[k].firstMatchOnly : false;
|
||||||
var action = this.actions[k].do ? this.actions[k].do : 'click';
|
var action = this.actions[k].do ? this.actions[k].do : 'click';
|
||||||
var closeSelector = this.actions[k].closeSelector ? this.actions[k].closeSelector : null;
|
var closeSelector = this.actions[k].closeSelector ? this.actions[k].closeSelector : null;
|
||||||
var didSomething = false;
|
var didSomething = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue