%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/985914/root/data/old/home/stash/stash/atlassian-stash/static/util/
Upload File :
Create Path :
Current File : //proc/985914/root/data/old/home/stash/stash/atlassian-stash/static/util/handler-registry-min.js

define("util/handler-registry",["jquery","underscore"],function(C,A){function B(){this.handlers=[]}B.prototype.register=function(E){if(!A.isFunction(E.handle)){throw new Error("Handler must have a handle function")}E.weight=typeof E.weight==="number"&&!isNaN(E.weight)?E.weight:1000;this.handlers.push(E);this.handlers=A.sortBy(this.handlers,function(G){return G.weight});var F=this;return function D(){var G=F.handlers.indexOf(E);if(G>=0){F.handlers.splice(G,1)}}};B.prototype._handle=function(G){var F=C.Deferred();var I;var D;var E=this.handlers;var J=[];function H(K){if(I){return F.reject(new Error("Handling aborted."))}if(K<E.length){D=E[K].handle(G)||C.Deferred().reject();return C.when(D).done(function(L){F.resolve(L||{},J)}).fail(function(L){L&&J.push(L);H(K+1)})}else{F.reject(new Error("No registered handlers were able to handle file"))}}H(0);return F.promise({abort:function(){if(!I&&D&&D.abort){D.abort()}I=true}})};B.prototype._clear=function(){this.handlers=[]};return B});

Zerion Mini Shell 1.0