|
|
@@ -63,8 +63,8 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
} );
|
|
|
|
|
|
describe( 'upcast', () => {
|
|
|
- it( 'should convert <span class="ck-restricted-editing-exception"> to marker', () => {
|
|
|
- editor.setData( '<p>foo <span class="ck-restricted-editing-exception">bar</span> baz</p>' );
|
|
|
+ it( 'should convert <span class="restricted-editing-exception"> to marker', () => {
|
|
|
+ editor.setData( '<p>foo <span class="restricted-editing-exception">bar</span> baz</p>' );
|
|
|
|
|
|
expect( model.markers.has( 'restrictedEditingException:1' ) ).to.be.true;
|
|
|
|
|
|
@@ -74,10 +74,10 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
expect( marker.getEnd().path ).to.deep.equal( [ 0, 7 ] );
|
|
|
} );
|
|
|
|
|
|
- it( 'should convert multiple <span class="ck-restricted-editing-exception">', () => {
|
|
|
+ it( 'should convert multiple <span class="restricted-editing-exception">', () => {
|
|
|
editor.setData(
|
|
|
- '<p>foo <span class="ck-restricted-editing-exception">bar</span> baz</p>' +
|
|
|
- '<p>ABCDEF<span class="ck-restricted-editing-exception">GHIJK</span>LMNOPQRST</p>'
|
|
|
+ '<p>foo <span class="restricted-editing-exception">bar</span> baz</p>' +
|
|
|
+ '<p>ABCDEF<span class="restricted-editing-exception">GHIJK</span>LMNOPQRST</p>'
|
|
|
);
|
|
|
|
|
|
expect( model.markers.has( 'restrictedEditingException:1' ) ).to.be.true;
|
|
|
@@ -111,7 +111,7 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
} );
|
|
|
} );
|
|
|
|
|
|
- const expectedView = '<p>foo <span class="ck-restricted-editing-exception">bar</span> baz</p>';
|
|
|
+ const expectedView = '<p>foo <span class="restricted-editing-exception">bar</span> baz</p>';
|
|
|
expect( editor.getData() ).to.equal( expectedView );
|
|
|
expect( getViewData( editor.editing.view, { withoutSelection: true } ) ).to.equal( expectedView );
|
|
|
} );
|
|
|
@@ -129,9 +129,9 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
} );
|
|
|
} );
|
|
|
|
|
|
- expect( editor.getData() ).to.equal( '<p>foo <span class="ck-restricted-editing-exception"></span>bar baz</p>' );
|
|
|
+ expect( editor.getData() ).to.equal( '<p>foo <span class="restricted-editing-exception"></span>bar baz</p>' );
|
|
|
expect( getViewData( editor.editing.view, { withoutSelection: true } ) ).to.equal(
|
|
|
- '<p>foo <span class="ck-restricted-editing-exception ck-restricted-editing-exception_collapsed"></span>bar baz</p>'
|
|
|
+ '<p>foo <span class="restricted-editing-exception restricted-editing-exception_collapsed"></span>bar baz</p>'
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
@@ -150,11 +150,11 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
} );
|
|
|
|
|
|
expect( editor.getData() ).to.equal(
|
|
|
- '<p><span class="ck-restricted-editing-exception"><b>foo bar baz</b></span></p>'
|
|
|
+ '<p><span class="restricted-editing-exception"><b>foo bar baz</b></span></p>'
|
|
|
);
|
|
|
expect( getViewData( editor.editing.view, { withoutSelection: true } ) ).to.equal(
|
|
|
'<p>' +
|
|
|
- '<span class="ck-restricted-editing-exception ck-restricted-editing-exception_selected"><b>foo bar baz</b></span>' +
|
|
|
+ '<span class="restricted-editing-exception restricted-editing-exception_selected"><b>foo bar baz</b></span>' +
|
|
|
'</p>'
|
|
|
);
|
|
|
} );
|
|
|
@@ -201,12 +201,12 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
} );
|
|
|
|
|
|
expect( editor.getData() ).to.equal(
|
|
|
- '<p>foo <span class="ck-restricted-editing-exception">bar</span> baz</p>' +
|
|
|
- '<p>xxx <span class="ck-restricted-editing-exception">yRyy</span> zzz</p>' );
|
|
|
+ '<p>foo <span class="restricted-editing-exception">bar</span> baz</p>' +
|
|
|
+ '<p>xxx <span class="restricted-editing-exception">yRyy</span> zzz</p>' );
|
|
|
|
|
|
expect( getViewData( editor.editing.view, { withoutSelection: true } ) ).to.equal(
|
|
|
- '<p>foo <span class="ck-restricted-editing-exception">bar</span> baz</p>' +
|
|
|
- '<p>xxx <span class="ck-restricted-editing-exception ck-restricted-editing-exception_selected">yRyy</span> zzz</p>' );
|
|
|
+ '<p>foo <span class="restricted-editing-exception">bar</span> baz</p>' +
|
|
|
+ '<p>xxx <span class="restricted-editing-exception restricted-editing-exception_selected">yRyy</span> zzz</p>' );
|
|
|
} );
|
|
|
|
|
|
it( 'should block user typing outside exception markers', () => {
|
|
|
@@ -765,7 +765,7 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
} );
|
|
|
|
|
|
expect( getViewData( view ) ).to.equal(
|
|
|
- '<p>foo <span class="ck-restricted-editing-exception ck-restricted-editing-exception_selected">b{a}r</span> baz</p>'
|
|
|
+ '<p>foo <span class="restricted-editing-exception restricted-editing-exception_selected">b{a}r</span> baz</p>'
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
@@ -784,13 +784,13 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
} );
|
|
|
|
|
|
expect( getViewData( view ) ).to.equal(
|
|
|
- '<p>foo <span class="ck-restricted-editing-exception ck-restricted-editing-exception_selected">b{a}r</span> baz</p>'
|
|
|
+ '<p>foo <span class="restricted-editing-exception restricted-editing-exception_selected">b{a}r</span> baz</p>'
|
|
|
);
|
|
|
|
|
|
model.change( writer => writer.setSelection( model.document.getRoot().getChild( 0 ), 0 ) );
|
|
|
|
|
|
expect( getViewData( view ) ).to.equal(
|
|
|
- '<p>{}foo <span class="ck-restricted-editing-exception">bar</span> baz</p>'
|
|
|
+ '<p>{}foo <span class="restricted-editing-exception">bar</span> baz</p>'
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
@@ -809,13 +809,13 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
} );
|
|
|
|
|
|
expect( getViewData( view ) ).to.equal(
|
|
|
- '<p>{}foo <span class="ck-restricted-editing-exception">bar</span> baz</p>'
|
|
|
+ '<p>{}foo <span class="restricted-editing-exception">bar</span> baz</p>'
|
|
|
);
|
|
|
|
|
|
model.change( writer => writer.setSelection( model.document.getRoot().getChild( 0 ), 6 ) );
|
|
|
|
|
|
expect( getViewData( view ) ).to.equal(
|
|
|
- '<p>foo <span class="ck-restricted-editing-exception ck-restricted-editing-exception_selected">ba{}r</span> baz</p>'
|
|
|
+ '<p>foo <span class="restricted-editing-exception restricted-editing-exception_selected">ba{}r</span> baz</p>'
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
@@ -839,7 +839,7 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
} );
|
|
|
|
|
|
expect( getViewData( view ) ).to.equal(
|
|
|
- '<p>foo <span class="ck-restricted-editing-exception ck-restricted-editing-exception_selected">bFOO{a}r</span> baz</p>'
|
|
|
+ '<p>foo <span class="restricted-editing-exception restricted-editing-exception_selected">bFOO{a}r</span> baz</p>'
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
@@ -865,7 +865,7 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
} );
|
|
|
|
|
|
expect( getViewData( view ) ).to.equal(
|
|
|
- '<p>foo <span class="ck-restricted-editing-exception ck-restricted-editing-exception_selected">b{}r</span> baz</p>'
|
|
|
+ '<p>foo <span class="restricted-editing-exception restricted-editing-exception_selected">b{}r</span> baz</p>'
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
@@ -892,7 +892,7 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
|
|
|
expect( getViewData( view ) ).to.equal(
|
|
|
'<p>foo ' +
|
|
|
- '<span class="ck-restricted-editing-exception ck-restricted-editing-exception_selected">' +
|
|
|
+ '<span class="restricted-editing-exception restricted-editing-exception_selected">' +
|
|
|
'<strong>b{a</strong>' +
|
|
|
'}r</span>' +
|
|
|
' baz</p>'
|
|
|
@@ -921,7 +921,7 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
} );
|
|
|
|
|
|
expect( getViewData( view ) ).to.equal(
|
|
|
- '<p>foo {<span class="ck-restricted-editing-exception ck-restricted-editing-exception_selected">ba}r</span> baz</p>'
|
|
|
+ '<p>foo {<span class="restricted-editing-exception restricted-editing-exception_selected">ba}r</span> baz</p>'
|
|
|
);
|
|
|
} );
|
|
|
|
|
|
@@ -953,7 +953,7 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
expect( getViewData( view ) ).to.equal(
|
|
|
'<p>' +
|
|
|
'<span>foo </span>' +
|
|
|
- '<span class="ck-restricted-editing-exception ck-restricted-editing-exception_selected">' +
|
|
|
+ '<span class="restricted-editing-exception restricted-editing-exception_selected">' +
|
|
|
'<span>b</span>{a}r' +
|
|
|
'</span>' +
|
|
|
' baz</p>'
|
|
|
@@ -962,7 +962,7 @@ describe( 'RestrictedEditingModeEditing', () => {
|
|
|
model.change( writer => writer.removeMarker( 'fooMarker' ) );
|
|
|
|
|
|
expect( getViewData( view ) ).to.equal(
|
|
|
- '<p>foo <span class="ck-restricted-editing-exception ck-restricted-editing-exception_selected">b{a}r</span> baz</p>'
|
|
|
+ '<p>foo <span class="restricted-editing-exception restricted-editing-exception_selected">b{a}r</span> baz</p>'
|
|
|
);
|
|
|
} );
|
|
|
} );
|