Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Increased the specificity of CSS rules. Introduced the .ck class for …
Browse files Browse the repository at this point in the history
…editor UI components (see: ckeditor/ckeditor5#494).
  • Loading branch information
oleq committed Mar 23, 2018
1 parent 66d67c0 commit 498c08c
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 96 deletions.
1 change: 1 addition & 0 deletions src/imagetextalternative/ui/textalternativeformview.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export default class TextAlternativeFormView extends View {

attributes: {
class: [
'ck',
'ck-text-alternative-form',
],

Expand Down
12 changes: 6 additions & 6 deletions tests/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe( 'Image', () => {
setModelData( model, '[<image alt="alt text" src="foo.png"></image>]' );

expect( getViewData( view ) ).to.equal(
'[<figure class="ck-widget ck-widget_selected image" contenteditable="false">' +
'[<figure class="ck ck-widget ck-widget_selected image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>]'
);
Expand All @@ -73,7 +73,7 @@ describe( 'Image', () => {
setModelData( model, '[<image src="foo.png" alt=""></image>]' );

expect( getViewData( view ) ).to.equal(
'[<figure class="ck-widget ck-widget_selected image" contenteditable="false">' +
'[<figure class="ck ck-widget ck-widget_selected image" contenteditable="false">' +
'<img alt="" src="foo.png"></img>' +
'</figure>]'
);
Expand All @@ -89,10 +89,10 @@ describe( 'Image', () => {
);

expect( getViewData( view ) ).to.equal(
'[<figure class="ck-widget ck-widget_selected image" contenteditable="false">' +
'[<figure class="ck ck-widget ck-widget_selected image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>]' +
'<figure class="ck-widget image" contenteditable="false">' +
'<figure class="ck ck-widget image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>'
);
Expand All @@ -103,10 +103,10 @@ describe( 'Image', () => {
} );

expect( getViewData( view ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false">' +
'<figure class="ck ck-widget image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>' +
'[<figure class="ck-widget ck-widget_selected image" contenteditable="false">' +
'[<figure class="ck ck-widget ck-widget_selected image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>]'
);
Expand Down
8 changes: 4 additions & 4 deletions tests/image/converters.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ describe( 'Image converters', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false"><img alt="foo bar" src=""></img></figure>'
'<figure class="ck ck-widget image" contenteditable="false"><img alt="foo bar" src=""></img></figure>'
);
} );

Expand All @@ -228,7 +228,7 @@ describe( 'Image converters', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false"><img src=""></img></figure>'
'<figure class="ck ck-widget image" contenteditable="false"><img src=""></img></figure>'
);
} );

Expand All @@ -241,7 +241,7 @@ describe( 'Image converters', () => {
} );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false"><img alt="baz quix" src=""></img></figure>'
'<figure class="ck ck-widget image" contenteditable="false"><img alt="baz quix" src=""></img></figure>'
);
} );

Expand All @@ -253,7 +253,7 @@ describe( 'Image converters', () => {
setModelData( model, '<image src="" alt="foo bar"></image>' );

expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false"><img src=""></img></figure>'
'<figure class="ck ck-widget image" contenteditable="false"><img src=""></img></figure>'
);
} );
} );
Expand Down
20 changes: 10 additions & 10 deletions tests/image/imageediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ describe( 'ImageEditing', () => {
setModelData( model, '<image src="foo.png" alt="alt text"></image>' );

expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
'<figure class="ck ck-widget image" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
);
} );

Expand All @@ -402,7 +402,7 @@ describe( 'ImageEditing', () => {
} );

expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false"><img alt="new text" src="foo.png"></img></figure>'
'<figure class="ck ck-widget image" contenteditable="false"><img alt="new text" src="foo.png"></img></figure>'
);
} );

Expand All @@ -415,7 +415,7 @@ describe( 'ImageEditing', () => {
} );

expect( getViewData( view, { withoutSelection: true } ) )
.to.equal( '<figure class="ck-widget image" contenteditable="false"><img src="foo.png"></img></figure>' );
.to.equal( '<figure class="ck ck-widget image" contenteditable="false"><img src="foo.png"></img></figure>' );
} );

it( 'should not convert change if is already consumed', () => {
Expand All @@ -431,7 +431,7 @@ describe( 'ImageEditing', () => {
} );

expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
'<figure class="ck ck-widget image" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
);
} );

Expand All @@ -444,7 +444,7 @@ describe( 'ImageEditing', () => {
'</image>' );

expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false">' +
'<figure class="ck ck-widget image" contenteditable="false">' +
'<img alt="alt text" sizes="100vw" src="foo.png" srcset="small.png 148w, big.png 1024w"></img>' +
'</figure>'
);
Expand All @@ -464,7 +464,7 @@ describe( 'ImageEditing', () => {
} );

expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false">' +
'<figure class="ck ck-widget image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>'
);
Expand All @@ -479,7 +479,7 @@ describe( 'ImageEditing', () => {
'</image>' );

expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false">' +
'<figure class="ck ck-widget image" contenteditable="false">' +
'<img alt="alt text" sizes="100vw" src="foo.png" srcset="small.png 148w, big.png 1024w" width="1024"></img>' +
'</figure>'
);
Expand All @@ -494,7 +494,7 @@ describe( 'ImageEditing', () => {
} );

expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false">' +
'<figure class="ck ck-widget image" contenteditable="false">' +
'<img src="foo.png"></img>' +
'</figure>'
);
Expand All @@ -514,7 +514,7 @@ describe( 'ImageEditing', () => {
} );

expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false">' +
'<figure class="ck ck-widget image" contenteditable="false">' +
'<img src="foo.png"></img>' +
'</figure>'
);
Expand All @@ -536,7 +536,7 @@ describe( 'ImageEditing', () => {
);

expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
'<figure class="ck-widget image" contenteditable="false">' +
'<figure class="ck ck-widget image" contenteditable="false">' +
'<img alt="alt text" src="foo.png"></img>' +
'</figure>'
);
Expand Down
Loading

0 comments on commit 498c08c

Please sign in to comment.