Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Samsel committed Aug 25, 2017
1 parent c1d571e commit 4c40d4f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
6 changes: 4 additions & 2 deletions plugins/wysiwygarea/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,12 @@
doc.getDocumentElement().addClass( doc.$.compatMode );
}

// Prevent IE/Edge from leaving a new paragraph/div after deleting all contents in body. (http://dev.ckeditor.com/ticket/6966, http://dev.ckeditor.com/ticket/13142)
// Prevent IE/Edge from leaving a new paragraph/div after deleting all contents in body (http://dev.ckeditor.com/ticket/6966, http://dev.ckeditor.com/ticket/13142).
if ( CKEDITOR.env.ie && !CKEDITOR.env.edge && editor.enterMode != CKEDITOR.ENTER_P ) {
removeSuperfluousElement( 'p' );
} else if ( CKEDITOR.env.edge && editor.enterMode != CKEDITOR.ENTER_DIV && CKEDITOR.env.version < 15 ) {
}
// From version Edge 15 additional `div` are not added to the editor.
else if ( CKEDITOR.env.edge && editor.enterMode != CKEDITOR.ENTER_DIV && CKEDITOR.env.version < 15 ) {
removeSuperfluousElement( 'div' );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
var editor = CKEDITOR.replace( 'editor1', {
height: '600px'
} );
setInterval( function() {
document.getElementById( 'output' ).innerText = editor.editable().getFirst().getName();
}, 200)
var output = document.getElementById( 'output' )
editor.on( 'instanceReady', function() {
editor.editable().$.addEventListener( 'keyup', function() {
output.innerText = editor.editable().getFirst().getName();
} );
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
@bender-ckeditor-plugins: image2, wysiwygarea, undo, sourcearea

----
1. Put caret in the text on the right and type some character.
1. Use `Ctrl + Z` or `Cmd + Z` shortcut to make undo.
1. Put caret in the text on the right and type some text.
1. Use `Ctrl + Z` or `Cmd + Z` shortcut to make undo few times.

**Expected:** Text returns to previous form. Below editor will be written `div` on green background.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
};

bender.test( {
// #704
'test keeping widget wrapper in editor when superflous elemnts are checked': function() {
CKEDITOR.plugins.add( 'test', {
requires: 'widget',
Expand Down
14 changes: 7 additions & 7 deletions tests/plugins/wysiwygarea/superfluouselement.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bender.editor = {
};

bender.test( {
'Test removing superfluous <p> inserted by IE11': function() {
'test removing superfluous <p> inserted by IE11': function() {
if ( !CKEDITOR.env.ie || CKEDITOR.env.edge ) {
assert.ignore();
}
Expand Down Expand Up @@ -44,7 +44,7 @@ bender.test( {
wait();
},

'Test removing superfluous <div> inserted by Edge < v15': function() {
'test removing superfluous <div> inserted by Edge': function() {
if ( !CKEDITOR.env.edge || CKEDITOR.env.version >= 15 ) {
assert.ignore();
}
Expand All @@ -70,7 +70,7 @@ bender.test( {
wait();
},

'Test not removing non-superfluous <div> in Edge < v15': function() {
'test not removing non-superfluous <div> in Edge': function() {
if ( !CKEDITOR.env.edge || CKEDITOR.env.version >= 15 ) {
assert.ignore();
}
Expand All @@ -95,7 +95,7 @@ bender.test( {
wait();
},

'Test removing superfluous <div> when typing in Edge < v15': function() {
'test removing superfluous <div> when typing in Edge': function() {
if ( !CKEDITOR.env.edge || CKEDITOR.env.version >= 15 ) {
assert.ignore();
}
Expand Down Expand Up @@ -145,7 +145,7 @@ bender.test( {
wait();
},

'Test not removing non-superfluous <div> when typing in Edge < v15': function() {
'test not removing non-superfluous <div> when typing in Edge': function() {
if ( !CKEDITOR.env.edge || CKEDITOR.env.version >= 15 ) {
assert.ignore();
}
Expand Down Expand Up @@ -179,7 +179,7 @@ bender.test( {
},

// http://dev.ckeditor.com/ticket/14831
'Test not removing [data-cke-temp] <div> when typing': function() {
'test not removing [data-cke-temp] <div> when typing': function() {
if ( !CKEDITOR.env.edge || CKEDITOR.env.version < 14 ) {
assert.ignore();
}
Expand Down Expand Up @@ -229,7 +229,7 @@ bender.test( {
wait();
},

'Test not-removing <div> with any attributes in Edge < v15': function() {
'test not removing <div> with any attributes in Edge': function() {
if ( !CKEDITOR.env.edge || CKEDITOR.env.version >= 15 ) {
assert.ignore();
}
Expand Down

0 comments on commit 4c40d4f

Please sign in to comment.