User:Manuela/global.js: Difference between revisions
Appearance
From Meta, a Wikimedia project coordination wiki
mNo edit summary
mNo edit summary
Line 1:
Line 1:
$(function () {
$(function () {
//make TOC draggable(削除) and fixed (削除ここまで)
//make TOC draggable
console.log('right: pos.right');
var $mytoc = $('#toc');
var $mytoc = $('#toc');
if ( $mytoc.length ) {
⚫
try {
$mytoc.(削除) css({ ' (削除ここまで)position(削除) ': 'absolute' } (削除ここまで));
(追記) var pos = (追記ここまで)$mytoc.position(追記) ( (追記ここまで));
$mytoc.css({ 'position': 'absolute',
dragElement(document.getElementById('toc'));
marginLeft: 0, marginTop: 0,
top: pos.top, right: pos.right
});
dragElement($mytoc[0]);
setTimeout(function () {
setTimeout(function () {
$('#toc').css({
$('#toc').css({
'position': 'fixed',
'position': 'fixed',
'right': '0.5em'
'right': '0.(追記) 5em', 'top': ' (追記ここまで)5em'
});
});
}, 200);
}, 200);
⚫
} catch (err) {
⚫
console.log('MediaWiki:(削除) Common (削除ここまで).js#(削除) toc (削除ここまで) ' +(削除) (削除ここまで)err.message);
}
}
else{
console.log('No TOC');
⚫
(追記) } (追記ここまで)
function dragElement(elmnt) {
var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
elmnt.onmousedown = dragMouseDown;
function dragMouseDown(e) {
e = e || window.event;
e.preventDefault();
// get the mouse cursor position at startup:
pos3 = e.clientX;
pos4 = e.clientY;
document.onmouseup = closeDragElement;
// call a function whenever the cursor moves:
document.onmousemove = elementDrag;
//console.log('MediaWiki:Gadget-Navbar.js dragMouseDown');
}
function elementDrag(e) {
e = e || window.event;
e.preventDefault();
// calculate the new cursor position:
pos1 = pos3 - e.clientX;
pos2 = pos4 - e.clientY;
pos3 = e.clientX;
pos4 = e.clientY;
// set the element's new position:
elmnt.style.top = elmnt.offsetTop - pos2 + 'px';
elmnt.style.left = elmnt.offsetLeft - pos1 + 'px';
//console.log('MediaWiki:Gadget-Navbar.js elementDrag');
}
function closeDragElement() {
// stop moving when mouse button is released:
document.onmouseup = null;
document.onmousemove = null;
//console.log('MediaWiki:Gadget-Navbar.js closeDragElement');
}
}
//console.log('MediaWiki:Gadget-Navbar.js 2');
//console.log('\nprefix: ' +mw.config.get( 'wgServer' ) +mw.config.get( 'wgScript' ) +'?title=' +mw.config.get( 'wgPageName' ) +'&action=edit');
var pfx = '\n<a target="_blank" href="' +mw.config.get('wgServer') +mw.config.get('wgScript') +'?title=';
var pfx = '\n<a target="_blank" href="' +mw.config.get('wgServer') +mw.config.get('wgScript') +'?title=';
⚫
try {
⚫
var navBar = '\n<div id="botbar" class="metadata bottombar">\n<div style="display: flex; flex-direction: row; position: relative; margin-left: 30px; margin-right: 30px">' +'<div id="botbarheader" style="width: 20px; border: none; cursor: move;"></div>' +wikiadmin(pfx) +mywikis() +buttons() +'\n<div id="botbarfooter" style="width: 20px; border: none; cursor: move;"></div></div></div>';
$('#mw-indicator-mw-helplink').hide();
⚫
} catch (err) {
⚫
console.log('MediaWiki:(追記) Gadget-Navbar (追記ここまで).js#(追記) mw-indicator-mw-helplink (追記ここまで) ' +err.message);
}
⚫
var navBar = '\n<div id="botbar" class="(追記) noprint (追記ここまで)metadata bottombar">\n<div style="display: flex; flex-direction: row; position: relative; margin-left: 30px; margin-right: 30px">' +'<div id="botbarheader" style="width: 20px; border: none; cursor: move;"></div>' +wikiadmin(pfx) +mywikis() +buttons() +'\n<div id="botbarfooter" style="width: 20px; border: none; cursor: move;"></div></div></div>';
$('body').append(navBar);
$('body').append(navBar);
var $mybar = $('#botbar');
var $mybar = $('#botbar');
Line 78:
Line 127:
var bot = '\n<a href="#footer" title="bottom" style="margin-left: 5px; font-size: 38px">⬇';
var bot = '\n<a href="#footer" title="bottom" style="margin-left: 5px; font-size: 38px">⬇';
var toggl = '\n<div id="toggle" title="toggle bar small" style="cursor: pointer; margin-left: 5px; font-size: 38px">⇔</div>';
var toggl = '\n<div id="toggle" title="toggle bar small" style="cursor: pointer; margin-left: 5px; font-size: 38px">⇔</div>';
var transp = '\n<div title="toggle background" id="transparent" class="dropdown" style="margin-left: 5px; cursor: pointer; font-size: 38px">' +'❋</div>';
var transp =(追記) ''; // (追記ここまで) '\n<div title="toggle background" id="transparent" class="dropdown" style="margin-left: 5px; cursor: pointer; font-size: 38px">' +'❋</div>';
var floppy = '\n<div title="jumpt to save button" class="dropdown" id="only-when-edit" style="margin-left: 5px;"><a href="#wpSaveWidget" title="save" style="margin-left: 10px; font-size: 38px">✔';
var floppy = '\n<div title="jumpt to save button" class="dropdown" id="only-when-edit" style="margin-left: 5px;"><a href="#wpSaveWidget" title="save" style="margin-left: 10px; font-size: 38px">✔';
var cross = '\n<div title="close bar" id="closebar" class="dropdown" style="margin-left: 5px; cursor: pointer; font-size: 38px">' +'✘</div>';
var cross = '\n<div title="close bar" id="closebar" class="dropdown" style="margin-left: 5px; cursor: pointer; font-size: 38px">' +'✘</div>';
Line 132:
Line 181:
'<a target="_blank" href="https://de.scratch-wiki.info/">Scratch Wiki deutsch</a>\t<a target="_blank" href="https://imslp.org/">IMSPL</a>' +
'<a target="_blank" href="https://de.scratch-wiki.info/">Scratch Wiki deutsch</a>\t<a target="_blank" href="https://imslp.org/">IMSPL</a>' +
'<a target="_blank" href="https://wiki.selfhtml.org/wiki/">Selfhtml Wiki</a>' +
'<a target="_blank" href="https://wiki.selfhtml.org/wiki/">Selfhtml Wiki</a>' +
'<a target="_blank" href="https://(削除) http://de (削除ここまで).(削除) pluspedia (削除ここまで).org(削除) /wiki (削除ここまで)/">(削除) PlusPedia (削除ここまで)</a>' +
'<a target="_blank" href="https://(追記) www (追記ここまで).(追記) stupidedia (追記ここまで).org/">(追記) Stupidedia (leider geschlossen) (追記ここまで)</a>' +
'<a target="_blank" href="https://de.uncyclopedia.co/wiki/">Uncyclopedia</a>' +
'<a target="_blank" href="https://de.pluspedia.org/wiki/">PlusPedia</a>' +
'<a target="_blank" href="https://marjorie-wiki.de/wiki/">MARJORIE-WIKI</a>' +
'<a target="_blank" href="https://www.perrypedia.de/">PerryPedia</a>' +
'<a target="_blank" href="http://de.spongepedia.org/">Spongepedia</a>' +
'<a target="_blank" href="http://kamelopedia.net/">Kamelopedia</a>' +
'<div class="separator-top"></div>' +
'<div class="separator-top"></div>' +
'<a target="_blank" href="https://www.mediawiki.org/wiki/Sites_using_MediaWiki/de">Liste deutschsprachiger MediaWiki-Wikis</a>';
'<a target="_blank" href="https://www.mediawiki.org/wiki/Sites_using_MediaWiki/de">Liste deutschsprachiger MediaWiki-Wikis</a>';
Line 138:
Line 193:
}
}
function mirameta() {
function mirameta() {
var linktext = '(削除) Miraheze (削除ここまで)Meta Wikis';
var linktext = 'Meta Wikis';
var linkliste = '<a target="_blank" href="https://meta.miraheze.org/wiki/">Meta</a>' +
var linkliste = '<a target="_blank" href="https://meta.miraheze.org/wiki/">Meta</a>' +
'<a target="_blank" href="https://login.miraheze.org/wiki/">Login</a>' +
'<a target="_blank" href="https://login.miraheze.org/wiki/">Login</a>' +
Line 144:
Line 199:
'<a target="_blank" href="https://dev.miraheze.org/wiki/">Entwicklerwiki</a>' +
'<a target="_blank" href="https://dev.miraheze.org/wiki/">Entwicklerwiki</a>' +
'<a target="_blank" href="https://commons.miraheze.org/wiki/">Commons</a>' +
'<a target="_blank" href="https://commons.miraheze.org/wiki/">Commons</a>' +
'<a target="_blank" href="https://test.miraheze.org/wiki/">Testwiki</a>'(削除) ; (削除ここまで)
'<a target="_blank" href="https://test.miraheze.org/wiki/">Testwiki</a>'(追記) + (追記ここまで)
'<div class="separator-top"></div>' +
'<a target="_blank" href="https://meta.wikitide.com/wiki/">Wikitide Meta</a>';
return dropdown_submenu(linktext, linkliste);
}
function shout() {
var linktext = 'Shoutwiki Wikis';
var linkliste = '<a target="_blank" href="http://www.shoutwiki.com">Shoutwiki</a>' +
'<a target="_blank" href="http://regionalbahnstattbus.shoutwiki.com/">Regionalbahn Shout</a>' +
'<a target="_blank" href="http://kubu.shoutwiki.com/">Kunterbunt</a>' +
'<a target="_blank" href="http://mw.shoutwiki.com">Manuelas WIki</a>';
return dropdown_submenu(linktext, linkliste);
return dropdown_submenu(linktext, linkliste);
}
}
Line 152:
Line 218:
var linkliste =
var linkliste =
'<a target="_blank" href="https://lilypond.miraheze.org/">Lilypond</a>' +
'<a target="_blank" href="https://lilypond.miraheze.org/">Lilypond</a>' +
'<a target="_blank" href="https://(削除) yazz (削除ここまで).miraheze.org/">(削除) Kubu (削除ここまで)</a>' +
'<a target="_blank" href="https://(追記) musik (追記ここまで).miraheze.org/">(追記) Musik (追記ここまで)</a>' +
'<a target="_blank" href="https://yazz.miraheze.org/">Wiki Kunterbunt</a>' +
'<a target="_blank" href="https://musi.miraheze.org/">Walletschek Wiki</a>' +
'<a target="_blank" href="https://nopedia.miraheze.org/">Stupidedia Mirror</a>' +
'<a target="_blank" href="https://meingarten.miraheze.org/">Mein Garten</a>' +
'<a target="_blank" href="https://meingarten.miraheze.org/">Mein Garten</a>' +
'<a target="_blank" href="https://regionalbahnstattbus.miraheze.org/">Regionalbahn</a>' +
'<a target="_blank" href="https://regionalbahnstattbus.miraheze.org/">Regionalbahn</a>' +
'<a target="_blank" href="https://klimarealisten.miraheze.org/">Mein Testwiki</a>' +
'<a target="_blank" href="https://klimarealisten.miraheze.org/">Mein Testwiki</a>' +
'<div class="separator-top"></div>' +
'<a target="_blank" href="https://misch.wikitide.com/wiki/">Kunterbunt (Wikitide)</a>' +
'<div class="separator-top"></div>' +
'<a target="_blank" href="https://aboutpcs.miraheze.org/">About PCs Wiki</a>' +
'<a target="_blank" href="https://aboutpcs.miraheze.org/">About PCs Wiki</a>' +
'<a target="_blank" href="https://unicodesubsets.miraheze.org/">Unicode subsets Wiki</a>' +
'<a target="_blank" href="https://tetris.miraheze.org/">Tetris Wiki</a>' +
'<a target="_blank" href="https://xen.miraheze.org/">Xenharmonic Wiki</a>' +
'<div class="separator-top"></div>' +
'<div class="separator-top"></div>' +
'<a target="_blank" href="https://hexengarten.miraheze.org/">Hexengarten</a>' +
'<a target="_blank" href="https://hexengarten.miraheze.org/">Hexengarten</a>' +
Line 199:
Line 274:
function mywikis(pfx) {
function mywikis(pfx) {
var linktext = 'Wikiliste';
var linktext = 'Wikiliste';
var content = mirawiki() +mirameta() +otherwikis() +wikipedia();
var content = mirawiki(追記) () +shout (追記ここまで)() +mirameta() +otherwikis() +wikipedia();
return dropdown(linktext, content);
return dropdown(linktext, content);
}
}
Line 249:
Line 324:
pfx +'Special:UncategorizedCategories">Nicht kategorisierte Kategorien</a>' +
pfx +'Special:UncategorizedCategories">Nicht kategorisierte Kategorien</a>' +
pfx +'Special:UncategorizedPages">Nicht kategorisierte Seiten</a>' +
pfx +'Special:UncategorizedPages">Nicht kategorisierte Seiten</a>' +
pfx +'Special:UncategorizedFiles">Nicht kategorisierte Dateien</a>' +
pfx +'Special:UncategorizedTemplates">Nicht kategorisierte Vorlagen</a>' +
pfx +'Special:UncategorizedTemplates">Nicht kategorisierte Vorlagen</a>' +
pfx +'Special:UnusedCategories">Verwaiste Kategorien</a>' +
pfx +'Special:UnusedCategories">Verwaiste Kategorien</a>' +
Line 287:
Line 363:
pfx +'Special:Interwiki">Interwiki Daten</a>' +
pfx +'Special:Interwiki">Interwiki Daten</a>' +
pfx +'Special:AllMessages">Systemnachrichten</a>' +
pfx +'Special:AllMessages">Systemnachrichten</a>' +
pfx +'Special:RecentChanges">letzte Änderungen</a>' +
'<div class="separator-top"></div>' +
'<div class="separator-top"></div>' +
pfx +'Special:MediaStatistics">Medieninformation</a>' +
pfx +'Special:MediaStatistics">Medieninformation</a>' +
Latest revision as of 17:00, 8 August 2023
$(function(){ //make TOC draggable console.log('right: pos.right'); var$mytoc=$('#toc'); if($mytoc.length){ varpos=$mytoc.position(); $mytoc.css({'position':'absolute', marginLeft:0,marginTop:0, top:pos.top,right:pos.right }); dragElement($mytoc[0]); setTimeout(function(){ $('#toc').css({ 'position':'fixed', 'right':'0.5em','top':'5em' }); },200); } else{ console.log('No TOC'); } functiondragElement(elmnt){ varpos1=0,pos2=0,pos3=0,pos4=0; elmnt.onmousedown=dragMouseDown; functiondragMouseDown(e){ e=e||window.event; e.preventDefault(); // get the mouse cursor position at startup: pos3=e.clientX; pos4=e.clientY; document.onmouseup=closeDragElement; // call a function whenever the cursor moves: document.onmousemove=elementDrag; //console.log('MediaWiki:Gadget-Navbar.js dragMouseDown'); } functionelementDrag(e){ e=e||window.event; e.preventDefault(); // calculate the new cursor position: pos1=pos3-e.clientX; pos2=pos4-e.clientY; pos3=e.clientX; pos4=e.clientY; // set the element's new position: elmnt.style.top=elmnt.offsetTop-pos2+'px'; elmnt.style.left=elmnt.offsetLeft-pos1+'px'; //console.log('MediaWiki:Gadget-Navbar.js elementDrag'); } functioncloseDragElement(){ // stop moving when mouse button is released: document.onmouseup=null; document.onmousemove=null; //console.log('MediaWiki:Gadget-Navbar.js closeDragElement'); } } //console.log('MediaWiki:Gadget-Navbar.js 2'); //console.log('\nprefix: ' +mw.config.get( 'wgServer' ) +mw.config.get( 'wgScript' ) +'?title=' +mw.config.get( 'wgPageName' ) +'&action=edit'); varpfx='\n<a target="_blank" href="'+mw.config.get('wgServer')+mw.config.get('wgScript')+'?title='; try{ $('#mw-indicator-mw-helplink').hide(); }catch(err){ console.log('MediaWiki:Gadget-Navbar.js#mw-indicator-mw-helplink '+err.message); } varnavBar='\n<div id="botbar" class="noprint metadata bottombar">\n<div style="display: flex; flex-direction: row; position: relative; margin-left: 30px; margin-right: 30px">'+'<div id="botbarheader" style="width: 20px; border: none; cursor: move;"></div>'+wikiadmin(pfx)+mywikis()+buttons()+'\n<div id="botbarfooter" style="width: 20px; border: none; cursor: move;"></div></div></div>'; $('body').append(navBar); var$mybar=$('#botbar'); try{ $mybar.css({'position':'absolute'}); dragElement(document.getElementById('botbar')); setTimeout(function(){ $('#botbar').css({ 'bottom':'0', 'position':'fixed' }); },200); }catch(err){ console.log('MediaWiki:Gadget-Navbar.js#botbar '+err.message); } $('#closebar').click(function(){ $('#botbar').hide(); }); $('#siteNotice').click(function(){ $('#siteNotice').hide(); }); $('#toggle').click(function(){ try{ $('#navbarAdministration').toggle(); $('#navbarWikiliste').toggle(); //console.log('MediaWiki:Gadget-Navbar.js#toggle toggle'); }catch(err){ console.log('MediaWiki:Gadget-Navbar.js#toggle '+err.message); } }); try{ $('#centralNotice').hide(); //console.log('MediaWiki:Gadget-Navbar.js#centralNotice hidden'); }catch(err){ console.log('MediaWiki:Gadget-Navbar.js#centralNotice '+err.message); } $('#centralNotice').click(function(){ $('#centralNotice').hide(); //console.log('MediaWiki:Gadget-Navbar.js#centralNotice clicked'); }); $("#transparent").click(function(){ try{ $("#botbar").toggleClass("bottombar"); //console.log('MediaWiki:Common.js#transparent toggleClass'); }catch(err){ console.log('MediaWiki:Common.js#transparent '+err.message); } }); functionbuttons(){ // erzeugt die Navigationselemente Pfeile und Disk varklass='\n<div class="dropdown">'; vartail='</a></div>'; vartop='\n<a href="#mw-page-base" title="top" style="margin-left: 5px; font-size: 38px">⬆'; varbot='\n<a href="#footer" title="bottom" style="margin-left: 5px; font-size: 38px">⬇'; vartoggl='\n<div id="toggle" title="toggle bar small" style="cursor: pointer; margin-left: 5px; font-size: 38px">⇔</div>'; vartransp='';// '\n<div title="toggle background" id="transparent" class="dropdown" style="margin-left: 5px; cursor: pointer; font-size: 38px">' +'❋</div>'; varfloppy='\n<div title="jumpt to save button" class="dropdown" id="only-when-edit" style="margin-left: 5px;"><a href="#wpSaveWidget" title="save" style="margin-left: 10px; font-size: 38px">✔'; varcross='\n<div title="close bar" id="closebar" class="dropdown" style="margin-left: 5px; cursor: pointer; font-size: 38px">'+'✘</div>'; varmybuts=klass+top+tail+klass+bot+tail+transp+toggl+cross+floppy+tail; //console.log(mybuts); returnmybuts; } functionnavbar(pfx){ // Menüpunkt zum Anklicken der wichtigsten Elemente der Navigation Bar varlinktext='Gadget Navigationsleiste'; varlink='<a target="_blank" href="https://yazz.miraheze.org/wiki/Help:Navigation_bar'; varlinkliste='<a target="_blank" href="https://yazz.miraheze.org/w/index.php?title=MediaWiki:Common.css/bottombar.css">Globale User CSS Datei Yazz:MediaWiki:Common.css/bottombar.css</a>'+ '<a target="_blank" href="https://yazz.miraheze.org/w/index.php?title=MediaWiki:Gadget-Navbar.js">Globale User JavaScript Datei Yazz:MediaWiki:Gadget-Navbar.js</a>'+ '<div class="separator-top"></div>'+ pfx+'Special:AllPages/MediaWiki:">Alle MediaWiki Seiten</a>'+ pfx+'MediaWiki:Vector.css">Vector.css (im Wiki)</a>'+ pfx+'MediaWiki:Common.css">Common.css (im Wiki)</a>'+ pfx+'MediaWiki:Vector.js">Vector.js (im Wiki)</a>'+ pfx+'MediaWiki:Common.js">Common.js (im Wiki)</a>'; returndropdown_submenu(linktext,linkliste,link); } functionwikipedia(){ varmywikis='<a target="_blank" href="https://meta.wikimedia.org/">Meta</a>\ <a target="_blank" href="https://www.mediawiki.org/">MediaWiki</a>\ <a target="_blank" href="https://commons.wikimedia.org/">Commons</a>\ <a target="_blank" href="https://de.wikipedia.org/">Wikipedia</a>\ <a target="_blank" href="https://de.wikibooks.org/">Wikibooks</a>\ <a target="_blank" href="https://en.wikipedia.org/">Wikipedia (en)</a>\ <a target="_blank" href="https://en.wikibooks.org/">Wikibooks (en)</a>\ <a target="_blank" href="https://www.wikidata.org/">Wikidata</a>\ <a target="_blank" href="https://species.wikimedia.org/">Species</a>\ <a target="_blank" href="https://wikisource.org/">Wikisource</a>\ <a target="_blank" href="https://de.wikiquote.org/">Wikiquote</a>\ <a target="_blank" href="https://de.wikiversity.org/">Wikiversity</a>\ <a target="_blank" href="https://de.wikivoyage.org/">Wikivoyage</a>\ <a target="_blank" href="https://de.wikinews.org/">Wikinews</a>\ <a target="_blank" href="https://en.wikiquote.org/">Wikiquote (en)</a>\ <a target="_blank" href="https://en.wikiversity.org/">Wikiversity (en)</a>\ <a target="_blank" href="https://en.wikivoyage.org/">Wikivoyage (en)</a>\ <a target="_blank" href="https://en.wikinews.org/">Wikinews (en)</a>'; varmytext='Wikipedia'; returndropdown_submenu(mytext,mywikis); } functionotherwikis(){ varmytext='andere Wikis'; varmywikis='<a target="_blank" href="https://wiki.piratenpartei.de">Deutsche Piraten</a>'+ '<a target="_blank" href="https://wiki.piratenpartei.at">Österreichische Piraten</a>'+ '<a target="_blank" href="https://www.cpdl.org">Choralwiki</a>'+ '<a target="_blank" href="https://en.scratch-wiki.info/">Scratch Wiki englisch</a>'+ '<a target="_blank" href="https://de.scratch-wiki.info/">Scratch Wiki deutsch</a>\t<a target="_blank" href="https://imslp.org/">IMSPL</a>'+ '<a target="_blank" href="https://wiki.selfhtml.org/wiki/">Selfhtml Wiki</a>'+ '<a target="_blank" href="https://www.stupidedia.org/">Stupidedia (leider geschlossen)</a>'+ '<a target="_blank" href="https://de.uncyclopedia.co/wiki/">Uncyclopedia</a>'+ '<a target="_blank" href="https://de.pluspedia.org/wiki/">PlusPedia</a>'+ '<a target="_blank" href="https://marjorie-wiki.de/wiki/">MARJORIE-WIKI</a>'+ '<a target="_blank" href="https://www.perrypedia.de/">PerryPedia</a>'+ '<a target="_blank" href="http://de.spongepedia.org/">Spongepedia</a>'+ '<a target="_blank" href="http://kamelopedia.net/">Kamelopedia</a>'+ '<div class="separator-top"></div>'+ '<a target="_blank" href="https://www.mediawiki.org/wiki/Sites_using_MediaWiki/de">Liste deutschsprachiger MediaWiki-Wikis</a>'; returndropdown_submenu(mytext,mywikis); } functionmirameta(){ varlinktext='Meta Wikis'; varlinkliste='<a target="_blank" href="https://meta.miraheze.org/wiki/">Meta</a>'+ '<a target="_blank" href="https://login.miraheze.org/wiki/">Login</a>'+ '<a target="_blank" href="https://template.miraheze.org/wiki/">Templates</a>'+ '<a target="_blank" href="https://dev.miraheze.org/wiki/">Entwicklerwiki</a>'+ '<a target="_blank" href="https://commons.miraheze.org/wiki/">Commons</a>'+ '<a target="_blank" href="https://test.miraheze.org/wiki/">Testwiki</a>'+ '<div class="separator-top"></div>'+ '<a target="_blank" href="https://meta.wikitide.com/wiki/">Wikitide Meta</a>'; returndropdown_submenu(linktext,linkliste); } functionshout(){ varlinktext='Shoutwiki Wikis'; varlinkliste='<a target="_blank" href="http://www.shoutwiki.com">Shoutwiki</a>'+ '<a target="_blank" href="http://regionalbahnstattbus.shoutwiki.com/">Regionalbahn Shout</a>'+ '<a target="_blank" href="http://kubu.shoutwiki.com/">Kunterbunt</a>'+ '<a target="_blank" href="http://mw.shoutwiki.com">Manuelas WIki</a>'; returndropdown_submenu(linktext,linkliste); } functionmirawiki(){ varlinktext='Miraheze Wikis'; varlinkliste= '<a target="_blank" href="https://lilypond.miraheze.org/">Lilypond</a>'+ '<a target="_blank" href="https://musik.miraheze.org/">Musik</a>'+ '<a target="_blank" href="https://yazz.miraheze.org/">Wiki Kunterbunt</a>'+ '<a target="_blank" href="https://musi.miraheze.org/">Walletschek Wiki</a>'+ '<a target="_blank" href="https://nopedia.miraheze.org/">Stupidedia Mirror</a>'+ '<a target="_blank" href="https://meingarten.miraheze.org/">Mein Garten</a>'+ '<a target="_blank" href="https://regionalbahnstattbus.miraheze.org/">Regionalbahn</a>'+ '<a target="_blank" href="https://klimarealisten.miraheze.org/">Mein Testwiki</a>'+ '<div class="separator-top"></div>'+ '<a target="_blank" href="https://misch.wikitide.com/wiki/">Kunterbunt (Wikitide)</a>'+ '<div class="separator-top"></div>'+ '<a target="_blank" href="https://aboutpcs.miraheze.org/">About PCs Wiki</a>'+ '<a target="_blank" href="https://unicodesubsets.miraheze.org/">Unicode subsets Wiki</a>'+ '<a target="_blank" href="https://tetris.miraheze.org/">Tetris Wiki</a>'+ '<a target="_blank" href="https://xen.miraheze.org/">Xenharmonic Wiki</a>'+ '<div class="separator-top"></div>'+ '<a target="_blank" href="https://hexengarten.miraheze.org/">Hexengarten</a>'+ '<a target="_blank" href="https://traunstoaner.miraheze.org/">TraunStoaner</a>'+ '<a target="_blank" href="https://physicsde.miraheze.org/">Offene Fragen und Probleme der Physik</a>'+ '<a target="_blank" href="https://albionweb.miraheze.org/">ALBIONWEB</a>'+ '<a target="_blank" href="https://startups.miraheze.org/">Geschichte der Startups</a>'+ '<a target="_blank" href="https://schuelerwiki.miraheze.org/">Schülerwiki</a>'+ '<a target="_blank" href="https://stiff.miraheze.org/">Strümpfe im Feature Film</a>'+ '<div class="separator-top"></div>'+ '<a target="_blank" href="https://sdiy.info/wiki/Main_Page">Synth DIY Wiki</a>'+ '<a target="_blank" href="https://quirc.miraheze.org/">QuIRC</a>'+ '<a target="_blank" href="https://combinatorialnumbertheory.miraheze.org/">Combinatorial Number Theory</a>'+ '<a target="_blank" href="https://poserdazfreebies.miraheze.org/">Poser and Daz Studio Free Resources Wiki</a>'+ '<a target="_blank" href="https://terribletvshows.miraheze.org/">Terrible TV Shows Wiki</a>'+ '<a target="_blank" href="https://xen.miraheze.org/">Xenharmonic Wiki</a>'+ '<a target="_blank" href="https://mylittlepony.miraheze.org/">Equestripedia – a MLP Wiki</a>'+ '<a target="_blank" href="https://snapwiki.miraheze.org/">Snap!</a>'; returndropdown_submenu(linktext,linkliste); } functionwikiactn(pfx){ // Seitenaktionenen varmypfad=mw.config.get('wgScript'); varmwname=mw.config.get('wgPageName'); varmwserv=mw.config.get('wgServer'); varmyname='<a target="_blank" href="'+mwserv+mypfad+'?title='+mwname+'&'; vareditme='action=edit'; varrawme='action=raw&ctype=text/css'; varhistme='action=history'; varinfome='action=info'; varpurme='action=purge'; varqqxme='uselang=qqx'; varlinktext='Seitenaktionen'; varlinkliste=myname+editme+'">edit</a>'+myname+rawme+'">raw</a>'+ myname+histme+'">history</a>'+myname+infome+'">info</a>'+ myname+purme+'">refresh</a>'+myname+qqxme+'">qqx</a>'+ '<a target="_blank" href="'+mwserv+mypfad+'?title=Special:PrefixIndex/'+mwname+'/">Unterseiten</a>'; returndropdown_submenu(linktext,linkliste); } functionmywikis(pfx){ varlinktext='Wikiliste'; varcontent=mirawiki()+shout()+mirameta()+otherwikis()+wikipedia(); returndropdown(linktext,content); } functionprogm(){ varlinktext='Programmieren'; varlinkliste='<a target="_blank" href="https://gchq.github.io/CyberChef/">Cyber Chef</a>'+ '<div class="separator-top"></div>'+ '<a target="_blank" href="https://www.javascript.com/">JavaScript offizielle Webseite</a>'+ '<a target="_blank" href="https://www.w3schools.com/js/default.asp">JavaScript Tutorial auf W3</a>'+ '<a target="_blank" href="https://www.w3schools.com/jquery/default.asp">jQuery Tutorial auf W3</a>'+ '<div class="separator-top"></div>'+ '<a target="_blank" href="https://www.php.net/manual/de/">PHP-Handbuch</a>'+ '<a target="_blank" href="https://www.w3schools.com/php/default.asp">PHP Tutorial auf W3</a>'+ '<div class="separator-top"></div>'+ '<a target="_blank" href="https://www.w3schools.com/html/default.asp">HTML Tutorial auf W3</a>'+ '<a target="_blank" href="https://www.w3schools.com/css/default.asp">CSS Tutorial auf W3</a>'+ '<a target="_blank" href="https://www.w3.org/TR/SVG/">Scalable Vector Graphics (SVG) 2</a>'+ '<a target="_blank" href="https://validator.w3.org/">Markup Validation Service</a>'+ '<a target="_blank" href="https://de.wikibooks.org/wiki/SVG">SVG Wikibook</a>'+ '<a target="_blank" href="https://de.wikibooks.org/wiki/Websiteentwicklung">Websiteentwicklung Wikibook</a>' ; returndropdown_submenu(linktext,linkliste); } functionwikins(pfx){ varlinktext='Namensräume'; varlink='<a target="_blank" href="https://yazz.miraheze.org/wiki/Help:Namensr%C3%A4ume'; varlinkliste=pfx+'Special:AllPages">Alle Seiten</a>'+ pfx+'Special:AllPages&namespace=6">Alle Dateien</a>'+ pfx+'Special:AllPages&namespace=8">MediaWiki Seiten</a>'+ pfx+'Special:AllPages&namespace=14">Alle Kategorien</a>'+ pfx+'Special:AllPages&namespace=12">Help Seiten</a>'+ pfx+'Special:AllPages&namespace=2">Benutzerseiten</a>'+ pfx+'Special:AllPages&namespace=4">Projektseiten</a>'+ pfx+'Special:AllPages&namespace=10">Vorlagen</a>'+ pfx+'Special:AllPages/Module:">Module</a>'; returndropdown_submenu(linktext,linkliste,link); } functionwikiadmin(pfx){ varlinktext='Administration'; varcontent=wikins(pfx)+wikiinfo(pfx)+wikiactn(pfx)+wikiwant(pfx)+wikimaint(pfx)+wikipags(pfx)+progm()+navbar(pfx); returndropdown(linktext,content); } functionwikimaint(pfx){ varlinktext='Wartung'; varlinkliste=pfx+'Special:LongPages">Lange Seiten</a>'+ pfx+'Special:AncientPages">Seit längerem unbearbeitete Seiten</a>'+ pfx+'Special:UncategorizedCategories">Nicht kategorisierte Kategorien</a>'+ pfx+'Special:UncategorizedPages">Nicht kategorisierte Seiten</a>'+ pfx+'Special:UncategorizedFiles">Nicht kategorisierte Dateien</a>'+ pfx+'Special:UncategorizedTemplates">Nicht kategorisierte Vorlagen</a>'+ pfx+'Special:UnusedCategories">Verwaiste Kategorien</a>'+ pfx+'Special:UnusedFiles">Verwaiste Dateien</a>'+ pfx+'Special:UnusedTemplates">Verwaiste Vorlagen</a>'+ pfx+'Special:AbuseLog">Abuse Log</a>'+ pfx+'Special:AbuseFilter">Abuse Filter Management</a>'; returndropdown_submenu(linktext,linkliste); } functionwikiwant(pfx){ varlinktext='Fehlende Elemente'; varlinkliste=pfx+'Special:WantedPages">Fehlende Seiten</a>'+ pfx+'Special:WantedCategories">Fehlende Kategorien</a>'+ pfx+'Special:WantedFiles">Fehlende Dateien</a>'+ pfx+'Special:WantedTemplates">Fehlende Vorlagen</a>'; returndropdown_submenu(linktext,linkliste); } functionwikipags(pfx){ varlinktext='Seiteninformationen'; varlinkliste=pfx+'Special:NewPages">Neue Seiten</a>'+ pfx+'Special:NewFiles">Neue Dateien</a>'+ pfx+'Special:MostCategories">meiste Kategorien</a>'+ pfx+'Special:MostLinkedPages">meistverlinkte Seiten</a>'+ pfx+'Special:MostRevisions">meiste Bearbeitungen</a>'+ pfx+'Special:MostTranscludedPages">meisteingebundene Seiten</a>'+ pfx+'Special:MostLinkedCategories">meistverwendete Kategorien</a>'; returndropdown_submenu(linktext,linkliste); } functionwikiinfo(pfx){ varlinktext='Infos über das Wiki'; varlinkliste= pfx+'Special:Version">Version</a>'+ pfx+'Special:Statistics">Statistik</a>'+ pfx+'Special:ExpandTemplates">Vorlagen expandieren</a>'+ pfx+'Special:Interwiki">Interwiki Daten</a>'+ pfx+'Special:AllMessages">Systemnachrichten</a>'+ pfx+'Special:RecentChanges">letzte Änderungen</a>'+ '<div class="separator-top"></div>'+ pfx+'Special:MediaStatistics">Medieninformation</a>'+ pfx+'Special:MIMESearch/image/svg%2Bxml">SVG Images</a>'+ pfx+'Special:MIMESearch/image/png">PNG Images</a>'+ pfx+'Special:MIMESearch/image/jpeg">JPG Images</a>'+ pfx+'Special:MIMESearch/image/x-icon">Icons</a>'+ pfx+'Special:MIMESearch/image/*">Alle Bilder</a>'+ pfx+'Special:MIMESearch/application/pdf">PDF Dateien</a>'+ pfx+'Special:MIMESearch/application/*">Alle Anwendungsdateien</a>'+ pfx+'Special:MIMESearch/video/webm">Videos webm</a>'+ pfx+'Special:MIMESearch/video/*">Alle Videos</a>'+ pfx+'Special:MIMESearch/audio/mpeg">MP3 Audios</a>'+ pfx+'Special:MIMESearch/application/ogg">OGG Audios</a>'+ pfx+'Special:MIMESearch/audio/midi">Midi Audios</a>'+ pfx+'Special:MIMESearch/audio/*">Alle Audiodateien</a>'; returndropdown_submenu(linktext,linkliste); } functiondropdown(linktext,content,link){ // liefert einen Punkt der Navigationsleiste mit Untermenüs zurück // linktext: Beschriftung des Menüpunktes, der Pfeil nach unten wird durch CSS-Klasse hinzugefügt // link: muss mit <a href=" beginnen, optional // content: der Inhalt varmylink=link||'<a href="#'; varmylist=''; varmyid='navbar'+linktext; try{ mylist='\n<div class="dropdown" id="'+myid+'"><div class="dropbtn has-children">'+mylink+'">'+ linktext+'</a></div>\n<div class="dropdown-content">'+ content+'\n</div></div>'; }catch(err){ mylist=err.message; } returnmylist; } functiondropdown_submenu(linktext,linkliste,link){ // liefert ein komplettes Untermenü zurück // link: wenn der Menüpunkt keinen Link enthalten soll, den Textstring # übergeben // link muss mit <a href=" beginnen // linktext: Beschriftung des Menüpunktes, der Pfeil nach rechts wird automatisch hinzugefügt // linkliste: die Linkliste varmylink=link||'<a href="#'; // wenn Argument weggelassen, dann durch default ersetzen varmylist=''; try{ mylist='\n<div class="dropdown-submenu">'+mylink+'">'+ linktext+' ►</a>\n<ul class="sub-menu">'+ linkliste+'\n</ul></div>'; }catch(err){ mylist=err.message; } returnmylist; } functionpreurl(s,i){ // i=1 ergibt das Wiki Prefix // i=2 ergibt den Seitennamen // die URL enthält entweder /wiki/ oder title= // falls noch andere Varianten auftauchen muss die match-Funktion ergänzt werden try{ // var try1 = s.match(/([\S]*\/wiki\/)([^&]*)/); // var try2 = s.match(/([\S]*title=)([^&]*)/); // var mytry = try1 || try2; result=mw.config.get('wgPageName'); // mytry[2]; if(i==1){ result=mw.config.get('wgServer')+mw.config.get('wgScript')+'?title=';// mytry[1]; } }catch(err){ result=err.message; } returnresult; } functiondragElement(elmnt){ varpos1=0,pos2=0,pos3=0,pos4=0; elmnt.onmousedown=dragMouseDown; functiondragMouseDown(e){ e=e||window.event; e.preventDefault(); // get the mouse cursor position at startup: pos3=e.clientX; pos4=e.clientY; document.onmouseup=closeDragElement; // call a function whenever the cursor moves: document.onmousemove=elementDrag;//console.log('MediaWiki:Gadget-Navbar.js dragMouseDown'); } functionelementDrag(e){ e=e||window.event; e.preventDefault(); // calculate the new cursor position: pos1=pos3-e.clientX; pos2=pos4-e.clientY; pos3=e.clientX; pos4=e.clientY; // set the element's new position: elmnt.style.top=elmnt.offsetTop-pos2+'px'; elmnt.style.left=elmnt.offsetLeft-pos1+'px';//console.log('MediaWiki:Gadget-Navbar.js elementDrag'); } functioncloseDragElement(){ // stop moving when mouse button is released: document.onmouseup=null; document.onmousemove=null;//console.log('MediaWiki:Gadget-Navbar.js closeDragElement'); } } });