1var Localization; 2var JSLocalization = (function () { 3 function JSLocalization() { 4 } 5 JSLocalization.prototype.SetLanguageTexts = function (force) { 6 if (force === void 0) { force = false; } 7 var elements; 8 if (force) { 9 elements = $("[data-language]"); 10 } 11 else { 12 elements = $("[data-language]:not([data-language-set])"); 13 } 14 var _this = this; 15 elements.each(function () { 16 var e = $(this); 17 var key = e.attr("data-language"); 18 e.html(_this.GetText(key)); 19 e.attr("data-language-set", "true"); 20 }); 21 }; 22 JSLocalization.prototype.GetText = function (key) { 23 var result = Texts[key]; 24 if (!result) { 25 return key; 26 } 27 else { 28 return result; 29 } 30 }; 31 JSLocalization.prototype.SetDynamicLabels = function () { 32 document.title = Texts.DocumentTitle || Texts.PageTitle || Texts[$("[data-page-title]").attr("data-page-title")]; 33 $("#main-header").html(Texts.MainHeader || Texts[$("[data-main-header]").attr("data-main-header")] || Texts.DefaultMainHeader); 34 if ($("[data-replace-url]").length) { 35 $("[data-replace-url]").each(function () { 36 var e = $(this); 37 var html = e.html(); 38 html = html.replace(/\{0\}/g, url); 39 e.html(html); 40 }); 41 } 42 if ($("[data-wildcard-replace]").length) { 43 $("[data-wildcard-replace]").each(function () { 44 var e = $(this); 45 var html = e.html(); 46 html = html.replace(/\{0\}/g, e.attr("data-wildcard-replace")); 47 e.html(html); 48 }); 49 } 50 }; 51 JSLocalization.prototype.CheckWildcardParameter = function () { 52 var queryStringParams = this.GetQueryStringParams(); 53 if (queryStringParams["from"]) { 54 $("#from-wildcard").html(this.GetText("Index_WildcardText").replace(/\{0\}/g, queryStringParams["from"])); 55 } 56 }; 57 JSLocalization.prototype.GetQueryStringParams = function () { 58 var urlParams = {}; 59 (function () { 60 var match, pl = /\+/g, // Regex for replacing addition symbol with a space 61 search = /([^&=]+)=?([^&]*)/g, decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); }, query = window.location.search.substring(1); 62 urlParams = {}; 63 while (match = search.exec(query)) 64 urlParams[decode(match[1])] = decode(match[2]); 65 })(); 66 return urlParams; 67 }; 68 return JSLocalization; 69}()); 70$(function () { 71 Localization = new JSLocalization(); 72 Localization.SetLanguageTexts(); 73 Localization.SetDynamicLabels(); 74 Localization.CheckWildcardParameter(); 75}); 76//# sourceMappingURL=language.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.