Файловый менеджер - Редактировать - /home/wuectly/www/03cbe/search.zip
Назад
PK f�!]�"�� � jump-to-line.min.jsnu &1i� !(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b,c,d,e){a.openDialog?a.openDialog(b,e,{value:d,selectValueOnOpen:!0,bottom:a.options.search.bottom}):e(prompt(c,d))}function c(a){return a.phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+a.phrase("(Use line:column or scroll% syntax)")+"</span>"}function d(a,b){var c=Number(b);return/^[-+]/.test(b)?a.getCursor().line+c:c-1}a.defineOption("search",{bottom:!1}),a.commands.jumpToLine=function(a){var e=a.getCursor();b(a,c(a),a.phrase("Jump to line:"),e.line+1+":"+e.ch,(function(b){if(b){var c;if(c=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(b))a.setCursor(d(a,c[1]),Number(c[2]));else if(c=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(b)){var f=Math.round(a.lineCount()*Number(c[1])/100);/^[-+]/.test(c[1])&&(f=e.line+f+1),a.setCursor(f-1,e.ch)}else(c=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(b))&&a.setCursor(d(a,c[1]),e.ch)}}))},a.keyMap.default["Alt-G"]="jumpToLine"}));PK f�!]�WU] ] jump-to-line.jsnu &1i� // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: https://codemirror.net/LICENSE // Defines jumpToLine command. Uses dialog.js if present. (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../dialog/dialog")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror", "../dialog/dialog"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; // default search panel location CodeMirror.defineOption("search", {bottom: false}); function dialog(cm, text, shortText, deflt, f) { if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom}); else f(prompt(shortText, deflt)); } function getJumpDialog(cm) { return cm.phrase("Jump to line:") + ' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">' + cm.phrase("(Use line:column or scroll% syntax)") + '</span>'; } function interpretLine(cm, string) { var num = Number(string) if (/^[-+]/.test(string)) return cm.getCursor().line + num else return num - 1 } CodeMirror.commands.jumpToLine = function(cm) { var cur = cm.getCursor(); dialog(cm, getJumpDialog(cm), cm.phrase("Jump to line:"), (cur.line + 1) + ":" + cur.ch, function(posStr) { if (!posStr) return; var match; if (match = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr)) { cm.setCursor(interpretLine(cm, match[1]), Number(match[2])) } else if (match = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr)) { var line = Math.round(cm.lineCount() * Number(match[1]) / 100); if (/^[-+]/.test(match[1])) line = cur.line + line + 1; cm.setCursor(line - 1, cur.ch); } else if (match = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr)) { cm.setCursor(interpretLine(cm, match[1]), cur.ch); } }); }; CodeMirror.keyMap["default"]["Alt-G"] = "jumpToLine"; }); PK f�!]�B��� � searchcursor.min.jsnu &1i� !(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a){var b=a.flags;return null!=b?b:(a.ignoreCase?"i":"")+(a.global?"g":"")+(a.multiline?"m":"")}function c(a,c){for(var d=b(a),e=d,f=0;f<c.length;f++)-1==e.indexOf(c.charAt(f))&&(e+=c.charAt(f));return d==e?a:new RegExp(a.source,e)}function d(a){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(a.source)}function e(a,b,d){b=c(b,"g");for(var e=d.line,f=d.ch,g=a.lastLine();e<=g;e++,f=0){b.lastIndex=f;var h=a.getLine(e),i=b.exec(h);if(i)return{from:p(e,i.index),to:p(e,i.index+i[0].length),match:i}}}function f(a,b,f){if(!d(b))return e(a,b,f);b=c(b,"gm");for(var g,h=1,i=f.line,j=a.lastLine();i<=j;){for(var k=0;k<h&&!(i>j);k++){var l=a.getLine(i++);g=null==g?l:g+"\n"+l}h*=2,b.lastIndex=f.ch;var m=b.exec(g);if(m){var n=g.slice(0,m.index).split("\n"),o=m[0].split("\n"),q=f.line+n.length-1,r=n[n.length-1].length;return{from:p(q,r),to:p(q+o.length-1,1==o.length?r+o[0].length:o[o.length-1].length),match:m}}}}function g(a,b,c){for(var d,e=0;e<=a.length;){b.lastIndex=e;var f=b.exec(a);if(!f)break;var g=f.index+f[0].length;if(g>a.length-c)break;(!d||g>d.index+d[0].length)&&(d=f),e=f.index+1}return d}function h(a,b,d){b=c(b,"g");for(var e=d.line,f=d.ch,h=a.firstLine();e>=h;e--,f=-1){var i=a.getLine(e),j=g(i,b,f<0?0:i.length-f);if(j)return{from:p(e,j.index),to:p(e,j.index+j[0].length),match:j}}}function i(a,b,e){if(!d(b))return h(a,b,e);b=c(b,"gm");for(var f,i=1,j=a.getLine(e.line).length-e.ch,k=e.line,l=a.firstLine();k>=l;){for(var m=0;m<i&&k>=l;m++){var n=a.getLine(k--);f=null==f?n:n+"\n"+f}i*=2;var o=g(f,b,j);if(o){var q=f.slice(0,o.index).split("\n"),r=o[0].split("\n"),s=k+q.length,t=q[q.length-1].length;return{from:p(s,t),to:p(s+r.length-1,1==r.length?t+r[0].length:r[r.length-1].length),match:o}}}}function j(a,b,c,d){if(a.length==b.length)return c;for(var e=0,f=c+Math.max(0,a.length-b.length);;){if(e==f)return e;var g=e+f>>1,h=d(a.slice(0,g)).length;if(h==c)return g;h>c?f=g:e=g+1}}function k(a,b,c,d){if(!b.length)return null;var e=d?n:o,f=e(b).split(/\r|\n\r?/);a:for(var g=c.line,h=c.ch,i=a.lastLine()+1-f.length;g<=i;g++,h=0){var k=a.getLine(g).slice(h),l=e(k);if(1==f.length){var m=l.indexOf(f[0]);if(-1==m)continue a;var c=j(k,l,m,e)+h;return{from:p(g,j(k,l,m,e)+h),to:p(g,j(k,l,m+f[0].length,e)+h)}}var q=l.length-f[0].length;if(l.slice(q)==f[0]){for(var r=1;r<f.length-1;r++)if(e(a.getLine(g+r))!=f[r])continue a;var s=a.getLine(g+f.length-1),t=e(s),u=f[f.length-1];if(t.slice(0,u.length)==u)return{from:p(g,j(k,l,q,e)+h),to:p(g+f.length-1,j(s,t,u.length,e))}}}}function l(a,b,c,d){if(!b.length)return null;var e=d?n:o,f=e(b).split(/\r|\n\r?/);a:for(var g=c.line,h=c.ch,i=a.firstLine()-1+f.length;g>=i;g--,h=-1){var k=a.getLine(g);h>-1&&(k=k.slice(0,h));var l=e(k);if(1==f.length){var m=l.lastIndexOf(f[0]);if(-1==m)continue a;return{from:p(g,j(k,l,m,e)),to:p(g,j(k,l,m+f[0].length,e))}}var q=f[f.length-1];if(l.slice(0,q.length)==q){for(var r=1,c=g-f.length+1;r<f.length-1;r++)if(e(a.getLine(c+r))!=f[r])continue a;var s=a.getLine(g+1-f.length),t=e(s);if(t.slice(t.length-f[0].length)==f[0])return{from:p(g+1-f.length,j(s,t,s.length-f[0].length,e)),to:p(g,j(k,l,q.length,e))}}}}function m(a,b,d,g){this.atOccurrence=!1,this.doc=a,d=d?a.clipPos(d):p(0,0),this.pos={from:d,to:d};var j;"object"==typeof g?j=g.caseFold:(j=g,g=null),"string"==typeof b?(null==j&&(j=!1),this.matches=function(c,d){return(c?l:k)(a,b,d,j)}):(b=c(b,"gm"),g&&!1===g.multiline?this.matches=function(c,d){return(c?h:e)(a,b,d)}:this.matches=function(c,d){return(c?i:f)(a,b,d)})}var n,o,p=a.Pos;String.prototype.normalize?(n=function(a){return a.normalize("NFD").toLowerCase()},o=function(a){return a.normalize("NFD")}):(n=function(a){return a.toLowerCase()},o=function(a){return a}),m.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(b){for(var c=this.matches(b,this.doc.clipPos(b?this.pos.from:this.pos.to));c&&0==a.cmpPos(c.from,c.to);)b?c.from.ch?c.from=p(c.from.line,c.from.ch-1):c=c.from.line==this.doc.firstLine()?null:this.matches(b,this.doc.clipPos(p(c.from.line-1))):c.to.ch<this.doc.getLine(c.to.line).length?c.to=p(c.to.line,c.to.ch+1):c=c.to.line==this.doc.lastLine()?null:this.matches(b,p(c.to.line+1,0));if(c)return this.pos=c,this.atOccurrence=!0,this.pos.match||!0;var d=p(b?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:d,to:d},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(b,c){if(this.atOccurrence){var d=a.splitLines(b);this.doc.replaceRange(d,this.pos.from,this.pos.to,c),this.pos.to=p(this.pos.from.line+d.length-1,d[d.length-1].length+(1==d.length?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",(function(a,b,c){return new m(this.doc,a,b,c)})),a.defineDocExtension("getSearchCursor",(function(a,b,c){return new m(this,a,b,c)})),a.defineExtension("selectMatches",(function(b,c){for(var d=[],e=this.getSearchCursor(b,this.getCursor("from"),c);e.findNext()&&!(a.cmpPos(e.to(),this.getCursor("to"))>0);)d.push({anchor:e.from(),head:e.to()});d.length&&this.setSelections(d,0)}))}));PK f�!]��&�� � matchesonscrollbar.cssnu &1i� .CodeMirror-search-match { background: gold; border-top: 1px solid orange; border-bottom: 1px solid orange; -moz-box-sizing: border-box; box-sizing: border-box; opacity: .5; } PK f�!] ��� � search.min.jsnu &1i� !(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b){return"string"==typeof a?a=new RegExp(a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),b?"gi":"g"):a.global||(a=new RegExp(a.source,a.ignoreCase?"gi":"g")),{token:function(b){a.lastIndex=b.pos;var c=a.exec(b.string);if(c&&c.index==b.pos)return b.pos+=c[0].length||1,"searching";c?b.pos=c.index:b.skipToEnd()}}}function c(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function d(a){return a.state.search||(a.state.search=new c)}function e(a){return"string"==typeof a&&a==a.toLowerCase()}function f(a,b,c){return a.getSearchCursor(b,c,{caseFold:e(b),multiline:!0})}function g(a,b,c,d,e){a.openDialog(b,d,{value:c,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){o(a)},onKeyDown:e,bottom:a.options.search.bottom})}function h(a,b,c,d,e){a.openDialog?a.openDialog(b,e,{value:d,selectValueOnOpen:!0,bottom:a.options.search.bottom}):e(prompt(c,d))}function i(a,b,c,d){a.openConfirm?a.openConfirm(b,d):confirm(c)&&d[0]()}function j(a){return a.replace(/\\([nrt\\])/g,(function(a,b){return"n"==b?"\n":"r"==b?"\r":"t"==b?"\t":"\\"==b?"\\":a}))}function k(a){var b=a.match(/^\/(.*)\/([a-z]*)$/);if(b)try{a=new RegExp(b[1],-1==b[2].indexOf("i")?"":"i")}catch(a){}else a=j(a);return("string"==typeof a?""==a:a.test(""))&&(a=/x^/),a}function l(a,c,d){c.queryText=d,c.query=k(d),a.removeOverlay(c.overlay,e(c.query)),c.overlay=b(c.query,e(c.query)),a.addOverlay(c.overlay),a.showMatchesOnScrollbar&&(c.annotate&&(c.annotate.clear(),c.annotate=null),c.annotate=a.showMatchesOnScrollbar(c.query,e(c.query)))}function m(b,c,e,f){var i=d(b);if(i.query)return n(b,c);var j=b.getSelection()||i.lastQuery;if(j instanceof RegExp&&"x^"==j.source&&(j=null),e&&b.openDialog){var k=null,m=function(c,d){a.e_stop(d),c&&(c!=i.queryText&&(l(b,i,c),i.posFrom=i.posTo=b.getCursor()),k&&(k.style.opacity=1),n(b,d.shiftKey,(function(a,c){var d;c.line<3&&document.querySelector&&(d=b.display.wrapper.querySelector(".CodeMirror-dialog"))&&d.getBoundingClientRect().bottom-4>b.cursorCoords(c,"window").top&&((k=d).style.opacity=.4)})))};g(b,p(b),j,m,(function(c,e){var f=a.keyName(c),g=b.getOption("extraKeys"),h=g&&g[f]||a.keyMap[b.getOption("keyMap")][f];"findNext"==h||"findPrev"==h||"findPersistentNext"==h||"findPersistentPrev"==h?(a.e_stop(c),l(b,d(b),e),b.execCommand(h)):"find"!=h&&"findPersistent"!=h||(a.e_stop(c),m(e,c))})),f&&j&&(l(b,i,j),n(b,c))}else h(b,p(b),"Search for:",j,(function(a){a&&!i.query&&b.operation((function(){l(b,i,a),i.posFrom=i.posTo=b.getCursor(),n(b,c)}))}))}function n(b,c,e){b.operation((function(){var g=d(b),h=f(b,g.query,c?g.posFrom:g.posTo);(h.find(c)||(h=f(b,g.query,c?a.Pos(b.lastLine()):a.Pos(b.firstLine(),0)),h.find(c)))&&(b.setSelection(h.from(),h.to()),b.scrollIntoView({from:h.from(),to:h.to()},20),g.posFrom=h.from(),g.posTo=h.to(),e&&e(h.from(),h.to()))}))}function o(a){a.operation((function(){var b=d(a);b.lastQuery=b.query,b.query&&(b.query=b.queryText=null,a.removeOverlay(b.overlay),b.annotate&&(b.annotate.clear(),b.annotate=null))}))}function p(a){return'<span class="CodeMirror-search-label">'+a.phrase("Search:")+'</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+a.phrase("(Use /re/ syntax for regexp search)")+"</span>"}function q(a){return' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+a.phrase("(Use /re/ syntax for regexp search)")+"</span>"}function r(a){return'<span class="CodeMirror-search-label">'+a.phrase("With:")+'</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>'}function s(a){return'<span class="CodeMirror-search-label">'+a.phrase("Replace?")+"</span> <button>"+a.phrase("Yes")+"</button> <button>"+a.phrase("No")+"</button> <button>"+a.phrase("All")+"</button> <button>"+a.phrase("Stop")+"</button> "}function t(a,b,c){a.operation((function(){for(var d=f(a,b);d.findNext();)if("string"!=typeof b){var e=a.getRange(d.from(),d.to()).match(b);d.replace(c.replace(/\$(\d)/g,(function(a,b){return e[b]})))}else d.replace(c)}))}function u(a,b){if(!a.getOption("readOnly")){var c=a.getSelection()||d(a).lastQuery,e='<span class="CodeMirror-search-label">'+(b?a.phrase("Replace all:"):a.phrase("Replace:"))+"</span>";h(a,e+q(a),e,c,(function(c){c&&(c=k(c),h(a,r(a),a.phrase("Replace with:"),"",(function(d){if(d=j(d),b)t(a,c,d);else{o(a);var e=f(a,c,a.getCursor("from")),g=function(){var b,j=e.from();!(b=e.findNext())&&(e=f(a,c),!(b=e.findNext())||j&&e.from().line==j.line&&e.from().ch==j.ch)||(a.setSelection(e.from(),e.to()),a.scrollIntoView({from:e.from(),to:e.to()}),i(a,s(a),a.phrase("Replace?"),[function(){h(b)},g,function(){t(a,c,d)}]))},h=function(a){e.replace("string"==typeof c?d:d.replace(/\$(\d)/g,(function(b,c){return a[c]}))),g()};g()}})))}))}}a.defineOption("search",{bottom:!1}),a.commands.find=function(a){o(a),m(a)},a.commands.findPersistent=function(a){o(a),m(a,!1,!0)},a.commands.findPersistentNext=function(a){m(a,!1,!0,!0)},a.commands.findPersistentPrev=function(a){m(a,!0,!0,!0)},a.commands.findNext=m,a.commands.findPrev=function(a){m(a,!0)},a.commands.clearSearch=o,a.commands.replace=u,a.commands.replaceAll=function(a){u(a,!0)}}));PK f�!]�@~� � matchesonscrollbar.min.cssnu &1i� .CodeMirror-search-match{background:gold;border-top:1px solid orange;border-bottom:1px solid orange;-moz-box-sizing:border-box;box-sizing:border-box;opacity:.5}PK f�!] ��� � matchesonscrollbar.min.jsnu &1i� !(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b,c,d){this.cm=a,this.options=d;var e={listenForChanges:!1};for(var f in d)e[f]=d[f];e.className||(e.className="CodeMirror-search-match"),this.annotation=a.annotateScrollbar(e),this.query=b,this.caseFold=c,this.gap={from:a.firstLine(),to:a.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var g=this;a.on("change",this.changeHandler=function(a,b){g.onChange(b)})}function c(a,b,c){return a<=b?a:Math.max(b,a+c)}a.defineExtension("showMatchesOnScrollbar",(function(a,c,d){return"string"==typeof d&&(d={className:d}),d||(d={}),new b(this,a,c,d)}));b.prototype.findMatches=function(){if(this.gap){for(var b=0;b<this.matches.length;b++){var c=this.matches[b];if(c.from.line>=this.gap.to)break;c.to.line>=this.gap.from&&this.matches.splice(b--,1)}for(var d=this.cm.getSearchCursor(this.query,a.Pos(this.gap.from,0),{caseFold:this.caseFold,multiline:this.options.multiline}),e=this.options&&this.options.maxMatches||1e3;d.findNext();){var c={from:d.from(),to:d.to()};if(c.from.line>=this.gap.to)break;if(this.matches.splice(b++,0,c),this.matches.length>e)break}this.gap=null}},b.prototype.onChange=function(b){var d=b.from.line,e=a.changeEnd(b).line,f=e-b.to.line;if(this.gap?(this.gap.from=Math.min(c(this.gap.from,d,f),b.from.line),this.gap.to=Math.max(c(this.gap.to,d,f),b.from.line)):this.gap={from:b.from.line,to:e+1},f)for(var g=0;g<this.matches.length;g++){var h=this.matches[g],i=c(h.from.line,d,f);i!=h.from.line&&(h.from=a.Pos(i,h.from.ch));var j=c(h.to.line,d,f);j!=h.to.line&&(h.to=a.Pos(j,h.to.ch))}clearTimeout(this.update);var k=this;this.update=setTimeout((function(){k.updateAfterChange()}),250)},b.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},b.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}));PK f�!]�娩* �* search.jsnu &1i� // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: https://codemirror.net/LICENSE // Define search commands. Depends on dialog.js or another // implementation of the openDialog method. // Replace works a little oddly -- it will do the replace on the next // Ctrl-G (or whatever is bound to findNext) press. You prevent a // replace by making sure the match is no longer selected when hitting // Ctrl-G. (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("./searchcursor"), require("../dialog/dialog")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror", "./searchcursor", "../dialog/dialog"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; // default search panel location CodeMirror.defineOption("search", {bottom: false}); function searchOverlay(query, caseInsensitive) { if (typeof query == "string") query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g"); else if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "gi" : "g"); return {token: function(stream) { query.lastIndex = stream.pos; var match = query.exec(stream.string); if (match && match.index == stream.pos) { stream.pos += match[0].length || 1; return "searching"; } else if (match) { stream.pos = match.index; } else { stream.skipToEnd(); } }}; } function SearchState() { this.posFrom = this.posTo = this.lastQuery = this.query = null; this.overlay = null; } function getSearchState(cm) { return cm.state.search || (cm.state.search = new SearchState()); } function queryCaseInsensitive(query) { return typeof query == "string" && query == query.toLowerCase(); } function getSearchCursor(cm, query, pos) { // Heuristic: if the query string is all lowercase, do a case insensitive search. return cm.getSearchCursor(query, pos, {caseFold: queryCaseInsensitive(query), multiline: true}); } function persistentDialog(cm, text, deflt, onEnter, onKeyDown) { cm.openDialog(text, onEnter, { value: deflt, selectValueOnOpen: true, closeOnEnter: false, onClose: function() { clearSearch(cm); }, onKeyDown: onKeyDown, bottom: cm.options.search.bottom }); } function dialog(cm, text, shortText, deflt, f) { if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom}); else f(prompt(shortText, deflt)); } function confirmDialog(cm, text, shortText, fs) { if (cm.openConfirm) cm.openConfirm(text, fs); else if (confirm(shortText)) fs[0](); } function parseString(string) { return string.replace(/\\([nrt\\])/g, function(match, ch) { if (ch == "n") return "\n" if (ch == "r") return "\r" if (ch == "t") return "\t" if (ch == "\\") return "\\" return match }) } function parseQuery(query) { var isRE = query.match(/^\/(.*)\/([a-z]*)$/); if (isRE) { try { query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); } catch(e) {} // Not a regular expression after all, do a string search } else { query = parseString(query) } if (typeof query == "string" ? query == "" : query.test("")) query = /x^/; return query; } function startSearch(cm, state, query) { state.queryText = query; state.query = parseQuery(query); cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query)); state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query)); cm.addOverlay(state.overlay); if (cm.showMatchesOnScrollbar) { if (state.annotate) { state.annotate.clear(); state.annotate = null; } state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query)); } } function doSearch(cm, rev, persistent, immediate) { var state = getSearchState(cm); if (state.query) return findNext(cm, rev); var q = cm.getSelection() || state.lastQuery; if (q instanceof RegExp && q.source == "x^") q = null if (persistent && cm.openDialog) { var hiding = null var searchNext = function(query, event) { CodeMirror.e_stop(event); if (!query) return; if (query != state.queryText) { startSearch(cm, state, query); state.posFrom = state.posTo = cm.getCursor(); } if (hiding) hiding.style.opacity = 1 findNext(cm, event.shiftKey, function(_, to) { var dialog if (to.line < 3 && document.querySelector && (dialog = cm.display.wrapper.querySelector(".CodeMirror-dialog")) && dialog.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, "window").top) (hiding = dialog).style.opacity = .4 }) }; persistentDialog(cm, getQueryDialog(cm), q, searchNext, function(event, query) { var keyName = CodeMirror.keyName(event) var extra = cm.getOption('extraKeys'), cmd = (extra && extra[keyName]) || CodeMirror.keyMap[cm.getOption("keyMap")][keyName] if (cmd == "findNext" || cmd == "findPrev" || cmd == "findPersistentNext" || cmd == "findPersistentPrev") { CodeMirror.e_stop(event); startSearch(cm, getSearchState(cm), query); cm.execCommand(cmd); } else if (cmd == "find" || cmd == "findPersistent") { CodeMirror.e_stop(event); searchNext(query, event); } }); if (immediate && q) { startSearch(cm, state, q); findNext(cm, rev); } } else { dialog(cm, getQueryDialog(cm), "Search for:", q, function(query) { if (query && !state.query) cm.operation(function() { startSearch(cm, state, query); state.posFrom = state.posTo = cm.getCursor(); findNext(cm, rev); }); }); } } function findNext(cm, rev, callback) {cm.operation(function() { var state = getSearchState(cm); var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo); if (!cursor.find(rev)) { cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0)); if (!cursor.find(rev)) return; } cm.setSelection(cursor.from(), cursor.to()); cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20); state.posFrom = cursor.from(); state.posTo = cursor.to(); if (callback) callback(cursor.from(), cursor.to()) });} function clearSearch(cm) {cm.operation(function() { var state = getSearchState(cm); state.lastQuery = state.query; if (!state.query) return; state.query = state.queryText = null; cm.removeOverlay(state.overlay); if (state.annotate) { state.annotate.clear(); state.annotate = null; } });} function getQueryDialog(cm) { return '<span class="CodeMirror-search-label">' + cm.phrase("Search:") + '</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">' + cm.phrase("(Use /re/ syntax for regexp search)") + '</span>'; } function getReplaceQueryDialog(cm) { return ' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">' + cm.phrase("(Use /re/ syntax for regexp search)") + '</span>'; } function getReplacementQueryDialog(cm) { return '<span class="CodeMirror-search-label">' + cm.phrase("With:") + '</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>'; } function getDoReplaceConfirm(cm) { return '<span class="CodeMirror-search-label">' + cm.phrase("Replace?") + '</span> <button>' + cm.phrase("Yes") + '</button> <button>' + cm.phrase("No") + '</button> <button>' + cm.phrase("All") + '</button> <button>' + cm.phrase("Stop") + '</button> '; } function replaceAll(cm, query, text) { cm.operation(function() { for (var cursor = getSearchCursor(cm, query); cursor.findNext();) { if (typeof query != "string") { var match = cm.getRange(cursor.from(), cursor.to()).match(query); cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];})); } else cursor.replace(text); } }); } function replace(cm, all) { if (cm.getOption("readOnly")) return; var query = cm.getSelection() || getSearchState(cm).lastQuery; var dialogText = '<span class="CodeMirror-search-label">' + (all ? cm.phrase("Replace all:") : cm.phrase("Replace:")) + '</span>'; dialog(cm, dialogText + getReplaceQueryDialog(cm), dialogText, query, function(query) { if (!query) return; query = parseQuery(query); dialog(cm, getReplacementQueryDialog(cm), cm.phrase("Replace with:"), "", function(text) { text = parseString(text) if (all) { replaceAll(cm, query, text) } else { clearSearch(cm); var cursor = getSearchCursor(cm, query, cm.getCursor("from")); var advance = function() { var start = cursor.from(), match; if (!(match = cursor.findNext())) { cursor = getSearchCursor(cm, query); if (!(match = cursor.findNext()) || (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return; } cm.setSelection(cursor.from(), cursor.to()); cm.scrollIntoView({from: cursor.from(), to: cursor.to()}); confirmDialog(cm, getDoReplaceConfirm(cm), cm.phrase("Replace?"), [function() {doReplace(match);}, advance, function() {replaceAll(cm, query, text)}]); }; var doReplace = function(match) { cursor.replace(typeof query == "string" ? text : text.replace(/\$(\d)/g, function(_, i) {return match[i];})); advance(); }; advance(); } }); }); } CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);}; CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);}; CodeMirror.commands.findPersistentNext = function(cm) {doSearch(cm, false, true, true);}; CodeMirror.commands.findPersistentPrev = function(cm) {doSearch(cm, true, true, true);}; CodeMirror.commands.findNext = doSearch; CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);}; CodeMirror.commands.clearSearch = clearSearch; CodeMirror.commands.replace = replace; CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);}; }); PK f�!]C��F�/ �/ searchcursor.jsnu &1i� // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")) else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod) else // Plain browser env mod(CodeMirror) })(function(CodeMirror) { "use strict" var Pos = CodeMirror.Pos function regexpFlags(regexp) { var flags = regexp.flags return flags != null ? flags : (regexp.ignoreCase ? "i" : "") + (regexp.global ? "g" : "") + (regexp.multiline ? "m" : "") } function ensureFlags(regexp, flags) { var current = regexpFlags(regexp), target = current for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1) target += flags.charAt(i) return current == target ? regexp : new RegExp(regexp.source, target) } function maybeMultiline(regexp) { return /\\s|\\n|\n|\\W|\\D|\[\^/.test(regexp.source) } function searchRegexpForward(doc, regexp, start) { regexp = ensureFlags(regexp, "g") for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) { regexp.lastIndex = ch var string = doc.getLine(line), match = regexp.exec(string) if (match) return {from: Pos(line, match.index), to: Pos(line, match.index + match[0].length), match: match} } } function searchRegexpForwardMultiline(doc, regexp, start) { if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start) regexp = ensureFlags(regexp, "gm") var string, chunk = 1 for (var line = start.line, last = doc.lastLine(); line <= last;) { // This grows the search buffer in exponentially-sized chunks // between matches, so that nearby matches are fast and don't // require concatenating the whole document (in case we're // searching for something that has tons of matches), but at the // same time, the amount of retries is limited. for (var i = 0; i < chunk; i++) { if (line > last) break var curLine = doc.getLine(line++) string = string == null ? curLine : string + "\n" + curLine } chunk = chunk * 2 regexp.lastIndex = start.ch var match = regexp.exec(string) if (match) { var before = string.slice(0, match.index).split("\n"), inside = match[0].split("\n") var startLine = start.line + before.length - 1, startCh = before[before.length - 1].length return {from: Pos(startLine, startCh), to: Pos(startLine + inside.length - 1, inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length), match: match} } } } function lastMatchIn(string, regexp, endMargin) { var match, from = 0 while (from <= string.length) { regexp.lastIndex = from var newMatch = regexp.exec(string) if (!newMatch) break var end = newMatch.index + newMatch[0].length if (end > string.length - endMargin) break if (!match || end > match.index + match[0].length) match = newMatch from = newMatch.index + 1 } return match } function searchRegexpBackward(doc, regexp, start) { regexp = ensureFlags(regexp, "g") for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) { var string = doc.getLine(line) var match = lastMatchIn(string, regexp, ch < 0 ? 0 : string.length - ch) if (match) return {from: Pos(line, match.index), to: Pos(line, match.index + match[0].length), match: match} } } function searchRegexpBackwardMultiline(doc, regexp, start) { if (!maybeMultiline(regexp)) return searchRegexpBackward(doc, regexp, start) regexp = ensureFlags(regexp, "gm") var string, chunkSize = 1, endMargin = doc.getLine(start.line).length - start.ch for (var line = start.line, first = doc.firstLine(); line >= first;) { for (var i = 0; i < chunkSize && line >= first; i++) { var curLine = doc.getLine(line--) string = string == null ? curLine : curLine + "\n" + string } chunkSize *= 2 var match = lastMatchIn(string, regexp, endMargin) if (match) { var before = string.slice(0, match.index).split("\n"), inside = match[0].split("\n") var startLine = line + before.length, startCh = before[before.length - 1].length return {from: Pos(startLine, startCh), to: Pos(startLine + inside.length - 1, inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length), match: match} } } } var doFold, noFold if (String.prototype.normalize) { doFold = function(str) { return str.normalize("NFD").toLowerCase() } noFold = function(str) { return str.normalize("NFD") } } else { doFold = function(str) { return str.toLowerCase() } noFold = function(str) { return str } } // Maps a position in a case-folded line back to a position in the original line // (compensating for codepoints increasing in number during folding) function adjustPos(orig, folded, pos, foldFunc) { if (orig.length == folded.length) return pos for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) { if (min == max) return min var mid = (min + max) >> 1 var len = foldFunc(orig.slice(0, mid)).length if (len == pos) return mid else if (len > pos) max = mid else min = mid + 1 } } function searchStringForward(doc, query, start, caseFold) { // Empty string would match anything and never progress, so we // define it to match nothing instead. if (!query.length) return null var fold = caseFold ? doFold : noFold var lines = fold(query).split(/\r|\n\r?/) search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) { var orig = doc.getLine(line).slice(ch), string = fold(orig) if (lines.length == 1) { var found = string.indexOf(lines[0]) if (found == -1) continue search var start = adjustPos(orig, string, found, fold) + ch return {from: Pos(line, adjustPos(orig, string, found, fold) + ch), to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch)} } else { var cutFrom = string.length - lines[0].length if (string.slice(cutFrom) != lines[0]) continue search for (var i = 1; i < lines.length - 1; i++) if (fold(doc.getLine(line + i)) != lines[i]) continue search var end = doc.getLine(line + lines.length - 1), endString = fold(end), lastLine = lines[lines.length - 1] if (endString.slice(0, lastLine.length) != lastLine) continue search return {from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch), to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold))} } } } function searchStringBackward(doc, query, start, caseFold) { if (!query.length) return null var fold = caseFold ? doFold : noFold var lines = fold(query).split(/\r|\n\r?/) search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) { var orig = doc.getLine(line) if (ch > -1) orig = orig.slice(0, ch) var string = fold(orig) if (lines.length == 1) { var found = string.lastIndexOf(lines[0]) if (found == -1) continue search return {from: Pos(line, adjustPos(orig, string, found, fold)), to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold))} } else { var lastLine = lines[lines.length - 1] if (string.slice(0, lastLine.length) != lastLine) continue search for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++) if (fold(doc.getLine(start + i)) != lines[i]) continue search var top = doc.getLine(line + 1 - lines.length), topString = fold(top) if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search return {from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)), to: Pos(line, adjustPos(orig, string, lastLine.length, fold))} } } } function SearchCursor(doc, query, pos, options) { this.atOccurrence = false this.doc = doc pos = pos ? doc.clipPos(pos) : Pos(0, 0) this.pos = {from: pos, to: pos} var caseFold if (typeof options == "object") { caseFold = options.caseFold } else { // Backwards compat for when caseFold was the 4th argument caseFold = options options = null } if (typeof query == "string") { if (caseFold == null) caseFold = false this.matches = function(reverse, pos) { return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold) } } else { query = ensureFlags(query, "gm") if (!options || options.multiline !== false) this.matches = function(reverse, pos) { return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos) } else this.matches = function(reverse, pos) { return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos) } } } SearchCursor.prototype = { findNext: function() {return this.find(false)}, findPrevious: function() {return this.find(true)}, find: function(reverse) { var result = this.matches(reverse, this.doc.clipPos(reverse ? this.pos.from : this.pos.to)) // Implements weird auto-growing behavior on null-matches for // backwards-compatibility with the vim code (unfortunately) while (result && CodeMirror.cmpPos(result.from, result.to) == 0) { if (reverse) { if (result.from.ch) result.from = Pos(result.from.line, result.from.ch - 1) else if (result.from.line == this.doc.firstLine()) result = null else result = this.matches(reverse, this.doc.clipPos(Pos(result.from.line - 1))) } else { if (result.to.ch < this.doc.getLine(result.to.line).length) result.to = Pos(result.to.line, result.to.ch + 1) else if (result.to.line == this.doc.lastLine()) result = null else result = this.matches(reverse, Pos(result.to.line + 1, 0)) } } if (result) { this.pos = result this.atOccurrence = true return this.pos.match || true } else { var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0) this.pos = {from: end, to: end} return this.atOccurrence = false } }, from: function() {if (this.atOccurrence) return this.pos.from}, to: function() {if (this.atOccurrence) return this.pos.to}, replace: function(newText, origin) { if (!this.atOccurrence) return var lines = CodeMirror.splitLines(newText) this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin) this.pos.to = Pos(this.pos.from.line + lines.length - 1, lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0)) } } CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) { return new SearchCursor(this.doc, query, pos, caseFold) }) CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) { return new SearchCursor(this, query, pos, caseFold) }) CodeMirror.defineExtension("selectMatches", function(query, caseFold) { var ranges = [] var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold) while (cur.findNext()) { if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break ranges.push({anchor: cur.from(), head: cur.to()}) } if (ranges.length) this.setSelections(ranges, 0) }) }); PK f�!]��� matchesonscrollbar.jsnu &1i� // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("./searchcursor"), require("../scroll/annotatescrollbar")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror", "./searchcursor", "../scroll/annotatescrollbar"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineExtension("showMatchesOnScrollbar", function(query, caseFold, options) { if (typeof options == "string") options = {className: options}; if (!options) options = {}; return new SearchAnnotation(this, query, caseFold, options); }); function SearchAnnotation(cm, query, caseFold, options) { this.cm = cm; this.options = options; var annotateOptions = {listenForChanges: false}; for (var prop in options) annotateOptions[prop] = options[prop]; if (!annotateOptions.className) annotateOptions.className = "CodeMirror-search-match"; this.annotation = cm.annotateScrollbar(annotateOptions); this.query = query; this.caseFold = caseFold; this.gap = {from: cm.firstLine(), to: cm.lastLine() + 1}; this.matches = []; this.update = null; this.findMatches(); this.annotation.update(this.matches); var self = this; cm.on("change", this.changeHandler = function(_cm, change) { self.onChange(change); }); } var MAX_MATCHES = 1000; SearchAnnotation.prototype.findMatches = function() { if (!this.gap) return; for (var i = 0; i < this.matches.length; i++) { var match = this.matches[i]; if (match.from.line >= this.gap.to) break; if (match.to.line >= this.gap.from) this.matches.splice(i--, 1); } var cursor = this.cm.getSearchCursor(this.query, CodeMirror.Pos(this.gap.from, 0), {caseFold: this.caseFold, multiline: this.options.multiline}); var maxMatches = this.options && this.options.maxMatches || MAX_MATCHES; while (cursor.findNext()) { var match = {from: cursor.from(), to: cursor.to()}; if (match.from.line >= this.gap.to) break; this.matches.splice(i++, 0, match); if (this.matches.length > maxMatches) break; } this.gap = null; }; function offsetLine(line, changeStart, sizeChange) { if (line <= changeStart) return line; return Math.max(changeStart, line + sizeChange); } SearchAnnotation.prototype.onChange = function(change) { var startLine = change.from.line; var endLine = CodeMirror.changeEnd(change).line; var sizeChange = endLine - change.to.line; if (this.gap) { this.gap.from = Math.min(offsetLine(this.gap.from, startLine, sizeChange), change.from.line); this.gap.to = Math.max(offsetLine(this.gap.to, startLine, sizeChange), change.from.line); } else { this.gap = {from: change.from.line, to: endLine + 1}; } if (sizeChange) for (var i = 0; i < this.matches.length; i++) { var match = this.matches[i]; var newFrom = offsetLine(match.from.line, startLine, sizeChange); if (newFrom != match.from.line) match.from = CodeMirror.Pos(newFrom, match.from.ch); var newTo = offsetLine(match.to.line, startLine, sizeChange); if (newTo != match.to.line) match.to = CodeMirror.Pos(newTo, match.to.ch); } clearTimeout(this.update); var self = this; this.update = setTimeout(function() { self.updateAfterChange(); }, 250); }; SearchAnnotation.prototype.updateAfterChange = function() { this.findMatches(); this.annotation.update(this.matches); }; SearchAnnotation.prototype.clear = function() { this.cm.off("change", this.changeHandler); this.annotation.clear(); }; }); PK f�!]+��)F F match-highlighter.jsnu &1i� // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: https://codemirror.net/LICENSE // Highlighting text that matches the selection // // Defines an option highlightSelectionMatches, which, when enabled, // will style strings that match the selection throughout the // document. // // The option can be set to true to simply enable it, or to a // {minChars, style, wordsOnly, showToken, delay} object to explicitly // configure it. minChars is the minimum amount of characters that should be // selected for the behavior to occur, and style is the token style to // apply to the matches. This will be prefixed by "cm-" to create an // actual CSS class name. If wordsOnly is enabled, the matches will be // highlighted only if the selected text is a word. showToken, when enabled, // will cause the current token to be highlighted when nothing is selected. // delay is used to specify how much time to wait, in milliseconds, before // highlighting the matches. If annotateScrollbar is enabled, the occurrences // will be highlighted on the scrollbar via the matchesonscrollbar addon. (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("./matchesonscrollbar")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror", "./matchesonscrollbar"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; var defaults = { style: "matchhighlight", minChars: 2, delay: 100, wordsOnly: false, annotateScrollbar: false, showToken: false, trim: true } function State(options) { this.options = {} for (var name in defaults) this.options[name] = (options && options.hasOwnProperty(name) ? options : defaults)[name] this.overlay = this.timeout = null; this.matchesonscroll = null; this.active = false; } CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) { if (old && old != CodeMirror.Init) { removeOverlay(cm); clearTimeout(cm.state.matchHighlighter.timeout); cm.state.matchHighlighter = null; cm.off("cursorActivity", cursorActivity); cm.off("focus", onFocus) } if (val) { var state = cm.state.matchHighlighter = new State(val); if (cm.hasFocus()) { state.active = true highlightMatches(cm) } else { cm.on("focus", onFocus) } cm.on("cursorActivity", cursorActivity); } }); function cursorActivity(cm) { var state = cm.state.matchHighlighter; if (state.active || cm.hasFocus()) scheduleHighlight(cm, state) } function onFocus(cm) { var state = cm.state.matchHighlighter if (!state.active) { state.active = true scheduleHighlight(cm, state) } } function scheduleHighlight(cm, state) { clearTimeout(state.timeout); state.timeout = setTimeout(function() {highlightMatches(cm);}, state.options.delay); } function addOverlay(cm, query, hasBoundary, style) { var state = cm.state.matchHighlighter; cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style)); if (state.options.annotateScrollbar && cm.showMatchesOnScrollbar) { var searchFor = hasBoundary ? new RegExp((/\w/.test(query.charAt(0)) ? "\\b" : "") + query.replace(/[\\\[.+*?(){|^$]/g, "\\$&") + (/\w/.test(query.charAt(query.length - 1)) ? "\\b" : "")) : query; state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, false, {className: "CodeMirror-selection-highlight-scrollbar"}); } } function removeOverlay(cm) { var state = cm.state.matchHighlighter; if (state.overlay) { cm.removeOverlay(state.overlay); state.overlay = null; if (state.matchesonscroll) { state.matchesonscroll.clear(); state.matchesonscroll = null; } } } function highlightMatches(cm) { cm.operation(function() { var state = cm.state.matchHighlighter; removeOverlay(cm); if (!cm.somethingSelected() && state.options.showToken) { var re = state.options.showToken === true ? /[\w$]/ : state.options.showToken; var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start; while (start && re.test(line.charAt(start - 1))) --start; while (end < line.length && re.test(line.charAt(end))) ++end; if (start < end) addOverlay(cm, line.slice(start, end), re, state.options.style); return; } var from = cm.getCursor("from"), to = cm.getCursor("to"); if (from.line != to.line) return; if (state.options.wordsOnly && !isWord(cm, from, to)) return; var selection = cm.getRange(from, to) if (state.options.trim) selection = selection.replace(/^\s+|\s+$/g, "") if (selection.length >= state.options.minChars) addOverlay(cm, selection, false, state.options.style); }); } function isWord(cm, from, to) { var str = cm.getRange(from, to); if (str.match(/^\w+$/) !== null) { if (from.ch > 0) { var pos = {line: from.line, ch: from.ch - 1}; var chr = cm.getRange(pos, from); if (chr.match(/\W/) === null) return false; } if (to.ch < cm.getLine(from.line).length) { var pos = {line: to.line, ch: to.ch + 1}; var chr = cm.getRange(to, pos); if (chr.match(/\W/) === null) return false; } return true; } else return false; } function boundariesAround(stream, re) { return (!stream.start || !re.test(stream.string.charAt(stream.start - 1))) && (stream.pos == stream.string.length || !re.test(stream.string.charAt(stream.pos))); } function makeOverlay(query, hasBoundary, style) { return {token: function(stream) { if (stream.match(query) && (!hasBoundary || boundariesAround(stream, hasBoundary))) return style; stream.next(); stream.skipTo(query.charAt(0)) || stream.skipToEnd(); }}; } }); PK f�!]p)u:� � match-highlighter.min.jsnu &1i� !(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./matchesonscrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./matchesonscrollbar"],a):a(CodeMirror)})((function(a){"use strict";function b(a){this.options={};for(var b in l)this.options[b]=(a&&a.hasOwnProperty(b)?a:l)[b];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}function c(a){var b=a.state.matchHighlighter;(b.active||a.hasFocus())&&e(a,b)}function d(a){var b=a.state.matchHighlighter;b.active||(b.active=!0,e(a,b))}function e(a,b){clearTimeout(b.timeout),b.timeout=setTimeout((function(){h(a)}),b.options.delay)}function f(a,b,c,d){var e=a.state.matchHighlighter;if(a.addOverlay(e.overlay=k(b,c,d)),e.options.annotateScrollbar&&a.showMatchesOnScrollbar){var f=c?new RegExp((/\w/.test(b.charAt(0))?"\\b":"")+b.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+(/\w/.test(b.charAt(b.length-1))?"\\b":"")):b;e.matchesonscroll=a.showMatchesOnScrollbar(f,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function g(a){var b=a.state.matchHighlighter;b.overlay&&(a.removeOverlay(b.overlay),b.overlay=null,b.matchesonscroll&&(b.matchesonscroll.clear(),b.matchesonscroll=null))}function h(a){a.operation((function(){var b=a.state.matchHighlighter;if(g(a),!a.somethingSelected()&&b.options.showToken){for(var c=!0===b.options.showToken?/[\w$]/:b.options.showToken,d=a.getCursor(),e=a.getLine(d.line),h=d.ch,j=h;h&&c.test(e.charAt(h-1));)--h;for(;j<e.length&&c.test(e.charAt(j));)++j;return void(h<j&&f(a,e.slice(h,j),c,b.options.style))}var k=a.getCursor("from"),l=a.getCursor("to");if(k.line==l.line&&(!b.options.wordsOnly||i(a,k,l))){var m=a.getRange(k,l);b.options.trim&&(m=m.replace(/^\s+|\s+$/g,"")),m.length>=b.options.minChars&&f(a,m,!1,b.options.style)}}))}function i(a,b,c){if(null!==a.getRange(b,c).match(/^\w+$/)){if(b.ch>0){var d={line:b.line,ch:b.ch-1},e=a.getRange(d,b);if(null===e.match(/\W/))return!1}if(c.ch<a.getLine(b.line).length){var d={line:c.line,ch:c.ch+1},e=a.getRange(c,d);if(null===e.match(/\W/))return!1}return!0}return!1}function j(a,b){return!(a.start&&b.test(a.string.charAt(a.start-1))||a.pos!=a.string.length&&b.test(a.string.charAt(a.pos)))}function k(a,b,c){return{token:function(d){if(d.match(a)&&(!b||j(d,b)))return c;d.next(),d.skipTo(a.charAt(0))||d.skipToEnd()}}}var l={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};a.defineOption("highlightSelectionMatches",!1,(function(e,f,i){if(i&&i!=a.Init&&(g(e),clearTimeout(e.state.matchHighlighter.timeout),e.state.matchHighlighter=null,e.off("cursorActivity",c),e.off("focus",d)),f){var j=e.state.matchHighlighter=new b(f);e.hasFocus()?(j.active=!0,h(e)):e.on("focus",d),e.on("cursorActivity",c)}}))}));PK ��!]����7 7 link.phpnu &1i� <?php /** * @package JCE * @subpackage Editor * * @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. * @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE.txt */ \defined('_JEXEC') or die; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Filter\InputFilter; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Uri\Uri; use Joomla\String\StringHelper; class WFLinkSearchExtension extends WFSearchExtension { private $enabled = array(); protected function loadDefaultAdapter($plugin) { $app = Factory::getApplication(); // create component name from plugin - special case for "contacts" $component = ($plugin == 'contacts') ? 'com_contact' : 'com_' . $plugin; // check for associated component if (!ComponentHelper::isEnabled($component)) { return; } $adapter = __DIR__ . '/adapter/' . $plugin . '/' . $plugin . '.php'; if (!is_file($adapter)) { return; } require_once $adapter; // create classname, eg: PlgSearchContent $className = 'PlgWfSearch' . ucfirst($plugin); if (!class_exists($className)) { return; } // simple plugin config $config = array( 'name' => $plugin, 'type' => 'search', 'params' => array( 'search_limit' => 10, ), ); // Joomla 4+ if (method_exists($app, 'getDispatcher')) { $dispatcher = $app->getDispatcher(); $instance = new $className($dispatcher, (array) $config); $instance->registerListeners(); } else { $dispatcher = JEventDispatcher::getInstance(); $instance = new $className($dispatcher, (array) $config); } $this->enabled[] = $plugin; } /** * Constructor activating the default information of the class. */ public function __construct() { parent::__construct(); $request = WFRequest::getInstance(); $request->setRequest(array($this, 'doSearch')); $request->setRequest(array($this, 'getAreas')); $wf = WFEditorPlugin::getInstance(); // get plugins $plugins = $wf->getParam('search.link.plugins', array()); // set defaults if empty if (empty($plugins)) { $plugins = array('categories', 'contacts', 'content', 'tags'); } // list core adapters $adapters = array('categories', 'contacts', 'content', 'tags', 'weblinks'); // check and load external search plugins foreach ($plugins as $plugin) { // process core search plugins if (in_array($plugin, $adapters)) { $this->loadDefaultAdapter($plugin); continue; } // plugin must be enabled if (!PluginHelper::isEnabled('search', $plugin)) { continue; } // check plugin imports correctly - plugin may have a db entry, but is missing files if (PluginHelper::importPlugin('search', $plugin)) { $this->enabled[] = $plugin; } } PluginHelper::importPlugin('jce'); } public function display() { parent::display(); $document = WFDocument::getInstance(); $document->addScript(array('link'), 'extensions.search.js'); $document->addStylesheet(array('link'), 'extensions.search.css'); } public function isEnabled() { $wf = WFEditorPlugin::getInstance(); return (bool) $wf->getParam('search.link.enable', 1) && !empty($this->enabled); } /** * Method to get the search areas. */ public function getAreas() { $app = Factory::getApplication('site'); $areas = array(); $results = array(); $searchareas = $app->triggerEvent('onContentSearchAreas'); foreach ($searchareas as $area) { if (is_array($area)) { $areas = array_merge($areas, $area); } } foreach ($areas as $k => $v) { $results[$k] = Text::_($v); } return $results; } /* * Truncate search text * This method uses portions of components/com_finder/views/search/tmpl/default_result.php * @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. */ private function truncateText($text, $searchword) { // Calculate number of characters to display around the result $term_length = StringHelper::strlen($searchword); $lang = Factory::getLanguage(); $desc_length = $lang->getSearchDisplayedCharactersNumber(); $pad_length = $term_length < $desc_length ? (int) floor(($desc_length - $term_length) / 2) : 0; // Find the position of the search term $pos = $term_length ? StringHelper::strpos(StringHelper::strtolower($text), StringHelper::strtolower($searchword)) : false; // Find a potential start point $start = ($pos && $pos > $pad_length) ? $pos - $pad_length : 0; // Find a space between $start and $pos, start right after it. $space = StringHelper::strpos($text, ' ', $start > 0 ? $start - 1 : 0); $start = ($space && $space < $pos) ? $space + 1 : $start; $text = HTMLHelper::_('string.truncate', StringHelper::substr($text, $start), $desc_length, false); return $text; } /* * Prepare search content by clean and truncating * This method uses portions of SearchHelper::prepareSearchContent from administrator/components/com_search/helpers/search.php * @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. */ public function prepareSearchContent($text, $searchword) { // Replace line breaking tags with whitespace. $text = preg_replace("'<(br[^/>]*?/|hr[^/>]*?/|/(div|h[1-6]|li|p|td))>'si", ' ', $text); // clean text $text = htmlspecialchars(strip_tags($text)); // remove shortcode $text = preg_replace('#{.+?}#', '', $text); // truncate text based around searchword $text = $this->truncateText($text, $searchword); // highlight searchword $text = preg_replace('#\b(' . preg_quote($searchword, '#') . ')\b#i', '<mark>$1</mark>', $text); return $text; } /* * Render Search fields * This method uses portions of SearchViewSearch::display from components/com_search/views/search/view.html.php * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. */ public function render() { if (!$this->isEnabled()) { return ''; } // built select lists $orders = array(); $orders[] = HTMLHelper::_('select.option', 'newest', Text::_('WF_SEARCH_NEWEST_FIRST')); $orders[] = HTMLHelper::_('select.option', 'oldest', Text::_('WF_SEARCH_OLDEST_FIRST')); $orders[] = HTMLHelper::_('select.option', 'popular', Text::_('WF_SEARCH_MOST_POPULAR')); $orders[] = HTMLHelper::_('select.option', 'alpha', Text::_('WF_SEARCH_ALPHABETICAL')); $orders[] = HTMLHelper::_('select.option', 'category', Text::_('WF_CATEGORY')); $lists = array(); $lists['ordering'] = HTMLHelper::_('select.genericlist', $orders, 'ordering', 'class="inputbox"', 'value', 'text'); $searchphrases = array(); $searchphrases[] = HTMLHelper::_('select.option', 'all', Text::_('WF_SEARCH_ALL_WORDS')); $searchphrases[] = HTMLHelper::_('select.option', 'any', Text::_('WF_SEARCH_ANY_WORDS')); $searchphrases[] = HTMLHelper::_('select.option', 'exact', Text::_('WF_SEARCH_EXACT_PHRASE')); $lists['searchphrase'] = HTMLHelper::_('select.radiolist', $searchphrases, 'searchphrase', '', 'value', 'text', 'all'); $view = $this->getView(array('name' => 'search', 'layout' => 'search')); $view->searchareas = self::getAreas(); $view->lists = $lists; $view->display(); } private static function getSearchAreaFromUrl($url) { $query = parse_url($url, PHP_URL_QUERY); if (empty($query)) { return ""; } parse_str($query, $values); if (!array_key_exists('option', $values)) { return ""; } $language = Factory::getLanguage(); $option = $values['option']; // load system language file $language->load($option . '.sys', JPATH_ADMINISTRATOR); $language->load($option, JPATH_ADMINISTRATOR); return Text::_($option); } /** * Process search. * * @param type $query Search query * @return array Search Results * * This method uses portions of SearchController::search from components/com_search/controller.php * * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved */ public function doSearch($query) { $wf = WFEditorPlugin::getInstance(); $results = array(); if (empty($query)) { return $results; } // search area $area = null; // available search areas $areas = $this->getAreas(); // query using a specific plugin if (strpos($query, ':') !== false) { preg_match('#^(' . implode('|', $areas) . ')\:(.+)#', $query, $matches); if ($matches) { $area = array($matches[1]); $query = $matches[2]; } } $app = Factory::getApplication('site'); $filter = InputFilter::getInstance(); $limit = (int) $wf->getParam('search.link.limit', 50); // slashes cause errors, <> get stripped anyway later on. # causes problems. $searchword = trim(str_replace(array('#', '>', '<', '\\'), '', $filter->clean($query))); $ordering = null; $searchphrase = 'all'; // if searchword enclosed in double quotes, strip quotes and do exact match if (substr($searchword, 0, 1) == '"' && substr($searchword, -1) == '"') { $searchword = substr($searchword, 1, -1); $searchphrase = 'exact'; } $searchphrase = $app->input->post->getWord('searchphrase', $searchphrase); // get passed through ordering $ordering = $app->input->post->getWord('ordering', $ordering); // get passed through area $area = $app->input->post->getCmd('areas', (array) $area); if (empty($area)) { $area = null; } // trigger search on loaded plugins $searches = $app->triggerEvent('onContentSearch', array( $searchword, $searchphrase, $ordering, $area, )); $rows = array(); foreach ($searches as $search) { $rows = array_merge((array) $rows, (array) $search); } // get first 10 $rows = array_slice($rows, 0, $limit); $areas = array(); for ($i = 0, $count = count($rows); $i < $count; ++$i) { $row = &$rows[$i]; if (empty($row->href) || empty($row->title)) { continue; } $area = isset($row->section) ? $row->section : self::getSearchAreaFromUrl($row->href); if (!isset($areas[$area])) { $areas[$area] = array(); } $result = new StdClass; if ($searchphrase == 'exact') { $searchwords = array($searchword); $needle = $searchword; } else { $searchworda = preg_replace('#\xE3\x80\x80#s', ' ', $searchword); $searchwords = preg_split("/\s+/u", $searchworda); $needle = $searchwords[0]; } // get anchors if any... $row->anchors = self::getAnchors($row->text); // prepare and truncate search text $row->text = $this->prepareSearchContent($row->text, $needle); // remove base url if (Uri::base(true) && strpos($row->href, Uri::base(true)) !== false) { $row->href = substr_replace($row->href, '', 0, strlen(Uri::base(true)) + 1); } // remove the alias or ItemId from a link $row->href = self::route($row->href); $result->title = $row->title; $result->text = $row->text; $result->link = $row->href; if (!empty($row->anchors)) { $result->anchors = $row->anchors; } $areas[$area][] = $result; } if (!empty($areas)) { $results[] = $areas; } return $results; } private static function route($url) { $wf = WFEditorPlugin::getInstance(); // remove link alias if ((bool) $wf->getParam('search.link.remove_alias', 0)) { $url = WFLinkHelper::removeAlias($url); } // remove Itemid if "home" $url = WFLinkHelper::removeHomeItemId($url); // remove Itemid if set if ((bool) $wf->getParam('search.link.itemid', 1) === false) { $url = WFLinkHelper::removeItemId($url); } return $url; } private static function getAnchors($content) { preg_match_all('#<a([^>]+)(name|id)="([a-z]+[\w\-\:\.]*)"([^>]*)>#i', $content, $matches, PREG_SET_ORDER); $anchors = array(); if (!empty($matches)) { foreach ($matches as $match) { if (strpos($match[0], 'href') === false) { $anchors[] = $match[3]; } } } return $anchors; } } PK ��!]�#o, , index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK ��!]��cE] ] link.xmlnu &1i� <?xml version="1.0" ?> <extension version="3.4" type="plugin" group="jce" method="upgrade"> <name>WF_LINK_SEARCH_TITLE</name> <version>2.9.99.2</version> <creationDate>22-04-2026</creationDate> <author>Ryan Demmer</author> <authorEmail>info@joomlacontenteditor.net</authorEmail> <authorUrl>https://www.joomlacontenteditor.net/</authorUrl> <copyright>Copyright (C) 2006 - 2026 Ryan Demmer. All rights reserved</copyright> <license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license> <description>WF_LINK_SEARCH_DESC</description> <files> <filename>link.php</filename> <folder>link</folder> </files> <fields name="link"> <fieldset name="link"> <field name="enable" type="yesno" default="1" label="WF_LABEL_EXTENSION_ENABLE" description="WF_LABEL_EXTENSION_ENABLE_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="plugins" type="searchplugins" multiple="true" label="WF_PARAM_LINK_SEARCH_PLUGINS" description="WF_PARAM_LINK_SEARCH_PLUGINS_DESC" default="categories,contacts,content,weblinks,tags" layout="joomla.form.field.list-fancy-select" /> <field name="remove_alias" type="yesno" default="0" label="WF_LINK_SEARCH_REMOVE_ALIAS" description="WF_LINK_SEARCH_REMOVE_ALIAS_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="itemid" type="yesno" default="1" label="WF_LINK_SEARCH_ITEMID" description="WF_LINK_SEARCH_ITEMID_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> </fieldset> </fields> <plugins>link</plugins> <media></media> <languages></languages> </extension> PK ��!]p�&R2 2 css/link.cssnu &1i� #search-browser,#searchbox{position:relative}#search-browser button{padding:0 .5em}#search-browser button .uk-icon{margin:auto}#searchbox{z-index:1}div#search-browser input[type=checkbox],div#search-browser input[type=radio]{vertical-align:middle}.phrases-box input[type=radio]{margin:-3px 5px 0 0}#searchbox input{border-top-right-radius:0;border-bottom-right-radius:0;margin:0}#searchbox+div{margin-left:-1px;padding:0}#search-button{border-top-left-radius:0;border-bottom-left-radius:0}#search-clear{display:none}#search-clear.uk-active{display:block}#search-browser .uk-icon-spinner{display:none;right:0}#search-browser.loading .uk-icon-spinner{display:flex;opacity:1}#search-result{width:100%;height:100%;position:absolute;display:none;overflow:auto;overflow-x:hidden;margin:2px 0}#search-result dl{margin:5px 0;padding:10px}#search-result dl dt{cursor:pointer;font-weight:700;text-overflow:ellipsis;overflow:hidden;white-space:pre;text-decoration:underline}div#search-browser div#search-result dl.odd{background-color:#F5F5F5}div#search-browser div#search-result dl dd.anchor{line-height:32px;cursor:pointer}div#search-browser #search-options{width:100%;padding:5px;margin:2px 0 0}div#search-browser #search-options fieldset{margin:0;padding:0}div#search-browser #search-options fieldset>div{margin:5px 0}div#search-browser #search-options label{min-width:40px}#search-options-button{line-height:1}#search-options .search_only ul{list-style:none;padding:0;margin:0}#search-options .search_only ul li{display:inline-block}@media (max-width:375px){#search-button span{display:none}}PK ��!]�#o, , css/index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK ��!]�#o, , js/index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK ��!]5}�Vk k js/link.jsnu &1i� /* jce - 2.9.99.2 | 2026-04-22 | https://www.joomlacontenteditor.net | Source: https://github.com/widgetfactory/jce | Copyright (C) 2006 - 2026 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ WFExtensions.add("LinkSearch", { options: { element: "#search-input", button: "#search-button", clear: "#search-clear", empty: "No Results", onClick: $.noop }, init: function(options) { $.extend(this.options, options); var self = this, el = this.options.element, options = this.options.button; $(options).on("click", function(e) { self.search(), e.preventDefault(); }).button({ icons: { primary: "uk-icon-search" } }), $("#search-clear").on("click", function(e) { $(this).hasClass("uk-active") && ($(this).removeClass("uk-active"), $(el).val(""), $("#search-result").empty().hide()); }), $("#search-options-button").on("click", function(e) { e.preventDefault(), $(this).addClass("uk-active"); e = $("#search-options").parent(); $("#search-options").height(e.parent().height() - e.outerHeight() - 15).toggle(); }).on("close", function() { $(this).removeClass("uk-active"), $("#search-options").hide(); }), $(el).on("change keyup", function() { "" === this.value && ($("#search-result").empty().hide(), $("#search-clear").removeClass("uk-active")); }); }, search: function() { var self = this, s = this.options, el = s.element, $p = $("#search-result").parent(), query = $(el).val(); query && !$(el).hasClass("placeholder") && ($("#search-clear").removeClass("uk-active"), $("#search-browser").addClass("loading"), query = $.trim(query.replace(/[\///<>#]/g, "")), Wf.JSON.request("doSearch", { json: [ query ] }, function(results) { if (results) { if (results.error) return void Wf.Dialog.alert(results.error, { title: Wf.translate("link.search_error", "Search Error") }); $("#search-result").empty(), results.length ? ($.each(results, function(i, values) { $.each(values, function(name, items) { $("<h3>" + name + "</h3>").appendTo("#search-result"), $.each(items, function(i, item) { var $dl = $('<dl class="uk-margin-small" />').appendTo("#search-result"); $('<dt class="link uk-margin-small" />').text(item.title).on("click", function() { $.isFunction(self.options.onClick) && self.options.onClick.call(this, Wf.String.decode(item.link)); }).prepend('<i class="uk-icon uk-icon-file-text-o uk-margin-small-right" />').appendTo($dl), $('<dd class="text">' + item.text + "</dd>").appendTo($dl), item.anchors && $.each(item.anchors, function(i, a) { $('<dd class="anchor"><i role="presentation" class="uk-icon uk-icon-anchor uk-margin-small-right"></i>#' + a + "</dd>").on("click", function() { self.options.onClick.call(this, Wf.String.decode(item.link) + "#" + a); }).appendTo($dl); }); }); }); }), $("dl:odd", "#search-result").addClass("odd")) : $("#search-result").append("<p>" + s.empty + "</p>"), $("#search-options-button").trigger("close"), $("#search-result").height($p.parent().height() - $p.outerHeight() - 5).show(); } $("#search-browser").removeClass("loading"), $("#search-clear").addClass("uk-active"); }, self)); } });PK ��!]�#o, , adapter/categories/index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK ��!]�o��� � ! adapter/categories/categories.phpnu &1i� <?php /** * @package JCE * @subpackage Editor * * @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. * @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE.txt */ \defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\Helper\RouteHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Plugin\CMSPlugin; /** * Categories search plugin. * * @since 1.6 */ class PlgWfSearchCategories extends CMSPlugin { /** * Load the language file on instantiation. * * @var boolean * @since 3.1 */ protected $autoloadLanguage = true; /** * Determine areas searchable by this plugin. * * @return array An array of search areas. * * @since 1.6 */ public function onContentSearchAreas() { static $areas = array( 'categories' => 'PLG_SEARCH_CATEGORIES_CATEGORIES', ); return $areas; } /** * Search content (categories). * * The SQL must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav. * * @param string $text Target search string. * @param string $phrase Matching option (possible values: exact|any|all). Default is "any". * @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest". * @param mixed $areas An array if the search is to be restricted to areas or null to search all areas. * * @return array Search results. * * @since 1.6 */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = Factory::getDbo(); $user = Factory::getUser(); $app = Factory::getApplication(); $groups = implode(',', $user->getAuthorisedViewLevels()); $searchText = $text; if (is_array($areas) && !array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } $limit = $this->params->def('search_limit', 50); $text = trim($text); if ($text === '') { return array(); } switch ($ordering) { case 'alpha': $order = 'a.title ASC'; break; case 'category': case 'popular': case 'newest': case 'oldest': default: $order = 'a.title DESC'; } $text = $db->quote('%' . $db->escape($text, true) . '%', false); $query = $db->getQuery(true); // SQLSRV changes. $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias', '!=', '0'); $case_when .= ' THEN '; // Joomla 3 compatibility if (method_exists($query, 'castAsChar')) { $a_id = $query->castAsChar('a.id'); } else { $a_id = $query->castAs('CHAR', 'a.id'); } $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id . ' END as slug'; $query->select('a.title, a.description AS text, a.id AS catid, a.created_time, a.language, ' . $case_when); $query->from('#__categories AS a'); $query->where( '(a.title LIKE ' . $text . ' OR a.description LIKE ' . $text . ') AND a.published = 1 AND a.extension = ' . $db->quote('com_content') . 'AND a.access IN (' . $groups . ')' ); $query->group('a.id, a.title, a.description, a.alias, a.created_time'); $query->order($order); $db->setQuery($query, 0, $limit); try { $rows = $db->loadObjectList(); } catch (RuntimeException $e) { Factory::getApplication()->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); } if ($rows) { foreach ($rows as $i => $row) { $rows[$i]->href = RouteHelper::getCategoryRoute($row->slug, $row->language, 'com_content'); $rows[$i]->section = Text::_('JCATEGORY'); } } return $rows; } } PK ��!]�#o, , adapter/contacts/index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK ��!]y�P adapter/contacts/contacts.phpnu &1i� <?php /** * @package JCE * @subpackage Editor * * @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. * @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE.txt */ \defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\Helper\RouteHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Plugin\CMSPlugin; /** * Contacts search plugin. */ class PlgWfSearchContacts extends CMSPlugin { /** * Load the language file on instantiation. * * @var boolean */ protected $autoloadLanguage = true; /** * Determine areas searchable by this plugin. * * @return array An array of search areas. */ public function onContentSearchAreas() { static $areas = array( 'contacts' => 'PLG_SEARCH_CONTACTS_CONTACTS', ); return $areas; } /** * Search content (contacts). * * The SQL must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav. * * @param string $text Target search string. * @param string $phrase Matching option (possible values: exact|any|all). Default is "any". * @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest". * @param string $areas An array if the search is to be restricted to areas or null to search all areas. * * @return array Search results. */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = Factory::getDbo(); $app = Factory::getApplication(); $user = Factory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); // create a new RouteHelper instance $router = new RouteHelper(); if (is_array($areas) && !array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } $limit = $this->params->def('search_limit', 50); $text = trim($text); if ($text === '') { return array(); } $section = Text::_('PLG_SEARCH_CONTACTS_CONTACTS'); switch ($ordering) { case 'alpha': $order = 'a.name ASC'; break; case 'category': $order = 'c.title ASC, a.name ASC'; break; case 'popular': case 'newest': case 'oldest': default: $order = 'a.name DESC'; } $text = $db->quote('%' . $db->escape($text, true) . '%', false); $query = $db->getQuery(true); // SQLSRV changes. $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias', '!=', '0'); $case_when .= ' THEN '; if (method_exists($query, 'castAsChar')) { $a_id = $query->castAsChar('a.id'); } else { $a_id = $query->castAs('CHAR', 'a.id'); } $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id . ' END as slug'; $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('c.alias', '!=', '0'); $case_when1 .= ' THEN '; if (method_exists($query, 'castAsChar')) { $c_id = $query->castAsChar('c.id'); } else { $c_id = $query->castAs('CHAR', 'c.id'); } $case_when1 .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $c_id . ' END as catslug'; $query->select( 'a.name AS title, a.con_position, a.misc, a.language, ' . $case_when . ',' . $case_when1 . ', ' . $query->concatenate(array('a.name', 'a.con_position', 'a.misc'), ',') . ' AS text' ); $query->from('#__contact_details AS a') ->join('INNER', '#__categories AS c ON c.id = a.catid') ->where( '(a.name LIKE ' . $text . ' OR a.misc LIKE ' . $text . ' OR a.con_position LIKE ' . $text . ' OR a.address LIKE ' . $text . ' OR a.suburb LIKE ' . $text . ' OR a.state LIKE ' . $text . ' OR a.country LIKE ' . $text . ' OR a.postcode LIKE ' . $text . ' OR a.telephone LIKE ' . $text . ' OR a.fax LIKE ' . $text . ') AND a.published = 1 AND c.published = 1 ' . ' AND a.access IN (' . $groups . ') AND c.access IN (' . $groups . ')' ) ->order($order); $db->setQuery($query, 0, $limit); try { $rows = $db->loadObjectList(); } catch (RuntimeException $e) { $rows = array(); Factory::getApplication()->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); } if ($rows) { // create a new RouteHelper instance $router = new RouteHelper(); foreach ($rows as $key => $row) { $rows[$key]->href = $router->getRoute($row->slug, 'com_contact.contact', '', $row->language, $row->catslug); $rows[$key]->text = $row->title; $rows[$key]->text .= $row->con_position ? ', ' . $row->con_position : ''; $rows[$key]->text .= $row->misc ? ', ' . $row->misc : ''; $rows[$key]->section = $section; } } return $rows; } } PK ��!]�#o, , adapter/index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK ��!]�|7# adapter/tags/tags.phpnu &1i� <?php /** * @package JCE * @subpackage Editor * * @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. * @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE.txt */ \defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\Helper\RouteHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Plugin\CMSPlugin; /** * Tags search plugin. * */ class PlgWfSearchTags extends CMSPlugin { /** * Load the language file on instantiation. * * @var boolean */ protected $autoloadLanguage = true; /** * Determine areas searchable by this plugin. * * @return array An array of search areas. * */ public function onContentSearchAreas() { static $areas = array( 'tags' => 'PLG_SEARCH_TAGS_TAGS', ); return $areas; } /** * Search content (tags). * * The SQL must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav. * * @param string $text Target search string. * @param string $phrase Matching option (possible values: exact|any|all). Default is "any". * @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest". * @param string $areas An array if the search is to be restricted to areas or null to search all areas. * * @return array Search results. * * @since 3.3 */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = Factory::getDbo(); $query = $db->getQuery(true); $app = Factory::getApplication(); $user = Factory::getUser(); $lang = Factory::getLanguage(); $section = Text::_('PLG_SEARCH_TAGS_TAGS'); $limit = $this->params->def('search_limit', 50); if (is_array($areas) && !array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } $text = trim($text); if ($text === '') { return array(); } $text = $db->quote('%' . $db->escape($text, true) . '%', false); switch ($ordering) { case 'alpha': $order = 'a.title ASC'; break; case 'newest': $order = 'a.created_time DESC'; break; case 'oldest': $order = 'a.created_time ASC'; break; case 'popular': default: $order = 'a.title DESC'; } $query->select('a.id, a.title, a.alias, a.note, a.published, a.access' . ', a.checked_out, a.checked_out_time, a.created_user_id' . ', a.path, a.parent_id, a.level, a.lft, a.rgt' . ', a.language, a.created_time AS created, a.description'); $case_when_item_alias = ' CASE WHEN '; $case_when_item_alias .= $query->charLength('a.alias', '!=', '0'); $case_when_item_alias .= ' THEN '; // Joomla 3 compatibility if (method_exists($query, 'castAsChar')) { $a_id = $query->castAsChar('a.id'); } else { $a_id = $query->castAs('CHAR', 'a.id'); } $case_when_item_alias .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when_item_alias .= ' ELSE '; $case_when_item_alias .= $a_id . ' END as slug'; $query->select($case_when_item_alias); $query->from('#__tags AS a'); $query->where('a.alias <> ' . $db->quote('root')); $query->where('(a.title LIKE ' . $text . ' OR a.alias LIKE ' . $text . ')'); $query->where($db->qn('a.published') . ' = 1'); if (!$user->authorise('core.admin')) { $groups = implode(',', $user->getAuthorisedViewLevels()); $query->where('a.access IN (' . $groups . ')'); } $query->order($order); $db->setQuery($query, 0, $limit); try { $rows = $db->loadObjectList(); } catch (RuntimeException $e) { $rows = array(); Factory::getApplication()->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); } if ($rows) { // create a new RouteHelper instance $router = new RouteHelper(); foreach ($rows as $key => $row) { $rows[$key]->href = $router->getRoute($row->slug, 'com_tags.tag', '', $row->language); $rows[$key]->text = ($row->description !== '' ? $row->description : $row->title); $rows[$key]->text .= $row->note; } } return $rows; } } PK ��!]�#o, , adapter/tags/index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK ��!]l5J�� � adapter/content/content.phpnu &1i� <?php /** * @package JCE * @subpackage Editor * * @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. * @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE.txt */ \defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\Helper\RouteHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Plugin\CMSPlugin; /** * Content search plugin. * */ class PlgWfSearchContent extends CMSPlugin { /** * Determine areas searchable by this plugin. * * @return array An array of search areas. * */ public function onContentSearchAreas() { static $areas = array( 'content' => 'JGLOBAL_ARTICLES', ); return $areas; } /** * Search content (articles). * The SQL must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav. * * @param string $text Target search string. * @param string $phrase Matching option (possible values: exact|any|all). Default is "any". * @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest". * @param mixed $areas An array if the search it to be restricted to areas or null to search all areas. * * @return array Search results. * */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = Factory::getDbo(); $serverType = $db->getServerType(); $app = Factory::getApplication(); $user = Factory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $tag = Factory::getLanguage()->getTag(); $searchText = $text; if (is_array($areas) && !array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } $limit = $this->params->def('search_limit', 50); $nullDate = $db->getNullDate(); $date = Factory::getDate(); $now = $date->toSql(); $text = trim($text); if ($text === '') { return array(); } $relevance = array(); switch ($phrase) { case 'exact': $text = $db->quote('%' . $db->escape($text, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.title LIKE ' . $text; $wheres2[] = 'a.introtext LIKE ' . $text; $wheres2[] = 'a.fulltext LIKE ' . $text; $relevance[] = ' CASE WHEN ' . $wheres2[0] . ' THEN 5 ELSE 0 END '; $where = '(' . implode(') OR (', $wheres2) . ')'; break; case 'all': case 'any': default: $words = explode(' ', $text); $wheres = array(); foreach ($words as $word) { $word = $db->quote('%' . $db->escape($word, true) . '%', false); $wheres2 = array(); $wheres2[] = 'LOWER(a.title) LIKE LOWER(' . $word . ')'; $wheres2[] = 'LOWER(a.introtext) LIKE LOWER(' . $word . ')'; $wheres2[] = 'LOWER(a.fulltext) LIKE LOWER(' . $word . ')'; $relevance[] = ' CASE WHEN ' . $wheres2[0] . ' THEN 5 ELSE 0 END '; $wheres[] = implode(' OR ', $wheres2); } $where = '(' . implode(($phrase === 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; break; } switch ($ordering) { case 'oldest': $order = 'a.created ASC'; break; case 'popular': $order = 'a.hits DESC'; break; case 'alpha': $order = 'a.title ASC'; break; case 'category': $order = 'c.title ASC, a.title ASC'; break; case 'newest': default: $order = 'a.created DESC'; break; } $rows = array(); $query = $db->getQuery(true); // Search articles. if ($limit > 0) { //sqlsrv changes $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('a.alias', '!=', '0'); $case_when1 .= ' THEN '; // Joomla 3 compatibility if (method_exists($query, 'castAsChar')) { $a_id = $query->castAsChar('a.id'); } else { $a_id = $query->castAs('CHAR', 'a.id'); } $case_when1 .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $a_id . ' END as slug'; $case_when2 = ' CASE WHEN '; $case_when2 .= $query->charLength('b.alias', '!=', '0'); $case_when2 .= ' THEN '; // Joomla 3 compatibility if (method_exists($query, 'castAsChar')) { $c_id = $query->castAsChar('b.id'); } else { $c_id = $query->castAs('CHAR', 'b.id'); } $case_when2 .= $query->concatenate(array($c_id, 'b.alias'), ':'); $case_when2 .= ' ELSE '; $case_when2 .= $c_id . ' END as catslug'; $case = ',' . $case_when1 . ',' . $case_when2; if (!empty($relevance)) { $query->select(implode(' + ', $relevance) . ' AS relevance'); $order = ' relevance DESC, ' . $order; } $query->select('a.id AS slug, b.id AS catslug, a.alias, a.state, a.title AS title, a.access, ' . $query->concatenate(array('a.introtext', 'a.fulltext')) . ' AS text, a.language' . $case); $query->from('#__content AS a'); $query->innerJoin('#__categories AS b ON b.id = a.catid'); $query->where('(' . $where . ') AND a.state = 1 AND b.published = 1'); if (!$user->authorise('core.admin')) { $query->where('a.access IN (' . $groups . ')'); $query->where('b.access IN (' . $groups . ')'); } $query->order($order); $db->setQuery($query, 0, $limit); try { $rows = $db->loadObjectList(); } catch (RuntimeException $e) { $rows = array(); Factory::getApplication()->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); } if ($rows) { // create a new RouteHelper instance $router = new RouteHelper(); foreach ($rows as $key => $row) { $rows[$key]->href = $router->getRoute($row->slug, 'com_content.article', '', $row->language, $row->catslug); } } } return $rows; } } PK ��!]�#o, , adapter/content/index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK ��!]Q?n�b b adapter/weblinks/weblinks.phpnu &1i� <?php /** * @package JCE * @subpackage Editor * * @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. * @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE.txt */ \defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Plugin\CMSPlugin; require_once JPATH_SITE . '/components/com_weblinks/helpers/route.php'; /** * Weblinks search plugin. * */ class PlgWfSearchWeblinks extends CMSPlugin { /** * Load the language file on instantiation. * * @var boolean */ protected $autoloadLanguage = true; /** * Determine areas searchable by this plugin. * * @return array An array of search areas. * */ public function onContentSearchAreas() { static $areas = array( 'weblinks' => 'PLG_SEARCH_WEBLINKS_WEBLINKS', ); return $areas; } /** * Search content (weblinks). * * The SQL must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav * * @param string $text Target search string. * @param string $phrase Matching option (possible values: exact|any|all). Default is "any". * @param string $ordering Ordering option (possible values: newest|oldest|popular|alpha|category). Default is "newest". * @param mixed $areas An array if the search it to be restricted to areas or null to search all areas. * * @return array Search results. * * @since 1.6 */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = Factory::getDbo(); $groups = implode(',', Factory::getUser()->getAuthorisedViewLevels()); $searchText = $text; if (is_array($areas)) { if (!array_intersect($areas, array_keys($this->onContentSearchAreas()))) { return array(); } } $limit = $this->params->def('search_limit', 50); $state = array(); $text = trim($text); if ($text == '') { return array(); } switch ($phrase) { case 'exact': $text = $db->quote('%' . $db->escape($text, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.url LIKE ' . $text; $wheres2[] = 'a.description LIKE ' . $text; $wheres2[] = 'a.title LIKE ' . $text; $where = '(' . implode(') OR (', $wheres2) . ')'; break; case 'all': case 'any': default: $words = explode(' ', $text); $wheres = array(); foreach ($words as $word) { $word = $db->quote('%' . $db->escape($word, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.url LIKE ' . $word; $wheres2[] = 'a.description LIKE ' . $word; $wheres2[] = 'a.title LIKE ' . $word; $wheres[] = implode(' OR ', $wheres2); } $where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; break; } switch ($ordering) { case 'oldest': $order = 'a.created ASC'; break; case 'popular': $order = 'a.hits DESC'; break; case 'alpha': $order = 'a.title ASC'; break; case 'category': $order = 'c.title ASC, a.title ASC'; break; case 'newest': default: $order = 'a.created DESC'; } $query = $db->getQuery(true); // SQLSRV changes. $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias', '!=', '0'); $case_when .= ' THEN '; // Joomla 3 compatibility if (method_exists($query, 'castAsChar')) { $a_id = $query->castAsChar('a.id'); } else { $a_id = $query->castAs('CHAR', 'a.id'); } $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id . ' END as slug'; $case_when1 = ' CASE WHEN '; $case_when1 .= $query->charLength('c.alias', '!=', '0'); $case_when1 .= ' THEN '; // Joomla 3 compatibility if (method_exists($query, 'castAsChar')) { $c_id = $query->castAsChar('c.id'); } else { $c_id = $query->castAs('CHAR', 'c.id'); } $case_when1 .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when1 .= ' ELSE '; $case_when1 .= $c_id . ' END as catslug'; $query->select('a.title AS title, a.created AS created, a.url, a.description AS text, a.language, ' . $case_when . "," . $case_when1) ->from('#__weblinks AS a') ->join('INNER', '#__categories as c ON c.id = a.catid') ->where('(' . $where . ') AND a.state = 1 AND c.published = 1 AND c.access IN (' . $groups . ')') ->order($order); $db->setQuery($query, 0, $limit); $rows = $db->loadObjectList(); if ($rows) { foreach ($rows as $key => $row) { $rows[$key]->href = WeblinksHelperRoute::getWeblinkRoute($row->slug, $row->catslug, $row->language); } } return $rows; } } PK ��!]�#o, , adapter/weblinks/index.htmlnu &1i� <html><body bgcolor="#FFFFFF"></body></html>PK پ!]+��; ; default_form.phpnu &1i� <?php /** * @package Joomla.Site * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; if ($this->params->get('show_advanced', 1) || $this->params->get('show_autosuggest', 1)) { JHtml::_('jquery.framework'); $script = " jQuery(function() {"; if ($this->params->get('show_advanced', 1)) { /* * This segment of code disables select boxes that have no value when the * form is submitted so that the URL doesn't get blown up with null values. */ $script .= " jQuery('#finder-search').on('submit', function(e){ e.stopPropagation(); // Disable select boxes with no value selected. jQuery('#advancedSearch').find('select').each(function(index, el) { var el = jQuery(el); if(!el.val()){ el.attr('disabled', 'disabled'); } }); });"; } /* * This segment of code sets up the autocompleter. */ if ($this->params->get('show_autosuggest', 1)) { JHtml::_('script', 'jui/jquery.autocomplete.min.js', array('version' => 'auto', 'relative' => true)); $script .= " var suggest = jQuery('#q').autocomplete({ serviceUrl: '" . JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component') . "', paramName: 'q', minChars: 1, maxHeight: 400, width: 300, zIndex: 9999, deferRequestBy: 500 });"; } $script .= " });"; JFactory::getDocument()->addScriptDeclaration($script); } ?> <form id="finder-search" action="<?php echo JRoute::_($this->query->toURI()); ?>" method="get" class="form-inline"> <?php echo $this->getFields(); ?> <?php /* * DISABLED UNTIL WEIRD VALUES CAN BE TRACKED DOWN. */ if (false && $this->state->get('list.ordering') !== 'relevance_dsc'): ?> <input type="hidden" name="o" value="<?php echo $this->escape($this->state->get('list.ordering')); ?>" /> <?php endif; ?> <fieldset class="word control-group"> <label for="q"> <?php echo JText::_('COM_FINDER_SEARCH_TERMS'); ?> </label> <input type="text" name="q" id="q" size="30" value="<?php echo $this->escape($this->query->input); ?>" class="inputbox" /> <?php if ($this->escape($this->query->input) != '' || $this->params->get('allow_empty_search')):?> <button id="smartsearch-btn" name="Search" type="submit" class="button"><i class="icon-search"></i><?php echo JText::_('JSEARCH_FILTER_SUBMIT');?></button> <?php else: ?> <button id="smartsearch-btn" name="Search" type="submit" class="btn disabled"><?php echo JText::_('JSEARCH_FILTER_SUBMIT');?></button> <?php endif; ?> <?php if ($this->params->get('show_advanced', 1)): ?> <a href="#advancedSearch" data-toggle="collapse" class="btn"><i class="icon-list"></i><?php echo JText::_('COM_FINDER_ADVANCED_SEARCH_TOGGLE'); ?></a> <?php endif ?> </fieldset> <?php if ($this->params->get('show_advanced', 1)): ?> <div id="advancedSearch" class="collapse<?php if ($this->params->get('expand_advanced', 0)) echo ' in'; ?>"> <?php if ($this->params->get('show_advanced_tips', 1)): ?> <div class="advanced-search-tip"> <?php echo JText::_('COM_FINDER_ADVANCED_TIPS'); ?> </div> <?php endif; ?> <div id="finder-filter-window"> <?php echo JHtml::_('filter.select', $this->query, $this->params); ?> </div> </div> <?php endif; ?> </form> PK p"]:a�yN N tmpl/default.xmlnu &1i� <?xml version="1.0" encoding="utf-8"?> <metadata> <layout title="COM_SEARCH_SEARCH_VIEW_DEFAULT_TITLE" option="COM_SEARCH_SEARCH_VIEW_DEFAULT_OPTION"> <help key = "JHELP_MENUS_MENU_ITEM_SEARCH_RESULTS" /> <message> <![CDATA[COM_SEARCH_SEARCH_VIEW_DEFAULT_DESC]]> </message> </layout> <!-- Add fields to the request variables for the layout. --> <fields name="request"> <fieldset name="request" label="COM_SEARCH_FIELDSET_OPTIONAL_LABEL"> <field name="searchword" type="text" label="COM_SEARCH_FIELD_LABEL" description="COM_SEARCH_FIELD_DESC" /> </fieldset> </fields> <!-- Add fields to the parameters object for the layout. --> <fields name="params"> <!-- Basic options. --> <fieldset name="basic" label="COM_MENUS_BASIC_FIELDSET_LABEL"> <field name="search_phrases" type="list" label="COM_SEARCH_FIELD_SEARCH_PHRASES_LABEL" description="COM_SEARCH_FIELD_SEARCH_PHRASES_DESC" useglobal="true" class="chzn-color" > <option value="0">JNO</option> <option value="1">JYES</option> </field> <field name="search_areas" type="list" label="COM_SEARCH_FIELD_SEARCH_AREAS_LABEL" description="COM_SEARCH_FIELD_SEARCH_AREAS_DESC" useglobal="true" class="chzn-color" > <option value="0">JNO</option> <option value="1">JYES</option> </field> <field name="show_date" type="list" label="COM_SEARCH_CONFIG_FIELD_CREATED_DATE_LABEL" description="COM_SEARCH_CONFIG_FIELD_CREATED_DATE_DESC" useglobal="true" class="chzn-color" > <option value="0">JHIDE</option> <option value="1">JSHOW</option> </field> <field name="spacer1" type="spacer" label="COM_SEARCH_SAVED_SEARCH_OPTIONS" class="text" /> <!-- Add fields to define saved search. --> <field name="searchphrase" type="list" label="COM_SEARCH_FOR_LABEL" description="COM_SEARCH_FOR_DESC" default="0" > <option value="0">COM_SEARCH_ALL_WORDS</option> <option value="1">COM_SEARCH_ANY_WORDS</option> <option value="2">COM_SEARCH_EXACT_PHRASE</option> </field> <field name="ordering" type="list" label="COM_SEARCH_ORDERING_LABEL" description="COM_SEARCH_ORDERING_DESC" default="newest" > <option value="newest">COM_SEARCH_NEWEST_FIRST</option> <option value="oldest">COM_SEARCH_OLDEST_FIRST</option> <option value="popular">COM_SEARCH_MOST_POPULAR</option> <option value="alpha">COM_SEARCH_ALPHABETICAL</option> <option value="category">JCATEGORY</option> </field> </fieldset> </fields> </metadata> PK p"];��� � tmpl/default.phpnu &1i� <?php /** * @package Joomla.Site * @subpackage com_search * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div class="search<?php echo $this->pageclass_sfx; ?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1 class="page-title"> <?php if ($this->escape($this->params->get('page_heading'))) : ?> <?php echo $this->escape($this->params->get('page_heading')); ?> <?php else : ?> <?php echo $this->escape($this->params->get('page_title')); ?> <?php endif; ?> </h1> <?php endif; ?> <?php echo $this->loadTemplate('form'); ?> <?php if ($this->error == null && count($this->results) > 0) : ?> <?php echo $this->loadTemplate('results'); ?> <?php else : ?> <?php echo $this->loadTemplate('error'); ?> <?php endif; ?> </div> PK p"]HT7�4 4 tmpl/default_form.phpnu &1i� <?php /** * @package Joomla.Site * @subpackage com_search * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('bootstrap.tooltip'); $lang = JFactory::getLanguage(); $upper_limit = $lang->getUpperLimitSearchWord(); ?> <form id="searchForm" action="<?php echo JRoute::_('index.php?option=com_search'); ?>" method="post"> <div class="btn-toolbar"> <div class="btn-group pull-left"> <label for="search-searchword" class="element-invisible"> <?php echo JText::_('COM_SEARCH_SEARCH_KEYWORD'); ?> </label> <input type="text" name="searchword" title="<?php echo JText::_('COM_SEARCH_SEARCH_KEYWORD'); ?>" placeholder="<?php echo JText::_('COM_SEARCH_SEARCH_KEYWORD'); ?>" id="search-searchword" size="30" maxlength="<?php echo $upper_limit; ?>" value="<?php echo $this->escape($this->origkeyword); ?>" class="inputbox" /> </div> <div class="btn-group pull-left"> <button name="Search" onclick="this.form.submit()" class="btn hasTooltip" title="<?php echo JHtml::_('tooltipText', 'COM_SEARCH_SEARCH');?>"> <span class="icon-search"></span> <?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?> </button> </div> <input type="hidden" name="task" value="search" /> <div class="clearfix"></div> </div> <div class="searchintro<?php echo $this->params->get('pageclass_sfx', ''); ?>"> <?php if (!empty($this->searchword)) : ?> <p> <?php echo JText::plural('COM_SEARCH_SEARCH_KEYWORD_N_RESULTS', '<span class="badge badge-info">' . $this->total . '</span>'); ?> </p> <?php endif; ?> </div> <?php if ($this->params->get('search_phrases', 1)) : ?> <fieldset class="phrases"> <legend> <?php echo JText::_('COM_SEARCH_FOR'); ?> </legend> <div class="phrases-box"> <?php echo $this->lists['searchphrase']; ?> </div> <div class="ordering-box"> <label for="ordering" class="ordering"> <?php echo JText::_('COM_SEARCH_ORDERING'); ?> </label> <?php echo $this->lists['ordering']; ?> </div> </fieldset> <?php endif; ?> <?php if ($this->params->get('search_areas', 1)) : ?> <fieldset class="only"> <legend> <?php echo JText::_('COM_SEARCH_SEARCH_ONLY'); ?> </legend> <?php foreach ($this->searchareas['search'] as $val => $txt) : ?> <?php $checked = is_array($this->searchareas['active']) && in_array($val, $this->searchareas['active']) ? 'checked="checked"' : ''; ?> <label for="area-<?php echo $val; ?>" class="checkbox"> <input type="checkbox" name="areas[]" value="<?php echo $val; ?>" id="area-<?php echo $val; ?>" <?php echo $checked; ?> /> <?php echo JText::_($txt); ?> </label> <?php endforeach; ?> </fieldset> <?php endif; ?> <?php if ($this->total > 0) : ?> <div class="form-limit"> <label for="limit"> <?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?> </label> <?php echo $this->pagination->getLimitBox(); ?> </div> <p class="counter"> <?php echo $this->pagination->getPagesCounter(); ?> </p> <?php endif; ?> </form> PK p"] /1�: : tmpl/default_results.phpnu &1i� <?php /** * @package Joomla.Site * @subpackage com_search * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <dl class="search-results<?php echo $this->pageclass_sfx; ?>"> <?php foreach ($this->results as $result) : ?> <dt class="result-title"> <?php echo $this->pagination->limitstart + $result->count . '. '; ?> <?php if ($result->href) : ?> <a href="<?php echo JRoute::_($result->href); ?>"<?php if ($result->browsernav == 1) : ?> target="_blank"<?php endif; ?>> <?php // $result->title should not be escaped in this case, as it may ?> <?php // contain span HTML tags wrapping the searched terms, if present ?> <?php // in the title. ?> <?php echo $result->title; ?> </a> <?php else : ?> <?php // see above comment: do not escape $result->title ?> <?php echo $result->title; ?> <?php endif; ?> </dt> <?php if ($result->section) : ?> <dd class="result-category"> <span class="small<?php echo $this->pageclass_sfx; ?>"> (<?php echo $this->escape($result->section); ?>) </span> </dd> <?php endif; ?> <dd class="result-text"> <?php echo $result->text; ?> </dd> <?php if ($this->params->get('show_date')) : ?> <dd class="result-created<?php echo $this->pageclass_sfx; ?>"> <?php echo JText::sprintf('JGLOBAL_CREATED_DATE_ON', $result->created); ?> </dd> <?php endif; ?> <?php endforeach; ?> </dl> <div class="pagination"> <?php echo $this->pagination->getPagesLinks(); ?> </div> PK p"]1�bm� � tmpl/default_result.phpnu &1i� <?php /** * @package Joomla.Site * @subpackage com_finder * * @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\String\StringHelper; // Get the mime type class. $mime = !empty($this->result->mime) ? 'mime-' . $this->result->mime : null; $show_description = $this->params->get('show_description', 1); if ($show_description) { // Calculate number of characters to display around the result $term_length = StringHelper::strlen($this->query->input); $desc_length = $this->params->get('description_length', 255); $pad_length = $term_length < $desc_length ? (int) floor(($desc_length - $term_length) / 2) : 0; // Make sure we highlight term both in introtext and fulltext if (!empty($this->result->summary) && !empty($this->result->body)) { $full_description = FinderIndexerHelper::parse($this->result->summary . $this->result->body); } else { $full_description = $this->result->description; } // Find the position of the search term $pos = $term_length ? StringHelper::strpos(StringHelper::strtolower($full_description), StringHelper::strtolower($this->query->input)) : false; // Find a potential start point $start = ($pos && $pos > $pad_length) ? $pos - $pad_length : 0; // Find a space between $start and $pos, start right after it. $space = StringHelper::strpos($full_description, ' ', $start > 0 ? $start - 1 : 0); $start = ($space && $space < $pos) ? $space + 1 : $start; $description = JHtml::_('string.truncate', StringHelper::substr($full_description, $start), $desc_length, true); } $route = $this->result->route; // Get the route with highlighting information. if (!empty($this->query->highlight) && empty($this->result->mime) && $this->params->get('highlight_terms', 1) && JPluginHelper::isEnabled('system', 'highlight')) { $route .= '&highlight=' . base64_encode(json_encode($this->query->highlight)); } ?> <li> <h4 class="result-title <?php echo $mime; ?>"> <a href="<?php echo JRoute::_($route); ?>"> <?php echo $this->result->title; ?> </a> </h4> <?php if ($show_description && $description !== '') : ?> <p class="result-text<?php echo $this->pageclass_sfx; ?>"> <?php echo $description; ?> </p> <?php endif; ?> <?php if ($this->params->get('show_url', 1)) : ?> <div class="small result-url<?php echo $this->pageclass_sfx; ?>"> <?php echo $this->baseUrl, JRoute::_($this->result->route); ?> </div> <?php endif; ?> </li> PK p"]��8m�% �% view.html.phpnu &1i� <?php /** * @package Joomla.Site * @subpackage com_search * * @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\String\StringHelper; /** * HTML View class for the search component * * @since 1.0 */ class SearchViewSearch extends JViewLegacy { /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise an Error object. * * @since 1.0 */ public function display($tpl = null) { JLoader::register('SearchHelper', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/search.php'); $app = JFactory::getApplication(); $uri = JUri::getInstance(); $error = null; $results = null; $total = 0; // Get some data from the model $areas = $this->get('areas'); $state = $this->get('state'); $searchWord = $state->get('keyword'); $params = $app->getParams(); if (!$app->getMenu()->getActive()) { $params->set('page_title', JText::_('COM_SEARCH_SEARCH')); } $title = $params->get('page_title'); if ($app->get('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); } elseif ($app->get('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); } $this->document->setTitle($title); if ($params->get('menu-meta_description')) { $this->document->setDescription($params->get('menu-meta_description')); } if ($params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $params->get('menu-meta_keywords')); } if ($params->get('robots')) { $this->document->setMetadata('robots', $params->get('robots')); } // Built select lists $orders = array(); $orders[] = JHtml::_('select.option', 'newest', JText::_('COM_SEARCH_NEWEST_FIRST')); $orders[] = JHtml::_('select.option', 'oldest', JText::_('COM_SEARCH_OLDEST_FIRST')); $orders[] = JHtml::_('select.option', 'popular', JText::_('COM_SEARCH_MOST_POPULAR')); $orders[] = JHtml::_('select.option', 'alpha', JText::_('COM_SEARCH_ALPHABETICAL')); $orders[] = JHtml::_('select.option', 'category', JText::_('JCATEGORY')); $lists = array(); $lists['ordering'] = JHtml::_('select.genericlist', $orders, 'ordering', 'class="inputbox"', 'value', 'text', $state->get('ordering')); $searchphrases = array(); $searchphrases[] = JHtml::_('select.option', 'all', JText::_('COM_SEARCH_ALL_WORDS')); $searchphrases[] = JHtml::_('select.option', 'any', JText::_('COM_SEARCH_ANY_WORDS')); $searchphrases[] = JHtml::_('select.option', 'exact', JText::_('COM_SEARCH_EXACT_PHRASE')); $lists['searchphrase'] = JHtml::_('select.radiolist', $searchphrases, 'searchphrase', '', 'value', 'text', $state->get('match')); // Log the search \Joomla\CMS\Helper\SearchHelper::logSearch($searchWord, 'com_search'); // Limit search-word $lang = JFactory::getLanguage(); $upper_limit = $lang->getUpperLimitSearchWord(); $lower_limit = $lang->getLowerLimitSearchWord(); if (SearchHelper::limitSearchWord($searchWord)) { $error = JText::sprintf('COM_SEARCH_ERROR_SEARCH_MESSAGE', $lower_limit, $upper_limit); } // Sanitise search-word if (SearchHelper::santiseSearchWord($searchWord, $state->get('match'))) { $error = JText::_('COM_SEARCH_ERROR_IGNOREKEYWORD'); } if (!$searchWord && !empty($this->input) && count($this->input->post)) { // $error = JText::_('COM_SEARCH_ERROR_ENTERKEYWORD'); } // Put the filtered results back into the model // for next release, the checks should be done in the model perhaps... $state->set('keyword', $searchWord); if ($error === null) { $results = $this->get('data'); $total = $this->get('total'); $pagination = $this->get('pagination'); // Flag indicates to not add limitstart=0 to URL $pagination->hideEmptyLimitstart = true; if ($state->get('match') === 'exact') { $searchWords = array($searchWord); $needle = $searchWord; } else { $searchWordA = preg_replace('#\xE3\x80\x80#', ' ', $searchWord); $searchWords = preg_split("/\s+/u", $searchWordA); $needle = $searchWords[0]; } JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); // Make sure there are no slashes in the needle $needle = str_replace('/', '\/', $needle); for ($i = 0, $count = count($results); $i < $count; ++$i) { $rowTitle = &$results[$i]->title; $rowTitleHighLighted = $this->highLight($rowTitle, $needle, $searchWords); $rowText = &$results[$i]->text; $rowTextHighLighted = $this->highLight($rowText, $needle, $searchWords); $result = &$results[$i]; $created = ''; if ($result->created) { $created = JHtml::_('date', $result->created, JText::_('DATE_FORMAT_LC3')); } $result->title = $rowTitleHighLighted; $result->text = JHtml::_('content.prepare', $rowTextHighLighted, '', 'com_search.search'); $result->created = $created; $result->count = $i + 1; } } // Check for layout override $active = JFactory::getApplication()->getMenu()->getActive(); if (isset($active->query['layout'])) { $this->setLayout($active->query['layout']); } // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx', '')); $this->pagination = &$pagination; $this->results = &$results; $this->lists = &$lists; $this->params = &$params; $this->ordering = $state->get('ordering'); $this->searchword = $searchWord; $this->origkeyword = $state->get('origkeyword'); $this->searchphrase = $state->get('match'); $this->searchareas = $areas; $this->total = $total; $this->error = $error; $this->action = $uri; parent::display($tpl); } /** * Method to control the highlighting of keywords * * @param string $string text to be searched * @param string $needle text to search for * @param string $searchWords words to be searched * * @return mixed A string. * * @since 3.8.4 */ public function highLight($string, $needle, $searchWords) { $hl1 = '<span class="highlight">'; $hl2 = '</span>'; $mbString = extension_loaded('mbstring'); $highlighterLen = strlen($hl1 . $hl2); // Doing HTML entity decoding here, just in case we get any HTML entities here. $quoteStyle = version_compare(PHP_VERSION, '5.4', '>=') ? ENT_NOQUOTES | ENT_HTML401 : ENT_NOQUOTES; $row = html_entity_decode($string, $quoteStyle, 'UTF-8'); $row = SearchHelper::prepareSearchContent($row, $needle); $searchWords = array_values(array_unique($searchWords)); $lowerCaseRow = $mbString ? mb_strtolower($row) : StringHelper::strtolower($row); $transliteratedLowerCaseRow = SearchHelper::remove_accents($lowerCaseRow); $posCollector = array(); foreach ($searchWords as $highlightWord) { $found = false; if ($mbString) { $lowerCaseHighlightWord = mb_strtolower($highlightWord); if (($pos = mb_strpos($lowerCaseRow, $lowerCaseHighlightWord)) !== false) { $found = true; } elseif (($pos = mb_strpos($transliteratedLowerCaseRow, $lowerCaseHighlightWord)) !== false) { $found = true; } } else { $lowerCaseHighlightWord = StringHelper::strtolower($highlightWord); if (($pos = StringHelper::strpos($lowerCaseRow, $lowerCaseHighlightWord)) !== false) { $found = true; } elseif (($pos = StringHelper::strpos($transliteratedLowerCaseRow, $lowerCaseHighlightWord)) !== false) { $found = true; } } if ($found === true) { // Iconv transliterates '€' to 'EUR' // TODO: add other expanding translations? $eur_compensation = $pos > 0 ? substr_count($row, "\xE2\x82\xAC", 0, $pos) * 2 : 0; $pos -= $eur_compensation; // Collect pos and search-word $posCollector[$pos] = $highlightWord; } } if (count($posCollector)) { // Sort by pos. Easier to handle overlapping highlighter-spans ksort($posCollector); $cnt = 0; $lastHighlighterEnd = -1; foreach ($posCollector as $pos => $highlightWord) { $pos += $cnt * $highlighterLen; /* * Avoid overlapping/corrupted highlighter-spans * TODO $chkOverlap could be used to highlight remaining part * of search-word outside last highlighter-span. * At the moment no additional highlighter is set. */ $chkOverlap = $pos - $lastHighlighterEnd; if ($chkOverlap >= 0) { // Set highlighter around search-word if ($mbString) { $highlightWordLen = mb_strlen($highlightWord); $row = mb_substr($row, 0, $pos) . $hl1 . mb_substr($row, $pos, $highlightWordLen) . $hl2 . mb_substr($row, $pos + $highlightWordLen); } else { $highlightWordLen = StringHelper::strlen($highlightWord); $row = StringHelper::substr($row, 0, $pos) . $hl1 . StringHelper::substr($row, $pos, StringHelper::strlen($highlightWord)) . $hl2 . StringHelper::substr($row, $pos + StringHelper::strlen($highlightWord)); } $cnt++; $lastHighlighterEnd = $pos + $highlightWordLen + $highlighterLen; } } } return $row; } } PK p"]Vb��w w view.feed.phpnu &1i� <?php /** * @package Joomla.Site * @subpackage com_finder * * @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Search feed view class for the Finder package. * * @since 2.5 */ class FinderViewSearch extends JViewLegacy { /** * Method to display the view. * * @param string $tpl A template file to load. [optional] * * @return mixed JError object on failure, void on success. * * @since 2.5 */ public function display($tpl = null) { // Get the application $app = JFactory::getApplication(); // Adjust the list limit to the feed limit. $app->input->set('limit', $app->get('feed_limit')); // Get view data. $state = $this->get('State'); $params = $state->get('params'); $query = $this->get('Query'); $results = $this->get('Results'); // Push out the query data. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); $explained = JHtml::_('query.explained', $query); // Set the document title. $title = $params->get('page_title', ''); if (empty($title)) { $title = $app->get('sitename'); } elseif ($app->get('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); } elseif ($app->get('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); } $this->document->setTitle($title); // Configure the document description. if (!empty($explained)) { $this->document->setDescription(html_entity_decode(strip_tags($explained), ENT_QUOTES, 'UTF-8')); } // Set the document link. $this->document->link = JRoute::_($query->toUri()); // If we don't have any results, we are done. if (empty($results)) { return; } // Convert the results to feed entries. foreach ($results as $result) { // Convert the result to a feed entry. $item = new JFeedItem; $item->title = $result->title; $item->link = JRoute::_($result->route); $item->description = $result->description; // Use Unix date to cope for non-english languages $item->date = (int) $result->start_date ? JHtml::_('date', $result->start_date, 'U') : $result->indexdate; // Get the taxonomy data. $taxonomy = $result->getTaxonomy(); // Add the category to the feed if available. if (isset($taxonomy['Category'])) { $node = array_pop($taxonomy['Category']); $item->category = $node->title; } // Loads item info into RSS array $this->document->addItem($item); } } } PK p"]|�zi i view.opensearch.phpnu &1i� <?php /** * @package Joomla.Site * @subpackage com_search * * @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * OpenSearch View class for the Search component * * @since 1.7 */ class SearchViewSearch extends JViewLegacy { /** * Execute and display a template script. * * @param string $tpl name of the template * * @throws Exception * @return mixed A string if successful, otherwise an Error object. */ public function display($tpl = null) { $doc = JFactory::getDocument(); $app = JFactory::getApplication(); $params = JComponentHelper::getParams('com_search'); $doc->setShortName($params->get('opensearch_name', $app->get('sitename'))); $doc->setDescription($params->get('opensearch_description', $app->get('MetaDesc'))); // Add the URL for the search $searchUri = JUri::base() . 'index.php?option=com_search&searchword={searchTerms}'; // Find the menu item for the search $menu = $app->getMenu(); $items = $menu->getItems('link', 'index.php?option=com_search&view=search'); if (isset($items[0])) { $searchUri .= '&Itemid=' . $items[0]->id; } $htmlSearch = new JOpenSearchUrl; $htmlSearch->template = JRoute::_($searchUri); $doc->addUrl($htmlSearch); } } PK G"](�My y tmpl/default_error.phpnu &1i� <?php /** * @package Joomla.Site * @subpackage com_search * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <?php if ($this->error) : ?> <div class="error"> <?php echo $this->escape($this->error); ?> </div> <?php endif; ?> PK f�!]�"�� � jump-to-line.min.jsnu &1i� PK f�!]�WU] ] jump-to-line.jsnu &1i� PK f�!]�B��� � � searchcursor.min.jsnu &1i� PK f�!]��&�� � �"