CoreFiles by mySites.guru
mark-selection.min.js1 lines, 1,776 bytes, from Joomla_4.0.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 3.10.0-alpha9
md5
f471021b7116f71eb2382cdd2be1521d
sha1
e4dc71eafde2ee7fbb097b87e3f05640d4c59243
sha256
a44779961dfd6bbc803aa6cb901a2d1740aa6b0e502508fb1a441e37bf6d62db
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.markedSelection&&e.operation(function(){!function(e){if(!e.somethingSelected())return r(e);if(e.listSelections().length>1)return i(e);var t=e.getCursor("start"),n=e.getCursor("end"),f=e.state.markedSelection;if(!f.length)return o(e,t,n);var a=f[0].find(),s=f[f.length-1].find();if(!a||!s||n.line-t.line<=l||c(t,s.to)>=0||c(n,a.from)<=0)return i(e);for(;c(t,a.from)>0;)f.shift().clear(),a=f[0].find();c(t,a.from)<0&&(a.to.line-t.line<l?(f.shift().clear(),o(e,t,a.to,0)):o(e,t,a.from,0));for(;c(n,s.to)<0;)f.pop().clear(),s=f[f.length-1].find();c(n,s.to)>0&&(n.line-s.from.line<l?(f.pop().clear(),o(e,s.from,n)):o(e,s.to,n))}(e)})}function n(e){e.state.markedSelection&&e.state.markedSelection.length&&e.operation(function(){r(e)})}function o(e,t,n,o){if(0!=c(t,n))for(var r=e.state.markedSelection,i=e.state.markedSelectionStyle,a=t.line;;){var s=a==t.line?t:f(a,0),d=a+l,m=d>=n.line,u=m?n:f(d,0),S=e.markText(s,u,{className:i});if(null==o?r.push(S):r.splice(o++,0,S),m)break;a=d}}function r(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function i(e){r(e);for(var t=e.listSelections(),n=0;n<t.length;n++)o(e,t[n].from(),t[n].to())}e.defineOption("styleSelectedText",!1,function(o,l,f){var c=f&&f!=e.Init;l&&!c?(o.state.markedSelection=[],o.state.markedSelectionStyle="string"==typeof l?l:"CodeMirror-selectedtext",i(o),o.on("cursorActivity",t),o.on("change",n)):!l&&c&&(o.off("cursorActivity",t),o.off("change",n),r(o),o.state.markedSelection=o.state.markedSelectionStyle=null)});var l=8,f=e.Pos,c=e.cmpPos});

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