Mglaser has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/364439 )
Change subject: BlueSpiceVisualEditor: fixing context menu
......................................................................
BlueSpiceVisualEditor: fixing context menu
Context menu items are now displayed in block format. Also, some
code was removed which was needed in an older version to make table
menus available in the context menu. This is no longer neccessary.
The menu array has to remain, as other extensions add to the context
menu.
Change-Id: I92d029affaeaee3b45337db1f4b49229db04b11e
---
M VisualEditor/VisualEditor.class.php
M VisualEditor/resources/tiny_mce_plugins/bsactions/plugin.js
2 files changed, 8 insertions(+), 32 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions
refs/changes/39/364439/1
diff --git a/VisualEditor/VisualEditor.class.php
b/VisualEditor/VisualEditor.class.php
index 1e56d07..e99d826 100644
--- a/VisualEditor/VisualEditor.class.php
+++ b/VisualEditor/VisualEditor.class.php
@@ -186,7 +186,7 @@
array( 'title' => 'bs-visualeditor-greyscale', 'format'
=> 'table-style-greyscale' ),
array( 'title' => 'bs-visualeditor-greyscale-narrow',
'format' => 'table-style-greyscale-narrow' )
),
- 'contextmenu' => 'bsContextMenuMarker image | inserttable
bstableprops bsdeletetable bscell bsrow bscolumn'
+ 'contextmenu' => 'bsContextMenuMarker image | inserttable
tableprops deletetable cell row column'
// do not use table_class_list, as this breaks any existing
classes upon editing
);
diff --git a/VisualEditor/resources/tiny_mce_plugins/bsactions/plugin.js
b/VisualEditor/resources/tiny_mce_plugins/bsactions/plugin.js
index b3557b9..667feb7 100644
--- a/VisualEditor/resources/tiny_mce_plugins/bsactions/plugin.js
+++ b/VisualEditor/resources/tiny_mce_plugins/bsactions/plugin.js
@@ -47,15 +47,19 @@
function bindStateListener() {
// do not use the visible command, as it messes with
bar layot
//ctrl.visible(state);
+ var displayStyle = 'inline-block';
+ if ( ctrl.type == 'menuitem' ) {
+ displayStyle = 'block';
+ }
var state =
editor.dom.getParent(editor.selection.getStart(), selector)
if ( state ) {
- ctrl.getEl().style.display = 'inline-block';
+ ctrl.getEl().style.display = displayStyle;
} else {
ctrl.getEl().style.display = 'none';
}
editor.selection.selectorChanged(selector,
function(state) {
if ( state ) {
- ctrl.getEl().style.display =
'inline-block';
+ ctrl.getEl().style.display =
displayStyle;
} else {
ctrl.getEl().style.display = 'none';
}
@@ -295,35 +299,7 @@
var tableFunctionMenuItems = this.makeMenuItems(
ed.settings.bs_table_function_formats );
var tableStylesMenuItems = this.makeMenuItems(
ed.settings.bs_table_formats );
- menus = [{
- menuId: 'bstableprops',
- menuConfig: {
- text: 'Table properties',
- context: 'table',
- onPostRender:
postRenderVisibilityTable,
- cmd: 'mceTableProps'
- }
- }, {
- menuId: 'bsdeletetable',
- menuConfig: {
- text: 'Delete table',
- context: 'table',
- onPostRender:
postRenderVisibilityTable,
- cmd: 'mceTableDelete'
- }
- }, {
- menuId: 'bscell',
- menuItem: ed.menuItems['cell'],
- menuOnPostRender: postRenderVisibilityTable
- }, {
- menuId: 'bsrow',
- menuItem: ed.menuItems['row'],
- menuOnPostRender: postRenderVisibilityTable
- }, {
- menuId: 'bscolumn',
- menuItem: ed.menuItems['column'],
- menuOnPostRender: postRenderVisibilityTable
- }];
+ menus = [];
//HINT: TinyMCE I18N seems not wo work. Using MediaWiki I18N
buttons = [{
--
To view, visit https://gerrit.wikimedia.org/r/364439
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I92d029affaeaee3b45337db1f4b49229db04b11e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Mglaser <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits