CoreFiles by mySites.guru
soy.min.js1 lines, 5,921 bytes, from Joomla_4.0.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha6
md5
196777cf9df44de9e50ef088f8ea1d4b
sha1
88c83a506b1ec318836c2c9cddbcb1121922f307
sha256
b2c3437a9b57dd3c96ddb6473070a50f29104724a4b738af54f339e6b760c527
!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){var n=t.getMode(a,"text/plain"),s={html:t.getMode(a,{name:"text/html",multilineTagIndentFactor:2,multilineTagIndentPastTag:!1}),attributes:n,text:n,uri:n,trusted_resource_uri:n,css:t.getMode(a,"text/css"),js:t.getMode(a,{name:"text/javascript",statementIndent:2*a.indentUnit})};function i(t){return t[t.length-1]}function r(t,e,a){if(t.sol()){for(var n=0;n<e.indent&&t.eat(/\s/);n++);if(n)return null}var s=t.string,r=a.exec(s.substr(t.pos));r&&(t.string=s.substr(0,t.pos+r.index));var l=t.hideFirstChars(e.indent,function(){var a=i(e.localStates);return a.mode.token(t,a.state)});return t.string=s,l}function l(t,e){return{element:e,next:t}}function o(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 c(t){t.scopes&&(t.variables=t.scopes.element,t.scopes=t.scopes.next)}return{startState:function(){return{kind:[],kindTag:[],soyState:[],templates:null,variables:l(null,"ij"),scopes:null,indent:0,quoteKind:null,localStates:[{mode:s.html,state:t.startState(s.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(n,d){switch(i(d.soyState)){case"comment":if(n.match(/^.*?\*\//)?d.soyState.pop():n.skipToEnd(),!d.scopes)for(var m=/@param\??\s+(\S+)/g,u=n.current();p=m.exec(u);)d.variables=l(d.variables,p[1]);return"comment";case"string":var p;return(p=n.match(/^.*?(["']|\\[\s\S])/))?p[1]==d.quoteKind&&(d.quoteKind=null,d.soyState.pop()):n.skipToEnd(),"string"}if(n.match(/^\/\*/))return d.soyState.push("comment"),"comment";if(n.match(n.sol()||d.soyState.length&&"literal"!=i(d.soyState)?/^\s*\/\/.*/:/^\s+\/\/.*/))return"comment";switch(i(d.soyState)){case"templ-def":return(p=n.match(/^\.?([\w]+(?!\.[\w]+)*)/))?(d.templates=l(d.templates,p[1]),d.scopes=l(d.scopes,d.variables),d.soyState.pop(),"def"):(n.next(),null);case"templ-ref":return(p=n.match(/^\.?([\w]+)/))?(d.soyState.pop(),"."==p[0][0]?o(d.templates,p[1],!0):"variable"):(n.next(),null);case"param-def":return(p=n.match(/^\w+/))?(d.variables=l(d.variables,p[0]),d.soyState.pop(),d.soyState.push("param-type"),"def"):(n.next(),null);case"param-type":return"}"==n.peek()?(d.soyState.pop(),null):n.eatWhile(/^[\w]+/)?"variable-3":(n.next(),null);case"var-def":return(p=n.match(/^\$([\w]+)/))?(d.variables=l(d.variables,p[1]),d.soyState.pop(),"def"):(n.next(),null);case"tag":if(n.match(/^\/?}/))return"/template"==d.tag||"/deltemplate"==d.tag?(c(d),d.variables=l(null,"ij"),d.indent=0):("/for"!=d.tag&&"/foreach"!=d.tag||c(d),d.indent-=a.indentUnit*("/}"==n.current()||-1==e.indexOf(d.tag)?2:1)),d.soyState.pop(),"keyword";if(n.match(/^([\w?]+)(?==)/)){if("kind"==n.current()&&(p=n.match(/^="([^"]+)/,!1))){var f=p[1];d.kind.push(f),d.kindTag.push(d.tag);var h=s[f]||s.html;(g=i(d.localStates)).mode.indent&&(d.indent+=g.mode.indent(g.state,"")),d.localStates.push({mode:h,state:t.startState(h)})}return"attribute"}return(p=n.match(/^["']/))?(d.soyState.push("string"),d.quoteKind=p,"string"):(p=n.match(/^\$([\w]+)/))?o(d.variables,p[1]):(p=n.match(/^\w+/))?/^(?:as|and|or|not|in)$/.test(p[0])?"keyword":null:(n.next(),null);case"literal":return n.match(/^(?=\{\/literal})/)?(d.indent-=a.indentUnit,d.soyState.pop(),this.token(n,d)):r(n,d,/\{\/literal}/)}if(n.match(/^\{literal}/))return d.indent+=a.indentUnit,d.soyState.push("literal"),"keyword";if(p=n.match(/^\{([\/@\\]?\w+\??)(?=[\s\}]|\/[/*])/)){var g;if("/switch"!=p[1]&&(d.indent+=(/^(\/|(else|elseif|ifempty|case|fallbackmsg|default)$)/.test(p[1])&&"switch"!=d.tag?1:2)*a.indentUnit),d.tag=p[1],d.tag=="/"+i(d.kindTag))d.kind.pop(),d.kindTag.pop(),d.localStates.pop(),(g=i(d.localStates)).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=l(d.scopes,d.variables),d.soyState.push("var-def")):"namespace"==d.tag?d.scopes||(d.variables=l(null,"ij")):d.tag.match(/^@(?:param\??|inject)/)&&d.soyState.push("param-def"),"keyword"}return n.eat("{")?(d.tag="print",d.indent+=2*a.indentUnit,d.soyState.push("tag"),"keyword"):r(n,d,/\{|\s+\/\/|\/\*/)},indent:function(e,n){var s=e.indent,r=i(e.soyState);if("comment"==r)return t.Pass;if("literal"==r)/^\{\/literal}/.test(n)&&(s-=a.indentUnit);else{if(/^\s*\{\/(template|deltemplate)\b/.test(n))return 0;/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(n)&&(s-=a.indentUnit),"switch"!=e.tag&&/^\{(case|default)\b/.test(n)&&(s-=a.indentUnit),/^\{\/switch\b/.test(n)&&(s-=a.indentUnit)}var l=i(e.localStates);return s&&l.mode.indent&&(s+=l.mode.indent(l.state,n)),s},innerMode:function(t){return t.soyState.length&&"literal"!=i(t.soyState)?null:i(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")});

The same content is in 2 releases, Joomla 4.0.0-alpha6 to 4.0.0-alpha7. See them all, or every version of this file.