File: /volume1/@appstore/SynologyApplicationService/ui/authorize/js/Utils.js
/* jshint ignore: start */
/*
* a Javascript Utils
* version: v1.0.0
*/
var Utils = (function(){
var QueryString = function (name) {
let url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
let regex = new RegExp("[?&#]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) {
return null;
}
if (!results[2]) {
return '';
}
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var ReplacePath = function(path, lc) {
let loca = lc || window.location;
let url = loca.origin + loca.pathname.replace(/\/webman.*.html/i, path);
}
return {
GetParem: QueryString,
ReplacePath: ReplacePath
}
}());