From 32478cec02395158ccde04b0da698951c10b0501 Mon Sep 17 00:00:00 2001 From: demmm Date: Mon, 23 Sep 2024 17:39:05 +0200 Subject: [PATCH] update to latest transifex js check if it fixes live translations, no KaOS adjustments yet --- js/live.js | 1161 +++++++++++++++++++++++++++++----------------------- 1 file changed, 660 insertions(+), 501 deletions(-) diff --git a/js/live.js b/js/live.js index 49af7e6..3d6dee9 100644 --- a/js/live.js +++ b/js/live.js @@ -1,5 +1,8 @@ +/* + @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.0.8/LICENSE */ +'use strict'; (function() { - var LIB_VERSION = 119; + var LIB_VERSION = 138; window.Transifex = window.Transifex || {}; window.Transifex.live = window.Transifex.live || {}; window.Transifex.live._ = window.Transifex.live._ || {}; @@ -12,6 +15,7 @@ TXLIVE_PRIVATE.removeCommentsRegex = /\x3c!--([\s\S]*?)--\x3e/g; TXLIVE_PRIVATE.manifest_ready = false; + TXLIVE_PRIVATE.language_views_tracked_onload = false; if (TXLIVE.loaded && TXLIVE.lib_version && TXLIVE.lib_version >= LIB_VERSION) return; TXLIVE.loaded = true; TXLIVE.ready = false; @@ -29,10 +33,10 @@ dynamic: true }; - function setSettings(options, override) { + function setSettings(options, + override) { if (!options) return; - var k, - i; + var k, i; if (override) for (k in options) TXLIVE.settings[k] = options[k]; else @@ -42,29 +46,35 @@ TXLIVE.settings.prerender = Boolean(TXLIVE.settings.prerender | 0); TXLIVE.settings.dynamic = Boolean(TXLIVE.settings.dynamic | 0); TXLIVE.settings.rtl_layout = Boolean(TXLIVE.settings.rtl_layout | 0); - TXLIVE.settings.xss_protect = Boolean(TXLIVE.settings.xss_protect | 0); - TXLIVE.settings.manual_init = Boolean(TXLIVE.settings.manual_init | + TXLIVE.settings.xss_protect = Boolean(TXLIVE.settings.xss_protect | 0); + TXLIVE.settings.manual_init = Boolean(TXLIVE.settings.manual_init | 0); + TXLIVE.settings.reload_on_language_picker = Boolean(TXLIVE.settings.reload_on_language_picker | 0); TXLIVE.settings.translate_urls = Boolean(TXLIVE.settings.translate_urls | 0); TXLIVE.settings.ignore_databind = Boolean(TXLIVE.settings.ignore_databind | 0); TXLIVE.settings.staging = Boolean(TXLIVE.settings.staging | 0); TXLIVE.settings.cdn = TXLIVE.settings.cdn || "//cdn.transifex.com/"; - TXLIVE.settings.autocollect_url = TXLIVE.settings.autocollect_url || "//live-detector.svc.transifex.net"; + TXLIVE.settings.autocollect_url = TXLIVE.settings.autocollect_url || + "//live-detector.svc.transifex.net"; TXLIVE.settings.sidebar_base_url = TXLIVE.settings.sidebar_base_url || "https://app.transifex.com"; - TXLIVE.settings.assets_base_url = - TXLIVE.settings.assets_base_url || TXLIVE.settings.sidebar_base_url; + TXLIVE.settings.assets_base_url = TXLIVE.settings.assets_base_url || TXLIVE.settings.sidebar_base_url; TXLIVE.settings.sidebar_lang = TXLIVE.settings.sidebar_lang || "en"; + TXLIVE.settings.telemetry_url = TXLIVE.settings.telemetry_url || "https://telemetry.svc.transifex.net/live/integration"; + if ("ping_telemetry" in TXLIVE.settings) TXLIVE.settings.ping_telemetry = !!TXLIVE.settings.ping_telemetry; + else TXLIVE.settings.ping_telemetry = true; if (TXLIVE.settings.detectlang && typeof TXLIVE.settings.detectlang === "string") TXLIVE.settings.detectlang = Boolean(TXLIVE.settings.detectlang | 0); if (TXLIVE.settings.parse_attr && TXLIVE.settings.parse_attr.length) for (i = 0; i < TXLIVE.settings.parse_attr.length; ++i) TXLIVE.settings.parse_attr[i] = TXLIVE.settings.parse_attr[i].toLowerCase(); if (TXLIVE.settings.enable_tags && TXLIVE.settings.enable_tags.length) - for (i = - 0; i < TXLIVE.settings.enable_tags.length; ++i) TXLIVE.settings.enable_tags[i] = (TXLIVE.settings.enable_tags[i] || "").toUpperCase(); + for (i = 0; i < TXLIVE.settings.enable_tags.length; ++i) TXLIVE.settings.enable_tags[i] = + (TXLIVE.settings.enable_tags[i] || "").toUpperCase(); if (TXLIVE.settings.ignore_tags && TXLIVE.settings.ignore_tags.length) for (i = 0; i < TXLIVE.settings.ignore_tags.length; ++i) TXLIVE.settings.ignore_tags[i] = (TXLIVE.settings.ignore_tags[i] || "").toUpperCase(); if (TXLIVE.settings.ignore_class && TXLIVE.settings.ignore_class.length) - for (i = 0; i < TXLIVE.settings.ignore_class.length; ++i) TXLIVE.settings.ignore_class[i] = (TXLIVE.settings.ignore_class[i] || - "").toLowerCase() + for (i = 0; i < TXLIVE.settings.ignore_class.length; ++i) TXLIVE.settings.ignore_class[i] = (TXLIVE.settings.ignore_class[i] || "").toLowerCase(); + if (TXLIVE.settings.tags_as_blocks && TXLIVE.settings.tags_as_blocks.length) + for (i = + 0; i < TXLIVE.settings.tags_as_blocks.length; ++i) TXLIVE.settings.tags_as_blocks[i] = (TXLIVE.settings.tags_as_blocks[i] || "").toUpperCase() }(function() { var _prevDOMPurify = window.DOMPurify; ! function(e, t) { @@ -76,17 +86,17 @@ r = Object.freeze, o = Object.seal, i = Object.create, - a = "undefined" != typeof Reflect && Reflect, + a = "undefined" != typeof Reflect && + Reflect, l = a.apply, c = a.construct; l || (l = function(e, t, n) { return e.apply(t, n) }), r || (r = function(e) { return e - }), o || (o = - function(e) { - return e - }), c || (c = function(e, t) { + }), o || (o = function(e) { + return e + }), c || (c = function(e, t) { return new(Function.prototype.bind.apply(e, [null].concat(function(e) { if (Array.isArray(e)) { for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t]; @@ -104,11 +114,10 @@ h = T(String.prototype.indexOf), g = T(String.prototype.trim), v = T(RegExp.prototype.test), - b = (s = TypeError, - function() { - for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n]; - return c(s, t) - }); + b = (s = TypeError, function() { + for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n]; + return c(s, t) + }); function T(e) { return function(t) { @@ -136,31 +145,30 @@ for (r in t) l(e, t, [r]) && (n[r] = t[r]); return n } - var S = r(["a", "abbr", "acronym", "address", "area", "article", - "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", - "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr" + var S = r(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", + "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr" ]), - k = r(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "audio", "canvas", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", - "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "video", "view", "vkern" + k = r(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", + "audio", "canvas", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "video", "view", "vkern" ]), - _ = r(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feMerge", "feMergeNode", "feMorphology", "feOffset", - "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence" + _ = r(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", + "feFuncG", "feFuncR", "feGaussianBlur", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence" ]), D = r(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover"]), E = r(["#text"]), - L = r(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", - "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", - "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "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", "translate", "type", "usemap", "valign", "value", "width", "xmlns" + L = r(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", + "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", + "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "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", "translate", "type", "usemap", "valign", "value", "width", "xmlns" ]), - w = r(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", - "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "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", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", - "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan" + w = r(["accent-height", + "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "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", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", + "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", + "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan" ]), - M = r(["accent", "accentunder", - "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", - "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns" + M = r(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", + "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns" ]), O = r(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), N = o(/\{\{[\s\S]*|[\s\S]*\}\}/gm), @@ -170,8 +178,7 @@ H = o(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), z = o(/^(?:\w+script|data):/i), I = o(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), - j = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? - function(e) { + j = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e @@ -190,8 +197,7 @@ W = function(e, t) { if ("object" !== (void 0 === e ? "undefined" : j(e)) || "function" != typeof e.createPolicy) return null; var n = null; - t.currentScript && t.currentScript.hasAttribute("data-tt-policy-suffix") && - (n = t.currentScript.getAttribute("data-tt-policy-suffix")); + t.currentScript && t.currentScript.hasAttribute("data-tt-policy-suffix") && (n = t.currentScript.getAttribute("data-tt-policy-suffix")); var r = "dompurify" + (n ? "#" + n : ""); try { return e.createPolicy(r, { @@ -199,7 +205,7 @@ return e } }) - } catch (e$0) { + } catch (e) { return console.warn("TrustedTypes policy " + r + " could not be created."), null } }; @@ -236,7 +242,7 @@ re = {}; try { re = x(i).documentMode ? i.documentMode : {} - } catch (e$1) {} + } catch (e) {} var oe = {}; n.isSupported = J && void 0 !== J.createHTMLDocument && 9 !== re; var ie = N, @@ -267,8 +273,8 @@ Me = !0, Oe = !1, Ne = {}, - Re = A({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "plaintext", "script", "style", "svg", "template", "thead", "title", - "video", "xmp" + Re = A({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", + "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp" ]), Fe = null, Ce = A({}, ["audio", "video", "img", "source", "image", "track"]), @@ -277,9 +283,10 @@ Ie = null, je = i.createElement("form"), Ue = function(e) { - Ie && Ie === e || (e && "object" === (void 0 === e ? "undefined" : j(e)) || (e = {}), e = x(e), fe = "ALLOWED_TAGS" in e ? A({}, e.ALLOWED_TAGS) : pe, me = "ALLOWED_ATTR" in e ? A({}, e.ALLOWED_ATTR) : ye, He = "ADD_URI_SAFE_ATTR" in e ? A(x(ze), e.ADD_URI_SAFE_ATTR) : ze, Fe = "ADD_DATA_URI_TAGS" in - e ? A(x(Ce), e.ADD_DATA_URI_TAGS) : Ce, he = "FORBID_TAGS" in e ? A({}, e.FORBID_TAGS) : {}, ge = "FORBID_ATTR" in e ? A({}, e.FORBID_ATTR) : {}, Ne = "USE_PROFILES" in e && e.USE_PROFILES, ve = !1 !== e.ALLOW_ARIA_ATTR, be = !1 !== e.ALLOW_DATA_ATTR, Te = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ae = e.SAFE_FOR_TEMPLATES || !1, xe = e.WHOLE_DOCUMENT || !1, _e = e.RETURN_DOM || !1, De = e.RETURN_DOM_FRAGMENT || !1, Ee = e.RETURN_DOM_IMPORT || !1, Le = e.RETURN_TRUSTED_TYPE || !1, ke = e.FORCE_BODY || !1, we = !1 !== e.SANITIZE_DOM, Me = !1 !== e.KEEP_CONTENT, Oe = e.IN_PLACE || !1, de = e.ALLOWED_URI_REGEXP || - de, Ae && (be = !1), De && (_e = !0), Ne && (fe = A({}, [].concat(U(E))), me = [], !0 === Ne.html && (A(fe, S), A(me, L)), !0 === Ne.svg && (A(fe, k), A(me, w), A(me, O)), !0 === Ne.svgFilters && (A(fe, _), A(me, w), A(me, O)), !0 === Ne.mathMl && (A(fe, D), A(me, M), A(me, O))), e.ADD_TAGS && (fe === pe && (fe = x(fe)), A(fe, e.ADD_TAGS)), e.ADD_ATTR && (me === ye && (me = x(me)), A(me, e.ADD_ATTR)), e.ADD_URI_SAFE_ATTR && A(He, e.ADD_URI_SAFE_ATTR), Me && (fe["#text"] = !0), xe && A(fe, ["html", "head", "body"]), fe.table && (A(fe, ["tbody"]), delete he.tbody), r && r(e), Ie = e) + Ie && Ie === e || (e && "object" === (void 0 === e ? "undefined" : j(e)) || (e = {}), e = x(e), fe = "ALLOWED_TAGS" in e ? A({}, e.ALLOWED_TAGS) : pe, me = "ALLOWED_ATTR" in e ? A({}, e.ALLOWED_ATTR) : ye, He = "ADD_URI_SAFE_ATTR" in + e ? A(x(ze), e.ADD_URI_SAFE_ATTR) : ze, Fe = "ADD_DATA_URI_TAGS" in e ? A(x(Ce), e.ADD_DATA_URI_TAGS) : Ce, he = "FORBID_TAGS" in e ? A({}, e.FORBID_TAGS) : {}, ge = "FORBID_ATTR" in e ? A({}, e.FORBID_ATTR) : {}, Ne = "USE_PROFILES" in e && e.USE_PROFILES, ve = !1 !== e.ALLOW_ARIA_ATTR, be = !1 !== e.ALLOW_DATA_ATTR, Te = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ae = e.SAFE_FOR_TEMPLATES || !1, xe = e.WHOLE_DOCUMENT || !1, _e = e.RETURN_DOM || !1, De = e.RETURN_DOM_FRAGMENT || !1, Ee = e.RETURN_DOM_IMPORT || !1, Le = e.RETURN_TRUSTED_TYPE || !1, ke = e.FORCE_BODY || !1, we = !1 !== e.SANITIZE_DOM, + Me = !1 !== e.KEEP_CONTENT, Oe = e.IN_PLACE || !1, de = e.ALLOWED_URI_REGEXP || de, Ae && (be = !1), De && (_e = !0), Ne && (fe = A({}, [].concat(U(E))), me = [], !0 === Ne.html && (A(fe, S), A(me, L)), !0 === Ne.svg && (A(fe, k), A(me, w), A(me, O)), !0 === Ne.svgFilters && (A(fe, _), A(me, w), A(me, O)), !0 === Ne.mathMl && (A(fe, D), A(me, M), A(me, O))), e.ADD_TAGS && (fe === pe && (fe = x(fe)), A(fe, e.ADD_TAGS)), e.ADD_ATTR && (me === ye && (me = x(me)), A(me, e.ADD_ATTR)), e.ADD_URI_SAFE_ATTR && A(He, e.ADD_URI_SAFE_ATTR), Me && (fe["#text"] = !0), xe && A(fe, ["html", "head", "body"]), fe.table && + (A(fe, ["tbody"]), delete he.tbody), r && r(e), Ie = e) }, Pe = function(e) { f(n.removed, { @@ -287,7 +294,7 @@ }); try { e.parentNode.removeChild(e) - } catch (t$2) { + } catch (t) { e.outerHTML = $ } }, @@ -297,7 +304,7 @@ attribute: t.getAttributeNode(e), from: t }) - } catch (e$3) { + } catch (e) { f(n.removed, { attribute: null, from: t @@ -316,11 +323,11 @@ var o = X ? X.createHTML(e) : e; try { t = (new K).parseFromString(o, "text/html") - } catch (e$4) {} + } catch (e) {} if (!t || !t.documentElement) { - var a = (t = J.createHTMLDocument("")).body; - a.parentNode.removeChild(a.parentNode.firstElementChild), - a.outerHTML = o + var a = + (t = J.createHTMLDocument("")).body; + a.parentNode.removeChild(a.parentNode.firstElementChild), a.outerHTML = o } return e && n && t.body.insertBefore(i.createTextNode(n), t.body.childNodes[0] || null), ee.call(t, xe ? "html" : "body")[0] }, @@ -330,8 +337,8 @@ }, !1) }, qe = function(e) { - return !(e instanceof G || e instanceof q) && !("string" == typeof e.nodeName && "string" == typeof e.textContent && "function" == typeof e.removeChild && e.attributes instanceof B && "function" == typeof e.removeAttribute && "function" == typeof e.setAttribute && - "string" == typeof e.namespaceURI) + return !(e instanceof G || e instanceof q) && !("string" == typeof e.nodeName && "string" == typeof e.textContent && "function" == typeof e.removeChild && + e.attributes instanceof B && "function" == typeof e.removeAttribute && "function" == typeof e.setAttribute && "string" == typeof e.namespaceURI) }, Ke = function(e) { return "object" === (void 0 === c ? "undefined" : j(c)) ? e instanceof c : e && "object" === (void 0 === e ? "undefined" : j(e)) && "number" == typeof e.nodeType && "string" == typeof e.nodeName @@ -344,23 +351,23 @@ Ye = function(e) { var t = void 0; if (Ve("beforeSanitizeElements", e, null), qe(e)) return Pe(e), !0; - if (m(e.nodeName, /[\u0080-\uFFFF]/)) return Pe(e), !0; + if (m(e.nodeName, /[\u0080-\uFFFF]/)) return Pe(e), + !0; var r = p(e.nodeName); if (Ve("uponSanitizeElement", e, { tagName: r, allowedTags: fe - }), ("svg" === - r || "math" === r) && 0 !== e.querySelectorAll("p, br").length) return Pe(e), !0; + }), ("svg" === r || "math" === r) && 0 !== e.querySelectorAll("p, br").length) return Pe(e), !0; if (!Ke(e.firstElementChild) && (!Ke(e.content) || !Ke(e.content.firstElementChild)) && v(/<[!/\w]/g, e.innerHTML) && v(/<[!/\w]/g, e.textContent)) return Pe(e), !0; if (!fe[r] || he[r]) { if (Me && !Re[r] && "function" == typeof e.insertAdjacentHTML) try { var o = e.innerHTML; e.insertAdjacentHTML("AfterEnd", X ? X.createHTML(o) : o) - } catch (e$5) {} + } catch (e) {} return Pe(e), !0 } - return "noscript" !== r && "noembed" !== r || !v(/<\/no(script|embed)/i, e.innerHTML) ? (Ae && 3 === e.nodeType && (t = e.textContent, - t = y(t, ie, " "), t = y(t, ae, " "), e.textContent !== t && (f(n.removed, { + return "noscript" !== + r && "noembed" !== r || !v(/<\/no(script|embed)/i, e.innerHTML) ? (Ae && 3 === e.nodeType && (t = e.textContent, t = y(t, ie, " "), t = y(t, ae, " "), e.textContent !== t && (f(n.removed, { element: e.cloneNode() }), e.textContent = t)), Ve("afterSanitizeElements", e, null), !1) : (Pe(e), !0) }, @@ -372,7 +379,8 @@ if (!me[t] || ge[t]) return !1; if (He[t]); else if (v(de, y(n, ue, ""))); - else if ("src" !== t && "xlink:href" !== t && "href" !== t || "script" === e || 0 !== h(n, "data:") || !Fe[e]) + else if ("src" !== t && "xlink:href" !== t && "href" !== t || "script" === e || 0 !== h(n, + "data:") || !Fe[e]) if (Te && !v(se, y(n, ue, ""))); else { if (n) return !1 @@ -382,8 +390,7 @@ return !0 }, $e = function(e) { - var t = - void 0, + var t = void 0, r = void 0, o = void 0, i = void 0; @@ -401,14 +408,14 @@ s = c.name, u = c.namespaceURI; if (r = g(t.value), o = p(s), l.attrName = o, l.attrValue = r, l.keepAttr = !0, l.forceKeepAttr = void 0, Ve("uponSanitizeAttribute", e, l), r = l.attrValue, !l.forceKeepAttr && (We(s, e), l.keepAttr)) - if (v(/\/>/i, r)) We(s, e); + if (v(/\/>/i, + r)) We(s, e); else { Ae && (r = y(r, ie, " "), r = y(r, ae, " ")); var f = e.nodeName.toLowerCase(); if (Xe(f, o, r)) try { - u ? - e.setAttributeNS(u, s, r) : e.setAttribute(s, r), d(n.removed) - } catch (e$6) {} + u ? e.setAttributeNS(u, s, r) : e.setAttribute(s, r), d(n.removed) + } catch (e) {} } } Ve("afterSanitizeAttributes", e, null) @@ -425,7 +432,8 @@ l = void 0, s = void 0, u = void 0, - d = void 0; + d = + void 0; if (e || (e = "\x3c!--\x3e"), "string" != typeof e && !Ke(e)) { if ("function" != typeof e.toString) throw b("toString is not a function"); if ("string" != typeof(e = e.toString())) throw b("dirty is not a string, aborting"); @@ -438,10 +446,10 @@ return e } if (Se || Ue(r), n.removed = [], "string" == typeof e && (Oe = !1), Oe); - else if (e instanceof c) 1 === (l = (i = Be("\x3c!----\x3e")).ownerDocument.importNode(e, !0)).nodeType && "BODY" === l.nodeName || "HTML" === l.nodeName ? i = l : i.appendChild(l); + else if (e instanceof c) 1 === (l = (i = Be("\x3c!----\x3e")).ownerDocument.importNode(e, + !0)).nodeType && "BODY" === l.nodeName || "HTML" === l.nodeName ? i = l : i.appendChild(l); else { - if (!_e && !Ae && - !xe && -1 === e.indexOf("<")) return X && Le ? X.createHTML(e) : e; + if (!_e && !Ae && !xe && -1 === e.indexOf("<")) return X && Le ? X.createHTML(e) : e; if (!(i = Be(e))) return _e ? null : $ } i && ke && Pe(i.firstChild); @@ -456,8 +464,7 @@ var p = xe ? i.outerHTML : i.innerHTML; return Ae && (p = y(p, ie, " "), p = y(p, ae, " ")), X && Le ? X.createHTML(p) : p }, n.setConfig = function(e) { - Ue(e), - Se = !0 + Ue(e), Se = !0 }, n.clearConfig = function() { Ie = null, Se = !1 }, n.isValidAttribute = function(e, t, n) { @@ -502,8 +509,7 @@ }, error: function(err) { var output = "[TXLIVE][ERROR] " + TXLIVE.logger.serialize(err); - if (window.liveSettings.debug && - console && console.log) console.log(output); + if (window.liveSettings.debug && console && console.log) console.log(output); return output } }; @@ -548,17 +554,16 @@ try { var isFrame = window.frameElement != null } catch (e) {} - if (document.documentElement.doScroll && - !isFrame) { - var tryScroll = function() { + if (document.documentElement.doScroll && !isFrame) { + function tryScroll() { if (called) return; try { document.documentElement.doScroll("left"); ready() - } catch (e$7) { + } catch (e) { setTimeout(tryScroll, 10) } - }; + } tryScroll() } document.attachEvent("onreadystatechange", function() { @@ -577,11 +582,32 @@ } function bindLoad(handler) { - if (window.addEventListener) window.addEventListener("load", - handler, false); + if (window.addEventListener) window.addEventListener("load", handler, false); else if (window.attachEvent) window.attachEvent("onload", handler) } + function bindNavigate(handler) { + try { + (function(history) { + var pushState = history.pushState; + history.pushState = function(state) { + if (typeof history.onpushstate == "function") history.onpushstate({ + state: state + }); + var path = arguments && arguments.length > 2 ? arguments[2] : null; + if (path) handler(path); + return pushState.apply(history, arguments) + } + })(window.history); + window.addEventListener("popstate", function(e) { + var url = new URL(document.location); + if (url && url.pathname) handler(url.pathname) + }) + } catch (err) { + TXLIVE.logger.error(err) + } + } + function callFunctionArray(fcallarray, param) { if (!fcallarray) return; var is_dynamic_on = TXLIVE.isDynamicPageOn(); @@ -594,7 +620,8 @@ if (is_dynamic_on) TXLIVE.dynamicPageOn() } - function removeFromFunctionArray(fcallarray, fcall) { + function removeFromFunctionArray(fcallarray, + fcall) { if (!fcallarray) return; try { var index = fcallarray.indexOf(fcall); @@ -619,7 +646,8 @@ }; TXLIVE.assetUrl = function(url, default_host) { if (!url || !default_host) return url; - var locase_url = url.toLowerCase().trim(); + var locase_url = + url.toLowerCase().trim(); if (locase_url.indexOf("http://") === 0 || locase_url.indexOf("https://") === 0 || locase_url.indexOf("//") === 0) return url; return default_host + (default_host.slice(-1) == "/" ? "" : "/") + (url.indexOf("/") === 0 ? url.slice(1) : url) }; @@ -630,8 +658,7 @@ var script = document.createElement("script"); script.type = "text/javascript"; if (script.readyState) script.onreadystatechange = function() { - if (script.readyState === - "loaded" || script.readyState === "complete") { + if (script.readyState === "loaded" || script.readyState === "complete") { script.onreadystatechange = null; if (callback) callback() } @@ -647,35 +674,34 @@ } attributes = attributes || []; for (var i = attributes.length; i--;) script[attributes[i].name] = attributes[i].value; - if (text) script.text = text; + if (text) script.text = + text; if (url) script.src = url; document.getElementsByTagName("head")[0].appendChild(script) }; - TXLIVE_PRIVATE.getBrowserLocale = - function() { - var i, code; - if (navigator.languages && navigator.languages.length) - for (i = 0; i < navigator.languages.length; ++i) { - code = TXLIVE.normalizeLangCode(navigator.languages[i]); - if (TXLIVE.hasLanguageCode(code)) return code; - code = TXLIVE.matchLanguageCode(navigator.languages[i]); - if (code) return code - } - if (navigator.userLanguage) { - code = TXLIVE.normalizeLangCode(navigator.userLanguage); - if (TXLIVE.hasLanguageCode(code)) return code; - code = TXLIVE.matchLanguageCode(navigator.userLanguage); - if (code) return code - } - if (navigator.language) { - code = - TXLIVE.normalizeLangCode(navigator.language); + TXLIVE_PRIVATE.getBrowserLocale = function() { + var i, code; + if (navigator.languages && navigator.languages.length) + for (i = 0; i < navigator.languages.length; ++i) { + code = TXLIVE.normalizeLangCode(navigator.languages[i]); if (TXLIVE.hasLanguageCode(code)) return code; - code = TXLIVE.matchLanguageCode(navigator.language); + code = TXLIVE.matchLanguageCode(navigator.languages[i]); if (code) return code } - return null - }; + if (navigator.userLanguage) { + code = TXLIVE.normalizeLangCode(navigator.userLanguage); + if (TXLIVE.hasLanguageCode(code)) return code; + code = TXLIVE.matchLanguageCode(navigator.userLanguage); + if (code) return code + } + if (navigator.language) { + code = TXLIVE.normalizeLangCode(navigator.language); + if (TXLIVE.hasLanguageCode(code)) return code; + code = TXLIVE.matchLanguageCode(navigator.language); + if (code) return code + } + return null + }; function mergeArrays(array1, array2) { var i = array2.length, @@ -700,8 +726,7 @@ } function decodeString(str) { - return str.replace(/ /g, - "\u00a0") + return str.replace(/ /g, "\u00a0") } TXLIVE_PRIVATE.stripWhitespace = function(str) { if (!str || !str.trim().length) return null; @@ -713,7 +738,8 @@ TXLIVE_PRIVATE.getElementsByClassName = function(node, classname) { if (!node) return []; var a = []; - var re = new RegExp("(^| )" + classname + "( |$)"); + var re = new RegExp("(^| )" + classname + + "( |$)"); var els = node.getElementsByTagName("*"); for (var i = 0, j = els.length; i < j; i++) if (re.test(els[i].className)) a.push(els[i]); @@ -732,12 +758,12 @@ }; TXLIVE_PRIVATE.removeClass = function(node, cls) { if (TXLIVE_PRIVATE.hasClass(node, cls)) { - var reg = new RegExp("(\\s|^)" + cls + "(\\s|$)"); + var reg = + new RegExp("(\\s|^)" + cls + "(\\s|$)"); node.className = node.className.replace(reg, " ") } }; - TXLIVE_PRIVATE.addClass = function(node, - cls) { + TXLIVE_PRIVATE.addClass = function(node, cls) { if (!TXLIVE_PRIVATE.hasClass(node, cls) && node.className !== undefined && node.className.baseVal === undefined) node.className = (node.className || "") + " " + cls }; TXLIVE_PRIVATE.removeNodeByID = function(id) { @@ -747,12 +773,12 @@ TXLIVE_PRIVATE.getClosestByTag = function(el, tag) { tag = tag.toUpperCase(); do - if (el.nodeName === tag) return el; while (el = el.parentNode); + if (el.nodeName === + tag) return el; while (el = el.parentNode); return null }; TXLIVE_PRIVATE.escapeLanguageCode = function(code) { - return code.replace(/-/g, - "_").replace(/[.@]/g, "__") + return code.replace(/-/g, "_").replace(/[.@]/g, "__") }; TXLIVE_PRIVATE.constructPath = function(pathname, search) { search = search || ""; @@ -765,14 +791,14 @@ search = search_params.join("&"); if (search) search = "?" + search } - return pathname + search + return pathname + + search }; TXLIVE_PRIVATE.getWindowLocation = function() { return window.location }; TXLIVE_PRIVATE.getWindowPath = function() { - return TXLIVE_PRIVATE.constructPath(window.location.pathname, - window.location.search) + return TXLIVE_PRIVATE.constructPath(window.location.pathname, window.location.search) }; TXLIVE_PRIVATE.getWindowHost = function() { return document.location.host @@ -787,8 +813,7 @@ TXLIVE.doCORSRequest = function(url, method, data, callback, errback) { var req, invoke_cb = true; if (window.XMLHttpRequest) { - req = - new XMLHttpRequest; + req = new XMLHttpRequest; if ("withCredentials" in req) { req.open(method, url, true); if (errback) req.onerror = function(err) { @@ -799,15 +824,15 @@ if (req.readyState === 4 && invoke_cb) { if (req.status >= 200 && req.status < 400) { if (callback) callback(req.responseText) - } else if (errback) errback(new Error("doCORSRequest failed with status " + req.status + " for: " + TXLIVE_PRIVATE.getWindowLocation().href), req.status); + } else if (errback) errback(new Error("doCORSRequest failed with status " + + req.status + " for: " + TXLIVE_PRIVATE.getWindowLocation().href), req.status); invoke_cb = false } }; req.send(data) } } else if (window.XDomainRequest) { - req = - new XDomainRequest; + req = new XDomainRequest; req.open(method, url); if (errback) req.onerror = function(err) { if (invoke_cb && errback) errback(err); @@ -821,13 +846,13 @@ } else if (errback) errback(new Error("doCORSRequest: CORS not supported by browser")) }; TXLIVE_PRIVATE.md5 = function() { - var rotateLeft = function(lValue, iShiftBits) { - return lValue << iShiftBits | lValue >>> 32 - iShiftBits - }; + var rotateLeft = + function(lValue, iShiftBits) { + return lValue << iShiftBits | lValue >>> 32 - iShiftBits + }; var addUnsigned = function(lX, lY) { var lX4, lY4, lX8, lY8, lResult; - lX8 = - lX & 2147483648; + lX8 = lX & 2147483648; lY8 = lY & 2147483648; lX4 = lX & 1073741824; lY4 = lY & 1073741824; @@ -842,7 +867,8 @@ return x & y | ~x & z }; var G = function(x, y, z) { - return x & z | y & ~z + return x & z | + y & ~z }; var H = function(x, y, z) { return x ^ y ^ z @@ -851,8 +877,7 @@ return y ^ (x | ~z) }; var FF = function(a, b, c, d, x, s, ac) { - a = addUnsigned(a, addUnsigned(addUnsigned(F(b, - c, d), x), ac)); + a = addUnsigned(a, addUnsigned(addUnsigned(F(b, c, d), x), ac)); return addUnsigned(rotateLeft(a, s), b) }; var GG = function(a, b, c, d, x, s, ac) { @@ -864,13 +889,13 @@ return addUnsigned(rotateLeft(a, s), b) }; var II = function(a, b, c, d, x, s, ac) { - a = addUnsigned(a, addUnsigned(addUnsigned(I(b, c, d), x), ac)); + a = addUnsigned(a, + addUnsigned(addUnsigned(I(b, c, d), x), ac)); return addUnsigned(rotateLeft(a, s), b) }; var convertToWordArray = function(string) { var lWordCount; - var lMessageLength = - string.length; + var lMessageLength = string.length; var lNumberOfWordsTempOne = lMessageLength + 8; var lNumberOfWordsTempTwo = (lNumberOfWordsTempOne - lNumberOfWordsTempOne % 64) / 64; var lNumberOfWords = (lNumberOfWordsTempTwo + 1) * 16; @@ -879,12 +904,12 @@ var lByteCount = 0; while (lByteCount < lMessageLength) { lWordCount = (lByteCount - lByteCount % 4) / 4; - lBytePosition = lByteCount % 4 * 8; + lBytePosition = lByteCount % + 4 * 8; lWordArray[lWordCount] = lWordArray[lWordCount] | string.charCodeAt(lByteCount) << lBytePosition; lByteCount++ } - lWordCount = (lByteCount - lByteCount % 4) / - 4; + lWordCount = (lByteCount - lByteCount % 4) / 4; lBytePosition = lByteCount % 4 * 8; lWordArray[lWordCount] = lWordArray[lWordCount] | 128 << lBytePosition; lWordArray[lNumberOfWords - 2] = lMessageLength << 3; @@ -896,7 +921,8 @@ WordToHexValueTemp = "", lByte, lCount; for (lCount = 0; lCount <= 3; lCount++) { - lByte = lValue >>> lCount * 8 & 255; + lByte = lValue >>> lCount * 8 & + 255; WordToHexValueTemp = "0" + lByte.toString(16); WordToHexValue = WordToHexValue + WordToHexValueTemp.substr(WordToHexValueTemp.length - 2, 2) } @@ -913,7 +939,8 @@ output += String.fromCharCode(c & 63 | 128) } else { output += String.fromCharCode(c >> 12 | 224); - output += String.fromCharCode(c >> 6 & 63 | 128); + output += String.fromCharCode(c >> + 6 & 63 | 128); output += String.fromCharCode(c & 63 | 128) } } @@ -923,8 +950,7 @@ var x = Array(); var k, AA, BB, CC, DD, a, b, c, d; var S11 = 7, - S12 = - 12, + S12 = 12, S13 = 17, S14 = 22; var S21 = 5, @@ -1039,8 +1065,7 @@ function _storage_set_localStorage(key, value) { try { - window.localStorage.setItem(key, - JSON.stringify(value)) + window.localStorage.setItem(key, JSON.stringify(value)) } catch (err) { TXLIVE.logger.error(err); _storage_set_emu(key, value) @@ -1060,7 +1085,8 @@ function _storage_set_sessionStorage(key, value) { try { - window.sessionStorage.setItem(key, JSON.stringify(value)) + window.sessionStorage.setItem(key, + JSON.stringify(value)) } catch (err) { TXLIVE.logger.error(err); _storage_set_emu(key, value) @@ -1069,8 +1095,7 @@ function _storage_get_sessionStorage(key) { try { - var value = - window.sessionStorage.getItem(key); + var value = window.sessionStorage.getItem(key); if (value) return JSON.parse(value); return null } catch (err) { @@ -1084,13 +1109,13 @@ TXLIVE_PRIVATE.session_get = _session_get_emu; try { if (window.localStorage && window.localStorage.setItem) { - window.localStorage.setItem("txlive", "1"); + window.localStorage.setItem("txlive", + "1"); TXLIVE_PRIVATE.storage_set = _storage_set_localStorage; - TXLIVE_PRIVATE.storage_get = - _storage_get_localStorage; + TXLIVE_PRIVATE.storage_get = _storage_get_localStorage; TXLIVE.settings.has_storage = true } - } catch (err$8) { + } catch (err) { try { if (window.sessionStorage && window.sessionStorage.setItem) { window.sessionStorage.setItem("txlive", "1"); @@ -1102,13 +1127,13 @@ } try { if (window.sessionStorage && window.sessionStorage.setItem) { - window.sessionStorage.setItem("txlive", "1"); + window.sessionStorage.setItem("txlive", + "1"); TXLIVE_PRIVATE.session_set = _storage_set_sessionStorage; - TXLIVE_PRIVATE.session_get = - _storage_get_sessionStorage; + TXLIVE_PRIVATE.session_get = _storage_get_sessionStorage; TXLIVE.settings.has_session = true } - } catch (err$9) {} + } catch (err) {} TXLIVE_PRIVATE.apiScopedKey = function(key) { return TXLIVE.settings.api_key + "@" + key }; @@ -1125,39 +1150,38 @@ TXLIVE_PRIVATE.addPicker(picker); TXLIVE.dynamicPageOn() } - var added_picker_css = - false; + var added_picker_css = false; TXLIVE_PRIVATE.addPicker = function(picker) { if (!added_picker_css) { added_picker_css = true; try { - var css = ".txlive-langselector { position:fixed;z-index:999999;min-width: 120px;line-height:32px;background-color:#fcfcfc;box-shadow: 0 0 0px #CCD6E4;color: #3c5675;font-size: 14px;font-family: inherit; }"; + var css = ".txlive-langselector { position:fixed;z-index:999999;min-width: 120px;line-height:32px;background-color:rgba( 0,0,0,0.75 );box-shadow: 0 0 4px rgba( 0,0,0,0.3 );font-size: 14px;font-family: inherit; }"; css += ".txlive-langselector * { margin: 0;padding: 0;border: 0;font-size: 100%;font: inherit;vertical-align: baseline;border-radius: 0;-moz-border-radius:0;-webkit-border-radius:0;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-border-radius:0;opacity:1; }"; css += ".txlive-langselector.txlive-langselector-topleft { top:0;left:0;right:auto;bottom:auto;border-radius: 0 0 2px 0;-moz-border-radius: 0 0 2px 0;-webkit-border-radius: 0 0 2px 0; }"; css += ".txlive-langselector.txlive-langselector-topright { top:0;left:auto;right:0;bottom:auto;border-radius: 0 2px 0 0;-moz-border-radius: 0 2px 0 0;-webkit-border-radius: 0 2px 0 0; }"; css += ".txlive-langselector.txlive-langselector-bottomleft { top:auto;left:0;right:auto;bottom:0;border-radius: 0 2px 0 0;-moz-border-radius: 0 2px 0 0;-webkit-border-radius: 0 2px 0 0; }"; css += ".txlive-langselector.txlive-langselector-bottomright { top:auto;left:auto;right:0;bottom:0;border-radius: 2px 0 0 0;-moz-border-radius: 2px 0 0 0;-webkit-border-radius: 2px 0 0 0; }"; css += ".txlive-langselector .txlive-langselector-toggle { overflow: hidden;display: block;padding:2px 16px;width: 100%;height:36px;cursor:pointer;cursor:hand; }"; - css += ".txlive-langselector.txlive-langselector-topleft .txlive-langselector-toggle { overflow: hidden;display: block;border-top:2px solid #CCD6E4;padding:2px 16px;height:36px;line-height:32px;cursor:pointer;cursor:hand; }"; - css += ".txlive-langselector.txlive-langselector-topright .txlive-langselector-toggle { overflow: hidden;display: block;border-top:2px solid #CCD6E4;padding:2px 16px;height:36px;line-height:32px;cursor:pointer;cursor:hand; }"; - css += ".txlive-langselector.txlive-langselector-bottomleft .txlive-langselector-toggle { overflow: hidden;display: block;border-bottom:2px solid #CCD6E4;padding:2px 16px;height:36px;line-height:32px;cursor:pointer;cursor:hand; }"; - css += ".txlive-langselector.txlive-langselector-bottomright .txlive-langselector-toggle { overflow: hidden;display: block;border-bottom:2px solid #CCD6E4;border-radius: 6px;padding:2px 16px;height:36px;line-height:32px;cursor:pointer;cursor:hand; }"; + css += ".txlive-langselector.txlive-langselector-topleft .txlive-langselector-toggle { overflow: hidden;display: block;border-top:2px solid #006f9f;padding:2px 16px;height:36px;line-height:32px;cursor:pointer;cursor:hand; }"; + css += ".txlive-langselector.txlive-langselector-topright .txlive-langselector-toggle { overflow: hidden;display: block;border-top:2px solid #006f9f;padding:2px 16px;height:36px;line-height:32px;cursor:pointer;cursor:hand; }"; + css += ".txlive-langselector.txlive-langselector-bottomleft .txlive-langselector-toggle { overflow: hidden;display: block;border-bottom:2px solid #006f9f;padding:2px 16px;height:36px;line-height:32px;cursor:pointer;cursor:hand; }"; + css += ".txlive-langselector.txlive-langselector-bottomright .txlive-langselector-toggle { overflow: hidden;display: block;border-bottom:2px solid #006f9f;padding:2px 16px;height:36px;line-height:32px;cursor:pointer;cursor:hand; }"; css += ".txlive-langselector .txlive-langselector-current { float: left;padding: 0;max-width: 200px;overflow:hidden;white-space: nowrap;text-overflow:ellipsis; }"; css += ".txlive-langselector .txlive-langselector-marker { float: right;display: block;position:relative;width:0;height:0;margin-left:8px;margin-top: 13px;border-right:4px dashed transparent;border-left:4px dashed transparent;}"; css += ".txlive-langselector-topright .txlive-langselector-marker,"; css += ".txlive-langselector-topleft .txlive-langselector-marker {border-top:4px solid #fff;}"; css += ".txlive-langselector-bottomright .txlive-langselector-marker,"; - css += ".txlive-langselector-bottomleft .txlive-langselector-marker {border-bottom:4px solid #3c5675;}"; - css += ".txlive-langselector-list { position:absolute;width: 100%;margin:0;padding:10px 0;display:none;background-color:#EFF2F6;box-shadow: 0 0 0px #CCD6E4;color:#666;list-style-type:none; }"; - css += ".txlive-langselector-list.txlive-langselector-list-opened { display:block;max-height:500px;overflow:auto; }"; - css += ".txlive-langselector-list > li {padding:0 16px;width:100%;overflow:hidden;white-space: nowrap;text-overflow:ellipsis;}"; - css += ".txlive-langselector-list > li:hover {background-color:#31A3DD;color:#fff;cursor:pointer;cursor:hand;}"; + css += ".txlive-langselector-bottomleft .txlive-langselector-marker {border-bottom:4px solid #fff;}"; + css += ".txlive-langselector-list { position:absolute;width: 100%;margin:0;padding:10px 0;display:none;background-color:#eaf1f7;box-shadow: 0 0 4px rgba( 0,0,0,0.3 );color:#666;list-style-type:none; }"; + css += ".txlive-langselector-list.txlive-langselector-list-opened { display:block;max-height:315px;overflow:auto; }"; + css += ".txlive-langselector-list > li button {padding:0 16px;width:100%;overflow:hidden;white-space: nowrap;text-overflow:ellipsis; text-align: left;}"; + css += ".txlive-langselector-list > li button:hover {background-color:#b0b9c1;color:#fff;cursor:pointer;cursor:hand;}"; css += ".txlive-langselector-topright > .txlive-langselector-list {top:40px;left:auto;right:0;bottom:auto;border-bottom: 1px solid #f4f7f9;}"; css += ".txlive-langselector-topleft > .txlive-langselector-list {top:40px;left:0;right:auto;bottom:auto;border-bottom: 1px solid #f4f7f9;}"; - css += ".txlive-langselector-bottomright > .txlive-langselector-list {top:auto;left:auto;right:0;bottom:40px;border-top: 2px solid #CCD6E4;border-bottom: 2px solid #CCD6E4;border-left: 2px solid #CCD6E4;}"; + css += ".txlive-langselector-bottomright > .txlive-langselector-list {top:auto;left:auto;right:0;bottom:40px;border-top: 1px solid #f4f7f9;}"; css += ".txlive-langselector-bottomleft > .txlive-langselector-list {top:auto;left:0;right:auto;bottom:40px;border-top: 1px solid #f4f7f9;}"; css += ".txlive-langselector-topright > .txlive-langselector-list,"; - css += ".txlive-langselector-bottomright > .txlive-langselector-list {border-radius: 6px 0 0 6px;-moz-border-radius: 6px 0 0 6px;-webkit-border-radius: 6px 0 0 6px;}"; + css += ".txlive-langselector-bottomright > .txlive-langselector-list {border-radius: 2px 0 0 2px;-moz-border-radius: 2px 0 0 2px;-webkit-border-radius: 2px 0 0 2px;}"; css += ".txlive-langselector-topleft > .txlive-langselector-list,"; css += ".txlive-langselector-bottomleft > .txlive-langselector-list {border-radius: 0 2px 2px 0;-moz-border-radius: 0 2px 2px 0;-webkit-border-radius: 0 2px 2px 0;}"; var head = document.head || document.getElementsByTagName("head")[0]; @@ -1166,47 +1190,26 @@ if (style.styleSheet) style.styleSheet.cssText = css; else style.appendChild(document.createTextNode(css)); head.appendChild(style) - } catch (err$10) { - TXLIVE.logger.error(err$10) + } catch (err) { + TXLIVE.logger.error(err) } } try { - var pick_lang = function(element) { - close_picker(); - if (element && element.getAttribute) { - var lang = element.getAttribute("data-value"); - if (lang) TXLIVE.translateTo(lang) - } - }; - var close_picker = function() { - var toggler = - document.getElementById("tx-live-lang-picker"); - if (toggler) toggler.className = toggler.className.replace(open_class, "") - }; - var open_picker = function() { - var toggler = document.getElementById("tx-live-lang-picker"); - if (toggler) toggler.className += " " + open_class - }; - var is_picker_open = function() { - var toggler = document.getElementById("tx-live-lang-picker"); - return toggler && toggler.className.indexOf(open_class) >= 0 - }; - var html = '