%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /data/old/home/stash/atlassian-stash/static/bower/CodeMirror/addon/search/
Upload File :
Create Path :
Current File : //data/old/home/stash/atlassian-stash/static/bower/CodeMirror/addon/search/search-atlassian-min.js

(function(){function A(S,Q){var R;if(typeof S=="string"){R=S.charAt(0);S=new RegExp("^"+S.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),Q?"i":"")}else{S=new RegExp("^(?:"+S.source+")",S.ignoreCase?"i":"")}if(typeof S=="string"){return{token:function(T){if(T.match(S)){return"searching"}T.next();T.skipTo(S.charAt(0))||T.skipToEnd()}}}return{token:function(T){if(T.match(S)){return"searching"}while(!T.eol()){T.next();if(R){T.skipTo(R)||T.skipToEnd()}if(T.match(S,false)){break}}}}}function L(){this.posFrom=this.posTo=this.query=null;this.overlay=null}function G(Q){return Q.state.search||(Q.state.search=new L())}function P(Q){return typeof Q=="string"&&Q==Q.toLowerCase()}function N(Q,R,S){return Q.getSearchCursor(R,S,P(R))}function K(Q,T,R,U,S){if(Q.openDialog){Q.openDialog(T,S,{value:U})}else{S(prompt(R,U))}}function O(R,T,S,Q){if(R.openConfirm){R.openConfirm(T,Q)}else{if(confirm(S)){Q[0]()}}}function D(R){var Q=R.match(/^\/(.*)\/([a-z]*)$/);return Q?new RegExp(Q[1],Q[2].indexOf("i")==-1?"":"i"):R}var C='Search: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>';function J(Q,R){var S=G(Q);if(S.query){return H(Q,R)}K(Q,C,"Search for:",Q.getSelection(),function(T){Q.operation(function(){if(!T||S.query){return }S.query=D(T);Q.removeOverlay(S.overlay,P(S.query));S.overlay=A(S.query);Q.addOverlay(S.overlay);S.posFrom=S.posTo=Q.getCursor();H(Q,R)})})}function H(Q,R){Q.operation(function(){var S=G(Q);var T=N(Q,S.query,R?S.posFrom:S.posTo);if(!T.find(R)){T=N(Q,S.query,R?CodeMirror.Pos(Q.lastLine()):CodeMirror.Pos(Q.firstLine(),0));if(!T.find(R)){return }}Q.setSelection(T.from(),T.to());Q.scrollIntoView({from:T.from(),to:T.to()},100);S.posFrom=T.from();S.posTo=T.to()})}function M(Q){Q.operation(function(){var R=G(Q);if(!R.query){return }R.query=null;Q.removeOverlay(R.overlay)})}var F='Replace: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>';var I='With: <input type="text" style="width: 10em"/>';var E="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";function B(Q,R){K(Q,F,"Replace:",Q.getSelection(),function(S){if(!S){return }S=D(S);K(Q,I,"Replace with:","",function(W){if(R){Q.operation(function(){for(var Y=N(Q,S);Y.findNext();){if(typeof S!="string"){var X=Q.getRange(Y.from(),Y.to()).match(S);Y.replace(W.replace(/\$(\d)/,function(Z,a){return X[a]}))}else{Y.replace(W)}}})}else{M(Q);var V=N(Q,S,Q.getCursor());var U=function(){var Y=V.from(),X;if(!(X=V.findNext())){V=N(Q,S);if(!(X=V.findNext())||(Y&&V.from().line==Y.line&&V.from().ch==Y.ch)){return }}Q.setSelection(V.from(),V.to());Q.scrollIntoView({from:V.from(),to:V.to()},100);O(Q,E,"Replace?",[function(){T(X)},U])};var T=function(X){V.replace(typeof S=="string"?W:W.replace(/\$(\d)/,function(Y,Z){return X[Z]}));U()};U()}})})}CodeMirror.commands.find=function(Q){M(Q);J(Q)};CodeMirror.commands.findNext=J;CodeMirror.commands.findPrev=function(Q){J(Q,true)};CodeMirror.commands.clearSearch=M})();

Zerion Mini Shell 1.0