Skip to content

Commit fd15d20

Browse files
committed
Merge branch 't/12000'
2 parents 026c14e + cb19c7a commit fd15d20

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CKEditor 4 Changelog
66
Fixed Issues:
77

88
* [#11983](http://dev.ckeditor.com/ticket/11983): Fixed: Clicking a nested widget does not focus it. Additionally, performance of the [`widget.repository.getByElement()`](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.widget.repository-method-getByElement) method has been improved.
9+
* [#12000](http://dev.ckeditor.com/ticket/12000): Fixed: Nested widgets should be initialized on [`editor.setData()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setData) and [`nestedEditable.setData()`](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.widget.nestedEditable-method-setData).
910
* [#11960](http://dev.ckeditor.com/ticket/11960): [Blink/Webkit] Fixed: The caret should be scrolled into view on *Backspace* and *Delete* (covers only the merging blocks case).
1011
* [#11306](http://dev.ckeditor.com/ticket/11306): [OSX][Blink/Webkit] Fixed: No widget's entries in context menu on widget right-click.
1112
* [#11957](http://dev.ckeditor.com/ticket/11957): Fixed: Alignment labels in the [Enhanced Image](http://ckeditor.com/addon/image2) dialog are not translated.

plugins/widget/dev/assets/sample.jpg

17.5 KB
Loading

plugins/widget/dev/nestedwidgets.html

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
<title>Nested widgets &mdash; CKEditor Sample</title>
1010
<script src="../../../ckeditor.js"></script>
1111
<script src="../../../samples/sample.js"></script>
12+
<script src="../../../dev/console/console.js"></script>
13+
<script src="../../../dev/console/focusconsole.js"></script>
14+
<script src="console.js"></script>
1215
<link rel="stylesheet" href="../../../samples/sample.css">
1316
<link rel="stylesheet" href="../../../contents.css">
1417
<link rel="stylesheet" href="assets/simplebox/contents.css">
@@ -26,7 +29,7 @@ <h2 class="simplebox-title">Title</h2>
2629
<p><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong" title="Neil Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin" title="Buzz Aldrin">Buzz Aldrin</a>, on the Moon on [[July 20, 1969, at 20:18 UTC]]. Armstrong became the first to step onto the lunar surface 6 hours later on [[July 21 at 02:56 UTC]].</p>
2730

2831
<figure class="image" style="float: right">
29-
<img alt="The Eagle" src="../../../samples/assets/sample.jpg" width="150" />
32+
<img alt="The Eagle" src="assets/sample.jpg" width="150" />
3033
<figcaption>The Eagle in lunar orbit</figcaption>
3134
</figure>
3235

@@ -35,7 +38,7 @@ <h2 class="simplebox-title">Title</h2>
3538
<li>Bar!</li>
3639
</ul>
3740

38-
<p>Lorem ipsum dolor [[sit amet]], consectetur adipiscing elit. Curabitur sit amet orci ut nisi adipiscing ultrices. Sed pellentesque iaculis malesuada. Pellentesque scelerisque, purus non porta dictum, neque urna bibendum dolor, eget tristique ipsum metus fringilla dolor. Nullam sed accumsan sapien. Vestibulum in placerat magna. Sed justo lacus, volutpat rhoncus odio luctus, ornare adipiscing mauris. Vivamus erat sem, egestas et lectus eget, varius cursus odio. Duis posuere lacus sit amet urna bibendum, id iaculis eros ultrices. Vestibulum a ultrices ante.</p>
41+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet orci ut nisi adipiscing ultrices. Sed pellentesque iaculis malesuada. Pellentesque scelerisque, purus non porta dictum, neque urna bibendum dolor, eget tristique ipsum metus fringilla dolor. Nullam sed accumsan sapien. Vestibulum in placerat magna. Sed justo lacus, volutpat rhoncus odio luctus, ornare adipiscing mauris. Vivamus erat sem, egestas et lectus eget, varius cursus odio. Duis posuere lacus sit amet urna bibendum, id iaculis eros ultrices. Vestibulum a ultrices ante.</p>
3942
</div>
4043
</div>
4144

@@ -48,7 +51,7 @@ <h2 class="simplebox-title">Title</h2>
4851
<div class="simplebox align-center" style="width: 750px">
4952
<h2 class="simplebox-title">Title</h2>
5053
<div class="simplebox-content">
51-
<p><img alt="The Eagle" src="../../../samples/assets/sample.jpg" width="150" style="float: left" /><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong" title="Neil Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin" title="Buzz Aldrin">Buzz Aldrin</a>, on the Moon on [[July 20, 1969, at 20:18 UTC]]. Armstrong became the first to step onto the lunar surface 6 hours later on [[July 21 at 02:56 UTC]].</p>
54+
<p><img alt="The Eagle" src="assets/sample.jpg" width="150" style="float: left" /><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong" title="Neil Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin" title="Buzz Aldrin">Buzz Aldrin</a>, on the Moon on [[July 20, 1969, at 20:18 UTC]]. Armstrong became the first to step onto the lunar surface 6 hours later on [[July 21 at 02:56 UTC]].</p>
5255

5356
<ul>
5457
<li>Foo!</li>
@@ -70,7 +73,7 @@ <h2 class="simplebox-title">Title</h2>
7073
<p><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong" title="Neil Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin" title="Buzz Aldrin">Buzz Aldrin</a>, on the Moon on [[July 20, 1969, at 20:18 UTC]]. Armstrong became the first to step onto the lunar surface 6 hours later on [[July 21 at 02:56 UTC]].</p>
7174

7275
<figure class="image" style="float: right">
73-
<img alt="The Eagle" src="../../../samples/assets/sample.jpg" width="150" />
76+
<img alt="The Eagle" src="assets/sample.jpg" width="150" />
7477
<figcaption>The Eagle in lunar orbit</figcaption>
7578
</figure>
7679

@@ -79,7 +82,7 @@ <h2 class="simplebox-title">Title</h2>
7982
<li>Bar!</li>
8083
</ul>
8184

82-
<p>Lorem ipsum dolor [[sit amet]], consectetur adipiscing elit. Curabitur sit amet orci ut nisi adipiscing ultrices. Sed pellentesque iaculis malesuada. Pellentesque scelerisque, purus non porta dictum, neque urna bibendum dolor, eget tristique ipsum metus fringilla dolor. Nullam sed accumsan sapien. Vestibulum in placerat magna. Sed justo lacus, volutpat rhoncus odio luctus, ornare adipiscing mauris. Vivamus erat sem, egestas et lectus eget, varius cursus odio. Duis posuere lacus sit amet urna bibendum, id iaculis eros ultrices. Vestibulum a ultrices ante.</p>
85+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet orci ut nisi adipiscing ultrices. Sed pellentesque iaculis malesuada. Pellentesque scelerisque, purus non porta dictum, neque urna bibendum dolor, eget tristique ipsum metus fringilla dolor. Nullam sed accumsan sapien. Vestibulum in placerat magna. Sed justo lacus, volutpat rhoncus odio luctus, ornare adipiscing mauris. Vivamus erat sem, egestas et lectus eget, varius cursus odio. Duis posuere lacus sit amet urna bibendum, id iaculis eros ultrices. Vestibulum a ultrices ante.</p>
8386
</div>
8487
</div>
8588

@@ -92,7 +95,7 @@ <h2 class="simplebox-title">Title</h2>
9295
<div class="simplebox align-center" style="width: 750px">
9396
<h2 class="simplebox-title">Title</h2>
9497
<div class="simplebox-content">
95-
<p><img alt="The Eagle" src="../../../samples/assets/sample.jpg" width="150" style="float: left" /><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong" title="Neil Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin" title="Buzz Aldrin">Buzz Aldrin</a>, on the Moon on [[July 20, 1969, at 20:18 UTC]]. Armstrong became the first to step onto the lunar surface 6 hours later on [[July 21 at 02:56 UTC]].</p>
98+
<p><img alt="The Eagle" src="assets/sample.jpg" width="150" style="float: left" /><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong" title="Neil Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin" title="Buzz Aldrin">Buzz Aldrin</a>, on the Moon on [[July 20, 1969, at 20:18 UTC]]. Armstrong became the first to step onto the lunar surface 6 hours later on [[July 21 at 02:56 UTC]].</p>
9699

97100
<ul>
98101
<li>Foo!</li>
@@ -108,19 +111,6 @@ <h2 class="simplebox-title">Title</h2>
108111
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 )
109112
CKEDITOR.tools.enableHtml5Elements( document );
110113

111-
CKEDITOR.on( 'instanceCreated', function( evt ) {
112-
var editor = evt.editor;
113-
editor.on( 'pluginsLoaded', function() {
114-
editor.widgets.on( 'instanceCreated', function( evt ) {
115-
if ( evt.data.name == 'simplebox' ) {
116-
evt.data.on( 'ready', function() {
117-
editor.widgets.initOnAll( evt.data.editables.content );
118-
} );
119-
}
120-
} );
121-
} );
122-
} );
123-
124114
CKEDITOR.plugins.addExternal( 'simplebox', 'plugins/widget/dev/assets/simplebox/' );
125115

126116
CKEDITOR.replace( 'editor1', {
@@ -135,6 +125,11 @@ <h2 class="simplebox-title">Title</h2>
135125
removePlugins: 'forms,bidi'
136126
} );
137127

128+
CKCONSOLE.create( 'widget', { editor: 'editor1' } );
129+
CKCONSOLE.create( 'focus', { editor: 'editor1' } );
130+
CKCONSOLE.create( 'widget', { editor: 'editor2', folded: true } );
131+
CKCONSOLE.create( 'focus', { editor: 'editor2', folded: true } );
132+
138133
</script>
139134
</body>
140135
</html>

plugins/widget/plugin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@
496496
* @param {CKEDITOR.dom.element} [container=editor.editable()] The container which will be checked for not
497497
* initialized widgets. Defaults to editor's {@link CKEDITOR.editor#editable editable} element.
498498
* @returns {CKEDITOR.plugins.widget[]} Array of widget instances which have been initialized.
499+
* Note: only first level widgets are returned &ndash; without nested widgets.
499500
*/
500501
initOnAll: function( container ) {
501502
var newWidgets = ( container || this.editor.editable() ).find( '.cke_widget_new' ),
@@ -1511,6 +1512,8 @@
15111512
enterMode: this.enterMode
15121513
} );
15131514
this.setHtml( data );
1515+
1516+
this.editor.widgets.initOnAll( this );
15141517
},
15151518

15161519
/**

0 commit comments

Comments
 (0)