Move htmlspecialchars to util.js

rel-1.0
Vitaliy Filippov 2016-12-06 16:48:39 +03:00
parent eef62d3656
commit 5848c14701
2 changed files with 9 additions and 9 deletions

View File

@ -139,15 +139,6 @@ function TreeGridNode(node, grid, level, insertBefore, startHidden)
(function() {
function htmlspecialchars(text)
{
return (''+text).replace(/&/g, '&')
.replace(/'/g, ''') // '
.replace(/"/g, '"') // "
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}
TreeGrid.prototype.initStickyHeaders = function(options)
{
this.sticky = true;

View File

@ -1,3 +1,12 @@
window.htmlspecialchars = function(text)
{
return (''+text).replace(/&/g, '&amp;')
.replace(/'/g, '&apos;') // '
.replace(/"/g, '&quot;') // "
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
};
window.addListener = (function() {
return window.addEventListener
? function(el, type, fn) { el.addEventListener(type, fn, false); }