webshims-rails 0.4.7 → 1.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +15 -0
  2. data/lib/webshims-rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/webshims/extras/custom-validity.js +1 -1
  4. data/vendor/assets/javascripts/webshims/extras/mousepress.js +1 -1
  5. data/vendor/assets/javascripts/webshims/polyfiller.js +197 -166
  6. data/vendor/assets/javascripts/webshims/shims/combos/1.js +1711 -1609
  7. data/vendor/assets/javascripts/webshims/shims/combos/10.js +2575 -2253
  8. data/vendor/assets/javascripts/webshims/shims/combos/11.js +2452 -1476
  9. data/vendor/assets/javascripts/webshims/shims/combos/12.js +1405 -1159
  10. data/vendor/assets/javascripts/webshims/shims/combos/13.js +1316 -963
  11. data/vendor/assets/javascripts/webshims/shims/combos/14.js +1862 -179
  12. data/vendor/assets/javascripts/webshims/shims/combos/15.js +4327 -287
  13. data/vendor/assets/javascripts/webshims/shims/combos/16.js +3887 -586
  14. data/vendor/assets/javascripts/webshims/shims/combos/17.js +2911 -2159
  15. data/vendor/assets/javascripts/webshims/shims/combos/18.js +3425 -1730
  16. data/vendor/assets/javascripts/webshims/shims/combos/19.js +2854 -1203
  17. data/vendor/assets/javascripts/webshims/shims/combos/2.js +3351 -2130
  18. data/vendor/assets/javascripts/webshims/shims/combos/20.js +2426 -581
  19. data/vendor/assets/javascripts/webshims/shims/combos/21.js +1915 -1574
  20. data/vendor/assets/javascripts/webshims/shims/combos/22.js +864 -2275
  21. data/vendor/assets/javascripts/webshims/shims/combos/23.js +609 -1811
  22. data/vendor/assets/javascripts/webshims/shims/combos/3.js +1655 -2736
  23. data/vendor/assets/javascripts/webshims/shims/combos/4.js +1037 -603
  24. data/vendor/assets/javascripts/webshims/shims/combos/5.js +3100 -773
  25. data/vendor/assets/javascripts/webshims/shims/combos/6.js +3631 -840
  26. data/vendor/assets/javascripts/webshims/shims/combos/7.js +3596 -1354
  27. data/vendor/assets/javascripts/webshims/shims/combos/8.js +1731 -188
  28. data/vendor/assets/javascripts/webshims/shims/combos/9.js +3243 -1431
  29. data/vendor/assets/javascripts/webshims/shims/dom-extend.js +107 -18
  30. data/vendor/assets/javascripts/webshims/shims/es5.js +1 -0
  31. data/vendor/assets/javascripts/webshims/shims/form-core.js +553 -464
  32. data/vendor/assets/javascripts/webshims/shims/form-datalist.js +160 -154
  33. data/vendor/assets/javascripts/webshims/shims/form-message.js +73 -49
  34. data/vendor/assets/javascripts/webshims/shims/form-native-extend.js +18 -1
  35. data/vendor/assets/javascripts/webshims/shims/form-number-date-api.js +161 -36
  36. data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +2130 -813
  37. data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +206 -58
  38. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-ar.js → formcfg-ar.js} +30 -0
  39. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-ch-ZN.js → formcfg-ch-ZN.js} +31 -0
  40. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-de.txt → formcfg-de.txt} +50 -11
  41. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-el.js → formcfg-el.js} +31 -0
  42. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-en.txt → formcfg-en.txt} +44 -11
  43. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-es.js → formcfg-es.js} +31 -0
  44. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-fr.js → formcfg-fr.js} +31 -0
  45. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-he.js → formcfg-he.js} +31 -0
  46. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-hi.js → formcfg-hi.js} +31 -0
  47. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-hu.js → formcfg-hu.js} +31 -0
  48. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-it.js → formcfg-it.js} +31 -0
  49. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-ja.js → formcfg-ja.js} +31 -0
  50. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-nl.js → formcfg-nl.js} +31 -0
  51. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-pt-PT.js → formcfg-pt-PT.js} +31 -0
  52. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-ru.js → formcfg-ru.js} +31 -0
  53. data/vendor/assets/javascripts/webshims/shims/i18n/{errormessages-sv.js → formcfg-sv.js} +32 -0
  54. data/vendor/assets/javascripts/webshims/shims/json-storage.js +16 -10
  55. data/vendor/assets/javascripts/webshims/shims/mediaelement-core.js +155 -122
  56. data/vendor/assets/javascripts/webshims/shims/mediaelement-jaris.js +76 -41
  57. data/vendor/assets/javascripts/webshims/shims/mediaelement-yt.js +8 -16
  58. data/vendor/assets/javascripts/webshims/shims/range-ui.js +388 -0
  59. data/vendor/assets/javascripts/webshims/shims/styles/config.rb +12 -0
  60. data/vendor/assets/javascripts/webshims/shims/styles/forms.png +0 -0
  61. data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +1186 -0
  62. data/vendor/assets/javascripts/webshims/shims/styles/shim.css +868 -548
  63. data/vendor/assets/javascripts/webshims/shims/styles/vertical-range.png +0 -0
  64. data/vendor/assets/javascripts/webshims/shims/swf/JarisFLVPlayer.swf +0 -0
  65. data/vendor/assets/javascripts/webshims/shims/swfmini.js +497 -0
  66. data/vendor/assets/javascripts/webshims/shims/track-ui.js +3 -0
  67. data/vendor/assets/javascripts/webshims/shims/track.js +29 -29
  68. metadata +26 -125
  69. data/vendor/assets/javascripts/webshims/minified/extras/custom-validity.js +0 -1
  70. data/vendor/assets/javascripts/webshims/minified/extras/modernizr-custom.js +0 -1
  71. data/vendor/assets/javascripts/webshims/minified/extras/mousepress.js +0 -1
  72. data/vendor/assets/javascripts/webshims/minified/polyfiller.js +0 -1
  73. data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvas/canvas2png.js +0 -1
  74. data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvas/flashcanvas.js +0 -1
  75. data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvas/flashcanvas.swf +0 -0
  76. data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvas/proxy.php +0 -73
  77. data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvas/save.php +0 -49
  78. data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvasPro/canvas2png.js +0 -1
  79. data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvasPro/flash10canvas.swf +0 -0
  80. data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvasPro/flash9canvas.swf +0 -0
  81. data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvasPro/flashcanvas.js +0 -1
  82. data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvasPro/proxy.php +0 -73
  83. data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvasPro/save.php +0 -49
  84. data/vendor/assets/javascripts/webshims/minified/shims/combos/1.js +0 -1
  85. data/vendor/assets/javascripts/webshims/minified/shims/combos/10.js +0 -1
  86. data/vendor/assets/javascripts/webshims/minified/shims/combos/11.js +0 -1
  87. data/vendor/assets/javascripts/webshims/minified/shims/combos/12.js +0 -1
  88. data/vendor/assets/javascripts/webshims/minified/shims/combos/13.js +0 -1
  89. data/vendor/assets/javascripts/webshims/minified/shims/combos/14.js +0 -1
  90. data/vendor/assets/javascripts/webshims/minified/shims/combos/15.js +0 -1
  91. data/vendor/assets/javascripts/webshims/minified/shims/combos/16.js +0 -1
  92. data/vendor/assets/javascripts/webshims/minified/shims/combos/17.js +0 -1
  93. data/vendor/assets/javascripts/webshims/minified/shims/combos/18.js +0 -1
  94. data/vendor/assets/javascripts/webshims/minified/shims/combos/19.js +0 -1
  95. data/vendor/assets/javascripts/webshims/minified/shims/combos/2.js +0 -1
  96. data/vendor/assets/javascripts/webshims/minified/shims/combos/20.js +0 -1
  97. data/vendor/assets/javascripts/webshims/minified/shims/combos/21.js +0 -1
  98. data/vendor/assets/javascripts/webshims/minified/shims/combos/22.js +0 -1
  99. data/vendor/assets/javascripts/webshims/minified/shims/combos/23.js +0 -1
  100. data/vendor/assets/javascripts/webshims/minified/shims/combos/24.js +0 -1
  101. data/vendor/assets/javascripts/webshims/minified/shims/combos/25.js +0 -1
  102. data/vendor/assets/javascripts/webshims/minified/shims/combos/26.js +0 -1
  103. data/vendor/assets/javascripts/webshims/minified/shims/combos/27.js +0 -1
  104. data/vendor/assets/javascripts/webshims/minified/shims/combos/3.js +0 -1
  105. data/vendor/assets/javascripts/webshims/minified/shims/combos/4.js +0 -1
  106. data/vendor/assets/javascripts/webshims/minified/shims/combos/5.js +0 -1
  107. data/vendor/assets/javascripts/webshims/minified/shims/combos/59.js +0 -1
  108. data/vendor/assets/javascripts/webshims/minified/shims/combos/6.js +0 -1
  109. data/vendor/assets/javascripts/webshims/minified/shims/combos/7.js +0 -1
  110. data/vendor/assets/javascripts/webshims/minified/shims/combos/8.js +0 -1
  111. data/vendor/assets/javascripts/webshims/minified/shims/combos/9.js +0 -1
  112. data/vendor/assets/javascripts/webshims/minified/shims/details.js +0 -1
  113. data/vendor/assets/javascripts/webshims/minified/shims/dom-extend.js +0 -1
  114. data/vendor/assets/javascripts/webshims/minified/shims/es5.js +0 -1
  115. data/vendor/assets/javascripts/webshims/minified/shims/excanvas.js +0 -1
  116. data/vendor/assets/javascripts/webshims/minified/shims/form-core.js +0 -1
  117. data/vendor/assets/javascripts/webshims/minified/shims/form-datalist.js +0 -1
  118. data/vendor/assets/javascripts/webshims/minified/shims/form-message.js +0 -1
  119. data/vendor/assets/javascripts/webshims/minified/shims/form-native-extend.js +0 -1
  120. data/vendor/assets/javascripts/webshims/minified/shims/form-number-date-api.js +0 -1
  121. data/vendor/assets/javascripts/webshims/minified/shims/form-number-date-ui.js +0 -1
  122. data/vendor/assets/javascripts/webshims/minified/shims/form-shim-extend.js +0 -1
  123. data/vendor/assets/javascripts/webshims/minified/shims/geolocation.js +0 -1
  124. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-ar.js +0 -1
  125. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-ch-ZN.js +0 -1
  126. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-de.txt +0 -33
  127. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-el.js +0 -1
  128. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-en.txt +0 -34
  129. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-es.js +0 -1
  130. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-fr.js +0 -1
  131. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-he.js +0 -1
  132. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-hi.js +0 -1
  133. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-hu.js +0 -1
  134. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-it.js +0 -1
  135. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-ja.js +0 -1
  136. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-nl.js +0 -1
  137. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-pt-PT.js +0 -1
  138. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-ru.js +0 -1
  139. data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-sv.js +0 -1
  140. data/vendor/assets/javascripts/webshims/minified/shims/json-storage.js +0 -1
  141. data/vendor/assets/javascripts/webshims/minified/shims/jwplayer/license.txt +0 -1
  142. data/vendor/assets/javascripts/webshims/minified/shims/jwplayer/player.swf +0 -0
  143. data/vendor/assets/javascripts/webshims/minified/shims/jwplayer/readme.html +0 -87
  144. data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-core.js +0 -1
  145. data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-jaris.js +0 -1
  146. data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-native-fix.js +0 -1
  147. data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-swf.js +0 -1
  148. data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-yt.js +0 -1
  149. data/vendor/assets/javascripts/webshims/minified/shims/styles/details-arrows.png +0 -0
  150. data/vendor/assets/javascripts/webshims/minified/shims/styles/forms.png +0 -0
  151. data/vendor/assets/javascripts/webshims/minified/shims/styles/polyfill-loader.gif +0 -0
  152. data/vendor/assets/javascripts/webshims/minified/shims/styles/shim.css +0 -1
  153. data/vendor/assets/javascripts/webshims/minified/shims/swf/JarisFLVPlayer.swf +0 -0
  154. data/vendor/assets/javascripts/webshims/minified/shims/swf/jwwebshims.swf +0 -0
  155. data/vendor/assets/javascripts/webshims/minified/shims/swf/localStorage.swf +0 -0
  156. data/vendor/assets/javascripts/webshims/minified/shims/track-ui.js +0 -1
  157. data/vendor/assets/javascripts/webshims/minified/shims/track.js +0 -1
  158. data/vendor/assets/javascripts/webshims/shims/FlashCanvas/README +0 -62
  159. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/README +0 -82
  160. data/vendor/assets/javascripts/webshims/shims/combos/24.js +0 -2872
  161. data/vendor/assets/javascripts/webshims/shims/combos/25.js +0 -2376
  162. data/vendor/assets/javascripts/webshims/shims/combos/26.js +0 -3009
  163. data/vendor/assets/javascripts/webshims/shims/combos/27.js +0 -4150
  164. data/vendor/assets/javascripts/webshims/shims/combos/59.js +0 -1747
  165. data/vendor/assets/javascripts/webshims/shims/jwplayer/license.txt +0 -1
  166. data/vendor/assets/javascripts/webshims/shims/jwplayer/player.swf +0 -0
  167. data/vendor/assets/javascripts/webshims/shims/jwplayer/readme.html +0 -87
  168. data/vendor/assets/javascripts/webshims/shims/mediaelement-swf.js +0 -972
@@ -1,3 +1,1849 @@
1
+ // vim: ts=4 sts=4 sw=4 expandtab
2
+ // -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
3
+ // -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
4
+ // -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
5
+ // -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
6
+ // -- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
7
+ // -- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
8
+ // -- kossnocorp Sasha Koss XXX TODO License or CLA
9
+ // -- bryanforbes Bryan Forbes XXX TODO License or CLA
10
+ // -- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
11
+ // -- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD License
12
+ // -- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
13
+ // -- bbqsrc Brendan Molloy XXX TODO License or CLA
14
+ // -- iwyg XXX TODO License or CLA
15
+ // -- DomenicDenicola Domenic Denicola XXX TODO License or CLA
16
+ // -- xavierm02 Montillet Xavier XXX TODO License or CLA
17
+ // -- Raynos Raynos XXX TODO License or CLA
18
+ // -- samsonjs Sami Samhuri XXX TODO License or CLA
19
+ // -- rwldrn Rick Waldron Copyright (C) 2011 MIT License
20
+ // -- lexer Alexey Zakharov XXX TODO License or CLA
21
+
22
+ /*!
23
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
24
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
25
+ */
26
+
27
+ (function (undefined) {
28
+
29
+ /**
30
+ * Brings an environment as close to ECMAScript 5 compliance
31
+ * as is possible with the facilities of erstwhile engines.
32
+ *
33
+ * ES5 Draft
34
+ * http://www.ecma-international.org/publications/files/drafts/tc39-2009-050.pdf
35
+ *
36
+ * NOTE: this is a draft, and as such, the URL is subject to change. If the
37
+ * link is broken, check in the parent directory for the latest TC39 PDF.
38
+ * http://www.ecma-international.org/publications/files/drafts/
39
+ *
40
+ * Previous ES5 Draft
41
+ * http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf
42
+ * This is a broken link to the previous draft of ES5 on which most of the
43
+ * numbered specification references and quotes herein were taken. Updating
44
+ * these references and quotes to reflect the new document would be a welcome
45
+ * volunteer project.
46
+ *
47
+ * @module
48
+ */
49
+
50
+ /*whatsupdoc*/
51
+
52
+ // Shortcut to an often accessed properties, in order to avoid multiple
53
+ // dereference that costs universally.
54
+ // _Please note: Shortcuts are defined after `Function.prototype.bind` as we
55
+ // us it in defining shortcuts.
56
+ var call = Function.prototype.call;
57
+ var prototypeOfArray = Array.prototype;
58
+ var prototypeOfObject = Object.prototype;
59
+ var slice = prototypeOfArray.slice;
60
+ var owns;
61
+ var toString;
62
+
63
+ // ES-5 15.3.4.5
64
+ // http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf
65
+
66
+ if (!Function.prototype.bind) {
67
+ Function.prototype.bind = function (that) { // .length is 1
68
+ // 1. Let Target be the this value.
69
+ var target = this;
70
+ // 2. If IsCallable(Target) is false, throw a TypeError exception.
71
+ if (typeof target != "function")
72
+ throw new TypeError(); // TODO message
73
+ // 3. Let A be a new (possibly empty) internal list of all of the
74
+ // argument values provided after thisArg (arg1, arg2 etc), in order.
75
+ // XXX slicedArgs will stand in for "A" if used
76
+ var args = slice.call(arguments, 1); // for normal call
77
+ // 4. Let F be a new native ECMAScript object.
78
+ // 9. Set the [[Prototype]] internal property of F to the standard
79
+ // built-in Function prototype object as specified in 15.3.3.1.
80
+ // 10. Set the [[Call]] internal property of F as described in
81
+ // 15.3.4.5.1.
82
+ // 11. Set the [[Construct]] internal property of F as described in
83
+ // 15.3.4.5.2.
84
+ // 12. Set the [[HasInstance]] internal property of F as described in
85
+ // 15.3.4.5.3.
86
+ // 13. The [[Scope]] internal property of F is unused and need not
87
+ // exist.
88
+ var bound = function () {
89
+
90
+ if (this instanceof bound) {
91
+ // 15.3.4.5.2 [[Construct]]
92
+ // When the [[Construct]] internal method of a function object,
93
+ // F that was created using the bind function is called with a
94
+ // list of arguments ExtraArgs the following steps are taken:
95
+ // 1. Let target be the value of F's [[TargetFunction]]
96
+ // internal property.
97
+ // 2. If target has no [[Construct]] internal method, a
98
+ // TypeError exception is thrown.
99
+ // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
100
+ // property.
101
+ // 4. Let args be a new list containing the same values as the
102
+ // list boundArgs in the same order followed by the same
103
+ // values as the list ExtraArgs in the same order.
104
+
105
+ var F = function(){};
106
+ F.prototype = target.prototype;
107
+ var self = new F;
108
+
109
+ var result = target.apply(
110
+ self,
111
+ args.concat(slice.call(arguments))
112
+ );
113
+ if (result !== null && Object(result) === result)
114
+ return result;
115
+ return self;
116
+
117
+ } else {
118
+ // 15.3.4.5.1 [[Call]]
119
+ // When the [[Call]] internal method of a function object, F,
120
+ // which was created using the bind function is called with a
121
+ // this value and a list of arguments ExtraArgs the following
122
+ // steps are taken:
123
+ // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
124
+ // property.
125
+ // 2. Let boundThis be the value of F's [[BoundThis]] internal
126
+ // property.
127
+ // 3. Let target be the value of F's [[TargetFunction]] internal
128
+ // property.
129
+ // 4. Let args be a new list containing the same values as the list
130
+ // boundArgs in the same order followed by the same values as
131
+ // the list ExtraArgs in the same order. 5. Return the
132
+ // result of calling the [[Call]] internal method of target
133
+ // providing boundThis as the this value and providing args
134
+ // as the arguments.
135
+
136
+ // equiv: target.call(this, ...boundArgs, ...args)
137
+ return target.apply(
138
+ that,
139
+ args.concat(slice.call(arguments))
140
+ );
141
+
142
+ }
143
+
144
+ };
145
+ // XXX bound.length is never writable, so don't even try
146
+ //
147
+ // 16. The length own property of F is given attributes as specified in
148
+ // 15.3.5.1.
149
+ // TODO
150
+ // 17. Set the [[Extensible]] internal property of F to true.
151
+ // TODO
152
+ // 18. Call the [[DefineOwnProperty]] internal method of F with
153
+ // arguments "caller", PropertyDescriptor {[[Value]]: null,
154
+ // [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]:
155
+ // false}, and false.
156
+ // TODO
157
+ // 19. Call the [[DefineOwnProperty]] internal method of F with
158
+ // arguments "arguments", PropertyDescriptor {[[Value]]: null,
159
+ // [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]:
160
+ // false}, and false.
161
+ // TODO
162
+ // NOTE Function objects created using Function.prototype.bind do not
163
+ // have a prototype property.
164
+ // XXX can't delete it in pure-js.
165
+ return bound;
166
+ };
167
+ }
168
+
169
+ toString = call.bind(prototypeOfObject.toString);
170
+ owns = call.bind(prototypeOfObject.hasOwnProperty);
171
+
172
+
173
+ //
174
+ // Array
175
+ // =====
176
+ //
177
+
178
+ // ES5 15.4.3.2
179
+ if (!Array.isArray) {
180
+ Array.isArray = function (obj) {
181
+ return toString(obj) == "[object Array]";
182
+ };
183
+ }
184
+
185
+ // The IsCallable() check in the Array functions
186
+ // has been replaced with a strict check on the
187
+ // internal class of the object to trap cases where
188
+ // the provided function was actually a regular
189
+ // expression literal, which in V8 and
190
+ // JavaScriptCore is a typeof "function". Only in
191
+ // V8 are regular expression literals permitted as
192
+ // reduce parameters, so it is desirable in the
193
+ // general case for the shim to match the more
194
+ // strict and common behavior of rejecting regular
195
+ // expressions.
196
+
197
+ // ES5 15.4.4.18
198
+ // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/foreach
199
+ if (!Array.prototype.forEach) {
200
+ Array.prototype.forEach = function (fun /*, thisp*/) {
201
+ var self = toObject(this),
202
+ thisp = arguments[1],
203
+ i = 0,
204
+ length = self.length >>> 0;
205
+
206
+ // If no callback function or if callback is not a callable function
207
+ if (toString(fun) != "[object Function]") {
208
+ throw new TypeError(); // TODO message
209
+ }
210
+
211
+ while (i < length) {
212
+ if (i in self) {
213
+ // Invoke the callback function with call, passing arguments:
214
+ // context, property value, property key, thisArg object context
215
+ fun.call(thisp, self[i], i, self);
216
+ }
217
+ i++;
218
+ }
219
+ };
220
+ }
221
+
222
+ // ES5 15.4.4.19
223
+ // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
224
+ if (!Array.prototype.map) {
225
+ Array.prototype.map = function (fun /*, thisp*/) {
226
+ var self = toObject(this),
227
+ length = self.length >>> 0,
228
+ result = Array(length),
229
+ thisp = arguments[1];
230
+
231
+ // If no callback function or if callback is not a callable function
232
+ if (toString(fun) != "[object Function]") {
233
+ throw new TypeError(); // TODO message
234
+ }
235
+
236
+ for (var i = 0; i < length; i++) {
237
+ if (i in self)
238
+ result[i] = fun.call(thisp, self[i], i, self);
239
+ }
240
+ return result;
241
+ };
242
+ }
243
+
244
+ // ES5 15.4.4.20
245
+ if (!Array.prototype.filter) {
246
+ Array.prototype.filter = function (fun /*, thisp */) {
247
+ var self = toObject(this),
248
+ length = self.length >>> 0,
249
+ result = [],
250
+ thisp = arguments[1];
251
+
252
+ // If no callback function or if callback is not a callable function
253
+ if (toString(fun) != "[object Function]") {
254
+ throw new TypeError(); // TODO message
255
+ }
256
+
257
+ for (var i = 0; i < length; i++) {
258
+ if (i in self && fun.call(thisp, self[i], i, self))
259
+ result.push(self[i]);
260
+ }
261
+ return result;
262
+ };
263
+ }
264
+
265
+ // ES5 15.4.4.16
266
+ if (!Array.prototype.every) {
267
+ Array.prototype.every = function (fun /*, thisp */) {
268
+ var self = toObject(this),
269
+ length = self.length >>> 0,
270
+ thisp = arguments[1];
271
+
272
+ // If no callback function or if callback is not a callable function
273
+ if (toString(fun) != "[object Function]") {
274
+ throw new TypeError(); // TODO message
275
+ }
276
+
277
+ for (var i = 0; i < length; i++) {
278
+ if (i in self && !fun.call(thisp, self[i], i, self))
279
+ return false;
280
+ }
281
+ return true;
282
+ };
283
+ }
284
+
285
+ // ES5 15.4.4.17
286
+ // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
287
+ if (!Array.prototype.some) {
288
+ Array.prototype.some = function (fun /*, thisp */) {
289
+ var self = toObject(this),
290
+ length = self.length >>> 0,
291
+ thisp = arguments[1];
292
+
293
+ // If no callback function or if callback is not a callable function
294
+ if (toString(fun) != "[object Function]") {
295
+ throw new TypeError(); // TODO message
296
+ }
297
+
298
+ for (var i = 0; i < length; i++) {
299
+ if (i in self && fun.call(thisp, self[i], i, self))
300
+ return true;
301
+ }
302
+ return false;
303
+ };
304
+ }
305
+
306
+ // ES5 15.4.4.21
307
+ // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
308
+ if (!Array.prototype.reduce) {
309
+ Array.prototype.reduce = function (fun /*, initial*/) {
310
+ var self = toObject(this),
311
+ length = self.length >>> 0;
312
+
313
+ // If no callback function or if callback is not a callable function
314
+ if (toString(fun) != "[object Function]") {
315
+ throw new TypeError(); // TODO message
316
+ }
317
+
318
+ // no value to return if no initial value and an empty array
319
+ if (!length && arguments.length == 1)
320
+ throw new TypeError(); // TODO message
321
+
322
+ var i = 0;
323
+ var result;
324
+ if (arguments.length >= 2) {
325
+ result = arguments[1];
326
+ } else {
327
+ do {
328
+ if (i in self) {
329
+ result = self[i++];
330
+ break;
331
+ }
332
+
333
+ // if array contains no values, no initial value to return
334
+ if (++i >= length)
335
+ throw new TypeError(); // TODO message
336
+ } while (true);
337
+ }
338
+
339
+ for (; i < length; i++) {
340
+ if (i in self)
341
+ result = fun.call(void 0, result, self[i], i, self);
342
+ }
343
+
344
+ return result;
345
+ };
346
+ }
347
+
348
+ // ES5 15.4.4.22
349
+ // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
350
+ if (!Array.prototype.reduceRight) {
351
+ Array.prototype.reduceRight = function (fun /*, initial*/) {
352
+ var self = toObject(this),
353
+ length = self.length >>> 0;
354
+
355
+ // If no callback function or if callback is not a callable function
356
+ if (toString(fun) != "[object Function]") {
357
+ throw new TypeError(); // TODO message
358
+ }
359
+
360
+ // no value to return if no initial value, empty array
361
+ if (!length && arguments.length == 1)
362
+ throw new TypeError(); // TODO message
363
+
364
+ var result, i = length - 1;
365
+ if (arguments.length >= 2) {
366
+ result = arguments[1];
367
+ } else {
368
+ do {
369
+ if (i in self) {
370
+ result = self[i--];
371
+ break;
372
+ }
373
+
374
+ // if array contains no values, no initial value to return
375
+ if (--i < 0)
376
+ throw new TypeError(); // TODO message
377
+ } while (true);
378
+ }
379
+
380
+ do {
381
+ if (i in this)
382
+ result = fun.call(void 0, result, self[i], i, self);
383
+ } while (i--);
384
+
385
+ return result;
386
+ };
387
+ }
388
+
389
+ // ES5 15.4.4.14
390
+ // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
391
+ if (!Array.prototype.indexOf) {
392
+ Array.prototype.indexOf = function (sought /*, fromIndex */ ) {
393
+ var self = toObject(this),
394
+ length = self.length >>> 0;
395
+
396
+ if (!length)
397
+ return -1;
398
+
399
+ var i = 0;
400
+ if (arguments.length > 1)
401
+ i = toInteger(arguments[1]);
402
+
403
+ // handle negative indices
404
+ i = i >= 0 ? i : length - Math.abs(i);
405
+ for (; i < length; i++) {
406
+ if (i in self && self[i] === sought) {
407
+ return i;
408
+ }
409
+ }
410
+ return -1;
411
+ };
412
+ }
413
+
414
+ // ES5 15.4.4.15
415
+ if (!Array.prototype.lastIndexOf) {
416
+ Array.prototype.lastIndexOf = function (sought /*, fromIndex */) {
417
+ var self = toObject(this),
418
+ length = self.length >>> 0;
419
+
420
+ if (!length)
421
+ return -1;
422
+ var i = length - 1;
423
+ if (arguments.length > 1)
424
+ i = toInteger(arguments[1]);
425
+ // handle negative indices
426
+ i = i >= 0 ? i : length - Math.abs(i);
427
+ for (; i >= 0; i--) {
428
+ if (i in self && sought === self[i])
429
+ return i;
430
+ }
431
+ return -1;
432
+ };
433
+ }
434
+
435
+ //
436
+ // Array
437
+ // =====
438
+ //
439
+
440
+ // ES5 15.4.4.12
441
+ // http://es5.github.com/#x15.4.4.12
442
+ // Default value for second param
443
+ // [bugfix, ielt9, old browsers]
444
+ // IE < 9 bug: [1,2].splice(0).join("") == "" but should be "12"
445
+ if([1,2].splice(0).length != 2) {
446
+ var _origArraySplice = Array.prototype.splice;
447
+
448
+ Array.prototype.splice = function(start, deleteCount) {
449
+ if(!arguments.length)return [];
450
+
451
+ return _origArraySplice.apply(this, [
452
+ start === void 0 ? 0 : start,
453
+ deleteCount === void 0 ? (this.length - start) : deleteCount
454
+ ].concat(slice.call(arguments, 2)))
455
+ };
456
+ }
457
+
458
+ //
459
+ // Object
460
+ // ======
461
+ //
462
+
463
+
464
+ // ES5 15.2.3.14
465
+ // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
466
+ if (!Object.keys) {
467
+
468
+ var hasDontEnumBug = true,
469
+ dontEnums = [
470
+ "toString",
471
+ "toLocaleString",
472
+ "valueOf",
473
+ "hasOwnProperty",
474
+ "isPrototypeOf",
475
+ "propertyIsEnumerable",
476
+ "constructor"
477
+ ],
478
+ dontEnumsLength = dontEnums.length;
479
+
480
+ for (var key in {"toString": null})
481
+ hasDontEnumBug = false;
482
+
483
+ Object.keys = function keys(object) {
484
+
485
+ if ((typeof object != "object" && typeof object != "function") || object === null)
486
+ throw new TypeError("Object.keys called on a non-object");
487
+
488
+ var keys = [];
489
+ for (var name in object) {
490
+ if (owns(object, name)) {
491
+ keys.push(name);
492
+ }
493
+ }
494
+
495
+ if (hasDontEnumBug) {
496
+ for (var i = 0, ii = dontEnumsLength; i < ii; i++) {
497
+ var dontEnum = dontEnums[i];
498
+ if (owns(object, dontEnum)) {
499
+ keys.push(dontEnum);
500
+ }
501
+ }
502
+ }
503
+
504
+ return keys;
505
+ };
506
+
507
+ }
508
+
509
+ //
510
+ // Date
511
+ // ====
512
+ //
513
+
514
+ // ES5 15.9.5.43
515
+ // Format a Date object as a string according to a simplified subset of the ISO 8601
516
+ // standard as defined in 15.9.1.15.
517
+ if (!Date.prototype.toISOString) {
518
+ Date.prototype.toISOString = function toISOString() {
519
+ var result, length, value;
520
+ if (!isFinite(this))
521
+ throw new RangeError;
522
+
523
+ // the date time string format is specified in 15.9.1.15.
524
+ result = [this.getUTCFullYear(), this.getUTCMonth() + 1, this.getUTCDate(),
525
+ this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()];
526
+
527
+ length = result.length;
528
+ while (length--) {
529
+ value = result[length];
530
+ // pad months, days, hours, minutes, and seconds to have two digits.
531
+ if (value < 10)
532
+ result[length] = "0" + value;
533
+ }
534
+ // pad milliseconds to have three digits.
535
+ return result.slice(0, 3).join("-") + "T" + result.slice(3).join(":") + "." +
536
+ ("000" + this.getUTCMilliseconds()).slice(-3) + "Z";
537
+ }
538
+ }
539
+
540
+ // ES5 15.9.4.4
541
+ if (!Date.now) {
542
+ Date.now = function now() {
543
+ return new Date().getTime();
544
+ };
545
+ }
546
+
547
+ // ES5 15.9.5.44
548
+ if (!Date.prototype.toJSON) {
549
+ Date.prototype.toJSON = function toJSON(key) {
550
+ // This function provides a String representation of a Date object for
551
+ // use by JSON.stringify (15.12.3). When the toJSON method is called
552
+ // with argument key, the following steps are taken:
553
+
554
+ // 1. Let O be the result of calling ToObject, giving it the this
555
+ // value as its argument.
556
+ // 2. Let tv be ToPrimitive(O, hint Number).
557
+ // 3. If tv is a Number and is not finite, return null.
558
+ // XXX
559
+ // 4. Let toISO be the result of calling the [[Get]] internal method of
560
+ // O with argument "toISOString".
561
+ // 5. If IsCallable(toISO) is false, throw a TypeError exception.
562
+ if (typeof this.toISOString != "function")
563
+ throw new TypeError(); // TODO message
564
+ // 6. Return the result of calling the [[Call]] internal method of
565
+ // toISO with O as the this value and an empty argument list.
566
+ return this.toISOString();
567
+
568
+ // NOTE 1 The argument is ignored.
569
+
570
+ // NOTE 2 The toJSON function is intentionally generic; it does not
571
+ // require that its this value be a Date object. Therefore, it can be
572
+ // transferred to other kinds of objects for use as a method. However,
573
+ // it does require that any such object have a toISOString method. An
574
+ // object is free to use the argument key to filter its
575
+ // stringification.
576
+ };
577
+ }
578
+
579
+
580
+ //
581
+ // String
582
+ // ======
583
+ //
584
+
585
+ // ES5 15.5.4.20
586
+ var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
587
+ "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
588
+ "\u2029\uFEFF";
589
+ if (!String.prototype.trim || ws.trim()) {
590
+ // http://blog.stevenlevithan.com/archives/faster-trim-javascript
591
+ // http://perfectionkills.com/whitespace-deviations/
592
+ ws = "[" + ws + "]";
593
+ var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
594
+ trimEndRegexp = new RegExp(ws + ws + "*$");
595
+ String.prototype.trim = function trim() {
596
+ return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
597
+ };
598
+ }
599
+
600
+ // ES5 15.5.4.14
601
+ // http://es5.github.com/#x15.5.4.14
602
+ // [bugfix, chrome]
603
+ // If separator is undefined, then the result array contains just one String, which is the this value (converted to a String). If limit is not undefined, then the output array is truncated so that it contains no more than limit elements.
604
+ // "0".split(undefined, 0) -> []
605
+ if("0".split(void 0, 0).length) {
606
+ var oldSplit = String.prototype.split;
607
+ String.prototype.split = function(separator, limit) {
608
+ if(separator === void 0 && limit === 0)return [];
609
+ return oldSplit.apply(this, arguments);
610
+ }
611
+ }
612
+
613
+ // ECMA-262, 3rd B.2.3
614
+ // Note an ECMAScript standart, although ECMAScript 3rd Edition has a non-normative section suggesting uniform semantics
615
+ // and it should be normalized across all browsers
616
+ // [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE
617
+ if("".substr && "0b".substr(-1) !== "b") {
618
+ var oldSubstr = String.prototype.substr;
619
+ /**
620
+ * Get the substring of a string
621
+ * @param {integer} start where to start the substring
622
+ * @param {integer} length how many characters to return
623
+ * @return {string}
624
+ */
625
+ String.prototype.substr = function(start, length) {
626
+ return oldSubstr.call(this, start < 0 ? (start = this.length + start) < 0 ? 0 : start : start, length);
627
+ }
628
+ }
629
+
630
+ //
631
+ // Util
632
+ // ======
633
+ //
634
+
635
+ // http://jsperf.com/to-integer
636
+ var toInteger = function (n) {
637
+ n = +n;
638
+ if (n !== n) // isNaN
639
+ n = -1;
640
+ else if (n !== 0 && n !== (1/0) && n !== -(1/0))
641
+ n = (n > 0 || -1) * Math.floor(Math.abs(n));
642
+ return n;
643
+ };
644
+
645
+ var prepareString = "a"[0] != "a",
646
+ // ES5 9.9
647
+ toObject = function (o) {
648
+ if (o == null) { // this matches both null and undefined
649
+ throw new TypeError(); // TODO message
650
+ }
651
+ // If the implementation doesn't support by-index access of
652
+ // string characters (ex. IE < 7), split the string
653
+ if (prepareString && typeof o == "string" && o) {
654
+ return o.split("");
655
+ }
656
+ return Object(o);
657
+ };
658
+
659
+ })();
660
+
661
+
662
+
663
+ (function($, shims){
664
+ var defineProperty = 'defineProperty';
665
+ var advancedObjectProperties = !!(Object.create && Object.defineProperties && Object.getOwnPropertyDescriptor);
666
+ //safari5 has defineProperty-interface, but it can't be used on dom-object
667
+ //only do this test in non-IE browsers, because this hurts dhtml-behavior in some IE8 versions
668
+ if (advancedObjectProperties && Object[defineProperty] && Object.prototype.__defineGetter__) {
669
+ (function(){
670
+ try {
671
+ var foo = document.createElement('foo');
672
+ Object[defineProperty](foo, 'bar', {
673
+ get: function(){
674
+ return true;
675
+ }
676
+ });
677
+ advancedObjectProperties = !!foo.bar;
678
+ }
679
+ catch (e) {
680
+ advancedObjectProperties = false;
681
+ }
682
+ foo = null;
683
+ })();
684
+ }
685
+
686
+ Modernizr.objectAccessor = !!((advancedObjectProperties || (Object.prototype.__defineGetter__ && Object.prototype.__lookupSetter__)));
687
+ Modernizr.advancedObjectProperties = advancedObjectProperties;
688
+
689
+ if((!advancedObjectProperties || !Object.create || !Object.defineProperties || !Object.getOwnPropertyDescriptor || !Object.defineProperty)){
690
+ var call = Function.prototype.call;
691
+ var prototypeOfObject = Object.prototype;
692
+ var owns = call.bind(prototypeOfObject.hasOwnProperty);
693
+
694
+ shims.objectCreate = function(proto, props, opts, no__proto__){
695
+ var o;
696
+ var f = function(){};
697
+
698
+ f.prototype = proto;
699
+ o = new f();
700
+
701
+ if(!no__proto__ && !('__proto__' in o) && !Modernizr.objectAccessor){
702
+ o.__proto__ = proto;
703
+ }
704
+
705
+ if(props){
706
+ shims.defineProperties(o, props);
707
+ }
708
+
709
+ if(opts){
710
+ o.options = jQuery.extend(true, {}, o.options || {}, opts);
711
+ opts = o.options;
712
+ }
713
+
714
+ if(o._create && jQuery.isFunction(o._create)){
715
+ o._create(opts);
716
+ }
717
+ return o;
718
+ };
719
+
720
+ shims.defineProperties = function(object, props){
721
+ for (var name in props) {
722
+ if (owns(props, name)) {
723
+ shims.defineProperty(object, name, props[name]);
724
+ }
725
+ }
726
+ return object;
727
+ };
728
+
729
+ var descProps = ['configurable', 'enumerable', 'writable'];
730
+ shims.defineProperty = function(proto, property, descriptor){
731
+ if(typeof descriptor != "object" || descriptor === null){return proto;}
732
+
733
+ if(owns(descriptor, "value")){
734
+ proto[property] = descriptor.value;
735
+ return proto;
736
+ }
737
+
738
+ if(proto.__defineGetter__){
739
+ if (typeof descriptor.get == "function") {
740
+ proto.__defineGetter__(property, descriptor.get);
741
+ }
742
+ if (typeof descriptor.set == "function"){
743
+ proto.__defineSetter__(property, descriptor.set);
744
+ }
745
+ }
746
+ return proto;
747
+ };
748
+
749
+ shims.getPrototypeOf = function (object) {
750
+ return Object.getPrototypeOf && Object.getPrototypeOf(object) || object.__proto__ || object.constructor && object.constructor.prototype;
751
+ };
752
+
753
+ //based on http://www.refactory.org/s/object_getownpropertydescriptor/view/latest
754
+ shims.getOwnPropertyDescriptor = function(obj, prop){
755
+ if (typeof obj !== "object" && typeof obj !== "function" || obj === null){
756
+ throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object");
757
+ }
758
+ var descriptor;
759
+ if(Object.defineProperty && Object.getOwnPropertyDescriptor){
760
+ try{
761
+ descriptor = Object.getOwnPropertyDescriptor(obj, prop);
762
+ return descriptor;
763
+ } catch(e){}
764
+ }
765
+ descriptor = {
766
+ configurable: true,
767
+ enumerable: true,
768
+ writable: true,
769
+ value: undefined
770
+ };
771
+ var getter = obj.__lookupGetter__ && obj.__lookupGetter__(prop),
772
+ setter = obj.__lookupSetter__ && obj.__lookupSetter__(prop)
773
+ ;
774
+
775
+ if (!getter && !setter) { // not an accessor so return prop
776
+ if(!owns(obj, prop)){
777
+ return;
778
+ }
779
+ descriptor.value = obj[prop];
780
+ return descriptor;
781
+ }
782
+
783
+ // there is an accessor, remove descriptor.writable; populate descriptor.get and descriptor.set
784
+ delete descriptor.writable;
785
+ delete descriptor.value;
786
+ descriptor.get = descriptor.set = undefined;
787
+
788
+ if(getter){
789
+ descriptor.get = getter;
790
+ }
791
+
792
+ if(setter){
793
+ descriptor.set = setter;
794
+ }
795
+
796
+ return descriptor;
797
+ };
798
+
799
+ }
800
+ })(jQuery, jQuery.webshims);
801
+
802
+
803
+
804
+ //DOM-Extension helper
805
+ jQuery.webshims.register('dom-extend', function($, webshims, window, document, undefined){
806
+ "use strict";
807
+
808
+ webshims.assumeARIA = Modernizr.localstorage || Modernizr.video || Modernizr.boxsizing;
809
+
810
+ if($('<input type="email" />').attr('type') == 'text' || $('<form />').attr('novalidate') === "" || ('required' in $('<input />')[0].attributes)){
811
+ webshims.error("IE browser modes are busted in IE10. Please test your HTML/CSS/JS with a real IE version or at least IETester or similiar tools");
812
+ }
813
+
814
+ if(!$.parseHTML){
815
+ webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
816
+ }
817
+
818
+ //shortcus
819
+ var modules = webshims.modules;
820
+ var listReg = /\s*,\s*/;
821
+
822
+ //proxying attribute
823
+ var olds = {};
824
+ var havePolyfill = {};
825
+ var extendedProps = {};
826
+ var extendQ = {};
827
+ var modifyProps = {};
828
+
829
+ var oldVal = $.fn.val;
830
+ var singleVal = function(elem, name, val, pass, _argless){
831
+ return (_argless) ? oldVal.call($(elem)) : oldVal.call($(elem), val);
832
+ };
833
+
834
+
835
+ $.fn.val = function(val){
836
+ var elem = this[0];
837
+ if(arguments.length && val == null){
838
+ val = '';
839
+ }
840
+ if(!arguments.length){
841
+ if(!elem || elem.nodeType !== 1){return oldVal.call(this);}
842
+ return $.prop(elem, 'value', val, 'val', true);
843
+ }
844
+ if($.isArray(val)){
845
+ return oldVal.apply(this, arguments);
846
+ }
847
+ var isFunction = $.isFunction(val);
848
+ return this.each(function(i){
849
+ elem = this;
850
+ if(elem.nodeType === 1){
851
+ if(isFunction){
852
+ var genVal = val.call( elem, i, $.prop(elem, 'value', undefined, 'val', true));
853
+ if(genVal == null){
854
+ genVal = '';
855
+ }
856
+ $.prop(elem, 'value', genVal, 'val') ;
857
+ } else {
858
+ $.prop(elem, 'value', val, 'val');
859
+ }
860
+ }
861
+ });
862
+ };
863
+ $.fn.onTrigger = function(evt, fn){
864
+ return this.on(evt, fn).each(fn);
865
+ };
866
+
867
+ var dataID = '_webshimsLib'+ (Math.round(Math.random() * 1000));
868
+ var elementData = function(elem, key, val){
869
+ elem = elem.jquery ? elem[0] : elem;
870
+ if(!elem){return val || {};}
871
+ var data = $.data(elem, dataID);
872
+ if(val !== undefined){
873
+ if(!data){
874
+ data = $.data(elem, dataID, {});
875
+ }
876
+ if(key){
877
+ data[key] = val;
878
+ }
879
+ }
880
+
881
+ return key ? data && data[key] : data;
882
+ };
883
+
884
+
885
+ [{name: 'getNativeElement', prop: 'nativeElement'}, {name: 'getShadowElement', prop: 'shadowElement'}, {name: 'getShadowFocusElement', prop: 'shadowFocusElement'}].forEach(function(data){
886
+ $.fn[data.name] = function(){
887
+ var elems = [];
888
+ this.each(function(){
889
+ var shadowData = elementData(this, 'shadowData');
890
+ var elem = shadowData && shadowData[data.prop] || this;
891
+ if($.inArray(elem, elems) == -1){
892
+ elems.push(elem);
893
+ }
894
+ });
895
+ return this.pushStack(elems);
896
+ };
897
+ });
898
+
899
+ if($.Tween.propHooks._default && $.css){
900
+ (function(){
901
+ var isjQ8 = false;
902
+ try {
903
+ isjQ8 = $.css($('<b style="width: 10px" />')[0], 'width', '') == '10px';
904
+ } catch(er){
905
+ webshims.error(er);
906
+ }
907
+ var css = isjQ8 ?
908
+ function(elem, prop){
909
+ return $.css( elem, prop, false, "" );
910
+ } :
911
+ function(elem, prop){
912
+ return $.css( elem, prop, "" );
913
+ }
914
+ ;
915
+
916
+ $.extend($.Tween.propHooks._default, {
917
+ get: function( tween ) {
918
+ var result;
919
+
920
+ if ( (tween.elem[ tween.prop ] != null || havePolyfill[ tween.prop ]) &&
921
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
922
+ return havePolyfill[ tween.prop ] ? $.prop(tween.elem, tween.prop) : tween.elem[ tween.prop ];
923
+ }
924
+
925
+ // passing an empty string as a 3rd parameter to .css will automatically
926
+ // attempt a parseFloat and fallback to a string if the parse fails
927
+ // so, simple values such as "10px" are parsed to Float.
928
+ // complex values such as "rotate(1rad)" are returned as is.
929
+ result = css( tween.elem, tween.prop );
930
+ // Empty strings, null, undefined and "auto" are converted to 0.
931
+ return !result || result === "auto" ? 0 : result;
932
+ },
933
+ set: function( tween ) {
934
+ // use step hook for back compat - use cssHook if its there - use .style if its
935
+ // available and use plain properties where available
936
+ if ( jQuery.fx.step[ tween.prop ] ) {
937
+ jQuery.fx.step[ tween.prop ]( tween );
938
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
939
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
940
+ } else if( !havePolyfill[ tween.prop ] ) {
941
+ tween.elem[ tween.prop ] = tween.now;
942
+ } else {
943
+ $.prop(tween.elem, tween.prop, tween.now);
944
+ }
945
+ }
946
+ });
947
+ })();
948
+ }
949
+
950
+
951
+ ['removeAttr', 'prop', 'attr'].forEach(function(type){
952
+ olds[type] = $[type];
953
+ $[type] = function(elem, name, value, pass, _argless){
954
+ var isVal = (pass == 'val');
955
+ var oldMethod = !isVal ? olds[type] : singleVal;
956
+ if( !elem || !havePolyfill[name] || elem.nodeType !== 1 || (!isVal && pass && type == 'attr' && $.attrFn[name]) ){
957
+ return oldMethod(elem, name, value, pass, _argless);
958
+ }
959
+
960
+ var nodeName = (elem.nodeName || '').toLowerCase();
961
+ var desc = extendedProps[nodeName];
962
+ var curType = (type == 'attr' && (value === false || value === null)) ? 'removeAttr' : type;
963
+ var propMethod;
964
+ var oldValMethod;
965
+ var ret;
966
+
967
+
968
+ if(!desc){
969
+ desc = extendedProps['*'];
970
+ }
971
+ if(desc){
972
+ desc = desc[name];
973
+ }
974
+
975
+ if(desc){
976
+ propMethod = desc[curType];
977
+ }
978
+
979
+ if(propMethod){
980
+ if(name == 'value'){
981
+ oldValMethod = propMethod.isVal;
982
+ propMethod.isVal = isVal;
983
+ }
984
+ if(curType === 'removeAttr'){
985
+ return propMethod.value.call(elem);
986
+ } else if(value === undefined){
987
+ return (propMethod.get) ?
988
+ propMethod.get.call(elem) :
989
+ propMethod.value
990
+ ;
991
+ } else if(propMethod.set) {
992
+ if(type == 'attr' && value === true){
993
+ value = name;
994
+ }
995
+
996
+ ret = propMethod.set.call(elem, value);
997
+ }
998
+ if(name == 'value'){
999
+ propMethod.isVal = oldValMethod;
1000
+ }
1001
+ } else {
1002
+ ret = oldMethod(elem, name, value, pass, _argless);
1003
+ }
1004
+ if((value !== undefined || curType === 'removeAttr') && modifyProps[nodeName] && modifyProps[nodeName][name]){
1005
+
1006
+ var boolValue;
1007
+ if(curType == 'removeAttr'){
1008
+ boolValue = false;
1009
+ } else if(curType == 'prop'){
1010
+ boolValue = !!(value);
1011
+ } else {
1012
+ boolValue = true;
1013
+ }
1014
+
1015
+ modifyProps[nodeName][name].forEach(function(fn){
1016
+ if(!fn.only || (fn.only = 'prop' && type == 'prop') || (fn.only == 'attr' && type != 'prop')){
1017
+ fn.call(elem, value, boolValue, (isVal) ? 'val' : curType, type);
1018
+ }
1019
+ });
1020
+ }
1021
+ return ret;
1022
+ };
1023
+
1024
+ extendQ[type] = function(nodeName, prop, desc){
1025
+
1026
+ if(!extendedProps[nodeName]){
1027
+ extendedProps[nodeName] = {};
1028
+ }
1029
+ if(!extendedProps[nodeName][prop]){
1030
+ extendedProps[nodeName][prop] = {};
1031
+ }
1032
+ var oldDesc = extendedProps[nodeName][prop][type];
1033
+ var getSup = function(propType, descriptor, oDesc){
1034
+ if(descriptor && descriptor[propType]){
1035
+ return descriptor[propType];
1036
+ }
1037
+ if(oDesc && oDesc[propType]){
1038
+ return oDesc[propType];
1039
+ }
1040
+ if(type == 'prop' && prop == 'value'){
1041
+ return function(value){
1042
+ var elem = this;
1043
+ return (desc.isVal) ?
1044
+ singleVal(elem, prop, value, false, (arguments.length === 0)) :
1045
+ olds[type](elem, prop, value)
1046
+ ;
1047
+ };
1048
+ }
1049
+ if(type == 'prop' && propType == 'value' && desc.value.apply){
1050
+ return function(value){
1051
+ var sup = olds[type](this, prop);
1052
+ if(sup && sup.apply){
1053
+ sup = sup.apply(this, arguments);
1054
+ }
1055
+ return sup;
1056
+ };
1057
+ }
1058
+ return function(value){
1059
+ return olds[type](this, prop, value);
1060
+ };
1061
+ };
1062
+ extendedProps[nodeName][prop][type] = desc;
1063
+ if(desc.value === undefined){
1064
+ if(!desc.set){
1065
+ desc.set = desc.writeable ?
1066
+ getSup('set', desc, oldDesc) :
1067
+ (webshims.cfg.useStrict && prop == 'prop') ?
1068
+ function(){throw(prop +' is readonly on '+ nodeName);} :
1069
+ function(){webshims.info(prop +' is readonly on '+ nodeName);}
1070
+ ;
1071
+ }
1072
+ if(!desc.get){
1073
+ desc.get = getSup('get', desc, oldDesc);
1074
+ }
1075
+
1076
+ }
1077
+
1078
+ ['value', 'get', 'set'].forEach(function(descProp){
1079
+ if(desc[descProp]){
1080
+ desc['_sup'+descProp] = getSup(descProp, oldDesc);
1081
+ }
1082
+ });
1083
+ };
1084
+
1085
+ });
1086
+
1087
+ var extendNativeValue = (function(){
1088
+ var UNKNOWN = webshims.getPrototypeOf(document.createElement('foobar'));
1089
+ var has = Object.prototype.hasOwnProperty;
1090
+ //see also: https://github.com/lojjic/PIE/issues/40 | https://prototype.lighthouseapp.com/projects/8886/tickets/1107-ie8-fatal-crash-when-prototypejs-is-loaded-with-rounded-cornershtc
1091
+ var isExtendNativeSave = Modernizr.advancedObjectProperties && Modernizr.objectAccessor;
1092
+ return function(nodeName, prop, desc){
1093
+ var elem , elemProto;
1094
+ if( isExtendNativeSave && (elem = document.createElement(nodeName)) && (elemProto = webshims.getPrototypeOf(elem)) && UNKNOWN !== elemProto && ( !elem[prop] || !has.call(elem, prop) ) ){
1095
+ var sup = elem[prop];
1096
+ desc._supvalue = function(){
1097
+ if(sup && sup.apply){
1098
+ return sup.apply(this, arguments);
1099
+ }
1100
+ return sup;
1101
+ };
1102
+ elemProto[prop] = desc.value;
1103
+ } else {
1104
+ desc._supvalue = function(){
1105
+ var data = elementData(this, 'propValue');
1106
+ if(data && data[prop] && data[prop].apply){
1107
+ return data[prop].apply(this, arguments);
1108
+ }
1109
+ return data && data[prop];
1110
+ };
1111
+ initProp.extendValue(nodeName, prop, desc.value);
1112
+ }
1113
+ desc.value._supvalue = desc._supvalue;
1114
+ };
1115
+ })();
1116
+
1117
+ var initProp = (function(){
1118
+
1119
+ var initProps = {};
1120
+
1121
+ webshims.addReady(function(context, contextElem){
1122
+ var nodeNameCache = {};
1123
+ var getElementsByName = function(name){
1124
+ if(!nodeNameCache[name]){
1125
+ nodeNameCache[name] = $(context.getElementsByTagName(name));
1126
+ if(contextElem[0] && $.nodeName(contextElem[0], name)){
1127
+ nodeNameCache[name] = nodeNameCache[name].add(contextElem);
1128
+ }
1129
+ }
1130
+ };
1131
+
1132
+
1133
+ $.each(initProps, function(name, fns){
1134
+ getElementsByName(name);
1135
+ if(!fns || !fns.forEach){
1136
+ webshims.warn('Error: with '+ name +'-property. methods: '+ fns);
1137
+ return;
1138
+ }
1139
+ fns.forEach(function(fn){
1140
+ nodeNameCache[name].each(fn);
1141
+ });
1142
+ });
1143
+ nodeNameCache = null;
1144
+ });
1145
+
1146
+ var tempCache;
1147
+ var emptyQ = $([]);
1148
+ var createNodeNameInit = function(nodeName, fn){
1149
+ if(!initProps[nodeName]){
1150
+ initProps[nodeName] = [fn];
1151
+ } else {
1152
+ initProps[nodeName].push(fn);
1153
+ }
1154
+ if($.isDOMReady){
1155
+ (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
1156
+ }
1157
+ };
1158
+
1159
+ var elementExtends = {};
1160
+ return {
1161
+ createTmpCache: function(nodeName){
1162
+ if($.isDOMReady){
1163
+ tempCache = tempCache || $( document.getElementsByTagName(nodeName) );
1164
+ }
1165
+ return tempCache || emptyQ;
1166
+ },
1167
+ flushTmpCache: function(){
1168
+ tempCache = null;
1169
+ },
1170
+ content: function(nodeName, prop){
1171
+ createNodeNameInit(nodeName, function(){
1172
+ var val = $.attr(this, prop);
1173
+ if(val != null){
1174
+ $.attr(this, prop, val);
1175
+ }
1176
+ });
1177
+ },
1178
+ createElement: function(nodeName, fn){
1179
+ createNodeNameInit(nodeName, fn);
1180
+ },
1181
+ extendValue: function(nodeName, prop, value){
1182
+ createNodeNameInit(nodeName, function(){
1183
+ $(this).each(function(){
1184
+ var data = elementData(this, 'propValue', {});
1185
+ data[prop] = this[prop];
1186
+ this[prop] = value;
1187
+ });
1188
+ });
1189
+ }
1190
+ };
1191
+ })();
1192
+
1193
+ var createPropDefault = function(descs, removeType){
1194
+ if(descs.defaultValue === undefined){
1195
+ descs.defaultValue = '';
1196
+ }
1197
+ if(!descs.removeAttr){
1198
+ descs.removeAttr = {
1199
+ value: function(){
1200
+ descs[removeType || 'prop'].set.call(this, descs.defaultValue);
1201
+ descs.removeAttr._supvalue.call(this);
1202
+ }
1203
+ };
1204
+ }
1205
+ if(!descs.attr){
1206
+ descs.attr = {};
1207
+ }
1208
+ };
1209
+
1210
+ $.extend(webshims, {
1211
+
1212
+ getID: (function(){
1213
+ var ID = new Date().getTime();
1214
+ return function(elem){
1215
+ elem = $(elem);
1216
+ var id = elem.prop('id');
1217
+ if(!id){
1218
+ ID++;
1219
+ id = 'ID-'+ ID;
1220
+ elem.eq(0).prop('id', id);
1221
+ }
1222
+ return id;
1223
+ };
1224
+ })(),
1225
+ implement: function(elem, type){
1226
+ var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});
1227
+ if(data[type]){
1228
+ webshims.info(type +' already implemented for element #'+elem.id);
1229
+ return false;
1230
+ }
1231
+ data[type] = true;
1232
+ return true;
1233
+ },
1234
+ extendUNDEFProp: function(obj, props){
1235
+ $.each(props, function(name, prop){
1236
+ if( !(name in obj) ){
1237
+ obj[name] = prop;
1238
+ }
1239
+ });
1240
+ },
1241
+ //http://www.w3.org/TR/html5/common-dom-interfaces.html#reflect
1242
+ createPropDefault: createPropDefault,
1243
+ data: elementData,
1244
+ moveToFirstEvent: function(elem, eventType, bindType){
1245
+ var events = ($._data(elem, 'events') || {})[eventType];
1246
+ var fn;
1247
+
1248
+ if(events && events.length > 1){
1249
+ fn = events.pop();
1250
+ if(!bindType){
1251
+ bindType = 'bind';
1252
+ }
1253
+ if(bindType == 'bind' && events.delegateCount){
1254
+ events.splice( events.delegateCount, 0, fn);
1255
+ } else {
1256
+ events.unshift( fn );
1257
+ }
1258
+
1259
+
1260
+ }
1261
+ elem = null;
1262
+ },
1263
+ addShadowDom: (function(){
1264
+ var resizeTimer;
1265
+ var lastHeight;
1266
+ var lastWidth;
1267
+
1268
+ var docObserve = {
1269
+ init: false,
1270
+ runs: 0,
1271
+ test: function(){
1272
+ var height = docObserve.getHeight();
1273
+ var width = docObserve.getWidth();
1274
+
1275
+ if(height != docObserve.height || width != docObserve.width){
1276
+ docObserve.height = height;
1277
+ docObserve.width = width;
1278
+ docObserve.handler({type: 'docresize'});
1279
+ docObserve.runs++;
1280
+ if(docObserve.runs < 9){
1281
+ setTimeout(docObserve.test, 90);
1282
+ }
1283
+ } else {
1284
+ docObserve.runs = 0;
1285
+ }
1286
+ },
1287
+ handler: function(e){
1288
+ clearTimeout(resizeTimer);
1289
+ resizeTimer = setTimeout(function(){
1290
+ if(e.type == 'resize'){
1291
+ var width = $(window).width();
1292
+ var height = $(window).width();
1293
+ if(height == lastHeight && width == lastWidth){
1294
+ return;
1295
+ }
1296
+ lastHeight = height;
1297
+ lastWidth = width;
1298
+
1299
+ docObserve.height = docObserve.getHeight();
1300
+ docObserve.width = docObserve.getWidth();
1301
+
1302
+ }
1303
+ $(document).triggerHandler('updateshadowdom');
1304
+ }, (e.type == 'resize') ? 50 : 9);
1305
+ },
1306
+ _create: function(){
1307
+ $.each({ Height: "getHeight", Width: "getWidth" }, function(name, type){
1308
+ var body = document.body;
1309
+ var doc = document.documentElement;
1310
+ docObserve[type] = function(){
1311
+ return Math.max(
1312
+ body[ "scroll" + name ], doc[ "scroll" + name ],
1313
+ body[ "offset" + name ], doc[ "offset" + name ],
1314
+ doc[ "client" + name ]
1315
+ );
1316
+ };
1317
+ });
1318
+ },
1319
+ start: function(){
1320
+ if(!this.init && document.body){
1321
+ this.init = true;
1322
+ this._create();
1323
+ this.height = docObserve.getHeight();
1324
+ this.width = docObserve.getWidth();
1325
+ setInterval(this.test, 600);
1326
+ $(this.test);
1327
+ webshims.ready('WINDOWLOAD', this.test);
1328
+ $(window).bind('resize', this.handler);
1329
+ (function(){
1330
+ var oldAnimate = $.fn.animate;
1331
+ var animationTimer;
1332
+
1333
+ $.fn.animate = function(){
1334
+ clearTimeout(animationTimer);
1335
+ animationTimer = setTimeout(function(){
1336
+ docObserve.test();
1337
+ }, 99);
1338
+
1339
+ return oldAnimate.apply(this, arguments);
1340
+ };
1341
+ })();
1342
+ }
1343
+ }
1344
+ };
1345
+
1346
+
1347
+ webshims.docObserve = function(){
1348
+ webshims.ready('DOM', function(){
1349
+ docObserve.start();
1350
+ });
1351
+ };
1352
+ return function(nativeElem, shadowElem, opts){
1353
+ opts = opts || {};
1354
+ if(nativeElem.jquery){
1355
+ nativeElem = nativeElem[0];
1356
+ }
1357
+ if(shadowElem.jquery){
1358
+ shadowElem = shadowElem[0];
1359
+ }
1360
+ var nativeData = $.data(nativeElem, dataID) || $.data(nativeElem, dataID, {});
1361
+ var shadowData = $.data(shadowElem, dataID) || $.data(shadowElem, dataID, {});
1362
+ var shadowFocusElementData = {};
1363
+ if(!opts.shadowFocusElement){
1364
+ opts.shadowFocusElement = shadowElem;
1365
+ } else if(opts.shadowFocusElement){
1366
+ if(opts.shadowFocusElement.jquery){
1367
+ opts.shadowFocusElement = opts.shadowFocusElement[0];
1368
+ }
1369
+ shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData);
1370
+ }
1371
+
1372
+ nativeData.hasShadow = shadowElem;
1373
+ shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem;
1374
+ shadowFocusElementData.shadowData = shadowData.shadowData = nativeData.shadowData = {
1375
+ nativeElement: nativeElem,
1376
+ shadowElement: shadowElem,
1377
+ shadowFocusElement: opts.shadowFocusElement
1378
+ };
1379
+ if(opts.shadowChilds){
1380
+ opts.shadowChilds.each(function(){
1381
+ elementData(this, 'shadowData', shadowData.shadowData);
1382
+ });
1383
+ }
1384
+
1385
+ if(opts.data){
1386
+ shadowFocusElementData.shadowData.data = shadowData.shadowData.data = nativeData.shadowData.data = opts.data;
1387
+ }
1388
+ opts = null;
1389
+ webshims.docObserve();
1390
+ };
1391
+ })(),
1392
+ propTypes: {
1393
+ standard: function(descs, name){
1394
+ createPropDefault(descs);
1395
+ if(descs.prop){return;}
1396
+ descs.prop = {
1397
+ set: function(val){
1398
+ descs.attr.set.call(this, ''+val);
1399
+ },
1400
+ get: function(){
1401
+ return descs.attr.get.call(this) || descs.defaultValue;
1402
+ }
1403
+ };
1404
+
1405
+ },
1406
+ "boolean": function(descs, name){
1407
+
1408
+ createPropDefault(descs);
1409
+ if(descs.prop){return;}
1410
+ descs.prop = {
1411
+ set: function(val){
1412
+ if(val){
1413
+ descs.attr.set.call(this, "");
1414
+ } else {
1415
+ descs.removeAttr.value.call(this);
1416
+ }
1417
+ },
1418
+ get: function(){
1419
+ return descs.attr.get.call(this) != null;
1420
+ }
1421
+ };
1422
+ },
1423
+ "src": (function(){
1424
+ var anchor = document.createElement('a');
1425
+ anchor.style.display = "none";
1426
+ return function(descs, name){
1427
+
1428
+ createPropDefault(descs);
1429
+ if(descs.prop){return;}
1430
+ descs.prop = {
1431
+ set: function(val){
1432
+ descs.attr.set.call(this, val);
1433
+ },
1434
+ get: function(){
1435
+ var href = this.getAttribute(name);
1436
+ var ret;
1437
+ if(href == null){return '';}
1438
+
1439
+ anchor.setAttribute('href', href+'' );
1440
+
1441
+ if(!$.support.hrefNormalized){
1442
+ try {
1443
+ $(anchor).insertAfter(this);
1444
+ ret = anchor.getAttribute('href', 4);
1445
+ } catch(er){
1446
+ ret = anchor.getAttribute('href', 4);
1447
+ }
1448
+ $(anchor).detach();
1449
+ }
1450
+ return ret || anchor.href;
1451
+ }
1452
+ };
1453
+ };
1454
+ })(),
1455
+ enumarated: function(descs, name){
1456
+
1457
+ createPropDefault(descs);
1458
+ if(descs.prop){return;}
1459
+ descs.prop = {
1460
+ set: function(val){
1461
+ descs.attr.set.call(this, val);
1462
+ },
1463
+ get: function(){
1464
+ var val = (descs.attr.get.call(this) || '').toLowerCase();
1465
+ if(!val || descs.limitedTo.indexOf(val) == -1){
1466
+ val = descs.defaultValue;
1467
+ }
1468
+ return val;
1469
+ }
1470
+ };
1471
+ }
1472
+
1473
+ // ,unsignedLong: $.noop
1474
+ // ,"doubble": $.noop
1475
+ // ,"long": $.noop
1476
+ // ,tokenlist: $.noop
1477
+ // ,settableTokenlist: $.noop
1478
+ },
1479
+ reflectProperties: function(nodeNames, props){
1480
+ if(typeof props == 'string'){
1481
+ props = props.split(listReg);
1482
+ }
1483
+ props.forEach(function(prop){
1484
+ webshims.defineNodeNamesProperty(nodeNames, prop, {
1485
+ prop: {
1486
+ set: function(val){
1487
+ $.attr(this, prop, val);
1488
+ },
1489
+ get: function(){
1490
+ return $.attr(this, prop) || '';
1491
+ }
1492
+ }
1493
+ });
1494
+ });
1495
+ },
1496
+ defineNodeNameProperty: function(nodeName, prop, descs){
1497
+ havePolyfill[prop] = true;
1498
+
1499
+ if(descs.reflect){
1500
+ webshims.propTypes[descs.propType || 'standard'](descs, prop);
1501
+ }
1502
+
1503
+ ['prop', 'attr', 'removeAttr'].forEach(function(type){
1504
+ var desc = descs[type];
1505
+ if(desc){
1506
+ if(type === 'prop'){
1507
+ desc = $.extend({writeable: true}, desc);
1508
+ } else {
1509
+ desc = $.extend({}, desc, {writeable: true});
1510
+ }
1511
+
1512
+ extendQ[type](nodeName, prop, desc);
1513
+ if(nodeName != '*' && webshims.cfg.extendNative && type == 'prop' && desc.value && $.isFunction(desc.value)){
1514
+ extendNativeValue(nodeName, prop, desc);
1515
+ }
1516
+ descs[type] = desc;
1517
+ }
1518
+ });
1519
+ if(descs.initAttr){
1520
+ initProp.content(nodeName, prop);
1521
+ }
1522
+ return descs;
1523
+ },
1524
+
1525
+ defineNodeNameProperties: function(name, descs, propType, _noTmpCache){
1526
+ var olddesc;
1527
+ for(var prop in descs){
1528
+ if(!_noTmpCache && descs[prop].initAttr){
1529
+ initProp.createTmpCache(name);
1530
+ }
1531
+ if(propType){
1532
+ if(descs[prop][propType]){
1533
+ //webshims.log('override: '+ name +'['+prop +'] for '+ propType);
1534
+ } else {
1535
+ descs[prop][propType] = {};
1536
+ ['value', 'set', 'get'].forEach(function(copyProp){
1537
+ if(copyProp in descs[prop]){
1538
+ descs[prop][propType][copyProp] = descs[prop][copyProp];
1539
+ delete descs[prop][copyProp];
1540
+ }
1541
+ });
1542
+ }
1543
+ }
1544
+ descs[prop] = webshims.defineNodeNameProperty(name, prop, descs[prop]);
1545
+ }
1546
+ if(!_noTmpCache){
1547
+ initProp.flushTmpCache();
1548
+ }
1549
+ return descs;
1550
+ },
1551
+
1552
+ createElement: function(nodeName, create, descs){
1553
+ var ret;
1554
+ if($.isFunction(create)){
1555
+ create = {
1556
+ after: create
1557
+ };
1558
+ }
1559
+ initProp.createTmpCache(nodeName);
1560
+ if(create.before){
1561
+ initProp.createElement(nodeName, create.before);
1562
+ }
1563
+ if(descs){
1564
+ ret = webshims.defineNodeNameProperties(nodeName, descs, false, true);
1565
+ }
1566
+ if(create.after){
1567
+ initProp.createElement(nodeName, create.after);
1568
+ }
1569
+ initProp.flushTmpCache();
1570
+ return ret;
1571
+ },
1572
+ onNodeNamesPropertyModify: function(nodeNames, props, desc, only){
1573
+ if(typeof nodeNames == 'string'){
1574
+ nodeNames = nodeNames.split(listReg);
1575
+ }
1576
+ if($.isFunction(desc)){
1577
+ desc = {set: desc};
1578
+ }
1579
+
1580
+ nodeNames.forEach(function(name){
1581
+ if(!modifyProps[name]){
1582
+ modifyProps[name] = {};
1583
+ }
1584
+ if(typeof props == 'string'){
1585
+ props = props.split(listReg);
1586
+ }
1587
+ if(desc.initAttr){
1588
+ initProp.createTmpCache(name);
1589
+ }
1590
+ props.forEach(function(prop){
1591
+ if(!modifyProps[name][prop]){
1592
+ modifyProps[name][prop] = [];
1593
+ havePolyfill[prop] = true;
1594
+ }
1595
+ if(desc.set){
1596
+ if(only){
1597
+ desc.set.only = only;
1598
+ }
1599
+ modifyProps[name][prop].push(desc.set);
1600
+ }
1601
+
1602
+ if(desc.initAttr){
1603
+ initProp.content(name, prop);
1604
+ }
1605
+ });
1606
+ initProp.flushTmpCache();
1607
+
1608
+ });
1609
+ },
1610
+ defineNodeNamesBooleanProperty: function(elementNames, prop, descs){
1611
+ if(!descs){
1612
+ descs = {};
1613
+ }
1614
+ if($.isFunction(descs)){
1615
+ descs.set = descs;
1616
+ }
1617
+ webshims.defineNodeNamesProperty(elementNames, prop, {
1618
+ attr: {
1619
+ set: function(val){
1620
+ this.setAttribute(prop, val);
1621
+ if(descs.set){
1622
+ descs.set.call(this, true);
1623
+ }
1624
+ },
1625
+ get: function(){
1626
+ var ret = this.getAttribute(prop);
1627
+ return (ret == null) ? undefined : prop;
1628
+ }
1629
+ },
1630
+ removeAttr: {
1631
+ value: function(){
1632
+ this.removeAttribute(prop);
1633
+ if(descs.set){
1634
+ descs.set.call(this, false);
1635
+ }
1636
+ }
1637
+ },
1638
+ reflect: true,
1639
+ propType: 'boolean',
1640
+ initAttr: descs.initAttr || false
1641
+ });
1642
+ },
1643
+ contentAttr: function(elem, name, val){
1644
+ if(!elem.nodeName){return;}
1645
+ var attr;
1646
+ if(val === undefined){
1647
+ attr = (elem.attributes[name] || {});
1648
+ val = attr.specified ? attr.value : null;
1649
+ return (val == null) ? undefined : val;
1650
+ }
1651
+
1652
+ if(typeof val == 'boolean'){
1653
+ if(!val){
1654
+ elem.removeAttribute(name);
1655
+ } else {
1656
+ elem.setAttribute(name, name);
1657
+ }
1658
+ } else {
1659
+ elem.setAttribute(name, val);
1660
+ }
1661
+ },
1662
+
1663
+ // set current Lang:
1664
+ // - webshims.activeLang(lang:string);
1665
+ // get current lang
1666
+ // - webshims.activeLang();
1667
+ // get current lang
1668
+ // webshims.activeLang({
1669
+ // register: moduleName:string,
1670
+ // callback: callback:function
1671
+ // });
1672
+ // get/set including removeLang
1673
+ // - webshims.activeLang({
1674
+ // module: moduleName:string,
1675
+ // callback: callback:function,
1676
+ // langObj: languageObj:array/object
1677
+ // });
1678
+ activeLang: (function(){
1679
+ var callbacks = [];
1680
+ var registeredCallbacks = {};
1681
+ var currentLang;
1682
+ var shortLang;
1683
+ var notLocal = /:\/\/|^\.*\//;
1684
+ var loadRemoteLang = function(data, lang, options){
1685
+ var langSrc;
1686
+ if(lang && options && $.inArray(lang, options.availabeLangs || []) !== -1){
1687
+ data.loading = true;
1688
+ langSrc = options.langSrc;
1689
+ if(!notLocal.test(langSrc)){
1690
+ langSrc = webshims.cfg.basePath+langSrc;
1691
+ }
1692
+ webshims.loader.loadScript(langSrc+lang+'.js', function(){
1693
+ if(data.langObj[lang]){
1694
+ data.loading = false;
1695
+ callLang(data, true);
1696
+ } else {
1697
+ $(function(){
1698
+ if(data.langObj[lang]){
1699
+ callLang(data, true);
1700
+ }
1701
+ data.loading = false;
1702
+ });
1703
+ }
1704
+ });
1705
+ return true;
1706
+ }
1707
+ return false;
1708
+ };
1709
+ var callRegister = function(module){
1710
+ if(registeredCallbacks[module]){
1711
+ registeredCallbacks[module].forEach(function(data){
1712
+ data.callback(currentLang, shortLang, '');
1713
+ });
1714
+ }
1715
+ };
1716
+ var callLang = function(data, _noLoop){
1717
+ if(data.activeLang != currentLang && data.activeLang !== shortLang){
1718
+ var options = modules[data.module].options;
1719
+ if( data.langObj[currentLang] || (shortLang && data.langObj[shortLang]) ){
1720
+ data.activeLang = currentLang;
1721
+ data.callback(data.langObj[currentLang] || data.langObj[shortLang], currentLang);
1722
+ callRegister(data.module);
1723
+ } else if( !_noLoop &&
1724
+ !loadRemoteLang(data, currentLang, options) &&
1725
+ !loadRemoteLang(data, shortLang, options) &&
1726
+ data.langObj[''] && data.activeLang !== '' ) {
1727
+ data.activeLang = '';
1728
+ data.callback(data.langObj[''], currentLang);
1729
+ callRegister(data.module);
1730
+ }
1731
+ }
1732
+ };
1733
+
1734
+
1735
+ var activeLang = function(lang){
1736
+
1737
+ if(typeof lang == 'string' && lang !== currentLang){
1738
+ currentLang = lang;
1739
+ shortLang = currentLang.split('-')[0];
1740
+ if(currentLang == shortLang){
1741
+ shortLang = false;
1742
+ }
1743
+ $.each(callbacks, function(i, data){
1744
+ callLang(data);
1745
+ });
1746
+ } else if(typeof lang == 'object'){
1747
+
1748
+ if(lang.register){
1749
+ if(!registeredCallbacks[lang.register]){
1750
+ registeredCallbacks[lang.register] = [];
1751
+ }
1752
+ registeredCallbacks[lang.register].push(lang);
1753
+ lang.callback(currentLang, shortLang, '');
1754
+ } else {
1755
+ if(!lang.activeLang){
1756
+ lang.activeLang = '';
1757
+ }
1758
+ callbacks.push(lang);
1759
+ callLang(lang);
1760
+ }
1761
+ }
1762
+ return currentLang;
1763
+ };
1764
+
1765
+ return activeLang;
1766
+ })()
1767
+ });
1768
+
1769
+ $.each({
1770
+ defineNodeNamesProperty: 'defineNodeNameProperty',
1771
+ defineNodeNamesProperties: 'defineNodeNameProperties',
1772
+ createElements: 'createElement'
1773
+ }, function(name, baseMethod){
1774
+ webshims[name] = function(names, a, b, c){
1775
+ if(typeof names == 'string'){
1776
+ names = names.split(listReg);
1777
+ }
1778
+ var retDesc = {};
1779
+ names.forEach(function(nodeName){
1780
+ retDesc[nodeName] = webshims[baseMethod](nodeName, a, b, c);
1781
+ });
1782
+ return retDesc;
1783
+ };
1784
+ });
1785
+
1786
+ webshims.isReady('webshimLocalization', true);
1787
+ });
1788
+ //html5a11y
1789
+ (function($, document){
1790
+ if(!$.webshims.assumeARIA || ('content' in document.createElement('template'))){return;}
1791
+
1792
+ $(function(){
1793
+ var main = $('main').attr({role: 'main'});
1794
+ if(main.length > 1){
1795
+ webshims.error('only one main element allowed in document');
1796
+ } else if(main.is('article *, section *')) {
1797
+ webshims.error('main not allowed inside of article/section elements');
1798
+ }
1799
+ });
1800
+
1801
+ if(('hidden' in document.createElement('a'))){
1802
+ return;
1803
+ }
1804
+
1805
+ var elemMappings = {
1806
+ article: "article",
1807
+ aside: "complementary",
1808
+ section: "region",
1809
+ nav: "navigation",
1810
+ address: "contentinfo"
1811
+ };
1812
+ var addRole = function(elem, role){
1813
+ var hasRole = elem.getAttribute('role');
1814
+ if (!hasRole) {
1815
+ elem.setAttribute('role', role);
1816
+ }
1817
+ };
1818
+
1819
+
1820
+ $.webshims.addReady(function(context, contextElem){
1821
+ $.each(elemMappings, function(name, role){
1822
+ var elems = $(name, context).add(contextElem.filter(name));
1823
+ for (var i = 0, len = elems.length; i < len; i++) {
1824
+ addRole(elems[i], role);
1825
+ }
1826
+ });
1827
+ if (context === document) {
1828
+ var header = document.getElementsByTagName('header')[0];
1829
+ var footers = document.getElementsByTagName('footer');
1830
+ var footerLen = footers.length;
1831
+
1832
+ if (header && !$(header).closest('section, article')[0]) {
1833
+ addRole(header, 'banner');
1834
+ }
1835
+ if (!footerLen) {
1836
+ return;
1837
+ }
1838
+ var footer = footers[footerLen - 1];
1839
+ if (!$(footer).closest('section, article')[0]) {
1840
+ addRole(footer, 'contentinfo');
1841
+ }
1842
+ }
1843
+ });
1844
+
1845
+ })(jQuery, document);
1846
+
1
1847
 
2
1848
  //JSON
3
1849
  (function(){
@@ -189,23 +2035,28 @@ if (!('sessionStorage' in window)) {window.sessionStorage = new Storage('session
189
2035
  var shim;
190
2036
  var localStorageSwfCallback = function(type){
191
2037
  clearTimeout(swfTimer);
192
-
2038
+ var getType;
193
2039
  if(window.localStorage && (type != 'swf' || (shim && shim.key))){
194
2040
  $.webshims.isReady('json-storage', true);
195
2041
  return;
196
2042
  }
2043
+
197
2044
 
198
2045
  if(type === 'swf'){
199
2046
  shim = document.getElementById('swflocalstorageshim');
2047
+ getType = shim ? typeof(shim.GetVariable) : 'undefined';
2048
+
200
2049
  //brute force flash getter
201
- if( !shim || typeof shim.GetVariable == 'undefined' ){
2050
+ if( getType == 'undefined' ){
202
2051
  shim = document.swflocalstorageshim;
203
- }
204
- if( !shim || typeof shim.GetVariable == 'undefined'){
205
- shim = window.localstorageshim;
2052
+ getType = shim ? typeof(shim.GetVariable) : 'undefined';
2053
+ if( getType == 'undefined' ){
2054
+ shim = window.localstorageshim;
2055
+ getType = shim ? typeof(shim.GetVariable) : 'undefined';
2056
+ }
206
2057
  }
207
2058
 
208
- if(shim && typeof shim.GetVariable !== 'undefined'){
2059
+ if(getType != 'undefined'){
209
2060
  window.localStorage = {};
210
2061
 
211
2062
  window.localStorage.clear = function(){
@@ -245,7 +2096,6 @@ if (!('sessionStorage' in window)) {window.sessionStorage = new Storage('session
245
2096
  window.localStorage = new Storage('local');
246
2097
  $.webshims.warn('implement cookie-localStorage');
247
2098
  }
248
-
249
2099
  $.webshims.isReady('json-storage', true);
250
2100
  };
251
2101
  var storageCFG = $.webshims.cfg['json-storage'];
@@ -280,12 +2130,14 @@ if (!('sessionStorage' in window)) {window.sessionStorage = new Storage('session
280
2130
  //
281
2131
  // };
282
2132
 
283
- $.webshims.ready('DOM swfobject', function(){
2133
+ $.webshims.ready('DOM swfmini', function(){
2134
+
2135
+ var swfmini = window.swfmini;
284
2136
  if(runStart || (('localStorage' in window) && document.getElementById('swflocalstorageshim')) ){return;}
285
2137
  runStart = true;
286
- if(window.swfobject && swfobject.hasFlashPlayerVersion('8.0.0')){
2138
+ if(swfmini && swfmini.hasFlashPlayerVersion('8.0.0')){
287
2139
  $('body').append('<div id="swflocalstorageshim-wrapper"><div id="swflocalstorageshim" /></div>');
288
- swfobject.embedSWF($.webshims.cfg.basePath +'swf/localStorage.swf' +($.webshims.cfg.addCacheBuster || ''), 'swflocalstorageshim', '295', '198', '8.0.0', '', {allowscriptaccess: 'always'}, {name: 'swflocalstorageshim'}, function(e){
2140
+ swfmini.embedSWF($.webshims.cfg.basePath +'swf/localStorage.swf' +($.webshims.cfg.addCacheBuster || ''), 'swflocalstorageshim', '295', '198', '8.0.0', null, {allowscriptaccess: 'always'}, {name: 'swflocalstorageshim'}, function(e){
289
2141
  if(!e.success && !window.localStorage){
290
2142
  localStorageSwfCallback();
291
2143
  }
@@ -306,172 +2158,3 @@ if (!('sessionStorage' in window)) {window.sessionStorage = new Storage('session
306
2158
 
307
2159
  })();
308
2160
 
309
-
310
- (function($){
311
- if(navigator.geolocation){return;}
312
- var domWrite = function(){
313
- setTimeout(function(){
314
- throw('document.write is overwritten by geolocation shim. This method is incompatible with this plugin');
315
- }, 1);
316
- },
317
- id = 0
318
- ;
319
- var geoOpts = $.webshims.cfg.geolocation || {};
320
- navigator.geolocation = (function(){
321
- var pos;
322
- var api = {
323
- getCurrentPosition: function(success, error, opts){
324
- var locationAPIs = 2,
325
- errorTimer,
326
- googleTimer,
327
- calledEnd,
328
- endCallback = function(){
329
- if(calledEnd){return;}
330
- if(pos){
331
- calledEnd = true;
332
- success($.extend({timestamp: new Date().getTime()}, pos));
333
- resetCallback();
334
- if(window.JSON && window.sessionStorage){
335
- try{
336
- sessionStorage.setItem('storedGeolocationData654321', JSON.stringify(pos));
337
- } catch(e){}
338
- }
339
- } else if(error && !locationAPIs) {
340
- calledEnd = true;
341
- resetCallback();
342
- error({ code: 2, message: "POSITION_UNAVAILABLE"});
343
- }
344
- },
345
- googleCallback = function(){
346
- locationAPIs--;
347
- getGoogleCoords();
348
- endCallback();
349
- },
350
- resetCallback = function(){
351
- $(document).unbind('google-loader', resetCallback);
352
- clearTimeout(googleTimer);
353
- clearTimeout(errorTimer);
354
- },
355
- getGoogleCoords = function(){
356
- if(pos || !window.google || !google.loader || !google.loader.ClientLocation){return false;}
357
- var cl = google.loader.ClientLocation;
358
- pos = {
359
- coords: {
360
- latitude: cl.latitude,
361
- longitude: cl.longitude,
362
- altitude: null,
363
- accuracy: 43000,
364
- altitudeAccuracy: null,
365
- heading: parseInt('NaN', 10),
366
- velocity: null
367
- },
368
- //extension similiar to FF implementation
369
- address: $.extend({streetNumber: '', street: '', premises: '', county: '', postalCode: ''}, cl.address)
370
- };
371
- return true;
372
- },
373
- getInitCoords = function(){
374
- if(pos){return;}
375
- getGoogleCoords();
376
- if(pos || !window.JSON || !window.sessionStorage){return;}
377
- try{
378
- pos = sessionStorage.getItem('storedGeolocationData654321');
379
- pos = (pos) ? JSON.parse(pos) : false;
380
- if(!pos.coords){pos = false;}
381
- } catch(e){
382
- pos = false;
383
- }
384
- }
385
- ;
386
-
387
- getInitCoords();
388
-
389
- if(!pos){
390
- if(geoOpts.confirmText && !confirm(geoOpts.confirmText.replace('{location}', location.hostname))){
391
- if(error){
392
- error({ code: 1, message: "PERMISSION_DENIED"});
393
- }
394
- return;
395
- }
396
- $.ajax({
397
- url: 'http://freegeoip.net/json/',
398
- dataType: 'jsonp',
399
- cache: true,
400
- jsonp: 'callback',
401
- success: function(data){
402
- locationAPIs--;
403
- if(!data){return;}
404
- pos = pos || {
405
- coords: {
406
- latitude: data.latitude,
407
- longitude: data.longitude,
408
- altitude: null,
409
- accuracy: 43000,
410
- altitudeAccuracy: null,
411
- heading: parseInt('NaN', 10),
412
- velocity: null
413
- },
414
- //extension similiar to FF implementation
415
- address: {
416
- city: data.city,
417
- country: data.country_name,
418
- countryCode: data.country_code,
419
- county: "",
420
- postalCode: data.zipcode,
421
- premises: "",
422
- region: data.region_name,
423
- street: "",
424
- streetNumber: ""
425
- }
426
- };
427
- endCallback();
428
- },
429
- error: function(){
430
- locationAPIs--;
431
- endCallback();
432
- }
433
- });
434
- clearTimeout(googleTimer);
435
- if (!window.google || !window.google.loader) {
436
- googleTimer = setTimeout(function(){
437
- //destroys document.write!!!
438
- if (geoOpts.destroyWrite) {
439
- document.write = domWrite;
440
- document.writeln = domWrite;
441
- }
442
- $(document).one('google-loader', googleCallback);
443
- $.webshims.loader.loadScript('http://www.google.com/jsapi', false, 'google-loader');
444
- }, 800);
445
- } else {
446
- locationAPIs--;
447
- }
448
- } else {
449
- setTimeout(endCallback, 1);
450
- return;
451
- }
452
- if(opts && opts.timeout){
453
- errorTimer = setTimeout(function(){
454
- resetCallback();
455
- if(error) {
456
- error({ code: 3, message: "TIMEOUT"});
457
- }
458
- }, opts.timeout);
459
- } else {
460
- errorTimer = setTimeout(function(){
461
- locationAPIs = 0;
462
- endCallback();
463
- }, 10000);
464
- }
465
- },
466
- clearWatch: $.noop
467
- };
468
- api.watchPosition = function(a, b, c){
469
- api.getCurrentPosition(a, b, c);
470
- id++;
471
- return id;
472
- };
473
- return api;
474
- })();
475
-
476
- $.webshims.isReady('geolocation', true);
477
- })(jQuery);