MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
(Created page with "→Any JavaScript here will be loaded for all users on every page load.: var customizeToolbar = function () { console.log('ciao'); }; if ( [ 'edit', 'submit' ].indexOf(...") |
No edit summary |
||
| (36 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
var | var ul = document.querySelector(".ns-3000 #p-namespaces ul,.ns-3001 #p-namespaces ul");//finding the list | ||
var newLi = document.createElement("li");// creating a list item | |||
} | newLi.innerHTML = '<button id="wiki-to-pdf-button"><a id="wiki-to-pdf-link" href="#" title="[insert title]">Open in wiki-to-pdf!</a></button>'; | ||
if (ul){ | |||
ul.appendChild(newLi);//adding list item to list | |||
urlsplit = window.location.href.split(':'); | |||
lastsplit = urlsplit.length - 1; | |||
// splitagain = urlsplit[lastsplit].split('&')[0]; | |||
lastsplit = urlsplit[lastsplit].replace('&action=edit',''); | |||
splitagain = lastsplit; | |||
document.querySelector("#wiki-to-pdf-link").setAttribute('href','/wiki-to-pdf/unfold/'+splitagain); | |||
} | |||
/* iframe check */ | |||
if ( window.location !== window.parent.location ) { | |||
document.body.classList.add('iniframe'); | |||
} | |||
$('.page-SoLiXG_Home .toc a').attr('href',function(i,v) { | |||
return "https://titipi.org/wiki/index.php/SoLiXG:Key-concepts" + v; | |||
}); | |||
Latest revision as of 15:13, 27 June 2025
/* Any JavaScript here will be loaded for all users on every page load. */
var ul = document.querySelector(".ns-3000 #p-namespaces ul,.ns-3001 #p-namespaces ul");//finding the list
var newLi = document.createElement("li");// creating a list item
newLi.innerHTML = '<button id="wiki-to-pdf-button"><a id="wiki-to-pdf-link" href="#" title="[insert title]">Open in wiki-to-pdf!</a></button>';
if (ul){
ul.appendChild(newLi);//adding list item to list
urlsplit = window.location.href.split(':');
lastsplit = urlsplit.length - 1;
// splitagain = urlsplit[lastsplit].split('&')[0];
lastsplit = urlsplit[lastsplit].replace('&action=edit','');
splitagain = lastsplit;
document.querySelector("#wiki-to-pdf-link").setAttribute('href','/wiki-to-pdf/unfold/'+splitagain);
}
/* iframe check */
if ( window.location !== window.parent.location ) {
document.body.classList.add('iniframe');
}
$('.page-SoLiXG_Home .toc a').attr('href',function(i,v) {
return "https://titipi.org/wiki/index.php/SoLiXG:Key-concepts" + v;
});