selenium-webdriver 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. data/{common/src/rb/CHANGES → CHANGES} +13 -0
  2. data/{common/src/rb/README → README} +1 -1
  3. data/{common/src/rb/lib → lib}/selenium-webdriver.rb +0 -0
  4. data/{common/src/rb/lib → lib}/selenium/webdriver.rb +2 -1
  5. data/{common/src/rb/lib → lib}/selenium/webdriver/bridge_helper.rb +0 -0
  6. data/{common/src/rb/lib → lib}/selenium/webdriver/child_process.rb +0 -0
  7. data/{chrome/src/rb/lib → lib}/selenium/webdriver/chrome.rb +0 -0
  8. data/{chrome/src/rb/lib → lib}/selenium/webdriver/chrome/bridge.rb +2 -2
  9. data/{chrome/src/rb/lib → lib}/selenium/webdriver/chrome/command_executor.rb +0 -0
  10. data/lib/selenium/webdriver/chrome/extension.zip +0 -0
  11. data/{chrome/src/rb/lib → lib}/selenium/webdriver/chrome/launcher.rb +26 -20
  12. data/{common/src/rb/lib → lib}/selenium/webdriver/core_ext/dir.rb +0 -0
  13. data/{common/src/rb/lib → lib}/selenium/webdriver/core_ext/string.rb +0 -0
  14. data/{common/src/rb/lib → lib}/selenium/webdriver/driver.rb +0 -0
  15. data/{common/src/rb/lib → lib}/selenium/webdriver/driver_extensions/takes_screenshot.rb +0 -0
  16. data/{common/src/rb/lib → lib}/selenium/webdriver/element.rb +0 -0
  17. data/{common/src/rb/lib → lib}/selenium/webdriver/error.rb +0 -0
  18. data/{common/src/rb/lib → lib}/selenium/webdriver/file_reaper.rb +2 -1
  19. data/{common/src/rb/lib → lib}/selenium/webdriver/find.rb +0 -0
  20. data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox.rb +2 -1
  21. data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox/binary.rb +32 -6
  22. data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox/bridge.rb +0 -0
  23. data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
  24. data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox/launcher.rb +0 -0
  25. data/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so +0 -0
  26. data/lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so +0 -0
  27. data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox/profile.rb +37 -72
  28. data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox/profiles_ini.rb +0 -0
  29. data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox/util.rb +0 -0
  30. data/{jobbie/src/rb/lib → lib}/selenium/webdriver/ie.rb +2 -2
  31. data/{jobbie/src/rb/lib → lib}/selenium/webdriver/ie/bridge.rb +7 -2
  32. data/{jobbie/src/rb/lib → lib}/selenium/webdriver/ie/lib.rb +0 -0
  33. data/{jobbie/prebuilt/Win32/Release → lib/selenium/webdriver/ie/native/win32}/InternetExplorerDriver.dll +0 -0
  34. data/lib/selenium/webdriver/ie/native/x64/InternetExplorerDriver.dll +0 -0
  35. data/{jobbie/src/rb/lib → lib}/selenium/webdriver/ie/util.rb +0 -0
  36. data/{common/src/rb/lib → lib}/selenium/webdriver/keys.rb +0 -0
  37. data/{common/src/rb/lib → lib}/selenium/webdriver/navigation.rb +0 -0
  38. data/{common/src/rb/lib → lib}/selenium/webdriver/options.rb +0 -0
  39. data/{common/src/rb/lib → lib}/selenium/webdriver/platform.rb +5 -1
  40. data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote.rb +0 -0
  41. data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/bridge.rb +0 -0
  42. data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/capabilities.rb +0 -0
  43. data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/commands.rb +0 -0
  44. data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/http/common.rb +0 -0
  45. data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/http/curb.rb +0 -0
  46. data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/http/default.rb +5 -1
  47. data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/response.rb +0 -0
  48. data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/server_error.rb +0 -0
  49. data/{common/src/rb/lib → lib}/selenium/webdriver/target_locator.rb +0 -0
  50. data/{common/src/rb/lib → lib}/selenium/webdriver/timeouts.rb +0 -0
  51. data/lib/selenium/webdriver/zip_helper.rb +30 -0
  52. metadata +73 -214
  53. data/COPYING +0 -204
  54. data/chrome/prebuilt/Win32/Release/npchromedriver.dll +0 -0
  55. data/chrome/prebuilt/x64/Release/npchromedriver.dll +0 -0
  56. data/chrome/src/extension/background.html +0 -9
  57. data/chrome/src/extension/background.js +0 -1029
  58. data/chrome/src/extension/content_script.js +0 -1488
  59. data/chrome/src/extension/icons/busy.png +0 -0
  60. data/chrome/src/extension/icons/free.png +0 -0
  61. data/chrome/src/extension/manifest-nonwin.json +0 -19
  62. data/chrome/src/extension/manifest-win.json +0 -20
  63. data/chrome/src/extension/utils.js +0 -231
  64. data/common/src/js/abstractcommandprocessor.js +0 -132
  65. data/common/src/js/asserts.js +0 -296
  66. data/common/src/js/by.js +0 -149
  67. data/common/src/js/command.js +0 -380
  68. data/common/src/js/core/Blank.html +0 -7
  69. data/common/src/js/core/InjectedRemoteRunner.html +0 -8
  70. data/common/src/js/core/RemoteRunner.html +0 -101
  71. data/common/src/js/core/SeleniumLog.html +0 -109
  72. data/common/src/js/core/TestPrompt.html +0 -145
  73. data/common/src/js/core/TestRunner-splash.html +0 -55
  74. data/common/src/js/core/TestRunner.html +0 -165
  75. data/common/src/js/core/icons/all.png +0 -0
  76. data/common/src/js/core/icons/continue.png +0 -0
  77. data/common/src/js/core/icons/continue_disabled.png +0 -0
  78. data/common/src/js/core/icons/pause.png +0 -0
  79. data/common/src/js/core/icons/pause_disabled.png +0 -0
  80. data/common/src/js/core/icons/selected.png +0 -0
  81. data/common/src/js/core/icons/step.png +0 -0
  82. data/common/src/js/core/icons/step_disabled.png +0 -0
  83. data/common/src/js/core/lib/cssQuery/cssQuery-p.js +0 -6
  84. data/common/src/js/core/lib/cssQuery/src/cssQuery-level2.js +0 -142
  85. data/common/src/js/core/lib/cssQuery/src/cssQuery-level3.js +0 -150
  86. data/common/src/js/core/lib/cssQuery/src/cssQuery-standard.js +0 -53
  87. data/common/src/js/core/lib/cssQuery/src/cssQuery.js +0 -356
  88. data/common/src/js/core/lib/prototype.js +0 -2006
  89. data/common/src/js/core/lib/scriptaculous/builder.js +0 -101
  90. data/common/src/js/core/lib/scriptaculous/controls.js +0 -815
  91. data/common/src/js/core/lib/scriptaculous/dragdrop.js +0 -915
  92. data/common/src/js/core/lib/scriptaculous/effects.js +0 -958
  93. data/common/src/js/core/lib/scriptaculous/scriptaculous.js +0 -47
  94. data/common/src/js/core/lib/scriptaculous/slider.js +0 -283
  95. data/common/src/js/core/lib/scriptaculous/unittest.js +0 -383
  96. data/common/src/js/core/lib/snapsie.js +0 -91
  97. data/common/src/js/core/scripts/find_matching_child.js +0 -69
  98. data/common/src/js/core/scripts/htmlutils.js +0 -8716
  99. data/common/src/js/core/scripts/injection.html +0 -72
  100. data/common/src/js/core/scripts/selenium-api.js +0 -3291
  101. data/common/src/js/core/scripts/selenium-browserbot.js +0 -2457
  102. data/common/src/js/core/scripts/selenium-browserdetect.js +0 -153
  103. data/common/src/js/core/scripts/selenium-commandhandlers.js +0 -379
  104. data/common/src/js/core/scripts/selenium-executionloop.js +0 -175
  105. data/common/src/js/core/scripts/selenium-logging.js +0 -148
  106. data/common/src/js/core/scripts/selenium-remoterunner.js +0 -695
  107. data/common/src/js/core/scripts/selenium-testrunner.js +0 -1362
  108. data/common/src/js/core/scripts/selenium-version.js +0 -5
  109. data/common/src/js/core/scripts/ui-doc.html +0 -808
  110. data/common/src/js/core/scripts/ui-element.js +0 -1644
  111. data/common/src/js/core/scripts/ui-map-sample.js +0 -979
  112. data/common/src/js/core/scripts/user-extensions.js +0 -3
  113. data/common/src/js/core/scripts/user-extensions.js.sample +0 -75
  114. data/common/src/js/core/scripts/xmlextras.js +0 -153
  115. data/common/src/js/core/selenium-logo.png +0 -0
  116. data/common/src/js/core/selenium-test.css +0 -43
  117. data/common/src/js/core/selenium.css +0 -316
  118. data/common/src/js/core/xpath/dom.js +0 -566
  119. data/common/src/js/core/xpath/javascript-xpath-0.1.11.js +0 -2816
  120. data/common/src/js/core/xpath/util.js +0 -549
  121. data/common/src/js/core/xpath/xmltoken.js +0 -149
  122. data/common/src/js/core/xpath/xpath.js +0 -2481
  123. data/common/src/js/extension/README +0 -2
  124. data/common/src/js/extension/dommessenger.js +0 -152
  125. data/common/src/js/factory.js +0 -55
  126. data/common/src/js/future.js +0 -141
  127. data/common/src/js/jsunit.js +0 -40
  128. data/common/src/js/jsunit/app/css/jsUnitStyle.css +0 -50
  129. data/common/src/js/jsunit/app/css/readme +0 -10
  130. data/common/src/js/jsunit/app/emptyPage.html +0 -11
  131. data/common/src/js/jsunit/app/jsUnitCore.js +0 -534
  132. data/common/src/js/jsunit/app/jsUnitMockTimeout.js +0 -81
  133. data/common/src/js/jsunit/app/jsUnitTestManager.js +0 -705
  134. data/common/src/js/jsunit/app/jsUnitTestSuite.js +0 -44
  135. data/common/src/js/jsunit/app/jsUnitTracer.js +0 -102
  136. data/common/src/js/jsunit/app/jsUnitVersionCheck.js +0 -59
  137. data/common/src/js/jsunit/app/main-counts-errors.html +0 -12
  138. data/common/src/js/jsunit/app/main-counts-failures.html +0 -13
  139. data/common/src/js/jsunit/app/main-counts-runs.html +0 -13
  140. data/common/src/js/jsunit/app/main-counts.html +0 -21
  141. data/common/src/js/jsunit/app/main-data.html +0 -178
  142. data/common/src/js/jsunit/app/main-errors.html +0 -23
  143. data/common/src/js/jsunit/app/main-frame.html +0 -19
  144. data/common/src/js/jsunit/app/main-loader.html +0 -45
  145. data/common/src/js/jsunit/app/main-progress.html +0 -25
  146. data/common/src/js/jsunit/app/main-results.html +0 -67
  147. data/common/src/js/jsunit/app/main-status.html +0 -13
  148. data/common/src/js/jsunit/app/testContainer.html +0 -16
  149. data/common/src/js/jsunit/app/testContainerController.html +0 -77
  150. data/common/src/js/jsunit/app/xbDebug.js +0 -306
  151. data/common/src/js/jsunit/changelog.txt +0 -60
  152. data/common/src/js/jsunit/css/jsUnitStyle.css +0 -83
  153. data/common/src/js/jsunit/images/green.gif +0 -0
  154. data/common/src/js/jsunit/images/logo_jsunit.gif +0 -0
  155. data/common/src/js/jsunit/images/powerby-transparent.gif +0 -0
  156. data/common/src/js/jsunit/images/red.gif +0 -0
  157. data/common/src/js/jsunit/licenses/JDOM_license.txt +0 -56
  158. data/common/src/js/jsunit/licenses/Jetty_license.html +0 -213
  159. data/common/src/js/jsunit/licenses/MPL-1.1.txt +0 -470
  160. data/common/src/js/jsunit/licenses/gpl-2.txt +0 -340
  161. data/common/src/js/jsunit/licenses/index.html +0 -141
  162. data/common/src/js/jsunit/licenses/lgpl-2.1.txt +0 -504
  163. data/common/src/js/jsunit/licenses/mpl-tri-license-c.txt +0 -35
  164. data/common/src/js/jsunit/licenses/mpl-tri-license-html.txt +0 -35
  165. data/common/src/js/jsunit/readme.txt +0 -19
  166. data/common/src/js/jsunit/testRunner.html +0 -167
  167. data/common/src/js/jsunit/version.txt +0 -1
  168. data/common/src/js/key.js +0 -117
  169. data/common/src/js/localcommandprocessor.js +0 -171
  170. data/common/src/js/testcase.js +0 -219
  171. data/common/src/js/timing.js +0 -89
  172. data/common/src/js/webdriver.js +0 -860
  173. data/common/src/js/webelement.js +0 -483
  174. data/firefox/prebuilt/Win32/Release/webdriver-firefox.dll +0 -0
  175. data/firefox/prebuilt/amd64/libnoblur64.so +0 -0
  176. data/firefox/prebuilt/i386/libnoblur.so +0 -0
  177. data/firefox/prebuilt/linux/Release/libwebdriver-firefox.so +0 -0
  178. data/firefox/prebuilt/linux64/Release/libwebdriver-firefox.so +0 -0
  179. data/firefox/prebuilt/nsICommandProcessor.xpt +0 -0
  180. data/firefox/prebuilt/nsINativeEvents.xpt +0 -0
  181. data/firefox/prebuilt/nsIResponseHandler.xpt +0 -0
  182. data/firefox/src/extension/chrome.manifest +0 -3
  183. data/firefox/src/extension/components/badCertListener.js +0 -295
  184. data/firefox/src/extension/components/dispatcher.js +0 -495
  185. data/firefox/src/extension/components/driver-component.js +0 -130
  186. data/firefox/src/extension/components/errorcode.js +0 -70
  187. data/firefox/src/extension/components/firefoxDriver.js +0 -831
  188. data/firefox/src/extension/components/json2.js +0 -273
  189. data/firefox/src/extension/components/keytest.html +0 -554
  190. data/firefox/src/extension/components/nsCommandProcessor.js +0 -684
  191. data/firefox/src/extension/components/promptService.js +0 -208
  192. data/firefox/src/extension/components/request.js +0 -219
  193. data/firefox/src/extension/components/response.js +0 -276
  194. data/firefox/src/extension/components/screenshooter.js +0 -81
  195. data/firefox/src/extension/components/session.js +0 -314
  196. data/firefox/src/extension/components/sessionstore.js +0 -226
  197. data/firefox/src/extension/components/socketListener.js +0 -435
  198. data/firefox/src/extension/components/utils.js +0 -1335
  199. data/firefox/src/extension/components/webLoadingListener.js +0 -57
  200. data/firefox/src/extension/components/webdriverserver.js +0 -110
  201. data/firefox/src/extension/components/wrappedElement.js +0 -706
  202. data/firefox/src/extension/content/fxdriver.xul +0 -30
  203. data/firefox/src/extension/content/server.js +0 -95
  204. data/firefox/src/extension/idl/nsICommandProcessor.idl +0 -38
  205. data/firefox/src/extension/idl/nsIResponseHandler.idl +0 -34
  206. data/firefox/src/extension/install.rdf +0 -29
  207. data/jobbie/prebuilt/x64/Release/InternetExplorerDriver.dll +0 -0
@@ -1,915 +0,0 @@
1
- // Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
2
- // (c) 2005 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
3
- //
4
- // See scriptaculous.js for full license.
5
-
6
- /*--------------------------------------------------------------------------*/
7
-
8
- var Droppables = {
9
- drops: [],
10
-
11
- remove: function(element) {
12
- this.drops = this.drops.reject(function(d) { return d.element==$(element) });
13
- },
14
-
15
- add: function(element) {
16
- element = $(element);
17
- var options = Object.extend({
18
- greedy: true,
19
- hoverclass: null,
20
- tree: false
21
- }, arguments[1] || {});
22
-
23
- // cache containers
24
- if(options.containment) {
25
- options._containers = [];
26
- var containment = options.containment;
27
- if((typeof containment == 'object') &&
28
- (containment.constructor == Array)) {
29
- containment.each( function(c) { options._containers.push($(c)) });
30
- } else {
31
- options._containers.push($(containment));
32
- }
33
- }
34
-
35
- if(options.accept) options.accept = [options.accept].flatten();
36
-
37
- Element.makePositioned(element); // fix IE
38
- options.element = element;
39
-
40
- this.drops.push(options);
41
- },
42
-
43
- findDeepestChild: function(drops) {
44
- deepest = drops[0];
45
-
46
- for (i = 1; i < drops.length; ++i)
47
- if (Element.isParent(drops[i].element, deepest.element))
48
- deepest = drops[i];
49
-
50
- return deepest;
51
- },
52
-
53
- isContained: function(element, drop) {
54
- var containmentNode;
55
- if(drop.tree) {
56
- containmentNode = element.treeNode;
57
- } else {
58
- containmentNode = element.parentNode;
59
- }
60
- return drop._containers.detect(function(c) { return containmentNode == c });
61
- },
62
-
63
- isAffected: function(point, element, drop) {
64
- return (
65
- (drop.element!=element) &&
66
- ((!drop._containers) ||
67
- this.isContained(element, drop)) &&
68
- ((!drop.accept) ||
69
- (Element.classNames(element).detect(
70
- function(v) { return drop.accept.include(v) } ) )) &&
71
- Position.within(drop.element, point[0], point[1]) );
72
- },
73
-
74
- deactivate: function(drop) {
75
- if(drop.hoverclass)
76
- Element.removeClassName(drop.element, drop.hoverclass);
77
- this.last_active = null;
78
- },
79
-
80
- activate: function(drop) {
81
- if(drop.hoverclass)
82
- Element.addClassName(drop.element, drop.hoverclass);
83
- this.last_active = drop;
84
- },
85
-
86
- show: function(point, element) {
87
- if(!this.drops.length) return;
88
- var affected = [];
89
-
90
- if(this.last_active) this.deactivate(this.last_active);
91
- this.drops.each( function(drop) {
92
- if(Droppables.isAffected(point, element, drop))
93
- affected.push(drop);
94
- });
95
-
96
- if(affected.length>0) {
97
- drop = Droppables.findDeepestChild(affected);
98
- Position.within(drop.element, point[0], point[1]);
99
- if(drop.onHover)
100
- drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
101
-
102
- Droppables.activate(drop);
103
- }
104
- },
105
-
106
- fire: function(event, element) {
107
- if(!this.last_active) return;
108
- Position.prepare();
109
-
110
- if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
111
- if (this.last_active.onDrop)
112
- this.last_active.onDrop(element, this.last_active.element, event);
113
- },
114
-
115
- reset: function() {
116
- if(this.last_active)
117
- this.deactivate(this.last_active);
118
- }
119
- }
120
-
121
- var Draggables = {
122
- drags: [],
123
- observers: [],
124
-
125
- register: function(draggable) {
126
- if(this.drags.length == 0) {
127
- this.eventMouseUp = this.endDrag.bindAsEventListener(this);
128
- this.eventMouseMove = this.updateDrag.bindAsEventListener(this);
129
- this.eventKeypress = this.keyPress.bindAsEventListener(this);
130
-
131
- Event.observe(document, "mouseup", this.eventMouseUp);
132
- Event.observe(document, "mousemove", this.eventMouseMove);
133
- Event.observe(document, "keypress", this.eventKeypress);
134
- }
135
- this.drags.push(draggable);
136
- },
137
-
138
- unregister: function(draggable) {
139
- this.drags = this.drags.reject(function(d) { return d==draggable });
140
- if(this.drags.length == 0) {
141
- Event.stopObserving(document, "mouseup", this.eventMouseUp);
142
- Event.stopObserving(document, "mousemove", this.eventMouseMove);
143
- Event.stopObserving(document, "keypress", this.eventKeypress);
144
- }
145
- },
146
-
147
- activate: function(draggable) {
148
- window.focus(); // allows keypress events if window isn't currently focused, fails for Safari
149
- this.activeDraggable = draggable;
150
- },
151
-
152
- deactivate: function() {
153
- this.activeDraggable = null;
154
- },
155
-
156
- updateDrag: function(event) {
157
- if(!this.activeDraggable) return;
158
- var pointer = [Event.pointerX(event), Event.pointerY(event)];
159
- // Mozilla-based browsers fire successive mousemove events with
160
- // the same coordinates, prevent needless redrawing (moz bug?)
161
- if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return;
162
- this._lastPointer = pointer;
163
- this.activeDraggable.updateDrag(event, pointer);
164
- },
165
-
166
- endDrag: function(event) {
167
- if(!this.activeDraggable) return;
168
- this._lastPointer = null;
169
- this.activeDraggable.endDrag(event);
170
- this.activeDraggable = null;
171
- },
172
-
173
- keyPress: function(event) {
174
- if(this.activeDraggable)
175
- this.activeDraggable.keyPress(event);
176
- },
177
-
178
- addObserver: function(observer) {
179
- this.observers.push(observer);
180
- this._cacheObserverCallbacks();
181
- },
182
-
183
- removeObserver: function(element) { // element instead of observer fixes mem leaks
184
- this.observers = this.observers.reject( function(o) { return o.element==element });
185
- this._cacheObserverCallbacks();
186
- },
187
-
188
- notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag'
189
- if(this[eventName+'Count'] > 0)
190
- this.observers.each( function(o) {
191
- if(o[eventName]) o[eventName](eventName, draggable, event);
192
- });
193
- },
194
-
195
- _cacheObserverCallbacks: function() {
196
- ['onStart','onEnd','onDrag'].each( function(eventName) {
197
- Draggables[eventName+'Count'] = Draggables.observers.select(
198
- function(o) { return o[eventName]; }
199
- ).length;
200
- });
201
- }
202
- }
203
-
204
- /*--------------------------------------------------------------------------*/
205
-
206
- var Draggable = Class.create();
207
- Draggable.prototype = {
208
- initialize: function(element) {
209
- var options = Object.extend({
210
- handle: false,
211
- starteffect: function(element) {
212
- element._opacity = Element.getOpacity(element);
213
- new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});
214
- },
215
- reverteffect: function(element, top_offset, left_offset) {
216
- var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;
217
- element._revert = new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur});
218
- },
219
- endeffect: function(element) {
220
- var toOpacity = typeof element._opacity == 'number' ? element._opacity : 1.0
221
- new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity});
222
- },
223
- zindex: 1000,
224
- revert: false,
225
- scroll: false,
226
- scrollSensitivity: 20,
227
- scrollSpeed: 15,
228
- snap: false // false, or xy or [x,y] or function(x,y){ return [x,y] }
229
- }, arguments[1] || {});
230
-
231
- this.element = $(element);
232
-
233
- if(options.handle && (typeof options.handle == 'string')) {
234
- var h = Element.childrenWithClassName(this.element, options.handle, true);
235
- if(h.length>0) this.handle = h[0];
236
- }
237
- if(!this.handle) this.handle = $(options.handle);
238
- if(!this.handle) this.handle = this.element;
239
-
240
- if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML)
241
- options.scroll = $(options.scroll);
242
-
243
- Element.makePositioned(this.element); // fix IE
244
-
245
- this.delta = this.currentDelta();
246
- this.options = options;
247
- this.dragging = false;
248
-
249
- this.eventMouseDown = this.initDrag.bindAsEventListener(this);
250
- Event.observe(this.handle, "mousedown", this.eventMouseDown);
251
-
252
- Draggables.register(this);
253
- },
254
-
255
- destroy: function() {
256
- Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
257
- Draggables.unregister(this);
258
- },
259
-
260
- currentDelta: function() {
261
- return([
262
- parseInt(Element.getStyle(this.element,'left') || '0'),
263
- parseInt(Element.getStyle(this.element,'top') || '0')]);
264
- },
265
-
266
- initDrag: function(event) {
267
- if(Event.isLeftClick(event)) {
268
- // abort on form elements, fixes a Firefox issue
269
- var src = Event.element(event);
270
- if(src.tagName && (
271
- src.tagName=='INPUT' ||
272
- src.tagName=='SELECT' ||
273
- src.tagName=='OPTION' ||
274
- src.tagName=='BUTTON' ||
275
- src.tagName=='TEXTAREA')) return;
276
-
277
- if(this.element._revert) {
278
- this.element._revert.cancel();
279
- this.element._revert = null;
280
- }
281
-
282
- var pointer = [Event.pointerX(event), Event.pointerY(event)];
283
- var pos = Position.cumulativeOffset(this.element);
284
- this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
285
-
286
- Draggables.activate(this);
287
- Event.stop(event);
288
- }
289
- },
290
-
291
- startDrag: function(event) {
292
- this.dragging = true;
293
-
294
- if(this.options.zindex) {
295
- this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
296
- this.element.style.zIndex = this.options.zindex;
297
- }
298
-
299
- if(this.options.ghosting) {
300
- this._clone = this.element.cloneNode(true);
301
- Position.absolutize(this.element);
302
- this.element.parentNode.insertBefore(this._clone, this.element);
303
- }
304
-
305
- if(this.options.scroll) {
306
- if (this.options.scroll == window) {
307
- var where = this._getWindowScroll(this.options.scroll);
308
- this.originalScrollLeft = where.left;
309
- this.originalScrollTop = where.top;
310
- } else {
311
- this.originalScrollLeft = this.options.scroll.scrollLeft;
312
- this.originalScrollTop = this.options.scroll.scrollTop;
313
- }
314
- }
315
-
316
- Draggables.notify('onStart', this, event);
317
- if(this.options.starteffect) this.options.starteffect(this.element);
318
- },
319
-
320
- updateDrag: function(event, pointer) {
321
- if(!this.dragging) this.startDrag(event);
322
- Position.prepare();
323
- Droppables.show(pointer, this.element);
324
- Draggables.notify('onDrag', this, event);
325
- this.draw(pointer);
326
- if(this.options.change) this.options.change(this);
327
-
328
- if(this.options.scroll) {
329
- this.stopScrolling();
330
-
331
- var p;
332
- if (this.options.scroll == window) {
333
- with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
334
- } else {
335
- p = Position.page(this.options.scroll);
336
- p[0] += this.options.scroll.scrollLeft;
337
- p[1] += this.options.scroll.scrollTop;
338
- p.push(p[0]+this.options.scroll.offsetWidth);
339
- p.push(p[1]+this.options.scroll.offsetHeight);
340
- }
341
- var speed = [0,0];
342
- if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity);
343
- if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity);
344
- if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity);
345
- if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity);
346
- this.startScrolling(speed);
347
- }
348
-
349
- // fix AppleWebKit rendering
350
- if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0);
351
-
352
- Event.stop(event);
353
- },
354
-
355
- finishDrag: function(event, success) {
356
- this.dragging = false;
357
-
358
- if(this.options.ghosting) {
359
- Position.relativize(this.element);
360
- Element.remove(this._clone);
361
- this._clone = null;
362
- }
363
-
364
- if(success) Droppables.fire(event, this.element);
365
- Draggables.notify('onEnd', this, event);
366
-
367
- var revert = this.options.revert;
368
- if(revert && typeof revert == 'function') revert = revert(this.element);
369
-
370
- var d = this.currentDelta();
371
- if(revert && this.options.reverteffect) {
372
- this.options.reverteffect(this.element,
373
- d[1]-this.delta[1], d[0]-this.delta[0]);
374
- } else {
375
- this.delta = d;
376
- }
377
-
378
- if(this.options.zindex)
379
- this.element.style.zIndex = this.originalZ;
380
-
381
- if(this.options.endeffect)
382
- this.options.endeffect(this.element);
383
-
384
- Draggables.deactivate(this);
385
- Droppables.reset();
386
- },
387
-
388
- keyPress: function(event) {
389
- if(event.keyCode!=Event.KEY_ESC) return;
390
- this.finishDrag(event, false);
391
- Event.stop(event);
392
- },
393
-
394
- endDrag: function(event) {
395
- if(!this.dragging) return;
396
- this.stopScrolling();
397
- this.finishDrag(event, true);
398
- Event.stop(event);
399
- },
400
-
401
- draw: function(point) {
402
- var pos = Position.cumulativeOffset(this.element);
403
- var d = this.currentDelta();
404
- pos[0] -= d[0]; pos[1] -= d[1];
405
-
406
- if(this.options.scroll && (this.options.scroll != window)) {
407
- pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft;
408
- pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop;
409
- }
410
-
411
- var p = [0,1].map(function(i){
412
- return (point[i]-pos[i]-this.offset[i])
413
- }.bind(this));
414
-
415
- if(this.options.snap) {
416
- if(typeof this.options.snap == 'function') {
417
- p = this.options.snap(p[0],p[1],this);
418
- } else {
419
- if(this.options.snap instanceof Array) {
420
- p = p.map( function(v, i) {
421
- return Math.round(v/this.options.snap[i])*this.options.snap[i] }.bind(this))
422
- } else {
423
- p = p.map( function(v) {
424
- return Math.round(v/this.options.snap)*this.options.snap }.bind(this))
425
- }
426
- }}
427
-
428
- var style = this.element.style;
429
- if((!this.options.constraint) || (this.options.constraint=='horizontal'))
430
- style.left = p[0] + "px";
431
- if((!this.options.constraint) || (this.options.constraint=='vertical'))
432
- style.top = p[1] + "px";
433
- if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering
434
- },
435
-
436
- stopScrolling: function() {
437
- if(this.scrollInterval) {
438
- clearInterval(this.scrollInterval);
439
- this.scrollInterval = null;
440
- Draggables._lastScrollPointer = null;
441
- }
442
- },
443
-
444
- startScrolling: function(speed) {
445
- this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];
446
- this.lastScrolled = new Date();
447
- this.scrollInterval = setInterval(this.scroll.bind(this), 10);
448
- },
449
-
450
- scroll: function() {
451
- var current = new Date();
452
- var delta = current - this.lastScrolled;
453
- this.lastScrolled = current;
454
- if(this.options.scroll == window) {
455
- with (this._getWindowScroll(this.options.scroll)) {
456
- if (this.scrollSpeed[0] || this.scrollSpeed[1]) {
457
- var d = delta / 1000;
458
- this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] );
459
- }
460
- }
461
- } else {
462
- this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000;
463
- this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000;
464
- }
465
-
466
- Position.prepare();
467
- Droppables.show(Draggables._lastPointer, this.element);
468
- Draggables.notify('onDrag', this);
469
- Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer);
470
- Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000;
471
- Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000;
472
- if (Draggables._lastScrollPointer[0] < 0)
473
- Draggables._lastScrollPointer[0] = 0;
474
- if (Draggables._lastScrollPointer[1] < 0)
475
- Draggables._lastScrollPointer[1] = 0;
476
- this.draw(Draggables._lastScrollPointer);
477
-
478
- if(this.options.change) this.options.change(this);
479
- },
480
-
481
- _getWindowScroll: function(w) {
482
- var T, L, W, H;
483
- with (w.document) {
484
- if (w.document.documentElement && documentElement.scrollTop) {
485
- T = documentElement.scrollTop;
486
- L = documentElement.scrollLeft;
487
- } else if (w.document.body) {
488
- T = body.scrollTop;
489
- L = body.scrollLeft;
490
- }
491
- if (w.innerWidth) {
492
- W = w.innerWidth;
493
- H = w.innerHeight;
494
- } else if (w.document.documentElement && documentElement.clientWidth) {
495
- W = documentElement.clientWidth;
496
- H = documentElement.clientHeight;
497
- } else {
498
- W = body.offsetWidth;
499
- H = body.offsetHeight
500
- }
501
- }
502
- return { top: T, left: L, width: W, height: H };
503
- }
504
- }
505
-
506
- /*--------------------------------------------------------------------------*/
507
-
508
- var SortableObserver = Class.create();
509
- SortableObserver.prototype = {
510
- initialize: function(element, observer) {
511
- this.element = $(element);
512
- this.observer = observer;
513
- this.lastValue = Sortable.serialize(this.element);
514
- },
515
-
516
- onStart: function() {
517
- this.lastValue = Sortable.serialize(this.element);
518
- },
519
-
520
- onEnd: function() {
521
- Sortable.unmark();
522
- if(this.lastValue != Sortable.serialize(this.element))
523
- this.observer(this.element)
524
- }
525
- }
526
-
527
- var Sortable = {
528
- sortables: {},
529
-
530
- _findRootElement: function(element) {
531
- while (element.tagName != "BODY") {
532
- if(element.id && Sortable.sortables[element.id]) return element;
533
- element = element.parentNode;
534
- }
535
- },
536
-
537
- options: function(element) {
538
- element = Sortable._findRootElement($(element));
539
- if(!element) return;
540
- return Sortable.sortables[element.id];
541
- },
542
-
543
- destroy: function(element){
544
- var s = Sortable.options(element);
545
-
546
- if(s) {
547
- Draggables.removeObserver(s.element);
548
- s.droppables.each(function(d){ Droppables.remove(d) });
549
- s.draggables.invoke('destroy');
550
-
551
- delete Sortable.sortables[s.element.id];
552
- }
553
- },
554
-
555
- create: function(element) {
556
- element = $(element);
557
- var options = Object.extend({
558
- element: element,
559
- tag: 'li', // assumes li children, override with tag: 'tagname'
560
- dropOnEmpty: false,
561
- tree: false,
562
- treeTag: 'ul',
563
- overlap: 'vertical', // one of 'vertical', 'horizontal'
564
- constraint: 'vertical', // one of 'vertical', 'horizontal', false
565
- containment: element, // also takes array of elements (or id's); or false
566
- handle: false, // or a CSS class
567
- only: false,
568
- hoverclass: null,
569
- ghosting: false,
570
- scroll: false,
571
- scrollSensitivity: 20,
572
- scrollSpeed: 15,
573
- format: /^[^_]*_(.*)$/,
574
- onChange: Prototype.emptyFunction,
575
- onUpdate: Prototype.emptyFunction
576
- }, arguments[1] || {});
577
-
578
- // clear any old sortable with same element
579
- this.destroy(element);
580
-
581
- // build options for the draggables
582
- var options_for_draggable = {
583
- revert: true,
584
- scroll: options.scroll,
585
- scrollSpeed: options.scrollSpeed,
586
- scrollSensitivity: options.scrollSensitivity,
587
- ghosting: options.ghosting,
588
- constraint: options.constraint,
589
- handle: options.handle };
590
-
591
- if(options.starteffect)
592
- options_for_draggable.starteffect = options.starteffect;
593
-
594
- if(options.reverteffect)
595
- options_for_draggable.reverteffect = options.reverteffect;
596
- else
597
- if(options.ghosting) options_for_draggable.reverteffect = function(element) {
598
- element.style.top = 0;
599
- element.style.left = 0;
600
- };
601
-
602
- if(options.endeffect)
603
- options_for_draggable.endeffect = options.endeffect;
604
-
605
- if(options.zindex)
606
- options_for_draggable.zindex = options.zindex;
607
-
608
- // build options for the droppables
609
- var options_for_droppable = {
610
- overlap: options.overlap,
611
- containment: options.containment,
612
- tree: options.tree,
613
- hoverclass: options.hoverclass,
614
- onHover: Sortable.onHover
615
- //greedy: !options.dropOnEmpty
616
- }
617
-
618
- var options_for_tree = {
619
- onHover: Sortable.onEmptyHover,
620
- overlap: options.overlap,
621
- containment: options.containment,
622
- hoverclass: options.hoverclass
623
- }
624
-
625
- // fix for gecko engine
626
- Element.cleanWhitespace(element);
627
-
628
- options.draggables = [];
629
- options.droppables = [];
630
-
631
- // drop on empty handling
632
- if(options.dropOnEmpty || options.tree) {
633
- Droppables.add(element, options_for_tree);
634
- options.droppables.push(element);
635
- }
636
-
637
- (this.findElements(element, options) || []).each( function(e) {
638
- // handles are per-draggable
639
- var handle = options.handle ?
640
- Element.childrenWithClassName(e, options.handle)[0] : e;
641
- options.draggables.push(
642
- new Draggable(e, Object.extend(options_for_draggable, { handle: handle })));
643
- Droppables.add(e, options_for_droppable);
644
- if(options.tree) e.treeNode = element;
645
- options.droppables.push(e);
646
- });
647
-
648
- if(options.tree) {
649
- (Sortable.findTreeElements(element, options) || []).each( function(e) {
650
- Droppables.add(e, options_for_tree);
651
- e.treeNode = element;
652
- options.droppables.push(e);
653
- });
654
- }
655
-
656
- // keep reference
657
- this.sortables[element.id] = options;
658
-
659
- // for onupdate
660
- Draggables.addObserver(new SortableObserver(element, options.onUpdate));
661
-
662
- },
663
-
664
- // return all suitable-for-sortable elements in a guaranteed order
665
- findElements: function(element, options) {
666
- return Element.findChildren(
667
- element, options.only, options.tree ? true : false, options.tag);
668
- },
669
-
670
- findTreeElements: function(element, options) {
671
- return Element.findChildren(
672
- element, options.only, options.tree ? true : false, options.treeTag);
673
- },
674
-
675
- onHover: function(element, dropon, overlap) {
676
- if(Element.isParent(dropon, element)) return;
677
-
678
- if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) {
679
- return;
680
- } else if(overlap>0.5) {
681
- Sortable.mark(dropon, 'before');
682
- if(dropon.previousSibling != element) {
683
- var oldParentNode = element.parentNode;
684
- element.style.visibility = "hidden"; // fix gecko rendering
685
- dropon.parentNode.insertBefore(element, dropon);
686
- if(dropon.parentNode!=oldParentNode)
687
- Sortable.options(oldParentNode).onChange(element);
688
- Sortable.options(dropon.parentNode).onChange(element);
689
- }
690
- } else {
691
- Sortable.mark(dropon, 'after');
692
- var nextElement = dropon.nextSibling || null;
693
- if(nextElement != element) {
694
- var oldParentNode = element.parentNode;
695
- element.style.visibility = "hidden"; // fix gecko rendering
696
- dropon.parentNode.insertBefore(element, nextElement);
697
- if(dropon.parentNode!=oldParentNode)
698
- Sortable.options(oldParentNode).onChange(element);
699
- Sortable.options(dropon.parentNode).onChange(element);
700
- }
701
- }
702
- },
703
-
704
- onEmptyHover: function(element, dropon, overlap) {
705
- var oldParentNode = element.parentNode;
706
- var droponOptions = Sortable.options(dropon);
707
-
708
- if(!Element.isParent(dropon, element)) {
709
- var index;
710
-
711
- var children = Sortable.findElements(dropon, {tag: droponOptions.tag});
712
- var child = null;
713
-
714
- if(children) {
715
- var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap);
716
-
717
- for (index = 0; index < children.length; index += 1) {
718
- if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) {
719
- offset -= Element.offsetSize (children[index], droponOptions.overlap);
720
- } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) {
721
- child = index + 1 < children.length ? children[index + 1] : null;
722
- break;
723
- } else {
724
- child = children[index];
725
- break;
726
- }
727
- }
728
- }
729
-
730
- dropon.insertBefore(element, child);
731
-
732
- Sortable.options(oldParentNode).onChange(element);
733
- droponOptions.onChange(element);
734
- }
735
- },
736
-
737
- unmark: function() {
738
- if(Sortable._marker) Element.hide(Sortable._marker);
739
- },
740
-
741
- mark: function(dropon, position) {
742
- // mark on ghosting only
743
- var sortable = Sortable.options(dropon.parentNode);
744
- if(sortable && !sortable.ghosting) return;
745
-
746
- if(!Sortable._marker) {
747
- Sortable._marker = $('dropmarker') || document.createElement('DIV');
748
- Element.hide(Sortable._marker);
749
- Element.addClassName(Sortable._marker, 'dropmarker');
750
- Sortable._marker.style.position = 'absolute';
751
- document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
752
- }
753
- var offsets = Position.cumulativeOffset(dropon);
754
- Sortable._marker.style.left = offsets[0] + 'px';
755
- Sortable._marker.style.top = offsets[1] + 'px';
756
-
757
- if(position=='after')
758
- if(sortable.overlap == 'horizontal')
759
- Sortable._marker.style.left = (offsets[0]+dropon.clientWidth) + 'px';
760
- else
761
- Sortable._marker.style.top = (offsets[1]+dropon.clientHeight) + 'px';
762
-
763
- Element.show(Sortable._marker);
764
- },
765
-
766
- _tree: function(element, options, parent) {
767
- var children = Sortable.findElements(element, options) || [];
768
-
769
- for (var i = 0; i < children.length; ++i) {
770
- var match = children[i].id.match(options.format);
771
-
772
- if (!match) continue;
773
-
774
- var child = {
775
- id: encodeURIComponent(match ? match[1] : null),
776
- element: element,
777
- parent: parent,
778
- children: new Array,
779
- position: parent.children.length,
780
- container: Sortable._findChildrenElement(children[i], options.treeTag.toUpperCase())
781
- }
782
-
783
- /* Get the element containing the children and recurse over it */
784
- if (child.container)
785
- this._tree(child.container, options, child)
786
-
787
- parent.children.push (child);
788
- }
789
-
790
- return parent;
791
- },
792
-
793
- /* Finds the first element of the given tag type within a parent element.
794
- Used for finding the first LI[ST] within a L[IST]I[TEM].*/
795
- _findChildrenElement: function (element, containerTag) {
796
- if (element && element.hasChildNodes)
797
- for (var i = 0; i < element.childNodes.length; ++i)
798
- if (element.childNodes[i].tagName == containerTag)
799
- return element.childNodes[i];
800
-
801
- return null;
802
- },
803
-
804
- tree: function(element) {
805
- element = $(element);
806
- var sortableOptions = this.options(element);
807
- var options = Object.extend({
808
- tag: sortableOptions.tag,
809
- treeTag: sortableOptions.treeTag,
810
- only: sortableOptions.only,
811
- name: element.id,
812
- format: sortableOptions.format
813
- }, arguments[1] || {});
814
-
815
- var root = {
816
- id: null,
817
- parent: null,
818
- children: new Array,
819
- container: element,
820
- position: 0
821
- }
822
-
823
- return Sortable._tree (element, options, root);
824
- },
825
-
826
- /* Construct a [i] index for a particular node */
827
- _constructIndex: function(node) {
828
- var index = '';
829
- do {
830
- if (node.id) index = '[' + node.position + ']' + index;
831
- } while ((node = node.parent) != null);
832
- return index;
833
- },
834
-
835
- sequence: function(element) {
836
- element = $(element);
837
- var options = Object.extend(this.options(element), arguments[1] || {});
838
-
839
- return $(this.findElements(element, options) || []).map( function(item) {
840
- return item.id.match(options.format) ? item.id.match(options.format)[1] : '';
841
- });
842
- },
843
-
844
- setSequence: function(element, new_sequence) {
845
- element = $(element);
846
- var options = Object.extend(this.options(element), arguments[2] || {});
847
-
848
- var nodeMap = {};
849
- this.findElements(element, options).each( function(n) {
850
- if (n.id.match(options.format))
851
- nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode];
852
- n.parentNode.removeChild(n);
853
- });
854
-
855
- new_sequence.each(function(ident) {
856
- var n = nodeMap[ident];
857
- if (n) {
858
- n[1].appendChild(n[0]);
859
- delete nodeMap[ident];
860
- }
861
- });
862
- },
863
-
864
- serialize: function(element) {
865
- element = $(element);
866
- var options = Object.extend(Sortable.options(element), arguments[1] || {});
867
- var name = encodeURIComponent(
868
- (arguments[1] && arguments[1].name) ? arguments[1].name : element.id);
869
-
870
- if (options.tree) {
871
- return Sortable.tree(element, arguments[1]).children.map( function (item) {
872
- return [name + Sortable._constructIndex(item) + "=" +
873
- encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
874
- }).flatten().join('&');
875
- } else {
876
- return Sortable.sequence(element, arguments[1]).map( function(item) {
877
- return name + "[]=" + encodeURIComponent(item);
878
- }).join('&');
879
- }
880
- }
881
- }
882
-
883
- /* Returns true if child is contained within element */
884
- Element.isParent = function(child, element) {
885
- if (!child.parentNode || child == element) return false;
886
-
887
- if (child.parentNode == element) return true;
888
-
889
- return Element.isParent(child.parentNode, element);
890
- }
891
-
892
- Element.findChildren = function(element, only, recursive, tagName) {
893
- if(!element.hasChildNodes()) return null;
894
- tagName = tagName.toUpperCase();
895
- if(only) only = [only].flatten();
896
- var elements = [];
897
- $A(element.childNodes).each( function(e) {
898
- if(e.tagName && e.tagName.toUpperCase()==tagName &&
899
- (!only || (Element.classNames(e).detect(function(v) { return only.include(v) }))))
900
- elements.push(e);
901
- if(recursive) {
902
- var grandchildren = Element.findChildren(e, only, recursive, tagName);
903
- if(grandchildren) elements.push(grandchildren);
904
- }
905
- });
906
-
907
- return (elements.length>0 ? elements.flatten() : []);
908
- }
909
-
910
- Element.offsetSize = function (element, type) {
911
- if (type == 'vertical' || type == 'height')
912
- return element.offsetHeight;
913
- else
914
- return element.offsetWidth;
915
- }