Created method to return given string ns from app.strings

This commit is contained in:
Niko 2022-02-15 20:01:32 +01:00
parent 4e43a0adee
commit fff0dfa7d1
1 changed files with 6 additions and 0 deletions

View File

@ -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') {