forked from voidlabs/mosaico
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
368 lines (353 loc) · 16.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=480, initial-scale=1">
<title>Free responsive email template editor | Mosaico.io</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="Title" content="Free newsletter template editor. Build responsive email simply." />
<meta name="description" content="Mosaico is the first open source email template editor proudly brought to you by VOXmail: it is powerful and free! The email template builder supports responsive design and live wysiwyg editing." />
<meta name="keywords" content="responsive email designer, email editor, free email editor, email template creator, open source email editor" />
<meta name="author" content="VOXmail" />
<meta name="application-name" content="Mosaico" />
<meta property="og:title" content="Mosaico Email Editor" />
<meta property="og:image" content="http://mosaico.io/dist/img/mosaico-v.gif" />
<meta property="og:description" content="Outstanding opensource email template editor by VOXmail.it" />
<meta property="og:url" content="http://mosaico.io" />
<meta property="og:type" content="website" />
<link rel="canonical" href="http://mosaico.io" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="dist/mosaico-material.min.css" />
<link rel="stylesheet" href="dist/vendor/notoregular/stylesheet.css" />
<script src="dist/vendor/knockout.js"></script>
<script src="dist/vendor/jquery.min.js"></script>
<script>
var initialEdits = [];
if (localStorage.getItem('edits')) {
var editKeys = JSON.parse(localStorage.getItem('edits'));
var md;
for (var i = 0; i < editKeys.length; i++) {
md = localStorage.getItem('metadata-'+editKeys[i]);
if (typeof md == 'string') {
initialEdits.push(JSON.parse(md));
} else {
console.log("Ignoring saved key", editKeys[i], "type", typeof md, md);
}
}
initialEdits.sort(function(a, b) {
var lastA = a.changed ? a.changed : a.created;
var lastB = b.changed ? b.changed : b.created;
if (lastA < lastB) return 1;
if (lastA > lastB) return -1;
return 0;
});
}
var viewModel = {
showSaved: ko.observable(false),
edits: ko.observableArray(initialEdits),
templates: [{
name: 'versafix-1', desc: 'The versatile template'
},{
name: 'tedc15', desc: 'The TEDC15 template'
},{
name: 'tutorial', desc: 'The Tutorial'
}]
};
viewModel.edits.subscribe(function(newEdits) {
var keys = [];
for (var i = 0; i < newEdits.length; i++) {
keys.push(newEdits[i].key);
localStorage.setItem('metadata-'+newEdits[i].key, ko.toJSON(newEdits[i]));
}
localStorage.setItem('edits', ko.toJSON(keys));
});
viewModel.dateFormat = function(unixdate) {
if (typeof unixdate == 'undefined') return 'DD-MM-YYYY';
var d = new Date();
d.setTime(ko.utils.unwrapObservable(unixdate));
var m = ""+(d.getMonth()+1);
var h = ""+(d.getHours());
var i = ""+(d.getMinutes());
return d.getDate()+"/"+(m.length == 1 ? '0' : '')+m+"/"+d.getFullYear()+" "+(h.length == 1 ? '0' : '')+h+":"+(i.length == 1 ? '0' : '')+i;
};
viewModel.newEdit = function(shorttmplname) {
console.log("new", this, template);
var d = new Date();
var rnd = Math.random().toString(36).substr(2, 7);
var template = 'templates/'+shorttmplname+'/template-'+shorttmplname+'.html';
viewModel.edits.unshift({ created: Date.now(), key: rnd, name: shorttmplname, template: template });
document.location = 'editor.html#'+rnd;
// { data: 'AAAA-MM-GG', key: 'ABCDE' }
// viewModel.edits.push(template);
};
viewModel.renameEdit = function(index) {
var newName = window.prompt("Modifica nome", viewModel.edits()[index].name);
if (newName) {
var newItem = JSON.parse(ko.toJSON(viewModel.edits()[index]));
newItem.name = newName;
viewModel.edits.splice(index, 1, newItem);
}
return false;
};
viewModel.deleteEdit = function(index) {
var confirm = window.confirm("Are you sure you want to delete this content?");
if (confirm) {
var res = viewModel.edits.splice(index, 1);
console.log("removing template ", res);
localStorage.removeItem('template-'+res[0].key);
}
return false;
};
viewModel.list = function(clean) {
for (var i = localStorage.length - 1; i >= 0; i--) {
var key = localStorage.key(i);
if (clean) {
console.log("removing ", key, localStorage.getItem(key));
localStorage.removeItem(key);
} else {
console.log("ls ", key, localStorage.getItem(key));
}
}
};
document.addEventListener('DOMContentLoaded',function(){
ko.applyBindings(viewModel);
});
</script>
<style>
body {
font-family: "trebuchet ms",arial,sans-serif;
font-size: 13.6px;
}
a, a:link, a:visited {
color: #A00000;
text-decoration: none;
}
.template {
margin: 10px;
display: inline-block;
vertical-align: top;
}
.template a {
display: block;
outline: 2px solid #333332;
padding: 2px;
width: 340px;
height: 500px;
overflow-y: auto;
}
.template a:hover {
outline: 5px solid #900000;
transition: outline .2s;
}
#savedTable tbody tr:nth-child(odd) td {
background-color: white;
}
#savedTable td {
padding: 2px 5px ;
}
.operationButton, .resumeButton {
background-color: #333332;
color: white !important;
padding: 5px 8px;
border-radius: 5px;
display: inline-block;
}
.operationButton i {
color: white;
}
.ribbon {
background-color: #900000;
color: white;
display: inline-block;
padding: 3px 10px;
margin: 6px;
position: relative;
z-index: 10;
outline: 1px solid #600000;
}
/* outline su firefox viene fuori dal content */
@-moz-document url-prefix() {
.ribbon {
outline-color: transparent;
}
}
.ribbon:before, .ribbon:after {
z-index: -4;
content: ' ';
position: absolute;
width: 5px;
top: 7px;
height: 0;
border-width: 12px 12px;
border-style: solid;
border-color: #900000;
}
.ribbon:before {
left: -20px;
border-left-color: transparent;
}
.ribbon:after {
right: -20px;
border-right-color: transparent;
}
@media screen and (max-width: 1400px) {
.disclaimer {
left: 0 !important; right: 0 !important;
top: 0 !important;
width: auto !important;
border: none !important;
}
body { padding-top: 40px !important; }
}
@media screen and (max-width: 900px) {
.byTable { display: none; }
.byRibbon { display: inline !important; }
}
</style>
<!-- stili per logo -->
<style>
.logoContainer { padding-bottom: 4px; }
/*
body.mo table.logoWrapper, #mosaico-logo { width: auto; border-bottom: 0; margin: auto; }
body.mo table.logoWrapper td, #mosaico-logo td { background-color: transparent; height: auto; vertical-align: bottom; padding: 0;}
*/
#mosaico-logo.mosaico-text td { padding: 0px 1px 1px 0px; }
#mosaico-logo.mosaico-text td div { width: 16px; height: 16px; }
#mosaico-logo.mosaico-text { border-collapse: collapse; border-spacing: 0; }
#mosaico-logo .pullleft { margin-left: -50%; }
#mosaico-logo .pullup { margin-top: -110%; }
#mosaico-logo .s0 { transform: rotate(2deg); }
#mosaico-logo .s1 { transform: rotate(4deg); }
#mosaico-logo .s2 { transform: rotate(6deg); }
#mosaico-logo .s3 { transform: rotate(8deg); }
#mosaico-logo .s4 { transform: rotate(10deg); }
#mosaico-logo .s5 { transform: rotate(-2deg); }
#mosaico-logo .s6 { transform: rotate(-4deg); }
#mosaico-logo .s7 { transform: rotate(-6deg); }
#mosaico-logo .s8 { transform: rotate(-8deg); }
#mosaico-logo .s9 { transform: rotate(-10deg); }
#mosaico-logo .on { border: 0px solid #CCC; transition: transform .3s; -webkit-transition: transform .3s; }
#mosaico-logo .on.cc:hover { transform: rotate(90deg) scale(1.3); box-shadow: 1px -1px 2px #888; }
#mosaico-logo .ce { background-color: #333332; border-color: #FFFFFF; }
#mosaico-logo .cc { box-shadow: 1px 1px 1px #555; position: relative; z-index: 2; }
#mosaico-logo .c0 { background-color: #EECC20; border-color: #CEAC00; }
#mosaico-logo .c1 { background-color: #DD8010; border-color: #BD6000; }
#mosaico-logo .c2 { background-color: #CC8010; border-color: #AC6000; }
#mosaico-logo .c3 { background-color: #BB7010; border-color: #9B5000; }
#mosaico-logo .c4 { background-color: #CC6010; border-color: #AC4000; }
#mosaico-logo .c5 { background-color: #A03020; border-color: #801000; }
#mosaico-logo .c6 { background-color: #CE1000; border-color: #AC1000; }
#mosaico-logo .c7 { background-color: #7E1000; border-color: #5E0000; }
#mosaico-logo .c8 { background-color: #A01020; border-color: #800000; }
#mosaico-logo .c9 { background-color: #EE4400; border-color: #CC2400; }
</style>
<!-- script per logo -->
<script>
var makeMosaicoTable = function() {
var data = [
'#1## 7### 8##4 ##9# 1 #2## ##9# ',
'#<#4 # 3 #^^ # # # # # 6 2 ##9',
'5<## # # ### 7### # 3 # # # # #',
'#<0# ##0# ###6 2 # # ##8# 5###<## ###'
];
var t = $('<table class="mosaico-text" id="mosaico-logo" />');
var rnd1, rnd2, tr, className;
for (var i = 0; i < data.length; i++) {
tr = $('<tr />');
for (var j = 0; j < data[i].length; j++) {
className = 'on';
rnd1 = rnd2 = '';
switch (data[i].substr(j, 1)) {
case '#': rnd1 = 'ce'; break;
case '<':
case '^':
case ' ': className = 'off'; break;
default:
rnd1 = "cc c"+data[i].substr(j, 1);
rnd2 = "s"+Math.floor((Math.random() * 10));
}
if (j > 0 && data[i].substr(j-1, 1) == '<') className += " pullleft";
if (i > 0 && data[i-1].substr(j, 1) == '^') className += " pullup";
var td = $('<td><div class="'+className+" "+rnd1+" "+rnd2+'"></div></td>');
tr.append(td);
}
t.append(tr);
}
return t;
};
$(function() {
makeMosaicoTable().appendTo($('.logoContainer'));
$('.logoImage').remove();
});
// $('<hr/>').appendTo($('body'));
</script>
</head>
<body style="overflow: auto; text-align: center; background-color: #3f3d33; padding: 0; margin: 0; display: none;" data-bind="visible: true">
<div style="background-color: #d2cbb1; padding: 10px;">
<table class="logoWrapper" valign="bottom" align="center"><tr><td valign="bottom"><img class="logoImage" alt="Mosaico.io" style="display: block;" src="dist/img/mosaicologo.png" /><div class="logoContainer"></div></td><td class="byTable" valign="bottom"><a href="http://www.voxmail.it"><img src="dist/img/byvoxmail.png" alt="by VOXmail" /></a></td></tr></table>
<div class="ribbon">opensource email template editor <span class="byRibbon" style="display: none;">by VOXmail</span></div>
</div>
<div class="disclaimer" style="position: absolute; top: 10px; right: 10px; width: 140px; padding: .5em; background-color: #900000; color: white; border: 2px dashed #d2cbb1">WARNING: experimental beta version, use with care!</div>
<!-- ko if: edits().length -->
<div style="overflow-y: auto; max-height: 200px; z-index: 10; position: relative; padding: 1em; background-color: #f1eee6;">
<!-- ko ifnot: $root.showSaved --><span>You have saved contents in this browser! <a class="resumeButton" href="#" data-bind="click: $root.showSaved.bind(undefined, true);"><i class="fa fa-plus-square"></i> Show</a></span><!-- /ko -->
<!-- ko if: $root.showSaved -->
<table id="savedTable" align="center" cellspacing="0" cellpadding="8" style="padding: 5px; ">
<caption>Email contents saved in your browser <a href="#" class="resumeButton" data-bind="click: $root.showSaved.bind(undefined, false);"><i class="fa fa-minus-square"></i> Hide</a></caption>
<thead><tr>
<th>Id</th><th>Name</th><th>Created</th><th>Last changed</th><th>Operations</th>
</tr></thead>
<tbody data-bind="foreach: edits">
<tr>
<td align="left"><a href="#" data-bind="attr: { href: 'editor.html#'+key }"><code>#<span data-bind="text: key">key</span></code></a></td>
<td style="font-weight: bold" align="left"><a href="#" data-bind="attr: { href: 'editor.html#'+key }"><span data-bind="text: name">versamix</span></a></td>
<td><span data-bind="text: typeof created !== 'undefined' ? $root.dateFormat(created) : '-'">YYYY-MM-DD</span></td>
<td><span style="font-weight: bold" data-bind="text: typeof changed !== 'undefined' ? $root.dateFormat(changed) : '-'">YYYY-MM-DD</span></td>
<td>
<a class="operationButton" href="#" data-bind="attr: { href: 'editor.html#'+key }" title="edit"><i class="fa fa-pencil"></i></a>
<!--(<a href="#" data-bind="click: $root.renameEdit.bind(undefined, $index())" title="rinomina"><i class="fa fa-trash-o"></i></a>)-->
<a class="operationButton" href="#" data-bind="click: $root.deleteEdit.bind(undefined, $index())" title="delete"><i class="fa fa-trash-o"></i></a>
</td>
</tr>
</tbody>
</table>
<!-- /ko -->
</div>
<!-- /ko -->
<div class="content" style="background-color: white; margin-top: -20px; padding-top: 15px; background-origin: border; padding-bottom: 2em">
<h3>Try Mosaico first template: more to come soon, stay tuned!</h3>
<div data-bind="foreach: templates">
<div class="template template-xx" style="" data-bind="attr: { class: 'template template-'+name }">
<div class="description" style="padding-bottom:5px"><b data-bind="text: name">xx</b>: <span data-bind="text: desc">xx</span></div>
<a href="#" data-bind="click: $root.newEdit.bind(undefined, name), attr: { href: 'editor.html#templates/'+name+'/template-'+name+'.html' }">
<img src width="100%" alt="xx" data-bind="attr: { src: 'templates/'+name+'/edres/_full.png' }">
</a>
</div>
</div>
</div>
<div class="subscribe" style="background-color: #900000; color: white; padding: .5em">
<form action="http://mosaico.voxmail.it/user/register" accept-charset="UTF-8" method="post">
<label>Stay up to date about Mosaico main news via email (No spam!): </label>
<input type="text" placeholder="email address" maxlength="64" name="mail" value="" class="form-text required" style="border: 0; padding: 5px 10px; box-sizing: border-box;"/>
<input type="submit" name="submit" value="Keep in touch!" class="form-submit" style="background-color: #330000; color: white; border: 0; box-sizing: border-box; border-radius: 3px; padding: 5px 10px" />
<input type="hidden" name="form_id" value="user_register" />
</form>
</div>
<div class="about" style="background-color: #f1eee6; color: #333332; padding: 1em;">
<h3>Why MOSAICO?</h3>
<p>Designing and coding an email that <strong>works on every device</strong> and every client is a <strong>daunting task</strong> even for professionals.</p>
<p>Mosaico allows you to realize <strong>a beautiful and effective template</strong> without a <strong>team of professionals</strong> and hours of testing to make sure it works everywhere.</p>
<h3>What does make Mosaico unique?</h3>
<p><strong>Responsive and tested Template</strong>, working with <strong>all major email clients and devices</strong></p>
<p><strong>Rapid graphic personalization</strong> of the overall theme</p>
<p><strong>Flexibility and style customization</strong> of single elements</p>
<p>Intuitive <strong>drag & drop image upload</strong> and <strong>automatic resizing</strong> to fit available space</p>
<p><strong>Global undo/redo system</strong>: stop wasting time with saves, reviews and confirmations</p>
<p><strong>Custom templates support</strong>, with a simple template language (make your html design work on Mosaico in few hours)</p>
<p><strong>Open Source</strong>: Mosaico is distributed under the GPL license and the <a href="https://github.com/voidlabs/mosaico">complete code base</a> is available on GitHub</p>
</div>
<div class="footer" style="background-color: #3f3d33; color: #d2cbb1; padding: 1em">
Void Labs Snc 2015® - All rights reserved - P.IVA 02137700395
</div>
</body>
</html>