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,65 +1,56 @@
1
- define([
1
+ define( [
2
2
  "./core",
3
3
  "./var/concat",
4
4
  "./var/push",
5
5
  "./core/access",
6
6
  "./manipulation/var/rcheckableType",
7
+ "./manipulation/var/rtagName",
8
+ "./manipulation/var/rscriptType",
9
+ "./manipulation/wrapMap",
10
+ "./manipulation/getAll",
11
+ "./manipulation/setGlobalEval",
12
+ "./manipulation/buildFragment",
7
13
  "./manipulation/support",
8
- "./data/var/data_priv",
9
- "./data/var/data_user",
14
+
15
+ "./data/var/dataPriv",
16
+ "./data/var/dataUser",
17
+ "./data/var/acceptData",
10
18
 
11
19
  "./core/init",
12
- "./data/accepts",
13
20
  "./traversing",
14
21
  "./selector",
15
22
  "./event"
16
- ], function( jQuery, concat, push, access, rcheckableType, support, data_priv, data_user ) {
23
+ ], function( jQuery, concat, push, access,
24
+ rcheckableType, rtagName, rscriptType,
25
+ wrapMap, getAll, setGlobalEval, buildFragment, support,
26
+ dataPriv, dataUser, acceptData ) {
17
27
 
18
28
  var
19
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
20
- rtagName = /<([\w:]+)/,
21
- rhtml = /<|&#?\w+;/,
22
- rnoInnerhtml = /<(?:script|style|link)/i,
29
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
30
+
31
+ // Support: IE 10-11, Edge 10240+
32
+ // In IE/Edge using regex groups here causes severe slowdowns.
33
+ // See https://connect.microsoft.com/IE/feedback/details/1736512/
34
+ rnoInnerhtml = /<script|<style|<link/i,
35
+
23
36
  // checked="checked" or checked
24
37
  rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
25
- rscriptType = /^$|\/(?:java|ecma)script/i,
26
38
  rscriptTypeMasked = /^true\/(.*)/,
27
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
28
-
29
- // We have to close these tags to support XHTML (#13200)
30
- wrapMap = {
31
-
32
- // Support: IE9
33
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
34
-
35
- thead: [ 1, "<table>", "</table>" ],
36
- col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
37
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
38
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
39
-
40
- _default: [ 0, "", "" ]
41
- };
42
-
43
- // Support: IE9
44
- wrapMap.optgroup = wrapMap.option;
39
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
45
40
 
46
- wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
47
- wrapMap.th = wrapMap.td;
48
-
49
- // Support: 1.x compatibility
50
41
  // Manipulating tables requires a tbody
51
42
  function manipulationTarget( elem, content ) {
52
43
  return jQuery.nodeName( elem, "table" ) &&
53
44
  jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
54
45
 
55
- elem.getElementsByTagName("tbody")[0] ||
56
- elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
46
+ elem.getElementsByTagName( "tbody" )[ 0 ] ||
47
+ elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) :
57
48
  elem;
58
49
  }
59
50
 
60
51
  // Replace/restore the type attribute of script elements for safe DOM manipulation
61
52
  function disableScript( elem ) {
62
- elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
53
+ elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
63
54
  return elem;
64
55
  }
65
56
  function restoreScript( elem ) {
@@ -68,24 +59,12 @@ function restoreScript( elem ) {
68
59
  if ( match ) {
69
60
  elem.type = match[ 1 ];
70
61
  } else {
71
- elem.removeAttribute("type");
62
+ elem.removeAttribute( "type" );
72
63
  }
73
64
 
74
65
  return elem;
75
66
  }
76
67
 
77
- // Mark scripts as having already been evaluated
78
- function setGlobalEval( elems, refElements ) {
79
- var i = 0,
80
- l = elems.length;
81
-
82
- for ( ; i < l; i++ ) {
83
- data_priv.set(
84
- elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
85
- );
86
- }
87
- }
88
-
89
68
  function cloneCopyEvent( src, dest ) {
90
69
  var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
91
70
 
@@ -94,9 +73,9 @@ function cloneCopyEvent( src, dest ) {
94
73
  }
95
74
 
96
75
  // 1. Copy private data: events, handlers, etc.
97
- if ( data_priv.hasData( src ) ) {
98
- pdataOld = data_priv.access( src );
99
- pdataCur = data_priv.set( dest, pdataOld );
76
+ if ( dataPriv.hasData( src ) ) {
77
+ pdataOld = dataPriv.access( src );
78
+ pdataCur = dataPriv.set( dest, pdataOld );
100
79
  events = pdataOld.events;
101
80
 
102
81
  if ( events ) {
@@ -112,24 +91,14 @@ function cloneCopyEvent( src, dest ) {
112
91
  }
113
92
 
114
93
  // 2. Copy user data
115
- if ( data_user.hasData( src ) ) {
116
- udataOld = data_user.access( src );
94
+ if ( dataUser.hasData( src ) ) {
95
+ udataOld = dataUser.access( src );
117
96
  udataCur = jQuery.extend( {}, udataOld );
118
97
 
119
- data_user.set( dest, udataCur );
98
+ dataUser.set( dest, udataCur );
120
99
  }
121
100
  }
122
101
 
123
- function getAll( context, tag ) {
124
- var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
125
- context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
126
- [];
127
-
128
- return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
129
- jQuery.merge( [ context ], ret ) :
130
- ret;
131
- }
132
-
133
102
  // Fix IE bugs, see support tests
134
103
  function fixInput( src, dest ) {
135
104
  var nodeName = dest.nodeName.toLowerCase();
@@ -144,7 +113,122 @@ function fixInput( src, dest ) {
144
113
  }
145
114
  }
146
115
 
147
- jQuery.extend({
116
+ function domManip( collection, args, callback, ignored ) {
117
+
118
+ // Flatten any nested arrays
119
+ args = concat.apply( [], args );
120
+
121
+ var fragment, first, scripts, hasScripts, node, doc,
122
+ i = 0,
123
+ l = collection.length,
124
+ iNoClone = l - 1,
125
+ value = args[ 0 ],
126
+ isFunction = jQuery.isFunction( value );
127
+
128
+ // We can't cloneNode fragments that contain checked, in WebKit
129
+ if ( isFunction ||
130
+ ( l > 1 && typeof value === "string" &&
131
+ !support.checkClone && rchecked.test( value ) ) ) {
132
+ return collection.each( function( index ) {
133
+ var self = collection.eq( index );
134
+ if ( isFunction ) {
135
+ args[ 0 ] = value.call( this, index, self.html() );
136
+ }
137
+ domManip( self, args, callback, ignored );
138
+ } );
139
+ }
140
+
141
+ if ( l ) {
142
+ fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
143
+ first = fragment.firstChild;
144
+
145
+ if ( fragment.childNodes.length === 1 ) {
146
+ fragment = first;
147
+ }
148
+
149
+ // Require either new content or an interest in ignored elements to invoke the callback
150
+ if ( first || ignored ) {
151
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
152
+ hasScripts = scripts.length;
153
+
154
+ // Use the original fragment for the last item
155
+ // instead of the first because it can end up
156
+ // being emptied incorrectly in certain situations (#8070).
157
+ for ( ; i < l; i++ ) {
158
+ node = fragment;
159
+
160
+ if ( i !== iNoClone ) {
161
+ node = jQuery.clone( node, true, true );
162
+
163
+ // Keep references to cloned scripts for later restoration
164
+ if ( hasScripts ) {
165
+
166
+ // Support: Android<4.1, PhantomJS<2
167
+ // push.apply(_, arraylike) throws on ancient WebKit
168
+ jQuery.merge( scripts, getAll( node, "script" ) );
169
+ }
170
+ }
171
+
172
+ callback.call( collection[ i ], node, i );
173
+ }
174
+
175
+ if ( hasScripts ) {
176
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
177
+
178
+ // Reenable scripts
179
+ jQuery.map( scripts, restoreScript );
180
+
181
+ // Evaluate executable scripts on first document insertion
182
+ for ( i = 0; i < hasScripts; i++ ) {
183
+ node = scripts[ i ];
184
+ if ( rscriptType.test( node.type || "" ) &&
185
+ !dataPriv.access( node, "globalEval" ) &&
186
+ jQuery.contains( doc, node ) ) {
187
+
188
+ if ( node.src ) {
189
+
190
+ // Optional AJAX dependency, but won't run scripts if not present
191
+ if ( jQuery._evalUrl ) {
192
+ jQuery._evalUrl( node.src );
193
+ }
194
+ } else {
195
+ jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ }
202
+
203
+ return collection;
204
+ }
205
+
206
+ function remove( elem, selector, keepData ) {
207
+ var node,
208
+ nodes = selector ? jQuery.filter( selector, elem ) : elem,
209
+ i = 0;
210
+
211
+ for ( ; ( node = nodes[ i ] ) != null; i++ ) {
212
+ if ( !keepData && node.nodeType === 1 ) {
213
+ jQuery.cleanData( getAll( node ) );
214
+ }
215
+
216
+ if ( node.parentNode ) {
217
+ if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
218
+ setGlobalEval( getAll( node, "script" ) );
219
+ }
220
+ node.parentNode.removeChild( node );
221
+ }
222
+ }
223
+
224
+ return elem;
225
+ }
226
+
227
+ jQuery.extend( {
228
+ htmlPrefilter: function( html ) {
229
+ return html.replace( rxhtmlTag, "<$1></$2>" );
230
+ },
231
+
148
232
  clone: function( elem, dataAndEvents, deepDataAndEvents ) {
149
233
  var i, l, srcElements, destElements,
150
234
  clone = elem.cloneNode( true ),
@@ -187,102 +271,14 @@ jQuery.extend({
187
271
  return clone;
188
272
  },
189
273
 
190
- buildFragment: function( elems, context, scripts, selection ) {
191
- var elem, tmp, tag, wrap, contains, j,
192
- fragment = context.createDocumentFragment(),
193
- nodes = [],
194
- i = 0,
195
- l = elems.length;
196
-
197
- for ( ; i < l; i++ ) {
198
- elem = elems[ i ];
199
-
200
- if ( elem || elem === 0 ) {
201
-
202
- // Add nodes directly
203
- if ( jQuery.type( elem ) === "object" ) {
204
- // Support: QtWebKit, PhantomJS
205
- // push.apply(_, arraylike) throws on ancient WebKit
206
- jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
207
-
208
- // Convert non-html into a text node
209
- } else if ( !rhtml.test( elem ) ) {
210
- nodes.push( context.createTextNode( elem ) );
211
-
212
- // Convert html into DOM nodes
213
- } else {
214
- tmp = tmp || fragment.appendChild( context.createElement("div") );
215
-
216
- // Deserialize a standard representation
217
- tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
218
- wrap = wrapMap[ tag ] || wrapMap._default;
219
- tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
220
-
221
- // Descend through wrappers to the right content
222
- j = wrap[ 0 ];
223
- while ( j-- ) {
224
- tmp = tmp.lastChild;
225
- }
226
-
227
- // Support: QtWebKit, PhantomJS
228
- // push.apply(_, arraylike) throws on ancient WebKit
229
- jQuery.merge( nodes, tmp.childNodes );
230
-
231
- // Remember the top-level container
232
- tmp = fragment.firstChild;
233
-
234
- // Ensure the created nodes are orphaned (#12392)
235
- tmp.textContent = "";
236
- }
237
- }
238
- }
239
-
240
- // Remove wrapper from fragment
241
- fragment.textContent = "";
242
-
243
- i = 0;
244
- while ( (elem = nodes[ i++ ]) ) {
245
-
246
- // #4087 - If origin and destination elements are the same, and this is
247
- // that element, do not do anything
248
- if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
249
- continue;
250
- }
251
-
252
- contains = jQuery.contains( elem.ownerDocument, elem );
253
-
254
- // Append to fragment
255
- tmp = getAll( fragment.appendChild( elem ), "script" );
256
-
257
- // Preserve script evaluation history
258
- if ( contains ) {
259
- setGlobalEval( tmp );
260
- }
261
-
262
- // Capture executables
263
- if ( scripts ) {
264
- j = 0;
265
- while ( (elem = tmp[ j++ ]) ) {
266
- if ( rscriptType.test( elem.type || "" ) ) {
267
- scripts.push( elem );
268
- }
269
- }
270
- }
271
- }
272
-
273
- return fragment;
274
- },
275
-
276
274
  cleanData: function( elems ) {
277
- var data, elem, type, key,
275
+ var data, elem, type,
278
276
  special = jQuery.event.special,
279
277
  i = 0;
280
278
 
281
- for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
282
- if ( jQuery.acceptData( elem ) ) {
283
- key = elem[ data_priv.expando ];
284
-
285
- if ( key && (data = data_priv.cache[ key ]) ) {
279
+ for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
280
+ if ( acceptData( elem ) ) {
281
+ if ( ( data = elem[ dataPriv.expando ] ) ) {
286
282
  if ( data.events ) {
287
283
  for ( type in data.events ) {
288
284
  if ( special[ type ] ) {
@@ -294,91 +290,86 @@ jQuery.extend({
294
290
  }
295
291
  }
296
292
  }
297
- if ( data_priv.cache[ key ] ) {
298
- // Discard any remaining `private` data
299
- delete data_priv.cache[ key ];
300
- }
293
+
294
+ // Support: Chrome <= 35-45+
295
+ // Assign undefined instead of using delete, see Data#remove
296
+ elem[ dataPriv.expando ] = undefined;
297
+ }
298
+ if ( elem[ dataUser.expando ] ) {
299
+
300
+ // Support: Chrome <= 35-45+
301
+ // Assign undefined instead of using delete, see Data#remove
302
+ elem[ dataUser.expando ] = undefined;
301
303
  }
302
304
  }
303
- // Discard any remaining `user` data
304
- delete data_user.cache[ elem[ data_user.expando ] ];
305
305
  }
306
306
  }
307
- });
307
+ } );
308
+
309
+ jQuery.fn.extend( {
310
+
311
+ // Keep domManip exposed until 3.0 (gh-2225)
312
+ domManip: domManip,
313
+
314
+ detach: function( selector ) {
315
+ return remove( this, selector, true );
316
+ },
317
+
318
+ remove: function( selector ) {
319
+ return remove( this, selector );
320
+ },
308
321
 
309
- jQuery.fn.extend({
310
322
  text: function( value ) {
311
323
  return access( this, function( value ) {
312
324
  return value === undefined ?
313
325
  jQuery.text( this ) :
314
- this.empty().each(function() {
326
+ this.empty().each( function() {
315
327
  if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
316
328
  this.textContent = value;
317
329
  }
318
- });
330
+ } );
319
331
  }, null, value, arguments.length );
320
332
  },
321
333
 
322
334
  append: function() {
323
- return this.domManip( arguments, function( elem ) {
335
+ return domManip( this, arguments, function( elem ) {
324
336
  if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
325
337
  var target = manipulationTarget( this, elem );
326
338
  target.appendChild( elem );
327
339
  }
328
- });
340
+ } );
329
341
  },
330
342
 
331
343
  prepend: function() {
332
- return this.domManip( arguments, function( elem ) {
344
+ return domManip( this, arguments, function( elem ) {
333
345
  if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
334
346
  var target = manipulationTarget( this, elem );
335
347
  target.insertBefore( elem, target.firstChild );
336
348
  }
337
- });
349
+ } );
338
350
  },
339
351
 
340
352
  before: function() {
341
- return this.domManip( arguments, function( elem ) {
353
+ return domManip( this, arguments, function( elem ) {
342
354
  if ( this.parentNode ) {
343
355
  this.parentNode.insertBefore( elem, this );
344
356
  }
345
- });
357
+ } );
346
358
  },
347
359
 
348
360
  after: function() {
349
- return this.domManip( arguments, function( elem ) {
361
+ return domManip( this, arguments, function( elem ) {
350
362
  if ( this.parentNode ) {
351
363
  this.parentNode.insertBefore( elem, this.nextSibling );
352
364
  }
353
- });
354
- },
355
-
356
- remove: function( selector, keepData /* Internal Use Only */ ) {
357
- var elem,
358
- elems = selector ? jQuery.filter( selector, this ) : this,
359
- i = 0;
360
-
361
- for ( ; (elem = elems[i]) != null; i++ ) {
362
- if ( !keepData && elem.nodeType === 1 ) {
363
- jQuery.cleanData( getAll( elem ) );
364
- }
365
-
366
- if ( elem.parentNode ) {
367
- if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
368
- setGlobalEval( getAll( elem, "script" ) );
369
- }
370
- elem.parentNode.removeChild( elem );
371
- }
372
- }
373
-
374
- return this;
365
+ } );
375
366
  },
376
367
 
377
368
  empty: function() {
378
369
  var elem,
379
370
  i = 0;
380
371
 
381
- for ( ; (elem = this[i]) != null; i++ ) {
372
+ for ( ; ( elem = this[ i ] ) != null; i++ ) {
382
373
  if ( elem.nodeType === 1 ) {
383
374
 
384
375
  // Prevent memory leaks
@@ -396,9 +387,9 @@ jQuery.fn.extend({
396
387
  dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
397
388
  deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
398
389
 
399
- return this.map(function() {
390
+ return this.map( function() {
400
391
  return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
401
- });
392
+ } );
402
393
  },
403
394
 
404
395
  html: function( value ) {
@@ -415,7 +406,7 @@ jQuery.fn.extend({
415
406
  if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
416
407
  !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
417
408
 
418
- value = value.replace( rxhtmlTag, "<$1></$2>" );
409
+ value = jQuery.htmlPrefilter( value );
419
410
 
420
411
  try {
421
412
  for ( ; i < l; i++ ) {
@@ -431,7 +422,7 @@ jQuery.fn.extend({
431
422
  elem = 0;
432
423
 
433
424
  // If using innerHTML throws an exception, use the fallback method
434
- } catch( e ) {}
425
+ } catch ( e ) {}
435
426
  }
436
427
 
437
428
  if ( elem ) {
@@ -441,115 +432,25 @@ jQuery.fn.extend({
441
432
  },
442
433
 
443
434
  replaceWith: function() {
444
- var arg = arguments[ 0 ];
445
-
446
- // Make the changes, replacing each context element with the new content
447
- this.domManip( arguments, function( elem ) {
448
- arg = this.parentNode;
449
-
450
- jQuery.cleanData( getAll( this ) );
451
-
452
- if ( arg ) {
453
- arg.replaceChild( elem, this );
454
- }
455
- });
456
-
457
- // Force removal if there was no new content (e.g., from empty arguments)
458
- return arg && (arg.length || arg.nodeType) ? this : this.remove();
459
- },
460
-
461
- detach: function( selector ) {
462
- return this.remove( selector, true );
463
- },
464
-
465
- domManip: function( args, callback ) {
466
-
467
- // Flatten any nested arrays
468
- args = concat.apply( [], args );
469
-
470
- var fragment, first, scripts, hasScripts, node, doc,
471
- i = 0,
472
- l = this.length,
473
- set = this,
474
- iNoClone = l - 1,
475
- value = args[ 0 ],
476
- isFunction = jQuery.isFunction( value );
477
-
478
- // We can't cloneNode fragments that contain checked, in WebKit
479
- if ( isFunction ||
480
- ( l > 1 && typeof value === "string" &&
481
- !support.checkClone && rchecked.test( value ) ) ) {
482
- return this.each(function( index ) {
483
- var self = set.eq( index );
484
- if ( isFunction ) {
485
- args[ 0 ] = value.call( this, index, self.html() );
486
- }
487
- self.domManip( args, callback );
488
- });
489
- }
490
-
491
- if ( l ) {
492
- fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
493
- first = fragment.firstChild;
494
-
495
- if ( fragment.childNodes.length === 1 ) {
496
- fragment = first;
497
- }
498
-
499
- if ( first ) {
500
- scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
501
- hasScripts = scripts.length;
502
-
503
- // Use the original fragment for the last item instead of the first because it can end up
504
- // being emptied incorrectly in certain situations (#8070).
505
- for ( ; i < l; i++ ) {
506
- node = fragment;
435
+ var ignored = [];
507
436
 
508
- if ( i !== iNoClone ) {
509
- node = jQuery.clone( node, true, true );
437
+ // Make the changes, replacing each non-ignored context element with the new content
438
+ return domManip( this, arguments, function( elem ) {
439
+ var parent = this.parentNode;
510
440
 
511
- // Keep references to cloned scripts for later restoration
512
- if ( hasScripts ) {
513
- // Support: QtWebKit
514
- // jQuery.merge because push.apply(_, arraylike) throws
515
- jQuery.merge( scripts, getAll( node, "script" ) );
516
- }
517
- }
518
-
519
- callback.call( this[ i ], node, i );
520
- }
521
-
522
- if ( hasScripts ) {
523
- doc = scripts[ scripts.length - 1 ].ownerDocument;
524
-
525
- // Reenable scripts
526
- jQuery.map( scripts, restoreScript );
527
-
528
- // Evaluate executable scripts on first document insertion
529
- for ( i = 0; i < hasScripts; i++ ) {
530
- node = scripts[ i ];
531
- if ( rscriptType.test( node.type || "" ) &&
532
- !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
533
-
534
- if ( node.src ) {
535
- // Optional AJAX dependency, but won't run scripts if not present
536
- if ( jQuery._evalUrl ) {
537
- jQuery._evalUrl( node.src );
538
- }
539
- } else {
540
- jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
541
- }
542
- }
543
- }
441
+ if ( jQuery.inArray( this, ignored ) < 0 ) {
442
+ jQuery.cleanData( getAll( this ) );
443
+ if ( parent ) {
444
+ parent.replaceChild( elem, this );
544
445
  }
545
446
  }
546
- }
547
447
 
548
- return this;
448
+ // Force callback invocation
449
+ }, ignored );
549
450
  }
550
- });
451
+ } );
551
452
 
552
- jQuery.each({
453
+ jQuery.each( {
553
454
  appendTo: "append",
554
455
  prependTo: "prepend",
555
456
  insertBefore: "before",
@@ -574,7 +475,7 @@ jQuery.each({
574
475
 
575
476
  return this.pushStack( ret );
576
477
  };
577
- });
478
+ } );
578
479
 
579
480
  return jQuery;
580
- });
481
+ } );