%PDF- %PDF-
Mini Shell

Mini Shell

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

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

Zerion Mini Shell 1.0