mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 10:48:42 +00:00
Added support for apex skin
* Made vector specific styles only active in the vector skin * Added apex specific styles * Removed override of text size for document node * Added stylesheet for stand-alone to specify text size for document node Change-Id: I8a57918912499f9453a5692ff45a04a16ed34cde
This commit is contained in:
parent
38f5f7a0a8
commit
d147504f49
|
@ -9,6 +9,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class VisualEditorHooks {
|
class VisualEditorHooks {
|
||||||
|
/** List of skins VisualEditor integration supports */
|
||||||
|
protected static $supportedSkins = array( 'vector', 'apex' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds VisualEditor JS to the output if in the correct namespace.
|
* Adds VisualEditor JS to the output if in the correct namespace.
|
||||||
*
|
*
|
||||||
|
@ -20,8 +23,7 @@ class VisualEditorHooks {
|
||||||
public static function onBeforePageDisplay( &$output, &$skin ) {
|
public static function onBeforePageDisplay( &$output, &$skin ) {
|
||||||
global $wgTitle;
|
global $wgTitle;
|
||||||
if (
|
if (
|
||||||
// Vector skin supported for now.
|
in_array( $skin->getSkinName(), self::$supportedSkins ) &&
|
||||||
$skin->getSkinName() === 'vector' &&
|
|
||||||
(
|
(
|
||||||
// Article in the VisualEditor namespace
|
// Article in the VisualEditor namespace
|
||||||
$wgTitle->getNamespace() === NS_VISUALEDITOR ||
|
$wgTitle->getNamespace() === NS_VISUALEDITOR ||
|
||||||
|
|
|
@ -23,6 +23,8 @@ $html = '<div>' . file_get_contents( $page ) . '</div>';
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>VisualEditor Standalone Demo</title>
|
<title>VisualEditor Standalone Demo</title>
|
||||||
|
<!-- init -->
|
||||||
|
<link rel="stylesheet" href="../../modules/ve/init/sa/styles/ve.init.sa.css">
|
||||||
<!-- ce -->
|
<!-- ce -->
|
||||||
<link rel="stylesheet" href="../../modules/ve/ce/styles/ve.ce.DocumentNode.css">
|
<link rel="stylesheet" href="../../modules/ve/ce/styles/ve.ce.DocumentNode.css">
|
||||||
<link rel="stylesheet" href="../../modules/ve/ce/styles/ve.ce.Node.css">
|
<link rel="stylesheet" href="../../modules/ve/ce/styles/ve.ce.Node.css">
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
.ve-ce-documentNode {
|
.ve-ce-documentNode {
|
||||||
cursor: text;
|
cursor: text;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
font-size: 0.8em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prevent focus outline on editor */
|
/* Prevent focus outline on editor */
|
||||||
|
|
|
@ -5,20 +5,49 @@
|
||||||
* @license The MIT License (MIT); see LICENSE.txt
|
* @license The MIT License (MIT); see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.ve-surface {
|
/* Vector */
|
||||||
|
|
||||||
|
.skin-vector .ve-surface {
|
||||||
margin-top: 0.8em;
|
margin-top: 0.8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.es-toolbar-wrapper {
|
.skin-vector .ve-ce-documentNode {
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skin-vector .es-toolbar-wrapper {
|
||||||
margin: -1em -1em 1em -1em;
|
margin: -1em -1em 1em -1em;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.es-toolbar {
|
.skin-vector .es-toolbar {
|
||||||
display: none;
|
display: none;
|
||||||
margin-left: 1px;
|
margin-left: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Apex */
|
||||||
|
|
||||||
|
.skin-apex .ve-surface {
|
||||||
|
margin-top: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skin-apex .es-toolbar-wrapper {
|
||||||
|
margin: -0.9em -3em 0.8em -3em;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skin-apex .es-toolbar {
|
||||||
|
display: none;
|
||||||
|
line-height: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skin-apex .es-menuView-item:hover {
|
||||||
|
background-color: #d5eaed;
|
||||||
|
background-color: rgba(213, 234, 237, 0.75);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* VisualEditor */
|
||||||
|
|
||||||
.ve-init-mw-viewPageTarget-pageTitle {
|
.ve-init-mw-viewPageTarget-pageTitle {
|
||||||
-webkit-transition: opacity 200ms ease-out;
|
-webkit-transition: opacity 200ms ease-out;
|
||||||
-moz-transition: opacity 200ms ease-out;
|
-moz-transition: opacity 200ms ease-out;
|
||||||
|
|
3
modules/ve/init/sa/styles/ve.init.sa.css
Normal file
3
modules/ve/init/sa/styles/ve.init.sa.css
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
.ve-ce-documentNode {
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
Loading…
Reference in a new issue