mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
9563f0880d
* Only show the inspector if the selected text has an inspectable annotation * Replace the inline menu with a toolbar containing inspectable annotations * Change the appearance of the inspector to match new mockups * Add the trash can icon for removing annotations * Move iframe handling code into a class that manages all that nonsense Change-Id: I840f72426f9a9e50054a28de950393f0e9913153
47 lines
1 KiB
JavaScript
47 lines
1 KiB
JavaScript
/**
|
|
* VisualEditor data model InspectorFactory class.
|
|
*
|
|
* @copyright 2011-2012 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* DataModel Inspector factory.
|
|
*
|
|
* @class
|
|
* @constructor
|
|
* @extends {ve.Factory}
|
|
*/
|
|
ve.ui.InspectorFactory = function VeDmInspectorFactory() {
|
|
// Parent constructor
|
|
ve.Factory.call( this );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ui.InspectorFactory, ve.Factory );
|
|
|
|
/* Methods */
|
|
|
|
/**
|
|
* Gets an inspector constructor for a given annotation type.
|
|
*
|
|
* TODO: Use this in inspector tools to determine their state.
|
|
*
|
|
* @method
|
|
* @param {String} type Annotation type
|
|
* @returns {Function} Matching inspector constructor
|
|
*/
|
|
ve.ui.InspectorFactory.prototype.lookupByAnnotationType = function ( type ) {
|
|
for ( var name in this.registry ) {
|
|
// name = link
|
|
if ( this.registry[name].static.matchingTypes.indexOf( type ) !== -1 ) {
|
|
return this.registry[name];
|
|
}
|
|
}
|
|
};
|
|
|
|
/* Initialization */
|
|
|
|
ve.ui.inspectorFactory = new ve.ui.InspectorFactory();
|