{"version":3,"sources":["ng-dropzone.min.js"],"names":["angular","module","provider","defOps","setOptions","newOps","extend","$get","directive","$timeout","dropzoneOps","restrict","template","replace","scope","options","callbacks","methods","link","iElem","iAttr","initOps","dropzone","Dropzone","getDropzone","getAllFiles","files","controlMethods","forEach","methodName","apply","arguments","$$phase","$root","$apply","callbackMethods","method","callback","noop","on"],"mappings":"CAOA,WACI,YAEHA,SAAQC,OAAO,0BAA2BC,SAAS,cAAe,WAIjE,GAAIC,KAIJ,QACCC,WAAa,SAASC,GACrBL,QAAQM,OAAOH,EAAQE,IAExBE,KAAO,WACN,MAAOJ,OAGPK,UAAU,cAAe,WAAY,cAAe,SAASC,EAAUC,GACzE,OACCC,SAAW,KACXC,SAAW,cACXC,SAAU,EACVC,OACCC,QAAU,KACVC,UAAY,KACZC,QAAU,MAEXC,KAAO,SAASJ,EAAOK,EAAOC,GAE7BN,EAAMC,QAAUD,EAAMC,WACtB,IAAIM,GAAUrB,QAAQM,UAAWI,EAAaI,EAAMC,SAIhDO,EAAW,GAAIC,UAASJ,EAAM,GAAIE,EAOtCP,GAAMG,QAAUH,EAAMG,YAEtBH,EAAMG,QAAQO,YAAc,WAC3B,MAAOF,IAGRR,EAAMG,QAAQQ,YAAc,WAC3B,MAAOH,GAASI,MAGjB,IAAIC,IACH,aAAc,iBAAkB,eAChC,mBAAoB,mBAAoB,iBAAkB,oBAC1D,UAAW,SAAU,UAAW,yBAejC,IAZA3B,QAAQ4B,QAAQD,EAAgB,SAASE,GACxCf,EAAMG,QAAQY,GAAc,WAC3BP,EAASO,GAAYC,MAAMR,EAAUS,WACjCjB,EAAMkB,SAAYlB,EAAMmB,MAAMD,SAASlB,EAAMoB,YAShDpB,EAAME,UAAU,CAClB,GAAImB,IACH,OAAQ,YAAa,UACrB,YAAa,WAAY,YAAa,YAAa,cACnD,YAAa,QAAS,aAAc,iBACpC,UAAW,UAAW,WAAY,WAAY,kBAC9C,mBAAoB,qBAAsB,kBAAmB,kBAC7D,mBAAoB,mBAAoB,sBAAuB,QAAS,gBAEzEnC,SAAQ4B,QAAQO,EAAiB,SAASC,GACzC,GAAIC,GAAYvB,EAAME,UAAUoB,IAAWpC,QAAQsC,IACnDhB,GAASiB,GAAGH,EAAQ,WACnBC,EAASP,MAAM,KAAMC,WACjBjB,EAAMkB,SAAYlB,EAAMmB,MAAMD,SAASlB,EAAMoB","file":"ng-dropzone.min.js","sourcesContent":["/**!\r\n * AngularJS dropzone directive\r\n * @author Uday Hiwarale \r\n * https://www.github.com/thatisuday/ngDropzone\r\n */\r\n \r\n \r\n(function(){\r\n 'use strict';\r\n\r\n\tangular.module('thatisuday.dropzone', []).provider('dropzoneOps', function(){\r\n\t\t/*\r\n\t\t *\tAdd default options here\r\n\t\t**/\r\n\t\tvar defOps = {\r\n\t\t\t//Add your options here\r\n\t\t};\r\n\t\t\r\n\t\treturn {\r\n\t\t\tsetOptions : function(newOps){\r\n\t\t\t\tangular.extend(defOps, newOps);\r\n\t\t\t},\r\n\t\t\t$get : function(){\r\n\t\t\t\treturn defOps;\r\n\t\t\t}\r\n\t\t}\r\n\t}).directive('ngDropzone', ['$timeout', 'dropzoneOps', function($timeout, dropzoneOps){\r\n\t\treturn {\r\n\t\t\trestrict : 'AE',\r\n\t\t\ttemplate : '
',\r\n\t\t\treplace : true,\r\n\t\t\tscope : {\r\n\t\t\t\toptions : '=?', //http://www.dropzonejs.com/#configuration-options\r\n\t\t\t\tcallbacks : '=?', //http://www.dropzonejs.com/#events\r\n\t\t\t\tmethods : '=?' //http://www.dropzonejs.com/#dropzone-methods\r\n\t\t\t},\r\n\t\t\tlink : function(scope, iElem, iAttr){\r\n\t\t\t\t//Set options for dropzone {override from dropzone options provider}\r\n\t\t\t\tscope.options = scope.options || {};\r\n\t\t\t\tvar initOps = angular.extend({}, dropzoneOps, scope.options);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//Instantiate dropzone with initOps\r\n\t\t\t\tvar dropzone = new Dropzone(iElem[0], initOps);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t/*********************************************/\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//Instantiate Dropzone methods (Control actions)\r\n\t\t\t\tscope.methods = scope.methods || {};\r\n\t\t\t\t\r\n\t\t\t\tscope.methods.getDropzone = function(){ \r\n\t\t\t\t\treturn dropzone; //Return dropzone instance\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tscope.methods.getAllFiles = function(){ \r\n\t\t\t\t\treturn dropzone.files; //Return all files\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tvar controlMethods = [\r\n\t\t\t\t\t'removeFile', 'removeAllFiles', 'processQueue',\r\n\t\t\t\t\t'getAcceptedFiles', 'getRejectedFiles', 'getQueuedFiles', 'getUploadingFiles',\r\n\t\t\t\t\t'disable', 'enable', 'confirm', 'createThumbnailFromUrl'\r\n\t\t\t\t];\r\n\t\t\t\t\r\n\t\t\t\tangular.forEach(controlMethods, function(methodName){\r\n\t\t\t\t\tscope.methods[methodName] = function(){\r\n\t\t\t\t\t\tdropzone[methodName].apply(dropzone, arguments);\r\n\t\t\t\t\t\tif(!scope.$$phase && !scope.$root.$$phase) scope.$apply();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t/*********************************************/\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//Set invents (callbacks)\r\n\t\t\t\tif(scope.callbacks){\r\n\t\t\t\t\tvar callbackMethods = [\r\n\t\t\t\t\t\t'drop', 'dragstart', 'dragend',\r\n\t\t\t\t\t\t'dragenter', 'dragover', 'dragleave', 'addedfile', 'removedfile',\r\n\t\t\t\t\t\t'thumbnail', 'error', 'processing', 'uploadprogress',\r\n\t\t\t\t\t\t'sending', 'success', 'complete', 'canceled', 'maxfilesreached',\r\n\t\t\t\t\t\t'maxfilesexceeded', 'processingmultiple', 'sendingmultiple', 'successmultiple',\r\n\t\t\t\t\t\t'completemultiple', 'canceledmultiple', 'totaluploadprogress', 'reset', 'queuecomplete'\r\n\t\t\t\t\t];\r\n\t\t\t\t\tangular.forEach(callbackMethods, function(method){\r\n\t\t\t\t\t\tvar callback = (scope.callbacks[method] || angular.noop);\r\n\t\t\t\t\t\tdropzone.on(method, function(){\r\n\t\t\t\t\t\t\tcallback.apply(null, arguments);\r\n\t\t\t\t\t\t\tif(!scope.$$phase && !scope.$root.$$phase) scope.$apply();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}]);\r\n})();\r\n"],"sourceRoot":"/source/"}