Tchanders has uploaded a new change for review.
https://gerrit.wikimedia.org/r/240091
Change subject: Add tabs to score inspector
......................................................................
Add tabs to score inspector
Add a tab each for musical notation options and audio options.
Bug: T113354
Change-Id: I0aeec14d5f41ea0db0d88e7270d6db5c710464bf
---
M Score.php
M i18n/en.json
M i18n/qqq.json
M modules/ve-score/ve.ui.MWScoreInspector.js
4 files changed, 48 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Score
refs/changes/91/240091/1
diff --git a/Score.php b/Score.php
index ff86ddf..7bb1dcd 100644
--- a/Score.php
+++ b/Score.php
@@ -121,12 +121,14 @@
'ext.visualEditor.mwcore',
),
'messages' => array(
+ 'score-visualeditor-mwscoreinspector-audio',
'score-visualeditor-mwscoreinspector-lang',
'score-visualeditor-mwscoreinspector-lang-abc',
'score-visualeditor-mwscoreinspector-lang-lilypond',
'score-visualeditor-mwscoreinspector-midi',
'score-visualeditor-mwscoreinspector-override-midi',
'score-visualeditor-mwscoreinspector-override-midi-placeholder',
+ 'score-visualeditor-mwscoreinspector-notation',
'score-visualeditor-mwscoreinspector-override-ogg',
'score-visualeditor-mwscoreinspector-override-ogg-placeholder',
'score-visualeditor-mwscoreinspector-raw',
diff --git a/i18n/en.json b/i18n/en.json
index 5b7db0d..5356327 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -32,10 +32,12 @@
"score-renameerr": "Error moving score files to upload directory.",
"score-trimerr": "Image could not be trimmed:\n$1\nSet
<code>$wgScoreTrim=false</code> if this problem persists.",
"score-versionerr": "Unable to obtain LilyPond version:\n$1",
+ "score-visualeditor-mwscoreinspector-audio": "Audio",
"score-visualeditor-mwscoreinspector-lang": "Language",
"score-visualeditor-mwscoreinspector-lang-abc": "ABC",
"score-visualeditor-mwscoreinspector-lang-lilypond": "LilyPond",
"score-visualeditor-mwscoreinspector-midi": "Link to a MIDI file",
+ "score-visualeditor-mwscoreinspector-notation": "Notation",
"score-visualeditor-mwscoreinspector-override-midi": "Link to an existing
MIDI file (optional)",
"score-visualeditor-mwscoreinspector-override-midi-placeholder": "Name of
existing MIDI file",
"score-visualeditor-mwscoreinspector-override-ogg": "Use an existing audio
file (must be Ogg/Vorbis format)",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 7a6021a..f97126e 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -35,10 +35,12 @@
"score-renameerr": "Displayed if moving the resultant files from the
working environment to the upload directory fails.",
"score-trimerr": "Displayed if the extension failed to trim an output
image. $1 is the error (generally big block of text in a pre tag)",
"score-versionerr": "Displayed if the extension failed to obtain the
version string of LilyPond. $1 is the LilyPond stdout output generated by the
attempt.",
+ "score-visualeditor-mwscoreinspector-audio": "Label for the audio card
of the score inspector",
"score-visualeditor-mwscoreinspector-lang": "Label for the lang
attribute of the score node",
"score-visualeditor-mwscoreinspector-lang-abc": "Label for the 'ABC'
value of the lang attribute",
"score-visualeditor-mwscoreinspector-lang-lilypond": "Label for the
'LilyPond' value of the lang attribute",
"score-visualeditor-mwscoreinspector-midi": "Label for the midi
attribute of the score node",
+ "score-visualeditor-mwscoreinspector-notation": "Label for the notation
card of the score inspector",
"score-visualeditor-mwscoreinspector-override-midi": "Label for the
override_midi attribute of the score node",
"score-visualeditor-mwscoreinspector-override-midi-placeholder":
"Placeholder for the label for the override_midi attribute of the score node",
"score-visualeditor-mwscoreinspector-override-ogg": "Label for the
override_ogg attribute of the score node",
diff --git a/modules/ve-score/ve.ui.MWScoreInspector.js
b/modules/ve-score/ve.ui.MWScoreInspector.js
index 962183e..3daf52f 100644
--- a/modules/ve-score/ve.ui.MWScoreInspector.js
+++ b/modules/ve-score/ve.ui.MWScoreInspector.js
@@ -42,10 +42,44 @@
*/
ve.ui.MWScoreInspector.prototype.initialize = function () {
var langDropdown, inputField, langField, midiField, vorbisField,
rawField, overrideMidiField, overrideOggField,
+ notationCard, audioCard,
overlay = this.manager.getOverlay();
// Parent method
ve.ui.MWScoreInspector.super.prototype.initialize.call( this );
+
+ // Index layout
+ this.indexLayout = new OO.ui.IndexLayout( {
+ scrollable: false,
+ expanded: false
+ } );
+
+ // HACK: Make this an option upstream
+ this.indexLayout.stackLayout.$element.removeClass(
'oo-ui-panelLayout-expanded' );
+
+ // Cards
+ notationCard = new OO.ui.CardLayout( 'notation', {
+ label: ve.msg( 'score-visualeditor-mwscoreinspector-notation' ),
+ expanded: false,
+ scrollable: false,
+ padded: true
+ } );
+ audioCard = new OO.ui.CardLayout( 'audio', {
+ label: ve.msg( 'score-visualeditor-mwscoreinspector-audio' ),
+ expanded: false,
+ scrollable: false,
+ padded: true
+ } );
+
+ // TODO: Remove this when upstream patch for labels lands
+ notationCard.setupTabItem = audioCard.setupTabItem = function () {
+ this.tabItem.setLabel( ve.msg(
'score-visualeditor-mwscoreinspector-' + this.getName() ) );
+ };
+
+ this.indexLayout.addCards( [
+ notationCard,
+ audioCard
+ ] );
// Dropdown
langDropdown = new OO.ui.DropdownWidget( {
@@ -116,14 +150,19 @@
// Initialization
this.$content.addClass( 've-ui-mwScoreInspector-content' );
- this.form.$element.append(
+ notationCard.$element.append(
inputField.$element,
langField.$element,
- rawField.$element,
+ rawField.$element
+ );
+ audioCard.$element.append(
midiField.$element,
overrideMidiField.$element,
vorbisField.$element,
overrideOggField.$element
+ );
+ this.form.$element.append(
+ this.indexLayout.$element
);
};
@@ -164,6 +203,7 @@
this.overrideMidiInput.on( 'change',
this.onChangeHandler );
this.overrideOggInput.on( 'change',
this.onChangeHandler );
+ this.indexLayout.connect( this, { set: 'updateSize' } );
this.langMenu.connect( this, { choose:
'toggleDisableRawCheckbox' } );
this.midiCheckbox.connect( this, { change:
'toggleDisableOverrideMidiInput' } );
this.vorbisCheckbox.connect( this, { change:
'toggleDisableOverrideOggInput' } );
--
To view, visit https://gerrit.wikimedia.org/r/240091
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0aeec14d5f41ea0db0d88e7270d6db5c710464bf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Score
Gerrit-Branch: master
Gerrit-Owner: Tchanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits