%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /data/old/home/stash/stash/atlassian-stash/static/stash/api/util/
Upload File :
Create Path :
Current File : //data/old/home/stash/stash/atlassian-stash/static/stash/api/util/navbuilder-min.js

define("stash/api/util/navbuilder",["aui","jquery","lib/jsuri","underscore","util/deprecation","model/page-state","exports"],function(AF,Aa,f,AD,Al,R,w){function d(Ao,Ap,An){this.components=(AD.isString(Ao)?[Ao]:Ao)||[];this.params=Ap||{};this.anchor=An||undefined}d.prototype.buildRelNoContext=function(){var Ao="/"+AD.map(this.components,encodeURIComponent).join("/");var Ap=AD.reduce(this.params,function(Ar,Aq,As){if(!(AD.isArray(Aq))){Aq=[Aq]}AD.forEach(Aq,function(At){Ar.push({key:As,value:At})});return Ar},[]);var An=AD.map(Ap,function(Ar){var Aq=encodeURIComponent(Ar.value);return encodeURIComponent(Ar.key)+(Aq?"="+Aq:"")}).join("&");return Ao+(An?"?"+An:"")+(this.anchor?"#"+this.anchor:"")};d.prototype.buildRelative=function(){return AF.contextPath()+this.buildRelNoContext()};d.prototype.buildAbsolute=function(){return location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")+this.buildRelative()};d.prototype.toString=function(){return this.buildRelative()};d.prototype.addParams=function(Ao){var An=new d(this.components,AD.extend({},this.params));if(AD.isString(Ao)){An.params[Ao]=""}else{if(Ao.hasOwnProperty("queryParams")){An.params=AD.extend(An.params,Ao.queryParams)}else{if(!Ao.hasOwnProperty("urlMode")){An.params=AD.extend(An.params,Ao)}}}return An};d.prototype.withFragment=function(An){return new d(this.components,this.params,An)};d.prototype.pushComponents=function(){var An=new d(this.components.slice(0),this.params);AD.each(AD.toArray(arguments).slice(0),function(Ao){if(Ao!==""){An.components.push(Ao)}});return An};d.prototype.makeBuilder=function(An){var Ao=this;return AD.extend({_path:function(){return Ao},build:function(){return Ao.buildRelative()},buildAbsolute:function(){return Ao.buildAbsolute()},parse:function(){return AS(this.build())},withParams:function(Ap){return Ao.addParams(Ap).makeBuilder(An)},withFragment:function(Ap){return Ao.withFragment(Ap).makeBuilder(An)},addPathComponents:function(){return Ao.pushComponents.apply(Ao,arguments).makeBuilder(An)}},An)};function Am(An){if(typeof (An)==="string"){return An}else{if(!An){throw new Error(AF.I18n.getText("stash.web.error.no.project"))}}return An.getKey?An.getKey():An.key}function Ab(){if(R.getProject()){return R.getProject()}throw new Error(AF.I18n.getText("stash.web.error.no.project.context"))}function AI(An){if(typeof (An)==="string"){return An}else{if(!An){throw new Error(AF.I18n.getText("stash.web.error.no.repo"))}}return An.getSlug?An.getSlug():An.slug}function Ak(An){if(typeof (An)==="string"){return An}else{if(!An){throw new Error(AF.I18n.getText("stash.web.error.no.hook.key"))}}return An.getDetails().getKey()}function u(){if(R.getRepository()){return R.getRepository()}throw new Error(AF.I18n.getText("stash.web.error.no.repo.context"))}function j(An){if(An!==0&&!An){throw new Error(AF.I18n.getText("stash.web.error.no.pull-request.id"))}if(typeof An in {string:1,number:1}){return An}return An.getId?An.getId():An.id}function g(){if(R.getPullRequest()){return R.getPullRequest()}throw new Error(AF.I18n.getText("stash.web.error.no.pull-request.context"))}function AB(Aq){var Ap=Aq.components[1];var Ao=/~(.*)/;var An=Ao.exec(Ap);if(An){return new d(["users",An[1].toLowerCase()])}else{return Aq}}function D(An){if(An.length===1){if(An[0]&&An[0].getComponents){return An[0].getComponents()}else{if(An[0]&&An[0].components){return An[0].components}else{if(Aa.isArray(An[0])){return An[0]}}}}return AD.toArray(An)}function AW(){return new d("login").makeBuilder({next:Y})}function Y(Ao){if(typeof Ao!=="string"){var An=AF.contextPath();var Ap=location.pathname;if(An.length>0){Ap=Ap.substring(Ap.indexOf(An)+An.length)}Ao=Ap+location.search+location.hash}return this._path().addParams({next:Ao}).makeBuilder()}function M(){return new d("tmp").makeBuilder({avatars:function An(){return this._path().pushComponents("avatars").makeBuilder()}})}function J(){return AO()}function AO(){return new d("getting-started").makeBuilder({next:Y})}function h(){return new d("admin").makeBuilder({permissions:e,users:S,groups:F,licensing:function An(){return this._path().pushComponents("license").makeBuilder({edit:function Aq(){return this._path().addParams({edit:""}).makeBuilder()}})},mailServer:function Ap(){return this._path().pushComponents("mail-server").makeBuilder()},db:function Ao(){return this._path().pushComponents("db").makeBuilder()}})}function AA(){return new d("projects").makeBuilder()}function AL(){return new d("repos").makeBuilder({visibility:function An(Ao){return this._path().addParams({visibility:Ao}).makeBuilder()}})}function Ae(){return new d("captcha").addParams({ts:new Date().getTime().toString()}).makeBuilder()}function Ac(As){var Ar=new d(["projects",Am(As)]);return AB(Ar).makeBuilder({allRepos:Ah,repo:H,createRepo:function Ao(){return AB(this._path()).pushComponents("repos").addParams("create").makeBuilder()},settings:function Ap(){return this._path().pushComponents("settings").makeBuilder()},permissions:e,remove:function An(){return this._path().makeBuilder()},users:S,groups:F,avatar:function Aq(Au){var At=this._path().pushComponents("avatar.png");if(Au){At=At.addParams({s:Au})}return At.makeBuilder()}})}function AX(){return Ac(Ab())}function v(){return new d("projects").addParams("create").makeBuilder()}function AJ(As){As=As?As:"api";return new d(["rest",As,"latest"]).makeBuilder({project:b,currentProject:X,currentRepo:O,currentPullRequest:AH,markup:function An(){return this._path().pushComponents("markup").makeBuilder({preview:function At(){return this._path().pushComponents("preview").makeBuilder()}})},profile:function Ap(){return this._path().pushComponents("profile").makeBuilder({recent:function At(){return this._path().pushComponents("recent").makeBuilder({repos:function Au(){return this._path().pushComponents("repos").makeBuilder()}})}})},users:function Ao(Au){var At=this._path().pushComponents("users");if(Au){return At.pushComponents(Au).makeBuilder({avatar:G})}return At.makeBuilder()},groups:function Ar(){return this._path().pushComponents("groups").makeBuilder()},hooks:T,allRepos:Ah,admin:function Aq(){return this._path().pushComponents("admin").makeBuilder({users:function At(){return this._path().pushComponents("users").makeBuilder()}})}})}function Ai(){return new d(["plugins","servlet","upm"]).makeBuilder({requests:function An(){return this._path().pushComponents("requests","popular").makeBuilder({category:function(Ao){return this._path().addParams({category:Ao}).makeBuilder()}})}})}function B(){return new d(["plugins","servlet"]).makeBuilder({path:function An(){var Ao=this._path();return Ao.pushComponents.apply(Ao,D(arguments)).makeBuilder()}})}function e(){return this._path().pushComponents("permissions").makeBuilder({permission:V,users:S,groups:F})}function V(An){return this._path().pushComponents(An).makeBuilder({users:function Ap(){return this._path().pushComponents("users").makeBuilder()},groups:function Aq(){return this._path().pushComponents("groups").makeBuilder()},all:function Ao(){return this._path().pushComponents("all").makeBuilder()}})}function S(){return this._path().pushComponents("users").makeBuilder({create:A,deleteUser:AT,captcha:function An(Ao){return this._path().pushComponents("captcha").addParams({name:Ao}).makeBuilder()},view:Ag,filter:AC,deleteSuccess:Aj,permissions:e,none:AG})}function F(){return this._path().pushComponents("groups").makeBuilder({create:A,deleteGroup:AT,view:Ag,filter:AC,deleteSuccess:Aj,permissions:e,none:AG})}function AG(){return this._path().pushComponents("none").makeBuilder()}function Ah(){return AB(this._path()).pushComponents("repos").makeBuilder()}function x(An){return new d(["users",An]).makeBuilder({avatar:G})}function A(){return this._path().addParams({create:""}).makeBuilder()}function AT(An){return this._path().addParams({name:An}).makeBuilder()}function Ag(An){return this._path().pushComponents("view").addParams({name:An}).makeBuilder()}function AC(An){return this._path().addParams({filter:An}).makeBuilder()}function Aj(An){return this._path().addParams({deleted:An}).makeBuilder()}function H(Au){return AB(this._path()).pushComponents("repos",AI(Au)).makeBuilder({browse:function As(){return this._path().pushComponents("browse").makeBuilder(k)},diff:U,commits:function An(){return this._path().pushComponents("commits").makeBuilder({until:function Az(A1){var A0=this._path();if(A1&&!A1.isDefault){if(typeof A1!=="string"){A1=A1.displayId||A1}A0=A0.addParams({until:A1})}return A0.makeBuilder()}})},branches:function Ap(A0){var Az=this._path().pushComponents("branches");if(A0&&!A0.isDefault){if(typeof A0!=="string"){A0=A0.displayId||A0.id||A0}Az=Az.addParams({base:A0})}return Az.makeBuilder()},changeset:r,commit:r,compare:function Ay(){function Az(A0){return function(){return this._path().pushComponents(A0).makeBuilder(t)}}return this._path().pushComponents("compare").makeBuilder(AD.extend({commits:Az("commits"),diff:Az("diff")},E))},settings:function Av(){return this._path().pushComponents("settings").makeBuilder()},permissions:e,hooks:AZ,clone:function Ar(A0){var A2=this._path(),Az=A2.components[1].toLowerCase(),A1=A2.components[3].toLowerCase();if(A2.components[0]==="users"){Az="~"+Az}return new d(["scm",Az,A1+"."+A0],A2.params).makeBuilder()},fork:function At(){return this._path().addParams("fork").makeBuilder()},allPullRequests:function Aq(){return this._path().pushComponents("pull-requests").makeBuilder()},createPullRequest:function Ax(){return this._path().pushComponents("pull-requests").addParams("create").makeBuilder(t)},pullRequest:AK,attachments:function Ao(){return this._path().pushComponents("attachments").makeBuilder()},sizes:function Aw(){return this._path().pushComponents("sizes").makeBuilder()},build:function(){return this._path().pushComponents("browse").toString()}})}function I(){return AX().repo(R.getRepository())}var i={at:function y(Ao){var An=this._path();if(Ao){if(typeof Ao!=="string"){Ao=Ao.displayId||Ao}An=An.addParams({at:Ao})}return An.makeBuilder(i)},until:function AM(An){return this._path().addParams({until:An}).makeBuilder(i)},raw:function P(){return this._path().addParams({raw:""}).makeBuilder(i)}};var k={path:function AQ(){var An=this._path();return An.pushComponents.apply(An,D(arguments)).makeBuilder(i)},at:i.at};function U(Ao){var Ap=this._path(),At;var As=(Ao.getCommitRange&&Ao.getPath&&Ao.getSrcPath);var Ar=(Ao.commitRange&&Ao.path&&Ao.srcPath);var An;if(As||Ar){An=Ao.toJSON?Ao.toJSON():Ao}if(An){var Aq=An.commitRange;At=An.path;if(Aq.pullRequest){Ap=Ap.pushComponents("pull-requests",Aq.pullRequest.id)}else{Ap=Ap.addParams(Aa.extend({},{until:Aq.untilRevision&&Aq.untilRevision.id||undefined,since:Aq.sinceRevision&&Aq.sinceRevision.id||undefined}))}}else{At=Ao}Ap=Ap.pushComponents("diff");Ap=Ap.pushComponents.apply(Ap,At&&D([At]));Ap=Ap.addParams(Aa.extend({},{srcPath:An&&An.srcPath||undefined}));return Ap.makeBuilder(i)}function r(An){return this._path().pushComponents("commits",An).makeBuilder({comment:function Ao(Ap){return this._path().addParams({commentId:Ap}).makeBuilder()}})}function AZ(){return this._path().pushComponents("settings","hooks").makeBuilder()}var t={_builder:null,sourceBranch:function N(An){return this._path().addParams({sourceBranch:An}).makeBuilder(this._builder)},targetBranch:function l(An){return this._path().addParams({targetBranch:An}).makeBuilder(this._builder)},targetRepo:function AY(An){return this._path().addParams({targetRepoId:An}).makeBuilder(this._builder)}};t._builder=t;var E=AD.extend({build:function(){return this._path().pushComponents("commits").toString()}},t);E._builder=E;function AK(Ap){return this._path().pushComponents("pull-requests",j(Ap)).makeBuilder({unwatch:function As(){return this._path().pushComponents("unwatch").makeBuilder()},changeset:function An(At){return this._path().pushComponents("commits",At).makeBuilder()},overview:function Ar(){return this._path().pushComponents("overview").makeBuilder({comment:function At(Au){return this._path().addParams({commentId:Au}).makeBuilder()}})},diff:function Aq(){return this._path().pushComponents("diff").makeBuilder({change:function(At){return this._path().withFragment(At).makeBuilder()}})},commits:function Ao(){return this._path().pushComponents("commits").makeBuilder()},build:function(){return this._path().pushComponents("overview").toString()}})}function n(){return I.call(this).pullRequest(g())}function b(Ap){var An=Am(Ap);return this._path().pushComponents("projects",An).makeBuilder({allRepos:function Ao(){return this._path().pushComponents("repos").makeBuilder()},repo:AE,permissions:a})}function X(){return b.call(this,Ab())}function O(){return X.call(this).repo(u())}function Q(Aq){var Ao=Ak(Aq);return this._path().pushComponents("settings").pushComponents("hooks",Ao).makeBuilder({enabled:function An(){return this._path().pushComponents("enabled").makeBuilder()},settings:function Ap(){return this._path().pushComponents("settings").makeBuilder()}})}function AE(At){var Aq=AI(At);return this._path().pushComponents("repos",Aq).makeBuilder({tags:function Ap(){return this._path().pushComponents("tags").makeBuilder()},branches:function Ao(){return this._path().pushComponents("branches").makeBuilder()},commits:function Av(){return this._path().pushComponents("commits").makeBuilder()},commit:o,compare:function Ar(){var Ax=function(A0,A1){var A2={};A2[A0]=A1;return this._path().addParams(A2).makeBuilder(Ay)};var Az=function(A0){return function(){return this._path().pushComponents(A0).makeBuilder(Ay)}};var Ay={from:AD.partial(Ax,"from"),to:AD.partial(Ax,"to"),fromRepo:AD.partial(Ax,"fromRepo")};return this._path().pushComponents("compare").makeBuilder({changes:Az("changes"),commits:Az("commits"),diff:function(A0){return q.call(this,A0,Ay)}})},changeset:o,changes:function Aw(Ax){Ax=Ax.toJSON?Ax.toJSON():Ax;if(Ax.pullRequest){return this.pullRequest(Ax.pullRequest).changes()}else{if(Ax.untilRevision){return this.changeset(Ax).changes()}else{throw new Error("A valid commit-range is required to retrieve changes")}}},browse:function Au(){return this._path().pushComponents("browse").makeBuilder(k)},files:Z,related:function An(){return this._path().pushComponents("related").makeBuilder()},pullRequest:AR,allPullRequests:function As(){return this._path().pushComponents("pull-requests").makeBuilder()},hooks:AZ,hook:Q})}function AR(Au){var An=j(Au);return this._path().pushComponents("pull-requests",An).makeBuilder({activities:function(){return this._path().pushComponents("activities").makeBuilder()},approve:function Ao(){return this._path().pushComponents("approve").makeBuilder()},comment:function Aq(Aw){return this._path().pushComponents("comments",Aw).makeBuilder({comment:Aq})},comments:function(){return this._path().pushComponents("comments").makeBuilder()},changes:function Ar(){return this._path().pushComponents("changes").makeBuilder()},diff:AU,watch:function As(){return this._path().pushComponents("watch").makeBuilder()},merge:function At(){return this._path().pushComponents("merge").makeBuilder()},reopen:function Ap(){return this._path().pushComponents("reopen").makeBuilder()},decline:function Av(){return this._path().pushComponents("decline").makeBuilder()}})}function AH(){return O.call(this).pullRequest(g())}function o(Ap){Ap=Ap.toJSON?Ap.toJSON():Ap;var As=this._path().pushComponents("commits");if(typeof Ap==="string"){As=As.pushComponents(Ap)}else{if(Ap.untilRevision){As=As.pushComponents(Ap.untilRevision.id);var Aq=Ap.sinceRevision&&Ap.sinceRevision.id;if(Aq){As=As.addParams({since:Aq})}}else{throw new Error(AF.I18n.getText("stash.web.error.no.commit.or.commitRange"))}}return As.makeBuilder({diff:AU,changes:function Ao(){return this._path().pushComponents("changes").makeBuilder(C)},comments:function Ar(){return this._path().pushComponents("comments").makeBuilder(C)},watch:function An(){return this._path().pushComponents("watch").makeBuilder()}})}var C={path:function L(An){return this._path().addParams({path:An.toString()}).makeBuilder()}};function q(Ao,Aq){var An=Ao.toJSON?Ao.toJSON():Ao;var Ap=this._path();Ap=Ap.pushComponents("diff");Ap=Ap.pushComponents.apply(Ap,D([An.path]));if(An.srcPath){Ap=Ap.addParams({srcPath:An.srcPath.toString()})}return Ap.makeBuilder(Aq)}function AU(An){return q.call(this,An)}function Ad(){return this._path().pushComponents("browse").makeBuilder(k)}var c={at:i.at};var W={path:function m(){var An=this._path();return An.pushComponents.apply(An,D(arguments)).makeBuilder(c)},at:c.at};function Z(){return this._path().pushComponents("files").makeBuilder(Aa.extend({all:Al.fn(K,"nav.rest().{currentRepo()|project().repo()}.files().all()",null,"3.0","4.0")},W))}function K(){return this._path().addParams({limit:100000}).makeBuilder(W)}function a(){return this._path().pushComponents("permissions").makeBuilder({projectRead:function Ao(){return this._path().pushComponents("project-read").makeBuilder({all:AN,anon:function Ap(){return this._path().pushComponents("anon").makeBuilder(p)}})},projectWrite:function An(){return this._path().pushComponents("project-write").makeBuilder({all:AN})}})}var p={allow:AV};function AN(){return this._path().pushComponents("all").makeBuilder(p)}function AV(An){return this._path().addParams({allow:An}).makeBuilder()}function T(){return this._path().pushComponents("hooks").makeBuilder({hook:function An(Ao){return this._path().pushComponents(Ao).makeBuilder({avatar:function Ap(Aq){return this._path().pushComponents("avatar").addParams({version:Aq}).makeBuilder()}})}})}function G(Ao){var An=this._path().pushComponents("avatar.png");if(Ao){An=An.addParams({s:Ao})}return An.makeBuilder()}var Af=/(default-avatar-)\d+(\.png)/;function z(An,Ao){return{build:function(){var Ap=AS(An.avatarUrl);if(Ap.getQueryParamValue("s")){Ap.replaceQueryParam("s",Ao)}return Ap.toString().replace(Af,"$1"+Ao+"$2")}}}function AS(An){return new f(An)}function AP(An){return new Query(An)}function s(An,Ao){return new d(An,Ao).makeBuilder()}w._avatarUrl=z;w.addons=Ai;w.admin=h;w.allProjects=AA;w.allRepos=AL;w.captcha=Ae;w.createProject=v;w.currentProject=AX;w.currentPullRequest=n;w.currentRepo=I;w.login=AW;w.newBuilder=s;w.parse=AS;w.parseQuery=AP;w.pluginServlets=B;w.project=Ac;w.rest=AJ;w.tmp=M;w.user=x;w.welcome=J;w.gettingStarted=AO});

Zerion Mini Shell 1.0