mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 03:08:42 +00:00
Rename ui.Tool.static.canEditModel to isCompatibleWith
Change-Id: Ic7583f0966946c870f38a2e7ad06e558238c8794
This commit is contained in:
parent
36fc3b5911
commit
e41d4d470f
|
@ -39,7 +39,7 @@ ve.ui.DialogTool.static.dialog = '';
|
|||
/**
|
||||
* Annotation or node models this tool is related to.
|
||||
*
|
||||
* Used by #canEditModel.
|
||||
* Used by #isCompatibleWith.
|
||||
*
|
||||
* @static
|
||||
* @property {Function[]}
|
||||
|
@ -50,7 +50,7 @@ ve.ui.DialogTool.static.modelClasses = [];
|
|||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
ve.ui.DialogTool.static.canEditModel = function ( model ) {
|
||||
ve.ui.DialogTool.static.isCompatibleWith = function ( model ) {
|
||||
return ve.isInstanceOfAny( model, this.modelClasses );
|
||||
};
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ ve.ui.InspectorTool.static.inspector = '';
|
|||
/**
|
||||
* Annotation or node models this tool is related to.
|
||||
*
|
||||
* Used by #canEditModel.
|
||||
* Used by #isCompatibleWith.
|
||||
*
|
||||
* @static
|
||||
* @property {Function[]}
|
||||
|
@ -50,7 +50,7 @@ ve.ui.InspectorTool.static.modelClasses = [];
|
|||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
ve.ui.InspectorTool.static.canEditModel = function ( model ) {
|
||||
ve.ui.InspectorTool.static.isCompatibleWith = function ( model ) {
|
||||
return ve.isInstanceOfAny( model, this.modelClasses );
|
||||
};
|
||||
|
||||
|
|
|
@ -127,15 +127,15 @@ ve.ui.Tool.static.titleMessage = '';
|
|||
ve.ui.Tool.static.autoAdd = true;
|
||||
|
||||
/**
|
||||
* Check if this tool can be used on a model.
|
||||
* Check if this tool is compatible with given data.
|
||||
*
|
||||
* @method
|
||||
* @static
|
||||
* @inheritable
|
||||
* @param {ve.dm.Model} model Model to check
|
||||
* @returns {boolean} Tool can be used to edit model
|
||||
* @param {Mixed} data Data to check
|
||||
* @returns {boolean} Tool can be used with data
|
||||
*/
|
||||
ve.ui.Tool.static.canEditModel = function () {
|
||||
ve.ui.Tool.static.isCompatibleWith = function () {
|
||||
return false;
|
||||
};
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ ve.ui.ToolFactory.prototype.getToolsForAnnotations = function ( annotations ) {
|
|||
candidateTool = null;
|
||||
for ( name in this.registry ) {
|
||||
tool = this.registry[name];
|
||||
if ( tool.static.canEditModel( annotation ) ) {
|
||||
if ( tool.static.isCompatibleWith( annotation ) ) {
|
||||
if ( !candidateTool || tool.prototype instanceof candidateTool ) {
|
||||
candidateTool = tool;
|
||||
candidateToolName = name;
|
||||
|
@ -182,7 +182,7 @@ ve.ui.ToolFactory.prototype.getToolForNode = function ( node ) {
|
|||
|
||||
for ( name in this.registry ) {
|
||||
tool = this.registry[name];
|
||||
if ( tool.static.canEditModel( node ) ) {
|
||||
if ( tool.static.isCompatibleWith( node ) ) {
|
||||
if ( !candidateTool || tool.prototype instanceof candidateTool ) {
|
||||
candidateTool = tool;
|
||||
candidateToolName = name;
|
||||
|
|
Loading…
Reference in a new issue