CoreFiles by mySites.guru
match-highlighter.min.js1 lines, 2,771 bytes, from Joomla_4.0.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta
md5
95bb9253b95661ad470adb086ca3c045
sha1
0c204ce039bced6e46590fce03fa4964edfd7ede
sha256
8031f62df2d1429fe5580c9eb83f08bbf2fafbd97f88d5eee9aba212fce7830a
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("./matchesonscrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./matchesonscrollbar"],t):t(CodeMirror)}(function(t){"use strict";var e={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};function o(t){var e=t.state.matchHighlighter;(e.active||t.hasFocus())&&n(t,e)}function i(t){var e=t.state.matchHighlighter;e.active||(e.active=!0,n(t,e))}function n(t,e){clearTimeout(e.timeout),e.timeout=setTimeout(function(){s(t)},e.options.delay)}function r(t,e,o,i){var n=t.state.matchHighlighter;if(t.addOverlay(n.overlay=function(t,e,o){return{token:function(i){if(i.match(t)&&(!e||function(t,e){return!(t.start&&e.test(t.string.charAt(t.start-1))||t.pos!=t.string.length&&e.test(t.string.charAt(t.pos)))}(i,e)))return o;i.next(),i.skipTo(t.charAt(0))||i.skipToEnd()}}}(e,o,i)),n.options.annotateScrollbar&&t.showMatchesOnScrollbar){var r=o?new RegExp((/\w/.test(e.charAt(0))?"\\b":"")+e.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+(/\w/.test(e.charAt(e.length-1))?"\\b":"")):e;n.matchesonscroll=t.showMatchesOnScrollbar(r,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function a(t){var e=t.state.matchHighlighter;e.overlay&&(t.removeOverlay(e.overlay),e.overlay=null,e.matchesonscroll&&(e.matchesonscroll.clear(),e.matchesonscroll=null))}function s(t){t.operation(function(){var e=t.state.matchHighlighter;if(a(t),t.somethingSelected()||!e.options.showToken){var o=t.getCursor("from"),i=t.getCursor("to");if(o.line==i.line&&(!e.options.wordsOnly||function(t,e,o){if(null!==t.getRange(e,o).match(/^\w+$/)){if(e.ch>0){var i={line:e.line,ch:e.ch-1},n=t.getRange(i,e);if(null===n.match(/\W/))return!1}if(o.ch<t.getLine(e.line).length){var i={line:o.line,ch:o.ch+1},n=t.getRange(o,i);if(null===n.match(/\W/))return!1}return!0}return!1}(t,o,i))){var n=t.getRange(o,i);e.options.trim&&(n=n.replace(/^\s+|\s+$/g,"")),n.length>=e.options.minChars&&r(t,n,!1,e.options.style)}}else{for(var s=!0===e.options.showToken?/[\w$]/:e.options.showToken,c=t.getCursor(),l=t.getLine(c.line),h=c.ch,u=h;h&&s.test(l.charAt(h-1));)--h;for(;u<l.length&&s.test(l.charAt(u));)++u;h<u&&r(t,l.slice(h,u),s,e.options.style)}})}t.defineOption("highlightSelectionMatches",!1,function(n,r,c){if(c&&c!=t.Init&&(a(n),clearTimeout(n.state.matchHighlighter.timeout),n.state.matchHighlighter=null,n.off("cursorActivity",o),n.off("focus",i)),r){var l=n.state.matchHighlighter=new function(t){for(var o in this.options={},e)this.options[o]=(t&&t.hasOwnProperty(o)?t:e)[o];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}(r);n.hasFocus()?(l.active=!0,s(n)):n.on("focus",i),n.on("cursorActivity",o)}})});

The same content is in 7 releases, Joomla 4.0.0-beta to 4.0.0-beta7. See them all, or every version of this file.