Fixed sandbox. Multiple tabs work now.
WiP on selectable mosaico templates. TODO: Make files always point to trusted URL, such that we don't have to rebase them. They are public anyway. The same goes for mosaico endpoints: /mosaico/templates and /mosaico/img
This commit is contained in:
parent
a4ee1534cc
commit
7788b0bc67
79 changed files with 724 additions and 390 deletions
22
shared/templates.js
Normal file
22
shared/templates.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
function base(text, baseUrl) {
|
||||
if (baseUrl.endsWith('/')) {
|
||||
baseUrl = baseUrl.substring(0, baseUrl.length - 1);
|
||||
}
|
||||
|
||||
return text.split('[URL_BASE]').join(baseUrl);
|
||||
}
|
||||
|
||||
function unbase(text, baseUrl) {
|
||||
if (baseUrl.endsWith('/')) {
|
||||
baseUrl = baseUrl.substring(0, baseUrl.length - 1);
|
||||
}
|
||||
|
||||
return text.split(baseUrl).join('[URL_BASE]');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
base,
|
||||
unbase
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue