312f9bfe by acetousk

Remove external links, improve debugging data, fix regex

1 parent 21f9b5a5
......@@ -69,17 +69,6 @@ along with this software (see the LICENSE.md file). If not, see
</mj-column>
</mj-section>
<!-- Image Header -->
<mj-section background-url="http://1.bp.blogspot.com/-TPrfhxbYpDY/Uh3Refzk02I/AAAAAAAALw8/5sUJ0UUGYuw/s1600/New+York+in+The+1960's+-+70's+(2).jpg"
background-size="cover" background-repeat="no-repeat">
<mj-column>
<mj-text css-class="slogan" align="center" color="#fff" font-size="40px" font-family="Helvetica Neue">Slogan here</mj-text>
<mj-button background-color="#F63A4D" href="#">
Promotion
</mj-button>
</mj-column>
</mj-section>
<!-- Intro text -->
<mj-wrapper background-color="#ffe9f7" padding="10px">
<mj-section background-color="#eaeffa">
......@@ -100,9 +89,6 @@ along with this software (see the LICENSE.md file). If not, see
<!-- Side image -->
<mj-section background-color="white">
<mj-column>
<mj-image width="200px" src="https://designspell.files.wordpress.com/2012/01/sciolino-paris-bw.jpg" />
</mj-column>
<mj-column>
<mj-text font-style="italic" font-size="20px" font-family="Helvetica Neue" color="#626262">
Find amazing places ...
</mj-text>
......@@ -118,41 +104,19 @@ along with this software (see the LICENSE.md file). If not, see
</mj-text>
</mj-column>
</mj-section>
<mj-raw>
<div class="container">
<img class="item" src="https://source.unsplash.com/random/200x141?random" alt="Example image">
<img class="item" src="https://source.unsplash.com/random/200x142?random" alt="Example image">
<img class="item" src="https://source.unsplash.com/random/200x143?random" alt="Example image">
<img class="item" src="https://source.unsplash.com/random/200x144?random" alt="Example image">
<img class="item" src="https://source.unsplash.com/random/200x145?random" alt="Example image">
<img class="item" src="https://source.unsplash.com/random/200x146?random" alt="Example image">
</div>
</mj-raw>
<!-- Icons -->
<mj-section background-color="#fbfbfb">
<mj-column>
<mj-image width="100px" src="http://191n.mj.am/img/191n/3s/x0l.png" />
</mj-column>
<mj-column>
<mj-image width="100px" src="http://191n.mj.am/img/191n/3s/x01.png" />
</mj-column>
<mj-column>
<mj-image width="100px" src="http://191n.mj.am/img/191n/3s/x0s.png" />
</mj-column>
</mj-section>
<!-- Footer -->
<mj-section background-color="#e7e7e7">
<mj-column>
<mj-button href="#">Hello There!</mj-button>
<mj-social font-size="15px" icon-size="30px" mode="horizontal">
<mj-social-element name="facebook" href="https://mjml.io/">
<mj-social-element name="facebook" href="https://moqui.org/">
Facebook
</mj-social-element>
<mj-social-element name="google" href="https://mjml.io/">
<mj-social-element name="google" href="https://moqui.org/">
Google
</mj-social-element>
<mj-social-element name="twitter" href="https://mjml.io/">
<mj-social-element name="twitter" href="https://moqui.org/">
Twitter
</mj-social-element>
</mj-social>
......
......@@ -60,7 +60,8 @@ along with this software (see the LICENSE.md file). If not, see
<set field="grapesFile" from="grapesJsResource.makeFile(java.util.UUID.randomUUID().toString()+'.json')"/>
<service-call name="mjml.MjmlServices.get#GlobalGrapeVarList" out-map="context"/>
<set field="dataRaw" from="ec.resource.getLocationReference('dbresource://grapesjs/template/default.json').getText()"/>
<set field="defaultLocation" value="dbresource://grapesjs/template/default.json"/>
<set field="dataRaw" from="ec.resource.getLocationReference(defaultLocation).getText()"/>
<set field="htmlLocation" from="grapesJsResource.location + '/' + htmlFile?.dbResourceId + '.html'"/>
<set field="grapesLocation" from="grapesJsResource.location + '/' + grapesFile?.dbResourceId + '.json'"/>
<script><![CDATA[
......@@ -84,7 +85,7 @@ along with this software (see the LICENSE.md file). If not, see
}
}
context.allVarsRegexPattern = /\$\{[a-zA-Z_]\w*\}/
context.allVarsRegexPattern = /\$\{[a-zA-Z_][a-zA-Z0-9_.]*\}/
context.errorVarList = context.dataRaw.findAll(context.allVarsRegexPattern).unique().collect { it - '${' - '}' } - globalGrapeVarList*.key
context.errorTemplateRegexPattern = errorVarList.collect { '\\\$\\{'+it+'\\}' }.join('|')
if (context.errorTemplateRegexPattern) {
......@@ -96,7 +97,7 @@ along with this software (see the LICENSE.md file). If not, see
]]></script>
<!-- <log level="warn" message="dataPre is ${dataPre}"/>-->
<script><![CDATA[
String location = "template.ftl";
String location = defaultLocation;
freemarker.template.Template newTemplate;
Reader templateReader = null;
......@@ -146,7 +147,7 @@ along with this software (see the LICENSE.md file). If not, see
}
}
context.allVarsRegexPattern = /\$\{[a-zA-Z_]\w*\}/
context.allVarsRegexPattern = /\$\{[a-zA-Z_][a-zA-Z0-9_.]*\}/
context.errorVarList = context.dataRaw.findAll(context.allVarsRegexPattern).unique().collect { it - '${' - '}' } - globalGrapeVarList*.key
context.errorTemplateRegexPattern = errorVarList.collect { '\\\$\\{'+it+'\\}' }.join('|')
if (context.errorTemplateRegexPattern) {
......@@ -158,7 +159,7 @@ along with this software (see the LICENSE.md file). If not, see
]]></script>
<!-- <log level="warn" message="dataPre is ${dataPre}"/>-->
<script><![CDATA[
String location = "template.ftl";
String location = grapesFile.location;
freemarker.template.Template newTemplate;
Reader templateReader = null;
......