MediaWiki:Mobile.js

From VoWi
Revision as of 08:59, 22 May 2019 by Gittenburg (talk | contribs)
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* Das folgende JavaScript wird für alle Nutzer der mobilen Ansicht geladen. */

/* Lade MediaWiki:Common.css & MediaWiki:Common.js */
mw.loader.load( '/wiki?title=MediaWiki:Common.css&action=raw&ctype=text/css', 'text/css' );
mw.loader.load( '/wiki?title=MediaWiki:Common.js&action=raw&ctype=application/javascript', 'application/javascript' );

/* Verlinke Materialen */
if (mw.config.get('wgNamespaceNumber') == mw.config.get('wgNamespaceIds').tu_wien){
    var href = mw.config.get('wgArticlePath').replace('$1', 'Spezial:Materialien/' + mw.config.get('wgPageName').split('/')[0]);
    $('#page-actions').append('<li class="mw-ui-icon"><a href="'+href+'">📁</a></li>');
}

/* Menü */
$('#mw-mf-main-menu-button')[0].onclick = function(){
    $($('.menu ul')[0]).append(
'<li><a href="/wiki/Spezial:Letzte_Änderungen" class=mw-ui-icon>Letzte Änderungen</a></li>\
<li><a href="/wiki/VoWi:Nachrichten" class=mw-ui-icon>Nachrichten</a></li>\
<li><a href="/wiki/VoWi:Mitmachen" class=mw-ui-icon>Mitmachen</a></li>\
<li><a href="/wiki/Hilfe:Lösungsvorschläge" class=mw-ui-icon>Lösungsvorschläge</a></li>');
    $('#mw-mf-main-menu-button')[0].onclick = null;
};

/* Collapsible */
mw.loader.using( 'jquery.makeCollapsible' ).then( function () {
    $('.mw-collapsible').makeCollapsible();
});