...

Aus Wikibooks

Hinweis: Leere nach dem Veröffentlichen den Browser-Cache, um die Änderungen sehen zu können.

  • Firefox/Safari: Umschalttaste drücken und gleichzeitig Aktualisieren anklicken oder entweder Strg+F5 oder Strg+R (⌘+R auf dem Mac) drücken
  • Google Chrome: Umschalttaste+Strg+R (⌘+Umschalttaste+R auf dem Mac) drücken
  • Internet Explorer/Edge: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
  • Opera: Strg+F5
/* This gadget shows the real title of a page when {{DISPLAYTITLE:...}} is used. */

// <nowiki>
$(function () {
    // gadget shall only be active when viewing a page (not on edit or history pages)
    if (mw.config.get("wgIsArticle")) {
        // the displayed title of the page (content of <h1 id="firstHeading">...</h1>)
        var displayed_title = $("h1#firstHeading").first().text();
        
        // the actual title of the page
        var page_title = mw.config.get("wgPageName").replace(/_/g, " ");
        
        if (displayed_title && page_title && (displayed_title != page_title)) {
            // the displayed title does not match the actual page title
            //    -> show page title in <div id="contentSub">...</div>
            //
            // the space in the end is necessary, because there might be a redirect notice in #contentSub
            var title_hint = $("<span/>").addClass("noprint").text("↳ Seite „" + mw.html.escape(page_title) + "“ ");

            $("#contentSub").first().prepend(title_hint);
        }
    }
});
// </nowiki>