%PDF- %PDF-
| Direktori : /data/old/home/stash/atlassian/stash/3.7.1/atlassian-stash/static/util/ |
| Current File : //data/old/home/stash/atlassian/stash/3.7.1/atlassian-stash/static/util/determine-language-min.js |
define("util/determine-language",["codemirror","jquery","lodash","exports"],function(O,G,Q,R){document.documentElement.className+=" cm-s-stash-default";var N={bash:"text/x-sh",clojure:"text/x-clojure",coffeescript:"text/x-coffeescript",cpp:"text/x-c++src",cs:"text/x-csharp",css:"text/css",d:"text/x-d",diff:"text/x-diff",dos:"text/x-sh",erlang:"text/x-erlang",go:"text/x-go",haskell:"text/x-haskell",html:"text/html",ini:"text/x-toml",java:"text/x-java",javascript:"text/javascript",json:"application/json",less:"text/x-less",lisp:"text/x-common-lisp",lua:"text/x-lua",markdown:"text/x-markdown",objectivec:"text/x-csrc",perl:"text/x-perl",php:"application/x-httpd-php",python:"text/x-python",ruby:"text/x-ruby",scala:"text/x-scala",sql:"text/x-sql",tex:"text/x-stex",vbscript:"text/vbscript",xml:"application/xml"};var C=WRM.data.claim("com.atlassian.stash.stash-web-plugin:determine-language.syntax-highlighters")||{};var J={};var I={};Q.forEach(C,function(S,T){if(T.indexOf("/")===-1){console&&console.warn&&console.warn("DEPRECATED - Using HighlightJS mapping ("+T+") has been has been deprecated since 3.5 and will be removed in 4.0. See https://confluence.atlassian.com/display/STASHKB/Syntax+highlight+changes")}Q.forEach(S.e,function(U){J[U]=T});Q.forEach(S.x,function(U){I[U]=T})});var K={};var L={};function B(S){return Q.has(J,S)?J[S]:null}function D(S){return Q.has(I,S)?I[S]:null}function H(S){var T=S;if(S.indexOf("/")===-1){T=N[S]}return O.findModeByMIME(T)}function E(S){var U=/^#!(?:\/(?:usr\/)?(?:local\/)?bin\/([^\s]+))(?:\s+([^\s]+))?/;var T=U.exec(S);if(T){var V=T[1];if(V==="env"){V=T[2]}return V}return null}function A(T,S){return K.hasOwnProperty(T)?K[T]:S&&L.hasOwnProperty(S)?L[S]:null}function M(U){var S=U.path;var T=S.lastIndexOf(".");var Y=T===-1?S:S.substring(T+1);var X=U.firstLine.length>1?E(U.firstLine):null;var W=A(Y,X);var V;if(!W){V=B(Y)||(X!=null?D(X):null);if(V){W=H(V)}else{W=O.findModeByFileName(S)}W=W||O.findModeByMIME("text/plain");W.builtIn=true}if(U.legacy){return V||"text"}return W}function P(U,T,S){if(T){T.forEach(function(V){K[V]=U})}if(S){S.forEach(function(V){L[V]=U})}}function F(T){var S=O.findModeByName(T)||O.findModeByExtension(T);if(!S){return G.Deferred().resolve(O.findModeByMIME("text/plain"))}if(typeof O.mimeModes[S.mime]==="undefined"){return WRM.require("wr!com.atlassian.stash.stash-highlight-plugin:"+S.mode).then(function(){return S})}return G.Deferred().resolve(S)}R.fromFileInfo=M;R.registerCodeMirrorMode=P;R.getCodeMirrorModeForName=F});