-
Notifications
You must be signed in to change notification settings - Fork 0
/
orbweaver-progress.min.js.map
1 lines (1 loc) · 4.55 KB
/
orbweaver-progress.min.js.map
1
{"version":3,"sources":["orbweaver-progress.js"],"names":["window","angular","undefined","orbweaver","module","factory","$window","NProgress","provider","RestfulProgressServiceProvider","$resourceProvider","orbRestfulResourceProvider","this","$get","$q","orbProgressService","orbRestfulService","restfulProgressServiceFactory","url","params","actions","options","RestfulProgressService","resource","extend","forEach","defaults","empty","saveAsCreateOrUpdate","save","start","result","apply","arguments","done","action","name","incrementProgressCounter","progressCounter","decrementProgressCounter"],"mappings":";;;;;CAAA,SAAAA,OAAAC,QAAAC,WACA,YAEA,IAAAC,WAAAF,QAAAG,OAAA,eAAA,eAEAD,WAAAE,QAAA,aAAA,UAAA,SAAAC,SACA,MAAAA,SAAAC,aAGAJ,UAAAK,SAAA,6BAAA,oBAAA,6BAAA,QAAAC,gCAAAC,kBAAAC,4BACAC,KAAAC,MAAA,KAAA,qBAAA,oBAAA,SAAAC,GAAAC,mBAAAC,mBACA,QAAAC,+BAAAC,IAAAC,OAAAC,QAAAC,SASA,QAAAC,0BACA,MAAA,IAAAC,UATA,GAAAC,QAAAvB,QAAAuB,OACAC,QAAAxB,QAAAwB,OAEAL,SAAAI,UAAAd,kBAAAgB,SAAAN,QAAAT,2BAAAe,SAAAN,QAAAA,SACAC,QAAAG,UAAAb,2BAAAe,SAAAL,QAAAA,QAEA,IAAAE,UAAA,GAAAP,mBAAAE,IAAAC,OAAAC,QAAAC,QAoCA,OA9BAC,wBAAAK,MAAA,WACA,MAAA,IAAAJ,WAGAF,QAAAO,wBAAA,IACAN,uBAAAO,KAAA,WACAd,mBAAAe,OACA,IAAAC,QAAAR,SAAAM,KAAAG,MAAApB,KAAAqB,UACA,OAAAF,QACAA,OAAAA,WAAA,WAAAhB,mBAAAmB,UAEAnB,mBAAAmB,OACAH,UAKAN,QAAAL,QAAA,SAAAe,OAAAC,MACAd,uBAAAc,MAAA,WACArB,mBAAAe,OACA,IAAAC,QAAAR,SAAAa,MAAAJ,MAAApB,KAAAqB,UACA,OAAAF,QACAA,OAAAA,WAAA,WAAAhB,mBAAAmB,UAEAnB,mBAAAmB,OACAH,WAKAT,uBAGA,MAAAL,oCAIAd,UAAAE,QAAA,sBAAA,YAAA,SAAAE,WAGA,QAAA8B,4BACA,IAAAC,iBACA/B,UAAAuB,QAEAQ,kBAGA,QAAAC,4BACAD,kBACA,IAAAA,iBACA/B,UAAA2B,OAZA,GAAAI,iBAAA,CAgBA,QACAR,MAAAO,yBACAH,KAAAK,8BAIAvC,OAAAA,OAAAC","file":"orbweaver-progress.min.js","sourcesContent":["/**\n * orbweaver v1.0.0\n * @copyright 2013-2017 Arana Software <[email protected]>. https://github.com/aranasoft/orbweaver\n * @license BSD-3-Clause\n */\n\n(function (window, angular, undefined) {\n 'use strict';\n\n var orbweaver = angular.module('orbProgress', ['orbResource']);\n\n orbweaver.factory('NProgress', ['$window', function($window) {\n return $window.NProgress;\n }]);\n\n orbweaver.provider('orbRestfulProgressService', ['$resourceProvider', 'orbRestfulResourceProvider', function RestfulProgressServiceProvider($resourceProvider, orbRestfulResourceProvider) {\n this.$get = ['$q', 'orbProgressService', 'orbRestfulService', function ($q, orbProgressService, orbRestfulService) {\n function restfulProgressServiceFactory(url, params, actions, options) {\n var extend = angular.extend,\n forEach = angular.forEach;\n\n actions = extend({}, $resourceProvider.defaults.actions, orbRestfulResourceProvider.defaults.actions, actions);\n options = extend({}, orbRestfulResourceProvider.defaults.options, options);\n\n var resource = new orbRestfulService(url, params, actions, options);\n\n function RestfulProgressService() {\n return new resource();\n }\n\n RestfulProgressService.empty = function() {\n return new resource();\n };\n\n if (options.saveAsCreateOrUpdate !== false) {\n RestfulProgressService.save = function () {\n orbProgressService.start();\n var result = resource.save.apply(this, arguments);\n if (result) {\n return result.finally(function() { orbProgressService.done(); });\n } else {\n orbProgressService.done();\n return result;\n }\n };\n }\n\n forEach(actions, function(action, name) {\n RestfulProgressService[name] = function() {\n orbProgressService.start();\n var result = resource[name].apply(this, arguments);\n if (result) {\n return result.finally(function() { orbProgressService.done(); });\n } else {\n orbProgressService.done();\n return result;\n }\n };\n });\n\n return RestfulProgressService;\n }\n\n return restfulProgressServiceFactory;\n }];\n }]);\n\n orbweaver.factory(\"orbProgressService\", ['NProgress', function (NProgress) {\n var progressCounter = 0;\n\n function incrementProgressCounter() {\n if (progressCounter === 0) {\n NProgress.start();\n }\n progressCounter++;\n }\n\n function decrementProgressCounter() {\n progressCounter--;\n if (progressCounter === 0) {\n NProgress.done();\n }\n }\n\n return {\n start: incrementProgressCounter,\n done: decrementProgressCounter\n };\n }]);\n\n})(window, window.angular);\n\n"]}