From d5c0e00f697b5cb3960a5cedd7c98328d9b17eb2 Mon Sep 17 00:00:00 2001 From: 1stthomas Date: Sun, 30 May 2021 17:27:59 +0200 Subject: [PATCH] #2 support of the php html_entities function for javascript implemented --- controller.php | 7 +++++++ js/ht7.extenders.js | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 js/ht7.extenders.js diff --git a/controller.php b/controller.php index 9986784..d928e19 100644 --- a/controller.php +++ b/controller.php @@ -136,6 +136,13 @@ private function registerAssets() ['version' => '0.0.1', 'minify' => true, 'combine' => true], $this ); + $al->register( + 'javascript', + 'ht7-extenders', + 'js/ht7.extenders.js', + ['version' => '0.0.1', 'minify' => true, 'combine' => true], + $this + ); $al->registerGroup( 'ht7-widgets/body-overlay', diff --git a/js/ht7.extenders.js b/js/ht7.extenders.js new file mode 100644 index 0000000..c918020 --- /dev/null +++ b/js/ht7.extenders.js @@ -0,0 +1,8 @@ +// Proting of the php html_entites(). +String.prototype.htmlEntities = function() { + return document.createElement('p').textContent.innerHTML; + +// var p = document.createElement('p'); +// p.textContent = this; +// return p.innerHTML; +};