Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jappix/jappix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorOleg Kalandarashvili <V1RTUOZ@users.noreply.github.com>2015-03-17 14:08:36 +0300
committerOleg Kalandarashvili <V1RTUOZ@users.noreply.github.com>2015-03-17 14:08:36 +0300
commit657694df38b2ae35a11bcf4f8f2f7d42ce1dfb69 (patch)
tree3d3acba346802a7303e4a9ec7386482396bc99b4 /app
parent620c00433a79c8b60cb8c62625c34f53531a8244 (diff)
htmlentities method added (for #533)
Diffstat (limited to 'app')
-rw-r--r--app/javascripts/common.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/javascripts/common.js b/app/javascripts/common.js
index 58746044..8f58bfd4 100644
--- a/app/javascripts/common.js
+++ b/app/javascripts/common.js
@@ -894,6 +894,17 @@ var Common = (function () {
}
};
+
+ /**
+ * Convert all applicable characters to HTML entities
+ * @public
+ * @param {string} cb
+ * @return {string}
+ */
+ self.htmlentities = function(s) {
+ return $('<div/>').text(s + '').html();
+ };
+
/**