Index: admin/system_presets/simple/inp_ckconfig.js =================================================================== --- admin/system_presets/simple/inp_ckconfig.js +++ admin/system_presets/simple/inp_ckconfig.js @@ -24,7 +24,7 @@ CKEDITOR.config.entities = false; -CKEDITOR.config.extraPlugins = 'my_link,my_document,my_maximize,my_inline'; +CKEDITOR.config.extraPlugins = 'my_link,my_document,my_maximize,my_inline,sourcedialog'; //CKEDITOR.plugins.add('MySource'); //CKEDITOR.plugins.add('MyPreview'); @@ -58,7 +58,7 @@ ['Find', 'Replace', 'Scayt'], '/', ['Styles'], ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'], - ['NumberedList', 'BulletedList', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'] + ['NumberedList', 'BulletedList', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'Sourcedialog'] ]; /*CKEDITOR.config.toolbar_Simple = [ Index: core/admin_templates/js/inp_ckconfig.js =================================================================== --- core/admin_templates/js/inp_ckconfig.js +++ core/admin_templates/js/inp_ckconfig.js @@ -24,7 +24,7 @@ CKEDITOR.config.entities = false; -CKEDITOR.config.extraPlugins = 'my_link,my_document,my_maximize,my_inline'; +CKEDITOR.config.extraPlugins = 'my_link,my_document,my_maximize,my_inline,sourcedialog'; //CKEDITOR.plugins.add('MySource'); //CKEDITOR.plugins.add('MyPreview'); @@ -58,7 +58,7 @@ ['Find', 'Replace', 'Scayt'], '/', ['Styles'], ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'], - ['NumberedList', 'BulletedList', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'] + ['NumberedList', 'BulletedList', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'Sourcedialog'] ]; /*CKEDITOR.config.toolbar_Simple = [ Index: core/ckeditor/plugins/sourcedialog/dialogs/sourcedialog.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/dialogs/sourcedialog.js @@ -0,0 +1,79 @@ +/** + * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.dialog.add( 'sourcedialog', 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; + + // Store old editor data to avoid unnecessary setData. + var oldData; + + return { + title: editor.lang.sourcedialog.title, + minWidth: 100, + minHeight: 100, + + onShow: function() { + this.setValueOf( 'main', 'data', oldData = editor.getData() ); + }, + + onOk: ( function() { + function setData( dialog, newData ) { + // [IE8] Focus editor before setting selection to avoid setting data on + // locked selection, because in case of inline editor, it won't be + // unlocked before editable's HTML is altered. (#11585) + editor.focus(); + editor.setData( newData, function() { + dialog.hide(); + + // Ensure correct selection. + var range = editor.createRange(); + range.moveToElementEditStart( editor.editable() ); + range.select(); + } ); + } + + return function() { + // Remove CR from input data for reliable comparison with editor data. + var newData = this.getValueOf( 'main', 'data' ).replace( /\r/g, '' ), + that = this; + + // Avoid unnecessary setData. Also preserve selection + // when user changed his mind and goes back to wysiwyg editing. + if ( newData === oldData ) + return true; + + setTimeout( function() { + setData( that, newData ); + } ); + + // Don't let the dialog close before setData is over, to hide + // from user blinking caused by selection restoring and setting new data. + return false; + }; + } )(), + + contents: [ { + id: 'main', + label: editor.lang.sourcedialog.title, + elements: [ { + type: 'textarea', + id: 'data', + dir: 'ltr', + inputStyle: 'cursor:auto;' + + 'width:' + width + 'px;' + + 'height:' + height + 'px;' + + 'tab-size:4;' + + 'text-align:left;', + 'class': 'cke_source' + } ] + } ] + }; +} ); Index: core/ckeditor/plugins/sourcedialog/lang/af.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/af.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'af', { + toolbar: 'Bron', + title: 'Bron' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/ar.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/ar.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ar', { + toolbar: 'المصدر', + title: 'المصدر' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/bg.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/bg.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'bg', { + toolbar: 'Източник', + title: 'Източник' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/bn.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/bn.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'bn', { + toolbar: 'উৎস', + title: 'সোর্স' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/bs.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/bs.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'bs', { + toolbar: 'HTML kôd', + title: 'HTML kôd' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/ca.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/ca.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ca', { + toolbar: 'Codi font', + title: 'Codi font' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/cs.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/cs.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'cs', { + toolbar: 'Zdroj', + title: 'Zdroj' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/cy.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/cy.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'cy', { + toolbar: 'HTML', + title: 'HTML' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/da.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/da.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'da', { + toolbar: 'Kilde', + title: 'Kilde' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/de-ch.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/de-ch.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'de-ch', { + toolbar: 'Quellcode', + title: 'Quellcode' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/de.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/de.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'de', { + toolbar: 'Quellcode', + title: 'Quellcode' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/el.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/el.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'el', { + toolbar: 'Κώδικας', + title: 'Κώδικας' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/en-au.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/en-au.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'en-au', { + toolbar: 'Source', + title: 'Source' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/en-ca.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/en-ca.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'en-ca', { + toolbar: 'Source', + title: 'Source' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/en-gb.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/en-gb.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'en-gb', { + toolbar: 'Source', + title: 'Source' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/en.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/en.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'en', { + toolbar: 'Source', + title: 'Source' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/eo.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/eo.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'eo', { + toolbar: 'Fonto', + title: 'Fonto' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/es.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/es.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'es', { + toolbar: 'Fuente HTML', + title: 'Fuente HTML' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/et.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/et.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'et', { + toolbar: 'Lähtekood', + title: 'Lähtekood' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/eu.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/eu.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'eu', { + toolbar: 'Iturburua', + title: 'Iturburua' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/fa.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/fa.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'fa', { + toolbar: 'منبع', + title: 'منبع' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/fi.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/fi.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'fi', { + toolbar: 'Koodi', + title: 'Koodi' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/fo.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/fo.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'fo', { + toolbar: 'Kelda', + title: 'Kelda' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/fr-ca.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/fr-ca.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'fr-ca', { + toolbar: 'Source', + title: 'Source' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/fr.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/fr.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'fr', { + toolbar: 'Source', + title: 'Source' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/gl.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/gl.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'gl', { + toolbar: 'Orixe', + title: 'Orixe' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/gu.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/gu.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'gu', { + toolbar: 'મૂળ કે પ્રાથમિક દસ્તાવેજ', + title: 'મૂળ કે પ્રાથમિક દસ્તાવેજ' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/he.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/he.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'he', { + toolbar: 'מקור', + title: 'מקור' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/hi.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/hi.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'hi', { + toolbar: 'सोर्स', + title: 'सोर्स' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/hr.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/hr.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'hr', { + toolbar: 'Kôd', + title: 'Kôd' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/hu.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/hu.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'hu', { + toolbar: 'Forráskód', + title: 'Forráskód' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/id.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/id.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'id', { + toolbar: 'Sumber', + title: 'Sumber' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/is.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/is.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'is', { + toolbar: 'Kóði', + title: 'Kóði' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/it.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/it.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'it', { + toolbar: 'Sorgente', + title: 'Sorgente' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/ja.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/ja.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ja', { + toolbar: 'ソース', + title: 'ソース' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/ka.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/ka.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ka', { + toolbar: 'კოდები', + title: 'კოდები' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/km.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/km.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'km', { + toolbar: 'អក្សរ​កូដ', + title: 'អក្សរ​កូដ' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/ko.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/ko.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ko', { + toolbar: '소스', + title: '소스' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/ku.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/ku.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ku', { + toolbar: 'سەرچاوە', + title: 'سەرچاوە' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/lt.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/lt.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'lt', { + toolbar: 'Šaltinis', + title: 'Šaltinis' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/lv.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/lv.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'lv', { + toolbar: 'HTML kods', + title: 'HTML kods' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/mn.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/mn.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'mn', { + toolbar: 'Код', + title: 'Код' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/ms.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/ms.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ms', { + toolbar: 'Sumber', + title: 'Sumber' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/nb.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/nb.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'nb', { + toolbar: 'Kilde', + title: 'Kilde' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/nl.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/nl.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'nl', { + toolbar: 'Broncode', + title: 'Broncode' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/no.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/no.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'no', { + toolbar: 'Kilde', + title: 'Kilde' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/pl.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/pl.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'pl', { + toolbar: 'Źródło dokumentu', + title: 'Źródło dokumentu' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/pt-br.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/pt-br.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'pt-br', { + toolbar: 'Código-Fonte', + title: 'Código-Fonte' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/pt.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/pt.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'pt', { + toolbar: 'Fonte', + title: 'Fonte' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/ro.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/ro.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ro', { + toolbar: 'Sursa', + title: 'Sursa' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/ru.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/ru.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ru', { + toolbar: 'Исходник', + title: 'Источник' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/si.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/si.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'si', { + toolbar: 'මුලාශ්‍රය', + title: 'මුලාශ්‍රය' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/sk.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/sk.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'sk', { + toolbar: 'Zdroj', + title: 'Zdroj' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/sl.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/sl.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'sl', { + toolbar: 'Izvorna koda', + title: 'Izvorna koda' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/sq.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/sq.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'sq', { + toolbar: 'Burimi', + title: 'Burimi' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/sr-latn.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/sr-latn.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'sr-latn', { + toolbar: 'Kôd', + title: 'Kôd' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/sr.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/sr.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'sr', { + toolbar: 'Kôд', + title: 'Kôд' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/sv.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/sv.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'sv', { + toolbar: 'Källa', + title: 'Källa' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/th.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/th.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'th', { + toolbar: 'ดูรหัส HTML', + title: 'ดูรหัส HTML' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/tr.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/tr.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'tr', { + toolbar: 'Kaynak', + title: 'Kaynak' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/tt.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/tt.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'tt', { + toolbar: 'Чыганак', + title: 'Чыганак' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/ug.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/ug.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ug', { + toolbar: 'مەنبە', + title: 'مەنبە' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/uk.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/uk.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'uk', { + toolbar: 'Джерело', + title: 'Джерело' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/vi.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/vi.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'vi', { + toolbar: 'Mã HTML', + title: 'Mã HTML' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/zh-cn.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/zh-cn.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'zh-cn', { + toolbar: '源码', + title: '源码' +} ); Index: core/ckeditor/plugins/sourcedialog/lang/zh.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/lang/zh.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'zh', { + toolbar: '原始碼', + title: '原始碼' +} ); Index: core/ckeditor/plugins/sourcedialog/plugin.js =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/plugin.js @@ -0,0 +1,29 @@ +/** + * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.add( 'sourcedialog', { + // jscs:disable maximumLineLength + lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mn,ms,nb,nl,no,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% + // jscs:enable maximumLineLength + icons: 'sourcedialog,sourcedialog-rtl', // %REMOVE_LINE_CORE% + hidpi: true, // %REMOVE_LINE_CORE% + + init: function( editor ) { + // Register the "source" command, which simply opens the "source" dialog. + editor.addCommand( 'sourcedialog', new CKEDITOR.dialogCommand( 'sourcedialog' ) ); + + // Register the "source" dialog. + 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( 'Sourcedialog', { + label: editor.lang.sourcedialog.toolbar, + command: 'sourcedialog', + toolbar: 'mode,10' + } ); + } + } +} ); Index: core/ckeditor/plugins/sourcedialog/samples/sourcedialog.html =================================================================== --- /dev/null +++ core/ckeditor/plugins/sourcedialog/samples/sourcedialog.html @@ -0,0 +1,121 @@ + + + + + + Editing source code in a dialog — CKEditor Sample + + + + + + + + + +

+ CKEditor Samples » Editing source code in a dialog +

+
+ This sample is not maintained anymore. Check out its brand new version in CKEditor SDK. +
+
+

+ Sourcedialog plugin provides an easy way to edit raw HTML content + of an editor, similarly to what is possible with Sourcearea + plugin for classic (iframe-based) 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. It works with both classic + and inline instances. To enable this + plugin, basically add extraPlugins: 'sourcedialog' to editor's + config: +

+
+// Inline editor.
+CKEDITOR.inline( 'editable', {
+	extraPlugins: 'sourcedialog'
+});
+
+// Classic (iframe-based) editor.
+CKEDITOR.replace( 'textarea_id', {
+	extraPlugins: 'sourcedialog',
+	removePlugins: 'sourcearea'
+});
+
+

+ Note that you may want to include removePlugins: 'sourcearea' + in your config when using Sourcedialog in classic editor 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. +

+

+ 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.

+
+
+
+
+ + +
+ + + +