CoreFiles by mySites.guru
search.min.js1 lines, 5,514 bytes, from Joomla_4.0.0-beta7-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta6
md5
7f1e9db39ae1203f334dff97fb62c3ed
sha1
ce538f52e02b4f0a76a5ff47559bc72917ffd992
sha256
caac3e1b3ebd2d89e3e65ed56ff7c8c16977c3be0887e492db93e92f23f1128c
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function o(e){return e.state.search||(e.state.search=new function(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null})}function n(e){return"string"==typeof e&&e==e.toLowerCase()}function t(e,o,t){return e.getSearchCursor(o,t,{caseFold:n(o),multiline:!0})}function r(e,o,n,t,r){e.openDialog?e.openDialog(o,r,{value:t,selectValueOnOpen:!0,bottom:e.options.search.bottom}):r(prompt(n,t))}function i(e){return e.replace(/\\([nrt\\])/g,function(e,o){return"n"==o?"\n":"r"==o?"\r":"t"==o?"\t":"\\"==o?"\\":e})}function a(e){var o=e.match(/^\/(.*)\/([a-z]*)$/);if(o)try{e=new RegExp(o[1],-1==o[2].indexOf("i")?"":"i")}catch(e){}else e=i(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function s(e,o,t){o.queryText=t,o.query=a(t),e.removeOverlay(o.overlay,n(o.query)),o.overlay=function(e,o){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),o?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(o){e.lastIndex=o.pos;var n=e.exec(o.string);if(n&&n.index==o.pos)return o.pos+=n[0].length||1,"searching";n?o.pos=n.index:o.skipToEnd()}}}(o.query,n(o.query)),e.addOverlay(o.overlay),e.showMatchesOnScrollbar&&(o.annotate&&(o.annotate.clear(),o.annotate=null),o.annotate=e.showMatchesOnScrollbar(o.query,n(o.query)))}function c(n,t,i,a){var c=o(n);if(c.query)return l(n,t);var p=n.getSelection()||c.lastQuery;if(p instanceof RegExp&&"x^"==p.source&&(p=null),i&&n.openDialog){var d=null,m=function(o,t){e.e_stop(t),o&&(o!=c.queryText&&(s(n,c,o),c.posFrom=c.posTo=n.getCursor()),d&&(d.style.opacity=1),l(n,t.shiftKey,function(e,o){var t;o.line<3&&document.querySelector&&(t=n.display.wrapper.querySelector(".CodeMirror-dialog"))&&t.getBoundingClientRect().bottom-4>n.cursorCoords(o,"window").top&&((d=t).style.opacity=.4)}))};!function(e,o,n,t,r){e.openDialog(o,t,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){u(e)},onKeyDown:r,bottom:e.options.search.bottom})}(n,f(n),p,m,function(t,r){var i=e.keyName(t),a=n.getOption("extraKeys"),c=a&&a[i]||e.keyMap[n.getOption("keyMap")][i];"findNext"==c||"findPrev"==c||"findPersistentNext"==c||"findPersistentPrev"==c?(e.e_stop(t),s(n,o(n),r),n.execCommand(c)):"find"!=c&&"findPersistent"!=c||(e.e_stop(t),m(r,t))}),a&&p&&(s(n,c,p),l(n,t))}else r(n,f(n),"Search for:",p,function(e){e&&!c.query&&n.operation(function(){s(n,c,e),c.posFrom=c.posTo=n.getCursor(),l(n,t)})})}function l(n,r,i){n.operation(function(){var a=o(n),s=t(n,a.query,r?a.posFrom:a.posTo);(s.find(r)||(s=t(n,a.query,r?e.Pos(n.lastLine()):e.Pos(n.firstLine(),0))).find(r))&&(n.setSelection(s.from(),s.to()),n.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),i&&i(s.from(),s.to()))})}function u(e){e.operation(function(){var n=o(e);n.lastQuery=n.query,n.query&&(n.query=n.queryText=null,e.removeOverlay(n.overlay),n.annotate&&(n.annotate.clear(),n.annotate=null))})}function f(e){return'<span class="CodeMirror-search-label">'+e.phrase("Search:")+'</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use /re/ syntax for regexp search)")+"</span>"}function p(e,o,n){e.operation(function(){for(var r=t(e,o);r.findNext();)if("string"!=typeof o){var i=e.getRange(r.from(),r.to()).match(o);r.replace(n.replace(/\$(\d)/g,function(e,o){return i[o]}))}else r.replace(n)})}function d(e,n){if(!e.getOption("readOnly")){var s=e.getSelection()||o(e).lastQuery,c='<span class="CodeMirror-search-label">'+(n?e.phrase("Replace all:"):e.phrase("Replace:"))+"</span>";r(e,c+function(e){return' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use /re/ syntax for regexp search)")+"</span>"}(e),c,s,function(o){o&&(o=a(o),r(e,function(e){return'<span class="CodeMirror-search-label">'+e.phrase("With:")+'</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>'}(e),e.phrase("Replace with:"),"",function(r){if(r=i(r),n)p(e,o,r);else{u(e);var a=t(e,o,e.getCursor("from")),s=function(){var n,i=a.from();!(n=a.findNext())&&(a=t(e,o),!(n=a.findNext())||i&&a.from().line==i.line&&a.from().ch==i.ch)||(e.setSelection(a.from(),a.to()),e.scrollIntoView({from:a.from(),to:a.to()}),function(e,o,n,t){e.openConfirm?e.openConfirm(o,t):confirm(n)&&t[0]()}(e,function(e){return'<span class="CodeMirror-search-label">'+e.phrase("Replace?")+"</span> <button>"+e.phrase("Yes")+"</button> <button>"+e.phrase("No")+"</button> <button>"+e.phrase("All")+"</button> <button>"+e.phrase("Stop")+"</button> "}(e),e.phrase("Replace?"),[function(){c(n)},s,function(){p(e,o,r)}]))},c=function(e){a.replace("string"==typeof o?r:r.replace(/\$(\d)/g,function(o,n){return e[n]})),s()};s()}}))})}}e.defineOption("search",{bottom:!1}),e.commands.find=function(e){u(e),c(e)},e.commands.findPersistent=function(e){u(e),c(e,!1,!0)},e.commands.findPersistentNext=function(e){c(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){c(e,!0,!0,!0)},e.commands.findNext=c,e.commands.findPrev=function(e){c(e,!0)},e.commands.clearSearch=u,e.commands.replace=d,e.commands.replaceAll=function(e){d(e,!0)}});

No other release has this exact content. See every version of this file.