Tweichart has uploaded a new change for review. https://gerrit.wikimedia.org/r/151625
Change subject: [WIP] BS223: ContextMenu ...................................................................... [WIP] BS223: ContextMenu * initial commit * basic javascript implementation Change-Id: I0da5476a1615c71aa12e8e870ac9767b900a0ff5 --- A ContextMenu/ContextMenu.class.php A ContextMenu/ContextMenu.setup.php A ContextMenu/i18n/de.json A ContextMenu/resources/bluespice.contextmenu.js 4 files changed, 62 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/25/151625/1 diff --git a/ContextMenu/ContextMenu.class.php b/ContextMenu/ContextMenu.class.php new file mode 100644 index 0000000..660a405 --- /dev/null +++ b/ContextMenu/ContextMenu.class.php @@ -0,0 +1,42 @@ +<?php + +class ContextMenu extends BsExtensionMW { + + /** + * Contructor of the ContextMenu class + */ + public function __construct() { + wfProfileIn('BS::' . __METHOD__); + // Base settings + $this->mExtensionFile = __FILE__; + $this->mExtensionType = EXTTYPE::PARSERHOOK; + $this->mInfo = array( + EXTINFO::NAME => 'ContextMenu', + EXTINFO::DESCRIPTION => wfMessage('bs-contextmenu-desc')->plain(), + EXTINFO::AUTHOR => 'Tobias Weichart', + EXTINFO::VERSION => 'default', + EXTINFO::STATUS => 'default', + EXTINFO::PACKAGE => 'default', + EXTINFO::URL => 'http://www.hallowelt.biz', + EXTINFO::DEPS => array('bluespice' => '2.22.0') + ); + $this->mExtensionKey = 'MW::ContextMenu'; + wfProfileOut('BS::' . __METHOD__); + } + + /** + * Initialization of Authors extension + */ + protected function initExt() { + $this->setHook('BeforePageDisplay'); + } + + public function onBeforePageDisplay(&$oOutputPage, &$oSkin) { + if ($this->checkContext() === false) + return true; + $oOutputPage->addModuleStyles('ext.bluespice.contextmenu'); + + return true; + } + +} diff --git a/ContextMenu/ContextMenu.setup.php b/ContextMenu/ContextMenu.setup.php new file mode 100644 index 0000000..a93c0f5 --- /dev/null +++ b/ContextMenu/ContextMenu.setup.php @@ -0,0 +1,12 @@ +<?php + +BsExtensionManager::registerExtension('ContextMenu', BsRUNLEVEL::FULL|BsRUNLEVEL::REMOTE); + +$wgMessagesDirs['ContextMenu'] = __DIR__ . '/i18n'; + +$wgResourceModules['ext.bluespice.contextmenu'] = array( + 'scripts' => 'extensions/BlueSpiceExtensions/ContextMenu/resources/bluespice.contextmenu.js', + 'position' => 'top', + 'localBasePath' => $IP, + 'remoteBasePath' => &$GLOBALS['wgScriptPath'] +); \ No newline at end of file diff --git a/ContextMenu/i18n/de.json b/ContextMenu/i18n/de.json new file mode 100644 index 0000000..e0faff1 --- /dev/null +++ b/ContextMenu/i18n/de.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Tobias Weichart<weich...@hallowelt.biz>" + ] + }, + "bs-contextmenu-desc": "Zeigt ein Kontextmenü entsprechend des geklickten Links an." +} diff --git a/ContextMenu/resources/bluespice.contextmenu.js b/ContextMenu/resources/bluespice.contextmenu.js new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ContextMenu/resources/bluespice.contextmenu.js -- To view, visit https://gerrit.wikimedia.org/r/151625 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0da5476a1615c71aa12e8e870ac9767b900a0ff5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: master Gerrit-Owner: Tweichart <weich...@hallowelt.biz> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits