| Server IP : 104.21.37.246 / Your IP : 104.23.243.33 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/2388321/root/proc/2388322/task/2388322/cwd/sharedjs/libraries/cjt2/util/ |
Upload File : |
/*
# cjt/util/html.js Copyright(c) 2020 cPanel, L.L.C.
# All rights reserved.
# [email protected] http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
*/
/* global define: false */
define([
"jquery"
],
function($) {
return {
/**
* Encode a value as html.
*
* @static
* @method encode
* @param {String} value String with html characters that need encoding
* @return {String} Same string with html characters encoded.
*/
encode: function(value) {
// create a in-memory div, set it's inner text(which jQuery automatically encodes)
// then grab the encoded contents back out. The div never exists on the page.
return $("<div/>").text(value).html();
},
/**
* Decode a string from html encoding to text.
*
* @static
* @method decode
* @param {String} value String with html encoded characters
* @return {String} Same string with html encoded characters decoded.
*/
decode: function(value) {
return $("<div/>").html(value).text();
}
};
}
);