watir 5.0.0 → 6.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.document +5 -0
- data/.gitignore +21 -0
- data/.gitmodules +3 -0
- data/.travis.yml +35 -0
- data/CHANGES.md +1756 -0
- data/Gemfile +12 -0
- data/LICENSE +23 -0
- data/README.md +92 -0
- data/Rakefile +161 -32
- data/lib/watir.rb +127 -1
- data/lib/watir/after_hooks.rb +132 -0
- data/lib/watir/alert.rb +104 -0
- data/lib/watir/aliases.rb +6 -0
- data/lib/watir/atoms.rb +24 -0
- data/lib/watir/atoms/README +3 -0
- data/lib/watir/atoms/fireEvent.js +29 -0
- data/lib/watir/atoms/getAttribute.js +18 -0
- data/lib/watir/atoms/getInnerHtml.js +18 -0
- data/lib/watir/atoms/getOuterHtml.js +18 -0
- data/lib/watir/atoms/getParentElement.js +17 -0
- data/lib/watir/atoms/selectText.js +61 -0
- data/lib/watir/attribute_helper.rb +98 -0
- data/lib/watir/browser.rb +346 -0
- data/lib/watir/cell_container.rb +25 -0
- data/lib/watir/container.rb +51 -0
- data/lib/watir/cookies.rb +132 -0
- data/lib/watir/element_collection.rb +126 -0
- data/lib/watir/elements/area.rb +12 -0
- data/lib/watir/elements/button.rb +37 -0
- data/lib/watir/elements/cell.rb +17 -0
- data/lib/watir/elements/checkbox.rb +54 -0
- data/lib/watir/elements/dlist.rb +12 -0
- data/lib/watir/elements/element.rb +646 -0
- data/lib/watir/elements/file_field.rb +41 -0
- data/lib/watir/elements/font.rb +11 -0
- data/lib/watir/elements/form.rb +17 -0
- data/lib/watir/elements/hidden.rb +20 -0
- data/lib/watir/elements/html_elements.rb +2063 -0
- data/lib/watir/elements/iframe.rb +163 -0
- data/lib/watir/elements/image.rb +62 -0
- data/lib/watir/elements/input.rb +7 -0
- data/lib/watir/elements/link.rb +18 -0
- data/lib/watir/elements/option.rb +74 -0
- data/lib/watir/elements/radio.rb +42 -0
- data/lib/watir/elements/row.rb +17 -0
- data/lib/watir/elements/select.rb +238 -0
- data/lib/watir/elements/svg_elements.rb +667 -0
- data/lib/watir/elements/table.rb +42 -0
- data/lib/watir/elements/table_cell.rb +6 -0
- data/lib/watir/elements/table_row.rb +15 -0
- data/lib/watir/elements/table_section.rb +15 -0
- data/lib/watir/elements/text_area.rb +5 -0
- data/lib/watir/elements/text_field.rb +37 -0
- data/lib/watir/exception.rb +17 -0
- data/lib/watir/extensions/nokogiri.rb +14 -0
- data/lib/watir/extensions/select_text.rb +10 -0
- data/lib/watir/generator.rb +3 -0
- data/lib/watir/generator/base.rb +11 -0
- data/lib/watir/generator/base/generator.rb +115 -0
- data/lib/watir/generator/base/idl_sorter.rb +47 -0
- data/lib/watir/generator/base/spec_extractor.rb +138 -0
- data/lib/watir/generator/base/util.rb +21 -0
- data/lib/watir/generator/base/visitor.rb +157 -0
- data/lib/watir/generator/html.rb +15 -0
- data/lib/watir/generator/html/generator.rb +36 -0
- data/lib/watir/generator/html/spec_extractor.rb +50 -0
- data/lib/watir/generator/html/visitor.rb +21 -0
- data/lib/watir/generator/svg.rb +7 -0
- data/lib/watir/generator/svg/generator.rb +38 -0
- data/lib/watir/generator/svg/spec_extractor.rb +46 -0
- data/lib/watir/generator/svg/visitor.rb +21 -0
- data/lib/watir/has_window.rb +53 -0
- data/lib/watir/locators.rb +22 -0
- data/lib/watir/locators/button/locator.rb +38 -0
- data/lib/watir/locators/button/selector_builder.rb +27 -0
- data/lib/watir/locators/button/selector_builder/xpath.rb +29 -0
- data/lib/watir/locators/button/validator.rb +15 -0
- data/lib/watir/locators/cell/locator.rb +17 -0
- data/lib/watir/locators/cell/selector_builder.rb +24 -0
- data/lib/watir/locators/element/locator.rb +249 -0
- data/lib/watir/locators/element/selector_builder.rb +147 -0
- data/lib/watir/locators/element/selector_builder/css.rb +65 -0
- data/lib/watir/locators/element/selector_builder/xpath.rb +72 -0
- data/lib/watir/locators/element/validator.rb +23 -0
- data/lib/watir/locators/row/locator.rb +17 -0
- data/lib/watir/locators/row/selector_builder.rb +29 -0
- data/lib/watir/locators/text_area/locator.rb +13 -0
- data/lib/watir/locators/text_area/selector_builder.rb +22 -0
- data/lib/watir/locators/text_field/locator.rb +44 -0
- data/lib/watir/locators/text_field/selector_builder.rb +34 -0
- data/lib/watir/locators/text_field/selector_builder/xpath.rb +19 -0
- data/lib/watir/locators/text_field/validator.rb +20 -0
- data/lib/watir/row_container.rb +36 -0
- data/lib/watir/screenshot.rb +50 -0
- data/lib/watir/user_editable.rb +38 -0
- data/lib/watir/version.rb +3 -3
- data/lib/watir/wait.rb +250 -0
- data/lib/watir/wait/timer.rb +19 -0
- data/lib/watir/window.rb +244 -0
- data/lib/watir/xpath_support.rb +20 -0
- data/spec/always_locate_spec.rb +43 -0
- data/spec/browser_spec.rb +130 -0
- data/spec/click_spec.rb +19 -0
- data/spec/container_spec.rb +34 -0
- data/spec/element_locator_spec.rb +532 -0
- data/spec/element_spec.rb +136 -0
- data/spec/implementation.rb +216 -0
- data/spec/input_spec.rb +14 -0
- data/spec/locator_spec_helper.rb +57 -0
- data/spec/spec_helper.rb +35 -0
- data/spec/special_chars_spec.rb +13 -0
- data/support/doctest_helper.rb +78 -0
- data/support/travis.sh +44 -0
- data/support/version_differ.rb +59 -0
- data/watir.gemspec +37 -25
- metadata +288 -23
- data/lib/watir/loader.rb +0 -64
@@ -0,0 +1,132 @@
|
|
1
|
+
module Watir
|
2
|
+
|
3
|
+
#
|
4
|
+
# After hooks are blocks that run after certain browser events.
|
5
|
+
# They are generally used to ensure application under test does not encounter
|
6
|
+
# any error and are automatically executed after following events:
|
7
|
+
# 1. Open URL.
|
8
|
+
# 2. Refresh page.
|
9
|
+
# 3. Click, double-click or right-click on element.
|
10
|
+
# 4. Alert closing.
|
11
|
+
#
|
12
|
+
|
13
|
+
class AfterHooks
|
14
|
+
include Enumerable
|
15
|
+
|
16
|
+
def initialize(browser)
|
17
|
+
@browser = browser
|
18
|
+
@after_hooks = []
|
19
|
+
end
|
20
|
+
|
21
|
+
#
|
22
|
+
# Adds new after hook.
|
23
|
+
#
|
24
|
+
# @example
|
25
|
+
# browser.after_hooks.add do |browser|
|
26
|
+
# browser.text.include?("Server Error") and puts "Application exception or 500 error!"
|
27
|
+
# end
|
28
|
+
# browser.goto "watir.github.io/404"
|
29
|
+
# "Application exception or 500 error!"
|
30
|
+
#
|
31
|
+
# @param [#call] after_hook Object responding to call
|
32
|
+
# @yield after_hook block
|
33
|
+
# @yieldparam [Watir::Browser]
|
34
|
+
#
|
35
|
+
|
36
|
+
def add(after_hook = nil, &block)
|
37
|
+
if block_given?
|
38
|
+
@after_hooks << block
|
39
|
+
elsif after_hook.respond_to? :call
|
40
|
+
@after_hooks << after_hook
|
41
|
+
else
|
42
|
+
raise ArgumentError, "expected block or object responding to #call"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
alias_method :<<, :add
|
46
|
+
|
47
|
+
#
|
48
|
+
# Deletes after hook.
|
49
|
+
#
|
50
|
+
# @example
|
51
|
+
# browser.after_hooks.add do |browser|
|
52
|
+
# browser.text.include?("Server Error") and puts "Application exception or 500 error!"
|
53
|
+
# end
|
54
|
+
# browser.goto "watir.github.io/404"
|
55
|
+
# "Application exception or 500 error!"
|
56
|
+
# browser.after_hooks.delete browser.after_hooks[0]
|
57
|
+
# browser.refresh
|
58
|
+
#
|
59
|
+
|
60
|
+
def delete(after_hook)
|
61
|
+
@after_hooks.delete(after_hook)
|
62
|
+
end
|
63
|
+
|
64
|
+
#
|
65
|
+
# Runs after hooks.
|
66
|
+
#
|
67
|
+
|
68
|
+
def run
|
69
|
+
if @after_hooks.any? && @browser.window.present?
|
70
|
+
each { |after_hook| after_hook.call(@browser) }
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
#
|
75
|
+
# Executes a block without running error after hooks.
|
76
|
+
#
|
77
|
+
# @example
|
78
|
+
# browser.after_hooks.without do |browser|
|
79
|
+
# browser.element(name: "new_user_button").click
|
80
|
+
# end
|
81
|
+
#
|
82
|
+
# @yield Block that is executed without after hooks being run
|
83
|
+
# @yieldparam [Watir::Browser]
|
84
|
+
#
|
85
|
+
|
86
|
+
def without
|
87
|
+
current_after_hooks = @after_hooks
|
88
|
+
@after_hooks = []
|
89
|
+
yield(@browser)
|
90
|
+
ensure
|
91
|
+
@after_hooks = current_after_hooks
|
92
|
+
end
|
93
|
+
|
94
|
+
#
|
95
|
+
# Yields each after hook.
|
96
|
+
#
|
97
|
+
# @yieldparam [#call] after_hook Object responding to call
|
98
|
+
#
|
99
|
+
|
100
|
+
def each
|
101
|
+
@after_hooks.each { |after_hook| yield after_hook }
|
102
|
+
end
|
103
|
+
|
104
|
+
#
|
105
|
+
# Returns number of after hooks.
|
106
|
+
#
|
107
|
+
# @example
|
108
|
+
# browser.after_hooks.add { puts 'Some after_hook.' }
|
109
|
+
# browser.after_hooks.length
|
110
|
+
# #=> 1
|
111
|
+
#
|
112
|
+
# @return [Fixnum]
|
113
|
+
#
|
114
|
+
|
115
|
+
def length
|
116
|
+
@after_hooks.length
|
117
|
+
end
|
118
|
+
alias_method :size, :length
|
119
|
+
|
120
|
+
#
|
121
|
+
# Gets the after hook at the given index.
|
122
|
+
#
|
123
|
+
# @param [Fixnum] index
|
124
|
+
# @return [#call]
|
125
|
+
#
|
126
|
+
|
127
|
+
def [](index)
|
128
|
+
@after_hooks[index]
|
129
|
+
end
|
130
|
+
|
131
|
+
end # AfterHooks
|
132
|
+
end # Watir
|
data/lib/watir/alert.rb
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
module Watir
|
2
|
+
class Alert
|
3
|
+
|
4
|
+
include EventuallyPresent
|
5
|
+
|
6
|
+
def initialize(browser)
|
7
|
+
@browser = browser
|
8
|
+
@alert = nil
|
9
|
+
end
|
10
|
+
|
11
|
+
#
|
12
|
+
# Returns text of alert.
|
13
|
+
#
|
14
|
+
# @example
|
15
|
+
# browser.alert.text
|
16
|
+
# #=> "ok"
|
17
|
+
#
|
18
|
+
# @return [String]
|
19
|
+
#
|
20
|
+
|
21
|
+
def text
|
22
|
+
assert_exists
|
23
|
+
@alert.text
|
24
|
+
end
|
25
|
+
|
26
|
+
#
|
27
|
+
# Closes alert or accepts prompts/confirms.
|
28
|
+
#
|
29
|
+
# @example
|
30
|
+
# browser.alert.ok
|
31
|
+
# browser.alert.exists?
|
32
|
+
# #=> false
|
33
|
+
#
|
34
|
+
|
35
|
+
def ok
|
36
|
+
assert_exists
|
37
|
+
@alert.accept
|
38
|
+
@browser.after_hooks.run
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# Closes alert or cancels prompts/confirms.
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
# browser.alert.close
|
46
|
+
# browser.alert.exists?
|
47
|
+
# #=> false
|
48
|
+
#
|
49
|
+
|
50
|
+
def close
|
51
|
+
assert_exists
|
52
|
+
@alert.dismiss
|
53
|
+
@browser.after_hooks.run
|
54
|
+
end
|
55
|
+
|
56
|
+
#
|
57
|
+
# Enters text to prompt.
|
58
|
+
#
|
59
|
+
# @example
|
60
|
+
# browser.alert.set "Text for prompt"
|
61
|
+
# browser.alert.ok
|
62
|
+
#
|
63
|
+
# @param [String] value
|
64
|
+
#
|
65
|
+
|
66
|
+
def set(value)
|
67
|
+
assert_exists
|
68
|
+
@alert.send_keys(value)
|
69
|
+
end
|
70
|
+
|
71
|
+
#
|
72
|
+
# Returns true if alert, confirm or prompt is present and false otherwise.
|
73
|
+
#
|
74
|
+
# @example
|
75
|
+
# browser.alert.exists?
|
76
|
+
# #=> true
|
77
|
+
#
|
78
|
+
|
79
|
+
def exists?
|
80
|
+
assert_exists
|
81
|
+
true
|
82
|
+
rescue Exception::UnknownObjectException
|
83
|
+
false
|
84
|
+
end
|
85
|
+
alias_method :present?, :exists?
|
86
|
+
|
87
|
+
#
|
88
|
+
# @api private
|
89
|
+
#
|
90
|
+
|
91
|
+
def selector_string
|
92
|
+
'alert'
|
93
|
+
end
|
94
|
+
|
95
|
+
private
|
96
|
+
|
97
|
+
def assert_exists
|
98
|
+
@alert = @browser.driver.switch_to.alert
|
99
|
+
rescue Selenium::WebDriver::Error::NoAlertPresentError
|
100
|
+
raise Exception::UnknownObjectException, 'unable to locate alert'
|
101
|
+
end
|
102
|
+
|
103
|
+
end # Alert
|
104
|
+
end # Watir
|
data/lib/watir/atoms.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
module Watir
|
2
|
+
module Atoms
|
3
|
+
|
4
|
+
ATOMS = {}
|
5
|
+
|
6
|
+
def self.load(function_name)
|
7
|
+
ATOMS[function_name] = File.read(File.expand_path("../atoms/#{function_name}.js", __FILE__))
|
8
|
+
end
|
9
|
+
|
10
|
+
load :fireEvent
|
11
|
+
load :getAttribute
|
12
|
+
load :getOuterHtml
|
13
|
+
load :getInnerHtml
|
14
|
+
load :getParentElement
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def execute_atom(function_name, *arguments)
|
19
|
+
script = "return (%s).apply(null, arguments)" % ATOMS.fetch(function_name)
|
20
|
+
driver.execute_script(script, *arguments)
|
21
|
+
end
|
22
|
+
|
23
|
+
end # Atoms
|
24
|
+
end # Watir
|
@@ -0,0 +1,29 @@
|
|
1
|
+
// Copyright 2011 Software Freedom Conservatory
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
+
// you may not use this file except in compliance with the License.
|
4
|
+
// You may obtain a copy of the License at
|
5
|
+
//
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
//
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
// See the License for the specific language governing permissions and
|
12
|
+
// limitations under the License.
|
13
|
+
|
14
|
+
|
15
|
+
function(){return function(){var l=this;
|
16
|
+
function m(a){var c=typeof a;if(c=="object")if(a){if(a instanceof Array)return"array";else if(a instanceof Object)return c;var b=Object.prototype.toString.call(a);if(b=="[object Window]")return"object";if(b=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(b=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if(c==
|
17
|
+
"function"&&typeof a.call=="undefined")return"object";return c}function n(a,c){function b(){}b.prototype=c.prototype;a.i=c.prototype;a.prototype=new b};function o(a){this.stack=Error().stack||"";if(a)this.message=String(a)}n(o,Error);function aa(a){for(var c=1;c<arguments.length;c++){var b=String(arguments[c]).replace(/\$/g,"$$$$");a=a.replace(/\%s/,b)}return a}
|
18
|
+
function p(a,c){var b=0,d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),f=String(c).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),k=Math.max(d.length,f.length);for(var j=0;b==0&&j<k;j++){var e=d[j]||"",g=f[j]||"",q=RegExp("(\\d*)(\\D*)","g"),s=RegExp("(\\d*)(\\D*)","g");do{var h=q.exec(e)||["","",""],i=s.exec(g)||["","",""];if(h[0].length==0&&i[0].length==0)break;b=r(h[1].length==0?0:parseInt(h[1],10),i[1].length==0?0:parseInt(i[1],10))||r(h[2].length==0,i[2].length==0)||r(h[2],i[2])}while(b==
|
19
|
+
0)}return b}function r(a,c){if(a<c)return-1;else if(a>c)return 1;return 0};function t(a,c){c.unshift(a);o.call(this,aa.apply(null,c));c.shift();this.l=a}n(t,o);function ba(a,c){if(!a){var b=Array.prototype.slice.call(arguments,2),d="Assertion failed";if(c){d+=": "+c;var f=b}throw new t(""+d,f||[]);}return a};var u=Array.prototype,ca=u.indexOf?function(a,c,b){ba(a.length!=null);return u.indexOf.call(a,c,b)}:function(a,c,b){b=b==null?0:b<0?Math.max(0,a.length+b):b;if(typeof a=="string"){if(typeof c!="string"||c.length!=1)return-1;return a.indexOf(c,b)}for(b=b;b<a.length;b++)if(b in a&&a[b]===c)return b;return-1};var v,w,x,y;function z(){return l.navigator?l.navigator.userAgent:null}y=x=w=v=false;var A;if(A=z()){var da=l.navigator;v=A.indexOf("Opera")==0;w=!v&&A.indexOf("MSIE")!=-1;x=!v&&A.indexOf("WebKit")!=-1;y=!v&&!x&&da.product=="Gecko"}var B=v,C=w,D=y,E=x,F;
|
20
|
+
a:{var G="",H;if(B&&l.opera){var I=l.opera.version;G=typeof I=="function"?I():I}else{if(D)H=/rv\:([^\);]+)(\)|;)/;else if(C)H=/MSIE\s+([^\);]+)(\)|;)/;else if(E)H=/WebKit\/(\S+)/;if(H){var J=H.exec(z());G=J?J[1]:""}}if(C){var K,L=l.document;K=L?L.documentMode:undefined;if(K>parseFloat(G)){F=String(K);break a}}F=G}var M={};var ea;!C||M["9"]||(M["9"]=p(F,"9")>=0);C&&(M["9"]||(M["9"]=p(F,"9")>=0));function N(a,c){this.x=a!==undefined?a:0;this.y=c!==undefined?c:0}N.prototype.toString=function(){return"("+this.x+", "+this.y+")"};function O(a){return a?new fa(P(a)):ea||(ea=new fa)}function P(a){return a.nodeType==9?a:a.ownerDocument||a.document}function fa(a){this.e=a||l.document||document}function ga(a){a=!E&&a.e.compatMode=="CSS1Compat"?a.e.documentElement:a.e.body;return new N(a.scrollLeft,a.scrollTop)};var Q="StopIteration"in l?l.StopIteration:Error("StopIteration");function ha(){}ha.prototype.next=function(){throw Q;};function R(a,c,b,d,f){this.a=!!c;a&&S(this,a,d);this.d=f!=undefined?f:this.c||0;if(this.a)this.d*=-1;this.h=!b}n(R,ha);R.prototype.b=null;R.prototype.c=0;R.prototype.g=false;function S(a,c,b,d){if(a.b=c)a.c=typeof b=="number"?b:a.b.nodeType!=1?0:a.a?-1:1;if(typeof d=="number")a.d=d}
|
21
|
+
R.prototype.next=function(){var a;if(this.g){if(!this.b||this.h&&this.d==0)throw Q;a=this.b;var c=this.a?-1:1;if(this.c==c){var b=this.a?a.lastChild:a.firstChild;b?S(this,b):S(this,a,c*-1)}else(b=this.a?a.previousSibling:a.nextSibling)?S(this,b):S(this,a.parentNode,c*-1);this.d+=this.c*(this.a?-1:1)}else this.g=true;a=this.b;if(!this.b)throw Q;return a};
|
22
|
+
R.prototype.splice=function(){var a=this.b,c=this.a?1:-1;if(this.c==c){this.c=c*-1;this.d+=this.c*(this.a?-1:1)}this.a=!this.a;R.prototype.next.call(this);this.a=!this.a;c=arguments[0];var b=m(c);c=b=="array"||b=="object"&&typeof c.length=="number"?arguments[0]:arguments;for(b=c.length-1;b>=0;b--)a.parentNode&&a.parentNode.insertBefore(c[b],a.nextSibling);a&&a.parentNode&&a.parentNode.removeChild(a)};function T(a,c,b,d){R.call(this,a,c,b,null,d)}n(T,R);T.prototype.next=function(){do T.i.next.call(this);while(this.c==-1);return this.b};function U(a,c){var b;a:{b=P(a);if(b.defaultView&&b.defaultView.getComputedStyle)if(b=b.defaultView.getComputedStyle(a,null)){b=b[c]||b.getPropertyValue(c);break a}b=""}return b||(a.currentStyle?a.currentStyle[c]:null)||a.style[c]}function ia(a){var c=a.getBoundingClientRect();if(C){a=a.ownerDocument;c.left-=a.documentElement.clientLeft+a.body.clientLeft;c.top-=a.documentElement.clientTop+a.body.clientTop}return c}
|
23
|
+
function ja(a){if(C)return a.offsetParent;var c=P(a),b=U(a,"position"),d=b=="fixed"||b=="absolute";for(a=a.parentNode;a&&a!=c;a=a.parentNode){b=U(a,"position");d=d&&b=="static"&&a!=c.documentElement&&a!=c.body;if(!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||b=="fixed"||b=="absolute"))return a}return null};String.fromCharCode(160);var ka=C?1:0,la=["dragstart","dragexit","mouseover","mouseout"];
|
24
|
+
function V(a,c,b){var d=P(a),f=d?d.parentWindow||d.defaultView:window,k=new N;if(a.nodeType==1)if(a.getBoundingClientRect){var j=ia(a);k.x=j.left;k.y=j.top}else{j=ga(O(a));var e,g=P(a),q=U(a,"position"),s=D&&g.getBoxObjectFor&&!a.getBoundingClientRect&&q=="absolute"&&(e=g.getBoxObjectFor(a))&&(e.screenX<0||e.screenY<0),h=new N(0,0),i;e=g?g.nodeType==9?g:P(g):document;if(i=C)i=O(e).e.compatMode!="CSS1Compat";i=i?e.body:e.documentElement;if(a!=i)if(a.getBoundingClientRect){e=ia(a);g=ga(O(g));h.x=e.left+
|
25
|
+
g.x;h.y=e.top+g.y}else if(g.getBoxObjectFor&&!s){e=g.getBoxObjectFor(a);g=g.getBoxObjectFor(i);h.x=e.screenX-g.screenX;h.y=e.screenY-g.screenY}else{e=a;do{h.x+=e.offsetLeft;h.y+=e.offsetTop;if(e!=a){h.x+=e.clientLeft||0;h.y+=e.clientTop||0}if(E&&U(e,"position")=="fixed"){h.x+=g.body.scrollLeft;h.y+=g.body.scrollTop;break}e=e.offsetParent}while(e&&e!=a);if(B||E&&q=="absolute")h.y-=g.body.offsetTop;for(e=a;(e=ja(e))&&e!=g.body&&e!=i;){h.x-=e.scrollLeft;if(!B||e.tagName!="TR")h.y-=e.scrollTop}}k.x=h.x-
|
26
|
+
j.x;k.y=h.y-j.y}else{j=m(a.f)=="function";h=a;if(a.targetTouches)h=a.targetTouches[0];else if(j&&a.f().targetTouches)h=a.f().targetTouches[0];k.x=h.clientX;k.y=h.clientY}i=b||{};b=(i.x||0)+k.x;k=(i.y||0)+k.y;j=i.button||ka;h=i.bubble||true;g=null;if(ca(la,c)>=0)g=i.related||null;q=!!i.alt;e=!!i.control;s=!!i.shift;i=!!i.meta;if(a.fireEvent&&d&&d.createEventObject){a=d.createEventObject();a.altKey=q;a.j=e;a.metaKey=i;a.shiftKey=s;a.clientX=b;a.clientY=k;a.button=j;a.relatedTarget=g}else{a=d.createEvent("MouseEvents");
|
27
|
+
if(a.initMouseEvent)a.initMouseEvent(c,h,true,f,1,0,0,b,k,e,q,s,i,j,g);else{a.initEvent(c,h,true);a.shiftKey=s;a.metaKey=i;a.altKey=q;a.ctrlKey=e;a.button=j}}return a}
|
28
|
+
function W(a,c,b){var d=P(a);a=d?d.parentWindow||d.defaultView:window;var f=b||{};b=f.keyCode||0;var k=f.charCode||0,j=!!f.alt,e=!!f.ctrl,g=!!f.shift;f=!!f.meta;if(D){d=d.createEvent("KeyboardEvent");d.initKeyEvent(c,true,true,a,e,j,g,f,b,k)}else{if(C)d=d.createEventObject();else{d=d.createEvent("Events");d.initEvent(c,true,true);d.charCode=k}d.keyCode=b;d.altKey=j;d.ctrlKey=e;d.metaKey=f;d.shiftKey=g}return d}
|
29
|
+
function ma(a,c,b){var d=P(a),f=b||{};b=f.bubble!==false;var k=!!f.alt,j=!!f.control,e=!!f.shift;f=!!f.meta;if(a.fireEvent&&d&&d.createEventObject){a=d.createEventObject();a.altKey=k;a.k=j;a.metaKey=f;a.shiftKey=e}else{a=d.createEvent("HTMLEvents");a.initEvent(c,b,true);a.shiftKey=e;a.metaKey=f;a.altKey=k;a.ctrlKey=j}return a}var X={};X.click=V;X.keydown=W;X.keypress=W;X.keyup=W;X.mousedown=V;X.mousemove=V;X.mouseout=V;X.mouseover=V;X.mouseup=V;function na(a,c,b){b=(X[c]||ma)(a,c,b);var d;if(!(d=m(a.fireEvent)=="function")){d=m(a.fireEvent);d=d=="object"||d=="array"||d=="function"}if(d){try{(P(a)?P(a).parentWindow||P(a).defaultView:window).event=b}catch(f){}a=a.fireEvent("on"+c,b)}else a=a.dispatchEvent(b);return a}var Y="_".split("."),Z=l;!(Y[0]in Z)&&Z.execScript&&Z.execScript("var "+Y[0]);for(var $;Y.length&&($=Y.shift());)if(!Y.length&&na!==undefined)Z[$]=na;else Z=Z[$]?Z[$]:Z[$]={};; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null}, arguments);}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Copyright 2011 Software Freedom Conservatory
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
+
// you may not use this file except in compliance with the License.
|
4
|
+
// You may obtain a copy of the License at
|
5
|
+
//
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
//
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
// See the License for the specific language governing permissions and
|
12
|
+
// limitations under the License.
|
13
|
+
|
14
|
+
function(){return function(){var d=null,e=this;function f(b,a){function c(){}c.prototype=a.prototype;b.g=a.prototype;b.prototype=new c};function g(b){for(var a=1;a<arguments.length;a++)var c=String(arguments[a]).replace(/\$/g,"$$$$"),b=b.replace(/\%s/,c);return b}function i(b){return b.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}function j(b,a){if(b<a)return-1;else if(b>a)return 1;return 0};var k,l,m,p;function q(){return e.navigator?e.navigator.userAgent:d}p=m=l=k=!1;var r;if(r=q()){var s=e.navigator;k=r.indexOf("Opera")==0;l=!k&&r.indexOf("MSIE")!=-1;m=!k&&r.indexOf("WebKit")!=-1;p=!k&&!m&&s.product=="Gecko"}var t=l,u=p,x=m,y;
|
15
|
+
a:{var z="",A;if(k&&e.opera)var B=e.opera.version,z=typeof B=="function"?B():B;else if(u?A=/rv\:([^\);]+)(\)|;)/:t?A=/MSIE\s+([^\);]+)(\)|;)/:x&&(A=/WebKit\/(\S+)/),A)var C=A.exec(q()),z=C?C[1]:"";if(t){var D,E=e.document;D=E?E.documentMode:void 0;if(D>parseFloat(z)){y=String(D);break a}}y=z}var F={};
|
16
|
+
function G(b){var a;if(!(a=F[b])){a=0;for(var c=i(String(y)).split("."),h=i(String(b)).split("."),v=Math.max(c.length,h.length),w=0;a==0&&w<v;w++){var U=c[w]||"",V=h[w]||"",W=RegExp("(\\d*)(\\D*)","g"),X=RegExp("(\\d*)(\\D*)","g");do{var n=W.exec(U)||["","",""],o=X.exec(V)||["","",""];if(n[0].length==0&&o[0].length==0)break;a=j(n[1].length==0?0:parseInt(n[1],10),o[1].length==0?0:parseInt(o[1],10))||j(n[2].length==0,o[2].length==0)||j(n[2],o[2])}while(a==0)}a=F[b]=a>=0}return a};function H(b){this.stack=Error().stack||"";if(b)this.message=String(b)}f(H,Error);H.prototype.name="CustomError";function I(b,a){H.call(this,a);this.code=b;this.name=J[b]||J[13]}f(I,H);
|
17
|
+
var J,K={NoSuchElementError:7,NoSuchFrameError:8,UnknownCommandError:9,StaleElementReferenceError:10,ElementNotVisibleError:11,InvalidElementStateError:12,UnknownError:13,ElementNotSelectableError:15,XPathLookupError:19,NoSuchWindowError:23,InvalidCookieDomainError:24,UnableToSetCookieError:25,ModalDialogOpenedError:26,NoModalDialogOpenError:27,ScriptTimeoutError:28,InvalidSelectorError:32,SqlDatabaseError:33,MoveTargetOutOfBoundsError:34},L={},M;for(M in K)L[K[M]]=M;J=L;
|
18
|
+
I.prototype.toString=function(){return"["+this.name+"] "+this.message};function N(b,a){a.unshift(b);H.call(this,g.apply(d,a));a.shift();this.f=b}f(N,H);N.prototype.name="AssertionError";function O(b){var a=P;if(typeof a=="string"){if(typeof b!="string"||b.length!=1)return-1;return a.indexOf(b,0)}for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};!t||G("9");!u&&!t||t&&G("9")||u&&G("1.9.1");t&&G("9");function Q(b,a,c,h,v){this.b=!!a;if(b&&(this.a=b))this.c=typeof h=="number"?h:this.a.nodeType!=1?0:this.b?-1:1;this.d=v!=void 0?v:this.c||0;this.b&&(this.d*=-1);this.e=!c}f(Q,function(){});Q.prototype.a=d;Q.prototype.c=0;f(function(b,a,c,h){Q.call(this,b,a,c,d,h)},Q);var P=["async","autofocus","autoplay","checked","compact","complete","controls","declare","defaultchecked","defaultselected","defer","disabled","draggable","ended","formnovalidate","hidden","indeterminate","iscontenteditable","ismap","itemscope","loop","multiple","muted","nohref","noresize","noshade","novalidate","nowrap","open","paused","pubdate","readonly","required","reversed","scoped","seamless","seeking","selected","spellcheck","truespeed","willvalidate"];function R(b,a){if(8==b.nodeType)return d;a=a.toLowerCase();if(a=="style"){var c=i(b.style.cssText).toLowerCase();return c.charAt(c.length-1)==";"?c:c+";"}c=b.getAttributeNode(a);t&&!c&&G(8)&&O(a)>=0&&(c=b[a]);if(!c)return d;if(O(a)>=0)return t&&c.value=="false"?d:"true";return c.specified?c.value:d}var S="_".split("."),T=e;!(S[0]in T)&&T.execScript&&T.execScript("var "+S[0]);for(var Y;S.length&&(Y=S.shift());)!S.length&&R!==void 0?T[Y]=R:T=T[Y]?T[Y]:T[Y]={};; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null}, arguments);}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Copyright 2011 Software Freedom Conservatory
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
+
// you may not use this file except in compliance with the License.
|
4
|
+
// You may obtain a copy of the License at
|
5
|
+
//
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
//
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
// See the License for the specific language governing permissions and
|
12
|
+
// limitations under the License.
|
13
|
+
|
14
|
+
|
15
|
+
function(){return function(){var d=this;function e(a,b){function c(){}c.prototype=b.prototype;a.b=b.prototype;a.prototype=new c};function f(a){this.stack=Error().stack||"";if(a)this.message=String(a)}e(f,Error);function i(a){for(var b=1;b<arguments.length;b++){var c=String(arguments[b]).replace(/\$/g,"$$$$");a=a.replace(/\%s/,c)}return a}
|
16
|
+
function j(a,b){var c=0,A=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),B=String(b).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),H=Math.max(A.length,B.length);for(var l=0;c==0&&l<H;l++){var I=A[l]||"",J=B[l]||"",K=RegExp("(\\d*)(\\D*)","g"),L=RegExp("(\\d*)(\\D*)","g");do{var g=K.exec(I)||["","",""],h=L.exec(J)||["","",""];if(g[0].length==0&&h[0].length==0)break;c=k(g[1].length==0?0:parseInt(g[1],10),h[1].length==0?0:parseInt(h[1],10))||k(g[2].length==0,h[2].length==0)||k(g[2],h[2])}while(c==
|
17
|
+
0)}return c}function k(a,b){if(a<b)return-1;else if(a>b)return 1;return 0};e(function(a,b){b.unshift(a);f.call(this,i.apply(null,b));b.shift();this.a=a},f);var m,n,o,p;function q(){return d.navigator?d.navigator.userAgent:null}p=o=n=m=false;var r;if(r=q()){var s=d.navigator;m=r.indexOf("Opera")==0;n=!m&&r.indexOf("MSIE")!=-1;o=!m&&r.indexOf("WebKit")!=-1;p=!m&&!o&&s.product=="Gecko"}var t=n,u=p,v=o,w;
|
18
|
+
a:{var x="",y;if(m&&d.opera){var z=d.opera.version;x=typeof z=="function"?z():z}else{if(u)y=/rv\:([^\);]+)(\)|;)/;else if(t)y=/MSIE\s+([^\);]+)(\)|;)/;else if(v)y=/WebKit\/(\S+)/;if(y){var C=y.exec(q());x=C?C[1]:""}}if(t){var D,E=d.document;D=E?E.documentMode:undefined;if(D>parseFloat(x)){w=String(D);break a}}w=x}var F={};!t||F["9"]||(F["9"]=j(w,"9")>=0);t&&(F["9"]||(F["9"]=j(w,"9")>=0));function G(a){if("innerHTML"in a)return a.innerHTML;else{var b=(a.nodeType==9?a:a.ownerDocument||a.document).createElement("div");b.appendChild(a.cloneNode(true));return b.innerHTML}}var M="_".split("."),N=d;!(M[0]in N)&&N.execScript&&N.execScript("var "+M[0]);for(var O;M.length&&(O=M.shift());)if(!M.length&&G!==undefined)N[O]=G;else N=N[O]?N[O]:N[O]={};; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null}, arguments);}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Copyright 2011 Software Freedom Conservatory
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
+
// you may not use this file except in compliance with the License.
|
4
|
+
// You may obtain a copy of the License at
|
5
|
+
//
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
//
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
// See the License for the specific language governing permissions and
|
12
|
+
// limitations under the License.
|
13
|
+
|
14
|
+
|
15
|
+
function(){return function(){var d=this;function e(a,b){function c(){}c.prototype=b.prototype;a.b=b.prototype;a.prototype=new c};function f(a){this.stack=Error().stack||"";if(a)this.message=String(a)}e(f,Error);function i(a){for(var b=1;b<arguments.length;b++){var c=String(arguments[b]).replace(/\$/g,"$$$$");a=a.replace(/\%s/,c)}return a}
|
16
|
+
function j(a,b){var c=0,A=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),B=String(b).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),H=Math.max(A.length,B.length);for(var l=0;c==0&&l<H;l++){var I=A[l]||"",J=B[l]||"",K=RegExp("(\\d*)(\\D*)","g"),L=RegExp("(\\d*)(\\D*)","g");do{var g=K.exec(I)||["","",""],h=L.exec(J)||["","",""];if(g[0].length==0&&h[0].length==0)break;c=k(g[1].length==0?0:parseInt(g[1],10),h[1].length==0?0:parseInt(h[1],10))||k(g[2].length==0,h[2].length==0)||k(g[2],h[2])}while(c==
|
17
|
+
0)}return c}function k(a,b){if(a<b)return-1;else if(a>b)return 1;return 0};e(function(a,b){b.unshift(a);f.call(this,i.apply(null,b));b.shift();this.a=a},f);var m,n,o,p;function q(){return d.navigator?d.navigator.userAgent:null}p=o=n=m=false;var r;if(r=q()){var s=d.navigator;m=r.indexOf("Opera")==0;n=!m&&r.indexOf("MSIE")!=-1;o=!m&&r.indexOf("WebKit")!=-1;p=!m&&!o&&s.product=="Gecko"}var t=n,u=p,v=o,w;
|
18
|
+
a:{var x="",y;if(m&&d.opera){var z=d.opera.version;x=typeof z=="function"?z():z}else{if(u)y=/rv\:([^\);]+)(\)|;)/;else if(t)y=/MSIE\s+([^\);]+)(\)|;)/;else if(v)y=/WebKit\/(\S+)/;if(y){var C=y.exec(q());x=C?C[1]:""}}if(t){var D,E=d.document;D=E?E.documentMode:undefined;if(D>parseFloat(x)){w=String(D);break a}}w=x}var F={};!t||F["9"]||(F["9"]=j(w,"9")>=0);t&&(F["9"]||(F["9"]=j(w,"9")>=0));function G(a){if("outerHTML"in a)return a.outerHTML;else{var b=(a.nodeType==9?a:a.ownerDocument||a.document).createElement("div");b.appendChild(a.cloneNode(true));return b.innerHTML}}var M="_".split("."),N=d;!(M[0]in N)&&N.execScript&&N.execScript("var "+M[0]);for(var O;M.length&&(O=M.shift());)if(!M.length&&G!==undefined)N[O]=G;else N=N[O]?N[O]:N[O]={};; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null}, arguments);}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// Copyright 2011 Software Freedom Conservatory
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
+
// you may not use this file except in compliance with the License.
|
4
|
+
// You may obtain a copy of the License at
|
5
|
+
//
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
//
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
// See the License for the specific language governing permissions and
|
12
|
+
// limitations under the License.
|
13
|
+
|
14
|
+
function(){return function(){var d=this;function e(a,b){function c(){}c.prototype=b.prototype;a.g=b.prototype;a.prototype=new c};function g(a){for(var b=1;b<arguments.length;b++)var c=String(arguments[b]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,c);return a}function h(a,b){if(a<b)return-1;else if(a>b)return 1;return 0};var i,l,m,n;function o(){return d.navigator?d.navigator.userAgent:null}n=m=l=i=!1;var p;if(p=o()){var q=d.navigator;i=p.indexOf("Opera")==0;l=!i&&p.indexOf("MSIE")!=-1;m=!i&&p.indexOf("WebKit")!=-1;n=!i&&!m&&q.product=="Gecko"}var r=l,s=n,v=m,w;
|
15
|
+
a:{var x="",y;if(i&&d.opera)var z=d.opera.version,x=typeof z=="function"?z():z;else if(s?y=/rv\:([^\);]+)(\)|;)/:r?y=/MSIE\s+([^\);]+)(\)|;)/:v&&(y=/WebKit\/(\S+)/),y)var A=y.exec(o()),x=A?A[1]:"";if(r){var B,C=d.document;B=C?C.documentMode:void 0;if(B>parseFloat(x)){w=String(B);break a}}w=x}var D={};
|
16
|
+
function E(a){var b;if(!(b=D[a])){b=0;for(var c=String(w).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),f=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),t=Math.max(c.length,f.length),u=0;b==0&&u<t;u++){var L=c[u]||"",M=f[u]||"",N=RegExp("(\\d*)(\\D*)","g"),O=RegExp("(\\d*)(\\D*)","g");do{var j=N.exec(L)||["","",""],k=O.exec(M)||["","",""];if(j[0].length==0&&k[0].length==0)break;b=h(j[1].length==0?0:parseInt(j[1],10),k[1].length==0?0:parseInt(k[1],10))||h(j[2].length==0,k[2].length==0)||
|
17
|
+
h(j[2],k[2])}while(b==0)}b=D[a]=b>=0}return b};function F(a){this.stack=Error().stack||"";if(a)this.message=String(a)}e(F,Error);e(function(a,b){b.unshift(a);F.call(this,g.apply(null,b));b.shift();this.f=a},F);!r||E("9");!s&&!r||r&&E("9")||s&&E("1.9.1");r&&E("9");function G(a,b,c,f,t){this.b=!!b;if(a&&(this.a=a))this.c=typeof f=="number"?f:this.a.nodeType!=1?0:this.b?-1:1;this.d=t!=void 0?t:this.c||0;this.b&&(this.d*=-1);this.e=!c}e(G,function(){});G.prototype.a=null;G.prototype.c=0;e(function(a,b,c,f){G.call(this,a,b,c,null,f)},G);function H(a){for(a=a.parentNode;a&&a.nodeType!=1&&a.nodeType!=9&&a.nodeType!=11;)a=a.parentNode;return a&&a.nodeType==1?a:null}var I="_".split("."),J=d;!(I[0]in J)&&J.execScript&&J.execScript("var "+I[0]);for(var K;I.length&&(K=I.shift());)!I.length&&H!==void 0?J[K]=H:J=J[K]?J[K]:J[K]={};; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null}, arguments);}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
// Copyright 2011 Software Freedom Conservatory
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
+
// you may not use this file except in compliance with the License.
|
4
|
+
// You may obtain a copy of the License at
|
5
|
+
//
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
//
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
// See the License for the specific language governing permissions and
|
12
|
+
// limitations under the License.
|
13
|
+
|
14
|
+
function(){return function(){function f(a){throw a;}var h=void 0,l=null;function m(a){return function(){return this[a]}}function o(a){return function(){return a}}var p,r=this;
|
15
|
+
function s(a){var b=typeof a;if(b=="object")if(a){if(a instanceof Array)return"array";else if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if(c=="[object Window]")return"object";if(c=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(c=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
|
16
|
+
else if(b=="function"&&typeof a.call=="undefined")return"object";return b}function t(a){var b=s(a);return b=="array"||b=="object"&&typeof a.length=="number"}function u(a){return typeof a=="string"}function aa(a){a=s(a);return a=="object"||a=="array"||a=="function"}var ba="closure_uid_"+Math.floor(Math.random()*2147483648).toString(36),ca=0,da=Date.now||function(){return+new Date};function v(a,b){function c(){}c.prototype=b.prototype;a.Q=b.prototype;a.prototype=new c};function ea(a){this.stack=Error().stack||"";if(a)this.message=String(a)}v(ea,Error);ea.prototype.name="CustomError";function fa(a){for(var b=1;b<arguments.length;b++)var c=String(arguments[b]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,c);return a}function w(a){if(!ga.test(a))return a;a.indexOf("&")!=-1&&(a=a.replace(ha,"&"));a.indexOf("<")!=-1&&(a=a.replace(ia,"<"));a.indexOf(">")!=-1&&(a=a.replace(ja,">"));a.indexOf('"')!=-1&&(a=a.replace(ka,"""));return a}var ha=/&/g,ia=/</g,ja=/>/g,ka=/\"/g,ga=/[&<>\"]/;function la(a,b){if(a<b)return-1;else if(a>b)return 1;return 0}
|
17
|
+
var ma=Math.random()*2147483648|0;function na(a,b){b.unshift(a);ea.call(this,fa.apply(l,b));b.shift();this.ra=a}v(na,ea);na.prototype.name="AssertionError";function oa(a,b){if(!a){var c=Array.prototype.slice.call(arguments,2),d="Assertion failed";if(b){d+=": "+b;var e=c}f(new na(""+d,e||[]))}}function pa(a){f(new na("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1)))};function x(a){return a[a.length-1]}var qa=Array.prototype;function z(a,b){if(u(a)){if(!u(b)||b.length!=1)return-1;return a.indexOf(b,0)}for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function ra(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,g=0;g<d;g++)g in e&&b.call(c,e[g],g,a)}function sa(a,b){for(var c=a.length,d=Array(c),e=u(a)?a.split(""):a,g=0;g<c;g++)g in e&&(d[g]=b.call(h,e[g],g,a));return d}
|
18
|
+
function ta(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,g=0;g<d;g++)if(g in e&&b.call(c,e[g],g,a))return!0;return!1}function ua(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,g=0;g<d;g++)if(g in e&&!b.call(c,e[g],g,a))return!1;return!0}function va(a,b){var c;a:{c=a.length;for(var d=u(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(h,d[e],e,a)){c=e;break a}c=-1}return c<0?l:u(a)?a.charAt(c):a[c]}function wa(){return qa.concat.apply(qa,arguments)}
|
19
|
+
function xa(a){if(s(a)=="array")return wa(a);else{for(var b=[],c=0,d=a.length;c<d;c++)b[c]=a[c];return b}}function ya(a){if(s(a)=="array")return wa(a);return xa(a)}function za(a,b,c){oa(a.length!=l);return arguments.length<=2?qa.slice.call(a,b):qa.slice.call(a,b,c)};var A,Aa,Ba,Ca;function Da(){return r.navigator?r.navigator.userAgent:l}Ca=Ba=Aa=A=!1;var Ea;if(Ea=Da()){var Fa=r.navigator;A=Ea.indexOf("Opera")==0;Aa=!A&&Ea.indexOf("MSIE")!=-1;Ba=!A&&Ea.indexOf("WebKit")!=-1;Ca=!A&&!Ba&&Fa.product=="Gecko"}var Ga=A,B=Aa,C=Ca,Ha=Ba,Ia;
|
20
|
+
a:{var Ja="",D;if(Ga&&r.opera)var Ka=r.opera.version,Ja=typeof Ka=="function"?Ka():Ka;else if(C?D=/rv\:([^\);]+)(\)|;)/:B?D=/MSIE\s+([^\);]+)(\)|;)/:Ha&&(D=/WebKit\/(\S+)/),D)var La=D.exec(Da()),Ja=La?La[1]:"";if(B){var Ma,Na=r.document;Ma=Na?Na.documentMode:h;if(Ma>parseFloat(Ja)){Ia=String(Ma);break a}}Ia=Ja}var Pa={};
|
21
|
+
function E(a){var b;if(!(b=Pa[a])){b=0;for(var c=String(Ia).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=Math.max(c.length,d.length),g=0;b==0&&g<e;g++){var i=c[g]||"",j=d[g]||"",k=RegExp("(\\d*)(\\D*)","g"),q=RegExp("(\\d*)(\\D*)","g");do{var n=k.exec(i)||["","",""],y=q.exec(j)||["","",""];if(n[0].length==0&&y[0].length==0)break;b=la(n[1].length==0?0:parseInt(n[1],10),y[1].length==0?0:parseInt(y[1],10))||la(n[2].length==0,y[2].length==
|
22
|
+
0)||la(n[2],y[2])}while(b==0)}b=Pa[a]=b>=0}return b}var Qa={};function Ra(){return Qa[9]||(Qa[9]=B&&document.documentMode&&document.documentMode>=9)};var Sa,Ta=!B||E("9");!C&&!B||B&&E("9")||C&&E("1.9.1");B&&E("9");function Ua(a){var b;b=(b=a.className)&&typeof b.split=="function"?b.split(/\s+/):[];var c=za(arguments,1),d;d=b;for(var e=0,g=0;g<c.length;g++)z(d,c[g])>=0||(d.push(c[g]),e++);d=e==c.length;a.className=b.join(" ");return d};function Va(a,b){for(var c in a)b.call(h,a[c],c,a)}var Wa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];function Xa(a){for(var b,c,d=1;d<arguments.length;d++){c=arguments[d];for(b in c)a[b]=c[b];for(var e=0;e<Wa.length;e++)b=Wa[e],Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])}};function Ya(a){return a?new Za(F(a)):Sa||(Sa=new Za)}function $a(a,b){Va(b,function(b,d){d=="style"?a.style.cssText=b:d=="class"?a.className=b:d=="for"?a.htmlFor=b:d in ab?a.setAttribute(ab[d],b):a[d]=b})}var ab={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",height:"height",width:"width",usemap:"useMap",frameborder:"frameBorder",maxlength:"maxLength",type:"type"};function bb(a){return a?a.parentWindow||a.defaultView:window}
|
23
|
+
function cb(a,b,c){function d(c){c&&b.appendChild(u(c)?a.createTextNode(c):c)}for(var e=2;e<c.length;e++){var g=c[e];t(g)&&!(aa(g)&&g.nodeType>0)?ra(db(g)?xa(g):g,d):d(g)}}function eb(a){return a&&a.parentNode?a.parentNode.removeChild(a):l}function G(a,b){if(a.contains&&b.nodeType==1)return a==b||a.contains(b);if(typeof a.compareDocumentPosition!="undefined")return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}
|
24
|
+
function fb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=a.nodeType==1,d=b.nodeType==1;if(c&&d)return a.sourceIndex-b.sourceIndex;else{var e=a.parentNode,g=b.parentNode;if(e==g)return gb(a,b);if(!c&&G(e,b))return-1*hb(a,b);if(!d&&G(g,a))return hb(b,a);return(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:g.sourceIndex)}}d=F(a);c=d.createRange();c.selectNode(a);c.collapse(!0);d=
|
25
|
+
d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(r.Range.START_TO_END,d)}function hb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return gb(d,a)}function gb(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}
|
26
|
+
function ib(){var a,b=arguments.length;if(b){if(b==1)return arguments[0]}else return l;var c=[],d=Infinity;for(a=0;a<b;a++){for(var e=[],g=arguments[a];g;)e.unshift(g),g=g.parentNode;c.push(e);d=Math.min(d,e.length)}e=l;for(a=0;a<d;a++){for(var g=c[0][a],i=1;i<b;i++)if(g!=c[i][a])return e;e=g}return e}function F(a){return a.nodeType==9?a:a.ownerDocument||a.document}
|
27
|
+
function db(a){if(a&&typeof a.length=="number")if(aa(a))return typeof a.item=="function"||typeof a.item=="string";else if(s(a)=="function")return typeof a.item=="function";return!1}function Za(a){this.v=a||r.document||document}p=Za.prototype;p.T=m("v");
|
28
|
+
p.S=function(){var a=this.v,b=arguments,c=b[0],d=b[1];if(!Ta&&d&&(d.name||d.type)){c=["<",c];d.name&&c.push(' name="',w(d.name),'"');if(d.type){c.push(' type="',w(d.type),'"');var e={};Xa(e,d);d=e;delete d.type}c.push(">");c=c.join("")}c=a.createElement(c);if(d)u(d)?c.className=d:s(d)=="array"?Ua.apply(l,[c].concat(d)):$a(c,d);b.length>2&&cb(a,c,b);return c};p.createElement=function(a){return this.v.createElement(a)};p.createTextNode=function(a){return this.v.createTextNode(a)};
|
29
|
+
p.$=function(){return this.v.parentWindow||this.v.defaultView};p.appendChild=function(a,b){a.appendChild(b)};p.removeNode=eb;p.contains=G;function jb(){kb&&(this[ba]||(this[ba]=++ca))}var kb=!1;var H="StopIteration"in r?r.StopIteration:Error("StopIteration");function I(){}I.prototype.next=function(){f(H)};I.prototype.w=function(){return this};function lb(a){if(a instanceof I)return a;if(typeof a.w=="function")return a.w(!1);if(t(a)){var b=0,c=new I;c.next=function(){for(;;)if(b>=a.length&&f(H),b in a)return a[b++];else b++};return c}f(Error("Not implemented"))}
|
30
|
+
function mb(a,b){if(t(a))try{ra(a,b,h)}catch(c){c!==H&&f(c)}else{a=lb(a);try{for(;;)b.call(h,a.next(),h,a)}catch(d){d!==H&&f(d)}}}function nb(a){if(t(a))return ya(a);var a=lb(a),b=[];mb(a,function(a){b.push(a)});return b};function ob(a){return pb(a||arguments.callee.caller,[])}
|
31
|
+
function pb(a,b){var c=[];if(z(b,a)>=0)c.push("[...circular reference...]");else if(a&&b.length<50){c.push(qb(a)+"(");for(var d=a.arguments,e=0;e<d.length;e++){e>0&&c.push(", ");var g;g=d[e];switch(typeof g){case "object":g=g?"object":"null";break;case "string":break;case "number":g=String(g);break;case "boolean":g=g?"true":"false";break;case "function":g=(g=qb(g))?g:"[fn]";break;default:g=typeof g}g.length>40&&(g=g.substr(0,40)+"...");c.push(g)}b.push(a);c.push(")\n");try{c.push(pb(a.caller,b))}catch(i){c.push("[exception trying to get caller]\n")}}else a?
|
32
|
+
c.push("[...long stack...]"):c.push("[end]");return c.join("")}function qb(a){a=String(a);if(!rb[a]){var b=/function ([^\(]+)/.exec(a);rb[a]=b?b[1]:"[Anonymous]"}return rb[a]}var rb={};function J(a,b,c,d,e){this.reset(a,b,c,d,e)}J.prototype.ia=0;J.prototype.Z=l;J.prototype.Y=l;var sb=0;J.prototype.reset=function(a,b,c,d,e){this.ia=typeof e=="number"?e:sb++;this.ta=d||da();this.H=a;this.ga=b;this.qa=c;delete this.Z;delete this.Y};J.prototype.ba=function(a){this.H=a};function K(a){this.ha=a}K.prototype.O=l;K.prototype.H=l;K.prototype.R=l;K.prototype.aa=l;function tb(a,b){this.name=a;this.value=b}tb.prototype.toString=m("name");var ub=new tb("SEVERE",1E3),vb=new tb("WARNING",900),wb=new tb("CONFIG",700);K.prototype.getParent=m("O");K.prototype.ba=function(a){this.H=a};function xb(a){if(a.H)return a.H;if(a.O)return xb(a.O);pa("Root logger has no level set.");return l}
|
33
|
+
K.prototype.log=function(a,b,c){if(a.value>=xb(this).value){a=this.ea(a,b,c);r.console&&r.console.markTimeline&&r.console.markTimeline("log:"+a.ga);for(b=this;b;){var c=b,d=a;if(c.aa)for(var e=0,g=h;g=c.aa[e];e++)g(d);b=b.getParent()}}};
|
34
|
+
K.prototype.ea=function(a,b,c){var d=new J(a,String(b),this.ha);if(c){d.Z=c;var e;var g=arguments.callee.caller;try{var i;var j;c:{for(var k="window.location.href".split("."),q=r,n;n=k.shift();)if(q[n]!=l)q=q[n];else{j=l;break c}j=q}if(u(c))i={message:c,name:"Unknown error",lineNumber:"Not available",fileName:j,stack:"Not available"};else{var y,Oa,k=!1;try{y=c.lineNumber||c.pa||"Not available"}catch(hc){y="Not available",k=!0}try{Oa=c.fileName||c.filename||c.sourceURL||j}catch(ic){Oa="Not available",
|
35
|
+
k=!0}i=k||!c.lineNumber||!c.fileName||!c.stack?{message:c.message,name:c.name,lineNumber:y,fileName:Oa,stack:c.stack||"Not available"}:c}e="Message: "+w(i.message)+'\nUrl: <a href="view-source:'+i.fileName+'" target="_new">'+i.fileName+"</a>\nLine: "+i.lineNumber+"\n\nBrowser stack:\n"+w(i.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+w(ob(g)+"-> ")}catch(fc){e="Exception trying to expose exception! You win, we lose. "+fc}d.Y=e}return d};var yb={},zb=l;
|
36
|
+
function Ab(a){zb||(zb=new K(""),yb[""]=zb,zb.ba(wb));var b;if(!(b=yb[a])){b=new K(a);var c=a.lastIndexOf("."),d=a.substr(c+1),c=Ab(a.substr(0,c));if(!c.R)c.R={};c.R[d]=b;b.O=c;yb[a]=b}return b};function L(){jb.call(this)}v(L,jb);Ab("goog.dom.SavedRange");v(function(a){jb.call(this);this.ja="goog_"+ma++;this.da="goog_"+ma++;this.X=Ya(a.T());a.K(this.X.S("SPAN",{id:this.ja}),this.X.S("SPAN",{id:this.da}))},L);function M(a,b,c,d,e){this.l=!!b;a&&N(this,a,d);this.r=e!=h?e:this.n||0;this.l&&(this.r*=-1);this.ca=!c}v(M,I);p=M.prototype;p.m=l;p.n=0;p.W=!1;function N(a,b,c,d){if(a.m=b)a.n=typeof c=="number"?c:a.m.nodeType!=1?0:a.l?-1:1;if(typeof d=="number")a.r=d}
|
37
|
+
p.next=function(){var a;if(this.W){(!this.m||this.ca&&this.r==0)&&f(H);a=this.m;var b=this.l?-1:1;if(this.n==b){var c=this.l?a.lastChild:a.firstChild;c?N(this,c):N(this,a,b*-1)}else(c=this.l?a.previousSibling:a.nextSibling)?N(this,c):N(this,a.parentNode,b*-1);this.r+=this.n*(this.l?-1:1)}else this.W=!0;(a=this.m)||f(H);return a};
|
38
|
+
p.splice=function(){var a=this.m,b=this.l?1:-1;if(this.n==b)this.n=b*-1,this.r+=this.n*(this.l?-1:1);this.l=!this.l;M.prototype.next.call(this);this.l=!this.l;for(var b=t(arguments[0])?arguments[0]:arguments,c=b.length-1;c>=0;c--)a.parentNode&&a.parentNode.insertBefore(b[c],a.nextSibling);eb(a)};function O(){}function Bb(a){if(a.getSelection)return a.getSelection();else{var a=a.document,b=a.selection;if(b){try{var c=b.createRange();if(c.parentElement){if(c.parentElement().document!=a)return l}else if(!c.length||c.item(0).document!=a)return l}catch(d){return l}return b}return l}}function Cb(a){for(var b=[],c=0,d=a.z();c<d;c++)b.push(a.t(c));return b}O.prototype.A=o(!1);O.prototype.T=function(){return F(B?this.s():this.b())};O.prototype.$=function(){return bb(this.T())};
|
39
|
+
O.prototype.containsNode=function(a,b){return this.q(Db(a),b)};function P(a,b){M.call(this,a,b,!0)}v(P,M);function Q(){}v(Q,O);Q.prototype.q=function(a,b){var c=Cb(this),d=Cb(a);return(b?ta:ua)(d,function(a){return ta(c,function(c){return c.q(a,b)})})};Q.prototype.insertNode=function(a,b){if(b){var c=this.b();c.parentNode&&c.parentNode.insertBefore(a,c)}else c=this.g(),c.parentNode&&c.parentNode.insertBefore(a,c.nextSibling);return a};Q.prototype.K=function(a,b){this.insertNode(a,!0);this.insertNode(b,!1)};function R(a,b,c,d,e){var g;if(a){this.d=a;this.f=b;this.c=c;this.e=d;if(a.nodeType==1&&a.tagName!="BR")if(a=a.childNodes,b=a[b])this.d=b,this.f=0;else{if(a.length)this.d=x(a);g=!0}if(c.nodeType==1)(this.c=c.childNodes[d])?this.e=0:this.c=c}P.call(this,e?this.c:this.d,e);if(g)try{this.next()}catch(i){i!=H&&f(i)}}v(R,P);p=R.prototype;p.d=l;p.c=l;p.f=0;p.e=0;p.b=m("d");p.g=m("c");p.G=function(){return this.W&&this.m==this.c&&(!this.e||this.n!=1)};p.next=function(){this.G()&&f(H);return R.Q.next.call(this)};"ScriptEngine"in r&&r.ScriptEngine()=="JScript"&&(r.ScriptEngineMajorVersion(),r.ScriptEngineMinorVersion(),r.ScriptEngineBuildVersion());function S(){}S.prototype.q=function(a,b){var c=b&&!a.isCollapsed(),d=a.a;try{return c?this.j(d,0,1)>=0&&this.j(d,1,0)<=0:this.j(d,0,0)>=0&&this.j(d,1,1)<=0}catch(e){return B||f(e),!1}};S.prototype.containsNode=function(a,b){return this.q(T(a),b)};S.prototype.w=function(){return new R(this.b(),this.h(),this.g(),this.i())};function U(a){this.a=a}v(U,S);function Eb(a){var b=F(a).createRange();if(a.nodeType==3)b.setStart(a,0),b.setEnd(a,a.length);else if(V(a)){for(var c,d=a;(c=d.firstChild)&&V(c);)d=c;b.setStart(d,0);for(d=a;(c=d.lastChild)&&V(c);)d=c;b.setEnd(d,d.nodeType==1?d.childNodes.length:d.length)}else c=a.parentNode,a=z(c.childNodes,a),b.setStart(c,a),b.setEnd(c,a+1);return b}function Fb(a,b,c,d){var e=F(a).createRange();e.setStart(a,b);e.setEnd(c,d);return e}p=U.prototype;p.s=function(){return this.a.commonAncestorContainer};
|
40
|
+
p.b=function(){return this.a.startContainer};p.h=function(){return this.a.startOffset};p.g=function(){return this.a.endContainer};p.i=function(){return this.a.endOffset};p.j=function(a,b,c){return this.a.compareBoundaryPoints(c==1?b==1?r.Range.START_TO_START:r.Range.START_TO_END:b==1?r.Range.END_TO_START:r.Range.END_TO_END,a)};p.isCollapsed=function(){return this.a.collapsed};p.select=function(a){this.P(bb(F(this.b())).getSelection(),a)};p.P=function(a){a.removeAllRanges();a.addRange(this.a)};
|
41
|
+
p.insertNode=function(a,b){var c=this.a.cloneRange();c.collapse(b);c.insertNode(a);c.detach();return a};
|
42
|
+
p.K=function(a,b){var c=bb(F(this.b()));if(c=(c=Bb(c||window))&&Gb(c))var d=c.b(),e=c.g(),g=c.h(),i=c.i();var j=this.a.cloneRange(),k=this.a.cloneRange();j.collapse(!1);k.collapse(!0);j.insertNode(b);k.insertNode(a);j.detach();k.detach();if(c){if(d.nodeType==3)for(;g>d.length;){g-=d.length;do d=d.nextSibling;while(d==a||d==b)}if(e.nodeType==3)for(;i>e.length;){i-=e.length;do e=e.nextSibling;while(e==a||e==b)}Hb(d,g,e,i).select()}};p.collapse=function(a){this.a.collapse(a)};function W(a){this.a=a}v(W,U);W.prototype.P=function(a,b){var c=b?this.g():this.b(),d=b?this.i():this.h(),e=b?this.b():this.g(),g=b?this.h():this.i();a.collapse(c,d);(c!=e||d!=g)&&a.extend(e,g)};function Ib(a,b,c,d){M.call(this,a,b,c,l,d)}v(Ib,M);Ib.prototype.next=function(){do Ib.Q.next.call(this);while(this.n==-1);return this.m};function X(a,b){this.a=a;this.ma=b}v(X,S);var Jb=Ab("goog.dom.browserrange.IeRange");function Kb(a){var b=F(a).body.createTextRange();if(a.nodeType==1)b.moveToElementText(a),V(a)&&!a.childNodes.length&&b.collapse(!1);else{for(var c=0,d=a;d=d.previousSibling;){var e=d.nodeType;if(e==3)c+=d.length;else if(e==1){b.moveToElementText(d);break}}d||b.moveToElementText(a.parentNode);b.collapse(!d);c&&b.move("character",c);b.moveEnd("character",a.length)}return b}p=X.prototype;p.u=l;p.d=l;p.c=l;p.f=-1;
|
43
|
+
p.e=-1;p.o=function(){this.u=this.d=this.c=l;this.f=this.e=-1};
|
44
|
+
p.s=function(){if(!this.u){var a=this.a.text,b=this.a.duplicate(),c=a.replace(/ +$/,"");(c=a.length-c.length)&&b.moveEnd("character",-c);c=b.parentElement();b=b.htmlText.replace(/(\r\n|\r|\n)+/g," ").length;if(this.isCollapsed()&&b>0)return this.u=c;for(;b>c.outerHTML.replace(/(\r\n|\r|\n)+/g," ").length;)c=c.parentNode;for(;c.childNodes.length==1&&c.innerText==(c.firstChild.nodeType==3?c.firstChild.nodeValue:c.firstChild.innerText);){if(!V(c.firstChild))break;c=c.firstChild}a.length==0&&(c=Lb(this,
|
45
|
+
c));this.u=c}return this.u};function Lb(a,b){for(var c=b.childNodes,d=0,e=c.length;d<e;d++){var g=c[d];if(V(g)){var i=Kb(g),j=i.htmlText!=g.outerHTML;if(a.isCollapsed()&&j?a.j(i,1,1)>=0&&a.j(i,1,0)<=0:a.a.inRange(i))return Lb(a,g)}}return b}p.b=function(){if(!this.d&&(this.d=Mb(this,1),this.isCollapsed()))this.c=this.d;return this.d};p.h=function(){if(this.f<0&&(this.f=Nb(this,1),this.isCollapsed()))this.e=this.f;return this.f};
|
46
|
+
p.g=function(){if(this.isCollapsed())return this.b();if(!this.c)this.c=Mb(this,0);return this.c};p.i=function(){if(this.isCollapsed())return this.h();if(this.e<0&&(this.e=Nb(this,0),this.isCollapsed()))this.f=this.e;return this.e};p.j=function(a,b,c){return this.a.compareEndPoints((b==1?"Start":"End")+"To"+(c==1?"Start":"End"),a)};
|
47
|
+
function Mb(a,b,c){c=c||a.s();if(!c||!c.firstChild)return c;for(var d=b==1,e=0,g=c.childNodes.length;e<g;e++){var i=d?e:g-e-1,j=c.childNodes[i],k;try{k=T(j)}catch(q){continue}var n=k.a;if(a.isCollapsed())if(V(j)){if(k.q(a))return Mb(a,b,j)}else{if(a.j(n,1,1)==0){a.f=a.e=i;break}}else if(a.q(k)){if(!V(j)){d?a.f=i:a.e=i+1;break}return Mb(a,b,j)}else if(a.j(n,1,0)<0&&a.j(n,0,1)>0)return Mb(a,b,j)}return c}
|
48
|
+
function Nb(a,b){var c=b==1,d=c?a.b():a.g();if(d.nodeType==1){for(var d=d.childNodes,e=d.length,g=c?1:-1,i=c?0:e-1;i>=0&&i<e;i+=g){var j=d[i];if(!V(j)&&a.a.compareEndPoints((b==1?"Start":"End")+"To"+(b==1?"Start":"End"),T(j).a)==0)return c?i:i+1}return i==-1?0:i}else return e=a.a.duplicate(),g=Kb(d),e.setEndPoint(c?"EndToEnd":"StartToStart",g),e=e.text.length,c?d.length-e:e}p.isCollapsed=function(){return this.a.compareEndPoints("StartToEnd",this.a)==0};p.select=function(){this.a.select()};
|
49
|
+
function Ob(a,b,c){var d;d=d||Ya(a.parentElement());var e;b.nodeType!=1&&(e=!0,b=d.S("DIV",l,b));a.collapse(c);d=d||Ya(a.parentElement());var g=c=b.id;if(!c)c=b.id="goog_"+ma++;a.pasteHTML(b.outerHTML);(b=u(c)?d.v.getElementById(c):c)&&(g||b.removeAttribute("id"));if(e){a=b.firstChild;e=b;if((d=e.parentNode)&&d.nodeType!=11)if(e.removeNode)e.removeNode(!1);else{for(;b=e.firstChild;)d.insertBefore(b,e);eb(e)}b=a}return b}p.insertNode=function(a,b){var c=Ob(this.a.duplicate(),a,b);this.o();return c};
|
50
|
+
p.K=function(a,b){var c=this.a.duplicate(),d=this.a.duplicate();Ob(c,a,!0);Ob(d,b,!1);this.o()};p.collapse=function(a){this.a.collapse(a);a?(this.c=this.d,this.e=this.f):(this.d=this.c,this.f=this.e)};function Pb(a){this.a=a}v(Pb,U);Pb.prototype.P=function(a){a.collapse(this.b(),this.h());(this.g()!=this.b()||this.i()!=this.h())&&a.extend(this.g(),this.i());a.rangeCount==0&&a.addRange(this.a)};function Y(a){this.a=a}v(Y,U);Y.prototype.j=function(a,b,c){if(E("528"))return Y.Q.j.call(this,a,b,c);return this.a.compareBoundaryPoints(c==1?b==1?r.Range.START_TO_START:r.Range.END_TO_START:b==1?r.Range.START_TO_END:r.Range.END_TO_END,a)};Y.prototype.P=function(a,b){a.removeAllRanges();b?a.setBaseAndExtent(this.g(),this.i(),this.b(),this.h()):a.setBaseAndExtent(this.b(),this.h(),this.g(),this.i())};function Qb(a){return B&&!Ra()?new X(a,F(a.parentElement())):Ha?new Y(a):C?new W(a):Ga?new Pb(a):new U(a)}function T(a){if(B&&!Ra()){var b=new X(Kb(a),F(a));if(V(a)){for(var c,d=a;(c=d.firstChild)&&V(c);)d=c;b.d=d;b.f=0;for(d=a;(c=d.lastChild)&&V(c);)d=c;b.c=d;b.e=d.nodeType==1?d.childNodes.length:d.length;b.u=a}else b.d=b.c=b.u=a.parentNode,b.f=z(b.u.childNodes,a),b.e=b.f+1;a=b}else a=Ha?new Y(Eb(a)):C?new W(Eb(a)):Ga?new Pb(Eb(a)):new U(Eb(a));return a}
|
51
|
+
function V(a){var b;a:if(a.nodeType!=1)b=!1;else{switch(a.tagName){case "APPLET":case "AREA":case "BASE":case "BR":case "COL":case "FRAME":case "HR":case "IMG":case "INPUT":case "IFRAME":case "ISINDEX":case "LINK":case "NOFRAMES":case "NOSCRIPT":case "META":case "OBJECT":case "PARAM":case "SCRIPT":case "STYLE":b=!1;break a}b=!0}return b||a.nodeType==3};function Rb(){}v(Rb,O);function Sb(a,b){var c=new Rb;c.F=a;c.B=!!b;return c}function Hb(a,b,c,d){var e=new Rb;e.B=Tb(a,b,c,d);if(a.tagName=="BR")var g=a.parentNode,b=z(g.childNodes,a),a=g;if(c.tagName=="BR")g=c.parentNode,d=z(g.childNodes,c),c=g;e.B?(e.d=c,e.f=d,e.c=a,e.e=b):(e.d=a,e.f=b,e.c=c,e.e=d);return e}p=Rb.prototype;p.F=l;p.d=l;p.f=l;p.c=l;p.e=l;p.B=!1;p.U=o("text");p.N=function(){return Z(this).a};p.o=function(){this.d=this.f=this.c=this.e=l};p.z=o(1);p.t=function(){return this};
|
52
|
+
function Z(a){var y;var b;if(!(b=a.F)){b=a.b();var c=a.h(),d=a.g(),e=a.i();if(B&&!Ra()){var g=b,i=c,j=d,k=e,q=!1;g.nodeType==1&&(i>g.childNodes.length&&Jb.log(ub,"Cannot have startOffset > startNode child count",h),i=g.childNodes[i],q=!i,g=i||g.lastChild||g,i=0);var n=Kb(g);i&&n.move("character",i);g==j&&i==k?n.collapse(!0):(q&&n.collapse(!1),q=!1,j.nodeType==1&&(k>j.childNodes.length&&Jb.log(ub,"Cannot have endOffset > endNode child count",h),y=(i=j.childNodes[k])||j.lastChild||j,j=y,k=0,q=!i),g=
|
53
|
+
Kb(j),g.collapse(!q),k&&g.moveEnd("character",k),n.setEndPoint("EndToEnd",g));k=new X(n,F(b));k.d=b;k.f=c;k.c=d;k.e=e;b=k}else b=Ha?new Y(Fb(b,c,d,e)):C?new W(Fb(b,c,d,e)):Ga?new Pb(Fb(b,c,d,e)):new U(Fb(b,c,d,e));b=a.F=b}return b}p.s=function(){return Z(this).s()};p.b=function(){return this.d||(this.d=Z(this).b())};p.h=function(){return this.f!=l?this.f:this.f=Z(this).h()};p.g=function(){return this.c||(this.c=Z(this).g())};p.i=function(){return this.e!=l?this.e:this.e=Z(this).i()};p.A=m("B");
|
54
|
+
p.q=function(a,b){var c=a.U();if(c=="text")return Z(this).q(Z(a),b);else if(c=="control")return c=Ub(a),(b?ta:ua)(c,function(a){return this.containsNode(a,b)},this);return!1};p.isCollapsed=function(){return Z(this).isCollapsed()};p.w=function(){return new R(this.b(),this.h(),this.g(),this.i())};p.select=function(){Z(this).select(this.B)};p.insertNode=function(a,b){var c=Z(this).insertNode(a,b);this.o();return c};p.K=function(a,b){Z(this).K(a,b);this.o()};p.V=function(){return new Vb(this)};
|
55
|
+
p.collapse=function(a){a=this.A()?!a:a;this.F&&this.F.collapse(a);a?(this.c=this.d,this.e=this.f):(this.d=this.c,this.f=this.e);this.B=!1};function Vb(a){this.ka=a.A()?a.g():a.b();this.la=a.A()?a.i():a.h();this.na=a.A()?a.b():a.g();this.oa=a.A()?a.h():a.i()}v(Vb,L);function Wb(){}v(Wb,Q);p=Wb.prototype;p.a=l;p.k=l;p.J=l;p.o=function(){this.J=this.k=l};p.U=o("control");p.N=function(){return this.a||document.body.createControlRange()};p.z=function(){return this.a?this.a.length:0};p.t=function(a){a=this.a.item(a);return Sb(T(a),h)};p.s=function(){return ib.apply(l,Ub(this))};p.b=function(){return Xb(this)[0]};p.h=o(0);p.g=function(){var a=Xb(this),b=x(a);return va(a,function(a){return G(a,b)})};p.i=function(){return this.g().childNodes.length};
|
56
|
+
function Ub(a){if(!a.k&&(a.k=[],a.a))for(var b=0;b<a.a.length;b++)a.k.push(a.a.item(b));return a.k}function Xb(a){if(!a.J)a.J=Ub(a).concat(),a.J.sort(function(a,c){return a.sourceIndex-c.sourceIndex});return a.J}p.isCollapsed=function(){return!this.a||!this.a.length};p.w=function(){return new Yb(this)};p.select=function(){this.a&&this.a.select()};p.V=function(){return new Zb(this)};p.collapse=function(){this.a=l;this.o()};function Zb(a){this.k=Ub(a)}v(Zb,L);
|
57
|
+
function Yb(a){if(a)this.k=Xb(a),this.d=this.k.shift(),this.c=x(this.k)||this.d;P.call(this,this.d,!1)}v(Yb,P);p=Yb.prototype;p.d=l;p.c=l;p.k=l;p.b=m("d");p.g=m("c");p.G=function(){return!this.r&&!this.k.length};p.next=function(){if(this.G())f(H);else if(!this.r){var a=this.k.shift();N(this,a,1,1);return a}return Yb.Q.next.call(this)};function $b(){this.p=[];this.I=[];this.L=this.D=l}v($b,Q);p=$b.prototype;p.fa=Ab("goog.dom.MultiRange");p.o=function(){this.I=[];this.L=this.D=l};p.U=o("mutli");p.N=function(){this.p.length>1&&this.fa.log(vb,"getBrowserRangeObject called on MultiRange with more than 1 range",h);return this.p[0]};p.z=function(){return this.p.length};p.t=function(a){this.I[a]||(this.I[a]=Sb(Qb(this.p[a]),h));return this.I[a]};
|
58
|
+
p.s=function(){if(!this.L){for(var a=[],b=0,c=this.z();b<c;b++)a.push(this.t(b).s());this.L=ib.apply(l,a)}return this.L};function ac(a){if(!a.D)a.D=Cb(a),a.D.sort(function(a,c){var d=a.b(),e=a.h(),g=c.b(),i=c.h();if(d==g&&e==i)return 0;return Tb(d,e,g,i)?1:-1});return a.D}p.b=function(){return ac(this)[0].b()};p.h=function(){return ac(this)[0].h()};p.g=function(){return x(ac(this)).g()};p.i=function(){return x(ac(this)).i()};p.isCollapsed=function(){return this.p.length==0||this.p.length==1&&this.t(0).isCollapsed()};
|
59
|
+
p.w=function(){return new bc(this)};p.select=function(){var a=Bb(this.$());a.removeAllRanges();for(var b=0,c=this.z();b<c;b++)a.addRange(this.t(b).N())};p.V=function(){return new cc(this)};p.collapse=function(a){if(!this.isCollapsed()){var b=a?this.t(0):this.t(this.z()-1);this.o();b.collapse(a);this.I=[b];this.D=[b];this.p=[b.N()]}};function cc(a){this.sa=sa(Cb(a),function(a){return a.V()})}v(cc,L);function bc(a){if(a)this.C=sa(ac(a),function(a){return lb(a)});P.call(this,a?this.b():l,!1)}v(bc,P);
|
60
|
+
p=bc.prototype;p.C=l;p.M=0;p.b=function(){return this.C[0].b()};p.g=function(){return x(this.C).g()};p.G=function(){return this.C[this.M].G()};p.next=function(){try{var a=this.C[this.M],b=a.next();N(this,a.m,a.n,a.r);return b}catch(c){if(c!==H||this.C.length-1==this.M)f(c);else return this.M++,this.next()}};function Gb(a){var b,c=!1;if(a.createRange)try{b=a.createRange()}catch(d){return l}else if(a.rangeCount)if(a.rangeCount>1){b=new $b;for(var c=0,e=a.rangeCount;c<e;c++)b.p.push(a.getRangeAt(c));return b}else b=a.getRangeAt(0),c=Tb(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset);else return l;b&&b.addElement?(a=new Wb,a.a=b):a=Sb(Qb(b),c);return a}function Db(a){return Sb(T(a),h)}
|
61
|
+
function Tb(a,b,c,d){if(a==c)return d<b;var e;if(a.nodeType==1&&b)if(e=a.childNodes[b])a=e,b=0;else if(G(a,c))return!0;if(c.nodeType==1&&d)if(e=c.childNodes[d])c=e,d=0;else if(G(c,a))return!1;return(fb(a,c)||b-d)>0};function dc(a,b){var c=new Db(a);(c=va(nb(c),function(a){return a.nodeType==3&&a.data.indexOf(b)!=-1}))||f("could not find text node matching: "+b);var d=c.data.indexOf(b);Hb(c,d,c,d+b.length).select()}var ec="_".split("."),$=r;!(ec[0]in $)&&$.execScript&&$.execScript("var "+ec[0]);for(var gc;ec.length&&(gc=ec.shift());)!ec.length&&dc!==h?$[gc]=dc:$=$[gc]?$[gc]:$[gc]={};; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null}, arguments);}
|
@@ -0,0 +1,98 @@
|
|
1
|
+
module Watir
|
2
|
+
|
3
|
+
#
|
4
|
+
# @private
|
5
|
+
#
|
6
|
+
# Extended by Element, provides methods for defining attributes on the element classes.
|
7
|
+
#
|
8
|
+
|
9
|
+
module AttributeHelper
|
10
|
+
|
11
|
+
def inherit_attributes_from(kls)
|
12
|
+
kls.typed_attributes.each do |type, attrs|
|
13
|
+
attrs.each { |method, attr| attribute type, method, attr }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def typed_attributes
|
18
|
+
@typed_attributes ||= Hash.new { |hash, type| hash[type] = [] }
|
19
|
+
end
|
20
|
+
|
21
|
+
def attribute_list
|
22
|
+
@attribute_list ||= (
|
23
|
+
list = typed_attributes.values.flatten
|
24
|
+
list += ancestors[1..-1].map do |e|
|
25
|
+
e.attribute_list if e.respond_to?(:attribute_list)
|
26
|
+
end.compact.flatten
|
27
|
+
).uniq
|
28
|
+
end
|
29
|
+
|
30
|
+
alias_method :attributes, :attribute_list
|
31
|
+
|
32
|
+
#
|
33
|
+
# YARD macro to generated friendly
|
34
|
+
# documentation for attributes.
|
35
|
+
#
|
36
|
+
# @macro [attach] attribute
|
37
|
+
# @method $2
|
38
|
+
# @return [$1] value of $3 property
|
39
|
+
#
|
40
|
+
def attribute(type, method, attr)
|
41
|
+
typed_attributes[type] << [method, attr]
|
42
|
+
define_attribute(type, method, attr)
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def self.extended(klass)
|
48
|
+
klass.class_eval do
|
49
|
+
# undefine deprecated methods to use them for Element attributes
|
50
|
+
[:id, :type].each { |m| undef_method m if method_defined? m }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def define_attribute(type, name, attr)
|
55
|
+
case type.to_s
|
56
|
+
when 'String'
|
57
|
+
define_string_attribute(name, attr)
|
58
|
+
when 'Boolean'
|
59
|
+
define_boolean_attribute(name, attr)
|
60
|
+
when 'Fixnum'
|
61
|
+
define_int_attribute(name, attr)
|
62
|
+
when 'Float'
|
63
|
+
define_float_attribute(name, attr)
|
64
|
+
else
|
65
|
+
# $stderr.puts "treating #{type.inspect} as string for now"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def define_string_attribute(mname, aname)
|
70
|
+
define_method mname do
|
71
|
+
# final w3c likely will not support className
|
72
|
+
aname = :class if mname == :class_name
|
73
|
+
attribute_value(aname).to_s
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def define_boolean_attribute(mname, aname)
|
78
|
+
define_method mname do
|
79
|
+
attribute_value(aname) == "true"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def define_int_attribute(mname, aname)
|
84
|
+
define_method mname do
|
85
|
+
value = attribute_value(aname)
|
86
|
+
value && Integer(value)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def define_float_attribute(mname, aname)
|
91
|
+
define_method mname do
|
92
|
+
value = attribute_value(aname)
|
93
|
+
value && Float(value)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
end # AttributeHelper
|
98
|
+
end # Watir
|