trusty-cms 4.2.2 → 4.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/Gemfile.lock +98 -89
  4. data/app/assets/config/trusty-cms/manifest.js +7 -0
  5. data/app/assets/javascripts/admin/custom_file_upload.js +7 -0
  6. data/app/controllers/admin/assets_controller.rb +1 -1
  7. data/app/models/page.rb +2 -2
  8. data/app/views/admin/assets/new.html.haml +2 -0
  9. data/config/database.yml +4 -0
  10. data/config/initializers/assets.rb +0 -4
  11. data/coverage/index.html +155 -155
  12. data/lib/trusty_cms.rb +1 -1
  13. data/node_modules/hosted-git-info/CHANGELOG.md +10 -0
  14. data/node_modules/hosted-git-info/index.js +2 -2
  15. data/node_modules/hosted-git-info/package.json +1 -1
  16. data/node_modules/lodash/README.md +2 -2
  17. data/node_modules/lodash/_baseClone.js +2 -1
  18. data/node_modules/lodash/_baseOrderBy.js +17 -2
  19. data/node_modules/lodash/_baseSet.js +4 -0
  20. data/node_modules/lodash/_baseSortedIndexBy.js +7 -4
  21. data/node_modules/lodash/_baseTrim.js +19 -0
  22. data/node_modules/lodash/_equalArrays.js +5 -4
  23. data/node_modules/lodash/_equalObjects.js +5 -4
  24. data/node_modules/lodash/_trimmedEndIndex.js +19 -0
  25. data/node_modules/lodash/core.js +48 -6
  26. data/node_modules/lodash/core.min.js +9 -9
  27. data/node_modules/lodash/filter.js +4 -0
  28. data/node_modules/lodash/flake.lock +40 -0
  29. data/node_modules/lodash/flake.nix +20 -0
  30. data/node_modules/lodash/lodash.js +59 -11
  31. data/node_modules/lodash/lodash.min.js +126 -125
  32. data/node_modules/lodash/matches.js +7 -0
  33. data/node_modules/lodash/matchesProperty.js +7 -0
  34. data/node_modules/lodash/overEvery.js +4 -0
  35. data/node_modules/lodash/overSome.js +7 -0
  36. data/node_modules/lodash/package.json +1 -1
  37. data/node_modules/lodash/parseInt.js +1 -1
  38. data/node_modules/lodash/release.md +48 -0
  39. data/node_modules/lodash/sortBy.js +3 -3
  40. data/node_modules/lodash/template.js +24 -5
  41. data/node_modules/lodash/toNumber.js +3 -5
  42. data/node_modules/lodash/trim.js +2 -4
  43. data/node_modules/lodash/trimEnd.js +3 -5
  44. data/node_modules/lodash/trimStart.js +1 -1
  45. data/spec/dummy/log/development.log +9 -163
  46. data/spec/dummy/log/test.log +536 -0
  47. data/spec/dummy/node_modules/jquery-ui-bundle/AUTHORS.txt +333 -0
  48. data/spec/dummy/node_modules/jquery-ui-bundle/LICENSE.txt +43 -0
  49. data/spec/dummy/node_modules/jquery-ui-bundle/external/jquery/jquery.js +11008 -0
  50. data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_444444_256x240.png +0 -0
  51. data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_555555_256x240.png +0 -0
  52. data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_777620_256x240.png +0 -0
  53. data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_777777_256x240.png +0 -0
  54. data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_cc0000_256x240.png +0 -0
  55. data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_ffffff_256x240.png +0 -0
  56. data/spec/dummy/node_modules/jquery-ui-bundle/index.html +559 -0
  57. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.css +1312 -0
  58. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.js +18706 -0
  59. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.min.css +7 -0
  60. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.min.js +13 -0
  61. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.structure.css +886 -0
  62. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.structure.min.css +5 -0
  63. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.theme.css +443 -0
  64. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.theme.min.css +5 -0
  65. data/spec/dummy/node_modules/jquery-ui-bundle/package.json +33 -0
  66. data/spec/dummy/node_modules/jquery-ujs/CONTRIBUTING.md +109 -0
  67. data/spec/dummy/node_modules/jquery-ujs/MIT-LICENSE +20 -0
  68. data/spec/dummy/node_modules/jquery-ujs/README.md +86 -0
  69. data/spec/dummy/node_modules/jquery-ujs/RELEASE.md +23 -0
  70. data/spec/dummy/node_modules/jquery-ujs/bower.json +19 -0
  71. data/spec/dummy/node_modules/jquery-ujs/package.json +26 -0
  72. data/spec/dummy/node_modules/jquery-ujs/src/rails.js +555 -0
  73. data/spec/dummy/node_modules/jquery/AUTHORS.txt +327 -0
  74. data/spec/dummy/node_modules/jquery/LICENSE.txt +20 -0
  75. data/spec/dummy/node_modules/jquery/README.md +62 -0
  76. data/spec/dummy/node_modules/jquery/bower.json +14 -0
  77. data/spec/dummy/node_modules/jquery/dist/jquery.js +10872 -0
  78. data/spec/dummy/node_modules/jquery/dist/jquery.min.js +2 -0
  79. data/spec/dummy/node_modules/jquery/dist/jquery.min.map +1 -0
  80. data/spec/dummy/node_modules/jquery/dist/jquery.slim.js +8777 -0
  81. data/spec/dummy/node_modules/jquery/dist/jquery.slim.min.js +2 -0
  82. data/spec/dummy/node_modules/jquery/dist/jquery.slim.min.map +1 -0
  83. data/spec/dummy/node_modules/jquery/external/sizzle/LICENSE.txt +36 -0
  84. data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.js +2478 -0
  85. data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
  86. data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.min.map +1 -0
  87. data/spec/dummy/node_modules/jquery/package.json +117 -0
  88. data/spec/dummy/node_modules/jquery/src/ajax.js +873 -0
  89. data/spec/dummy/node_modules/jquery/src/ajax/jsonp.js +103 -0
  90. data/spec/dummy/node_modules/jquery/src/ajax/load.js +77 -0
  91. data/spec/dummy/node_modules/jquery/src/ajax/script.js +74 -0
  92. data/spec/dummy/node_modules/jquery/src/ajax/var/location.js +5 -0
  93. data/spec/dummy/node_modules/jquery/src/ajax/var/nonce.js +5 -0
  94. data/spec/dummy/node_modules/jquery/src/ajax/var/rquery.js +5 -0
  95. data/spec/dummy/node_modules/jquery/src/ajax/xhr.js +170 -0
  96. data/spec/dummy/node_modules/jquery/src/attributes.js +13 -0
  97. data/spec/dummy/node_modules/jquery/src/attributes/attr.js +141 -0
  98. data/spec/dummy/node_modules/jquery/src/attributes/classes.js +186 -0
  99. data/spec/dummy/node_modules/jquery/src/attributes/prop.js +143 -0
  100. data/spec/dummy/node_modules/jquery/src/attributes/support.js +33 -0
  101. data/spec/dummy/node_modules/jquery/src/attributes/val.js +191 -0
  102. data/spec/dummy/node_modules/jquery/src/callbacks.js +236 -0
  103. data/spec/dummy/node_modules/jquery/src/core.js +400 -0
  104. data/spec/dummy/node_modules/jquery/src/core/DOMEval.js +43 -0
  105. data/spec/dummy/node_modules/jquery/src/core/access.js +72 -0
  106. data/spec/dummy/node_modules/jquery/src/core/camelCase.js +23 -0
  107. data/spec/dummy/node_modules/jquery/src/core/init.js +129 -0
  108. data/spec/dummy/node_modules/jquery/src/core/isAttached.js +26 -0
  109. data/spec/dummy/node_modules/jquery/src/core/nodeName.js +13 -0
  110. data/spec/dummy/node_modules/jquery/src/core/parseHTML.js +65 -0
  111. data/spec/dummy/node_modules/jquery/src/core/parseXML.js +30 -0
  112. data/spec/dummy/node_modules/jquery/src/core/ready-no-deferred.js +97 -0
  113. data/spec/dummy/node_modules/jquery/src/core/ready.js +86 -0
  114. data/spec/dummy/node_modules/jquery/src/core/readyException.js +13 -0
  115. data/spec/dummy/node_modules/jquery/src/core/stripAndCollapse.js +14 -0
  116. data/spec/dummy/node_modules/jquery/src/core/support.js +20 -0
  117. data/spec/dummy/node_modules/jquery/src/core/toType.js +20 -0
  118. data/spec/dummy/node_modules/jquery/src/core/var/rsingleTag.js +7 -0
  119. data/spec/dummy/node_modules/jquery/src/css.js +494 -0
  120. data/spec/dummy/node_modules/jquery/src/css/addGetHookIf.js +26 -0
  121. data/spec/dummy/node_modules/jquery/src/css/adjustCSS.js +74 -0
  122. data/spec/dummy/node_modules/jquery/src/css/curCSS.js +65 -0
  123. data/spec/dummy/node_modules/jquery/src/css/finalPropName.js +42 -0
  124. data/spec/dummy/node_modules/jquery/src/css/hiddenVisibleSelectors.js +15 -0
  125. data/spec/dummy/node_modules/jquery/src/css/showHide.js +105 -0
  126. data/spec/dummy/node_modules/jquery/src/css/support.js +133 -0
  127. data/spec/dummy/node_modules/jquery/src/css/var/cssExpand.js +5 -0
  128. data/spec/dummy/node_modules/jquery/src/css/var/getStyles.js +17 -0
  129. data/spec/dummy/node_modules/jquery/src/css/var/isHiddenWithinTree.js +34 -0
  130. data/spec/dummy/node_modules/jquery/src/css/var/rboxStyle.js +7 -0
  131. data/spec/dummy/node_modules/jquery/src/css/var/rnumnonpx.js +7 -0
  132. data/spec/dummy/node_modules/jquery/src/css/var/swap.js +26 -0
  133. data/spec/dummy/node_modules/jquery/src/data.js +180 -0
  134. data/spec/dummy/node_modules/jquery/src/data/Data.js +162 -0
  135. data/spec/dummy/node_modules/jquery/src/data/var/acceptData.js +19 -0
  136. data/spec/dummy/node_modules/jquery/src/data/var/dataPriv.js +7 -0
  137. data/spec/dummy/node_modules/jquery/src/data/var/dataUser.js +7 -0
  138. data/spec/dummy/node_modules/jquery/src/deferred.js +399 -0
  139. data/spec/dummy/node_modules/jquery/src/deferred/exceptionHook.js +21 -0
  140. data/spec/dummy/node_modules/jquery/src/deprecated.js +87 -0
  141. data/spec/dummy/node_modules/jquery/src/deprecated/ajax-event-alias.js +22 -0
  142. data/spec/dummy/node_modules/jquery/src/deprecated/event.js +48 -0
  143. data/spec/dummy/node_modules/jquery/src/dimensions.js +57 -0
  144. data/spec/dummy/node_modules/jquery/src/effects.js +701 -0
  145. data/spec/dummy/node_modules/jquery/src/effects/Tween.js +125 -0
  146. data/spec/dummy/node_modules/jquery/src/effects/animatedSelector.js +15 -0
  147. data/spec/dummy/node_modules/jquery/src/event.js +892 -0
  148. data/spec/dummy/node_modules/jquery/src/event/focusin.js +58 -0
  149. data/spec/dummy/node_modules/jquery/src/event/support.js +11 -0
  150. data/spec/dummy/node_modules/jquery/src/event/trigger.js +201 -0
  151. data/spec/dummy/node_modules/jquery/src/exports/amd.js +26 -0
  152. data/spec/dummy/node_modules/jquery/src/exports/global.js +34 -0
  153. data/spec/dummy/node_modules/jquery/src/jquery.js +41 -0
  154. data/spec/dummy/node_modules/jquery/src/manipulation.js +480 -0
  155. data/spec/dummy/node_modules/jquery/src/manipulation/_evalUrl.js +32 -0
  156. data/spec/dummy/node_modules/jquery/src/manipulation/buildFragment.js +106 -0
  157. data/spec/dummy/node_modules/jquery/src/manipulation/getAll.js +32 -0
  158. data/spec/dummy/node_modules/jquery/src/manipulation/setGlobalEval.js +22 -0
  159. data/spec/dummy/node_modules/jquery/src/manipulation/support.js +41 -0
  160. data/spec/dummy/node_modules/jquery/src/manipulation/var/rscriptType.js +5 -0
  161. data/spec/dummy/node_modules/jquery/src/manipulation/var/rtagName.js +8 -0
  162. data/spec/dummy/node_modules/jquery/src/manipulation/wrapMap.js +30 -0
  163. data/spec/dummy/node_modules/jquery/src/offset.js +238 -0
  164. data/spec/dummy/node_modules/jquery/src/queue.js +145 -0
  165. data/spec/dummy/node_modules/jquery/src/queue/delay.js +24 -0
  166. data/spec/dummy/node_modules/jquery/src/selector-native.js +241 -0
  167. data/spec/dummy/node_modules/jquery/src/selector-sizzle.js +19 -0
  168. data/spec/dummy/node_modules/jquery/src/selector.js +3 -0
  169. data/spec/dummy/node_modules/jquery/src/serialize.js +136 -0
  170. data/spec/dummy/node_modules/jquery/src/traversing.js +198 -0
  171. data/spec/dummy/node_modules/jquery/src/traversing/findFilter.js +97 -0
  172. data/spec/dummy/node_modules/jquery/src/traversing/var/dir.js +22 -0
  173. data/spec/dummy/node_modules/jquery/src/traversing/var/rneedsContext.js +8 -0
  174. data/spec/dummy/node_modules/jquery/src/traversing/var/siblings.js +17 -0
  175. data/spec/dummy/node_modules/jquery/src/var/ObjectFunctionString.js +7 -0
  176. data/spec/dummy/node_modules/jquery/src/var/arr.js +5 -0
  177. data/spec/dummy/node_modules/jquery/src/var/class2type.js +6 -0
  178. data/spec/dummy/node_modules/jquery/src/var/document.js +5 -0
  179. data/spec/dummy/node_modules/jquery/src/var/documentElement.js +7 -0
  180. data/spec/dummy/node_modules/jquery/src/var/flat.js +16 -0
  181. data/spec/dummy/node_modules/jquery/src/var/fnToString.js +7 -0
  182. data/spec/dummy/node_modules/jquery/src/var/getProto.js +5 -0
  183. data/spec/dummy/node_modules/jquery/src/var/hasOwn.js +7 -0
  184. data/spec/dummy/node_modules/jquery/src/var/indexOf.js +7 -0
  185. data/spec/dummy/node_modules/jquery/src/var/isFunction.js +13 -0
  186. data/spec/dummy/node_modules/jquery/src/var/isWindow.js +8 -0
  187. data/spec/dummy/node_modules/jquery/src/var/pnum.js +5 -0
  188. data/spec/dummy/node_modules/jquery/src/var/push.js +7 -0
  189. data/spec/dummy/node_modules/jquery/src/var/rcheckableType.js +5 -0
  190. data/spec/dummy/node_modules/jquery/src/var/rcssNum.js +9 -0
  191. data/spec/dummy/node_modules/jquery/src/var/rnothtmlwhite.js +8 -0
  192. data/spec/dummy/node_modules/jquery/src/var/slice.js +7 -0
  193. data/spec/dummy/node_modules/jquery/src/var/support.js +6 -0
  194. data/spec/dummy/node_modules/jquery/src/var/toString.js +7 -0
  195. data/spec/dummy/node_modules/jquery/src/wrap.js +78 -0
  196. data/spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig +5 -0
  197. data/spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime +1 -0
  198. data/trusty_cms.gemspec +3 -2
  199. data/yarn.lock +9 -9
  200. metadata +354 -50
@@ -0,0 +1,103 @@
1
+ define( [
2
+ "../core",
3
+ "../var/isFunction",
4
+ "./var/nonce",
5
+ "./var/rquery",
6
+ "../ajax"
7
+ ], function( jQuery, isFunction, nonce, rquery ) {
8
+
9
+ "use strict";
10
+
11
+ var oldCallbacks = [],
12
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
13
+
14
+ // Default jsonp settings
15
+ jQuery.ajaxSetup( {
16
+ jsonp: "callback",
17
+ jsonpCallback: function() {
18
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
19
+ this[ callback ] = true;
20
+ return callback;
21
+ }
22
+ } );
23
+
24
+ // Detect, normalize options and install callbacks for jsonp requests
25
+ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
26
+
27
+ var callbackName, overwritten, responseContainer,
28
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
29
+ "url" :
30
+ typeof s.data === "string" &&
31
+ ( s.contentType || "" )
32
+ .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
33
+ rjsonp.test( s.data ) && "data"
34
+ );
35
+
36
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
37
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
38
+
39
+ // Get callback name, remembering preexisting value associated with it
40
+ callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
41
+ s.jsonpCallback() :
42
+ s.jsonpCallback;
43
+
44
+ // Insert callback into url or form data
45
+ if ( jsonProp ) {
46
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
47
+ } else if ( s.jsonp !== false ) {
48
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
49
+ }
50
+
51
+ // Use data converter to retrieve json after script execution
52
+ s.converters[ "script json" ] = function() {
53
+ if ( !responseContainer ) {
54
+ jQuery.error( callbackName + " was not called" );
55
+ }
56
+ return responseContainer[ 0 ];
57
+ };
58
+
59
+ // Force json dataType
60
+ s.dataTypes[ 0 ] = "json";
61
+
62
+ // Install callback
63
+ overwritten = window[ callbackName ];
64
+ window[ callbackName ] = function() {
65
+ responseContainer = arguments;
66
+ };
67
+
68
+ // Clean-up function (fires after converters)
69
+ jqXHR.always( function() {
70
+
71
+ // If previous value didn't exist - remove it
72
+ if ( overwritten === undefined ) {
73
+ jQuery( window ).removeProp( callbackName );
74
+
75
+ // Otherwise restore preexisting value
76
+ } else {
77
+ window[ callbackName ] = overwritten;
78
+ }
79
+
80
+ // Save back as free
81
+ if ( s[ callbackName ] ) {
82
+
83
+ // Make sure that re-using the options doesn't screw things around
84
+ s.jsonpCallback = originalSettings.jsonpCallback;
85
+
86
+ // Save the callback name for future use
87
+ oldCallbacks.push( callbackName );
88
+ }
89
+
90
+ // Call if it was a function and we have a response
91
+ if ( responseContainer && isFunction( overwritten ) ) {
92
+ overwritten( responseContainer[ 0 ] );
93
+ }
94
+
95
+ responseContainer = overwritten = undefined;
96
+ } );
97
+
98
+ // Delegate to script
99
+ return "script";
100
+ }
101
+ } );
102
+
103
+ } );
@@ -0,0 +1,77 @@
1
+ define( [
2
+ "../core",
3
+ "../core/stripAndCollapse",
4
+ "../var/isFunction",
5
+ "../core/parseHTML",
6
+ "../ajax",
7
+ "../traversing",
8
+ "../manipulation",
9
+ "../selector"
10
+ ], function( jQuery, stripAndCollapse, isFunction ) {
11
+
12
+ "use strict";
13
+
14
+ /**
15
+ * Load a url into a page
16
+ */
17
+ jQuery.fn.load = function( url, params, callback ) {
18
+ var selector, type, response,
19
+ self = this,
20
+ off = url.indexOf( " " );
21
+
22
+ if ( off > -1 ) {
23
+ selector = stripAndCollapse( url.slice( off ) );
24
+ url = url.slice( 0, off );
25
+ }
26
+
27
+ // If it's a function
28
+ if ( isFunction( params ) ) {
29
+
30
+ // We assume that it's the callback
31
+ callback = params;
32
+ params = undefined;
33
+
34
+ // Otherwise, build a param string
35
+ } else if ( params && typeof params === "object" ) {
36
+ type = "POST";
37
+ }
38
+
39
+ // If we have elements to modify, make the request
40
+ if ( self.length > 0 ) {
41
+ jQuery.ajax( {
42
+ url: url,
43
+
44
+ // If "type" variable is undefined, then "GET" method will be used.
45
+ // Make value of this field explicit since
46
+ // user can override it through ajaxSetup method
47
+ type: type || "GET",
48
+ dataType: "html",
49
+ data: params
50
+ } ).done( function( responseText ) {
51
+
52
+ // Save response for use in complete callback
53
+ response = arguments;
54
+
55
+ self.html( selector ?
56
+
57
+ // If a selector was specified, locate the right elements in a dummy div
58
+ // Exclude scripts to avoid IE 'Permission Denied' errors
59
+ jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
60
+
61
+ // Otherwise use the full result
62
+ responseText );
63
+
64
+ // If the request succeeds, this function gets "data", "status", "jqXHR"
65
+ // but they are ignored because response was set above.
66
+ // If it fails, this function gets "jqXHR", "status", "error"
67
+ } ).always( callback && function( jqXHR, status ) {
68
+ self.each( function() {
69
+ callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
70
+ } );
71
+ } );
72
+ }
73
+
74
+ return this;
75
+ };
76
+
77
+ } );
@@ -0,0 +1,74 @@
1
+ define( [
2
+ "../core",
3
+ "../var/document",
4
+ "../ajax"
5
+ ], function( jQuery, document ) {
6
+
7
+ "use strict";
8
+
9
+ // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
10
+ jQuery.ajaxPrefilter( function( s ) {
11
+ if ( s.crossDomain ) {
12
+ s.contents.script = false;
13
+ }
14
+ } );
15
+
16
+ // Install script dataType
17
+ jQuery.ajaxSetup( {
18
+ accepts: {
19
+ script: "text/javascript, application/javascript, " +
20
+ "application/ecmascript, application/x-ecmascript"
21
+ },
22
+ contents: {
23
+ script: /\b(?:java|ecma)script\b/
24
+ },
25
+ converters: {
26
+ "text script": function( text ) {
27
+ jQuery.globalEval( text );
28
+ return text;
29
+ }
30
+ }
31
+ } );
32
+
33
+ // Handle cache's special case and crossDomain
34
+ jQuery.ajaxPrefilter( "script", function( s ) {
35
+ if ( s.cache === undefined ) {
36
+ s.cache = false;
37
+ }
38
+ if ( s.crossDomain ) {
39
+ s.type = "GET";
40
+ }
41
+ } );
42
+
43
+ // Bind script tag hack transport
44
+ jQuery.ajaxTransport( "script", function( s ) {
45
+
46
+ // This transport only deals with cross domain or forced-by-attrs requests
47
+ if ( s.crossDomain || s.scriptAttrs ) {
48
+ var script, callback;
49
+ return {
50
+ send: function( _, complete ) {
51
+ script = jQuery( "<script>" )
52
+ .attr( s.scriptAttrs || {} )
53
+ .prop( { charset: s.scriptCharset, src: s.url } )
54
+ .on( "load error", callback = function( evt ) {
55
+ script.remove();
56
+ callback = null;
57
+ if ( evt ) {
58
+ complete( evt.type === "error" ? 404 : 200, evt.type );
59
+ }
60
+ } );
61
+
62
+ // Use native DOM manipulation to avoid our domManip AJAX trickery
63
+ document.head.appendChild( script[ 0 ] );
64
+ },
65
+ abort: function() {
66
+ if ( callback ) {
67
+ callback();
68
+ }
69
+ }
70
+ };
71
+ }
72
+ } );
73
+
74
+ } );
@@ -0,0 +1,5 @@
1
+ define( function() {
2
+ "use strict";
3
+
4
+ return window.location;
5
+ } );
@@ -0,0 +1,5 @@
1
+ define( function() {
2
+ "use strict";
3
+
4
+ return { guid: Date.now() };
5
+ } );
@@ -0,0 +1,5 @@
1
+ define( function() {
2
+ "use strict";
3
+
4
+ return ( /\?/ );
5
+ } );
@@ -0,0 +1,170 @@
1
+ define( [
2
+ "../core",
3
+ "../var/support",
4
+ "../ajax"
5
+ ], function( jQuery, support ) {
6
+
7
+ "use strict";
8
+
9
+ jQuery.ajaxSettings.xhr = function() {
10
+ try {
11
+ return new window.XMLHttpRequest();
12
+ } catch ( e ) {}
13
+ };
14
+
15
+ var xhrSuccessStatus = {
16
+
17
+ // File protocol always yields status code 0, assume 200
18
+ 0: 200,
19
+
20
+ // Support: IE <=9 only
21
+ // #1450: sometimes IE returns 1223 when it should be 204
22
+ 1223: 204
23
+ },
24
+ xhrSupported = jQuery.ajaxSettings.xhr();
25
+
26
+ support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
27
+ support.ajax = xhrSupported = !!xhrSupported;
28
+
29
+ jQuery.ajaxTransport( function( options ) {
30
+ var callback, errorCallback;
31
+
32
+ // Cross domain only allowed if supported through XMLHttpRequest
33
+ if ( support.cors || xhrSupported && !options.crossDomain ) {
34
+ return {
35
+ send: function( headers, complete ) {
36
+ var i,
37
+ xhr = options.xhr();
38
+
39
+ xhr.open(
40
+ options.type,
41
+ options.url,
42
+ options.async,
43
+ options.username,
44
+ options.password
45
+ );
46
+
47
+ // Apply custom fields if provided
48
+ if ( options.xhrFields ) {
49
+ for ( i in options.xhrFields ) {
50
+ xhr[ i ] = options.xhrFields[ i ];
51
+ }
52
+ }
53
+
54
+ // Override mime type if needed
55
+ if ( options.mimeType && xhr.overrideMimeType ) {
56
+ xhr.overrideMimeType( options.mimeType );
57
+ }
58
+
59
+ // X-Requested-With header
60
+ // For cross-domain requests, seeing as conditions for a preflight are
61
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
62
+ // (it can always be set on a per-request basis or even using ajaxSetup)
63
+ // For same-domain requests, won't change header if already provided.
64
+ if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
65
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
66
+ }
67
+
68
+ // Set headers
69
+ for ( i in headers ) {
70
+ xhr.setRequestHeader( i, headers[ i ] );
71
+ }
72
+
73
+ // Callback
74
+ callback = function( type ) {
75
+ return function() {
76
+ if ( callback ) {
77
+ callback = errorCallback = xhr.onload =
78
+ xhr.onerror = xhr.onabort = xhr.ontimeout =
79
+ xhr.onreadystatechange = null;
80
+
81
+ if ( type === "abort" ) {
82
+ xhr.abort();
83
+ } else if ( type === "error" ) {
84
+
85
+ // Support: IE <=9 only
86
+ // On a manual native abort, IE9 throws
87
+ // errors on any property access that is not readyState
88
+ if ( typeof xhr.status !== "number" ) {
89
+ complete( 0, "error" );
90
+ } else {
91
+ complete(
92
+
93
+ // File: protocol always yields status 0; see #8605, #14207
94
+ xhr.status,
95
+ xhr.statusText
96
+ );
97
+ }
98
+ } else {
99
+ complete(
100
+ xhrSuccessStatus[ xhr.status ] || xhr.status,
101
+ xhr.statusText,
102
+
103
+ // Support: IE <=9 only
104
+ // IE9 has no XHR2 but throws on binary (trac-11426)
105
+ // For XHR2 non-text, let the caller handle it (gh-2498)
106
+ ( xhr.responseType || "text" ) !== "text" ||
107
+ typeof xhr.responseText !== "string" ?
108
+ { binary: xhr.response } :
109
+ { text: xhr.responseText },
110
+ xhr.getAllResponseHeaders()
111
+ );
112
+ }
113
+ }
114
+ };
115
+ };
116
+
117
+ // Listen to events
118
+ xhr.onload = callback();
119
+ errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
120
+
121
+ // Support: IE 9 only
122
+ // Use onreadystatechange to replace onabort
123
+ // to handle uncaught aborts
124
+ if ( xhr.onabort !== undefined ) {
125
+ xhr.onabort = errorCallback;
126
+ } else {
127
+ xhr.onreadystatechange = function() {
128
+
129
+ // Check readyState before timeout as it changes
130
+ if ( xhr.readyState === 4 ) {
131
+
132
+ // Allow onerror to be called first,
133
+ // but that will not handle a native abort
134
+ // Also, save errorCallback to a variable
135
+ // as xhr.onerror cannot be accessed
136
+ window.setTimeout( function() {
137
+ if ( callback ) {
138
+ errorCallback();
139
+ }
140
+ } );
141
+ }
142
+ };
143
+ }
144
+
145
+ // Create the abort callback
146
+ callback = callback( "abort" );
147
+
148
+ try {
149
+
150
+ // Do send the request (this may raise an exception)
151
+ xhr.send( options.hasContent && options.data || null );
152
+ } catch ( e ) {
153
+
154
+ // #14683: Only rethrow if this hasn't been notified as an error yet
155
+ if ( callback ) {
156
+ throw e;
157
+ }
158
+ }
159
+ },
160
+
161
+ abort: function() {
162
+ if ( callback ) {
163
+ callback();
164
+ }
165
+ }
166
+ };
167
+ }
168
+ } );
169
+
170
+ } );