epuber 0.5.7 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -2
  3. data/README.md +20 -26
  4. data/bin/epuber +2 -3
  5. data/epuber.gemspec +10 -12
  6. data/lib/epuber/book/contributor.rb +1 -1
  7. data/lib/epuber/book/file_request.rb +1 -1
  8. data/lib/epuber/book/target.rb +1 -2
  9. data/lib/epuber/book/toc_item.rb +1 -2
  10. data/lib/epuber/book.rb +1 -2
  11. data/lib/epuber/checker/text_checker.rb +1 -1
  12. data/lib/epuber/checker.rb +1 -2
  13. data/lib/epuber/checker_transformer_base.rb +1 -0
  14. data/lib/epuber/command/build.rb +1 -2
  15. data/lib/epuber/command/compile.rb +1 -1
  16. data/lib/epuber/command/init.rb +1 -2
  17. data/lib/epuber/command/server.rb +1 -2
  18. data/lib/epuber/command.rb +1 -1
  19. data/lib/epuber/compiler/compilation_context.rb +1 -1
  20. data/lib/epuber/compiler/file_database.rb +3 -5
  21. data/lib/epuber/compiler/file_finders/abstract.rb +1 -1
  22. data/lib/epuber/compiler/file_finders/imaginary.rb +1 -2
  23. data/lib/epuber/compiler/file_finders/normal.rb +1 -1
  24. data/lib/epuber/compiler/file_resolver.rb +1 -2
  25. data/lib/epuber/compiler/file_stat.rb +0 -1
  26. data/lib/epuber/compiler/file_types/abstract_file.rb +1 -2
  27. data/lib/epuber/compiler/file_types/bade_file.rb +1 -2
  28. data/lib/epuber/compiler/file_types/coffee_script_file.rb +1 -2
  29. data/lib/epuber/compiler/file_types/container_xml_file.rb +1 -2
  30. data/lib/epuber/compiler/file_types/generated_file.rb +1 -2
  31. data/lib/epuber/compiler/file_types/ibooks_display_options_file.rb +1 -7
  32. data/lib/epuber/compiler/file_types/image_file.rb +1 -2
  33. data/lib/epuber/compiler/file_types/mime_type_file.rb +1 -2
  34. data/lib/epuber/compiler/file_types/nav_file.rb +1 -2
  35. data/lib/epuber/compiler/file_types/opf_file.rb +1 -2
  36. data/lib/epuber/compiler/file_types/source_file.rb +1 -2
  37. data/lib/epuber/compiler/file_types/static_file.rb +1 -2
  38. data/lib/epuber/compiler/file_types/stylus_file.rb +1 -2
  39. data/lib/epuber/compiler/file_types/xhtml_file.rb +2 -4
  40. data/lib/epuber/compiler/generator.rb +1 -1
  41. data/lib/epuber/compiler/meta_inf_generator.rb +1 -1
  42. data/lib/epuber/compiler/nav_generator.rb +1 -1
  43. data/lib/epuber/compiler/opf_generator.rb +1 -1
  44. data/lib/epuber/compiler/problem.rb +1 -2
  45. data/lib/epuber/compiler/xhtml_processor.rb +6 -6
  46. data/lib/epuber/compiler.rb +7 -11
  47. data/lib/epuber/config.rb +3 -4
  48. data/lib/epuber/dsl/attribute.rb +1 -1
  49. data/lib/epuber/dsl/attribute_support.rb +2 -2
  50. data/lib/epuber/dsl/object.rb +1 -1
  51. data/lib/epuber/dsl/tree_object.rb +1 -1
  52. data/lib/epuber/helper.rb +1 -1
  53. data/lib/epuber/lockfile.rb +1 -1
  54. data/lib/epuber/plugin.rb +1 -1
  55. data/lib/epuber/ruby_extensions/match_data.rb +1 -0
  56. data/lib/epuber/ruby_extensions/thread.rb +1 -0
  57. data/lib/epuber/server/handlers.rb +1 -1
  58. data/lib/epuber/server.rb +3 -2
  59. data/lib/epuber/templates.rb +2 -1
  60. data/lib/epuber/third_party/bower/bower.json +3 -3
  61. data/lib/epuber/third_party/bower/bower_components/cookies-js/bower.json +1 -1
  62. data/lib/epuber/third_party/bower/bower_components/cookies-js/dist/cookies.js +2 -3
  63. data/lib/epuber/third_party/bower/bower_components/cookies-js/dist/cookies.min.js +6 -6
  64. data/lib/epuber/third_party/bower/bower_components/jquery/AUTHORS.txt +278 -0
  65. data/lib/epuber/third_party/bower/bower_components/jquery/{MIT-LICENSE.txt → LICENSE.txt} +17 -2
  66. data/lib/epuber/third_party/bower/bower_components/jquery/README.md +65 -0
  67. data/lib/epuber/third_party/bower/bower_components/jquery/bower.json +2 -16
  68. data/lib/epuber/third_party/bower/bower_components/jquery/dist/jquery.js +2566 -1962
  69. data/lib/epuber/third_party/bower/bower_components/jquery/dist/jquery.min.js +4 -5
  70. data/lib/epuber/third_party/bower/bower_components/jquery/dist/jquery.min.map +1 -1
  71. data/lib/epuber/third_party/bower/bower_components/jquery/external/sizzle/LICENSE.txt +36 -0
  72. data/lib/epuber/third_party/bower/bower_components/jquery/{src → external}/sizzle/dist/sizzle.js +236 -160
  73. data/lib/epuber/third_party/bower/bower_components/jquery/external/sizzle/dist/sizzle.min.js +3 -0
  74. data/lib/epuber/third_party/bower/bower_components/jquery/external/sizzle/dist/sizzle.min.map +1 -0
  75. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/jsonp.js +25 -14
  76. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/load.js +20 -12
  77. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/parseJSON.js +2 -2
  78. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/parseXML.js +4 -5
  79. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js +16 -12
  80. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/var/location.js +3 -0
  81. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/var/nonce.js +2 -2
  82. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/var/rquery.js +3 -3
  83. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/xhr.js +73 -42
  84. data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax.js +116 -57
  85. data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/attr.js +49 -48
  86. data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/classes.js +86 -67
  87. data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/prop.js +63 -32
  88. data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/support.js +6 -5
  89. data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/val.js +40 -24
  90. data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes.js +2 -2
  91. data/lib/epuber/third_party/bower/bower_components/jquery/src/callbacks.js +114 -87
  92. data/lib/epuber/third_party/bower/bower_components/jquery/src/core/access.js +11 -6
  93. data/lib/epuber/third_party/bower/bower_components/jquery/src/core/init.js +27 -16
  94. data/lib/epuber/third_party/bower/bower_components/jquery/src/core/parseHTML.js +10 -8
  95. data/lib/epuber/third_party/bower/bower_components/jquery/src/core/ready.js +20 -14
  96. data/lib/epuber/third_party/bower/bower_components/jquery/src/core/var/rsingleTag.js +4 -3
  97. data/lib/epuber/third_party/bower/bower_components/jquery/src/core.js +77 -85
  98. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/addGetHookIf.js +5 -3
  99. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/adjustCSS.js +65 -0
  100. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/curCSS.js +20 -17
  101. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/defaultDisplay.js +16 -14
  102. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/hiddenVisibleSelectors.js +9 -6
  103. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/showHide.js +48 -0
  104. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/support.js +86 -61
  105. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/cssExpand.js +2 -2
  106. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/getStyles.js +8 -5
  107. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/isHidden.js +6 -3
  108. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/rmargin.js +3 -3
  109. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/rnumnonpx.js +2 -2
  110. data/lib/epuber/third_party/bower/bower_components/jquery/src/css/{swap.js → var/swap.js} +3 -7
  111. data/lib/epuber/third_party/bower/bower_components/jquery/src/css.js +107 -55
  112. data/lib/epuber/third_party/bower/bower_components/jquery/src/data/Data.js +93 -74
  113. data/lib/epuber/third_party/bower/bower_components/jquery/src/data/{accepts.js → var/acceptData.js} +4 -6
  114. data/lib/epuber/third_party/bower/bower_components/jquery/src/data/var/{data_priv.js → dataPriv.js} +2 -2
  115. data/lib/epuber/third_party/bower/bower_components/jquery/src/data/var/{data_user.js → dataUser.js} +2 -2
  116. data/lib/epuber/third_party/bower/bower_components/jquery/src/data.js +49 -40
  117. data/lib/epuber/third_party/bower/bower_components/jquery/src/deferred.js +34 -25
  118. data/lib/epuber/third_party/bower/bower_components/jquery/src/deprecated.js +27 -8
  119. data/lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js +9 -5
  120. data/lib/epuber/third_party/bower/bower_components/jquery/src/effects/Tween.js +14 -7
  121. data/lib/epuber/third_party/bower/bower_components/jquery/src/effects/animatedSelector.js +4 -4
  122. data/lib/epuber/third_party/bower/bower_components/jquery/src/effects.js +96 -115
  123. data/lib/epuber/third_party/bower/bower_components/jquery/src/event/ajax.js +11 -4
  124. data/lib/epuber/third_party/bower/bower_components/jquery/src/event/alias.js +11 -23
  125. data/lib/epuber/third_party/bower/bower_components/jquery/src/event/focusin.js +53 -0
  126. data/lib/epuber/third_party/bower/bower_components/jquery/src/event/support.js +3 -3
  127. data/lib/epuber/third_party/bower/bower_components/jquery/src/event/trigger.js +183 -0
  128. data/lib/epuber/third_party/bower/bower_components/jquery/src/event.js +168 -325
  129. data/lib/epuber/third_party/bower/bower_components/jquery/src/exports/amd.js +3 -3
  130. data/lib/epuber/third_party/bower/bower_components/jquery/src/exports/global.js +2 -8
  131. data/lib/epuber/third_party/bower/bower_components/jquery/src/intro.js +1 -1
  132. data/lib/epuber/third_party/bower/bower_components/jquery/src/jquery.js +5 -5
  133. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/_evalUrl.js +6 -4
  134. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/buildFragment.js +102 -0
  135. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/getAll.js +21 -0
  136. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/setGlobalEval.js +20 -0
  137. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/support.js +7 -6
  138. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -3
  139. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/var/rscriptType.js +3 -0
  140. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/var/rtagName.js +3 -0
  141. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/wrapMap.js +27 -0
  142. data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation.js +206 -305
  143. data/lib/epuber/third_party/bower/bower_components/jquery/src/offset.js +40 -29
  144. data/lib/epuber/third_party/bower/bower_components/jquery/src/outro.js +1 -0
  145. data/lib/epuber/third_party/bower/bower_components/jquery/src/queue/delay.js +6 -6
  146. data/lib/epuber/third_party/bower/bower_components/jquery/src/queue.js +23 -22
  147. data/lib/epuber/third_party/bower/bower_components/jquery/src/selector-native.js +107 -68
  148. data/lib/epuber/third_party/bower/bower_components/jquery/src/selector-sizzle.js +5 -5
  149. data/lib/epuber/third_party/bower/bower_components/jquery/src/selector.js +1 -1
  150. data/lib/epuber/third_party/bower/bower_components/jquery/src/serialize.js +28 -14
  151. data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/findFilter.js +13 -13
  152. data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/var/dir.js +20 -0
  153. data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/var/rneedsContext.js +2 -2
  154. data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/var/siblings.js +15 -0
  155. data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing.js +32 -56
  156. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/arr.js +2 -2
  157. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/class2type.js +3 -2
  158. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/concat.js +2 -2
  159. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/document.js +3 -0
  160. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/documentElement.js +5 -0
  161. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/hasOwn.js +2 -2
  162. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/indexOf.js +2 -2
  163. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/pnum.js +3 -3
  164. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/push.js +2 -2
  165. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/rcssNum.js +7 -0
  166. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/rnotwhite.js +3 -3
  167. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/slice.js +2 -2
  168. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/support.js +3 -2
  169. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/toString.js +2 -2
  170. data/lib/epuber/third_party/bower/bower_components/jquery/src/wrap.js +19 -19
  171. data/lib/epuber/third_party/bower/bower_components/spin.js/{LICENSE.txt → LICENSE.md} +2 -1
  172. data/lib/epuber/third_party/bower/bower_components/spin.js/README.md +21 -21
  173. data/lib/epuber/third_party/bower/bower_components/spin.js/bower.json +0 -1
  174. data/lib/epuber/third_party/bower/bower_components/spin.js/jquery.spin.js +23 -24
  175. data/lib/epuber/third_party/bower/bower_components/spin.js/spin.js +153 -113
  176. data/lib/epuber/third_party/bower/bower_components/spin.js/spin.min.js +2 -0
  177. data/lib/epuber/third_party/bower/bower_components/uri.js/CHANGELOG.md +424 -0
  178. data/lib/epuber/third_party/bower/bower_components/uri.js/README.md +23 -308
  179. data/lib/epuber/third_party/bower/bower_components/uri.js/SECURITY.md +12 -0
  180. data/lib/epuber/third_party/bower/bower_components/uri.js/bower.json +2 -2
  181. data/lib/epuber/third_party/bower/bower_components/uri.js/contributing.md +0 -4
  182. data/lib/epuber/third_party/bower/bower_components/uri.js/src/IPv6.js +3 -6
  183. data/lib/epuber/third_party/bower/bower_components/uri.js/src/SecondLevelDomains.js +8 -4
  184. data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.fragmentQuery.js +21 -4
  185. data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.fragmentURI.js +1 -1
  186. data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.js +312 -69
  187. data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.min.js +85 -77
  188. data/lib/epuber/third_party/bower/bower_components/uri.js/src/URITemplate.js +28 -11
  189. data/lib/epuber/third_party/bower/bower_components/uri.js/src/jquery.URI.js +17 -18
  190. data/lib/epuber/third_party/bower/bower_components/uri.js/src/jquery.URI.min.js +6 -6
  191. data/lib/epuber/third_party/bower/bower_components/uri.js/src/punycode.js +63 -38
  192. data/lib/epuber/third_party/bower.rb +2 -0
  193. data/lib/epuber/transformer/text_transformer.rb +1 -2
  194. data/lib/epuber/transformer.rb +1 -2
  195. data/lib/epuber/user_interface.rb +1 -1
  196. data/lib/epuber/vendor/hash_binding.rb +1 -1
  197. data/lib/epuber/vendor/nokogiri_extensions.rb +24 -21
  198. data/lib/epuber/vendor/ruby_templater.rb +1 -2
  199. data/lib/epuber/vendor/size.rb +1 -0
  200. data/lib/epuber/vendor/version.rb +1 -1
  201. data/lib/epuber/version.rb +2 -1
  202. data/lib/epuber.rb +1 -1
  203. metadata +77 -46
  204. data/lib/epuber/ruby_extensions/string.rb +0 -16
  205. data/lib/epuber/third_party/bower/bower_components/jquery/src/sizzle/dist/sizzle.min.js +0 -3
  206. data/lib/epuber/third_party/bower/bower_components/jquery/src/sizzle/dist/sizzle.min.map +0 -1
  207. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/strundefined.js +0 -3
  208. data/lib/epuber/vendor/globals_context.rb +0 -26
@@ -1,69 +1,80 @@
1
- define([
1
+ define( [
2
2
  "../core",
3
3
  "../var/rnotwhite",
4
- "./accepts"
5
- ], function( jQuery, rnotwhite ) {
4
+ "./var/acceptData"
5
+ ], function( jQuery, rnotwhite, acceptData ) {
6
6
 
7
7
  function Data() {
8
- // Support: Android<4,
9
- // Old WebKit does not have Object.preventExtensions/freeze method,
10
- // return new empty object instead with no [[set]] accessor
11
- Object.defineProperty( this.cache = {}, 0, {
12
- get: function() {
13
- return {};
14
- }
15
- });
16
-
17
8
  this.expando = jQuery.expando + Data.uid++;
18
9
  }
19
10
 
20
11
  Data.uid = 1;
21
- Data.accepts = jQuery.acceptData;
22
12
 
23
13
  Data.prototype = {
24
- key: function( owner ) {
14
+
15
+ register: function( owner, initial ) {
16
+ var value = initial || {};
17
+
18
+ // If it is a node unlikely to be stringify-ed or looped over
19
+ // use plain assignment
20
+ if ( owner.nodeType ) {
21
+ owner[ this.expando ] = value;
22
+
23
+ // Otherwise secure it in a non-enumerable, non-writable property
24
+ // configurability must be true to allow the property to be
25
+ // deleted with the delete operator
26
+ } else {
27
+ Object.defineProperty( owner, this.expando, {
28
+ value: value,
29
+ writable: true,
30
+ configurable: true
31
+ } );
32
+ }
33
+ return owner[ this.expando ];
34
+ },
35
+ cache: function( owner ) {
36
+
25
37
  // We can accept data for non-element nodes in modern browsers,
26
38
  // but we should not, see #8335.
27
- // Always return the key for a frozen object.
28
- if ( !Data.accepts( owner ) ) {
29
- return 0;
39
+ // Always return an empty object.
40
+ if ( !acceptData( owner ) ) {
41
+ return {};
30
42
  }
31
43
 
32
- var descriptor = {},
33
- // Check if the owner object already has a cache key
34
- unlock = owner[ this.expando ];
44
+ // Check if the owner object already has a cache
45
+ var value = owner[ this.expando ];
35
46
 
36
47
  // If not, create one
37
- if ( !unlock ) {
38
- unlock = Data.uid++;
39
-
40
- // Secure it in a non-enumerable, non-writable property
41
- try {
42
- descriptor[ this.expando ] = { value: unlock };
43
- Object.defineProperties( owner, descriptor );
44
-
45
- // Support: Android<4
46
- // Fallback to a less secure definition
47
- } catch ( e ) {
48
- descriptor[ this.expando ] = unlock;
49
- jQuery.extend( owner, descriptor );
48
+ if ( !value ) {
49
+ value = {};
50
+
51
+ // We can accept data for non-element nodes in modern browsers,
52
+ // but we should not, see #8335.
53
+ // Always return an empty object.
54
+ if ( acceptData( owner ) ) {
55
+
56
+ // If it is a node unlikely to be stringify-ed or looped over
57
+ // use plain assignment
58
+ if ( owner.nodeType ) {
59
+ owner[ this.expando ] = value;
60
+
61
+ // Otherwise secure it in a non-enumerable property
62
+ // configurable must be true to allow the property to be
63
+ // deleted when data is removed
64
+ } else {
65
+ Object.defineProperty( owner, this.expando, {
66
+ value: value,
67
+ configurable: true
68
+ } );
69
+ }
50
70
  }
51
71
  }
52
72
 
53
- // Ensure the cache object
54
- if ( !this.cache[ unlock ] ) {
55
- this.cache[ unlock ] = {};
56
- }
57
-
58
- return unlock;
73
+ return value;
59
74
  },
60
75
  set: function( owner, data, value ) {
61
76
  var prop,
62
- // There may be an unlock assigned to this node,
63
- // if there is no entry for this "owner", create one inline
64
- // and set the unlock as though an owner entry had always existed
65
- unlock = this.key( owner ),
66
- cache = this.cache[ unlock ];
77
+ cache = this.cache( owner );
67
78
 
68
79
  // Handle: [ owner, key, value ] args
69
80
  if ( typeof data === "string" ) {
@@ -71,30 +82,22 @@ Data.prototype = {
71
82
 
72
83
  // Handle: [ owner, { properties } ] args
73
84
  } else {
74
- // Fresh assignments by object are shallow copied
75
- if ( jQuery.isEmptyObject( cache ) ) {
76
- jQuery.extend( this.cache[ unlock ], data );
77
- // Otherwise, copy the properties one-by-one to the cache object
78
- } else {
79
- for ( prop in data ) {
80
- cache[ prop ] = data[ prop ];
81
- }
85
+
86
+ // Copy the properties one-by-one to the cache object
87
+ for ( prop in data ) {
88
+ cache[ prop ] = data[ prop ];
82
89
  }
83
90
  }
84
91
  return cache;
85
92
  },
86
93
  get: function( owner, key ) {
87
- // Either a valid cache is found, or will be created.
88
- // New caches will be created and the unlock returned,
89
- // allowing direct access to the newly created
90
- // empty data object. A valid owner object must be provided.
91
- var cache = this.cache[ this.key( owner ) ];
92
-
93
94
  return key === undefined ?
94
- cache : cache[ key ];
95
+ this.cache( owner ) :
96
+ owner[ this.expando ] && owner[ this.expando ][ key ];
95
97
  },
96
98
  access: function( owner, key, value ) {
97
99
  var stored;
100
+
98
101
  // In cases where either:
99
102
  //
100
103
  // 1. No key was specified
@@ -107,15 +110,15 @@ Data.prototype = {
107
110
  // 2. The data stored at the key
108
111
  //
109
112
  if ( key === undefined ||
110
- ((key && typeof key === "string") && value === undefined) ) {
113
+ ( ( key && typeof key === "string" ) && value === undefined ) ) {
111
114
 
112
115
  stored = this.get( owner, key );
113
116
 
114
117
  return stored !== undefined ?
115
- stored : this.get( owner, jQuery.camelCase(key) );
118
+ stored : this.get( owner, jQuery.camelCase( key ) );
116
119
  }
117
120
 
118
- // [*]When the key is not a string, or both a key and value
121
+ // When the key is not a string, or both a key and value
119
122
  // are specified, set or extend (existing objects) with either:
120
123
  //
121
124
  // 1. An object of properties
@@ -129,15 +132,20 @@ Data.prototype = {
129
132
  },
130
133
  remove: function( owner, key ) {
131
134
  var i, name, camel,
132
- unlock = this.key( owner ),
133
- cache = this.cache[ unlock ];
135
+ cache = owner[ this.expando ];
136
+
137
+ if ( cache === undefined ) {
138
+ return;
139
+ }
134
140
 
135
141
  if ( key === undefined ) {
136
- this.cache[ unlock ] = {};
142
+ this.register( owner );
137
143
 
138
144
  } else {
145
+
139
146
  // Support array or space separated string of keys
140
147
  if ( jQuery.isArray( key ) ) {
148
+
141
149
  // If "name" is an array of keys...
142
150
  // When data is initially created, via ("key", "val") signature,
143
151
  // keys will be converted to camelCase.
@@ -147,10 +155,12 @@ Data.prototype = {
147
155
  name = key.concat( key.map( jQuery.camelCase ) );
148
156
  } else {
149
157
  camel = jQuery.camelCase( key );
158
+
150
159
  // Try the string as a key before any manipulation
151
160
  if ( key in cache ) {
152
161
  name = [ key, camel ];
153
162
  } else {
163
+
154
164
  // If a key with the spaces exists, use it.
155
165
  // Otherwise, create an array by matching non-whitespace
156
166
  name = camel;
@@ -160,22 +170,31 @@ Data.prototype = {
160
170
  }
161
171
 
162
172
  i = name.length;
173
+
163
174
  while ( i-- ) {
164
175
  delete cache[ name[ i ] ];
165
176
  }
166
177
  }
178
+
179
+ // Remove the expando if there's no more data
180
+ if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
181
+
182
+ // Support: Chrome <= 35-45+
183
+ // Webkit & Blink performance suffers when deleting properties
184
+ // from DOM nodes, so set to undefined instead
185
+ // https://code.google.com/p/chromium/issues/detail?id=378607
186
+ if ( owner.nodeType ) {
187
+ owner[ this.expando ] = undefined;
188
+ } else {
189
+ delete owner[ this.expando ];
190
+ }
191
+ }
167
192
  },
168
193
  hasData: function( owner ) {
169
- return !jQuery.isEmptyObject(
170
- this.cache[ owner[ this.expando ] ] || {}
171
- );
172
- },
173
- discard: function( owner ) {
174
- if ( owner[ this.expando ] ) {
175
- delete this.cache[ owner[ this.expando ] ];
176
- }
194
+ var cache = owner[ this.expando ];
195
+ return cache !== undefined && !jQuery.isEmptyObject( cache );
177
196
  }
178
197
  };
179
198
 
180
199
  return Data;
181
- });
200
+ } );
@@ -1,11 +1,10 @@
1
- define([
2
- "../core"
3
- ], function( jQuery ) {
1
+ define( function() {
4
2
 
5
3
  /**
6
4
  * Determines whether an object can have data
7
5
  */
8
- jQuery.acceptData = function( owner ) {
6
+ return function( owner ) {
7
+
9
8
  // Accepts only:
10
9
  // - Node
11
10
  // - Node.ELEMENT_NODE
@@ -16,5 +15,4 @@ jQuery.acceptData = function( owner ) {
16
15
  return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
17
16
  };
18
17
 
19
- return jQuery.acceptData;
20
- });
18
+ } );
@@ -1,5 +1,5 @@
1
- define([
1
+ define( [
2
2
  "../Data"
3
3
  ], function( Data ) {
4
4
  return new Data();
5
- });
5
+ } );
@@ -1,5 +1,5 @@
1
- define([
1
+ define( [
2
2
  "../Data"
3
3
  ], function( Data ) {
4
4
  return new Data();
5
- });
5
+ } );
@@ -1,10 +1,9 @@
1
- define([
1
+ define( [
2
2
  "./core",
3
- "./var/rnotwhite",
4
3
  "./core/access",
5
- "./data/var/data_priv",
6
- "./data/var/data_user"
7
- ], function( jQuery, rnotwhite, access, data_priv, data_user ) {
4
+ "./data/var/dataPriv",
5
+ "./data/var/dataUser"
6
+ ], function( jQuery, access, dataPriv, dataUser ) {
8
7
 
9
8
  // Implementation Summary
10
9
  //
@@ -17,7 +16,7 @@ define([
17
16
  // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
18
17
 
19
18
  var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
20
- rmultiDash = /([A-Z])/g;
19
+ rmultiDash = /[A-Z]/g;
21
20
 
22
21
  function dataAttr( elem, key, data ) {
23
22
  var name;
@@ -25,7 +24,7 @@ function dataAttr( elem, key, data ) {
25
24
  // If nothing was found internally, try to fetch any
26
25
  // data from the HTML5 data-* attribute
27
26
  if ( data === undefined && elem.nodeType === 1 ) {
28
- name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
27
+ name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
29
28
  data = elem.getAttribute( name );
30
29
 
31
30
  if ( typeof data === "string" ) {
@@ -33,14 +32,15 @@ function dataAttr( elem, key, data ) {
33
32
  data = data === "true" ? true :
34
33
  data === "false" ? false :
35
34
  data === "null" ? null :
35
+
36
36
  // Only convert to a number if it doesn't change the string
37
37
  +data + "" === data ? +data :
38
38
  rbrace.test( data ) ? jQuery.parseJSON( data ) :
39
39
  data;
40
- } catch( e ) {}
40
+ } catch ( e ) {}
41
41
 
42
42
  // Make sure we set the data so it isn't changed later
43
- data_user.set( elem, key, data );
43
+ dataUser.set( elem, key, data );
44
44
  } else {
45
45
  data = undefined;
46
46
  }
@@ -48,31 +48,31 @@ function dataAttr( elem, key, data ) {
48
48
  return data;
49
49
  }
50
50
 
51
- jQuery.extend({
51
+ jQuery.extend( {
52
52
  hasData: function( elem ) {
53
- return data_user.hasData( elem ) || data_priv.hasData( elem );
53
+ return dataUser.hasData( elem ) || dataPriv.hasData( elem );
54
54
  },
55
55
 
56
56
  data: function( elem, name, data ) {
57
- return data_user.access( elem, name, data );
57
+ return dataUser.access( elem, name, data );
58
58
  },
59
59
 
60
60
  removeData: function( elem, name ) {
61
- data_user.remove( elem, name );
61
+ dataUser.remove( elem, name );
62
62
  },
63
63
 
64
64
  // TODO: Now that all calls to _data and _removeData have been replaced
65
- // with direct calls to data_priv methods, these can be deprecated.
65
+ // with direct calls to dataPriv methods, these can be deprecated.
66
66
  _data: function( elem, name, data ) {
67
- return data_priv.access( elem, name, data );
67
+ return dataPriv.access( elem, name, data );
68
68
  },
69
69
 
70
70
  _removeData: function( elem, name ) {
71
- data_priv.remove( elem, name );
71
+ dataPriv.remove( elem, name );
72
72
  }
73
- });
73
+ } );
74
74
 
75
- jQuery.fn.extend({
75
+ jQuery.fn.extend( {
76
76
  data: function( key, value ) {
77
77
  var i, name, data,
78
78
  elem = this[ 0 ],
@@ -81,9 +81,9 @@ jQuery.fn.extend({
81
81
  // Gets all values
82
82
  if ( key === undefined ) {
83
83
  if ( this.length ) {
84
- data = data_user.get( elem );
84
+ data = dataUser.get( elem );
85
85
 
86
- if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
86
+ if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
87
87
  i = attrs.length;
88
88
  while ( i-- ) {
89
89
 
@@ -92,12 +92,12 @@ jQuery.fn.extend({
92
92
  if ( attrs[ i ] ) {
93
93
  name = attrs[ i ].name;
94
94
  if ( name.indexOf( "data-" ) === 0 ) {
95
- name = jQuery.camelCase( name.slice(5) );
95
+ name = jQuery.camelCase( name.slice( 5 ) );
96
96
  dataAttr( elem, name, data[ name ] );
97
97
  }
98
98
  }
99
99
  }
100
- data_priv.set( elem, "hasDataAttrs", true );
100
+ dataPriv.set( elem, "hasDataAttrs", true );
101
101
  }
102
102
  }
103
103
 
@@ -106,14 +106,13 @@ jQuery.fn.extend({
106
106
 
107
107
  // Sets multiple values
108
108
  if ( typeof key === "object" ) {
109
- return this.each(function() {
110
- data_user.set( this, key );
111
- });
109
+ return this.each( function() {
110
+ dataUser.set( this, key );
111
+ } );
112
112
  }
113
113
 
114
114
  return access( this, function( value ) {
115
- var data,
116
- camelKey = jQuery.camelCase( key );
115
+ var data, camelKey;
117
116
 
118
117
  // The calling jQuery object (element matches) is not empty
119
118
  // (and therefore has an element appears at this[ 0 ]) and the
@@ -121,16 +120,24 @@ jQuery.fn.extend({
121
120
  // will result in `undefined` for elem = this[ 0 ] which will
122
121
  // throw an exception if an attempt to read a data cache is made.
123
122
  if ( elem && value === undefined ) {
123
+
124
124
  // Attempt to get data from the cache
125
125
  // with the key as-is
126
- data = data_user.get( elem, key );
126
+ data = dataUser.get( elem, key ) ||
127
+
128
+ // Try to find dashed key if it exists (gh-2779)
129
+ // This is for 2.2.x only
130
+ dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() );
131
+
127
132
  if ( data !== undefined ) {
128
133
  return data;
129
134
  }
130
135
 
136
+ camelKey = jQuery.camelCase( key );
137
+
131
138
  // Attempt to get data from the cache
132
139
  // with the key camelized
133
- data = data_user.get( elem, camelKey );
140
+ data = dataUser.get( elem, camelKey );
134
141
  if ( data !== undefined ) {
135
142
  return data;
136
143
  }
@@ -147,32 +154,34 @@ jQuery.fn.extend({
147
154
  }
148
155
 
149
156
  // Set the data...
150
- this.each(function() {
157
+ camelKey = jQuery.camelCase( key );
158
+ this.each( function() {
159
+
151
160
  // First, attempt to store a copy or reference of any
152
161
  // data that might've been store with a camelCased key.
153
- var data = data_user.get( this, camelKey );
162
+ var data = dataUser.get( this, camelKey );
154
163
 
155
164
  // For HTML5 data-* attribute interop, we have to
156
165
  // store property names with dashes in a camelCase form.
157
166
  // This might not apply to all properties...*
158
- data_user.set( this, camelKey, value );
167
+ dataUser.set( this, camelKey, value );
159
168
 
160
169
  // *... In the case of properties that might _actually_
161
170
  // have dashes, we need to also store a copy of that
162
171
  // unchanged property.
163
- if ( key.indexOf("-") !== -1 && data !== undefined ) {
164
- data_user.set( this, key, value );
172
+ if ( key.indexOf( "-" ) > -1 && data !== undefined ) {
173
+ dataUser.set( this, key, value );
165
174
  }
166
- });
175
+ } );
167
176
  }, null, value, arguments.length > 1, null, true );
168
177
  },
169
178
 
170
179
  removeData: function( key ) {
171
- return this.each(function() {
172
- data_user.remove( this, key );
173
- });
180
+ return this.each( function() {
181
+ dataUser.remove( this, key );
182
+ } );
174
183
  }
175
- });
184
+ } );
176
185
 
177
186
  return jQuery;
178
- });
187
+ } );
@@ -1,17 +1,18 @@
1
- define([
1
+ define( [
2
2
  "./core",
3
3
  "./var/slice",
4
4
  "./callbacks"
5
5
  ], function( jQuery, slice ) {
6
6
 
7
- jQuery.extend({
7
+ jQuery.extend( {
8
8
 
9
9
  Deferred: function( func ) {
10
10
  var tuples = [
11
+
11
12
  // action, add listener, listener list, final state
12
- [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
13
- [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
14
- [ "notify", "progress", jQuery.Callbacks("memory") ]
13
+ [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ],
14
+ [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ],
15
+ [ "notify", "progress", jQuery.Callbacks( "memory" ) ]
15
16
  ],
16
17
  state = "pending",
17
18
  promise = {
@@ -24,25 +25,30 @@ jQuery.extend({
24
25
  },
25
26
  then: function( /* fnDone, fnFail, fnProgress */ ) {
26
27
  var fns = arguments;
27
- return jQuery.Deferred(function( newDefer ) {
28
+ return jQuery.Deferred( function( newDefer ) {
28
29
  jQuery.each( tuples, function( i, tuple ) {
29
30
  var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
31
+
30
32
  // deferred[ done | fail | progress ] for forwarding actions to newDefer
31
- deferred[ tuple[1] ](function() {
33
+ deferred[ tuple[ 1 ] ]( function() {
32
34
  var returned = fn && fn.apply( this, arguments );
33
35
  if ( returned && jQuery.isFunction( returned.promise ) ) {
34
36
  returned.promise()
37
+ .progress( newDefer.notify )
35
38
  .done( newDefer.resolve )
36
- .fail( newDefer.reject )
37
- .progress( newDefer.notify );
39
+ .fail( newDefer.reject );
38
40
  } else {
39
- newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
41
+ newDefer[ tuple[ 0 ] + "With" ](
42
+ this === promise ? newDefer.promise() : this,
43
+ fn ? [ returned ] : arguments
44
+ );
40
45
  }
41
- });
42
- });
46
+ } );
47
+ } );
43
48
  fns = null;
44
- }).promise();
49
+ } ).promise();
45
50
  },
51
+
46
52
  // Get a promise for this deferred
47
53
  // If obj is provided, the promise aspect is added to the object
48
54
  promise: function( obj ) {
@@ -60,11 +66,12 @@ jQuery.extend({
60
66
  stateString = tuple[ 3 ];
61
67
 
62
68
  // promise[ done | fail | progress ] = list.add
63
- promise[ tuple[1] ] = list.add;
69
+ promise[ tuple[ 1 ] ] = list.add;
64
70
 
65
71
  // Handle state
66
72
  if ( stateString ) {
67
- list.add(function() {
73
+ list.add( function() {
74
+
68
75
  // state = [ resolved | rejected ]
69
76
  state = stateString;
70
77
 
@@ -73,12 +80,12 @@ jQuery.extend({
73
80
  }
74
81
 
75
82
  // deferred[ resolve | reject | notify ]
76
- deferred[ tuple[0] ] = function() {
77
- deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
83
+ deferred[ tuple[ 0 ] ] = function() {
84
+ deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments );
78
85
  return this;
79
86
  };
80
- deferred[ tuple[0] + "With" ] = list.fireWith;
81
- });
87
+ deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
88
+ } );
82
89
 
83
90
  // Make the deferred a promise
84
91
  promise.promise( deferred );
@@ -99,9 +106,11 @@ jQuery.extend({
99
106
  length = resolveValues.length,
100
107
 
101
108
  // the count of uncompleted subordinates
102
- remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
109
+ remaining = length !== 1 ||
110
+ ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
103
111
 
104
- // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
112
+ // the master Deferred.
113
+ // If resolveValues consist of only a single Deferred, just use that.
105
114
  deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
106
115
 
107
116
  // Update function for both resolve and progress values
@@ -127,9 +136,9 @@ jQuery.extend({
127
136
  for ( ; i < length; i++ ) {
128
137
  if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
129
138
  resolveValues[ i ].promise()
139
+ .progress( updateFunc( i, progressContexts, progressValues ) )
130
140
  .done( updateFunc( i, resolveContexts, resolveValues ) )
131
- .fail( deferred.reject )
132
- .progress( updateFunc( i, progressContexts, progressValues ) );
141
+ .fail( deferred.reject );
133
142
  } else {
134
143
  --remaining;
135
144
  }
@@ -143,7 +152,7 @@ jQuery.extend({
143
152
 
144
153
  return deferred.promise();
145
154
  }
146
- });
155
+ } );
147
156
 
148
157
  return jQuery;
149
- });
158
+ } );
@@ -1,13 +1,32 @@
1
- define([
2
- "./core",
3
- "./traversing"
1
+ define( [
2
+ "./core"
4
3
  ], function( jQuery ) {
5
4
 
6
- // The number of elements contained in the matched element set
7
- jQuery.fn.size = function() {
8
- return this.length;
9
- };
5
+ jQuery.fn.extend( {
6
+
7
+ bind: function( types, data, fn ) {
8
+ return this.on( types, null, data, fn );
9
+ },
10
+ unbind: function( types, fn ) {
11
+ return this.off( types, null, fn );
12
+ },
13
+
14
+ delegate: function( selector, types, data, fn ) {
15
+ return this.on( types, selector, data, fn );
16
+ },
17
+ undelegate: function( selector, types, fn ) {
18
+
19
+ // ( namespace ) or ( selector, types [, fn] )
20
+ return arguments.length === 1 ?
21
+ this.off( selector, "**" ) :
22
+ this.off( types, selector || "**", fn );
23
+ },
24
+ size: function() {
25
+ return this.length;
26
+ }
27
+ } );
10
28
 
11
29
  jQuery.fn.andSelf = jQuery.fn.addBack;
12
30
 
13
- });
31
+ } );
32
+