From 00088bbf05a52a59d52b51c0f1dbd775a15010e3 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Thu, 12 Dec 2013 11:04:15 -0800 Subject: [PATCH] Use the same new toolbar for media and reference dialogs With blocks comment out where they're not wanted. Bonus: Actually make the pasteSpecial command available in these contexts. Bug: 58404 Change-Id: Ic77c252ddc9ae54019b2d86ee5f8a6f4febf4292 --- .../ui/dialogs/ve.ui.MWMediaEditDialog.js | 46 ++++++++++++++---- .../ui/dialogs/ve.ui.MWReferenceDialog.js | 47 +++++++++++++++++-- 2 files changed, 80 insertions(+), 13 deletions(-) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js index bfb0b1f368..c9231ef76d 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js @@ -37,21 +37,51 @@ ve.ui.MWMediaEditDialog.static.titleMessage = 'visualeditor-dialog-media-title'; ve.ui.MWMediaEditDialog.static.icon = 'picture'; ve.ui.MWMediaEditDialog.static.toolbarGroups = [ + // History { 'include': [ 'undo', 'redo' ] }, - { 'include': [ 'bold', 'italic', 'link', 'clear' ] }, + // No formatting + /* { + 'type': 'menu', + 'include': [ { 'group': 'format' } ], + 'promote': [ 'paragraph' ], + 'demote': [ 'preformatted', 'heading1' ] + },*/ + // Style + { + 'type': 'list', + 'icon': 'text-style', + 'include': [ { 'group': 'textStyle' }, 'clear' ], + 'promote': [ 'bold', 'italic' ], + 'demote': [ 'strikethrough', 'code', 'underline', 'clear' ] + }, + // Link + { 'include': [ 'link' ] }, + // No structure + /* { + 'type': 'bar', + 'include': [ 'number', 'bullet', 'outdent', 'indent' ] + },*/ + // Insert { 'include': '*', - 'exclude': [ - { 'group': 'format' }, - { 'group': 'structure' }, - 'referenceList' - ] + 'exclude': [ { 'group': 'format' }, { 'group': 'structure' }, 'referenceList' ], + 'label': 'visualeditor-toolbar-insert', + 'demote': [ 'specialcharacter' ] } ]; + ve.ui.MWMediaEditDialog.static.surfaceCommands = [ - 'undo', 'redo', 'bold', 'italic', 'link', 'clear', - 'underline', 'subscript', 'superscript' + 'undo', + 'redo', + 'bold', + 'italic', + 'link', + 'clear', + 'underline', + 'subscript', + 'superscript', + 'pasteSpecial' ]; /* Methods */ diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js index 80b4ca8c66..d882732b17 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js @@ -36,15 +36,52 @@ ve.ui.MWReferenceDialog.static.titleMessage = 'visualeditor-dialog-reference-tit ve.ui.MWReferenceDialog.static.icon = 'reference'; ve.ui.MWReferenceDialog.static.toolbarGroups = [ + // History { 'include': [ 'undo', 'redo' ] }, - { 'include': [ 'bold', 'italic', 'link', 'clear' ] }, - { 'include': [ 'number', 'bullet', 'outdent', 'indent' ] }, - { 'include': '*', 'exclude': [ { 'group': 'format' }, 'reference', 'referenceList' ] } + // No formatting + /* { + 'type': 'menu', + 'include': [ { 'group': 'format' } ], + 'promote': [ 'paragraph' ], + 'demote': [ 'preformatted', 'heading1' ] + },*/ + // Style + { + 'type': 'list', + 'icon': 'text-style', + 'include': [ { 'group': 'textStyle' }, 'clear' ], + 'promote': [ 'bold', 'italic' ], + 'demote': [ 'strikethrough', 'code', 'underline', 'clear' ] + }, + // Link + { 'include': [ 'link' ] }, + // Structure + { + 'type': 'bar', + 'include': [ 'number', 'bullet', 'outdent', 'indent' ] + }, + // Insert + { + 'include': '*', + 'exclude': [ { 'group': 'format' }, 'reference', 'referenceList' ], + 'label': 'visualeditor-toolbar-insert', + 'demote': [ 'specialcharacter' ] + } ]; ve.ui.MWReferenceDialog.static.surfaceCommands = [ - 'undo', 'redo', 'bold', 'italic', 'link', 'clear', - 'underline', 'subscript', 'superscript' + 'undo', + 'redo', + 'bold', + 'italic', + 'link', + 'clear', + 'underline', + 'subscript', + 'superscript', + 'indent', + 'outdent', + 'pasteSpecial' ]; /* Methods */