X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fframework%2Futils%2Futils.js;h=e8e9ad1a95360799c13325c10460a37cf6637737;hb=refs%2Fchanges%2F03%2F1103%2F1;hp=744202731cbc6be11df0411e22d5248268219b3d;hpb=05b0bf7615e179d26d14d5d40f021fa3db9142a6;p=osm%2FUI.git diff --git a/skyquake/framework/utils/utils.js b/skyquake/framework/utils/utils.js index 744202731..e8e9ad1a9 100644 --- a/skyquake/framework/utils/utils.js +++ b/skyquake/framework/utils/utils.js @@ -189,7 +189,7 @@ Utils.setAuthentication = function(username, password, cb) { window.sessionStorage.setItem("auth", AuthBase64); self.detectInactivity(); $.ajax({ - url: '//' + window.location.hostname + ':' + NODE_PORT + '/check-auth?api_server=' + API_SERVER, + url: '//' + window.location.hostname + ':' + window.location.port + '/check-auth?api_server=' + API_SERVER, type: 'GET', beforeSend: Utils.addAuthorizationStub, success: function(data) { @@ -295,4 +295,20 @@ Utils.arrayIntersperse = (arr, sep) => { }, [arr[0]]); } +Utils.cleanImageDataURI = (imageString, type, id) => { + if (/\bbase64\b/g.test(imageString)) { + return imageString; + } else if (/<\?xml\b/g.test(imageString)) { + const imgStr = imageString.substring(imageString.indexOf('