[gen] Integrated ckeditor 4.4.4.
This commit is contained in:
parent
1e29611746
commit
c40e133113
229 changed files with 3326 additions and 0 deletions
28
gen/ui/ckeditor/plugins/scayt/LICENSE.md
Normal file
28
gen/ui/ckeditor/plugins/scayt/LICENSE.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
Software License Agreement
|
||||
==========================
|
||||
|
||||
**CKEditor SCAYT Plugin**
|
||||
Copyright © 2012, [CKSource](http://cksource.com) - Frederico Knabben. All rights reserved.
|
||||
|
||||
Licensed under the terms of any of the following licenses at your choice:
|
||||
|
||||
* GNU General Public License Version 2 or later (the "GPL"):
|
||||
http://www.gnu.org/licenses/gpl.html
|
||||
|
||||
* GNU Lesser General Public License Version 2.1 or later (the "LGPL"):
|
||||
http://www.gnu.org/licenses/lgpl.html
|
||||
|
||||
* Mozilla Public License Version 1.1 or later (the "MPL"):
|
||||
http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
|
||||
You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "legal.txt" in your version of this software, indicating your license choice.
|
||||
|
||||
Sources of Intellectual Property Included in this plugin
|
||||
--------------------------------------------------------
|
||||
|
||||
Where not otherwise indicated, all plugin content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, the plugin will incorporate work done by developers outside of CKSource with their express permission.
|
||||
|
||||
Trademarks
|
||||
----------
|
||||
|
||||
CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
|
25
gen/ui/ckeditor/plugins/scayt/README.md
Normal file
25
gen/ui/ckeditor/plugins/scayt/README.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
CKEditor SCAYT Plugin
|
||||
=====================
|
||||
|
||||
This plugin brings Spell Check As You Type (SCAYT) into up to CKEditor 4+.
|
||||
|
||||
SCAYT is a "installation-less", using the web-services of [WebSpellChecker.net](http://www.webspellchecker.net/). It's an out of the box solution.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
1. Clone/copy this repository contents in a new "plugins/scayt" folder in your CKEditor installation.
|
||||
2. Enable the "scayt" plugin in the CKEditor configuration file (config.js):
|
||||
|
||||
config.extraPlugins = 'scayt';
|
||||
|
||||
That's all. SCAYT will appear on the editor toolbar and will be ready to use.
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Licensed under the terms of any of the following licenses at your choice: [GPL](http://www.gnu.org/licenses/gpl.html), [LGPL](http://www.gnu.org/licenses/lgpl.html) and [MPL](http://www.mozilla.org/MPL/MPL-1.1.html).
|
||||
|
||||
See LICENSE.md for more information.
|
||||
|
||||
Developed in cooperation with [WebSpellChecker.net](http://www.webspellchecker.net/).
|
17
gen/ui/ckeditor/plugins/scayt/dialogs/options.js
Normal file
17
gen/ui/ckeditor/plugins/scayt/dialogs/options.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
CKEDITOR.dialog.add("scaytDialog",function(f){var g=f.scayt,k='<p><img src="'+g.getLogo()+'" /></p><p>'+g.getLocal("version")+g.getVersion()+"</p><p>"+g.getLocal("text_copyrights")+"</p>",l=CKEDITOR.document,i={isChanged:function(){return null===this.newLang||this.currentLang===this.newLang?!1:!0},currentLang:g.getLang(),newLang:null,reset:function(){this.currentLang=g.getLang();this.newLang=null},id:"lang"},k=[{id:"options",label:g.getLocal("tab_options"),onShow:function(){},elements:[{type:"vbox",
|
||||
id:"scaytOptions",children:function(){var a=g.getApplicationConfig(),e=[],b={"ignore-all-caps-words":"label_allCaps","ignore-domain-names":"label_ignoreDomainNames","ignore-words-with-mixed-cases":"label_mixedCase","ignore-words-with-numbers":"label_mixedWithDigits"},d;for(d in a){var c={type:"checkbox"};c.id=d;c.label=g.getLocal(b[d]);e.push(c)}return e}(),onShow:function(){this.getChild();for(var a=f.scayt,e=0;e<this.getChild().length;e++)this.getChild()[e].setValue(a.getApplicationConfig()[this.getChild()[e].id])}}]},
|
||||
{id:"langs",label:g.getLocal("tab_languages"),elements:[{id:"leftLangColumn",type:"vbox",align:"left",widths:["100"],children:[{type:"html",id:"langBox",style:"overflow: hidden; white-space: normal;",html:'<form><div style="float:left;width:45%;margin-left:5px;" id="left-col-'+f.name+'"></div><div style="float:left;width:45%;margin-left:15px;" id="right-col-'+f.name+'"></div></form>',onShow:function(){var a=f.scayt.getLang();l.getById("scaytLang_"+a).$.checked=!0}}]}]},{id:"dictionaries",label:g.getLocal("tab_dictionaries"),
|
||||
elements:[{type:"vbox",id:"rightCol_col__left",children:[{type:"html",id:"dictionaryNote",html:""},{type:"text",id:"dictionaryName",label:g.getLocal("label_fieldNameDic")||"Dictionary name",onShow:function(a){var e=a.sender,b=f.scayt;setTimeout(function(){e.getContentElement("dictionaries","dictionaryNote").getElement().setText("");null!=b.getUserDictionaryName()&&""!=b.getUserDictionaryName()&&e.getContentElement("dictionaries","dictionaryName").setValue(b.getUserDictionaryName())},0)}},{type:"hbox",
|
||||
id:"notExistDic",align:"left",style:"width:auto;",widths:["50%","50%"],children:[{type:"button",id:"createDic",label:g.getLocal("btn_createDic"),title:g.getLocal("btn_createDic"),onClick:function(){var a=this.getDialog(),e=j,b=f.scayt,d=a.getContentElement("dictionaries","dictionaryName").getValue();b.createUserDictionary(d,function(c){c.error||e.toggleDictionaryButtons.call(a,!0);c.dialog=a;c.command="create";c.name=d;f.fire("scaytUserDictionaryAction",c)},function(c){c.dialog=a;c.command="create";
|
||||
c.name=d;f.fire("scaytUserDictionaryActionError",c)})}},{type:"button",id:"restoreDic",label:g.getLocal("btn_restoreDic"),title:g.getLocal("btn_restoreDic"),onClick:function(){var a=this.getDialog(),e=f.scayt,b=j,d=a.getContentElement("dictionaries","dictionaryName").getValue();e.restoreUserDictionary(d,function(c){c.dialog=a;c.error||b.toggleDictionaryButtons.call(a,!0);c.command="restore";c.name=d;f.fire("scaytUserDictionaryAction",c)},function(c){c.dialog=a;c.command="restore";c.name=d;f.fire("scaytUserDictionaryActionError",
|
||||
c)})}}]},{type:"hbox",id:"existDic",align:"left",style:"width:auto;",widths:["50%","50%"],children:[{type:"button",id:"removeDic",label:g.getLocal("btn_deleteDic"),title:g.getLocal("btn_deleteDic"),onClick:function(){var a=this.getDialog(),e=f.scayt,b=j,d=a.getContentElement("dictionaries","dictionaryName"),c=d.getValue();e.removeUserDictionary(c,function(e){d.setValue("");e.error||b.toggleDictionaryButtons.call(a,!1);e.dialog=a;e.command="remove";e.name=c;f.fire("scaytUserDictionaryAction",e)},function(b){b.dialog=
|
||||
a;b.command="remove";b.name=c;f.fire("scaytUserDictionaryActionError",b)})}},{type:"button",id:"renameDic",label:g.getLocal("btn_renameDic"),title:g.getLocal("btn_renameDic"),onClick:function(){var a=this.getDialog(),e=f.scayt,b=a.getContentElement("dictionaries","dictionaryName").getValue();e.renameUserDictionary(b,function(d){d.dialog=a;d.command="rename";d.name=b;f.fire("scaytUserDictionaryAction",d)},function(d){d.dialog=a;d.command="rename";d.name=b;f.fire("scaytUserDictionaryActionError",d)})}}]},
|
||||
{type:"html",id:"dicInfo",html:'<div id="dic_info_editor1" style="margin:5px auto; width:95%;white-space:normal;">'+g.getLocal("text_descriptionDic")+"</div>"}]}]},{id:"about",label:g.getLocal("tab_about"),elements:[{type:"html",id:"about",style:"margin: 5px 5px;",html:'<div><div id="scayt_about_">'+k+"</div></div>"}]}];f.on("scaytUserDictionaryAction",function(a){var e=a.data.dialog,b=e.getContentElement("dictionaries","dictionaryNote").getElement(),d=a.editor.scayt,c;void 0===a.data.error?(c=d.getLocal("message_success_"+
|
||||
a.data.command+"Dic"),c=c.replace("%s",a.data.name),b.setText(c),SCAYT.$(b.$).css({color:"blue"})):(""===a.data.name?b.setText(d.getLocal("message_info_emptyDic")):(c=d.getLocal("message_error_"+a.data.command+"Dic"),c=c.replace("%s",a.data.name),b.setText(c)),SCAYT.$(b.$).css({color:"red"}),null!=d.getUserDictionaryName()&&""!=d.getUserDictionaryName()?e.getContentElement("dictionaries","dictionaryName").setValue(d.getUserDictionaryName()):e.getContentElement("dictionaries","dictionaryName").setValue(""))});
|
||||
f.on("scaytUserDictionaryActionError",function(a){var e=a.data.dialog,b=e.getContentElement("dictionaries","dictionaryNote").getElement(),d=a.editor.scayt,c;""===a.data.name?b.setText(d.getLocal("message_info_emptyDic")):(c=d.getLocal("message_error_"+a.data.command+"Dic"),c=c.replace("%s",a.data.name),b.setText(c));SCAYT.$(b.$).css({color:"red"});null!=d.getUserDictionaryName()&&""!=d.getUserDictionaryName()?e.getContentElement("dictionaries","dictionaryName").setValue(d.getUserDictionaryName()):
|
||||
e.getContentElement("dictionaries","dictionaryName").setValue("")});var j={title:g.getLocal("text_title"),resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:340,minHeight:260,onLoad:function(){if(0!=f.config.scayt_uiTabs[1]){var a=j,e=a.getLangBoxes.call(this);e.getParent().setStyle("white-space","normal");a.renderLangList(e);this.definition.minWidth=this.getSize().width;this.resize(this.definition.minWidth,this.definition.minHeight)}},onCancel:function(){i.reset()},onHide:function(){f.unlockSelection()},
|
||||
onShow:function(){f.fire("scaytDialogShown",this);if(0!=f.config.scayt_uiTabs[2]){var a=f.scayt,e=this.getContentElement("dictionaries","dictionaryName"),b=this.getContentElement("dictionaries","existDic").getElement().getParent(),d=this.getContentElement("dictionaries","notExistDic").getElement().getParent();b.hide();d.hide();null!=a.getUserDictionaryName()&&""!=a.getUserDictionaryName()?(this.getContentElement("dictionaries","dictionaryName").setValue(a.getUserDictionaryName()),b.show()):(e.setValue(""),
|
||||
d.show())}},onOk:function(){var a=j,e=f.scayt;this.getContentElement("options","scaytOptions");a=a.getChangedOption.call(this);e.commitOption({changedOptions:a})},toggleDictionaryButtons:function(a){var e=this.getContentElement("dictionaries","existDic").getElement().getParent(),b=this.getContentElement("dictionaries","notExistDic").getElement().getParent();a?(e.show(),b.hide()):(e.hide(),b.show())},getChangedOption:function(){var a={};if(1==f.config.scayt_uiTabs[0])for(var e=this.getContentElement("options",
|
||||
"scaytOptions").getChild(),b=0;b<e.length;b++)e[b].isChanged()&&(a[e[b].id]=e[b].getValue());i.isChanged()&&(a[i.id]=f.config.scayt_sLang=i.currentLang=i.newLang);return a},buildRadioInputs:function(a,e){var b=new CKEDITOR.dom.element("div");CKEDITOR.document.createElement("div");var d="scaytLang_"+e,c=CKEDITOR.dom.element.createFromHtml('<input id="'+d+'" type="radio" value="'+e+'" name="scayt_lang" />'),g=new CKEDITOR.dom.element("label"),h=f.scayt;b.setStyles({"white-space":"normal",position:"relative"});
|
||||
c.on("click",function(a){i.newLang=a.sender.getValue()});g.appendText(a);g.setAttribute("for",d);b.append(c);b.append(g);e===h.getLang()&&(c.setAttribute("checked",!0),c.setAttribute("defaultChecked","defaultChecked"));return b},renderLangList:function(a){var e=a.find("#left-col-"+f.name).getItem(0),a=a.find("#right-col-"+f.name).getItem(0),b=g.getLangList(),d={},c=[],i=0,h;for(h in b.ltr)d[h]=b.ltr[h];for(h in b.rtl)d[h]=b.rtl[h];for(h in d)c.push([h,d[h]]);c.sort(function(a,b){var c=0;a[1]>b[1]?
|
||||
c=1:a[1]<b[1]&&(c=-1);return c});d={};for(b=0;b<c.length;b++)d[c[b][0]]=c[b][1];c=Math.round(c.length/2);for(h in d)i++,this.buildRadioInputs(d[h],h).appendTo(i<=c?e:a)},getLangBoxes:function(){return this.getContentElement("langs","langBox").getElement()},contents:function(a,e){var b=[],d=e.config.scayt_uiTabs;if(d){for(var c in d)1==d[c]&&b.push(a[c]);b.push(a[a.length-1])}else return a;return b}(k,f)};return j});
|
71
gen/ui/ckeditor/plugins/scayt/dialogs/toolbar.css
Normal file
71
gen/ui/ckeditor/plugins/scayt/dialogs/toolbar.css
Normal file
|
@ -0,0 +1,71 @@
|
|||
a
|
||||
{
|
||||
text-decoration:none;
|
||||
padding: 2px 4px 4px 6px;
|
||||
display : block;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
margin : 0px;
|
||||
}
|
||||
|
||||
a.cke_scayt_toogle:hover,
|
||||
a.cke_scayt_toogle:focus,
|
||||
a.cke_scayt_toogle:active
|
||||
{
|
||||
border-color: #316ac5;
|
||||
background-color: #dff1ff;
|
||||
color : #000;
|
||||
cursor: pointer;
|
||||
margin : 0px;
|
||||
}
|
||||
a.cke_scayt_toogle {
|
||||
color : #316ac5;
|
||||
border-color: #fff;
|
||||
}
|
||||
.scayt_enabled a.cke_scayt_item {
|
||||
color : #316ac5;
|
||||
border-color: #fff;
|
||||
margin : 0px;
|
||||
}
|
||||
.scayt_disabled a.cke_scayt_item {
|
||||
color : gray;
|
||||
border-color : #fff;
|
||||
}
|
||||
.scayt_enabled a.cke_scayt_item:hover,
|
||||
.scayt_enabled a.cke_scayt_item:focus,
|
||||
.scayt_enabled a.cke_scayt_item:active
|
||||
{
|
||||
border-color: #316ac5;
|
||||
background-color: #dff1ff;
|
||||
color : #000;
|
||||
cursor: pointer;
|
||||
}
|
||||
.scayt_disabled a.cke_scayt_item:hover,
|
||||
.scayt_disabled a.cke_scayt_item:focus,
|
||||
.scayt_disabled a.cke_scayt_item:active
|
||||
{
|
||||
border-color: gray;
|
||||
background-color: #dff1ff;
|
||||
color : gray;
|
||||
cursor: no-drop;
|
||||
}
|
||||
.cke_scayt_set_on, .cke_scayt_set_off
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
.scayt_enabled .cke_scayt_set_on
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
.scayt_disabled .cke_scayt_set_on
|
||||
{
|
||||
display: inline;
|
||||
}
|
||||
.scayt_disabled .cke_scayt_set_off
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
.scayt_enabled .cke_scayt_set_off
|
||||
{
|
||||
display: inline;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue