mikuli.cz

:)
git clone https://git.sr.ht/~ashymad/mikuli.cz
Log | Files | Refs

commit 0eadad180fa75c105fed46783488383f843a9df7
parent be734ff73e474fc08333006d261d7762d967e765
Author: markseu <mark2011@mayberg.se>
Date:   Sat,  7 Mar 2020 18:15:58 +0100

Updated installation files

Diffstat:
Msystem/extensions/core.php | 40++++++++++++++++++++++++++++++++--------
Msystem/extensions/edit.js | 5+++--
2 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/system/extensions/core.php b/system/extensions/core.php @@ -2388,7 +2388,7 @@ class YellowToolbox { $elementsSvg = array( "svg", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "feblend", "fecolormatrix", "fecomponenttransfer", "fecomposite", "feconvolvematrix", "fediffuselighting", "fedisplacementmap", "fedistantlight", "feflood", "fefunca", "fefuncb", "fefuncg", "fefuncr", "fegaussianblur", "femerge", "femergenode", "femorphology", "feoffset", "fepointlight", "fespecularlighting", "fespotlight", "fetile", "feturbulence", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "use", "view", "vkern"); $attributesHtml = array( - "accept", "action", "align", "allowfullscreen", "alt", "autocomplete", "background", "bgcolor", "border", "cellpadding", "cellspacing", "charset", "checked", "cite", "class", "clear", "color", "cols", "colspan", "content", "coords", "crossorigin", "datetime", "default", "dir", "disabled", "download", "enctype", "face", "for", "frameborder", "headers", "height", "hidden", "high", "href", "hreflang", "id", "integrity", "ismap", "label", "lang", "list", "loop", "low", "max", "maxlength", "media", "method", "min", "multiple", "name", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "poster", "prefix", "preload", "property", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "type", "usemap", "valign", "value", "width", "xmlns"); + "accept", "action", "align", "allowfullscreen", "alt", "autocomplete", "background", "bgcolor", "border", "cellpadding", "cellspacing", "charset", "checked", "cite", "class", "clear", "color", "cols", "colspan", "content", "coords", "crossorigin", "datetime", "default", "dir", "disabled", "download", "enctype", "face", "for", "frameborder", "headers", "height", "hidden", "high", "href", "hreflang", "id", "integrity", "ismap", "label", "lang", "list", "loop", "low", "max", "maxlength", "media", "method", "min", "multiple", "name", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "poster", "prefix", "preload", "property", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "target", "title", "type", "usemap", "valign", "value", "width", "xmlns"); $attributesSvg = array( "accent-height", "accumulate", "additivive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "datenstrom", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "tabindex", "targetx", "targety", "transform", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xlink:href", "xml:id", "xml:space", "xmlns", "y", "y1", "y2", "z", "zoomandpan"); $elementsSafe = $elementsHtml; @@ -3156,43 +3156,67 @@ class YellowExtensions { } } -// Unicode string support +// Check if string is empty function strempty($string) { return is_null($string) || $string===""; } -function strencode($string) { - return addcslashes($string, "\'\"\\\/"); -} -function strreplaceu() { - return call_user_func_array("str_replace", func_get_args()); -} + +// Make string lowercase, UTF-8 compatible function strtoloweru() { return call_user_func_array("mb_strtolower", func_get_args()); } + +// Make string uppercase, UTF-8 compatible function strtoupperu() { return call_user_func_array("mb_strtoupper", func_get_args()); } + +// Return string length, UTF-8 compatible function strlenu() { return call_user_func_array("mb_strlen", func_get_args()); } + +// Return string length in bytes, ASCII compatible function strlenb() { return call_user_func_array("strlen", func_get_args()); } + +// Return string positon, UTF-8 compatible function strposu() { return call_user_func_array("mb_strpos", func_get_args()); } + +// Return string position in bytes, ASCII compatible function strposb() { return call_user_func_array("strpos", func_get_args()); } + +// Return reverse string position, UTF-8 compatible function strrposu() { return call_user_func_array("mb_strrpos", func_get_args()); } + +// Return reverse string position in bytes, ASCII compatible function strrposb() { return call_user_func_array("strrpos", func_get_args()); } + +// Return part of a string, UTF-8 compatible function substru() { return call_user_func_array("mb_substr", func_get_args()); } + +// Return part of a string of bytes, ASCII compatible function substrb() { return call_user_func_array("substr", func_get_args()); } + +// Replace string, UTF-8 compatible +function strreplaceu() { + return call_user_func_array("str_replace", func_get_args()); +} + +// Encode string, suitable for JavaScript arguments +function strencode($string) { + return addcslashes($string, "\'\"\\\/"); +} diff --git a/system/extensions/edit.js b/system/extensions/edit.js @@ -866,8 +866,9 @@ yellow.edit = { bindActions: function(element) { var elements = element.getElementsByTagName("a"); for (var i=0, l=elements.length; i<l; i++) { - var href = elements[i].getAttribute("href"); - if (href.substring(0, 13)=="#data-action-") elements[i].setAttribute("data-action", href.substring(13)); + if (elements[i].getAttribute("href") && elements[i].getAttribute("href").substring(0, 13)=="#data-action-") { + elements[i].setAttribute("data-action", elements[i].getAttribute("href").substring(13)); + } if (elements[i].getAttribute("data-action")) elements[i].onclick = yellow.onClickAction; if (elements[i].getAttribute("data-action")=="toolbar") elements[i].onmousedown = function(e) { e.preventDefault(); }; }