idleb %!s(int64=7) %!d(string=hai) anos
pai
achega
149dc4c556

+ 3 - 1
packages/ckeditor5-basic-styles/lang/contexts.json

@@ -3,5 +3,7 @@
 	"Italic": "Toolbar button tooltip for the Italic feature.",
 	"Underline": "Toolbar button tooltip for the Underline feature.",
 	"Code": "Toolbar button tooltip for the Code feature.",
-	"Strikethrough": "Toolbar button tooltip for the Strikethrough feature."
+	"Strikethrough": "Toolbar button tooltip for the Strikethrough feature.",
+	"Subscript": "Toolbar button tooltip for the Subscript feature.",
+	"Superscript": "Toolbar button tooltip for the Superscript feature."
 }

+ 1 - 1
packages/ckeditor5-basic-styles/src/subscript.js

@@ -31,6 +31,6 @@ export default class Subscript extends Plugin {
 	 * @inheritDoc
 	 */
 	static get pluginName() {
-		return 'Sub';
+		return 'Subscript';
 	}
 }

+ 4 - 4
packages/ckeditor5-basic-styles/src/subscript/subscriptediting.js

@@ -10,7 +10,7 @@
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import AttributeCommand from '../attributecommand';
 
-const SUB = 'sub';
+const SUBSCRIPT = 'subscript';
 
 /**
  * The subscript editing feature.
@@ -27,12 +27,12 @@ export default class SubscriptEditing extends Plugin {
 	init() {
 		const editor = this.editor;
 		// Allow sub attribute on text nodes.
-		editor.model.schema.extend( '$text', { allowAttributes: SUB } );
+		editor.model.schema.extend( '$text', { allowAttributes: SUBSCRIPT } );
 
 		// Build converter from model to view for data and editing pipelines.
 
 		editor.conversion.attributeToElement( {
-			model: SUB,
+			model: SUBSCRIPT,
 			view: 'sub',
 			upcastAlso: [
 				{
@@ -44,6 +44,6 @@ export default class SubscriptEditing extends Plugin {
 		} );
 
 		// Create sub command.
-		editor.commands.add( SUB, new AttributeCommand( editor, SUB ) );
+		editor.commands.add( SUBSCRIPT, new AttributeCommand( editor, SUBSCRIPT ) );
 	}
 }

+ 4 - 4
packages/ckeditor5-basic-styles/src/subscript/subscriptui.js

@@ -12,7 +12,7 @@ import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
 
 import subscriptIcon from '../../theme/icons/subscript.svg';
 
-const SUB = 'sub';
+const SUBSCRIPT = 'subscript';
 
 /**
  * The subscript UI feature. It introduces the Subscript button.
@@ -28,8 +28,8 @@ export default class SubscriptUI extends Plugin {
 		const t = editor.t;
 
 		// Add subscript button to feature components.
-		editor.ui.componentFactory.add( SUB, locale => {
-			const command = editor.commands.get( SUB );
+		editor.ui.componentFactory.add( SUBSCRIPT, locale => {
+			const command = editor.commands.get( SUBSCRIPT );
 			const view = new ButtonView( locale );
 
 			view.set( {
@@ -41,7 +41,7 @@ export default class SubscriptUI extends Plugin {
 			view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
 
 			// Execute command.
-			this.listenTo( view, 'execute', () => editor.execute( SUB ) );
+			this.listenTo( view, 'execute', () => editor.execute( SUBSCRIPT ) );
 
 			return view;
 		} );

+ 1 - 1
packages/ckeditor5-basic-styles/src/superscript.js

@@ -31,6 +31,6 @@ export default class Superscript extends Plugin {
 	 * @inheritDoc
 	 */
 	static get pluginName() {
-		return 'Super';
+		return 'Superscript';
 	}
 }

+ 4 - 4
packages/ckeditor5-basic-styles/src/superscript/superscriptediting.js

@@ -10,7 +10,7 @@
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import AttributeCommand from '../attributecommand';
 
-const SUPER = 'super';
+const SUPERSCRIPT = 'superscript';
 
 /**
  * The superscript editing feature.
@@ -27,12 +27,12 @@ export default class SuperscriptEditing extends Plugin {
 	init() {
 		const editor = this.editor;
 		// Allow super attribute on text nodes.
-		editor.model.schema.extend( '$text', { allowAttributes: SUPER } );
+		editor.model.schema.extend( '$text', { allowAttributes: SUPERSCRIPT } );
 
 		// Build converter from model to view for data and editing pipelines.
 
 		editor.conversion.attributeToElement( {
-			model: SUPER,
+			model: SUPERSCRIPT,
 			view: 'sup',
 			upcastAlso: [
 				{
@@ -44,6 +44,6 @@ export default class SuperscriptEditing extends Plugin {
 		} );
 
 		// Create super command.
-		editor.commands.add( SUPER, new AttributeCommand( editor, SUPER ) );
+		editor.commands.add( SUPERSCRIPT, new AttributeCommand( editor, SUPERSCRIPT ) );
 	}
 }

+ 4 - 4
packages/ckeditor5-basic-styles/src/superscript/superscriptui.js

@@ -12,7 +12,7 @@ import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
 
 import superscriptIcon from '../../theme/icons/superscript.svg';
 
-const SUPER = 'super';
+const SUPERSCRIPT = 'superscript';
 
 /**
  * The superscript UI feature. It introduces the Superscript button.
@@ -28,8 +28,8 @@ export default class SuperscriptUI extends Plugin {
 		const t = editor.t;
 
 		// Add superscript button to feature components.
-		editor.ui.componentFactory.add( SUPER, locale => {
-			const command = editor.commands.get( SUPER );
+		editor.ui.componentFactory.add( SUPERSCRIPT, locale => {
+			const command = editor.commands.get( SUPERSCRIPT );
 			const view = new ButtonView( locale );
 
 			view.set( {
@@ -41,7 +41,7 @@ export default class SuperscriptUI extends Plugin {
 			view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
 
 			// Execute command.
-			this.listenTo( view, 'execute', () => editor.execute( SUPER ) );
+			this.listenTo( view, 'execute', () => editor.execute( SUPERSCRIPT ) );
 
 			return view;
 		} );

+ 1 - 1
packages/ckeditor5-basic-styles/tests/manual/basic-styles.html

@@ -1,3 +1,3 @@
 <div id="editor">
-	<p><i>This</i> <s>is</s> <code>an</code> <strong>editor</strong> <u>instance</u>.</p>
+	<p><i>This</i> <s>is</s> <code>an</code> <strong>editor</strong> <u>instance</u>, X<sub>1</sub>, X<sup>2</sup>.</p>
 </div>

+ 4 - 2
packages/ckeditor5-basic-styles/tests/manual/basic-styles.js

@@ -13,11 +13,13 @@ import Italic from '../../src/italic';
 import Strikethrough from '../../src/strikethrough';
 import Underline from '../../src/underline';
 import Code from '../../src/code';
+import Subscript from '../../src/subscript';
+import Superscript from '../../src/Superscript';
 
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
-		plugins: [ Essentials, Paragraph, Bold, Italic, Strikethrough, Underline, Code ],
-		toolbar: [ 'bold', 'italic', 'strikethrough', 'underline', 'code', 'undo', 'redo' ]
+		plugins: [ Essentials, Paragraph, Bold, Italic, Strikethrough, Underline, Code, Subscript, Superscript ],
+		toolbar: [ 'bold', 'italic', 'strikethrough', 'underline', 'code', 'undo', 'redo', 'subscript', 'superscript' ]
 	} )
 	.then( editor => {
 		window.editor = editor;

+ 4 - 2
packages/ckeditor5-basic-styles/tests/manual/basic-styles.md

@@ -5,5 +5,7 @@
   * bold **"editor"**,
   * underline "instance",
   * strikethrough ~~"is"~~,
-  * code `"an"`.
-2. Test the bold, italic, strikethrough, underline and code features live.
+  * code `"an"`,
+  * subscript X<sub>1</sub>,
+  * superscript X<sup>2</sup>.
+2. Test the bold, italic, strikethrough, underline, code, subscript and superscript features live.