glebtv-ckeditor 4.3.2.6 → 4.4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ckeditor/application_controller.rb +5 -1
- data/lib/ckeditor/version.rb +2 -1
- data/lib/glebtv-ckeditor.rb +0 -0
- data/vendor/assets/javascripts/ckeditor/build-config.js +14 -68
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +737 -713
- data/vendor/assets/javascripts/ckeditor/config.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/en.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/autocomplete.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/commentselectedrange.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/searchcode.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/uncommentselectedrange.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcode.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +125 -35
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-day.css +34 -34
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-night.css +34 -34
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +5 -5
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +74 -75
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-dark.css +34 -34
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-light.css +34 -34
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +27 -27
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +21 -21
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +23 -23
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/elegant.css +13 -13
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +30 -30
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +43 -47
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mbo.css +37 -37
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mdn-like.css +44 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +43 -43
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +29 -29
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/neat.css +12 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/neo.css +40 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +24 -24
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-dark.css +34 -34
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-light.css +34 -34
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +48 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +21 -23
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +167 -180
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +26 -26
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-eighties.css +34 -34
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +28 -28
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +30 -30
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +48 -48
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +42 -42
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +8 -8
- data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +7 -7
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +27 -27
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +3 -4
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +22 -33
- data/vendor/assets/javascripts/ckeditor/plugins/preview/preview.html +8 -5
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/README.md +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +17 -20
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +163 -152
- data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +13 -12
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +5 -5
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +44 -36
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +65 -58
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc_ie.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/en.js +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +364 -362
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css.scss +16 -13
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css.scss +16 -13
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css.scss +16 -13
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css.scss +16 -13
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css.scss +16 -13
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css.scss +23 -15
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css.scss +23 -15
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css.scss +23 -15
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css.scss +23 -15
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css.scss +23 -15
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css.scss +23 -15
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
- metadata +12 -11
- data/vendor/assets/javascripts/ckeditor/CHANGES.md +0 -414
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/AutoComplete.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/AutoFormat.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/CommentSelectedRange.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/SearchCode.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/UncommentSelectedRange.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/fakeobjects/images/spacer.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmp.html +0 -118
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_opera.css.scss +0 -781
@@ -2,15 +2,16 @@
|
|
2
2
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
3
3
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
4
4
|
*/
|
5
|
-
CKEDITOR.dialog.add("cellProperties",function(
|
6
|
-
children:[{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"width",width:"100px",label:
|
7
|
-
commit:function(a){var b=parseInt(this.getValue(),10),c=this.getDialog().getValueOf("info","widthType");isNaN(b)?a.removeStyle("width"):a.setStyle("width",b+c);a.removeAttribute("width")},"default":""},{type:"select",id:"widthType",
|
8
|
-
id:"height",label:
|
9
|
-
10);isNaN(b)?a.removeStyle("height"):a.setStyle("height",CKEDITOR.tools.cssLength(b));a.removeAttribute("height")}},{id:"htmlHeightType",type:"html",html:"<br />"+
|
10
|
-
|
11
|
-
"bottom"],[c.alignBaseline,"baseline"]],setup:function(a){var b=a.getAttribute("vAlign"),a=a.getStyle("vertical-align");switch(a){case "top":case "middle":case "bottom":case "baseline":break;default:a=""}
|
12
|
-
setup:function(a){
|
13
|
-
setup:function(a){(a=parseInt(a.getAttribute("colSpan"),10))&&1!=a
|
14
|
-
a.removeStyle("background-color");a.removeAttribute("bgColor")}},
|
15
|
-
a.getAttribute("borderColor");
|
16
|
-
"borderColor").setValue(a);this.focus()},this)}}:
|
5
|
+
CKEDITOR.dialog.add("cellProperties",function(g){function d(a){return function(b){for(var c=a(b[0]),d=1;d<b.length;d++)if(a(b[d])!==c){c=null;break}"undefined"!=typeof c&&(this.setValue(c),CKEDITOR.env.gecko&&("select"==this.type&&!c)&&(this.getInputElement().$.selectedIndex=-1))}}function j(a){if(a=l.exec(a.getStyle("width")||a.getAttribute("width")))return a[2]}var h=g.lang.table,c=h.cell,e=g.lang.common,i=CKEDITOR.dialog.validate,l=/^(\d+(?:\.\d+)?)(px|%)$/,f={type:"html",html:" "},m="rtl"==
|
6
|
+
g.lang.dir,k=g.plugins.colordialog;return{title:c.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?450:410,minHeight:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?230:220,contents:[{id:"info",label:c.title,accessKey:"I",elements:[{type:"hbox",widths:["40%","5%","40%"],children:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"width",width:"100px",label:e.width,validate:i.number(c.invalidWidth),onLoad:function(){var a=this.getDialog().getContentElement("info",
|
7
|
+
"widthType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("width"),10),a=parseInt(a.getStyle("width"),10);return!isNaN(a)?a:!isNaN(b)?b:""}),commit:function(a){var b=parseInt(this.getValue(),10),c=this.getDialog().getValueOf("info","widthType")||j(a);isNaN(b)?a.removeStyle("width"):a.setStyle("width",b+c);a.removeAttribute("width")},"default":""},{type:"select",id:"widthType",
|
8
|
+
label:g.lang.table.widthUnit,labelStyle:"visibility:hidden","default":"px",items:[[h.widthPx,"px"],[h.widthPc,"%"]],setup:d(j)}]},{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"height",label:e.height,width:"100px","default":"",validate:i.number(c.invalidHeight),onLoad:function(){var a=this.getDialog().getContentElement("info","htmlHeightType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=
|
9
|
+
parseInt(a.getAttribute("height"),10),a=parseInt(a.getStyle("height"),10);return!isNaN(a)?a:!isNaN(b)?b:""}),commit:function(a){var b=parseInt(this.getValue(),10);isNaN(b)?a.removeStyle("height"):a.setStyle("height",CKEDITOR.tools.cssLength(b));a.removeAttribute("height")}},{id:"htmlHeightType",type:"html",html:"<br />"+h.widthPx}]},f,{type:"select",id:"wordWrap",label:c.wordWrap,"default":"yes",items:[[c.yes,"yes"],[c.no,"no"]],setup:d(function(a){var b=a.getAttribute("noWrap");if("nowrap"==a.getStyle("white-space")||
|
10
|
+
b)return"no"}),commit:function(a){"no"==this.getValue()?a.setStyle("white-space","nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},f,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[e.notSet,""],[e.alignLeft,"left"],[e.alignCenter,"center"],[e.alignRight,"right"],[e.alignJustify,"justify"]],setup:d(function(a){var b=a.getAttribute("align");return a.getStyle("text-align")||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("text-align",b):a.removeStyle("text-align");
|
11
|
+
a.removeAttribute("align")}},{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[e.notSet,""],[e.alignTop,"top"],[e.alignMiddle,"middle"],[e.alignBottom,"bottom"],[c.alignBaseline,"baseline"]],setup:d(function(a){var b=a.getAttribute("vAlign"),a=a.getStyle("vertical-align");switch(a){case "top":case "middle":case "bottom":case "baseline":break;default:a=""}return a||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("vertical-align",b):a.removeStyle("vertical-align");a.removeAttribute("vAlign")}}]},
|
12
|
+
f,{type:"vbox",padding:0,children:[{type:"select",id:"cellType",label:c.cellType,"default":"td",items:[[c.data,"td"],[c.header,"th"]],setup:d(function(a){return a.getName()}),commit:function(a){a.renameNode(this.getValue())}},f,{type:"text",id:"rowSpan",label:c.rowSpan,"default":"",validate:i.integer(c.invalidRowSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("rowSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("rowSpan",this.getValue()):
|
13
|
+
a.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",label:c.colSpan,"default":"",validate:i.integer(c.invalidColSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("colSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("colSpan",this.getValue()):a.removeAttribute("colSpan")}},f,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"bgColor",label:c.bgColor,"default":"",setup:d(function(a){var b=a.getAttribute("bgColor");
|
14
|
+
return a.getStyle("background-color")||b}),commit:function(a){this.getValue()?a.setStyle("background-color",this.getValue()):a.removeStyle("background-color");a.removeAttribute("bgColor")}},k?{type:"button",id:"bgColorChoose","class":"colorChooser",label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","bgColor").setValue(a);this.focus()},this)}}:f]},f,
|
15
|
+
{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",setup:d(function(a){var b=a.getAttribute("borderColor");return a.getStyle("border-color")||b}),commit:function(a){this.getValue()?a.setStyle("border-color",this.getValue()):a.removeStyle("border-color");a.removeAttribute("borderColor")}},k?{type:"button",id:"borderColorChoose","class":"colorChooser",label:c.chooseColor,style:(m?"margin-right":"margin-left")+": 10px",onLoad:function(){this.getElement().getParent().setStyle("vertical-align",
|
16
|
+
"bottom")},onClick:function(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","borderColor").setValue(a);this.focus()},this)}}:f]}]}]}]}],onShow:function(){this.cells=CKEDITOR.plugins.tabletools.getSelectedCells(this._.editor.getSelection());this.setupContent(this.cells)},onOk:function(){for(var a=this._.editor.getSelection(),b=a.createBookmarks(),c=this.cells,d=0;d<c.length;d++)this.commitContent(c[d]);this._.editor.forceNextSelectionCheck();a.selectBookmarks(b);this._.editor.selectionChange()},
|
17
|
+
onLoad:function(){var a={};this.foreach(function(b){b.setup&&b.commit&&(b.setup=CKEDITOR.tools.override(b.setup,function(c){return function(){c.apply(this,arguments);a[b.id]=b.getValue()}}),b.commit=CKEDITOR.tools.override(b.commit,function(c){return function(){a[b.id]!==b.getValue()&&c.apply(this,arguments)}}))})}}});
|
@@ -61,11 +61,11 @@ For licensing, see LICENSE.md or http://ckeditor.com/license
|
|
61
61
|
cursor: pointer;
|
62
62
|
}
|
63
63
|
|
64
|
-
/*
|
65
|
-
the hover style of the link itself contains certain CSS declarations
|
66
|
-
.
|
67
|
-
.
|
68
|
-
.
|
64
|
+
/* IE Quirks contextual selectors children will not get :hover transition until
|
65
|
+
the hover style of the link itself contains certain CSS declarations. */
|
66
|
+
.cke_browser_quirks .cke_tpl_list a:active,
|
67
|
+
.cke_browser_quirks .cke_tpl_list a:hover,
|
68
|
+
.cke_browser_quirks .cke_tpl_list a:focus
|
69
69
|
{
|
70
70
|
background-position: 0 0;
|
71
71
|
}
|
@@ -4,26 +4,27 @@
|
|
4
4
|
*/
|
5
5
|
|
6
6
|
CKEDITOR.plugins.add('wordcount', {
|
7
|
-
lang:
|
8
|
-
version
|
9
|
-
init: function
|
7
|
+
lang: 'ca,de,en,es,fr,it,jp,nl,no,pl,pt-br,ru,sv', // %REMOVE_LINE_CORE%
|
8
|
+
version: 1.10,
|
9
|
+
init: function(editor) {
|
10
10
|
if (editor.elementMode === CKEDITOR.ELEMENT_MODE_INLINE) {
|
11
11
|
return;
|
12
12
|
}
|
13
|
-
|
13
|
+
|
14
14
|
var defaultFormat = '<span class="cke_path_item">',
|
15
15
|
intervalId,
|
16
16
|
lastWordCount,
|
17
|
-
lastCharCount = 0
|
17
|
+
lastCharCount = 0; /*,
|
18
18
|
limitReachedNotified = false,
|
19
|
-
limitRestoredNotified = false
|
19
|
+
limitRestoredNotified = false;*/
|
20
20
|
|
21
21
|
// Default Config
|
22
22
|
var defaultConfig = {
|
23
23
|
showWordCount: true,
|
24
24
|
showCharCount: false,
|
25
|
-
|
26
|
-
|
25
|
+
countSpacesAsChars: false,
|
26
|
+
//charLimit: 'unlimited',
|
27
|
+
//wordLimit: 'unlimited',
|
27
28
|
countHTML: false
|
28
29
|
};
|
29
30
|
|
@@ -35,9 +36,9 @@ CKEDITOR.plugins.add('wordcount', {
|
|
35
36
|
|
36
37
|
defaultFormat += charLabel + ' %charCount%';
|
37
38
|
|
38
|
-
if (config.charLimit != 'unlimited') {
|
39
|
+
/*if (config.charLimit != 'unlimited') {
|
39
40
|
defaultFormat += ' (' + editor.lang.wordcount.limit + ' ' + config.charLimit + ')';
|
40
|
-
}
|
41
|
+
}*/
|
41
42
|
}
|
42
43
|
|
43
44
|
if (config.showCharCount && config.showWordCount) {
|
@@ -47,17 +48,17 @@ CKEDITOR.plugins.add('wordcount', {
|
|
47
48
|
if (config.showWordCount) {
|
48
49
|
defaultFormat += editor.lang.wordcount.WordCount + ' %wordCount%';
|
49
50
|
|
50
|
-
if (config.wordLimit != 'unlimited') {
|
51
|
+
/*if (config.wordLimit != 'unlimited') {
|
51
52
|
defaultFormat += ' (' + editor.lang.wordcount.limit + ' ' + config.wordLimit + ')';
|
52
|
-
}
|
53
|
+
}*/
|
53
54
|
}
|
54
|
-
|
55
|
+
|
55
56
|
defaultFormat += '</span>';
|
56
57
|
|
57
58
|
var format = defaultFormat;
|
58
59
|
|
59
|
-
CKEDITOR.document.appendStyleSheet(
|
60
|
-
|
60
|
+
CKEDITOR.document.appendStyleSheet(this.path + 'css/wordcount.css');
|
61
|
+
|
61
62
|
function counterId(editorInstance) {
|
62
63
|
return 'cke_wordcount_' + editorInstance.name;
|
63
64
|
}
|
@@ -71,7 +72,7 @@ CKEDITOR.plugins.add('wordcount', {
|
|
71
72
|
tmp.innerHTML = html;
|
72
73
|
|
73
74
|
if (tmp.textContent == '' && typeof tmp.innerText == 'undefined') {
|
74
|
-
|
75
|
+
return '';
|
75
76
|
}
|
76
77
|
|
77
78
|
return tmp.textContent || tmp.innerText;
|
@@ -88,7 +89,7 @@ CKEDITOR.plugins.add('wordcount', {
|
|
88
89
|
if (config.countHTML) {
|
89
90
|
charCount = text.length;
|
90
91
|
} else {
|
91
|
-
|
92
|
+
// strip body tags
|
92
93
|
if (editor.config.fullPage) {
|
93
94
|
var i = text.search(new RegExp("<body>", "i"));
|
94
95
|
if (i != -1) {
|
@@ -101,8 +102,12 @@ CKEDITOR.plugins.add('wordcount', {
|
|
101
102
|
normalizedText = text.
|
102
103
|
replace(/(\r\n|\n|\r)/gm, "").
|
103
104
|
replace(/^\s+|\s+$/g, "").
|
104
|
-
replace(" ", "")
|
105
|
-
|
105
|
+
replace(" ", "");
|
106
|
+
|
107
|
+
if (!config.countSpacesAsChars) {
|
108
|
+
normalizedText = text.
|
109
|
+
replace(/\s/g, "");
|
110
|
+
}
|
106
111
|
|
107
112
|
normalizedText = strip(normalizedText).replace(/^([\s\t\r\n]*)$/, "");
|
108
113
|
|
@@ -132,39 +137,42 @@ CKEDITOR.plugins.add('wordcount', {
|
|
132
137
|
|
133
138
|
var html = format.replace('%wordCount%', wordCount).replace('%charCount%', charCount);
|
134
139
|
|
140
|
+
editor.plugins.wordcount.wordCount = wordCount;
|
141
|
+
editor.plugins.wordcount.charCount = charCount;
|
142
|
+
|
135
143
|
counterElement(editorInstance).innerHTML = html;
|
136
144
|
|
137
145
|
if (charCount == lastCharCount) {
|
138
146
|
return true;
|
139
147
|
}
|
140
|
-
|
148
|
+
|
141
149
|
lastWordCount = wordCount;
|
142
150
|
lastCharCount = charCount;
|
143
151
|
|
144
152
|
// Check for word limit
|
145
|
-
if (config.showWordCount && wordCount > config.wordLimit) {
|
153
|
+
/*if (config.showWordCount && wordCount > config.wordLimit) {
|
146
154
|
limitReached(editor, limitReachedNotified);
|
147
155
|
} else if (config.showWordCount && wordCount == config.wordLimit) {
|
148
156
|
// create snapshot to make sure only the content after the limit gets deleted
|
149
157
|
editorInstance.fire('saveSnapshot');
|
150
158
|
} else if (!limitRestoredNotified && wordCount < config.wordLimit) {
|
151
159
|
limitRestored(editor);
|
152
|
-
}
|
160
|
+
}*/
|
153
161
|
|
154
162
|
// Check for char limit
|
155
|
-
if (config.showCharCount && charCount > config.charLimit) {
|
163
|
+
/*if (config.showCharCount && charCount > config.charLimit) {
|
156
164
|
limitReached(editor, limitReachedNotified);
|
157
165
|
} else if (config.showCharCount && charCount == config.charLimit) {
|
158
166
|
// create snapshot to make sure only the content after the limit gets deleted
|
159
167
|
editorInstance.fire('saveSnapshot');
|
160
168
|
} else if (!limitRestoredNotified && charCount < config.charLimit) {
|
161
169
|
limitRestored(editor);
|
162
|
-
}
|
170
|
+
}*/
|
163
171
|
|
164
172
|
return true;
|
165
173
|
}
|
166
174
|
|
167
|
-
function limitReached(editorInstance, notify) {
|
175
|
+
/*function limitReached(editorInstance, notify) {
|
168
176
|
limitReachedNotified = true;
|
169
177
|
limitRestoredNotified = false;
|
170
178
|
|
@@ -187,30 +195,30 @@ CKEDITOR.plugins.add('wordcount', {
|
|
187
195
|
editorInstance.config.Locked = 0;
|
188
196
|
|
189
197
|
counterElement(editorInstance).className = "cke_wordcount";
|
190
|
-
}
|
198
|
+
}*/
|
191
199
|
|
192
|
-
editor.on('key', function
|
200
|
+
editor.on('key', function(event) {
|
193
201
|
if (editor.mode === 'source') {
|
194
202
|
updateCounter(event.editor);
|
195
203
|
}
|
196
204
|
}, editor, null, 100);
|
197
|
-
|
198
|
-
editor.on('change', function
|
205
|
+
|
206
|
+
editor.on('change', function(event) {
|
199
207
|
|
200
208
|
updateCounter(event.editor);
|
201
209
|
}, editor, null, 100);
|
202
|
-
|
203
|
-
|
210
|
+
|
211
|
+
editor.on('uiSpace', function(event) {
|
204
212
|
if (event.data.space == 'bottom') {
|
205
213
|
event.data.html += '<div id="' + counterId(event.editor) + '" class="cke_wordcount" style=""' + ' title="' + editor.lang.wordcount.title + '"' + '> </div>';
|
206
214
|
}
|
207
215
|
}, editor, null, 100);
|
208
216
|
|
209
|
-
editor.on('dataReady', function
|
217
|
+
editor.on('dataReady', function(event) {
|
210
218
|
updateCounter(event.editor);
|
211
219
|
}, editor, null, 100);
|
212
220
|
|
213
|
-
editor.on('afterPaste', function
|
221
|
+
editor.on('afterPaste', function(event) {
|
214
222
|
updateCounter(event.editor);
|
215
223
|
}, editor, null, 100);
|
216
224
|
/*editor.on('focus', function (event) {
|
@@ -219,14 +227,14 @@ CKEDITOR.plugins.add('wordcount', {
|
|
219
227
|
updateCounter(editor);
|
220
228
|
}, 300, event.editor);
|
221
229
|
}, editor, null, 300);*/
|
222
|
-
editor.on('blur', function
|
230
|
+
editor.on('blur', function() {
|
223
231
|
if (intervalId) {
|
224
232
|
window.clearInterval(intervalId);
|
225
233
|
}
|
226
234
|
}, editor, null, 300);
|
227
|
-
|
235
|
+
|
228
236
|
if (!String.prototype.trim) {
|
229
|
-
String.prototype.trim = function
|
237
|
+
String.prototype.trim = function() {
|
230
238
|
return this.replace(/^\s+|\s+$/g, '');
|
231
239
|
};
|
232
240
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
2
|
<!--
|
3
|
-
Copyright (c) 2003-
|
3
|
+
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
4
4
|
For licensing, see LICENSE.html or http://ckeditor.com/license
|
5
5
|
-->
|
6
6
|
<html>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
|
2
2
|
<!--
|
3
|
-
Copyright (c) 2003-
|
3
|
+
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
4
4
|
For licensing, see LICENSE.html or http://ckeditor.com/license
|
5
5
|
-->
|
6
6
|
<html>
|
@@ -1,67 +1,74 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2003-
|
2
|
+
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
3
3
|
For licensing, see LICENSE.html or http://ckeditor.com/license
|
4
4
|
*/
|
5
|
-
(function(){function
|
6
|
-
if("number"==typeof g&&g){var h=new Date;h.setTime(h.getTime()+1E3*g);g=f.expires=h}g&&g.toUTCString&&(f.expires=g.toUTCString());var b=encodeURIComponent(b),a=a+"="+b,e;for(e in f)b=f[e],a+="; "+e,!0!==b&&(a+="="+b);document.cookie=a};return{postMessage:{init:function(a){
|
7
|
-
(a.message.id||(a.message.id=
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
i=
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
b
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
5
|
+
(function(){function y(a){if(!a)throw"Languages-by-groups list are required for construct selectbox";var c=[],d="",f;for(f in a)for(var g in a[f]){var h=a[f][g];"en_US"==h?d=h:c.push(h)}c.sort();d&&c.unshift(d);return{getCurrentLangGroup:function(c){a:{for(var d in a)for(var f in a[d])if(f.toUpperCase()===c.toUpperCase()){c=d;break a}c=""}return c},setLangList:function(){var c={},d;for(d in a)for(var f in a[d])c[a[d][f]]=f;return c}()}}var e=function(){var a=function(a,b,f){var f=f||{},g=f.expires;
|
6
|
+
if("number"==typeof g&&g){var h=new Date;h.setTime(h.getTime()+1E3*g);g=f.expires=h}g&&g.toUTCString&&(f.expires=g.toUTCString());var b=encodeURIComponent(b),a=a+"="+b,e;for(e in f)b=f[e],a+="; "+e,!0!==b&&(a+="="+b);document.cookie=a};return{postMessage:{init:function(a){window.addEventListener?window.addEventListener("message",a,!1):window.attachEvent("onmessage",a)},send:function(a){var b=Object.prototype.toString,f=a.fn||null,g=a.id||"",e=a.target||window,i=a.message||{id:g};a.message&&"[object Object]"==
|
7
|
+
b.call(a.message)&&(a.message.id||(a.message.id=g),i=a.message);a=window.JSON.stringify(i,f);e.postMessage(a,"*")},unbindHandler:function(a){window.removeEventListener?window.removeEventListener("message",a,!1):window.detachEvent("onmessage",a)}},hash:{create:function(){},parse:function(){}},cookie:{set:a,get:function(a){return(a=document.cookie.match(RegExp("(?:^|; )"+a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)")))?decodeURIComponent(a[1]):void 0},remove:function(c){a(c,"",{expires:-1})}},
|
8
|
+
misc:{findFocusable:function(a){var b=null;a&&(b=a.find("a[href], area[href], input, select, textarea, button, *[tabindex], *[contenteditable]"));return b},isVisible:function(a){return!(0===a.offsetWidth||0==a.offsetHeight||"none"===(document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null).display:a.currentStyle?a.currentStyle.display:a.style.display))},hasClass:function(a,b){return!(!a.className||!a.className.match(RegExp("(\\s|^)"+b+"(\\s|$)")))}}}}(),
|
9
|
+
a=a||{};a.TextAreaNumber=null;a.load=!0;a.cmd={SpellTab:"spell",Thesaurus:"thes",GrammTab:"grammar"};a.dialog=null;a.optionNode=null;a.selectNode=null;a.grammerSuggest=null;a.textNode={};a.iframeMain=null;a.dataTemp="";a.div_overlay=null;a.textNodeInfo={};a.selectNode={};a.selectNodeResponce={};a.langList=null;a.langSelectbox=null;a.banner="";a.show_grammar=null;a.div_overlay_no_check=null;a.targetFromFrame={};a.onLoadOverlay=null;a.LocalizationComing={};a.OverlayPlace=null;a.LocalizationButton={ChangeTo:{instance:null,
|
10
|
+
text:"Change to"},ChangeAll:{instance:null,text:"Change All"},IgnoreWord:{instance:null,text:"Ignore word"},IgnoreAllWords:{instance:null,text:"Ignore all words"},Options:{instance:null,text:"Options",optionsDialog:{instance:null}},AddWord:{instance:null,text:"Add word"},FinishChecking:{instance:null,text:"Finish Checking"}};a.LocalizationLabel={ChangeTo:{instance:null,text:"Change to"},Suggestions:{instance:null,text:"Suggestions"}};var z=function(b){var c,d;for(d in b)c=b[d].instance.getElement().getFirst()||
|
11
|
+
b[d].instance.getElement(),c.setText(a.LocalizationComing[d])},A=function(b){for(var c in b){if(!b[c].instance.setLabel)break;b[c].instance.setLabel(a.LocalizationComing[c])}},j,q;a.framesetHtml=function(b){return"<iframe id="+a.iframeNumber+"_"+b+' frameborder="0" allowtransparency="1" style="width:100%;border: 1px solid #AEB3B9;overflow: auto;background:#fff; border-radius: 3px;"></iframe>'};a.setIframe=function(b,c){var d;d=a.framesetHtml(c);var f=a.iframeNumber+"_"+c;b.getElement().setHtml(d);
|
12
|
+
d=document.getElementById(f);d=d.contentWindow?d.contentWindow:d.contentDocument.document?d.contentDocument.document:d.contentDocument;d.document.open();d.document.write('<!DOCTYPE html><html><head><meta charset="UTF-8"><title>iframe</title><style>html,body{margin: 0;height: 100%;font: 13px/1.555 "Trebuchet MS", sans-serif;}a{color: #888;font-weight: bold;text-decoration: none;border-bottom: 1px solid #888;}.main-box {color:#252525;padding: 3px 5px;text-align: justify;}.main-box p{margin: 0 0 14px;}.main-box .cerr{color: #f00000;border-bottom-color: #f00000;}</style></head><body><div id="content" class="main-box"></div><iframe src="" frameborder="0" id="spelltext" name="spelltext" style="display:none; width: 100%" ></iframe><iframe src="" frameborder="0" id="loadsuggestfirst" name="loadsuggestfirst" style="display:none; width: 100%" ></iframe><iframe src="" frameborder="0" id="loadspellsuggestall" name="loadspellsuggestall" style="display:none; width: 100%" ></iframe><iframe src="" frameborder="0" id="loadOptionsForm" name="loadOptionsForm" style="display:none; width: 100%" ></iframe><script>(function(window) {var ManagerPostMessage = function() {var _init = function(handler) {if (document.addEventListener) {window.addEventListener("message", handler, false);} else {window.attachEvent("onmessage", handler);};};var _sendCmd = function(o) {var str,type = Object.prototype.toString,fn = o.fn || null,id = o.id || "",target = o.target || window,message = o.message || { "id": id };if (o.message && type.call(o.message) == "[object Object]") {(o.message["id"]) ? o.message["id"] : o.message["id"] = id;message = o.message;};str = JSON.stringify(message, fn);target.postMessage(str, "*");};return {init: _init,send: _sendCmd};};var manageMessageTmp = new ManagerPostMessage;var appString = (function(){var spell = parent.CKEDITOR.config.wsc.DefaultParams.scriptPath;var serverUrl = parent.CKEDITOR.config.wsc.DefaultParams.serviceHost;return serverUrl + spell;})();function loadScript(src, callback) {var scriptTag = document.createElement("script");scriptTag.type = "text/javascript";callback ? callback : callback = function() {};if(scriptTag.readyState) {scriptTag.onreadystatechange = function() {if (scriptTag.readyState == "loaded" ||scriptTag.readyState == "complete") {scriptTag.onreadystatechange = null;setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);callback();}};}else{scriptTag.onload = function() {setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);callback();};};scriptTag.src = src;document.getElementsByTagName("head")[0].appendChild(scriptTag);};window.onload = function(){loadScript(appString, function(){manageMessageTmp.send({"id": "iframeOnload","target": window.parent});});}})(this);<\/script></body></html>');
|
13
|
+
d.document.close()};a.setCurrentIframe=function(b){a.setIframe(a.dialog._.contents[b].Content,b)};a.setHeightBannerFrame=function(){var b=a.dialog.getContentElement("SpellTab","banner").getElement(),c=a.dialog.getContentElement("GrammTab","banner").getElement(),d=a.dialog.getContentElement("Thesaurus","banner").getElement();b.setStyle("height","90px");c.setStyle("height","90px");d.setStyle("height","90px")};a.setHeightFrame=function(){document.getElementById(a.iframeNumber+"_"+a.dialog._.currentTabId).style.height=
|
14
|
+
"240px"};a.sendData=function(b){var c=b._.currentTabId,d=b._.contents[c].Content,f,g;a.setIframe(d,c);var e=function(e){e=e||window.event;e.data.getTarget().is("a")&&c!=b._.currentTabId&&(c=b._.currentTabId,d=b._.contents[c].Content,f=a.iframeNumber+"_"+c,a.div_overlay.setEnable(),d.getElement().getChildCount()?u(a.targetFromFrame[f],a.cmd[c]):(a.setIframe(d,c),g=document.getElementById(f),a.targetFromFrame[f]=g.contentWindow))};b.parts.tabs.removeListener("click",e);b.parts.tabs.on("click",e)};a.buildSelectLang=
|
15
|
+
function(a){var c=new CKEDITOR.dom.element("div"),d=new CKEDITOR.dom.element("select"),a="wscLang"+a;c.addClass("cke_dialog_ui_input_select");c.setAttribute("role","presentation");c.setStyles({height:"auto",position:"absolute",right:"0",top:"-1px",width:"160px","white-space":"normal"});d.setAttribute("id",a);d.addClass("cke_dialog_ui_input_select");d.setStyles({width:"160px"});c.append(d);return c};a.buildOptionLang=function(b,c){var d=document.getElementById("wscLang"+c),f=document.createDocumentFragment(),
|
16
|
+
g,e,i=[];if(0===d.options.length){for(g in b)i.push([g,b[g]]);i.sort();for(var k=0;k<i.length;k++)g=document.createElement("option"),g.setAttribute("value",i[k][1]),e=document.createTextNode(i[k][0]),g.appendChild(e),i[k][1]==a.selectingLang&&g.setAttribute("selected","selected"),f.appendChild(g);d.appendChild(f)}};a.buildOptionSynonyms=function(b){b=a.selectNodeResponce[b];a.selectNode.synonyms.clear();for(var c=0;c<b.length;c++)a.selectNode.synonyms.add(b[c],b[c]);a.selectNode.synonyms.getInputElement().$.firstChild.selected=
|
17
|
+
!0;a.textNode.Thesaurus.setValue(a.selectNode.synonyms.getInputElement().getValue())};var r=function(a){var c=document,d=a.target||c.body,f=a.id||"overlayBlock",e=a.opacity||"0.9",a=a.background||"#f1f1f1",h=c.getElementById(f),i=h||c.createElement("div");i.style.cssText="position: absolute;top:30px;bottom:41px;left:1px;right:1px;z-index: 10020;padding:0;margin:0;background:"+a+";opacity: "+e+";filter: alpha(opacity="+100*e+");display: none;";i.id=f;h||d.appendChild(i);return{setDisable:function(){i.style.display=
|
18
|
+
"none"},setEnable:function(){i.style.display="block"}}},B=function(b,c,d){var f=new CKEDITOR.dom.element("div"),e=new CKEDITOR.dom.element("input"),h=new CKEDITOR.dom.element("label"),i="wscGrammerSuggest"+b+"_"+c;f.addClass("cke_dialog_ui_input_radio");f.setAttribute("role","presentation");f.setStyles({width:"97%",padding:"5px","white-space":"normal"});e.setAttributes({type:"radio",value:c,name:"wscGrammerSuggest",id:i});e.setStyles({"float":"left"});e.on("click",function(b){a.textNode.GrammTab.setValue(b.sender.getValue())});
|
19
|
+
d&&e.setAttribute("checked",!0);e.addClass("cke_dialog_ui_radio_input");h.appendText(b);h.setAttribute("for",i);h.setStyles({display:"block","line-height":"16px","margin-left":"18px","white-space":"normal"});f.append(e);f.append(h);return f},v=function(a){a=a||"true";null!==a&&"false"==a&&m()},n=function(b){var c=new y(b),b="wscLang"+a.dialog.getParentEditor().name,b=document.getElementById(b),d=a.iframeNumber+"_"+a.dialog._.currentTabId;a.buildOptionLang(c.setLangList,a.dialog.getParentEditor().name);
|
20
|
+
w[c.getCurrentLangGroup(a.selectingLang)]();v(a.show_grammar);b.onchange=function(){w[c.getCurrentLangGroup(this.value)]();v(a.show_grammar);a.div_overlay.setEnable();a.selectingLang=this.value;e.postMessage.send({message:{changeLang:a.selectingLang,text:a.dataTemp},target:a.targetFromFrame[d],id:"selectionLang_outer__page"})}},C=function(b){if("no_any_suggestions"==b){b="No suggestions";a.LocalizationButton.ChangeTo.instance.disable();a.LocalizationButton.ChangeAll.instance.disable();var c=function(b){b=
|
21
|
+
a.LocalizationButton[b].instance;b.getElement().hasClass("cke_disabled")?b.getElement().setStyle("color","#a0a0a0"):b.disable()};c("ChangeTo");c("ChangeAll")}else a.LocalizationButton.ChangeTo.instance.enable(),a.LocalizationButton.ChangeAll.instance.enable(),a.LocalizationButton.ChangeTo.instance.getElement().setStyle("color","#333"),a.LocalizationButton.ChangeAll.instance.getElement().setStyle("color","#333");return b},E={iframeOnload:function(){a.div_overlay.setEnable();var b=a.dialog._.currentTabId;
|
22
|
+
u(a.targetFromFrame[a.iframeNumber+"_"+b],a.cmd[b])},suggestlist:function(b){delete b.id;a.div_overlay_no_check.setDisable();s();n(a.langList);var c=C(b.word),d="";c instanceof Array&&(c=b.word[0]);d=c=c.split(",");q.clear();a.textNode.SpellTab.setValue(d[0]);for(b=0;b<d.length;b++)q.add(d[b],d[b]);l();a.div_overlay.setDisable()},grammerSuggest:function(b){delete b.id;delete b.mocklangs;s();n(a.langList);var c=b.grammSuggest[0];a.grammerSuggest.getElement().setHtml("");a.textNode.GrammTab.reset();
|
23
|
+
a.textNode.GrammTab.setValue(c);a.textNodeInfo.GrammTab.getElement().setHtml("");a.textNodeInfo.GrammTab.getElement().setText(b.info);for(var b=b.grammSuggest,c=b.length,d=!0,f=0;f<c;f++)a.grammerSuggest.getElement().append(B(b[f],b[f],d)),d=!1;l();a.div_overlay.setDisable()},thesaurusSuggest:function(b){delete b.id;delete b.mocklangs;s();n(a.langList);a.selectNodeResponce=b;a.textNode.Thesaurus.reset();a.selectNode.categories.clear();for(var c in b)a.selectNode.categories.add(c,c);b=a.selectNode.categories.getInputElement().getChildren().$[0].value;
|
24
|
+
a.selectNode.categories.getInputElement().getChildren().$[0].selected=!0;a.buildOptionSynonyms(b);l();a.div_overlay.setDisable()},finish:function(b){delete b.id;D();b=a.dialog.getContentElement(a.dialog._.currentTabId,"BlockFinishChecking").getElement();b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.show();a.div_overlay.setDisable()},settext:function(b){delete b.id;a.dialog.getParentEditor().getCommand("checkspell");var c=a.dialog.getParentEditor();try{c.focus()}catch(d){}c.setData(b.text,
|
25
|
+
function(){a.dataTemp="";c.unlockSelection();c.fire("saveSnapshot");a.dialog.hide()})},ReplaceText:function(b){delete b.id;a.div_overlay.setEnable();a.dataTemp=b.text;a.selectingLang=b.currentLang;window.setTimeout(function(){try{a.div_overlay.setDisable()}catch(b){}},500);z(a.LocalizationButton);A(a.LocalizationLabel)},options_checkbox_send:function(b){delete b.id;b={osp:e.cookie.get("osp"),udn:e.cookie.get("udn"),cust_dic_ids:a.cust_dic_ids};e.postMessage.send({message:b,target:a.targetFromFrame[a.iframeNumber+
|
26
|
+
"_"+a.dialog._.currentTabId],id:"options_outer__page"})},getOptions:function(b){var c=b.DefOptions.udn;a.LocalizationComing=b.DefOptions.localizationButtonsAndText;a.show_grammar=b.show_grammar;a.langList=b.lang;if(a.bnr=b.bannerId){a.setHeightBannerFrame();var d=b.banner;a.dialog.getContentElement(a.dialog._.currentTabId,"banner").getElement().setHtml(d)}else a.setHeightFrame();"undefined"==c&&(a.userDictionaryName?(c=a.userDictionaryName,d={osp:e.cookie.get("osp"),udn:a.userDictionaryName,cust_dic_ids:a.cust_dic_ids,
|
27
|
+
id:"options_dic_send",udnCmd:"create"},e.postMessage.send({message:d,target:a.targetFromFrame[void 0]})):c="");e.cookie.set("osp",b.DefOptions.osp);e.cookie.set("udn",c);e.cookie.set("cust_dic_ids",b.DefOptions.cust_dic_ids);e.postMessage.send({id:"giveOptions"})},options_dic_send:function(){var b={osp:e.cookie.get("osp"),udn:e.cookie.get("udn"),cust_dic_ids:a.cust_dic_ids,id:"options_dic_send",udnCmd:e.cookie.get("udnCmd")};e.postMessage.send({message:b,target:a.targetFromFrame[a.iframeNumber+"_"+
|
28
|
+
a.dialog._.currentTabId]})},data:function(a){delete a.id},giveOptions:function(){},setOptionsConfirmF:function(){},setOptionsConfirmT:function(){j.setValue("")},clickBusy:function(){a.div_overlay.setEnable()},suggestAllCame:function(){a.div_overlay.setDisable();a.div_overlay_no_check.setDisable()},TextCorrect:function(){n(a.langList)}},x=function(a){a=a||window.event;if((a=window.JSON.parse(a.data))&&a.id)E[a.id](a)},u=function(b,c,d,f){c=c||CKEDITOR.config.wsc_cmd;d=d||a.dataTemp;e.postMessage.send({message:{customerId:a.wsc_customerId,
|
29
|
+
text:d,txt_ctrl:a.TextAreaNumber,cmd:c,cust_dic_ids:a.cust_dic_ids,udn:a.userDictionaryName,slang:a.selectingLang,reset_suggest:f||!1},target:b,id:"data_outer__page"});a.div_overlay.setEnable()},w={superset:function(){a.dialog.showPage("Thesaurus");a.dialog.showPage("GrammTab");o()},usual:function(){t();m();o()},rtl:function(){t();m();o()}},F=function(b){var c=new function(a){var b={};return{getCmdByTab:function(c){for(var e in a)b[a[e]]=e;return b[c]}}}(a.cmd);b.selectPage(c.getCmdByTab(CKEDITOR.config.wsc_cmd));
|
30
|
+
a.sendData(b)},t=function(){a.dialog.hidePage("Thesaurus")},m=function(){a.dialog.hidePage("GrammTab")},o=function(){a.dialog.showPage("SpellTab")},l=function(){var b=a.dialog.getContentElement(a.dialog._.currentTabId,"bottomGroup").getElement();b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.show()},D=function(){var b=a.dialog.getContentElement(a.dialog._.currentTabId,"bottomGroup").getElement(),c=document.activeElement,d;b.setStyles({display:"block",position:"absolute",
|
31
|
+
left:"-9999px"});setTimeout(function(){b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.hide();a.dialog._.editor.focusManager.currentActive.focusNext();d=e.misc.findFocusable(a.dialog.parts.contents);if(!e.misc.hasClass(c,"cke_dialog_tab")&&!e.misc.hasClass(c,"cke_dialog_contents_body")&&e.misc.isVisible(c))try{c.focus()}catch(f){}else for(var g=0,h;g<d.count();g++)if(h=d.getItem(g),e.misc.isVisible(h.$)){try{h.$.focus()}catch(i){}break}},0)},s=function(){var b=a.dialog.getContentElement(a.dialog._.currentTabId,
|
32
|
+
"BlockFinishChecking").getElement(),c=document.activeElement,d;b.setStyles({display:"block",position:"absolute",left:"-9999px"});setTimeout(function(){b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.hide();a.dialog._.editor.focusManager.currentActive.focusNext();d=e.misc.findFocusable(a.dialog.parts.contents);if(!e.misc.hasClass(c,"cke_dialog_tab")&&!e.misc.hasClass(c,"cke_dialog_contents_body")&&e.misc.isVisible(c))try{c.focus()}catch(f){}else for(var g=0,h;g<d.count();g++)if(h=
|
33
|
+
d.getItem(g),e.misc.isVisible(h.$)){try{h.$.focus()}catch(i){}break}},0)};CKEDITOR.dialog.add("checkspell",function(b){var c=function(){this.getElement().focus();a.div_overlay.setEnable();var c=a.dialog._.currentTabId,f=a.iframeNumber+"_"+c,g=a.textNode[c].getValue(),h=this.getElement().getAttribute("title-cmd");e.postMessage.send({message:{cmd:h,tabId:c,new_word:g},target:a.targetFromFrame[f],id:"cmd_outer__page"});("ChangeTo"==h||"ChangeAll"==h)&&b.fire("saveSnapshot");"FinishChecking"==h&&b.config.wsc_onFinish.call(CKEDITOR.document.getWindow().getFrame())};
|
34
|
+
return{title:b.config.wsc_dialogTitle||b.lang.wsc.title,minWidth:560,minHeight:444,buttons:[CKEDITOR.dialog.cancelButton],onLoad:function(){a.dialog=this;t();m();o()},onShow:function(){b.lockSelection(b.getSelection());a.TextAreaNumber="cke_textarea_"+CKEDITOR.currentInstance.name;e.postMessage.init(x);a.dataTemp=CKEDITOR.currentInstance.getData();a.OverlayPlace=a.dialog.parts.tabs.getParent().$;if(CKEDITOR&&CKEDITOR.config){a.wsc_customerId=b.config.wsc_customerId;a.cust_dic_ids=b.config.wsc_customDictionaryIds;
|
30
35
|
a.userDictionaryName=b.config.wsc_userDictionaryName;a.defaultLanguage=CKEDITOR.config.defaultLanguage;var c="file:"==document.location.protocol?"http:":document.location.protocol;CKEDITOR.scriptLoader.load(b.config.wsc_customLoaderScript||c+"//loader.webspellchecker.net/sproxy_fck/sproxy.php?plugin=fck2&customerid="+a.wsc_customerId+"&cmd=script&doc=wsc&schema=22",function(c){CKEDITOR.config&&CKEDITOR.config.wsc&&CKEDITOR.config.wsc.DefaultParams?(a.serverLocationHash=CKEDITOR.config.wsc.DefaultParams.serviceHost,
|
31
36
|
a.logotype=CKEDITOR.config.wsc.DefaultParams.logoPath,a.loadIcon=CKEDITOR.config.wsc.DefaultParams.iconPath,a.loadIconEmptyEditor=CKEDITOR.config.wsc.DefaultParams.iconPathEmptyEditor,a.LangComparer=new CKEDITOR.config.wsc.DefaultParams._SP_FCK_LangCompare):(a.serverLocationHash=DefaultParams.serviceHost,a.logotype=DefaultParams.logoPath,a.loadIcon=DefaultParams.iconPath,a.loadIconEmptyEditor=DefaultParams.iconPathEmptyEditor,a.LangComparer=new _SP_FCK_LangCompare);a.pluginPath=CKEDITOR.getUrl(b.plugins.wsc.path);
|
32
|
-
a.iframeNumber=a.TextAreaNumber;a.templatePath=a.pluginPath+"dialogs/tmp.html";a.LangComparer.setDefaulLangCode(a.defaultLanguage);a.currentLang=b.config.wsc_lang||a.LangComparer.getSPLangCode(b.langCode);a.selectingLang=a.currentLang;a.div_overlay=new
|
33
|
-
a.div_overlay_no_check=new
|
34
|
-
c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"hbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;",widths:["50%","50%"],children:[{type:"hbox",id:"leftCol",align:"left",width:"50%",children:[{type:"vbox",id:"rightCol1",widths:["50%","50%"],children:[{type:"text",id:"text",label:a.LocalizationLabel.ChangeTo.text+
|
35
|
-
this},onHide:function(){this.reset()}},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"text",id:"labelSuggestions",label:a.LocalizationLabel.Suggestions.text+":",onShow:function(){a.LocalizationLabel.Suggestions.instance=this;this.getInputElement().
|
36
|
-
a.logotype;this.getElement().getParent().setStyles({"text-align":"left"})}}]},{type:"select",id:"list_of_suggestions",labelStyle:"font: 12px/25px arial, sans-serif;",size:"6",inputStyle:"width: 140px; height: auto;",items:[["loading..."]],onShow:function(){
|
37
|
-
|
38
|
-
label:a.LocalizationButton.
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
id:"rightCol_col__left",children:[{type:"button",id:"Option_button",label:a.LocalizationButton.Options.text,title:"Option",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
{type:"
|
51
|
-
{type:"select",id:"
|
52
|
-
|
53
|
-
id:"
|
54
|
-
|
55
|
-
|
37
|
+
a.iframeNumber=a.TextAreaNumber;a.templatePath=a.pluginPath+"dialogs/tmp.html";a.LangComparer.setDefaulLangCode(a.defaultLanguage);a.currentLang=b.config.wsc_lang||a.LangComparer.getSPLangCode(b.langCode);a.selectingLang=a.currentLang;a.div_overlay=new r({opacity:"1",background:"#fff url("+a.loadIcon+") no-repeat 50% 50%",target:a.OverlayPlace});var d=a.dialog.parts.tabs.getId(),d=CKEDITOR.document.getById(d);d.setStyle("width","97%");d.getElementsByTag("DIV").count()||d.append(a.buildSelectLang(a.dialog.getParentEditor().name));
|
38
|
+
a.div_overlay_no_check=new r({opacity:"1",id:"no_check_over",background:"#fff url("+a.loadIconEmptyEditor+") no-repeat 50% 50%",target:a.OverlayPlace});c&&(F(a.dialog),a.dialog.setupContent(a.dialog))})}else a.dialog.hide()},onHide:function(){var c=CKEDITOR.plugins.scayt,f=b.scayt;b.unlockSelection();c&&(f&&c.state[b.name]&&f.setMarkupPaused)&&f.setMarkupPaused(!1);a.dataTemp="";e.postMessage.unbindHandler(x)},contents:[{id:"SpellTab",label:"SpellChecker",accessKey:"S",elements:[{type:"html",id:"banner",
|
39
|
+
label:"banner",style:"",html:"<div></div>"},{type:"html",id:"Content",label:"spellContent",html:"",setup:function(b){var b=a.iframeNumber+"_"+b._.currentTabId,c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"hbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;",widths:["50%","50%"],children:[{type:"hbox",id:"leftCol",align:"left",width:"50%",children:[{type:"vbox",id:"rightCol1",widths:["50%","50%"],children:[{type:"text",id:"text",label:a.LocalizationLabel.ChangeTo.text+
|
40
|
+
":",labelLayout:"horizontal",labelStyle:"font: 12px/25px arial, sans-serif;",width:"140px","default":"",onShow:function(){a.textNode.SpellTab=this;a.LocalizationLabel.ChangeTo.instance=this},onHide:function(){this.reset()}},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"text",id:"labelSuggestions",label:a.LocalizationLabel.Suggestions.text+":",onShow:function(){a.LocalizationLabel.Suggestions.instance=this;this.getInputElement().setStyles({display:"block",
|
41
|
+
position:"absolute",left:"-9999px"})}},{type:"html",id:"logo",html:'<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"left"})}}]},{type:"select",id:"list_of_suggestions",labelStyle:"font: 12px/25px arial, sans-serif;",size:"6",inputStyle:"width: 140px; height: auto;",items:[["loading..."]],onShow:function(){q=
|
42
|
+
this},onHide:function(){this.clear()},onChange:function(){a.textNode.SpellTab.setValue(this.getValue())}}]}]}]},{type:"hbox",id:"rightCol",align:"right",width:"50%",children:[{type:"vbox",id:"rightCol_col__left",widths:["50%","50%","50%","50%"],children:[{type:"button",id:"ChangeTo",label:a.LocalizationButton.ChangeTo.text,title:"Change to",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.ChangeTo.instance=this},onClick:c},{type:"button",
|
43
|
+
id:"ChangeAll",label:a.LocalizationButton.ChangeAll.text,title:"Change All",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.ChangeAll.instance=this},onClick:c},{type:"button",id:"AddWord",label:a.LocalizationButton.AddWord.text,title:"Add word",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.AddWord.instance=this},onClick:c},{type:"button",id:"FinishChecking",label:a.LocalizationButton.FinishChecking.text,
|
44
|
+
title:"Finish Checking",style:"width: 100%;margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.FinishChecking.instance=this},onClick:c}]},{type:"vbox",id:"rightCol_col__right",widths:["50%","50%","50%"],children:[{type:"button",id:"IgnoreWord",label:a.LocalizationButton.IgnoreWord.text,title:"Ignore word",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.IgnoreWord.instance=this},
|
45
|
+
onClick:c},{type:"button",id:"IgnoreAllWords",label:a.LocalizationButton.IgnoreAllWords.text,title:"Ignore all words",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.IgnoreAllWords.instance=this},onClick:c},{type:"button",id:"option",label:a.LocalizationButton.Options.text,title:"Option",style:"width: 100%;",onLoad:function(){a.LocalizationButton.Options.instance=this;"file:"==document.location.protocol&&this.disable()},onClick:function(){this.getElement().focus();
|
46
|
+
"file:"==document.location.protocol?alert("WSC: Options functionality is disabled when runing from file system"):(p=document.activeElement,b.openDialog("options"))}}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",widths:["70%","30%"],onShow:function(){this.getElement().setStyles({display:"block",position:"absolute",left:"-9999px"})},onHide:l,children:[{type:"hbox",id:"leftCol",align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",setup:function(){this.getChild()[0].getElement().$.src=
|
47
|
+
a.logotype;this.getChild()[0].getElement().getParent().setStyles({"text-align":"center"})},children:[{type:"html",id:"logo",html:'<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">'}]}]},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"Option_button",label:a.LocalizationButton.Options.text,title:"Option",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",
|
48
|
+
this.id);"file:"==document.location.protocol&&this.disable()},onClick:function(){this.getElement().focus();"file:"==document.location.protocol?alert("WSC: Options functionality is disabled when runing from file system"):(p=document.activeElement,b.openDialog("options"))}},{type:"button",id:"FinishChecking",label:a.LocalizationButton.FinishChecking.text,title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]}]},{id:"GrammTab",
|
49
|
+
label:"Grammar",accessKey:"G",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"<div></div>"},{type:"html",id:"Content",label:"GrammarContent",html:"",setup:function(){var b=a.iframeNumber+"_"+a.dialog._.currentTabId,c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"vbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;",children:[{type:"hbox",id:"leftCol",widths:["66%","34%"],children:[{type:"vbox",children:[{type:"text",id:"text",label:"Change to:",labelLayout:"horizontal",
|
50
|
+
labelStyle:"font: 12px/25px arial, sans-serif;",inputStyle:"float: right; width: 200px;","default":"",onShow:function(){a.textNode.GrammTab=this},onHide:function(){this.reset()}},{type:"html",id:"html_text",html:"<div style='min-height: 17px; line-height: 17px; padding: 5px; text-align: left;background: #F1F1F1;color: #595959; white-space: normal!important;'></div>",onShow:function(){a.textNodeInfo.GrammTab=this}},{type:"html",id:"radio",html:"",onShow:function(){a.grammerSuggest=this}}]},{type:"vbox",
|
51
|
+
children:[{type:"button",id:"ChangeTo",label:"Change to",title:"Change to",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c},{type:"button",id:"IgnoreWord",label:"Ignore word",title:"Ignore word",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c},{type:"button",id:"IgnoreAllWords",label:"Ignore Problem",title:"Ignore Problem",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",
|
52
|
+
this.id)},onClick:c},{type:"button",id:"FinishChecking",label:"Finish Checking",title:"Finish Checking",style:"width: 133px; float: right; margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",widths:["70%","30%"],onShow:function(){this.getElement().setStyles({display:"block",position:"absolute",left:"-9999px"})},onHide:l,children:[{type:"hbox",id:"leftCol",align:"left",width:"70%",
|
53
|
+
children:[{type:"vbox",id:"rightCol1",children:[{type:"html",id:"logo",html:'<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}}]}]},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"FinishChecking",label:"Finish Checking",
|
54
|
+
title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]}]},{id:"Thesaurus",label:"Thesaurus",accessKey:"T",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"<div></div>"},{type:"html",id:"Content",label:"spellContent",html:"",setup:function(){var b=a.iframeNumber+"_"+a.dialog._.currentTabId,c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"vbox",id:"bottomGroup",style:"width:560px; margin: -10px auto; overflow: hidden;",
|
55
|
+
children:[{type:"hbox",widths:["75%","25%"],children:[{type:"vbox",children:[{type:"hbox",widths:["65%","35%"],children:[{type:"text",id:"ChangeTo",label:"Change to:",labelLayout:"horizontal",inputStyle:"width: 160px;",labelStyle:"font: 12px/25px arial, sans-serif;","default":"",onShow:function(){a.textNode.Thesaurus=this},onHide:function(){this.reset()}},{type:"button",id:"ChangeTo",label:"Change to",title:"Change to",style:"width: 121px; margin-top: 1px;",onLoad:function(){this.getElement().setAttribute("title-cmd",
|
56
|
+
this.id)},onClick:c}]},{type:"hbox",children:[{type:"select",id:"categories",label:"Categories:",labelStyle:"font: 12px/25px arial, sans-serif;",size:"5",inputStyle:"width: 180px; height: auto;",items:[],onShow:function(){a.selectNode.categories=this},onHide:function(){this.clear()},onChange:function(){a.buildOptionSynonyms(this.getValue())}},{type:"select",id:"synonyms",label:"Synonyms:",labelStyle:"font: 12px/25px arial, sans-serif;",size:"5",inputStyle:"width: 180px; height: auto;",items:[],onShow:function(){a.selectNode.synonyms=
|
57
|
+
this;a.textNode.Thesaurus.setValue(this.getValue())},onHide:function(){this.clear()},onChange:function(){a.textNode.Thesaurus.setValue(this.getValue())}}]}]},{type:"vbox",width:"120px",style:"margin-top:46px;",children:[{type:"html",id:"logotype",label:"WebSpellChecker.net",html:'<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}},
|
58
|
+
{type:"button",id:"FinishChecking",label:"Finish Checking",title:"Finish Checking",style:"width: 121px; float: right; margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",widths:["70%","30%"],onShow:function(){this.getElement().setStyles({display:"block",position:"absolute",left:"-9999px"})},children:[{type:"hbox",id:"leftCol",align:"left",width:"70%",children:[{type:"vbox",
|
59
|
+
id:"rightCol1",children:[{type:"html",id:"logo",html:'<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}}]}]},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"FinishChecking",label:"Finish Checking",title:"Finish Checking",
|
60
|
+
style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]}]}]}});var p=null;CKEDITOR.dialog.add("options",function(){var b=null,c={},d={},f=null,g=null;e.cookie.get("udn");e.cookie.get("osp");var h=function(){g=this.getElement().getAttribute("title-cmd");var a=[];a[0]=d.IgnoreAllCapsWords;a[1]=d.IgnoreWordsNumbers;a[2]=d.IgnoreMixedCaseWords;a[3]=d.IgnoreDomainNames;a=a.toString().replace(/,/g,"");e.cookie.set("osp",a);e.cookie.set("udnCmd",g?g:"ignore");
|
61
|
+
"delete"!=g&&(a="",""!==j.getValue()&&(a=j.getValue()),e.cookie.set("udn",a));e.postMessage.send({id:"options_dic_send"})},i=function(){f.getElement().setHtml(a.LocalizationComing.error);f.getElement().show()};return{title:a.LocalizationComing.Options,minWidth:430,minHeight:130,resizable:CKEDITOR.DIALOG_RESIZE_NONE,contents:[{id:"OptionsTab",label:"Options",accessKey:"O",elements:[{type:"hbox",id:"options_error",children:[{type:"html",style:"display: block;text-align: center;white-space: normal!important; font-size: 12px;color:red",
|
56
62
|
html:"<div></div>",onShow:function(){f=this}}]},{type:"vbox",id:"Options_content",children:[{type:"hbox",id:"Options_manager",widths:["52%","48%"],children:[{type:"fieldset",label:"Spell Checking Options",style:"border: none;margin-top: 13px;padding: 10px 0 10px 10px",onShow:function(){this.getInputElement().$.children[0].innerHTML=a.LocalizationComing.SpellCheckingOptions},children:[{type:"vbox",id:"Options_checkbox",children:[{type:"checkbox",id:"IgnoreAllCapsWords",label:"Ignore All-Caps Words",
|
57
63
|
labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){d[this.id]=!this.getValue()?0:1}},{type:"checkbox",id:"IgnoreWordsNumbers",label:"Ignore Words with Numbers",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){d[this.id]=!this.getValue()?0:1}},{type:"checkbox",
|
58
64
|
id:"IgnoreMixedCaseWords",label:"Ignore Mixed-Case Words",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){d[this.id]=!this.getValue()?0:1}},{type:"checkbox",id:"IgnoreDomainNames",label:"Ignore Domain Names",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){d[this.id]=
|
59
65
|
!this.getValue()?0:1}}]}]},{type:"vbox",id:"Options_DictionaryName",children:[{type:"text",id:"DictionaryName",style:"margin-bottom: 10px",label:"Dictionary Name:",labelLayout:"vertical",labelStyle:"font: 12px/25px arial, sans-serif;","default":"",onLoad:function(){j=this;this.setValue(a.userDictionaryName?a.userDictionaryName:(e.cookie.get("udn"),this.getValue()))},onShow:function(){j=this;this.setValue(!e.cookie.get("udn")?this.getValue():e.cookie.get("udn"));this.setLabel(a.LocalizationComing.DictionaryName)},
|
60
|
-
onHide:function(){this.reset()}},{type:"hbox",id:"Options_buttons",children:[{type:"vbox",id:"Options_leftCol_col",widths:["50%","50%"],children:[{type:"button",id:"create",label:"Create",title:"Create",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){this.getElement().setText(a.LocalizationComing.Create)},onClick:h},{type:"button",id:"restore",label:"Restore",title:"Restore",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",
|
61
|
-
this.id)},onShow:function(){this.getElement().setText(a.LocalizationComing.Restore)},onClick:h}]},{type:"vbox",id:"Options_rightCol_col",widths:["50%","50%"],children:[{type:"button",id:"rename",label:"Rename",title:"Rename",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){this.getElement().setText(a.LocalizationComing.Rename)},onClick:h},{type:"button",id:"delete",label:"Remove",
|
62
|
-
this.id)},onShow:function(){this.getElement().setText(a.LocalizationComing.Remove)},onClick:h}]}]}]}]},{type:"hbox",id:"Options_text",children:[{type:"html",style:"text-align: justify;margin-top: 15px;white-space: normal!important; font-size: 12px;color:#777;",html:"<div>"+a.LocalizationComing.OptionsTextIntro+"</div>",onShow:function(){this.getElement().setText(a.LocalizationComing.OptionsTextIntro)}}]}]}]}],
|
63
|
-
a[0]=d.IgnoreAllCapsWords;a[1]=d.IgnoreWordsNumbers;a[2]=d.IgnoreMixedCaseWords;a[3]=d.IgnoreDomainNames;a=a.toString().replace(/,/g,"");e.cookie.set("osp",a);e.cookie.set("udn",j.getValue());e.postMessage.send({id:"options_checkbox_send"});f.getElement().hide();f.getElement().setHtml(" ")},onLoad:function(){b=this;
|
64
|
-
b.getContentElement("OptionsTab","IgnoreMixedCaseWords");c.IgnoreDomainNames=b.getContentElement("OptionsTab","IgnoreDomainNames")},onShow:function(){var b=e.cookie.get("osp").split("");d.IgnoreAllCapsWords=b[0];d.IgnoreWordsNumbers=b[1];d.IgnoreMixedCaseWords=b[2];d.IgnoreDomainNames=b[3];!parseInt(d.IgnoreAllCapsWords,10)?c.IgnoreAllCapsWords.setValue("",!1):c.IgnoreAllCapsWords.setValue("checked"
|
65
|
-
!1);!parseInt(d.IgnoreMixedCaseWords,10)?c.IgnoreMixedCaseWords.setValue("",!1):c.IgnoreMixedCaseWords.setValue("checked",!1);!parseInt(d.IgnoreDomainNames,10)?c.IgnoreDomainNames.setValue("",!1):c.IgnoreDomainNames.setValue("checked",!1);d.IgnoreAllCapsWords=!c.IgnoreAllCapsWords.getValue()?0:1;d.IgnoreWordsNumbers=!c.IgnoreWordsNumbers.getValue()?0:1;d.IgnoreMixedCaseWords=!c.IgnoreMixedCaseWords.getValue()?
|
66
|
-
a.LocalizationComing.IgnoreAllCapsWords;c.IgnoreWordsNumbers.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreWordsWithNumbers;c.IgnoreMixedCaseWords.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreMixedCaseWords;c.IgnoreDomainNames.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreDomainNames}
|
67
|
-
d.setSize("height",b.height-310):d&&d.setSize("height",b.height-220))});CKEDITOR.on("dialogDefinition",function(b){var c=b.data.definition;a.onLoadOverlay=new
|
66
|
+
onHide:function(){this.reset()}},{type:"hbox",id:"Options_buttons",children:[{type:"vbox",id:"Options_leftCol_col",widths:["50%","50%"],children:[{type:"button",id:"create",label:"Create",title:"Create",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){(this.getElement().getFirst()||this.getElement()).setText(a.LocalizationComing.Create)},onClick:h},{type:"button",id:"restore",label:"Restore",title:"Restore",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",
|
67
|
+
this.id)},onShow:function(){(this.getElement().getFirst()||this.getElement()).setText(a.LocalizationComing.Restore)},onClick:h}]},{type:"vbox",id:"Options_rightCol_col",widths:["50%","50%"],children:[{type:"button",id:"rename",label:"Rename",title:"Rename",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){(this.getElement().getFirst()||this.getElement()).setText(a.LocalizationComing.Rename)},onClick:h},{type:"button",id:"delete",label:"Remove",
|
68
|
+
title:"Remove",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){(this.getElement().getFirst()||this.getElement()).setText(a.LocalizationComing.Remove)},onClick:h}]}]}]}]},{type:"hbox",id:"Options_text",children:[{type:"html",style:"text-align: justify;margin-top: 15px;white-space: normal!important; font-size: 12px;color:#777;",html:"<div>"+a.LocalizationComing.OptionsTextIntro+"</div>",onShow:function(){this.getElement().setText(a.LocalizationComing.OptionsTextIntro)}}]}]}]}],
|
69
|
+
buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton],onOk:function(){var a=[];a[0]=d.IgnoreAllCapsWords;a[1]=d.IgnoreWordsNumbers;a[2]=d.IgnoreMixedCaseWords;a[3]=d.IgnoreDomainNames;a=a.toString().replace(/,/g,"");e.cookie.set("osp",a);e.cookie.set("udn",j.getValue());e.postMessage.send({id:"options_checkbox_send"});f.getElement().hide();f.getElement().setHtml(" ")},onLoad:function(){b=this;c.IgnoreAllCapsWords=b.getContentElement("OptionsTab","IgnoreAllCapsWords");c.IgnoreWordsNumbers=
|
70
|
+
b.getContentElement("OptionsTab","IgnoreWordsNumbers");c.IgnoreMixedCaseWords=b.getContentElement("OptionsTab","IgnoreMixedCaseWords");c.IgnoreDomainNames=b.getContentElement("OptionsTab","IgnoreDomainNames")},onShow:function(){e.postMessage.init(i);var b=e.cookie.get("osp").split("");d.IgnoreAllCapsWords=b[0];d.IgnoreWordsNumbers=b[1];d.IgnoreMixedCaseWords=b[2];d.IgnoreDomainNames=b[3];!parseInt(d.IgnoreAllCapsWords,10)?c.IgnoreAllCapsWords.setValue("",!1):c.IgnoreAllCapsWords.setValue("checked",
|
71
|
+
!1);!parseInt(d.IgnoreWordsNumbers,10)?c.IgnoreWordsNumbers.setValue("",!1):c.IgnoreWordsNumbers.setValue("checked",!1);!parseInt(d.IgnoreMixedCaseWords,10)?c.IgnoreMixedCaseWords.setValue("",!1):c.IgnoreMixedCaseWords.setValue("checked",!1);!parseInt(d.IgnoreDomainNames,10)?c.IgnoreDomainNames.setValue("",!1):c.IgnoreDomainNames.setValue("checked",!1);d.IgnoreAllCapsWords=!c.IgnoreAllCapsWords.getValue()?0:1;d.IgnoreWordsNumbers=!c.IgnoreWordsNumbers.getValue()?0:1;d.IgnoreMixedCaseWords=!c.IgnoreMixedCaseWords.getValue()?
|
72
|
+
0:1;d.IgnoreDomainNames=!c.IgnoreDomainNames.getValue()?0:1;c.IgnoreAllCapsWords.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreAllCapsWords;c.IgnoreWordsNumbers.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreWordsWithNumbers;c.IgnoreMixedCaseWords.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreMixedCaseWords;c.IgnoreDomainNames.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreDomainNames},onHide:function(){e.postMessage.unbindHandler(i);if(p)try{p.focus()}catch(a){}}}});
|
73
|
+
CKEDITOR.dialog.on("resize",function(b){var b=b.data,c=b.dialog,d=CKEDITOR.document.getById(a.iframeNumber+"_"+c._.currentTabId);"checkspell"==c._.name&&(a.bnr?d&&d.setSize("height",b.height-310):d&&d.setSize("height",b.height-220))});CKEDITOR.on("dialogDefinition",function(b){if("checkspell"===b.data.name){var c=b.data.definition;a.onLoadOverlay=new r({opacity:"1",background:"#fff",target:c.dialog.parts.tabs.getParent().$});a.onLoadOverlay.setEnable();c.dialog.on("cancel",function(){c.dialog.getParentEditor().config.wsc_onClose.call(this.document.getWindow().getFrame());
|
74
|
+
a.div_overlay.setDisable();a.onLoadOverlay.setDisable();return!1},this,null,-1)}})})();
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2003-
|
2
|
+
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
3
3
|
For licensing, see LICENSE.html or http://ckeditor.com/license
|
4
4
|
*/
|
5
5
|
CKEDITOR.dialog.add("checkspell",function(a){function c(a,c){var d=0;return function(){"function"==typeof window.doSpell?("undefined"!=typeof e&&window.clearInterval(e),j(a)):180==d++&&window._cancelOnError(c)}}function j(c){var f=new window._SP_FCK_LangCompare,b=CKEDITOR.getUrl(a.plugins.wsc.path+"dialogs/"),e=b+"tmpFrameset.html";window.gFCKPluginName="wsc";f.setDefaulLangCode(a.config.defaultLanguage);window.doSpell({ctrl:g,lang:a.config.wsc_lang||f.getSPLangCode(a.langCode),intLang:a.config.wsc_uiLang||
|
File without changes
|
File without changes
|
@@ -1,362 +1,364 @@
|
|
1
|
-
/*
|
2
|
-
* Youtube Embed Plugin
|
3
|
-
*
|
4
|
-
* @author Jonnas Fonini <contato@fonini.net>
|
5
|
-
* @version 1.0.
|
6
|
-
*/
|
7
|
-
( function() {
|
8
|
-
CKEDITOR.plugins.add( 'youtube',
|
9
|
-
{
|
10
|
-
lang: [ 'en', 'pt', 'ja', 'hu', 'it', 'fr', 'tr', 'ru', 'de', 'ar', 'nl', 'pl' ],
|
11
|
-
init: function( editor )
|
12
|
-
{
|
13
|
-
editor.addCommand( 'youtube', new CKEDITOR.dialogCommand( 'youtube', {
|
14
|
-
allowedContent: 'iframe[!width,!height,!src,!frameborder,!allowfullscreen]; object param[*]'
|
15
|
-
}));
|
16
|
-
|
17
|
-
editor.ui.addButton( 'Youtube',
|
18
|
-
{
|
19
|
-
label : editor.lang.youtube.button,
|
20
|
-
toolbar : 'insert',
|
21
|
-
command : 'youtube',
|
22
|
-
icon : this.path + 'images/icon.png'
|
23
|
-
});
|
24
|
-
|
25
|
-
CKEDITOR.dialog.add( 'youtube', function ( instance )
|
26
|
-
{
|
27
|
-
var video;
|
28
|
-
|
29
|
-
return {
|
30
|
-
title : editor.lang.youtube.title,
|
31
|
-
minWidth : 500,
|
32
|
-
minHeight : 200,
|
33
|
-
contents :
|
34
|
-
[{
|
35
|
-
id : 'youtubePlugin',
|
36
|
-
expand : true,
|
37
|
-
elements :
|
38
|
-
[{
|
39
|
-
id : 'txtEmbed',
|
40
|
-
type : 'textarea',
|
41
|
-
label : editor.lang.youtube.txtEmbed,
|
42
|
-
autofocus : 'autofocus',
|
43
|
-
onChange : function ( api )
|
44
|
-
{
|
45
|
-
handleEmbedChange( this, api );
|
46
|
-
},
|
47
|
-
onKeyUp : function ( api )
|
48
|
-
{
|
49
|
-
handleEmbedChange( this, api );
|
50
|
-
},
|
51
|
-
validate : function ()
|
52
|
-
{
|
53
|
-
if ( this.isEnabled() )
|
54
|
-
{
|
55
|
-
if ( !this.getValue() )
|
56
|
-
{
|
57
|
-
alert( editor.lang.youtube.noCode );
|
58
|
-
return false;
|
59
|
-
}
|
60
|
-
else
|
61
|
-
if ( this.getValue().length === 0 || this.getValue().indexOf( '//' ) === -1 )
|
62
|
-
{
|
63
|
-
alert( editor.lang.youtube.invalidEmbed );
|
64
|
-
return false;
|
65
|
-
}
|
66
|
-
}
|
67
|
-
}
|
68
|
-
},
|
69
|
-
{
|
70
|
-
type : 'html',
|
71
|
-
html : editor.lang.youtube.or + '<hr>'
|
72
|
-
},
|
73
|
-
{
|
74
|
-
type : 'hbox',
|
75
|
-
widths : [ '70%', '15%', '15%' ],
|
76
|
-
children :
|
77
|
-
[
|
78
|
-
{
|
79
|
-
id : 'txtUrl',
|
80
|
-
type : 'text',
|
81
|
-
label : editor.lang.youtube.txtUrl,
|
82
|
-
onChange : function ( api )
|
83
|
-
{
|
84
|
-
handleLinkChange( this, api );
|
85
|
-
},
|
86
|
-
onKeyUp : function ( api )
|
87
|
-
{
|
88
|
-
handleLinkChange( this, api );
|
89
|
-
},
|
90
|
-
validate : function ()
|
91
|
-
{
|
92
|
-
if ( this.isEnabled() )
|
93
|
-
{
|
94
|
-
if ( !this.getValue() )
|
95
|
-
{
|
96
|
-
alert( editor.lang.youtube.noCode );
|
97
|
-
return false;
|
98
|
-
}
|
99
|
-
else{
|
100
|
-
video = ytVidId(this.getValue());
|
101
|
-
|
102
|
-
if ( this.getValue().length === 0 || video === false)
|
103
|
-
{
|
104
|
-
alert( editor.lang.youtube.invalidUrl );
|
105
|
-
return false;
|
106
|
-
}
|
107
|
-
}
|
108
|
-
}
|
109
|
-
}
|
110
|
-
},
|
111
|
-
{
|
112
|
-
type : 'text',
|
113
|
-
id : 'txtWidth',
|
114
|
-
width : '60px',
|
115
|
-
label : editor.lang.youtube.txtWidth,
|
116
|
-
'default' : editor.config.youtube_width != null ? editor.config.youtube_width : '640',
|
117
|
-
validate : function ()
|
118
|
-
{
|
119
|
-
if ( this.getValue() )
|
120
|
-
{
|
121
|
-
var width = parseInt ( this.getValue() ) || 0;
|
122
|
-
|
123
|
-
if ( width === 0 )
|
124
|
-
{
|
125
|
-
alert( editor.lang.youtube.invalidWidth );
|
126
|
-
return false;
|
127
|
-
}
|
128
|
-
}
|
129
|
-
else {
|
130
|
-
alert( editor.lang.youtube.noWidth );
|
131
|
-
return false;
|
132
|
-
}
|
133
|
-
}
|
134
|
-
},
|
135
|
-
{
|
136
|
-
type : 'text',
|
137
|
-
id : 'txtHeight',
|
138
|
-
width : '60px',
|
139
|
-
label : editor.lang.youtube.txtHeight,
|
140
|
-
'default' : editor.config.youtube_height != null ? editor.config.youtube_height : '360',
|
141
|
-
validate : function ()
|
142
|
-
{
|
143
|
-
if ( this.getValue() )
|
144
|
-
{
|
145
|
-
var height = parseInt ( this.getValue() ) || 0;
|
146
|
-
|
147
|
-
if ( height === 0 )
|
148
|
-
{
|
149
|
-
alert( editor.lang.youtube.invalidHeight );
|
150
|
-
return false;
|
151
|
-
}
|
152
|
-
}
|
153
|
-
else {
|
154
|
-
alert( editor.lang.youtube.noHeight );
|
155
|
-
return false;
|
156
|
-
}
|
157
|
-
}
|
158
|
-
}
|
159
|
-
]
|
160
|
-
},
|
161
|
-
{
|
162
|
-
type : 'hbox',
|
163
|
-
widths : [ '55%', '45%' ],
|
164
|
-
children :
|
165
|
-
[
|
166
|
-
{
|
167
|
-
id : 'chkRelated',
|
168
|
-
type : 'checkbox',
|
169
|
-
'default' : editor.config.youtube_related != null ? editor.config.youtube_related : true,
|
170
|
-
label : editor.lang.youtube.chkRelated
|
171
|
-
},
|
172
|
-
{
|
173
|
-
id : 'chkOlderCode',
|
174
|
-
type : 'checkbox',
|
175
|
-
'default' : editor.config.youtube_older != null ? editor.config.youtube_older : false,
|
176
|
-
label : editor.lang.youtube.chkOlderCode
|
177
|
-
}
|
178
|
-
]
|
179
|
-
},
|
180
|
-
{
|
181
|
-
type : 'hbox',
|
182
|
-
widths : [ '55%', '45%' ],
|
183
|
-
children :
|
184
|
-
[
|
185
|
-
{
|
186
|
-
id : 'chkPrivacy',
|
187
|
-
type : 'checkbox',
|
188
|
-
label : editor.lang.youtube.chkPrivacy,
|
189
|
-
'default' : editor.config.youtube_privacy != null ? editor.config.youtube_privacy : false
|
190
|
-
},
|
191
|
-
{
|
192
|
-
id : 'chkAutoplay',
|
193
|
-
type : 'checkbox',
|
194
|
-
'default' : editor.config.youtube_autoplay != null ? editor.config.youtube_autoplay : false,
|
195
|
-
label : editor.lang.youtube.chkAutoplay
|
196
|
-
}
|
197
|
-
]
|
198
|
-
},
|
199
|
-
{
|
200
|
-
type : 'hbox',
|
201
|
-
widths : [ '45%', '55%'],
|
202
|
-
children :
|
203
|
-
[
|
204
|
-
{
|
205
|
-
id : 'txtStartAt',
|
206
|
-
type : 'text',
|
207
|
-
label : editor.lang.youtube.txtStartAt,
|
208
|
-
validate : function ()
|
209
|
-
{
|
210
|
-
if ( this.getValue() )
|
211
|
-
{
|
212
|
-
var str = this.getValue();
|
213
|
-
|
214
|
-
if ( !/^(?:(?:([01]?\d|2[0-3]):)?([0-5]?\d):)?([0-5]?\d)$/i.test( str ) )
|
215
|
-
{
|
216
|
-
alert( editor.lang.youtube.invalidTime );
|
217
|
-
return false;
|
218
|
-
}
|
219
|
-
}
|
220
|
-
}
|
221
|
-
},
|
222
|
-
{
|
223
|
-
id: 'empty',
|
224
|
-
type: 'html',
|
225
|
-
html: ''
|
226
|
-
}
|
227
|
-
]
|
228
|
-
}
|
229
|
-
]
|
230
|
-
}
|
231
|
-
],
|
232
|
-
onOk: function()
|
233
|
-
{
|
234
|
-
var content = '';
|
235
|
-
|
236
|
-
if ( this.getContentElement( 'youtubePlugin', 'txtEmbed' ).isEnabled() )
|
237
|
-
{
|
238
|
-
content = this.getValueOf( 'youtubePlugin', 'txtEmbed' );
|
239
|
-
}
|
240
|
-
else {
|
241
|
-
var url = '//', params = [], startSecs;
|
242
|
-
var width = this.getValueOf( 'youtubePlugin', 'txtWidth' );
|
243
|
-
var height = this.getValueOf( 'youtubePlugin', 'txtHeight' );
|
244
|
-
|
245
|
-
if ( this.getContentElement( 'youtubePlugin', 'chkPrivacy' ).getValue() === true )
|
246
|
-
{
|
247
|
-
url += 'www.youtube-nocookie.com/';
|
248
|
-
}
|
249
|
-
else {
|
250
|
-
url += 'www.youtube.com/';
|
251
|
-
}
|
252
|
-
|
253
|
-
url += 'embed/' + video;
|
254
|
-
|
255
|
-
if ( this.getContentElement( 'youtubePlugin', 'chkRelated' ).getValue() === false )
|
256
|
-
{
|
257
|
-
params.push('rel=0');
|
258
|
-
}
|
259
|
-
|
260
|
-
if ( this.getContentElement( 'youtubePlugin', 'chkAutoplay' ).getValue() === true )
|
261
|
-
{
|
262
|
-
params.push('autoplay=1');
|
263
|
-
}
|
264
|
-
|
265
|
-
startSecs = this.getValueOf( 'youtubePlugin', 'txtStartAt' );
|
266
|
-
if ( startSecs ){
|
267
|
-
var seconds = hmsToSeconds( startSecs );
|
268
|
-
|
269
|
-
params.push('start=' + seconds);
|
270
|
-
}
|
271
|
-
|
272
|
-
if (
|
273
|
-
{
|
274
|
-
url = url.
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
content
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
}
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
*
|
340
|
-
*
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
}
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
1
|
+
/*
|
2
|
+
* Youtube Embed Plugin
|
3
|
+
*
|
4
|
+
* @author Jonnas Fonini <contato@fonini.net>
|
5
|
+
* @version 1.0.10
|
6
|
+
*/
|
7
|
+
( function() {
|
8
|
+
CKEDITOR.plugins.add( 'youtube',
|
9
|
+
{
|
10
|
+
lang: [ 'en', 'pt', 'ja', 'hu', 'it', 'fr', 'tr', 'ru', 'de', 'ar', 'nl', 'pl', 'vi'],
|
11
|
+
init: function( editor )
|
12
|
+
{
|
13
|
+
editor.addCommand( 'youtube', new CKEDITOR.dialogCommand( 'youtube', {
|
14
|
+
allowedContent: 'iframe[!width,!height,!src,!frameborder,!allowfullscreen]; object param[*]'
|
15
|
+
}));
|
16
|
+
|
17
|
+
editor.ui.addButton( 'Youtube',
|
18
|
+
{
|
19
|
+
label : editor.lang.youtube.button,
|
20
|
+
toolbar : 'insert',
|
21
|
+
command : 'youtube',
|
22
|
+
icon : this.path + 'images/icon.png'
|
23
|
+
});
|
24
|
+
|
25
|
+
CKEDITOR.dialog.add( 'youtube', function ( instance )
|
26
|
+
{
|
27
|
+
var video;
|
28
|
+
|
29
|
+
return {
|
30
|
+
title : editor.lang.youtube.title,
|
31
|
+
minWidth : 500,
|
32
|
+
minHeight : 200,
|
33
|
+
contents :
|
34
|
+
[{
|
35
|
+
id : 'youtubePlugin',
|
36
|
+
expand : true,
|
37
|
+
elements :
|
38
|
+
[{
|
39
|
+
id : 'txtEmbed',
|
40
|
+
type : 'textarea',
|
41
|
+
label : editor.lang.youtube.txtEmbed,
|
42
|
+
autofocus : 'autofocus',
|
43
|
+
onChange : function ( api )
|
44
|
+
{
|
45
|
+
handleEmbedChange( this, api );
|
46
|
+
},
|
47
|
+
onKeyUp : function ( api )
|
48
|
+
{
|
49
|
+
handleEmbedChange( this, api );
|
50
|
+
},
|
51
|
+
validate : function ()
|
52
|
+
{
|
53
|
+
if ( this.isEnabled() )
|
54
|
+
{
|
55
|
+
if ( !this.getValue() )
|
56
|
+
{
|
57
|
+
alert( editor.lang.youtube.noCode );
|
58
|
+
return false;
|
59
|
+
}
|
60
|
+
else
|
61
|
+
if ( this.getValue().length === 0 || this.getValue().indexOf( '//' ) === -1 )
|
62
|
+
{
|
63
|
+
alert( editor.lang.youtube.invalidEmbed );
|
64
|
+
return false;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
},
|
69
|
+
{
|
70
|
+
type : 'html',
|
71
|
+
html : editor.lang.youtube.or + '<hr>'
|
72
|
+
},
|
73
|
+
{
|
74
|
+
type : 'hbox',
|
75
|
+
widths : [ '70%', '15%', '15%' ],
|
76
|
+
children :
|
77
|
+
[
|
78
|
+
{
|
79
|
+
id : 'txtUrl',
|
80
|
+
type : 'text',
|
81
|
+
label : editor.lang.youtube.txtUrl,
|
82
|
+
onChange : function ( api )
|
83
|
+
{
|
84
|
+
handleLinkChange( this, api );
|
85
|
+
},
|
86
|
+
onKeyUp : function ( api )
|
87
|
+
{
|
88
|
+
handleLinkChange( this, api );
|
89
|
+
},
|
90
|
+
validate : function ()
|
91
|
+
{
|
92
|
+
if ( this.isEnabled() )
|
93
|
+
{
|
94
|
+
if ( !this.getValue() )
|
95
|
+
{
|
96
|
+
alert( editor.lang.youtube.noCode );
|
97
|
+
return false;
|
98
|
+
}
|
99
|
+
else{
|
100
|
+
video = ytVidId(this.getValue());
|
101
|
+
|
102
|
+
if ( this.getValue().length === 0 || video === false)
|
103
|
+
{
|
104
|
+
alert( editor.lang.youtube.invalidUrl );
|
105
|
+
return false;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
}
|
109
|
+
}
|
110
|
+
},
|
111
|
+
{
|
112
|
+
type : 'text',
|
113
|
+
id : 'txtWidth',
|
114
|
+
width : '60px',
|
115
|
+
label : editor.lang.youtube.txtWidth,
|
116
|
+
'default' : editor.config.youtube_width != null ? editor.config.youtube_width : '640',
|
117
|
+
validate : function ()
|
118
|
+
{
|
119
|
+
if ( this.getValue() )
|
120
|
+
{
|
121
|
+
var width = parseInt ( this.getValue() ) || 0;
|
122
|
+
|
123
|
+
if ( width === 0 )
|
124
|
+
{
|
125
|
+
alert( editor.lang.youtube.invalidWidth );
|
126
|
+
return false;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
else {
|
130
|
+
alert( editor.lang.youtube.noWidth );
|
131
|
+
return false;
|
132
|
+
}
|
133
|
+
}
|
134
|
+
},
|
135
|
+
{
|
136
|
+
type : 'text',
|
137
|
+
id : 'txtHeight',
|
138
|
+
width : '60px',
|
139
|
+
label : editor.lang.youtube.txtHeight,
|
140
|
+
'default' : editor.config.youtube_height != null ? editor.config.youtube_height : '360',
|
141
|
+
validate : function ()
|
142
|
+
{
|
143
|
+
if ( this.getValue() )
|
144
|
+
{
|
145
|
+
var height = parseInt ( this.getValue() ) || 0;
|
146
|
+
|
147
|
+
if ( height === 0 )
|
148
|
+
{
|
149
|
+
alert( editor.lang.youtube.invalidHeight );
|
150
|
+
return false;
|
151
|
+
}
|
152
|
+
}
|
153
|
+
else {
|
154
|
+
alert( editor.lang.youtube.noHeight );
|
155
|
+
return false;
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
]
|
160
|
+
},
|
161
|
+
{
|
162
|
+
type : 'hbox',
|
163
|
+
widths : [ '55%', '45%' ],
|
164
|
+
children :
|
165
|
+
[
|
166
|
+
{
|
167
|
+
id : 'chkRelated',
|
168
|
+
type : 'checkbox',
|
169
|
+
'default' : editor.config.youtube_related != null ? editor.config.youtube_related : true,
|
170
|
+
label : editor.lang.youtube.chkRelated
|
171
|
+
},
|
172
|
+
{
|
173
|
+
id : 'chkOlderCode',
|
174
|
+
type : 'checkbox',
|
175
|
+
'default' : editor.config.youtube_older != null ? editor.config.youtube_older : false,
|
176
|
+
label : editor.lang.youtube.chkOlderCode
|
177
|
+
}
|
178
|
+
]
|
179
|
+
},
|
180
|
+
{
|
181
|
+
type : 'hbox',
|
182
|
+
widths : [ '55%', '45%' ],
|
183
|
+
children :
|
184
|
+
[
|
185
|
+
{
|
186
|
+
id : 'chkPrivacy',
|
187
|
+
type : 'checkbox',
|
188
|
+
label : editor.lang.youtube.chkPrivacy,
|
189
|
+
'default' : editor.config.youtube_privacy != null ? editor.config.youtube_privacy : false
|
190
|
+
},
|
191
|
+
{
|
192
|
+
id : 'chkAutoplay',
|
193
|
+
type : 'checkbox',
|
194
|
+
'default' : editor.config.youtube_autoplay != null ? editor.config.youtube_autoplay : false,
|
195
|
+
label : editor.lang.youtube.chkAutoplay
|
196
|
+
}
|
197
|
+
]
|
198
|
+
},
|
199
|
+
{
|
200
|
+
type : 'hbox',
|
201
|
+
widths : [ '45%', '55%'],
|
202
|
+
children :
|
203
|
+
[
|
204
|
+
{
|
205
|
+
id : 'txtStartAt',
|
206
|
+
type : 'text',
|
207
|
+
label : editor.lang.youtube.txtStartAt,
|
208
|
+
validate : function ()
|
209
|
+
{
|
210
|
+
if ( this.getValue() )
|
211
|
+
{
|
212
|
+
var str = this.getValue();
|
213
|
+
|
214
|
+
if ( !/^(?:(?:([01]?\d|2[0-3]):)?([0-5]?\d):)?([0-5]?\d)$/i.test( str ) )
|
215
|
+
{
|
216
|
+
alert( editor.lang.youtube.invalidTime );
|
217
|
+
return false;
|
218
|
+
}
|
219
|
+
}
|
220
|
+
}
|
221
|
+
},
|
222
|
+
{
|
223
|
+
id: 'empty',
|
224
|
+
type: 'html',
|
225
|
+
html: ''
|
226
|
+
}
|
227
|
+
]
|
228
|
+
}
|
229
|
+
]
|
230
|
+
}
|
231
|
+
],
|
232
|
+
onOk: function()
|
233
|
+
{
|
234
|
+
var content = '';
|
235
|
+
|
236
|
+
if ( this.getContentElement( 'youtubePlugin', 'txtEmbed' ).isEnabled() )
|
237
|
+
{
|
238
|
+
content = this.getValueOf( 'youtubePlugin', 'txtEmbed' );
|
239
|
+
}
|
240
|
+
else {
|
241
|
+
var url = '//', params = [], startSecs;
|
242
|
+
var width = this.getValueOf( 'youtubePlugin', 'txtWidth' );
|
243
|
+
var height = this.getValueOf( 'youtubePlugin', 'txtHeight' );
|
244
|
+
|
245
|
+
if ( this.getContentElement( 'youtubePlugin', 'chkPrivacy' ).getValue() === true )
|
246
|
+
{
|
247
|
+
url += 'www.youtube-nocookie.com/';
|
248
|
+
}
|
249
|
+
else {
|
250
|
+
url += 'www.youtube.com/';
|
251
|
+
}
|
252
|
+
|
253
|
+
url += 'embed/' + video;
|
254
|
+
|
255
|
+
if ( this.getContentElement( 'youtubePlugin', 'chkRelated' ).getValue() === false )
|
256
|
+
{
|
257
|
+
params.push('rel=0');
|
258
|
+
}
|
259
|
+
|
260
|
+
if ( this.getContentElement( 'youtubePlugin', 'chkAutoplay' ).getValue() === true )
|
261
|
+
{
|
262
|
+
params.push('autoplay=1');
|
263
|
+
}
|
264
|
+
|
265
|
+
startSecs = this.getValueOf( 'youtubePlugin', 'txtStartAt' );
|
266
|
+
if ( startSecs ){
|
267
|
+
var seconds = hmsToSeconds( startSecs );
|
268
|
+
|
269
|
+
params.push('start=' + seconds);
|
270
|
+
}
|
271
|
+
|
272
|
+
if ( params.length > 0 )
|
273
|
+
{
|
274
|
+
url = url + '?' + params.join( '&' );
|
275
|
+
}
|
276
|
+
|
277
|
+
if ( this.getContentElement( 'youtubePlugin', 'chkOlderCode' ).getValue() === true )
|
278
|
+
{
|
279
|
+
url = url.replace('embed/', 'v/');
|
280
|
+
url = url.replace(/&/g, '&');
|
281
|
+
|
282
|
+
if ( url.indexOf('?')== -1 )
|
283
|
+
{
|
284
|
+
url += '?';
|
285
|
+
}
|
286
|
+
else {
|
287
|
+
url += '&';
|
288
|
+
}
|
289
|
+
url += 'hl=pt_BR&version=3';
|
290
|
+
|
291
|
+
content = '<object width="' + width + '" height="' + height + '">';
|
292
|
+
content += '<param name="movie" value="' + url + '"></param>';
|
293
|
+
content += '<param name="allowFullScreen" value="true"></param>';
|
294
|
+
content += '<param name="allowscriptaccess" value="always"></param>';
|
295
|
+
content += '<embed src="' + url + '" type="application/x-shockwave-flash" ';
|
296
|
+
content += 'width="' + width + '" height="' + height + '" allowscriptaccess="always" ';
|
297
|
+
content += 'allowfullscreen="true"></embed>';
|
298
|
+
content += '</object>';
|
299
|
+
}
|
300
|
+
else {
|
301
|
+
content = '<iframe width="' + width + '" height="' + height + '" src="' + url + '" ';
|
302
|
+
content += 'frameborder="0" allowfullscreen></iframe>';
|
303
|
+
}
|
304
|
+
}
|
305
|
+
|
306
|
+
var instance = this.getParentEditor();
|
307
|
+
instance.insertHtml( content );
|
308
|
+
}
|
309
|
+
};
|
310
|
+
});
|
311
|
+
}
|
312
|
+
});
|
313
|
+
})();
|
314
|
+
|
315
|
+
function handleLinkChange( el, api )
|
316
|
+
{
|
317
|
+
if ( el.getValue().length > 0 )
|
318
|
+
{
|
319
|
+
el.getDialog().getContentElement( 'youtubePlugin', 'txtEmbed' ).disable();
|
320
|
+
}
|
321
|
+
else {
|
322
|
+
el.getDialog().getContentElement( 'youtubePlugin', 'txtEmbed' ).enable();
|
323
|
+
}
|
324
|
+
}
|
325
|
+
|
326
|
+
function handleEmbedChange( el, api )
|
327
|
+
{
|
328
|
+
if ( el.getValue().length > 0 )
|
329
|
+
{
|
330
|
+
el.getDialog().getContentElement( 'youtubePlugin', 'txtUrl' ).disable();
|
331
|
+
}
|
332
|
+
else {
|
333
|
+
el.getDialog().getContentElement( 'youtubePlugin', 'txtUrl' ).enable();
|
334
|
+
}
|
335
|
+
}
|
336
|
+
|
337
|
+
|
338
|
+
/**
|
339
|
+
* JavaScript function to match (and return) the video Id
|
340
|
+
* of any valid Youtube Url, given as input string.
|
341
|
+
* @author: Stephan Schmitz <eyecatchup@gmail.com>
|
342
|
+
* @url: http://stackoverflow.com/a/10315969/624466
|
343
|
+
*/
|
344
|
+
function ytVidId( url )
|
345
|
+
{
|
346
|
+
var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
|
347
|
+
return ( url.match( p ) ) ? RegExp.$1 : false;
|
348
|
+
}
|
349
|
+
|
350
|
+
/**
|
351
|
+
* Converts time in hms format to seconds only
|
352
|
+
*/
|
353
|
+
function hmsToSeconds( time )
|
354
|
+
{
|
355
|
+
var arr = time.split(':'), s = 0, m = 1;
|
356
|
+
|
357
|
+
while (arr.length > 0)
|
358
|
+
{
|
359
|
+
s += m * parseInt(arr.pop(), 10);
|
360
|
+
m *= 60;
|
361
|
+
}
|
362
|
+
|
363
|
+
return s;
|
364
|
+
}
|