Skip to content

Commit

Permalink
Merge branch 'master' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Jasiun committed Feb 12, 2015
2 parents ec874ca + a35f3db commit 439339b
Show file tree
Hide file tree
Showing 465 changed files with 107 additions and 13,375 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Expand Up @@ -42,6 +42,12 @@ Other Changes:

## CKEditor 4.4.8

Fixed Issues:

* [#12899](http://dev.ckeditor.com/ticket/12899): Fixed: Corrected wrong tag ending for horizontal box definition in [dialogui](http://ckeditor.com/addon/dialogui) plugin. Thanks to [mizafish](https://github.com/mizafish)!
* [#12796](http://dev.ckeditor.com/ticket/12796): Fixed: [Indent List](http://ckeditor.com/addon/indentlist) plugin unwraps parent li elements.
* [#12885](http://dev.ckeditor.com/ticket/12885): Added missing getData parameter documentation.

Other Changes:

* [#12844](http://dev.ckeditor.com/ticket/12844): Upgraded the [testing environment](http://docs.ckeditor.com/#!/guide/dev_tests) to [Bender.js](https://github.com/benderjs/benderjs) `0.2.*`.
Expand Down
12 changes: 9 additions & 3 deletions core/editor.js
Expand Up @@ -864,10 +864,16 @@
* if ( CKEDITOR.instances.editor1.getData() == '' )
* alert( 'There is no data available.' );
*
* @param {Boolean} internal If set to `true`, it will prevent firing the
* {@link CKEDITOR.editor#beforeGetData} and {@link CKEDITOR.editor#event-getData} events, so
* the real content of the editor will not be read and cached data will be returned. The method will work
* much faster, but this may result in the editor returning the data that is not up to date. This parameter
* should thus only be set to `true` when you are certain that the cached data is up to date.
*
* @returns {String} The editor data.
*/
getData: function( noEvents ) {
!noEvents && this.fire( 'beforeGetData' );
getData: function( internal ) {
!internal && this.fire( 'beforeGetData' );

var eventData = this._.data;

Expand All @@ -882,7 +888,7 @@
eventData = { dataValue: eventData };

// Fire "getData" so data manipulation may happen.
!noEvents && this.fire( 'getData', eventData );
!internal && this.fire( 'getData', eventData );

return eventData.dataValue;
},
Expand Down
3 changes: 1 addition & 2 deletions gruntfile.js
Expand Up @@ -17,8 +17,7 @@ module.exports = function( grunt ) {
'plugins/htmlwriter/samples/assets/outputforflash/**',
'tests/adapters/jquery/_assets/**',
'tests/core/dom/_assets/**',
'tests/core/selection/_helpers/rangy.js',
'tests/plugins/mathjax/_assets/truncated-mathjax/**'
'tests/core/selection/_helpers/rangy.js'
];

// Basic configuration which will be overloaded by the tasks.
Expand Down
2 changes: 1 addition & 1 deletion plugins/dialogui/plugin.js
Expand Up @@ -170,7 +170,7 @@ CKEDITOR.plugins.add( 'dialogui', {
' for="' + _.inputId + '"' +
( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) + '>' +
CKEDITOR.tools.htmlEncode( elementDefinition.label ) +
'</span>'
'</label>'
},
{
type: 'html',
Expand Down
11 changes: 8 additions & 3 deletions plugins/indentlist/plugin.js
Expand Up @@ -232,11 +232,16 @@
range;

while ( ( range = iterator.getNextRange() ) ) {
var rangeRoot = range.getCommonAncestor(),
nearestListBlock = rangeRoot;
var nearestListBlock = range.getCommonAncestor();

while ( nearestListBlock && !( nearestListBlock.type == CKEDITOR.NODE_ELEMENT && context[ nearestListBlock.getName() ] ) )
while ( nearestListBlock && !( nearestListBlock.type == CKEDITOR.NODE_ELEMENT && context[ nearestListBlock.getName() ] ) ) {
// Avoid having plugin propagate to parent of editor in inline mode by canceling the indentation. (#12796)
if ( editor.editable().equals( nearestListBlock ) ) {
nearestListBlock = false;
break;
}
nearestListBlock = nearestListBlock.getParent();
}

// Avoid having selection boundaries out of the list.
// <ul><li>[...</li></ul><p>...]</p> => <ul><li>[...]</li></ul><p>...</p>
Expand Down
6 changes: 3 additions & 3 deletions plugins/mathjax/dev/mathjax.html
Expand Up @@ -78,23 +78,23 @@ <h1>Apollo 11</h1>
extraPlugins: 'mathjax',
height: 350,
allowedContent: true,
// mathJaxLib: './truncated-mathjax/MathJax.js?config=TeX-AMS_HTML',
// mathJaxLib: 'http://cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML',
mathJaxClass: 'mjx'
} );

CKEDITOR.inline( 'editor2', {
extraPlugins: 'mathjax',
height: 350,
allowedContent: true,
// mathJaxLib: './truncated-mathjax/MathJax.js?config=TeX-AMS_HTML',
// mathJaxLib: 'http://cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML',
mathJaxClass: 'mjx'
} );

CKEDITOR.replace( 'editor3', {
extraPlugins: 'mathjax,divarea',
height: 350,
allowedContent: true,
// mathJaxLib: './truncated-mathjax/MathJax.js?config=TeX-AMS_HTML',
// mathJaxLib: 'http://cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML',
mathJaxClass: 'mjx'
} );

Expand Down
5 changes: 5 additions & 0 deletions tests/plugins/indentlist/editorinlist.html
@@ -0,0 +1,5 @@
<ul>
<li id="outerListItem">
<div contenteditable="true" id="editor1"></div>
</li>
</ul>
72 changes: 72 additions & 0 deletions tests/plugins/indentlist/editorinlist.js
@@ -0,0 +1,72 @@
/* bender-tags: editor,unit */
/* bender-ckeditor-plugins: toolbar,floatingspace,list,indentlist */

CKEDITOR.disableAutoInline = true;

bender.editor = {
creator: 'inline',
name: 'editor1'
};

bender.test( {
'test outdent does not unwrap parent li with multiple lists and both lists selected': function() {
var bot = this.editorBot,
editor = bot.editor;

editor.focus();
bender.tools.selection.setWithHtml( editor, '<ul><li>[1</li></ul><ol><li>2]</li></ol>' );

var originalEditable = editor.editable(),
originalEditableParent = originalEditable.getParent();

bot.execCommand( 'outdent' );

var body = CKEDITOR.document.getBody();
assert.isTrue( body.contains( originalEditableParent ), 'editable\'s parent was not removed from the body element' );
assert.areSame( originalEditableParent, originalEditable.getParent(), 'editable\'s parent did not change' );

// It is not necessarily the most expected result (I would expect both lists to be outdented),
// but this is how the algorithm works in an iframed editor at the moment.
assert.areSame( '<p>1</p><ol><li>2</li></ol>', editor.getData(), 'the first of the selected lists was outdented' );
},

'test outdent does not unwrap parent li with multiple lists and one list selected': function() {
var bot = this.editorBot,
editor = bot.editor;

editor.focus();
bender.tools.selection.setWithHtml( editor, '<ul><li>[1]</li></ul><ol><li>2</li></ol>' );

var originalEditable = editor.editable(),
originalEditableParent = originalEditable.getParent();

bot.execCommand( 'outdent' );

var body = CKEDITOR.document.getBody();
assert.isTrue( body.contains( originalEditableParent ), 'editable\'s parent was not removed from the body element' );
assert.areSame( originalEditableParent, originalEditable.getParent(), 'editable\'s parent did not change' );

// It is not necessarily the most expected result (I would expect both lists to be outdented),
// but this is how the algorithm works in an iframed editor at the moment.
assert.areSame( '<p>1</p><ol><li>2</li></ol>', editor.getData(), 'the first of the selected lists was outdented' );
},

'test outdent does not unwrap parent li with a single list': function() {
var bot = this.editorBot,
editor = bot.editor;

editor.focus();
bender.tools.selection.setWithHtml( editor, '<ul><li>[1]</li></ul>' );

var originalEditable = editor.editable(),
originalEditableParent = originalEditable.getParent();

bot.execCommand( 'outdent' );

var body = CKEDITOR.document.getBody();
assert.isTrue( body.contains( originalEditableParent ), 'editable\'s parent was not removed from the body element' );
assert.areSame( originalEditableParent, originalEditable.getParent(), 'editable\'s parent did not change' );

assert.areSame( '<p>1</p>', editor.getData(), 'the first of the selected lists was outdented' );
}
} );
6 changes: 0 additions & 6 deletions tests/plugins/mathjax/_assets/truncated-mathjax/.gitignore

This file was deleted.

202 changes: 0 additions & 202 deletions tests/plugins/mathjax/_assets/truncated-mathjax/LICENSE

This file was deleted.

0 comments on commit 439339b

Please sign in to comment.