All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.852f0ecd7b17e3bfd700a821ff438f7e.js Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"],(function(require,exports,e){"use strict";var t=require("../token_iterator").TokenIterator;function r(e,t){return e.type.lastIndexOf(t+".xml")>-1}exports.singletonTags=["area","base","br","col","command","embed","hr","html","img","input","keygen","link","meta","param","source","track","wbr"],exports.blockTags=["article","aside","blockquote","body","div","dl","fieldset","footer","form","head","header","html","nav","ol","p","script","section","style","table","tbody","tfoot","thead","ul"],exports.formatOptions={lineBreaksAfterCommasInCurlyBlock:!0},exports.beautify=function(e){for(var a,o,s,n=new t(e,0,0),i=n.getCurrentToken(),c=e.getTabString(),l=exports.singletonTags,m=exports.blockTags,u=exports.formatOptions||{},p=!1,f=!1,h=!1,y="",d="",g="",b=0,k=0,w=0,v=0,x=0,T=0,C=0,R=0,B=0,O=!1,I=!1,q=!1,_=!1,j={0:0},A=[],F=!1,S=function(){a&&a.value&&"string.regexp"!==a.type&&(a.value=a.value.replace(/^\s*/,""))},K=function(){for(var e=y.length-1;0!=e&&" "===y[e];)e-=1;y=y.slice(0,e+1)},L=function(){y=y.trimRight(),p=!1};null!==i;){if(R=n.getCurrentTokenRow(),n.$rowTokens,a=n.stepForward(),void 0!==i){if(d=i.value,x=0,q="style"===g||"ace/mode/css"===e.$modeId,r(i,"tag-open")?(I=!0,a&&(_=-1!==m.indexOf(a.value)),"0;B--)y+="\n";p=!0,r(i,"comment")||i.type.match(/^(comment|string)$/)||(d=d.trimLeft())}if(d){if("keyword"===i.type&&d.match(/^(if|else|elseif|for|foreach|while|switch)$/)?(A[b]=d,S(),h=!0,d.match(/^(else|elseif)$/)&&y.match(/\}[\s]*$/)&&(L(),f=!0)):"paren.lparen"===i.type?(S(),"{"===d.substr(-1)&&(h=!0,O=!1,I||(B=1)),"{"===d.substr(0,1)&&(f=!0,"["!==y.substr(-1)&&"["===y.trimRight().substr(-1)?(L(),f=!1):")"===y.trimRight().substr(-1)?L():K())):"paren.rparen"===i.type?(x=1,"}"===d.substr(0,1)&&("case"===A[b-1]&&x++,"{"===y.trimRight().substr(-1)?L():(f=!0,q&&(B+=2))),"]"===d.substr(0,1)&&"}"!==y.substr(-1)&&"}"===y.trimRight().substr(-1)&&(f=!1,v++,L()),")"===d.substr(0,1)&&"("!==y.substr(-1)&&"("===y.trimRight().substr(-1)&&(f=!1,v++,L()),K()):"keyword.operator"!==i.type&&"keyword"!==i.type||!d.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)?"punctuation.operator"===i.type&&";"===d?(L(),S(),h=!0,q&&B++):"punctuation.operator"===i.type&&d.match(/^(:|,)$/)?(L(),S(),d.match(/^(,)$/)&&C>0&&0===T&&u.lineBreaksAfterCommasInCurlyBlock?B++:(h=!0,p=!1)):"support.php_tag"!==i.type||"?>"!==d||p?r(i,"attribute-name")&&y.substr(-1).match(/^\s$/)?f=!0:r(i,"attribute-equals")?(K(),S()):r(i,"tag-close")?(K(),"/>"===d&&(f=!0)):"keyword"===i.type&&d.match(/^(case|default)$/)&&F&&(x=1):(L(),f=!0):(L(),S(),f=!0,h=!0),p&&(!i.type.match(/^(comment)$/)||d.substr(0,1).match(/^[/#]$/))&&(!i.type.match(/^(string)$/)||d.substr(0,1).match(/^['"@]$/))){if(v=w,b>k)for(v++,s=b;s>k;s--)j[s]=v;else b"===d)&&(B=_&&a&&""===d&&b--),r(i,"tag-name")&&(g=d),o=R}}i=a}y=y.trim(),e.doc.setValue(y)},exports.commands=[{name:"beautify",description:"Format selection (Beautify)",exec:function(e){exports.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]})),ace.require(["ace/ext/beautify"],(function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}));




© 2015 - 2024 Weber Informatics LLC | Privacy Policy