use seperated URL cleaning module
This commit is contained in:
parent
42cea844a8
commit
0ff2a26969
3 changed files with 6 additions and 20 deletions
|
@ -4,20 +4,15 @@ Change the currently selected data to be viewed by the popup.
|
|||
*/
|
||||
|
||||
import {global} from "/scripts/secretariat.js";
|
||||
import {URLs} from "/scripts/utils/URLs.js";
|
||||
|
||||
class pointer {
|
||||
/*
|
||||
Select a URL to view.
|
||||
*/
|
||||
static select(URL) {
|
||||
const clean = (URL) => {
|
||||
|
||||
// Remove the protocol from the URL.
|
||||
return((URL.replace(/(^\w+:|^)\/\//, ``).split(`?`))[0]);
|
||||
}
|
||||
|
||||
try {
|
||||
URL = (!URL) ? window.location.href : ((URL && (typeof URL).includes(`str`)) ? clean(URL) : null);
|
||||
URL = (!URL) ? window.location.href : ((URL && (typeof URL).includes(`str`)) ? URLs.clean(URL) : null);
|
||||
} catch(err) {}
|
||||
|
||||
// Get the last edited site.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue