CoreFiles by mySites.guru
soy.min.js1 lines, 5,898 bytes, from Joomla_4.0.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 3.10.0-alpha9
md5
56d527683fb644169dd5c2c06f38df5a
sha1
9d2c8b8b65e3d0f363849107bb2a01d554896ae5
sha256
710241943e63d59409da6a07e369f67f2cf03508a5f530b8b90b1255240f1d9c
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],t):t(CodeMirror)}(function(t){"use strict";var e=["template","literal","msg","fallbackmsg","let","if","elseif","else","switch","case","default","foreach","ifempty","for","call","param","deltemplate","delcall","log"];t.defineMode("soy",function(a){function n(t){return t[t.length-1]}function s(t,e,a){if(t.sol()){for(var s=0;s<e.indent&&t.eat(/\s/);s++);if(s)return null}var i=t.string,l=a.exec(i.substr(t.pos));l&&(t.string=i.substr(0,t.pos+l.index));var r=t.hideFirstChars(e.indent,function(){var a=n(e.localStates);return a.mode.token(t,a.state)});return t.string=i,r}function i(t,e){return{element:e,next:t}}function l(t,e,a){return function(t,e){for(;t;){if(t.element===e)return!0;t=t.next}return!1}(t,e)?"variable-2":a?"variable":"variable-2 error"}function r(t){t.scopes&&(t.variables=t.scopes.element,t.scopes=t.scopes.next)}var o=t.getMode(a,"text/plain"),c={html:t.getMode(a,{name:"text/html",multilineTagIndentFactor:2,multilineTagIndentPastTag:!1}),attributes:o,text:o,uri:o,css:t.getMode(a,"text/css"),js:t.getMode(a,{name:"text/javascript",statementIndent:2*a.indentUnit})};return{startState:function(){return{kind:[],kindTag:[],soyState:[],templates:null,variables:i(null,"ij"),scopes:null,indent:0,quoteKind:null,localStates:[{mode:c.html,state:t.startState(c.html)}]}},copyState:function(e){return{tag:e.tag,kind:e.kind.concat([]),kindTag:e.kindTag.concat([]),soyState:e.soyState.concat([]),templates:e.templates,variables:e.variables,scopes:e.scopes,indent:e.indent,quoteKind:e.quoteKind,localStates:e.localStates.map(function(e){return{mode:e.mode,state:t.copyState(e.mode,e.state)}})}},token:function(o,d){switch(n(d.soyState)){case"comment":if(o.match(/^.*?\*\//)?d.soyState.pop():o.skipToEnd(),!d.scopes)for(var m=/@param\??\s+(\S+)/g,u=o.current();h=m.exec(u);)d.variables=i(d.variables,h[1]);return"comment";case"templ-def":return(h=o.match(/^\.?([\w]+(?!\.[\w]+)*)/))?(d.templates=i(d.templates,h[1]),d.scopes=i(d.scopes,d.variables),d.soyState.pop(),"def"):(o.next(),null);case"templ-ref":return(h=o.match(/^\.?([\w]+)/))?(d.soyState.pop(),"."==h[0][0]?l(d.templates,h[1],!0):"variable"):(o.next(),null);case"param-def":return(h=o.match(/^\w+/))?(d.variables=i(d.variables,h[0]),d.soyState.pop(),d.soyState.push("param-type"),"def"):(o.next(),null);case"param-type":return"}"==o.peek()?(d.soyState.pop(),null):o.eatWhile(/^[\w]+/)?"variable-3":(o.next(),null);case"var-def":return(h=o.match(/^\$([\w]+)/))?(d.variables=i(d.variables,h[1]),d.soyState.pop(),"def"):(o.next(),null);case"tag":if(o.match(/^\/?}/))return"/template"==d.tag||"/deltemplate"==d.tag?(r(d),d.variables=i(null,"ij"),d.indent=0):("/for"!=d.tag&&"/foreach"!=d.tag||r(d),d.indent-=a.indentUnit*("/}"==o.current()||-1==e.indexOf(d.tag)?2:1)),d.soyState.pop(),"keyword";if(o.match(/^([\w?]+)(?==)/)){if("kind"==o.current()&&(h=o.match(/^="([^"]+)/,!1))){var p=h[1];d.kind.push(p),d.kindTag.push(d.tag);var f=c[p]||c.html;(g=n(d.localStates)).mode.indent&&(d.indent+=g.mode.indent(g.state,"")),d.localStates.push({mode:f,state:t.startState(f)})}return"attribute"}return(h=o.match(/^["']/))?(d.soyState.push("string"),d.quoteKind=h,"string"):(h=o.match(/^\$([\w]+)/))?l(d.variables,h[1]):(h=o.match(/^\w+/))?/^(?:as|and|or|not|in)$/.test(h[0])?"keyword":null:(o.next(),null);case"literal":return o.match(/^(?=\{\/literal})/)?(d.indent-=a.indentUnit,d.soyState.pop(),this.token(o,d)):s(o,d,/\{\/literal}/);case"string":var h;return(h=o.match(/^.*?(["']|\\[\s\S])/))?h[1]==d.quoteKind&&(d.quoteKind=null,d.soyState.pop()):o.skipToEnd(),"string"}if(o.match(/^\/\*/))return d.soyState.push("comment"),d.scopes||(d.variables=i(null,"ij")),"comment";if(o.match(o.sol()?/^\s*\/\/.*/:/^\s+\/\/.*/))return d.scopes||(d.variables=i(null,"ij")),"comment";if(o.match(/^\{literal}/))return d.indent+=a.indentUnit,d.soyState.push("literal"),"keyword";if(h=o.match(/^\{([\/@\\]?\w+\??)(?=[\s\}])/)){if("/switch"!=h[1]&&(d.indent+=(/^(\/|(else|elseif|ifempty|case|fallbackmsg|default)$)/.test(h[1])&&"switch"!=d.tag?1:2)*a.indentUnit),d.tag=h[1],d.tag=="/"+n(d.kindTag)){d.kind.pop(),d.kindTag.pop(),d.localStates.pop();var g=n(d.localStates);g.mode.indent&&(d.indent-=g.mode.indent(g.state,""))}return d.soyState.push("tag"),"template"==d.tag||"deltemplate"==d.tag?d.soyState.push("templ-def"):"call"==d.tag||"delcall"==d.tag?d.soyState.push("templ-ref"):"let"==d.tag?d.soyState.push("var-def"):"for"==d.tag||"foreach"==d.tag?(d.scopes=i(d.scopes,d.variables),d.soyState.push("var-def")):"namespace"==d.tag?d.scopes||(d.variables=i(null,"ij")):d.tag.match(/^@(?:param\??|inject)/)&&d.soyState.push("param-def"),"keyword"}return o.eat("{")?(d.tag="print",d.indent+=2*a.indentUnit,d.soyState.push("tag"),"keyword"):s(o,d,/\{|\s+\/\/|\/\*/)},indent:function(e,s){var i=e.indent,l=n(e.soyState);if("comment"==l)return t.Pass;if("literal"==l)/^\{\/literal}/.test(s)&&(i-=a.indentUnit);else{if(/^\s*\{\/(template|deltemplate)\b/.test(s))return 0;/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(s)&&(i-=a.indentUnit),"switch"!=e.tag&&/^\{(case|default)\b/.test(s)&&(i-=a.indentUnit),/^\{\/switch\b/.test(s)&&(i-=a.indentUnit)}var r=n(e.localStates);return i&&r.mode.indent&&(i+=r.mode.indent(r.state,s)),i},innerMode:function(t){return t.soyState.length&&"literal"!=n(t.soyState)?null:n(t.localStates)},electricInput:/^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",useInnerComments:!1,fold:"indent"}},"htmlmixed"),t.registerHelper("hintWords","soy",e.concat(["delpackage","namespace","alias","print","css","debugger"])),t.defineMIME("text/x-soy","soy")});

No other release has this exact content. See every version of this file.