Explorar el Código

Added more documentation and fixed the pointless interface doc.

Piotrek Koszuliński hace 5 años
padre
commit
c00851cf85

+ 10 - 1
packages/ckeditor5-link/docs/features/link.md

@@ -132,7 +132,7 @@ ClassicEditor
 		// ...
 		// ...
 		link: {
 		link: {
 			decorators: {
 			decorators: {
-				addTargetToExternalLinks: {
+				openInNewTab: {
 					mode: 'manual',
 					mode: 'manual',
 					label: 'Open in a new tab',
 					label: 'Open in a new tab',
 					attributes: {
 					attributes: {
@@ -195,6 +195,15 @@ ClassicEditor
 					attributes: {
 					attributes: {
 						download: 'file'
 						download: 'file'
 					}
 					}
+				},
+				openInNewTab: {
+					mode: 'manual',
+					label: 'Open in a new tab',
+					defaultValue: true,			// This option will be selected by default.
+					attributes: {
+						target: '_blank',
+						rel: 'noopener noreferrer'
+					}
 				}
 				}
 			}
 			}
 		}
 		}

+ 8 - 2
packages/ckeditor5-link/src/link.js

@@ -147,8 +147,13 @@ export default class Link extends Plugin {
  */
  */
 
 
 /**
 /**
- * Represents a link decorator definition ({@link module:link/link~LinkDecoratorManualDefinition `'manual'`}
- * or {@link module:link/link~LinkDecoratorAutomaticDefinition `'automatic'`}).
+ * A link decorator definition. Two types implement this defition:
+ *
+ * * {@link module:link/link~LinkDecoratorManualDefinition}
+ * * {@link module:link/link~LinkDecoratorAutomaticDefinition}
+ *
+ * Refer to their document for more information about available options or to the
+ * {@glink features/link#custom-link-attributes-decorators link feature guide} for general information.
  *
  *
  * @interface LinkDecoratorDefinition
  * @interface LinkDecoratorDefinition
  */
  */
@@ -203,6 +208,7 @@ export default class Link extends Plugin {
  *		{
  *		{
  *			mode: 'manual',
  *			mode: 'manual',
  *			label: 'Open in a new tab',
  *			label: 'Open in a new tab',
+ *			defaultValue: true,
  *			attributes: {
  *			attributes: {
  *				target: '_blank',
  *				target: '_blank',
  *				rel: 'noopener noreferrer'
  *				rel: 'noopener noreferrer'