diff --git a/CKEditor.php b/CKEditor.php index 2b1edb58..13a11348 100644 --- a/CKEditor.php +++ b/CKEditor.php @@ -59,7 +59,7 @@ private function presetBasic(){ $options['removeButtons'] = 'Subscript,Superscript,Flash,Table,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe'; $options['removePlugins'] = 'elementspath'; $options['resize_enabled'] = false; - + $options['extraPlugins'] = 'confighelper'; $this->editorOptions = ArrayHelper::merge($options, $this->editorOptions); } @@ -82,9 +82,11 @@ private function presetStandard(){ $options['removeButtons'] = 'Smiley,Iframe'; - if($this->_inline){ - $options['extraPlugins'] = 'sourcedialog'; + if ($this->_inline) { + $options['extraPlugins'] = 'sourcedialog,confighelper'; $options['removePlugins'] = 'sourcearea'; + } else { + $options['extraPlugins'] = 'confighelper'; } $this->editorOptions = ArrayHelper::merge($options, $this->editorOptions); @@ -110,9 +112,11 @@ private function presetFull(){ ['name' => 'others'], ]; - if($this->_inline){ - $options['extraPlugins'] = 'sourcedialog'; + if ($this->_inline) { + $options['extraPlugins'] = 'sourcedialog,confighelper'; $options['removePlugins'] = 'sourcearea'; + } else { + $options['extraPlugins'] = 'confighelper'; } $this->editorOptions = ArrayHelper::merge($options, $this->editorOptions); @@ -130,15 +134,15 @@ public function run() } echo Html::endTag('div'); - $js = [ - 'mihaildev.ckEditor.registerOnChange('.Json::encode($this->options['id']).');' - ]; + $js = [ + 'mihaildev.ckEditor.registerOnChange('.Json::encode($this->options['id']).');' + ]; - if(isset($this->editorOptions['filebrowserUploadUrl'])) - $js[] = "mihaildev.ckEditor.registerCsrf();"; + if(isset($this->editorOptions['filebrowserUploadUrl'])) + $js[] = "mihaildev.ckEditor.registerCsrf();"; - if(!isset($this->editorOptions['on']['instanceReady'])) - $this->editorOptions['on']['instanceReady'] = new JsExpression("function( ev ){".implode(' ', $js)."}"); + if(!isset($this->editorOptions['on']['instanceReady'])) + $this->editorOptions['on']['instanceReady'] = new JsExpression("function( ev ){".implode(' ', $js)."}"); if($this->_inline){ $JavaScript = "CKEDITOR.inline("; diff --git a/editor/plugins/confighelper/LICENSE b/editor/plugins/confighelper/LICENSE new file mode 100755 index 00000000..df5936ea --- /dev/null +++ b/editor/plugins/confighelper/LICENSE @@ -0,0 +1,363 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. "Contributor" + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. "Contributor Version" + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the terms of + a Secondary License. + +1.6. "Executable Form" + + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + + means a work that combines Covered Software with other material, in a + separate file or files, that is not Covered Software. + +1.8. "License" + + means this document. + +1.9. "Licensable" + + means having the right to grant, to the maximum extent possible, whether + at the time of the initial grant or subsequently, any and all of the + rights conveyed by this License. + +1.10. "Modifications" + + means any of the following: + + a. any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. "Patent Claims" of a Contributor + + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the License, + by the making, using, selling, offering for sale, having made, import, + or transfer of either its Contributions or its Contributor Version. + +1.12. "Secondary License" + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. "Source Code Form" + + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, "control" means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution + become effective for each Contribution on the date the Contributor first + distributes such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under + this License. No additional rights or licenses will be implied from the + distribution or licensing of Covered Software under this License. + Notwithstanding Section 2.1(b) above, no patent license is granted by a + Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of + its Contributions. + + This License does not grant any rights in the trademarks, service marks, + or logos of any Contributor (except as may be necessary to comply with + the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this + License (see Section 10.2) or under the terms of a Secondary License (if + permitted under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its + Contributions are its original creation(s) or it has sufficient rights to + grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under + applicable copyright doctrines of fair use, fair dealing, or other + equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under + the terms of this License. You must inform recipients that the Source + Code Form of the Covered Software is governed by the terms of this + License, and how they can obtain a copy of this License. You may not + attempt to alter or restrict the recipients' rights in the Source Code + Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter the + recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for + the Covered Software. If the Larger Work is a combination of Covered + Software with a work governed by one or more Secondary Licenses, and the + Covered Software is not Incompatible With Secondary Licenses, this + License permits You to additionally distribute such Covered Software + under the terms of such Secondary License(s), so that the recipient of + the Larger Work may, at their option, further distribute the Covered + Software under the terms of either this License or such Secondary + License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices + (including copyright notices, patent notices, disclaimers of warranty, or + limitations of liability) contained within the Source Code Form of the + Covered Software, except that You may alter any license notices to the + extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on + behalf of any Contributor. You must make it absolutely clear that any + such warranty, support, indemnity, or liability obligation is offered by + You alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, + judicial order, or regulation then You must: (a) comply with the terms of + this License to the maximum extent possible; and (b) describe the + limitations and the code they affect. Such description must be placed in a + text file included with all distributions of the Covered Software under + this License. Except to the extent prohibited by statute or regulation, + such description must be sufficiently detailed for a recipient of ordinary + skill to be able to understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing + basis, if such Contributor fails to notify You of the non-compliance by + some reasonable means prior to 60 days after You have come back into + compliance. Moreover, Your grants from a particular Contributor are + reinstated on an ongoing basis if such Contributor notifies You of the + non-compliance by some reasonable means, this is the first time You have + received notice of non-compliance with this License from such + Contributor, and You become compliant prior to 30 days after Your receipt + of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, + counter-claims, and cross-claims) alleging that a Contributor Version + directly or indirectly infringes any patent, then the rights granted to + You by any and all Contributors for the Covered Software under Section + 2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an "as is" basis, + without warranty of any kind, either expressed, implied, or statutory, + including, without limitation, warranties that the Covered Software is free + of defects, merchantable, fit for a particular purpose or non-infringing. + The entire risk as to the quality and performance of the Covered Software + is with You. Should any Covered Software prove defective in any respect, + You (not any Contributor) assume the cost of any necessary servicing, + repair, or correction. This disclaimer of warranty constitutes an essential + part of this License. No use of any Covered Software is authorized under + this License except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from + such party's negligence to the extent applicable law prohibits such + limitation. Some jurisdictions do not allow the exclusion or limitation of + incidental or consequential damages, so this exclusion and limitation may + not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts + of a jurisdiction where the defendant maintains its principal place of + business and such litigation shall be governed by laws of that + jurisdiction, without reference to its conflict-of-law provisions. Nothing + in this Section shall prevent a party's ability to bring cross-claims or + counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. Any law or regulation which provides that + the language of a contract shall be construed against the drafter shall not + be used to construe this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version + of the License under which You originally received the Covered Software, + or under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a + modified version of this License if you rename the license and remove + any references to the name of the license steward (except to note that + such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary + Licenses If You choose to distribute Source Code Form that is + Incompatible With Secondary Licenses under the terms of this version of + the License, the notice described in Exhibit B of this License must be + attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, +then You may include the notice in a location (such as a LICENSE file in a +relevant directory) where a recipient would be likely to look for such a +notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice + + This Source Code Form is "Incompatible + With Secondary Licenses", as defined by + the Mozilla Public License, v. 2.0. + diff --git a/editor/plugins/confighelper/README.md b/editor/plugins/confighelper/README.md new file mode 100755 index 00000000..d3b0bc7b --- /dev/null +++ b/editor/plugins/confighelper/README.md @@ -0,0 +1,5 @@ +confighelper +============ + +Configuration Helper + HTML5 placeholder for CKEditor. +See docs/install.html for full details and install instructions diff --git a/editor/plugins/confighelper/docs/install.html b/editor/plugins/confighelper/docs/install.html new file mode 100755 index 00000000..84625826 --- /dev/null +++ b/editor/plugins/confighelper/docs/install.html @@ -0,0 +1,128 @@ + + + + +Configuration Helper plugin + + + + +

Configuration Helper Plugin for CKEditor

+ +

Introduction

+

This plugin tries to help setup CKEditor by providing additional configuration options to perform some +kind of common tasks.

+

Currently if offers a "removeDialogFields" that allows to remove individual fields in the dialogs (versus removing whole tabs with +removeDialogTabs, and "dialogFieldsDefaultValues" +defines default values for dialog fields.

+ +

Author:

+

Alfonso Martínez de Lizarrondo

+ +

Version history:

+
    +
  1. 1.0: 26-February-2012. First version.
  2. +
  3. 1.1: 16-February-2012. Added placeholder.
  4. +
  5. 1.2: 23-April-2012. Added hideDialogFields.
  6. +
  7. 1.3: 1-December-2012. Compatibility with CKEditor 4.
  8. +
  9. 1.4: 28-March-2013. Compatibility of the "placeholder" attribute with the inline mode of CKEditor 4.
  10. +
  11. 1.5: 16-April-2013. Version 1.4 was broken in CKEditor 3.
  12. +
  13. 1.6: 16-August-2013. Handle the setData method to update the "placeholder" status
  14. +
  15. 1.7: 6-October-2013. Patch by bfavors to fix handling placeholder on initial load of editor
  16. +
  17. 1.8: 9-March-2014. Check for IE11 by Russel Ward
    + Set caret into the empty paragraph correctly on first focus, patch by glanchow +
  18. +
  19. 1.8.1: 5-April-2014. Fix IE8 & IE9 problem with "inline textarea" if it's empty on start +
  20. +
  21. 1.8.2: 12-April-2014. Protect detection of empty content. Thanks to tanihito. +
  22. +
  23. 1.8.3: 30-November-2014. Force SCAYT to use the language that it's specified as the language for the contents.
    + Listen to the contentDom event to avoid problems when calling setData in WYSIWYG mode. Thanks to noam-si. +
  24. +
  25. 1.8.4: 25-November-2018: + Prevent editing the placeholder text if startupFocus is true. Thanks to Albince Paliakkara
    + Prevent leaking editor instances on destroy. Thanks to Ben Demboski +
  26. +
+ +

Installation

+

1. Copying the files

+

Extract the contents of the zip in you plugins directory, so it ends up like + this
+ +

+
+ckeditor\
+	...
+	images\
+	lang\
+	plugins\
+		...
+		confighelper\
+			plugin.js
+			docs\
+				install.html
+		...
+	skins\
+	themes\
+
+

2. Adding it to CKEditor

+

Now add the plugin in your config.js or custom js configuration +file: +config.extraPlugins='confighelper'; +

+ +

3. Configuration

+

config.removeDialogFields

+

This entry is a string, the fields are defined as dialogName + ":" + tab + ":" + field. Fields are joined with semicolons. +In order to learn the name of the parameters you can use the "Developer Tools plugin", launch that sample and open the dialog that you want to customize. +Now a little popup with appear showing the info about that field, for example: +

Element Information
+Dialog window name : image
+Tab name : info
+Element ID : txtBorder
+Element type : text
+
+so in order to remove the class attribute for images the config is: +
config.removeDialogFields="image:info:txtBorder";
+removing another field +
config.removeDialogFields="image:info:txtBorder;image:info:txtHSpace";
+ +

config.dialogFieldsDefaultValues

+

This setting uses directly a JSON object as the configuration value, first an object that has the dialog names as properties, each property is +a new object with the name of the tabs and finally each property name maps to the field name and it's value is the default value to use for the field.

+

An example might be much better as I might have messed up something in the description:

+
config.dialogFieldsDefaultValues =
+{
+	image:
+		{
+			advanced:
+				{
+					txtGenClass : 'myClass',
+					txtGenTitle : 'Image title'
+				}
+		}
+};
+
+ +

config.placeholder

+

This a text that will be shown when the editor is empty following the HTML5 placeholder attribute. When the user focus the editor, the content is +cleared automatically.

+

The value can be set in the configuration or as an attribute of the replaced element

+
config.placeholder = 'Type here...';
+ +

config.hideDialogFields

+

This entry uses the same sintax that the 'removeDialogFields' option. The difference is that some fields can't be removed easily as other parts of the dialog +might not be ready and might try to always use it, generating a javascript error. In other cases the layout might be broken if the field is removed instead of hidden.
+In those cases it's possible to hide the fields using this entry, and the preview in the image dialog is an example of such a field.

+
config.hideDialogFields="image:info:htmlPreview";
+ + + +

Disclaimers

+

CKEditor is © CKSource.com

+ + diff --git a/editor/plugins/confighelper/docs/styles.css b/editor/plugins/confighelper/docs/styles.css new file mode 100755 index 00000000..58ae80a0 --- /dev/null +++ b/editor/plugins/confighelper/docs/styles.css @@ -0,0 +1,59 @@ +body { + font-family: Arial, Helvetica, sans-serif; + font-size: 90%; +} +h1 { + text-align:center; + font-size:180%; +} +h2 { + border-bottom:2px solid #CCC; + margin:1em 0 0.4em 0; +} +h3 { + margin-bottom:0.4em; +} +p { + margin:0 0 1em 1em; + text-align:justify; +} +ol { + margin:0 0 1.2em 1em; + padding:0; + list-style-type:none; +} +ol li { + margin:0.2em 0; +} +pre, code { + font-size:100%; + font-family:"Courier New", Courier, mono; + background-color: #CCCCCC; + border:1px solid #999; + padding:0.2em 1em; + margin: 0.4em 0; + display:block; + white-space: pre; + overflow: auto; +} +form { + margin:0 0 0 1em; +} +span.key { + color: #006600; +} +#install { + display:none +} +#languages ul { + display:inline; + list-style-type:none; + margin:0; + padding:0; +} +#languages li { + display:inline; + margin:0; + padding:0; + vertical-align:bottom; +} \ No newline at end of file diff --git a/editor/plugins/confighelper/plugin.js b/editor/plugins/confighelper/plugin.js new file mode 100755 index 00000000..ea84bf67 --- /dev/null +++ b/editor/plugins/confighelper/plugin.js @@ -0,0 +1,362 @@ +/** + * @file Configuration helper plugin for CKEditor + * Copyright (C) 2012 Alfonso Martínez de Lizarrondo + * + */ +(function() { + 'use strict'; + + // Check if the browser supports the placeholder attribute on textareas natively. + var supportsPlaceholder = ('placeholder' in document.createElement( 'textarea' ) ); + + // If the data is "empty" (BR, P) or the placeholder then return an empty string. + // Otherwise return the original data + function dataIsEmpty( data ) { + if ( !data) + return true; + + if ( data.length > 20 ) + return false; + + var value = data.replace( /[\n|\t]*/g, '' ).toLowerCase(); + if ( !value || value == '
' || value == '

 

' || value == '


' || value == '

 

' || value == ' ' || value == ' ' || value == ' 
' || value == '
' ) + return true; + + return false; + } + + function addPlaceholder(ev) { + var editor = ev.editor; + var root = (editor.editable ? editor.editable() : (editor.mode == 'wysiwyg' ? editor.document && editor.document.getBody() : editor.textarea ) ); + var placeholder = ev.listenerData; + if (!root) + return; + + if (editor.mode == 'wysiwyg') { + // If the blur is due to a dialog, don't apply the placeholder + if ( CKEDITOR.dialog._.currentTop ) + return; + + if ( !root ) + return; + + if ( dataIsEmpty( root.getHtml() ) ) { + root.setHtml( placeholder ); + root.addClass( 'placeholder' ); + } + } + + if (editor.mode == 'source') { + if ( supportsPlaceholder ) { + if (ev.name == 'mode') { + root.setAttribute( 'placeholder', placeholder ); + } + return; + } + + if ( dataIsEmpty( root.getValue() ) ) { + root.setValue( placeholder ); + root.addClass( 'placeholder' ); + } + } + } + + function removePlaceholder(ev) { + var editor = ev.editor; + var root = (editor.editable ? editor.editable() : (editor.mode == 'wysiwyg' ? editor.document && editor.document.getBody() : editor.textarea ) ); + if (!root) + return; + + if (editor.mode == 'wysiwyg' ) { + if (!root.hasClass( 'placeholder' )) + return; + + root.removeClass( 'placeholder' ); + // fill it properly + if (CKEDITOR.dtd[ root.getName() ]['p']) { + root.setHtml( '


' ); + // Set caret in position + var range = new CKEDITOR.dom.range(editor.document); + range.moveToElementEditablePosition(root.getFirst(), true); + editor.getSelection().selectRanges([ range ]); + } else { + root.setHtml(' '); + } + } + + if (editor.mode == 'source') { + if ( !root.hasClass( 'placeholder' ) ) + return; + + root.removeClass( 'placeholder' ); + root.setValue( '' ); + } + } + + function getLang( element ) { + if (!element) + return null; + + return element.getAttribute( 'lang' ) || getLang( element.getParent() ); + } + + CKEDITOR.plugins.add( 'confighelper', { + getPlaceholderCss : function() { + return '.placeholder{ color: #999; }'; + }, + + onLoad : function() { + // v4 + if (CKEDITOR.addCss) + CKEDITOR.addCss( this.getPlaceholderCss() ); + }, + + init : function( editor ) { + + // correct focus status after switch mode + editor.on( 'mode', function( ev ) { + // Let's update to match reality + ev.editor.focusManager.hasFocus = false; + // Now focus it: + }); + + // Placeholder - Start + // Get the placeholder from the replaced element or from the configuration + var placeholder = editor.element.getAttribute( 'placeholder' ) || editor.config.placeholder; + + if (placeholder) { + // CSS for WYSIWYG mode + // v3 + if (editor.addCss) + editor.addCss(this.getPlaceholderCss()); + + // CSS for textarea mode + var node = CKEDITOR.document.getHead().append( 'style' ); + node.setAttribute( 'type', 'text/css' ); + var content = 'textarea.placeholder { color: #999; font-style: italic; }'; + + if ( CKEDITOR.env.ie && CKEDITOR.env.version < 11) + node.$.styleSheet.cssText = content; + else + node.$.innerHTML = content; + + // Watch for the calls to getData to remove the placeholder + editor.on( 'getData', function( ev ) { + var element = (editor.editable ? editor.editable() : (editor.mode == 'wysiwyg' ? editor.document && editor.document.getBody() : editor.textarea ) ); + + if ( element && element.hasClass( 'placeholder' ) ) + ev.data.dataValue = ''; + }); + + // Watch for setData to remove placeholder class + editor.on('setData', function(ev) { + if ( CKEDITOR.dialog._.currentTop ) + return; + + if ( editor.mode == 'source' && supportsPlaceholder ) + return; + + var root = (editor.editable ? editor.editable() : (editor.mode == 'wysiwyg' ? editor.document && editor.document.getBody() : editor.textarea ) ); + + if ( !root ) + return; + + if ( !dataIsEmpty( ev.data.dataValue ) ) { + // Remove the class if new data is not empty + if ( root.hasClass( 'placeholder' ) ) + root.removeClass( 'placeholder' ); + } else { + // if data is empty, set it to the placeholder + addPlaceholder(ev); + } + }); + + editor.on('blur', addPlaceholder, null, placeholder); + editor.on('mode', addPlaceholder, null, placeholder); + editor.on('contentDom', addPlaceholder, null, placeholder); + + editor.on('focus', removePlaceholder); + editor.on('key', removePlaceholder); + editor.on('beforeModeUnload', removePlaceholder); + } // Placeholder - End + + + // SCAYT lang from element lang: + var lang = editor.config.contentsLanguage || getLang( editor.element ); + if ( lang && editor.plugins.scayt && !editor.config.scayt_sLang ) { + try { + // Remove the stored language + if (localStorage) + localStorage.removeItem( 'scayt_0_lang' ); + } catch (e) { /* */} + + // Convert from HTML5 Lang to spellchecker.net values + var map = { + 'en' : 'en_US', + 'en-us': 'en_US', + 'en-gb': 'en_GB', + 'pt-br': 'pt_BR', + 'da' : 'da_DK', + 'da-dk': 'da_DK', + 'nl-nl': 'nl_NL', + 'en-ca': 'en_CA', + 'fi-fi': 'fi_FI', + 'fr' : 'fr_FR', + 'fr-fr': 'fr_FR', + 'fr-ca': 'fr_CA', + 'de' : 'de_DE', + 'de-de': 'de_DE', + 'el-gr': 'el_GR', + 'it' : 'it_IT', + 'it-it': 'it_IT', + 'nb-no': 'nb_NO', + 'pt' : 'pt_PT', + 'pt-pt': 'pt_PT', + 'es' : 'es_ES', + 'es-es': 'es_ES', + 'sv-se': 'sv_SE' + }; + editor.config.scayt_sLang = map[ lang.toLowerCase() ]; + } + + // Parse the config to turn it into a js object + // format= dialogName:tabName:fieldName + var parseDefinitionToObject = function( value ) { + // Allow JSON definitions + if (typeof value == 'object') + return value; + + var contents = value.split( ';' ), + tabsToProcess = {}, + i; + + for ( i = 0; i < contents.length; i++ ) { + var parts = contents[ i ].split( ':' ); + if ( parts.length == 3 ) { + var dialogName = parts[ 0 ], + tabName = parts[ 1 ], + fieldName = parts[ 2 ]; + + if ( !tabsToProcess[ dialogName ] ) + tabsToProcess[ dialogName ] = {}; + if ( !tabsToProcess[ dialogName ][ tabName ] ) + tabsToProcess[ dialogName ][ tabName ] = []; + + tabsToProcess[ dialogName ][ tabName ].push( fieldName ); + } + } + return tabsToProcess; + }; + + // Customize dialogs: + function customizeDialogs( ev ) { + if ( editor != ev.editor ) + return; + + var dialogName = ev.data.name, + dialogDefinition = ev.data.definition, + tabsToProcess, + i, name, fields, tab; + + if (dialogName == 'tableProperties') + dialogName = 'table'; + + // Parse the config to turn it into a js object + if ( !( 'removeDialogFields' in editor._ ) && editor.config.removeDialogFields ) + editor._.removeDialogFields = parseDefinitionToObject( editor.config.removeDialogFields ); + + // Remove fields of this dialog. + if ( editor._.removeDialogFields && ( tabsToProcess = editor._.removeDialogFields[ dialogName ] ) ) { + for ( name in tabsToProcess ) { + fields = tabsToProcess[ name ]; + tab = dialogDefinition.getContents( name ); + + for ( i = 0; i < fields.length ; i++ ) + tab.remove( fields[ i ] ); + } + } + + + if ( !( 'hideDialogFields' in editor._ ) && editor.config.hideDialogFields ) + editor._.hideDialogFields = parseDefinitionToObject( editor.config.hideDialogFields ); + + // Remove fields of this dialog. + if ( editor._.hideDialogFields && ( tabsToProcess = editor._.hideDialogFields[ dialogName ] ) ) { + for ( name in tabsToProcess ) { + fields = tabsToProcess[ name ]; + tab = dialogDefinition.getContents( name ); + + for ( i = 0; i < fields.length ; i++ ) + tab.get( fields[ i ] ).hidden = true; + } + } + + // Set default values. + if ( editor.config.dialogFieldsDefaultValues && ( tabsToProcess = editor.config.dialogFieldsDefaultValues[ dialogName ] ) ) { + for ( name in tabsToProcess ) { + fields = tabsToProcess[ name ]; + tab = dialogDefinition.getContents( name ); + + for ( var fieldName in fields ) { + var dialogField = tab.get( fieldName ); + if ( dialogField ) + dialogField[ 'default' ] = fields[ fieldName ]; + } + } + } + + + } + + CKEDITOR.on( 'dialogDefinition', customizeDialogs ); + editor.once( 'beforeDestroy', function() { + CKEDITOR.removeListener( 'dialogDefinition', customizeDialogs ); + }); + + } + } ); + +})(); + + /** + * Allows to define which dialog fiels must be removed + * @name CKEDITOR.config.removeDialogFields + * @type {String} + * @example + * editor.config.removeDialogFields = "image:info:txtBorder;image:info:txtHSpace"; + */ + + /** + * Allows to define which dialog fiels must be hidden + * @name CKEDITOR.config.hideDialogFields + * @type {String} + * @example + * editor.config.hideDialogFields = "image:info:htmlPreview"; + */ + + /** + * Allows to define default values for dialog fields + * @name CKEDITOR.config.dialogFieldsDefaultValues + * @type {Object} + * @example + config.dialogFieldsDefaultValues = + { + image: + { + advanced: + { + txtGenClass : 'myClass', + txtGenTitle : 'Image title' + } + } + }; + */ + + + /** + * Placeholder text for empty editor + * @name CKEDITOR.config.placeholder + * @type {String} + * @example + * editor.config.placeholder = "Please, type here..."; + */ diff --git a/editor/plugins/sourcedialog/dialogs/sourcedialog.js b/editor/plugins/sourcedialog/dialogs/sourcedialog.js new file mode 100644 index 00000000..2568b8c7 --- /dev/null +++ b/editor/plugins/sourcedialog/dialogs/sourcedialog.js @@ -0,0 +1,79 @@ +/** + * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-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. (https://dev.ckeditor.com/ticket/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' + } ] + } ] + }; +} ); diff --git a/editor/plugins/sourcedialog/icons/hidpi/sourcedialog-rtl.png b/editor/plugins/sourcedialog/icons/hidpi/sourcedialog-rtl.png new file mode 100644 index 00000000..c95da32d Binary files /dev/null and b/editor/plugins/sourcedialog/icons/hidpi/sourcedialog-rtl.png differ diff --git a/editor/plugins/sourcedialog/icons/hidpi/sourcedialog.png b/editor/plugins/sourcedialog/icons/hidpi/sourcedialog.png new file mode 100644 index 00000000..2f3eae1a Binary files /dev/null and b/editor/plugins/sourcedialog/icons/hidpi/sourcedialog.png differ diff --git a/editor/plugins/sourcedialog/icons/sourcedialog-rtl.png b/editor/plugins/sourcedialog/icons/sourcedialog-rtl.png new file mode 100644 index 00000000..5353eee7 Binary files /dev/null and b/editor/plugins/sourcedialog/icons/sourcedialog-rtl.png differ diff --git a/editor/plugins/sourcedialog/icons/sourcedialog.png b/editor/plugins/sourcedialog/icons/sourcedialog.png new file mode 100644 index 00000000..0783e85c Binary files /dev/null and b/editor/plugins/sourcedialog/icons/sourcedialog.png differ diff --git a/editor/plugins/sourcedialog/lang/af.js b/editor/plugins/sourcedialog/lang/af.js new file mode 100644 index 00000000..7cf230f4 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/af.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'af', { + toolbar: 'Bron', + title: 'Bron' +} ); diff --git a/editor/plugins/sourcedialog/lang/ar.js b/editor/plugins/sourcedialog/lang/ar.js new file mode 100644 index 00000000..b8d3b51c --- /dev/null +++ b/editor/plugins/sourcedialog/lang/ar.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ar', { + toolbar: 'المصدر', + title: 'المصدر' +} ); diff --git a/editor/plugins/sourcedialog/lang/az.js b/editor/plugins/sourcedialog/lang/az.js new file mode 100644 index 00000000..248a2a1c --- /dev/null +++ b/editor/plugins/sourcedialog/lang/az.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'az', { + toolbar: 'Mənbə', + title: 'Mənbə' +} ); diff --git a/editor/plugins/sourcedialog/lang/bg.js b/editor/plugins/sourcedialog/lang/bg.js new file mode 100644 index 00000000..87b4826d --- /dev/null +++ b/editor/plugins/sourcedialog/lang/bg.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'bg', { + toolbar: 'Източник', + title: 'Източник' +} ); diff --git a/editor/plugins/sourcedialog/lang/bn.js b/editor/plugins/sourcedialog/lang/bn.js new file mode 100644 index 00000000..4350a662 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/bn.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'bn', { + toolbar: 'উৎস', + title: 'সোর্স' +} ); diff --git a/editor/plugins/sourcedialog/lang/bs.js b/editor/plugins/sourcedialog/lang/bs.js new file mode 100644 index 00000000..21024988 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/bs.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'bs', { + toolbar: 'HTML kôd', + title: 'HTML kôd' +} ); diff --git a/editor/plugins/sourcedialog/lang/ca.js b/editor/plugins/sourcedialog/lang/ca.js new file mode 100644 index 00000000..84e80e50 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/ca.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ca', { + toolbar: 'Codi font', + title: 'Codi font' +} ); diff --git a/editor/plugins/sourcedialog/lang/cs.js b/editor/plugins/sourcedialog/lang/cs.js new file mode 100644 index 00000000..f84440a0 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/cs.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'cs', { + toolbar: 'Zdroj', + title: 'Zdroj' +} ); diff --git a/editor/plugins/sourcedialog/lang/cy.js b/editor/plugins/sourcedialog/lang/cy.js new file mode 100644 index 00000000..35a91c32 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/cy.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'cy', { + toolbar: 'HTML', + title: 'HTML' +} ); diff --git a/editor/plugins/sourcedialog/lang/da.js b/editor/plugins/sourcedialog/lang/da.js new file mode 100644 index 00000000..f5edc792 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/da.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'da', { + toolbar: 'Kilde', + title: 'Kilde' +} ); diff --git a/editor/plugins/sourcedialog/lang/de-ch.js b/editor/plugins/sourcedialog/lang/de-ch.js new file mode 100644 index 00000000..dc4c441b --- /dev/null +++ b/editor/plugins/sourcedialog/lang/de-ch.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'de-ch', { + toolbar: 'Quellcode', + title: 'Quellcode' +} ); diff --git a/editor/plugins/sourcedialog/lang/de.js b/editor/plugins/sourcedialog/lang/de.js new file mode 100644 index 00000000..94f1db0a --- /dev/null +++ b/editor/plugins/sourcedialog/lang/de.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'de', { + toolbar: 'Quellcode', + title: 'Quellcode' +} ); diff --git a/editor/plugins/sourcedialog/lang/el.js b/editor/plugins/sourcedialog/lang/el.js new file mode 100644 index 00000000..4d712a0b --- /dev/null +++ b/editor/plugins/sourcedialog/lang/el.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'el', { + toolbar: 'Κώδικας', + title: 'Κώδικας' +} ); diff --git a/editor/plugins/sourcedialog/lang/en-au.js b/editor/plugins/sourcedialog/lang/en-au.js new file mode 100644 index 00000000..b19c2984 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/en-au.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'en-au', { + toolbar: 'Source', + title: 'Source' +} ); diff --git a/editor/plugins/sourcedialog/lang/en-ca.js b/editor/plugins/sourcedialog/lang/en-ca.js new file mode 100644 index 00000000..2afd3a83 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/en-ca.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'en-ca', { + toolbar: 'Source', + title: 'Source' +} ); diff --git a/editor/plugins/sourcedialog/lang/en-gb.js b/editor/plugins/sourcedialog/lang/en-gb.js new file mode 100644 index 00000000..0b369d6a --- /dev/null +++ b/editor/plugins/sourcedialog/lang/en-gb.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'en-gb', { + toolbar: 'Source', + title: 'Source' +} ); diff --git a/editor/plugins/sourcedialog/lang/en.js b/editor/plugins/sourcedialog/lang/en.js new file mode 100644 index 00000000..1a6134d4 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/en.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'en', { + toolbar: 'Source', + title: 'Source' +} ); diff --git a/editor/plugins/sourcedialog/lang/eo.js b/editor/plugins/sourcedialog/lang/eo.js new file mode 100644 index 00000000..564d1b61 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/eo.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'eo', { + toolbar: 'Fonto', + title: 'Fonto' +} ); diff --git a/editor/plugins/sourcedialog/lang/es-mx.js b/editor/plugins/sourcedialog/lang/es-mx.js new file mode 100644 index 00000000..bce771b5 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/es-mx.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'es-mx', { + toolbar: 'Fuente', + title: 'Fuente' +} ); diff --git a/editor/plugins/sourcedialog/lang/es.js b/editor/plugins/sourcedialog/lang/es.js new file mode 100644 index 00000000..f26ed429 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/es.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'es', { + toolbar: 'Fuente HTML', + title: 'Fuente HTML' +} ); diff --git a/editor/plugins/sourcedialog/lang/et.js b/editor/plugins/sourcedialog/lang/et.js new file mode 100644 index 00000000..1f46e616 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/et.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'et', { + toolbar: 'Lähtekood', + title: 'Lähtekood' +} ); diff --git a/editor/plugins/sourcedialog/lang/eu.js b/editor/plugins/sourcedialog/lang/eu.js new file mode 100644 index 00000000..2eaf2806 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/eu.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'eu', { + toolbar: 'Iturburua', + title: 'Iturburua' +} ); diff --git a/editor/plugins/sourcedialog/lang/fa.js b/editor/plugins/sourcedialog/lang/fa.js new file mode 100644 index 00000000..3c8fe824 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/fa.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'fa', { + toolbar: 'منبع', + title: 'منبع' +} ); diff --git a/editor/plugins/sourcedialog/lang/fi.js b/editor/plugins/sourcedialog/lang/fi.js new file mode 100644 index 00000000..ac1af786 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/fi.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'fi', { + toolbar: 'Koodi', + title: 'Koodi' +} ); diff --git a/editor/plugins/sourcedialog/lang/fo.js b/editor/plugins/sourcedialog/lang/fo.js new file mode 100644 index 00000000..d18b6008 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/fo.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'fo', { + toolbar: 'Kelda', + title: 'Kelda' +} ); diff --git a/editor/plugins/sourcedialog/lang/fr-ca.js b/editor/plugins/sourcedialog/lang/fr-ca.js new file mode 100644 index 00000000..039d8354 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/fr-ca.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'fr-ca', { + toolbar: 'Source', + title: 'Source' +} ); diff --git a/editor/plugins/sourcedialog/lang/fr.js b/editor/plugins/sourcedialog/lang/fr.js new file mode 100644 index 00000000..51ce0619 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/fr.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'fr', { + toolbar: 'Source', + title: 'Source' +} ); diff --git a/editor/plugins/sourcedialog/lang/gl.js b/editor/plugins/sourcedialog/lang/gl.js new file mode 100644 index 00000000..79b311ab --- /dev/null +++ b/editor/plugins/sourcedialog/lang/gl.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'gl', { + toolbar: 'Orixe', + title: 'Orixe' +} ); diff --git a/editor/plugins/sourcedialog/lang/gu.js b/editor/plugins/sourcedialog/lang/gu.js new file mode 100644 index 00000000..151bf8fa --- /dev/null +++ b/editor/plugins/sourcedialog/lang/gu.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'gu', { + toolbar: 'મૂળ કે પ્રાથમિક દસ્તાવેજ', + title: 'મૂળ કે પ્રાથમિક દસ્તાવેજ' +} ); diff --git a/editor/plugins/sourcedialog/lang/he.js b/editor/plugins/sourcedialog/lang/he.js new file mode 100644 index 00000000..9b172c12 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/he.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'he', { + toolbar: 'מקור', + title: 'מקור' +} ); diff --git a/editor/plugins/sourcedialog/lang/hi.js b/editor/plugins/sourcedialog/lang/hi.js new file mode 100644 index 00000000..f40619b9 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/hi.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'hi', { + toolbar: 'सोर्स', + title: 'सोर्स' +} ); diff --git a/editor/plugins/sourcedialog/lang/hr.js b/editor/plugins/sourcedialog/lang/hr.js new file mode 100644 index 00000000..50ddc4c0 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/hr.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'hr', { + toolbar: 'Kôd', + title: 'Kôd' +} ); diff --git a/editor/plugins/sourcedialog/lang/hu.js b/editor/plugins/sourcedialog/lang/hu.js new file mode 100644 index 00000000..7ababc34 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/hu.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'hu', { + toolbar: 'Forráskód', + title: 'Forráskód' +} ); diff --git a/editor/plugins/sourcedialog/lang/id.js b/editor/plugins/sourcedialog/lang/id.js new file mode 100644 index 00000000..f021ae47 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/id.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'id', { + toolbar: 'Sumber', + title: 'Sumber' +} ); diff --git a/editor/plugins/sourcedialog/lang/is.js b/editor/plugins/sourcedialog/lang/is.js new file mode 100644 index 00000000..36d17c45 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/is.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'is', { + toolbar: 'Kóði', + title: 'Kóði' +} ); diff --git a/editor/plugins/sourcedialog/lang/it.js b/editor/plugins/sourcedialog/lang/it.js new file mode 100644 index 00000000..19dd0580 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/it.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'it', { + toolbar: 'Sorgente', + title: 'Sorgente' +} ); diff --git a/editor/plugins/sourcedialog/lang/ja.js b/editor/plugins/sourcedialog/lang/ja.js new file mode 100644 index 00000000..fce97ccc --- /dev/null +++ b/editor/plugins/sourcedialog/lang/ja.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ja', { + toolbar: 'ソース', + title: 'ソース' +} ); diff --git a/editor/plugins/sourcedialog/lang/ka.js b/editor/plugins/sourcedialog/lang/ka.js new file mode 100644 index 00000000..2205e50c --- /dev/null +++ b/editor/plugins/sourcedialog/lang/ka.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ka', { + toolbar: 'კოდები', + title: 'კოდები' +} ); diff --git a/editor/plugins/sourcedialog/lang/km.js b/editor/plugins/sourcedialog/lang/km.js new file mode 100644 index 00000000..84ffa135 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/km.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'km', { + toolbar: 'អក្សរ​កូដ', + title: 'អក្សរ​កូដ' +} ); diff --git a/editor/plugins/sourcedialog/lang/ko.js b/editor/plugins/sourcedialog/lang/ko.js new file mode 100644 index 00000000..dfc4d8e8 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/ko.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ko', { + toolbar: '소스', + title: '소스' +} ); diff --git a/editor/plugins/sourcedialog/lang/ku.js b/editor/plugins/sourcedialog/lang/ku.js new file mode 100644 index 00000000..d6faeb3e --- /dev/null +++ b/editor/plugins/sourcedialog/lang/ku.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ku', { + toolbar: 'سەرچاوە', + title: 'سەرچاوە' +} ); diff --git a/editor/plugins/sourcedialog/lang/lt.js b/editor/plugins/sourcedialog/lang/lt.js new file mode 100644 index 00000000..27d2581d --- /dev/null +++ b/editor/plugins/sourcedialog/lang/lt.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'lt', { + toolbar: 'Šaltinis', + title: 'Šaltinis' +} ); diff --git a/editor/plugins/sourcedialog/lang/lv.js b/editor/plugins/sourcedialog/lang/lv.js new file mode 100644 index 00000000..b3f8cfc0 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/lv.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'lv', { + toolbar: 'HTML kods', + title: 'HTML kods' +} ); diff --git a/editor/plugins/sourcedialog/lang/mn.js b/editor/plugins/sourcedialog/lang/mn.js new file mode 100644 index 00000000..d3b8312e --- /dev/null +++ b/editor/plugins/sourcedialog/lang/mn.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'mn', { + toolbar: 'Код', + title: 'Код' +} ); diff --git a/editor/plugins/sourcedialog/lang/ms.js b/editor/plugins/sourcedialog/lang/ms.js new file mode 100644 index 00000000..40a62293 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/ms.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ms', { + toolbar: 'Sumber', + title: 'Sumber' +} ); diff --git a/editor/plugins/sourcedialog/lang/nb.js b/editor/plugins/sourcedialog/lang/nb.js new file mode 100644 index 00000000..80ce5416 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/nb.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'nb', { + toolbar: 'Kilde', + title: 'Kilde' +} ); diff --git a/editor/plugins/sourcedialog/lang/nl.js b/editor/plugins/sourcedialog/lang/nl.js new file mode 100644 index 00000000..5700892c --- /dev/null +++ b/editor/plugins/sourcedialog/lang/nl.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'nl', { + toolbar: 'Broncode', + title: 'Broncode' +} ); diff --git a/editor/plugins/sourcedialog/lang/no.js b/editor/plugins/sourcedialog/lang/no.js new file mode 100644 index 00000000..2cd24358 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/no.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'no', { + toolbar: 'Kilde', + title: 'Kilde' +} ); diff --git a/editor/plugins/sourcedialog/lang/oc.js b/editor/plugins/sourcedialog/lang/oc.js new file mode 100644 index 00000000..e79a1754 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/oc.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'oc', { + toolbar: 'Font', + title: 'Font' +} ); diff --git a/editor/plugins/sourcedialog/lang/pl.js b/editor/plugins/sourcedialog/lang/pl.js new file mode 100644 index 00000000..601179ef --- /dev/null +++ b/editor/plugins/sourcedialog/lang/pl.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'pl', { + toolbar: 'Źródło dokumentu', + title: 'Źródło dokumentu' +} ); diff --git a/editor/plugins/sourcedialog/lang/pt-br.js b/editor/plugins/sourcedialog/lang/pt-br.js new file mode 100644 index 00000000..b9b68e7c --- /dev/null +++ b/editor/plugins/sourcedialog/lang/pt-br.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'pt-br', { + toolbar: 'Código-Fonte', + title: 'Código-Fonte' +} ); diff --git a/editor/plugins/sourcedialog/lang/pt.js b/editor/plugins/sourcedialog/lang/pt.js new file mode 100644 index 00000000..4b9acd64 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/pt.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'pt', { + toolbar: 'Fonte', + title: 'Fonte' +} ); diff --git a/editor/plugins/sourcedialog/lang/ro.js b/editor/plugins/sourcedialog/lang/ro.js new file mode 100644 index 00000000..035647c8 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/ro.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ro', { + toolbar: 'Sursa', + title: 'Sursa' +} ); diff --git a/editor/plugins/sourcedialog/lang/ru.js b/editor/plugins/sourcedialog/lang/ru.js new file mode 100644 index 00000000..6ed41343 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/ru.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ru', { + toolbar: 'Исходник', + title: 'Источник' +} ); diff --git a/editor/plugins/sourcedialog/lang/si.js b/editor/plugins/sourcedialog/lang/si.js new file mode 100644 index 00000000..dbae1fbe --- /dev/null +++ b/editor/plugins/sourcedialog/lang/si.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'si', { + toolbar: 'මුලාශ්‍රය', + title: 'මුලාශ්‍රය' +} ); diff --git a/editor/plugins/sourcedialog/lang/sk.js b/editor/plugins/sourcedialog/lang/sk.js new file mode 100644 index 00000000..99bab916 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/sk.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'sk', { + toolbar: 'Zdroj', + title: 'Zdroj' +} ); diff --git a/editor/plugins/sourcedialog/lang/sl.js b/editor/plugins/sourcedialog/lang/sl.js new file mode 100644 index 00000000..54e4eb2f --- /dev/null +++ b/editor/plugins/sourcedialog/lang/sl.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'sl', { + toolbar: 'Izvorna koda', + title: 'Izvorna koda' +} ); diff --git a/editor/plugins/sourcedialog/lang/sq.js b/editor/plugins/sourcedialog/lang/sq.js new file mode 100644 index 00000000..ee46124c --- /dev/null +++ b/editor/plugins/sourcedialog/lang/sq.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'sq', { + toolbar: 'Burimi', + title: 'Burimi' +} ); diff --git a/editor/plugins/sourcedialog/lang/sr-latn.js b/editor/plugins/sourcedialog/lang/sr-latn.js new file mode 100644 index 00000000..d12887f8 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/sr-latn.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'sr-latn', { + toolbar: 'Kôd', + title: 'Kôd' +} ); diff --git a/editor/plugins/sourcedialog/lang/sr.js b/editor/plugins/sourcedialog/lang/sr.js new file mode 100644 index 00000000..d4a0b82c --- /dev/null +++ b/editor/plugins/sourcedialog/lang/sr.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'sr', { + toolbar: 'Kôд', + title: 'Kôд' +} ); diff --git a/editor/plugins/sourcedialog/lang/sv.js b/editor/plugins/sourcedialog/lang/sv.js new file mode 100644 index 00000000..1d506e9b --- /dev/null +++ b/editor/plugins/sourcedialog/lang/sv.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'sv', { + toolbar: 'Källa', + title: 'Källa' +} ); diff --git a/editor/plugins/sourcedialog/lang/th.js b/editor/plugins/sourcedialog/lang/th.js new file mode 100644 index 00000000..e5b2d79d --- /dev/null +++ b/editor/plugins/sourcedialog/lang/th.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'th', { + toolbar: 'ดูรหัส HTML', + title: 'ดูรหัส HTML' +} ); diff --git a/editor/plugins/sourcedialog/lang/tr.js b/editor/plugins/sourcedialog/lang/tr.js new file mode 100644 index 00000000..4851acd4 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/tr.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'tr', { + toolbar: 'Kaynak', + title: 'Kaynak' +} ); diff --git a/editor/plugins/sourcedialog/lang/tt.js b/editor/plugins/sourcedialog/lang/tt.js new file mode 100644 index 00000000..22920bee --- /dev/null +++ b/editor/plugins/sourcedialog/lang/tt.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'tt', { + toolbar: 'Чыганак', + title: 'Чыганак' +} ); diff --git a/editor/plugins/sourcedialog/lang/ug.js b/editor/plugins/sourcedialog/lang/ug.js new file mode 100644 index 00000000..efb34990 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/ug.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'ug', { + toolbar: 'مەنبە', + title: 'مەنبە' +} ); diff --git a/editor/plugins/sourcedialog/lang/uk.js b/editor/plugins/sourcedialog/lang/uk.js new file mode 100644 index 00000000..967bf58e --- /dev/null +++ b/editor/plugins/sourcedialog/lang/uk.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'uk', { + toolbar: 'Джерело', + title: 'Джерело' +} ); diff --git a/editor/plugins/sourcedialog/lang/vi.js b/editor/plugins/sourcedialog/lang/vi.js new file mode 100644 index 00000000..aa3d0d0d --- /dev/null +++ b/editor/plugins/sourcedialog/lang/vi.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'vi', { + toolbar: 'Mã HTML', + title: 'Mã HTML' +} ); diff --git a/editor/plugins/sourcedialog/lang/zh-cn.js b/editor/plugins/sourcedialog/lang/zh-cn.js new file mode 100644 index 00000000..2940a092 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/zh-cn.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'zh-cn', { + toolbar: '源码', + title: '源码' +} ); diff --git a/editor/plugins/sourcedialog/lang/zh.js b/editor/plugins/sourcedialog/lang/zh.js new file mode 100644 index 00000000..2f3f94c2 --- /dev/null +++ b/editor/plugins/sourcedialog/lang/zh.js @@ -0,0 +1,9 @@ +/* +Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ + +CKEDITOR.plugins.setLang( 'sourcedialog', 'zh', { + toolbar: '原始碼', + title: '原始碼' +} ); diff --git a/editor/plugins/sourcedialog/plugin.js b/editor/plugins/sourcedialog/plugin.js new file mode 100644 index 00000000..8507ea56 --- /dev/null +++ b/editor/plugins/sourcedialog/plugin.js @@ -0,0 +1,30 @@ +/** + * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.add( 'sourcedialog', { + // jscs:disable maximumLineLength + lang: 'af,ar,az,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,es-mx,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,oc,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 + requires: 'dialog', + 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' + } ); + } + } +} ); diff --git a/editor/plugins/sourcedialog/samples/sourcedialog.html b/editor/plugins/sourcedialog/samples/sourcedialog.html new file mode 100644 index 00000000..22fc433c --- /dev/null +++ b/editor/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 Examples. +
+
+

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

+
+
+
+
+ + +
+ + + +