ckeditor/plugins/autocorrect/dialogs/options.js
author indvd00m (gotoindvdum[at]gmail[dot]com)
Thu, 15 Dec 2016 18:10:20 +0300
changeset 0 44d330dccc59
permissions -rw-r--r--
Init sample
indvd00m@0
     1
/*
indvd00m@0
     2
 Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
indvd00m@0
     3
 For licensing, see LICENSE.md or http://ckeditor.com/license
indvd00m@0
     4
*/
indvd00m@0
     5
(function(){function b(){this.setValue(f.getOption(this.option))}function c(){f.setOption(this.option,this.getValue())}var f=CKEDITOR.plugins.autocorrect;CKEDITOR.dialog.add("autocorrectOptions",function(a){a=a.lang.autocorrect;return{title:a.autocorrect,resizable:CKEDITOR.DIALOG_RESIZE_NONE,minWidth:350,minHeight:170,onOk:function(){this.commitContent()},contents:[{id:"autocorrect",label:a.autocorrect,title:a.autocorrect,accessKey:"",elements:[{type:"vbox",padding:0,children:[{type:"checkbox",id:"useReplacementTableCheckbox",
indvd00m@0
     6
option:"useReplacementTable",setup:b,commit:c,isChanged:!1,label:a.replaceTextAsYouType},{type:"html",html:'<div style="height: 150px;overflow-y: scroll;border: 1px solid #afafaf"></div>',setup:function(){this.getElement().setHtml("");var a=f.getOption("replacementTable"),b=document.createElement("table");b.style.width="100%";b.style.tableLayout="fixed";var c=b.appendChild(document.createElement("tbody")),g;for(g in a){var h=document.createElement("tr"),d=document.createElement("td");d.appendChild(document.createTextNode(g));
indvd00m@0
     7
d.style.borderBottom="1px solid #afafaf";d.style.padding="0 5px";var e=document.createElement("td");h.appendChild(d);e.appendChild(document.createTextNode(a[g]));e.style.borderBottom="1px solid #afafaf";e.style.padding="0 5px";h.appendChild(e);c.appendChild(h)}this.getElement().append(new CKEDITOR.dom.element(b))}}]}]},{id:"autoformatAsYouType",label:a.autoformatAsYouType,title:a.autoformatAsYouType,accessKey:"",elements:[{type:"fieldset",label:CKEDITOR.tools.htmlEncode(a.replaceAsYouType),children:[{type:"vbox",
indvd00m@0
     8
padding:0,children:[{type:"checkbox",id:"smartQuotesCheckbox",option:"smartQuotesAsYouType",setup:b,commit:c,isChanged:!1,label:a.smartQuotesOption},{type:"checkbox",id:"formatOrdinalsCheckbox",option:"formatOrdinalsAsYouType",setup:b,commit:c,isChanged:!1,label:a.formatOrdinalsOption},{type:"checkbox",id:"replaceHyphensCheckbox",option:"replaceHyphensAsYouType",setup:b,commit:c,isChanged:!1,label:a.replaceHyphensOption},{type:"checkbox",id:"recognizeUrlsCheckbox",option:"recognizeUrlsAsYouType",
indvd00m@0
     9
setup:b,commit:c,isChanged:!1,label:a.recognizeUrlsOption}]}]},{type:"fieldset",label:CKEDITOR.tools.htmlEncode(a.applyAsYouType),children:[{type:"vbox",padding:0,children:[{type:"checkbox",id:"formatBulletedListsCheckbox",option:"formatBulletedListsAsYouType",setup:b,commit:c,isChanged:!1,label:a.formatBulletedListsOption},{type:"checkbox",id:"formatNumberedListsCheckbox",option:"formatNumberedListsAsYouType",setup:b,commit:c,isChanged:!1,label:a.formatNumberedListsOption},{type:"checkbox",id:"createHorizontalRulesCheckbox",
indvd00m@0
    10
option:"createHorizontalRulesAsYouType",setup:b,commit:c,isChanged:!1,label:a.createHorizontalRulesOption}]}]}]},{id:"replace",label:a.autoformat,accessKey:"",elements:[{type:"fieldset",label:CKEDITOR.tools.htmlEncode(a.replace),children:[{type:"vbox",padding:0,children:[{type:"checkbox",id:"smartQuotesCheckbox",option:"smartQuotes",setup:b,commit:c,isChanged:!1,label:a.smartQuotesOption},{type:"checkbox",id:"formatOrdinalsCheckbox",option:"formatOrdinals",setup:b,commit:c,isChanged:!1,label:a.formatOrdinalsOption},
indvd00m@0
    11
{type:"checkbox",id:"replaceHyphensCheckbox",option:"replaceHyphens",setup:b,commit:c,isChanged:!1,label:a.replaceHyphensOption},{type:"checkbox",id:"recognizeUrlsCheckbox",option:"recognizeUrls",setup:b,commit:c,isChanged:!1,label:a.recognizeUrlsOption}]}]},{type:"fieldset",label:CKEDITOR.tools.htmlEncode(a.apply),children:[{type:"vbox",padding:0,children:[{type:"checkbox",id:"formatBulletedListsCheckbox",option:"formatBulletedLists",setup:b,commit:c,isChanged:!1,label:a.formatBulletedListsOption},
indvd00m@0
    12
{type:"checkbox",id:"formatNumberedListsCheckbox",option:"formatNumberedLists",setup:b,commit:c,isChanged:!1,label:a.formatNumberedListsOption},{type:"checkbox",id:"createHorizontalRulesCheckbox",option:"createHorizontalRules",setup:b,commit:c,isChanged:!1,label:a.createHorizontalRulesOption}]}]}]}],onShow:function(){this.setupContent()}}})})();