/** * @param $out OutputPage object */ function setupSkinUserCss(OutputPage $out) { // do not use non-standard MW less files anymore // parent::setupSkinUserCss( $out ); // load Bootstrap styles $out->addModuleStyles('ext.bootstrap.styles'); }
/** * BeforePageDisplay hook * * Add the modules to the page * * @param $out OutputPage output page * @param $skin Skin current skin * * @return true */ public static function onBeforePageDisplay(OutputPage $out, $skin) { //Add modules: $out->addModuleStyles('ext.wr.ShareBar'); $out->addModules('ext.wr.ShareBar.js'); return true; }
/** * This function adds additional modules containing CSS before the page is displayed */ public function onBeforePageDisplay(OutputPage &$out, Skin &$ski) { $title_object = $out->getTitle(); $page_title = $title_object->getPrefixedURL(); if ($page_title === 'Special:UserPage' || $page_title === 'Special:AllCollections' || $page_title === 'Special:SingleManuscriptPages' || $page_title === 'Special:AllCollations' || $page_title === 'Special:RecentManuscriptPages' || $page_title === 'Special:AllStylometricAnalysis') { $out->addModuleStyles(array('ext.userpagecss', 'ext.manuscriptdeskbasecss')); $out->addModules("ext.javascriptloaderdots"); } return true; }
/** * BeofrePageDislpay hook. Load additional modules containing CSS before the page is displayed */ public function onBeforePageDisplay(OutputPage &$out, Skin &$ski) { $page_title_with_namespace = $out->getTitle()->getPrefixedURL(); if ($page_title_with_namespace === 'Special:HelperScripts') { $css_modules = array('ext.manuscriptdeskbasecss'); $javascript_modules = array('ext.javascriptloader'); $out->addModuleStyles($css_modules); $out->addModules($javascript_modules); } return true; }
/** * OutputPageParserOutput hook handler * @param OutputPage $out * @param ParserOutput $parserOutput * @return type */ public static function outputPageParserOutput(OutputPage &$out, ParserOutput $parserOutput) { $out->addModuleStyles('ext.articleEmblems'); if (isset($parserOutput->articleEmblems)) { $emblems = array(); foreach ($parserOutput->articleEmblems as $emblem) { $emblems[] = '<li class="articleEmblem">' . $emblem . '</li>'; } $parserOutput->setText('<ul id="articleEmblems" class="noprint">' . implode($emblems) . '</ul>' . $parserOutput->getText()); } return true; }
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); }
/** * Add specific styles for this skin * * @param OutputPage $out */ function setupSkinUserCss(OutputPage $out) { $moduleStyles = array('mediawiki.legacy.shared', 'mediawiki.legacy.commonPrint', 'mediawiki.sectionAnchor'); if ($out->isSyndicated()) { $moduleStyles[] = 'mediawiki.feedlink'; } // Deprecated since 1.26: Unconditional loading of mediawiki.ui.button // on every page is deprecated. Express a dependency instead. if (strpos($out->getHTML(), 'mw-ui-button') !== false) { $moduleStyles[] = 'mediawiki.ui.button'; } $out->addModuleStyles($moduleStyles); }
/** * Add FlaggedRevs css for relevant special pages. * @param OutputPage $out */ protected static function injectStyleForSpecial(&$out) { $title = $out->getTitle(); $spPages = array('UnreviewedPages', 'PendingChanges', 'ProblemChanges', 'Watchlist', 'Recentchanges', 'Contributions', 'Recentchangeslinked'); foreach ($spPages as $key) { if ($title->isSpecial($key)) { $out->addModuleStyles('ext.flaggedRevs.basic'); // CSS only break; } } return true; }
/** * Adds VisualEditor JS to the output. * * This is attached to the MediaWiki 'BeforePageDisplay' hook. * * @param OutputPage $output * @param Skin $skin * @return boolean */ public static function onBeforePageDisplay(OutputPage &$output, Skin &$skin) { $output->addModules(array('ext.visualEditor.desktopArticleTarget.init', 'ext.visualEditor.targetLoader')); $output->addModuleStyles(array('ext.visualEditor.desktopArticleTarget.noscript')); // add scroll offset js variable to output $veConfig = ConfigFactory::getDefaultInstance()->makeConfig('visualeditor'); $skinsToolbarScrollOffset = $veConfig->get('VisualEditorSkinToolbarScrollOffset'); $toolbarScrollOffset = 0; $skinName = $skin->getSkinName(); if (isset($skinsToolbarScrollOffset[$skinName])) { $toolbarScrollOffset = $skinsToolbarScrollOffset[$skinName]; } $output->addJsConfigVars('wgVisualEditorToolbarScrollOffset', $toolbarScrollOffset); return true; }
public static function injectCss(OutputPage $out, $text) { global $wgTranslatePageTranslationULS; $title = $out->getTitle(); $isSource = TranslatablePage::isSourcePage($title); $isTranslation = TranslatablePage::isTranslationPage($title); if ($isSource || $isTranslation) { $out->addModuleStyles('ext.translate'); if ($wgTranslatePageTranslationULS) { $out->addModules('ext.translate.pagetranslation.uls'); } // Per bug T63331 $type = $isSource ? 'source' : 'translation'; $out->addJsConfigVars('wgTranslatePageTranslation', $type); } return true; }
/** * Hook into Article::view() to provide syntax highlighting for * custom CSS and JavaScript pages * * @param string $text * @param Title $title * @param OutputPage $output * @return bool */ public static function viewHook( $text, $title, $output ) { global $wgUseSiteCss; // Determine the language $matches = array(); preg_match( '!\.(css|js)$!u', $title->getText(), $matches ); $lang = $matches[1] == 'css' ? 'css' : 'javascript'; // Attempt to format $geshi = self::prepare( $text, $lang ); if( $geshi instanceof GeSHi ) { $out = $geshi->parse_code(); if( !$geshi->error() ) { // Done $output->addHeadItem( "source-$lang", self::buildHeadItem( $geshi ) ); $output->addHTML( "<div dir=\"ltr\">{$out}</div>" ); if( $wgUseSiteCss ) { $output->addModuleStyles( 'ext.geshi.local' ); } return false; } } // Bottle out return true; }
/** * EditPage::showEditForm:initial hook * * Adds the modules to the edit form * * @param EditPage $editPage the current EditPage object. * @param OutputPage $outputPage object. * @return bool */ public static function editPageShowEditFormInitial($editPage, $outputPage) { if ($editPage->contentModel !== CONTENT_MODEL_WIKITEXT) { return true; } // Add modules for enabled features foreach (self::$features as $name => $feature) { if (!self::isEnabled($name)) { continue; } if (isset($feature['stylemodules'])) { $outputPage->addModuleStyles($feature['stylemodules']); } if (isset($feature['modules'])) { $outputPage->addModules($feature['modules']); } } $article = $editPage->getArticle(); $request = $article->getContext()->getRequest(); // Don't run this if the request was posted - we don't want to log 'init' when the // user just pressed 'Show preview' or 'Show changes', or switched from VE keeping // changes. if (class_exists('EventLogging') && !$request->wasPosted()) { $data = array(); $data['editingSessionId'] = self::getEditingStatsId(); if ($request->getVal('section')) { $data['action.init.type'] = 'section'; } else { $data['action.init.type'] = 'page'; } if ($request->getHeader('Referer')) { if ($request->getVal('section') === 'new' || !$article->exists()) { $data['action.init.mechanism'] = 'new'; } else { $data['action.init.mechanism'] = 'click'; } } else { $data['action.init.mechanism'] = 'url'; } self::doEventLogging('init', $article, $data); } return true; }
public function onBeforePageDisplay(OutputPage &$out, Skin &$skin) { $out->addModuleStyles('ext.bluespice.universalExport.css'); return true; }
/** * Adds resources to ResourceLoader * @param OutputPage $out * @param Skin $skin * @return boolean Always true to keep hook running */ public function onBeforePageDisplay(&$out, &$skin) { //Having a dedicated module for styles and loading it through //'addModuleStyles' prevents CSS flickering. It shoult obly be done //when styling elements that are available in the source HTML. If you //want to style markup that gets generated by JavaScript embed your //styling in the same module and use 'addModules'. $out->addModuleStyles('ext.bluespice.boilerPlate.styles'); //Adding JavaScript and clientside I18N $out->addModules('ext.bluespice.boilerPlate.scripts'); //Additional context sensitive data for the clientside $bVar = date('w') == 3; //Is it Wednesday? $out->addJsConfigVars('bsBoilerPlateSomeCalculatedVar', $bVar); return true; }
public function __construct(OutputPage $output) { $this->output = $output; $output->addModules('mediawiki.checkboxtoggle'); $output->addModuleStyles('mediawiki.checkboxtoggle.styles'); }
/** * Add specific styles for this skin * * @param OutputPage $out */ function setupSkinUserCss(OutputPage $out) { $out->addModuleStyles(array('mediawiki.legacy.shared', 'mediawiki.legacy.commonPrint', 'mediawiki.ui.button', 'mediawiki.sectionAnchor')); }
/** * Skin CSS * * @param OutputPage $out */ function setupSkinUserCss(OutputPage $out) { $out->addModuleStyles('ext.mobileFrontend2.common'); }
/** * Add skin specific stylesheets * @param $out OutputPage */ function setupSkinUserCss(OutputPage $out) { $out->addModuleStyles('mediawiki.legacy.shared'); $out->addModuleStyles('mediawiki.legacy.oldshared'); }
/** * Hook-Handler for MediaWiki 'BeforePageDisplay' hook. Sets context if needed. * @param OutputPage $oOutputPage * @param Skin $oSkin * @return bool */ public function onBeforePageDisplay(&$oOutputPage, &$oSkin) { $oOutputPage->addModuleStyles('ext.bluespice.blog'); return true; }
/** * Adds the 'ext.bluespice.responsibleeditors' module to the OutputPage * @param OutputPage $out * @param Skin $skin * @return boolean */ public function onBeforePageDisplay($out, $skin) { if ($out->getRequest()->getVal('action', 'view') == 'view' && !$out->getTitle()->isSpecialPage()) { $out->addModules('ext.bluespice.responsibleEditors'); $out->addModuleStyles('ext.bluespice.responsibleEditors.styles'); //Make information about current pages RespEds available on client side $iArticleId = $out->getTitle()->getArticleID(); $aResponsibleEditorIds = $this->getResponsibleEditorIdsByArticleId($iArticleId); $oData = new stdClass(); $oData->articleId = $iArticleId; $oData->editorIds = $aResponsibleEditorIds; $out->addJsConfigVars('bsResponsibleEditors', $oData); } if (BsExtensionManager::getExtension('Bookshelf') !== null) { //Attach Bookshelfs plugin if in context if (SpecialPage::getTitleFor('BookshelfBookManager')->equals($out->getTitle())) { $out->addModules('ext.bluespice.responsibleEditors.bookshelfPlugin'); } } if (BsExtensionManager::getExtension('SuperList') !== null) { //Attach SuperList plugin if in context if (SpecialPage::getTitleFor('SuperList')->equals($out->getTitle())) { $out->addModules('ext.bluespice.responsibleEditors.superList'); } } return true; }
/** * Adds CSS to Page * @param OutputPage $out * @param Skin $skin * @return boolean */ public function onBeforePageDisplay(&$out, &$skin) { $out->addModuleStyles('ext.bluespice.review.styles'); if ($out->getTitle()->isContentPage() == false) { return true; } if ($out->getTitle()->exists() == false) { return true; } //if( $out->getTitle()->userCan('workflowread') == false ) return true; $out->addModules('ext.bluespice.review'); //PW TODO: find better way //this always was loaded too late, no matter what dependency or position $out->addScript('<script>' . "\$(document).on( 'BsStateBarRegisterToggleClickElements', function(event, aRegisteredToggleClickElements) {" . "aRegisteredToggleClickElements.push(\$('#sb-Review'));" . "});" . '</script>'); $bUserCanEdit = $out->getTitle()->userCan('workflowedit'); $out->addJsConfigVars('bsReviewUserCanEdit', $bUserCanEdit); $oRev = BsReviewProcess::newFromPid($out->getTitle()->getArticleID()); $out->addJsConfigVars('bsReview', $this->makeJSDataObject($oRev)); return true; }
public function onBeforePageDisplay(OutputPage &$out, Skin &$skin) { $out->addModuleStyles(array('ext.bluespice.notifications')); return true; }
/** * BeforePageDisplay hook handler * @see https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay * * @param OutputPage $out * @param Skin $sk * @return bool */ public static function onBeforePageDisplay(&$out, &$sk) { global $wgGatherEnableBetaFeature; $desktopBetaFeatureEnabled = class_exists('BetaFeatures') && BetaFeatures::isFeatureEnabled($out->getUser(), 'betafeatures-gather') && $wgGatherEnableBetaFeature; if ($desktopBetaFeatureEnabled) { $out->addModules('ext.gather.desktop'); $out->addModuleStyles(array('mediawiki.ui.input', 'mediawiki.ui.icon')); } }
/** * * @param OutputPage $out * @param Skin $skin * @return boolean */ public static function onBeforePageDisplay(&$out, &$skin) { $out->addModuleStyles('ext.bluespice.insertcategory.styles'); $out->addModules('ext.bluespice.insertcategory'); $out->addJsConfigVars('BSInsertCategoryWithParents', BsConfig::get('MW::InsertCategory::WithParents')); return true; }
/** * Set the script tags in an OutputPage object * @param OutputPage $outputPage */ static function setHeaders($outputPage) { # Add the modules $outputPage->addModuleStyles('ext.categoryTree.css'); $outputPage->addModules('ext.categoryTree'); }
/** * Adds VisualEditor JS to the output. * * This is attached to the MediaWiki 'BeforePageDisplay' hook. * * @param OutputPage $output * @param Skin $skin * @return boolean */ public static function onBeforePageDisplay(OutputPage &$output, Skin &$skin) { $output->addModules(array('ext.visualEditor.viewPageTarget.init', 'ext.visualEditor.targetLoader')); $output->addModuleStyles(array('ext.visualEditor.viewPageTarget.noscript')); return true; }
/** * Hook-Handler for MediaWiki 'BeforePageDisplay' hook. Sets context if needed. * @param OutputPage $oOutputPage * @param Skin $oSkin * @return bool */ public function onBeforePageDisplay(&$oOutputPage, &$oSkin) { if ($this->checkContext() === false) { return true; } $oOutputPage->addModuleStyles('ext.bluespice.authors.styles'); return true; }
/** * Add skin specific stylesheets * @param $out OutputPage */ function setupSkinUserCss(OutputPage $out) { $out->addModuleStyles('mediawiki.legacy.shared'); $out->addModuleStyles('mediawiki.legacy.oldshared'); // TODO: When converting old skins to use ResourceLoader (or removing them) the following should be reconsidered $out->addStyle($this->getStylesheet()); $out->addStyle('common/common_rtl.css', '', '', 'rtl'); }
/** * Add skin-specific stylesheets * @param OutputPage $out */ public function setupSkinUserCss(OutputPage $out) { // Add Minerva-specific ResourceLoader modules to the page output $out->addModuleStyles($this->getSkinStyles()); }
/** * Adds the 'ext.bluespice.extendedsearch' module to the OutputPage * @param OutputPage $oOut * @param Skin $oSkin * @return boolean */ public function onBeforePageDisplay($oOut, $oSkin) { $oOut->addModuleStyles('ext.bluespice.extendedsearch.autocomplete.style'); $oOut->addModules('ext.bluespice.extendedsearch.autocomplete'); $oOut->addModules('ext.bluespice.extendedsearch.focus'); $oOut->addModules('ext.bluespice.extendedsearch.form'); return true; }