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,5 +1,6 @@
1
- define([
1
+ define( [
2
2
  "./var/arr",
3
+ "./var/document",
3
4
  "./var/slice",
4
5
  "./var/concat",
5
6
  "./var/push",
@@ -8,16 +9,14 @@ define([
8
9
  "./var/toString",
9
10
  "./var/hasOwn",
10
11
  "./var/support"
11
- ], function( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) {
12
+ ], function( arr, document, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) {
12
13
 
13
14
  var
14
- // Use the correct document accordingly with window argument (sandbox)
15
- document = window.document,
16
-
17
15
  version = "@VERSION",
18
16
 
19
17
  // Define a local copy of jQuery
20
18
  jQuery = function( selector, context ) {
19
+
21
20
  // The jQuery object is actually just the init constructor 'enhanced'
22
21
  // Need init if jQuery is called (just allow error to be thrown if not included)
23
22
  return new jQuery.fn.init( selector, context );
@@ -37,6 +36,7 @@ var
37
36
  };
38
37
 
39
38
  jQuery.fn = jQuery.prototype = {
39
+
40
40
  // The current version of jQuery being used
41
41
  jquery: version,
42
42
 
@@ -80,16 +80,14 @@ jQuery.fn = jQuery.prototype = {
80
80
  },
81
81
 
82
82
  // Execute a callback for every element in the matched set.
83
- // (You can seed the arguments with an array of args, but this is
84
- // only used internally.)
85
- each: function( callback, args ) {
86
- return jQuery.each( this, callback, args );
83
+ each: function( callback ) {
84
+ return jQuery.each( this, callback );
87
85
  },
88
86
 
89
87
  map: function( callback ) {
90
- return this.pushStack( jQuery.map(this, function( elem, i ) {
88
+ return this.pushStack( jQuery.map( this, function( elem, i ) {
91
89
  return callback.call( elem, i, elem );
92
- }));
90
+ } ) );
93
91
  },
94
92
 
95
93
  slice: function() {
@@ -107,11 +105,11 @@ jQuery.fn = jQuery.prototype = {
107
105
  eq: function( i ) {
108
106
  var len = this.length,
109
107
  j = +i + ( i < 0 ? len : 0 );
110
- return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
108
+ return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
111
109
  },
112
110
 
113
111
  end: function() {
114
- return this.prevObject || this.constructor(null);
112
+ return this.prevObject || this.constructor();
115
113
  },
116
114
 
117
115
  // For internal use only.
@@ -123,7 +121,7 @@ jQuery.fn = jQuery.prototype = {
123
121
 
124
122
  jQuery.extend = jQuery.fn.extend = function() {
125
123
  var options, name, src, copy, copyIsArray, clone,
126
- target = arguments[0] || {},
124
+ target = arguments[ 0 ] || {},
127
125
  i = 1,
128
126
  length = arguments.length,
129
127
  deep = false;
@@ -138,7 +136,7 @@ jQuery.extend = jQuery.fn.extend = function() {
138
136
  }
139
137
 
140
138
  // Handle case when target is a string or something (possible in deep copy)
141
- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
139
+ if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
142
140
  target = {};
143
141
  }
144
142
 
@@ -149,8 +147,10 @@ jQuery.extend = jQuery.fn.extend = function() {
149
147
  }
150
148
 
151
149
  for ( ; i < length; i++ ) {
150
+
152
151
  // Only deal with non-null/undefined values
153
- if ( (options = arguments[ i ]) != null ) {
152
+ if ( ( options = arguments[ i ] ) != null ) {
153
+
154
154
  // Extend the base object
155
155
  for ( name in options ) {
156
156
  src = target[ name ];
@@ -162,13 +162,15 @@ jQuery.extend = jQuery.fn.extend = function() {
162
162
  }
163
163
 
164
164
  // Recurse if we're merging plain objects or arrays
165
- if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
165
+ if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
166
+ ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
167
+
166
168
  if ( copyIsArray ) {
167
169
  copyIsArray = false;
168
- clone = src && jQuery.isArray(src) ? src : [];
170
+ clone = src && jQuery.isArray( src ) ? src : [];
169
171
 
170
172
  } else {
171
- clone = src && jQuery.isPlainObject(src) ? src : {};
173
+ clone = src && jQuery.isPlainObject( src ) ? src : {};
172
174
  }
173
175
 
174
176
  // Never move original objects, clone them
@@ -186,7 +188,8 @@ jQuery.extend = jQuery.fn.extend = function() {
186
188
  return target;
187
189
  };
188
190
 
189
- jQuery.extend({
191
+ jQuery.extend( {
192
+
190
193
  // Unique for each copy of jQuery on the page
191
194
  expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
192
195
 
@@ -200,7 +203,7 @@ jQuery.extend({
200
203
  noop: function() {},
201
204
 
202
205
  isFunction: function( obj ) {
203
- return jQuery.type(obj) === "function";
206
+ return jQuery.type( obj ) === "function";
204
207
  },
205
208
 
206
209
  isArray: Array.isArray,
@@ -210,14 +213,18 @@ jQuery.extend({
210
213
  },
211
214
 
212
215
  isNumeric: function( obj ) {
216
+
213
217
  // parseFloat NaNs numeric-cast false positives (null|true|false|"")
214
218
  // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
215
219
  // subtraction forces infinities to NaN
216
220
  // adding 1 corrects loss of precision from parseFloat (#15100)
217
- return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
221
+ var realStringObj = obj && obj.toString();
222
+ return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
218
223
  },
219
224
 
220
225
  isPlainObject: function( obj ) {
226
+ var key;
227
+
221
228
  // Not plain objects:
222
229
  // - Any object or value whose internal [[Class]] property is not "[object Object]"
223
230
  // - DOM nodes
@@ -226,14 +233,18 @@ jQuery.extend({
226
233
  return false;
227
234
  }
228
235
 
236
+ // Not own constructor property must be Object
229
237
  if ( obj.constructor &&
230
- !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
238
+ !hasOwn.call( obj, "constructor" ) &&
239
+ !hasOwn.call( obj.constructor.prototype || {}, "isPrototypeOf" ) ) {
231
240
  return false;
232
241
  }
233
242
 
234
- // If the function hasn't returned already, we're confident that
235
- // |obj| is a plain object, created by {} or constructed with new Object
236
- return true;
243
+ // Own properties are enumerated firstly, so to speed up,
244
+ // if last one is own, then all properties are own
245
+ for ( key in obj ) {}
246
+
247
+ return key === undefined || hasOwn.call( obj, key );
237
248
  },
238
249
 
239
250
  isEmptyObject: function( obj ) {
@@ -248,9 +259,10 @@ jQuery.extend({
248
259
  if ( obj == null ) {
249
260
  return obj + "";
250
261
  }
262
+
251
263
  // Support: Android<4.0, iOS<6 (functionish RegExp)
252
264
  return typeof obj === "object" || typeof obj === "function" ?
253
- class2type[ toString.call(obj) ] || "object" :
265
+ class2type[ toString.call( obj ) ] || "object" :
254
266
  typeof obj;
255
267
  },
256
268
 
@@ -262,16 +274,19 @@ jQuery.extend({
262
274
  code = jQuery.trim( code );
263
275
 
264
276
  if ( code ) {
277
+
265
278
  // If the code includes a valid, prologue position
266
279
  // strict mode pragma, execute code by injecting a
267
280
  // script tag into the document.
268
- if ( code.indexOf("use strict") === 1 ) {
269
- script = document.createElement("script");
281
+ if ( code.indexOf( "use strict" ) === 1 ) {
282
+ script = document.createElement( "script" );
270
283
  script.text = code;
271
284
  document.head.appendChild( script ).parentNode.removeChild( script );
272
285
  } else {
273
- // Otherwise, avoid the DOM node creation, insertion
274
- // and removal by using an indirect global eval
286
+
287
+ // Otherwise, avoid the DOM node creation, insertion
288
+ // and removal by using an indirect global eval
289
+
275
290
  indirect( code );
276
291
  }
277
292
  }
@@ -288,49 +303,20 @@ jQuery.extend({
288
303
  return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
289
304
  },
290
305
 
291
- // args is for internal usage only
292
- each: function( obj, callback, args ) {
293
- var value,
294
- i = 0,
295
- length = obj.length,
296
- isArray = isArraylike( obj );
297
-
298
- if ( args ) {
299
- if ( isArray ) {
300
- for ( ; i < length; i++ ) {
301
- value = callback.apply( obj[ i ], args );
306
+ each: function( obj, callback ) {
307
+ var length, i = 0;
302
308
 
303
- if ( value === false ) {
304
- break;
305
- }
306
- }
307
- } else {
308
- for ( i in obj ) {
309
- value = callback.apply( obj[ i ], args );
310
-
311
- if ( value === false ) {
312
- break;
313
- }
309
+ if ( isArrayLike( obj ) ) {
310
+ length = obj.length;
311
+ for ( ; i < length; i++ ) {
312
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
313
+ break;
314
314
  }
315
315
  }
316
-
317
- // A special, fast, case for the most common use of each
318
316
  } else {
319
- if ( isArray ) {
320
- for ( ; i < length; i++ ) {
321
- value = callback.call( obj[ i ], i, obj[ i ] );
322
-
323
- if ( value === false ) {
324
- break;
325
- }
326
- }
327
- } else {
328
- for ( i in obj ) {
329
- value = callback.call( obj[ i ], i, obj[ i ] );
330
-
331
- if ( value === false ) {
332
- break;
333
- }
317
+ for ( i in obj ) {
318
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
319
+ break;
334
320
  }
335
321
  }
336
322
  }
@@ -350,7 +336,7 @@ jQuery.extend({
350
336
  var ret = results || [];
351
337
 
352
338
  if ( arr != null ) {
353
- if ( isArraylike( Object(arr) ) ) {
339
+ if ( isArrayLike( Object( arr ) ) ) {
354
340
  jQuery.merge( ret,
355
341
  typeof arr === "string" ?
356
342
  [ arr ] : arr
@@ -402,14 +388,13 @@ jQuery.extend({
402
388
 
403
389
  // arg is for internal usage only
404
390
  map: function( elems, callback, arg ) {
405
- var value,
391
+ var length, value,
406
392
  i = 0,
407
- length = elems.length,
408
- isArray = isArraylike( elems ),
409
393
  ret = [];
410
394
 
411
395
  // Go through the array, translating each of the items to their new values
412
- if ( isArray ) {
396
+ if ( isArrayLike( elems ) ) {
397
+ length = elems.length;
413
398
  for ( ; i < length; i++ ) {
414
399
  value = callback( elems[ i ], i, arg );
415
400
 
@@ -470,33 +455,40 @@ jQuery.extend({
470
455
  // jQuery.support is not used in Core but other projects attach their
471
456
  // properties to it so it needs to exist.
472
457
  support: support
473
- });
458
+ } );
459
+
460
+ // JSHint would error on this code due to the Symbol not being defined in ES5.
461
+ // Defining this global in .jshintrc would create a danger of using the global
462
+ // unguarded in another place, it seems safer to just disable JSHint for these
463
+ // three lines.
464
+ /* jshint ignore: start */
465
+ if ( typeof Symbol === "function" ) {
466
+ jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
467
+ }
468
+ /* jshint ignore: end */
474
469
 
475
470
  // Populate the class2type map
476
- jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
471
+ jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
472
+ function( i, name ) {
477
473
  class2type[ "[object " + name + "]" ] = name.toLowerCase();
478
- });
474
+ } );
479
475
 
480
- function isArraylike( obj ) {
476
+ function isArrayLike( obj ) {
481
477
 
482
478
  // Support: iOS 8.2 (not reproducible in simulator)
483
479
  // `in` check used to prevent JIT error (gh-2145)
484
480
  // hasOwn isn't used here due to false negatives
485
481
  // regarding Nodelist length in IE
486
- var length = "length" in obj && obj.length,
482
+ var length = !!obj && "length" in obj && obj.length,
487
483
  type = jQuery.type( obj );
488
484
 
489
485
  if ( type === "function" || jQuery.isWindow( obj ) ) {
490
486
  return false;
491
487
  }
492
488
 
493
- if ( obj.nodeType === 1 && length ) {
494
- return true;
495
- }
496
-
497
489
  return type === "array" || length === 0 ||
498
490
  typeof length === "number" && length > 0 && ( length - 1 ) in obj;
499
491
  }
500
492
 
501
493
  return jQuery;
502
- });
494
+ } );
@@ -1,10 +1,12 @@
1
- define(function() {
1
+ define( function() {
2
2
 
3
3
  function addGetHookIf( conditionFn, hookFn ) {
4
+
4
5
  // Define the hook, we'll check on the first run if it's really needed.
5
6
  return {
6
7
  get: function() {
7
8
  if ( conditionFn() ) {
9
+
8
10
  // Hook not needed (or it's not possible to use it due
9
11
  // to missing dependency), remove it.
10
12
  delete this.get;
@@ -12,11 +14,11 @@ function addGetHookIf( conditionFn, hookFn ) {
12
14
  }
13
15
 
14
16
  // Hook needed; redefine it so that the support test is not executed again.
15
- return (this.get = hookFn).apply( this, arguments );
17
+ return ( this.get = hookFn ).apply( this, arguments );
16
18
  }
17
19
  };
18
20
  }
19
21
 
20
22
  return addGetHookIf;
21
23
 
22
- });
24
+ } );
@@ -0,0 +1,65 @@
1
+ define( [
2
+ "../core",
3
+ "../var/rcssNum"
4
+ ], function( jQuery, rcssNum ) {
5
+
6
+ function adjustCSS( elem, prop, valueParts, tween ) {
7
+ var adjusted,
8
+ scale = 1,
9
+ maxIterations = 20,
10
+ currentValue = tween ?
11
+ function() { return tween.cur(); } :
12
+ function() { return jQuery.css( elem, prop, "" ); },
13
+ initial = currentValue(),
14
+ unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
15
+
16
+ // Starting value computation is required for potential unit mismatches
17
+ initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
18
+ rcssNum.exec( jQuery.css( elem, prop ) );
19
+
20
+ if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
21
+
22
+ // Trust units reported by jQuery.css
23
+ unit = unit || initialInUnit[ 3 ];
24
+
25
+ // Make sure we update the tween properties later on
26
+ valueParts = valueParts || [];
27
+
28
+ // Iteratively approximate from a nonzero starting point
29
+ initialInUnit = +initial || 1;
30
+
31
+ do {
32
+
33
+ // If previous iteration zeroed out, double until we get *something*.
34
+ // Use string for doubling so we don't accidentally see scale as unchanged below
35
+ scale = scale || ".5";
36
+
37
+ // Adjust and apply
38
+ initialInUnit = initialInUnit / scale;
39
+ jQuery.style( elem, prop, initialInUnit + unit );
40
+
41
+ // Update scale, tolerating zero or NaN from tween.cur()
42
+ // Break the loop if scale is unchanged or perfect, or if we've just had enough.
43
+ } while (
44
+ scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
45
+ );
46
+ }
47
+
48
+ if ( valueParts ) {
49
+ initialInUnit = +initialInUnit || +initial || 0;
50
+
51
+ // Apply relative offset (+=/-=) if specified
52
+ adjusted = valueParts[ 1 ] ?
53
+ initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
54
+ +valueParts[ 2 ];
55
+ if ( tween ) {
56
+ tween.unit = unit;
57
+ tween.start = initialInUnit;
58
+ tween.end = adjusted;
59
+ }
60
+ }
61
+ return adjusted;
62
+ }
63
+
64
+ return adjustCSS;
65
+ } );
@@ -1,34 +1,36 @@
1
- define([
1
+ define( [
2
2
  "../core",
3
3
  "./var/rnumnonpx",
4
4
  "./var/rmargin",
5
5
  "./var/getStyles",
6
- "../selector" // contains
7
- ], function( jQuery, rnumnonpx, rmargin, getStyles ) {
6
+ "./support",
7
+ "../selector" // Get jQuery.contains
8
+ ], function( jQuery, rnumnonpx, rmargin, getStyles, support ) {
8
9
 
9
10
  function curCSS( elem, name, computed ) {
10
11
  var width, minWidth, maxWidth, ret,
11
12
  style = elem.style;
12
13
 
13
14
  computed = computed || getStyles( elem );
15
+ ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
14
16
 
15
- // Support: IE9
16
- // getPropertyValue is only needed for .css('filter') (#12537)
17
- if ( computed ) {
18
- ret = computed.getPropertyValue( name ) || computed[ name ];
17
+ // Support: Opera 12.1x only
18
+ // Fall back to style even without computed
19
+ // computed is undefined for elems on document fragments
20
+ if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
21
+ ret = jQuery.style( elem, name );
19
22
  }
20
23
 
24
+ // Support: IE9
25
+ // getPropertyValue is only needed for .css('filter') (#12537)
21
26
  if ( computed ) {
22
27
 
23
- if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
24
- ret = jQuery.style( elem, name );
25
- }
26
-
27
- // Support: iOS < 6
28
28
  // A tribute to the "awesome hack by Dean Edwards"
29
- // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
30
- // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
31
- if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
29
+ // Android Browser returns percentage for some values,
30
+ // but width seems to be reliably pixels.
31
+ // This is against the CSSOM draft spec:
32
+ // http://dev.w3.org/csswg/cssom/#resolved-values
33
+ if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
32
34
 
33
35
  // Remember the original values
34
36
  width = style.width;
@@ -47,11 +49,12 @@ function curCSS( elem, name, computed ) {
47
49
  }
48
50
 
49
51
  return ret !== undefined ?
50
- // Support: IE
52
+
53
+ // Support: IE9-11+
51
54
  // IE returns zIndex value as an integer.
52
55
  ret + "" :
53
56
  ret;
54
57
  }
55
58
 
56
59
  return curCSS;
57
- });
60
+ } );
@@ -1,27 +1,29 @@
1
- define([
1
+ define( [
2
2
  "../core",
3
+ "../var/document",
3
4
  "../manipulation" // appendTo
4
- ], function( jQuery ) {
5
+ ], function( jQuery, document ) {
5
6
 
6
7
  var iframe,
7
- elemdisplay = {};
8
+ elemdisplay = {
9
+
10
+ // Support: Firefox
11
+ // We have to pre-define these values for FF (#10227)
12
+ HTML: "block",
13
+ BODY: "block"
14
+ };
8
15
 
9
16
  /**
10
17
  * Retrieve the actual display of a element
11
18
  * @param {String} name nodeName of the element
12
19
  * @param {Object} doc Document object
13
20
  */
21
+
14
22
  // Called only from within defaultDisplay
15
23
  function actualDisplay( name, doc ) {
16
- var style,
17
- elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
24
+ var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
18
25
 
19
- // getDefaultComputedStyle might be reliably used only on attached element
20
- display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
21
-
22
- // Use of this method is a temporary fix (more like optimization) until something better comes along,
23
- // since it was removed from specification and supported only in FF
24
- style.display : jQuery.css( elem[ 0 ], "display" );
26
+ display = jQuery.css( elem[ 0 ], "display" );
25
27
 
26
28
  // We don't have any data stored on the element,
27
29
  // so use "detach" method as fast way to get rid of the element
@@ -45,7 +47,8 @@ function defaultDisplay( nodeName ) {
45
47
  if ( display === "none" || !display ) {
46
48
 
47
49
  // Use the already-created iframe if possible
48
- iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
50
+ iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) )
51
+ .appendTo( doc.documentElement );
49
52
 
50
53
  // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
51
54
  doc = iframe[ 0 ].contentDocument;
@@ -66,5 +69,4 @@ function defaultDisplay( nodeName ) {
66
69
  }
67
70
 
68
71
  return defaultDisplay;
69
-
70
- });
72
+ } );
@@ -1,15 +1,18 @@
1
- define([
1
+ define( [
2
2
  "../core",
3
3
  "../selector"
4
4
  ], function( jQuery ) {
5
5
 
6
6
  jQuery.expr.filters.hidden = function( elem ) {
7
- // Support: Opera <= 12.12
8
- // Opera reports offsetWidths and offsetHeights less than zero on some elements
9
- return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
7
+ return !jQuery.expr.filters.visible( elem );
10
8
  };
11
9
  jQuery.expr.filters.visible = function( elem ) {
12
- return !jQuery.expr.filters.hidden( elem );
10
+
11
+ // Support: Opera <= 12.12
12
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
13
+ // Use OR instead of AND as the element is not visible if either is true
14
+ // See tickets #10406 and #13132
15
+ return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0;
13
16
  };
14
17
 
15
- });
18
+ } );
@@ -0,0 +1,48 @@
1
+ define( [
2
+ "../data/var/dataPriv"
3
+ ], function( dataPriv ) {
4
+
5
+ function showHide( elements, show ) {
6
+ var display, elem,
7
+ values = [],
8
+ index = 0,
9
+ length = elements.length;
10
+
11
+ // Determine new display value for elements that need to change
12
+ for ( ; index < length; index++ ) {
13
+ elem = elements[ index ];
14
+ if ( !elem.style ) {
15
+ continue;
16
+ }
17
+
18
+ display = elem.style.display;
19
+ if ( show ) {
20
+ if ( display === "none" ) {
21
+
22
+ // Restore a pre-hide() value if we have one
23
+ values[ index ] = dataPriv.get( elem, "display" ) || "";
24
+ }
25
+ } else {
26
+ if ( display !== "none" ) {
27
+ values[ index ] = "none";
28
+
29
+ // Remember the value we're replacing
30
+ dataPriv.set( elem, "display", display );
31
+ }
32
+ }
33
+ }
34
+
35
+ // Set the display of the elements in a second loop
36
+ // to avoid the constant reflow
37
+ for ( index = 0; index < length; index++ ) {
38
+ if ( values[ index ] != null ) {
39
+ elements[ index ].style.display = values[ index ];
40
+ }
41
+ }
42
+
43
+ return elements;
44
+ }
45
+
46
+ return showHide;
47
+
48
+ } );