%PDF- %PDF-
Mini Shell

Mini Shell

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

define("widget/approve",["jquery","util/ajax","util/deprecation","util/events","model/page-state","widget/button-trigger"],function(G,F,E,C,B,A){function D(K,I){this._opts={url:I,triggerHandler:this.buttonClicked};A.call(this,K,this._opts);var H=this;var J=function(L){if(B.getCurrentUser()&&L.user.name===B.getCurrentUser().getName()&&L.pullRequestId===B.getPullRequest().getId()){H.setTriggerActive(L.approved);var M=L.approved?AJS.I18n.getText("stash.web.pullrequest.toolbar.approved.tooltip"):AJS.I18n.getText("stash.web.pullrequest.toolbar.approve.tooltip");H._$trigger.attr("title",M+H._$trigger.data("kbShortcutAppended"))}};C.on("stash.widget.approve-button.adding",J);C.on("stash.widget.approve-button.removing",J);C.on("stash.widget.approve-button.add.failed",J);C.on("stash.widget.approve-button.remove.failed",J)}G.extend(D.prototype,A.prototype);D.prototype.buttonClicked=function(K,J){var H=this;function I(L,M){C.trigger(L,H,{approved:M,pullRequestId:B.getPullRequest().getId(),user:E.jsonAsBrace(B.getCurrentUser(),"3.2","4.0")})}I(K?"stash.widget.approve-button.adding":"stash.widget.approve-button.removing",K);F.rest({url:H._opts.url,type:K?"POST":"DELETE",statusCode:{"401":function(N,P,M,O,L){return G.extend({},L,{title:AJS.I18n.getText("stash.web.pullrequest.approve.error.401.title"),message:AJS.I18n.getText("stash.web.pullrequest.approve.error.401.message"),fallbackUrl:false,shouldReload:true})},"409":function(N,P,M,O,L){return G.extend({},L,{title:AJS.I18n.getText("stash.web.pullrequest.approve.error.409.title"),fallbackUrl:false,shouldReload:true})}}}).done(function(){I(K?"stash.widget.approve-button.added":"stash.widget.approve-button.removed",K)}).fail(function(){I(K?"stash.widget.approve-button.add.failed":"stash.widget.approve-button.remove.failed",!K)})};return D});

Zerion Mini Shell 1.0