CoreFiles by mySites.guru
foldcode.min.js1 lines, 2,551 bytes, from Joomla_4.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta4
md5
d45eee9fb493f78b7af7d5d20451bcad
sha1
1c317e39c509c6a9bbf8703cda4b868feac1b454
sha256
388e7166e1f791ebe0824a410fced4f9933c9b3d7ed7af86aea0fea05949f585
!function(n){"object"==typeof exports&&"object"==typeof module?n(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)}(function(n){"use strict";function o(o,e,t,i){if(t&&t.call){var l=t;t=null}else l=r(o,t,"rangeFinder");"number"==typeof e&&(e=n.Pos(e,0));var f=r(o,t,"minFoldSize");function d(n){var r=l(o,e);if(!r||r.to.line-r.from.line<f)return null;for(var t=o.findMarksAt(r.from),d=0;d<t.length;++d)if(t[d].__isFold&&"fold"!==i){if(!n)return null;r.cleared=!0,t[d].clear()}return r}var u=d(!0);if(r(o,t,"scanUp"))for(;!u&&e.line>o.firstLine();)e=n.Pos(e.line-1,0),u=d(!1);if(u&&!u.cleared&&"unfold"!==i){var a=function(n,o,e){var t=r(n,o,"widget");"function"==typeof t&&(t=t(e.from,e.to));if("string"==typeof t){var i=document.createTextNode(t);(t=document.createElement("span")).appendChild(i),t.className="CodeMirror-foldmarker"}else t&&(t=t.cloneNode(!0));return t}(o,t,u);n.on(a,"mousedown",function(o){c.clear(),n.e_preventDefault(o)});var c=o.markText(u.from,u.to,{replacedWith:a,clearOnEnter:r(o,t,"clearOnEnter"),__isFold:!0});c.on("clear",function(e,r){n.signal(o,"unfold",o,e,r)}),n.signal(o,"fold",o,u.from,u.to)}}n.newFoldFunction=function(n,e){return function(r,t){o(r,t,{rangeFinder:n,widget:e})}},n.defineExtension("foldCode",function(n,e,r){o(this,n,e,r)}),n.defineExtension("isFolded",function(n){for(var o=this.findMarksAt(n),e=0;e<o.length;++e)if(o[e].__isFold)return!0}),n.commands.toggleFold=function(n){n.foldCode(n.getCursor())},n.commands.fold=function(n){n.foldCode(n.getCursor(),null,"fold")},n.commands.unfold=function(n){n.foldCode(n.getCursor(),null,"unfold")},n.commands.foldAll=function(o){o.operation(function(){for(var e=o.firstLine(),r=o.lastLine();e<=r;e++)o.foldCode(n.Pos(e,0),null,"fold")})},n.commands.unfoldAll=function(o){o.operation(function(){for(var e=o.firstLine(),r=o.lastLine();e<=r;e++)o.foldCode(n.Pos(e,0),null,"unfold")})},n.registerHelper("fold","combine",function(){var n=Array.prototype.slice.call(arguments,0);return function(o,e){for(var r=0;r<n.length;++r){var t=n[r](o,e);if(t)return t}}}),n.registerHelper("fold","auto",function(n,o){for(var e=n.getHelpers(o,"fold"),r=0;r<e.length;r++){var t=e[r](n,o);if(t)return t}});var e={rangeFinder:n.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function r(n,o,r){if(o&&void 0!==o[r])return o[r];var t=n.options.foldOptions;return t&&void 0!==t[r]?t[r]:e[r]}n.defineOption("foldOptions",null),n.defineExtension("foldOption",function(n,o){return r(this,n,o)})});

The same content is in 7 releases, Joomla 4.0.0-beta to 4.0.0-beta7. See them all, or every version of this file.