/** * */ function setupSkinUserCss(OutputPage $out) { global $wgContLang; $qb = $this->qbSetting(); $rules = array(); if (2 == $qb) { # Right $rules[] = "#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }"; $rules[] = "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }"; } elseif (1 == $qb || 3 == $qb) { $rules[] = "#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }"; $rules[] = "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }"; if (3 == $qb) { $rules[] = "#quickbar { position: fixed; padding: 4px; }"; } } elseif (4 == $qb) { $rules[] = "#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}"; $rules[] = "#quickbar { border-right: 1px solid gray; }"; $rules[] = "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }"; } $style = implode("\n", $rules); if ($wgContLang->getDir() === 'rtl') { $style = CSSJanus::transform($style, true, false); } $out->addInlineStyle($style); parent::setupSkinUserCss($out); }
public function initPage(OutputPage $out) { $baseURL = $GLOBALS['egBootyBaseURL']; //add the css modules separately to prevent a FOUC $out->addModuleStyles('bootstrap.css'); $out->addModuleStyles('skin.booty.css'); $out->addModuleStyles('font-awesome'); //since we're using theb mediawiki generated head element, we have to add the viewport meta tag //so the layout scaled properly to mobile devices $out->addMeta('viewport', 'width=device-width'); //,initial-width=1,maximum-width=1' ); /* Until ResourceLoader can correctly parse multiple urls in a single font-family webfont files have to be defined in the head to prevent it screwing things up */ $out->addInlineStyle("@font-face {\n\t\t font-family: 'Glyphicons Halflings';\n\t\t src: url('{$baseURL}/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.eot');\n\t\t src: url('{$baseURL}/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('{$baseURL}/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.woff') format('woff'), url('{$baseURL}/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('{$baseURL}/bootstrap-3.0.3/fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');\n\t\t}"); $out->addInlineStyle("@font-face {\n\t\t font-family: 'FontAwesome';\n\t\t src: url('{$baseURL}/font-awesome-4.0.3/fonts/fontawesome-webfont.eot?v=4.0.3');\n\t\t src: url('{$baseURL}/font-awesome-4.0.3/fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'), url('{$baseURL}/font-awesome-4.0.3/fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'), url('{$baseURL}/font-awesome-4.0.3/fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'), url('{$baseURL}/font-awesome-4.0.3/fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg');\n\t\t font-weight: normal;\n\t\t font-style: normal;\n\t\t}"); //js items will be appended after page load $out->addModules('bootstrap.js'); $out->addModules('skin.booty.js'); $out->addHeadItem('meta-viewport', '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">'); parent::initPage($out); }
function setupSkinUserCss(OutputPage $out) { global $wgContLang; $qb = $this->qbSetting(); $rules = array(); if (2 == $qb) { # Right $rules[] = "#quickbar { position: absolute; right: 4px; }"; $rules[] = "#article { margin-left: 4px; margin-right: 148px; }"; } elseif (1 == $qb) { $rules[] = "#quickbar { position: absolute; left: 4px; }"; $rules[] = "#article { margin-left: 148px; margin-right: 4px; }"; } elseif (3 == $qb) { # Floating left $rules[] = "#quickbar { position:absolute; left:4px }"; $rules[] = "#topbar { margin-left: 148px }"; $rules[] = "#article { margin-left:148px; margin-right: 4px; }"; $rules[] = "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;}"; # Hides from IE } elseif (4 == $qb) { # Floating right $rules[] = "#quickbar { position: fixed; right: 4px; }"; $rules[] = "#topbar { margin-right: 148px }"; $rules[] = "#article { margin-right: 148px; margin-left: 4px; }"; $rules[] = "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;}"; # Hides from IE } $style = implode("\n", $rules); if ($wgContLang->getDir() === 'rtl') { $style = CSSJanus::transform($style, true, false); } $out->addInlineStyle($style); parent::setupSkinUserCss($out); }
public static function onBeforePageDisplay(OutputPage &$out, &$skin) { if (!$out->getTitle()->isSpecial('WikiAdmin')) { return true; } if (strtolower($out->getRequest()->getVal('mode')) != 'preferences') { return true; } $out->addInlineStyle('.bs-prefs legend{cursor:pointer;}'); return true; }