lady_josephine 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +32 -0
  4. data/app/assets/fonts/lady_josephine/icons/icons.eot +0 -0
  5. data/app/assets/fonts/lady_josephine/icons/icons.svg +215 -0
  6. data/app/assets/fonts/lady_josephine/icons/icons.ttf +0 -0
  7. data/app/assets/fonts/lady_josephine/icons/icons.woff +0 -0
  8. data/app/assets/javascripts/lady_josephine/blocks/facebook.js +25 -0
  9. data/app/assets/javascripts/lady_josephine/blocks/instagram.js +22 -0
  10. data/app/assets/javascripts/lady_josephine/blocks/soundcloud.js +24 -0
  11. data/app/assets/javascripts/lady_josephine/blocks/twitter.js +25 -0
  12. data/app/assets/javascripts/lady_josephine/blocks/vimeo.js +55 -0
  13. data/app/assets/javascripts/lady_josephine/blocks/youtube.js +64 -0
  14. data/app/assets/javascripts/lady_josephine/editor.js +40 -0
  15. data/app/assets/javascripts/lady_josephine/lady_josephine.js +4 -0
  16. data/app/assets/javascripts/lady_josephine/lady_josephine_view.js +6 -0
  17. data/app/assets/stylesheets/lady_josephine/content.sass +33 -0
  18. data/app/assets/stylesheets/lady_josephine/icons.sass +175 -0
  19. data/app/assets/stylesheets/lady_josephine/lady_josephine.sass +6 -0
  20. data/app/assets/stylesheets/lady_josephine/sir_trevor.sass +619 -0
  21. data/app/assets/stylesheets/lady_josephine/vars.sass +36 -0
  22. data/app/controllers/lady_josephine/application_controller.rb +4 -0
  23. data/app/controllers/lady_josephine/editor_controller.rb +40 -0
  24. data/app/controllers/lady_josephine/images_controller.rb +26 -0
  25. data/app/helpers/lady_josephine/helper.rb +25 -0
  26. data/app/helpers/lady_josephine/sir_trevor_helper.rb +172 -0
  27. data/app/models/lady_josephine/concerns/model.rb +29 -0
  28. data/app/models/lady_josephine/concerns/pingable.rb +28 -0
  29. data/app/models/lady_josephine/concerns/server_uuid.rb +24 -0
  30. data/app/models/lady_josephine/concerns/sir_trevor_images.rb +38 -0
  31. data/app/models/lady_josephine/image.rb +41 -0
  32. data/app/uploader/lady_josephine/base_uploader.rb +47 -0
  33. data/app/uploader/lady_josephine/image_uploader.rb +149 -0
  34. data/app/views/lady_josephine/blocks/_audio_block.haml +2 -0
  35. data/app/views/lady_josephine/blocks/_definition_block.haml +4 -0
  36. data/app/views/lady_josephine/blocks/_divider_block.haml +2 -0
  37. data/app/views/lady_josephine/blocks/_extended_image_block.haml +63 -0
  38. data/app/views/lady_josephine/blocks/_extended_quote_block.haml +5 -0
  39. data/app/views/lady_josephine/blocks/_extended_tweet_block.haml +2 -0
  40. data/app/views/lady_josephine/blocks/_facebook_post_block.haml +2 -0
  41. data/app/views/lady_josephine/blocks/_heading_block.haml +2 -0
  42. data/app/views/lady_josephine/blocks/_html_block.haml +1 -0
  43. data/app/views/lady_josephine/blocks/_instagram_block.haml +2 -0
  44. data/app/views/lady_josephine/blocks/_list_block.haml +3 -0
  45. data/app/views/lady_josephine/blocks/_quote_block.haml +5 -0
  46. data/app/views/lady_josephine/blocks/_text_block.html.haml +2 -0
  47. data/app/views/lady_josephine/blocks/_video_block.haml +9 -0
  48. data/config/routes.rb +9 -0
  49. data/db/migrate/20160222151500_lady_josephine_image.rb +18 -0
  50. data/lib/generators/lady_josephine_migration/USAGE +9 -0
  51. data/lib/generators/lady_josephine_migration/lady_josephine_migration_generator.rb +17 -0
  52. data/lib/generators/lady_josephine_migration/templates/migration.rb +9 -0
  53. data/lib/lady_josephine.rb +18 -0
  54. data/lib/lady_josephine/engine.rb +18 -0
  55. data/lib/lady_josephine/redcarpet/custom_markdown_formatter.rb +63 -0
  56. data/lib/lady_josephine/renderer/sir_trevor_renderer.rb +16 -0
  57. data/lib/lady_josephine/version.rb +3 -0
  58. data/lib/lady_josephine/whitelist.rb +26 -0
  59. data/lib/tasks/lady_josephine_tasks.rake +4 -0
  60. data/spec/controllers/lady_josephine/editor_controller_spec.rb +58 -0
  61. data/spec/dummy/README.rdoc +28 -0
  62. data/spec/dummy/Rakefile +6 -0
  63. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  64. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  65. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  66. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  67. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  68. data/spec/dummy/bin/bundle +3 -0
  69. data/spec/dummy/bin/rails +4 -0
  70. data/spec/dummy/bin/rake +4 -0
  71. data/spec/dummy/bin/setup +29 -0
  72. data/spec/dummy/config.ru +4 -0
  73. data/spec/dummy/config/application.rb +26 -0
  74. data/spec/dummy/config/boot.rb +5 -0
  75. data/spec/dummy/config/database.yml +25 -0
  76. data/spec/dummy/config/environment.rb +5 -0
  77. data/spec/dummy/config/environments/development.rb +41 -0
  78. data/spec/dummy/config/environments/production.rb +79 -0
  79. data/spec/dummy/config/environments/test.rb +42 -0
  80. data/spec/dummy/config/initializers/assets.rb +11 -0
  81. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  82. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  83. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  84. data/spec/dummy/config/initializers/inflections.rb +16 -0
  85. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  86. data/spec/dummy/config/initializers/session_store.rb +3 -0
  87. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  88. data/spec/dummy/config/locales/en.yml +23 -0
  89. data/spec/dummy/config/routes.rb +4 -0
  90. data/spec/dummy/config/secrets.yml +22 -0
  91. data/spec/dummy/db/development.sqlite3 +0 -0
  92. data/spec/dummy/db/schema.rb +16 -0
  93. data/spec/dummy/db/test.sqlite3 +0 -0
  94. data/spec/dummy/log/bla +0 -0
  95. data/spec/dummy/public/404.html +67 -0
  96. data/spec/dummy/public/422.html +67 -0
  97. data/spec/dummy/public/500.html +66 -0
  98. data/spec/dummy/public/favicon.ico +0 -0
  99. data/spec/spec_helper.rb +17 -0
  100. data/vendor/assets/components/Eventable/README.md +12 -0
  101. data/vendor/assets/components/Eventable/bower.json +10 -0
  102. data/vendor/assets/components/Eventable/component.json +11 -0
  103. data/vendor/assets/components/Eventable/eventable.js +207 -0
  104. data/vendor/assets/components/Eventable/package.json +15 -0
  105. data/vendor/assets/components/jquery-autosize/bower.json +30 -0
  106. data/vendor/assets/components/jquery-autosize/demo.html +36 -0
  107. data/vendor/assets/components/jquery-autosize/jquery.autosize.js +273 -0
  108. data/vendor/assets/components/jquery-autosize/jquery.autosize.min.js +6 -0
  109. data/vendor/assets/components/jquery-autosize/package.json +32 -0
  110. data/vendor/assets/components/jquery-autosize/readme.md +216 -0
  111. data/vendor/assets/components/jquery/AUTHORS.txt +163 -0
  112. data/vendor/assets/components/jquery/CONTRIBUTING.md +216 -0
  113. data/vendor/assets/components/jquery/Gruntfile.js +496 -0
  114. data/vendor/assets/components/jquery/MIT-LICENSE.txt +21 -0
  115. data/vendor/assets/components/jquery/README.md +415 -0
  116. data/vendor/assets/components/jquery/build/release-notes.js +59 -0
  117. data/vendor/assets/components/jquery/build/release.js +246 -0
  118. data/vendor/assets/components/jquery/component.json +13 -0
  119. data/vendor/assets/components/jquery/composer.json +35 -0
  120. data/vendor/assets/components/jquery/jquery-migrate.js +496 -0
  121. data/vendor/assets/components/jquery/jquery-migrate.min.js +3 -0
  122. data/vendor/assets/components/jquery/jquery.js +9597 -0
  123. data/vendor/assets/components/jquery/jquery.min.js +5 -0
  124. data/vendor/assets/components/jquery/jquery.min.map +1 -0
  125. data/vendor/assets/components/jquery/package.json +39 -0
  126. data/vendor/assets/components/jquery/speed/benchmark.js +15 -0
  127. data/vendor/assets/components/jquery/speed/benchmarker.css +65 -0
  128. data/vendor/assets/components/jquery/speed/benchmarker.js +181 -0
  129. data/vendor/assets/components/jquery/speed/closest.html +39 -0
  130. data/vendor/assets/components/jquery/speed/css.html +82 -0
  131. data/vendor/assets/components/jquery/speed/event.html +58 -0
  132. data/vendor/assets/components/jquery/speed/filter.html +183 -0
  133. data/vendor/assets/components/jquery/speed/find.html +179 -0
  134. data/vendor/assets/components/jquery/speed/index.html +72 -0
  135. data/vendor/assets/components/jquery/speed/jquery-basis.js +6238 -0
  136. data/vendor/assets/components/jquery/speed/slice.vs.concat.html +47 -0
  137. data/vendor/assets/components/jquery/src/ajax.js +851 -0
  138. data/vendor/assets/components/jquery/src/ajax/jsonp.js +80 -0
  139. data/vendor/assets/components/jquery/src/ajax/script.js +86 -0
  140. data/vendor/assets/components/jquery/src/ajax/xhr.js +207 -0
  141. data/vendor/assets/components/jquery/src/attributes.js +661 -0
  142. data/vendor/assets/components/jquery/src/callbacks.js +196 -0
  143. data/vendor/assets/components/jquery/src/core.js +949 -0
  144. data/vendor/assets/components/jquery/src/css.js +679 -0
  145. data/vendor/assets/components/jquery/src/data.js +340 -0
  146. data/vendor/assets/components/jquery/src/deferred.js +141 -0
  147. data/vendor/assets/components/jquery/src/deprecated.js +4 -0
  148. data/vendor/assets/components/jquery/src/dimensions.js +41 -0
  149. data/vendor/assets/components/jquery/src/effects.js +730 -0
  150. data/vendor/assets/components/jquery/src/event-alias.js +15 -0
  151. data/vendor/assets/components/jquery/src/event.js +991 -0
  152. data/vendor/assets/components/jquery/src/exports.js +18 -0
  153. data/vendor/assets/components/jquery/src/intro.js +20 -0
  154. data/vendor/assets/components/jquery/src/manipulation.js +796 -0
  155. data/vendor/assets/components/jquery/src/offset.js +169 -0
  156. data/vendor/assets/components/jquery/src/outro.js +2 -0
  157. data/vendor/assets/components/jquery/src/queue.js +147 -0
  158. data/vendor/assets/components/jquery/src/serialize.js +99 -0
  159. data/vendor/assets/components/jquery/src/sizzle-jquery.js +9 -0
  160. data/vendor/assets/components/jquery/src/support.js +241 -0
  161. data/vendor/assets/components/jquery/src/traversing.js +275 -0
  162. data/vendor/assets/components/jquery/test/csp.php +16 -0
  163. data/vendor/assets/components/jquery/test/data/1x1.jpg +0 -0
  164. data/vendor/assets/components/jquery/test/data/ajax/unreleasedXHR.html +25 -0
  165. data/vendor/assets/components/jquery/test/data/atom+xml.php +4 -0
  166. data/vendor/assets/components/jquery/test/data/badcall.js +1 -0
  167. data/vendor/assets/components/jquery/test/data/badjson.js +1 -0
  168. data/vendor/assets/components/jquery/test/data/cleanScript.html +10 -0
  169. data/vendor/assets/components/jquery/test/data/core/cc_on.html +22 -0
  170. data/vendor/assets/components/jquery/test/data/dashboard.xml +11 -0
  171. data/vendor/assets/components/jquery/test/data/dimensions/documentLarge.html +17 -0
  172. data/vendor/assets/components/jquery/test/data/dimensions/documentSmall.html +21 -0
  173. data/vendor/assets/components/jquery/test/data/echoData.php +1 -0
  174. data/vendor/assets/components/jquery/test/data/echoQuery.php +1 -0
  175. data/vendor/assets/components/jquery/test/data/errorWithText.php +5 -0
  176. data/vendor/assets/components/jquery/test/data/etag.php +21 -0
  177. data/vendor/assets/components/jquery/test/data/evalScript.php +1 -0
  178. data/vendor/assets/components/jquery/test/data/event/longLoadScript.php +4 -0
  179. data/vendor/assets/components/jquery/test/data/event/promiseReady.html +17 -0
  180. data/vendor/assets/components/jquery/test/data/event/syncReady.html +23 -0
  181. data/vendor/assets/components/jquery/test/data/headers.php +18 -0
  182. data/vendor/assets/components/jquery/test/data/if_modified_since.php +20 -0
  183. data/vendor/assets/components/jquery/test/data/iframe.html +8 -0
  184. data/vendor/assets/components/jquery/test/data/jquery-1.8.2.ajax_xhr.min.js +2 -0
  185. data/vendor/assets/components/jquery/test/data/json.php +13 -0
  186. data/vendor/assets/components/jquery/test/data/json_obj.js +1 -0
  187. data/vendor/assets/components/jquery/test/data/jsonp.php +14 -0
  188. data/vendor/assets/components/jquery/test/data/manipulation/iframe-denied.html +36 -0
  189. data/vendor/assets/components/jquery/test/data/name.html +1 -0
  190. data/vendor/assets/components/jquery/test/data/name.php +24 -0
  191. data/vendor/assets/components/jquery/test/data/nocontent.php +5 -0
  192. data/vendor/assets/components/jquery/test/data/offset/absolute.html +41 -0
  193. data/vendor/assets/components/jquery/test/data/offset/body.html +26 -0
  194. data/vendor/assets/components/jquery/test/data/offset/fixed.html +34 -0
  195. data/vendor/assets/components/jquery/test/data/offset/relative.html +31 -0
  196. data/vendor/assets/components/jquery/test/data/offset/scroll.html +39 -0
  197. data/vendor/assets/components/jquery/test/data/offset/static.html +31 -0
  198. data/vendor/assets/components/jquery/test/data/offset/table.html +43 -0
  199. data/vendor/assets/components/jquery/test/data/params_html.php +12 -0
  200. data/vendor/assets/components/jquery/test/data/readywaitasset.js +1 -0
  201. data/vendor/assets/components/jquery/test/data/readywaitloader.js +25 -0
  202. data/vendor/assets/components/jquery/test/data/script.php +11 -0
  203. data/vendor/assets/components/jquery/test/data/selector/html5_selector.html +114 -0
  204. data/vendor/assets/components/jquery/test/data/selector/sizzle_cache.html +21 -0
  205. data/vendor/assets/components/jquery/test/data/statusText.php +5 -0
  206. data/vendor/assets/components/jquery/test/data/support/bodyBackground.html +28 -0
  207. data/vendor/assets/components/jquery/test/data/support/shrinkWrapBlocks.html +23 -0
  208. data/vendor/assets/components/jquery/test/data/support/testElementCrash.html +17 -0
  209. data/vendor/assets/components/jquery/test/data/test.html +7 -0
  210. data/vendor/assets/components/jquery/test/data/test.js +3 -0
  211. data/vendor/assets/components/jquery/test/data/test.php +7 -0
  212. data/vendor/assets/components/jquery/test/data/test2.html +5 -0
  213. data/vendor/assets/components/jquery/test/data/test3.html +3 -0
  214. data/vendor/assets/components/jquery/test/data/testinit.js +269 -0
  215. data/vendor/assets/components/jquery/test/data/testrunner.js +368 -0
  216. data/vendor/assets/components/jquery/test/data/testsuite.css +155 -0
  217. data/vendor/assets/components/jquery/test/data/text.php +12 -0
  218. data/vendor/assets/components/jquery/test/data/ua.txt +272 -0
  219. data/vendor/assets/components/jquery/test/data/with_fries.xml +25 -0
  220. data/vendor/assets/components/jquery/test/data/with_fries_over_jsonp.php +7 -0
  221. data/vendor/assets/components/jquery/test/delegatetest.html +228 -0
  222. data/vendor/assets/components/jquery/test/hovertest.html +158 -0
  223. data/vendor/assets/components/jquery/test/index.html +330 -0
  224. data/vendor/assets/components/jquery/test/localfile.html +75 -0
  225. data/vendor/assets/components/jquery/test/networkerror.html +84 -0
  226. data/vendor/assets/components/jquery/test/polluted.php +110 -0
  227. data/vendor/assets/components/jquery/test/readywait.html +70 -0
  228. data/vendor/assets/components/jquery/test/unit/ajax.js +1971 -0
  229. data/vendor/assets/components/jquery/test/unit/attributes.js +1332 -0
  230. data/vendor/assets/components/jquery/test/unit/callbacks.js +326 -0
  231. data/vendor/assets/components/jquery/test/unit/core.js +1332 -0
  232. data/vendor/assets/components/jquery/test/unit/css.js +1036 -0
  233. data/vendor/assets/components/jquery/test/unit/data.js +636 -0
  234. data/vendor/assets/components/jquery/test/unit/deferred.js +440 -0
  235. data/vendor/assets/components/jquery/test/unit/deprecated.js +1 -0
  236. data/vendor/assets/components/jquery/test/unit/dimensions.js +461 -0
  237. data/vendor/assets/components/jquery/test/unit/effects.js +2050 -0
  238. data/vendor/assets/components/jquery/test/unit/event.js +2690 -0
  239. data/vendor/assets/components/jquery/test/unit/exports.js +7 -0
  240. data/vendor/assets/components/jquery/test/unit/manipulation.js +2242 -0
  241. data/vendor/assets/components/jquery/test/unit/offset.js +549 -0
  242. data/vendor/assets/components/jquery/test/unit/queue.js +316 -0
  243. data/vendor/assets/components/jquery/test/unit/selector.js +185 -0
  244. data/vendor/assets/components/jquery/test/unit/serialize.js +146 -0
  245. data/vendor/assets/components/jquery/test/unit/support.js +384 -0
  246. data/vendor/assets/components/jquery/test/unit/traversing.js +667 -0
  247. data/vendor/assets/components/jquery/test/xhtml.php +5 -0
  248. data/vendor/assets/components/sir-trevor-js/CHANGELOG.md +44 -0
  249. data/vendor/assets/components/sir-trevor-js/Gemfile +3 -0
  250. data/vendor/assets/components/sir-trevor-js/Gemfile.lock +10 -0
  251. data/vendor/assets/components/sir-trevor-js/Gruntfile.js +109 -0
  252. data/vendor/assets/components/sir-trevor-js/MIT-LICENCE +20 -0
  253. data/vendor/assets/components/sir-trevor-js/Readme.md +84 -0
  254. data/vendor/assets/components/sir-trevor-js/bower.json +21 -0
  255. data/vendor/assets/components/sir-trevor-js/component.json +42 -0
  256. data/vendor/assets/components/sir-trevor-js/contributing.md +74 -0
  257. data/vendor/assets/components/sir-trevor-js/examples-component/component.json +14 -0
  258. data/vendor/assets/components/sir-trevor-js/examples-component/index.html +33 -0
  259. data/vendor/assets/components/sir-trevor-js/examples-component/index.js +29 -0
  260. data/vendor/assets/components/sir-trevor-js/examples-component/javascript/example_block.js +203 -0
  261. data/vendor/assets/components/sir-trevor-js/examples-component/javascript/limit_chars.js +46 -0
  262. data/vendor/assets/components/sir-trevor-js/examples-component/sir-trevor.gif +0 -0
  263. data/vendor/assets/components/sir-trevor-js/locales/cn.js +51 -0
  264. data/vendor/assets/components/sir-trevor-js/locales/de.js +51 -0
  265. data/vendor/assets/components/sir-trevor-js/locales/es.js +51 -0
  266. data/vendor/assets/components/sir-trevor-js/locales/fi.js +51 -0
  267. data/vendor/assets/components/sir-trevor-js/locales/fr.js +51 -0
  268. data/vendor/assets/components/sir-trevor-js/locales/pt.js +52 -0
  269. data/vendor/assets/components/sir-trevor-js/package.json +23 -0
  270. data/vendor/assets/components/sir-trevor-js/sir-trevor-icons.css +6 -0
  271. data/vendor/assets/components/sir-trevor-js/sir-trevor.css +393 -0
  272. data/vendor/assets/components/sir-trevor-js/sir-trevor.css.map +7 -0
  273. data/vendor/assets/components/sir-trevor-js/sir-trevor.js +5481 -0
  274. data/vendor/assets/components/sir-trevor-js/sir-trevor.min.js +13 -0
  275. data/vendor/assets/components/underscore/CNAME +1 -0
  276. data/vendor/assets/components/underscore/CONTRIBUTING.md +9 -0
  277. data/vendor/assets/components/underscore/LICENSE +22 -0
  278. data/vendor/assets/components/underscore/README.md +19 -0
  279. data/vendor/assets/components/underscore/Rakefile +10 -0
  280. data/vendor/assets/components/underscore/docs/docco.css +192 -0
  281. data/vendor/assets/components/underscore/docs/favicon.ico +0 -0
  282. data/vendor/assets/components/underscore/docs/images/background.png +0 -0
  283. data/vendor/assets/components/underscore/docs/images/underscore.png +0 -0
  284. data/vendor/assets/components/underscore/docs/underscore.html +823 -0
  285. data/vendor/assets/components/underscore/favicon.ico +0 -0
  286. data/vendor/assets/components/underscore/index.html +2467 -0
  287. data/vendor/assets/components/underscore/index.js +1 -0
  288. data/vendor/assets/components/underscore/package.json +16 -0
  289. data/vendor/assets/components/underscore/test/arrays.js +200 -0
  290. data/vendor/assets/components/underscore/test/chaining.js +59 -0
  291. data/vendor/assets/components/underscore/test/collections.js +453 -0
  292. data/vendor/assets/components/underscore/test/functions.js +265 -0
  293. data/vendor/assets/components/underscore/test/index.html +44 -0
  294. data/vendor/assets/components/underscore/test/objects.js +570 -0
  295. data/vendor/assets/components/underscore/test/speed.js +75 -0
  296. data/vendor/assets/components/underscore/test/utility.js +266 -0
  297. data/vendor/assets/components/underscore/test/vendor/jquery.js +9404 -0
  298. data/vendor/assets/components/underscore/test/vendor/jslitmus.js +670 -0
  299. data/vendor/assets/components/underscore/test/vendor/qunit.css +235 -0
  300. data/vendor/assets/components/underscore/test/vendor/qunit.js +1977 -0
  301. data/vendor/assets/components/underscore/test/vendor/runner.js +98 -0
  302. data/vendor/assets/components/underscore/underscore-min.js +1 -0
  303. data/vendor/assets/components/underscore/underscore.js +1226 -0
  304. metadata +473 -0
@@ -0,0 +1,196 @@
1
+ // String to Object options format cache
2
+ var optionsCache = {};
3
+
4
+ // Convert String-formatted options into Object-formatted ones and store in cache
5
+ function createOptions( options ) {
6
+ var object = optionsCache[ options ] = {};
7
+ jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
8
+ object[ flag ] = true;
9
+ });
10
+ return object;
11
+ }
12
+
13
+ /*
14
+ * Create a callback list using the following parameters:
15
+ *
16
+ * options: an optional list of space-separated options that will change how
17
+ * the callback list behaves or a more traditional option object
18
+ *
19
+ * By default a callback list will act like an event callback list and can be
20
+ * "fired" multiple times.
21
+ *
22
+ * Possible options:
23
+ *
24
+ * once: will ensure the callback list can only be fired once (like a Deferred)
25
+ *
26
+ * memory: will keep track of previous values and will call any callback added
27
+ * after the list has been fired right away with the latest "memorized"
28
+ * values (like a Deferred)
29
+ *
30
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
31
+ *
32
+ * stopOnFalse: interrupt callings when a callback returns false
33
+ *
34
+ */
35
+ jQuery.Callbacks = function( options ) {
36
+
37
+ // Convert options from String-formatted to Object-formatted if needed
38
+ // (we check in cache first)
39
+ options = typeof options === "string" ?
40
+ ( optionsCache[ options ] || createOptions( options ) ) :
41
+ jQuery.extend( {}, options );
42
+
43
+ var // Flag to know if list is currently firing
44
+ firing,
45
+ // Last fire value (for non-forgettable lists)
46
+ memory,
47
+ // Flag to know if list was already fired
48
+ fired,
49
+ // End of the loop when firing
50
+ firingLength,
51
+ // Index of currently firing callback (modified by remove if needed)
52
+ firingIndex,
53
+ // First callback to fire (used internally by add and fireWith)
54
+ firingStart,
55
+ // Actual callback list
56
+ list = [],
57
+ // Stack of fire calls for repeatable lists
58
+ stack = !options.once && [],
59
+ // Fire callbacks
60
+ fire = function( data ) {
61
+ memory = options.memory && data;
62
+ fired = true;
63
+ firingIndex = firingStart || 0;
64
+ firingStart = 0;
65
+ firingLength = list.length;
66
+ firing = true;
67
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
68
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
69
+ memory = false; // To prevent further calls using add
70
+ break;
71
+ }
72
+ }
73
+ firing = false;
74
+ if ( list ) {
75
+ if ( stack ) {
76
+ if ( stack.length ) {
77
+ fire( stack.shift() );
78
+ }
79
+ } else if ( memory ) {
80
+ list = [];
81
+ } else {
82
+ self.disable();
83
+ }
84
+ }
85
+ },
86
+ // Actual Callbacks object
87
+ self = {
88
+ // Add a callback or a collection of callbacks to the list
89
+ add: function() {
90
+ if ( list ) {
91
+ // First, we save the current length
92
+ var start = list.length;
93
+ (function add( args ) {
94
+ jQuery.each( args, function( _, arg ) {
95
+ var type = jQuery.type( arg );
96
+ if ( type === "function" ) {
97
+ if ( !options.unique || !self.has( arg ) ) {
98
+ list.push( arg );
99
+ }
100
+ } else if ( arg && arg.length && type !== "string" ) {
101
+ // Inspect recursively
102
+ add( arg );
103
+ }
104
+ });
105
+ })( arguments );
106
+ // Do we need to add the callbacks to the
107
+ // current firing batch?
108
+ if ( firing ) {
109
+ firingLength = list.length;
110
+ // With memory, if we're not firing then
111
+ // we should call right away
112
+ } else if ( memory ) {
113
+ firingStart = start;
114
+ fire( memory );
115
+ }
116
+ }
117
+ return this;
118
+ },
119
+ // Remove a callback from the list
120
+ remove: function() {
121
+ if ( list ) {
122
+ jQuery.each( arguments, function( _, arg ) {
123
+ var index;
124
+ while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
125
+ list.splice( index, 1 );
126
+ // Handle firing indexes
127
+ if ( firing ) {
128
+ if ( index <= firingLength ) {
129
+ firingLength--;
130
+ }
131
+ if ( index <= firingIndex ) {
132
+ firingIndex--;
133
+ }
134
+ }
135
+ }
136
+ });
137
+ }
138
+ return this;
139
+ },
140
+ // Check if a given callback is in the list.
141
+ // If no argument is given, return whether or not list has callbacks attached.
142
+ has: function( fn ) {
143
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
144
+ },
145
+ // Remove all callbacks from the list
146
+ empty: function() {
147
+ list = [];
148
+ return this;
149
+ },
150
+ // Have the list do nothing anymore
151
+ disable: function() {
152
+ list = stack = memory = undefined;
153
+ return this;
154
+ },
155
+ // Is it disabled?
156
+ disabled: function() {
157
+ return !list;
158
+ },
159
+ // Lock the list in its current state
160
+ lock: function() {
161
+ stack = undefined;
162
+ if ( !memory ) {
163
+ self.disable();
164
+ }
165
+ return this;
166
+ },
167
+ // Is it locked?
168
+ locked: function() {
169
+ return !stack;
170
+ },
171
+ // Call all callbacks with the given context and arguments
172
+ fireWith: function( context, args ) {
173
+ args = args || [];
174
+ args = [ context, args.slice ? args.slice() : args ];
175
+ if ( list && ( !fired || stack ) ) {
176
+ if ( firing ) {
177
+ stack.push( args );
178
+ } else {
179
+ fire( args );
180
+ }
181
+ }
182
+ return this;
183
+ },
184
+ // Call all the callbacks with the given arguments
185
+ fire: function() {
186
+ self.fireWith( this, arguments );
187
+ return this;
188
+ },
189
+ // To know if the callbacks have already been called at least once
190
+ fired: function() {
191
+ return !!fired;
192
+ }
193
+ };
194
+
195
+ return self;
196
+ };
@@ -0,0 +1,949 @@
1
+ var
2
+ // The deferred used on DOM ready
3
+ readyList,
4
+
5
+ // A central reference to the root jQuery(document)
6
+ rootjQuery,
7
+
8
+ // Support: IE<9
9
+ // For `typeof node.method` instead of `node.method !== undefined`
10
+ core_strundefined = typeof undefined,
11
+
12
+ // Use the correct document accordingly with window argument (sandbox)
13
+ document = window.document,
14
+ location = window.location,
15
+
16
+ // Map over jQuery in case of overwrite
17
+ _jQuery = window.jQuery,
18
+
19
+ // Map over the $ in case of overwrite
20
+ _$ = window.$,
21
+
22
+ // [[Class]] -> type pairs
23
+ class2type = {},
24
+
25
+ // List of deleted data cache ids, so we can reuse them
26
+ core_deletedIds = [],
27
+
28
+ core_version = "@VERSION",
29
+
30
+ // Save a reference to some core methods
31
+ core_concat = core_deletedIds.concat,
32
+ core_push = core_deletedIds.push,
33
+ core_slice = core_deletedIds.slice,
34
+ core_indexOf = core_deletedIds.indexOf,
35
+ core_toString = class2type.toString,
36
+ core_hasOwn = class2type.hasOwnProperty,
37
+ core_trim = core_version.trim,
38
+
39
+ // Define a local copy of jQuery
40
+ jQuery = function( selector, context ) {
41
+ // The jQuery object is actually just the init constructor 'enhanced'
42
+ return new jQuery.fn.init( selector, context, rootjQuery );
43
+ },
44
+
45
+ // Used for matching numbers
46
+ core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
47
+
48
+ // Used for splitting on whitespace
49
+ core_rnotwhite = /\S+/g,
50
+
51
+ // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
52
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
53
+
54
+ // A simple way to check for HTML strings
55
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
56
+ // Strict HTML recognition (#11290: must start with <)
57
+ rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
58
+
59
+ // Match a standalone tag
60
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
61
+
62
+ // JSON RegExp
63
+ rvalidchars = /^[\],:{}\s]*$/,
64
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
65
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
66
+ rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
67
+
68
+ // Matches dashed string for camelizing
69
+ rmsPrefix = /^-ms-/,
70
+ rdashAlpha = /-([\da-z])/gi,
71
+
72
+ // Used by jQuery.camelCase as callback to replace()
73
+ fcamelCase = function( all, letter ) {
74
+ return letter.toUpperCase();
75
+ },
76
+
77
+ // The ready event handler
78
+ completed = function( event ) {
79
+
80
+ // readyState === "complete" is good enough for us to call the dom ready in oldIE
81
+ if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
82
+ detach();
83
+ jQuery.ready();
84
+ }
85
+ },
86
+ // Clean-up method for dom ready events
87
+ detach = function() {
88
+ if ( document.addEventListener ) {
89
+ document.removeEventListener( "DOMContentLoaded", completed, false );
90
+ window.removeEventListener( "load", completed, false );
91
+
92
+ } else {
93
+ document.detachEvent( "onreadystatechange", completed );
94
+ window.detachEvent( "onload", completed );
95
+ }
96
+ };
97
+
98
+ jQuery.fn = jQuery.prototype = {
99
+ // The current version of jQuery being used
100
+ jquery: core_version,
101
+
102
+ constructor: jQuery,
103
+ init: function( selector, context, rootjQuery ) {
104
+ var match, elem;
105
+
106
+ // HANDLE: $(""), $(null), $(undefined), $(false)
107
+ if ( !selector ) {
108
+ return this;
109
+ }
110
+
111
+ // Handle HTML strings
112
+ if ( typeof selector === "string" ) {
113
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
114
+ // Assume that strings that start and end with <> are HTML and skip the regex check
115
+ match = [ null, selector, null ];
116
+
117
+ } else {
118
+ match = rquickExpr.exec( selector );
119
+ }
120
+
121
+ // Match html or make sure no context is specified for #id
122
+ if ( match && (match[1] || !context) ) {
123
+
124
+ // HANDLE: $(html) -> $(array)
125
+ if ( match[1] ) {
126
+ context = context instanceof jQuery ? context[0] : context;
127
+
128
+ // scripts is true for back-compat
129
+ jQuery.merge( this, jQuery.parseHTML(
130
+ match[1],
131
+ context && context.nodeType ? context.ownerDocument || context : document,
132
+ true
133
+ ) );
134
+
135
+ // HANDLE: $(html, props)
136
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
137
+ for ( match in context ) {
138
+ // Properties of context are called as methods if possible
139
+ if ( jQuery.isFunction( this[ match ] ) ) {
140
+ this[ match ]( context[ match ] );
141
+
142
+ // ...and otherwise set as attributes
143
+ } else {
144
+ this.attr( match, context[ match ] );
145
+ }
146
+ }
147
+ }
148
+
149
+ return this;
150
+
151
+ // HANDLE: $(#id)
152
+ } else {
153
+ elem = document.getElementById( match[2] );
154
+
155
+ // Check parentNode to catch when Blackberry 4.6 returns
156
+ // nodes that are no longer in the document #6963
157
+ if ( elem && elem.parentNode ) {
158
+ // Handle the case where IE and Opera return items
159
+ // by name instead of ID
160
+ if ( elem.id !== match[2] ) {
161
+ return rootjQuery.find( selector );
162
+ }
163
+
164
+ // Otherwise, we inject the element directly into the jQuery object
165
+ this.length = 1;
166
+ this[0] = elem;
167
+ }
168
+
169
+ this.context = document;
170
+ this.selector = selector;
171
+ return this;
172
+ }
173
+
174
+ // HANDLE: $(expr, $(...))
175
+ } else if ( !context || context.jquery ) {
176
+ return ( context || rootjQuery ).find( selector );
177
+
178
+ // HANDLE: $(expr, context)
179
+ // (which is just equivalent to: $(context).find(expr)
180
+ } else {
181
+ return this.constructor( context ).find( selector );
182
+ }
183
+
184
+ // HANDLE: $(DOMElement)
185
+ } else if ( selector.nodeType ) {
186
+ this.context = this[0] = selector;
187
+ this.length = 1;
188
+ return this;
189
+
190
+ // HANDLE: $(function)
191
+ // Shortcut for document ready
192
+ } else if ( jQuery.isFunction( selector ) ) {
193
+ return rootjQuery.ready( selector );
194
+ }
195
+
196
+ if ( selector.selector !== undefined ) {
197
+ this.selector = selector.selector;
198
+ this.context = selector.context;
199
+ }
200
+
201
+ return jQuery.makeArray( selector, this );
202
+ },
203
+
204
+ // Start with an empty selector
205
+ selector: "",
206
+
207
+ // The default length of a jQuery object is 0
208
+ length: 0,
209
+
210
+ // The number of elements contained in the matched element set
211
+ size: function() {
212
+ return this.length;
213
+ },
214
+
215
+ toArray: function() {
216
+ return core_slice.call( this );
217
+ },
218
+
219
+ // Get the Nth element in the matched element set OR
220
+ // Get the whole matched element set as a clean array
221
+ get: function( num ) {
222
+ return num == null ?
223
+
224
+ // Return a 'clean' array
225
+ this.toArray() :
226
+
227
+ // Return just the object
228
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
229
+ },
230
+
231
+ // Take an array of elements and push it onto the stack
232
+ // (returning the new matched element set)
233
+ pushStack: function( elems ) {
234
+
235
+ // Build a new jQuery matched element set
236
+ var ret = jQuery.merge( this.constructor(), elems );
237
+
238
+ // Add the old object onto the stack (as a reference)
239
+ ret.prevObject = this;
240
+ ret.context = this.context;
241
+
242
+ // Return the newly-formed element set
243
+ return ret;
244
+ },
245
+
246
+ // Execute a callback for every element in the matched set.
247
+ // (You can seed the arguments with an array of args, but this is
248
+ // only used internally.)
249
+ each: function( callback, args ) {
250
+ return jQuery.each( this, callback, args );
251
+ },
252
+
253
+ ready: function( fn ) {
254
+ // Add the callback
255
+ jQuery.ready.promise().done( fn );
256
+
257
+ return this;
258
+ },
259
+
260
+ slice: function() {
261
+ return this.pushStack( core_slice.apply( this, arguments ) );
262
+ },
263
+
264
+ first: function() {
265
+ return this.eq( 0 );
266
+ },
267
+
268
+ last: function() {
269
+ return this.eq( -1 );
270
+ },
271
+
272
+ eq: function( i ) {
273
+ var len = this.length,
274
+ j = +i + ( i < 0 ? len : 0 );
275
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
276
+ },
277
+
278
+ map: function( callback ) {
279
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
280
+ return callback.call( elem, i, elem );
281
+ }));
282
+ },
283
+
284
+ end: function() {
285
+ return this.prevObject || this.constructor(null);
286
+ },
287
+
288
+ // For internal use only.
289
+ // Behaves like an Array's method, not like a jQuery method.
290
+ push: core_push,
291
+ sort: [].sort,
292
+ splice: [].splice
293
+ };
294
+
295
+ // Give the init function the jQuery prototype for later instantiation
296
+ jQuery.fn.init.prototype = jQuery.fn;
297
+
298
+ jQuery.extend = jQuery.fn.extend = function() {
299
+ var src, copyIsArray, copy, name, options, clone,
300
+ target = arguments[0] || {},
301
+ i = 1,
302
+ length = arguments.length,
303
+ deep = false;
304
+
305
+ // Handle a deep copy situation
306
+ if ( typeof target === "boolean" ) {
307
+ deep = target;
308
+ target = arguments[1] || {};
309
+ // skip the boolean and the target
310
+ i = 2;
311
+ }
312
+
313
+ // Handle case when target is a string or something (possible in deep copy)
314
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
315
+ target = {};
316
+ }
317
+
318
+ // extend jQuery itself if only one argument is passed
319
+ if ( length === i ) {
320
+ target = this;
321
+ --i;
322
+ }
323
+
324
+ for ( ; i < length; i++ ) {
325
+ // Only deal with non-null/undefined values
326
+ if ( (options = arguments[ i ]) != null ) {
327
+ // Extend the base object
328
+ for ( name in options ) {
329
+ src = target[ name ];
330
+ copy = options[ name ];
331
+
332
+ // Prevent never-ending loop
333
+ if ( target === copy ) {
334
+ continue;
335
+ }
336
+
337
+ // Recurse if we're merging plain objects or arrays
338
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
339
+ if ( copyIsArray ) {
340
+ copyIsArray = false;
341
+ clone = src && jQuery.isArray(src) ? src : [];
342
+
343
+ } else {
344
+ clone = src && jQuery.isPlainObject(src) ? src : {};
345
+ }
346
+
347
+ // Never move original objects, clone them
348
+ target[ name ] = jQuery.extend( deep, clone, copy );
349
+
350
+ // Don't bring in undefined values
351
+ } else if ( copy !== undefined ) {
352
+ target[ name ] = copy;
353
+ }
354
+ }
355
+ }
356
+ }
357
+
358
+ // Return the modified object
359
+ return target;
360
+ };
361
+
362
+ jQuery.extend({
363
+ noConflict: function( deep ) {
364
+ if ( window.$ === jQuery ) {
365
+ window.$ = _$;
366
+ }
367
+
368
+ if ( deep && window.jQuery === jQuery ) {
369
+ window.jQuery = _jQuery;
370
+ }
371
+
372
+ return jQuery;
373
+ },
374
+
375
+ // Is the DOM ready to be used? Set to true once it occurs.
376
+ isReady: false,
377
+
378
+ // A counter to track how many items to wait for before
379
+ // the ready event fires. See #6781
380
+ readyWait: 1,
381
+
382
+ // Hold (or release) the ready event
383
+ holdReady: function( hold ) {
384
+ if ( hold ) {
385
+ jQuery.readyWait++;
386
+ } else {
387
+ jQuery.ready( true );
388
+ }
389
+ },
390
+
391
+ // Handle when the DOM is ready
392
+ ready: function( wait ) {
393
+
394
+ // Abort if there are pending holds or we're already ready
395
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
396
+ return;
397
+ }
398
+
399
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
400
+ if ( !document.body ) {
401
+ return setTimeout( jQuery.ready );
402
+ }
403
+
404
+ // Remember that the DOM is ready
405
+ jQuery.isReady = true;
406
+
407
+ // If a normal DOM Ready event fired, decrement, and wait if need be
408
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
409
+ return;
410
+ }
411
+
412
+ // If there are functions bound, to execute
413
+ readyList.resolveWith( document, [ jQuery ] );
414
+
415
+ // Trigger any bound ready events
416
+ if ( jQuery.fn.trigger ) {
417
+ jQuery( document ).trigger("ready").off("ready");
418
+ }
419
+ },
420
+
421
+ // See test/unit/core.js for details concerning isFunction.
422
+ // Since version 1.3, DOM methods and functions like alert
423
+ // aren't supported. They return false on IE (#2968).
424
+ isFunction: function( obj ) {
425
+ return jQuery.type(obj) === "function";
426
+ },
427
+
428
+ isArray: Array.isArray || function( obj ) {
429
+ return jQuery.type(obj) === "array";
430
+ },
431
+
432
+ isWindow: function( obj ) {
433
+ return obj != null && obj == obj.window;
434
+ },
435
+
436
+ isNumeric: function( obj ) {
437
+ return !isNaN( parseFloat(obj) ) && isFinite( obj );
438
+ },
439
+
440
+ type: function( obj ) {
441
+ if ( obj == null ) {
442
+ return String( obj );
443
+ }
444
+ return typeof obj === "object" || typeof obj === "function" ?
445
+ class2type[ core_toString.call(obj) ] || "object" :
446
+ typeof obj;
447
+ },
448
+
449
+ isPlainObject: function( obj ) {
450
+ // Must be an Object.
451
+ // Because of IE, we also have to check the presence of the constructor property.
452
+ // Make sure that DOM nodes and window objects don't pass through, as well
453
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
454
+ return false;
455
+ }
456
+
457
+ try {
458
+ // Not own constructor property must be Object
459
+ if ( obj.constructor &&
460
+ !core_hasOwn.call(obj, "constructor") &&
461
+ !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
462
+ return false;
463
+ }
464
+ } catch ( e ) {
465
+ // IE8,9 Will throw exceptions on certain host objects #9897
466
+ return false;
467
+ }
468
+
469
+ // Own properties are enumerated firstly, so to speed up,
470
+ // if last one is own, then all properties are own.
471
+
472
+ var key;
473
+ for ( key in obj ) {}
474
+
475
+ return key === undefined || core_hasOwn.call( obj, key );
476
+ },
477
+
478
+ isEmptyObject: function( obj ) {
479
+ var name;
480
+ for ( name in obj ) {
481
+ return false;
482
+ }
483
+ return true;
484
+ },
485
+
486
+ error: function( msg ) {
487
+ throw new Error( msg );
488
+ },
489
+
490
+ // data: string of html
491
+ // context (optional): If specified, the fragment will be created in this context, defaults to document
492
+ // keepScripts (optional): If true, will include scripts passed in the html string
493
+ parseHTML: function( data, context, keepScripts ) {
494
+ if ( !data || typeof data !== "string" ) {
495
+ return null;
496
+ }
497
+ if ( typeof context === "boolean" ) {
498
+ keepScripts = context;
499
+ context = false;
500
+ }
501
+ context = context || document;
502
+
503
+ var parsed = rsingleTag.exec( data ),
504
+ scripts = !keepScripts && [];
505
+
506
+ // Single tag
507
+ if ( parsed ) {
508
+ return [ context.createElement( parsed[1] ) ];
509
+ }
510
+
511
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
512
+ if ( scripts ) {
513
+ jQuery( scripts ).remove();
514
+ }
515
+ return jQuery.merge( [], parsed.childNodes );
516
+ },
517
+
518
+ parseJSON: function( data ) {
519
+ // Attempt to parse using the native JSON parser first
520
+ if ( window.JSON && window.JSON.parse ) {
521
+ return window.JSON.parse( data );
522
+ }
523
+
524
+ if ( data === null ) {
525
+ return data;
526
+ }
527
+
528
+ if ( typeof data === "string" ) {
529
+
530
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
531
+ data = jQuery.trim( data );
532
+
533
+ if ( data ) {
534
+ // Make sure the incoming data is actual JSON
535
+ // Logic borrowed from http://json.org/json2.js
536
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
537
+ .replace( rvalidtokens, "]" )
538
+ .replace( rvalidbraces, "")) ) {
539
+
540
+ return ( new Function( "return " + data ) )();
541
+ }
542
+ }
543
+ }
544
+
545
+ jQuery.error( "Invalid JSON: " + data );
546
+ },
547
+
548
+ // Cross-browser xml parsing
549
+ parseXML: function( data ) {
550
+ var xml, tmp;
551
+ if ( !data || typeof data !== "string" ) {
552
+ return null;
553
+ }
554
+ try {
555
+ if ( window.DOMParser ) { // Standard
556
+ tmp = new DOMParser();
557
+ xml = tmp.parseFromString( data , "text/xml" );
558
+ } else { // IE
559
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
560
+ xml.async = "false";
561
+ xml.loadXML( data );
562
+ }
563
+ } catch( e ) {
564
+ xml = undefined;
565
+ }
566
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
567
+ jQuery.error( "Invalid XML: " + data );
568
+ }
569
+ return xml;
570
+ },
571
+
572
+ noop: function() {},
573
+
574
+ // Evaluates a script in a global context
575
+ // Workarounds based on findings by Jim Driscoll
576
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
577
+ globalEval: function( data ) {
578
+ if ( data && jQuery.trim( data ) ) {
579
+ // We use execScript on Internet Explorer
580
+ // We use an anonymous function so that context is window
581
+ // rather than jQuery in Firefox
582
+ ( window.execScript || function( data ) {
583
+ window[ "eval" ].call( window, data );
584
+ } )( data );
585
+ }
586
+ },
587
+
588
+ // Convert dashed to camelCase; used by the css and data modules
589
+ // Microsoft forgot to hump their vendor prefix (#9572)
590
+ camelCase: function( string ) {
591
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
592
+ },
593
+
594
+ nodeName: function( elem, name ) {
595
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
596
+ },
597
+
598
+ // args is for internal usage only
599
+ each: function( obj, callback, args ) {
600
+ var value,
601
+ i = 0,
602
+ length = obj.length,
603
+ isArray = isArraylike( obj );
604
+
605
+ if ( args ) {
606
+ if ( isArray ) {
607
+ for ( ; i < length; i++ ) {
608
+ value = callback.apply( obj[ i ], args );
609
+
610
+ if ( value === false ) {
611
+ break;
612
+ }
613
+ }
614
+ } else {
615
+ for ( i in obj ) {
616
+ value = callback.apply( obj[ i ], args );
617
+
618
+ if ( value === false ) {
619
+ break;
620
+ }
621
+ }
622
+ }
623
+
624
+ // A special, fast, case for the most common use of each
625
+ } else {
626
+ if ( isArray ) {
627
+ for ( ; i < length; i++ ) {
628
+ value = callback.call( obj[ i ], i, obj[ i ] );
629
+
630
+ if ( value === false ) {
631
+ break;
632
+ }
633
+ }
634
+ } else {
635
+ for ( i in obj ) {
636
+ value = callback.call( obj[ i ], i, obj[ i ] );
637
+
638
+ if ( value === false ) {
639
+ break;
640
+ }
641
+ }
642
+ }
643
+ }
644
+
645
+ return obj;
646
+ },
647
+
648
+ // Use native String.trim function wherever possible
649
+ trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
650
+ function( text ) {
651
+ return text == null ?
652
+ "" :
653
+ core_trim.call( text );
654
+ } :
655
+
656
+ // Otherwise use our own trimming functionality
657
+ function( text ) {
658
+ return text == null ?
659
+ "" :
660
+ ( text + "" ).replace( rtrim, "" );
661
+ },
662
+
663
+ // results is for internal usage only
664
+ makeArray: function( arr, results ) {
665
+ var ret = results || [];
666
+
667
+ if ( arr != null ) {
668
+ if ( isArraylike( Object(arr) ) ) {
669
+ jQuery.merge( ret,
670
+ typeof arr === "string" ?
671
+ [ arr ] : arr
672
+ );
673
+ } else {
674
+ core_push.call( ret, arr );
675
+ }
676
+ }
677
+
678
+ return ret;
679
+ },
680
+
681
+ inArray: function( elem, arr, i ) {
682
+ var len;
683
+
684
+ if ( arr ) {
685
+ if ( core_indexOf ) {
686
+ return core_indexOf.call( arr, elem, i );
687
+ }
688
+
689
+ len = arr.length;
690
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
691
+
692
+ for ( ; i < len; i++ ) {
693
+ // Skip accessing in sparse arrays
694
+ if ( i in arr && arr[ i ] === elem ) {
695
+ return i;
696
+ }
697
+ }
698
+ }
699
+
700
+ return -1;
701
+ },
702
+
703
+ merge: function( first, second ) {
704
+ var l = second.length,
705
+ i = first.length,
706
+ j = 0;
707
+
708
+ if ( typeof l === "number" ) {
709
+ for ( ; j < l; j++ ) {
710
+ first[ i++ ] = second[ j ];
711
+ }
712
+ } else {
713
+ while ( second[j] !== undefined ) {
714
+ first[ i++ ] = second[ j++ ];
715
+ }
716
+ }
717
+
718
+ first.length = i;
719
+
720
+ return first;
721
+ },
722
+
723
+ grep: function( elems, callback, inv ) {
724
+ var retVal,
725
+ ret = [],
726
+ i = 0,
727
+ length = elems.length;
728
+ inv = !!inv;
729
+
730
+ // Go through the array, only saving the items
731
+ // that pass the validator function
732
+ for ( ; i < length; i++ ) {
733
+ retVal = !!callback( elems[ i ], i );
734
+ if ( inv !== retVal ) {
735
+ ret.push( elems[ i ] );
736
+ }
737
+ }
738
+
739
+ return ret;
740
+ },
741
+
742
+ // arg is for internal usage only
743
+ map: function( elems, callback, arg ) {
744
+ var value,
745
+ i = 0,
746
+ length = elems.length,
747
+ isArray = isArraylike( elems ),
748
+ ret = [];
749
+
750
+ // Go through the array, translating each of the items to their
751
+ if ( isArray ) {
752
+ for ( ; i < length; i++ ) {
753
+ value = callback( elems[ i ], i, arg );
754
+
755
+ if ( value != null ) {
756
+ ret[ ret.length ] = value;
757
+ }
758
+ }
759
+
760
+ // Go through every key on the object,
761
+ } else {
762
+ for ( i in elems ) {
763
+ value = callback( elems[ i ], i, arg );
764
+
765
+ if ( value != null ) {
766
+ ret[ ret.length ] = value;
767
+ }
768
+ }
769
+ }
770
+
771
+ // Flatten any nested arrays
772
+ return core_concat.apply( [], ret );
773
+ },
774
+
775
+ // A global GUID counter for objects
776
+ guid: 1,
777
+
778
+ // Bind a function to a context, optionally partially applying any
779
+ // arguments.
780
+ proxy: function( fn, context ) {
781
+ var args, proxy, tmp;
782
+
783
+ if ( typeof context === "string" ) {
784
+ tmp = fn[ context ];
785
+ context = fn;
786
+ fn = tmp;
787
+ }
788
+
789
+ // Quick check to determine if target is callable, in the spec
790
+ // this throws a TypeError, but we will just return undefined.
791
+ if ( !jQuery.isFunction( fn ) ) {
792
+ return undefined;
793
+ }
794
+
795
+ // Simulated bind
796
+ args = core_slice.call( arguments, 2 );
797
+ proxy = function() {
798
+ return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
799
+ };
800
+
801
+ // Set the guid of unique handler to the same of original handler, so it can be removed
802
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
803
+
804
+ return proxy;
805
+ },
806
+
807
+ // Multifunctional method to get and set values of a collection
808
+ // The value/s can optionally be executed if it's a function
809
+ access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
810
+ var i = 0,
811
+ length = elems.length,
812
+ bulk = key == null;
813
+
814
+ // Sets many values
815
+ if ( jQuery.type( key ) === "object" ) {
816
+ chainable = true;
817
+ for ( i in key ) {
818
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
819
+ }
820
+
821
+ // Sets one value
822
+ } else if ( value !== undefined ) {
823
+ chainable = true;
824
+
825
+ if ( !jQuery.isFunction( value ) ) {
826
+ raw = true;
827
+ }
828
+
829
+ if ( bulk ) {
830
+ // Bulk operations run against the entire set
831
+ if ( raw ) {
832
+ fn.call( elems, value );
833
+ fn = null;
834
+
835
+ // ...except when executing function values
836
+ } else {
837
+ bulk = fn;
838
+ fn = function( elem, key, value ) {
839
+ return bulk.call( jQuery( elem ), value );
840
+ };
841
+ }
842
+ }
843
+
844
+ if ( fn ) {
845
+ for ( ; i < length; i++ ) {
846
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
847
+ }
848
+ }
849
+ }
850
+
851
+ return chainable ?
852
+ elems :
853
+
854
+ // Gets
855
+ bulk ?
856
+ fn.call( elems ) :
857
+ length ? fn( elems[0], key ) : emptyGet;
858
+ },
859
+
860
+ now: function() {
861
+ return ( new Date() ).getTime();
862
+ }
863
+ });
864
+
865
+ jQuery.ready.promise = function( obj ) {
866
+ if ( !readyList ) {
867
+
868
+ readyList = jQuery.Deferred();
869
+
870
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
871
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
872
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
873
+ if ( document.readyState === "complete" ) {
874
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
875
+ setTimeout( jQuery.ready );
876
+
877
+ // Standards-based browsers support DOMContentLoaded
878
+ } else if ( document.addEventListener ) {
879
+ // Use the handy event callback
880
+ document.addEventListener( "DOMContentLoaded", completed, false );
881
+
882
+ // A fallback to window.onload, that will always work
883
+ window.addEventListener( "load", completed, false );
884
+
885
+ // If IE event model is used
886
+ } else {
887
+ // Ensure firing before onload, maybe late but safe also for iframes
888
+ document.attachEvent( "onreadystatechange", completed );
889
+
890
+ // A fallback to window.onload, that will always work
891
+ window.attachEvent( "onload", completed );
892
+
893
+ // If IE and not a frame
894
+ // continually check to see if the document is ready
895
+ var top = false;
896
+
897
+ try {
898
+ top = window.frameElement == null && document.documentElement;
899
+ } catch(e) {}
900
+
901
+ if ( top && top.doScroll ) {
902
+ (function doScrollCheck() {
903
+ if ( !jQuery.isReady ) {
904
+
905
+ try {
906
+ // Use the trick by Diego Perini
907
+ // http://javascript.nwbox.com/IEContentLoaded/
908
+ top.doScroll("left");
909
+ } catch(e) {
910
+ return setTimeout( doScrollCheck, 50 );
911
+ }
912
+
913
+ // detach all dom ready events
914
+ detach();
915
+
916
+ // and execute any waiting functions
917
+ jQuery.ready();
918
+ }
919
+ })();
920
+ }
921
+ }
922
+ }
923
+ return readyList.promise( obj );
924
+ };
925
+
926
+ // Populate the class2type map
927
+ jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
928
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
929
+ });
930
+
931
+ function isArraylike( obj ) {
932
+ var length = obj.length,
933
+ type = jQuery.type( obj );
934
+
935
+ if ( jQuery.isWindow( obj ) ) {
936
+ return false;
937
+ }
938
+
939
+ if ( obj.nodeType === 1 && length ) {
940
+ return true;
941
+ }
942
+
943
+ return type === "array" || type !== "function" &&
944
+ ( length === 0 ||
945
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj );
946
+ }
947
+
948
+ // All jQuery objects should point back to these
949
+ rootjQuery = jQuery(document);