Difference between revisions of "MediaWiki:Vector.js"

From Wikimedia District of Columbia
Jump to navigation Jump to search
(For mobile devices)
(Restoring color bar JS that was accidentally deleted in the Great Vector.js Massacre of '13)
Line 6: Line 6:
 
viewPortTag.content = "width=device-width; initial-scale=1; maximum-scale=1;";
 
viewPortTag.content = "width=device-width; initial-scale=1; maximum-scale=1;";
 
document.getElementsByTagName('head')[0].appendChild(viewPortTag);
 
document.getElementsByTagName('head')[0].appendChild(viewPortTag);
  +
  +
/* Hide the default page heading on pages using the color bar heading format */
  +
  +
function removeFirstHeading() {
  +
if ($("div.colorbar").length) {
  +
document.getElementById("firstHeading").className += " nodisplay";
  +
document.getElementById("contentSub").className += " nodisplay";
  +
}
  +
}
  +
  +
addOnloadHook(removeFirstHeading);

Revision as of 15:38, 29 June 2013

/* For mobile devices */

var viewPortTag=document.createElement('meta');
viewPortTag.id="viewport";
viewPortTag.name = "viewport";
viewPortTag.content = "width=device-width; initial-scale=1; maximum-scale=1;";
document.getElementsByTagName('head')[0].appendChild(viewPortTag);

/* Hide the default page heading on pages using the color bar heading format */

function removeFirstHeading() {
    if ($("div.colorbar").length) {
        document.getElementById("firstHeading").className += " nodisplay";
        document.getElementById("contentSub").className += " nodisplay";
    }
}

addOnloadHook(removeFirstHeading);