[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 (function () { 2 'use strict'; 3 4 /** 5 * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> 6 * @license GNU General Public License version 2 or later; see LICENSE.txt 7 */ 8 (function () { 9 document.addEventListener('DOMContentLoaded', function () { 10 var decodeHtmlspecialChars = function decodeHtmlspecialChars(text) { 11 var map = { 12 '&': '&', 13 '&': '&', 14 '<': '<', 15 '>': '>', 16 '"': '"', 17 ''': "'", 18 '’': '’', 19 '‘': '‘', 20 '–': '–', 21 '—': '—', 22 '…': '…', 23 '”': '”' 24 }; 25 /* eslint-disable */ 26 27 return text.replace(/\&[\w\d\#]{2,5}\;/g, function (m) { 28 var n = map[m]; 29 return n; 30 }); 31 }; 32 33 var compare = function compare(original, changed) { 34 var display = changed.nextElementSibling; 35 var color = ''; 36 var pre = null; 37 var diff = Diff.diffLines(original.innerHTML, changed.innerHTML); 38 var fragment = document.createDocumentFragment(); 39 /* eslint-enable */ 40 41 diff.forEach(function (part) { 42 if (part.added) { 43 color = '#a6f3a6'; 44 } else if (part.removed) { 45 color = '#f8cbcb'; 46 } else { 47 color = ''; 48 } 49 50 pre = document.createElement('pre'); 51 pre.style.backgroundColor = color; 52 pre.className = 'diffview'; 53 pre.appendChild(document.createTextNode(decodeHtmlspecialChars(part.value))); 54 fragment.appendChild(pre); 55 }); 56 display.appendChild(fragment); 57 }; 58 59 var diffs = [].slice.call(document.querySelectorAll('#original')); 60 61 for (var i = 0, l = diffs.length; i < l; i += 1) { 62 compare(diffs[i], diffs[i].nextElementSibling); 63 } 64 }); 65 })(); 66 67 })();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |