Add support for templates in the file manager

This commit is contained in:
yflory
2016-12-22 16:53:35 +01:00
parent 1772cc93c8
commit 9b6c9e3891
6 changed files with 184 additions and 54 deletions

View File

@@ -451,6 +451,21 @@ define([
return localStorage[attr];
};
// STORAGE - TEMPLATES
var listTemplates = common.listTemplates = function (type) {
var allTemplates = getStore().listTemplates();
if (!type) { return allTemplates; }
var templates = allTemplates.filter(function (f) {
var parsed = parsePadUrl(f.href);
return parsed.type === type;
});
return templates;
};
var addTemplate = common.addTemplate = function (href) {
getStore().addTemplate(href);
};
// STORAGE
/* fetch and migrate your pad history from localStorage */