From fff0dfa7d1ad54e34ead34e2616a476784701f67 Mon Sep 17 00:00:00 2001 From: Niko Date: Tue, 15 Feb 2022 20:01:32 +0100 Subject: [PATCH] Created method to return given string ns from app.strings --- web/src/app/js/base.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/src/app/js/base.js b/web/src/app/js/base.js index 5c4417c..7f8516c 100644 --- a/web/src/app/js/base.js +++ b/web/src/app/js/base.js @@ -122,6 +122,12 @@ function getNormalizedURI() { return window.location.pathname.replace(/\/+?$/, ' function capitalize(s) { return s.charAt(0).toUpperCase() + s.substr(1) } function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)) } +function s(name) { + if (app.strings === undefined || !name.match(/^[a-zA-Z0-9\.\_]+$/)) + return false; + return eval('app.strings.'+name); +} + function JSON_to_URLEncoded(element,key,list) { var list = list || []; if (typeof(element) == 'object') {