From 5848c14701886506f3597ae26da4882284fea65e Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Tue, 6 Dec 2016 16:48:39 +0300 Subject: [PATCH] Move htmlspecialchars to util.js --- treegrid.js | 9 --------- util.js | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/treegrid.js b/treegrid.js index 406f5b2..6bf99e5 100644 --- a/treegrid.js +++ b/treegrid.js @@ -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, '>'); -} - TreeGrid.prototype.initStickyHeaders = function(options) { this.sticky = true; diff --git a/util.js b/util.js index d063bf3..bfd31f9 100644 --- a/util.js +++ b/util.js @@ -1,3 +1,12 @@ +window.htmlspecialchars = function(text) +{ + return (''+text).replace(/&/g, '&') + .replace(/'/g, ''') // ' + .replace(/"/g, '"') // " + .replace(//g, '>'); +}; + window.addListener = (function() { return window.addEventListener ? function(el, type, fn) { el.addEventListener(type, fn, false); }