%PDF- %PDF-
| Direktori : /data/old/home/stash/atlassian-stash/static/bower/CodeMirror/mode/htmlmixed/ |
| Current File : //data/old/home/stash/atlassian-stash/static/bower/CodeMirror/mode/htmlmixed/htmlmixed-min.js |
CodeMirror.defineMode("htmlmixed",function(B,C){var A=CodeMirror.getMode(B,{name:"xml",htmlMode:true,multilineTagIndentFactor:C.multilineTagIndentFactor,multilineTagIndentPastTag:C.multilineTagIndentPastTag});var L=CodeMirror.getMode(B,"css");var J=[],I=C&&C.scriptTypes;J.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:CodeMirror.getMode(B,"javascript")});if(I){for(var D=0;D<I.length;++D){var H=I[D];J.push({matches:H.matches,mode:H.mode&&CodeMirror.getMode(B,H.mode)})}}J.push({matches:/./,mode:CodeMirror.getMode(B,"text/plain")});function E(R,P){var N=P.htmlState.tagName;var O=A.token(R,P.htmlState);if(N=="script"&&/\btag\b/.test(O)&&R.current()==">"){var S=R.string.slice(Math.max(0,R.pos-100),R.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);S=S?S[1]:"";if(S&&/[\"\']/.test(S.charAt(0))){S=S.slice(1,S.length-1)}for(var M=0;M<J.length;++M){var Q=J[M];if(typeof Q.matches=="string"?S==Q.matches:Q.matches.test(S)){if(Q.mode){P.token=K;P.localMode=Q.mode;P.localState=Q.mode.startState&&Q.mode.startState(A.indent(P.htmlState,""))}break}}}else{if(N=="style"&&/\btag\b/.test(O)&&R.current()==">"){P.token=F;P.localMode=L;P.localState=L.startState(A.indent(P.htmlState,""))}}return O}function G(R,N,O){var Q=R.current();var P=Q.search(N),M;if(P>-1){R.backUp(Q.length-P)}else{if(M=Q.match(/<\/?$/)){R.backUp(Q.length);if(!R.match(N,false)){R.match(Q)}}}return O}function K(N,M){if(N.match(/^<\/\s*script\s*>/i,false)){M.token=E;M.localState=M.localMode=null;return E(N,M)}return G(N,/<\/\s*script\s*>/,M.localMode.token(N,M.localState))}function F(N,M){if(N.match(/^<\/\s*style\s*>/i,false)){M.token=E;M.localState=M.localMode=null;return E(N,M)}return G(N,/<\/\s*style\s*>/,L.token(N,M.localState))}return{startState:function(){var M=A.startState();return{token:E,localMode:null,localState:null,htmlState:M}},copyState:function(N){if(N.localState){var M=CodeMirror.copyState(N.localMode,N.localState)}return{token:N.token,localMode:N.localMode,localState:M,htmlState:CodeMirror.copyState(A,N.htmlState)}},token:function(N,M){return M.token(N,M)},indent:function(N,M){if(!N.localMode||/^\s*<\//.test(M)){return A.indent(N.htmlState,M)}else{if(N.localMode.indent){return N.localMode.indent(N.localState,M)}else{return CodeMirror.Pass}}},innerMode:function(M){return{state:M.localState||M.htmlState,mode:M.localMode||A}}}},"xml","javascript","css");CodeMirror.defineMIME("text/html","htmlmixed");