Added monobook support

* Added style for monobook
* Added monobook to whitelisted skins
* Made ve.init.mw.ViewPageTarget resilliant to vector and monobook-like skins

Change-Id: Ia39e034229204ae5f1f70dce5d74c6c4db42277b
This commit is contained in:
Trevor Parscal 2012-08-23 11:01:20 -07:00
parent f948c359eb
commit 9c782b29b3
4 changed files with 25 additions and 4 deletions

View file

@ -10,7 +10,7 @@
class VisualEditorHooks {
/** List of skins VisualEditor integration supports */
protected static $supportedSkins = array( 'vector', 'apex' );
protected static $supportedSkins = array( 'vector', 'apex', 'monobook' );
/**
* Adds VisualEditor JS to the output if in the correct namespace.

View file

@ -79,6 +79,9 @@ $wgResourceModules += array(
),
'apex' => array(
've/init/mw/styles/ve.init.mw.ViewPageTarget-apex.css',
),
'monobook' => array(
've/init/mw/styles/ve.init.mw.ViewPageTarget-monobook.css',
)
),
'dependencies' => array(

View file

@ -0,0 +1,16 @@
/**
* VisualEditor initialization ViewPageTarget Monobook skin high-definition styles.
*
* @copyright 2011-2012 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
.es-toolbar-wrapper {
margin: 0 -1em;
}
.es-toolbar,
.ve-init-mw-viewPageTarget-saveDialog {
font-size: 1.25em;
line-height: 1.5em;
}

View file

@ -483,7 +483,7 @@ ve.init.mw.ViewPageTarget.prototype.setupSkinTabs = function () {
// into editsource, add a new "VisualEditor" Edit tab
action = mw.config.get( 'wgArticleId', 0 ) === 0 ? 'create' : 'edit';
pVeEdit = mw.util.addPortletLink(
'p-views',
$( '#p-views' ).length ? 'p-views' : 'p-cactions',
// Use url instead of '#'.
// So that 1) one can always open it in a new tab, even when
// onEditTabClick is bound.
@ -927,7 +927,8 @@ ve.init.mw.ViewPageTarget.prototype.restorePageTitle = function () {
* @method
*/
ve.init.mw.ViewPageTarget.prototype.transformSkinTabs = function () {
$( '#p-views' ).find( 'li.selected' ).removeClass( 'selected' );
$( $( '#p-views' ).length ? '#p-views' : '#p-cactions' )
.find( 'li.selected' ).removeClass( 'selected' );
$( '#ca-edit' ).addClass( 'selected' );
};
@ -937,7 +938,8 @@ ve.init.mw.ViewPageTarget.prototype.transformSkinTabs = function () {
* @method
*/
ve.init.mw.ViewPageTarget.prototype.restoreSkinTabs = function () {
$( '#p-views' ).find( 'li.selected' ).removeClass( 'selected' );
$( $( '#p-views' ).length ? '#p-views' : '#p-cactions' )
.find( 'li.selected' ).removeClass( 'selected' );
$( '#ca-view' ).addClass( 'selected' );
};