瀏覽代碼

Rename helper class.

Mateusz Samsel 6 年之前
父節點
當前提交
d5ae67f1dc

+ 5 - 5
packages/ckeditor5-link/src/linkediting.js

@@ -11,7 +11,7 @@ import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import LinkCommand from './linkcommand';
 import UnlinkCommand from './unlinkcommand';
 import { createLinkElement, ensureSafeUrl } from './utils';
-import AutomaticDispatchers from './utils/automaticdispatcher';
+import AutomaticDecorators from './utils/automaticdecorators';
 import bindTwoStepCaretToAttribute from '@ckeditor/ckeditor5-engine/src/utils/bindtwostepcarettoattribute';
 import findLinkRange from './findlinkrange';
 import '../theme/link.css';
@@ -70,10 +70,10 @@ export default class LinkEditing extends Plugin {
 				}
 			} );
 
-		const automaticDispatcher = new AutomaticDispatchers();
+		const automaticDecorators = new AutomaticDecorators();
 
 		if ( editor.config.get( 'link.targetDecorator' ) ) {
-			automaticDispatcher.add( {
+			automaticDecorators.add( {
 				mode: AUTO,
 				callback: url => {
 					const EXTERNAL_LINKS_REGEXP = /^(https?:)?\/\//;
@@ -87,9 +87,9 @@ export default class LinkEditing extends Plugin {
 		}
 
 		const linkDecorators = editor.config.get( 'link.decorators' ) || [];
-		automaticDispatcher.add( linkDecorators.filter( item => item.mode === AUTO ) );
+		automaticDecorators.add( linkDecorators.filter( item => item.mode === AUTO ) );
 
-		editor.conversion.for( 'downcast' ).add( automaticDispatcher.getCallback() );
+		editor.conversion.for( 'downcast' ).add( automaticDecorators.getDispatcher() );
 
 		// Create linking commands.
 		editor.commands.add( 'link', new LinkCommand( editor ) );

+ 3 - 3
packages/ckeditor5-link/src/utils/automaticdispatcher.js

@@ -4,10 +4,10 @@
  */
 
 /**
- * @module link/utils/automaticdispatcher
+ * @module link/utils/automaticdecorators
  */
 
-export default class AutomaticDispatchers {
+export default class AutomaticDecorators {
 	constructor() {
 		this._definitions = new Set();
 	}
@@ -20,7 +20,7 @@ export default class AutomaticDispatchers {
 		}
 	}
 
-	getCallback() {
+	getDispatcher() {
 		return dispatcher => {
 			dispatcher.on( 'attribute:linkHref', ( evt, data, conversionApi ) => {
 				// There is only test as this behavior decorates links and