Jelajahi Sumber

Add Editing to RestrictedMode names.

Maciej Gołaszewski 6 tahun lalu
induk
melakukan
4cb6ffe02f

+ 6 - 6
packages/ckeditor5-restricted-editing/src/restrictedmode.js → packages/ckeditor5-restricted-editing/src/restrictededitingmode.js

@@ -4,12 +4,12 @@
  */
 
 /**
- * @module restricted-editing/restrictedmode
+ * @module restricted-editing/restrictededitingmode
  */
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
-import RestrictedModeEditing from './restrictedmodeediting';
-import RestrictedModeUI from './restrictedmodeui';
+import RestrictedEditingModeEditing from './restrictededitingmodeediting';
+import RestrictedEditingModeUI from './restrictededitingmodeui';
 
 import '../theme/restrictedediting.css';
 
@@ -23,15 +23,15 @@ import '../theme/restrictedediting.css';
  *
  * @extends module:core/plugin~Plugin
  */
-export default class RestrictedMode extends Plugin {
+export default class RestrictedEditingMode extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
 	static get pluginName() {
-		return 'RestrictedMode';
+		return 'RestrictedEditingMode';
 	}
 
 	static get requires() {
-		return [ RestrictedModeEditing, RestrictedModeUI ];
+		return [ RestrictedEditingModeEditing, RestrictedEditingModeUI ];
 	}
 }

+ 9 - 9
packages/ckeditor5-restricted-editing/src/restrictedmodeediting.js → packages/ckeditor5-restricted-editing/src/restrictededitingmodeediting.js

@@ -4,12 +4,12 @@
  */
 
 /**
- * @module restricted-editing/restrictedmodeediting
+ * @module restricted-editing/restrictededitingmodeediting
  */
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import Matcher from '@ckeditor/ckeditor5-engine/src/view/matcher';
-import RestrictedEditingNavigationCommand from './restrictedmodenavigationcommand';
+import RestrictedEditingNavigationCommand from './restrictededitingmodenavigationcommand';
 
 const HIGHLIGHT_CLASS = 'ck-restricted-editing-exception_selected';
 
@@ -22,12 +22,12 @@ const HIGHLIGHT_CLASS = 'ck-restricted-editing-exception_selected';
  *
  * @extends module:core/plugin~Plugin
  */
-export default class RestrictedModeEditing extends Plugin {
+export default class RestrictedEditingModeEditing extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
 	static get pluginName() {
-		return 'RestrictedModeEditing';
+		return 'RestrictedEditingModeEditing';
 	}
 
 	/**
@@ -90,7 +90,7 @@ export default class RestrictedModeEditing extends Plugin {
 		editor.keystrokes.set( 'Shift+Tab', getCommandExecuter( 'goToPreviousRestrictedEditingRegion' ) );
 
 		this._setupExceptionHighlighting();
-		this._setupRestrictedMode( editor );
+		this._setupRestrictedEditingMode( editor );
 
 		// Block clipboard completely in restricted mode.
 		this.listenTo( editor.editing.view.document, 'clipboardInput', evt => {
@@ -159,7 +159,7 @@ export default class RestrictedModeEditing extends Plugin {
 		} );
 	}
 
-	_setupRestrictedMode( editor ) {
+	_setupRestrictedEditingMode( editor ) {
 		this._disableCommands( editor );
 
 		const selection = editor.model.document.selection;
@@ -285,11 +285,11 @@ export default class RestrictedModeEditing extends Plugin {
 			.map( name => editor.commands.get( name ) );
 
 		for ( const command of commands ) {
-			command.clearForceDisabled( 'RestrictedMode' );
+			command.clearForceDisabled( 'RestrictedEditingMode' );
 		}
 
 		for ( const command of exceptionDisable.map( name => editor.commands.get( name ) ) ) {
-			command.forceDisabled( 'RestrictedMode' );
+			command.forceDisabled( 'RestrictedEditingMode' );
 		}
 	}
 
@@ -299,7 +299,7 @@ export default class RestrictedModeEditing extends Plugin {
 			.map( name => editor.commands.get( name ) );
 
 		for ( const command of commands ) {
-			command.forceDisabled( 'RestrictedMode' );
+			command.forceDisabled( 'RestrictedEditingMode' );
 		}
 	}
 

+ 2 - 2
packages/ckeditor5-restricted-editing/src/restrictedmodenavigationcommand.js → packages/ckeditor5-restricted-editing/src/restrictededitingmodenavigationcommand.js

@@ -4,7 +4,7 @@
  */
 
 /**
- * @module restricted-editing/restrictedmodenavigationcommand
+ * @module restricted-editing/restrictededitingmodenavigationcommand
  */
 
 import Command from '@ckeditor/ckeditor5-core/src/command';
@@ -14,7 +14,7 @@ import Command from '@ckeditor/ckeditor5-core/src/command';
  *
  * @extends module:core/command~Command
  */
-export default class RestrictedModeNavigationCommand extends Command {
+export default class RestrictedEditingModeNavigationCommand extends Command {
 	/**
 	 * Creates an instance of the command.
 	 *

+ 3 - 3
packages/ckeditor5-restricted-editing/src/restrictedmodeui.js → packages/ckeditor5-restricted-editing/src/restrictededitingmodeui.js

@@ -4,7 +4,7 @@
  */
 
 /**
- * @module restricted-editing/restrictedmodeui
+ * @module restricted-editing/restrictededitingmodeui
  */
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
@@ -21,12 +21,12 @@ import Collection from '@ckeditor/ckeditor5-utils/src/collection';
  *
  * @extends module:core/plugin~Plugin
  */
-export default class RestrictedModeUI extends Plugin {
+export default class RestrictedEditingModeUI extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
 	static get pluginName() {
-		return 'RestrictedModeUI';
+		return 'RestrictedEditingModeUI';
 	}
 
 	/**

+ 4 - 4
packages/ckeditor5-restricted-editing/tests/manual/restrictedediting.js

@@ -10,7 +10,7 @@ import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articleplugi
 import Table from '@ckeditor/ckeditor5-table/src/table';
 
 import StandardEditingMode from '../../src/standardeditingmode';
-import RestrictedMode from '../../src/restrictedmode';
+import RestrictedEditingMode from '../../src/restrictededitingmode';
 
 const restrictedModeButton = document.getElementById( 'mode-restricted' );
 const standardModeButton = document.getElementById( 'mode-standard' );
@@ -28,7 +28,7 @@ function startMode( selectedMode ) {
 	if ( selectedMode === 'standard' ) {
 		startStandardEditingMode();
 	} else {
-		startRestrictedMode();
+		startRestrictedEditingMode();
 	}
 }
 
@@ -53,9 +53,9 @@ async function startStandardEditingMode() {
 	} );
 }
 
-async function startRestrictedMode() {
+async function startRestrictedEditingMode() {
 	await reloadEditor( {
-		plugins: [ ArticlePluginSet, Table, RestrictedMode ],
+		plugins: [ ArticlePluginSet, Table, RestrictedEditingMode ],
 		toolbar: [ 'bold', 'italic', 'link', '|', 'restrictedEditing', '|', 'undo', 'redo' ]
 	} );
 }

+ 10 - 10
packages/ckeditor5-restricted-editing/tests/restrictedmode.js

@@ -8,11 +8,11 @@
 import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
 import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
 
-import RestrictedMode from './../src/restrictedmode';
-import RestrictedModeUI from './../src/restrictedmodeui';
-import RestrictedModeEditing from './../src/restrictedmodeediting';
+import RestrictedEditingMode from './../src/restrictededitingmode';
+import RestrictedEditingModeUI from './../src/restrictededitingmodeui';
+import RestrictedEditingModeEditing from './../src/restrictededitingmodeediting';
 
-describe( 'RestrictedMode', () => {
+describe( 'RestrictedEditingMode', () => {
 	let editor, element;
 
 	testUtils.createSinonSandbox();
@@ -21,7 +21,7 @@ describe( 'RestrictedMode', () => {
 		element = document.createElement( 'div' );
 		document.body.appendChild( element );
 
-		editor = await ClassicTestEditor.create( element, { plugins: [ RestrictedMode ] } );
+		editor = await ClassicTestEditor.create( element, { plugins: [ RestrictedEditingMode ] } );
 	} );
 
 	afterEach( () => {
@@ -31,14 +31,14 @@ describe( 'RestrictedMode', () => {
 	} );
 
 	it( 'should be named', () => {
-		expect( RestrictedMode.pluginName ).to.equal( 'RestrictedMode' );
+		expect( RestrictedEditingMode.pluginName ).to.equal( 'RestrictedEditingMode' );
 	} );
 
-	it( 'should load the RestrictedModeEditing plugin', () => {
-		expect( editor.plugins.get( RestrictedModeEditing ) ).to.be.instanceOf( RestrictedModeEditing );
+	it( 'should load the RestrictedEditingModeEditing plugin', () => {
+		expect( editor.plugins.get( RestrictedEditingModeEditing ) ).to.be.instanceOf( RestrictedEditingModeEditing );
 	} );
 
-	it( 'should load the RestrictedModeUI plugin', () => {
-		expect( editor.plugins.get( RestrictedModeUI ) ).to.be.instanceOf( RestrictedModeUI );
+	it( 'should load the RestrictedEditingModeUI plugin', () => {
+		expect( editor.plugins.get( RestrictedEditingModeUI ) ).to.be.instanceOf( RestrictedEditingModeUI );
 	} );
 } );

+ 3 - 3
packages/ckeditor5-restricted-editing/tests/restrictedmodeediting-commands.js

@@ -10,7 +10,7 @@ import Typing from '@ckeditor/ckeditor5-typing/src/typing';
 import Command from '@ckeditor/ckeditor5-core/src/command';
 import { setData as setModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 
-import RestrictedModeEditing from './../src/restrictedmodeediting';
+import RestrictedEditingModeEditing from './../src/restrictededitingmodeediting';
 import UndoEditing from '@ckeditor/ckeditor5-undo/src/undoediting';
 
 describe( 'RestrictedEditingEditing - commands', () => {
@@ -22,7 +22,7 @@ describe( 'RestrictedEditingEditing - commands', () => {
 		let model, firstParagraph;
 
 		beforeEach( async () => {
-			editor = await VirtualTestEditor.create( { plugins: [ Paragraph, Typing, RestrictedModeEditing ] } );
+			editor = await VirtualTestEditor.create( { plugins: [ Paragraph, Typing, RestrictedEditingModeEditing ] } );
 			model = editor.model;
 
 			setModelData( model, '<paragraph>[]foo bar baz</paragraph>' );
@@ -549,7 +549,7 @@ describe( 'RestrictedEditingEditing - commands', () => {
 		let model, firstParagraph;
 
 		beforeEach( async () => {
-			editor = await VirtualTestEditor.create( { plugins: [ Paragraph, Typing, UndoEditing, RestrictedModeEditing ] } );
+			editor = await VirtualTestEditor.create( { plugins: [ Paragraph, Typing, UndoEditing, RestrictedEditingModeEditing ] } );
 			model = editor.model;
 
 			setModelData( model, '<paragraph>[]foo bar baz</paragraph>' );

+ 14 - 13
packages/ckeditor5-restricted-editing/tests/restrictedmodeediting.js

@@ -15,17 +15,17 @@ import { assertEqualMarkup } from '@ckeditor/ckeditor5-utils/tests/_utils/utils'
 import Typing from '@ckeditor/ckeditor5-typing/src/typing';
 import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard';
 
-import RestrictedModeEditing from './../src/restrictedmodeediting';
-import RestrictedModeNavigationCommand from '../src/restrictedmodenavigationcommand';
+import RestrictedEditingModeEditing from './../src/restrictededitingmodeediting';
+import RestrictedEditingModeNavigationCommand from '../src/restrictededitingmodenavigationcommand';
 
-describe( 'RestrictedModeEditing', () => {
+describe( 'RestrictedEditingModeEditing', () => {
 	let editor;
 
 	testUtils.createSinonSandbox();
 
 	describe( 'plugin', () => {
 		beforeEach( async () => {
-			editor = await VirtualTestEditor.create( { plugins: [ RestrictedModeEditing ] } );
+			editor = await VirtualTestEditor.create( { plugins: [ RestrictedEditingModeEditing ] } );
 		} );
 
 		afterEach( async () => {
@@ -33,19 +33,20 @@ describe( 'RestrictedModeEditing', () => {
 		} );
 
 		it( 'should be named', () => {
-			expect( RestrictedModeEditing.pluginName ).to.equal( 'RestrictedModeEditing' );
+			expect( RestrictedEditingModeEditing.pluginName ).to.equal( 'RestrictedEditingModeEditing' );
 		} );
 
 		it( 'should be loaded', () => {
-			expect( editor.plugins.get( RestrictedModeEditing ) ).to.be.instanceOf( RestrictedModeEditing );
+			expect( editor.plugins.get( RestrictedEditingModeEditing ) ).to.be.instanceOf( RestrictedEditingModeEditing );
 		} );
 
 		it( 'adds a "goToPreviousRestrictedEditingRegion" command', () => {
-			expect( editor.commands.get( 'goToPreviousRestrictedEditingRegion' ) ).to.be.instanceOf( RestrictedModeNavigationCommand );
+			expect( editor.commands.get( 'goToPreviousRestrictedEditingRegion' ) )
+				.to.be.instanceOf( RestrictedEditingModeNavigationCommand );
 		} );
 
 		it( 'adds a "goToNextRestrictedEditingRegion" command', () => {
-			expect( editor.commands.get( 'goToNextRestrictedEditingRegion' ) ).to.be.instanceOf( RestrictedModeNavigationCommand );
+			expect( editor.commands.get( 'goToNextRestrictedEditingRegion' ) ).to.be.instanceOf( RestrictedEditingModeNavigationCommand );
 		} );
 	} );
 
@@ -53,7 +54,7 @@ describe( 'RestrictedModeEditing', () => {
 		let model;
 
 		beforeEach( async () => {
-			editor = await VirtualTestEditor.create( { plugins: [ Paragraph, RestrictedModeEditing ] } );
+			editor = await VirtualTestEditor.create( { plugins: [ Paragraph, RestrictedEditingModeEditing ] } );
 			model = editor.model;
 		} );
 
@@ -145,7 +146,7 @@ describe( 'RestrictedModeEditing', () => {
 		let model;
 
 		beforeEach( async () => {
-			editor = await VirtualTestEditor.create( { plugins: [ Paragraph, Typing, RestrictedModeEditing ] } );
+			editor = await VirtualTestEditor.create( { plugins: [ Paragraph, Typing, RestrictedEditingModeEditing ] } );
 			model = editor.model;
 		} );
 
@@ -330,7 +331,7 @@ describe( 'RestrictedModeEditing', () => {
 		let model, viewDoc;
 
 		beforeEach( async () => {
-			editor = await VirtualTestEditor.create( { plugins: [ Paragraph, Typing, Clipboard, RestrictedModeEditing ] } );
+			editor = await VirtualTestEditor.create( { plugins: [ Paragraph, Typing, Clipboard, RestrictedEditingModeEditing ] } );
 			model = editor.model;
 			viewDoc = editor.editing.view.document;
 		} );
@@ -388,7 +389,7 @@ describe( 'RestrictedModeEditing', () => {
 
 		beforeEach( async () => {
 			editor = await VirtualTestEditor.create( {
-				plugins: [ Paragraph, RestrictedModeEditing, BoldEditing ]
+				plugins: [ Paragraph, RestrictedEditingModeEditing, BoldEditing ]
 			} );
 			model = editor.model;
 			view = editor.editing.view;
@@ -621,7 +622,7 @@ describe( 'RestrictedModeEditing', () => {
 
 		beforeEach( async () => {
 			editor = await VirtualTestEditor.create( {
-				plugins: [ Paragraph, RestrictedModeEditing, BoldEditing ]
+				plugins: [ Paragraph, RestrictedEditingModeEditing, BoldEditing ]
 			} );
 
 			model = editor.model;

+ 4 - 4
packages/ckeditor5-restricted-editing/tests/restrictedmodenavigationcommand.js

@@ -6,9 +6,9 @@
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';
 import { setData as setModelData, getData as getModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 
-import RestrictedModeNavigationCommand from '../src/restrictedmodenavigationcommand';
+import RestrictedEditingModeNavigationCommand from '../src/restrictededitingmodenavigationcommand';
 
-describe( 'RestrictedModeNavigationCommand', () => {
+describe( 'RestrictedEditingModeNavigationCommand', () => {
 	let editor, forwardCommand, backwardCommand, model;
 
 	beforeEach( () => {
@@ -18,8 +18,8 @@ describe( 'RestrictedModeNavigationCommand', () => {
 				editor = newEditor;
 				model = editor.model;
 
-				forwardCommand = new RestrictedModeNavigationCommand( editor, 'forward' );
-				backwardCommand = new RestrictedModeNavigationCommand( editor, 'backward' );
+				forwardCommand = new RestrictedEditingModeNavigationCommand( editor, 'forward' );
+				backwardCommand = new RestrictedEditingModeNavigationCommand( editor, 'backward' );
 
 				model.schema.register( 'paragraph', { inheritAllFrom: '$block' } );
 				editor.model.schema.extend( '$text', { allowAttributes: [ 'restrictedEditingException' ] } );

+ 6 - 6
packages/ckeditor5-restricted-editing/tests/restrictedmodeui.js

@@ -8,11 +8,11 @@
 import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
 import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
 
-import RestrictedModeEditing from './../src/restrictedmodeediting';
-import RestrictedModeUI from './../src/restrictedmodeui';
+import RestrictedEditingModeEditing from './../src/restrictededitingmodeediting';
+import RestrictedEditingModeUI from './../src/restrictededitingmodeui';
 import lockIcon from '../theme/icons/contentlock.svg';
 
-describe( 'RestrictedModeUI', () => {
+describe( 'RestrictedEditingModeUI', () => {
 	let editor, element, goToPreviousCommand, goToNextCommand;
 
 	testUtils.createSinonSandbox();
@@ -22,7 +22,7 @@ describe( 'RestrictedModeUI', () => {
 		document.body.appendChild( element );
 
 		editor = await ClassicTestEditor.create( element, {
-			plugins: [ RestrictedModeEditing, RestrictedModeUI ]
+			plugins: [ RestrictedEditingModeEditing, RestrictedEditingModeUI ]
 		} );
 
 		goToPreviousCommand = editor.commands.get( 'goToPreviousRestrictedEditingRegion' );
@@ -37,11 +37,11 @@ describe( 'RestrictedModeUI', () => {
 
 	describe( 'plugin', () => {
 		it( 'should be named', () => {
-			expect( RestrictedModeUI.pluginName ).to.equal( 'RestrictedModeUI' );
+			expect( RestrictedEditingModeUI.pluginName ).to.equal( 'RestrictedEditingModeUI' );
 		} );
 
 		it( 'should be loaded', () => {
-			expect( editor.plugins.get( RestrictedModeUI ) ).to.be.instanceOf( RestrictedModeUI );
+			expect( editor.plugins.get( RestrictedEditingModeUI ) ).to.be.instanceOf( RestrictedEditingModeUI );
 		} );
 	} );