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,49 +1,47 @@
1
- define([
1
+ define( [
2
2
  "../core",
3
3
  "../var/rnotwhite",
4
- "../var/strundefined",
5
- "../data/var/data_priv",
4
+ "../data/var/dataPriv",
6
5
  "../core/init"
7
- ], function( jQuery, rnotwhite, strundefined, data_priv ) {
6
+ ], function( jQuery, rnotwhite, dataPriv ) {
8
7
 
9
8
  var rclass = /[\t\r\n\f]/g;
10
9
 
11
- jQuery.fn.extend({
10
+ function getClass( elem ) {
11
+ return elem.getAttribute && elem.getAttribute( "class" ) || "";
12
+ }
13
+
14
+ jQuery.fn.extend( {
12
15
  addClass: function( value ) {
13
- var classes, elem, cur, clazz, j, finalValue,
14
- proceed = typeof value === "string" && value,
15
- i = 0,
16
- len = this.length;
16
+ var classes, elem, cur, curValue, clazz, j, finalValue,
17
+ i = 0;
17
18
 
18
19
  if ( jQuery.isFunction( value ) ) {
19
- return this.each(function( j ) {
20
- jQuery( this ).addClass( value.call( this, j, this.className ) );
21
- });
20
+ return this.each( function( j ) {
21
+ jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
22
+ } );
22
23
  }
23
24
 
24
- if ( proceed ) {
25
- // The disjunction here is for better compressibility (see removeClass)
26
- classes = ( value || "" ).match( rnotwhite ) || [];
25
+ if ( typeof value === "string" && value ) {
26
+ classes = value.match( rnotwhite ) || [];
27
27
 
28
- for ( ; i < len; i++ ) {
29
- elem = this[ i ];
30
- cur = elem.nodeType === 1 && ( elem.className ?
31
- ( " " + elem.className + " " ).replace( rclass, " " ) :
32
- " "
33
- );
28
+ while ( ( elem = this[ i++ ] ) ) {
29
+ curValue = getClass( elem );
30
+ cur = elem.nodeType === 1 &&
31
+ ( " " + curValue + " " ).replace( rclass, " " );
34
32
 
35
33
  if ( cur ) {
36
34
  j = 0;
37
- while ( (clazz = classes[j++]) ) {
35
+ while ( ( clazz = classes[ j++ ] ) ) {
38
36
  if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
39
37
  cur += clazz + " ";
40
38
  }
41
39
  }
42
40
 
43
- // only assign if different to avoid unneeded rendering.
41
+ // Only assign if different to avoid unneeded rendering.
44
42
  finalValue = jQuery.trim( cur );
45
- if ( elem.className !== finalValue ) {
46
- elem.className = finalValue;
43
+ if ( curValue !== finalValue ) {
44
+ elem.setAttribute( "class", finalValue );
47
45
  }
48
46
  }
49
47
  }
@@ -53,40 +51,43 @@ jQuery.fn.extend({
53
51
  },
54
52
 
55
53
  removeClass: function( value ) {
56
- var classes, elem, cur, clazz, j, finalValue,
57
- proceed = arguments.length === 0 || typeof value === "string" && value,
58
- i = 0,
59
- len = this.length;
54
+ var classes, elem, cur, curValue, clazz, j, finalValue,
55
+ i = 0;
60
56
 
61
57
  if ( jQuery.isFunction( value ) ) {
62
- return this.each(function( j ) {
63
- jQuery( this ).removeClass( value.call( this, j, this.className ) );
64
- });
58
+ return this.each( function( j ) {
59
+ jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
60
+ } );
61
+ }
62
+
63
+ if ( !arguments.length ) {
64
+ return this.attr( "class", "" );
65
65
  }
66
- if ( proceed ) {
67
- classes = ( value || "" ).match( rnotwhite ) || [];
68
66
 
69
- for ( ; i < len; i++ ) {
70
- elem = this[ i ];
67
+ if ( typeof value === "string" && value ) {
68
+ classes = value.match( rnotwhite ) || [];
69
+
70
+ while ( ( elem = this[ i++ ] ) ) {
71
+ curValue = getClass( elem );
72
+
71
73
  // This expression is here for better compressibility (see addClass)
72
- cur = elem.nodeType === 1 && ( elem.className ?
73
- ( " " + elem.className + " " ).replace( rclass, " " ) :
74
- ""
75
- );
74
+ cur = elem.nodeType === 1 &&
75
+ ( " " + curValue + " " ).replace( rclass, " " );
76
76
 
77
77
  if ( cur ) {
78
78
  j = 0;
79
- while ( (clazz = classes[j++]) ) {
79
+ while ( ( clazz = classes[ j++ ] ) ) {
80
+
80
81
  // Remove *all* instances
81
- while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
82
+ while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
82
83
  cur = cur.replace( " " + clazz + " ", " " );
83
84
  }
84
85
  }
85
86
 
86
87
  // Only assign if different to avoid unneeded rendering.
87
- finalValue = value ? jQuery.trim( cur ) : "";
88
- if ( elem.className !== finalValue ) {
89
- elem.className = finalValue;
88
+ finalValue = jQuery.trim( cur );
89
+ if ( curValue !== finalValue ) {
90
+ elem.setAttribute( "class", finalValue );
90
91
  }
91
92
  }
92
93
  }
@@ -103,20 +104,26 @@ jQuery.fn.extend({
103
104
  }
104
105
 
105
106
  if ( jQuery.isFunction( value ) ) {
106
- return this.each(function( i ) {
107
- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
108
- });
107
+ return this.each( function( i ) {
108
+ jQuery( this ).toggleClass(
109
+ value.call( this, i, getClass( this ), stateVal ),
110
+ stateVal
111
+ );
112
+ } );
109
113
  }
110
114
 
111
- return this.each(function() {
115
+ return this.each( function() {
116
+ var className, i, self, classNames;
117
+
112
118
  if ( type === "string" ) {
119
+
113
120
  // Toggle individual class names
114
- var className,
115
- i = 0,
116
- self = jQuery( this ),
117
- classNames = value.match( rnotwhite ) || [];
121
+ i = 0;
122
+ self = jQuery( this );
123
+ classNames = value.match( rnotwhite ) || [];
124
+
125
+ while ( ( className = classNames[ i++ ] ) ) {
118
126
 
119
- while ( (className = classNames[ i++ ]) ) {
120
127
  // Check each className given, space separated list
121
128
  if ( self.hasClass( className ) ) {
122
129
  self.removeClass( className );
@@ -126,33 +133,45 @@ jQuery.fn.extend({
126
133
  }
127
134
 
128
135
  // Toggle whole class name
129
- } else if ( type === strundefined || type === "boolean" ) {
130
- if ( this.className ) {
131
- // store className if set
132
- data_priv.set( this, "__className__", this.className );
136
+ } else if ( value === undefined || type === "boolean" ) {
137
+ className = getClass( this );
138
+ if ( className ) {
139
+
140
+ // Store className if set
141
+ dataPriv.set( this, "__className__", className );
133
142
  }
134
143
 
135
144
  // If the element has a class name or if we're passed `false`,
136
145
  // then remove the whole classname (if there was one, the above saved it).
137
146
  // Otherwise bring back whatever was previously saved (if anything),
138
147
  // falling back to the empty string if nothing was stored.
139
- this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
148
+ if ( this.setAttribute ) {
149
+ this.setAttribute( "class",
150
+ className || value === false ?
151
+ "" :
152
+ dataPriv.get( this, "__className__" ) || ""
153
+ );
154
+ }
140
155
  }
141
- });
156
+ } );
142
157
  },
143
158
 
144
159
  hasClass: function( selector ) {
145
- var className = " " + selector + " ",
146
- i = 0,
147
- l = this.length;
148
- for ( ; i < l; i++ ) {
149
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
160
+ var className, elem,
161
+ i = 0;
162
+
163
+ className = " " + selector + " ";
164
+ while ( ( elem = this[ i++ ] ) ) {
165
+ if ( elem.nodeType === 1 &&
166
+ ( " " + getClass( elem ) + " " ).replace( rclass, " " )
167
+ .indexOf( className ) > -1
168
+ ) {
150
169
  return true;
151
170
  }
152
171
  }
153
172
 
154
173
  return false;
155
174
  }
156
- });
175
+ } );
157
176
 
158
- });
177
+ } );
@@ -1,69 +1,90 @@
1
- define([
1
+ define( [
2
2
  "../core",
3
3
  "../core/access",
4
- "./support"
4
+ "./support",
5
+ "../selector"
5
6
  ], function( jQuery, access, support ) {
6
7
 
7
- var rfocusable = /^(?:input|select|textarea|button)$/i;
8
+ var rfocusable = /^(?:input|select|textarea|button)$/i,
9
+ rclickable = /^(?:a|area)$/i;
8
10
 
9
- jQuery.fn.extend({
11
+ jQuery.fn.extend( {
10
12
  prop: function( name, value ) {
11
13
  return access( this, jQuery.prop, name, value, arguments.length > 1 );
12
14
  },
13
15
 
14
16
  removeProp: function( name ) {
15
- return this.each(function() {
17
+ return this.each( function() {
16
18
  delete this[ jQuery.propFix[ name ] || name ];
17
- });
19
+ } );
18
20
  }
19
- });
20
-
21
- jQuery.extend({
22
- propFix: {
23
- "for": "htmlFor",
24
- "class": "className"
25
- },
21
+ } );
26
22
 
23
+ jQuery.extend( {
27
24
  prop: function( elem, name, value ) {
28
- var ret, hooks, notxml,
25
+ var ret, hooks,
29
26
  nType = elem.nodeType;
30
27
 
31
28
  // Don't get/set properties on text, comment and attribute nodes
32
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
29
+ if ( nType === 3 || nType === 8 || nType === 2 ) {
33
30
  return;
34
31
  }
35
32
 
36
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
33
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
37
34
 
38
- if ( notxml ) {
39
35
  // Fix name and attach hooks
40
36
  name = jQuery.propFix[ name ] || name;
41
37
  hooks = jQuery.propHooks[ name ];
42
38
  }
43
39
 
44
40
  if ( value !== undefined ) {
45
- return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
46
- ret :
47
- ( elem[ name ] = value );
48
-
49
- } else {
50
- return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
51
- ret :
52
- elem[ name ];
41
+ if ( hooks && "set" in hooks &&
42
+ ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
43
+ return ret;
44
+ }
45
+
46
+ return ( elem[ name ] = value );
53
47
  }
48
+
49
+ if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
50
+ return ret;
51
+ }
52
+
53
+ return elem[ name ];
54
54
  },
55
55
 
56
56
  propHooks: {
57
57
  tabIndex: {
58
58
  get: function( elem ) {
59
- return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
60
- elem.tabIndex :
61
- -1;
59
+
60
+ // elem.tabIndex doesn't always return the
61
+ // correct value when it hasn't been explicitly set
62
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
63
+ // Use proper attribute retrieval(#12072)
64
+ var tabindex = jQuery.find.attr( elem, "tabindex" );
65
+
66
+ return tabindex ?
67
+ parseInt( tabindex, 10 ) :
68
+ rfocusable.test( elem.nodeName ) ||
69
+ rclickable.test( elem.nodeName ) && elem.href ?
70
+ 0 :
71
+ -1;
62
72
  }
63
73
  }
74
+ },
75
+
76
+ propFix: {
77
+ "for": "htmlFor",
78
+ "class": "className"
64
79
  }
65
- });
80
+ } );
66
81
 
82
+ // Support: IE <=11 only
83
+ // Accessing the selectedIndex property
84
+ // forces the browser to respect setting selected
85
+ // on the option
86
+ // The getter ensures a default option is selected
87
+ // when in an optgroup
67
88
  if ( !support.optSelected ) {
68
89
  jQuery.propHooks.selected = {
69
90
  get: function( elem ) {
@@ -72,11 +93,21 @@ if ( !support.optSelected ) {
72
93
  parent.parentNode.selectedIndex;
73
94
  }
74
95
  return null;
96
+ },
97
+ set: function( elem ) {
98
+ var parent = elem.parentNode;
99
+ if ( parent ) {
100
+ parent.selectedIndex;
101
+
102
+ if ( parent.parentNode ) {
103
+ parent.parentNode.selectedIndex;
104
+ }
105
+ }
75
106
  }
76
107
  };
77
108
  }
78
109
 
79
- jQuery.each([
110
+ jQuery.each( [
80
111
  "tabIndex",
81
112
  "readOnly",
82
113
  "maxLength",
@@ -89,6 +120,6 @@ jQuery.each([
89
120
  "contentEditable"
90
121
  ], function() {
91
122
  jQuery.propFix[ this.toLowerCase() ] = this;
92
- });
123
+ } );
93
124
 
94
- });
125
+ } );
@@ -1,8 +1,9 @@
1
- define([
1
+ define( [
2
+ "../var/document",
2
3
  "../var/support"
3
- ], function( support ) {
4
+ ], function( document, support ) {
4
5
 
5
- (function() {
6
+ ( function() {
6
7
  var input = document.createElement( "input" ),
7
8
  select = document.createElement( "select" ),
8
9
  opt = select.appendChild( document.createElement( "option" ) );
@@ -28,8 +29,8 @@ define([
28
29
  input.value = "t";
29
30
  input.type = "radio";
30
31
  support.radioValue = input.value === "t";
31
- })();
32
+ } )();
32
33
 
33
34
  return support;
34
35
 
35
- });
36
+ } );
@@ -1,29 +1,36 @@
1
- define([
1
+ define( [
2
2
  "../core",
3
3
  "./support",
4
4
  "../core/init"
5
5
  ], function( jQuery, support ) {
6
6
 
7
- var rreturn = /\r/g;
7
+ var rreturn = /\r/g,
8
+ rspaces = /[\x20\t\r\n\f]+/g;
8
9
 
9
- jQuery.fn.extend({
10
+ jQuery.fn.extend( {
10
11
  val: function( value ) {
11
12
  var hooks, ret, isFunction,
12
- elem = this[0];
13
+ elem = this[ 0 ];
13
14
 
14
15
  if ( !arguments.length ) {
15
16
  if ( elem ) {
16
- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
17
+ hooks = jQuery.valHooks[ elem.type ] ||
18
+ jQuery.valHooks[ elem.nodeName.toLowerCase() ];
17
19
 
18
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
20
+ if ( hooks &&
21
+ "get" in hooks &&
22
+ ( ret = hooks.get( elem, "value" ) ) !== undefined
23
+ ) {
19
24
  return ret;
20
25
  }
21
26
 
22
27
  ret = elem.value;
23
28
 
24
29
  return typeof ret === "string" ?
30
+
25
31
  // Handle most common string cases
26
- ret.replace(rreturn, "") :
32
+ ret.replace( rreturn, "" ) :
33
+
27
34
  // Handle cases where value is null/undef or number
28
35
  ret == null ? "" : ret;
29
36
  }
@@ -33,7 +40,7 @@ jQuery.fn.extend({
33
40
 
34
41
  isFunction = jQuery.isFunction( value );
35
42
 
36
- return this.each(function( i ) {
43
+ return this.each( function( i ) {
37
44
  var val;
38
45
 
39
46
  if ( this.nodeType !== 1 ) {
@@ -56,29 +63,33 @@ jQuery.fn.extend({
56
63
  } else if ( jQuery.isArray( val ) ) {
57
64
  val = jQuery.map( val, function( value ) {
58
65
  return value == null ? "" : value + "";
59
- });
66
+ } );
60
67
  }
61
68
 
62
69
  hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
63
70
 
64
71
  // If set returns undefined, fall back to normal setting
65
- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
72
+ if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
66
73
  this.value = val;
67
74
  }
68
- });
75
+ } );
69
76
  }
70
- });
77
+ } );
71
78
 
72
- jQuery.extend({
79
+ jQuery.extend( {
73
80
  valHooks: {
74
81
  option: {
75
82
  get: function( elem ) {
83
+
76
84
  var val = jQuery.find.attr( elem, "value" );
77
85
  return val != null ?
78
86
  val :
87
+
79
88
  // Support: IE10-11+
80
89
  // option.text throws exceptions (#14686, #14858)
81
- jQuery.trim( jQuery.text( elem ) );
90
+ // Strip and collapse whitespace
91
+ // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
92
+ jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " );
82
93
  }
83
94
  },
84
95
  select: {
@@ -97,11 +108,14 @@ jQuery.extend({
97
108
  for ( ; i < max; i++ ) {
98
109
  option = options[ i ];
99
110
 
100
- // IE6-9 doesn't update selected after form reset (#2551)
111
+ // IE8-9 doesn't update selected after form reset (#2551)
101
112
  if ( ( option.selected || i === index ) &&
113
+
102
114
  // Don't return options that are disabled or in a disabled optgroup
103
- ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
104
- ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
115
+ ( support.optDisabled ?
116
+ !option.disabled : option.getAttribute( "disabled" ) === null ) &&
117
+ ( !option.parentNode.disabled ||
118
+ !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
105
119
 
106
120
  // Get the specific value for the option
107
121
  value = jQuery( option ).val();
@@ -127,7 +141,9 @@ jQuery.extend({
127
141
 
128
142
  while ( i-- ) {
129
143
  option = options[ i ];
130
- if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
144
+ if ( option.selected =
145
+ jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
146
+ ) {
131
147
  optionSet = true;
132
148
  }
133
149
  }
@@ -140,22 +156,22 @@ jQuery.extend({
140
156
  }
141
157
  }
142
158
  }
143
- });
159
+ } );
144
160
 
145
161
  // Radios and checkboxes getter/setter
146
- jQuery.each([ "radio", "checkbox" ], function() {
162
+ jQuery.each( [ "radio", "checkbox" ], function() {
147
163
  jQuery.valHooks[ this ] = {
148
164
  set: function( elem, value ) {
149
165
  if ( jQuery.isArray( value ) ) {
150
- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
166
+ return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
151
167
  }
152
168
  }
153
169
  };
154
170
  if ( !support.checkOn ) {
155
171
  jQuery.valHooks[ this ].get = function( elem ) {
156
- return elem.getAttribute("value") === null ? "on" : elem.value;
172
+ return elem.getAttribute( "value" ) === null ? "on" : elem.value;
157
173
  };
158
174
  }
159
- });
175
+ } );
160
176
 
161
- });
177
+ } );
@@ -1,4 +1,4 @@
1
- define([
1
+ define( [
2
2
  "./core",
3
3
  "./attributes/attr",
4
4
  "./attributes/prop",
@@ -8,4 +8,4 @@ define([
8
8
 
9
9
  // Return jQuery for attributes-only inclusion
10
10
  return jQuery;
11
- });
11
+ } );