Gisle Aune
8 years ago
8 changed files with 127 additions and 34 deletions
-
23index.js
-
2package.json
-
17scripts/bg.js
-
24scripts/data.js
-
10scripts/list.js
-
11util.js
-
7www-root/index.html
-
15www-root/js/page.js
@ -0,0 +1,11 @@ |
|||
module.exports = { |
|||
formatTemplate: function(text, data) { |
|||
var keys = Object.keys(data); |
|||
for(var i = 0; i < keys.length; ++i) { |
|||
var key = keys[i]; |
|||
text = text.replace('{' + key + '}', data[key]); |
|||
} |
|||
|
|||
return text; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue