Skip to content
Snippets Groups Projects
Commit a64bab9e authored by juanf's avatar juanf
Browse files

SSDM-5540 : Autocorrect

SVN: 38833
parent c5521c08
No related branches found
No related tags found
No related merge requests found
Showing
with 1321 additions and 1 deletion
......@@ -10,7 +10,7 @@ CKEDITOR.editorConfig = function( config ) {
config.specialChars = config.specialChars.concat( ['α', 'β', 'γ', 'δ',
'ε', 'ζ', 'η', 'θ', 'κ', 'λ', 'μ', 'ξ', 'π', 'ρ', 'σ',
'υ', 'φ', 'ψ', 'ω', 'Δ', 'Σ', 'Φ', 'Ω'] );
config.extraPlugins = 'confighelper,colordialog,dialogadvtab,table,tabletools,tableresize';
config.extraPlugins = 'confighelper,colordialog,dialogadvtab,table,tabletools,tableresize,autocorrect';
config.stylesSet = false;
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
......
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
( function() {
var plugin = CKEDITOR.plugins.autocorrect;
function setupOption() {
this.setValue(plugin.getOption(this.option));
}
function commitOption() {
plugin.setOption(this.option, this.getValue());
}
CKEDITOR.dialog.add( 'autocorrectOptions', function( editor ) {
var lang = editor.lang.autocorrect;
return {
title: lang.autocorrect,
resizable: CKEDITOR.DIALOG_RESIZE_NONE,
minWidth: 350,
minHeight: 170,
onOk: function() {
this.commitContent();
},
contents: [
{
id: 'autocorrect',
label: lang.autocorrect,
title: lang.autocorrect,
accessKey: '',
elements: [
{
type: 'vbox',
padding: 0,
children: [
{
type: 'checkbox',
id: 'useReplacementTableCheckbox',
option: 'useReplacementTable',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.replaceTextAsYouType
},
{
type: 'html',
html: '<div style="height: 150px;overflow-y: scroll;border: 1px solid #afafaf"></div>',
setup: function() {
this.getElement().setHtml('');
var option = plugin.getOption('replacementTable');
var table = document.createElement('table');
table.style.width = '100%';
table.style.tableLayout = 'fixed';
var tbody = table.appendChild(document.createElement('tbody'));
for (var prop in option) {
var row = document.createElement('tr');
var cell1 = document.createElement('td');
cell1.appendChild(document.createTextNode(prop));
cell1.style.borderBottom = '1px solid #afafaf';
cell1.style.padding = '0 5px';
var cell2 = document.createElement('td');
row.appendChild(cell1);
cell2.appendChild(document.createTextNode(option[prop]));
cell2.style.borderBottom = '1px solid #afafaf';
cell2.style.padding = '0 5px';
row.appendChild(cell2);
tbody.appendChild(row);
}
this.getElement().append(new CKEDITOR.dom.element(table));
}
}]
}
]
},
{
id: 'autoformatAsYouType',
label: lang.autoformatAsYouType,
title: lang.autoformatAsYouType,
accessKey: '',
elements: [
{
type: 'fieldset',
label: CKEDITOR.tools.htmlEncode( lang.replaceAsYouType ),
children: [
{
type: 'vbox',
padding: 0,
children: [
{
type: 'checkbox',
id: 'smartQuotesCheckbox',
option: 'smartQuotesAsYouType',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.smartQuotesOption
},
{
type: 'checkbox',
id: 'formatOrdinalsCheckbox',
option: 'formatOrdinalsAsYouType',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.formatOrdinalsOption
},
{
type: 'checkbox',
id: 'replaceHyphensCheckbox',
option: 'replaceHyphensAsYouType',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.replaceHyphensOption
},
{
type: 'checkbox',
id: 'recognizeUrlsCheckbox',
option: 'recognizeUrlsAsYouType',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.recognizeUrlsOption
}
]
}
]
},
{
type: 'fieldset',
label: CKEDITOR.tools.htmlEncode( lang.applyAsYouType ),
children: [
{
type: 'vbox',
padding: 0,
children: [
{
type: 'checkbox',
id: 'formatBulletedListsCheckbox',
option: 'formatBulletedListsAsYouType',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.formatBulletedListsOption
},
{
type: 'checkbox',
id: 'formatNumberedListsCheckbox',
option: 'formatNumberedListsAsYouType',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.formatNumberedListsOption
},
{
type: 'checkbox',
id: 'createHorizontalRulesCheckbox',
option: 'createHorizontalRulesAsYouType',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.createHorizontalRulesOption
}
]
}
]
}
]
},
{
id: 'replace',
label: lang.autoformat,
accessKey: '',
elements: [
{
type: 'fieldset',
label: CKEDITOR.tools.htmlEncode( lang.replace ),
children: [
{
type: 'vbox',
padding: 0,
children: [
{
type: 'checkbox',
id: 'smartQuotesCheckbox',
option: 'smartQuotes',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.smartQuotesOption
},
{
type: 'checkbox',
id: 'formatOrdinalsCheckbox',
option: 'formatOrdinals',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.formatOrdinalsOption
},
{
type: 'checkbox',
id: 'replaceHyphensCheckbox',
option: 'replaceHyphens',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.replaceHyphensOption
},
{
type: 'checkbox',
id: 'recognizeUrlsCheckbox',
option: 'recognizeUrls',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.recognizeUrlsOption
}
]
}
]
},
{
type: 'fieldset',
label: CKEDITOR.tools.htmlEncode( lang.apply ),
children: [
{
type: 'vbox',
padding: 0,
children: [
{
type: 'checkbox',
id: 'formatBulletedListsCheckbox',
option: 'formatBulletedLists',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.formatBulletedListsOption
},
{
type: 'checkbox',
id: 'formatNumberedListsCheckbox',
option: 'formatNumberedLists',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.formatNumberedListsOption
},
{
type: 'checkbox',
id: 'createHorizontalRulesCheckbox',
option: 'createHorizontalRules',
setup: setupOption,
commit: commitOption,
isChanged: false,
label: lang.createHorizontalRulesOption
}
]
}
]
}
]
}
],
onShow: function() {
this.setupContent();
}
};
} );
} )();
CKEDITOR.plugins.setLang( 'autocorrect', 'en', {
toolbar: 'AutoCorrect',
autocorrect: 'AutoCorrect',
disable: 'Disable AutoCorrect',
enable: 'Enable AutoCorrect',
autocorrectNow: 'AutoCorrect Now',
options: 'AutoCorrect Options',
autoformat: 'AutoFormat',
autoformatAsYouType: 'AutoFormat As You Type',
replaceTextAsYouType: 'Replace text as you type',
replaceAsYouType: 'Replace as you type',
applyAsYouType: 'Apply as you type',
apply: 'Apply',
replace: 'Replace',
smartQuotesOption: '"Straight quotes" with “smart quotes”',
formatOrdinalsOption: 'Ordinals (1st) with superscript',
replaceHyphensOption: 'Hyphens (--) with dash(—)',
recognizeUrlsOption: 'Internet and network paths with hyperlinks',
formatBulletedListsOption: 'Automatic bulleted lists',
formatNumberedListsOption: 'Automatic numbered lists',
createHorizontalRulesOption: 'Horizontal rules',
replaceFractionsOption: 'Fractions (1/2) with fraction character (½)'
});
CKEDITOR.plugins.setLang( 'autocorrect', 'ru', {
toolbar: 'Автозамена',
autocorrect: 'Автозамена',
disable: 'Отключить автозамену',
enable: 'Включить автозамену',
autocorrectNow: 'Произвести автозамену',
options: 'Параметры автозамены',
autoformat: 'Автоформат',
autoformatAsYouType: 'Автоформат при вводе',
replaceTextAsYouType: 'Заменять текст при вводе',
replaceAsYouType: 'Заменять при вводе',
applyAsYouType: 'Применять при вводе',
apply: 'Применять',
replace: 'Заменять',
smartQuotesOption: '"Прямые" кавычки «парными»',
formatOrdinalsOption: 'Английские порядковые (1st) надстрочными знаками',
replaceHyphensOption: 'Дефисы (--) на тире (—)',
recognizeUrlsOption: 'Адреса Интернета и сетевые пути гиперссылками',
formatBulletedListsOption: 'Стили маркированных списков',
formatNumberedListsOption: 'Стили нумерованных списков',
createHorizontalRulesOption: 'Горизонтальные линии'
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment