mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
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:
@@ -76,5 +76,29 @@ if (!Function.prototype.bind) {
|
||||
}
|
||||
};
|
||||
|
||||
var entityMap = {
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
"/": '/'
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user