mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34:54 +00:00
f9864e9288
This isn't as simple as just dropping applyToAppendedContent = false on LinkAnnotation, because browsers differ in their continuation behavior. Firefox continues links, but Chrome doesn't. To work around this, add a property indicating that the annotation needs its continuation behavior to be forced. Rename areAnnotationsCorrect() to needsPawn() accordingly. Bug: 49931 Change-Id: Id6424af89c92bba2be87736e8a937e0f2067c007
42 lines
1,022 B
JavaScript
42 lines
1,022 B
JavaScript
/*!
|
|
* VisualEditor ContentEditable AnnotationFactory class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* ContentEditable annotation factory.
|
|
*
|
|
* @class
|
|
* @extends ve.NamedClassFactory
|
|
* @constructor
|
|
*/
|
|
ve.ce.AnnotationFactory = function VeCeAnnotationFactory() {
|
|
// Parent constructor
|
|
ve.NamedClassFactory.call( this );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ce.AnnotationFactory, ve.NamedClassFactory );
|
|
|
|
/* Methods */
|
|
|
|
/**
|
|
* Check if an annotation needs to force continuation
|
|
* @param {string} type Annotation type
|
|
* @returns {boolean} Whether the annotation needs to force continuation
|
|
*/
|
|
ve.ce.AnnotationFactory.prototype.isAnnotationContinuationForced = function ( type ) {
|
|
if ( type in this.registry ) {
|
|
return this.registry[type].static.forceContinuation;
|
|
}
|
|
return false;
|
|
};
|
|
|
|
/* Initialization */
|
|
|
|
// TODO: Move instantiation to a different file
|
|
ve.ce.annotationFactory = new ve.ce.AnnotationFactory();
|