Update VE core submodule to master (a942301)

New changes:
2cc219a Update OOjs UI to v0.1.0-pre (571f26d0ab)
3543cb7 Protect against offset=-1 in insertContent()
7a3d456 [BREAKING CHANGE] Move selection restrictions from tools to commands
3d847bb Disable desktop context on table selections
41282dd Missed function rename from RangeFix change
dd6c8b8 Support toDomElements returning an empty array
9be6464 Placholder -> placeholder
9bdd0a8 Restore basic styling to toolbar in core target (only)

Local changes:
Move selection restrictions from tools to commands

Change-Id: I88f3d04946bd1d03ed001d747475a8b495a0f64c
This commit is contained in:
James D. Forrester 2014-11-04 14:10:28 -08:00
parent c23208371a
commit 31bafa183d
7 changed files with 100 additions and 38 deletions

2
lib/ve

@ -1 +1 @@
Subproject commit dc8cf638f32402579d80de0f27fd404bf5c1d01f
Subproject commit a94230136846b2844612911719260a0e6107e47f

View file

@ -854,7 +854,10 @@ ve.init.mw.Target.prototype.generateCitationFeatures = function () {
tool.static.autoAddToGroup = true;
ve.ui.toolFactory.register( tool );
ve.ui.commandRegistry.register(
new ve.ui.Command( name, 'window', 'open', 'transclusion', data )
new ve.ui.Command(
name, 'window', 'open',
{ data: ['transclusion', data], supportedSelections: ['linear'] }
)
);
// Generate citation tool
name = 'cite-' + item.name;
@ -872,7 +875,10 @@ ve.init.mw.Target.prototype.generateCitationFeatures = function () {
tool.static.autoAddToGroup = true;
ve.ui.toolFactory.register( tool );
ve.ui.commandRegistry.register(
new ve.ui.Command( name, 'window', 'open', name, data )
new ve.ui.Command(
name, 'window', 'open',
{ data: [name, data], supportedSelections: ['linear'] }
)
);
// Generate dialog
dialog = function GeneratedMWCitationDialog( config ) {

View file

@ -30,8 +30,6 @@ ve.ui.MWCitationDialogTool.static.group = 'cite';
ve.ui.MWCitationDialogTool.static.modelClasses = [ ve.dm.MWReferenceNode ];
ve.ui.MWCitationDialogTool.static.requiresSelection = [ 'linear' ];
/**
* Only display tool for single-template transclusions of these templates.
*

View file

@ -25,7 +25,6 @@ ve.ui.MWMediaDialogTool.static.title =
OO.ui.deferMsg( 'visualeditor-dialogbutton-media-tooltip' );
ve.ui.MWMediaDialogTool.static.modelClasses = [ ve.dm.MWBlockImageNode, ve.dm.MWInlineImageNode ];
ve.ui.MWMediaDialogTool.static.commandName = 'media';
ve.ui.MWMediaDialogTool.static.requiresSelection = [ 'linear' ];
ve.ui.MWMediaDialogTool.static.autoAddToCatchall = false;
ve.ui.MWMediaDialogTool.static.autoAddToGroup = false;
ve.ui.toolFactory.register( ve.ui.MWMediaDialogTool );

View file

@ -25,7 +25,6 @@ ve.ui.MWReferenceDialogTool.static.title =
OO.ui.deferMsg( 'visualeditor-dialogbutton-reference-tooltip' );
ve.ui.MWReferenceDialogTool.static.modelClasses = [ ve.dm.MWReferenceNode ];
ve.ui.MWReferenceDialogTool.static.commandName = 'reference';
ve.ui.MWReferenceDialogTool.static.requiresSelection = [ 'linear' ];
ve.ui.toolFactory.register( ve.ui.MWReferenceDialogTool );
/**
@ -48,7 +47,6 @@ ve.ui.MWUseExistingReferenceDialogTool.static.title =
OO.ui.deferMsg( 'visualeditor-dialog-reference-useexisting-tool' );
ve.ui.MWUseExistingReferenceDialogTool.static.modelClasses = [];
ve.ui.MWUseExistingReferenceDialogTool.static.commandName = 'reference/existing';
ve.ui.MWUseExistingReferenceDialogTool.static.requiresSelection = [ 'linear' ];
ve.ui.MWUseExistingReferenceDialogTool.static.autoAddToGroup = false;
ve.ui.MWUseExistingReferenceDialogTool.static.autoAddToCatchall = false;
@ -94,5 +92,4 @@ ve.ui.MWReferencesListDialogTool.static.title =
OO.ui.deferMsg( 'visualeditor-dialogbutton-referenceslist-tooltip' );
ve.ui.MWReferencesListDialogTool.static.modelClasses = [ ve.dm.MWReferencesListNode ];
ve.ui.MWReferencesListDialogTool.static.commandName = 'referencesList';
ve.ui.MWReferencesListDialogTool.static.requiresSelection = [ 'linear' ];
ve.ui.toolFactory.register( ve.ui.MWReferencesListDialogTool );

View file

@ -35,8 +35,6 @@ ve.ui.MWTransclusionDialogTool.static.title =
ve.ui.MWTransclusionDialogTool.static.modelClasses = [ ve.dm.MWTransclusionNode ];
ve.ui.MWTransclusionDialogTool.static.requiresSelection = [ 'linear' ];
ve.ui.MWTransclusionDialogTool.static.commandName = 'transclusion';
/**

View file

@ -8,71 +8,135 @@
/* MW Command Registrations */
ve.ui.commandRegistry.register(
new ve.ui.Command( 'link', 'mwlink', 'open' )
new ve.ui.Command(
'link', 'mwlink', 'open', { supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'gallery', 'window', 'open', 'gallery' )
new ve.ui.Command(
'gallery', 'window', 'open',
{ args: ['gallery'], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'media', 'window', 'open', 'media' )
new ve.ui.Command(
'media', 'window', 'open',
{ args: ['media'], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'referencesList', 'window', 'open', 'referencesList' )
new ve.ui.Command(
'referencesList', 'window', 'open',
{ args: ['referencesList'], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'reference', 'window', 'open', 'reference' )
new ve.ui.Command(
'reference', 'window', 'open',
{ args: ['reference'], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'reference/existing', 'window', 'open', 'reference', { useExisting: true } )
new ve.ui.Command(
'reference/existing', 'window', 'open',
{ args: [ 'reference', { useExisting: true } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'transclusion', 'window', 'open', 'transclusion' )
new ve.ui.Command(
'transclusion', 'window', 'open',
{ args: ['transclusion'], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'alienExtension', 'window', 'open', 'alienExtension' )
new ve.ui.Command(
'alienExtension', 'window', 'open',
{ args: ['alienExtension'], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'meta', 'window', 'open', 'meta' )
new ve.ui.Command(
'meta', 'window', 'open',
{ args: ['meta'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'meta/settings', 'window', 'open', 'meta', { page: 'settings' } )
new ve.ui.Command(
'meta/settings', 'window', 'open',
{ args: [ 'meta', { page: 'settings' } ] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'meta/advanced', 'window', 'open', 'meta', { page: 'advancedSettings' } )
new ve.ui.Command(
'meta/advanced', 'window', 'open',
{ args: [ 'meta', { page: 'advancedSettings' } ] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'meta/categories', 'window', 'open', 'meta', { page: 'categories' } )
new ve.ui.Command(
'meta/categories', 'window', 'open',
{ args: [ 'meta', { page: 'categories' } ] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'meta/languages', 'window', 'open', 'meta', { page: 'languages' } )
new ve.ui.Command(
'meta/languages', 'window', 'open',
{ args: [ 'meta', { page: 'languages' } ] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'heading1', 'format', 'convert', 'mwHeading', { level: 1 } )
new ve.ui.Command(
'heading1', 'format', 'convert',
{ args: [ 'mwHeading', { level: 1 } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'heading2', 'format', 'convert', 'mwHeading', { level: 2 } )
new ve.ui.Command(
'heading2', 'format', 'convert',
{ args: [ 'mwHeading', { level: 2 } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'heading3', 'format', 'convert', 'mwHeading', { level: 3 } )
new ve.ui.Command(
'heading3', 'format', 'convert',
{ args: [ 'mwHeading', { level: 3 } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'heading4', 'format', 'convert', 'mwHeading', { level: 4 } )
new ve.ui.Command(
'heading4', 'format', 'convert',
{ args: [ 'mwHeading', { level: 4 } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'heading5', 'format', 'convert', 'mwHeading', { level: 5 } )
new ve.ui.Command(
'heading5', 'format', 'convert',
{ args: [ 'mwHeading', { level: 5 } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'heading6', 'format', 'convert', 'mwHeading', { level: 6 } )
new ve.ui.Command(
'heading6', 'format', 'convert',
{ args: [ 'mwHeading', { level: 6 } ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'preformatted', 'format', 'convert', 'mwPreformatted' )
new ve.ui.Command(
'preformatted', 'format', 'convert',
{ args: [ 'mwPreformatted' ], supportedSelections: ['linear'] }
)
);
ve.ui.commandRegistry.register(
new ve.ui.Command( 'insertTable', 'table', 'create', {
new ve.ui.Command( 'insertTable', 'table', 'create',
{
args: [ {
header: true,
rows: 3,
cols: 4,
type: 'mwTable',
attributes: { wikitable: true }
} )
} ],
supportedSelections: ['linear']
}
)
);