ajax-manager
Advanced tools
Comparing version 1.0.14 to 1.0.15
@@ -1,1 +0,1 @@ | ||
!function(o,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.ajaxManager=n():o.ajaxManager=n()}(this,function(){return function(o){function n(t){if(e[t])return e[t].exports;var r=e[t]={i:t,l:!1,exports:{}};return o[t].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var e={};return n.m=o,n.c=e,n.d=function(o,e,t){n.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},n.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(e,"a",e),e},n.o=function(o,n){return Object.prototype.hasOwnProperty.call(o,n)},n.p="",n(n.s=0)}([function(o,n,e){"use strict";function t(o){return o&&o.__esModule?o:{default:o}}Object.defineProperty(n,"__esModule",{value:!0});var r=e(1);Object.defineProperty(n,"default",{enumerable:!0,get:function(){return t(r).default}})},function(o,n,e){"use strict";function t(o){if(Array.isArray(o)){for(var n=0,e=Array(o.length);n<o.length;n++)e[n]=o[n];return e}return Array.from(o)}function r(o){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=window.__apiConfig__[o];r||(r={});var a=r.url||t.url||n.url||e.url||"",i=window.__apiRoot__||t.__apiRoot||n.__apiRoot||e.__apiRoot||"";return r.ignoreGlobalApiRoot||t.__ignoreGlobalApiRoot||n.__ignoreGlobalApiRoot||e.__ignoreGlobalApiRoot?a:i+a}Object.defineProperty(n,"__esModule",{value:!0}),window.__apiCount__=0,window.__apiCounter={add:function(){window.__apiCount__++},remove:function(){window.__apiCount__--},get:function(){return window.__apiCount__}},window.__apiConfig__||(window.__apiConfig__={}),window.__apiRoot__||(window.__apiRoot__=null);var a=function(){function o(o,n){for(var e=0;e<o.length;e++)"function"==typeof o[e]&&o[e].apply(o,t(n))}function n(o,n){"function"==typeof o&&o.apply(void 0,t(n))}function e(o,n){for(var e=0;e<p[o].length;e++){var r;"function"==typeof p[o][e]&&(r=p[o])[e].apply(r,t(n))}}var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_=arguments[2],u=_,l={};a.forEach(function(o,n){for(var e in o){var t=o[e];e in l&&console.warn('ajaxManager: api in models should not have same name "'+e+'".'),l[e]=t}l.__global||(l.__global={})});var f={beforeSend:[],success:[],error:[],complete:[]},p={ajaxStart:[],ajaxStop:[]},c={};for(var d in l)!function(t){/^__/g.test(t)||(c[t]=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Object.keys(f).map(function(o){i[o]&&f[o].push(i[o]),l.__global[o]&&f[o].push(l.__global[o])}),Object.keys(p).map(function(o){i[o]&&p[o].push(i[o]),l.__global[o]&&p[o].push(l.__global[o])});var d={beforeSend:null,success:null,error:null,complete:null};Object.keys(d).map(function(o){d[o]=a[o]||l[t][o]});var s=Object.assign({},i.data||{},l.__global.data||{},l[t].data||{},a.data||{}),g=Object.assign({},i||{},l[t]||{},a,{url:r(t,l[t],i,a),data:s,beforeSend:function(t){_&&(window.__apiCounter.add(),e("ajaxStart",[t])),c&&o(f.beforeSend,[t]),n(d.beforeSend,[t])},success:function(e,t,r){c&&o(f.success,[e,t,r]),n(d.success,[e,t,r])},error:function(e,t,r){c&&o(f.error,[e,t,r]),n(d.error,[e,t,r])},complete:function(t,r){_&&(window.__apiCounter.remove(),e("ajaxStop",[t,r])),c&&o(f.complete,[t,r]),n(d.complete,[t,r])}});return g.contentType&&"application/json"===g.contentType.toLowerCase().trim()&&(g.data=JSON.stringify(s)),window.__apiConfig__&&window.__apiConfig__[t]&&window.__apiConfig__[t].type&&(g.type=window.__apiConfig__[t].type),u.ajax(g)})}(d);return c};n.default=a}])}); | ||
!function(o,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ajaxManager=e():o.ajaxManager=e()}(this,function(){return function(o){function e(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return o[t].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=o,e.c=n,e.d=function(o,n,t){e.o(o,n)||Object.defineProperty(o,n,{configurable:!1,enumerable:!0,get:t})},e.n=function(o){var n=o&&o.__esModule?function(){return o.default}:function(){return o};return e.d(n,"a",n),n},e.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},e.p="",e(e.s=0)}([function(o,e,n){"use strict";function t(o){return o&&o.__esModule?o:{default:o}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(1);Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t(r).default}})},function(o,e,n){"use strict";function t(o){if(Array.isArray(o)){for(var e=0,n=Array(o.length);e<o.length;e++)n[e]=o[e];return n}return Array.from(o)}function r(o){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=window.__apiConfig__[o];r||(r={});var a=r.url||t.url||e.url||n.url||"",i=window.__apiRoot__||t.__apiRoot||e.__apiRoot||n.__apiRoot||"";return r.ignoreGlobalApiRoot||t.__ignoreGlobalApiRoot||e.__ignoreGlobalApiRoot||n.__ignoreGlobalApiRoot?a:i+a}Object.defineProperty(e,"__esModule",{value:!0}),window.__apiCount__=0,window.__apiCounter={add:function(){window.__apiCount__++},remove:function(){window.__apiCount__--},get:function(){return window.__apiCount__}},window.__apiConfig__||(window.__apiConfig__={}),window.__apiRoot__||(window.__apiRoot__=null);var a=function(){function o(o,e){for(var n=0;n<o.length;n++)"function"==typeof o[n]&&o[n].apply(o,t(e))}function e(o,e){"function"==typeof o&&o.apply(void 0,t(e))}function n(o,e){for(var n=0;n<c[o].length;n++){var r;"function"==typeof c[o][n]&&(r=c[o])[n].apply(r,t(e))}}var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_=arguments[2],u=_,l={};a.forEach(function(o,e){for(var n in o){var t=o[n];n in l&&console.warn('ajaxManager: api in models should not have same name "'+n+'".'),l[n]=t}l.__global||(l.__global={}),l.__default||(l.__default={})});var f={beforeSend:[],success:[],error:[],complete:[]},c={ajaxStart:[],ajaxStop:[]},p={};for(var d in l)!function(t){/^__/g.test(t)||(p[t]=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],p=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Object.keys(f).map(function(o){i[o]&&f[o].push(i[o]),l.__global[o]&&f[o].push(l.__global[o])}),Object.keys(c).map(function(o){i[o]&&c[o].push(i[o]),l.__global[o]&&c[o].push(l.__global[o])});var d={beforeSend:null,success:null,error:null,complete:null};Object.keys(d).map(function(o){d[o]=a[o]||l[t][o]});var s=Object.assign({},i.data||{},l.__global.data||{},l[t].data||{},a.data||{}),g=Object.assign({},l.__default||{},i||{},l[t]||{},a,l.__global,{url:r(t,l[t],i,a),data:s,beforeSend:function(t){_&&(window.__apiCounter.add(),n("ajaxStart",[t])),p&&o(f.beforeSend,[t]),e(d.beforeSend,[t])},success:function(n,t,r){p&&o(f.success,[n,t,r]),e(d.success,[n,t,r])},error:function(n,t,r){p&&o(f.error,[n,t,r]),e(d.error,[n,t,r])},complete:function(t,r){_&&(window.__apiCounter.remove(),n("ajaxStop",[t,r])),p&&o(f.complete,[t,r]),e(d.complete,[t,r])}});return window.__apiConfig__&&window.__apiConfig__[t]&&window.__apiConfig__[t].type&&(g=Object.assign({},g,window.__apiConfig__[t])),"post"===g.method.toLowerCase().trim()&&g.contentType&&"application/json"===g.contentType.toLowerCase().trim()&&(g.data=JSON.stringify(s)),u.ajax(g)})}(d);return p};e.default=a}])}); |
{ | ||
"name": "ajax-manager", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "An jQuery ajax management tool", | ||
"main": "index.js", | ||
"scripts": { | ||
"dev": "webpack --config ./webpack.config.js --watch", | ||
"build": "webpack --config ./webpack.config.js", | ||
@@ -8,0 +9,0 @@ "test": "echo \"Error: no test specified\" && exit 1" |
@@ -188,3 +188,3 @@ // use global count instead of jquery global event because it does't support cross domain request | ||
if ( | ||
allConfig.type.toLowerCase().trim() === 'post' && | ||
allConfig.method.toLowerCase().trim() === 'post' && | ||
allConfig.contentType && | ||
@@ -191,0 +191,0 @@ allConfig.contentType.toLowerCase().trim() === 'application/json') { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21168