|
|
@@ -196,9 +196,7 @@ export default class Writer {
|
|
|
* @error model-writer-insert-forbidden-move
|
|
|
*/
|
|
|
throw new CKEditorError(
|
|
|
- 'model-writer-insert-forbidden-move: ' +
|
|
|
- 'Cannot move a node from a document to a different tree. ' +
|
|
|
- 'It is forbidden to move a node that was already in a document outside of it.',
|
|
|
+ 'undefinedit-is-forbidden-to-move-a-node-that-was-already-in-a-document-outside-of-it.',
|
|
|
this
|
|
|
);
|
|
|
} else {
|
|
|
@@ -484,7 +482,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-move-invalid-range
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-move-invalid-range: Invalid range to move.', this );
|
|
|
+ throw new CKEditorError( 'writer-move-invalid-range', this );
|
|
|
}
|
|
|
|
|
|
if ( !range.isFlat ) {
|
|
|
@@ -493,7 +491,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-move-range-not-flat
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-move-range-not-flat: Range to move is not flat.', this );
|
|
|
+ throw new CKEditorError( 'writer-move-range-not-flat', this );
|
|
|
}
|
|
|
|
|
|
const position = Position._createAt( itemOrPosition, offset );
|
|
|
@@ -513,7 +511,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-move-different-document
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-move-different-document: Range is going to be moved between different documents.', this );
|
|
|
+ throw new CKEditorError( 'writer-move-different-document', this );
|
|
|
}
|
|
|
|
|
|
const version = range.root.document ? range.root.document.version : null;
|
|
|
@@ -565,7 +563,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-merge-no-element-before
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-merge-no-element-before: Node before merge position must be an element.', this );
|
|
|
+ throw new CKEditorError( 'writer-merge-no-element-before', this );
|
|
|
}
|
|
|
|
|
|
if ( !( nodeAfter instanceof Element ) ) {
|
|
|
@@ -574,7 +572,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-merge-no-element-after
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-merge-no-element-after: Node after merge position must be an element.', this );
|
|
|
+ throw new CKEditorError( 'writer-merge-no-element-after', this );
|
|
|
}
|
|
|
|
|
|
if ( !position.root.document ) {
|
|
|
@@ -724,7 +722,7 @@ export default class Writer {
|
|
|
* @error writer-rename-not-element-instance
|
|
|
*/
|
|
|
throw new CKEditorError(
|
|
|
- 'writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.',
|
|
|
+ 'writer-rename-not-element-instance',
|
|
|
this
|
|
|
);
|
|
|
}
|
|
|
@@ -761,7 +759,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-split-element-no-parent
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-split-element-no-parent: Element with no parent can not be split.', this );
|
|
|
+ throw new CKEditorError( 'writer-split-element-no-parent', this );
|
|
|
}
|
|
|
|
|
|
// When limit element is not defined lets set splitElement parent as limit.
|
|
|
@@ -770,7 +768,7 @@ export default class Writer {
|
|
|
}
|
|
|
|
|
|
if ( !position.parent.getAncestors( { includeSelf: true } ).includes( limitElement ) ) {
|
|
|
- throw new CKEditorError( 'writer-split-invalid-limit-element: Limit element is not a position ancestor.', this );
|
|
|
+ throw new CKEditorError( 'writer-split-invalid-limit-element', this );
|
|
|
}
|
|
|
|
|
|
// We need to cache elements that will be created as a result of the first split because
|
|
|
@@ -820,7 +818,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-wrap-range-not-flat
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-wrap-range-not-flat: Range to wrap is not flat.', this );
|
|
|
+ throw new CKEditorError( 'writer-wrap-range-not-flat', this );
|
|
|
}
|
|
|
|
|
|
const element = elementOrString instanceof Element ? elementOrString : new Element( elementOrString );
|
|
|
@@ -831,7 +829,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-wrap-element-not-empty
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-wrap-element-not-empty: Element to wrap with is not empty.', this );
|
|
|
+ throw new CKEditorError( 'writer-wrap-element-not-empty', this );
|
|
|
}
|
|
|
|
|
|
if ( element.parent !== null ) {
|
|
|
@@ -840,7 +838,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-wrap-element-attached
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-wrap-element-attached: Element to wrap with is already attached to tree model.', this );
|
|
|
+ throw new CKEditorError( 'writer-wrap-element-attached', this );
|
|
|
}
|
|
|
|
|
|
this.insert( element, range.start );
|
|
|
@@ -866,7 +864,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-unwrap-element-no-parent
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.', this );
|
|
|
+ throw new CKEditorError( 'writer-unwrap-element-no-parent', this );
|
|
|
}
|
|
|
|
|
|
this.move( Range._createIn( element ), this.createPositionAfter( element ) );
|
|
|
@@ -922,7 +920,7 @@ export default class Writer {
|
|
|
* @error writer-addMarker-no-usingOperation
|
|
|
*/
|
|
|
throw new CKEditorError(
|
|
|
- 'writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.',
|
|
|
+ 'writer-addmarker-no-usingoperation',
|
|
|
this
|
|
|
);
|
|
|
}
|
|
|
@@ -937,7 +935,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-addMarker-marker-exists
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-addMarker-marker-exists: Marker with provided name already exists.', this );
|
|
|
+ throw new CKEditorError( 'writer-addmarker-marker-exists', this );
|
|
|
}
|
|
|
|
|
|
if ( !range ) {
|
|
|
@@ -947,7 +945,7 @@ export default class Writer {
|
|
|
* @error writer-addMarker-no-range
|
|
|
*/
|
|
|
throw new CKEditorError(
|
|
|
- 'writer-addMarker-no-range: Range parameter is required when adding a new marker.',
|
|
|
+ 'writer-addmarker-no-range',
|
|
|
this
|
|
|
);
|
|
|
}
|
|
|
@@ -1042,7 +1040,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-updateMarker-marker-not-exists
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-updateMarker-marker-not-exists: Marker with provided name does not exists.', this );
|
|
|
+ throw new CKEditorError( 'writer-updatemarker-marker-not-exists', this );
|
|
|
}
|
|
|
|
|
|
if ( !options ) {
|
|
|
@@ -1064,7 +1062,7 @@ export default class Writer {
|
|
|
* @error writer-updateMarker-wrong-options
|
|
|
*/
|
|
|
throw new CKEditorError(
|
|
|
- 'writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.',
|
|
|
+ 'writer-updatemarker-wrong-options',
|
|
|
this
|
|
|
);
|
|
|
}
|
|
|
@@ -1116,7 +1114,7 @@ export default class Writer {
|
|
|
*
|
|
|
* @error writer-removeMarker-no-marker
|
|
|
*/
|
|
|
- throw new CKEditorError( 'writer-removeMarker-no-marker: Trying to remove marker which does not exist.', this );
|
|
|
+ throw new CKEditorError( 'writer-removemarker-no-marker', this );
|
|
|
}
|
|
|
|
|
|
const marker = this.model.markers.get( name );
|
|
|
@@ -1349,7 +1347,7 @@ export default class Writer {
|
|
|
* @error writer-incorrect-use
|
|
|
*/
|
|
|
if ( this.model._currentWriter !== this ) {
|
|
|
- throw new CKEditorError( 'writer-incorrect-use: Trying to use a writer outside the change() block.', this );
|
|
|
+ throw new CKEditorError( 'writer-incorrect-use', this );
|
|
|
}
|
|
|
}
|
|
|
|