Enhancement : Palette colors creation

- Added cancel button to create palette dialog
- Added escape/unescapeHtml methods to pskl.utils
- Escaping palette name now ...
- Removed outdated comment in app.js regarding appEngine token
- Added a call to destroy() during dialogClose of AbstractDlgCtrl
This commit is contained in:
jdescottes
2014-09-07 12:22:44 +02:00
parent 6b32239fa1
commit 92d7109ef7
7 changed files with 108 additions and 61 deletions

View File

@@ -76,5 +76,29 @@ if (!Function.prototype.bind) {
}
};
var entityMap = {
"&": "&",
"<": "&lt;",
">": "&gt;",
'"': '&quot;',
"'": '&#39;',
"/": '&#x2F;'
};
ns.escapeHtml= function (string) {
return String(string).replace(/[&<>"'\/]/g, function (s) {
return entityMap[s];
});
};
var reEntityMap = {};
ns.unescapeHtml= function (string) {
Object.keys(entityMap).forEach(function(key) {
reEntityMap[key] = reEntityMap[key] || new RegExp(entityMap[key], "g");
string = string.replace(reEntityMap[key], key);
});
return string;
};
})();