From 77d17e12b9c6e7015b706aedc95de5f128f8370c Mon Sep 17 00:00:00 2001 From: fredck Date: Thu, 7 Feb 2013 19:22:51 +0100 Subject: [PATCH 01/10] Introduced the new "source" plugin, which makes source editing available in a dialog. --- plugins/dialogui/plugin.js | 4 ++- plugins/source/dialogs/source.js | 42 ++++++++++++++++++++++++++++ plugins/source/icons/source-rtl.png | Bin 0 -> 760 bytes plugins/source/icons/source.png | Bin 0 -> 768 bytes plugins/source/lang/en.js | 9 ++++++ plugins/source/plugin.js | 26 +++++++++++++++++ 6 files changed, 80 insertions(+), 1 deletion(-) create mode 100755 plugins/source/dialogs/source.js create mode 100644 plugins/source/icons/source-rtl.png create mode 100644 plugins/source/icons/source.png create mode 100644 plugins/source/lang/en.js create mode 100644 plugins/source/plugin.js diff --git a/plugins/dialogui/plugin.js b/plugins/dialogui/plugin.js index bb66d9d3355..3eb78b1c536 100644 --- a/plugins/dialogui/plugin.js +++ b/plugins/dialogui/plugin.js @@ -279,13 +279,15 @@ CKEDITOR.plugins.add( 'dialogui', { attributes.rows = elementDefinition.rows || 5; attributes.cols = elementDefinition.cols || 20; + attributes[ 'class' ] = 'cke_dialog_ui_input_textarea ' + ( elementDefinition[ 'class' ] || '' ); + if ( typeof elementDefinition.inputStyle != 'undefined' ) attributes.style = elementDefinition.inputStyle; var innerHTML = function() { attributes[ 'aria-labelledby' ] = this._.labelId; this._.required && ( attributes[ 'aria-required' ] = this._.required ); - var html = [ '' ); diff --git a/plugins/source/dialogs/source.js b/plugins/source/dialogs/source.js new file mode 100755 index 00000000000..09c8beb85b1 --- /dev/null +++ b/plugins/source/dialogs/source.js @@ -0,0 +1,42 @@ +/** + * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.html or http://ckeditor.com/license + */ + +CKEDITOR.dialog.add( 'source', function( editor ) { + var size = CKEDITOR.document.getWindow().getViewPaneSize(); + + // Make it maximum 800px wide, but still fully visible in the viewport. + var width = Math.min( size.width - 70, 800); + + // Make it use 2/3 of the viewport height. + var height = size.height / 1.5; + + return { + title: editor.lang.source.title, + minWidth: 100, + minHeight: 100, + + onShow: function() { + this.setValueOf( 'main', 'data', editor.getData() ); + }, + + onOk: function() { + editor.setData( this.getValueOf( 'main', 'data' ) ); + }, + + contents: [{ + id: 'main', + label: editor.lang.source.title, + elements: [{ + type: 'textarea', + type: 'textarea', + id: 'data', + inputStyle: 'cursor:auto;' + + 'width:' + width + 'px;' + + 'height:' + height + 'px', + 'class': 'cke_source' + }] + }] + }; +}); diff --git a/plugins/source/icons/source-rtl.png b/plugins/source/icons/source-rtl.png new file mode 100644 index 0000000000000000000000000000000000000000..2efa25dd5849af6b56191cdbe34882cc1a4132a1 GIT binary patch literal 760 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_D|ilc1-IV~EA+-bn|ugabv|_7}f5kevO}=duWs?@8g3PYFZ?M~9!DsPBGRH%-MAvMM6+9U(d;j}qjV^;@ zKCEIV14R^-?w&n+wr|y}(Dd^1>k`S!Y#5Sx5+%-^oa(i-xU#a6*~ZS=`t@ophJEih zZ{2#dz#`eZ{f7wqiq-;2vKSv(I2-J~=7_rp#OrKYW7 z3uZ5SslR~tOLaVmS||??K$)8w^t7yJUDsl)~)`B1wU97d@uVK z%KX1``*t;-jcot%?@Qv=yH8TFc)sFl)~Zz!$$j6xe^)=S{U+Cbv)N}m4WIR{3R->j ziX~9Vcc#c`f-H@zw2UuxYjnA-@)B{aZi91@qf4^D#X}^_!XyLiS>gw)dKEacf3|&?03;zH5wJX4kUr?jwH~0Qb zu2(0St?Pj)MzzE>q9i4;B-JXpC>2OC7#SEE=^7g98kmO|8d@0}Ss58>8yH#{7|b#? za7WRQo1c=IR*74~>x_=yKn;>08-nxGO3D+9QW?t2%k?tzvWt@w3sUv+i_&MmvylQS OV(@hJb6Mw<&;$Vf3_#le literal 0 HcmV?d00001 diff --git a/plugins/source/icons/source.png b/plugins/source/icons/source.png new file mode 100644 index 0000000000000000000000000000000000000000..ffd830df39cf00db69916e39fe0396abfe559791 GIT binary patch literal 768 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_D|ilccAMV~EA+-pRZDq#Z@t_8V_rbKUHXR7?aD=O=~`jtLX)EcaaE z;W<@_b>&2jOVK4Kja^PMKUox#dFc@M65qtNEiZS>F!h{ZYpl*1*WAqQW+ip@%uN6P zKcDwJsq|YLw)kR(fw}qdHG)nLK7E?BdbReP;uWu+oRLWOxID$8Z*RvLp6uN8!orC< zr#lvL2<~L<;5a66?fUiJRp)w^E?rtH_;N{R6~E9_A@*j*!w&=e{QV{Q+8H`Hva_@M z&z(EhcT6DU>w#+jK#_{~hD)bx+9q)5iP3?N9}D@moIiiQK0R`qzS7**R@OCJw{v+p zh`5HV4qdbLNMVm*o7YmN3CwTn_SdT@$!5Q8>`+iL=jt)+;J6kw>#SO@TXWUke`cOS zJ%;a}xcTvInLd5`(dzp9N2>P5d2LtvwC`rlKE{a1$eZkTYu2rEbBJ3RvMiqQK-B3! ze{7V3Iv@YI40PMN?{)kOG`jAV?f(1f$&)9mJ3`)Hvu9*j`q|&y%xqq2q9}+qZ9bKd`;l<4 z2~JFUb1*s7cFt7urw8xy8^!&XIN$#Nt^ZS3MV58z*K;Z=D9vNzr`XA3_1`O;7im~vE0Tq8hkp{{{>h@qjCv5}RL zp|*jcm4U%5Qv-Jt4Y~O#nQ4`{HN4K~_zlz`39=zLKdq!Zu_%?Hyu4g5GcUV1Ik6yB XFTW^#_B$IXpdtoOS3j3^P6 Date: Thu, 14 Feb 2013 14:14:27 +0100 Subject: [PATCH 02/10] Fixed selection issues in gecko, webkit and IE on dialog close. --- plugins/source/dialogs/source.js | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/plugins/source/dialogs/source.js b/plugins/source/dialogs/source.js index 09c8beb85b1..6548a90f430 100755 --- a/plugins/source/dialogs/source.js +++ b/plugins/source/dialogs/source.js @@ -12,17 +12,44 @@ CKEDITOR.dialog.add( 'source', function( editor ) { // Make it use 2/3 of the viewport height. var height = size.height / 1.5; + // Store old editor data to avoid unnecessary setData. + var oldData; + return { title: editor.lang.source.title, minWidth: 100, minHeight: 100, onShow: function() { - this.setValueOf( 'main', 'data', editor.getData() ); + this.setValueOf( 'main', 'data', oldData = editor.getData() ); }, onOk: function() { - editor.setData( this.getValueOf( 'main', 'data' ) ); + var that = this, + newData = this.getValueOf( 'main', 'data' ); + + // Avoid unnecessary setData. Also preserve selection + // when user changed his mind and goes back to wysiwyg editing. + if ( newData === oldData ) + return; + + editor.setData( this.getValueOf( 'main', 'data' ), function() { + // Avoid selection error in webkit & gecko. + if ( CKEDITOR.env.webkit || CKEDITOR.env.gecko ) { + var range = editor.createRange(); + range.moveToElementEditStart( editor.editable() ); + range.select(); + } + + // Fix wrong caret position in IEs. + CKEDITOR.env.ie && editor.editable().focus(); + + // Close the dialog once getData is done and selection is fixed. + that.hide(); + } ); + + // Don't let the dialog close before setData is over. + return false; }, contents: [{ From e9d3bbd30717094c8df6fc571fbb74b7af328c18 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Thu, 14 Feb 2013 15:33:11 +0100 Subject: [PATCH 03/10] Added sample for source plugin. --- plugins/source/samples/source.html | 113 +++++++++++++++++++++++++++++ samples/index.html | 3 + 2 files changed, 116 insertions(+) create mode 100644 plugins/source/samples/source.html diff --git a/plugins/source/samples/source.html b/plugins/source/samples/source.html new file mode 100644 index 00000000000..58a5e76ca67 --- /dev/null +++ b/plugins/source/samples/source.html @@ -0,0 +1,113 @@ + + + + + Raw HTML editing with dialog-based source editor — CKEditor Sample + + + + + + + + + + +

+ CKEditor Samples » Raw HTML editing with dialog-based source editor +

+
+

+ Source plugin provides an easy way to edit raw HTML content + of an editor, similarly to what is possible with Sourcearea + plugin for framed instances but using dialogs. Thanks to that, it's also possible + to manipulate raw content of inline editor instances. +

+

+ This plugin extends the toolbar with a button, + which opens a dialog window with a source code editor. To enable this + plugin, basically add extraPlugins: 'source' to editor's + config: +

+
+// Inline editor.
+CKEDITOR.inline( 'editable', {
+	extraPlugins: 'source',
+	removePlugins: 'sourcearea'
+});
+
+// Framed editor.
+CKEDITOR.replace( 'textarea_id', {
+	extraPlugins: 'source',
+	removePlugins: 'sourcearea'
+});
+
+

+ Note that editable in the code above is the id + attribute of the <div> element to be converted into an inline instance. +

+

+ Note that textarea_id in the code above is the id attribute of + the <textarea> element to be replaced with CKEditor. +

+
+
+ +
+

This is some sample text. You are using CKEditor.

+
+
+
+
+ + +
+ + + + diff --git a/samples/index.html b/samples/index.html index 1928ed5cab0..5084921f425 100644 --- a/samples/index.html +++ b/samples/index.html @@ -139,6 +139,9 @@

Output for Flash
Configuring CKEditor to produce HTML code that can be used with Adobe Flash.
+ +
Raw HTML editing with dialog-based source editor New!
+
Editing HTML content of both inline and framed editor instances.
From 46202fad8145c1edbfe3ecc25b7dbdb9d57a8b8d Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Thu, 14 Feb 2013 15:37:20 +0100 Subject: [PATCH 04/10] Fixed jslint issue. --- plugins/source/dialogs/source.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/source/dialogs/source.js b/plugins/source/dialogs/source.js index 6548a90f430..aea4e0091ae 100755 --- a/plugins/source/dialogs/source.js +++ b/plugins/source/dialogs/source.js @@ -31,7 +31,7 @@ CKEDITOR.dialog.add( 'source', function( editor ) { // Avoid unnecessary setData. Also preserve selection // when user changed his mind and goes back to wysiwyg editing. if ( newData === oldData ) - return; + return true; editor.setData( this.getValueOf( 'main', 'data' ), function() { // Avoid selection error in webkit & gecko. From 1f037d362a113a09b332258ceaf9c51376f11866 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Fri, 15 Feb 2013 11:49:40 +0100 Subject: [PATCH 05/10] Fixed permission denied when closing source dialog in IEs. --- core/dom/node.js | 6 +++++- core/selection.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/dom/node.js b/core/dom/node.js index c08bcd3eb85..f991518aa18 100644 --- a/core/dom/node.js +++ b/core/dom/node.js @@ -560,7 +560,11 @@ CKEDITOR.tools.extend( CKEDITOR.dom.node.prototype, { if ( $.nodeName && ( name = $.nodeName.toLowerCase(), ( typeof reference == 'string' ? name == reference : name in reference ) ) ) return new CKEDITOR.dom.node( $ ); - $ = $.parentNode; + try { + $ = $.parentNode; + } catch( e ) { + $ = null; + } } return null; }, diff --git a/core/selection.js b/core/selection.js index fd501bbff4e..3827fb208f9 100644 --- a/core/selection.js +++ b/core/selection.js @@ -1288,7 +1288,7 @@ if ( restore ) { // Saved selection may be outdated (e.g. anchored in offline nodes). // Avoid getting broken by such. - var common = selectedElement || ranges[ 0 ].getCommonAncestor(); + var common = selectedElement || ranges[ 0 ] && ranges[ 0 ].getCommonAncestor(); if ( !( common && common.getAscendant( 'body', 1 ) ) ) return; From ab3126c04784c12563dc315a38ec22783fc391eb Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Fri, 15 Feb 2013 11:50:01 +0100 Subject: [PATCH 06/10] Ensured asynchronous setData on souce dialog close in IE. --- plugins/source/dialogs/source.js | 43 ++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/plugins/source/dialogs/source.js b/plugins/source/dialogs/source.js index aea4e0091ae..e2f83f3f12c 100755 --- a/plugins/source/dialogs/source.js +++ b/plugins/source/dialogs/source.js @@ -24,33 +24,38 @@ CKEDITOR.dialog.add( 'source', function( editor ) { this.setValueOf( 'main', 'data', oldData = editor.getData() ); }, - onOk: function() { - var that = this, - newData = this.getValueOf( 'main', 'data' ); + onOk: (function() { + function setData( newData ) { + var that = this; - // Avoid unnecessary setData. Also preserve selection - // when user changed his mind and goes back to wysiwyg editing. - if ( newData === oldData ) - return true; + editor.setData( newData, function() { + that.hide(); - editor.setData( this.getValueOf( 'main', 'data' ), function() { - // Avoid selection error in webkit & gecko. - if ( CKEDITOR.env.webkit || CKEDITOR.env.gecko ) { + // Ensure correct selection. var range = editor.createRange(); range.moveToElementEditStart( editor.editable() ); range.select(); - } + } ); + } - // Fix wrong caret position in IEs. - CKEDITOR.env.ie && editor.editable().focus(); + return function( event ) { + var newData = this.getValueOf( 'main', 'data' ); - // Close the dialog once getData is done and selection is fixed. - that.hide(); - } ); + // Avoid unnecessary setData. Also preserve selection + // when user changed his mind and goes back to wysiwyg editing. + if ( newData === oldData ) + return true; - // Don't let the dialog close before setData is over. - return false; - }, + // Set data asynchronously to avoid errors in IE. + CKEDITOR.env.ie ? + CKEDITOR.tools.setTimeout( setData, 0, this, newData ) + : + setData.call( this, newData ); + + // Don't let the dialog close before setData is over. + return false; + }; + })(), contents: [{ id: 'main', From a5ded6cd26188fc2a8cfd8f1e4239d9033f1262c Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Fri, 15 Feb 2013 12:11:32 +0100 Subject: [PATCH 07/10] Set tab-size for source plugin to 4. --- plugins/source/dialogs/source.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/source/dialogs/source.js b/plugins/source/dialogs/source.js index e2f83f3f12c..864a0a39764 100755 --- a/plugins/source/dialogs/source.js +++ b/plugins/source/dialogs/source.js @@ -66,7 +66,8 @@ CKEDITOR.dialog.add( 'source', function( editor ) { id: 'data', inputStyle: 'cursor:auto;' + 'width:' + width + 'px;' + - 'height:' + height + 'px', + 'height:' + height + 'px;' + + 'tab-size:4;', 'class': 'cke_source' }] }] From 30dbc887ed8c96723d9cbdb283e4e61954c4fc79 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Tue, 19 Feb 2013 13:29:53 +0100 Subject: [PATCH 08/10] Renamed source plugin -> sourcedialog. --- .../dialogs/sourcedialog.js} | 9 +++++---- .../icons/sourcedialog-rtl.png} | Bin .../icons/sourcedialog.png} | Bin plugins/{source => sourcedialog}/lang/en.js | 2 +- plugins/{source => sourcedialog}/plugin.js | 14 +++++++------- .../samples/sourcedialog.html} | 10 +++++----- samples/index.html | 2 +- skins/kama/presets.css | 3 ++- skins/moono/presets.css | 3 ++- 9 files changed, 23 insertions(+), 20 deletions(-) rename plugins/{source/dialogs/source.js => sourcedialog/dialogs/sourcedialog.js} (85%) rename plugins/{source/icons/source-rtl.png => sourcedialog/icons/sourcedialog-rtl.png} (100%) rename plugins/{source/icons/source.png => sourcedialog/icons/sourcedialog.png} (100%) rename plugins/{source => sourcedialog}/lang/en.js (79%) rename plugins/{source => sourcedialog}/plugin.js (55%) rename plugins/{source/samples/source.html => sourcedialog/samples/sourcedialog.html} (91%) diff --git a/plugins/source/dialogs/source.js b/plugins/sourcedialog/dialogs/sourcedialog.js similarity index 85% rename from plugins/source/dialogs/source.js rename to plugins/sourcedialog/dialogs/sourcedialog.js index 864a0a39764..e3b566b5e24 100755 --- a/plugins/source/dialogs/source.js +++ b/plugins/sourcedialog/dialogs/sourcedialog.js @@ -3,7 +3,7 @@ * For licensing, see LICENSE.html or http://ckeditor.com/license */ -CKEDITOR.dialog.add( 'source', function( editor ) { +CKEDITOR.dialog.add( 'sourcedialog', function( editor ) { var size = CKEDITOR.document.getWindow().getViewPaneSize(); // Make it maximum 800px wide, but still fully visible in the viewport. @@ -16,7 +16,7 @@ CKEDITOR.dialog.add( 'source', function( editor ) { var oldData; return { - title: editor.lang.source.title, + title: editor.lang.sourcedialog.title, minWidth: 100, minHeight: 100, @@ -39,7 +39,8 @@ CKEDITOR.dialog.add( 'source', function( editor ) { } return function( event ) { - var newData = this.getValueOf( 'main', 'data' ); + // Remove CR from input data for reliable comparison with editor data. + var newData = this.getValueOf( 'main', 'data' ).replace( /\r/g, '' ); // Avoid unnecessary setData. Also preserve selection // when user changed his mind and goes back to wysiwyg editing. @@ -59,7 +60,7 @@ CKEDITOR.dialog.add( 'source', function( editor ) { contents: [{ id: 'main', - label: editor.lang.source.title, + label: editor.lang.sourcedialog.title, elements: [{ type: 'textarea', type: 'textarea', diff --git a/plugins/source/icons/source-rtl.png b/plugins/sourcedialog/icons/sourcedialog-rtl.png similarity index 100% rename from plugins/source/icons/source-rtl.png rename to plugins/sourcedialog/icons/sourcedialog-rtl.png diff --git a/plugins/source/icons/source.png b/plugins/sourcedialog/icons/sourcedialog.png similarity index 100% rename from plugins/source/icons/source.png rename to plugins/sourcedialog/icons/sourcedialog.png diff --git a/plugins/source/lang/en.js b/plugins/sourcedialog/lang/en.js similarity index 79% rename from plugins/source/lang/en.js rename to plugins/sourcedialog/lang/en.js index 72370d97404..d41d8f70223 100644 --- a/plugins/source/lang/en.js +++ b/plugins/sourcedialog/lang/en.js @@ -3,7 +3,7 @@ Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ -CKEDITOR.plugins.setLang( 'source', 'en', { +CKEDITOR.plugins.setLang( 'sourcedialog', 'en', { toolbar: 'Source', title: 'Source' }); diff --git a/plugins/source/plugin.js b/plugins/sourcedialog/plugin.js similarity index 55% rename from plugins/source/plugin.js rename to plugins/sourcedialog/plugin.js index b5e343466ed..38ebe1ec3d8 100644 --- a/plugins/source/plugin.js +++ b/plugins/sourcedialog/plugin.js @@ -3,22 +3,22 @@ * For licensing, see LICENSE.html or http://ckeditor.com/license */ -CKEDITOR.plugins.add( 'source', { +CKEDITOR.plugins.add( 'sourcedialog', { lang: 'en', // %REMOVE_LINE_CORE% - icons: 'source,source-rtl', // %REMOVE_LINE_CORE% + icons: 'sourcedialog,sourcedialog-rtl', // %REMOVE_LINE_CORE% init: function( editor ) { // Register the "source" command, which simply opens the "source" dialog. - editor.addCommand( 'source', new CKEDITOR.dialogCommand( 'source' ) ); + editor.addCommand( 'sourcedialog', new CKEDITOR.dialogCommand( 'sourcedialog' ) ); // Register the "source" dialog. - CKEDITOR.dialog.add( 'source', this.path + 'dialogs/source.js' ); + CKEDITOR.dialog.add( 'sourcedialog', this.path + 'dialogs/sourcedialog.js' ); // If the toolbar is available, create the "Source" button. if ( editor.ui.addButton ) { - editor.ui.addButton( 'Source', { - label: editor.lang.source.toolbar, - command: 'source', + editor.ui.addButton( 'Sourcedialog', { + label: editor.lang.sourcedialog.toolbar, + command: 'sourcedialog', toolbar: 'mode,10' }); } diff --git a/plugins/source/samples/source.html b/plugins/sourcedialog/samples/sourcedialog.html similarity index 91% rename from plugins/source/samples/source.html rename to plugins/sourcedialog/samples/sourcedialog.html index 58a5e76ca67..69207be9338 100644 --- a/plugins/source/samples/source.html +++ b/plugins/sourcedialog/samples/sourcedialog.html @@ -29,7 +29,7 @@

- Source plugin provides an easy way to edit raw HTML content + Sourcedialog plugin provides an easy way to edit raw HTML content of an editor, similarly to what is possible with Sourcearea plugin for framed instances but using dialogs. Thanks to that, it's also possible to manipulate raw content of inline editor instances. @@ -37,19 +37,19 @@

This plugin extends the toolbar with a button, which opens a dialog window with a source code editor. To enable this - plugin, basically add extraPlugins: 'source' to editor's + plugin, basically add extraPlugins: 'sourcedialog' to editor's config:

 // Inline editor.
 CKEDITOR.inline( 'editable', {
-	extraPlugins: 'source',
+	extraPlugins: 'sourcedialog',
 	removePlugins: 'sourcearea'
 });
 
 // Framed editor.
 CKEDITOR.replace( 'textarea_id', {
-	extraPlugins: 'source',
+	extraPlugins: 'sourcedialog',
 	removePlugins: 'sourcearea'
 });
 
@@ -90,7 +90,7 @@

{ name: 'basicstyles' }, { name: 'links' } ], - extraPlugins: 'source', + extraPlugins: 'sourcedialog', removePlugins: 'sourcearea' } diff --git a/samples/index.html b/samples/index.html index 5084921f425..2d81a09b3f4 100644 --- a/samples/index.html +++ b/samples/index.html @@ -140,7 +140,7 @@

Output for Flash
Configuring CKEditor to produce HTML code that can be used with Adobe Flash.
-
Raw HTML editing with dialog-based source editor New!
+
Raw HTML editing with dialog-based source editor New!
Editing HTML content of both inline and framed editor instances.
diff --git a/skins/kama/presets.css b/skins/kama/presets.css index 2d99dfd4458..7889cf90d4e 100644 --- a/skins/kama/presets.css +++ b/skins/kama/presets.css @@ -4,7 +4,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ /* "Source" button label */ -.cke_button__source_label +.cke_button__source_label, +.cke_button__sourcedialog_label { display: inline; } diff --git a/skins/moono/presets.css b/skins/moono/presets.css index 2d99dfd4458..7889cf90d4e 100644 --- a/skins/moono/presets.css +++ b/skins/moono/presets.css @@ -4,7 +4,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ /* "Source" button label */ -.cke_button__source_label +.cke_button__source_label, +.cke_button__sourcedialog_label { display: inline; } From a96b267d27462919fdc06ce43fc99145fffcf6c2 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Tue, 19 Feb 2013 13:35:49 +0100 Subject: [PATCH 09/10] Improved sourcedialog sample. --- plugins/sourcedialog/samples/sourcedialog.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/sourcedialog/samples/sourcedialog.html b/plugins/sourcedialog/samples/sourcedialog.html index 69207be9338..aa2a1172d69 100644 --- a/plugins/sourcedialog/samples/sourcedialog.html +++ b/plugins/sourcedialog/samples/sourcedialog.html @@ -36,15 +36,15 @@

This plugin extends the toolbar with a button, - which opens a dialog window with a source code editor. To enable this + which opens a dialog window with a source code editor. It works with both framed + and inline instances. To enable this plugin, basically add extraPlugins: 'sourcedialog' to editor's config:

 // Inline editor.
 CKEDITOR.inline( 'editable', {
-	extraPlugins: 'sourcedialog',
-	removePlugins: 'sourcearea'
+	extraPlugins: 'sourcedialog'
 });
 
 // Framed editor.
@@ -53,6 +53,11 @@ 

removePlugins: 'sourcearea' });

+

+ Note that you may want to include removePlugins: 'sourcearea' + in your config when using Sourcedialog in framed instances. + This prevents feature redundancy. +

Note that editable in the code above is the id attribute of the <div> element to be converted into an inline instance. From 30b5e41074309080c138395a281ffb8ea12e2511 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Tue, 19 Feb 2013 14:04:42 +0100 Subject: [PATCH 10/10] Changelog entry. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 8a15e0b7b30..9816814f9a6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ CKEditor 4 Changelog ## CKEditor 4.1 * [#9907](http://dev.ckeditor.com/ticket/9907): Added contentPreview event for preview data manipulation. +* [#9713](http://dev.ckeditor.com/ticket/9713): Introduced `sourcedialog` plugin that brings raw HTML editing for inline editor instances. ## CKEditor 4.0.2