Difference between revisions of "User:One-Six/fullpagename.js"

From Moegirlpedia
Jump to: navigation, search
m
m (new site domain)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
let mwFullPageName = window.location.href.replace(/http(s|):\/\/en.moegirl.org\//,"");
+
console.log("User:One-Six/fullpagename.js is loaded");
if(/index\.php/g.test(mwFullPageName)) {
+
const hrefFullPageNamee = () => {
let array = [...mwFullPageName.matchAll(/title=(.+?)(?:&|$)/g)];
+
let fullPageNamee = window.location.href.replace(/http(s|)\:\/\/en\.moegirl\.org(|\.cn)\//,"");
    mwFullPageName = array[array.length - 1][1];
+
if(/index\.php/g.test(fullPageNamee)) {
} else {
+
let array = [...fullPageNamee.matchAll(/title=(.+?)(?:&|$)/g)];
mwFullPageName = mwFullPageName.replace(/http(s|):\/\/en.moegirl.org\//,"");
+
        fullPageNamee = array[array.length - 1][1];
}
+
}
mwFullPageName = mwFullPageName.replace(/#.+$/,"");
+
return fullPageNamee.replace(/#.+$/,"");
console.log("FULLPAGENAME:"+mwFullPageName);
+
//console.log("FULLPAGENAME:"+fullPageNamee);
 +
};

Latest revision as of 12:12, 28 July 2020

console.log("User:One-Six/fullpagename.js is loaded");
const hrefFullPageNamee = () => {
	let fullPageNamee = window.location.href.replace(/http(s|)\:\/\/en\.moegirl\.org(|\.cn)\//,"");
	if(/index\.php/g.test(fullPageNamee)) {
		let array = [...fullPageNamee.matchAll(/title=(.+?)(?:&|$)/g)];
        fullPageNamee = array[array.length - 1][1];
	}
	return fullPageNamee.replace(/#.+$/,"");
	//console.log("FULLPAGENAME:"+fullPageNamee);
};