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 ...@@ -69,17 +69,6 @@ along with this software (see the LICENSE.md file). If not, see
69 </mj-column> 69 </mj-column>
70 </mj-section> 70 </mj-section>
71 71
72 <!-- Image Header -->
73 <mj-section background-url="http://1.bp.blogspot.com/-TPrfhxbYpDY/Uh3Refzk02I/AAAAAAAALw8/5sUJ0UUGYuw/s1600/New+York+in+The+1960's+-+70's+(2).jpg"
74 background-size="cover" background-repeat="no-repeat">
75 <mj-column>
76 <mj-text css-class="slogan" align="center" color="#fff" font-size="40px" font-family="Helvetica Neue">Slogan here</mj-text>
77 <mj-button background-color="#F63A4D" href="#">
78 Promotion
79 </mj-button>
80 </mj-column>
81 </mj-section>
82
83 <!-- Intro text --> 72 <!-- Intro text -->
84 <mj-wrapper background-color="#ffe9f7" padding="10px"> 73 <mj-wrapper background-color="#ffe9f7" padding="10px">
85 <mj-section background-color="#eaeffa"> 74 <mj-section background-color="#eaeffa">
...@@ -100,9 +89,6 @@ along with this software (see the LICENSE.md file). If not, see ...@@ -100,9 +89,6 @@ along with this software (see the LICENSE.md file). If not, see
100 <!-- Side image --> 89 <!-- Side image -->
101 <mj-section background-color="white"> 90 <mj-section background-color="white">
102 <mj-column> 91 <mj-column>
103 <mj-image width="200px" src="https://designspell.files.wordpress.com/2012/01/sciolino-paris-bw.jpg" />
104 </mj-column>
105 <mj-column>
106 <mj-text font-style="italic" font-size="20px" font-family="Helvetica Neue" color="#626262"> 92 <mj-text font-style="italic" font-size="20px" font-family="Helvetica Neue" color="#626262">
107 Find amazing places ... 93 Find amazing places ...
108 </mj-text> 94 </mj-text>
...@@ -118,41 +104,19 @@ along with this software (see the LICENSE.md file). If not, see ...@@ -118,41 +104,19 @@ along with this software (see the LICENSE.md file). If not, see
118 </mj-text> 104 </mj-text>
119 </mj-column> 105 </mj-column>
120 </mj-section> 106 </mj-section>
121 <mj-raw>
122 <div class="container">
123 <img class="item" src="https://source.unsplash.com/random/200x141?random" alt="Example image">
124 <img class="item" src="https://source.unsplash.com/random/200x142?random" alt="Example image">
125 <img class="item" src="https://source.unsplash.com/random/200x143?random" alt="Example image">
126 <img class="item" src="https://source.unsplash.com/random/200x144?random" alt="Example image">
127 <img class="item" src="https://source.unsplash.com/random/200x145?random" alt="Example image">
128 <img class="item" src="https://source.unsplash.com/random/200x146?random" alt="Example image">
129 </div>
130 </mj-raw>
131 <!-- Icons -->
132 <mj-section background-color="#fbfbfb">
133 <mj-column>
134 <mj-image width="100px" src="http://191n.mj.am/img/191n/3s/x0l.png" />
135 </mj-column>
136 <mj-column>
137 <mj-image width="100px" src="http://191n.mj.am/img/191n/3s/x01.png" />
138 </mj-column>
139 <mj-column>
140 <mj-image width="100px" src="http://191n.mj.am/img/191n/3s/x0s.png" />
141 </mj-column>
142 </mj-section>
143 107
144 <!-- Footer --> 108 <!-- Footer -->
145 <mj-section background-color="#e7e7e7"> 109 <mj-section background-color="#e7e7e7">
146 <mj-column> 110 <mj-column>
147 <mj-button href="#">Hello There!</mj-button> 111 <mj-button href="#">Hello There!</mj-button>
148 <mj-social font-size="15px" icon-size="30px" mode="horizontal"> 112 <mj-social font-size="15px" icon-size="30px" mode="horizontal">
149 <mj-social-element name="facebook" href="https://mjml.io/"> 113 <mj-social-element name="facebook" href="https://moqui.org/">
150 Facebook 114 Facebook
151 </mj-social-element> 115 </mj-social-element>
152 <mj-social-element name="google" href="https://mjml.io/"> 116 <mj-social-element name="google" href="https://moqui.org/">
153 Google 117 Google
154 </mj-social-element> 118 </mj-social-element>
155 <mj-social-element name="twitter" href="https://mjml.io/"> 119 <mj-social-element name="twitter" href="https://moqui.org/">
156 Twitter 120 Twitter
157 </mj-social-element> 121 </mj-social-element>
158 </mj-social> 122 </mj-social>
......
...@@ -60,7 +60,8 @@ along with this software (see the LICENSE.md file). If not, see ...@@ -60,7 +60,8 @@ along with this software (see the LICENSE.md file). If not, see
60 <set field="grapesFile" from="grapesJsResource.makeFile(java.util.UUID.randomUUID().toString()+'.json')"/> 60 <set field="grapesFile" from="grapesJsResource.makeFile(java.util.UUID.randomUUID().toString()+'.json')"/>
61 61
62 <service-call name="mjml.MjmlServices.get#GlobalGrapeVarList" out-map="context"/> 62 <service-call name="mjml.MjmlServices.get#GlobalGrapeVarList" out-map="context"/>
63 <set field="dataRaw" from="ec.resource.getLocationReference('dbresource://grapesjs/template/default.json').getText()"/> 63 <set field="defaultLocation" value="dbresource://grapesjs/template/default.json"/>
64 <set field="dataRaw" from="ec.resource.getLocationReference(defaultLocation).getText()"/>
64 <set field="htmlLocation" from="grapesJsResource.location + '/' + htmlFile?.dbResourceId + '.html'"/> 65 <set field="htmlLocation" from="grapesJsResource.location + '/' + htmlFile?.dbResourceId + '.html'"/>
65 <set field="grapesLocation" from="grapesJsResource.location + '/' + grapesFile?.dbResourceId + '.json'"/> 66 <set field="grapesLocation" from="grapesJsResource.location + '/' + grapesFile?.dbResourceId + '.json'"/>
66 <script><![CDATA[ 67 <script><![CDATA[
...@@ -84,7 +85,7 @@ along with this software (see the LICENSE.md file). If not, see ...@@ -84,7 +85,7 @@ along with this software (see the LICENSE.md file). If not, see
84 } 85 }
85 } 86 }
86 87
87 context.allVarsRegexPattern = /\$\{[a-zA-Z_]\w*\}/ 88 context.allVarsRegexPattern = /\$\{[a-zA-Z_][a-zA-Z0-9_.]*\}/
88 context.errorVarList = context.dataRaw.findAll(context.allVarsRegexPattern).unique().collect { it - '${' - '}' } - globalGrapeVarList*.key 89 context.errorVarList = context.dataRaw.findAll(context.allVarsRegexPattern).unique().collect { it - '${' - '}' } - globalGrapeVarList*.key
89 context.errorTemplateRegexPattern = errorVarList.collect { '\\\$\\{'+it+'\\}' }.join('|') 90 context.errorTemplateRegexPattern = errorVarList.collect { '\\\$\\{'+it+'\\}' }.join('|')
90 if (context.errorTemplateRegexPattern) { 91 if (context.errorTemplateRegexPattern) {
...@@ -96,7 +97,7 @@ along with this software (see the LICENSE.md file). If not, see ...@@ -96,7 +97,7 @@ along with this software (see the LICENSE.md file). If not, see
96 ]]></script> 97 ]]></script>
97 <!-- <log level="warn" message="dataPre is ${dataPre}"/>--> 98 <!-- <log level="warn" message="dataPre is ${dataPre}"/>-->
98 <script><![CDATA[ 99 <script><![CDATA[
99 String location = "template.ftl"; 100 String location = defaultLocation;
100 101
101 freemarker.template.Template newTemplate; 102 freemarker.template.Template newTemplate;
102 Reader templateReader = null; 103 Reader templateReader = null;
...@@ -146,7 +147,7 @@ along with this software (see the LICENSE.md file). If not, see ...@@ -146,7 +147,7 @@ along with this software (see the LICENSE.md file). If not, see
146 } 147 }
147 } 148 }
148 149
149 context.allVarsRegexPattern = /\$\{[a-zA-Z_]\w*\}/ 150 context.allVarsRegexPattern = /\$\{[a-zA-Z_][a-zA-Z0-9_.]*\}/
150 context.errorVarList = context.dataRaw.findAll(context.allVarsRegexPattern).unique().collect { it - '${' - '}' } - globalGrapeVarList*.key 151 context.errorVarList = context.dataRaw.findAll(context.allVarsRegexPattern).unique().collect { it - '${' - '}' } - globalGrapeVarList*.key
151 context.errorTemplateRegexPattern = errorVarList.collect { '\\\$\\{'+it+'\\}' }.join('|') 152 context.errorTemplateRegexPattern = errorVarList.collect { '\\\$\\{'+it+'\\}' }.join('|')
152 if (context.errorTemplateRegexPattern) { 153 if (context.errorTemplateRegexPattern) {
...@@ -158,7 +159,7 @@ along with this software (see the LICENSE.md file). If not, see ...@@ -158,7 +159,7 @@ along with this software (see the LICENSE.md file). If not, see
158 ]]></script> 159 ]]></script>
159 <!-- <log level="warn" message="dataPre is ${dataPre}"/>--> 160 <!-- <log level="warn" message="dataPre is ${dataPre}"/>-->
160 <script><![CDATA[ 161 <script><![CDATA[
161 String location = "template.ftl"; 162 String location = grapesFile.location;
162 163
163 freemarker.template.Template newTemplate; 164 freemarker.template.Template newTemplate;
164 Reader templateReader = null; 165 Reader templateReader = null;
......