CoreFiles by mySites.guru
sublime.min.js1 lines, 14,728 bytes, from Joomla_4.0.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 3.10.0-alpha9
md5
88656cf914ee873e9209ef50e0a2b314
sha1
3a7a56a5d55e0f61c99d5f44dccc15a8d59da557
sha256
e3ba5f610ca0904e4f392507a6f9bc27d78d45fd8357f35ccbde0bbf077f7bf5
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n){t.extendSelectionsBy(function(r){return t.display.shift||t.doc.extend||r.empty()?function(t,n,r){if(r<0&&0==n.ch)return t.clipPos(u(n.line-1));var o=t.getLine(n.line);if(r>0&&n.ch>=o.length)return t.clipPos(u(n.line+1,0));for(var i,l="start",a=n.ch,s=r<0?0:o.length,c=0;a!=s;a+=r,c++){var f=o.charAt(r<0?a-1:a),d="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==d&&f.toUpperCase()==f&&(d="W"),"start"==l)"o"!=d&&(l="in",i=d);else if("in"==l&&i!=d){if("w"==i&&"W"==d&&r<0&&a--,"W"==i&&"w"==d&&r>0){i="w";continue}break}}return u(n.line,a)}(t.doc,r.head,n):n<0?r.from():r.to()})}function n(t,n){if(t.isReadOnly())return e.Pass;t.operation(function(){for(var e=t.listSelections().length,r=[],o=-1,i=0;i<e;i++){var l=t.listSelections()[i].head;if(!(l.line<=o)){var a=u(l.line+(n?0:1),0);t.replaceRange("\n",a,null,"+insertLine"),t.indentLine(a.line,null,!0),r.push({head:a,anchor:a}),o=l.line+1}}t.setSelections(r)}),t.execCommand("indentAuto")}function r(t,n){for(var r=n.ch,o=r,i=t.getLine(n.line);r&&e.isWordChar(i.charAt(r-1));)--r;for(;o<i.length&&e.isWordChar(i.charAt(o));)++o;return{from:u(n.line,r),to:u(n.line,o),word:i.slice(r,o)}}function o(e,t){for(var n=e.listSelections(),r=[],o=0;o<n.length;o++){var i=n[o],l={anchor:e.findPosV(i.anchor,t,"line"),head:e.findPosV(i.head,t,"line")};r.push(i),r.push(l)}e.setSelections(r)}function i(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var o=t[r].head,i=e.scanForBracket(o,-1);if(!i)return!1;for(;;){var l=e.scanForBracket(o,1);if(!l)return!1;if(l.ch==d.charAt(d.indexOf(i.ch)+1)){n.push({anchor:u(i.pos.line,i.pos.ch+1),head:l.pos});break}o=u(l.pos.line,l.pos.ch+1)}}return e.setSelections(n),!0}function l(t,n){if(t.isReadOnly())return e.Pass;for(var r,o=t.listSelections(),i=[],l=0;l<o.length;l++){var a=o[l];if(!a.empty()){for(var s=a.from().line,c=a.to().line;l<o.length-1&&o[l+1].from().line==c;)c=o[++l].to().line;o[l].to().ch||c--,i.push(s,c)}}i.length?r=!0:i.push(t.firstLine(),t.lastLine()),t.operation(function(){for(var e=[],o=0;o<i.length;o+=2){var l=i[o],a=i[o+1],s=u(l,0),c=u(a),f=t.getRange(s,c,!1);n?f.sort():f.sort(function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),e<t?-1:e==t?0:1}),t.replaceRange(f,s,c),r&&e.push({anchor:s,head:u(a+1,0)})}r&&t.setSelections(e,0)})}function a(t,n){t.operation(function(){for(var o=t.listSelections(),i=[],l=[],a=0;a<o.length;a++){(c=o[a]).empty()?(i.push(a),l.push("")):l.push(n(t.getRange(c.from(),c.to())))}t.replaceSelections(l,"around","case");for(var s,a=i.length-1;a>=0;a--){var c=o[i[a]];if(!(s&&e.cmpPos(c.head,s)>0)){var f=r(t,c.head);s=f.from,t.replaceRange(n(f.word),f.from,f.to)}}})}function s(t){var n=t.getCursor("from"),o=t.getCursor("to");if(0==e.cmpPos(n,o)){var i=r(t,n);if(!i.word)return;n=i.from,o=i.to}return{from:n,to:o,query:t.getRange(n,o),word:i}}function c(e,t){var n=s(e);if(n){var r=n.query,o=e.getSearchCursor(r,t?n.to:n.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(r,t?u(e.firstLine(),0):e.clipPos(u(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):n.word&&e.setSelection(n.from,n.to))}}var f=e.commands,u=e.Pos;f.goSubwordLeft=function(e){t(e,-1)},f.goSubwordRight=function(e){t(e,1)},f.scrollLineUp=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},f.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},f.splitSelectionByLine=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)for(var o=t[r].from(),i=t[r].to(),l=o.line;l<=i.line;++l)i.line>o.line&&l==i.line&&0==i.ch||n.push({anchor:l==o.line?o:u(l,0),head:l==i.line?i:u(l)});e.setSelections(n,0)},f.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},f.selectLine=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var o=t[r];n.push({anchor:u(o.from().line,0),head:u(o.to().line+1,0)})}e.setSelections(n)},f.insertLineAfter=function(e){return n(e,!1)},f.insertLineBefore=function(e){return n(e,!0)},f.selectNextOccurrence=function(t){var n=t.getCursor("from"),o=t.getCursor("to"),i=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(n,o)){var l=r(t,n);if(!l.word)return;t.setSelection(l.from,l.to),i=!0}else{var a=t.getRange(n,o),s=i?new RegExp("\\b"+a+"\\b"):a,c=t.getSearchCursor(s,o),f=c.findNext();if(f||(f=(c=t.getSearchCursor(s,u(t.firstLine(),0))).findNext()),!f||function(e,t,n){for(var r=0;r<e.length;r++)if(e[r].from()==t&&e[r].to()==n)return!0;return!1}(t.listSelections(),c.from(),c.to()))return e.Pass;t.addSelection(c.from(),c.to())}i&&(t.state.sublimeFindFullWord=t.doc.sel)},f.addCursorToPrevLine=function(e){o(e,-1)},f.addCursorToNextLine=function(e){o(e,1)};var d="(){}[]";f.selectScope=function(e){i(e)||e.execCommand("selectAll")},f.selectBetweenBrackets=function(t){if(!i(t))return e.Pass},f.goToBracket=function(t){t.extendSelectionsBy(function(n){var r=t.scanForBracket(n.head,1);if(r&&0!=e.cmpPos(r.pos,n.head))return r.pos;var o=t.scanForBracket(n.head,-1);return o&&u(o.pos.line,o.pos.ch+1)||n.head})},f.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),r=[],o=t.firstLine()-1,i=[],l=0;l<n.length;l++){var a=n[l],s=a.from().line-1,c=a.to().line;i.push({anchor:u(a.anchor.line-1,a.anchor.ch),head:u(a.head.line-1,a.head.ch)}),0!=a.to().ch||a.empty()||--c,s>o?r.push(s,c):r.length&&(r[r.length-1]=c),o=c}t.operation(function(){for(var e=0;e<r.length;e+=2){var n=r[e],o=r[e+1],l=t.getLine(n);t.replaceRange("",u(n,0),u(n+1,0),"+swapLine"),o>t.lastLine()?t.replaceRange("\n"+l,u(t.lastLine()),null,"+swapLine"):t.replaceRange(l+"\n",u(o,0),null,"+swapLine")}t.setSelections(i),t.scrollIntoView()})},f.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),r=[],o=t.lastLine()+1,i=n.length-1;i>=0;i--){var l=n[i],a=l.to().line+1,s=l.from().line;0!=l.to().ch||l.empty()||a--,a<o?r.push(a,s):r.length&&(r[r.length-1]=s),o=s}t.operation(function(){for(var e=r.length-2;e>=0;e-=2){var n=r[e],o=r[e+1],i=t.getLine(n);n==t.lastLine()?t.replaceRange("",u(n-1),u(n),"+swapLine"):t.replaceRange("",u(n,0),u(n+1,0),"+swapLine"),t.replaceRange(i+"\n",u(o,0),null,"+swapLine")}t.scrollIntoView()})},f.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},f.joinLines=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){for(var o=t[r],i=o.from(),l=i.line,a=o.to().line;r<t.length-1&&t[r+1].from().line==a;)a=t[++r].to().line;n.push({start:l,end:a,anchor:!o.empty()&&i})}e.operation(function(){for(var t=0,r=[],o=0;o<n.length;o++){for(var i,l=n[o],a=l.anchor&&u(l.anchor.line-t,l.anchor.ch),s=l.start;s<=l.end;s++){var c=s-t;s==l.end&&(i=u(c,e.getLine(c).length+1)),c<e.lastLine()&&(e.replaceRange(" ",u(c),u(c+1,/^\s*/.exec(e.getLine(c+1))[0].length)),++t)}r.push({anchor:a||i,head:i})}e.setSelections(r,0)})},f.duplicateLine=function(e){e.operation(function(){for(var t=e.listSelections().length,n=0;n<t;n++){var r=e.listSelections()[n];r.empty()?e.replaceRange(e.getLine(r.head.line)+"\n",u(r.head.line,0)):e.replaceRange(e.getRange(r.from(),r.to()),r.from())}e.scrollIntoView()})},f.sortLines=function(e){l(e,!0)},f.sortLinesInsensitive=function(e){l(e,!1)},f.nextBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},f.prevBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},f.toggleBookmark=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var o=t[r].from(),i=t[r].to(),l=e.findMarks(o,i),a=0;a<l.length;a++)if(l[a].sublimeBookmark){l[a].clear();for(var s=0;s<n.length;s++)n[s]==l[a]&&n.splice(s--,1);break}a==l.length&&n.push(e.markText(o,i,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},f.clearBookmarks=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},f.selectBookmarks=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var o=t[r].find();o?n.push({anchor:o.from,head:o.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},f.smartBackspace=function(t){if(t.somethingSelected())return e.Pass;t.operation(function(){for(var n=t.listSelections(),r=t.getOption("indentUnit"),o=n.length-1;o>=0;o--){var i=n[o].head,l=t.getRange({line:i.line,ch:0},i),a=e.countColumn(l,null,t.getOption("tabSize")),s=t.findPosH(i,-1,"char",!1);if(l&&!/\S/.test(l)&&a%r==0){var c=new u(i.line,e.findColumn(l,a-r,r));c.ch!=i.ch&&(s=c)}t.replaceRange("",s,i,"+delete")}})},f.delLineRight=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,u(t[n].to().line),"+delete");e.scrollIntoView()})},f.upcaseAtCursor=function(e){a(e,function(e){return e.toUpperCase()})},f.downcaseAtCursor=function(e){a(e,function(e){return e.toLowerCase()})},f.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},f.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},f.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),o=n;if(e.cmpPos(r,o)>0){var i=o;o=r,r=i}t.state.sublimeKilled=t.getRange(r,o),t.replaceRange("",r,o)}},f.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},f.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},f.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},f.selectLinesUpward=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line>e.firstLine()&&e.addSelection(u(r.head.line-1,r.head.ch))}})},f.selectLinesDownward=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line<e.lastLine()&&e.addSelection(u(r.head.line+1,r.head.ch))}})},f.findUnder=function(e){c(e,!0)},f.findUnderPrevious=function(e){c(e,!1)},f.findAllUnder=function(e){var t=s(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],o=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&o++;e.setSelections(r,o)}};var h=e.keyMap;h.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Up":"addCursorToPrevLine","Shift-Cmd-Down":"addCursorToNextLine","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F9:"sortLines","Cmd-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"selectLinesUpward","Ctrl-Shift-Down":"selectLinesDownward","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(h.macSublime),h.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Alt-CtrlUp":"addCursorToPrevLine","Alt-CtrlDown":"addCursorToNextLine","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Ctrl-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"selectLinesUpward","Ctrl-Alt-Down":"selectLinesDownward","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(h.pcSublime);var m=h.default==h.macDefault;h.sublime=m?h.macSublime:h.pcSublime});

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