本文整理汇总了PHP中OutputPage::addModuleStyles方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputPage::addModuleStyles方法的具体用法?PHP OutputPage::addModuleStyles怎么用?PHP OutputPage::addModuleStyles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputPage
的用法示例。
在下文中一共展示了OutputPage::addModuleStyles方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupSkinUserCss
/**
* @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');
}
示例2: onBeforePageDisplay
/**
* 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;
}
示例3: onBeforePageDisplay
/**
* 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;
}
示例4: onBeforePageDisplay
/**
* 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;
}
示例5: outputPageParserOutput
/**
* 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;
}
示例6: initPage
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);
}
示例7: setupSkinUserCss
/**
* 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);
}
示例8: injectStyleForSpecial
/**
* 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;
}
示例9: onBeforePageDisplay
/**
* 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;
}
示例10: injectCss
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;
}
示例11: viewHook
/**
* 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;
}
示例12: editPageShowEditFormInitial
/**
* 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;
}
示例13: onBeforePageDisplay
public function onBeforePageDisplay(OutputPage &$out, Skin &$skin)
{
$out->addModuleStyles('ext.bluespice.universalExport.css');
return true;
}
示例14: onBeforePageDisplay
/**
* 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;
}
示例15: __construct
public function __construct(OutputPage $output)
{
$this->output = $output;
$output->addModules('mediawiki.checkboxtoggle');
$output->addModuleStyles('mediawiki.checkboxtoggle.styles');
}