mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Implement Import and Merge wizard dialog
This commit is contained in:

committed by
Julian Descottes

parent
b5a8eb9f96
commit
78bbc71e6c
@ -15,6 +15,15 @@
|
||||
return templates[templateId];
|
||||
},
|
||||
|
||||
getAsHTML : function (templateId) {
|
||||
var template = ns.Template.get(templateId);
|
||||
if (!template) {
|
||||
return;
|
||||
}
|
||||
|
||||
return ns.Template.createFromHTML(template);
|
||||
},
|
||||
|
||||
createFromHTML : function (html) {
|
||||
var dummyEl = ns.Template._getDummyEl();
|
||||
dummyEl.innerHTML = html;
|
||||
@ -50,6 +59,15 @@
|
||||
return template;
|
||||
},
|
||||
|
||||
getAndReplace : function (templateId, dict) {
|
||||
var result = '';
|
||||
var tpl = pskl.utils.Template.get(templateId);
|
||||
if (tpl) {
|
||||
result = pskl.utils.Template.replace(tpl, dict);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sanitize the provided string to make it safer for using in templates.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user