epuber 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -3
  3. data/README.md +3 -11
  4. data/bin/epuber +2 -3
  5. data/epuber.gemspec +3 -6
  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 -1
  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 +3 -1
  46. data/lib/epuber/compiler.rb +7 -11
  47. data/lib/epuber/config.rb +1 -2
  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 +2 -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_user.js → dataPriv.js} +2 -2
  115. data/lib/epuber/third_party/bower/bower_components/jquery/src/data/var/{data_priv.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 +48 -30
  204. data/lib/epuber/third_party/bower/bower_components/jquery/src/sizzle/dist/sizzle.min.js +0 -3
  205. data/lib/epuber/third_party/bower/bower_components/jquery/src/sizzle/dist/sizzle.min.map +0 -1
  206. data/lib/epuber/third_party/bower/bower_components/jquery/src/var/strundefined.js +0 -3
  207. data/lib/epuber/vendor/globals_context.rb +0 -26
@@ -1,17 +1,14 @@
1
- define([
1
+ define( [
2
2
  "./core",
3
3
  "./var/rnotwhite"
4
4
  ], function( jQuery, rnotwhite ) {
5
5
 
6
- // String to Object options format cache
7
- var optionsCache = {};
8
-
9
- // Convert String-formatted options into Object-formatted ones and store in cache
6
+ // Convert String-formatted options into Object-formatted ones
10
7
  function createOptions( options ) {
11
- var object = optionsCache[ options ] = {};
8
+ var object = {};
12
9
  jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
13
10
  object[ flag ] = true;
14
- });
11
+ } );
15
12
  return object;
16
13
  }
17
14
 
@@ -42,156 +39,186 @@ jQuery.Callbacks = function( options ) {
42
39
  // Convert options from String-formatted to Object-formatted if needed
43
40
  // (we check in cache first)
44
41
  options = typeof options === "string" ?
45
- ( optionsCache[ options ] || createOptions( options ) ) :
42
+ createOptions( options ) :
46
43
  jQuery.extend( {}, options );
47
44
 
48
- var // Last fire value (for non-forgettable lists)
45
+ var // Flag to know if list is currently firing
46
+ firing,
47
+
48
+ // Last fire value for non-forgettable lists
49
49
  memory,
50
+
50
51
  // Flag to know if list was already fired
51
52
  fired,
52
- // Flag to know if list is currently firing
53
- firing,
54
- // First callback to fire (used internally by add and fireWith)
55
- firingStart,
56
- // End of the loop when firing
57
- firingLength,
58
- // Index of currently firing callback (modified by remove if needed)
59
- firingIndex,
53
+
54
+ // Flag to prevent firing
55
+ locked,
56
+
60
57
  // Actual callback list
61
58
  list = [],
62
- // Stack of fire calls for repeatable lists
63
- stack = !options.once && [],
59
+
60
+ // Queue of execution data for repeatable lists
61
+ queue = [],
62
+
63
+ // Index of currently firing callback (modified by add/remove as needed)
64
+ firingIndex = -1,
65
+
64
66
  // Fire callbacks
65
- fire = function( data ) {
66
- memory = options.memory && data;
67
- fired = true;
68
- firingIndex = firingStart || 0;
69
- firingStart = 0;
70
- firingLength = list.length;
71
- firing = true;
72
- for ( ; list && firingIndex < firingLength; firingIndex++ ) {
73
- if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
74
- memory = false; // To prevent further calls using add
75
- break;
67
+ fire = function() {
68
+
69
+ // Enforce single-firing
70
+ locked = options.once;
71
+
72
+ // Execute callbacks for all pending executions,
73
+ // respecting firingIndex overrides and runtime changes
74
+ fired = firing = true;
75
+ for ( ; queue.length; firingIndex = -1 ) {
76
+ memory = queue.shift();
77
+ while ( ++firingIndex < list.length ) {
78
+
79
+ // Run callback and check for early termination
80
+ if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
81
+ options.stopOnFalse ) {
82
+
83
+ // Jump to end and forget the data so .add doesn't re-fire
84
+ firingIndex = list.length;
85
+ memory = false;
86
+ }
76
87
  }
77
88
  }
89
+
90
+ // Forget the data if we're done with it
91
+ if ( !options.memory ) {
92
+ memory = false;
93
+ }
94
+
78
95
  firing = false;
79
- if ( list ) {
80
- if ( stack ) {
81
- if ( stack.length ) {
82
- fire( stack.shift() );
83
- }
84
- } else if ( memory ) {
96
+
97
+ // Clean up if we're done firing for good
98
+ if ( locked ) {
99
+
100
+ // Keep an empty list if we have data for future add calls
101
+ if ( memory ) {
85
102
  list = [];
103
+
104
+ // Otherwise, this object is spent
86
105
  } else {
87
- self.disable();
106
+ list = "";
88
107
  }
89
108
  }
90
109
  },
110
+
91
111
  // Actual Callbacks object
92
112
  self = {
113
+
93
114
  // Add a callback or a collection of callbacks to the list
94
115
  add: function() {
95
116
  if ( list ) {
96
- // First, we save the current length
97
- var start = list.length;
98
- (function add( args ) {
117
+
118
+ // If we have memory from a past run, we should fire after adding
119
+ if ( memory && !firing ) {
120
+ firingIndex = list.length - 1;
121
+ queue.push( memory );
122
+ }
123
+
124
+ ( function add( args ) {
99
125
  jQuery.each( args, function( _, arg ) {
100
- var type = jQuery.type( arg );
101
- if ( type === "function" ) {
126
+ if ( jQuery.isFunction( arg ) ) {
102
127
  if ( !options.unique || !self.has( arg ) ) {
103
128
  list.push( arg );
104
129
  }
105
- } else if ( arg && arg.length && type !== "string" ) {
130
+ } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
131
+
106
132
  // Inspect recursively
107
133
  add( arg );
108
134
  }
109
- });
110
- })( arguments );
111
- // Do we need to add the callbacks to the
112
- // current firing batch?
113
- if ( firing ) {
114
- firingLength = list.length;
115
- // With memory, if we're not firing then
116
- // we should call right away
117
- } else if ( memory ) {
118
- firingStart = start;
119
- fire( memory );
135
+ } );
136
+ } )( arguments );
137
+
138
+ if ( memory && !firing ) {
139
+ fire();
120
140
  }
121
141
  }
122
142
  return this;
123
143
  },
144
+
124
145
  // Remove a callback from the list
125
146
  remove: function() {
126
- if ( list ) {
127
- jQuery.each( arguments, function( _, arg ) {
128
- var index;
129
- while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
130
- list.splice( index, 1 );
131
- // Handle firing indexes
132
- if ( firing ) {
133
- if ( index <= firingLength ) {
134
- firingLength--;
135
- }
136
- if ( index <= firingIndex ) {
137
- firingIndex--;
138
- }
139
- }
147
+ jQuery.each( arguments, function( _, arg ) {
148
+ var index;
149
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
150
+ list.splice( index, 1 );
151
+
152
+ // Handle firing indexes
153
+ if ( index <= firingIndex ) {
154
+ firingIndex--;
140
155
  }
141
- });
142
- }
156
+ }
157
+ } );
143
158
  return this;
144
159
  },
160
+
145
161
  // Check if a given callback is in the list.
146
162
  // If no argument is given, return whether or not list has callbacks attached.
147
163
  has: function( fn ) {
148
- return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
164
+ return fn ?
165
+ jQuery.inArray( fn, list ) > -1 :
166
+ list.length > 0;
149
167
  },
168
+
150
169
  // Remove all callbacks from the list
151
170
  empty: function() {
152
- list = [];
153
- firingLength = 0;
171
+ if ( list ) {
172
+ list = [];
173
+ }
154
174
  return this;
155
175
  },
156
- // Have the list do nothing anymore
176
+
177
+ // Disable .fire and .add
178
+ // Abort any current/pending executions
179
+ // Clear all callbacks and values
157
180
  disable: function() {
158
- list = stack = memory = undefined;
181
+ locked = queue = [];
182
+ list = memory = "";
159
183
  return this;
160
184
  },
161
- // Is it disabled?
162
185
  disabled: function() {
163
186
  return !list;
164
187
  },
165
- // Lock the list in its current state
188
+
189
+ // Disable .fire
190
+ // Also disable .add unless we have memory (since it would have no effect)
191
+ // Abort any pending executions
166
192
  lock: function() {
167
- stack = undefined;
193
+ locked = queue = [];
168
194
  if ( !memory ) {
169
- self.disable();
195
+ list = memory = "";
170
196
  }
171
197
  return this;
172
198
  },
173
- // Is it locked?
174
199
  locked: function() {
175
- return !stack;
200
+ return !!locked;
176
201
  },
202
+
177
203
  // Call all callbacks with the given context and arguments
178
204
  fireWith: function( context, args ) {
179
- if ( list && ( !fired || stack ) ) {
205
+ if ( !locked ) {
180
206
  args = args || [];
181
207
  args = [ context, args.slice ? args.slice() : args ];
182
- if ( firing ) {
183
- stack.push( args );
184
- } else {
185
- fire( args );
208
+ queue.push( args );
209
+ if ( !firing ) {
210
+ fire();
186
211
  }
187
212
  }
188
213
  return this;
189
214
  },
215
+
190
216
  // Call all the callbacks with the given arguments
191
217
  fire: function() {
192
218
  self.fireWith( this, arguments );
193
219
  return this;
194
220
  },
221
+
195
222
  // To know if the callbacks have already been called at least once
196
223
  fired: function() {
197
224
  return !!fired;
@@ -202,4 +229,4 @@ jQuery.Callbacks = function( options ) {
202
229
  };
203
230
 
204
231
  return jQuery;
205
- });
232
+ } );
@@ -1,10 +1,10 @@
1
- define([
1
+ define( [
2
2
  "../core"
3
3
  ], function( jQuery ) {
4
4
 
5
5
  // Multifunctional method to get and set values of a collection
6
6
  // The value/s can optionally be executed if it's a function
7
- var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
7
+ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
8
8
  var i = 0,
9
9
  len = elems.length,
10
10
  bulk = key == null;
@@ -13,7 +13,7 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe
13
13
  if ( jQuery.type( key ) === "object" ) {
14
14
  chainable = true;
15
15
  for ( i in key ) {
16
- jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
16
+ access( elems, fn, i, key[ i ], true, emptyGet, raw );
17
17
  }
18
18
 
19
19
  // Sets one value
@@ -25,6 +25,7 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe
25
25
  }
26
26
 
27
27
  if ( bulk ) {
28
+
28
29
  // Bulk operations run against the entire set
29
30
  if ( raw ) {
30
31
  fn.call( elems, value );
@@ -41,7 +42,11 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe
41
42
 
42
43
  if ( fn ) {
43
44
  for ( ; i < len; i++ ) {
44
- fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
45
+ fn(
46
+ elems[ i ], key, raw ?
47
+ value :
48
+ value.call( elems[ i ], i, fn( elems[ i ], key ) )
49
+ );
45
50
  }
46
51
  }
47
52
  }
@@ -52,9 +57,9 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe
52
57
  // Gets
53
58
  bulk ?
54
59
  fn.call( elems ) :
55
- len ? fn( elems[0], key ) : emptyGet;
60
+ len ? fn( elems[ 0 ], key ) : emptyGet;
56
61
  };
57
62
 
58
63
  return access;
59
64
 
60
- });
65
+ } );
@@ -1,9 +1,10 @@
1
1
  // Initialize a jQuery object
2
- define([
2
+ define( [
3
3
  "../core",
4
+ "../var/document",
4
5
  "./var/rsingleTag",
5
6
  "../traversing/findFilter"
6
- ], function( jQuery, rsingleTag ) {
7
+ ], function( jQuery, document, rsingleTag ) {
7
8
 
8
9
  // A central reference to the root jQuery(document)
9
10
  var rootjQuery,
@@ -13,7 +14,7 @@ var rootjQuery,
13
14
  // Strict HTML recognition (#11290: must start with <)
14
15
  rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
15
16
 
16
- init = jQuery.fn.init = function( selector, context ) {
17
+ init = jQuery.fn.init = function( selector, context, root ) {
17
18
  var match, elem;
18
19
 
19
20
  // HANDLE: $(""), $(null), $(undefined), $(false)
@@ -21,9 +22,16 @@ var rootjQuery,
21
22
  return this;
22
23
  }
23
24
 
25
+ // Method init() accepts an alternate rootjQuery
26
+ // so migrate can support jQuery.sub (gh-2101)
27
+ root = root || rootjQuery;
28
+
24
29
  // Handle HTML strings
25
30
  if ( typeof selector === "string" ) {
26
- if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
31
+ if ( selector[ 0 ] === "<" &&
32
+ selector[ selector.length - 1 ] === ">" &&
33
+ selector.length >= 3 ) {
34
+
27
35
  // Assume that strings that start and end with <> are HTML and skip the regex check
28
36
  match = [ null, selector, null ];
29
37
 
@@ -32,23 +40,24 @@ var rootjQuery,
32
40
  }
33
41
 
34
42
  // Match html or make sure no context is specified for #id
35
- if ( match && (match[1] || !context) ) {
43
+ if ( match && ( match[ 1 ] || !context ) ) {
36
44
 
37
45
  // HANDLE: $(html) -> $(array)
38
- if ( match[1] ) {
39
- context = context instanceof jQuery ? context[0] : context;
46
+ if ( match[ 1 ] ) {
47
+ context = context instanceof jQuery ? context[ 0 ] : context;
40
48
 
41
49
  // Option to run scripts is true for back-compat
42
50
  // Intentionally let the error be thrown if parseHTML is not present
43
51
  jQuery.merge( this, jQuery.parseHTML(
44
- match[1],
52
+ match[ 1 ],
45
53
  context && context.nodeType ? context.ownerDocument || context : document,
46
54
  true
47
55
  ) );
48
56
 
49
57
  // HANDLE: $(html, props)
50
- if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
58
+ if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
51
59
  for ( match in context ) {
60
+
52
61
  // Properties of context are called as methods if possible
53
62
  if ( jQuery.isFunction( this[ match ] ) ) {
54
63
  this[ match ]( context[ match ] );
@@ -64,14 +73,15 @@ var rootjQuery,
64
73
 
65
74
  // HANDLE: $(#id)
66
75
  } else {
67
- elem = document.getElementById( match[2] );
76
+ elem = document.getElementById( match[ 2 ] );
68
77
 
69
78
  // Support: Blackberry 4.6
70
79
  // gEBID returns nodes no longer in the document (#6963)
71
80
  if ( elem && elem.parentNode ) {
81
+
72
82
  // Inject the element directly into the jQuery object
73
83
  this.length = 1;
74
- this[0] = elem;
84
+ this[ 0 ] = elem;
75
85
  }
76
86
 
77
87
  this.context = document;
@@ -81,7 +91,7 @@ var rootjQuery,
81
91
 
82
92
  // HANDLE: $(expr, $(...))
83
93
  } else if ( !context || context.jquery ) {
84
- return ( context || rootjQuery ).find( selector );
94
+ return ( context || root ).find( selector );
85
95
 
86
96
  // HANDLE: $(expr, context)
87
97
  // (which is just equivalent to: $(context).find(expr)
@@ -91,15 +101,16 @@ var rootjQuery,
91
101
 
92
102
  // HANDLE: $(DOMElement)
93
103
  } else if ( selector.nodeType ) {
94
- this.context = this[0] = selector;
104
+ this.context = this[ 0 ] = selector;
95
105
  this.length = 1;
96
106
  return this;
97
107
 
98
108
  // HANDLE: $(function)
99
109
  // Shortcut for document ready
100
110
  } else if ( jQuery.isFunction( selector ) ) {
101
- return typeof rootjQuery.ready !== "undefined" ?
102
- rootjQuery.ready( selector ) :
111
+ return root.ready !== undefined ?
112
+ root.ready( selector ) :
113
+
103
114
  // Execute immediately if ready is not present
104
115
  selector( jQuery );
105
116
  }
@@ -120,4 +131,4 @@ rootjQuery = jQuery( document );
120
131
 
121
132
  return init;
122
133
 
123
- });
134
+ } );
@@ -1,11 +1,13 @@
1
- define([
1
+ define( [
2
2
  "../core",
3
+ "../var/document",
3
4
  "./var/rsingleTag",
4
- "../manipulation" // buildFragment
5
- ], function( jQuery, rsingleTag ) {
5
+ "../manipulation/buildFragment"
6
+ ], function( jQuery, document, rsingleTag, buildFragment ) {
6
7
 
7
- // data: string of html
8
- // context (optional): If specified, the fragment will be created in this context, defaults to document
8
+ // Argument "data" should be string of html
9
+ // context (optional): If specified, the fragment will be created in this context,
10
+ // defaults to document
9
11
  // keepScripts (optional): If true, will include scripts passed in the html string
10
12
  jQuery.parseHTML = function( data, context, keepScripts ) {
11
13
  if ( !data || typeof data !== "string" ) {
@@ -22,10 +24,10 @@ jQuery.parseHTML = function( data, context, keepScripts ) {
22
24
 
23
25
  // Single tag
24
26
  if ( parsed ) {
25
- return [ context.createElement( parsed[1] ) ];
27
+ return [ context.createElement( parsed[ 1 ] ) ];
26
28
  }
27
29
 
28
- parsed = jQuery.buildFragment( [ data ], context, scripts );
30
+ parsed = buildFragment( [ data ], context, scripts );
29
31
 
30
32
  if ( scripts && scripts.length ) {
31
33
  jQuery( scripts ).remove();
@@ -36,4 +38,4 @@ jQuery.parseHTML = function( data, context, keepScripts ) {
36
38
 
37
39
  return jQuery.parseHTML;
38
40
 
39
- });
41
+ } );
@@ -1,20 +1,23 @@
1
- define([
1
+ define( [
2
2
  "../core",
3
+ "../var/document",
3
4
  "../core/init",
4
5
  "../deferred"
5
- ], function( jQuery ) {
6
+ ], function( jQuery, document ) {
6
7
 
7
8
  // The deferred used on DOM ready
8
9
  var readyList;
9
10
 
10
11
  jQuery.fn.ready = function( fn ) {
12
+
11
13
  // Add the callback
12
14
  jQuery.ready.promise().done( fn );
13
15
 
14
16
  return this;
15
17
  };
16
18
 
17
- jQuery.extend({
19
+ jQuery.extend( {
20
+
18
21
  // Is the DOM ready to be used? Set to true once it occurs.
19
22
  isReady: false,
20
23
 
@@ -56,14 +59,14 @@ jQuery.extend({
56
59
  jQuery( document ).off( "ready" );
57
60
  }
58
61
  }
59
- });
62
+ } );
60
63
 
61
64
  /**
62
65
  * The ready event handler and self cleanup method
63
66
  */
64
67
  function completed() {
65
- document.removeEventListener( "DOMContentLoaded", completed, false );
66
- window.removeEventListener( "load", completed, false );
68
+ document.removeEventListener( "DOMContentLoaded", completed );
69
+ window.removeEventListener( "load", completed );
67
70
  jQuery.ready();
68
71
  }
69
72
 
@@ -72,20 +75,23 @@ jQuery.ready.promise = function( obj ) {
72
75
 
73
76
  readyList = jQuery.Deferred();
74
77
 
75
- // Catch cases where $(document).ready() is called after the browser event has already occurred.
76
- // We once tried to use readyState "interactive" here, but it caused issues like the one
77
- // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
78
- if ( document.readyState === "complete" ) {
78
+ // Catch cases where $(document).ready() is called
79
+ // after the browser event has already occurred.
80
+ // Support: IE9-10 only
81
+ // Older IE sometimes signals "interactive" too soon
82
+ if ( document.readyState === "complete" ||
83
+ ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
84
+
79
85
  // Handle it asynchronously to allow scripts the opportunity to delay ready
80
- setTimeout( jQuery.ready );
86
+ window.setTimeout( jQuery.ready );
81
87
 
82
88
  } else {
83
89
 
84
90
  // Use the handy event callback
85
- document.addEventListener( "DOMContentLoaded", completed, false );
91
+ document.addEventListener( "DOMContentLoaded", completed );
86
92
 
87
93
  // A fallback to window.onload, that will always work
88
- window.addEventListener( "load", completed, false );
94
+ window.addEventListener( "load", completed );
89
95
  }
90
96
  }
91
97
  return readyList.promise( obj );
@@ -94,4 +100,4 @@ jQuery.ready.promise = function( obj ) {
94
100
  // Kick off the DOM ready check even if the user does not
95
101
  jQuery.ready.promise();
96
102
 
97
- });
103
+ } );
@@ -1,4 +1,5 @@
1
- define(function() {
1
+ define( function() {
2
+
2
3
  // Match a standalone tag
3
- return (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
4
- });
4
+ return ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
5
+ } );