[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/system/js/ -> highlight-es5.min.js (source)

   1  !function(){"use strict";function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var e=function(){function t(t,e,n,r){void 0===e&&(e=!0),void 0===n&&(n=[]),void 0===r&&(r=5e3),this.ctx=t,this.iframes=e,this.exclude=n,this.iframesTimeout=r}t.matches=function(t,e){var n="string"==typeof e?[e]:e,r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;if(r){var i=!1;return n.every((function(e){return!r.call(t,e)||(i=!0,!1)})),i}return!1};var e=t.prototype;return e.getContexts=function(){var t=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach((function(e){var n=t.filter((function(t){return t.contains(e)})).length>0;-1!==t.indexOf(e)||n||t.push(e)})),t},e.getIframeContents=function(t,e,n){var r;void 0===n&&(n=function(){});try{var i=t.contentWindow;if(r=i.document,!i||!r)throw new Error("iframe inaccessible")}catch(t){n()}r&&e(r)},e.isIframeBlank=function(t){var e="about:blank",n=t.getAttribute("src").trim();return t.contentWindow.location.href===e&&n!==e&&n},e.observeIframeLoad=function(t,e,n){var r=this,i=!1,o=null,a=function a(){if(!i){i=!0,clearTimeout(o);try{r.isIframeBlank(t)||(t.removeEventListener("load",a),r.getIframeContents(t,e,n))}catch(t){n()}}};t.addEventListener("load",a),o=setTimeout(a,this.iframesTimeout)},e.onIframeReady=function(t,e,n){try{"complete"===t.contentWindow.document.readyState?this.isIframeBlank(t)?this.observeIframeLoad(t,e,n):this.getIframeContents(t,e,n):this.observeIframeLoad(t,e,n)}catch(t){n()}},e.waitForIframes=function(t,e){var n=this,r=0;this.forEachIframe(t,(function(){return!0}),(function(t){r++,n.waitForIframes(t.querySelector("html"),(function(){--r||e()}))}),(function(t){t||e()}))},e.forEachIframe=function(e,n,r,i){var o=this;void 0===i&&(i=function(){});var a=e.querySelectorAll("iframe"),s=a.length,c=0;a=Array.prototype.slice.call(a);var u=function(){--s<=0&&i(c)};s||u(),a.forEach((function(e){t.matches(e,o.exclude)?u():o.onIframeReady(e,(function(t){n(e)&&(c++,r(t)),u()}),u)}))},e.createIterator=function(t,e,n){return document.createNodeIterator(t,e,n,!1)},e.createInstanceOnIframe=function(e){return new t(e.querySelector("html"),this.iframes)},e.compareNodeIframe=function(t,e,n){if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING){if(null===e)return!0;if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1},e.getIteratorNode=function(t){var e=t.previousNode();return{prevNode:e,node:(null===e||t.nextNode())&&t.nextNode()}},e.checkIframeFilter=function(t,e,n,r){var i=!1,o=!1;return r.forEach((function(t,e){t.val===n&&(i=e,o=t.handled)})),this.compareNodeIframe(t,e,n)?(!1!==i||o?!1===i||o||(r[i].handled=!0):r.push({val:n,handled:!0}),!0):(!1===i&&r.push({val:n,handled:!1}),!1)},e.handleOpenIframes=function(t,e,n,r){var i=this;t.forEach((function(t){t.handled||i.getIframeContents(t.val,(function(t){i.createInstanceOnIframe(t).forEachNode(e,n,r)}))}))},e.iterateThroughNodes=function(t,e,n,r,i){for(var o,a,s,c=this,u=this.createIterator(e,t,r),h=[],l=[];s=void 0,s=c.getIteratorNode(u),a=s.prevNode,o=s.node;)this.iframes&&this.forEachIframe(e,(function(t){return c.checkIframeFilter(o,a,t,h)}),(function(e){c.createInstanceOnIframe(e).forEachNode(t,(function(t){return l.push(t)}),r)})),l.push(o);l.forEach((function(t){n(t)})),this.iframes&&this.handleOpenIframes(h,t,n,r),i()},e.forEachNode=function(t,e,n,r){var i=this;void 0===r&&(r=function(){});var o=this.getContexts(),a=o.length;a||r(),o.forEach((function(o){var s=function(){i.iterateThroughNodes(t,o,e,n,(function(){--a<=0&&r()}))};i.iframes?i.waitForIframes(o,s):s()}))},t}(),n=function(){function n(t){this.ctx=t,this.ie=!1;var e=window.navigator.userAgent;(e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1)&&(this.ie=!0)}var r,i,o,a=n.prototype;return a.log=function(t,e){void 0===e&&(e="debug");var n=this.opt.log;this.opt.debug&&"object"==typeof n&&"function"==typeof n[e]&&n[e]("mark.js: "+t)},a.escapeStr=function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},a.createRegExp=function(t){return"disabled"!==this.opt.wildcards&&(t=this.setupWildcardsRegExp(t)),t=this.escapeStr(t),Object.keys(this.opt.synonyms).length&&(t=this.createSynonymsRegExp(t)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.setupIgnoreJoinersRegExp(t)),this.opt.diacritics&&(t=this.createDiacriticsRegExp(t)),t=this.createMergedBlanksRegExp(t),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.createJoinersRegExp(t)),"disabled"!==this.opt.wildcards&&(t=this.createWildcardsRegExp(t)),t=this.createAccuracyRegExp(t)},a.createSynonymsRegExp=function(t){var e=this.opt.synonyms,n=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var i in e)if(e.hasOwnProperty(i)){var o=e[i],a="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(i):this.escapeStr(i),s="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(o):this.escapeStr(o);""!==a&&""!==s&&(t=t.replace(new RegExp("("+this.escapeStr(a)+"|"+this.escapeStr(s)+")","gm"+n),r+"("+this.processSynomyms(a)+"|"+this.processSynomyms(s)+")"+r))}return t},a.processSynomyms=function(t){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.setupIgnoreJoinersRegExp(t)),t},a.setupWildcardsRegExp=function(t){return(t=t.replace(/(?:\\)*\?/g,(function(t){return"\\"===t.charAt(0)?"?":""}))).replace(/(?:\\)*\*/g,(function(t){return"\\"===t.charAt(0)?"*":""}))},a.createWildcardsRegExp=function(t){var e="withSpaces"===this.opt.wildcards;return t.replace(/\u0001/g,e?"[\\S\\s]?":"\\S?").replace(/\u0002/g,e?"[\\S\\s]*?":"\\S*")},a.setupIgnoreJoinersRegExp=function(t){return t.replace(/[^(|)\\]/g,(function(t,e,n){var r=n.charAt(e+1);return/[(|)\\]/.test(r)||""===r?t:t+"\0"}))},a.createJoinersRegExp=function(t){var e=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&e.push(this.escapeStr(n.join(""))),this.opt.ignoreJoiners&&e.push("\\u00ad\\u200b\\u200c\\u200d"),e.length?t.split(/\u0000+/).join("["+e.join("")+"]*"):t},a.createDiacriticsRegExp=function(t){var e=this.opt.caseSensitive?"":"i",n=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"],r=[];return t.split("").forEach((function(i){n.every((function(n){if(-1!==n.indexOf(i)){if(r.indexOf(n)>-1)return!1;t=t.replace(new RegExp("["+n+"]","gm"+e),"["+n+"]"),r.push(n)}return!0}))})),t},a.createMergedBlanksRegExp=function(t){return t.replace(/[\s]+/gim,"[\\s]+")},a.createAccuracyRegExp=function(t){var e=this,n=this.opt.accuracy,r="string"==typeof n?n:n.value,i="string"==typeof n?[]:n.limiters,o="";switch(i.forEach((function(t){o+="|"+e.escapeStr(t)})),r){case"partially":default:return"()("+t+")";case"complementary":return"()([^"+(o="\\s"+(o||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿")))+"]*"+t+"[^"+o+"]*)";case"exactly":return"(^|\\s"+o+")("+t+")(?=$|\\s"+o+")"}},a.getSeparatedKeywords=function(t){var e=this,n=[];return t.forEach((function(t){e.opt.separateWordSearch?t.split(" ").forEach((function(t){t.trim()&&-1===n.indexOf(t)&&n.push(t)})):t.trim()&&-1===n.indexOf(t)&&n.push(t)})),{keywords:n.sort((function(t,e){return e.length-t.length})),length:n.length}},a.isNumeric=function(t){return Number(parseFloat(t))==t},a.checkRanges=function(t){var e=this;if(!Array.isArray(t)||"[object Object]"!==Object.prototype.toString.call(t[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(t),[];var n=[],r=0;return t.sort((function(t,e){return t.start-e.start})).forEach((function(t){var i=e.callNoMatchOnInvalidRanges(t,r),o=i.start,a=i.end;i.valid&&(t.start=o,t.length=a-o,n.push(t),r=a)})),n},a.callNoMatchOnInvalidRanges=function(t,e){var n,r,i=!1;return t&&void 0!==t.start?(r=(n=parseInt(t.start,10))+parseInt(t.length,10),this.isNumeric(t.start)&&this.isNumeric(t.length)&&r-e>0&&r-n>0?i=!0:(this.log("Ignoring invalid or overlapping range: "+JSON.stringify(t)),this.opt.noMatch(t))):(this.log("Ignoring invalid range: "+JSON.stringify(t)),this.opt.noMatch(t)),{start:n,end:r,valid:i}},a.checkWhitespaceRanges=function(t,e,n){var r,i=!0,o=n.length,a=e-o,s=parseInt(t.start,10)-a;return(r=(s=s>o?o:s)+parseInt(t.length,10))>o&&(r=o,this.log("End range automatically set to the max value of "+o)),s<0||r-s<0||s>o||r>o?(i=!1,this.log("Invalid range: "+JSON.stringify(t)),this.opt.noMatch(t)):""===n.substring(s,r).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(t)),this.opt.noMatch(t)),{start:s,end:r,valid:i}},a.getTextNodes=function(t){var e=this,n="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,(function(t){r.push({start:n.length,end:(n+=t.textContent).length,node:t})}),(function(t){return e.matchesExclude(t.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),(function(){t({value:n,nodes:r})}))},a.matchesExclude=function(t){return e.matches(t,this.opt.exclude.concat(["script","style","title","head","html"]))},a.wrapRangeInTextNode=function(t,e,n){var r=this.opt.element?this.opt.element:"mark",i=t.splitText(e),o=i.splitText(n-e),a=document.createElement(r);return a.setAttribute("data-markjs","true"),this.opt.className&&a.setAttribute("class",this.opt.className),a.textContent=i.textContent,i.parentNode.replaceChild(a,i),o},a.wrapRangeInMappedTextNode=function(t,e,n,r,i){var o=this;t.nodes.every((function(a,s){var c=t.nodes[s+1];if(void 0===c||c.start>e){if(!r(a.node))return!1;var u=e-a.start,h=(n>a.end?a.end:n)-a.start,l=t.value.substr(0,a.start),f=t.value.substr(h+a.start);if(a.node=o.wrapRangeInTextNode(a.node,u,h),t.value=l+f,t.nodes.forEach((function(e,n){n>=s&&(t.nodes[n].start>0&&n!==s&&(t.nodes[n].start-=h),t.nodes[n].end-=h)})),n-=h,i(a.node.previousSibling,a.start),!(n>a.end))return!1;e=a.end}return!0}))},a.wrapMatches=function(t,e,n,r,i){var o=this,a=0===e?0:e+1;this.getTextNodes((function(e){e.nodes.forEach((function(e){var i;for(e=e.node;null!==(i=t.exec(e.textContent))&&""!==i[a];)if(n(i[a],e)){var s=i.index;if(0!==a)for(var c=1;c<a;c++)s+=i[c].length;e=o.wrapRangeInTextNode(e,s,s+i[a].length),r(e.previousSibling),t.lastIndex=0}})),i()}))},a.wrapMatchesAcrossElements=function(t,e,n,r,i){var o=this,a=0===e?0:e+1;this.getTextNodes((function(e){for(var s;null!==(s=t.exec(e.value))&&""!==s[a];){var c=s.index;if(0!==a)for(var u=1;u<a;u++)c+=s[u].length;var h=c+s[a].length;o.wrapRangeInMappedTextNode(e,c,h,(function(t){return n(s[a],t)}),(function(e,n){t.lastIndex=n,r(e)}))}i()}))},a.wrapRangeFromIndex=function(t,e,n,r){var i=this;this.getTextNodes((function(o){var a=o.value.length;t.forEach((function(t,r){var s=i.checkWhitespaceRanges(t,a,o.value),c=s.start,u=s.end;s.valid&&i.wrapRangeInMappedTextNode(o,c,u,(function(n){return e(n,t,o.value.substring(c,u),r)}),(function(e){n(e,t)}))})),r()}))},a.unwrapMatches=function(t){for(var e=t.parentNode,n=document.createDocumentFragment();t.firstChild;)n.appendChild(t.removeChild(t.firstChild));e.replaceChild(n,t),this.ie?this.normalizeTextNode(e):e.normalize()},a.normalizeTextNode=function(t){if(t){if(3===t.nodeType)for(;t.nextSibling&&3===t.nextSibling.nodeType;)t.nodeValue+=t.nextSibling.nodeValue,t.parentNode.removeChild(t.nextSibling);else this.normalizeTextNode(t.firstChild);this.normalizeTextNode(t.nextSibling)}},a.markRegExp=function(t,e){var n=this;this.opt=e,this.log('Searching with expression "'+t+'"');var r=0,i="wrapMatches";this.opt.acrossElements&&(i="wrapMatchesAcrossElements"),this[i](t,this.opt.ignoreGroups,(function(t,e){return n.opt.filter(e,t,r)}),(function(t){r++,n.opt.each(t)}),(function(){0===r&&n.opt.noMatch(t),n.opt.done(r)}))},a.mark=function(t,e){var n=this;this.opt=e;var r=0,i="wrapMatches",o=this.getSeparatedKeywords("string"==typeof t?[t]:t),a=o.keywords,s=o.length,c=this.opt.caseSensitive?"":"i";this.opt.acrossElements&&(i="wrapMatchesAcrossElements"),0===s?this.opt.done(r):function t(e){var o=new RegExp(n.createRegExp(e),"gm"+c),u=0;n.log('Searching with expression "'+o+'"'),n[i](o,1,(function(t,i){return n.opt.filter(i,e,r,u)}),(function(t){u++,r++,n.opt.each(t)}),(function(){0===u&&n.opt.noMatch(e),a[s-1]===e?n.opt.done(r):t(a[a.indexOf(e)+1])}))}(a[0])},a.markRanges=function(t,e){var n=this;this.opt=e;var r=0,i=this.checkRanges(t);i&&i.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(i)),this.wrapRangeFromIndex(i,(function(t,e,r,i){return n.opt.filter(t,e,r,i)}),(function(t,e){r++,n.opt.each(t,e)}),(function(){n.opt.done(r)}))):this.opt.done(r)},a.unmark=function(t){var n=this;this.opt=t;var r=this.opt.element?this.opt.element:"*";r+="[data-markjs]",this.opt.className&&(r+="."+this.opt.className),this.log('Removal selector "'+r+'"'),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,(function(t){n.unwrapMatches(t)}),(function(t){var i=e.matches(t,r),o=n.matchesExclude(t);return!i||o?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),this.opt.done)},r=n,(i=[{key:"opt",get:function(){return this._opt},set:function(t){this._opt=Object.assign({},{element:"",className:"",exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,diacritics:!0,synonyms:{},accuracy:"partially",acrossElements:!1,caseSensitive:!1,ignoreJoiners:!1,ignoreGroups:0,ignorePunctuation:[],wildcards:"disabled",each:function(){},noMatch:function(){},filter:function(){return!0},done:function(){},debug:!1,log:window.console},t)}},{key:"iterator",get:function(){return new e(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}}])&&t(r.prototype,i),o&&t(r,o),Object.defineProperty(r,"prototype",{writable:!1}),n}();function r(t){var e=this,r=new n(t);return this.mark=function(t,n){return r.mark(t,n),e},this.markRegExp=function(t,n){return r.markRegExp(t,n),e},this.markRanges=function(t,n){return r.markRanges(t,n),e},this.unmark=function(t){return r.unmark(t),e},this}var i={exclude:[],separateWordSearch:!0,accuracy:"partially",diacritics:!0,synonyms:{},iframes:!1,iframesTimeout:5e3,acrossElements:!0,caseSensitive:!1,ignoreJoiners:!1,wildcards:"disabled",compatibility:!1};Joomla.getOptions&&"function"==typeof Joomla.getOptions&&Joomla.getOptions("highlight")&&Joomla.getOptions("highlight").forEach((function(t){var e=Object.assign({},i,t);if(e.compatibility){var n=document.querySelector("#"+e.start);document.querySelector("#"+e.end);var o=n.parentNode;Array.from(o.childNodes).forEach((function(t){})),[].forEach((function(t){var n=new r(t);e.highLight.map((function(t){return n.mark(t,e)}))}))}else{var a=document.querySelector("."+e.class);if(a){var s=new r(a);e.highLight.forEach((function(t){s.mark(t,e)}))}}}))}();


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer