X-Git-Url: http://wagnertech.de/git?p=kivitendo-erp.git;a=blobdiff_plain;f=js%2Fckeditor%2Fplugins%2Fcodemirror%2Fjs%2Fcodemirror.addons.search.min.js;fp=js%2Fckeditor%2Fplugins%2Fcodemirror%2Fjs%2Fcodemirror.addons.search.min.js;h=5f906a01d3854b0817a8409aeaa7f9ba53b2a6b3;hp=0000000000000000000000000000000000000000;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hpb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44 diff --git a/js/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js b/js/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js new file mode 100644 index 000000000..5f906a01d --- /dev/null +++ b/js/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js @@ -0,0 +1,26 @@ +!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/search/searchcursor",["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function x(d){if(!d.global){var b=d.flags;d=new RegExp(d.source,(null!=b?b:(d.ignoreCase?"i":"")+(d.global?"g":"")+(d.multiline?"m":""))+"g")}return d}function z(d,b,e){b=x(b);var k=e.line,f=e.ch;for(e=d.lastLine();k<=e;k++,f=0)if(b.lastIndex=f,f=d.getLine(k),f=b.exec(f))return{from:m(k, +f.index),to:m(k,f.index+f[0].length),match:f}}function q(d,b,e){if(!/\\s|\\n|\n|\\W|\\D|\[\^/.test(b.source))return z(d,b,e);b=x(b);for(var k,f=1,a=e.line,c=d.lastLine();a<=c;){for(var h=0;h=e;k--,f=-1){var a=d.getLine(k);-1=n;){for(var h=0;h>1,m=a(d.slice(0,c)).length;if(m==e)return c;m>e?b=c:f=c+1}}function r(d,b,e,a){if(!b.length)return null;a=a?n:y;b=a(b).split(/\r|\n\r?/);var f=e.line;e=e.ch;var c=d.lastLine()+1-b.length;a:for(;f<=c;f++,e=0){var g=d.getLine(f).slice(e),h=a(g);if(1== +b.length){var t=h.indexOf(b[0]);if(-1==t)continue a;l(g,h,t,a);return{from:m(f,l(g,h,t,a)+e),to:m(f,l(g,h,t+b[0].length,a)+e)}}t=h.length-b[0].length;if(h.slice(t)==b[0]){for(var u=1;u=q;f--,g=-1){var h=d.getLine(f);-1=w&&g()},200)});a.on(n,"focus",function(){++w})}});a.defineExtension("openNotification",function(q,p){function c(){r||(r=!0,clearTimeout(g),l.parentNode.removeChild(l))}z(this,c);var g,l=x(this,q,p&&p.bottom),r=!1,v=p&&void 0!== +p.duration?p.duration:5E3;return a.on(l,"click",function(g){a.e_preventDefault(g);c()}),v&&(g=setTimeout(c,v)),c})}); +(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define("addon/search/search.js",["../../lib/codemirror","./searchcursor","../dialog/dialog"],a):a(CodeMirror)})(function(a){function x(h,a){return"string"==typeof h?h=new RegExp(h.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$\x26"),a?"gi":"g"):h.global||(h=new RegExp(h.source,h.ignoreCase?"gi":"g")),{token:function(a){h.lastIndex= +a.pos;var b=h.exec(a.string);if(b&&b.index==a.pos)return a.pos+=b[0].length||1,"searching";b?a.pos=b.index:a.skipToEnd()}}}function z(){this.overlay=this.posFrom=this.posTo=this.lastQuery=this.query=null}function q(h){return h.state.search||(h.state.search=new z)}function p(h){return"string"==typeof h&&h==h.toLowerCase()}function c(h,a,b){return h.getSearchCursor(a,b,{caseFold:p(a),multiline:!0})}function g(h,a,b,c,f){h.openDialog(a,c,{value:b,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){d(h)}, +onKeyDown:f})}function l(h,a,b,c,d){h.openDialog?h.openDialog(a,d,{value:c,selectValueOnOpen:!0}):d(prompt(b,c))}function r(a,b,c,d){a.openConfirm?a.openConfirm(b,d):confirm(c)&&d[0]()}function v(a){return a.replace(/\\(.)/g,function(a,h){return"n"==h?"\n":"r"==h?"\r":h})}function w(a){var b=a.match(/^\/(.*)\/([a-z]*)$/);if(b)try{a=new RegExp(b[1],-1==b[2].indexOf("i")?"":"i")}catch(c){}else a=v(a);return("string"==typeof a?""==a:a.test(""))&&(a=/x^/),a}function n(a,b,c){b.queryText=c;b.query=w(c); +a.removeOverlay(b.overlay,p(b.query));b.overlay=x(b.query,p(b.query));a.addOverlay(b.overlay);a.showMatchesOnScrollbar&&(b.annotate&&(b.annotate.clear(),b.annotate=null),b.annotate=a.showMatchesOnScrollbar(b.query,p(b.query)))}function y(b,c,d,f){var e=q(b);if(e.query)return m(b,c);var p=b.getSelection()||e.lastQuery;if(d&&b.openDialog){var B=null,r=function(c,d){a.e_stop(d);c&&(c!=e.queryText&&(n(b,e,c),e.posFrom=e.posTo=b.getCursor()),B&&(B.style.opacity=1),m(b,d.shiftKey,function(a,c){var d;3> +c.line&&document.querySelector&&(d=b.display.wrapper.querySelector(".CodeMirror-dialog"))&&d.getBoundingClientRect().bottom-4>b.cursorCoords(c,"window").top&&((B=d).style.opacity=.4)}))};g(b,k,p,r,function(c,d){var e=a.keyName(c),f=a.keyMap[b.getOption("keyMap")][e];f||(f=b.getOption("extraKeys")[e]);"findNext"==f||"findPrev"==f||"findPersistentNext"==f||"findPersistentPrev"==f?(a.e_stop(c),n(b,q(b),d),b.execCommand(f)):"find"!=f&&"findPersistent"!=f||(a.e_stop(c),r(d,c))});f&&p&&(n(b,e,p),m(b,c))}else l(b, +k,"Search for:",p,function(a){a&&!e.query&&b.operation(function(){n(b,e,a);e.posFrom=e.posTo=b.getCursor();m(b,c)})})}function m(b,d,f){b.operation(function(){var e=q(b),g=c(b,e.query,d?e.posFrom:e.posTo);(g.find(d)||(g=c(b,e.query,d?a.Pos(b.lastLine()):a.Pos(b.firstLine(),0)),g.find(d)))&&(b.setSelection(g.from(),g.to()),b.scrollIntoView({from:g.from(),to:g.to()},20),e.posFrom=g.from(),e.posTo=g.to(),f&&f(g.from(),g.to()))})}function d(b){b.operation(function(){var a=q(b);(a.lastQuery=a.query)&& +(a.query=a.queryText=null,b.removeOverlay(a.overlay),a.annotate&&(a.annotate.clear(),a.annotate=null))})}function b(b,a,d){b.operation(function(){for(var e=c(b,a);e.findNext();)if("string"!=typeof a){var f=b.getRange(e.from(),e.to()).match(a);e.replace(d.replace(/\$(\d)/g,function(b,a){return f[a]}))}else e.replace(d)})}function e(a,e){if(!a.getOption("readOnly")){var g=a.getSelection()||q(a).lastQuery,k='\x3cspan class\x3d"CodeMirror-search-label"\x3e'+(e?"Replace all:":"Replace:")+"\x3c/span\x3e"; +l(a,k+f,k,g,function(f){f&&(f=w(f),l(a,C,"Replace with:","",function(g){if(g=v(g),e)b(a,f,g);else{d(a);var k=c(a,f,a.getCursor("from")),l=function(){var d,e=k.from();!(d=k.findNext())&&(k=c(a,f),!(d=k.findNext())||e&&k.from().line==e.line&&k.from().ch==e.ch)||(a.setSelection(k.from(),k.to()),a.scrollIntoView({from:k.from(),to:k.to()}),r(a,D,"Replace?",[function(){m(d)},l,function(){b(a,f,g)}]))},m=function(a){k.replace("string"==typeof f?g:g.replace(/\$(\d)/g,function(b,c){return a[c]}));l()};l()}}))})}} +var k='\x3cspan class\x3d"CodeMirror-search-label"\x3eSearch:\x3c/span\x3e \x3cinput type\x3d"text" style\x3d"width: 10em" class\x3d"CodeMirror-search-field"/\x3e \x3cspan style\x3d"color: #888" class\x3d"CodeMirror-search-hint"\x3e(Use /re/ syntax for regexp search)\x3c/span\x3e',f=' \x3cinput type\x3d"text" style\x3d"width: 10em" class\x3d"CodeMirror-search-field"/\x3e \x3cspan style\x3d"color: #888" class\x3d"CodeMirror-search-hint"\x3e(Use /re/ syntax for regexp search)\x3c/span\x3e',C='\x3cspan class\x3d"CodeMirror-search-label"\x3eWith:\x3c/span\x3e \x3cinput type\x3d"text" style\x3d"width: 10em" class\x3d"CodeMirror-search-field"/\x3e', +D='\x3cspan class\x3d"CodeMirror-search-label"\x3eReplace?\x3c/span\x3e \x3cbutton\x3eYes\x3c/button\x3e \x3cbutton\x3eNo\x3c/button\x3e \x3cbutton\x3eAll\x3c/button\x3e \x3cbutton\x3eStop\x3c/button\x3e';a.commands.find=function(a){d(a);y(a)};a.commands.findPersistent=function(a){d(a);y(a,!1,!0)};a.commands.findPersistentNext=function(a){y(a,!1,!0,!0)};a.commands.findPersistentPrev=function(a){y(a,!0,!0,!0)};a.commands.findNext=y;a.commands.findPrev=function(a){y(a,!0)};a.commands.clearSearch=d; +a.commands.replace=e;a.commands.replaceAll=function(a){e(a,!0)}});(function(a){"function"==typeof a.define&&a.define("addonSearch",["addon/search/search.js"],function(){})})(this); \ No newline at end of file