summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2013-07-15 14:18:47 +0100
committerlsces <lester@lsces.co.uk>2013-07-15 14:18:47 +0100
commitde6d09676a9527919813a4474cc28af554a35fe1 (patch)
treea2b3c2ddf01eca1600e130125733d324b59744bb /plugins
parent1d0d1733baef4dbab3f8cd7d7150a55ef2828464 (diff)
downloadckeditor-de6d09676a9527919813a4474cc28af554a35fe1.tar.gz
ckeditor-de6d09676a9527919813a4474cc28af554a35fe1.tar.bz2
ckeditor-de6d09676a9527919813a4474cc28af554a35fe1.zip
Upgrade to CKEditor V4
Directory structure changed so many files removed and replace in a new location This batch is the actuall file changes
Diffstat (limited to 'plugins')
-rw-r--r--plugins/a11yhelp/dialogs/a11yhelp.js220
-rw-r--r--plugins/about/dialogs/about.js77
-rw-r--r--plugins/clipboard/dialogs/paste.js233
-rw-r--r--plugins/colordialog/dialogs/colordialog.js345
-rw-r--r--plugins/dialog/dialogDefinition.js1010
-rw-r--r--plugins/div/dialogs/div.js461
-rw-r--r--plugins/find/dialogs/find.js793
-rw-r--r--plugins/flash/dialogs/flash.js675
-rw-r--r--plugins/forms/dialogs/button.js104
-rw-r--r--plugins/forms/dialogs/checkbox.js134
-rw-r--r--plugins/forms/dialogs/form.js155
-rw-r--r--plugins/forms/dialogs/hiddenfield.js89
-rw-r--r--plugins/forms/dialogs/radio.js119
-rw-r--r--plugins/forms/dialogs/select.js510
-rw-r--r--plugins/forms/dialogs/textarea.js122
-rw-r--r--plugins/forms/dialogs/textfield.js186
-rw-r--r--plugins/iframe/dialogs/iframe.js223
-rw-r--r--plugins/image/dialogs/image.js1220
-rw-r--r--plugins/link/dialogs/anchor.js124
-rw-r--r--plugins/link/dialogs/link.js1298
-rw-r--r--plugins/liststyle/dialogs/liststyle.js204
-rw-r--r--plugins/pastefromword/filter/default.js1220
-rw-r--r--plugins/smiley/dialogs/smiley.js197
-rw-r--r--plugins/specialchar/dialogs/specialchar.js309
-rw-r--r--plugins/specialchar/lang/_translationstatus.txt78
-rw-r--r--plugins/specialchar/lang/cs.js9
-rw-r--r--plugins/specialchar/lang/cy.js9
-rw-r--r--plugins/specialchar/lang/de.js9
-rw-r--r--plugins/specialchar/lang/en.js9
-rw-r--r--plugins/specialchar/lang/eo.js9
-rw-r--r--plugins/specialchar/lang/et.js9
-rw-r--r--plugins/specialchar/lang/fa.js9
-rw-r--r--plugins/specialchar/lang/fi.js9
-rw-r--r--plugins/specialchar/lang/fr.js9
-rw-r--r--plugins/specialchar/lang/hr.js9
-rw-r--r--plugins/specialchar/lang/it.js9
-rw-r--r--plugins/specialchar/lang/nb.js9
-rw-r--r--plugins/specialchar/lang/nl.js9
-rw-r--r--plugins/specialchar/lang/no.js9
-rw-r--r--plugins/specialchar/lang/tr.js9
-rw-r--r--plugins/specialchar/lang/ug.js9
-rw-r--r--plugins/specialchar/lang/zh-cn.js9
-rw-r--r--plugins/table/dialogs/table.js563
-rw-r--r--plugins/tabletools/dialogs/tableCell.js424
-rw-r--r--plugins/templates/dialogs/templates.js208
-rw-r--r--plugins/templates/templates/default.js92
-rw-r--r--plugins/wsc/dialogs/ciframe.html19
-rw-r--r--plugins/wsc/dialogs/tmpFrameset.html2
-rw-r--r--plugins/wsc/dialogs/wsc.css78
-rw-r--r--plugins/wsc/dialogs/wsc.js2097
50 files changed, 13485 insertions, 257 deletions
diff --git a/plugins/a11yhelp/dialogs/a11yhelp.js b/plugins/a11yhelp/dialogs/a11yhelp.js
index e4bd208..f8a6f81 100644
--- a/plugins/a11yhelp/dialogs/a11yhelp.js
+++ b/plugins/a11yhelp/dialogs/a11yhelp.js
@@ -1,7 +1,217 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-CKEDITOR.dialog.add('a11yHelp',function(a){var b=a.lang.accessibilityHelp,c=CKEDITOR.tools.getNextId(),d={8:'BACKSPACE',9:'TAB',13:'ENTER',16:'SHIFT',17:'CTRL',18:'ALT',19:'PAUSE',20:'CAPSLOCK',27:'ESCAPE',33:'PAGE UP',34:'PAGE DOWN',35:'END',36:'HOME',37:'LEFT ARROW',38:'UP ARROW',39:'RIGHT ARROW',40:'DOWN ARROW',45:'INSERT',46:'DELETE',91:'LEFT WINDOW KEY',92:'RIGHT WINDOW KEY',93:'SELECT KEY',96:'NUMPAD 0',97:'NUMPAD 1',98:'NUMPAD 2',99:'NUMPAD 3',100:'NUMPAD 4',101:'NUMPAD 5',102:'NUMPAD 6',103:'NUMPAD 7',104:'NUMPAD 8',105:'NUMPAD 9',106:'MULTIPLY',107:'ADD',109:'SUBTRACT',110:'DECIMAL POINT',111:'DIVIDE',112:'F1',113:'F2',114:'F3',115:'F4',116:'F5',117:'F6',118:'F7',119:'F8',120:'F9',121:'F10',122:'F11',123:'F12',144:'NUM LOCK',145:'SCROLL LOCK',186:'SEMI-COLON',187:'EQUAL SIGN',188:'COMMA',189:'DASH',190:'PERIOD',191:'FORWARD SLASH',192:'GRAVE ACCENT',219:'OPEN BRACKET',220:'BACK SLASH',221:'CLOSE BRAKET',222:'SINGLE QUOTE'};d[CKEDITOR.ALT]='ALT';d[CKEDITOR.SHIFT]='SHIFT';d[CKEDITOR.CTRL]='CTRL';var e=[CKEDITOR.ALT,CKEDITOR.SHIFT,CKEDITOR.CTRL];function f(j){var k,l,m=[];for(var n=0;n<e.length;n++){l=e[n];k=j/e[n];if(k>1&&k<=2){j-=l;m.push(d[l]);}}m.push(d[j]||String.fromCharCode(j));return m.join('+');};var g=/\$\{(.*?)\}/g;function h(j,k){var l=a.config.keystrokes,m,n=l.length;for(var o=0;o<n;o++){m=l[o];if(m[1]==k)break;}return f(m[0]);};function i(){var j='<div class="cke_accessibility_legend" role="document" aria-labelledby="'+c+'_arialbl" tabIndex="-1">%1</div>'+'<span id="'+c+'_arialbl" class="cke_voice_label">'+b.contents+' </span>',k='<h1>%1</h1><dl>%2</dl>',l='<dt>%1</dt><dd>%2</dd>',m=[],n=b.legend,o=n.length;for(var p=0;p<o;p++){var q=n[p],r=[],s=q.items,t=s.length;for(var u=0;u<t;u++){var v=s[u],w;w=l.replace('%1',v.name).replace('%2',v.legend.replace(g,h));r.push(w);}m.push(k.replace('%1',q.name).replace('%2',r.join('')));}return j.replace('%1',m.join(''));};return{title:b.title,minWidth:600,minHeight:400,contents:[{id:'info',label:a.lang.common.generalTab,expand:true,elements:[{type:'html',id:'legends',style:'white-space:normal;',focus:function(){},html:i()+'<style type="text/css">'+'.cke_accessibility_legend'+'{'+'width:600px;'+'height:400px;'+'padding-right:5px;'+'overflow-y:auto;'+'overflow-x:hidden;'+'}'+'.cke_browser_quirks .cke_accessibility_legend,'+'.cke_browser_ie6 .cke_accessibility_legend'+'{'+'height:390px'+'}'+'.cke_accessibility_legend *'+'{'+'white-space:normal;'+'}'+'.cke_accessibility_legend h1'+'{'+'font-size: 20px;'+'border-bottom: 1px solid #AAA;'+'margin: 5px 0px 15px;'+'}'+'.cke_accessibility_legend dl'+'{'+'margin-left: 5px;'+'}'+'.cke_accessibility_legend dt'+'{'+'font-size: 13px;'+'font-weight: bold;'+'}'+'.cke_accessibility_legend dd'+'{'+'margin:10px'+'}'+'</style>'}]}],buttons:[CKEDITOR.dialog.cancelButton]};
+CKEDITOR.dialog.add( 'a11yHelp', function( editor ) {
+ var lang = editor.lang.a11yhelp,
+ id = CKEDITOR.tools.getNextId();
+
+ // CharCode <-> KeyChar.
+ var keyMap = {
+ 8: "BACKSPACE",
+ 9: "TAB",
+ 13: "ENTER",
+ 16: "SHIFT",
+ 17: "CTRL",
+ 18: "ALT",
+ 19: "PAUSE",
+ 20: "CAPSLOCK",
+ 27: "ESCAPE",
+ 33: "PAGE UP",
+ 34: "PAGE DOWN",
+ 35: "END",
+ 36: "HOME",
+ 37: "LEFT ARROW",
+ 38: "UP ARROW",
+ 39: "RIGHT ARROW",
+ 40: "DOWN ARROW",
+ 45: "INSERT",
+ 46: "DELETE",
+ 91: "LEFT WINDOW KEY",
+ 92: "RIGHT WINDOW KEY",
+ 93: "SELECT KEY",
+ 96: "NUMPAD 0",
+ 97: "NUMPAD 1",
+ 98: "NUMPAD 2",
+ 99: "NUMPAD 3",
+ 100: "NUMPAD 4",
+ 101: "NUMPAD 5",
+ 102: "NUMPAD 6",
+ 103: "NUMPAD 7",
+ 104: "NUMPAD 8",
+ 105: "NUMPAD 9",
+ 106: "MULTIPLY",
+ 107: "ADD",
+ 109: "SUBTRACT",
+ 110: "DECIMAL POINT",
+ 111: "DIVIDE",
+ 112: "F1",
+ 113: "F2",
+ 114: "F3",
+ 115: "F4",
+ 116: "F5",
+ 117: "F6",
+ 118: "F7",
+ 119: "F8",
+ 120: "F9",
+ 121: "F10",
+ 122: "F11",
+ 123: "F12",
+ 144: "NUM LOCK",
+ 145: "SCROLL LOCK",
+ 186: "SEMI-COLON",
+ 187: "EQUAL SIGN",
+ 188: "COMMA",
+ 189: "DASH",
+ 190: "PERIOD",
+ 191: "FORWARD SLASH",
+ 192: "GRAVE ACCENT",
+ 219: "OPEN BRACKET",
+ 220: "BACK SLASH",
+ 221: "CLOSE BRAKET",
+ 222: "SINGLE QUOTE"
+ };
+
+ // Modifier keys override.
+ keyMap[ CKEDITOR.ALT ] = 'ALT';
+ keyMap[ CKEDITOR.SHIFT ] = 'SHIFT';
+ keyMap[ CKEDITOR.CTRL ] = 'CTRL';
+
+ // Sort in desc.
+ var modifiers = [ CKEDITOR.ALT, CKEDITOR.SHIFT, CKEDITOR.CTRL ];
+
+ function representKeyStroke( keystroke ) {
+ var quotient, modifier,
+ presentation = [];
+
+ for ( var i = 0; i < modifiers.length; i++ ) {
+ modifier = modifiers[ i ];
+ quotient = keystroke / modifiers[ i ];
+ if ( quotient > 1 && quotient <= 2 ) {
+ keystroke -= modifier;
+ presentation.push( keyMap[ modifier ] );
+ }
+ }
+
+ presentation.push( keyMap[ keystroke ] || String.fromCharCode( keystroke ) );
+
+ return presentation.join( '+' );
+ }
+
+ var variablesPattern = /\$\{(.*?)\}/g;
+
+ var replaceVariables = (function() {
+ // Swaps keystrokes with their commands in object literal.
+ // This makes searching keystrokes by command much easier.
+ var keystrokesByCode = editor.keystrokeHandler.keystrokes,
+ keystrokesByName = {};
+
+ for ( var i in keystrokesByCode )
+ keystrokesByName[ keystrokesByCode[ i ] ] = i;
+
+ return function( match, name ) {
+ // Return the keystroke representation or leave match untouched
+ // if there's no keystroke for such command.
+ return keystrokesByName[ name ] ? representKeyStroke( keystrokesByName[ name ] ) : match;
+ };
+ })();
+
+ // Create the help list directly from lang file entries.
+ function buildHelpContents() {
+ var pageTpl = '<div class="cke_accessibility_legend" role="document" aria-labelledby="' + id + '_arialbl" tabIndex="-1">%1</div>' +
+ '<span id="' + id + '_arialbl" class="cke_voice_label">' + lang.contents + ' </span>',
+ sectionTpl = '<h1>%1</h1><dl>%2</dl>',
+ itemTpl = '<dt>%1</dt><dd>%2</dd>';
+
+ var pageHtml = [],
+ sections = lang.legend,
+ sectionLength = sections.length;
+
+ for ( var i = 0; i < sectionLength; i++ ) {
+ var section = sections[ i ],
+ sectionHtml = [],
+ items = section.items,
+ itemsLength = items.length;
+
+ for ( var j = 0; j < itemsLength; j++ ) {
+ var item = items[ j ],
+ itemLegend = item.legend.replace( variablesPattern, replaceVariables );
+
+ // (#9765) If some commands haven't been replaced in the legend,
+ // most likely their keystrokes are unavailable and we shouldn't include
+ // them in our help list.
+ if ( itemLegend.match( variablesPattern ) )
+ continue;
+
+ sectionHtml.push( itemTpl.replace( '%1', item.name ).replace( '%2', itemLegend ) );
+ }
+
+ pageHtml.push( sectionTpl.replace( '%1', section.name ).replace( '%2', sectionHtml.join( '' ) ) );
+ }
+
+ return pageTpl.replace( '%1', pageHtml.join( '' ) );
+ }
+
+ return {
+ title: lang.title,
+ minWidth: 600,
+ minHeight: 400,
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.common.generalTab,
+ expand: true,
+ elements: [
+ {
+ type: 'html',
+ id: 'legends',
+ style: 'white-space:normal;',
+ focus: function() { this.getElement().focus(); },
+ html: buildHelpContents() + '<style type="text/css">' +
+ '.cke_accessibility_legend' +
+ '{' +
+ 'width:600px;' +
+ 'height:400px;' +
+ 'padding-right:5px;' +
+ 'overflow-y:auto;' +
+ 'overflow-x:hidden;' +
+ '}' +
+ // Some adjustments are to be done for IE6 and Quirks to work "properly" (#5757)
+ '.cke_browser_quirks .cke_accessibility_legend,' +
+ '.cke_browser_ie6 .cke_accessibility_legend' +
+ '{' +
+ 'height:390px' +
+ '}' +
+ // Override non-wrapping white-space rule in reset css.
+ '.cke_accessibility_legend *' +
+ '{' +
+ 'white-space:normal;' +
+ '}' +
+ '.cke_accessibility_legend h1' +
+ '{' +
+ 'font-size: 20px;' +
+ 'border-bottom: 1px solid #AAA;' +
+ 'margin: 5px 0px 15px;' +
+ '}' +
+ '.cke_accessibility_legend dl' +
+ '{' +
+ 'margin-left: 5px;' +
+ '}' +
+ '.cke_accessibility_legend dt' +
+ '{' +
+ 'font-size: 13px;' +
+ 'font-weight: bold;' +
+ '}' +
+ '.cke_accessibility_legend dd' +
+ '{' +
+ 'margin:10px' +
+ '}' +
+ '</style>'
+ }
+ ]
+ }
+ ],
+ buttons: [ CKEDITOR.dialog.cancelButton ]
+ };
});
diff --git a/plugins/about/dialogs/about.js b/plugins/about/dialogs/about.js
index 77c1334..8c1f2e1 100644
--- a/plugins/about/dialogs/about.js
+++ b/plugins/about/dialogs/about.js
@@ -1,6 +1,73 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-CKEDITOR.dialog.add('about',function(a){var b=a.lang.about;return{title:CKEDITOR.env.ie?b.dlgTitle:b.title,minWidth:390,minHeight:230,contents:[{id:'tab1',label:'',title:'',expand:true,padding:0,elements:[{type:'html',html:'<style type="text/css">.cke_about_container{color:#000 !important;padding:10px 10px 0;margin-top:5px}.cke_about_container p{margin: 0 0 10px;}.cke_about_container .cke_about_logo{height:81px;background-color:#fff;background-image:url('+CKEDITOR.plugins.get('about').path+'dialogs/logo_ckeditor.png);'+'background-position:center; '+'background-repeat:no-repeat;'+'margin-bottom:10px;'+'}'+'.cke_about_container a'+'{'+'cursor:pointer !important;'+'color:blue !important;'+'text-decoration:underline !important;'+'}'+'</style>'+'<div class="cke_about_container">'+'<div class="cke_about_logo"></div>'+'<p>'+'CKEditor '+CKEDITOR.version+' (revision '+CKEDITOR.revision+')<br>'+'<a href="http://ckeditor.com/">http://ckeditor.com</a>'+'</p>'+'<p>'+b.help.replace('$1','<a href="http://docs.cksource.com/CKEditor_3.x/Users_Guide/Quick_Reference">'+b.userGuide+'</a>')+'</p>'+'<p>'+b.moreInfo+'<br>'+'<a href="http://ckeditor.com/license">http://ckeditor.com/license</a>'+'</p>'+'<p>'+b.copy.replace('$1','<a href="http://cksource.com/">CKSource</a> - Frederico Knabben')+'</p>'+'</div>'}]}],buttons:[CKEDITOR.dialog.cancelButton]};});
+CKEDITOR.dialog.add( 'about', function( editor ) {
+ var lang = editor.lang.about;
+
+ return {
+ title: CKEDITOR.env.ie ? lang.dlgTitle : lang.title,
+ minWidth: 390,
+ minHeight: 230,
+ contents: [
+ {
+ id: 'tab1',
+ label: '',
+ title: '',
+ expand: true,
+ padding: 0,
+ elements: [
+ {
+ type: 'html',
+ html: '<style type="text/css">' +
+ '.cke_about_container' +
+ '{' +
+ 'color:#000 !important;' +
+ 'padding:10px 10px 0;' +
+ 'margin-top:5px' +
+ '}' +
+ '.cke_about_container p' +
+ '{' +
+ 'margin: 0 0 10px;' +
+ '}' +
+ '.cke_about_container .cke_about_logo' +
+ '{' +
+ 'height:81px;' +
+ 'background-color:#fff;' +
+ 'background-image:url(' + CKEDITOR.plugins.get( 'about' ).path + 'dialogs/logo_ckeditor.png);' +
+ 'background-position:center; ' +
+ 'background-repeat:no-repeat;' +
+ 'margin-bottom:10px;' +
+ '}' +
+ '.cke_about_container a' +
+ '{' +
+ 'cursor:pointer !important;' +
+ 'color:#00B2CE !important;' +
+ 'text-decoration:underline !important;' +
+ '}' +
+ '</style>' +
+ '<div class="cke_about_container">' +
+ '<div class="cke_about_logo"></div>' +
+ '<p>' +
+ 'CKEditor ' + CKEDITOR.version + ' (revision ' + CKEDITOR.revision + ')<br>' +
+ '<a href="http://ckeditor.com/">http://ckeditor.com</a>' +
+ '</p>' +
+ '<p>' +
+ lang.help.replace( '$1', '<a href="http://docs.ckeditor.com/user">' + lang.userGuide + '</a>' ) +
+ '</p>' +
+ '<p>' +
+ lang.moreInfo + '<br>' +
+ '<a href="http://ckeditor.com/about/license">http://ckeditor.com/about/license</a>' +
+ '</p>' +
+ '<p>' +
+ lang.copy.replace( '$1', '<a href="http://cksource.com/">CKSource</a> - Frederico Knabben' ) +
+ '</p>' +
+ '</div>'
+ }
+ ]
+ }
+ ],
+ buttons: [ CKEDITOR.dialog.cancelButton ]
+ };
+});
diff --git a/plugins/clipboard/dialogs/paste.js b/plugins/clipboard/dialogs/paste.js
index ed1a423..892c6c3 100644
--- a/plugins/clipboard/dialogs/paste.js
+++ b/plugins/clipboard/dialogs/paste.js
@@ -1,7 +1,228 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-CKEDITOR.dialog.add('paste',function(a){var b=a.lang.clipboard,c=CKEDITOR.env.isCustomDomain();function d(e){var f=new CKEDITOR.dom.document(e.document),g=f.$,h=f.getById('cke_actscrpt');h&&h.remove();CKEDITOR.env.ie?g.body.contentEditable='true':g.designMode='on';if(CKEDITOR.env.ie&&CKEDITOR.env.version<8)f.getWindow().on('blur',function(){g.selection.empty();});f.on('keydown',function(i){var j=i.data,k=j.getKeystroke(),l;switch(k){case 27:this.hide();l=1;break;case 9:case CKEDITOR.SHIFT+9:this.changeFocus(1);l=1;}l&&j.preventDefault();},this);a.fire('ariaWidget',new CKEDITOR.dom.element(e.frameElement));};return{title:b.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?370:350,minHeight:CKEDITOR.env.quirks?250:245,onShow:function(){this.parts.dialog.$.offsetHeight;this.setupContent();},onHide:function(){if(CKEDITOR.env.ie)this.getParentEditor().document.getBody().$.contentEditable='true';},onLoad:function(){if((CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&a.lang.dir=='rtl')this.parts.contents.setStyle('overflow','hidden');},onOk:function(){this.commitContent();},contents:[{id:'general',label:a.lang.common.generalTab,elements:[{type:'html',id:'securityMsg',html:'<div style="white-space:normal;width:340px;">'+b.securityMsg+'</div>'},{type:'html',id:'pasteMsg',html:'<div style="white-space:normal;width:340px;">'+b.pasteMsg+'</div>'},{type:'html',id:'editing_area',style:'width: 100%; height: 100%;',html:'',focus:function(){var e=this.getInputElement().$.contentWindow;setTimeout(function(){e.focus();},500);},setup:function(){var e=this.getDialog(),f='<html dir="'+a.config.contentsLangDirection+'"'+' lang="'+(a.config.contentsLanguage||a.langCode)+'">'+'<head><style>body { margin: 3px; height: 95%; } </style></head><body>'+'<script id="cke_actscrpt" type="text/javascript">'+'window.parent.CKEDITOR.tools.callFunction( '+CKEDITOR.tools.addFunction(d,e)+', this );'+'</script></body>'+'</html>',g=CKEDITOR.env.air?'javascript:void(0)':c?"javascript:void((function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})())"':'',h=CKEDITOR.dom.element.createFromHtml('<iframe class="cke_pasteframe" frameborder="0" allowTransparency="true" src="'+g+'"'+' role="region"'+' aria-label="'+b.pasteArea+'"'+' aria-describedby="'+e.getContentElement('general','pasteMsg').domId+'"'+' aria-multiple="true"'+'></iframe>');h.on('load',function(k){k.removeListener();var l=h.getFrameDocument();l.write(f);if(CKEDITOR.env.air)d.call(this,l.getWindow().$);
-},e);h.setCustomData('dialog',e);var i=this.getElement();i.setHtml('');i.append(h);if(CKEDITOR.env.ie){var j=CKEDITOR.dom.element.createFromHtml('<span tabindex="-1" style="position:absolute;" role="presentation"></span>');j.on('focus',function(){h.$.contentWindow.focus();});i.append(j);this.focus=function(){j.focus();this.fire('focus');};}this.getInputElement=function(){return h;};if(CKEDITOR.env.ie){i.setStyle('display','block');i.setStyle('height',h.$.offsetHeight+2+'px');}},commit:function(e){var f=this.getElement(),g=this.getDialog().getParentEditor(),h=this.getInputElement().getFrameDocument().getBody(),i=h.getBogus(),j;i&&i.remove();j=h.getHtml();setTimeout(function(){g.fire('paste',{html:j});},0);}}]}]};});
+CKEDITOR.dialog.add( 'paste', function( editor ) {
+ var lang = editor.lang.clipboard;
+
+ function onPasteFrameLoad( win ) {
+ var doc = new CKEDITOR.dom.document( win.document ),
+ body = doc.getBody(),
+ script = doc.getById( 'cke_actscrpt' );
+
+ script && script.remove();
+
+ body.setAttribute( 'contenteditable', true );
+
+ // IE before version 8 will leave cursor blinking inside the document after
+ // editor blurred unless we clean up the selection. (#4716)
+ if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) {
+ doc.getWindow().on( 'blur', function() {
+ doc.$.selection.empty();
+ });
+ }
+
+ doc.on( 'keydown', function( e ) {
+ var domEvent = e.data,
+ key = domEvent.getKeystroke(),
+ processed;
+
+ switch ( key ) {
+ case 27:
+ this.hide();
+ processed = 1;
+ break;
+
+ case 9:
+ case CKEDITOR.SHIFT + 9:
+ this.changeFocus( 1 );
+ processed = 1;
+ }
+
+ processed && domEvent.preventDefault();
+ }, this );
+
+ editor.fire( 'ariaWidget', new CKEDITOR.dom.element( win.frameElement ) );
+
+ // Handle pending focus.
+ if ( doc.getWindow().getFrame().removeCustomData( 'pendingFocus' ) )
+ body.focus();
+ }
+
+ // If pasteDialogCommit wasn't canceled by e.g. editor.getClipboardData
+ // then fire paste event.
+ // Do not use editor#paste, because it would start from beforePaste event.
+ editor.on( 'pasteDialogCommit', function( evt ) {
+ if ( evt.data )
+ editor.fire( 'paste', { type: 'auto', dataValue: evt.data } );
+ }, null, null, 1000 );
+
+ return {
+ title: lang.title,
+
+ minWidth: CKEDITOR.env.ie && CKEDITOR.env.quirks ? 370 : 350,
+ minHeight: CKEDITOR.env.quirks ? 250 : 245,
+ onShow: function() {
+ // FIREFOX BUG: Force the browser to render the dialog to make the to-be-
+ // inserted iframe editable. (#3366)
+ this.parts.dialog.$.offsetHeight;
+
+ this.setupContent();
+
+ // Set dialog title to the custom value (set e.g. in editor.openDialog callback) and reset this value.
+ // If custom title not set, use default one.
+ this.parts.title.setHtml( this.customTitle || lang.title );
+ this.customTitle = null;
+ },
+
+ onLoad: function() {
+ if ( ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) && editor.lang.dir == 'rtl' )
+ this.parts.contents.setStyle( 'overflow', 'hidden' );
+ },
+
+ onOk: function() {
+ this.commitContent();
+ },
+
+ contents: [
+ {
+ id: 'general',
+ label: editor.lang.common.generalTab,
+ elements: [
+ {
+ type: 'html',
+ id: 'securityMsg',
+ html: '<div style="white-space:normal;width:340px">' + lang.securityMsg + '</div>'
+ },
+ {
+ type: 'html',
+ id: 'pasteMsg',
+ html: '<div style="white-space:normal;width:340px">' + lang.pasteMsg + '</div>'
+ },
+ {
+ type: 'html',
+ id: 'editing_area',
+ style: 'width:100%;height:100%',
+ html: '',
+ focus: function() {
+ var iframe = this.getInputElement(),
+ doc = iframe.getFrameDocument(),
+ body = doc.getBody();
+
+ // Frame content may not loaded at the moment.
+ if ( !body || body.isReadOnly() )
+ iframe.setCustomData( 'pendingFocus', 1 );
+ else
+ body.focus();
+ },
+ setup: function() {
+ var dialog = this.getDialog();
+ var htmlToLoad = '<html dir="' + editor.config.contentsLangDirection + '"' +
+ ' lang="' + ( editor.config.contentsLanguage || editor.langCode ) + '">' +
+ '<head><style>body{margin:3px;height:95%}</style></head><body>' +
+ '<script id="cke_actscrpt" type="text/javascript">' +
+ 'window.parent.CKEDITOR.tools.callFunction(' + CKEDITOR.tools.addFunction( onPasteFrameLoad, dialog ) + ',this);' +
+ '</script></body>' +
+ '</html>';
+
+ var src =
+ CKEDITOR.env.air ?
+ 'javascript:void(0)' :
+ CKEDITOR.env.ie ?
+ 'javascript:void((function(){' + encodeURIComponent(
+ 'document.open();' +
+ '(' + CKEDITOR.tools.fixDomain + ')();' +
+ 'document.close();'
+ ) + '})())"'
+ : '';
+
+ var iframe = CKEDITOR.dom.element.createFromHtml( '<iframe' +
+ ' class="cke_pasteframe"' +
+ ' frameborder="0" ' +
+ ' allowTransparency="true"' +
+ ' src="' + src + '"' +
+ ' role="region"' +
+ ' aria-label="' + lang.pasteArea + '"' +
+ ' aria-describedby="' + dialog.getContentElement( 'general', 'pasteMsg' ).domId + '"' +
+ ' aria-multiple="true"' +
+ '></iframe>' );
+
+ iframe.on( 'load', function( e ) {
+ e.removeListener();
+
+ var doc = iframe.getFrameDocument();
+ doc.write( htmlToLoad );
+
+ editor.focusManager.add( doc.getBody() );
+
+ if ( CKEDITOR.env.air )
+ onPasteFrameLoad.call( this, doc.getWindow().$ );
+ }, dialog );
+
+ iframe.setCustomData( 'dialog', dialog );
+
+ var container = this.getElement();
+ container.setHtml( '' );
+ container.append( iframe );
+
+ // IE need a redirect on focus to make
+ // the cursor blinking inside iframe. (#5461)
+ if ( CKEDITOR.env.ie ) {
+ var focusGrabber = CKEDITOR.dom.element.createFromHtml( '<span tabindex="-1" style="position:absolute" role="presentation"></span>' );
+ focusGrabber.on( 'focus', function() {
+ // Since fixDomain is called in src attribute,
+ // IE needs some slight delay to correctly move focus.
+ setTimeout( function() {
+ iframe.$.contentWindow.focus();
+ } );
+ } );
+ container.append( focusGrabber );
+
+ // Override focus handler on field.
+ this.focus = function() {
+ focusGrabber.focus();
+ this.fire( 'focus' );
+ };
+ }
+
+ this.getInputElement = function() {
+ return iframe;
+ };
+
+ // Force container to scale in IE.
+ if ( CKEDITOR.env.ie ) {
+ container.setStyle( 'display', 'block' );
+ container.setStyle( 'height', ( iframe.$.offsetHeight + 2 ) + 'px' );
+ }
+ },
+ commit: function( data ) {
+ var editor = this.getDialog().getParentEditor(),
+ body = this.getInputElement().getFrameDocument().getBody(),
+ bogus = body.getBogus(),
+ html;
+ bogus && bogus.remove();
+
+ // Saving the contents so changes until paste is complete will not take place (#7500)
+ html = body.getHtml();
+
+ // Opera needs some time to think about what has happened and what it should do now.
+ setTimeout( function() {
+ editor.fire( 'pasteDialogCommit', html );
+ }, 0 );
+ }
+ }
+ ]
+ }
+ ]
+ };
+});
+
+/**
+ * Internal event to pass paste dialog's data to the listeners.
+ *
+ * @private
+ * @event pasteDialogCommit
+ * @member CKEDITOR.editor
+ * @param {CKEDITOR.editor} editor This editor instance.
+ */
diff --git a/plugins/colordialog/dialogs/colordialog.js b/plugins/colordialog/dialogs/colordialog.js
index e908269..7021434 100644
--- a/plugins/colordialog/dialogs/colordialog.js
+++ b/plugins/colordialog/dialogs/colordialog.js
@@ -1,7 +1,340 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-CKEDITOR.dialog.add('colordialog',function(a){var b=CKEDITOR.dom.element,c=CKEDITOR.document,d=a.lang.colordialog,e,f={type:'html',html:'&nbsp;'},g;function h(){c.getById(u).removeStyle('background-color');e.getContentElement('picker','selectedColor').setValue('');g&&g.removeAttribute('aria-selected');g=null;};function i(w){var x=w.data.getTarget(),y;if(x.getName()=='td'&&(y=x.getChild(0).getHtml())){g=x;g.setAttribute('aria-selected',true);e.getContentElement('picker','selectedColor').setValue(y);}};function j(w){w=w.replace(/^#/,'');for(var x=0,y=[];x<=2;x++)y[x]=parseInt(w.substr(x*2,2),16);var z=0.2126*y[0]+0.7152*y[1]+0.0722*y[2];return '#'+(z>=165?'000':'fff');};var k,l;function m(w){!w.name&&(w=new CKEDITOR.event(w));var x=!/mouse/.test(w.name),y=w.data.getTarget(),z;if(y.getName()=='td'&&(z=y.getChild(0).getHtml())){o(w);x?k=y:l=y;if(x){y.setStyle('border-color',j(z));y.setStyle('border-style','dotted');}c.getById(s).setStyle('background-color',z);c.getById(t).setHtml(z);}};function n(){var w=k.getChild(0).getHtml();k.setStyle('border-color',w);k.setStyle('border-style','solid');c.getById(s).removeStyle('background-color');c.getById(t).setHtml('&nbsp;');k=null;};function o(w){var x=!/mouse/.test(w.name),y=x&&k;if(y){var z=y.getChild(0).getHtml();y.setStyle('border-color',z);y.setStyle('border-style','solid');}if(!(k||l)){c.getById(s).removeStyle('background-color');c.getById(t).setHtml('&nbsp;');}};function p(w){var x=w.data,y=x.getTarget(),z,A,B=x.getKeystroke(),C=a.lang.dir=='rtl';switch(B){case 38:if(z=y.getParent().getPrevious()){A=z.getChild([y.getIndex()]);A.focus();}x.preventDefault();break;case 40:if(z=y.getParent().getNext()){A=z.getChild([y.getIndex()]);if(A&&A.type==1)A.focus();}x.preventDefault();break;case 32:case 13:i(w);x.preventDefault();break;case C?37:39:if(A=y.getNext()){if(A.type==1){A.focus();x.preventDefault(true);}}else if(z=y.getParent().getNext()){A=z.getChild([0]);if(A&&A.type==1){A.focus();x.preventDefault(true);}}break;case C?39:37:if(A=y.getPrevious()){A.focus();x.preventDefault(true);}else if(z=y.getParent().getPrevious()){A=z.getLast();A.focus();x.preventDefault(true);}break;default:return;}};function q(){v=CKEDITOR.dom.element.createFromHtml('<table tabIndex="-1" aria-label="'+d.options+'"'+' role="grid" style="border-collapse:separate;" cellspacing="0">'+'<caption class="cke_voice_label">'+d.options+'</caption>'+'<tbody role="presentation"></tbody></table>');v.on('mouseover',m);v.on('mouseout',o);var w=['00','33','66','99','cc','ff'];
-function x(C,D){for(var E=C;E<C+3;E++){var F=new b(v.$.insertRow(-1));F.setAttribute('role','row');for(var G=D;G<D+3;G++)for(var H=0;H<6;H++)y(F.$,'#'+w[G]+w[H]+w[E]);}};function y(C,D){var E=new b(C.insertCell(-1));E.setAttribute('class','ColorCell');E.setAttribute('tabIndex',-1);E.setAttribute('role','gridcell');E.on('keydown',p);E.on('click',i);E.on('focus',m);E.on('blur',o);E.setStyle('background-color',D);E.setStyle('border','1px solid '+D);E.setStyle('width','14px');E.setStyle('height','14px');var F=r('color_table_cell');E.setAttribute('aria-labelledby',F);E.append(CKEDITOR.dom.element.createFromHtml('<span id="'+F+'" class="cke_voice_label">'+D+'</span>',CKEDITOR.document));};x(0,0);x(3,0);x(0,3);x(3,3);var z=new b(v.$.insertRow(-1));z.setAttribute('role','row');for(var A=0;A<6;A++)y(z.$,'#'+w[A]+w[A]+w[A]);for(var B=0;B<12;B++)y(z.$,'#000000');};var r=function(w){return CKEDITOR.tools.getNextId()+'_'+w;},s=r('hicolor'),t=r('hicolortext'),u=r('selhicolor'),v;q();return{title:d.title,minWidth:360,minHeight:220,onLoad:function(){e=this;},onHide:function(){h();n();},contents:[{id:'picker',label:d.title,accessKey:'I',elements:[{type:'hbox',padding:0,widths:['70%','10%','30%'],children:[{type:'html',html:'<div></div>',onLoad:function(){CKEDITOR.document.getById(this.domId).append(v);},focus:function(){(k||this.getElement().getElementsByTag('td').getItem(0)).focus();}},f,{type:'vbox',padding:0,widths:['70%','5%','25%'],children:[{type:'html',html:'<span>'+d.highlight+'</span>\t\t\t\t\t\t\t\t\t\t\t\t<div id="'+s+'" style="border: 1px solid; height: 74px; width: 74px;"></div>\t\t\t\t\t\t\t\t\t\t\t\t<div id="'+t+'">&nbsp;</div><span>'+d.selected+'</span>\t\t\t\t\t\t\t\t\t\t\t\t<div id="'+u+'" style="border: 1px solid; height: 20px; width: 74px;"></div>'},{type:'text',label:d.selected,labelStyle:'display:none',id:'selectedColor',style:'width: 74px',onChange:function(){try{c.getById(u).setStyle('background-color',this.getValue());}catch(w){h();}}},f,{type:'button',id:'clear',style:'margin-top: 5px',label:d.clear,onClick:h}]}]}]}]};});
+CKEDITOR.dialog.add( 'colordialog', function( editor ) {
+ // Define some shorthands.
+ var $el = CKEDITOR.dom.element,
+ $doc = CKEDITOR.document,
+ lang = editor.lang.colordialog;
+
+ // Reference the dialog.
+ var dialog;
+
+ var spacer = {
+ type: 'html',
+ html: '&nbsp;'
+ };
+
+ var selected;
+
+ function clearSelected() {
+ $doc.getById( selHiColorId ).removeStyle( 'background-color' );
+ dialog.getContentElement( 'picker', 'selectedColor' ).setValue( '' );
+ selected && selected.removeAttribute( 'aria-selected' );
+ selected = null;
+ }
+
+ function updateSelected( evt ) {
+ var target = evt.data.getTarget(),
+ color;
+
+ if ( target.getName() == 'td' && ( color = target.getChild( 0 ).getHtml() ) ) {
+ selected = target;
+ selected.setAttribute( 'aria-selected', true );
+ dialog.getContentElement( 'picker', 'selectedColor' ).setValue( color );
+ }
+ }
+
+ // Basing black-white decision off of luma scheme using the Rec. 709 version
+ function whiteOrBlack( color ) {
+ color = color.replace( /^#/, '' );
+ for ( var i = 0, rgb = []; i <= 2; i++ )
+ rgb[ i ] = parseInt( color.substr( i * 2, 2 ), 16 );
+ var luma = ( 0.2126 * rgb[ 0 ] ) + ( 0.7152 * rgb[ 1 ] ) + ( 0.0722 * rgb[ 2 ] );
+ return '#' + ( luma >= 165 ? '000' : 'fff' );
+ }
+
+ // Distinguish focused and hover states.
+ var focused, hovered;
+
+ // Apply highlight style.
+ function updateHighlight( event ) {
+ // Convert to event.
+ !event.name && ( event = new CKEDITOR.event( event ) );
+
+ var isFocus = !( /mouse/ ).test( event.name ),
+ target = event.data.getTarget(),
+ color;
+
+ if ( target.getName() == 'td' && ( color = target.getChild( 0 ).getHtml() ) ) {
+ removeHighlight( event );
+
+ isFocus ? focused = target : hovered = target;
+
+ // Apply outline style to show focus.
+ if ( isFocus ) {
+ target.setStyle( 'border-color', whiteOrBlack( color ) );
+ target.setStyle( 'border-style', 'dotted' );
+ }
+
+ $doc.getById( hicolorId ).setStyle( 'background-color', color );
+ $doc.getById( hicolorTextId ).setHtml( color );
+ }
+ }
+
+ function clearHighlight() {
+ var color = focused.getChild( 0 ).getHtml();
+ focused.setStyle( 'border-color', color );
+ focused.setStyle( 'border-style', 'solid' );
+ $doc.getById( hicolorId ).removeStyle( 'background-color' );
+ $doc.getById( hicolorTextId ).setHtml( '&nbsp;' );
+ focused = null;
+ }
+
+ // Remove previously focused style.
+ function removeHighlight( event ) {
+ var isFocus = !( /mouse/ ).test( event.name ),
+ target = isFocus && focused;
+
+ if ( target ) {
+ var color = target.getChild( 0 ).getHtml();
+ target.setStyle( 'border-color', color );
+ target.setStyle( 'border-style', 'solid' );
+ }
+
+ if ( !( focused || hovered ) ) {
+ $doc.getById( hicolorId ).removeStyle( 'background-color' );
+ $doc.getById( hicolorTextId ).setHtml( '&nbsp;' );
+ }
+ }
+
+ function onKeyStrokes( evt ) {
+ var domEvt = evt.data;
+
+ var element = domEvt.getTarget();
+ var relative, nodeToMove;
+ var keystroke = domEvt.getKeystroke(),
+ rtl = editor.lang.dir == 'rtl';
+
+ switch ( keystroke ) {
+ // UP-ARROW
+ case 38:
+ // relative is TR
+ if ( ( relative = element.getParent().getPrevious() ) ) {
+ nodeToMove = relative.getChild( [ element.getIndex() ] );
+ nodeToMove.focus();
+ }
+ domEvt.preventDefault();
+ break;
+ // DOWN-ARROW
+ case 40:
+ // relative is TR
+ if ( ( relative = element.getParent().getNext() ) ) {
+ nodeToMove = relative.getChild( [ element.getIndex() ] );
+ if ( nodeToMove && nodeToMove.type == 1 ) {
+ nodeToMove.focus();
+ }
+ }
+ domEvt.preventDefault();
+ break;
+
+ // SPACE
+ // ENTER
+ case 32:
+ case 13:
+ updateSelected( evt );
+ domEvt.preventDefault();
+ break;
+
+ // RIGHT-ARROW
+ case rtl ? 37:
+ 39 :
+ // relative is TD
+ if ( ( nodeToMove = element.getNext() ) ) {
+ if ( nodeToMove.type == 1 ) {
+ nodeToMove.focus();
+ domEvt.preventDefault( true );
+ }
+ }
+ // relative is TR
+ else if ( ( relative = element.getParent().getNext() ) ) {
+ nodeToMove = relative.getChild( [ 0 ] );
+ if ( nodeToMove && nodeToMove.type == 1 ) {
+ nodeToMove.focus();
+ domEvt.preventDefault( true );
+ }
+ }
+ break;
+
+ // LEFT-ARROW
+ case rtl ? 39:
+ 37 :
+ // relative is TD
+ if ( ( nodeToMove = element.getPrevious() ) ) {
+ nodeToMove.focus();
+ domEvt.preventDefault( true );
+ }
+ // relative is TR
+ else if ( ( relative = element.getParent().getPrevious() ) ) {
+ nodeToMove = relative.getLast();
+ nodeToMove.focus();
+ domEvt.preventDefault( true );
+ }
+ break;
+ default:
+ // Do not stop not handled events.
+ return;
+ }
+ }
+
+ function createColorTable() {
+ table = CKEDITOR.dom.element.createFromHtml( '<table tabIndex="-1" aria-label="' + lang.options + '"' +
+ ' role="grid" style="border-collapse:separate;" cellspacing="0">' +
+ '<caption class="cke_voice_label">' + lang.options + '</caption>' +
+ '<tbody role="presentation"></tbody></table>' );
+
+ table.on( 'mouseover', updateHighlight );
+ table.on( 'mouseout', removeHighlight );
+
+ // Create the base colors array.
+ var aColors = [ '00', '33', '66', '99', 'cc', 'ff' ];
+
+ // This function combines two ranges of three values from the color array into a row.
+ function appendColorRow( rangeA, rangeB ) {
+ for ( var i = rangeA; i < rangeA + 3; i++ ) {
+ var row = new $el( table.$.insertRow( -1 ) );
+ row.setAttribute( 'role', 'row' );
+
+ for ( var j = rangeB; j < rangeB + 3; j++ ) {
+ for ( var n = 0; n < 6; n++ ) {
+ appendColorCell( row.$, '#' + aColors[ j ] + aColors[ n ] + aColors[ i ] );
+ }
+ }
+ }
+ }
+
+ // This function create a single color cell in the color table.
+ function appendColorCell( targetRow, color ) {
+ var cell = new $el( targetRow.insertCell( -1 ) );
+ cell.setAttribute( 'class', 'ColorCell' );
+ cell.setAttribute( 'tabIndex', -1 );
+ cell.setAttribute( 'role', 'gridcell' );
+
+ cell.on( 'keydown', onKeyStrokes );
+ cell.on( 'click', updateSelected );
+ cell.on( 'focus', updateHighlight );
+ cell.on( 'blur', removeHighlight );
+
+ cell.setStyle( 'background-color', color );
+ cell.setStyle( 'border', '1px solid ' + color );
+
+ cell.setStyle( 'width', '14px' );
+ cell.setStyle( 'height', '14px' );
+
+ var colorLabel = numbering( 'color_table_cell' );
+ cell.setAttribute( 'aria-labelledby', colorLabel );
+ cell.append( CKEDITOR.dom.element.createFromHtml( '<span id="' + colorLabel + '" class="cke_voice_label">' + color + '</span>', CKEDITOR.document ) );
+ }
+
+ appendColorRow( 0, 0 );
+ appendColorRow( 3, 0 );
+ appendColorRow( 0, 3 );
+ appendColorRow( 3, 3 );
+
+ // Create the last row.
+ var oRow = new $el( table.$.insertRow( -1 ) );
+ oRow.setAttribute( 'role', 'row' );
+
+ // Create the gray scale colors cells.
+ for ( var n = 0; n < 6; n++ ) {
+ appendColorCell( oRow.$, '#' + aColors[ n ] + aColors[ n ] + aColors[ n ] );
+ }
+
+ // Fill the row with black cells.
+ for ( var i = 0; i < 12; i++ ) {
+ appendColorCell( oRow.$, '#000000' );
+ }
+ }
+
+ var numbering = function( id ) {
+ return CKEDITOR.tools.getNextId() + '_' + id;
+ },
+ hicolorId = numbering( 'hicolor' ),
+ hicolorTextId = numbering( 'hicolortext' ),
+ selHiColorId = numbering( 'selhicolor' ),
+ table;
+
+ createColorTable();
+
+ return {
+ title: lang.title,
+ minWidth: 360,
+ minHeight: 220,
+ onLoad: function() {
+ // Update reference.
+ dialog = this;
+ },
+ onHide: function() {
+ clearSelected();
+ clearHighlight();
+ },
+ contents: [
+ {
+ id: 'picker',
+ label: lang.title,
+ accessKey: 'I',
+ elements: [
+ {
+ type: 'hbox',
+ padding: 0,
+ widths: [ '70%', '10%', '30%' ],
+ children: [
+ {
+ type: 'html',
+ html: '<div></div>',
+ onLoad: function() {
+ CKEDITOR.document.getById( this.domId ).append( table );
+ },
+ focus: function() {
+ // Restore the previously focused cell,
+ // otherwise put the initial focus on the first table cell.
+ ( focused || this.getElement().getElementsByTag( 'td' ).getItem( 0 ) ).focus();
+ }
+ },
+ spacer,
+ {
+ type: 'vbox',
+ padding: 0,
+ widths: [ '70%', '5%', '25%' ],
+ children: [
+ {
+ type: 'html',
+ html: '<span>' + lang.highlight + '</span>\
+ <div id="' + hicolorId + '" style="border: 1px solid; height: 74px; width: 74px;"></div>\
+ <div id="' + hicolorTextId + '">&nbsp;</div><span>' + lang.selected + '</span>\
+ <div id="' + selHiColorId + '" style="border: 1px solid; height: 20px; width: 74px;"></div>'
+ },
+ {
+ type: 'text',
+ label: lang.selected,
+ labelStyle: 'display:none',
+ id: 'selectedColor',
+ style: 'width: 74px',
+ onChange: function() {
+ // Try to update color preview with new value. If fails, then set it no none.
+ try {
+ $doc.getById( selHiColorId ).setStyle( 'background-color', this.getValue() );
+ } catch ( e ) {
+ clearSelected();
+ }
+ }
+ },
+ spacer,
+ {
+ type: 'button',
+ id: 'clear',
+ style: 'margin-top: 5px',
+ label: lang.clear,
+ onClick: clearSelected
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ };
+});
diff --git a/plugins/dialog/dialogDefinition.js b/plugins/dialog/dialogDefinition.js
index a2c9d6d..6810a90 100644
--- a/plugins/dialog/dialogDefinition.js
+++ b/plugins/dialog/dialogDefinition.js
@@ -1,4 +1,1006 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
+
+/**
+ * @fileOverview Defines the "virtual" dialog, dialog content and dialog button
+ * definition classes.
+ */
+
+/**
+ * The definition of a dialog window.
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create dialogs.
+ *
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ *
+ * CKEDITOR.dialog.add( 'testOnly', function( editor ) {
+ * return {
+ * title: 'Test Dialog',
+ * resizable: CKEDITOR.DIALOG_RESIZE_BOTH,
+ * minWidth: 500,
+ * minHeight: 400,
+ * contents: [
+ * {
+ * id: 'tab1',
+ * label: 'First Tab',
+ * title: 'First Tab Title',
+ * accessKey: 'Q',
+ * elements: [
+ * {
+ * type: 'text',
+ * label: 'Test Text 1',
+ * id: 'testText1',
+ * 'default': 'hello world!'
+ * }
+ * ]
+ * }
+ * ]
+ * };
+ * } );
+ *
+ * @class CKEDITOR.dialog.definition
+ */
+
+/**
+ * The dialog title, displayed in the dialog's header. Required.
+ *
+ * @property {String} title
+ */
+
+/**
+ * How the dialog can be resized, must be one of the four contents defined below.
+ *
+ * * {@link CKEDITOR#DIALOG_RESIZE_NONE}
+ * * {@link CKEDITOR#DIALOG_RESIZE_WIDTH}
+ * * {@link CKEDITOR#DIALOG_RESIZE_HEIGHT}
+ * * {@link CKEDITOR#DIALOG_RESIZE_BOTH}
+ *
+ * @property {Number} [resizable=CKEDITOR.DIALOG_RESIZE_NONE]
+ */
+
+/**
+ * The minimum width of the dialog, in pixels.
+ *
+ * @property {Number} [minWidth=600]
+ */
+
+/**
+ * The minimum height of the dialog, in pixels.
+ *
+ * @property {Number} [minHeight=400]
+ */
+
+
+/**
+ * The initial width of the dialog, in pixels.
+ *
+ * @since 3.5.3
+ * @property {Number} [width=CKEDITOR.dialog.definition#minWidth]
+ */
+
+/**
+ * The initial height of the dialog, in pixels.
+ *
+ * @since 3.5.3
+ * @property {Number} [height=CKEDITOR.dialog.definition.minHeight]
+ */
+
+/**
+ * The buttons in the dialog, defined as an array of
+ * {@link CKEDITOR.dialog.definition.button} objects.
+ *
+ * @property {Array} [buttons=[ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ]]
+ */
+
+/**
+ * The contents in the dialog, defined as an array of
+ * {@link CKEDITOR.dialog.definition.content} objects. Required.
+ *
+ * @property {Array} contents
+ */
+
+/**
+ * The function to execute when OK is pressed.
+ *
+ * @property {Function} onOk
+ */
+
+/**
+ * The function to execute when Cancel is pressed.
+ *
+ * @property {Function} onCancel
+ */
+
+/**
+ * The function to execute when the dialog is displayed for the first time.
+ *
+ * @property {Function} onLoad
+ */
+
+/**
+ * The function to execute when the dialog is loaded (executed every time the dialog is opened).
+ *
+ * @property {Function} onShow
+ */
+
+/**
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create dialog content pages.
+ *
+ * @class CKEDITOR.dialog.definition.content.
+ */
+
+/**
+ * The id of the content page.
+ *
+ * @property {String} id
+ */
+
+/**
+ * The tab label of the content page.
+ *
+ * @property {String} label
+ */
+
+/**
+ * The popup message of the tab label.
+ *
+ * @property {String} title
+ */
+
+/**
+ * The CTRL hotkey for switching to the tab.
+ *
+ * contentDefinition.accessKey = 'Q'; // Switch to this page when CTRL-Q is pressed.
+ *
+ * @property {String} accessKey
+ */
+
+/**
+ * The UI elements contained in this content page, defined as an array of
+ * {@link CKEDITOR.dialog.definition.uiElement} objects.
+ *
+ * @property {Array} elements
+ */
+
+/**
+ * The definition of user interface element (textarea, radio etc).
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create dialog UI elements.
+ *
+ * @class CKEDITOR.dialog.definition.uiElement
+ * @see CKEDITOR.ui.dialog.uiElement
+ */
+
+/**
+ * The id of the UI element.
+ *
+ * @property {String} id
+ */
+
+/**
+ * The type of the UI element. Required.
+ *
+ * @property {String} type
+ */
+
+/**
+ * The popup label of the UI element.
+ *
+ * @property {String} title
+ */
+
+/**
+ * The content that needs to be allowed to enable this UI element.
+ * All formats accepted by {@link CKEDITOR.filter#check} may be used.
+ *
+ * When all UI elements in a tab are disabled, this tab will be disabled automatically.
+ *
+ * @property {String/Object/CKEDITOR.style} requiredContent
+ */
+
+/**
+ * CSS class names to append to the UI element.
+ *
+ * @property {String} className
+ */
+
+/**
+ * Inline CSS classes to append to the UI element.
+ *
+ * @property {String} style
+ */
+
+/**
+ * Horizontal alignment (in container) of the UI element.
+ *
+ * @property {String} align
+ */
+
+/**
+ * Function to execute the first time the UI element is displayed.
+ *
+ * @property {Function} onLoad
+ */
+
+/**
+ * Function to execute whenever the UI element's parent dialog is displayed.
+ *
+ * @property {Function} onShow
+ */
+
+/**
+ * Function to execute whenever the UI element's parent dialog is closed.
+ *
+ * @property {Function} onHide
+ */
+
+/**
+ * Function to execute whenever the UI element's parent
+ * dialog's {@link CKEDITOR.dialog#setupContent} method is executed.
+ * It usually takes care of the respective UI element as a standalone element.
+ *
+ * @property {Function} setup
+ */
+
+/**
+ * Function to execute whenever the UI element's parent
+ * dialog's {@link CKEDITOR.dialog#commitContent} method is executed.
+ * It usually takes care of the respective UI element as a standalone element.
+ *
+ * @property {Function} commit
+ */
+
+// ----- hbox -----------------------------------------------------------------
+
+/**
+ * Horizontal layout box for dialog UI elements, auto-expends to available width of container.
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create horizontal layouts.
+ *
+ * Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.hbox} object and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
+ *
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ *
+ * // Example:
+ * {
+ * type: 'hbox',
+ * widths: [ '25%', '25%', '50%' ],
+ * children: [
+ * {
+ * type: 'text',
+ * id: 'id1',
+ * width: '40px',
+ * },
+ * {
+ * type: 'text',
+ * id: 'id2',
+ * width: '40px',
+ * },
+ * {
+ * type: 'text',
+ * id: 'id3'
+ * }
+ * ]
+ * }
+ *
+ * @class CKEDITOR.dialog.definition.hbox
+ * @extends CKEDITOR.dialog.definition.uiElement
+ */
+
+/**
+ * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this container.
+ *
+ * @property {Array} children
+ */
+
+/**
+ * (Optional) The widths of child cells.
+ *
+ * @property {Array} widths
+ */
+
+/**
+ * (Optional) The height of the layout.
+ *
+ * @property {Number} height
+ */
+
+/**
+ * The CSS styles to apply to this element.
+ *
+ * @property {String} styles
+ */
+
+/**
+ * (Optional) The padding width inside child cells. Example: 0, 1.
+ *
+ * @property {Number} padding
+ */
+
+/**
+ * (Optional) The alignment of the whole layout. Example: center, top.
+ *
+ * @property {String} align
+ */
+
+// ----- vbox -----------------------------------------------------------------
+
+/**
+ * Vertical layout box for dialog UI elements.
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create vertical layouts.
+ *
+ * Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.vbox} object and can
+ * be accessed with {@link CKEDITOR.dialog#getContentElement}.
+ *
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ *
+ * // Example:
+ * {
+ * type: 'vbox',
+ * align: 'right',
+ * width: '200px',
+ * children: [
+ * {
+ * type: 'text',
+ * id: 'age',
+ * label: 'Age'
+ * },
+ * {
+ * type: 'text',
+ * id: 'sex',
+ * label: 'Sex'
+ * },
+ * {
+ * type: 'text',
+ * id: 'nationality',
+ * label: 'Nationality'
+ * }
+ * ]
+ * }
+ *
+ * @class CKEDITOR.dialog.definition.vbox
+ * @extends CKEDITOR.dialog.definition.uiElement
+ */
+
+/**
+ * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this container.
+ *
+ * @property {Array} children
+ */
+
+/**
+ * (Optional) The width of the layout.
+ *
+ * @property {Array} width
+ */
+
+/**
+ * (Optional) The heights of individual cells.
+ *
+ * @property {Number} heights
+ */
+
+/**
+ * The CSS styles to apply to this element.
+ *
+ * @property {String} styles
+ */
+
+/**
+ * (Optional) The padding width inside child cells. Example: 0, 1.
+ *
+ * @property {Number} padding
+ */
+
+/**
+ * (Optional) The alignment of the whole layout. Example: center, top.
+ *
+ * @property {String} align
+ */
+
+/**
+ * (Optional) Whether the layout should expand vertically to fill its container.
+ *
+ * @property {Boolean} expand
+ */
+
+// ----- labeled element ------------------------------------------------------
+
+/**
+ * The definition of labeled user interface element (textarea, textInput etc).
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create dialog UI elements.
+ *
+ * @class CKEDITOR.dialog.definition.labeledElement
+ * @extends CKEDITOR.dialog.definition.uiElement
+ * @see CKEDITOR.ui.dialog.labeledElement
+ */
+
+/**
+ * The label of the UI element.
+ *
+ * {
+ * type: 'text',
+ * label: 'My Label'
+ * }
+ *
+ * @property {String} label
+ */
+
+/**
+ * (Optional) Specify the layout of the label. Set to `'horizontal'` for horizontal layout.
+ * The default layout is vertical.
+ *
+ * {
+ * type: 'text',
+ * label: 'My Label',
+ * labelLayout: 'horizontal'
+ * }
+ *
+ * @property {String} labelLayout
+ */
+
+/**
+ * (Optional) Applies only to horizontal layouts: a two elements array of lengths to specify the widths of the
+ * label and the content element. See also {@link CKEDITOR.dialog.definition.labeledElement#labelLayout}.
+ *
+ * {
+ * type: 'text',
+ * label: 'My Label',
+ * labelLayout: 'horizontal',
+ * widths: [100, 200]
+ * }
+ *
+ * @property {Array} widths
+ */
+
+/**
+ * Specify the inline style of the uiElement label.
+ *
+ * {
+ * type: 'text',
+ * label: 'My Label',
+ * labelStyle: 'color: red'
+ * }
+ *
+ * @property {String} labelStyle
+ */
+
+
+/**
+ * Specify the inline style of the input element.
+ *
+ * {
+ * type: 'text',
+ * label: 'My Label',
+ * inputStyle: 'text-align: center'
+ * }
+ *
+ * @since 3.6.1
+ * @property {String} inputStyle
+ */
+
+/**
+ * Specify the inline style of the input element container.
+ *
+ * {
+ * type: 'text',
+ * label: 'My Label',
+ * controlStyle: 'width: 3em'
+ * }
+ *
+ * @since 3.6.1
+ * @property {String} controlStyle
+ */
+
+// ----- button ---------------------------------------------------------------
+
+/**
+ * The definition of a button.
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create buttons.
+ *
+ * Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.button} object
+ * and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
+ *
+ * For a complete example of dialog definition, please check {@link CKEDITOR.dialog#add}.
+ *
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ *
+ * // Example:
+ * {
+ * type: 'button',
+ * id: 'buttonId',
+ * label: 'Click me',
+ * title: 'My title',
+ * onClick: function() {
+ * // this = CKEDITOR.ui.dialog.button
+ * alert( 'Clicked: ' + this.id );
+ * }
+ * }
+ *
+ * @class CKEDITOR.dialog.definition.button
+ * @extends CKEDITOR.dialog.definition.uiElement
+ */
+
+/**
+ * Whether the button is disabled.
+ *
+ * @property {Boolean} disabled
+ */
+
+/**
+ * The label of the UI element.
+ *
+ * @property {String} label
+ */
+
+// ----- checkbox ------
+/**
+ * The definition of a checkbox element.
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create groups of checkbox buttons.
+ *
+ * Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.checkbox} object
+ * and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
+ *
+ * For a complete example of dialog definition, please check {@link CKEDITOR.dialog#add}.
+ *
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ *
+ * // Example:
+ * {
+ * type: 'checkbox',
+ * id: 'agree',
+ * label: 'I agree',
+ * 'default': 'checked',
+ * onClick: function() {
+ * // this = CKEDITOR.ui.dialog.checkbox
+ * alert( 'Checked: ' + this.getValue() );
+ * }
+ * }
+ *
+ * @class CKEDITOR.dialog.definition.checkbox
+ * @extends CKEDITOR.dialog.definition.uiElement
+ */
+
+/**
+ * (Optional) The validation function.
+ *
+ * @property {Function} validate
+ */
+
+/**
+ * The label of the UI element.
+ *
+ * @property {String} label
+ */
+
+/**
+ * The default state.
+ *
+ * @property {String} [default='' (unchecked)]
+ */
+
+// ----- file -----------------------------------------------------------------
+
+/**
+ * The definition of a file upload input.
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create file upload elements.
+ *
+ * Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.file} object
+ * and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
+ *
+ * For a complete example of dialog definition, please check {@link CKEDITOR.dialog#add}.
+ *
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ *
+ * // Example:
+ * {
+ * type: 'file',
+ * id: 'upload',
+ * label: 'Select file from your computer',
+ * size: 38
+ * },
+ * {
+ * type: 'fileButton',
+ * id: 'fileId',
+ * label: 'Upload file',
+ * 'for': [ 'tab1', 'upload' ],
+ * filebrowser: {
+ * onSelect: function( fileUrl, data ) {
+ * alert( 'Successfully uploaded: ' + fileUrl );
+ * }
+ * }
+ * }
+ *
+ * @class CKEDITOR.dialog.definition.file
+ * @extends CKEDITOR.dialog.definition.labeledElement
+ */
+
+/**
+ * (Optional) The validation function.
+ *
+ * @property {Function} validate
+ */
+
+/**
+ * (Optional) The action attribute of the form element associated with this file upload input.
+ * If empty, CKEditor will use path to server connector for currently opened folder.
+ *
+ * @property {String} action
+ */
+
+/**
+ * The size of the UI element.
+ *
+ * @property {Number} size
+ */
+
+// ----- fileButton -----------------------------------------------------------
+
+/**
+ * The definition of a button for submitting the file in a file upload input.
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create a button for submitting the file in a file upload input.
+ *
+ * Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.fileButton} object
+ * and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
+ *
+ * For a complete example of dialog definition, please check {@link CKEDITOR.dialog#add}.
+ *
+ * @class CKEDITOR.dialog.definition.fileButton
+ * @extends CKEDITOR.dialog.definition.uiElement
+ */
+
+/**
+ * (Optional) The validation function.
+ *
+ * @property {Function} validate
+ */
+
+/**
+ * The label of the UI element.
+ *
+ * @property {String} label
+ */
+
+/**
+ * The instruction for CKEditor how to deal with file upload.
+ * By default, the file and fileButton elements will not work "as expected" if this attribute is not set.
+ *
+ * // Update field with id 'txtUrl' in the 'tab1' tab when file is uploaded.
+ * filebrowser: 'tab1:txtUrl'
+ *
+ * // Call custom onSelect function when file is successfully uploaded.
+ * filebrowser: {
+ * onSelect: function( fileUrl, data ) {
+ * alert( 'Successfully uploaded: ' + fileUrl );
+ * }
+ * }
+ *
+ * @property {String} filebrowser/Object
+ */
+
+/**
+ * An array that contains pageId and elementId of the file upload input element for which this button is created.
+ *
+ * [ pageId, elementId ]
+ *
+ * @property {String} for
+ */
+
+// ----- html -----------------------------------------------------------------
+
+/**
+ * The definition of a raw HTML element.
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create elements made from raw HTML code.
+ *
+ * Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.html} object
+ * and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
+ *
+ * For a complete example of dialog definition, please check {@link CKEDITOR.dialog#add}.
+ * To access HTML elements use {@link CKEDITOR.dom.document#getById}.
+ *
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ *
+ * // Example 1:
+ * {
+ * type: 'html',
+ * html: '<h3>This is some sample HTML content.</h3>'
+ * }
+ *
+ * // Example 2:
+ * // Complete sample with document.getById() call when the "Ok" button is clicked.
+ * var dialogDefinition = {
+ * title: 'Sample dialog',
+ * minWidth: 300,
+ * minHeight: 200,
+ * onOk: function() {
+ * // "this" is now a CKEDITOR.dialog object.
+ * var document = this.getElement().getDocument();
+ * // document = CKEDITOR.dom.document
+ * var element = <b>document.getById( 'myDiv' );</b>
+ * if ( element )
+ * alert( element.getHtml() );
+ * },
+ * contents: [
+ * {
+ * id: 'tab1',
+ * label: '',
+ * title: '',
+ * elements: [
+ * {
+ * type: 'html',
+ * html: '<div id="myDiv">Sample <b>text</b>.</div><div id="otherId">Another div.</div>'
+ * }
+ * ]
+ * }
+ * ],
+ * buttons: [ CKEDITOR.dialog.cancelButton, CKEDITOR.dialog.okButton ]
+ * };
+ *
+ * @class CKEDITOR.dialog.definition.html
+ * @extends CKEDITOR.dialog.definition.uiElement
+ */
+
+/**
+ * (Required) HTML code of this element.
+ *
+ * @property {String} html
+ */
+
+// ----- radio ----------------------------------------------------------------
+
+/**
+ * The definition of a radio group.
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create groups of radio buttons.
+ *
+ * Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.radio} object
+ * and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
+ *
+ * For a complete example of dialog definition, please check {@link CKEDITOR.dialog#add}.
+ *
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ *
+ * // Example:
+ * {
+ * type: 'radio',
+ * id: 'country',
+ * label: 'Which country is bigger',
+ * items: [ [ 'France', 'FR' ], [ 'Germany', 'DE' ] ],
+ * style: 'color: green',
+ * 'default': 'DE',
+ * onClick: function() {
+ * // this = CKEDITOR.ui.dialog.radio
+ * alert( 'Current value: ' + this.getValue() );
+ * }
+ * }
+ *
+ * @class CKEDITOR.dialog.definition.radio
+ * @extends CKEDITOR.dialog.definition.labeledElement
+ */
+
+/**
+ * The default value.
+ *
+ * @property {String} default
+ */
+
+/**
+ * (Optional) The validation function.
+ *
+ * @property {Function} validate
+ */
+
+/**
+ * An array of options. Each option is a 1- or 2-item array of format `[ 'Description', 'Value' ]`.
+ * If `'Value'` is missing, then the value would be assumed to be the same as the description.
+ *
+ * @property {Array} items
+ */
+
+// ----- selectElement --------------------------------------------------------
+
+/**
+ * The definition of a select element.
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create select elements.
+ *
+ * Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.select} object
+ * and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
+ *
+ * For a complete example of dialog definition, please check {@link CKEDITOR.dialog#add}.
+ *
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ *
+ * // Example:
+ * {
+ * type: 'select',
+ * id: 'sport',
+ * label: 'Select your favourite sport',
+ * items: [ [ 'Basketball' ], [ 'Baseball' ], [ 'Hockey' ], [ 'Football' ] ],
+ * 'default': 'Football',
+ * onChange: function( api ) {
+ * // this = CKEDITOR.ui.dialog.select
+ * alert( 'Current value: ' + this.getValue() );
+ * }
+ * }
+ *
+ * @class CKEDITOR.dialog.definition.select
+ * @extends CKEDITOR.dialog.definition.labeledElement
+ */
+
+/**
+ * The default value.
+ *
+ * @property {String} default
+ */
+
+/**
+ * (Optional) The validation function.
+ *
+ * @property {Function} validate
+ */
+
+/**
+ * An array of options. Each option is a 1- or 2-item array of format `[ 'Description', 'Value' ]`.
+ * If `'Value'` is missing, then the value would be assumed to be the same as the description.
+ *
+ * @property {Array} items
+ */
+
+/**
+ * (Optional) Set this to true if you'd like to have a multiple-choice select box.
+ *
+ * @property {Boolean} [multiple=false]
+ */
+
+/**
+ * (Optional) The number of items to display in the select box.
+ *
+ * @property {Number} size
+ */
+
+// ----- textInput ------------------------------------------------------------
+
+/**
+ * The definition of a text field (single line).
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create text fields.
+ *
+ * Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.textInput} object
+ * and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
+ *
+ * For a complete example of dialog definition, please check {@link CKEDITOR.dialog#add}.
+ *
+ * // There is no constructor for this class, the user just has to define an
+ * // object with the appropriate properties.
+ *
+ * {
+ * type: 'text',
+ * id: 'name',
+ * label: 'Your name',
+ * 'default': '',
+ * validate: function() {
+ * if ( !this.getValue() ) {
+ * api.openMsgDialog( '', 'Name cannot be empty.' );
+ * return false;
+ * }
+ * }
+ * }
+ *
+ * @class CKEDITOR.dialog.definition.textInput
+ * @extends CKEDITOR.dialog.definition.labeledElement
+ */
+
+/**
+ * The default value.
+ *
+ * @property {String} default
+ */
+
+/**
+ * (Optional) The maximum length.
+ *
+ * @property {Number} maxLength
+ */
+
+/**
+ * (Optional) The size of the input field.
+ *
+ * @property {Number} size
+ */
+
+/**
+ * (Optional) The validation function.
+ *
+ * @property {Function} validate
+ */
+
+// ----- textarea -------------------------------------------------------------
+
+/**
+ * The definition of a text field (multiple lines).
+ *
+ * This class is not really part of the API. It just illustrates the properties
+ * that developers can use to define and create textarea.
+ *
+ * Once the dialog is opened, the created element becomes a {@link CKEDITOR.ui.dialog.textarea} object
+ * and can be accessed with {@link CKEDITOR.dialog#getContentElement}.
+ *
+ * For a complete example of dialog definition, please check {@link CKEDITOR.dialog#add}.
+ *
+* // There is no constructor for this class, the user just has to define an
+* // object with the appropriate properties.
+*
+* // Example:
+* {
+* type: 'textarea',
+* id: 'message',
+* label: 'Your comment',
+* 'default': '',
+* validate: function() {
+* if ( this.getValue().length < 5 ) {
+* api.openMsgDialog( 'The comment is too short.' );
+* return false;
+* }
+* }
+* }
+ *
+ * @class CKEDITOR.dialog.definition.textarea
+ * @extends CKEDITOR.dialog.definition.labeledElement
+ */
+
+/**
+ * The number of rows.
+ *
+ * @property {Number} rows
+ */
+
+/**
+ * The number of columns.
+ *
+ * @property {Number} cols
+ */
+
+/**
+ * (Optional) The validation function.
+ *
+ * @property {Function} validate
+ */
+
+/**
+ * The default value.
+ *
+ * @property {String} default
+ */
diff --git a/plugins/div/dialogs/div.js b/plugins/div/dialogs/div.js
index e9cae67..1e39816 100644
--- a/plugins/div/dialogs/div.js
+++ b/plugins/div/dialogs/div.js
@@ -1,8 +1,457 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+ * Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-(function(){function a(d,e,f){if(!e.is||!e.getCustomData('block_processed')){e.is&&CKEDITOR.dom.element.setMarker(f,e,'block_processed',true);d.push(e);}};function b(d){var e=[],f=d.getChildren();for(var g=0;g<f.count();g++){var h=f.getItem(g);if(!(h.type===CKEDITOR.NODE_TEXT&&/^[ \t\n\r]+$/.test(h.getText())))e.push(h);}return e;};function c(d,e){var f=(function(){var p=CKEDITOR.tools.extend({},CKEDITOR.dtd.$blockLimit);delete p.div;if(d.config.div_wrapTable){delete p.td;delete p.th;}return p;})(),g=CKEDITOR.dtd.div;function h(p){var q=new CKEDITOR.dom.elementPath(p).elements,r;for(var s=0;s<q.length;s++){if(q[s].getName() in f){r=q[s];break;}}return r;};function i(){this.foreach(function(p){if(/^(?!vbox|hbox)/.test(p.type)){if(!p.setup)p.setup=function(q){p.setValue(q.getAttribute(p.id)||'');};if(!p.commit)p.commit=function(q){var r=this.getValue();if('dir'==p.id&&q.getComputedStyle('direction')==r)return;if(r)q.setAttribute(p.id,r);else q.removeAttribute(p.id);};}});};function j(p){var q=[],r={},s=[],t,u=p.document.getSelection(),v=u.getRanges(),w=u.createBookmarks(),x,y,z=p.config.enterMode==CKEDITOR.ENTER_DIV?'div':'p';for(x=0;x<v.length;x++){y=v[x].createIterator();while(t=y.getNextParagraph()){if(t.getName() in f){var A,B=t.getChildren();for(A=0;A<B.count();A++)a(s,B.getItem(A),r);}else{while(!g[t.getName()]&&t.getName()!='body')t=t.getParent();a(s,t,r);}}}CKEDITOR.dom.element.clearAllMarkers(r);var C=l(s),D,E,F;for(x=0;x<C.length;x++){var G=C[x][0];D=G.getParent();for(A=1;A<C[x].length;A++)D=D.getCommonAncestor(C[x][A]);F=new CKEDITOR.dom.element('div',p.document);for(A=0;A<C[x].length;A++){G=C[x][A];while(!G.getParent().equals(D))G=G.getParent();C[x][A]=G;}var H=null;for(A=0;A<C[x].length;A++){G=C[x][A];if(!(G.getCustomData&&G.getCustomData('block_processed'))){G.is&&CKEDITOR.dom.element.setMarker(r,G,'block_processed',true);if(!A)F.insertBefore(G);F.append(G);}}CKEDITOR.dom.element.clearAllMarkers(r);q.push(F);}u.selectBookmarks(w);return q;};function k(p){var q=new CKEDITOR.dom.elementPath(p.getSelection().getStartElement()),r=q.blockLimit,s=r&&r.getAscendant('div',true);return s;};function l(p){var q=[],r=null,s,t;for(var u=0;u<p.length;u++){t=p[u];var v=h(t);if(!v.equals(r)){r=v;q.push([]);}q[q.length-1].push(t);}return q;};function m(p){var q=this.getDialog(),r=q._element&&q._element.clone()||new CKEDITOR.dom.element('div',d.document);this.commit(r,true);p=[].concat(p);var s=p.length,t;for(var u=0;u<s;u++){t=q.getContentElement.apply(q,p[u].split(':'));
-t&&t.setup&&t.setup(r,true);}};var n={},o=[];return{title:d.lang.div.title,minWidth:400,minHeight:165,contents:[{id:'info',label:d.lang.common.generalTab,title:d.lang.common.generalTab,elements:[{type:'hbox',widths:['50%','50%'],children:[{id:'elementStyle',type:'select',style:'width: 100%;',label:d.lang.div.styleSelectLabel,'default':'',items:[[d.lang.common.notSet,'']],onChange:function(){m.call(this,['info:class','advanced:dir','advanced:style']);},setup:function(p){for(var q in n)n[q].checkElementRemovable(p,true)&&this.setValue(q);},commit:function(p){var q;if(q=this.getValue()){var r=n[q],s=p.getCustomData('elementStyle')||'';r.applyToObject(p);p.setCustomData('elementStyle',s+r._.definition.attributes.style);}}},{id:'class',type:'text',label:d.lang.common.cssClass,'default':''}]}]},{id:'advanced',label:d.lang.common.advancedTab,title:d.lang.common.advancedTab,elements:[{type:'vbox',padding:1,children:[{type:'hbox',widths:['50%','50%'],children:[{type:'text',id:'id',label:d.lang.common.id,'default':''},{type:'text',id:'lang',label:d.lang.link.langCode,'default':''}]},{type:'hbox',children:[{type:'text',id:'style',style:'width: 100%;',label:d.lang.common.cssStyle,'default':'',commit:function(p){var q=this.getValue()+(p.getCustomData('elementStyle')||'');p.setAttribute('style',q);}}]},{type:'hbox',children:[{type:'text',id:'title',style:'width: 100%;',label:d.lang.common.advisoryTitle,'default':''}]},{type:'select',id:'dir',style:'width: 100%;',label:d.lang.common.langDir,'default':'',items:[[d.lang.common.notSet,''],[d.lang.common.langDirLtr,'ltr'],[d.lang.common.langDirRtl,'rtl']]}]}]}],onLoad:function(){i.call(this);var p=this,q=this.getContentElement('info','elementStyle');d.getStylesSet(function(r){var s;if(r)for(var t=0;t<r.length;t++){var u=r[t];if(u.element&&u.element=='div'){s=u.name;n[s]=new CKEDITOR.style(u);q.items.push([s,s]);q.add(s,s);}}q[q.items.length>1?'enable':'disable']();setTimeout(function(){q.setup(p._element);},0);});},onShow:function(){if(e=='editdiv'){var p=k(d);p&&this.setupContent(this._element=p);}},onOk:function(){if(e=='editdiv')o=[this._element];else o=j(d,true);var p=o.length;for(var q=0;q<p;q++){this.commitContent(o[q]);!o[q].getAttribute('style')&&o[q].removeAttribute('style');}this.hide();},onHide:function(){if(e=='editdiv')this._element.removeCustomData('elementStyle');delete this._element;}};};CKEDITOR.dialog.add('creatediv',function(d){return c(d,'creatediv');});CKEDITOR.dialog.add('editdiv',function(d){return c(d,'editdiv');
-});})();
+(function() {
+
+ // Add to collection with DUP examination.
+ // @param {Object} collection
+ // @param {Object} element
+ // @param {Object} database
+ function addSafely( collection, element, database ) {
+ // 1. IE doesn't support customData on text nodes;
+ // 2. Text nodes never get chance to appear twice;
+ if ( !element.is || !element.getCustomData( 'block_processed' ) ) {
+ element.is && CKEDITOR.dom.element.setMarker( database, element, 'block_processed', true );
+ collection.push( element );
+ }
+ }
+
+ function getNonEmptyChildren( element ) {
+ var retval = [];
+ var children = element.getChildren();
+ for ( var i = 0; i < children.count(); i++ ) {
+ var child = children.getItem( i );
+ if ( !( child.type === CKEDITOR.NODE_TEXT && ( /^[ \t\n\r]+$/ ).test( child.getText() ) ) )
+ retval.push( child );
+ }
+ return retval;
+ }
+
+ // Dialog reused by both 'creatediv' and 'editdiv' commands.
+ // @param {Object} editor
+ // @param {String} command The command name which indicate what the current command is.
+ function divDialog( editor, command ) {
+ // Definition of elements at which div operation should stopped.
+ var divLimitDefinition = (function() {
+
+ // Customzie from specialize blockLimit elements
+ var definition = CKEDITOR.tools.extend( {}, CKEDITOR.dtd.$blockLimit );
+
+ if ( editor.config.div_wrapTable ) {
+ delete definition.td;
+ delete definition.th;
+ }
+ return definition;
+ })();
+
+ // DTD of 'div' element
+ var dtd = CKEDITOR.dtd.div;
+
+ // Get the first div limit element on the element's path.
+ // @param {Object} element
+ function getDivContainer( element ) {
+ var container = editor.elementPath( element ).blockLimit;
+
+ // Dont stop at 'td' and 'th' when div should wrap entire table.
+ if ( editor.config.div_wrapTable && container.is( [ 'td', 'th' ] ) ) {
+ var parentPath = editor.elementPath( container.getParent() );
+ container = parentPath.blockLimit;
+ }
+
+ return container;
+ }
+
+ // Init all fields' setup/commit function.
+ // @memberof divDialog
+ function setupFields() {
+ this.foreach( function( field ) {
+ // Exclude layout container elements
+ if ( /^(?!vbox|hbox)/.test( field.type ) ) {
+ if ( !field.setup ) {
+ // Read the dialog fields values from the specified
+ // element attributes.
+ field.setup = function( element ) {
+ field.setValue( element.getAttribute( field.id ) || '', 1 );
+ };
+ }
+ if ( !field.commit ) {
+ // Set element attributes assigned by the dialog
+ // fields.
+ field.commit = function( element ) {
+ var fieldValue = this.getValue();
+ // ignore default element attribute values
+ if ( 'dir' == field.id && element.getComputedStyle( 'direction' ) == fieldValue )
+ return;
+
+ if ( fieldValue )
+ element.setAttribute( field.id, fieldValue );
+ else
+ element.removeAttribute( field.id );
+ };
+ }
+ }
+ });
+ }
+
+ // Wrapping 'div' element around appropriate blocks among the selected ranges.
+ // @param {Object} editor
+ function createDiv( editor ) {
+ // new adding containers OR detected pre-existed containers.
+ var containers = [];
+ // node markers store.
+ var database = {};
+ // All block level elements which contained by the ranges.
+ var containedBlocks = [],
+ block;
+
+ // Get all ranges from the selection.
+ var selection = editor.getSelection(),
+ ranges = selection.getRanges();
+ var bookmarks = selection.createBookmarks();
+ var i, iterator;
+
+ // Calcualte a default block tag if we need to create blocks.
+ var blockTag = editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p';
+
+ // collect all included elements from dom-iterator
+ for ( i = 0; i < ranges.length; i++ ) {
+ iterator = ranges[ i ].createIterator();
+ while ( ( block = iterator.getNextParagraph() ) ) {
+ // include contents of blockLimit elements.
+ if ( block.getName() in divLimitDefinition ) {
+ var j,
+ childNodes = block.getChildren();
+ for ( j = 0; j < childNodes.count(); j++ )
+ addSafely( containedBlocks, childNodes.getItem( j ), database );
+ } else {
+ while ( !dtd[ block.getName() ] && !block.equals( ranges[ i ].root ) )
+ block = block.getParent();
+ addSafely( containedBlocks, block, database );
+ }
+ }
+ }
+
+ CKEDITOR.dom.element.clearAllMarkers( database );
+
+ var blockGroups = groupByDivLimit( containedBlocks );
+ var ancestor, blockEl, divElement;
+
+ for ( i = 0; i < blockGroups.length; i++ ) {
+ var currentNode = blockGroups[ i ][ 0 ];
+
+ // Calculate the common parent node of all contained elements.
+ ancestor = currentNode.getParent();
+ for ( j = 1; j < blockGroups[ i ].length; j++ )
+ ancestor = ancestor.getCommonAncestor( blockGroups[ i ][ j ] );
+
+ divElement = new CKEDITOR.dom.element( 'div', editor.document );
+
+ // Normalize the blocks in each group to a common parent.
+ for ( j = 0; j < blockGroups[ i ].length; j++ ) {
+ currentNode = blockGroups[ i ][ j ];
+
+ while ( !currentNode.getParent().equals( ancestor ) )
+ currentNode = currentNode.getParent();
+
+ // This could introduce some duplicated elements in array.
+ blockGroups[ i ][ j ] = currentNode;
+ }
+
+ // Wrapped blocks counting
+ var fixedBlock = null;
+ for ( j = 0; j < blockGroups[ i ].length; j++ ) {
+ currentNode = blockGroups[ i ][ j ];
+
+ // Avoid DUP elements introduced by grouping.
+ if ( !( currentNode.getCustomData && currentNode.getCustomData( 'block_processed' ) ) ) {
+ currentNode.is && CKEDITOR.dom.element.setMarker( database, currentNode, 'block_processed', true );
+
+ // Establish new container, wrapping all elements in this group.
+ if ( !j )
+ divElement.insertBefore( currentNode );
+
+ divElement.append( currentNode );
+ }
+ }
+
+ CKEDITOR.dom.element.clearAllMarkers( database );
+ containers.push( divElement );
+ }
+
+ selection.selectBookmarks( bookmarks );
+ return containers;
+ }
+
+ // Divide a set of nodes to different groups by their path's blocklimit element.
+ // Note: the specified nodes should be in source order naturally, which mean they are supposed to producea by following class:
+ // * CKEDITOR.dom.range.Iterator
+ // * CKEDITOR.dom.domWalker
+ // @returns {Array[]} the grouped nodes
+ function groupByDivLimit( nodes ) {
+ var groups = [],
+ lastDivLimit = null,
+ path, block;
+ for ( var i = 0; i < nodes.length; i++ ) {
+ block = nodes[ i ];
+ var limit = getDivContainer( block );
+ if ( !limit.equals( lastDivLimit ) ) {
+ lastDivLimit = limit;
+ groups.push( [] );
+ }
+ groups[ groups.length - 1 ].push( block );
+ }
+ return groups;
+ }
+
+ // Synchronous field values to other impacted fields is required, e.g. div styles
+ // change should also alter inline-style text.
+ function commitInternally( targetFields ) {
+ var dialog = this.getDialog(),
+ element = dialog._element && dialog._element.clone() || new CKEDITOR.dom.element( 'div', editor.document );
+
+ // Commit this field and broadcast to target fields.
+ this.commit( element, true );
+
+ targetFields = [].concat( targetFields );
+ var length = targetFields.length,
+ field;
+ for ( var i = 0; i < length; i++ ) {
+ field = dialog.getContentElement.apply( dialog, targetFields[ i ].split( ':' ) );
+ field && field.setup && field.setup( element, true );
+ }
+ }
+
+
+ // Registered 'CKEDITOR.style' instances.
+ var styles = {};
+
+ // Hold a collection of created block container elements.
+ var containers = [];
+
+ // @type divDialog
+ return {
+ title: editor.lang.div.title,
+ minWidth: 400,
+ minHeight: 165,
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.common.generalTab,
+ title: editor.lang.common.generalTab,
+ elements: [
+ {
+ type: 'hbox',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ id: 'elementStyle',
+ type: 'select',
+ style: 'width: 100%;',
+ label: editor.lang.div.styleSelectLabel,
+ 'default': '',
+ // Options are loaded dynamically.
+ items: [
+ [ editor.lang.common.notSet, '' ]
+ ],
+ onChange: function() {
+ commitInternally.call( this, [ 'info:elementStyle', 'info:class', 'advanced:dir', 'advanced:style' ] );
+ },
+ setup: function( element ) {
+ for ( var name in styles )
+ styles[ name ].checkElementRemovable( element, true ) && this.setValue( name, 1 );
+ },
+ commit: function( element ) {
+ var styleName;
+ if ( ( styleName = this.getValue() ) ) {
+ var style = styles[ styleName ];
+ style.applyToObject( element );
+ }
+ else
+ element.removeAttribute( 'style' );
+ }
+ },
+ {
+ id: 'class',
+ type: 'text',
+ requiredContent: 'div(cke-xyz)', // Random text like 'xyz' will check if all are allowed.
+ label: editor.lang.common.cssClass,
+ 'default': ''
+ }
+ ]
+ }
+ ]
+ },
+ {
+ id: 'advanced',
+ label: editor.lang.common.advancedTab,
+ title: editor.lang.common.advancedTab,
+ elements: [
+ {
+ type: 'vbox',
+ padding: 1,
+ children: [
+ {
+ type: 'hbox',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ type: 'text',
+ id: 'id',
+ requiredContent: 'div[id]',
+ label: editor.lang.common.id,
+ 'default': ''
+ },
+ {
+ type: 'text',
+ id: 'lang',
+ requiredContent: 'div[lang]',
+ label: editor.lang.common.langCode,
+ 'default': ''
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ children: [
+ {
+ type: 'text',
+ id: 'style',
+ requiredContent: 'div{cke-xyz}', // Random text like 'xyz' will check if all are allowed.
+ style: 'width: 100%;',
+ label: editor.lang.common.cssStyle,
+ 'default': '',
+ commit: function( element ) {
+ element.setAttribute( 'style', this.getValue() );
+ }
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ children: [
+ {
+ type: 'text',
+ id: 'title',
+ requiredContent: 'div[title]',
+ style: 'width: 100%;',
+ label: editor.lang.common.advisoryTitle,
+ 'default': ''
+ }
+ ]
+ },
+ {
+ type: 'select',
+ id: 'dir',
+ requiredContent: 'div[dir]',
+ style: 'width: 100%;',
+ label: editor.lang.common.langDir,
+ 'default': '',
+ items: [
+ [ editor.lang.common.notSet, '' ],
+ [
+ editor.lang.common.langDirLtr,
+ 'ltr'
+ ],
+ [
+ editor.lang.common.langDirRtl,
+ 'rtl'
+ ]
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ onLoad: function() {
+ setupFields.call( this );
+
+ // Preparing for the 'elementStyle' field.
+ var dialog = this,
+ stylesField = this.getContentElement( 'info', 'elementStyle' );
+
+ // Reuse the 'stylescombo' plugin's styles definition.
+ editor.getStylesSet( function( stylesDefinitions ) {
+ var styleName, style;
+
+ if ( stylesDefinitions ) {
+ // Digg only those styles that apply to 'div'.
+ for ( var i = 0; i < stylesDefinitions.length; i++ ) {
+ var styleDefinition = stylesDefinitions[ i ];
+ if ( styleDefinition.element && styleDefinition.element == 'div' ) {
+ styleName = styleDefinition.name;
+ styles[ styleName ] = style = new CKEDITOR.style( styleDefinition );
+
+ if ( editor.filter.check( style ) ) {
+ // Populate the styles field options with style name.
+ stylesField.items.push( [ styleName, styleName ] );
+ stylesField.add( styleName, styleName );
+ }
+ }
+ }
+ }
+
+ // We should disable the content element
+ // it if no options are available at all.
+ stylesField[ stylesField.items.length > 1 ? 'enable' : 'disable' ]();
+
+ // Now setup the field value manually if dialog was opened on element. (#9689)
+ setTimeout( function() {
+ dialog._element && stylesField.setup( dialog._element );
+ }, 0 );
+ });
+ },
+ onShow: function() {
+ // Whether always create new container regardless of existed
+ // ones.
+ if ( command == 'editdiv' ) {
+ // Try to discover the containers that already existed in
+ // ranges
+ // update dialog field values
+ this.setupContent( this._element = CKEDITOR.plugins.div.getSurroundDiv( editor ) );
+ }
+ },
+ onOk: function() {
+ if ( command == 'editdiv' )
+ containers = [ this._element ];
+ else
+ containers = createDiv( editor, true );
+
+ // Update elements attributes
+ var size = containers.length;
+ for ( var i = 0; i < size; i++ ) {
+ this.commitContent( containers[ i ] );
+
+ // Remove empty 'style' attribute.
+ !containers[ i ].getAttribute( 'style' ) && containers[ i ].removeAttribute( 'style' );
+ }
+
+ this.hide();
+ },
+ onHide: function() {
+ // Remove style only when editing existing DIV. (#6315)
+ if ( command == 'editdiv' )
+ this._element.removeCustomData( 'elementStyle' );
+ delete this._element;
+ }
+ };
+ }
+
+ CKEDITOR.dialog.add( 'creatediv', function( editor ) {
+ return divDialog( editor, 'creatediv' );
+ });
+ CKEDITOR.dialog.add( 'editdiv', function( editor ) {
+ return divDialog( editor, 'editdiv' );
+ });
+})();
+
+/**
+ * Whether to wrap the whole table instead of indivisual cells when created `<div>` in table cell.
+ *
+ * config.div_wrapTable = true;
+ *
+ * @cfg {Boolean} [div_wrapTable=false]
+ * @member CKEDITOR.config
+ */
diff --git a/plugins/find/dialogs/find.js b/plugins/find/dialogs/find.js
index 317d678..a7168c7 100644
--- a/plugins/find/dialogs/find.js
+++ b/plugins/find/dialogs/find.js
@@ -1,10 +1,785 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-(function(){var a;function b(i){return i.type==CKEDITOR.NODE_TEXT&&i.getLength()>0&&(!a||!i.isReadOnly());};function c(i){return!(i.type==CKEDITOR.NODE_ELEMENT&&i.isBlockBoundary(CKEDITOR.tools.extend({},CKEDITOR.dtd.$empty,CKEDITOR.dtd.$nonEditable)));};var d=function(){var i=this;return{textNode:i.textNode,offset:i.offset,character:i.textNode?i.textNode.getText().charAt(i.offset):null,hitMatchBoundary:i._.matchBoundary};},e=['find','replace'],f=[['txtFindFind','txtFindReplace'],['txtFindCaseChk','txtReplaceCaseChk'],['txtFindWordChk','txtReplaceWordChk'],['txtFindCyclic','txtReplaceCyclic']];function g(i){var j,k,l,m;j=i==='find'?1:0;k=1-j;var n,o=f.length;for(n=0;n<o;n++){l=this.getContentElement(e[j],f[n][j]);m=this.getContentElement(e[k],f[n][k]);m.setValue(l.getValue());}};var h=function(i,j){var k=new CKEDITOR.style(CKEDITOR.tools.extend({attributes:{'data-cke-highlight':1},fullMatch:1,ignoreReadonly:1,childRule:function(){return 0;}},i.config.find_highlight,true)),l=function(y,z){var A=this,B=new CKEDITOR.dom.walker(y);B.guard=z?c:function(C){!c(C)&&(A._.matchBoundary=true);};B.evaluator=b;B.breakOnFalse=1;if(y.startContainer.type==CKEDITOR.NODE_TEXT){this.textNode=y.startContainer;this.offset=y.startOffset-1;}this._={matchWord:z,walker:B,matchBoundary:false};};l.prototype={next:function(){return this.move();},back:function(){return this.move(true);},move:function(y){var A=this;var z=A.textNode;if(z===null)return d.call(A);A._.matchBoundary=false;if(z&&y&&A.offset>0){A.offset--;return d.call(A);}else if(z&&A.offset<z.getLength()-1){A.offset++;return d.call(A);}else{z=null;while(!z){z=A._.walker[y?'previous':'next'].call(A._.walker);if(A._.matchWord&&!z||A._.walker._.end)break;}A.textNode=z;if(z)A.offset=y?z.getLength()-1:0;else A.offset=0;}return d.call(A);}};var m=function(y,z){this._={walker:y,cursors:[],rangeLength:z,highlightRange:null,isMatched:0};};m.prototype={toDomRange:function(){var y=new CKEDITOR.dom.range(i.document),z=this._.cursors;if(z.length<1){var A=this._.walker.textNode;if(A)y.setStartAfter(A);else return null;}else{var B=z[0],C=z[z.length-1];y.setStart(B.textNode,B.offset);y.setEnd(C.textNode,C.offset+1);}return y;},updateFromDomRange:function(y){var B=this;var z,A=new l(y);B._.cursors=[];do{z=A.next();if(z.character)B._.cursors.push(z);}while(z.character);B._.rangeLength=B._.cursors.length;},setMatched:function(){this._.isMatched=true;},clearMatched:function(){this._.isMatched=false;},isMatched:function(){return this._.isMatched;
-},highlight:function(){var B=this;if(B._.cursors.length<1)return;if(B._.highlightRange)B.removeHighlight();var y=B.toDomRange(),z=y.createBookmark();k.applyToRange(y);y.moveToBookmark(z);B._.highlightRange=y;var A=y.startContainer;if(A.type!=CKEDITOR.NODE_ELEMENT)A=A.getParent();A.scrollIntoView();B.updateFromDomRange(y);},removeHighlight:function(){var z=this;if(!z._.highlightRange)return;var y=z._.highlightRange.createBookmark();k.removeFromRange(z._.highlightRange);z._.highlightRange.moveToBookmark(y);z.updateFromDomRange(z._.highlightRange);z._.highlightRange=null;},isReadOnly:function(){if(!this._.highlightRange)return 0;return this._.highlightRange.startContainer.isReadOnly();},moveBack:function(){var A=this;var y=A._.walker.back(),z=A._.cursors;if(y.hitMatchBoundary)A._.cursors=z=[];z.unshift(y);if(z.length>A._.rangeLength)z.pop();return y;},moveNext:function(){var A=this;var y=A._.walker.next(),z=A._.cursors;if(y.hitMatchBoundary)A._.cursors=z=[];z.push(y);if(z.length>A._.rangeLength)z.shift();return y;},getEndCharacter:function(){var y=this._.cursors;if(y.length<1)return null;return y[y.length-1].character;},getNextCharacterRange:function(y){var z,A,B=this._.cursors;if((z=B[B.length-1])&&z.textNode)A=new l(n(z));else A=this._.walker;return new m(A,y);},getCursors:function(){return this._.cursors;}};function n(y,z){var A=new CKEDITOR.dom.range();A.setStart(y.textNode,z?y.offset:y.offset+1);A.setEndAt(i.document.getBody(),CKEDITOR.POSITION_BEFORE_END);return A;};function o(y){var z=new CKEDITOR.dom.range();z.setStartAt(i.document.getBody(),CKEDITOR.POSITION_AFTER_START);z.setEnd(y.textNode,y.offset);return z;};var p=0,q=1,r=2,s=function(y,z){var A=[-1];if(z)y=y.toLowerCase();for(var B=0;B<y.length;B++){A.push(A[B]+1);while(A[B+1]>0&&y.charAt(B)!=y.charAt(A[B+1]-1))A[B+1]=A[A[B+1]-1]+1;}this._={overlap:A,state:0,ignoreCase:!!z,pattern:y};};s.prototype={feedCharacter:function(y){var z=this;if(z._.ignoreCase)y=y.toLowerCase();for(;;){if(y==z._.pattern.charAt(z._.state)){z._.state++;if(z._.state==z._.pattern.length){z._.state=0;return r;}return q;}else if(!z._.state)return p;else z._.state=z._.overlap[z._.state];}return null;},reset:function(){this._.state=0;}};var t=/[.,"'?!;: \u0085\u00a0\u1680\u280e\u2028\u2029\u202f\u205f\u3000]/,u=function(y){if(!y)return true;var z=y.charCodeAt(0);return z>=9&&z<=13||z>=8192&&z<=8202||t.test(y);},v={searchRange:null,matchRange:null,find:function(y,z,A,B,C,D){var M=this;if(!M.matchRange)M.matchRange=new m(new l(M.searchRange),y.length);
-else{M.matchRange.removeHighlight();M.matchRange=M.matchRange.getNextCharacterRange(y.length);}var E=new s(y,!z),F=p,G='%';while(G!==null){M.matchRange.moveNext();while(G=M.matchRange.getEndCharacter()){F=E.feedCharacter(G);if(F==r)break;if(M.matchRange.moveNext().hitMatchBoundary)E.reset();}if(F==r){if(A){var H=M.matchRange.getCursors(),I=H[H.length-1],J=H[0],K=new l(o(J),true),L=new l(n(I),true);if(!(u(K.back().character)&&u(L.next().character)))continue;}M.matchRange.setMatched();if(C!==false)M.matchRange.highlight();return true;}}M.matchRange.clearMatched();M.matchRange.removeHighlight();if(B&&!D){M.searchRange=w(1);M.matchRange=null;return arguments.callee.apply(M,Array.prototype.slice.call(arguments).concat([true]));}return false;},replaceCounter:0,replace:function(y,z,A,B,C,D,E){var J=this;a=1;var F=0;if(J.matchRange&&J.matchRange.isMatched()&&!J.matchRange._.isReplaced&&!J.matchRange.isReadOnly()){J.matchRange.removeHighlight();var G=J.matchRange.toDomRange(),H=i.document.createText(A);if(!E){var I=i.getSelection();I.selectRanges([G]);i.fire('saveSnapshot');}G.deleteContents();G.insertNode(H);if(!E){I.selectRanges([G]);i.fire('saveSnapshot');}J.matchRange.updateFromDomRange(G);if(!E)J.matchRange.highlight();J.matchRange._.isReplaced=true;J.replaceCounter++;F=1;}else F=J.find(z,B,C,D,!E);a=0;return F;}};function w(y){var z,A=i.getSelection(),B=i.document.getBody();if(A&&!y){z=A.getRanges()[0].clone();z.collapse(true);}else{z=new CKEDITOR.dom.range();z.setStartAt(B,CKEDITOR.POSITION_AFTER_START);}z.setEndAt(B,CKEDITOR.POSITION_BEFORE_END);return z;};var x=i.lang.findAndReplace;return{title:x.title,resizable:CKEDITOR.DIALOG_RESIZE_NONE,minWidth:350,minHeight:170,buttons:[CKEDITOR.dialog.cancelButton],contents:[{id:'find',label:x.find,title:x.find,accessKey:'',elements:[{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtFindFind',label:x.findWhat,isChanged:false,labelLayout:'horizontal',accessKey:'F'},{type:'button',id:'btnFind',align:'left',style:'width:100%',label:x.find,onClick:function(){var y=this.getDialog();if(!v.find(y.getValueOf('find','txtFindFind'),y.getValueOf('find','txtFindCaseChk'),y.getValueOf('find','txtFindWordChk'),y.getValueOf('find','txtFindCyclic')))alert(x.notFoundMsg);}}]},{type:'fieldset',label:CKEDITOR.tools.htmlEncode(x.findOptions),style:'margin-top:29px',children:[{type:'vbox',padding:0,children:[{type:'checkbox',id:'txtFindCaseChk',isChanged:false,label:x.matchCase},{type:'checkbox',id:'txtFindWordChk',isChanged:false,label:x.matchWord},{type:'checkbox',id:'txtFindCyclic',isChanged:false,'default':true,label:x.matchCyclic}]}]}]},{id:'replace',label:x.replace,accessKey:'M',elements:[{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtFindReplace',label:x.findWhat,isChanged:false,labelLayout:'horizontal',accessKey:'F'},{type:'button',id:'btnFindReplace',align:'left',style:'width:100%',label:x.replace,onClick:function(){var y=this.getDialog();
-if(!v.replace(y,y.getValueOf('replace','txtFindReplace'),y.getValueOf('replace','txtReplace'),y.getValueOf('replace','txtReplaceCaseChk'),y.getValueOf('replace','txtReplaceWordChk'),y.getValueOf('replace','txtReplaceCyclic')))alert(x.notFoundMsg);}}]},{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtReplace',label:x.replaceWith,isChanged:false,labelLayout:'horizontal',accessKey:'R'},{type:'button',id:'btnReplaceAll',align:'left',style:'width:100%',label:x.replaceAll,isChanged:false,onClick:function(){var y=this.getDialog(),z;v.replaceCounter=0;v.searchRange=w(1);if(v.matchRange){v.matchRange.removeHighlight();v.matchRange=null;}i.fire('saveSnapshot');while(v.replace(y,y.getValueOf('replace','txtFindReplace'),y.getValueOf('replace','txtReplace'),y.getValueOf('replace','txtReplaceCaseChk'),y.getValueOf('replace','txtReplaceWordChk'),false,true)){}if(v.replaceCounter){alert(x.replaceSuccessMsg.replace(/%1/,v.replaceCounter));i.fire('saveSnapshot');}else alert(x.notFoundMsg);}}]},{type:'fieldset',label:CKEDITOR.tools.htmlEncode(x.findOptions),children:[{type:'vbox',padding:0,children:[{type:'checkbox',id:'txtReplaceCaseChk',isChanged:false,label:x.matchCase},{type:'checkbox',id:'txtReplaceWordChk',isChanged:false,label:x.matchWord},{type:'checkbox',id:'txtReplaceCyclic',isChanged:false,'default':true,label:x.matchCyclic}]}]}]}],onLoad:function(){var y=this,z,A,B=0;this.on('hide',function(){B=0;});this.on('show',function(){B=1;});this.selectPage=CKEDITOR.tools.override(this.selectPage,function(C){return function(D){C.call(y,D);var E=y._.tabs[D],F,G,H;G=D==='find'?'txtFindFind':'txtFindReplace';H=D==='find'?'txtFindWordChk':'txtReplaceWordChk';z=y.getContentElement(D,G);A=y.getContentElement(D,H);if(!E.initialized){F=CKEDITOR.document.getById(z._.inputId);E.initialized=true;}if(B)g.call(this,D);};});},onShow:function(){var B=this;v.searchRange=w();var y=B.getParentEditor().getSelection().getSelectedText(),z=j=='find'?'txtFindFind':'txtFindReplace',A=B.getContentElement(j,z);A.setValue(y);A.select();B.selectPage(j);B[(j=='find'&&B._.editor.readOnly?'hide':'show')+'Page']('replace');},onHide:function(){var y;if(v.matchRange&&v.matchRange.isMatched()){v.matchRange.removeHighlight();i.focus();y=v.matchRange.toDomRange();if(y)i.getSelection().selectRanges([y]);}delete v.matchRange;},onFocus:function(){if(j=='replace')return this.getContentElement('replace','txtFindReplace');else return this.getContentElement('find','txtFindFind');}};};CKEDITOR.dialog.add('find',function(i){return h(i,'find');
-});CKEDITOR.dialog.add('replace',function(i){return h(i,'replace');});})();
+(function() {
+ var isReplace;
+
+ function findEvaluator( node ) {
+ return node.type == CKEDITOR.NODE_TEXT && node.getLength() > 0 && ( !isReplace || !node.isReadOnly() );
+ }
+
+ // Elements which break characters been considered as sequence.
+ function nonCharactersBoundary( node ) {
+ return !( node.type == CKEDITOR.NODE_ELEMENT && node.isBlockBoundary( CKEDITOR.tools.extend( {}, CKEDITOR.dtd.$empty, CKEDITOR.dtd.$nonEditable ) ) );
+ }
+
+ // Get the cursor object which represent both current character and it's dom
+ // position thing.
+ var cursorStep = function() {
+ return {
+ textNode: this.textNode,
+ offset: this.offset,
+ character: this.textNode ? this.textNode.getText().charAt( this.offset ) : null,
+ hitMatchBoundary: this._.matchBoundary
+ };
+ };
+
+ var pages = [ 'find', 'replace' ],
+ fieldsMapping = [
+ [ 'txtFindFind', 'txtFindReplace' ],
+ [ 'txtFindCaseChk', 'txtReplaceCaseChk' ],
+ [ 'txtFindWordChk', 'txtReplaceWordChk' ],
+ [ 'txtFindCyclic', 'txtReplaceCyclic' ] ];
+
+ // Synchronize corresponding filed values between 'replace' and 'find' pages.
+ // @param {String} currentPageId The page id which receive values.
+ function syncFieldsBetweenTabs( currentPageId ) {
+ var sourceIndex, targetIndex, sourceField, targetField;
+
+ sourceIndex = currentPageId === 'find' ? 1 : 0;
+ targetIndex = 1 - sourceIndex;
+ var i,
+ l = fieldsMapping.length;
+ for ( i = 0; i < l; i++ ) {
+ sourceField = this.getContentElement( pages[ sourceIndex ], fieldsMapping[ i ][ sourceIndex ] );
+ targetField = this.getContentElement( pages[ targetIndex ], fieldsMapping[ i ][ targetIndex ] );
+
+ targetField.setValue( sourceField.getValue() );
+ }
+ }
+
+ var findDialog = function( editor, startupPage ) {
+ // Style object for highlights: (#5018)
+ // 1. Defined as full match style to avoid compromising ordinary text color styles.
+ // 2. Must be apply onto inner-most text to avoid conflicting with ordinary text color styles visually.
+ var highlightStyle = new CKEDITOR.style( CKEDITOR.tools.extend({
+ attributes: { 'data-cke-highlight':1 },
+ fullMatch: 1, ignoreReadonly: 1, childRule: function() {
+ return 0;
+ } }, editor.config.find_highlight, true ) );
+
+ // Iterator which walk through the specified range char by char. By
+ // default the walking will not stop at the character boundaries, until
+ // the end of the range is encountered.
+ // @param { CKEDITOR.dom.range } range
+ // @param {Boolean} matchWord Whether the walking will stop at character boundary.
+ var characterWalker = function( range, matchWord ) {
+ var self = this;
+ var walker = new CKEDITOR.dom.walker( range );
+ walker.guard = matchWord ? nonCharactersBoundary : function( node ) {
+ !nonCharactersBoundary( node ) && ( self._.matchBoundary = true );
+ };
+ walker[ 'evaluator' ] = findEvaluator;
+ walker.breakOnFalse = 1;
+
+ if ( range.startContainer.type == CKEDITOR.NODE_TEXT ) {
+ this.textNode = range.startContainer;
+ this.offset = range.startOffset - 1;
+ }
+
+ this._ = {
+ matchWord: matchWord,
+ walker: walker,
+ matchBoundary: false
+ };
+ };
+
+ characterWalker.prototype = {
+ next: function() {
+ return this.move();
+ },
+
+ back: function() {
+ return this.move( true );
+ },
+
+ move: function( rtl ) {
+ var currentTextNode = this.textNode;
+ // Already at the end of document, no more character available.
+ if ( currentTextNode === null )
+ return cursorStep.call( this );
+
+ this._.matchBoundary = false;
+
+ // There are more characters in the text node, step forward.
+ if ( currentTextNode && rtl && this.offset > 0 ) {
+ this.offset--;
+ return cursorStep.call( this );
+ } else if ( currentTextNode && this.offset < currentTextNode.getLength() - 1 ) {
+ this.offset++;
+ return cursorStep.call( this );
+ } else {
+ currentTextNode = null;
+ // At the end of the text node, walking foward for the next.
+ while ( !currentTextNode ) {
+ currentTextNode = this._.walker[ rtl ? 'previous' : 'next' ].call( this._.walker );
+
+ // Stop searching if we're need full word match OR
+ // already reach document end.
+ if ( this._.matchWord && !currentTextNode || this._.walker._.end )
+ break;
+ }
+ // Found a fresh text node.
+ this.textNode = currentTextNode;
+ if ( currentTextNode )
+ this.offset = rtl ? currentTextNode.getLength() - 1 : 0;
+ else
+ this.offset = 0;
+ }
+
+ return cursorStep.call( this );
+ }
+
+ };
+
+ /**
+ * A range of cursors which represent a trunk of characters which try to
+ * match, it has the same length as the pattern string.
+ *
+ * **Note:** This class isn't accessible from global scope.
+ *
+ * @private
+ * @class CKEDITOR.plugins.find.characterRange
+ * @constructor Creates a characterRange class instance.
+ */
+ var characterRange = function( characterWalker, rangeLength ) {
+ this._ = {
+ walker: characterWalker,
+ cursors: [],
+ rangeLength: rangeLength,
+ highlightRange: null,
+ isMatched: 0
+ };
+ };
+
+ characterRange.prototype = {
+ /**
+ * Translate this range to {@link CKEDITOR.dom.range}.
+ */
+ toDomRange: function() {
+ var range = editor.createRange();
+ var cursors = this._.cursors;
+ if ( cursors.length < 1 ) {
+ var textNode = this._.walker.textNode;
+ if ( textNode )
+ range.setStartAfter( textNode );
+ else
+ return null;
+ } else {
+ var first = cursors[ 0 ],
+ last = cursors[ cursors.length - 1 ];
+
+ range.setStart( first.textNode, first.offset );
+ range.setEnd( last.textNode, last.offset + 1 );
+ }
+
+ return range;
+ },
+
+ /**
+ * Reflect the latest changes from dom range.
+ */
+ updateFromDomRange: function( domRange ) {
+ var cursor,
+ walker = new characterWalker( domRange );
+ this._.cursors = [];
+ do {
+ cursor = walker.next();
+ if ( cursor.character ) this._.cursors.push( cursor );
+ }
+ while ( cursor.character );
+ this._.rangeLength = this._.cursors.length;
+ },
+
+ setMatched: function() {
+ this._.isMatched = true;
+ },
+
+ clearMatched: function() {
+ this._.isMatched = false;
+ },
+
+ isMatched: function() {
+ return this._.isMatched;
+ },
+
+ /**
+ * Hightlight the current matched chunk of text.
+ */
+ highlight: function() {
+ // Do not apply if nothing is found.
+ if ( this._.cursors.length < 1 )
+ return;
+
+ // Remove the previous highlight if there's one.
+ if ( this._.highlightRange )
+ this.removeHighlight();
+
+ // Apply the highlight.
+ var range = this.toDomRange(),
+ bookmark = range.createBookmark();
+ highlightStyle.applyToRange( range );
+ range.moveToBookmark( bookmark );
+ this._.highlightRange = range;
+
+ // Scroll the editor to the highlighted area.
+ var element = range.startContainer;
+ if ( element.type != CKEDITOR.NODE_ELEMENT )
+ element = element.getParent();
+ element.scrollIntoView();
+
+ // Update the character cursors.
+ this.updateFromDomRange( range );
+ },
+
+ /**
+ * Remove highlighted find result.
+ */
+ removeHighlight: function() {
+ if ( !this._.highlightRange )
+ return;
+
+ var bookmark = this._.highlightRange.createBookmark();
+ highlightStyle.removeFromRange( this._.highlightRange );
+ this._.highlightRange.moveToBookmark( bookmark );
+ this.updateFromDomRange( this._.highlightRange );
+ this._.highlightRange = null;
+ },
+
+ isReadOnly: function() {
+ if ( !this._.highlightRange )
+ return 0;
+
+ return this._.highlightRange.startContainer.isReadOnly();
+ },
+
+ moveBack: function() {
+ var retval = this._.walker.back(),
+ cursors = this._.cursors;
+
+ if ( retval.hitMatchBoundary )
+ this._.cursors = cursors = [];
+
+ cursors.unshift( retval );
+ if ( cursors.length > this._.rangeLength )
+ cursors.pop();
+
+ return retval;
+ },
+
+ moveNext: function() {
+ var retval = this._.walker.next(),
+ cursors = this._.cursors;
+
+ // Clear the cursors queue if we've crossed a match boundary.
+ if ( retval.hitMatchBoundary )
+ this._.cursors = cursors = [];
+
+ cursors.push( retval );
+ if ( cursors.length > this._.rangeLength )
+ cursors.shift();
+
+ return retval;
+ },
+
+ getEndCharacter: function() {
+ var cursors = this._.cursors;
+ if ( cursors.length < 1 )
+ return null;
+
+ return cursors[ cursors.length - 1 ].character;
+ },
+
+ getNextCharacterRange: function( maxLength ) {
+ var lastCursor, nextRangeWalker,
+ cursors = this._.cursors;
+
+ if ( ( lastCursor = cursors[ cursors.length - 1 ] ) && lastCursor.textNode )
+ nextRangeWalker = new characterWalker( getRangeAfterCursor( lastCursor ) );
+ // In case it's an empty range (no cursors), figure out next range from walker (#4951).
+ else
+ nextRangeWalker = this._.walker;
+
+ return new characterRange( nextRangeWalker, maxLength );
+ },
+
+ getCursors: function() {
+ return this._.cursors;
+ }
+ };
+
+
+ // The remaining document range after the character cursor.
+ function getRangeAfterCursor( cursor, inclusive ) {
+ var range = editor.createRange();
+ range.setStart( cursor.textNode, ( inclusive ? cursor.offset : cursor.offset + 1 ) );
+ range.setEndAt( editor.editable(), CKEDITOR.POSITION_BEFORE_END );
+ return range;
+ }
+
+ // The document range before the character cursor.
+ function getRangeBeforeCursor( cursor ) {
+ var range = editor.createRange();
+ range.setStartAt( editor.editable(), CKEDITOR.POSITION_AFTER_START );
+ range.setEnd( cursor.textNode, cursor.offset );
+ return range;
+ }
+
+ var KMP_NOMATCH = 0,
+ KMP_ADVANCED = 1,
+ KMP_MATCHED = 2;
+
+ // Examination the occurrence of a word which implement KMP algorithm.
+ var kmpMatcher = function( pattern, ignoreCase ) {
+ var overlap = [ -1 ];
+ if ( ignoreCase )
+ pattern = pattern.toLowerCase();
+ for ( var i = 0; i < pattern.length; i++ ) {
+ overlap.push( overlap[ i ] + 1 );
+ while ( overlap[ i + 1 ] > 0 && pattern.charAt( i ) != pattern.charAt( overlap[ i + 1 ] - 1 ) )
+ overlap[ i + 1 ] = overlap[ overlap[ i + 1 ] - 1 ] + 1;
+ }
+
+ this._ = {
+ overlap: overlap,
+ state: 0,
+ ignoreCase: !!ignoreCase,
+ pattern: pattern
+ };
+ };
+
+ kmpMatcher.prototype = {
+ feedCharacter: function( c ) {
+ if ( this._.ignoreCase )
+ c = c.toLowerCase();
+
+ while ( true ) {
+ if ( c == this._.pattern.charAt( this._.state ) ) {
+ this._.state++;
+ if ( this._.state == this._.pattern.length ) {
+ this._.state = 0;
+ return KMP_MATCHED;
+ }
+ return KMP_ADVANCED;
+ } else if ( !this._.state )
+ return KMP_NOMATCH;
+ else
+ this._.state = this._.overlap[ this._.state ];
+ }
+
+ return null;
+ },
+
+ reset: function() {
+ this._.state = 0;
+ }
+ };
+
+ var wordSeparatorRegex = /[.,"'?!;: \u0085\u00a0\u1680\u280e\u2028\u2029\u202f\u205f\u3000]/;
+
+ var isWordSeparator = function( c ) {
+ if ( !c )
+ return true;
+ var code = c.charCodeAt( 0 );
+ return ( code >= 9 && code <= 0xd ) || ( code >= 0x2000 && code <= 0x200a ) || wordSeparatorRegex.test( c );
+ };
+
+ var finder = {
+ searchRange: null,
+ matchRange: null,
+ find: function( pattern, matchCase, matchWord, matchCyclic, highlightMatched, cyclicRerun ) {
+ if ( !this.matchRange )
+ this.matchRange = new characterRange( new characterWalker( this.searchRange ), pattern.length );
+ else {
+ this.matchRange.removeHighlight();
+ this.matchRange = this.matchRange.getNextCharacterRange( pattern.length );
+ }
+
+ var matcher = new kmpMatcher( pattern, !matchCase ),
+ matchState = KMP_NOMATCH,
+ character = '%';
+
+ while ( character !== null ) {
+ this.matchRange.moveNext();
+ while ( ( character = this.matchRange.getEndCharacter() ) ) {
+ matchState = matcher.feedCharacter( character );
+ if ( matchState == KMP_MATCHED )
+ break;
+ if ( this.matchRange.moveNext().hitMatchBoundary )
+ matcher.reset();
+ }
+
+ if ( matchState == KMP_MATCHED ) {
+ if ( matchWord ) {
+ var cursors = this.matchRange.getCursors(),
+ tail = cursors[ cursors.length - 1 ],
+ head = cursors[ 0 ];
+
+ var rangeBefore = getRangeBeforeCursor( head ),
+ rangeAfter = getRangeAfterCursor( tail );
+
+ // The word boundary checks requires to trim the text nodes. (#9036)
+ rangeBefore.trim();
+ rangeAfter.trim();
+
+ var headWalker = new characterWalker( rangeBefore, true ),
+ tailWalker = new characterWalker( rangeAfter, true );
+
+ if ( !( isWordSeparator( headWalker.back().character ) && isWordSeparator( tailWalker.next().character ) ) )
+ continue;
+ }
+ this.matchRange.setMatched();
+ if ( highlightMatched !== false )
+ this.matchRange.highlight();
+ return true;
+ }
+ }
+
+ this.matchRange.clearMatched();
+ this.matchRange.removeHighlight();
+ // Clear current session and restart with the default search
+ // range.
+ // Re-run the finding once for cyclic.(#3517)
+ if ( matchCyclic && !cyclicRerun ) {
+ this.searchRange = getSearchRange( 1 );
+ this.matchRange = null;
+ return arguments.callee.apply( this, Array.prototype.slice.call( arguments ).concat( [ true ] ) );
+ }
+
+ return false;
+ },
+
+ // Record how much replacement occurred toward one replacing.
+ replaceCounter: 0,
+
+ replace: function( dialog, pattern, newString, matchCase, matchWord, matchCyclic, isReplaceAll ) {
+ isReplace = 1;
+
+ // Successiveness of current replace/find.
+ var result = 0;
+
+ // 1. Perform the replace when there's already a match here.
+ // 2. Otherwise perform the find but don't replace it immediately.
+ if ( this.matchRange && this.matchRange.isMatched() && !this.matchRange._.isReplaced && !this.matchRange.isReadOnly() ) {
+ // Turn off highlight for a while when saving snapshots.
+ this.matchRange.removeHighlight();
+ var domRange = this.matchRange.toDomRange();
+ var text = editor.document.createText( newString );
+ if ( !isReplaceAll ) {
+ // Save undo snaps before and after the replacement.
+ var selection = editor.getSelection();
+ selection.selectRanges( [ domRange ] );
+ editor.fire( 'saveSnapshot' );
+ }
+ domRange.deleteContents();
+ domRange.insertNode( text );
+ if ( !isReplaceAll ) {
+ selection.selectRanges( [ domRange ] );
+ editor.fire( 'saveSnapshot' );
+ }
+ this.matchRange.updateFromDomRange( domRange );
+ if ( !isReplaceAll )
+ this.matchRange.highlight();
+ this.matchRange._.isReplaced = true;
+ this.replaceCounter++;
+ result = 1;
+ } else
+ result = this.find( pattern, matchCase, matchWord, matchCyclic, !isReplaceAll );
+
+ isReplace = 0;
+
+ return result;
+ }
+ };
+
+ // The range in which find/replace happened, receive from user
+ // selection prior.
+ function getSearchRange( isDefault ) {
+ var searchRange,
+ sel = editor.getSelection(),
+ editable = editor.editable();
+
+ if ( sel && !isDefault ) {
+ searchRange = sel.getRanges()[ 0 ].clone();
+ searchRange.collapse( true );
+ } else {
+ searchRange = editor.createRange();
+ searchRange.setStartAt( editable, CKEDITOR.POSITION_AFTER_START );
+ }
+ searchRange.setEndAt( editable, CKEDITOR.POSITION_BEFORE_END );
+ return searchRange;
+ }
+
+ var lang = editor.lang.find;
+ return {
+ title: lang.title,
+ resizable: CKEDITOR.DIALOG_RESIZE_NONE,
+ minWidth: 350,
+ minHeight: 170,
+ buttons: [ CKEDITOR.dialog.cancelButton ], // Cancel button only.
+ contents: [
+ {
+ id: 'find',
+ label: lang.find,
+ title: lang.find,
+ accessKey: '',
+ elements: [
+ {
+ type: 'hbox',
+ widths: [ '230px', '90px' ],
+ children: [
+ {
+ type: 'text',
+ id: 'txtFindFind',
+ label: lang.findWhat,
+ isChanged: false,
+ labelLayout: 'horizontal',
+ accessKey: 'F'
+ },
+ {
+ type: 'button',
+ id: 'btnFind',
+ align: 'left',
+ style: 'width:100%',
+ label: lang.find,
+ onClick: function() {
+ var dialog = this.getDialog();
+ if ( !finder.find( dialog.getValueOf( 'find', 'txtFindFind' ), dialog.getValueOf( 'find', 'txtFindCaseChk' ), dialog.getValueOf( 'find', 'txtFindWordChk' ), dialog.getValueOf( 'find', 'txtFindCyclic' ) ) )
+ alert( lang.notFoundMsg );
+ }
+ }
+ ]
+ },
+ {
+ type: 'fieldset',
+ label: CKEDITOR.tools.htmlEncode( lang.findOptions ),
+ style: 'margin-top:29px',
+ children: [
+ {
+ type: 'vbox',
+ padding: 0,
+ children: [
+ {
+ type: 'checkbox',
+ id: 'txtFindCaseChk',
+ isChanged: false,
+ label: lang.matchCase
+ },
+ {
+ type: 'checkbox',
+ id: 'txtFindWordChk',
+ isChanged: false,
+ label: lang.matchWord
+ },
+ {
+ type: 'checkbox',
+ id: 'txtFindCyclic',
+ isChanged: false,
+ 'default': true,
+ label: lang.matchCyclic
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ id: 'replace',
+ label: lang.replace,
+ accessKey: 'M',
+ elements: [
+ {
+ type: 'hbox',
+ widths: [ '230px', '90px' ],
+ children: [
+ {
+ type: 'text',
+ id: 'txtFindReplace',
+ label: lang.findWhat,
+ isChanged: false,
+ labelLayout: 'horizontal',
+ accessKey: 'F'
+ },
+ {
+ type: 'button',
+ id: 'btnFindReplace',
+ align: 'left',
+ style: 'width:100%',
+ label: lang.replace,
+ onClick: function() {
+ var dialog = this.getDialog();
+ if ( !finder.replace( dialog, dialog.getValueOf( 'replace', 'txtFindReplace' ), dialog.getValueOf( 'replace', 'txtReplace' ), dialog.getValueOf( 'replace', 'txtReplaceCaseChk' ), dialog.getValueOf( 'replace', 'txtReplaceWordChk' ), dialog.getValueOf( 'replace', 'txtReplaceCyclic' ) ) )
+ alert( lang.notFoundMsg );
+ }
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '230px', '90px' ],
+ children: [
+ {
+ type: 'text',
+ id: 'txtReplace',
+ label: lang.replaceWith,
+ isChanged: false,
+ labelLayout: 'horizontal',
+ accessKey: 'R'
+ },
+ {
+ type: 'button',
+ id: 'btnReplaceAll',
+ align: 'left',
+ style: 'width:100%',
+ label: lang.replaceAll,
+ isChanged: false,
+ onClick: function() {
+ var dialog = this.getDialog();
+ var replaceNums;
+
+ finder.replaceCounter = 0;
+
+ // Scope to full document.
+ finder.searchRange = getSearchRange( 1 );
+ if ( finder.matchRange ) {
+ finder.matchRange.removeHighlight();
+ finder.matchRange = null;
+ }
+ editor.fire( 'saveSnapshot' );
+ while ( finder.replace( dialog, dialog.getValueOf( 'replace', 'txtFindReplace' ), dialog.getValueOf( 'replace', 'txtReplace' ), dialog.getValueOf( 'replace', 'txtReplaceCaseChk' ), dialog.getValueOf( 'replace', 'txtReplaceWordChk' ), false, true ) ) {
+ /*jsl:pass*/
+ }
+
+ if ( finder.replaceCounter ) {
+ alert( lang.replaceSuccessMsg.replace( /%1/, finder.replaceCounter ) );
+ editor.fire( 'saveSnapshot' );
+ } else
+ alert( lang.notFoundMsg );
+ }
+ }
+ ]
+ },
+ {
+ type: 'fieldset',
+ label: CKEDITOR.tools.htmlEncode( lang.findOptions ),
+ children: [
+ {
+ type: 'vbox',
+ padding: 0,
+ children: [
+ {
+ type: 'checkbox',
+ id: 'txtReplaceCaseChk',
+ isChanged: false,
+ label: lang.matchCase
+ },
+ {
+ type: 'checkbox',
+ id: 'txtReplaceWordChk',
+ isChanged: false,
+ label: lang.matchWord
+ },
+ {
+ type: 'checkbox',
+ id: 'txtReplaceCyclic',
+ isChanged: false,
+ 'default': true,
+ label: lang.matchCyclic
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ onLoad: function() {
+ var dialog = this;
+
+ // Keep track of the current pattern field in use.
+ var patternField, wholeWordChkField;
+
+ // Ignore initial page select on dialog show
+ var isUserSelect = 0;
+ this.on( 'hide', function() {
+ isUserSelect = 0;
+ });
+ this.on( 'show', function() {
+ isUserSelect = 1;
+ });
+
+ this.selectPage = CKEDITOR.tools.override( this.selectPage, function( originalFunc ) {
+ return function( pageId ) {
+ originalFunc.call( dialog, pageId );
+
+ var currPage = dialog._.tabs[ pageId ];
+ var patternFieldInput, patternFieldId, wholeWordChkFieldId;
+ patternFieldId = pageId === 'find' ? 'txtFindFind' : 'txtFindReplace';
+ wholeWordChkFieldId = pageId === 'find' ? 'txtFindWordChk' : 'txtReplaceWordChk';
+
+ patternField = dialog.getContentElement( pageId, patternFieldId );
+ wholeWordChkField = dialog.getContentElement( pageId, wholeWordChkFieldId );
+
+ // Prepare for check pattern text filed 'keyup' event
+ if ( !currPage.initialized ) {
+ patternFieldInput = CKEDITOR.document.getById( patternField._.inputId );
+ currPage.initialized = true;
+ }
+
+ // Synchronize fields on tab switch.
+ if ( isUserSelect )
+ syncFieldsBetweenTabs.call( this, pageId );
+ };
+ });
+
+ },
+ onShow: function() {
+ // Establish initial searching start position.
+ finder.searchRange = getSearchRange();
+
+ // Fill in the find field with selected text.
+ var selectedText = this.getParentEditor().getSelection().getSelectedText(),
+ patternFieldId = ( startupPage == 'find' ? 'txtFindFind' : 'txtFindReplace' );
+
+ var field = this.getContentElement( startupPage, patternFieldId );
+ field.setValue( selectedText );
+ field.select();
+
+ this.selectPage( startupPage );
+
+ this[ ( startupPage == 'find' && this._.editor.readOnly ? 'hide' : 'show' ) + 'Page' ]( 'replace' );
+ },
+ onHide: function() {
+ var range;
+ if ( finder.matchRange && finder.matchRange.isMatched() ) {
+ finder.matchRange.removeHighlight();
+ editor.focus();
+
+ range = finder.matchRange.toDomRange();
+ if ( range )
+ editor.getSelection().selectRanges( [ range ] );
+ }
+
+ // Clear current session before dialog close
+ delete finder.matchRange;
+ },
+ onFocus: function() {
+ if ( startupPage == 'replace' )
+ return this.getContentElement( 'replace', 'txtFindReplace' );
+ else
+ return this.getContentElement( 'find', 'txtFindFind' );
+ }
+ };
+ };
+
+ CKEDITOR.dialog.add( 'find', function( editor ) {
+ return findDialog( editor, 'find' );
+ });
+
+ CKEDITOR.dialog.add( 'replace', function( editor ) {
+ return findDialog( editor, 'replace' );
+ });
+})();
diff --git a/plugins/flash/dialogs/flash.js b/plugins/flash/dialogs/flash.js
index 475ede3..e0e60e8 100644
--- a/plugins/flash/dialogs/flash.js
+++ b/plugins/flash/dialogs/flash.js
@@ -1,9 +1,668 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-(function(){var a=1,b=2,c=4,d={id:[{type:a,name:'id'}],classid:[{type:a,name:'classid'}],codebase:[{type:a,name:'codebase'}],pluginspage:[{type:c,name:'pluginspage'}],src:[{type:b,name:'movie'},{type:c,name:'src'},{type:a,name:'data'}],name:[{type:c,name:'name'}],align:[{type:a,name:'align'}],title:[{type:a,name:'title'},{type:c,name:'title'}],'class':[{type:a,name:'class'},{type:c,name:'class'}],width:[{type:a,name:'width'},{type:c,name:'width'}],height:[{type:a,name:'height'},{type:c,name:'height'}],hSpace:[{type:a,name:'hSpace'},{type:c,name:'hSpace'}],vSpace:[{type:a,name:'vSpace'},{type:c,name:'vSpace'}],style:[{type:a,name:'style'},{type:c,name:'style'}],type:[{type:c,name:'type'}]},e=['play','loop','menu','quality','scale','salign','wmode','bgcolor','base','flashvars','allowScriptAccess','allowFullScreen'];for(var f=0;f<e.length;f++)d[e[f]]=[{type:c,name:e[f]},{type:b,name:e[f]}];e=['allowFullScreen','play','loop','menu'];for(f=0;f<e.length;f++)d[e[f]][0]['default']=d[e[f]][1]['default']=true;var g=CKEDITOR.tools.cssLength;function h(j,k,l){var r=this;var m=d[r.id];if(!m)return;var n=r instanceof CKEDITOR.ui.dialog.checkbox;for(var o=0;o<m.length;o++){var p=m[o];switch(p.type){case a:if(!j)continue;if(j.getAttribute(p.name)!==null){var q=j.getAttribute(p.name);if(n)r.setValue(q.toLowerCase()=='true');else r.setValue(q);return;}else if(n)r.setValue(!!p['default']);break;case b:if(!j)continue;if(p.name in l){q=l[p.name];if(n)r.setValue(q.toLowerCase()=='true');else r.setValue(q);return;}else if(n)r.setValue(!!p['default']);break;case c:if(!k)continue;if(k.getAttribute(p.name)){q=k.getAttribute(p.name);if(n)r.setValue(q.toLowerCase()=='true');else r.setValue(q);return;}else if(n)r.setValue(!!p['default']);}}};function i(j,k,l){var t=this;var m=d[t.id];if(!m)return;var n=t.getValue()==='',o=t instanceof CKEDITOR.ui.dialog.checkbox;for(var p=0;p<m.length;p++){var q=m[p];switch(q.type){case a:if(!j||q.name=='data'&&k&&!j.hasAttribute('data'))continue;var r=t.getValue();if(n||o&&r===q['default'])j.removeAttribute(q.name);else j.setAttribute(q.name,r);break;case b:if(!j)continue;r=t.getValue();if(n||o&&r===q['default']){if(q.name in l)l[q.name].remove();}else if(q.name in l)l[q.name].setAttribute('value',r);else{var s=CKEDITOR.dom.element.createFromHtml('<cke:param></cke:param>',j.getDocument());s.setAttributes({name:q.name,value:r});if(j.getChildCount()<1)s.appendTo(j);else s.insertBefore(j.getFirst());}break;case c:if(!k)continue;r=t.getValue();if(n||o&&r===q['default'])k.removeAttribute(q.name);
-else k.setAttribute(q.name,r);}}};CKEDITOR.dialog.add('flash',function(j){var k=!j.config.flashEmbedTagOnly,l=j.config.flashAddEmbedTag||j.config.flashEmbedTagOnly,m,n='<div>'+CKEDITOR.tools.htmlEncode(j.lang.common.preview)+'<br>'+'<div id="cke_FlashPreviewLoader'+CKEDITOR.tools.getNextNumber()+'" style="display:none"><div class="loading">&nbsp;</div></div>'+'<div id="cke_FlashPreviewBox'+CKEDITOR.tools.getNextNumber()+'" class="FlashPreviewBox"></div></div>';return{title:j.lang.flash.title,minWidth:420,minHeight:310,onShow:function(){var A=this;A.fakeImage=A.objectNode=A.embedNode=null;m=new CKEDITOR.dom.element('embed',j.document);var o=A.getSelectedElement();if(o&&o.data('cke-real-element-type')&&o.data('cke-real-element-type')=='flash'){A.fakeImage=o;var p=j.restoreRealElement(o),q=null,r=null,s={};if(p.getName()=='cke:object'){q=p;var t=q.getElementsByTag('embed','cke');if(t.count()>0)r=t.getItem(0);var u=q.getElementsByTag('param','cke');for(var v=0,w=u.count();v<w;v++){var x=u.getItem(v),y=x.getAttribute('name'),z=x.getAttribute('value');s[y]=z;}}else if(p.getName()=='cke:embed')r=p;A.objectNode=q;A.embedNode=r;A.setupContent(q,r,s,o);}},onOk:function(){var y=this;var o=null,p=null,q=null;if(!y.fakeImage){if(k){o=CKEDITOR.dom.element.createFromHtml('<cke:object></cke:object>',j.document);var r={classid:'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',codebase:'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'};o.setAttributes(r);}if(l){p=CKEDITOR.dom.element.createFromHtml('<cke:embed></cke:embed>',j.document);p.setAttributes({type:'application/x-shockwave-flash',pluginspage:'http://www.macromedia.com/go/getflashplayer'});if(o)p.appendTo(o);}}else{o=y.objectNode;p=y.embedNode;}if(o){q={};var s=o.getElementsByTag('param','cke');for(var t=0,u=s.count();t<u;t++)q[s.getItem(t).getAttribute('name')]=s.getItem(t);}var v={},w={};y.commitContent(o,p,q,v,w);var x=j.createFakeElement(o||p,'cke_flash','flash',true);x.setAttributes(w);x.setStyles(v);if(y.fakeImage){x.replace(y.fakeImage);j.getSelection().selectElement(x);}else j.insertElement(x);},onHide:function(){if(this.preview)this.preview.setHtml('');},contents:[{id:'info',label:j.lang.common.generalTab,accessKey:'I',elements:[{type:'vbox',padding:0,children:[{type:'hbox',widths:['280px','110px'],align:'right',children:[{id:'src',type:'text',label:j.lang.common.url,required:true,validate:CKEDITOR.dialog.validate.notEmpty(j.lang.flash.validateSrc),setup:h,commit:i,onLoad:function(){var o=this.getDialog(),p=function(q){m.setAttribute('src',q);
-o.preview.setHtml('<embed height="100%" width="100%" src="'+CKEDITOR.tools.htmlEncode(m.getAttribute('src'))+'" type="application/x-shockwave-flash"></embed>');};o.preview=o.getContentElement('info','preview').getElement().getChild(3);this.on('change',function(q){if(q.data&&q.data.value)p(q.data.value);});this.getInputElement().on('change',function(q){p(this.getValue());},this);}},{type:'button',id:'browse',filebrowser:'info:src',hidden:true,style:'display:inline-block;margin-top:10px;',label:j.lang.common.browseServer}]}]},{type:'hbox',widths:['25%','25%','25%','25%','25%'],children:[{type:'text',id:'width',style:'width:95px',label:j.lang.common.width,validate:CKEDITOR.dialog.validate.htmlLength(j.lang.common.invalidHtmlLength.replace('%1',j.lang.common.width)),setup:h,commit:i},{type:'text',id:'height',style:'width:95px',label:j.lang.common.height,validate:CKEDITOR.dialog.validate.htmlLength(j.lang.common.invalidHtmlLength.replace('%1',j.lang.common.height)),setup:h,commit:i},{type:'text',id:'hSpace',style:'width:95px',label:j.lang.flash.hSpace,validate:CKEDITOR.dialog.validate.integer(j.lang.flash.validateHSpace),setup:h,commit:i},{type:'text',id:'vSpace',style:'width:95px',label:j.lang.flash.vSpace,validate:CKEDITOR.dialog.validate.integer(j.lang.flash.validateVSpace),setup:h,commit:i}]},{type:'vbox',children:[{type:'html',id:'preview',style:'width:95%;',html:n}]}]},{id:'Upload',hidden:true,filebrowser:'uploadButton',label:j.lang.common.upload,elements:[{type:'file',id:'upload',label:j.lang.common.upload,size:38},{type:'fileButton',id:'uploadButton',label:j.lang.common.uploadSubmit,filebrowser:'info:src','for':['Upload','upload']}]},{id:'properties',label:j.lang.flash.propertiesTab,elements:[{type:'hbox',widths:['50%','50%'],children:[{id:'scale',type:'select',label:j.lang.flash.scale,'default':'',style:'width : 100%;',items:[[j.lang.common.notSet,''],[j.lang.flash.scaleAll,'showall'],[j.lang.flash.scaleNoBorder,'noborder'],[j.lang.flash.scaleFit,'exactfit']],setup:h,commit:i},{id:'allowScriptAccess',type:'select',label:j.lang.flash.access,'default':'',style:'width : 100%;',items:[[j.lang.common.notSet,''],[j.lang.flash.accessAlways,'always'],[j.lang.flash.accessSameDomain,'samedomain'],[j.lang.flash.accessNever,'never']],setup:h,commit:i}]},{type:'hbox',widths:['50%','50%'],children:[{id:'wmode',type:'select',label:j.lang.flash.windowMode,'default':'',style:'width : 100%;',items:[[j.lang.common.notSet,''],[j.lang.flash.windowModeWindow,'window'],[j.lang.flash.windowModeOpaque,'opaque'],[j.lang.flash.windowModeTransparent,'transparent']],setup:h,commit:i},{id:'quality',type:'select',label:j.lang.flash.quality,'default':'high',style:'width : 100%;',items:[[j.lang.common.notSet,''],[j.lang.flash.qualityBest,'best'],[j.lang.flash.qualityHigh,'high'],[j.lang.flash.qualityAutoHigh,'autohigh'],[j.lang.flash.qualityMedium,'medium'],[j.lang.flash.qualityAutoLow,'autolow'],[j.lang.flash.qualityLow,'low']],setup:h,commit:i}]},{type:'hbox',widths:['50%','50%'],children:[{id:'align',type:'select',label:j.lang.common.align,'default':'',style:'width : 100%;',items:[[j.lang.common.notSet,''],[j.lang.common.alignLeft,'left'],[j.lang.flash.alignAbsBottom,'absBottom'],[j.lang.flash.alignAbsMiddle,'absMiddle'],[j.lang.flash.alignBaseline,'baseline'],[j.lang.common.alignBottom,'bottom'],[j.lang.common.alignMiddle,'middle'],[j.lang.common.alignRight,'right'],[j.lang.flash.alignTextTop,'textTop'],[j.lang.common.alignTop,'top']],setup:h,commit:function(o,p,q,r,s){var t=this.getValue();
-i.apply(this,arguments);t&&(s.align=t);}},{type:'html',html:'<div></div>'}]},{type:'fieldset',label:CKEDITOR.tools.htmlEncode(j.lang.flash.flashvars),children:[{type:'vbox',padding:0,children:[{type:'checkbox',id:'menu',label:j.lang.flash.chkMenu,'default':true,setup:h,commit:i},{type:'checkbox',id:'play',label:j.lang.flash.chkPlay,'default':true,setup:h,commit:i},{type:'checkbox',id:'loop',label:j.lang.flash.chkLoop,'default':true,setup:h,commit:i},{type:'checkbox',id:'allowFullScreen',label:j.lang.flash.chkFull,'default':true,setup:h,commit:i}]}]}]},{id:'advanced',label:j.lang.common.advancedTab,elements:[{type:'hbox',widths:['45%','55%'],children:[{type:'text',id:'id',label:j.lang.common.id,setup:h,commit:i},{type:'text',id:'title',label:j.lang.common.advisoryTitle,setup:h,commit:i}]},{type:'hbox',widths:['45%','55%'],children:[{type:'text',id:'bgcolor',label:j.lang.flash.bgcolor,setup:h,commit:i},{type:'text',id:'class',label:j.lang.common.cssClass,setup:h,commit:i}]},{type:'text',id:'style',validate:CKEDITOR.dialog.validate.inlineStyle(j.lang.common.invalidInlineStyle),label:j.lang.common.cssStyle,setup:h,commit:i}]}]};});})();
+(function() {
+ // It is possible to set things in three different places.
+ // 1. As attributes in the object tag.
+ // 2. As param tags under the object tag.
+ // 3. As attributes in the embed tag.
+ // It is possible for a single attribute to be present in more than one place.
+ // So let's define a mapping between a sementic attribute and its syntactic
+ // equivalents.
+ // Then we'll set and retrieve attribute values according to the mapping,
+ // instead of having to check and set each syntactic attribute every time.
+ //
+ // Reference: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
+ var ATTRTYPE_OBJECT = 1,
+ ATTRTYPE_PARAM = 2,
+ ATTRTYPE_EMBED = 4;
+
+ var attributesMap = {
+ id: [ {
+ type: ATTRTYPE_OBJECT, name: 'id'
+ }],
+ classid: [ {
+ type: ATTRTYPE_OBJECT, name: 'classid'
+ }],
+ codebase: [ {
+ type: ATTRTYPE_OBJECT, name: 'codebase'
+ }],
+ pluginspage: [ {
+ type: ATTRTYPE_EMBED, name: 'pluginspage'
+ }],
+ src: [ {
+ type: ATTRTYPE_PARAM, name: 'movie'
+ }, {
+ type: ATTRTYPE_EMBED, name: 'src'
+ }, {
+ type: ATTRTYPE_OBJECT, name: 'data'
+ }],
+ name: [ {
+ type: ATTRTYPE_EMBED, name: 'name'
+ }],
+ align: [ {
+ type: ATTRTYPE_OBJECT, name: 'align'
+ }],
+ 'class': [ {
+ type: ATTRTYPE_OBJECT, name: 'class'
+ }, {
+ type: ATTRTYPE_EMBED, name: 'class'
+ }],
+ width: [ {
+ type: ATTRTYPE_OBJECT, name: 'width'
+ }, {
+ type: ATTRTYPE_EMBED, name: 'width'
+ }],
+ height: [ {
+ type: ATTRTYPE_OBJECT, name: 'height'
+ }, {
+ type: ATTRTYPE_EMBED, name: 'height'
+ }],
+ hSpace: [ {
+ type: ATTRTYPE_OBJECT, name: 'hSpace'
+ }, {
+ type: ATTRTYPE_EMBED, name: 'hSpace'
+ }],
+ vSpace: [ {
+ type: ATTRTYPE_OBJECT, name: 'vSpace'
+ }, {
+ type: ATTRTYPE_EMBED, name: 'vSpace'
+ }],
+ style: [ {
+ type: ATTRTYPE_OBJECT, name: 'style'
+ }, {
+ type: ATTRTYPE_EMBED, name: 'style'
+ }],
+ type: [ {
+ type: ATTRTYPE_EMBED, name: 'type'
+ }]
+ };
+
+ var names = [ 'play', 'loop', 'menu', 'quality', 'scale', 'salign', 'wmode', 'bgcolor', 'base', 'flashvars', 'allowScriptAccess', 'allowFullScreen' ];
+ for ( var i = 0; i < names.length; i++ )
+ attributesMap[ names[ i ] ] = [ {
+ type: ATTRTYPE_EMBED, name: names[ i ]
+ }, {
+ type: ATTRTYPE_PARAM, name: names[ i ]
+ }];
+ names = [ 'allowFullScreen', 'play', 'loop', 'menu' ];
+ for ( i = 0; i < names.length; i++ )
+ attributesMap[ names[ i ] ][ 0 ][ 'default' ] = attributesMap[ names[ i ] ][ 1 ][ 'default' ] = true;
+
+ var defaultToPixel = CKEDITOR.tools.cssLength;
+
+ function loadValue( objectNode, embedNode, paramMap ) {
+ var attributes = attributesMap[ this.id ];
+ if ( !attributes )
+ return;
+
+ var isCheckbox = ( this instanceof CKEDITOR.ui.dialog.checkbox );
+ for ( var i = 0; i < attributes.length; i++ ) {
+ var attrDef = attributes[ i ];
+ switch ( attrDef.type ) {
+ case ATTRTYPE_OBJECT:
+ if ( !objectNode )
+ continue;
+ if ( objectNode.getAttribute( attrDef.name ) !== null ) {
+ var value = objectNode.getAttribute( attrDef.name );
+ if ( isCheckbox )
+ this.setValue( value.toLowerCase() == 'true' );
+ else
+ this.setValue( value );
+ return;
+ } else if ( isCheckbox )
+ this.setValue( !!attrDef[ 'default' ] );
+ break;
+ case ATTRTYPE_PARAM:
+ if ( !objectNode )
+ continue;
+ if ( attrDef.name in paramMap ) {
+ value = paramMap[ attrDef.name ];
+ if ( isCheckbox )
+ this.setValue( value.toLowerCase() == 'true' );
+ else
+ this.setValue( value );
+ return;
+ } else if ( isCheckbox )
+ this.setValue( !!attrDef[ 'default' ] );
+ break;
+ case ATTRTYPE_EMBED:
+ if ( !embedNode )
+ continue;
+ if ( embedNode.getAttribute( attrDef.name ) ) {
+ value = embedNode.getAttribute( attrDef.name );
+ if ( isCheckbox )
+ this.setValue( value.toLowerCase() == 'true' );
+ else
+ this.setValue( value );
+ return;
+ } else if ( isCheckbox )
+ this.setValue( !!attrDef[ 'default' ] );
+ }
+ }
+ }
+
+ function commitValue( objectNode, embedNode, paramMap ) {
+ var attributes = attributesMap[ this.id ];
+ if ( !attributes )
+ return;
+
+ var isRemove = ( this.getValue() === '' ),
+ isCheckbox = ( this instanceof CKEDITOR.ui.dialog.checkbox );
+
+ for ( var i = 0; i < attributes.length; i++ ) {
+ var attrDef = attributes[ i ];
+ switch ( attrDef.type ) {
+ case ATTRTYPE_OBJECT:
+ // Avoid applying the data attribute when not needed (#7733)
+ if ( !objectNode || ( attrDef.name == 'data' && embedNode && !objectNode.hasAttribute( 'data' ) ) )
+ continue;
+ var value = this.getValue();
+ if ( isRemove || isCheckbox && value === attrDef[ 'default' ] )
+ objectNode.removeAttribute( attrDef.name );
+ else
+ objectNode.setAttribute( attrDef.name, value );
+ break;
+ case ATTRTYPE_PARAM:
+ if ( !objectNode )
+ continue;
+ value = this.getValue();
+ if ( isRemove || isCheckbox && value === attrDef[ 'default' ] ) {
+ if ( attrDef.name in paramMap )
+ paramMap[ attrDef.name ].remove();
+ } else {
+ if ( attrDef.name in paramMap )
+ paramMap[ attrDef.name ].setAttribute( 'value', value );
+ else {
+ var param = CKEDITOR.dom.element.createFromHtml( '<cke:param></cke:param>', objectNode.getDocument() );
+ param.setAttributes({ name: attrDef.name, value: value } );
+ if ( objectNode.getChildCount() < 1 )
+ param.appendTo( objectNode );
+ else
+ param.insertBefore( objectNode.getFirst() );
+ }
+ }
+ break;
+ case ATTRTYPE_EMBED:
+ if ( !embedNode )
+ continue;
+ value = this.getValue();
+ if ( isRemove || isCheckbox && value === attrDef[ 'default' ] )
+ embedNode.removeAttribute( attrDef.name );
+ else
+ embedNode.setAttribute( attrDef.name, value );
+ }
+ }
+ }
+
+ CKEDITOR.dialog.add( 'flash', function( editor ) {
+ var makeObjectTag = !editor.config.flashEmbedTagOnly,
+ makeEmbedTag = editor.config.flashAddEmbedTag || editor.config.flashEmbedTagOnly;
+
+ var previewPreloader,
+ previewAreaHtml = '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) + '<br>' +
+ '<div id="cke_FlashPreviewLoader' + CKEDITOR.tools.getNextNumber() + '" style="display:none"><div class="loading">&nbsp;</div></div>' +
+ '<div id="cke_FlashPreviewBox' + CKEDITOR.tools.getNextNumber() + '" class="FlashPreviewBox"></div></div>';
+
+ return {
+ title: editor.lang.flash.title,
+ minWidth: 420,
+ minHeight: 310,
+ onShow: function() {
+ // Clear previously saved elements.
+ this.fakeImage = this.objectNode = this.embedNode = null;
+ previewPreloader = new CKEDITOR.dom.element( 'embed', editor.document );
+
+ // Try to detect any embed or object tag that has Flash parameters.
+ var fakeImage = this.getSelectedElement();
+ if ( fakeImage && fakeImage.data( 'cke-real-element-type' ) && fakeImage.data( 'cke-real-element-type' ) == 'flash' ) {
+ this.fakeImage = fakeImage;
+
+ var realElement = editor.restoreRealElement( fakeImage ),
+ objectNode = null,
+ embedNode = null,
+ paramMap = {};
+ if ( realElement.getName() == 'cke:object' ) {
+ objectNode = realElement;
+ var embedList = objectNode.getElementsByTag( 'embed', 'cke' );
+ if ( embedList.count() > 0 )
+ embedNode = embedList.getItem( 0 );
+ var paramList = objectNode.getElementsByTag( 'param', 'cke' );
+ for ( var i = 0, length = paramList.count(); i < length; i++ ) {
+ var item = paramList.getItem( i ),
+ name = item.getAttribute( 'name' ),
+ value = item.getAttribute( 'value' );
+ paramMap[ name ] = value;
+ }
+ } else if ( realElement.getName() == 'cke:embed' )
+ embedNode = realElement;
+
+ this.objectNode = objectNode;
+ this.embedNode = embedNode;
+
+ this.setupContent( objectNode, embedNode, paramMap, fakeImage );
+ }
+ },
+ onOk: function() {
+ // If there's no selected object or embed, create one. Otherwise, reuse the
+ // selected object and embed nodes.
+ var objectNode = null,
+ embedNode = null,
+ paramMap = null;
+ if ( !this.fakeImage ) {
+ if ( makeObjectTag ) {
+ objectNode = CKEDITOR.dom.element.createFromHtml( '<cke:object></cke:object>', editor.document );
+ var attributes = {
+ classid: 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
+ codebase: 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'
+ };
+ objectNode.setAttributes( attributes );
+ }
+ if ( makeEmbedTag ) {
+ embedNode = CKEDITOR.dom.element.createFromHtml( '<cke:embed></cke:embed>', editor.document );
+ embedNode.setAttributes({
+ type: 'application/x-shockwave-flash',
+ pluginspage: 'http://www.macromedia.com/go/getflashplayer'
+ });
+ if ( objectNode )
+ embedNode.appendTo( objectNode );
+ }
+ } else {
+ objectNode = this.objectNode;
+ embedNode = this.embedNode;
+ }
+
+ // Produce the paramMap if there's an object tag.
+ if ( objectNode ) {
+ paramMap = {};
+ var paramList = objectNode.getElementsByTag( 'param', 'cke' );
+ for ( var i = 0, length = paramList.count(); i < length; i++ )
+ paramMap[ paramList.getItem( i ).getAttribute( 'name' ) ] = paramList.getItem( i );
+ }
+
+ // A subset of the specified attributes/styles
+ // should also be applied on the fake element to
+ // have better visual effect. (#5240)
+ var extraStyles = {},
+ extraAttributes = {};
+ this.commitContent( objectNode, embedNode, paramMap, extraStyles, extraAttributes );
+
+ // Refresh the fake image.
+ var newFakeImage = editor.createFakeElement( objectNode || embedNode, 'cke_flash', 'flash', true );
+ newFakeImage.setAttributes( extraAttributes );
+ newFakeImage.setStyles( extraStyles );
+ if ( this.fakeImage ) {
+ newFakeImage.replace( this.fakeImage );
+ editor.getSelection().selectElement( newFakeImage );
+ } else
+ editor.insertElement( newFakeImage );
+ },
+
+ onHide: function() {
+ if ( this.preview )
+ this.preview.setHtml( '' );
+ },
+
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.common.generalTab,
+ accessKey: 'I',
+ elements: [
+ {
+ type: 'vbox',
+ padding: 0,
+ children: [
+ {
+ type: 'hbox',
+ widths: [ '280px', '110px' ],
+ align: 'right',
+ children: [
+ {
+ id: 'src',
+ type: 'text',
+ label: editor.lang.common.url,
+ required: true,
+ validate: CKEDITOR.dialog.validate.notEmpty( editor.lang.flash.validateSrc ),
+ setup: loadValue,
+ commit: commitValue,
+ onLoad: function() {
+ var dialog = this.getDialog(),
+ updatePreview = function( src ) {
+ // Query the preloader to figure out the url impacted by based href.
+ previewPreloader.setAttribute( 'src', src );
+ dialog.preview.setHtml( '<embed height="100%" width="100%" src="' + CKEDITOR.tools.htmlEncode( previewPreloader.getAttribute( 'src' ) )
+ + '" type="application/x-shockwave-flash"></embed>' );
+ };
+ // Preview element
+ dialog.preview = dialog.getContentElement( 'info', 'preview' ).getElement().getChild( 3 );
+
+ // Sync on inital value loaded.
+ this.on( 'change', function( evt ) {
+
+ if ( evt.data && evt.data.value )
+ updatePreview( evt.data.value );
+ });
+ // Sync when input value changed.
+ this.getInputElement().on( 'change', function( evt ) {
+
+ updatePreview( this.getValue() );
+ }, this );
+ }
+ },
+ {
+ type: 'button',
+ id: 'browse',
+ filebrowser: 'info:src',
+ hidden: true,
+ // v-align with the 'src' field.
+ // TODO: We need something better than a fixed size here.
+ style: 'display:inline-block;margin-top:10px;',
+ label: editor.lang.common.browseServer
+ }
+ ]
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '25%', '25%', '25%', '25%', '25%' ],
+ children: [
+ {
+ type: 'text',
+ id: 'width',
+ requiredContent: 'embed[width]',
+ style: 'width:95px',
+ label: editor.lang.common.width,
+ validate: CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength.replace( '%1', editor.lang.common.width ) ),
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ type: 'text',
+ id: 'height',
+ requiredContent: 'embed[height]',
+ style: 'width:95px',
+ label: editor.lang.common.height,
+ validate: CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength.replace( '%1', editor.lang.common.height ) ),
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ type: 'text',
+ id: 'hSpace',
+ requiredContent: 'embed[hspace]',
+ style: 'width:95px',
+ label: editor.lang.flash.hSpace,
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.flash.validateHSpace ),
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ type: 'text',
+ id: 'vSpace',
+ requiredContent: 'embed[vspace]',
+ style: 'width:95px',
+ label: editor.lang.flash.vSpace,
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.flash.validateVSpace ),
+ setup: loadValue,
+ commit: commitValue
+ }
+ ]
+ },
+
+ {
+ type: 'vbox',
+ children: [
+ {
+ type: 'html',
+ id: 'preview',
+ style: 'width:95%;',
+ html: previewAreaHtml
+ }
+ ]
+ }
+ ]
+ },
+ {
+ id: 'Upload',
+ hidden: true,
+ filebrowser: 'uploadButton',
+ label: editor.lang.common.upload,
+ elements: [
+ {
+ type: 'file',
+ id: 'upload',
+ label: editor.lang.common.upload,
+ size: 38
+ },
+ {
+ type: 'fileButton',
+ id: 'uploadButton',
+ label: editor.lang.common.uploadSubmit,
+ filebrowser: 'info:src',
+ 'for': [ 'Upload', 'upload' ]
+ }
+ ]
+ },
+ {
+ id: 'properties',
+ label: editor.lang.flash.propertiesTab,
+ elements: [
+ {
+ type: 'hbox',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ id: 'scale',
+ type: 'select',
+ requiredContent: 'embed[scale]',
+ label: editor.lang.flash.scale,
+ 'default': '',
+ style: 'width : 100%;',
+ items: [
+ [ editor.lang.common.notSet, '' ],
+ [ editor.lang.flash.scaleAll, 'showall' ],
+ [ editor.lang.flash.scaleNoBorder, 'noborder' ],
+ [ editor.lang.flash.scaleFit, 'exactfit' ]
+ ],
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ id: 'allowScriptAccess',
+ type: 'select',
+ requiredContent: 'embed[allowscriptaccess]',
+ label: editor.lang.flash.access,
+ 'default': '',
+ style: 'width : 100%;',
+ items: [
+ [ editor.lang.common.notSet, '' ],
+ [ editor.lang.flash.accessAlways, 'always' ],
+ [ editor.lang.flash.accessSameDomain, 'samedomain' ],
+ [ editor.lang.flash.accessNever, 'never' ]
+ ],
+ setup: loadValue,
+ commit: commitValue
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ id: 'wmode',
+ type: 'select',
+ requiredContent: 'embed[wmode]',
+ label: editor.lang.flash.windowMode,
+ 'default': '',
+ style: 'width : 100%;',
+ items: [
+ [ editor.lang.common.notSet, '' ],
+ [ editor.lang.flash.windowModeWindow, 'window' ],
+ [ editor.lang.flash.windowModeOpaque, 'opaque' ],
+ [ editor.lang.flash.windowModeTransparent, 'transparent' ]
+ ],
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ id: 'quality',
+ type: 'select',
+ requiredContent: 'embed[quality]',
+ label: editor.lang.flash.quality,
+ 'default': 'high',
+ style: 'width : 100%;',
+ items: [
+ [ editor.lang.common.notSet, '' ],
+ [ editor.lang.flash.qualityBest, 'best' ],
+ [ editor.lang.flash.qualityHigh, 'high' ],
+ [ editor.lang.flash.qualityAutoHigh, 'autohigh' ],
+ [ editor.lang.flash.qualityMedium, 'medium' ],
+ [ editor.lang.flash.qualityAutoLow, 'autolow' ],
+ [ editor.lang.flash.qualityLow, 'low' ]
+ ],
+ setup: loadValue,
+ commit: commitValue
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ id: 'align',
+ type: 'select',
+ requiredContent: 'object[align]',
+ label: editor.lang.common.align,
+ 'default': '',
+ style: 'width : 100%;',
+ items: [
+ [ editor.lang.common.notSet, '' ],
+ [ editor.lang.common.alignLeft, 'left' ],
+ [ editor.lang.flash.alignAbsBottom, 'absBottom' ],
+ [ editor.lang.flash.alignAbsMiddle, 'absMiddle' ],
+ [ editor.lang.flash.alignBaseline, 'baseline' ],
+ [ editor.lang.common.alignBottom, 'bottom' ],
+ [ editor.lang.common.alignMiddle, 'middle' ],
+ [ editor.lang.common.alignRight, 'right' ],
+ [ editor.lang.flash.alignTextTop, 'textTop' ],
+ [ editor.lang.common.alignTop, 'top' ]
+ ],
+ setup: loadValue,
+ commit: function( objectNode, embedNode, paramMap, extraStyles, extraAttributes ) {
+ var value = this.getValue();
+ commitValue.apply( this, arguments );
+ value && ( extraAttributes.align = value );
+ }
+ },
+ {
+ type: 'html',
+ html: '<div></div>'
+ }
+ ]
+ },
+ {
+ type: 'fieldset',
+ label: CKEDITOR.tools.htmlEncode( editor.lang.flash.flashvars ),
+ children: [
+ {
+ type: 'vbox',
+ padding: 0,
+ children: [
+ {
+ type: 'checkbox',
+ id: 'menu',
+ label: editor.lang.flash.chkMenu,
+ 'default': true,
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ type: 'checkbox',
+ id: 'play',
+ label: editor.lang.flash.chkPlay,
+ 'default': true,
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ type: 'checkbox',
+ id: 'loop',
+ label: editor.lang.flash.chkLoop,
+ 'default': true,
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ type: 'checkbox',
+ id: 'allowFullScreen',
+ label: editor.lang.flash.chkFull,
+ 'default': true,
+ setup: loadValue,
+ commit: commitValue
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ id: 'advanced',
+ label: editor.lang.common.advancedTab,
+ elements: [
+ {
+ type: 'hbox',
+ children: [
+ {
+ type: 'text',
+ id: 'id',
+ requiredContent: 'object[id]',
+ label: editor.lang.common.id,
+ setup: loadValue,
+ commit: commitValue
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '45%', '55%' ],
+ children: [
+ {
+ type: 'text',
+ id: 'bgcolor',
+ requiredContent: 'embed[bgcolor]',
+ label: editor.lang.flash.bgcolor,
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ type: 'text',
+ id: 'class',
+ requiredContent: 'embed(cke-xyz)', // Random text like 'xyz' will check if all are allowed.
+ label: editor.lang.common.cssClass,
+ setup: loadValue,
+ commit: commitValue
+ }
+ ]
+ },
+ {
+ type: 'text',
+ id: 'style',
+ requiredContent: 'embed{cke-xyz}', // Random text like 'xyz' will check if all are allowed.
+ validate: CKEDITOR.dialog.validate.inlineStyle( editor.lang.common.invalidInlineStyle ),
+ label: editor.lang.common.cssStyle,
+ setup: loadValue,
+ commit: commitValue
+ }
+ ]
+ }
+ ]
+ };
+ });
+})();
diff --git a/plugins/forms/dialogs/button.js b/plugins/forms/dialogs/button.js
index 6030fd4..0abc6eb 100644
--- a/plugins/forms/dialogs/button.js
+++ b/plugins/forms/dialogs/button.js
@@ -1,6 +1,100 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
+CKEDITOR.dialog.add( 'button', function( editor ) {
+ function commitAttributes( element ) {
+ var val = this.getValue();
+ if ( val ) {
+ element.attributes[ this.id ] = val;
+ if ( this.id == 'name' )
+ element.attributes[ 'data-cke-saved-name' ] = val;
+ } else {
+ delete element.attributes[ this.id ];
+ if ( this.id == 'name' )
+ delete element.attributes[ 'data-cke-saved-name' ];
+ }
+ }
-CKEDITOR.dialog.add('button',function(a){function b(c){var e=this;var d=e.getValue();if(d){c.attributes[e.id]=d;if(e.id=='name')c.attributes['data-cke-saved-name']=d;}else{delete c.attributes[e.id];if(e.id=='name')delete c.attributes['data-cke-saved-name'];}};return{title:a.lang.button.title,minWidth:350,minHeight:150,onShow:function(){var e=this;delete e.button;var c=e.getParentEditor().getSelection().getSelectedElement();if(c&&c.is('input')){var d=c.getAttribute('type');if(d in {button:1,reset:1,submit:1}){e.button=c;e.setupContent(c);}}},onOk:function(){var c=this.getParentEditor(),d=this.button,e=!d,f=d?CKEDITOR.htmlParser.fragment.fromHtml(d.getOuterHtml()).children[0]:new CKEDITOR.htmlParser.element('input');this.commitContent(f);var g=new CKEDITOR.htmlParser.basicWriter();f.writeHtml(g);var h=CKEDITOR.dom.element.createFromHtml(g.getHtml(),c.document);if(e)c.insertElement(h);else{h.replace(d);c.getSelection().selectElement(h);}},contents:[{id:'info',label:a.lang.button.title,title:a.lang.button.title,elements:[{id:'name',type:'text',label:a.lang.common.name,'default':'',setup:function(c){this.setValue(c.data('cke-saved-name')||c.getAttribute('name')||'');},commit:b},{id:'value',type:'text',label:a.lang.button.text,accessKey:'V','default':'',setup:function(c){this.setValue(c.getAttribute('value')||'');},commit:b},{id:'type',type:'select',label:a.lang.button.type,'default':'button',accessKey:'T',items:[[a.lang.button.typeBtn,'button'],[a.lang.button.typeSbm,'submit'],[a.lang.button.typeRst,'reset']],setup:function(c){this.setValue(c.getAttribute('type')||'');},commit:b}]}]};});
+ return {
+ title: editor.lang.forms.button.title,
+ minWidth: 350,
+ minHeight: 150,
+ onShow: function() {
+ delete this.button;
+ var element = this.getParentEditor().getSelection().getSelectedElement();
+ if ( element && element.is( 'input' ) ) {
+ var type = element.getAttribute( 'type' );
+ if ( type in { button:1,reset:1,submit:1 } ) {
+ this.button = element;
+ this.setupContent( element );
+ }
+ }
+ },
+ onOk: function() {
+ var editor = this.getParentEditor(),
+ element = this.button,
+ isInsertMode = !element;
+
+ var fake = element ? CKEDITOR.htmlParser.fragment.fromHtml( element.getOuterHtml() ).children[ 0 ] : new CKEDITOR.htmlParser.element( 'input' );
+ this.commitContent( fake );
+
+ var writer = new CKEDITOR.htmlParser.basicWriter();
+ fake.writeHtml( writer );
+ var newElement = CKEDITOR.dom.element.createFromHtml( writer.getHtml(), editor.document );
+
+ if ( isInsertMode )
+ editor.insertElement( newElement );
+ else {
+ newElement.replace( element );
+ editor.getSelection().selectElement( newElement );
+ }
+ },
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.forms.button.title,
+ title: editor.lang.forms.button.title,
+ elements: [
+ {
+ id: 'name',
+ type: 'text',
+ label: editor.lang.common.name,
+ 'default': '',
+ setup: function( element ) {
+ this.setValue( element.data( 'cke-saved-name' ) || element.getAttribute( 'name' ) || '' );
+ },
+ commit: commitAttributes
+ },
+ {
+ id: 'value',
+ type: 'text',
+ label: editor.lang.forms.button.text,
+ accessKey: 'V',
+ 'default': '',
+ setup: function( element ) {
+ this.setValue( element.getAttribute( 'value' ) || '' );
+ },
+ commit: commitAttributes
+ },
+ {
+ id: 'type',
+ type: 'select',
+ label: editor.lang.forms.button.type,
+ 'default': 'button',
+ accessKey: 'T',
+ items: [
+ [ editor.lang.forms.button.typeBtn, 'button' ],
+ [ editor.lang.forms.button.typeSbm, 'submit' ],
+ [ editor.lang.forms.button.typeRst, 'reset' ]
+ ],
+ setup: function( element ) {
+ this.setValue( element.getAttribute( 'type' ) || '' );
+ },
+ commit: commitAttributes
+ }
+ ]
+ }
+ ]
+ };
+});
diff --git a/plugins/forms/dialogs/checkbox.js b/plugins/forms/dialogs/checkbox.js
index 45c8760..b24656a 100644
--- a/plugins/forms/dialogs/checkbox.js
+++ b/plugins/forms/dialogs/checkbox.js
@@ -1,6 +1,130 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
+CKEDITOR.dialog.add( 'checkbox', function( editor ) {
+ return {
+ title: editor.lang.forms.checkboxAndRadio.checkboxTitle,
+ minWidth: 350,
+ minHeight: 140,
+ onShow: function() {
+ delete this.checkbox;
-CKEDITOR.dialog.add('checkbox',function(a){return{title:a.lang.checkboxAndRadio.checkboxTitle,minWidth:350,minHeight:140,onShow:function(){var c=this;delete c.checkbox;var b=c.getParentEditor().getSelection().getSelectedElement();if(b&&b.getAttribute('type')=='checkbox'){c.checkbox=b;c.setupContent(b);}},onOk:function(){var b,c=this.checkbox,d=!c;if(d){b=this.getParentEditor();c=b.document.createElement('input');c.setAttribute('type','checkbox');b.insertElement(c);}this.commitContent({element:c});},contents:[{id:'info',label:a.lang.checkboxAndRadio.checkboxTitle,title:a.lang.checkboxAndRadio.checkboxTitle,startupFocus:'txtName',elements:[{id:'txtName',type:'text',label:a.lang.common.name,'default':'',accessKey:'N',setup:function(b){this.setValue(b.data('cke-saved-name')||b.getAttribute('name')||'');},commit:function(b){var c=b.element;if(this.getValue())c.data('cke-saved-name',this.getValue());else{c.data('cke-saved-name',false);c.removeAttribute('name');}}},{id:'txtValue',type:'text',label:a.lang.checkboxAndRadio.value,'default':'',accessKey:'V',setup:function(b){var c=b.getAttribute('value');this.setValue(CKEDITOR.env.ie&&c=='on'?'':c);},commit:function(b){var c=b.element,d=this.getValue();if(d&&!(CKEDITOR.env.ie&&d=='on'))c.setAttribute('value',d);else if(CKEDITOR.env.ie){var e=new CKEDITOR.dom.element('input',c.getDocument());c.copyAttributes(e,{value:1});e.replace(c);a.getSelection().selectElement(e);b.element=e;}else c.removeAttribute('value');}},{id:'cmbSelected',type:'checkbox',label:a.lang.checkboxAndRadio.selected,'default':'',accessKey:'S',value:'checked',setup:function(b){this.setValue(b.getAttribute('checked'));},commit:function(b){var c=b.element;if(CKEDITOR.env.ie){var d=!!c.getAttribute('checked'),e=!!this.getValue();if(d!=e){var f=CKEDITOR.dom.element.createFromHtml('<input type="checkbox"'+(e?' checked="checked"':'')+'/>',a.document);c.copyAttributes(f,{type:1,checked:1});f.replace(c);a.getSelection().selectElement(f);b.element=f;}}else{var g=this.getValue();if(g)c.setAttribute('checked','checked');else c.removeAttribute('checked');}}}]}]};});
+ var element = this.getParentEditor().getSelection().getSelectedElement();
+
+ if ( element && element.getAttribute( 'type' ) == 'checkbox' ) {
+ this.checkbox = element;
+ this.setupContent( element );
+ }
+ },
+ onOk: function() {
+ var editor,
+ element = this.checkbox,
+ isInsertMode = !element;
+
+ if ( isInsertMode ) {
+ editor = this.getParentEditor();
+ element = editor.document.createElement( 'input' );
+ element.setAttribute( 'type', 'checkbox' );
+ editor.insertElement( element );
+ }
+ this.commitContent({ element: element } );
+ },
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.forms.checkboxAndRadio.checkboxTitle,
+ title: editor.lang.forms.checkboxAndRadio.checkboxTitle,
+ startupFocus: 'txtName',
+ elements: [
+ {
+ id: 'txtName',
+ type: 'text',
+ label: editor.lang.common.name,
+ 'default': '',
+ accessKey: 'N',
+ setup: function( element ) {
+ this.setValue( element.data( 'cke-saved-name' ) || element.getAttribute( 'name' ) || '' );
+ },
+ commit: function( data ) {
+ var element = data.element;
+
+ // IE failed to update 'name' property on input elements, protect it now.
+ if ( this.getValue() )
+ element.data( 'cke-saved-name', this.getValue() );
+ else {
+ element.data( 'cke-saved-name', false );
+ element.removeAttribute( 'name' );
+ }
+ }
+ },
+ {
+ id: 'txtValue',
+ type: 'text',
+ label: editor.lang.forms.checkboxAndRadio.value,
+ 'default': '',
+ accessKey: 'V',
+ setup: function( element ) {
+ var value = element.getAttribute( 'value' );
+ // IE Return 'on' as default attr value.
+ this.setValue( CKEDITOR.env.ie && value == 'on' ? '' : value );
+ },
+ commit: function( data ) {
+ var element = data.element,
+ value = this.getValue();
+
+ if ( value && !( CKEDITOR.env.ie && value == 'on' ) )
+ element.setAttribute( 'value', value );
+ else {
+ if ( CKEDITOR.env.ie ) {
+ // Remove attribute 'value' of checkbox (#4721).
+ var checkbox = new CKEDITOR.dom.element( 'input', element.getDocument() );
+ element.copyAttributes( checkbox, { value:1 } );
+ checkbox.replace( element );
+ editor.getSelection().selectElement( checkbox );
+ data.element = checkbox;
+ } else
+ element.removeAttribute( 'value' );
+ }
+ }
+ },
+ {
+ id: 'cmbSelected',
+ type: 'checkbox',
+ label: editor.lang.forms.checkboxAndRadio.selected,
+ 'default': '',
+ accessKey: 'S',
+ value: "checked",
+ setup: function( element ) {
+ this.setValue( element.getAttribute( 'checked' ) );
+ },
+ commit: function( data ) {
+ var element = data.element;
+
+ if ( CKEDITOR.env.ie ) {
+ var isElementChecked = !!element.getAttribute( 'checked' ),
+ isChecked = !!this.getValue();
+
+ if ( isElementChecked != isChecked ) {
+ var replace = CKEDITOR.dom.element.createFromHtml( '<input type="checkbox"' + ( isChecked ? ' checked="checked"' : '' )
+ + '/>', editor.document );
+
+ element.copyAttributes( replace, { type:1,checked:1 } );
+ replace.replace( element );
+ editor.getSelection().selectElement( replace );
+ data.element = replace;
+ }
+ } else {
+ var value = this.getValue();
+ if ( value )
+ element.setAttribute( 'checked', 'checked' );
+ else
+ element.removeAttribute( 'checked' );
+ }
+ }
+ }
+ ]
+ }
+ ]
+ };
+});
diff --git a/plugins/forms/dialogs/form.js b/plugins/forms/dialogs/form.js
index 8b4e90f..58bf9a3 100644
--- a/plugins/forms/dialogs/form.js
+++ b/plugins/forms/dialogs/form.js
@@ -1,6 +1,151 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
+CKEDITOR.dialog.add( 'form', function( editor ) {
+ var autoAttributes = { action:1,id:1,method:1,enctype:1,target:1 };
-CKEDITOR.dialog.add('form',function(a){var b={action:1,id:1,method:1,enctype:1,target:1};return{title:a.lang.form.title,minWidth:350,minHeight:200,onShow:function(){var e=this;delete e.form;var c=e.getParentEditor().getSelection().getStartElement(),d=c&&c.getAscendant('form',true);if(d){e.form=d;e.setupContent(d);}},onOk:function(){var c,d=this.form,e=!d;if(e){c=this.getParentEditor();d=c.document.createElement('form');!CKEDITOR.env.ie&&d.append(c.document.createElement('br'));}if(e)c.insertElement(d);this.commitContent(d);},onLoad:function(){function c(e){this.setValue(e.getAttribute(this.id)||'');};function d(e){var f=this;if(f.getValue())e.setAttribute(f.id,f.getValue());else e.removeAttribute(f.id);};this.foreach(function(e){if(b[e.id]){e.setup=c;e.commit=d;}});},contents:[{id:'info',label:a.lang.form.title,title:a.lang.form.title,elements:[{id:'txtName',type:'text',label:a.lang.common.name,'default':'',accessKey:'N',setup:function(c){this.setValue(c.data('cke-saved-name')||c.getAttribute('name')||'');},commit:function(c){if(this.getValue())c.data('cke-saved-name',this.getValue());else{c.data('cke-saved-name',false);c.removeAttribute('name');}}},{id:'action',type:'text',label:a.lang.form.action,'default':'',accessKey:'T'},{type:'hbox',widths:['45%','55%'],children:[{id:'id',type:'text',label:a.lang.common.id,'default':'',accessKey:'I'},{id:'enctype',type:'select',label:a.lang.form.encoding,style:'width:100%',accessKey:'E','default':'',items:[[''],['text/plain'],['multipart/form-data'],['application/x-www-form-urlencoded']]}]},{type:'hbox',widths:['45%','55%'],children:[{id:'target',type:'select',label:a.lang.common.target,style:'width:100%',accessKey:'M','default':'',items:[[a.lang.common.notSet,''],[a.lang.common.targetNew,'_blank'],[a.lang.common.targetTop,'_top'],[a.lang.common.targetSelf,'_self'],[a.lang.common.targetParent,'_parent']]},{id:'method',type:'select',label:a.lang.form.method,accessKey:'M','default':'GET',items:[['GET','get'],['POST','post']]}]}]}]};});
+ return {
+ title: editor.lang.forms.form.title,
+ minWidth: 350,
+ minHeight: 200,
+ onShow: function() {
+ delete this.form;
+
+ var path = this.getParentEditor().elementPath(),
+ form = path.contains( 'form', 1 );
+
+ if ( form ) {
+ this.form = form;
+ this.setupContent( form );
+ }
+ },
+ onOk: function() {
+ var editor,
+ element = this.form,
+ isInsertMode = !element;
+
+ if ( isInsertMode ) {
+ editor = this.getParentEditor();
+ element = editor.document.createElement( 'form' );
+ !CKEDITOR.env.ie && element.append( editor.document.createElement( 'br' ) );
+ }
+
+ if ( isInsertMode )
+ editor.insertElement( element );
+ this.commitContent( element );
+ },
+ onLoad: function() {
+ function autoSetup( element ) {
+ this.setValue( element.getAttribute( this.id ) || '' );
+ }
+
+ function autoCommit( element ) {
+ if ( this.getValue() )
+ element.setAttribute( this.id, this.getValue() );
+ else
+ element.removeAttribute( this.id );
+ }
+
+ this.foreach( function( contentObj ) {
+ if ( autoAttributes[ contentObj.id ] ) {
+ contentObj.setup = autoSetup;
+ contentObj.commit = autoCommit;
+ }
+ });
+ },
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.forms.form.title,
+ title: editor.lang.forms.form.title,
+ elements: [
+ {
+ id: 'txtName',
+ type: 'text',
+ label: editor.lang.common.name,
+ 'default': '',
+ accessKey: 'N',
+ setup: function( element ) {
+ this.setValue( element.data( 'cke-saved-name' ) || element.getAttribute( 'name' ) || '' );
+ },
+ commit: function( element ) {
+ if ( this.getValue() )
+ element.data( 'cke-saved-name', this.getValue() );
+ else {
+ element.data( 'cke-saved-name', false );
+ element.removeAttribute( 'name' );
+ }
+ }
+ },
+ {
+ id: 'action',
+ type: 'text',
+ label: editor.lang.forms.form.action,
+ 'default': '',
+ accessKey: 'T'
+ },
+ {
+ type: 'hbox',
+ widths: [ '45%', '55%' ],
+ children: [
+ {
+ id: 'id',
+ type: 'text',
+ label: editor.lang.common.id,
+ 'default': '',
+ accessKey: 'I'
+ },
+ {
+ id: 'enctype',
+ type: 'select',
+ label: editor.lang.forms.form.encoding,
+ style: 'width:100%',
+ accessKey: 'E',
+ 'default': '',
+ items: [
+ [ '' ],
+ [ 'text/plain' ],
+ [ 'multipart/form-data' ],
+ [ 'application/x-www-form-urlencoded' ]
+ ]
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '45%', '55%' ],
+ children: [
+ {
+ id: 'target',
+ type: 'select',
+ label: editor.lang.common.target,
+ style: 'width:100%',
+ accessKey: 'M',
+ 'default': '',
+ items: [
+ [ editor.lang.common.notSet, '' ],
+ [ editor.lang.common.targetNew, '_blank' ],
+ [ editor.lang.common.targetTop, '_top' ],
+ [ editor.lang.common.targetSelf, '_self' ],
+ [ editor.lang.common.targetParent, '_parent' ]
+ ]
+ },
+ {
+ id: 'method',
+ type: 'select',
+ label: editor.lang.forms.form.method,
+ accessKey: 'M',
+ 'default': 'GET',
+ items: [
+ [ 'GET', 'get' ],
+ [ 'POST', 'post' ]
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ };
+});
diff --git a/plugins/forms/dialogs/hiddenfield.js b/plugins/forms/dialogs/hiddenfield.js
index 0bce0cf..601a088 100644
--- a/plugins/forms/dialogs/hiddenfield.js
+++ b/plugins/forms/dialogs/hiddenfield.js
@@ -1,6 +1,85 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
+CKEDITOR.dialog.add( 'hiddenfield', function( editor ) {
+ return {
+ title: editor.lang.forms.hidden.title,
+ hiddenField: null,
+ minWidth: 350,
+ minHeight: 110,
+ onShow: function() {
+ delete this.hiddenField;
-CKEDITOR.dialog.add('hiddenfield',function(a){return{title:a.lang.hidden.title,hiddenField:null,minWidth:350,minHeight:110,onShow:function(){var e=this;delete e.hiddenField;var b=e.getParentEditor(),c=b.getSelection(),d=c.getSelectedElement();if(d&&d.data('cke-real-element-type')&&d.data('cke-real-element-type')=='hiddenfield'){e.hiddenField=d;d=b.restoreRealElement(e.hiddenField);e.setupContent(d);c.selectElement(e.hiddenField);}},onOk:function(){var g=this;var b=g.getValueOf('info','_cke_saved_name'),c=g.getValueOf('info','value'),d=g.getParentEditor(),e=CKEDITOR.env.ie&&!(CKEDITOR.document.$.documentMode>=8)?d.document.createElement('<input name="'+CKEDITOR.tools.htmlEncode(b)+'">'):d.document.createElement('input');e.setAttribute('type','hidden');g.commitContent(e);var f=d.createFakeElement(e,'cke_hidden','hiddenfield');if(!g.hiddenField)d.insertElement(f);else{f.replace(g.hiddenField);d.getSelection().selectElement(f);}return true;},contents:[{id:'info',label:a.lang.hidden.title,title:a.lang.hidden.title,elements:[{id:'_cke_saved_name',type:'text',label:a.lang.hidden.name,'default':'',accessKey:'N',setup:function(b){this.setValue(b.data('cke-saved-name')||b.getAttribute('name')||'');},commit:function(b){if(this.getValue())b.setAttribute('name',this.getValue());else b.removeAttribute('name');}},{id:'value',type:'text',label:a.lang.hidden.value,'default':'',accessKey:'V',setup:function(b){this.setValue(b.getAttribute('value')||'');},commit:function(b){if(this.getValue())b.setAttribute('value',this.getValue());else b.removeAttribute('value');}}]}]};});
+ var editor = this.getParentEditor(),
+ selection = editor.getSelection(),
+ element = selection.getSelectedElement();
+
+ if ( element && element.data( 'cke-real-element-type' ) && element.data( 'cke-real-element-type' ) == 'hiddenfield' ) {
+ this.hiddenField = element;
+ element = editor.restoreRealElement( this.hiddenField );
+ this.setupContent( element );
+ selection.selectElement( this.hiddenField );
+ }
+ },
+ onOk: function() {
+ var name = this.getValueOf( 'info', '_cke_saved_name' ),
+ value = this.getValueOf( 'info', 'value' ),
+ editor = this.getParentEditor(),
+ element = CKEDITOR.env.ie && !( CKEDITOR.document.$.documentMode >= 8 ) ? editor.document.createElement( '<input name="' + CKEDITOR.tools.htmlEncode( name ) + '">' ) : editor.document.createElement( 'input' );
+
+ element.setAttribute( 'type', 'hidden' );
+ this.commitContent( element );
+ var fakeElement = editor.createFakeElement( element, 'cke_hidden', 'hiddenfield' );
+ if ( !this.hiddenField )
+ editor.insertElement( fakeElement );
+ else {
+ fakeElement.replace( this.hiddenField );
+ editor.getSelection().selectElement( fakeElement );
+ }
+ return true;
+ },
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.forms.hidden.title,
+ title: editor.lang.forms.hidden.title,
+ elements: [
+ {
+ id: '_cke_saved_name',
+ type: 'text',
+ label: editor.lang.forms.hidden.name,
+ 'default': '',
+ accessKey: 'N',
+ setup: function( element ) {
+ this.setValue( element.data( 'cke-saved-name' ) || element.getAttribute( 'name' ) || '' );
+ },
+ commit: function( element ) {
+ if ( this.getValue() )
+ element.setAttribute( 'name', this.getValue() );
+ else {
+ element.removeAttribute( 'name' );
+ }
+ }
+ },
+ {
+ id: 'value',
+ type: 'text',
+ label: editor.lang.forms.hidden.value,
+ 'default': '',
+ accessKey: 'V',
+ setup: function( element ) {
+ this.setValue( element.getAttribute( 'value' ) || '' );
+ },
+ commit: function( element ) {
+ if ( this.getValue() )
+ element.setAttribute( 'value', this.getValue() );
+ else
+ element.removeAttribute( 'value' );
+ }
+ }
+ ]
+ }
+ ]
+ };
+});
diff --git a/plugins/forms/dialogs/radio.js b/plugins/forms/dialogs/radio.js
index 4a05d9b..ebdf951 100644
--- a/plugins/forms/dialogs/radio.js
+++ b/plugins/forms/dialogs/radio.js
@@ -1,6 +1,115 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
+CKEDITOR.dialog.add( 'radio', function( editor ) {
+ return {
+ title: editor.lang.forms.checkboxAndRadio.radioTitle,
+ minWidth: 350,
+ minHeight: 140,
+ onShow: function() {
+ delete this.radioButton;
-CKEDITOR.dialog.add('radio',function(a){return{title:a.lang.checkboxAndRadio.radioTitle,minWidth:350,minHeight:140,onShow:function(){var c=this;delete c.radioButton;var b=c.getParentEditor().getSelection().getSelectedElement();if(b&&b.getName()=='input'&&b.getAttribute('type')=='radio'){c.radioButton=b;c.setupContent(b);}},onOk:function(){var b,c=this.radioButton,d=!c;if(d){b=this.getParentEditor();c=b.document.createElement('input');c.setAttribute('type','radio');}if(d)b.insertElement(c);this.commitContent({element:c});},contents:[{id:'info',label:a.lang.checkboxAndRadio.radioTitle,title:a.lang.checkboxAndRadio.radioTitle,elements:[{id:'name',type:'text',label:a.lang.common.name,'default':'',accessKey:'N',setup:function(b){this.setValue(b.data('cke-saved-name')||b.getAttribute('name')||'');},commit:function(b){var c=b.element;if(this.getValue())c.data('cke-saved-name',this.getValue());else{c.data('cke-saved-name',false);c.removeAttribute('name');}}},{id:'value',type:'text',label:a.lang.checkboxAndRadio.value,'default':'',accessKey:'V',setup:function(b){this.setValue(b.getAttribute('value')||'');},commit:function(b){var c=b.element;if(this.getValue())c.setAttribute('value',this.getValue());else c.removeAttribute('value');}},{id:'checked',type:'checkbox',label:a.lang.checkboxAndRadio.selected,'default':'',accessKey:'S',value:'checked',setup:function(b){this.setValue(b.getAttribute('checked'));},commit:function(b){var c=b.element;if(!(CKEDITOR.env.ie||CKEDITOR.env.opera)){if(this.getValue())c.setAttribute('checked','checked');else c.removeAttribute('checked');}else{var d=c.getAttribute('checked'),e=!!this.getValue();if(d!=e){var f=CKEDITOR.dom.element.createFromHtml('<input type="radio"'+(e?' checked="checked"':'')+'></input>',a.document);c.copyAttributes(f,{type:1,checked:1});f.replace(c);a.getSelection().selectElement(f);b.element=f;}}}}]}]};});
+ var element = this.getParentEditor().getSelection().getSelectedElement();
+ if ( element && element.getName() == 'input' && element.getAttribute( 'type' ) == 'radio' ) {
+ this.radioButton = element;
+ this.setupContent( element );
+ }
+ },
+ onOk: function() {
+ var editor,
+ element = this.radioButton,
+ isInsertMode = !element;
+
+ if ( isInsertMode ) {
+ editor = this.getParentEditor();
+ element = editor.document.createElement( 'input' );
+ element.setAttribute( 'type', 'radio' );
+ }
+
+ if ( isInsertMode )
+ editor.insertElement( element );
+ this.commitContent({ element: element } );
+ },
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.forms.checkboxAndRadio.radioTitle,
+ title: editor.lang.forms.checkboxAndRadio.radioTitle,
+ elements: [
+ {
+ id: 'name',
+ type: 'text',
+ label: editor.lang.common.name,
+ 'default': '',
+ accessKey: 'N',
+ setup: function( element ) {
+ this.setValue( element.data( 'cke-saved-name' ) || element.getAttribute( 'name' ) || '' );
+ },
+ commit: function( data ) {
+ var element = data.element;
+
+ if ( this.getValue() )
+ element.data( 'cke-saved-name', this.getValue() );
+ else {
+ element.data( 'cke-saved-name', false );
+ element.removeAttribute( 'name' );
+ }
+ }
+ },
+ {
+ id: 'value',
+ type: 'text',
+ label: editor.lang.forms.checkboxAndRadio.value,
+ 'default': '',
+ accessKey: 'V',
+ setup: function( element ) {
+ this.setValue( element.getAttribute( 'value' ) || '' );
+ },
+ commit: function( data ) {
+ var element = data.element;
+
+ if ( this.getValue() )
+ element.setAttribute( 'value', this.getValue() );
+ else
+ element.removeAttribute( 'value' );
+ }
+ },
+ {
+ id: 'checked',
+ type: 'checkbox',
+ label: editor.lang.forms.checkboxAndRadio.selected,
+ 'default': '',
+ accessKey: 'S',
+ value: "checked",
+ setup: function( element ) {
+ this.setValue( element.getAttribute( 'checked' ) );
+ },
+ commit: function( data ) {
+ var element = data.element;
+
+ if ( !( CKEDITOR.env.ie || CKEDITOR.env.opera ) ) {
+ if ( this.getValue() )
+ element.setAttribute( 'checked', 'checked' );
+ else
+ element.removeAttribute( 'checked' );
+ } else {
+ var isElementChecked = element.getAttribute( 'checked' );
+ var isChecked = !!this.getValue();
+
+ if ( isElementChecked != isChecked ) {
+ var replace = CKEDITOR.dom.element.createFromHtml( '<input type="radio"' + ( isChecked ? ' checked="checked"' : '' )
+ + '></input>', editor.document );
+ element.copyAttributes( replace, { type:1,checked:1 } );
+ replace.replace( element );
+ editor.getSelection().selectElement( replace );
+ data.element = replace;
+ }
+ }
+ }
+ }
+ ]
+ }
+ ]
+ };
+});
diff --git a/plugins/forms/dialogs/select.js b/plugins/forms/dialogs/select.js
index 37ec6d4..53aaf58 100644
--- a/plugins/forms/dialogs/select.js
+++ b/plugins/forms/dialogs/select.js
@@ -1,9 +1,503 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
+CKEDITOR.dialog.add( 'select', function( editor ) {
+ // Add a new option to a SELECT object (combo or list).
+ function addOption( combo, optionText, optionValue, documentObject, index ) {
+ combo = getSelect( combo );
+ var oOption;
+ if ( documentObject )
+ oOption = documentObject.createElement( "OPTION" );
+ else
+ oOption = document.createElement( "OPTION" );
-CKEDITOR.dialog.add('select',function(a){function b(k,l,m,n,o){k=j(k);var p;if(n)p=n.createElement('OPTION');else p=document.createElement('OPTION');if(k&&p&&p.getName()=='option'){if(CKEDITOR.env.ie){if(!isNaN(parseInt(o,10)))k.$.options.add(p.$,o);else k.$.options.add(p.$);p.$.innerHTML=l.length>0?l:'';p.$.value=m;}else{if(o!==null&&o<k.getChildCount())k.getChild(o<0?0:o).insertBeforeMe(p);else k.append(p);p.setText(l.length>0?l:'');p.setValue(m);}}else return false;return p;};function c(k){k=j(k);var l=g(k);for(var m=k.getChildren().count()-1;m>=0;m--){if(k.getChild(m).$.selected)k.getChild(m).remove();}h(k,l);};function d(k,l,m,n){k=j(k);if(l<0)return false;var o=k.getChild(l);o.setText(m);o.setValue(n);return o;};function e(k){k=j(k);while(k.getChild(0)&&k.getChild(0).remove()){}};function f(k,l,m){k=j(k);var n=g(k);if(n<0)return false;var o=n+l;o=o<0?0:o;o=o>=k.getChildCount()?k.getChildCount()-1:o;if(n==o)return false;var p=k.getChild(n),q=p.getText(),r=p.getValue();p.remove();p=b(k,q,r,!m?null:m,o);h(k,o);return p;};function g(k){k=j(k);return k?k.$.selectedIndex:-1;};function h(k,l){k=j(k);if(l<0)return null;var m=k.getChildren().count();k.$.selectedIndex=l>=m?m-1:l;return k;};function i(k){k=j(k);return k?k.getChildren():false;};function j(k){if(k&&k.domId&&k.getInputElement().$)return k.getInputElement();else if(k&&k.$)return k;return false;};return{title:a.lang.select.title,minWidth:CKEDITOR.env.ie?460:395,minHeight:CKEDITOR.env.ie?320:300,onShow:function(){var n=this;delete n.selectBox;n.setupContent('clear');var k=n.getParentEditor().getSelection().getSelectedElement();if(k&&k.getName()=='select'){n.selectBox=k;n.setupContent(k.getName(),k);var l=i(k);for(var m=0;m<l.count();m++)n.setupContent('option',l.getItem(m));}},onOk:function(){var k=this.getParentEditor(),l=this.selectBox,m=!l;if(m)l=k.document.createElement('select');this.commitContent(l);if(m){k.insertElement(l);if(CKEDITOR.env.ie){var n=k.getSelection(),o=n.createBookmarks();setTimeout(function(){n.selectBookmarks(o);},0);}}},contents:[{id:'info',label:a.lang.select.selectInfo,title:a.lang.select.selectInfo,accessKey:'',elements:[{id:'txtName',type:'text',widths:['25%','75%'],labelLayout:'horizontal',label:a.lang.common.name,'default':'',accessKey:'N',style:'width:350px',setup:function(k,l){if(k=='clear')this.setValue(this['default']||'');else if(k=='select')this.setValue(l.data('cke-saved-name')||l.getAttribute('name')||'');},commit:function(k){if(this.getValue())k.data('cke-saved-name',this.getValue());
-else{k.data('cke-saved-name',false);k.removeAttribute('name');}}},{id:'txtValue',type:'text',widths:['25%','75%'],labelLayout:'horizontal',label:a.lang.select.value,style:'width:350px','default':'',className:'cke_disabled',onLoad:function(){this.getInputElement().setAttribute('readOnly',true);},setup:function(k,l){if(k=='clear')this.setValue('');else if(k=='option'&&l.getAttribute('selected'))this.setValue(l.$.value);}},{type:'hbox',widths:['175px','170px'],children:[{id:'txtSize',type:'text',labelLayout:'horizontal',label:a.lang.select.size,'default':'',accessKey:'S',style:'width:175px',validate:function(){var k=CKEDITOR.dialog.validate.integer(a.lang.common.validateNumberFailed);return this.getValue()===''||k.apply(this);},setup:function(k,l){if(k=='select')this.setValue(l.getAttribute('size')||'');if(CKEDITOR.env.webkit)this.getInputElement().setStyle('width','86px');},commit:function(k){if(this.getValue())k.setAttribute('size',this.getValue());else k.removeAttribute('size');}},{type:'html',html:'<span>'+CKEDITOR.tools.htmlEncode(a.lang.select.lines)+'</span>'}]},{type:'html',html:'<span>'+CKEDITOR.tools.htmlEncode(a.lang.select.opAvail)+'</span>'},{type:'hbox',widths:['115px','115px','100px'],children:[{type:'vbox',children:[{id:'txtOptName',type:'text',label:a.lang.select.opText,style:'width:115px',setup:function(k,l){if(k=='clear')this.setValue('');}},{type:'select',id:'cmbName',label:'',title:'',size:5,style:'width:115px;height:75px',items:[],onChange:function(){var k=this.getDialog(),l=k.getContentElement('info','cmbValue'),m=k.getContentElement('info','txtOptName'),n=k.getContentElement('info','txtOptValue'),o=g(this);h(l,o);m.setValue(this.getValue());n.setValue(l.getValue());},setup:function(k,l){if(k=='clear')e(this);else if(k=='option')b(this,l.getText(),l.getText(),this.getDialog().getParentEditor().document);},commit:function(k){var l=this.getDialog(),m=i(this),n=i(l.getContentElement('info','cmbValue')),o=l.getContentElement('info','txtValue').getValue();e(k);for(var p=0;p<m.count();p++){var q=b(k,m.getItem(p).getValue(),n.getItem(p).getValue(),l.getParentEditor().document);if(n.getItem(p).getValue()==o){q.setAttribute('selected','selected');q.selected=true;}}}}]},{type:'vbox',children:[{id:'txtOptValue',type:'text',label:a.lang.select.opValue,style:'width:115px',setup:function(k,l){if(k=='clear')this.setValue('');}},{type:'select',id:'cmbValue',label:'',size:5,style:'width:115px;height:75px',items:[],onChange:function(){var k=this.getDialog(),l=k.getContentElement('info','cmbName'),m=k.getContentElement('info','txtOptName'),n=k.getContentElement('info','txtOptValue'),o=g(this);
-h(l,o);m.setValue(l.getValue());n.setValue(this.getValue());},setup:function(k,l){var n=this;if(k=='clear')e(n);else if(k=='option'){var m=l.getValue();b(n,m,m,n.getDialog().getParentEditor().document);if(l.getAttribute('selected')=='selected')n.getDialog().getContentElement('info','txtValue').setValue(m);}}}]},{type:'vbox',padding:5,children:[{type:'button',id:'btnAdd',style:'',label:a.lang.select.btnAdd,title:a.lang.select.btnAdd,style:'width:100%;',onClick:function(){var k=this.getDialog(),l=k.getParentEditor(),m=k.getContentElement('info','txtOptName'),n=k.getContentElement('info','txtOptValue'),o=k.getContentElement('info','cmbName'),p=k.getContentElement('info','cmbValue');b(o,m.getValue(),m.getValue(),k.getParentEditor().document);b(p,n.getValue(),n.getValue(),k.getParentEditor().document);m.setValue('');n.setValue('');}},{type:'button',id:'btnModify',label:a.lang.select.btnModify,title:a.lang.select.btnModify,style:'width:100%;',onClick:function(){var k=this.getDialog(),l=k.getContentElement('info','txtOptName'),m=k.getContentElement('info','txtOptValue'),n=k.getContentElement('info','cmbName'),o=k.getContentElement('info','cmbValue'),p=g(n);if(p>=0){d(n,p,l.getValue(),l.getValue());d(o,p,m.getValue(),m.getValue());}}},{type:'button',id:'btnUp',style:'width:100%;',label:a.lang.select.btnUp,title:a.lang.select.btnUp,onClick:function(){var k=this.getDialog(),l=k.getContentElement('info','cmbName'),m=k.getContentElement('info','cmbValue');f(l,-1,k.getParentEditor().document);f(m,-1,k.getParentEditor().document);}},{type:'button',id:'btnDown',style:'width:100%;',label:a.lang.select.btnDown,title:a.lang.select.btnDown,onClick:function(){var k=this.getDialog(),l=k.getContentElement('info','cmbName'),m=k.getContentElement('info','cmbValue');f(l,1,k.getParentEditor().document);f(m,1,k.getParentEditor().document);}}]}]},{type:'hbox',widths:['40%','20%','40%'],children:[{type:'button',id:'btnSetValue',label:a.lang.select.btnSetValue,title:a.lang.select.btnSetValue,onClick:function(){var k=this.getDialog(),l=k.getContentElement('info','cmbValue'),m=k.getContentElement('info','txtValue');m.setValue(l.getValue());}},{type:'button',id:'btnDelete',label:a.lang.select.btnDelete,title:a.lang.select.btnDelete,onClick:function(){var k=this.getDialog(),l=k.getContentElement('info','cmbName'),m=k.getContentElement('info','cmbValue'),n=k.getContentElement('info','txtOptName'),o=k.getContentElement('info','txtOptValue');c(l);c(m);n.setValue('');o.setValue('');}},{id:'chkMulti',type:'checkbox',label:a.lang.select.chkMulti,'default':'',accessKey:'M',value:'checked',setup:function(k,l){if(k=='select')this.setValue(l.getAttribute('multiple'));
-if(CKEDITOR.env.webkit)this.getElement().getParent().setStyle('vertical-align','middle');},commit:function(k){if(this.getValue())k.setAttribute('multiple',this.getValue());else k.removeAttribute('multiple');}}]}]}]};});
+ if ( combo && oOption && oOption.getName() == 'option' ) {
+ if ( CKEDITOR.env.ie ) {
+ if ( !isNaN( parseInt( index, 10 ) ) )
+ combo.$.options.add( oOption.$, index );
+ else
+ combo.$.options.add( oOption.$ );
+
+ oOption.$.innerHTML = optionText.length > 0 ? optionText : '';
+ oOption.$.value = optionValue;
+ } else {
+ if ( index !== null && index < combo.getChildCount() )
+ combo.getChild( index < 0 ? 0 : index ).insertBeforeMe( oOption );
+ else
+ combo.append( oOption );
+
+ oOption.setText( optionText.length > 0 ? optionText : '' );
+ oOption.setValue( optionValue );
+ }
+ } else
+ return false;
+
+ return oOption;
+ }
+ // Remove all selected options from a SELECT object.
+ function removeSelectedOptions( combo ) {
+ combo = getSelect( combo );
+
+ // Save the selected index
+ var iSelectedIndex = getSelectedIndex( combo );
+
+ // Remove all selected options.
+ for ( var i = combo.getChildren().count() - 1; i >= 0; i-- ) {
+ if ( combo.getChild( i ).$.selected )
+ combo.getChild( i ).remove();
+ }
+
+ // Reset the selection based on the original selected index.
+ setSelectedIndex( combo, iSelectedIndex );
+ }
+ //Modify option from a SELECT object.
+ function modifyOption( combo, index, title, value ) {
+ combo = getSelect( combo );
+ if ( index < 0 )
+ return false;
+ var child = combo.getChild( index );
+ child.setText( title );
+ child.setValue( value );
+ return child;
+ }
+
+ function removeAllOptions( combo ) {
+ combo = getSelect( combo );
+ while ( combo.getChild( 0 ) && combo.getChild( 0 ).remove() ) {
+ /*jsl:pass*/
+ }
+ }
+ // Moves the selected option by a number of steps (also negative).
+ function changeOptionPosition( combo, steps, documentObject ) {
+ combo = getSelect( combo );
+ var iActualIndex = getSelectedIndex( combo );
+ if ( iActualIndex < 0 )
+ return false;
+
+ var iFinalIndex = iActualIndex + steps;
+ iFinalIndex = ( iFinalIndex < 0 ) ? 0 : iFinalIndex;
+ iFinalIndex = ( iFinalIndex >= combo.getChildCount() ) ? combo.getChildCount() - 1 : iFinalIndex;
+
+ if ( iActualIndex == iFinalIndex )
+ return false;
+
+ var oOption = combo.getChild( iActualIndex ),
+ sText = oOption.getText(),
+ sValue = oOption.getValue();
+
+ oOption.remove();
+
+ oOption = addOption( combo, sText, sValue, ( !documentObject ) ? null : documentObject, iFinalIndex );
+ setSelectedIndex( combo, iFinalIndex );
+ return oOption;
+ }
+
+ function getSelectedIndex( combo ) {
+ combo = getSelect( combo );
+ return combo ? combo.$.selectedIndex : -1;
+ }
+
+ function setSelectedIndex( combo, index ) {
+ combo = getSelect( combo );
+ if ( index < 0 )
+ return null;
+ var count = combo.getChildren().count();
+ combo.$.selectedIndex = ( index >= count ) ? ( count - 1 ) : index;
+ return combo;
+ }
+
+ function getOptions( combo ) {
+ combo = getSelect( combo );
+ return combo ? combo.getChildren() : false;
+ }
+
+ function getSelect( obj ) {
+ if ( obj && obj.domId && obj.getInputElement().$ ) // Dialog element.
+ return obj.getInputElement();
+ else if ( obj && obj.$ )
+ return obj;
+ return false;
+ }
+
+ return {
+ title: editor.lang.forms.select.title,
+ minWidth: CKEDITOR.env.ie ? 460 : 395,
+ minHeight: CKEDITOR.env.ie ? 320 : 300,
+ onShow: function() {
+ delete this.selectBox;
+ this.setupContent( 'clear' );
+ var element = this.getParentEditor().getSelection().getSelectedElement();
+ if ( element && element.getName() == "select" ) {
+ this.selectBox = element;
+ this.setupContent( element.getName(), element );
+
+ // Load Options into dialog.
+ var objOptions = getOptions( element );
+ for ( var i = 0; i < objOptions.count(); i++ )
+ this.setupContent( 'option', objOptions.getItem( i ) );
+ }
+ },
+ onOk: function() {
+ var editor = this.getParentEditor(),
+ element = this.selectBox,
+ isInsertMode = !element;
+
+ if ( isInsertMode )
+ element = editor.document.createElement( 'select' );
+ this.commitContent( element );
+
+ if ( isInsertMode ) {
+ editor.insertElement( element );
+ if ( CKEDITOR.env.ie ) {
+ var sel = editor.getSelection(),
+ bms = sel.createBookmarks();
+ setTimeout( function() {
+ sel.selectBookmarks( bms );
+ }, 0 );
+ }
+ }
+ },
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.forms.select.selectInfo,
+ title: editor.lang.forms.select.selectInfo,
+ accessKey: '',
+ elements: [
+ {
+ id: 'txtName',
+ type: 'text',
+ widths: [ '25%', '75%' ],
+ labelLayout: 'horizontal',
+ label: editor.lang.common.name,
+ 'default': '',
+ accessKey: 'N',
+ style: 'width:350px',
+ setup: function( name, element ) {
+ if ( name == 'clear' )
+ this.setValue( this[ 'default' ] || '' );
+ else if ( name == 'select' ) {
+ this.setValue( element.data( 'cke-saved-name' ) || element.getAttribute( 'name' ) || '' );
+ }
+ },
+ commit: function( element ) {
+ if ( this.getValue() )
+ element.data( 'cke-saved-name', this.getValue() );
+ else {
+ element.data( 'cke-saved-name', false );
+ element.removeAttribute( 'name' );
+ }
+ }
+ },
+ {
+ id: 'txtValue',
+ type: 'text',
+ widths: [ '25%', '75%' ],
+ labelLayout: 'horizontal',
+ label: editor.lang.forms.select.value,
+ style: 'width:350px',
+ 'default': '',
+ className: 'cke_disabled',
+ onLoad: function() {
+ this.getInputElement().setAttribute( 'readOnly', true );
+ },
+ setup: function( name, element ) {
+ if ( name == 'clear' )
+ this.setValue( '' );
+ else if ( name == 'option' && element.getAttribute( 'selected' ) )
+ this.setValue( element.$.value );
+ }
+ },
+ {
+ type: 'hbox',
+ widths: [ '175px', '170px' ],
+ children: [
+ {
+ id: 'txtSize',
+ type: 'text',
+ labelLayout: 'horizontal',
+ label: editor.lang.forms.select.size,
+ 'default': '',
+ accessKey: 'S',
+ style: 'width:175px',
+ validate: function() {
+ var func = CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed );
+ return ( ( this.getValue() === '' ) || func.apply( this ) );
+ },
+ setup: function( name, element ) {
+ if ( name == 'select' )
+ this.setValue( element.getAttribute( 'size' ) || '' );
+ if ( CKEDITOR.env.webkit )
+ this.getInputElement().setStyle( 'width', '86px' );
+ },
+ commit: function( element ) {
+ if ( this.getValue() )
+ element.setAttribute( 'size', this.getValue() );
+ else
+ element.removeAttribute( 'size' );
+ }
+ },
+ {
+ type: 'html',
+ html: '<span>' + CKEDITOR.tools.htmlEncode( editor.lang.forms.select.lines ) + '</span>'
+ }
+ ]
+ },
+ {
+ type: 'html',
+ html: '<span>' + CKEDITOR.tools.htmlEncode( editor.lang.forms.select.opAvail ) + '</span>'
+ },
+ {
+ type: 'hbox',
+ widths: [ '115px', '115px', '100px' ],
+ children: [
+ {
+ type: 'vbox',
+ children: [
+ {
+ id: 'txtOptName',
+ type: 'text',
+ label: editor.lang.forms.select.opText,
+ style: 'width:115px',
+ setup: function( name, element ) {
+ if ( name == 'clear' )
+ this.setValue( "" );
+ }
+ },
+ {
+ type: 'select',
+ id: 'cmbName',
+ label: '',
+ title: '',
+ size: 5,
+ style: 'width:115px;height:75px',
+ items: [],
+ onChange: function() {
+ var dialog = this.getDialog(),
+ values = dialog.getContentElement( 'info', 'cmbValue' ),
+ optName = dialog.getContentElement( 'info', 'txtOptName' ),
+ optValue = dialog.getContentElement( 'info', 'txtOptValue' ),
+ iIndex = getSelectedIndex( this );
+
+ setSelectedIndex( values, iIndex );
+ optName.setValue( this.getValue() );
+ optValue.setValue( values.getValue() );
+ },
+ setup: function( name, element ) {
+ if ( name == 'clear' )
+ removeAllOptions( this );
+ else if ( name == 'option' )
+ addOption( this, element.getText(), element.getText(), this.getDialog().getParentEditor().document );
+ },
+ commit: function( element ) {
+ var dialog = this.getDialog(),
+ optionsNames = getOptions( this ),
+ optionsValues = getOptions( dialog.getContentElement( 'info', 'cmbValue' ) ),
+ selectValue = dialog.getContentElement( 'info', 'txtValue' ).getValue();
+
+ removeAllOptions( element );
+
+ for ( var i = 0; i < optionsNames.count(); i++ ) {
+ var oOption = addOption( element, optionsNames.getItem( i ).getValue(), optionsValues.getItem( i ).getValue(), dialog.getParentEditor().document );
+ if ( optionsValues.getItem( i ).getValue() == selectValue ) {
+ oOption.setAttribute( 'selected', 'selected' );
+ oOption.selected = true;
+ }
+ }
+ }
+ }
+ ]
+ },
+ {
+ type: 'vbox',
+ children: [
+ {
+ id: 'txtOptValue',
+ type: 'text',
+ label: editor.lang.forms.select.opValue,
+ style: 'width:115px',
+ setup: function( name, element ) {
+ if ( name == 'clear' )
+ this.setValue( "" );
+ }
+ },
+ {
+ type: 'select',
+ id: 'cmbValue',
+ label: '',
+ size: 5,
+ style: 'width:115px;height:75px',
+ items: [],
+ onChange: function() {
+ var dialog = this.getDialog(),
+ names = dialog.getContentElement( 'info', 'cmbName' ),
+ optName = dialog.getContentElement( 'info', 'txtOptName' ),
+ optValue = dialog.getContentElement( 'info', 'txtOptValue' ),
+ iIndex = getSelectedIndex( this );
+
+ setSelectedIndex( names, iIndex );
+ optName.setValue( names.getValue() );
+ optValue.setValue( this.getValue() );
+ },
+ setup: function( name, element ) {
+ if ( name == 'clear' )
+ removeAllOptions( this );
+ else if ( name == 'option' ) {
+ var oValue = element.getValue();
+ addOption( this, oValue, oValue, this.getDialog().getParentEditor().document );
+ if ( element.getAttribute( 'selected' ) == 'selected' )
+ this.getDialog().getContentElement( 'info', 'txtValue' ).setValue( oValue );
+ }
+ }
+ }
+ ]
+ },
+ {
+ type: 'vbox',
+ padding: 5,
+ children: [
+ {
+ type: 'button',
+ id: 'btnAdd',
+ style: '',
+ label: editor.lang.forms.select.btnAdd,
+ title: editor.lang.forms.select.btnAdd,
+ style: 'width:100%;',
+ onClick: function() {
+ //Add new option.
+ var dialog = this.getDialog(),
+ parentEditor = dialog.getParentEditor(),
+ optName = dialog.getContentElement( 'info', 'txtOptName' ),
+ optValue = dialog.getContentElement( 'info', 'txtOptValue' ),
+ names = dialog.getContentElement( 'info', 'cmbName' ),
+ values = dialog.getContentElement( 'info', 'cmbValue' );
+
+ addOption( names, optName.getValue(), optName.getValue(), dialog.getParentEditor().document );
+ addOption( values, optValue.getValue(), optValue.getValue(), dialog.getParentEditor().document );
+
+ optName.setValue( "" );
+ optValue.setValue( "" );
+ }
+ },
+ {
+ type: 'button',
+ id: 'btnModify',
+ label: editor.lang.forms.select.btnModify,
+ title: editor.lang.forms.select.btnModify,
+ style: 'width:100%;',
+ onClick: function() {
+ //Modify selected option.
+ var dialog = this.getDialog(),
+ optName = dialog.getContentElement( 'info', 'txtOptName' ),
+ optValue = dialog.getContentElement( 'info', 'txtOptValue' ),
+ names = dialog.getContentElement( 'info', 'cmbName' ),
+ values = dialog.getContentElement( 'info', 'cmbValue' ),
+ iIndex = getSelectedIndex( names );
+
+ if ( iIndex >= 0 ) {
+ modifyOption( names, iIndex, optName.getValue(), optName.getValue() );
+ modifyOption( values, iIndex, optValue.getValue(), optValue.getValue() );
+ }
+ }
+ },
+ {
+ type: 'button',
+ id: 'btnUp',
+ style: 'width:100%;',
+ label: editor.lang.forms.select.btnUp,
+ title: editor.lang.forms.select.btnUp,
+ onClick: function() {
+ //Move up.
+ var dialog = this.getDialog(),
+ names = dialog.getContentElement( 'info', 'cmbName' ),
+ values = dialog.getContentElement( 'info', 'cmbValue' );
+
+ changeOptionPosition( names, -1, dialog.getParentEditor().document );
+ changeOptionPosition( values, -1, dialog.getParentEditor().document );
+ }
+ },
+ {
+ type: 'button',
+ id: 'btnDown',
+ style: 'width:100%;',
+ label: editor.lang.forms.select.btnDown,
+ title: editor.lang.forms.select.btnDown,
+ onClick: function() {
+ //Move down.
+ var dialog = this.getDialog(),
+ names = dialog.getContentElement( 'info', 'cmbName' ),
+ values = dialog.getContentElement( 'info', 'cmbValue' );
+
+ changeOptionPosition( names, 1, dialog.getParentEditor().document );
+ changeOptionPosition( values, 1, dialog.getParentEditor().document );
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '40%', '20%', '40%' ],
+ children: [
+ {
+ type: 'button',
+ id: 'btnSetValue',
+ label: editor.lang.forms.select.btnSetValue,
+ title: editor.lang.forms.select.btnSetValue,
+ onClick: function() {
+ //Set as default value.
+ var dialog = this.getDialog(),
+ values = dialog.getContentElement( 'info', 'cmbValue' ),
+ txtValue = dialog.getContentElement( 'info', 'txtValue' );
+ txtValue.setValue( values.getValue() );
+ }
+ },
+ {
+ type: 'button',
+ id: 'btnDelete',
+ label: editor.lang.forms.select.btnDelete,
+ title: editor.lang.forms.select.btnDelete,
+ onClick: function() {
+ // Delete option.
+ var dialog = this.getDialog(),
+ names = dialog.getContentElement( 'info', 'cmbName' ),
+ values = dialog.getContentElement( 'info', 'cmbValue' ),
+ optName = dialog.getContentElement( 'info', 'txtOptName' ),
+ optValue = dialog.getContentElement( 'info', 'txtOptValue' );
+
+ removeSelectedOptions( names );
+ removeSelectedOptions( values );
+
+ optName.setValue( "" );
+ optValue.setValue( "" );
+ }
+ },
+ {
+ id: 'chkMulti',
+ type: 'checkbox',
+ label: editor.lang.forms.select.chkMulti,
+ 'default': '',
+ accessKey: 'M',
+ value: "checked",
+ setup: function( name, element ) {
+ if ( name == 'select' )
+ this.setValue( element.getAttribute( 'multiple' ) );
+ if ( CKEDITOR.env.webkit )
+ this.getElement().getParent().setStyle( 'vertical-align', 'middle' );
+ },
+ commit: function( element ) {
+ if ( this.getValue() )
+ element.setAttribute( 'multiple', this.getValue() );
+ else
+ element.removeAttribute( 'multiple' );
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ };
+});
diff --git a/plugins/forms/dialogs/textarea.js b/plugins/forms/dialogs/textarea.js
index 0ea4e72..87eb2f3 100644
--- a/plugins/forms/dialogs/textarea.js
+++ b/plugins/forms/dialogs/textarea.js
@@ -1,6 +1,118 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
+CKEDITOR.dialog.add( 'textarea', function( editor ) {
+ return {
+ title: editor.lang.forms.textarea.title,
+ minWidth: 350,
+ minHeight: 220,
+ onShow: function() {
+ delete this.textarea;
-CKEDITOR.dialog.add('textarea',function(a){return{title:a.lang.textarea.title,minWidth:350,minHeight:220,onShow:function(){var c=this;delete c.textarea;var b=c.getParentEditor().getSelection().getSelectedElement();if(b&&b.getName()=='textarea'){c.textarea=b;c.setupContent(b);}},onOk:function(){var b,c=this.textarea,d=!c;if(d){b=this.getParentEditor();c=b.document.createElement('textarea');}this.commitContent(c);if(d)b.insertElement(c);},contents:[{id:'info',label:a.lang.textarea.title,title:a.lang.textarea.title,elements:[{id:'_cke_saved_name',type:'text',label:a.lang.common.name,'default':'',accessKey:'N',setup:function(b){this.setValue(b.data('cke-saved-name')||b.getAttribute('name')||'');},commit:function(b){if(this.getValue())b.data('cke-saved-name',this.getValue());else{b.data('cke-saved-name',false);b.removeAttribute('name');}}},{type:'hbox',widths:['50%','50%'],children:[{id:'cols',type:'text',label:a.lang.textarea.cols,'default':'',accessKey:'C',style:'width:50px',validate:CKEDITOR.dialog.validate.integer(a.lang.common.validateNumberFailed),setup:function(b){var c=b.hasAttribute('cols')&&b.getAttribute('cols');this.setValue(c||'');},commit:function(b){if(this.getValue())b.setAttribute('cols',this.getValue());else b.removeAttribute('cols');}},{id:'rows',type:'text',label:a.lang.textarea.rows,'default':'',accessKey:'R',style:'width:50px',validate:CKEDITOR.dialog.validate.integer(a.lang.common.validateNumberFailed),setup:function(b){var c=b.hasAttribute('rows')&&b.getAttribute('rows');this.setValue(c||'');},commit:function(b){if(this.getValue())b.setAttribute('rows',this.getValue());else b.removeAttribute('rows');}}]},{id:'value',type:'textarea',label:a.lang.textfield.value,'default':'',setup:function(b){this.setValue(b.$.defaultValue);},commit:function(b){b.$.value=b.$.defaultValue=this.getValue();}}]}]};});
+ var element = this.getParentEditor().getSelection().getSelectedElement();
+ if ( element && element.getName() == "textarea" ) {
+ this.textarea = element;
+ this.setupContent( element );
+ }
+ },
+ onOk: function() {
+ var editor,
+ element = this.textarea,
+ isInsertMode = !element;
+
+ if ( isInsertMode ) {
+ editor = this.getParentEditor();
+ element = editor.document.createElement( 'textarea' );
+ }
+ this.commitContent( element );
+
+ if ( isInsertMode )
+ editor.insertElement( element );
+ },
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.forms.textarea.title,
+ title: editor.lang.forms.textarea.title,
+ elements: [
+ {
+ id: '_cke_saved_name',
+ type: 'text',
+ label: editor.lang.common.name,
+ 'default': '',
+ accessKey: 'N',
+ setup: function( element ) {
+ this.setValue( element.data( 'cke-saved-name' ) || element.getAttribute( 'name' ) || '' );
+ },
+ commit: function( element ) {
+ if ( this.getValue() )
+ element.data( 'cke-saved-name', this.getValue() );
+ else {
+ element.data( 'cke-saved-name', false );
+ element.removeAttribute( 'name' );
+ }
+ }
+ },
+ {
+ type: 'hbox',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ id: 'cols',
+ type: 'text',
+ label: editor.lang.forms.textarea.cols,
+ 'default': '',
+ accessKey: 'C',
+ style: 'width:50px',
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed ),
+ setup: function( element ) {
+ var value = element.hasAttribute( 'cols' ) && element.getAttribute( 'cols' );
+ this.setValue( value || '' );
+ },
+ commit: function( element ) {
+ if ( this.getValue() )
+ element.setAttribute( 'cols', this.getValue() );
+ else
+ element.removeAttribute( 'cols' );
+ }
+ },
+ {
+ id: 'rows',
+ type: 'text',
+ label: editor.lang.forms.textarea.rows,
+ 'default': '',
+ accessKey: 'R',
+ style: 'width:50px',
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed ),
+ setup: function( element ) {
+ var value = element.hasAttribute( 'rows' ) && element.getAttribute( 'rows' );
+ this.setValue( value || '' );
+ },
+ commit: function( element ) {
+ if ( this.getValue() )
+ element.setAttribute( 'rows', this.getValue() );
+ else
+ element.removeAttribute( 'rows' );
+ }
+ }
+ ]
+ },
+ {
+ id: 'value',
+ type: 'textarea',
+ label: editor.lang.forms.textfield.value,
+ 'default': '',
+ setup: function( element ) {
+ this.setValue( element.$.defaultValue );
+ },
+ commit: function( element ) {
+ element.$.value = element.$.defaultValue = this.getValue();
+ }
+ }
+
+ ]
+ }
+ ]
+ };
+});
diff --git a/plugins/forms/dialogs/textfield.js b/plugins/forms/dialogs/textfield.js
index 23ee866..e612f9f 100644
--- a/plugins/forms/dialogs/textfield.js
+++ b/plugins/forms/dialogs/textfield.js
@@ -1,6 +1,182 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
+CKEDITOR.dialog.add( 'textfield', function( editor ) {
+ var autoAttributes = { value:1,size:1,maxLength:1 };
-CKEDITOR.dialog.add('textfield',function(a){var b={value:1,size:1,maxLength:1},c={text:1,password:1};return{title:a.lang.textfield.title,minWidth:350,minHeight:150,onShow:function(){var e=this;delete e.textField;var d=e.getParentEditor().getSelection().getSelectedElement();if(d&&d.getName()=='input'&&(c[d.getAttribute('type')]||!d.getAttribute('type'))){e.textField=d;e.setupContent(d);}},onOk:function(){var d,e=this.textField,f=!e;if(f){d=this.getParentEditor();e=d.document.createElement('input');e.setAttribute('type','text');}if(f)d.insertElement(e);this.commitContent({element:e});},onLoad:function(){var d=function(f){var g=f.hasAttribute(this.id)&&f.getAttribute(this.id);this.setValue(g||'');},e=function(f){var g=f.element,h=this.getValue();if(h)g.setAttribute(this.id,h);else g.removeAttribute(this.id);};this.foreach(function(f){if(b[f.id]){f.setup=d;f.commit=e;}});},contents:[{id:'info',label:a.lang.textfield.title,title:a.lang.textfield.title,elements:[{type:'hbox',widths:['50%','50%'],children:[{id:'_cke_saved_name',type:'text',label:a.lang.textfield.name,'default':'',accessKey:'N',setup:function(d){this.setValue(d.data('cke-saved-name')||d.getAttribute('name')||'');},commit:function(d){var e=d.element;if(this.getValue())e.data('cke-saved-name',this.getValue());else{e.data('cke-saved-name',false);e.removeAttribute('name');}}},{id:'value',type:'text',label:a.lang.textfield.value,'default':'',accessKey:'V'}]},{type:'hbox',widths:['50%','50%'],children:[{id:'size',type:'text',label:a.lang.textfield.charWidth,'default':'',accessKey:'C',style:'width:50px',validate:CKEDITOR.dialog.validate.integer(a.lang.common.validateNumberFailed)},{id:'maxLength',type:'text',label:a.lang.textfield.maxChars,'default':'',accessKey:'M',style:'width:50px',validate:CKEDITOR.dialog.validate.integer(a.lang.common.validateNumberFailed)}],onLoad:function(){if(CKEDITOR.env.ie7Compat)this.getElement().setStyle('zoom','100%');}},{id:'type',type:'select',label:a.lang.textfield.type,'default':'text',accessKey:'M',items:[[a.lang.textfield.typeText,'text'],[a.lang.textfield.typePass,'password']],setup:function(d){this.setValue(d.getAttribute('type'));},commit:function(d){var e=d.element;if(CKEDITOR.env.ie){var f=e.getAttribute('type'),g=this.getValue();if(f!=g){var h=CKEDITOR.dom.element.createFromHtml('<input type="'+g+'"></input>',a.document);e.copyAttributes(h,{type:1});h.replace(e);a.getSelection().selectElement(h);d.element=h;}}else e.setAttribute('type',this.getValue());}}]}]};});
+ var acceptedTypes = { email:1,password:1,search:1,tel:1,text:1,url:1 };
+
+ function autoCommit( data ) {
+ var element = data.element;
+ var value = this.getValue();
+
+ value ? element.setAttribute( this.id, value ) : element.removeAttribute( this.id );
+ }
+
+ function autoSetup( element ) {
+ var value = element.hasAttribute( this.id ) && element.getAttribute( this.id );
+ this.setValue( value || '' );
+ }
+
+ return {
+ title: editor.lang.forms.textfield.title,
+ minWidth: 350,
+ minHeight: 150,
+ onShow: function() {
+ delete this.textField;
+
+ var element = this.getParentEditor().getSelection().getSelectedElement();
+ if ( element && element.getName() == "input" && ( acceptedTypes[ element.getAttribute( 'type' ) ] || !element.getAttribute( 'type' ) ) ) {
+ this.textField = element;
+ this.setupContent( element );
+ }
+ },
+ onOk: function() {
+ var editor = this.getParentEditor(),
+ element = this.textField,
+ isInsertMode = !element;
+
+ if ( isInsertMode ) {
+ element = editor.document.createElement( 'input' );
+ element.setAttribute( 'type', 'text' );
+ }
+
+ var data = { element: element };
+
+ if ( isInsertMode )
+ editor.insertElement( data.element );
+
+ this.commitContent( data );
+
+ // Element might be replaced by commitment.
+ if ( !isInsertMode )
+ editor.getSelection().selectElement( data.element );
+ },
+ onLoad: function() {
+ this.foreach( function( contentObj ) {
+ if ( contentObj.getValue ) {
+ if ( !contentObj.setup )
+ contentObj.setup = autoSetup;
+ if ( !contentObj.commit )
+ contentObj.commit = autoCommit;
+ }
+ });
+ },
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.forms.textfield.title,
+ title: editor.lang.forms.textfield.title,
+ elements: [
+ {
+ type: 'hbox',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ id: '_cke_saved_name',
+ type: 'text',
+ label: editor.lang.forms.textfield.name,
+ 'default': '',
+ accessKey: 'N',
+ setup: function( element ) {
+ this.setValue( element.data( 'cke-saved-name' ) || element.getAttribute( 'name' ) || '' );
+ },
+ commit: function( data ) {
+ var element = data.element;
+
+ if ( this.getValue() )
+ element.data( 'cke-saved-name', this.getValue() );
+ else {
+ element.data( 'cke-saved-name', false );
+ element.removeAttribute( 'name' );
+ }
+ }
+ },
+ {
+ id: 'value',
+ type: 'text',
+ label: editor.lang.forms.textfield.value,
+ 'default': '',
+ accessKey: 'V',
+ commit: function( data ) {
+ if ( CKEDITOR.env.ie && !this.getValue() ) {
+ var element = data.element,
+ fresh = new CKEDITOR.dom.element( 'input', editor.document );
+ element.copyAttributes( fresh, { value:1 } );
+ fresh.replace( element );
+ data.element = fresh;
+ } else
+ autoCommit.call( this, data );
+ }
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ id: 'size',
+ type: 'text',
+ label: editor.lang.forms.textfield.charWidth,
+ 'default': '',
+ accessKey: 'C',
+ style: 'width:50px',
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed )
+ },
+ {
+ id: 'maxLength',
+ type: 'text',
+ label: editor.lang.forms.textfield.maxChars,
+ 'default': '',
+ accessKey: 'M',
+ style: 'width:50px',
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed )
+ }
+ ],
+ onLoad: function() {
+ // Repaint the style for IE7 (#6068)
+ if ( CKEDITOR.env.ie7Compat )
+ this.getElement().setStyle( 'zoom', '100%' );
+ }
+ },
+ {
+ id: 'type',
+ type: 'select',
+ label: editor.lang.forms.textfield.type,
+ 'default': 'text',
+ accessKey: 'M',
+ items: [
+ [ editor.lang.forms.textfield.typeEmail, 'email' ],
+ [ editor.lang.forms.textfield.typePass, 'password' ],
+ [ editor.lang.forms.textfield.typeSearch, 'search' ],
+ [ editor.lang.forms.textfield.typeTel, 'tel' ],
+ [ editor.lang.forms.textfield.typeText, 'text' ],
+ [ editor.lang.forms.textfield.typeUrl, 'url' ]
+ ],
+ setup: function( element ) {
+ this.setValue( element.getAttribute( 'type' ) );
+ },
+ commit: function( data ) {
+ var element = data.element;
+
+ if ( CKEDITOR.env.ie ) {
+ var elementType = element.getAttribute( 'type' );
+ var myType = this.getValue();
+
+ if ( elementType != myType ) {
+ var replace = CKEDITOR.dom.element.createFromHtml( '<input type="' + myType + '"></input>', editor.document );
+ element.copyAttributes( replace, { type:1 } );
+ replace.replace( element );
+ data.element = replace;
+ }
+ } else
+ element.setAttribute( 'type', this.getValue() );
+ }
+ }
+ ]
+ }
+ ]
+ };
+});
diff --git a/plugins/iframe/dialogs/iframe.js b/plugins/iframe/dialogs/iframe.js
index 06ac17a..ea11339 100644
--- a/plugins/iframe/dialogs/iframe.js
+++ b/plugins/iframe/dialogs/iframe.js
@@ -1,7 +1,218 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-(function(){var a={scrolling:{'true':'yes','false':'no'},frameborder:{'true':'1','false':'0'}};function b(d){var g=this;var e=g instanceof CKEDITOR.ui.dialog.checkbox;if(d.hasAttribute(g.id)){var f=d.getAttribute(g.id);if(e)g.setValue(a[g.id]['true']==f.toLowerCase());else g.setValue(f);}};function c(d){var h=this;var e=h.getValue()==='',f=h instanceof CKEDITOR.ui.dialog.checkbox,g=h.getValue();if(e)d.removeAttribute(h.att||h.id);else if(f)d.setAttribute(h.id,a[h.id][g]);else d.setAttribute(h.att||h.id,g);};CKEDITOR.dialog.add('iframe',function(d){var e=d.lang.iframe,f=d.lang.common,g=d.plugins.dialogadvtab;return{title:e.title,minWidth:350,minHeight:260,onShow:function(){var j=this;j.fakeImage=j.iframeNode=null;var h=j.getSelectedElement();if(h&&h.data('cke-real-element-type')&&h.data('cke-real-element-type')=='iframe'){j.fakeImage=h;var i=d.restoreRealElement(h);j.iframeNode=i;j.setupContent(i);}},onOk:function(){var l=this;var h;if(!l.fakeImage)h=new CKEDITOR.dom.element('iframe');else h=l.iframeNode;var i={},j={};l.commitContent(h,i,j);var k=d.createFakeElement(h,'cke_iframe','iframe',true);k.setAttributes(j);k.setStyles(i);if(l.fakeImage){k.replace(l.fakeImage);d.getSelection().selectElement(k);}else d.insertElement(k);},contents:[{id:'info',label:f.generalTab,accessKey:'I',elements:[{type:'vbox',padding:0,children:[{id:'src',type:'text',label:f.url,required:true,validate:CKEDITOR.dialog.validate.notEmpty(e.noUrl),setup:b,commit:c}]},{type:'hbox',children:[{id:'width',type:'text',style:'width:100%',labelLayout:'vertical',label:f.width,validate:CKEDITOR.dialog.validate.htmlLength(f.invalidHtmlLength.replace('%1',f.width)),setup:b,commit:c},{id:'height',type:'text',style:'width:100%',labelLayout:'vertical',label:f.height,validate:CKEDITOR.dialog.validate.htmlLength(f.invalidHtmlLength.replace('%1',f.height)),setup:b,commit:c},{id:'align',type:'select','default':'',items:[[f.notSet,''],[f.alignLeft,'left'],[f.alignRight,'right'],[f.alignTop,'top'],[f.alignMiddle,'middle'],[f.alignBottom,'bottom']],style:'width:100%',labelLayout:'vertical',label:f.align,setup:function(h,i){b.apply(this,arguments);if(i){var j=i.getAttribute('align');this.setValue(j&&j.toLowerCase()||'');}},commit:function(h,i,j){c.apply(this,arguments);if(this.getValue())j.align=this.getValue();}}]},{type:'hbox',widths:['50%','50%'],children:[{id:'scrolling',type:'checkbox',label:e.scrolling,setup:b,commit:c},{id:'frameborder',type:'checkbox',label:e.border,setup:b,commit:c}]},{type:'hbox',widths:['50%','50%'],children:[{id:'name',type:'text',label:f.name,setup:b,commit:c},{id:'title',type:'text',label:f.advisoryTitle,setup:b,commit:c}]},{id:'longdesc',type:'text',label:f.longDescr,setup:b,commit:c}]},g&&g.createAdvancedTab(d,{id:1,classes:1,styles:1})]};
-});})();
+(function() {
+ // Map 'true' and 'false' values to match W3C's specifications
+ // http://www.w3.org/TR/REC-html40/present/frames.html#h-16.5
+ var checkboxValues = {
+ scrolling: { 'true': 'yes', 'false': 'no' },
+ frameborder: { 'true': '1', 'false': '0' }
+ };
+
+ function loadValue( iframeNode ) {
+ var isCheckbox = this instanceof CKEDITOR.ui.dialog.checkbox;
+ if ( iframeNode.hasAttribute( this.id ) ) {
+ var value = iframeNode.getAttribute( this.id );
+ if ( isCheckbox )
+ this.setValue( checkboxValues[ this.id ][ 'true' ] == value.toLowerCase() );
+ else
+ this.setValue( value );
+ }
+ }
+
+ function commitValue( iframeNode ) {
+ var isRemove = this.getValue() === '',
+ isCheckbox = this instanceof CKEDITOR.ui.dialog.checkbox,
+ value = this.getValue();
+ if ( isRemove )
+ iframeNode.removeAttribute( this.att || this.id );
+ else if ( isCheckbox )
+ iframeNode.setAttribute( this.id, checkboxValues[ this.id ][ value ] );
+ else
+ iframeNode.setAttribute( this.att || this.id, value );
+ }
+
+ CKEDITOR.dialog.add( 'iframe', function( editor ) {
+ var iframeLang = editor.lang.iframe,
+ commonLang = editor.lang.common,
+ dialogadvtab = editor.plugins.dialogadvtab;
+ return {
+ title: iframeLang.title,
+ minWidth: 350,
+ minHeight: 260,
+ onShow: function() {
+ // Clear previously saved elements.
+ this.fakeImage = this.iframeNode = null;
+
+ var fakeImage = this.getSelectedElement();
+ if ( fakeImage && fakeImage.data( 'cke-real-element-type' ) && fakeImage.data( 'cke-real-element-type' ) == 'iframe' ) {
+ this.fakeImage = fakeImage;
+
+ var iframeNode = editor.restoreRealElement( fakeImage );
+ this.iframeNode = iframeNode;
+
+ this.setupContent( iframeNode );
+ }
+ },
+ onOk: function() {
+ var iframeNode;
+ if ( !this.fakeImage )
+ iframeNode = new CKEDITOR.dom.element( 'iframe' );
+ else
+ iframeNode = this.iframeNode;
+
+ // A subset of the specified attributes/styles
+ // should also be applied on the fake element to
+ // have better visual effect. (#5240)
+ var extraStyles = {},
+ extraAttributes = {};
+ this.commitContent( iframeNode, extraStyles, extraAttributes );
+
+ // Refresh the fake image.
+ var newFakeImage = editor.createFakeElement( iframeNode, 'cke_iframe', 'iframe', true );
+ newFakeImage.setAttributes( extraAttributes );
+ newFakeImage.setStyles( extraStyles );
+ if ( this.fakeImage ) {
+ newFakeImage.replace( this.fakeImage );
+ editor.getSelection().selectElement( newFakeImage );
+ } else
+ editor.insertElement( newFakeImage );
+ },
+ contents: [
+ {
+ id: 'info',
+ label: commonLang.generalTab,
+ accessKey: 'I',
+ elements: [
+ {
+ type: 'vbox',
+ padding: 0,
+ children: [
+ {
+ id: 'src',
+ type: 'text',
+ label: commonLang.url,
+ required: true,
+ validate: CKEDITOR.dialog.validate.notEmpty( iframeLang.noUrl ),
+ setup: loadValue,
+ commit: commitValue
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ children: [
+ {
+ id: 'width',
+ type: 'text',
+ requiredContent: 'iframe[width]',
+ style: 'width:100%',
+ labelLayout: 'vertical',
+ label: commonLang.width,
+ validate: CKEDITOR.dialog.validate.htmlLength( commonLang.invalidHtmlLength.replace( '%1', commonLang.width ) ),
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ id: 'height',
+ type: 'text',
+ requiredContent: 'iframe[height]',
+ style: 'width:100%',
+ labelLayout: 'vertical',
+ label: commonLang.height,
+ validate: CKEDITOR.dialog.validate.htmlLength( commonLang.invalidHtmlLength.replace( '%1', commonLang.height ) ),
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ id: 'align',
+ type: 'select',
+ requiredContent: 'iframe[align]',
+ 'default': '',
+ items: [
+ [ commonLang.notSet, '' ],
+ [ commonLang.alignLeft, 'left' ],
+ [ commonLang.alignRight, 'right' ],
+ [ commonLang.alignTop, 'top' ],
+ [ commonLang.alignMiddle, 'middle' ],
+ [ commonLang.alignBottom, 'bottom' ]
+ ],
+ style: 'width:100%',
+ labelLayout: 'vertical',
+ label: commonLang.align,
+ setup: function( iframeNode, fakeImage ) {
+ loadValue.apply( this, arguments );
+ if ( fakeImage ) {
+ var fakeImageAlign = fakeImage.getAttribute( 'align' );
+ this.setValue( fakeImageAlign && fakeImageAlign.toLowerCase() || '' );
+ }
+ },
+ commit: function( iframeNode, extraStyles, extraAttributes ) {
+ commitValue.apply( this, arguments );
+ if ( this.getValue() )
+ extraAttributes.align = this.getValue();
+ }
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ id: 'scrolling',
+ type: 'checkbox',
+ requiredContent: 'iframe[scrolling]',
+ label: iframeLang.scrolling,
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ id: 'frameborder',
+ type: 'checkbox',
+ requiredContent: 'iframe[frameborder]',
+ label: iframeLang.border,
+ setup: loadValue,
+ commit: commitValue
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ id: 'name',
+ type: 'text',
+ requiredContent: 'iframe[name]',
+ label: commonLang.name,
+ setup: loadValue,
+ commit: commitValue
+ },
+ {
+ id: 'title',
+ type: 'text',
+ requiredContent: 'iframe[title]',
+ label: commonLang.advisoryTitle,
+ setup: loadValue,
+ commit: commitValue
+ }
+ ]
+ },
+ {
+ id: 'longdesc',
+ type: 'text',
+ requiredContent: 'iframe[longdesc]',
+ label: commonLang.longDescr,
+ setup: loadValue,
+ commit: commitValue
+ }
+ ]
+ },
+ dialogadvtab && dialogadvtab.createAdvancedTab( editor, { id:1,classes:1,styles:1 }, 'iframe' )
+ ]
+ };
+ });
+})();
diff --git a/plugins/image/dialogs/image.js b/plugins/image/dialogs/image.js
index 0410b95..7c92eea 100644
--- a/plugins/image/dialogs/image.js
+++ b/plugins/image/dialogs/image.js
@@ -1,13 +1,1209 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-(function(){var a=function(b,c){var d=1,e=2,f=4,g=8,h=/^\s*(\d+)((px)|\%)?\s*$/i,i=/(^\s*(\d+)((px)|\%)?\s*$)|^$/i,j=/^\d+px$/,k=function(){var B=this.getValue(),C=this.getDialog(),D=B.match(h);if(D){if(D[2]=='%')p(C,false);B=D[1];}if(C.lockRatio){var E=C.originalElement;if(E.getCustomData('isReady')=='true')if(this.id=='txtHeight'){if(B&&B!='0')B=Math.round(E.$.width*(B/E.$.height));if(!isNaN(B))C.setValueOf('info','txtWidth',B);}else{if(B&&B!='0')B=Math.round(E.$.height*(B/E.$.width));if(!isNaN(B))C.setValueOf('info','txtHeight',B);}}l(C);},l=function(B){if(!B.originalElement||!B.preview)return 1;B.commitContent(f,B.preview);return 0;};function m(){var B=arguments,C=this.getContentElement('advanced','txtdlgGenStyle');C&&C.commit.apply(C,B);this.foreach(function(D){if(D.commit&&D.id!='txtdlgGenStyle')D.commit.apply(D,B);});};var n;function o(B){if(n)return;n=1;var C=this.getDialog(),D=C.imageElement;if(D){this.commit(d,D);B=[].concat(B);var E=B.length,F;for(var G=0;G<E;G++){F=C.getContentElement.apply(C,B[G].split(':'));F&&F.setup(d,D);}}n=0;};var p=function(B,C){if(!B.getContentElement('info','ratioLock'))return null;var D=B.originalElement;if(!D)return null;if(C=='check'){if(!B.userlockRatio&&D.getCustomData('isReady')=='true'){var E=B.getValueOf('info','txtWidth'),F=B.getValueOf('info','txtHeight'),G=D.$.width*1000/D.$.height,H=E*1000/F;B.lockRatio=false;if(!E&&!F)B.lockRatio=true;else if(!isNaN(G)&&!isNaN(H))if(Math.round(G)==Math.round(H))B.lockRatio=true;}}else if(C!=undefined)B.lockRatio=C;else{B.userlockRatio=1;B.lockRatio=!B.lockRatio;}var I=CKEDITOR.document.getById(w);if(B.lockRatio)I.removeClass('cke_btn_unlocked');else I.addClass('cke_btn_unlocked');I.setAttribute('aria-checked',B.lockRatio);if(CKEDITOR.env.hc){var J=I.getChild(0);J.setHtml(B.lockRatio?CKEDITOR.env.ie?'■':'▣':CKEDITOR.env.ie?'□':'▢');}return B.lockRatio;},q=function(B){var C=B.originalElement;if(C.getCustomData('isReady')=='true'){var D=B.getContentElement('info','txtWidth'),E=B.getContentElement('info','txtHeight');D&&D.setValue(C.$.width);E&&E.setValue(C.$.height);}l(B);},r=function(B,C){if(B!=d)return;function D(I,J){var K=I.match(h);if(K){if(K[2]=='%'){K[1]+='%';p(E,false);}return K[1];}return J;};var E=this.getDialog(),F='',G=this.id=='txtWidth'?'width':'height',H=C.getAttribute(G);if(H)F=D(H,F);F=D(C.getStyle(G),F);this.setValue(F);},s,t=function(){var B=this.originalElement;B.setCustomData('isReady','true');B.removeListener('load',t);B.removeListener('error',u);B.removeListener('abort',u);
-CKEDITOR.document.getById(y).setStyle('display','none');if(!this.dontResetSize)q(this);if(this.firstLoad)CKEDITOR.tools.setTimeout(function(){p(this,'check');},0,this);this.firstLoad=false;this.dontResetSize=false;},u=function(){var D=this;var B=D.originalElement;B.removeListener('load',t);B.removeListener('error',u);B.removeListener('abort',u);var C=CKEDITOR.getUrl(b.skinPath+'images/noimage.png');if(D.preview)D.preview.setAttribute('src',C);CKEDITOR.document.getById(y).setStyle('display','none');p(D,false);},v=function(B){return CKEDITOR.tools.getNextId()+'_'+B;},w=v('btnLockSizes'),x=v('btnResetSize'),y=v('ImagePreviewLoader'),z=v('previewLink'),A=v('previewImage');return{title:b.lang.image[c=='image'?'title':'titleButton'],minWidth:420,minHeight:360,onShow:function(){var H=this;H.imageElement=false;H.linkElement=false;H.imageEditMode=false;H.linkEditMode=false;H.lockRatio=true;H.userlockRatio=0;H.dontResetSize=false;H.firstLoad=true;H.addLink=false;var B=H.getParentEditor(),C=B.getSelection(),D=C&&C.getSelectedElement(),E=D&&D.getAscendant('a');CKEDITOR.document.getById(y).setStyle('display','none');s=new CKEDITOR.dom.element('img',B.document);H.preview=CKEDITOR.document.getById(A);H.originalElement=B.document.createElement('img');H.originalElement.setAttribute('alt','');H.originalElement.setCustomData('isReady','false');if(E){H.linkElement=E;H.linkEditMode=true;var F=E.getChildren();if(F.count()==1){var G=F.getItem(0).getName();if(G=='img'||G=='input'){H.imageElement=F.getItem(0);if(H.imageElement.getName()=='img')H.imageEditMode='img';else if(H.imageElement.getName()=='input')H.imageEditMode='input';}}if(c=='image')H.setupContent(e,E);}if(D&&D.getName()=='img'&&!D.data('cke-realelement')||D&&D.getName()=='input'&&D.getAttribute('type')=='image'){H.imageEditMode=D.getName();H.imageElement=D;}if(H.imageEditMode){H.cleanImageElement=H.imageElement;H.imageElement=H.cleanImageElement.clone(true,true);H.setupContent(d,H.imageElement);}else H.imageElement=B.document.createElement('img');p(H,true);if(!CKEDITOR.tools.trim(H.getValueOf('info','txtUrl'))){H.preview.removeAttribute('src');H.preview.setStyle('display','none');}},onOk:function(){var C=this;if(C.imageEditMode){var B=C.imageEditMode;if(c=='image'&&B=='input'&&confirm(b.lang.image.button2Img)){B='img';C.imageElement=b.document.createElement('img');C.imageElement.setAttribute('alt','');b.insertElement(C.imageElement);}else if(c!='image'&&B=='img'&&confirm(b.lang.image.img2Button)){B='input';C.imageElement=b.document.createElement('input');
-C.imageElement.setAttributes({type:'image',alt:''});b.insertElement(C.imageElement);}else{C.imageElement=C.cleanImageElement;delete C.cleanImageElement;}}else{if(c=='image')C.imageElement=b.document.createElement('img');else{C.imageElement=b.document.createElement('input');C.imageElement.setAttribute('type','image');}C.imageElement.setAttribute('alt','');}if(!C.linkEditMode)C.linkElement=b.document.createElement('a');C.commitContent(d,C.imageElement);C.commitContent(e,C.linkElement);if(!C.imageElement.getAttribute('style'))C.imageElement.removeAttribute('style');if(!C.imageEditMode){if(C.addLink){if(!C.linkEditMode){b.insertElement(C.linkElement);C.linkElement.append(C.imageElement,false);}else b.insertElement(C.imageElement);}else b.insertElement(C.imageElement);}else if(!C.linkEditMode&&C.addLink){b.insertElement(C.linkElement);C.imageElement.appendTo(C.linkElement);}else if(C.linkEditMode&&!C.addLink){b.getSelection().selectElement(C.linkElement);b.insertElement(C.imageElement);}},onLoad:function(){var C=this;if(c!='image')C.hidePage('Link');var B=C._.element.getDocument();if(C.getContentElement('info','ratioLock')){C.addFocusable(B.getById(x),5);C.addFocusable(B.getById(w),5);}C.commitContent=m;},onHide:function(){var B=this;if(B.preview)B.commitContent(g,B.preview);if(B.originalElement){B.originalElement.removeListener('load',t);B.originalElement.removeListener('error',u);B.originalElement.removeListener('abort',u);B.originalElement.remove();B.originalElement=false;}delete B.imageElement;},contents:[{id:'info',label:b.lang.image.infoTab,accessKey:'I',elements:[{type:'vbox',padding:0,children:[{type:'hbox',widths:['280px','110px'],align:'right',children:[{id:'txtUrl',type:'text',label:b.lang.common.url,required:true,onChange:function(){var B=this.getDialog(),C=this.getValue();if(C.length>0){B=this.getDialog();var D=B.originalElement;B.preview.removeStyle('display');D.setCustomData('isReady','false');var E=CKEDITOR.document.getById(y);if(E)E.setStyle('display','');D.on('load',t,B);D.on('error',u,B);D.on('abort',u,B);D.setAttribute('src',C);s.setAttribute('src',C);B.preview.setAttribute('src',s.$.src);l(B);}else if(B.preview){B.preview.removeAttribute('src');B.preview.setStyle('display','none');}},setup:function(B,C){if(B==d){var D=C.data('cke-saved-src')||C.getAttribute('src'),E=this;this.getDialog().dontResetSize=true;E.setValue(D);E.setInitValue();}},commit:function(B,C){var D=this;if(B==d&&(D.getValue()||D.isChanged())){C.data('cke-saved-src',D.getValue());
-C.setAttribute('src',D.getValue());}else if(B==g){C.setAttribute('src','');C.removeAttribute('src');}},validate:CKEDITOR.dialog.validate.notEmpty(b.lang.image.urlMissing)},{type:'button',id:'browse',style:'display:inline-block;margin-top:10px;',align:'center',label:b.lang.common.browseServer,hidden:true,filebrowser:'info:txtUrl'}]}]},{id:'txtAlt',type:'text',label:b.lang.image.alt,accessKey:'T','default':'',onChange:function(){l(this.getDialog());},setup:function(B,C){if(B==d)this.setValue(C.getAttribute('alt'));},commit:function(B,C){var D=this;if(B==d){if(D.getValue()||D.isChanged())C.setAttribute('alt',D.getValue());}else if(B==f)C.setAttribute('alt',D.getValue());else if(B==g)C.removeAttribute('alt');}},{type:'hbox',children:[{id:'basic',type:'vbox',children:[{type:'hbox',widths:['50%','50%'],children:[{type:'vbox',padding:1,children:[{type:'text',width:'40px',id:'txtWidth',label:b.lang.common.width,onKeyUp:k,onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:function(){var B=this.getValue().match(i),C=!!(B&&parseInt(B[1],10)!==0);if(!C)alert(b.lang.common.invalidWidth);return C;},setup:r,commit:function(B,C,D){var E=this.getValue();if(B==d){if(E)C.setStyle('width',CKEDITOR.tools.cssLength(E));else C.removeStyle('width');!D&&C.removeAttribute('width');}else if(B==f){var F=E.match(h);if(!F){var G=this.getDialog().originalElement;if(G.getCustomData('isReady')=='true')C.setStyle('width',G.$.width+'px');}else C.setStyle('width',CKEDITOR.tools.cssLength(E));}else if(B==g){C.removeAttribute('width');C.removeStyle('width');}}},{type:'text',id:'txtHeight',width:'40px',label:b.lang.common.height,onKeyUp:k,onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:function(){var B=this.getValue().match(i),C=!!(B&&parseInt(B[1],10)!==0);if(!C)alert(b.lang.common.invalidHeight);return C;},setup:r,commit:function(B,C,D){var E=this.getValue();if(B==d){if(E)C.setStyle('height',CKEDITOR.tools.cssLength(E));else C.removeStyle('height');!D&&C.removeAttribute('height');}else if(B==f){var F=E.match(h);if(!F){var G=this.getDialog().originalElement;if(G.getCustomData('isReady')=='true')C.setStyle('height',G.$.height+'px');}else C.setStyle('height',CKEDITOR.tools.cssLength(E));}else if(B==g){C.removeAttribute('height');C.removeStyle('height');}}}]},{id:'ratioLock',type:'html',style:'margin-top:30px;width:40px;height:40px;',onLoad:function(){var B=CKEDITOR.document.getById(x),C=CKEDITOR.document.getById(w);if(B){B.on('click',function(D){q(this);D.data&&D.data.preventDefault();
-},this.getDialog());B.on('mouseover',function(){this.addClass('cke_btn_over');},B);B.on('mouseout',function(){this.removeClass('cke_btn_over');},B);}if(C){C.on('click',function(D){var I=this;var E=p(I),F=I.originalElement,G=I.getValueOf('info','txtWidth');if(F.getCustomData('isReady')=='true'&&G){var H=F.$.height/F.$.width*G;if(!isNaN(H)){I.setValueOf('info','txtHeight',Math.round(H));l(I);}}D.data&&D.data.preventDefault();},this.getDialog());C.on('mouseover',function(){this.addClass('cke_btn_over');},C);C.on('mouseout',function(){this.removeClass('cke_btn_over');},C);}},html:'<div><a href="javascript:void(0)" tabindex="-1" title="'+b.lang.image.lockRatio+'" class="cke_btn_locked" id="'+w+'" role="checkbox"><span class="cke_icon"></span><span class="cke_label">'+b.lang.image.lockRatio+'</span></a>'+'<a href="javascript:void(0)" tabindex="-1" title="'+b.lang.image.resetSize+'" class="cke_btn_reset" id="'+x+'" role="button"><span class="cke_label">'+b.lang.image.resetSize+'</span></a>'+'</div>'}]},{type:'vbox',padding:1,children:[{type:'text',id:'txtBorder',width:'60px',label:b.lang.image.border,'default':'',onKeyUp:function(){l(this.getDialog());},onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:CKEDITOR.dialog.validate.integer(b.lang.image.validateBorder),setup:function(B,C){if(B==d){var D,E=C.getStyle('border-width');E=E&&E.match(/^(\d+px)(?: \1 \1 \1)?$/);D=E&&parseInt(E[1],10);isNaN(parseInt(D,10))&&(D=C.getAttribute('border'));this.setValue(D);}},commit:function(B,C,D){var E=parseInt(this.getValue(),10);if(B==d||B==f){if(!isNaN(E)){C.setStyle('border-width',CKEDITOR.tools.cssLength(E));C.setStyle('border-style','solid');}else if(!E&&this.isChanged()){C.removeStyle('border-width');C.removeStyle('border-style');C.removeStyle('border-color');}if(!D&&B==d)C.removeAttribute('border');}else if(B==g){C.removeAttribute('border');C.removeStyle('border-width');C.removeStyle('border-style');C.removeStyle('border-color');}}},{type:'text',id:'txtHSpace',width:'60px',label:b.lang.image.hSpace,'default':'',onKeyUp:function(){l(this.getDialog());},onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:CKEDITOR.dialog.validate.integer(b.lang.image.validateHSpace),setup:function(B,C){if(B==d){var D,E,F,G=C.getStyle('margin-left'),H=C.getStyle('margin-right');G=G&&G.match(j);H=H&&H.match(j);E=parseInt(G,10);F=parseInt(H,10);D=E==F&&E;isNaN(parseInt(D,10))&&(D=C.getAttribute('hspace'));this.setValue(D);}},commit:function(B,C,D){var E=parseInt(this.getValue(),10);
-if(B==d||B==f){if(!isNaN(E)){C.setStyle('margin-left',CKEDITOR.tools.cssLength(E));C.setStyle('margin-right',CKEDITOR.tools.cssLength(E));}else if(!E&&this.isChanged()){C.removeStyle('margin-left');C.removeStyle('margin-right');}if(!D&&B==d)C.removeAttribute('hspace');}else if(B==g){C.removeAttribute('hspace');C.removeStyle('margin-left');C.removeStyle('margin-right');}}},{type:'text',id:'txtVSpace',width:'60px',label:b.lang.image.vSpace,'default':'',onKeyUp:function(){l(this.getDialog());},onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:CKEDITOR.dialog.validate.integer(b.lang.image.validateVSpace),setup:function(B,C){if(B==d){var D,E,F,G=C.getStyle('margin-top'),H=C.getStyle('margin-bottom');G=G&&G.match(j);H=H&&H.match(j);E=parseInt(G,10);F=parseInt(H,10);D=E==F&&E;isNaN(parseInt(D,10))&&(D=C.getAttribute('vspace'));this.setValue(D);}},commit:function(B,C,D){var E=parseInt(this.getValue(),10);if(B==d||B==f){if(!isNaN(E)){C.setStyle('margin-top',CKEDITOR.tools.cssLength(E));C.setStyle('margin-bottom',CKEDITOR.tools.cssLength(E));}else if(!E&&this.isChanged()){C.removeStyle('margin-top');C.removeStyle('margin-bottom');}if(!D&&B==d)C.removeAttribute('vspace');}else if(B==g){C.removeAttribute('vspace');C.removeStyle('margin-top');C.removeStyle('margin-bottom');}}},{id:'cmbAlign',type:'select',widths:['35%','65%'],style:'width:90px',label:b.lang.common.align,'default':'',items:[[b.lang.common.notSet,''],[b.lang.common.alignLeft,'left'],[b.lang.common.alignRight,'right']],onChange:function(){l(this.getDialog());o.call(this,'advanced:txtdlgGenStyle');},setup:function(B,C){if(B==d){var D=C.getStyle('float');switch(D){case 'inherit':case 'none':D='';}!D&&(D=(C.getAttribute('align')||'').toLowerCase());this.setValue(D);}},commit:function(B,C,D){var E=this.getValue();if(B==d||B==f){if(E)C.setStyle('float',E);else C.removeStyle('float');if(!D&&B==d){E=(C.getAttribute('align')||'').toLowerCase();switch(E){case 'left':case 'right':C.removeAttribute('align');}}}else if(B==g)C.removeStyle('float');}}]}]},{type:'vbox',height:'250px',children:[{type:'html',id:'htmlPreview',style:'width:95%;',html:'<div>'+CKEDITOR.tools.htmlEncode(b.lang.common.preview)+'<br>'+'<div id="'+y+'" class="ImagePreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>'+'<div class="ImagePreviewBox"><table><tr><td>'+'<a href="javascript:void(0)" target="_blank" onclick="return false;" id="'+z+'">'+'<img id="'+A+'" alt="" /></a>'+(b.config.image_previewText||'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.')+'</td></tr></table></div></div>'}]}]}]},{id:'Link',label:b.lang.link.title,padding:0,elements:[{id:'txtUrl',type:'text',label:b.lang.common.url,style:'width: 100%','default':'',setup:function(B,C){if(B==e){var D=C.data('cke-saved-href');
-if(!D)D=C.getAttribute('href');this.setValue(D);}},commit:function(B,C){var E=this;if(B==e)if(E.getValue()||E.isChanged()){var D=decodeURI(E.getValue());C.data('cke-saved-href',D);C.setAttribute('href',D);if(E.getValue()||!b.config.image_removeLinkByEmptyURL)E.getDialog().addLink=true;}}},{type:'button',id:'browse',filebrowser:{action:'Browse',target:'Link:txtUrl',url:b.config.filebrowserImageBrowseLinkUrl},style:'float:right',hidden:true,label:b.lang.common.browseServer},{id:'cmbTarget',type:'select',label:b.lang.common.target,'default':'',items:[[b.lang.common.notSet,''],[b.lang.common.targetNew,'_blank'],[b.lang.common.targetTop,'_top'],[b.lang.common.targetSelf,'_self'],[b.lang.common.targetParent,'_parent']],setup:function(B,C){if(B==e)this.setValue(C.getAttribute('target')||'');},commit:function(B,C){if(B==e)if(this.getValue()||this.isChanged())C.setAttribute('target',this.getValue());}}]},{id:'Upload',hidden:true,filebrowser:'uploadButton',label:b.lang.image.upload,elements:[{type:'file',id:'upload',label:b.lang.image.btnUpload,style:'height:40px',size:38},{type:'fileButton',id:'uploadButton',filebrowser:'info:txtUrl',label:b.lang.image.btnUpload,'for':['Upload','upload']}]},{id:'advanced',label:b.lang.common.advancedTab,elements:[{type:'hbox',widths:['50%','25%','25%'],children:[{type:'text',id:'linkId',label:b.lang.common.id,setup:function(B,C){if(B==d)this.setValue(C.getAttribute('id'));},commit:function(B,C){if(B==d)if(this.getValue()||this.isChanged())C.setAttribute('id',this.getValue());}},{id:'cmbLangDir',type:'select',style:'width : 100px;',label:b.lang.common.langDir,'default':'',items:[[b.lang.common.notSet,''],[b.lang.common.langDirLtr,'ltr'],[b.lang.common.langDirRtl,'rtl']],setup:function(B,C){if(B==d)this.setValue(C.getAttribute('dir'));},commit:function(B,C){if(B==d)if(this.getValue()||this.isChanged())C.setAttribute('dir',this.getValue());}},{type:'text',id:'txtLangCode',label:b.lang.common.langCode,'default':'',setup:function(B,C){if(B==d)this.setValue(C.getAttribute('lang'));},commit:function(B,C){if(B==d)if(this.getValue()||this.isChanged())C.setAttribute('lang',this.getValue());}}]},{type:'text',id:'txtGenLongDescr',label:b.lang.common.longDescr,setup:function(B,C){if(B==d)this.setValue(C.getAttribute('longDesc'));},commit:function(B,C){if(B==d)if(this.getValue()||this.isChanged())C.setAttribute('longDesc',this.getValue());}},{type:'hbox',widths:['50%','50%'],children:[{type:'text',id:'txtGenClass',label:b.lang.common.cssClass,'default':'',setup:function(B,C){if(B==d)this.setValue(C.getAttribute('class'));
-},commit:function(B,C){if(B==d)if(this.getValue()||this.isChanged())C.setAttribute('class',this.getValue());}},{type:'text',id:'txtGenTitle',label:b.lang.common.advisoryTitle,'default':'',onChange:function(){l(this.getDialog());},setup:function(B,C){if(B==d)this.setValue(C.getAttribute('title'));},commit:function(B,C){var D=this;if(B==d){if(D.getValue()||D.isChanged())C.setAttribute('title',D.getValue());}else if(B==f)C.setAttribute('title',D.getValue());else if(B==g)C.removeAttribute('title');}}]},{type:'text',id:'txtdlgGenStyle',label:b.lang.common.cssStyle,validate:CKEDITOR.dialog.validate.inlineStyle(b.lang.common.invalidInlineStyle),'default':'',setup:function(B,C){if(B==d){var D=C.getAttribute('style');if(!D&&C.$.style.cssText)D=C.$.style.cssText;this.setValue(D);var E=C.$.style.height,F=C.$.style.width,G=(E?E:'').match(h),H=(F?F:'').match(h);this.attributesInStyle={height:!!G,width:!!H};}},onChange:function(){o.call(this,['info:cmbFloat','info:cmbAlign','info:txtVSpace','info:txtHSpace','info:txtBorder','info:txtWidth','info:txtHeight']);l(this);},commit:function(B,C){if(B==d&&(this.getValue()||this.isChanged()))C.setAttribute('style',this.getValue());}}]}]};};CKEDITOR.dialog.add('image',function(b){return a(b,'image');});CKEDITOR.dialog.add('imagebutton',function(b){return a(b,'imagebutton');});})();
+(function() {
+ var imageDialog = function( editor, dialogType ) {
+ // Load image preview.
+ var IMAGE = 1,
+ LINK = 2,
+ PREVIEW = 4,
+ CLEANUP = 8,
+ regexGetSize = /^\s*(\d+)((px)|\%)?\s*$/i,
+ regexGetSizeOrEmpty = /(^\s*(\d+)((px)|\%)?\s*$)|^$/i,
+ pxLengthRegex = /^\d+px$/;
+
+ var onSizeChange = function() {
+ var value = this.getValue(),
+ // This = input element.
+ dialog = this.getDialog(),
+ aMatch = value.match( regexGetSize ); // Check value
+ if ( aMatch ) {
+ if ( aMatch[ 2 ] == '%' ) // % is allowed - > unlock ratio.
+ switchLockRatio( dialog, false ); // Unlock.
+ value = aMatch[ 1 ];
+ }
+
+ // Only if ratio is locked
+ if ( dialog.lockRatio ) {
+ var oImageOriginal = dialog.originalElement;
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) {
+ if ( this.id == 'txtHeight' ) {
+ if ( value && value != '0' )
+ value = Math.round( oImageOriginal.$.width * ( value / oImageOriginal.$.height ) );
+ if ( !isNaN( value ) )
+ dialog.setValueOf( 'info', 'txtWidth', value );
+ } else //this.id = txtWidth.
+ {
+ if ( value && value != '0' )
+ value = Math.round( oImageOriginal.$.height * ( value / oImageOriginal.$.width ) );
+ if ( !isNaN( value ) )
+ dialog.setValueOf( 'info', 'txtHeight', value );
+ }
+ }
+ }
+ updatePreview( dialog );
+ };
+
+ var updatePreview = function( dialog ) {
+ //Don't load before onShow.
+ if ( !dialog.originalElement || !dialog.preview )
+ return 1;
+
+ // Read attributes and update imagePreview;
+ dialog.commitContent( PREVIEW, dialog.preview );
+ return 0;
+ };
+
+ // Custom commit dialog logic, where we're intended to give inline style
+ // field (txtdlgGenStyle) higher priority to avoid overwriting styles contribute
+ // by other fields.
+ function commitContent() {
+ var args = arguments;
+ var inlineStyleField = this.getContentElement( 'advanced', 'txtdlgGenStyle' );
+ inlineStyleField && inlineStyleField.commit.apply( inlineStyleField, args );
+
+ this.foreach( function( widget ) {
+ if ( widget.commit && widget.id != 'txtdlgGenStyle' )
+ widget.commit.apply( widget, args );
+ });
+ }
+
+ // Avoid recursions.
+ var incommit;
+
+ // Synchronous field values to other impacted fields is required, e.g. border
+ // size change should alter inline-style text as well.
+ function commitInternally( targetFields ) {
+ if ( incommit )
+ return;
+
+ incommit = 1;
+
+ var dialog = this.getDialog(),
+ element = dialog.imageElement;
+ if ( element ) {
+ // Commit this field and broadcast to target fields.
+ this.commit( IMAGE, element );
+
+ targetFields = [].concat( targetFields );
+ var length = targetFields.length,
+ field;
+ for ( var i = 0; i < length; i++ ) {
+ field = dialog.getContentElement.apply( dialog, targetFields[ i ].split( ':' ) );
+ // May cause recursion.
+ field && field.setup( IMAGE, element );
+ }
+ }
+
+ incommit = 0;
+ }
+
+ var switchLockRatio = function( dialog, value ) {
+ if ( !dialog.getContentElement( 'info', 'ratioLock' ) )
+ return null;
+
+ var oImageOriginal = dialog.originalElement;
+
+ // Dialog may already closed. (#5505)
+ if ( !oImageOriginal )
+ return null;
+
+ // Check image ratio and original image ratio, but respecting user's preference.
+ if ( value == 'check' ) {
+ if ( !dialog.userlockRatio && oImageOriginal.getCustomData( 'isReady' ) == 'true' ) {
+ var width = dialog.getValueOf( 'info', 'txtWidth' ),
+ height = dialog.getValueOf( 'info', 'txtHeight' ),
+ originalRatio = oImageOriginal.$.width * 1000 / oImageOriginal.$.height,
+ thisRatio = width * 1000 / height;
+ dialog.lockRatio = false; // Default: unlock ratio
+
+ if ( !width && !height )
+ dialog.lockRatio = true;
+ else if ( !isNaN( originalRatio ) && !isNaN( thisRatio ) ) {
+ if ( Math.round( originalRatio ) == Math.round( thisRatio ) )
+ dialog.lockRatio = true;
+ }
+ }
+ } else if ( value != undefined )
+ dialog.lockRatio = value;
+ else {
+ dialog.userlockRatio = 1;
+ dialog.lockRatio = !dialog.lockRatio;
+ }
+
+ var ratioButton = CKEDITOR.document.getById( btnLockSizesId );
+ if ( dialog.lockRatio )
+ ratioButton.removeClass( 'cke_btn_unlocked' );
+ else
+ ratioButton.addClass( 'cke_btn_unlocked' );
+
+ ratioButton.setAttribute( 'aria-checked', dialog.lockRatio );
+
+ // Ratio button hc presentation - WHITE SQUARE / BLACK SQUARE
+ if ( CKEDITOR.env.hc ) {
+ var icon = ratioButton.getChild( 0 );
+ icon.setHtml( dialog.lockRatio ? CKEDITOR.env.ie ? '\u25A0' : '\u25A3' : CKEDITOR.env.ie ? '\u25A1' : '\u25A2' );
+ }
+
+ return dialog.lockRatio;
+ };
+
+ var resetSize = function( dialog ) {
+ var oImageOriginal = dialog.originalElement;
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) {
+ var widthField = dialog.getContentElement( 'info', 'txtWidth' ),
+ heightField = dialog.getContentElement( 'info', 'txtHeight' );
+ widthField && widthField.setValue( oImageOriginal.$.width );
+ heightField && heightField.setValue( oImageOriginal.$.height );
+ }
+ updatePreview( dialog );
+ };
+
+ var setupDimension = function( type, element ) {
+ if ( type != IMAGE )
+ return;
+
+ function checkDimension( size, defaultValue ) {
+ var aMatch = size.match( regexGetSize );
+ if ( aMatch ) {
+ if ( aMatch[ 2 ] == '%' ) // % is allowed.
+ {
+ aMatch[ 1 ] += '%';
+ switchLockRatio( dialog, false ); // Unlock ratio
+ }
+ return aMatch[ 1 ];
+ }
+ return defaultValue;
+ }
+
+ var dialog = this.getDialog(),
+ value = '',
+ dimension = this.id == 'txtWidth' ? 'width' : 'height',
+ size = element.getAttribute( dimension );
+
+ if ( size )
+ value = checkDimension( size, value );
+ value = checkDimension( element.getStyle( dimension ), value );
+
+ this.setValue( value );
+ };
+
+ var previewPreloader;
+
+ var onImgLoadEvent = function() {
+ // Image is ready.
+ var original = this.originalElement;
+ original.setCustomData( 'isReady', 'true' );
+ original.removeListener( 'load', onImgLoadEvent );
+ original.removeListener( 'error', onImgLoadErrorEvent );
+ original.removeListener( 'abort', onImgLoadErrorEvent );
+
+ // Hide loader
+ CKEDITOR.document.getById( imagePreviewLoaderId ).setStyle( 'display', 'none' );
+
+ // New image -> new domensions
+ if ( !this.dontResetSize )
+ resetSize( this );
+
+ if ( this.firstLoad )
+ CKEDITOR.tools.setTimeout( function() {
+ switchLockRatio( this, 'check' );
+ }, 0, this );
+
+ this.firstLoad = false;
+ this.dontResetSize = false;
+ };
+
+ var onImgLoadErrorEvent = function() {
+ // Error. Image is not loaded.
+ var original = this.originalElement;
+ original.removeListener( 'load', onImgLoadEvent );
+ original.removeListener( 'error', onImgLoadErrorEvent );
+ original.removeListener( 'abort', onImgLoadErrorEvent );
+
+ // Set Error image.
+ var noimage = CKEDITOR.getUrl( CKEDITOR.plugins.get( 'image' ).path + 'images/noimage.png' );
+
+ if ( this.preview )
+ this.preview.setAttribute( 'src', noimage );
+
+ // Hide loader
+ CKEDITOR.document.getById( imagePreviewLoaderId ).setStyle( 'display', 'none' );
+ switchLockRatio( this, false ); // Unlock.
+ };
+
+ var numbering = function( id ) {
+ return CKEDITOR.tools.getNextId() + '_' + id;
+ },
+ btnLockSizesId = numbering( 'btnLockSizes' ),
+ btnResetSizeId = numbering( 'btnResetSize' ),
+ imagePreviewLoaderId = numbering( 'ImagePreviewLoader' ),
+ previewLinkId = numbering( 'previewLink' ),
+ previewImageId = numbering( 'previewImage' );
+
+ return {
+ title: editor.lang.image[ dialogType == 'image' ? 'title' : 'titleButton' ],
+ minWidth: 420,
+ minHeight: 360,
+ onShow: function() {
+ this.imageElement = false;
+ this.linkElement = false;
+
+ // Default: create a new element.
+ this.imageEditMode = false;
+ this.linkEditMode = false;
+
+ this.lockRatio = true;
+ this.userlockRatio = 0;
+ this.dontResetSize = false;
+ this.firstLoad = true;
+ this.addLink = false;
+
+ var editor = this.getParentEditor(),
+ sel = editor.getSelection(),
+ element = sel && sel.getSelectedElement(),
+ link = element && editor.elementPath( element ).contains( 'a', 1 );
+
+ //Hide loader.
+ CKEDITOR.document.getById( imagePreviewLoaderId ).setStyle( 'display', 'none' );
+ // Create the preview before setup the dialog contents.
+ previewPreloader = new CKEDITOR.dom.element( 'img', editor.document );
+ this.preview = CKEDITOR.document.getById( previewImageId );
+
+ // Copy of the image
+ this.originalElement = editor.document.createElement( 'img' );
+ this.originalElement.setAttribute( 'alt', '' );
+ this.originalElement.setCustomData( 'isReady', 'false' );
+
+ if ( link ) {
+ this.linkElement = link;
+ this.linkEditMode = true;
+
+ // Look for Image element.
+ var linkChildren = link.getChildren();
+ if ( linkChildren.count() == 1 ) // 1 child.
+ {
+ var childTagName = linkChildren.getItem( 0 ).getName();
+ if ( childTagName == 'img' || childTagName == 'input' ) {
+ this.imageElement = linkChildren.getItem( 0 );
+ if ( this.imageElement.getName() == 'img' )
+ this.imageEditMode = 'img';
+ else if ( this.imageElement.getName() == 'input' )
+ this.imageEditMode = 'input';
+ }
+ }
+ // Fill out all fields.
+ if ( dialogType == 'image' )
+ this.setupContent( LINK, link );
+ }
+
+ if ( element && element.getName() == 'img' && !element.data( 'cke-realelement' ) || element && element.getName() == 'input' && element.getAttribute( 'type' ) == 'image' ) {
+ this.imageEditMode = element.getName();
+ this.imageElement = element;
+ }
+
+ if ( this.imageEditMode ) {
+ // Use the original element as a buffer from since we don't want
+ // temporary changes to be committed, e.g. if the dialog is canceled.
+ this.cleanImageElement = this.imageElement;
+ this.imageElement = this.cleanImageElement.clone( true, true );
+
+ // Fill out all fields.
+ this.setupContent( IMAGE, this.imageElement );
+ } else
+ this.imageElement = editor.document.createElement( 'img' );
+
+ // Refresh LockRatio button
+ switchLockRatio( this, true );
+
+ // Dont show preview if no URL given.
+ if ( !CKEDITOR.tools.trim( this.getValueOf( 'info', 'txtUrl' ) ) ) {
+ this.preview.removeAttribute( 'src' );
+ this.preview.setStyle( 'display', 'none' );
+ }
+ },
+ onOk: function() {
+ // Edit existing Image.
+ if ( this.imageEditMode ) {
+ var imgTagName = this.imageEditMode;
+
+ // Image dialog and Input element.
+ if ( dialogType == 'image' && imgTagName == 'input' && confirm( editor.lang.image.button2Img ) ) {
+ // Replace INPUT-> IMG
+ imgTagName = 'img';
+ this.imageElement = editor.document.createElement( 'img' );
+ this.imageElement.setAttribute( 'alt', '' );
+ editor.insertElement( this.imageElement );
+ }
+ // ImageButton dialog and Image element.
+ else if ( dialogType != 'image' && imgTagName == 'img' && confirm( editor.lang.image.img2Button ) ) {
+ // Replace IMG -> INPUT
+ imgTagName = 'input';
+ this.imageElement = editor.document.createElement( 'input' );
+ this.imageElement.setAttributes({
+ type: 'image',
+ alt: ''
+ });
+ editor.insertElement( this.imageElement );
+ } else {
+ // Restore the original element before all commits.
+ this.imageElement = this.cleanImageElement;
+ delete this.cleanImageElement;
+ }
+ } else // Create a new image.
+ {
+ // Image dialog -> create IMG element.
+ if ( dialogType == 'image' )
+ this.imageElement = editor.document.createElement( 'img' );
+ else {
+ this.imageElement = editor.document.createElement( 'input' );
+ this.imageElement.setAttribute( 'type', 'image' );
+ }
+ this.imageElement.setAttribute( 'alt', '' );
+ }
+
+ // Create a new link.
+ if ( !this.linkEditMode )
+ this.linkElement = editor.document.createElement( 'a' );
+
+ // Set attributes.
+ this.commitContent( IMAGE, this.imageElement );
+ this.commitContent( LINK, this.linkElement );
+
+ // Remove empty style attribute.
+ if ( !this.imageElement.getAttribute( 'style' ) )
+ this.imageElement.removeAttribute( 'style' );
+
+ // Insert a new Image.
+ if ( !this.imageEditMode ) {
+ if ( this.addLink ) {
+ //Insert a new Link.
+ if ( !this.linkEditMode ) {
+ editor.insertElement( this.linkElement );
+ this.linkElement.append( this.imageElement, false );
+ } else //Link already exists, image not.
+ editor.insertElement( this.imageElement );
+ } else
+ editor.insertElement( this.imageElement );
+ } else // Image already exists.
+ {
+ //Add a new link element.
+ if ( !this.linkEditMode && this.addLink ) {
+ editor.insertElement( this.linkElement );
+ this.imageElement.appendTo( this.linkElement );
+ }
+ //Remove Link, Image exists.
+ else if ( this.linkEditMode && !this.addLink ) {
+ editor.getSelection().selectElement( this.linkElement );
+ editor.insertElement( this.imageElement );
+ }
+ }
+ },
+ onLoad: function() {
+ if ( dialogType != 'image' )
+ this.hidePage( 'Link' ); //Hide Link tab.
+ var doc = this._.element.getDocument();
+
+ if ( this.getContentElement( 'info', 'ratioLock' ) ) {
+ this.addFocusable( doc.getById( btnResetSizeId ), 5 );
+ this.addFocusable( doc.getById( btnLockSizesId ), 5 );
+ }
+
+ this.commitContent = commitContent;
+ },
+ onHide: function() {
+ if ( this.preview )
+ this.commitContent( CLEANUP, this.preview );
+
+ if ( this.originalElement ) {
+ this.originalElement.removeListener( 'load', onImgLoadEvent );
+ this.originalElement.removeListener( 'error', onImgLoadErrorEvent );
+ this.originalElement.removeListener( 'abort', onImgLoadErrorEvent );
+ this.originalElement.remove();
+ this.originalElement = false; // Dialog is closed.
+ }
+
+ delete this.imageElement;
+ },
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.image.infoTab,
+ accessKey: 'I',
+ elements: [
+ {
+ type: 'vbox',
+ padding: 0,
+ children: [
+ {
+ type: 'hbox',
+ widths: [ '280px', '110px' ],
+ align: 'right',
+ children: [
+ {
+ id: 'txtUrl',
+ type: 'text',
+ label: editor.lang.common.url,
+ required: true,
+ onChange: function() {
+ var dialog = this.getDialog(),
+ newUrl = this.getValue();
+
+ //Update original image
+ if ( newUrl.length > 0 ) //Prevent from load before onShow
+ {
+ dialog = this.getDialog();
+ var original = dialog.originalElement;
+
+ dialog.preview.removeStyle( 'display' );
+
+ original.setCustomData( 'isReady', 'false' );
+ // Show loader
+ var loader = CKEDITOR.document.getById( imagePreviewLoaderId );
+ if ( loader )
+ loader.setStyle( 'display', '' );
+
+ original.on( 'load', onImgLoadEvent, dialog );
+ original.on( 'error', onImgLoadErrorEvent, dialog );
+ original.on( 'abort', onImgLoadErrorEvent, dialog );
+ original.setAttribute( 'src', newUrl );
+
+ // Query the preloader to figure out the url impacted by based href.
+ previewPreloader.setAttribute( 'src', newUrl );
+ dialog.preview.setAttribute( 'src', previewPreloader.$.src );
+ updatePreview( dialog );
+ }
+ // Dont show preview if no URL given.
+ else if ( dialog.preview ) {
+ dialog.preview.removeAttribute( 'src' );
+ dialog.preview.setStyle( 'display', 'none' );
+ }
+ },
+ setup: function( type, element ) {
+ if ( type == IMAGE ) {
+ var url = element.data( 'cke-saved-src' ) || element.getAttribute( 'src' );
+ var field = this;
+
+ this.getDialog().dontResetSize = true;
+
+ field.setValue( url ); // And call this.onChange()
+ // Manually set the initial value.(#4191)
+ field.setInitValue();
+ }
+ },
+ commit: function( type, element ) {
+ if ( type == IMAGE && ( this.getValue() || this.isChanged() ) ) {
+ element.data( 'cke-saved-src', this.getValue() );
+ element.setAttribute( 'src', this.getValue() );
+ } else if ( type == CLEANUP ) {
+ element.setAttribute( 'src', '' ); // If removeAttribute doesn't work.
+ element.removeAttribute( 'src' );
+ }
+ },
+ validate: CKEDITOR.dialog.validate.notEmpty( editor.lang.image.urlMissing )
+ },
+ {
+ type: 'button',
+ id: 'browse',
+ // v-align with the 'txtUrl' field.
+ // TODO: We need something better than a fixed size here.
+ style: 'display:inline-block;margin-top:10px;',
+ align: 'center',
+ label: editor.lang.common.browseServer,
+ hidden: true,
+ filebrowser: 'info:txtUrl'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ id: 'txtAlt',
+ type: 'text',
+ label: editor.lang.image.alt,
+ accessKey: 'T',
+ 'default': '',
+ onChange: function() {
+ updatePreview( this.getDialog() );
+ },
+ setup: function( type, element ) {
+ if ( type == IMAGE )
+ this.setValue( element.getAttribute( 'alt' ) );
+ },
+ commit: function( type, element ) {
+ if ( type == IMAGE ) {
+ if ( this.getValue() || this.isChanged() )
+ element.setAttribute( 'alt', this.getValue() );
+ } else if ( type == PREVIEW ) {
+ element.setAttribute( 'alt', this.getValue() );
+ } else if ( type == CLEANUP ) {
+ element.removeAttribute( 'alt' );
+ }
+ }
+ },
+ {
+ type: 'hbox',
+ children: [
+ {
+ id: 'basic',
+ type: 'vbox',
+ children: [
+ {
+ type: 'hbox',
+ requiredContent: 'img{width,height}',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ type: 'vbox',
+ padding: 1,
+ children: [
+ {
+ type: 'text',
+ width: '45px',
+ id: 'txtWidth',
+ label: editor.lang.common.width,
+ onKeyUp: onSizeChange,
+ onChange: function() {
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
+ },
+ validate: function() {
+ var aMatch = this.getValue().match( regexGetSizeOrEmpty ),
+ isValid = !!( aMatch && parseInt( aMatch[ 1 ], 10 ) !== 0 );
+ if ( !isValid )
+ alert( editor.lang.common.invalidWidth );
+ return isValid;
+ },
+ setup: setupDimension,
+ commit: function( type, element, internalCommit ) {
+ var value = this.getValue();
+ if ( type == IMAGE ) {
+ if ( value )
+ element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) );
+ else
+ element.removeStyle( 'width' );
+
+ !internalCommit && element.removeAttribute( 'width' );
+ } else if ( type == PREVIEW ) {
+ var aMatch = value.match( regexGetSize );
+ if ( !aMatch ) {
+ var oImageOriginal = this.getDialog().originalElement;
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
+ element.setStyle( 'width', oImageOriginal.$.width + 'px' );
+ } else
+ element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) );
+ } else if ( type == CLEANUP ) {
+ element.removeAttribute( 'width' );
+ element.removeStyle( 'width' );
+ }
+ }
+ },
+ {
+ type: 'text',
+ id: 'txtHeight',
+ width: '45px',
+ label: editor.lang.common.height,
+ onKeyUp: onSizeChange,
+ onChange: function() {
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
+ },
+ validate: function() {
+ var aMatch = this.getValue().match( regexGetSizeOrEmpty ),
+ isValid = !!( aMatch && parseInt( aMatch[ 1 ], 10 ) !== 0 );
+ if ( !isValid )
+ alert( editor.lang.common.invalidHeight );
+ return isValid;
+ },
+ setup: setupDimension,
+ commit: function( type, element, internalCommit ) {
+ var value = this.getValue();
+ if ( type == IMAGE ) {
+ if ( value )
+ element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) );
+ else
+ element.removeStyle( 'height' );
+
+ !internalCommit && element.removeAttribute( 'height' );
+ } else if ( type == PREVIEW ) {
+ var aMatch = value.match( regexGetSize );
+ if ( !aMatch ) {
+ var oImageOriginal = this.getDialog().originalElement;
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
+ element.setStyle( 'height', oImageOriginal.$.height + 'px' );
+ } else
+ element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) );
+ } else if ( type == CLEANUP ) {
+ element.removeAttribute( 'height' );
+ element.removeStyle( 'height' );
+ }
+ }
+ }
+ ]
+ },
+ {
+ id: 'ratioLock',
+ type: 'html',
+ style: 'margin-top:30px;width:40px;height:40px;',
+ onLoad: function() {
+ // Activate Reset button
+ var resetButton = CKEDITOR.document.getById( btnResetSizeId ),
+ ratioButton = CKEDITOR.document.getById( btnLockSizesId );
+ if ( resetButton ) {
+ resetButton.on( 'click', function( evt ) {
+ resetSize( this );
+ evt.data && evt.data.preventDefault();
+ }, this.getDialog() );
+ resetButton.on( 'mouseover', function() {
+ this.addClass( 'cke_btn_over' );
+ }, resetButton );
+ resetButton.on( 'mouseout', function() {
+ this.removeClass( 'cke_btn_over' );
+ }, resetButton );
+ }
+ // Activate (Un)LockRatio button
+ if ( ratioButton ) {
+ ratioButton.on( 'click', function( evt ) {
+ var locked = switchLockRatio( this ),
+ oImageOriginal = this.originalElement,
+ width = this.getValueOf( 'info', 'txtWidth' );
+
+ if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' && width ) {
+ var height = oImageOriginal.$.height / oImageOriginal.$.width * width;
+ if ( !isNaN( height ) ) {
+ this.setValueOf( 'info', 'txtHeight', Math.round( height ) );
+ updatePreview( this );
+ }
+ }
+ evt.data && evt.data.preventDefault();
+ }, this.getDialog() );
+ ratioButton.on( 'mouseover', function() {
+ this.addClass( 'cke_btn_over' );
+ }, ratioButton );
+ ratioButton.on( 'mouseout', function() {
+ this.removeClass( 'cke_btn_over' );
+ }, ratioButton );
+ }
+ },
+ html: '<div>' +
+ '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.lockRatio +
+ '" class="cke_btn_locked" id="' + btnLockSizesId + '" role="checkbox"><span class="cke_icon"></span><span class="cke_label">' + editor.lang.image.lockRatio + '</span></a>' +
+ '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.resetSize +
+ '" class="cke_btn_reset" id="' + btnResetSizeId + '" role="button"><span class="cke_label">' + editor.lang.image.resetSize + '</span></a>' +
+ '</div>'
+ }
+ ]
+ },
+ {
+ type: 'vbox',
+ padding: 1,
+ children: [
+ {
+ type: 'text',
+ id: 'txtBorder',
+ requiredContent: 'img{border-width}',
+ width: '60px',
+ label: editor.lang.image.border,
+ 'default': '',
+ onKeyUp: function() {
+ updatePreview( this.getDialog() );
+ },
+ onChange: function() {
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
+ },
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.image.validateBorder ),
+ setup: function( type, element ) {
+ if ( type == IMAGE ) {
+ var value,
+ borderStyle = element.getStyle( 'border-width' );
+ borderStyle = borderStyle && borderStyle.match( /^(\d+px)(?: \1 \1 \1)?$/ );
+ value = borderStyle && parseInt( borderStyle[ 1 ], 10 );
+ isNaN( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'border' ) );
+ this.setValue( value );
+ }
+ },
+ commit: function( type, element, internalCommit ) {
+ var value = parseInt( this.getValue(), 10 );
+ if ( type == IMAGE || type == PREVIEW ) {
+ if ( !isNaN( value ) ) {
+ element.setStyle( 'border-width', CKEDITOR.tools.cssLength( value ) );
+ element.setStyle( 'border-style', 'solid' );
+ } else if ( !value && this.isChanged() )
+ element.removeStyle( 'border' );
+
+ if ( !internalCommit && type == IMAGE )
+ element.removeAttribute( 'border' );
+ } else if ( type == CLEANUP ) {
+ element.removeAttribute( 'border' );
+ element.removeStyle( 'border-width' );
+ element.removeStyle( 'border-style' );
+ element.removeStyle( 'border-color' );
+ }
+ }
+ },
+ {
+ type: 'text',
+ id: 'txtHSpace',
+ requiredContent: 'img{margin-left,margin-right}',
+ width: '60px',
+ label: editor.lang.image.hSpace,
+ 'default': '',
+ onKeyUp: function() {
+ updatePreview( this.getDialog() );
+ },
+ onChange: function() {
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
+ },
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.image.validateHSpace ),
+ setup: function( type, element ) {
+ if ( type == IMAGE ) {
+ var value, marginLeftPx, marginRightPx,
+ marginLeftStyle = element.getStyle( 'margin-left' ),
+ marginRightStyle = element.getStyle( 'margin-right' );
+
+ marginLeftStyle = marginLeftStyle && marginLeftStyle.match( pxLengthRegex );
+ marginRightStyle = marginRightStyle && marginRightStyle.match( pxLengthRegex );
+ marginLeftPx = parseInt( marginLeftStyle, 10 );
+ marginRightPx = parseInt( marginRightStyle, 10 );
+
+ value = ( marginLeftPx == marginRightPx ) && marginLeftPx;
+ isNaN( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'hspace' ) );
+
+ this.setValue( value );
+ }
+ },
+ commit: function( type, element, internalCommit ) {
+ var value = parseInt( this.getValue(), 10 );
+ if ( type == IMAGE || type == PREVIEW ) {
+ if ( !isNaN( value ) ) {
+ element.setStyle( 'margin-left', CKEDITOR.tools.cssLength( value ) );
+ element.setStyle( 'margin-right', CKEDITOR.tools.cssLength( value ) );
+ } else if ( !value && this.isChanged() ) {
+ element.removeStyle( 'margin-left' );
+ element.removeStyle( 'margin-right' );
+ }
+
+ if ( !internalCommit && type == IMAGE )
+ element.removeAttribute( 'hspace' );
+ } else if ( type == CLEANUP ) {
+ element.removeAttribute( 'hspace' );
+ element.removeStyle( 'margin-left' );
+ element.removeStyle( 'margin-right' );
+ }
+ }
+ },
+ {
+ type: 'text',
+ id: 'txtVSpace',
+ requiredContent: 'img{margin-top,margin-bottom}',
+ width: '60px',
+ label: editor.lang.image.vSpace,
+ 'default': '',
+ onKeyUp: function() {
+ updatePreview( this.getDialog() );
+ },
+ onChange: function() {
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
+ },
+ validate: CKEDITOR.dialog.validate.integer( editor.lang.image.validateVSpace ),
+ setup: function( type, element ) {
+ if ( type == IMAGE ) {
+ var value, marginTopPx, marginBottomPx,
+ marginTopStyle = element.getStyle( 'margin-top' ),
+ marginBottomStyle = element.getStyle( 'margin-bottom' );
+
+ marginTopStyle = marginTopStyle && marginTopStyle.match( pxLengthRegex );
+ marginBottomStyle = marginBottomStyle && marginBottomStyle.match( pxLengthRegex );
+ marginTopPx = parseInt( marginTopStyle, 10 );
+ marginBottomPx = parseInt( marginBottomStyle, 10 );
+
+ value = ( marginTopPx == marginBottomPx ) && marginTopPx;
+ isNaN( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'vspace' ) );
+ this.setValue( value );
+ }
+ },
+ commit: function( type, element, internalCommit ) {
+ var value = parseInt( this.getValue(), 10 );
+ if ( type == IMAGE || type == PREVIEW ) {
+ if ( !isNaN( value ) ) {
+ element.setStyle( 'margin-top', CKEDITOR.tools.cssLength( value ) );
+ element.setStyle( 'margin-bottom', CKEDITOR.tools.cssLength( value ) );
+ } else if ( !value && this.isChanged() ) {
+ element.removeStyle( 'margin-top' );
+ element.removeStyle( 'margin-bottom' );
+ }
+
+ if ( !internalCommit && type == IMAGE )
+ element.removeAttribute( 'vspace' );
+ } else if ( type == CLEANUP ) {
+ element.removeAttribute( 'vspace' );
+ element.removeStyle( 'margin-top' );
+ element.removeStyle( 'margin-bottom' );
+ }
+ }
+ },
+ {
+ id: 'cmbAlign',
+ requiredContent: 'img{float}',
+ type: 'select',
+ widths: [ '35%', '65%' ],
+ style: 'width:90px',
+ label: editor.lang.common.align,
+ 'default': '',
+ items: [
+ [ editor.lang.common.notSet, '' ],
+ [ editor.lang.common.alignLeft, 'left' ],
+ [ editor.lang.common.alignRight, 'right' ]
+ // Backward compatible with v2 on setup when specified as attribute value,
+ // while these values are no more available as select options.
+ // [ editor.lang.image.alignAbsBottom , 'absBottom'],
+ // [ editor.lang.image.alignAbsMiddle , 'absMiddle'],
+ // [ editor.lang.image.alignBaseline , 'baseline'],
+ // [ editor.lang.image.alignTextTop , 'text-top'],
+ // [ editor.lang.image.alignBottom , 'bottom'],
+ // [ editor.lang.image.alignMiddle , 'middle'],
+ // [ editor.lang.image.alignTop , 'top']
+ ],
+ onChange: function() {
+ updatePreview( this.getDialog() );
+ commitInternally.call( this, 'advanced:txtdlgGenStyle' );
+ },
+ setup: function( type, element ) {
+ if ( type == IMAGE ) {
+ var value = element.getStyle( 'float' );
+ switch ( value ) {
+ // Ignore those unrelated values.
+ case 'inherit':
+ case 'none':
+ value = '';
+ }
+
+ !value && ( value = ( element.getAttribute( 'align' ) || '' ).toLowerCase() );
+ this.setValue( value );
+ }
+ },
+ commit: function( type, element, internalCommit ) {
+ var value = this.getValue();
+ if ( type == IMAGE || type == PREVIEW ) {
+ if ( value )
+ element.setStyle( 'float', value );
+ else
+ element.removeStyle( 'float' );
+
+ if ( !internalCommit && type == IMAGE ) {
+ value = ( element.getAttribute( 'align' ) || '' ).toLowerCase();
+ switch ( value ) {
+ // we should remove it only if it matches "left" or "right",
+ // otherwise leave it intact.
+ case 'left':
+ case 'right':
+ element.removeAttribute( 'align' );
+ }
+ }
+ } else if ( type == CLEANUP )
+ element.removeStyle( 'float' );
+
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ type: 'vbox',
+ height: '250px',
+ children: [
+ {
+ type: 'html',
+ id: 'htmlPreview',
+ style: 'width:95%;',
+ html: '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) + '<br>' +
+ '<div id="' + imagePreviewLoaderId + '" class="ImagePreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>' +
+ '<div class="ImagePreviewBox"><table><tr><td>' +
+ '<a href="javascript:void(0)" target="_blank" onclick="return false;" id="' + previewLinkId + '">' +
+ '<img id="' + previewImageId + '" alt="" /></a>' +
+ ( editor.config.image_previewText || 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ' +
+ 'Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, ' +
+ 'nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.' ) +
+ '</td></tr></table></div></div>'
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ id: 'Link',
+ requiredContent: 'a[href]',
+ label: editor.lang.image.linkTab,
+ padding: 0,
+ elements: [
+ {
+ id: 'txtUrl',
+ type: 'text',
+ label: editor.lang.common.url,
+ style: 'width: 100%',
+ 'default': '',
+ setup: function( type, element ) {
+ if ( type == LINK ) {
+ var href = element.data( 'cke-saved-href' );
+ if ( !href )
+ href = element.getAttribute( 'href' );
+ this.setValue( href );
+ }
+ },
+ commit: function( type, element ) {
+ if ( type == LINK ) {
+ if ( this.getValue() || this.isChanged() ) {
+ var url = decodeURI( this.getValue() );
+ element.data( 'cke-saved-href', url );
+ element.setAttribute( 'href', url );
+
+ if ( this.getValue() || !editor.config.image_removeLinkByEmptyURL )
+ this.getDialog().addLink = true;
+ }
+ }
+ }
+ },
+ {
+ type: 'button',
+ id: 'browse',
+ filebrowser: {
+ action: 'Browse',
+ target: 'Link:txtUrl',
+ url: editor.config.filebrowserImageBrowseLinkUrl
+ },
+ style: 'float:right',
+ hidden: true,
+ label: editor.lang.common.browseServer
+ },
+ {
+ id: 'cmbTarget',
+ type: 'select',
+ requiredContent: 'a[target]',
+ label: editor.lang.common.target,
+ 'default': '',
+ items: [
+ [ editor.lang.common.notSet, '' ],
+ [ editor.lang.common.targetNew, '_blank' ],
+ [ editor.lang.common.targetTop, '_top' ],
+ [ editor.lang.common.targetSelf, '_self' ],
+ [ editor.lang.common.targetParent, '_parent' ]
+ ],
+ setup: function( type, element ) {
+ if ( type == LINK )
+ this.setValue( element.getAttribute( 'target' ) || '' );
+ },
+ commit: function( type, element ) {
+ if ( type == LINK ) {
+ if ( this.getValue() || this.isChanged() )
+ element.setAttribute( 'target', this.getValue() );
+ }
+ }
+ }
+ ]
+ },
+ {
+ id: 'Upload',
+ hidden: true,
+ filebrowser: 'uploadButton',
+ label: editor.lang.image.upload,
+ elements: [
+ {
+ type: 'file',
+ id: 'upload',
+ label: editor.lang.image.btnUpload,
+ style: 'height:40px',
+ size: 38
+ },
+ {
+ type: 'fileButton',
+ id: 'uploadButton',
+ filebrowser: 'info:txtUrl',
+ label: editor.lang.image.btnUpload,
+ 'for': [ 'Upload', 'upload' ]
+ }
+ ]
+ },
+ {
+ id: 'advanced',
+ label: editor.lang.common.advancedTab,
+ elements: [
+ {
+ type: 'hbox',
+ widths: [ '50%', '25%', '25%' ],
+ children: [
+ {
+ type: 'text',
+ id: 'linkId',
+ requiredContent: 'img[id]',
+ label: editor.lang.common.id,
+ setup: function( type, element ) {
+ if ( type == IMAGE )
+ this.setValue( element.getAttribute( 'id' ) );
+ },
+ commit: function( type, element ) {
+ if ( type == IMAGE ) {
+ if ( this.getValue() || this.isChanged() )
+ element.setAttribute( 'id', this.getValue() );
+ }
+ }
+ },
+ {
+ id: 'cmbLangDir',
+ type: 'select',
+ requiredContent: 'img[dir]',
+ style: 'width : 100px;',
+ label: editor.lang.common.langDir,
+ 'default': '',
+ items: [
+ [ editor.lang.common.notSet, '' ],
+ [ editor.lang.common.langDirLtr, 'ltr' ],
+ [ editor.lang.common.langDirRtl, 'rtl' ]
+ ],
+ setup: function( type, element ) {
+ if ( type == IMAGE )
+ this.setValue( element.getAttribute( 'dir' ) );
+ },
+ commit: function( type, element ) {
+ if ( type == IMAGE ) {
+ if ( this.getValue() || this.isChanged() )
+ element.setAttribute( 'dir', this.getValue() );
+ }
+ }
+ },
+ {
+ type: 'text',
+ id: 'txtLangCode',
+ requiredContent: 'img[lang]',
+ label: editor.lang.common.langCode,
+ 'default': '',
+ setup: function( type, element ) {
+ if ( type == IMAGE )
+ this.setValue( element.getAttribute( 'lang' ) );
+ },
+ commit: function( type, element ) {
+ if ( type == IMAGE ) {
+ if ( this.getValue() || this.isChanged() )
+ element.setAttribute( 'lang', this.getValue() );
+ }
+ }
+ }
+ ]
+ },
+ {
+ type: 'text',
+ id: 'txtGenLongDescr',
+ requiredContent: 'img[longdesc]',
+ label: editor.lang.common.longDescr,
+ setup: function( type, element ) {
+ if ( type == IMAGE )
+ this.setValue( element.getAttribute( 'longDesc' ) );
+ },
+ commit: function( type, element ) {
+ if ( type == IMAGE ) {
+ if ( this.getValue() || this.isChanged() )
+ element.setAttribute( 'longDesc', this.getValue() );
+ }
+ }
+ },
+ {
+ type: 'hbox',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ type: 'text',
+ id: 'txtGenClass',
+ requiredContent: 'img(cke-xyz)', // Random text like 'xyz' will check if all are allowed.
+ label: editor.lang.common.cssClass,
+ 'default': '',
+ setup: function( type, element ) {
+ if ( type == IMAGE )
+ this.setValue( element.getAttribute( 'class' ) );
+ },
+ commit: function( type, element ) {
+ if ( type == IMAGE ) {
+ if ( this.getValue() || this.isChanged() )
+ element.setAttribute( 'class', this.getValue() );
+ }
+ }
+ },
+ {
+ type: 'text',
+ id: 'txtGenTitle',
+ requiredContent: 'img[title]',
+ label: editor.lang.common.advisoryTitle,
+ 'default': '',
+ onChange: function() {
+ updatePreview( this.getDialog() );
+ },
+ setup: function( type, element ) {
+ if ( type == IMAGE )
+ this.setValue( element.getAttribute( 'title' ) );
+ },
+ commit: function( type, element ) {
+ if ( type == IMAGE ) {
+ if ( this.getValue() || this.isChanged() )
+ element.setAttribute( 'title', this.getValue() );
+ } else if ( type == PREVIEW ) {
+ element.setAttribute( 'title', this.getValue() );
+ } else if ( type == CLEANUP ) {
+ element.removeAttribute( 'title' );
+ }
+ }
+ }
+ ]
+ },
+ {
+ type: 'text',
+ id: 'txtdlgGenStyle',
+ requiredContent: 'img{cke-xyz}', // Random text like 'xyz' will check if all are allowed.
+ label: editor.lang.common.cssStyle,
+ validate: CKEDITOR.dialog.validate.inlineStyle( editor.lang.common.invalidInlineStyle ),
+ 'default': '',
+ setup: function( type, element ) {
+ if ( type == IMAGE ) {
+ var genStyle = element.getAttribute( 'style' );
+ if ( !genStyle && element.$.style.cssText )
+ genStyle = element.$.style.cssText;
+ this.setValue( genStyle );
+
+ var height = element.$.style.height,
+ width = element.$.style.width,
+ aMatchH = ( height ? height : '' ).match( regexGetSize ),
+ aMatchW = ( width ? width : '' ).match( regexGetSize );
+
+ this.attributesInStyle = {
+ height: !!aMatchH,
+ width: !!aMatchW
+ };
+ }
+ },
+ onChange: function() {
+ commitInternally.call( this, [ 'info:cmbFloat', 'info:cmbAlign',
+ 'info:txtVSpace', 'info:txtHSpace',
+ 'info:txtBorder',
+ 'info:txtWidth', 'info:txtHeight' ] );
+ updatePreview( this );
+ },
+ commit: function( type, element ) {
+ if ( type == IMAGE && ( this.getValue() || this.isChanged() ) ) {
+ element.setAttribute( 'style', this.getValue() );
+ }
+ }
+ }
+ ]
+ }
+ ]
+ };
+ };
+
+ CKEDITOR.dialog.add( 'image', function( editor ) {
+ return imageDialog( editor, 'image' );
+ });
+
+ CKEDITOR.dialog.add( 'imagebutton', function( editor ) {
+ return imageDialog( editor, 'imagebutton' );
+ });
+})();
diff --git a/plugins/link/dialogs/anchor.js b/plugins/link/dialogs/anchor.js
index a664ff2..daa4660 100644
--- a/plugins/link/dialogs/anchor.js
+++ b/plugins/link/dialogs/anchor.js
@@ -1,6 +1,120 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-CKEDITOR.dialog.add('anchor',function(a){var b=function(d){this._.selectedElement=d;var e=d.data('cke-saved-name');this.setValueOf('info','txtName',e||'');};function c(d,e){return d.createFakeElement(e,'cke_anchor','anchor');};return{title:a.lang.anchor.title,minWidth:300,minHeight:60,onOk:function(){var k=this;var d=k.getValueOf('info','txtName'),e={name:d,'data-cke-saved-name':d};if(k._.selectedElement){if(k._.selectedElement.data('cke-realelement')){var f=c(a,a.document.createElement('a',{attributes:e}));f.replace(k._.selectedElement);}else k._.selectedElement.setAttributes(e);}else{var g=a.getSelection(),h=g&&g.getRanges()[0];if(h.collapsed){if(CKEDITOR.plugins.link.synAnchorSelector)e['class']='cke_anchor_empty';if(CKEDITOR.plugins.link.emptyAnchorFix){e.contenteditable='false';e['data-cke-editable']=1;}var i=a.document.createElement('a',{attributes:e});if(CKEDITOR.plugins.link.fakeAnchor)i=c(a,i);h.insertNode(i);}else{if(CKEDITOR.env.ie&&CKEDITOR.env.version<9)e['class']='cke_anchor';var j=new CKEDITOR.style({element:'a',attributes:e});j.type=CKEDITOR.STYLE_INLINE;j.apply(a.document);}}},onHide:function(){delete this._.selectedElement;},onShow:function(){var h=this;var d=a.getSelection(),e=d.getSelectedElement(),f;if(e){if(CKEDITOR.plugins.link.fakeAnchor){var g=CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,e);g&&b.call(h,g);h._.selectedElement=e;}else if(e.is('a')&&e.hasAttribute('name'))b.call(h,e);}else{f=CKEDITOR.plugins.link.getSelectedLink(a);if(f){b.call(h,f);d.selectElement(f);}}h.getContentElement('info','txtName').focus();},contents:[{id:'info',label:a.lang.anchor.title,accessKey:'I',elements:[{type:'text',id:'txtName',label:a.lang.anchor.name,required:true,validate:function(){if(!this.getValue()){alert(a.lang.anchor.errorName);return false;}return true;}}]}]};});
+CKEDITOR.dialog.add( 'anchor', function( editor ) {
+ // Function called in onShow to load selected element.
+ var loadElements = function( element ) {
+ this._.selectedElement = element;
+
+ var attributeValue = element.data( 'cke-saved-name' );
+ this.setValueOf( 'info', 'txtName', attributeValue || '' );
+ };
+
+ function createFakeAnchor( editor, anchor ) {
+ return editor.createFakeElement( anchor, 'cke_anchor', 'anchor' );
+ }
+
+ return {
+ title: editor.lang.link.anchor.title,
+ minWidth: 300,
+ minHeight: 60,
+ onOk: function() {
+ var name = CKEDITOR.tools.trim( this.getValueOf( 'info', 'txtName' ) );
+ var attributes = {
+ id: name,
+ name: name,
+ 'data-cke-saved-name': name
+ };
+
+ if ( this._.selectedElement ) {
+ if ( this._.selectedElement.data( 'cke-realelement' ) ) {
+ var newFake = createFakeAnchor( editor, editor.document.createElement( 'a', { attributes: attributes } ) );
+ newFake.replace( this._.selectedElement );
+ } else
+ this._.selectedElement.setAttributes( attributes );
+ } else {
+ var sel = editor.getSelection(),
+ range = sel && sel.getRanges()[ 0 ];
+
+ // Empty anchor
+ if ( range.collapsed ) {
+ if ( CKEDITOR.plugins.link.synAnchorSelector )
+ attributes[ 'class' ] = 'cke_anchor_empty';
+
+ if ( CKEDITOR.plugins.link.emptyAnchorFix ) {
+ attributes[ 'contenteditable' ] = 'false';
+ attributes[ 'data-cke-editable' ] = 1;
+ }
+
+ var anchor = editor.document.createElement( 'a', { attributes: attributes } );
+
+ // Transform the anchor into a fake element for browsers that need it.
+ if ( CKEDITOR.plugins.link.fakeAnchor )
+ anchor = createFakeAnchor( editor, anchor );
+
+ range.insertNode( anchor );
+ } else {
+ if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 )
+ attributes[ 'class' ] = 'cke_anchor';
+
+ // Apply style.
+ var style = new CKEDITOR.style({ element: 'a', attributes: attributes } );
+ style.type = CKEDITOR.STYLE_INLINE;
+ editor.applyStyle( style );
+ }
+ }
+ },
+
+ onHide: function() {
+ delete this._.selectedElement;
+ },
+
+ onShow: function() {
+ var selection = editor.getSelection(),
+ fullySelected = selection.getSelectedElement(),
+ partialSelected;
+
+ // Detect the anchor under selection.
+ if ( fullySelected ) {
+ if ( CKEDITOR.plugins.link.fakeAnchor ) {
+ var realElement = CKEDITOR.plugins.link.tryRestoreFakeAnchor( editor, fullySelected );
+ realElement && loadElements.call( this, realElement );
+ this._.selectedElement = fullySelected;
+ } else if ( fullySelected.is( 'a' ) && fullySelected.hasAttribute( 'name' ) )
+ loadElements.call( this, fullySelected );
+ } else {
+ partialSelected = CKEDITOR.plugins.link.getSelectedLink( editor );
+ if ( partialSelected ) {
+ loadElements.call( this, partialSelected );
+ selection.selectElement( partialSelected );
+ }
+ }
+
+ this.getContentElement( 'info', 'txtName' ).focus();
+ },
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.link.anchor.title,
+ accessKey: 'I',
+ elements: [
+ {
+ type: 'text',
+ id: 'txtName',
+ label: editor.lang.link.anchor.name,
+ required: true,
+ validate: function() {
+ if ( !this.getValue() ) {
+ alert( editor.lang.link.anchor.errorName );
+ return false;
+ }
+ return true;
+ }
+ }
+ ]
+ }
+ ]
+ };
+});
diff --git a/plugins/link/dialogs/link.js b/plugins/link/dialogs/link.js
index c0d32c8..cf0b26f 100644
--- a/plugins/link/dialogs/link.js
+++ b/plugins/link/dialogs/link.js
@@ -1,12 +1,1288 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-CKEDITOR.dialog.add('link',function(a){var b=CKEDITOR.plugins.link,c=function(){var F=this.getDialog(),G=F.getContentElement('target','popupFeatures'),H=F.getContentElement('target','linkTargetName'),I=this.getValue();if(!G||!H)return;G=G.getElement();G.hide();H.setValue('');switch(I){case 'frame':H.setLabel(a.lang.link.targetFrameName);H.getElement().show();break;case 'popup':G.show();H.setLabel(a.lang.link.targetPopupName);H.getElement().show();break;default:H.setValue(I);H.getElement().hide();break;}},d=function(){var F=this.getDialog(),G=['urlOptions','anchorOptions','emailOptions'],H=this.getValue(),I=F.definition.getContents('upload'),J=I&&I.hidden;if(H=='url'){if(a.config.linkShowTargetTab)F.showPage('target');if(!J)F.showPage('upload');}else{F.hidePage('target');if(!J)F.hidePage('upload');}for(var K=0;K<G.length;K++){var L=F.getContentElement('info',G[K]);if(!L)continue;L=L.getElement().getParent().getParent();if(G[K]==H+'Options')L.show();else L.hide();}F.layout();},e=/^javascript:/,f=/^mailto:([^?]+)(?:\?(.+))?$/,g=/subject=([^;?:@&=$,\/]*)/,h=/body=([^;?:@&=$,\/]*)/,i=/^#(.*)$/,j=/^((?:http|https|ftp|news):\/\/)?(.*)$/,k=/^(_(?:self|top|parent|blank))$/,l=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,m=/^javascript:([^(]+)\(([^)]+)\)$/,n=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,o=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,p=function(F,G){var H=G&&(G.data('cke-saved-href')||G.getAttribute('href'))||'',I,J,K,L,M={};if(I=H.match(e))if(y=='encode')H=H.replace(l,function(ae,af,ag){return 'mailto:'+String.fromCharCode.apply(String,af.split(','))+(ag&&w(ag));});else if(y)H.replace(m,function(ae,af,ag){if(af==z.name){M.type='email';var ah=M.email={},ai=/[^,\s]+/g,aj=/(^')|('$)/g,ak=ag.match(ai),al=ak.length,am,an;for(var ao=0;ao<al;ao++){an=decodeURIComponent(w(ak[ao].replace(aj,'')));am=z.params[ao].toLowerCase();ah[am]=an;}ah.address=[ah.name,ah.domain].join('@');}});if(!M.type)if(K=H.match(i)){M.type='anchor';M.anchor={};M.anchor.name=M.anchor.id=K[1];}else if(J=H.match(f)){var N=H.match(g),O=H.match(h);M.type='email';var P=M.email={};P.address=J[1];N&&(P.subject=decodeURIComponent(N[1]));O&&(P.body=decodeURIComponent(O[1]));}else if(H&&(L=H.match(j))){M.type='url';M.url={};M.url.protocol=L[1];M.url.url=L[2];}else M.type='url';if(G){var Q=G.getAttribute('target');M.target={};M.adv={};if(!Q){var R=G.data('cke-pa-onclick')||G.getAttribute('onclick'),S=R&&R.match(n);
-if(S){M.target.type='popup';M.target.name=S[1];var T;while(T=o.exec(S[2])){if((T[2]=='yes'||T[2]=='1')&&!(T[1] in {height:1,width:1,top:1,left:1}))M.target[T[1]]=true;else if(isFinite(T[2]))M.target[T[1]]=T[2];}}}else{var U=Q.match(k);if(U)M.target.type=M.target.name=Q;else{M.target.type='frame';M.target.name=Q;}}var V=this,W=function(ae,af){var ag=G.getAttribute(af);if(ag!==null)M.adv[ae]=ag||'';};W('advId','id');W('advLangDir','dir');W('advAccessKey','accessKey');M.adv.advName=G.data('cke-saved-name')||G.getAttribute('name')||'';W('advLangCode','lang');W('advTabIndex','tabindex');W('advTitle','title');W('advContentType','type');CKEDITOR.plugins.link.synAnchorSelector?M.adv.advCSSClasses=C(G):W('advCSSClasses','class');W('advCharset','charset');W('advStyles','style');W('advRel','rel');}var X=M.anchors=[],Y,Z,aa;if(CKEDITOR.plugins.link.emptyAnchorFix){var ab=F.document.getElementsByTag('a');for(Y=0,Z=ab.count();Y<Z;Y++){aa=ab.getItem(Y);if(aa.data('cke-saved-name')||aa.hasAttribute('name'))X.push({name:aa.data('cke-saved-name')||aa.getAttribute('name'),id:aa.getAttribute('id')});}}else{var ac=new CKEDITOR.dom.nodeList(F.document.$.anchors);for(Y=0,Z=ac.count();Y<Z;Y++){aa=ac.getItem(Y);X[Y]={name:aa.getAttribute('name'),id:aa.getAttribute('id')};}}if(CKEDITOR.plugins.link.fakeAnchor){var ad=F.document.getElementsByTag('img');for(Y=0,Z=ad.count();Y<Z;Y++){if(aa=CKEDITOR.plugins.link.tryRestoreFakeAnchor(F,ad.getItem(Y)))X.push({name:aa.getAttribute('name'),id:aa.getAttribute('id')});}}this._.selectedElement=G;return M;},q=function(F,G){if(G[F])this.setValue(G[F][this.id]||'');},r=function(F){return q.call(this,'target',F);},s=function(F){return q.call(this,'adv',F);},t=function(F,G){if(!G[F])G[F]={};G[F][this.id]=this.getValue()||'';},u=function(F){return t.call(this,'target',F);},v=function(F){return t.call(this,'adv',F);};function w(F){return F.replace(/\\'/g,"'");};function x(F){return F.replace(/'/g,'\\$&');};var y=a.config.emailProtection||'';if(y&&y!='encode'){var z={};y.replace(/^([^(]+)\(([^)]+)\)$/,function(F,G,H){z.name=G;z.params=[];H.replace(/[^,\s]+/g,function(I){z.params.push(I);});});}function A(F){var G,H=z.name,I=z.params,J,K;G=[H,'('];for(var L=0;L<I.length;L++){J=I[L].toLowerCase();K=F[J];L>0&&G.push(',');G.push("'",K?x(encodeURIComponent(F[J])):'',"'");}G.push(')');return G.join('');};function B(F){var G,H=F.length,I=[];for(var J=0;J<H;J++){G=F.charCodeAt(J);I.push(G);}return 'String.fromCharCode('+I.join(',')+')';};function C(F){var G=F.getAttribute('class');
-return G?G.replace(/\s*(?:cke_anchor_empty|cke_anchor)(?:\s*$)?/g,''):'';};var D=a.lang.common,E=a.lang.link;return{title:E.title,minWidth:350,minHeight:230,contents:[{id:'info',label:E.info,title:E.info,elements:[{id:'linkType',type:'select',label:E.type,'default':'url',items:[[E.toUrl,'url'],[E.toAnchor,'anchor'],[E.toEmail,'email']],onChange:d,setup:function(F){if(F.type)this.setValue(F.type);},commit:function(F){F.type=this.getValue();}},{type:'vbox',id:'urlOptions',children:[{type:'hbox',widths:['25%','75%'],children:[{id:'protocol',type:'select',label:D.protocol,'default':'http://',items:[['http://‎','http://'],['https://‎','https://'],['ftp://‎','ftp://'],['news://‎','news://'],[E.other,'']],setup:function(F){if(F.url)this.setValue(F.url.protocol||'');},commit:function(F){if(!F.url)F.url={};F.url.protocol=this.getValue();}},{type:'text',id:'url',label:D.url,required:true,onLoad:function(){this.allowOnChange=true;},onKeyUp:function(){var K=this;K.allowOnChange=false;var F=K.getDialog().getContentElement('info','protocol'),G=K.getValue(),H=/^(http|https|ftp|news):\/\/(?=.)/i,I=/^((javascript:)|[#\/\.\?])/i,J=H.exec(G);if(J){K.setValue(G.substr(J[0].length));F.setValue(J[0].toLowerCase());}else if(I.test(G))F.setValue('');K.allowOnChange=true;},onChange:function(){if(this.allowOnChange)this.onKeyUp();},validate:function(){var F=this.getDialog();if(F.getContentElement('info','linkType')&&F.getValueOf('info','linkType')!='url')return true;if(this.getDialog().fakeObj)return true;var G=CKEDITOR.dialog.validate.notEmpty(E.noUrl);return G.apply(this);},setup:function(F){this.allowOnChange=false;if(F.url)this.setValue(F.url.url);this.allowOnChange=true;},commit:function(F){this.onChange();if(!F.url)F.url={};F.url.url=this.getValue();this.allowOnChange=false;}}],setup:function(F){if(!this.getDialog().getContentElement('info','linkType'))this.getElement().show();}},{type:'button',id:'browse',hidden:'true',filebrowser:'info:url',label:D.browseServer}]},{type:'vbox',id:'anchorOptions',width:260,align:'center',padding:0,children:[{type:'fieldset',id:'selectAnchorText',label:E.selectAnchor,setup:function(F){if(F.anchors.length>0)this.getElement().show();else this.getElement().hide();},children:[{type:'hbox',id:'selectAnchor',children:[{type:'select',id:'anchorName','default':'',label:E.anchorName,style:'width: 100%;',items:[['']],setup:function(F){var I=this;I.clear();I.add('');for(var G=0;G<F.anchors.length;G++){if(F.anchors[G].name)I.add(F.anchors[G].name);}if(F.anchor)I.setValue(F.anchor.name);
-var H=I.getDialog().getContentElement('info','linkType');if(H&&H.getValue()=='email')I.focus();},commit:function(F){if(!F.anchor)F.anchor={};F.anchor.name=this.getValue();}},{type:'select',id:'anchorId','default':'',label:E.anchorId,style:'width: 100%;',items:[['']],setup:function(F){var H=this;H.clear();H.add('');for(var G=0;G<F.anchors.length;G++){if(F.anchors[G].id)H.add(F.anchors[G].id);}if(F.anchor)H.setValue(F.anchor.id);},commit:function(F){if(!F.anchor)F.anchor={};F.anchor.id=this.getValue();}}],setup:function(F){if(F.anchors.length>0)this.getElement().show();else this.getElement().hide();}}]},{type:'html',id:'noAnchors',style:'text-align: center;',html:'<div role="note" tabIndex="-1">'+CKEDITOR.tools.htmlEncode(E.noAnchors)+'</div>',focus:true,setup:function(F){if(F.anchors.length<1)this.getElement().show();else this.getElement().hide();}}],setup:function(F){if(!this.getDialog().getContentElement('info','linkType'))this.getElement().hide();}},{type:'vbox',id:'emailOptions',padding:1,children:[{type:'text',id:'emailAddress',label:E.emailAddress,required:true,validate:function(){var F=this.getDialog();if(!F.getContentElement('info','linkType')||F.getValueOf('info','linkType')!='email')return true;var G=CKEDITOR.dialog.validate.notEmpty(E.noEmail);return G.apply(this);},setup:function(F){if(F.email)this.setValue(F.email.address);var G=this.getDialog().getContentElement('info','linkType');if(G&&G.getValue()=='email')this.select();},commit:function(F){if(!F.email)F.email={};F.email.address=this.getValue();}},{type:'text',id:'emailSubject',label:E.emailSubject,setup:function(F){if(F.email)this.setValue(F.email.subject);},commit:function(F){if(!F.email)F.email={};F.email.subject=this.getValue();}},{type:'textarea',id:'emailBody',label:E.emailBody,rows:3,'default':'',setup:function(F){if(F.email)this.setValue(F.email.body);},commit:function(F){if(!F.email)F.email={};F.email.body=this.getValue();}}],setup:function(F){if(!this.getDialog().getContentElement('info','linkType'))this.getElement().hide();}}]},{id:'target',label:E.target,title:E.target,elements:[{type:'hbox',widths:['50%','50%'],children:[{type:'select',id:'linkTargetType',label:D.target,'default':'notSet',style:'width : 100%;',items:[[D.notSet,'notSet'],[E.targetFrame,'frame'],[E.targetPopup,'popup'],[D.targetNew,'_blank'],[D.targetTop,'_top'],[D.targetSelf,'_self'],[D.targetParent,'_parent']],onChange:c,setup:function(F){if(F.target)this.setValue(F.target.type||'notSet');c.call(this);},commit:function(F){if(!F.target)F.target={};
-F.target.type=this.getValue();}},{type:'text',id:'linkTargetName',label:E.targetFrameName,'default':'',setup:function(F){if(F.target)this.setValue(F.target.name);},commit:function(F){if(!F.target)F.target={};F.target.name=this.getValue().replace(/\W/gi,'');}}]},{type:'vbox',width:'100%',align:'center',padding:2,id:'popupFeatures',children:[{type:'fieldset',label:E.popupFeatures,children:[{type:'hbox',children:[{type:'checkbox',id:'resizable',label:E.popupResizable,setup:r,commit:u},{type:'checkbox',id:'status',label:E.popupStatusBar,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'location',label:E.popupLocationBar,setup:r,commit:u},{type:'checkbox',id:'toolbar',label:E.popupToolbar,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'menubar',label:E.popupMenuBar,setup:r,commit:u},{type:'checkbox',id:'fullscreen',label:E.popupFullScreen,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'scrollbars',label:E.popupScrollBars,setup:r,commit:u},{type:'checkbox',id:'dependent',label:E.popupDependent,setup:r,commit:u}]},{type:'hbox',children:[{type:'text',widths:['50%','50%'],labelLayout:'horizontal',label:D.width,id:'width',setup:r,commit:u},{type:'text',labelLayout:'horizontal',widths:['50%','50%'],label:E.popupLeft,id:'left',setup:r,commit:u}]},{type:'hbox',children:[{type:'text',labelLayout:'horizontal',widths:['50%','50%'],label:D.height,id:'height',setup:r,commit:u},{type:'text',labelLayout:'horizontal',label:E.popupTop,widths:['50%','50%'],id:'top',setup:r,commit:u}]}]}]}]},{id:'upload',label:E.upload,title:E.upload,hidden:true,filebrowser:'uploadButton',elements:[{type:'file',id:'upload',label:D.upload,style:'height:40px',size:29},{type:'fileButton',id:'uploadButton',label:D.uploadSubmit,filebrowser:'info:url','for':['upload','upload']}]},{id:'advanced',label:E.advanced,title:E.advanced,elements:[{type:'vbox',padding:1,children:[{type:'hbox',widths:['45%','35%','20%'],children:[{type:'text',id:'advId',label:E.id,setup:s,commit:v},{type:'select',id:'advLangDir',label:E.langDir,'default':'',style:'width:110px',items:[[D.notSet,''],[E.langDirLTR,'ltr'],[E.langDirRTL,'rtl']],setup:s,commit:v},{type:'text',id:'advAccessKey',width:'80px',label:E.acccessKey,maxLength:1,setup:s,commit:v}]},{type:'hbox',widths:['45%','35%','20%'],children:[{type:'text',label:E.name,id:'advName',setup:s,commit:v},{type:'text',label:E.langCode,id:'advLangCode',width:'110px','default':'',setup:s,commit:v},{type:'text',label:E.tabIndex,id:'advTabIndex',width:'80px',maxLength:5,setup:s,commit:v}]}]},{type:'vbox',padding:1,children:[{type:'hbox',widths:['45%','55%'],children:[{type:'text',label:E.advisoryTitle,'default':'',id:'advTitle',setup:s,commit:v},{type:'text',label:E.advisoryContentType,'default':'',id:'advContentType',setup:s,commit:v}]},{type:'hbox',widths:['45%','55%'],children:[{type:'text',label:E.cssClasses,'default':'',id:'advCSSClasses',setup:s,commit:v},{type:'text',label:E.charset,'default':'',id:'advCharset',setup:s,commit:v}]},{type:'hbox',widths:['45%','55%'],children:[{type:'text',label:E.rel,'default':'',id:'advRel',setup:s,commit:v},{type:'text',label:E.styles,'default':'',id:'advStyles',validate:CKEDITOR.dialog.validate.inlineStyle(a.lang.common.invalidInlineStyle),setup:s,commit:v}]}]}]}],onShow:function(){var F=this.getParentEditor(),G=F.getSelection(),H=null;
-if((H=b.getSelectedLink(F))&&H.hasAttribute('href'))G.selectElement(H);else H=null;this.setupContent(p.apply(this,[F,H]));},onOk:function(){var F={},G=[],H={},I=this,J=this.getParentEditor();this.commitContent(H);switch(H.type||'url'){case 'url':var K=H.url&&H.url.protocol!=undefined?H.url.protocol:'http://',L=H.url&&CKEDITOR.tools.trim(H.url.url)||'';F['data-cke-saved-href']=L.indexOf('/')===0?L:K+L;break;case 'anchor':var M=H.anchor&&H.anchor.name,N=H.anchor&&H.anchor.id;F['data-cke-saved-href']='#'+(M||N||'');break;case 'email':var O,P=H.email,Q=P.address;switch(y){case '':case 'encode':var R=encodeURIComponent(P.subject||''),S=encodeURIComponent(P.body||''),T=[];R&&T.push('subject='+R);S&&T.push('body='+S);T=T.length?'?'+T.join('&'):'';if(y=='encode'){O=["javascript:void(location.href='mailto:'+",B(Q)];T&&O.push("+'",x(T),"'");O.push(')');}else O=['mailto:',Q,T];break;default:var U=Q.split('@',2);P.name=U[0];P.domain=U[1];O=['javascript:',A(P)];}F['data-cke-saved-href']=O.join('');break;}if(H.target)if(H.target.type=='popup'){var V=["window.open(this.href, '",H.target.name||'',"', '"],W=['resizable','status','location','toolbar','menubar','fullscreen','scrollbars','dependent'],X=W.length,Y=function(ai){if(H.target[ai])W.push(ai+'='+H.target[ai]);};for(var Z=0;Z<X;Z++)W[Z]=W[Z]+(H.target[W[Z]]?'=yes':'=no');Y('width');Y('left');Y('height');Y('top');V.push(W.join(','),"'); return false;");F['data-cke-pa-onclick']=V.join('');G.push('target');}else{if(H.target.type!='notSet'&&H.target.name)F.target=H.target.name;else G.push('target');G.push('data-cke-pa-onclick','onclick');}if(H.adv){var aa=function(ai,aj){var ak=H.adv[ai];if(ak)F[aj]=ak;else G.push(aj);};aa('advId','id');aa('advLangDir','dir');aa('advAccessKey','accessKey');if(H.adv.advName)F.name=F['data-cke-saved-name']=H.adv.advName;else G=G.concat(['data-cke-saved-name','name']);aa('advLangCode','lang');aa('advTabIndex','tabindex');aa('advTitle','title');aa('advContentType','type');aa('advCSSClasses','class');aa('advCharset','charset');aa('advStyles','style');aa('advRel','rel');}var ab=J.getSelection();F.href=F['data-cke-saved-href'];if(!this._.selectedElement){var ac=ab.getRanges(true);if(ac.length==1&&ac[0].collapsed){var ad=new CKEDITOR.dom.text(H.type=='email'?H.email.address:F['data-cke-saved-href'],J.document);ac[0].insertNode(ad);ac[0].selectNodeContents(ad);ab.selectRanges(ac);}var ae=new CKEDITOR.style({element:'a',attributes:F});ae.type=CKEDITOR.STYLE_INLINE;ae.apply(J.document);}else{var af=this._.selectedElement,ag=af.data('cke-saved-href'),ah=af.getHtml();
-af.setAttributes(F);af.removeAttributes(G);if(H.adv&&H.adv.advName&&CKEDITOR.plugins.link.synAnchorSelector)af.addClass(af.getChildCount()?'cke_anchor':'cke_anchor_empty');if(ag==ah||H.type=='email'&&ah.indexOf('@')!=-1)af.setHtml(H.type=='email'?H.email.address:F['data-cke-saved-href']);ab.selectElement(af);delete this._.selectedElement;}},onLoad:function(){if(!a.config.linkShowAdvancedTab)this.hidePage('advanced');if(!a.config.linkShowTargetTab)this.hidePage('target');},onFocus:function(){var F=this.getContentElement('info','linkType'),G;if(F&&F.getValue()=='url'){G=this.getContentElement('info','url');G.select();}}};});
+CKEDITOR.dialog.add( 'link', function( editor ) {
+ var plugin = CKEDITOR.plugins.link;
+ // Handles the event when the "Target" selection box is changed.
+ var targetChanged = function() {
+ var dialog = this.getDialog(),
+ popupFeatures = dialog.getContentElement( 'target', 'popupFeatures' ),
+ targetName = dialog.getContentElement( 'target', 'linkTargetName' ),
+ value = this.getValue();
+
+ if ( !popupFeatures || !targetName )
+ return;
+
+ popupFeatures = popupFeatures.getElement();
+ popupFeatures.hide();
+ targetName.setValue( '' );
+
+ switch ( value ) {
+ case 'frame':
+ targetName.setLabel( editor.lang.link.targetFrameName );
+ targetName.getElement().show();
+ break;
+ case 'popup':
+ popupFeatures.show();
+ targetName.setLabel( editor.lang.link.targetPopupName );
+ targetName.getElement().show();
+ break;
+ default:
+ targetName.setValue( value );
+ targetName.getElement().hide();
+ break;
+ }
+
+ };
+
+ // Handles the event when the "Type" selection box is changed.
+ var linkTypeChanged = function() {
+ var dialog = this.getDialog(),
+ partIds = [ 'urlOptions', 'anchorOptions', 'emailOptions' ],
+ typeValue = this.getValue(),
+ uploadTab = dialog.definition.getContents( 'upload' ),
+ uploadInitiallyHidden = uploadTab && uploadTab.hidden;
+
+ if ( typeValue == 'url' ) {
+ if ( editor.config.linkShowTargetTab )
+ dialog.showPage( 'target' );
+ if ( !uploadInitiallyHidden )
+ dialog.showPage( 'upload' );
+ } else {
+ dialog.hidePage( 'target' );
+ if ( !uploadInitiallyHidden )
+ dialog.hidePage( 'upload' );
+ }
+
+ for ( var i = 0; i < partIds.length; i++ ) {
+ var element = dialog.getContentElement( 'info', partIds[ i ] );
+ if ( !element )
+ continue;
+
+ element = element.getElement().getParent().getParent();
+ if ( partIds[ i ] == typeValue + 'Options' )
+ element.show();
+ else
+ element.hide();
+ }
+
+ dialog.layout();
+ };
+
+ // Loads the parameters in a selected link to the link dialog fields.
+ var javascriptProtocolRegex = /^javascript:/,
+ emailRegex = /^mailto:([^?]+)(?:\?(.+))?$/,
+ emailSubjectRegex = /subject=([^;?:@&=$,\/]*)/,
+ emailBodyRegex = /body=([^;?:@&=$,\/]*)/,
+ anchorRegex = /^#(.*)$/,
+ urlRegex = /^((?:http|https|ftp|news):\/\/)?(.*)$/,
+ selectableTargets = /^(_(?:self|top|parent|blank))$/,
+ encodedEmailLinkRegex = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
+ functionCallProtectedEmailLinkRegex = /^javascript:([^(]+)\(([^)]+)\)$/;
+
+ var popupRegex = /\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/;
+ var popupFeaturesRegex = /(?:^|,)([^=]+)=(\d+|yes|no)/gi;
+
+ var parseLink = function( editor, element ) {
+ var href = ( element && ( element.data( 'cke-saved-href' ) || element.getAttribute( 'href' ) ) ) || '',
+ javascriptMatch, emailMatch, anchorMatch, urlMatch,
+ retval = {};
+
+ if ( ( javascriptMatch = href.match( javascriptProtocolRegex ) ) ) {
+ if ( emailProtection == 'encode' ) {
+ href = href.replace( encodedEmailLinkRegex, function( match, protectedAddress, rest ) {
+ return 'mailto:' +
+ String.fromCharCode.apply( String, protectedAddress.split( ',' ) ) +
+ ( rest && unescapeSingleQuote( rest ) );
+ });
+ }
+ // Protected email link as function call.
+ else if ( emailProtection ) {
+ href.replace( functionCallProtectedEmailLinkRegex, function( match, funcName, funcArgs ) {
+ if ( funcName == compiledProtectionFunction.name ) {
+ retval.type = 'email';
+ var email = retval.email = {};
+
+ var paramRegex = /[^,\s]+/g,
+ paramQuoteRegex = /(^')|('$)/g,
+ paramsMatch = funcArgs.match( paramRegex ),
+ paramsMatchLength = paramsMatch.length,
+ paramName, paramVal;
+
+ for ( var i = 0; i < paramsMatchLength; i++ ) {
+ paramVal = decodeURIComponent( unescapeSingleQuote( paramsMatch[ i ].replace( paramQuoteRegex, '' ) ) );
+ paramName = compiledProtectionFunction.params[ i ].toLowerCase();
+ email[ paramName ] = paramVal;
+ }
+ email.address = [ email.name, email.domain ].join( '@' );
+ }
+ });
+ }
+ }
+
+ if ( !retval.type ) {
+ if ( ( anchorMatch = href.match( anchorRegex ) ) ) {
+ retval.type = 'anchor';
+ retval.anchor = {};
+ retval.anchor.name = retval.anchor.id = anchorMatch[ 1 ];
+ }
+ // Protected email link as encoded string.
+ else if ( ( emailMatch = href.match( emailRegex ) ) ) {
+ var subjectMatch = href.match( emailSubjectRegex ),
+ bodyMatch = href.match( emailBodyRegex );
+
+ retval.type = 'email';
+ var email = ( retval.email = {} );
+ email.address = emailMatch[ 1 ];
+ subjectMatch && ( email.subject = decodeURIComponent( subjectMatch[ 1 ] ) );
+ bodyMatch && ( email.body = decodeURIComponent( bodyMatch[ 1 ] ) );
+ }
+ // urlRegex matches empty strings, so need to check for href as well.
+ else if ( href && ( urlMatch = href.match( urlRegex ) ) ) {
+ retval.type = 'url';
+ retval.url = {};
+ retval.url.protocol = urlMatch[ 1 ];
+ retval.url.url = urlMatch[ 2 ];
+ } else
+ retval.type = 'url';
+ }
+
+ // Load target and popup settings.
+ if ( element ) {
+ var target = element.getAttribute( 'target' );
+ retval.target = {};
+ retval.adv = {};
+
+ // IE BUG: target attribute is an empty string instead of null in IE if it's not set.
+ if ( !target ) {
+ var onclick = element.data( 'cke-pa-onclick' ) || element.getAttribute( 'onclick' ),
+ onclickMatch = onclick && onclick.match( popupRegex );
+ if ( onclickMatch ) {
+ retval.target.type = 'popup';
+ retval.target.name = onclickMatch[ 1 ];
+
+ var featureMatch;
+ while ( ( featureMatch = popupFeaturesRegex.exec( onclickMatch[ 2 ] ) ) ) {
+ // Some values should remain numbers (#7300)
+ if ( ( featureMatch[ 2 ] == 'yes' || featureMatch[ 2 ] == '1' ) && !( featureMatch[ 1 ] in { height:1,width:1,top:1,left:1 } ) )
+ retval.target[ featureMatch[ 1 ] ] = true;
+ else if ( isFinite( featureMatch[ 2 ] ) )
+ retval.target[ featureMatch[ 1 ] ] = featureMatch[ 2 ];
+ }
+ }
+ } else {
+ var targetMatch = target.match( selectableTargets );
+ if ( targetMatch )
+ retval.target.type = retval.target.name = target;
+ else {
+ retval.target.type = 'frame';
+ retval.target.name = target;
+ }
+ }
+
+ var me = this;
+ var advAttr = function( inputName, attrName ) {
+ var value = element.getAttribute( attrName );
+ if ( value !== null )
+ retval.adv[ inputName ] = value || '';
+ };
+ advAttr( 'advId', 'id' );
+ advAttr( 'advLangDir', 'dir' );
+ advAttr( 'advAccessKey', 'accessKey' );
+
+ retval.adv.advName = element.data( 'cke-saved-name' ) || element.getAttribute( 'name' ) || '';
+ advAttr( 'advLangCode', 'lang' );
+ advAttr( 'advTabIndex', 'tabindex' );
+ advAttr( 'advTitle', 'title' );
+ advAttr( 'advContentType', 'type' );
+ CKEDITOR.plugins.link.synAnchorSelector ? retval.adv.advCSSClasses = getLinkClass( element ) : advAttr( 'advCSSClasses', 'class' );
+ advAttr( 'advCharset', 'charset' );
+ advAttr( 'advStyles', 'style' );
+ advAttr( 'advRel', 'rel' );
+ }
+
+ // Find out whether we have any anchors in the editor.
+ var anchors = retval.anchors = [],
+ i, count, item;
+
+ // For some browsers we set contenteditable="false" on anchors, making document.anchors not to include them, so we must traverse the links manually (#7893).
+ if ( CKEDITOR.plugins.link.emptyAnchorFix ) {
+ var links = editor.document.getElementsByTag( 'a' );
+ for ( i = 0, count = links.count(); i < count; i++ ) {
+ item = links.getItem( i );
+ if ( item.data( 'cke-saved-name' ) || item.hasAttribute( 'name' ) )
+ anchors.push({ name: item.data( 'cke-saved-name' ) || item.getAttribute( 'name' ), id: item.getAttribute( 'id' ) } );
+ }
+ } else {
+ var anchorList = new CKEDITOR.dom.nodeList( editor.document.$.anchors );
+ for ( i = 0, count = anchorList.count(); i < count; i++ ) {
+ item = anchorList.getItem( i );
+ anchors[ i ] = { name: item.getAttribute( 'name' ), id: item.getAttribute( 'id' ) };
+ }
+ }
+
+ if ( CKEDITOR.plugins.link.fakeAnchor ) {
+ var imgs = editor.document.getElementsByTag( 'img' );
+ for ( i = 0, count = imgs.count(); i < count; i++ ) {
+ if ( ( item = CKEDITOR.plugins.link.tryRestoreFakeAnchor( editor, imgs.getItem( i ) ) ) )
+ anchors.push({ name: item.getAttribute( 'name' ), id: item.getAttribute( 'id' ) } );
+ }
+ }
+
+ // Record down the selected element in the dialog.
+ this._.selectedElement = element;
+ return retval;
+ };
+
+ var setupParams = function( page, data ) {
+ if ( data[ page ] )
+ this.setValue( data[ page ][ this.id ] || '' );
+ };
+
+ var setupPopupParams = function( data ) {
+ return setupParams.call( this, 'target', data );
+ };
+
+ var setupAdvParams = function( data ) {
+ return setupParams.call( this, 'adv', data );
+ };
+
+ var commitParams = function( page, data ) {
+ if ( !data[ page ] )
+ data[ page ] = {};
+
+ data[ page ][ this.id ] = this.getValue() || '';
+ };
+
+ var commitPopupParams = function( data ) {
+ return commitParams.call( this, 'target', data );
+ };
+
+ var commitAdvParams = function( data ) {
+ return commitParams.call( this, 'adv', data );
+ };
+
+ function unescapeSingleQuote( str ) {
+ return str.replace( /\\'/g, '\'' );
+ }
+
+ function escapeSingleQuote( str ) {
+ return str.replace( /'/g, '\\$&' );
+ }
+
+ var emailProtection = editor.config.emailProtection || '';
+
+ // Compile the protection function pattern.
+ if ( emailProtection && emailProtection != 'encode' ) {
+ var compiledProtectionFunction = {};
+
+ emailProtection.replace( /^([^(]+)\(([^)]+)\)$/, function( match, funcName, params ) {
+ compiledProtectionFunction.name = funcName;
+ compiledProtectionFunction.params = [];
+ params.replace( /[^,\s]+/g, function( param ) {
+ compiledProtectionFunction.params.push( param );
+ });
+ });
+ }
+
+ function protectEmailLinkAsFunction( email ) {
+ var retval,
+ name = compiledProtectionFunction.name,
+ params = compiledProtectionFunction.params,
+ paramName, paramValue;
+
+ retval = [ name, '(' ];
+ for ( var i = 0; i < params.length; i++ ) {
+ paramName = params[ i ].toLowerCase();
+ paramValue = email[ paramName ];
+
+ i > 0 && retval.push( ',' );
+ retval.push( '\'', paramValue ? escapeSingleQuote( encodeURIComponent( email[ paramName ] ) ) : '', '\'' );
+ }
+ retval.push( ')' );
+ return retval.join( '' );
+ }
+
+ function protectEmailAddressAsEncodedString( address ) {
+ var charCode,
+ length = address.length,
+ encodedChars = [];
+ for ( var i = 0; i < length; i++ ) {
+ charCode = address.charCodeAt( i );
+ encodedChars.push( charCode );
+ }
+ return 'String.fromCharCode(' + encodedChars.join( ',' ) + ')';
+ }
+
+ function getLinkClass( ele ) {
+ var className = ele.getAttribute( 'class' );
+ return className ? className.replace( /\s*(?:cke_anchor_empty|cke_anchor)(?:\s*$)?/g, '' ) : '';
+ }
+
+ var commonLang = editor.lang.common,
+ linkLang = editor.lang.link;
+
+ return {
+ title: linkLang.title,
+ minWidth: 350,
+ minHeight: 230,
+ contents: [
+ {
+ id: 'info',
+ label: linkLang.info,
+ title: linkLang.info,
+ elements: [
+ {
+ id: 'linkType',
+ type: 'select',
+ label: linkLang.type,
+ 'default': 'url',
+ items: [
+ [ linkLang.toUrl, 'url' ],
+ [ linkLang.toAnchor, 'anchor' ],
+ [ linkLang.toEmail, 'email' ]
+ ],
+ onChange: linkTypeChanged,
+ setup: function( data ) {
+ if ( data.type )
+ this.setValue( data.type );
+ },
+ commit: function( data ) {
+ data.type = this.getValue();
+ }
+ },
+ {
+ type: 'vbox',
+ id: 'urlOptions',
+ children: [
+ {
+ type: 'hbox',
+ widths: [ '25%', '75%' ],
+ children: [
+ {
+ id: 'protocol',
+ type: 'select',
+ label: commonLang.protocol,
+ 'default': 'http://',
+ items: [
+ // Force 'ltr' for protocol names in BIDI. (#5433)
+ [ 'http://\u200E', 'http://' ],
+ [ 'https://\u200E', 'https://' ],
+ [ 'ftp://\u200E', 'ftp://' ],
+ [ 'news://\u200E', 'news://' ],
+ [ linkLang.other, '' ]
+ ],
+ setup: function( data ) {
+ if ( data.url )
+ this.setValue( data.url.protocol || '' );
+ },
+ commit: function( data ) {
+ if ( !data.url )
+ data.url = {};
+
+ data.url.protocol = this.getValue();
+ }
+ },
+ {
+ type: 'text',
+ id: 'url',
+ label: commonLang.url,
+ required: true,
+ onLoad: function() {
+ this.allowOnChange = true;
+ },
+ onKeyUp: function() {
+ this.allowOnChange = false;
+ var protocolCmb = this.getDialog().getContentElement( 'info', 'protocol' ),
+ url = this.getValue(),
+ urlOnChangeProtocol = /^(http|https|ftp|news):\/\/(?=.)/i,
+ urlOnChangeTestOther = /^((javascript:)|[#\/\.\?])/i;
+
+ var protocol = urlOnChangeProtocol.exec( url );
+ if ( protocol ) {
+ this.setValue( url.substr( protocol[ 0 ].length ) );
+ protocolCmb.setValue( protocol[ 0 ].toLowerCase() );
+ } else if ( urlOnChangeTestOther.test( url ) )
+ protocolCmb.setValue( '' );
+
+ this.allowOnChange = true;
+ },
+ onChange: function() {
+ if ( this.allowOnChange ) // Dont't call on dialog load.
+ this.onKeyUp();
+ },
+ validate: function() {
+ var dialog = this.getDialog();
+
+ if ( dialog.getContentElement( 'info', 'linkType' ) && dialog.getValueOf( 'info', 'linkType' ) != 'url' )
+ return true;
+
+ if ( (/javascript\:/).test( this.getValue() ) ) {
+ alert( commonLang.invalidValue );
+ return false;
+ }
+
+ if ( this.getDialog().fakeObj ) // Edit Anchor.
+ return true;
+
+ var func = CKEDITOR.dialog.validate.notEmpty( linkLang.noUrl );
+ return func.apply( this );
+ },
+ setup: function( data ) {
+ this.allowOnChange = false;
+ if ( data.url )
+ this.setValue( data.url.url );
+ this.allowOnChange = true;
+
+ },
+ commit: function( data ) {
+ // IE will not trigger the onChange event if the mouse has been used
+ // to carry all the operations #4724
+ this.onChange();
+
+ if ( !data.url )
+ data.url = {};
+
+ data.url.url = this.getValue();
+ this.allowOnChange = false;
+ }
+ }
+ ],
+ setup: function( data ) {
+ if ( !this.getDialog().getContentElement( 'info', 'linkType' ) )
+ this.getElement().show();
+ }
+ },
+ {
+ type: 'button',
+ id: 'browse',
+ hidden: 'true',
+ filebrowser: 'info:url',
+ label: commonLang.browseServer
+ }
+ ]
+ },
+ {
+ type: 'vbox',
+ id: 'anchorOptions',
+ width: 260,
+ align: 'center',
+ padding: 0,
+ children: [
+ {
+ type: 'fieldset',
+ id: 'selectAnchorText',
+ label: linkLang.selectAnchor,
+ setup: function( data ) {
+ if ( data.anchors.length > 0 )
+ this.getElement().show();
+ else
+ this.getElement().hide();
+ },
+ children: [
+ {
+ type: 'hbox',
+ id: 'selectAnchor',
+ children: [
+ {
+ type: 'select',
+ id: 'anchorName',
+ 'default': '',
+ label: linkLang.anchorName,
+ style: 'width: 100%;',
+ items: [
+ [ '' ]
+ ],
+ setup: function( data ) {
+ this.clear();
+ this.add( '' );
+ for ( var i = 0; i < data.anchors.length; i++ ) {
+ if ( data.anchors[ i ].name )
+ this.add( data.anchors[ i ].name );
+ }
+
+ if ( data.anchor )
+ this.setValue( data.anchor.name );
+
+ var linkType = this.getDialog().getContentElement( 'info', 'linkType' );
+ if ( linkType && linkType.getValue() == 'email' )
+ this.focus();
+ },
+ commit: function( data ) {
+ if ( !data.anchor )
+ data.anchor = {};
+
+ data.anchor.name = this.getValue();
+ }
+ },
+ {
+ type: 'select',
+ id: 'anchorId',
+ 'default': '',
+ label: linkLang.anchorId,
+ style: 'width: 100%;',
+ items: [
+ [ '' ]
+ ],
+ setup: function( data ) {
+ this.clear();
+ this.add( '' );
+ for ( var i = 0; i < data.anchors.length; i++ ) {
+ if ( data.anchors[ i ].id )
+ this.add( data.anchors[ i ].id );
+ }
+
+ if ( data.anchor )
+ this.setValue( data.anchor.id );
+ },
+ commit: function( data ) {
+ if ( !data.anchor )
+ data.anchor = {};
+
+ data.anchor.id = this.getValue();
+ }
+ }
+ ],
+ setup: function( data ) {
+ if ( data.anchors.length > 0 )
+ this.getElement().show();
+ else
+ this.getElement().hide();
+ }
+ }
+ ]
+ },
+ {
+ type: 'html',
+ id: 'noAnchors',
+ style: 'text-align: center;',
+ html: '<div role="note" tabIndex="-1">' + CKEDITOR.tools.htmlEncode( linkLang.noAnchors ) + '</div>',
+ // Focus the first element defined in above html.
+ focus: true,
+ setup: function( data ) {
+ if ( data.anchors.length < 1 )
+ this.getElement().show();
+ else
+ this.getElement().hide();
+ }
+ }
+ ],
+ setup: function( data ) {
+ if ( !this.getDialog().getContentElement( 'info', 'linkType' ) )
+ this.getElement().hide();
+ }
+ },
+ {
+ type: 'vbox',
+ id: 'emailOptions',
+ padding: 1,
+ children: [
+ {
+ type: 'text',
+ id: 'emailAddress',
+ label: linkLang.emailAddress,
+ required: true,
+ validate: function() {
+ var dialog = this.getDialog();
+
+ if ( !dialog.getContentElement( 'info', 'linkType' ) || dialog.getValueOf( 'info', 'linkType' ) != 'email' )
+ return true;
+
+ var func = CKEDITOR.dialog.validate.notEmpty( linkLang.noEmail );
+ return func.apply( this );
+ },
+ setup: function( data ) {
+ if ( data.email )
+ this.setValue( data.email.address );
+
+ var linkType = this.getDialog().getContentElement( 'info', 'linkType' );
+ if ( linkType && linkType.getValue() == 'email' )
+ this.select();
+ },
+ commit: function( data ) {
+ if ( !data.email )
+ data.email = {};
+
+ data.email.address = this.getValue();
+ }
+ },
+ {
+ type: 'text',
+ id: 'emailSubject',
+ label: linkLang.emailSubject,
+ setup: function( data ) {
+ if ( data.email )
+ this.setValue( data.email.subject );
+ },
+ commit: function( data ) {
+ if ( !data.email )
+ data.email = {};
+
+ data.email.subject = this.getValue();
+ }
+ },
+ {
+ type: 'textarea',
+ id: 'emailBody',
+ label: linkLang.emailBody,
+ rows: 3,
+ 'default': '',
+ setup: function( data ) {
+ if ( data.email )
+ this.setValue( data.email.body );
+ },
+ commit: function( data ) {
+ if ( !data.email )
+ data.email = {};
+
+ data.email.body = this.getValue();
+ }
+ }
+ ],
+ setup: function( data ) {
+ if ( !this.getDialog().getContentElement( 'info', 'linkType' ) )
+ this.getElement().hide();
+ }
+ }
+ ]
+ },
+ {
+ id: 'target',
+ requiredContent: 'a[target]', // This is not fully correct, because some target option requires JS.
+ label: linkLang.target,
+ title: linkLang.target,
+ elements: [
+ {
+ type: 'hbox',
+ widths: [ '50%', '50%' ],
+ children: [
+ {
+ type: 'select',
+ id: 'linkTargetType',
+ label: commonLang.target,
+ 'default': 'notSet',
+ style: 'width : 100%;',
+ 'items': [
+ [ commonLang.notSet, 'notSet' ],
+ [ linkLang.targetFrame, 'frame' ],
+ [ linkLang.targetPopup, 'popup' ],
+ [ commonLang.targetNew, '_blank' ],
+ [ commonLang.targetTop, '_top' ],
+ [ commonLang.targetSelf, '_self' ],
+ [ commonLang.targetParent, '_parent' ]
+ ],
+ onChange: targetChanged,
+ setup: function( data ) {
+ if ( data.target )
+ this.setValue( data.target.type || 'notSet' );
+ targetChanged.call( this );
+ },
+ commit: function( data ) {
+ if ( !data.target )
+ data.target = {};
+
+ data.target.type = this.getValue();
+ }
+ },
+ {
+ type: 'text',
+ id: 'linkTargetName',
+ label: linkLang.targetFrameName,
+ 'default': '',
+ setup: function( data ) {
+ if ( data.target )
+ this.setValue( data.target.name );
+ },
+ commit: function( data ) {
+ if ( !data.target )
+ data.target = {};
+
+ data.target.name = this.getValue().replace( /\W/gi, '' );
+ }
+ }
+ ]
+ },
+ {
+ type: 'vbox',
+ width: '100%',
+ align: 'center',
+ padding: 2,
+ id: 'popupFeatures',
+ children: [
+ {
+ type: 'fieldset',
+ label: linkLang.popupFeatures,
+ children: [
+ {
+ type: 'hbox',
+ children: [
+ {
+ type: 'checkbox',
+ id: 'resizable',
+ label: linkLang.popupResizable,
+ setup: setupPopupParams,
+ commit: commitPopupParams
+ },
+ {
+ type: 'checkbox',
+ id: 'status',
+ label: linkLang.popupStatusBar,
+ setup: setupPopupParams,
+ commit: commitPopupParams
+
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ children: [
+ {
+ type: 'checkbox',
+ id: 'location',
+ label: linkLang.popupLocationBar,
+ setup: setupPopupParams,
+ commit: commitPopupParams
+
+ },
+ {
+ type: 'checkbox',
+ id: 'toolbar',
+ label: linkLang.popupToolbar,
+ setup: setupPopupParams,
+ commit: commitPopupParams
+
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ children: [
+ {
+ type: 'checkbox',
+ id: 'menubar',
+ label: linkLang.popupMenuBar,
+ setup: setupPopupParams,
+ commit: commitPopupParams
+
+ },
+ {
+ type: 'checkbox',
+ id: 'fullscreen',
+ label: linkLang.popupFullScreen,
+ setup: setupPopupParams,
+ commit: commitPopupParams
+
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ children: [
+ {
+ type: 'checkbox',
+ id: 'scrollbars',
+ label: linkLang.popupScrollBars,
+ setup: setupPopupParams,
+ commit: commitPopupParams
+
+ },
+ {
+ type: 'checkbox',
+ id: 'dependent',
+ label: linkLang.popupDependent,
+ setup: setupPopupParams,
+ commit: commitPopupParams
+
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ children: [
+ {
+ type: 'text',
+ widths: [ '50%', '50%' ],
+ labelLayout: 'horizontal',
+ label: commonLang.width,
+ id: 'width',
+ setup: setupPopupParams,
+ commit: commitPopupParams
+
+ },
+ {
+ type: 'text',
+ labelLayout: 'horizontal',
+ widths: [ '50%', '50%' ],
+ label: linkLang.popupLeft,
+ id: 'left',
+ setup: setupPopupParams,
+ commit: commitPopupParams
+
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ children: [
+ {
+ type: 'text',
+ labelLayout: 'horizontal',
+ widths: [ '50%', '50%' ],
+ label: commonLang.height,
+ id: 'height',
+ setup: setupPopupParams,
+ commit: commitPopupParams
+
+ },
+ {
+ type: 'text',
+ labelLayout: 'horizontal',
+ label: linkLang.popupTop,
+ widths: [ '50%', '50%' ],
+ id: 'top',
+ setup: setupPopupParams,
+ commit: commitPopupParams
+
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ id: 'upload',
+ label: linkLang.upload,
+ title: linkLang.upload,
+ hidden: true,
+ filebrowser: 'uploadButton',
+ elements: [
+ {
+ type: 'file',
+ id: 'upload',
+ label: commonLang.upload,
+ style: 'height:40px',
+ size: 29
+ },
+ {
+ type: 'fileButton',
+ id: 'uploadButton',
+ label: commonLang.uploadSubmit,
+ filebrowser: 'info:url',
+ 'for': [ 'upload', 'upload' ]
+ }
+ ]
+ },
+ {
+ id: 'advanced',
+ label: linkLang.advanced,
+ title: linkLang.advanced,
+ elements: [
+ {
+ type: 'vbox',
+ padding: 1,
+ children: [
+ {
+ type: 'hbox',
+ widths: [ '45%', '35%', '20%' ],
+ children: [
+ {
+ type: 'text',
+ id: 'advId',
+ requiredContent: 'a[id]',
+ label: linkLang.id,
+ setup: setupAdvParams,
+ commit: commitAdvParams
+ },
+ {
+ type: 'select',
+ id: 'advLangDir',
+ requiredContent: 'a[dir]',
+ label: linkLang.langDir,
+ 'default': '',
+ style: 'width:110px',
+ items: [
+ [ commonLang.notSet, '' ],
+ [ linkLang.langDirLTR, 'ltr' ],
+ [ linkLang.langDirRTL, 'rtl' ]
+ ],
+ setup: setupAdvParams,
+ commit: commitAdvParams
+ },
+ {
+ type: 'text',
+ id: 'advAccessKey',
+ requiredContent: 'a[accesskey]',
+ width: '80px',
+ label: linkLang.acccessKey,
+ maxLength: 1,
+ setup: setupAdvParams,
+ commit: commitAdvParams
+
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '45%', '35%', '20%' ],
+ children: [
+ {
+ type: 'text',
+ label: linkLang.name,
+ id: 'advName',
+ requiredContent: 'a[name]',
+ setup: setupAdvParams,
+ commit: commitAdvParams
+
+ },
+ {
+ type: 'text',
+ label: linkLang.langCode,
+ id: 'advLangCode',
+ requiredContent: 'a[lang]',
+ width: '110px',
+ 'default': '',
+ setup: setupAdvParams,
+ commit: commitAdvParams
+
+ },
+ {
+ type: 'text',
+ label: linkLang.tabIndex,
+ id: 'advTabIndex',
+ requiredContent: 'a[tabindex]',
+ width: '80px',
+ maxLength: 5,
+ setup: setupAdvParams,
+ commit: commitAdvParams
+
+ }
+ ]
+ }
+ ]
+ },
+ {
+ type: 'vbox',
+ padding: 1,
+ children: [
+ {
+ type: 'hbox',
+ widths: [ '45%', '55%' ],
+ children: [
+ {
+ type: 'text',
+ label: linkLang.advisoryTitle,
+ requiredContent: 'a[title]',
+ 'default': '',
+ id: 'advTitle',
+ setup: setupAdvParams,
+ commit: commitAdvParams
+
+ },
+ {
+ type: 'text',
+ label: linkLang.advisoryContentType,
+ requiredContent: 'a[type]',
+ 'default': '',
+ id: 'advContentType',
+ setup: setupAdvParams,
+ commit: commitAdvParams
+
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '45%', '55%' ],
+ children: [
+ {
+ type: 'text',
+ label: linkLang.cssClasses,
+ requiredContent: 'a(cke-xyz)', // Random text like 'xyz' will check if all are allowed.
+ 'default': '',
+ id: 'advCSSClasses',
+ setup: setupAdvParams,
+ commit: commitAdvParams
+
+ },
+ {
+ type: 'text',
+ label: linkLang.charset,
+ requiredContent: 'a[charset]',
+ 'default': '',
+ id: 'advCharset',
+ setup: setupAdvParams,
+ commit: commitAdvParams
+
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '45%', '55%' ],
+ children: [
+ {
+ type: 'text',
+ label: linkLang.rel,
+ requiredContent: 'a[rel]',
+ 'default': '',
+ id: 'advRel',
+ setup: setupAdvParams,
+ commit: commitAdvParams
+ },
+ {
+ type: 'text',
+ label: linkLang.styles,
+ requiredContent: 'a{cke-xyz}', // Random text like 'xyz' will check if all are allowed.
+ 'default': '',
+ id: 'advStyles',
+ validate: CKEDITOR.dialog.validate.inlineStyle( editor.lang.common.invalidInlineStyle ),
+ setup: setupAdvParams,
+ commit: commitAdvParams
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ onShow: function() {
+ var editor = this.getParentEditor(),
+ selection = editor.getSelection(),
+ element = null;
+
+ // Fill in all the relevant fields if there's already one link selected.
+ if ( ( element = plugin.getSelectedLink( editor ) ) && element.hasAttribute( 'href' ) )
+ selection.selectElement( element );
+ else
+ element = null;
+
+ this.setupContent( parseLink.apply( this, [ editor, element ] ) );
+ },
+ onOk: function() {
+ var attributes = {},
+ removeAttributes = [],
+ data = {},
+ me = this,
+ editor = this.getParentEditor();
+
+ this.commitContent( data );
+
+ // Compose the URL.
+ switch ( data.type || 'url' ) {
+ case 'url':
+ var protocol = ( data.url && data.url.protocol != undefined ) ? data.url.protocol : 'http://',
+ url = ( data.url && CKEDITOR.tools.trim( data.url.url ) ) || '';
+ attributes[ 'data-cke-saved-href' ] = ( url.indexOf( '/' ) === 0 ) ? url : protocol + url;
+ break;
+ case 'anchor':
+ var name = ( data.anchor && data.anchor.name ),
+ id = ( data.anchor && data.anchor.id );
+ attributes[ 'data-cke-saved-href' ] = '#' + ( name || id || '' );
+ break;
+ case 'email':
+
+ var linkHref,
+ email = data.email,
+ address = email.address;
+
+ switch ( emailProtection ) {
+ case '':
+ case 'encode':
+ {
+ var subject = encodeURIComponent( email.subject || '' ),
+ body = encodeURIComponent( email.body || '' );
+
+ // Build the e-mail parameters first.
+ var argList = [];
+ subject && argList.push( 'subject=' + subject );
+ body && argList.push( 'body=' + body );
+ argList = argList.length ? '?' + argList.join( '&' ) : '';
+
+ if ( emailProtection == 'encode' ) {
+ linkHref = [ 'javascript:void(location.href=\'mailto:\'+',
+ protectEmailAddressAsEncodedString( address ) ];
+ // parameters are optional.
+ argList && linkHref.push( '+\'', escapeSingleQuote( argList ), '\'' );
+
+ linkHref.push( ')' );
+ } else
+ linkHref = [ 'mailto:', address, argList ];
+
+ break;
+ }
+ default:
+ {
+ // Separating name and domain.
+ var nameAndDomain = address.split( '@', 2 );
+ email.name = nameAndDomain[ 0 ];
+ email.domain = nameAndDomain[ 1 ];
+
+ linkHref = [ 'javascript:', protectEmailLinkAsFunction( email ) ];
+ }
+ }
+
+ attributes[ 'data-cke-saved-href' ] = linkHref.join( '' );
+ break;
+ }
+
+ // Popups and target.
+ if ( data.target ) {
+ if ( data.target.type == 'popup' ) {
+ var onclickList = [ 'window.open(this.href, \'',
+ data.target.name || '', '\', \'' ];
+ var featureList = [ 'resizable', 'status', 'location', 'toolbar', 'menubar', 'fullscreen',
+ 'scrollbars', 'dependent' ];
+ var featureLength = featureList.length;
+ var addFeature = function( featureName ) {
+ if ( data.target[ featureName ] )
+ featureList.push( featureName + '=' + data.target[ featureName ] );
+ };
+
+ for ( var i = 0; i < featureLength; i++ )
+ featureList[ i ] = featureList[ i ] + ( data.target[ featureList[ i ] ] ? '=yes' : '=no' );
+ addFeature( 'width' );
+ addFeature( 'left' );
+ addFeature( 'height' );
+ addFeature( 'top' );
+
+ onclickList.push( featureList.join( ',' ), '\'); return false;' );
+ attributes[ 'data-cke-pa-onclick' ] = onclickList.join( '' );
+
+ // Add the "target" attribute. (#5074)
+ removeAttributes.push( 'target' );
+ } else {
+ if ( data.target.type != 'notSet' && data.target.name )
+ attributes.target = data.target.name;
+ else
+ removeAttributes.push( 'target' );
+
+ removeAttributes.push( 'data-cke-pa-onclick', 'onclick' );
+ }
+ }
+
+ // Advanced attributes.
+ if ( data.adv ) {
+ var advAttr = function( inputName, attrName ) {
+ var value = data.adv[ inputName ];
+ if ( value )
+ attributes[ attrName ] = value;
+ else
+ removeAttributes.push( attrName );
+ };
+
+ advAttr( 'advId', 'id' );
+ advAttr( 'advLangDir', 'dir' );
+ advAttr( 'advAccessKey', 'accessKey' );
+
+ if ( data.adv[ 'advName' ] )
+ attributes[ 'name' ] = attributes[ 'data-cke-saved-name' ] = data.adv[ 'advName' ];
+ else
+ removeAttributes = removeAttributes.concat( [ 'data-cke-saved-name', 'name' ] );
+
+ advAttr( 'advLangCode', 'lang' );
+ advAttr( 'advTabIndex', 'tabindex' );
+ advAttr( 'advTitle', 'title' );
+ advAttr( 'advContentType', 'type' );
+ advAttr( 'advCSSClasses', 'class' );
+ advAttr( 'advCharset', 'charset' );
+ advAttr( 'advStyles', 'style' );
+ advAttr( 'advRel', 'rel' );
+ }
+
+
+ var selection = editor.getSelection();
+
+ // Browser need the "href" fro copy/paste link to work. (#6641)
+ attributes.href = attributes[ 'data-cke-saved-href' ];
+
+ if ( !this._.selectedElement ) {
+ var range = selection.getRanges( 1 )[ 0 ];
+
+ // Use link URL as text with a collapsed cursor.
+ if ( range.collapsed ) {
+ // Short mailto link text view (#5736).
+ var text = new CKEDITOR.dom.text( data.type == 'email' ? data.email.address : attributes[ 'data-cke-saved-href' ], editor.document );
+ range.insertNode( text );
+ range.selectNodeContents( text );
+ }
+
+ // Apply style.
+ var style = new CKEDITOR.style({ element: 'a', attributes: attributes } );
+ style.type = CKEDITOR.STYLE_INLINE; // need to override... dunno why.
+ style.applyToRange( range );
+ range.select();
+ } else {
+ // We're only editing an existing link, so just overwrite the attributes.
+ var element = this._.selectedElement,
+ href = element.data( 'cke-saved-href' ),
+ textView = element.getHtml();
+
+ element.setAttributes( attributes );
+ element.removeAttributes( removeAttributes );
+
+ if ( data.adv && data.adv.advName && CKEDITOR.plugins.link.synAnchorSelector )
+ element.addClass( element.getChildCount() ? 'cke_anchor' : 'cke_anchor_empty' );
+
+ // Update text view when user changes protocol (#4612).
+ if ( href == textView || data.type == 'email' && textView.indexOf( '@' ) != -1 ) {
+ // Short mailto link text view (#5736).
+ element.setHtml( data.type == 'email' ? data.email.address : attributes[ 'data-cke-saved-href' ] );
+ }
+
+ selection.selectElement( element );
+ delete this._.selectedElement;
+ }
+ },
+ onLoad: function() {
+ if ( !editor.config.linkShowAdvancedTab )
+ this.hidePage( 'advanced' ); //Hide Advanded tab.
+
+ if ( !editor.config.linkShowTargetTab )
+ this.hidePage( 'target' ); //Hide Target tab.
+ },
+ // Inital focus on 'url' field if link is of type URL.
+ onFocus: function() {
+ var linkType = this.getContentElement( 'info', 'linkType' ),
+ urlField;
+ if ( linkType && linkType.getValue() == 'url' ) {
+ urlField = this.getContentElement( 'info', 'url' );
+ urlField.select();
+ }
+ }
+ };
+});
+
+/**
+ * The e-mail address anti-spam protection option. The protection will be
+ * applied when creating or modifying e-mail links through the editor interface.
+ *
+ * Two methods of protection can be choosed:
+ *
+ * 1. The e-mail parts (name, domain and any other query string) are
+ * assembled into a function call pattern. Such function must be
+ * provided by the developer in the pages that will use the contents.
+ * 2. Only the e-mail address is obfuscated into a special string that
+ * has no meaning for humans or spam bots, but which is properly
+ * rendered and accepted by the browser.
+ *
+ * Both approaches require JavaScript to be enabled.
+ *
+ * // href="mailto:tester@ckeditor.com?subject=subject&body=body"
+ * config.emailProtection = '';
+ *
+ * // href="<a href=\"javascript:void(location.href=\'mailto:\'+String.fromCharCode(116,101,115,116,101,114,64,99,107,101,100,105,116,111,114,46,99,111,109)+\'?subject=subject&body=body\')\">e-mail</a>"
+ * config.emailProtection = 'encode';
+ *
+ * // href="javascript:mt('tester','ckeditor.com','subject','body')"
+ * config.emailProtection = 'mt(NAME,DOMAIN,SUBJECT,BODY)';
+ *
+ * @since 3.1
+ * @cfg {String} [emailProtection='' (empty string = disabled)]
+ * @member CKEDITOR.config
+ */
diff --git a/plugins/liststyle/dialogs/liststyle.js b/plugins/liststyle/dialogs/liststyle.js
index 5bf1c7f..5cefb3f 100644
--- a/plugins/liststyle/dialogs/liststyle.js
+++ b/plugins/liststyle/dialogs/liststyle.js
@@ -1,7 +1,199 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-(function(){function a(e,f){var g;try{g=e.getSelection().getRanges()[0];}catch(h){return null;}g.shrink(CKEDITOR.SHRINK_TEXT);return g.getCommonAncestor().getAscendant(f,1);};var b=function(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.is('li');},c={a:'lower-alpha',A:'upper-alpha',i:'lower-roman',I:'upper-roman',1:'decimal',disc:'disc',circle:'circle',square:'square'};function d(e,f){var g=e.lang.list;if(f=='bulletedListStyle')return{title:g.bulletedTitle,minWidth:300,minHeight:50,contents:[{id:'info',accessKey:'I',elements:[{type:'select',label:g.type,id:'type',align:'center',style:'width:150px',items:[[g.notset,''],[g.circle,'circle'],[g.disc,'disc'],[g.square,'square']],setup:function(i){var j=i.getStyle('list-style-type')||c[i.getAttribute('type')]||i.getAttribute('type')||'';this.setValue(j);},commit:function(i){var j=this.getValue();if(j)i.setStyle('list-style-type',j);else i.removeStyle('list-style-type');}}]}],onShow:function(){var i=this.getParentEditor(),j=a(i,'ul');j&&this.setupContent(j);},onOk:function(){var i=this.getParentEditor(),j=a(i,'ul');j&&this.commitContent(j);}};else if(f=='numberedListStyle'){var h=[[g.notset,''],[g.lowerRoman,'lower-roman'],[g.upperRoman,'upper-roman'],[g.lowerAlpha,'lower-alpha'],[g.upperAlpha,'upper-alpha'],[g.decimal,'decimal']];if(!CKEDITOR.env.ie||CKEDITOR.env.version>7)h.concat([[g.armenian,'armenian'],[g.decimalLeadingZero,'decimal-leading-zero'],[g.georgian,'georgian'],[g.lowerGreek,'lower-greek']]);return{title:g.numberedTitle,minWidth:300,minHeight:50,contents:[{id:'info',accessKey:'I',elements:[{type:'hbox',widths:['25%','75%'],children:[{label:g.start,type:'text',id:'start',validate:CKEDITOR.dialog.validate.integer(g.validateStartNumber),setup:function(i){var j=i.getFirst(b).getAttribute('value')||i.getAttribute('start')||1;j&&this.setValue(j);},commit:function(i){var j=i.getFirst(b),k=j.getAttribute('value')||i.getAttribute('start')||1;i.getFirst(b).removeAttribute('value');var l=parseInt(this.getValue(),10);if(isNaN(l))i.removeAttribute('start');else i.setAttribute('start',l);var m=j,n=k,o=isNaN(l)?1:l;while((m=m.getNext(b))&&n++){if(m.getAttribute('value')==n)m.setAttribute('value',o+n-k);}}},{type:'select',label:g.type,id:'type',style:'width: 100%;',items:h,setup:function(i){var j=i.getStyle('list-style-type')||c[i.getAttribute('type')]||i.getAttribute('type')||'';this.setValue(j);},commit:function(i){var j=this.getValue();if(j)i.setStyle('list-style-type',j);else i.removeStyle('list-style-type');}}]}]}],onShow:function(){var i=this.getParentEditor(),j=a(i,'ol');
-j&&this.setupContent(j);},onOk:function(){var i=this.getParentEditor(),j=a(i,'ol');j&&this.commitContent(j);}};}};CKEDITOR.dialog.add('numberedListStyle',function(e){return d(e,'numberedListStyle');});CKEDITOR.dialog.add('bulletedListStyle',function(e){return d(e,'bulletedListStyle');});})();
+(function() {
+ function getListElement( editor, listTag ) {
+ var range;
+ try {
+ range = editor.getSelection().getRanges()[ 0 ];
+ } catch ( e ) {
+ return null;
+ }
+
+ range.shrink( CKEDITOR.SHRINK_TEXT );
+ return editor.elementPath( range.getCommonAncestor() ).contains( listTag, 1 );
+ }
+
+ var listItem = function( node ) {
+ return node.type == CKEDITOR.NODE_ELEMENT && node.is( 'li' );
+ };
+
+ var mapListStyle = {
+ 'a': 'lower-alpha',
+ 'A': 'upper-alpha',
+ 'i': 'lower-roman',
+ 'I': 'upper-roman',
+ '1': 'decimal',
+ 'disc': 'disc',
+ 'circle': 'circle',
+ 'square': 'square'
+ };
+
+ function listStyle( editor, startupPage ) {
+ var lang = editor.lang.liststyle;
+ if ( startupPage == 'bulletedListStyle' ) {
+ return {
+ title: lang.bulletedTitle,
+ minWidth: 300,
+ minHeight: 50,
+ contents: [
+ {
+ id: 'info',
+ accessKey: 'I',
+ elements: [
+ {
+ type: 'select',
+ label: lang.type,
+ id: 'type',
+ align: 'center',
+ style: 'width:150px',
+ items: [
+ [ lang.notset, '' ],
+ [ lang.circle, 'circle' ],
+ [ lang.disc, 'disc' ],
+ [ lang.square, 'square' ]
+ ],
+ setup: function( element ) {
+ var value = element.getStyle( 'list-style-type' ) || mapListStyle[ element.getAttribute( 'type' ) ] || element.getAttribute( 'type' ) || '';
+
+ this.setValue( value );
+ },
+ commit: function( element ) {
+ var value = this.getValue();
+ if ( value )
+ element.setStyle( 'list-style-type', value );
+ else
+ element.removeStyle( 'list-style-type' );
+ }
+ }
+ ]
+ }
+ ],
+ onShow: function() {
+ var editor = this.getParentEditor(),
+ element = getListElement( editor, 'ul' );
+
+ element && this.setupContent( element );
+ },
+ onOk: function() {
+ var editor = this.getParentEditor(),
+ element = getListElement( editor, 'ul' );
+
+ element && this.commitContent( element );
+ }
+ };
+ } else if ( startupPage == 'numberedListStyle' ) {
+
+ var listStyleOptions = [
+ [ lang.notset, '' ],
+ [ lang.lowerRoman, 'lower-roman' ],
+ [ lang.upperRoman, 'upper-roman' ],
+ [ lang.lowerAlpha, 'lower-alpha' ],
+ [ lang.upperAlpha, 'upper-alpha' ],
+ [ lang.decimal, 'decimal' ]
+ ];
+
+ if ( !CKEDITOR.env.ie || CKEDITOR.env.version > 7 ) {
+ listStyleOptions.concat( [
+ [ lang.armenian, 'armenian' ],
+ [ lang.decimalLeadingZero, 'decimal-leading-zero' ],
+ [ lang.georgian, 'georgian' ],
+ [ lang.lowerGreek, 'lower-greek' ]
+ ] );
+ }
+
+ return {
+ title: lang.numberedTitle,
+ minWidth: 300,
+ minHeight: 50,
+ contents: [
+ {
+ id: 'info',
+ accessKey: 'I',
+ elements: [
+ {
+ type: 'hbox',
+ widths: [ '25%', '75%' ],
+ children: [
+ {
+ label: lang.start,
+ type: 'text',
+ id: 'start',
+ validate: CKEDITOR.dialog.validate.integer( lang.validateStartNumber ),
+ setup: function( element ) {
+ // List item start number dominates.
+ var value = element.getFirst( listItem ).getAttribute( 'value' ) || element.getAttribute( 'start' ) || 1;
+ value && this.setValue( value );
+ },
+ commit: function( element ) {
+ var firstItem = element.getFirst( listItem );
+ var oldStart = firstItem.getAttribute( 'value' ) || element.getAttribute( 'start' ) || 1;
+
+ // Force start number on list root.
+ element.getFirst( listItem ).removeAttribute( 'value' );
+ var val = parseInt( this.getValue(), 10 );
+ if ( isNaN( val ) )
+ element.removeAttribute( 'start' );
+ else
+ element.setAttribute( 'start', val );
+
+ // Update consequent list item numbering.
+ var nextItem = firstItem,
+ conseq = oldStart,
+ startNumber = isNaN( val ) ? 1 : val;
+ while ( ( nextItem = nextItem.getNext( listItem ) ) && conseq++ ) {
+ if ( nextItem.getAttribute( 'value' ) == conseq )
+ nextItem.setAttribute( 'value', startNumber + conseq - oldStart );
+ }
+ }
+ },
+ {
+ type: 'select',
+ label: lang.type,
+ id: 'type',
+ style: 'width: 100%;',
+ items: listStyleOptions,
+ setup: function( element ) {
+ var value = element.getStyle( 'list-style-type' ) || mapListStyle[ element.getAttribute( 'type' ) ] || element.getAttribute( 'type' ) || '';
+
+ this.setValue( value );
+ },
+ commit: function( element ) {
+ var value = this.getValue();
+ if ( value )
+ element.setStyle( 'list-style-type', value );
+ else
+ element.removeStyle( 'list-style-type' );
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ onShow: function() {
+ var editor = this.getParentEditor(),
+ element = getListElement( editor, 'ol' );
+
+ element && this.setupContent( element );
+ },
+ onOk: function() {
+ var editor = this.getParentEditor(),
+ element = getListElement( editor, 'ol' );
+
+ element && this.commitContent( element );
+ }
+ };
+ }
+ }
+
+ CKEDITOR.dialog.add( 'numberedListStyle', function( editor ) {
+ return listStyle( editor, 'numberedListStyle' );
+ });
+
+ CKEDITOR.dialog.add( 'bulletedListStyle', function( editor ) {
+ return listStyle( editor, 'bulletedListStyle' );
+ });
+})();
diff --git a/plugins/pastefromword/filter/default.js b/plugins/pastefromword/filter/default.js
index e424034..61b7506 100644
--- a/plugins/pastefromword/filter/default.js
+++ b/plugins/pastefromword/filter/default.js
@@ -1,11 +1,1211 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-(function(){var a=CKEDITOR.htmlParser.fragment.prototype,b=CKEDITOR.htmlParser.element.prototype;a.onlyChild=b.onlyChild=function(){var u=this.children,v=u.length,w=v==1&&u[0];return w||null;};b.removeAnyChildWithName=function(u){var v=this.children,w=[],x;for(var y=0;y<v.length;y++){x=v[y];if(!x.name)continue;if(x.name==u){w.push(x);v.splice(y--,1);}w=w.concat(x.removeAnyChildWithName(u));}return w;};b.getAncestor=function(u){var v=this.parent;while(v&&!(v.name&&v.name.match(u)))v=v.parent;return v;};a.firstChild=b.firstChild=function(u){var v;for(var w=0;w<this.children.length;w++){v=this.children[w];if(u(v))return v;else if(v.name){v=v.firstChild(u);if(v)return v;}}return null;};b.addStyle=function(u,v,w){var A=this;var x,y='';if(typeof v=='string')y+=u+':'+v+';';else{if(typeof u=='object')for(var z in u){if(u.hasOwnProperty(z))y+=z+':'+u[z]+';';}else y+=u;w=v;}if(!A.attributes)A.attributes={};x=A.attributes.style||'';x=(w?[y,x]:[x,y]).join(';');A.attributes.style=x.replace(/^;|;(?=;)/,'');};CKEDITOR.dtd.parentOf=function(u){var v={};for(var w in this){if(w.indexOf('$')==-1&&this[w][u])v[w]=1;}return v;};function c(u){var v=u.children,w,x,y=u.children.length,z,A,B=/list-style-type:(.*?)(?:;|$)/,C=CKEDITOR.plugins.pastefromword.filters.stylesFilter;x=u.attributes;if(B.exec(x.style))return;for(var D=0;D<y;D++){w=v[D];if(w.attributes.value&&Number(w.attributes.value)==D+1)delete w.attributes.value;z=B.exec(w.attributes.style);if(z)if(z[1]==A||!A)A=z[1];else{A=null;break;}}if(A){for(D=0;D<y;D++){x=v[D].attributes;x.style&&(x.style=C([['list-style-type']])(x.style)||'');}u.addStyle('list-style-type',A);}};var d=/^([.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz){1}?/i,e=/^(?:\b0[^\s]*\s*){1,4}$/,f='^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$',g=new RegExp(f),h=new RegExp(f.toUpperCase()),i={decimal:/\d+/,'lower-roman':g,'upper-roman':h,'lower-alpha':/^[a-z]+$/,'upper-alpha':/^[A-Z]+$/},j={disc:/[l\u00B7\u2002]/,circle:/[\u006F\u00D8]/,square:/[\u006E\u25C6]/},k={ol:i,ul:j},l=[[1000,'M'],[900,'CM'],[500,'D'],[400,'CD'],[100,'C'],[90,'XC'],[50,'L'],[40,'XL'],[10,'X'],[9,'IX'],[5,'V'],[4,'IV'],[1,'I']],m='ABCDEFGHIJKLMNOPQRSTUVWXYZ';function n(u){u=u.toUpperCase();var v=l.length,w=0;for(var x=0;x<v;++x)for(var y=l[x],z=y[1].length;u.substr(0,z)==y[1];u=u.substr(z))w+=y[0];return w;};function o(u){u=u.toUpperCase();var v=m.length,w=1;for(var x=1;u.length>0;x*=v){w+=m.indexOf(u.charAt(u.length-1))*x;u=u.substr(0,u.length-1);}return w;
-};var p=0,q=null,r,s=CKEDITOR.plugins.pastefromword={utils:{createListBulletMarker:function(u,v){var w=new CKEDITOR.htmlParser.element('cke:listbullet');w.attributes={'cke:listsymbol':u[0]};w.add(new CKEDITOR.htmlParser.text(v));return w;},isListBulletIndicator:function(u){var v=u.attributes&&u.attributes.style;if(/mso-list\s*:\s*Ignore/i.test(v))return true;},isContainingOnlySpaces:function(u){var v;return(v=u.onlyChild())&&/^(:?\s|&nbsp;)+$/.test(v.value);},resolveList:function(u){var v=u.attributes,w;if((w=u.removeAnyChildWithName('cke:listbullet'))&&w.length&&(w=w[0])){u.name='cke:li';if(v.style)v.style=s.filters.stylesFilter([['text-indent'],['line-height'],[/^margin(:?-left)?$/,null,function(x){var y=x.split(' ');x=CKEDITOR.tools.convertToPx(y[3]||y[1]||y[0]);if(!p&&q!==null&&x>q)p=x-q;q=x;v['cke:indent']=p&&Math.ceil(x/p)+1||1;}],[/^mso-list$/,null,function(x){x=x.split(' ');var y=Number(x[0].match(/\d+/)),z=Number(x[1].match(/\d+/));if(z==1){y!==r&&(v['cke:reset']=1);r=y;}v['cke:indent']=z;}]])(v.style,u)||'';if(!v['cke:indent']){q=0;v['cke:indent']=1;}CKEDITOR.tools.extend(v,w.attributes);return true;}else r=q=p=null;return false;},getStyleComponents:(function(){var u=CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;"></div>',CKEDITOR.document);CKEDITOR.document.getBody().append(u);return function(v,w,x){u.setStyle(v,w);var y={},z=x.length;for(var A=0;A<z;A++)y[x[A]]=u.getStyle(x[A]);return y;};})(),listDtdParents:CKEDITOR.dtd.parentOf('ol')},filters:{flattenList:function(u,v){v=typeof v=='number'?v:1;var w=u.attributes,x;switch(w.type){case 'a':x='lower-alpha';break;case '1':x='decimal';break;}var y=u.children,z;for(var A=0;A<y.length;A++){z=y[A];if(z.name in CKEDITOR.dtd.$listItem){var B=z.attributes,C=z.children,D=C.length,E=C[D-1];if(E.name in CKEDITOR.dtd.$list){u.add(E,A+1);if(!--C.length)y.splice(A--,1);}z.name='cke:li';w.start&&!A&&(B.value=w.start);s.filters.stylesFilter([['tab-stops',null,function(H){var I=H.split(' ')[1].match(d);I&&(q=CKEDITOR.tools.convertToPx(I[0]));}],v==1?['mso-list',null,function(H){H=H.split(' ');var I=Number(H[0].match(/\d+/));I!==r&&(B['cke:reset']=1);r=I;}]:null])(B.style);B['cke:indent']=v;B['cke:listtype']=u.name;B['cke:list-style-type']=x;}else if(z.name in CKEDITOR.dtd.$list){arguments.callee.apply(this,[z,v+1]);y=y.slice(0,A).concat(z.children).concat(y.slice(A+1));u.children=[];for(var F=0,G=y.length;F<G;F++)u.add(y[F]);}}delete u.name;w['cke:list']=1;},assembleList:function(u){var v=u.children,w,x,y,z,A,B,C,D=[],E,F,G,H,I,J;
-for(var K=0;K<v.length;K++){w=v[K];if('cke:li'==w.name){w.name='li';x=w;y=x.attributes;G=y['cke:listsymbol'];G=G&&G.match(/^(?:[(]?)([^\s]+?)([.)]?)$/);H=I=J=null;if(y['cke:ignored']){v.splice(K--,1);continue;}y['cke:reset']&&(C=A=B=null);z=Number(y['cke:indent']);if(z!=A)F=E=null;if(!G){H=y['cke:listtype']||'ol';I=y['cke:list-style-type'];}else{if(F&&k[F][E].test(G[1])){H=F;I=E;}else for(var L in k)for(var M in k[L]){if(k[L][M].test(G[1]))if(L=='ol'&&/alpha|roman/.test(M)){var N=/roman/.test(M)?n(G[1]):o(G[1]);if(!J||N<J){J=N;H=L;I=M;}}else{H=L;I=M;break;}}!H&&(H=G[2]?'ol':'ul');}F=H;E=I||(H=='ol'?'decimal':'disc');if(I&&I!=(H=='ol'?'decimal':'disc'))x.addStyle('list-style-type',I);if(H=='ol'&&G){switch(I){case 'decimal':J=Number(G[1]);break;case 'lower-roman':case 'upper-roman':J=n(G[1]);break;case 'lower-alpha':case 'upper-alpha':J=o(G[1]);break;}x.attributes.value=J;}if(!C){D.push(C=new CKEDITOR.htmlParser.element(H));C.add(x);v[K]=C;}else{if(z>A){D.push(C=new CKEDITOR.htmlParser.element(H));C.add(x);B.add(C);}else if(z<A){var O=A-z,P;while(O--&&(P=C.parent))C=P.parent;C.add(x);}else C.add(x);v.splice(K--,1);}B=x;A=z;}else if(C)C=A=B=null;}for(K=0;K<D.length;K++)c(D[K]);C=A=B=r=q=p=null;},falsyFilter:function(u){return false;},stylesFilter:function(u,v){return function(w,x){var y=[];(w||'').replace(/&quot;/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(A,B,C){B=B.toLowerCase();B=='font-family'&&(C=C.replace(/["']/g,''));var D,E,F,G;for(var H=0;H<u.length;H++){if(u[H]){D=u[H][0];E=u[H][1];F=u[H][2];G=u[H][3];if(B.match(D)&&(!E||C.match(E))){B=G||B;v&&(F=F||C);if(typeof F=='function')F=F(C,x,B);if(F&&F.push)B=F[0],F=F[1];if(typeof F=='string')y.push([B,F]);return;}}}!v&&y.push([B,C]);});for(var z=0;z<y.length;z++)y[z]=y[z].join(':');return y.length?y.join(';')+';':false;};},elementMigrateFilter:function(u,v){return function(w){var x=v?new CKEDITOR.style(u,v)._.definition:u;w.name=x.element;CKEDITOR.tools.extend(w.attributes,CKEDITOR.tools.clone(x.attributes));w.addStyle(CKEDITOR.style.getStyleText(x));};},styleMigrateFilter:function(u,v){var w=this.elementMigrateFilter;return function(x,y){var z=new CKEDITOR.htmlParser.element(null),A={};A[v]=x;w(u,A)(z);z.children=y.children;y.children=[z];};},bogusAttrFilter:function(u,v){if(v.name.indexOf('cke:')==-1)return false;},applyStyleFilter:null},getRules:function(u){var v=CKEDITOR.dtd,w=CKEDITOR.tools.extend({},v.$block,v.$listItem,v.$tableContent),x=u.config,y=this.filters,z=y.falsyFilter,A=y.stylesFilter,B=y.elementMigrateFilter,C=CKEDITOR.tools.bind(this.filters.styleMigrateFilter,this.filters),D=this.utils.createListBulletMarker,E=y.flattenList,F=y.assembleList,G=this.utils.isListBulletIndicator,H=this.utils.isContainingOnlySpaces,I=this.utils.resolveList,J=function(O){O=CKEDITOR.tools.convertToPx(O);
-return isNaN(O)?O:O+'px';},K=this.utils.getStyleComponents,L=this.utils.listDtdParents,M=x.pasteFromWordRemoveFontStyles!==false,N=x.pasteFromWordRemoveStyles!==false;return{elementNames:[[/meta|link|script/,'']],root:function(O){O.filterChildren();F(O);},elements:{'^':function(O){var P;if(CKEDITOR.env.gecko&&(P=y.applyStyleFilter))P(O);},$:function(O){var P=O.name||'',Q=O.attributes;if(P in w&&Q.style)Q.style=A([[/^(:?width|height)$/,null,J]])(Q.style)||'';if(P.match(/h\d/)){O.filterChildren();if(I(O))return;B(x['format_'+P])(O);}else if(P in v.$inline){O.filterChildren();if(H(O))delete O.name;}else if(P.indexOf(':')!=-1&&P.indexOf('cke')==-1){O.filterChildren();if(P=='v:imagedata'){var R=O.attributes['o:href'];if(R)O.attributes.src=R;O.name='img';return;}delete O.name;}if(P in L){O.filterChildren();F(O);}},style:function(O){if(CKEDITOR.env.gecko){var P=O.onlyChild().value.match(/\/\* Style Definitions \*\/([\s\S]*?)\/\*/),Q=P&&P[1],R={};if(Q){Q.replace(/[\n\r]/g,'').replace(/(.+?)\{(.+?)\}/g,function(S,T,U){T=T.split(',');var V=T.length,W;for(var X=0;X<V;X++)CKEDITOR.tools.trim(T[X]).replace(/^(\w+)(\.[\w-]+)?$/g,function(Y,Z,aa){Z=Z||'*';aa=aa.substring(1,aa.length);if(aa.match(/MsoNormal/))return;if(!R[Z])R[Z]={};if(aa)R[Z][aa]=U;else R[Z]=U;});});y.applyStyleFilter=function(S){var T=R['*']?'*':S.name,U=S.attributes&&S.attributes['class'],V;if(T in R){V=R[T];if(typeof V=='object')V=V[U];V&&S.addStyle(V,true);}};}}return false;},p:function(O){if(/MsoListParagraph/.exec(O.attributes['class'])){var P=O.firstChild(function(S){return S.type==CKEDITOR.NODE_TEXT&&!H(S.parent);}),Q=P&&P.parent,R=Q&&Q.attributes;R&&!R.style&&(R.style='mso-list: Ignore;');}O.filterChildren();if(I(O))return;if(x.enterMode==CKEDITOR.ENTER_BR){delete O.name;O.add(new CKEDITOR.htmlParser.element('br'));}else B(x['format_'+(x.enterMode==CKEDITOR.ENTER_P?'p':'div')])(O);},div:function(O){var P=O.onlyChild();if(P&&P.name=='table'){var Q=O.attributes;P.attributes=CKEDITOR.tools.extend(P.attributes,Q);Q.style&&P.addStyle(Q.style);var R=new CKEDITOR.htmlParser.element('div');R.addStyle('clear','both');O.add(R);delete O.name;}},td:function(O){if(O.getAncestor('thead'))O.name='th';},ol:E,ul:E,dl:E,font:function(O){if(G(O.parent)){delete O.name;return;}O.filterChildren();var P=O.attributes,Q=P.style,R=O.parent;if('font'==R.name){CKEDITOR.tools.extend(R.attributes,O.attributes);Q&&R.addStyle(Q);delete O.name;}else{Q=Q||'';if(P.color){P.color!='#000000'&&(Q+='color:'+P.color+';');delete P.color;
-}if(P.face){Q+='font-family:'+P.face+';';delete P.face;}if(P.size){Q+='font-size:'+(P.size>3?'large':P.size<3?'small':'medium')+';';delete P.size;}O.name='span';O.addStyle(Q);}},span:function(O){if(G(O.parent))return false;O.filterChildren();if(H(O)){delete O.name;return null;}if(G(O)){var P=O.firstChild(function(Y){return Y.value||Y.name=='img';}),Q=P&&(P.value||'l.'),R=Q&&Q.match(/^(?:[(]?)([^\s]+?)([.)]?)$/);if(R){var S=D(R,Q),T=O.getAncestor('span');if(T&&/ mso-hide:\s*all|display:\s*none /.test(T.attributes.style))S.attributes['cke:ignored']=1;return S;}}var U=O.children,V=O.attributes,W=V&&V.style,X=U&&U[0];if(W)V.style=A([['line-height'],[/^font-family$/,null,!M?C(x.font_style,'family'):null],[/^font-size$/,null,!M?C(x.fontSize_style,'size'):null],[/^color$/,null,!M?C(x.colorButton_foreStyle,'color'):null],[/^background-color$/,null,!M?C(x.colorButton_backStyle,'color'):null]])(W,O)||'';return null;},b:B(x.coreStyles_bold),i:B(x.coreStyles_italic),u:B(x.coreStyles_underline),s:B(x.coreStyles_strike),sup:B(x.coreStyles_superscript),sub:B(x.coreStyles_subscript),a:function(O){var P=O.attributes;if(P&&!P.href&&P.name)delete O.name;else if(CKEDITOR.env.webkit&&P.href&&P.href.match(/file:\/\/\/[\S]+#/i))P.href=P.href.replace(/file:\/\/\/[^#]+/i,'');},'cke:listbullet':function(O){if(O.getAncestor(/h\d/)&&!x.pasteFromWordNumberedHeadingToList)delete O.name;}},attributeNames:[[/^onmouse(:?out|over)/,''],[/^onload$/,''],[/(?:v|o):\w+/,''],[/^lang/,'']],attributes:{style:A(N?[[/^list-style-type$/,null],[/^margin$|^margin-(?!bottom|top)/,null,function(O,P,Q){if(P.name in {p:1,div:1}){var R=x.contentsLangDirection=='ltr'?'margin-left':'margin-right';if(Q=='margin')O=K(Q,O,[R])[R];else if(Q!=R)return null;if(O&&!e.test(O))return[R,O];}return null;}],[/^clear$/],[/^border.*|margin.*|vertical-align|float$/,null,function(O,P){if(P.name=='img')return O;}],[/^width|height$/,null,function(O,P){if(P.name in {table:1,td:1,th:1,img:1})return O;}]]:[[/^mso-/],[/-color$/,null,function(O){if(O=='transparent')return false;if(CKEDITOR.env.gecko)return O.replace(/-moz-use-text-color/g,'transparent');}],[/^margin$/,e],['text-indent','0cm'],['page-break-before'],['tab-stops'],['display','none'],M?[/font-?/]:null],N),width:function(O,P){if(P.name in v.$tableContent)return false;},border:function(O,P){if(P.name in v.$tableContent)return false;},'class':z,bgcolor:z,valign:N?z:function(O,P){P.addStyle('vertical-align',O);return false;}},comment:!CKEDITOR.env.ie?function(O,P){var Q=O.match(/<img.*?>/),R=O.match(/^\[if !supportLists\]([\s\S]*?)\[endif\]$/);
-if(R){var S=R[1]||Q&&'l.',T=S&&S.match(/>(?:[(]?)([^\s]+?)([.)]?)</);return D(T,S);}if(CKEDITOR.env.gecko&&Q){var U=CKEDITOR.htmlParser.fragment.fromHtml(Q[0]).children[0],V=P.previous,W=V&&V.value.match(/<v:imagedata[^>]*o:href=['"](.*?)['"]/),X=W&&W[1];X&&(U.attributes.src=X);return U;}return false;}:z};}},t=function(){this.dataFilter=new CKEDITOR.htmlParser.filter();};t.prototype={toHtml:function(u){var v=CKEDITOR.htmlParser.fragment.fromHtml(u,false),w=new CKEDITOR.htmlParser.basicWriter();v.writeHtml(w,this.dataFilter);return w.getHtml(true);}};CKEDITOR.cleanWord=function(u,v){if(CKEDITOR.env.gecko)u=u.replace(/(<!--\[if[^<]*?\])-->([\S\s]*?)<!--(\[endif\]-->)/gi,'$1$2$3');var w=new t(),x=w.dataFilter;x.addRules(CKEDITOR.plugins.pastefromword.getRules(v));v.fire('beforeCleanWord',{filter:x});try{u=w.toHtml(u,false);}catch(y){alert(v.lang.pastefromword.error);}u=u.replace(/cke:.*?".*?"/g,'');u=u.replace(/style=""/g,'');u=u.replace(/<span>/g,'');return u;};})();
+(function() {
+ var fragmentPrototype = CKEDITOR.htmlParser.fragment.prototype,
+ elementPrototype = CKEDITOR.htmlParser.element.prototype;
+
+ fragmentPrototype.onlyChild = elementPrototype.onlyChild = function() {
+ var children = this.children,
+ count = children.length,
+ firstChild = ( count == 1 ) && children[ 0 ];
+ return firstChild || null;
+ };
+
+ elementPrototype.removeAnyChildWithName = function( tagName ) {
+ var children = this.children,
+ childs = [],
+ child;
+
+ for ( var i = 0; i < children.length; i++ ) {
+ child = children[ i ];
+ if ( !child.name )
+ continue;
+
+ if ( child.name == tagName ) {
+ childs.push( child );
+ children.splice( i--, 1 );
+ }
+ childs = childs.concat( child.removeAnyChildWithName( tagName ) );
+ }
+ return childs;
+ };
+
+ elementPrototype.getAncestor = function( tagNameRegex ) {
+ var parent = this.parent;
+ while ( parent && !( parent.name && parent.name.match( tagNameRegex ) ) )
+ parent = parent.parent;
+ return parent;
+ };
+
+ fragmentPrototype.firstChild = elementPrototype.firstChild = function( evaluator ) {
+ var child;
+
+ for ( var i = 0; i < this.children.length; i++ ) {
+ child = this.children[ i ];
+ if ( evaluator( child ) )
+ return child;
+ else if ( child.name ) {
+ child = child.firstChild( evaluator );
+ if ( child )
+ return child;
+ }
+ }
+
+ return null;
+ };
+
+ // Adding a (set) of styles to the element's 'style' attributes.
+ elementPrototype.addStyle = function( name, value, isPrepend ) {
+ var styleText,
+ addingStyleText = '';
+ // name/value pair.
+ if ( typeof value == 'string' )
+ addingStyleText += name + ':' + value + ';';
+ else {
+ // style literal.
+ if ( typeof name == 'object' ) {
+ for ( var style in name ) {
+ if ( name.hasOwnProperty( style ) )
+ addingStyleText += style + ':' + name[ style ] + ';';
+ }
+ }
+ // raw style text form.
+ else
+ addingStyleText += name;
+
+ isPrepend = value;
+ }
+
+ if ( !this.attributes )
+ this.attributes = {};
+
+ styleText = this.attributes.style || '';
+
+ styleText = ( isPrepend ? [ addingStyleText, styleText ] : [ styleText, addingStyleText ] ).join( ';' );
+
+ this.attributes.style = styleText.replace( /^;|;(?=;)/, '' );
+ };
+
+ // Retrieve a style property value of the element.
+ elementPrototype.getStyle = function( name ) {
+ var styles = this.attributes.style;
+ if ( styles ) {
+ styles = CKEDITOR.tools.parseCssText( styles, 1 );
+ return styles[ name ];
+ }
+ };
+
+ /**
+ * Return the DTD-valid parent tag names of the specified one.
+ *
+ * @member CKEDITOR.dtd
+ * @param {String} tagName
+ * @returns {Object}
+ */
+ CKEDITOR.dtd.parentOf = function( tagName ) {
+ var result = {};
+ for ( var tag in this ) {
+ if ( tag.indexOf( '$' ) == -1 && this[ tag ][ tagName ] )
+ result[ tag ] = 1;
+ }
+ return result;
+ };
+
+ // 1. move consistent list item styles up to list root.
+ // 2. clear out unnecessary list item numbering.
+ function postProcessList( list ) {
+ var children = list.children,
+ child, attrs,
+ count = list.children.length,
+ match, mergeStyle,
+ styleTypeRegexp = /list-style-type:(.*?)(?:;|$)/,
+ stylesFilter = CKEDITOR.plugins.pastefromword.filters.stylesFilter;
+
+ attrs = list.attributes;
+ if ( styleTypeRegexp.exec( attrs.style ) )
+ return;
+
+ for ( var i = 0; i < count; i++ ) {
+ child = children[ i ];
+
+ if ( child.attributes.value && Number( child.attributes.value ) == i + 1 )
+ delete child.attributes.value;
+
+ match = styleTypeRegexp.exec( child.attributes.style );
+
+ if ( match ) {
+ if ( match[ 1 ] == mergeStyle || !mergeStyle )
+ mergeStyle = match[ 1 ];
+ else {
+ mergeStyle = null;
+ break;
+ }
+ }
+ }
+
+ if ( mergeStyle ) {
+ for ( i = 0; i < count; i++ ) {
+ attrs = children[ i ].attributes;
+ attrs.style && ( attrs.style = stylesFilter( [ [ 'list-style-type' ] ] )( attrs.style ) || '' );
+ }
+
+ list.addStyle( 'list-style-type', mergeStyle );
+ }
+ }
+
+ var cssLengthRelativeUnit = /^([.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz){1}?/i;
+ var emptyMarginRegex = /^(?:\b0[^\s]*\s*){1,4}$/; // e.g. 0px 0pt 0px
+ var romanLiternalPattern = '^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$',
+ lowerRomanLiteralRegex = new RegExp( romanLiternalPattern ),
+ upperRomanLiteralRegex = new RegExp( romanLiternalPattern.toUpperCase() );
+
+ var orderedPatterns = { 'decimal': /\d+/, 'lower-roman': lowerRomanLiteralRegex, 'upper-roman': upperRomanLiteralRegex, 'lower-alpha': /^[a-z]+$/, 'upper-alpha': /^[A-Z]+$/ },
+ unorderedPatterns = { 'disc': /[l\u00B7\u2002]/, 'circle': /[\u006F\u00D8]/, 'square': /[\u006E\u25C6]/ },
+ listMarkerPatterns = { 'ol': orderedPatterns, 'ul': unorderedPatterns },
+ romans = [ [ 1000, 'M' ], [ 900, 'CM' ], [ 500, 'D' ], [ 400, 'CD' ], [ 100, 'C' ], [ 90, 'XC' ], [ 50, 'L' ], [ 40, 'XL' ], [ 10, 'X' ], [ 9, 'IX' ], [ 5, 'V' ], [ 4, 'IV' ], [ 1, 'I' ] ],
+ alpahbets = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ // Convert roman numbering back to decimal.
+ function fromRoman( str ) {
+ str = str.toUpperCase();
+ var l = romans.length,
+ retVal = 0;
+ for ( var i = 0; i < l; ++i ) {
+ for ( var j = romans[ i ], k = j[ 1 ].length; str.substr( 0, k ) == j[ 1 ]; str = str.substr( k ) )
+ retVal += j[ 0 ];
+ }
+ return retVal;
+ }
+
+ // Convert alphabet numbering back to decimal.
+ function fromAlphabet( str ) {
+ str = str.toUpperCase();
+ var l = alpahbets.length,
+ retVal = 1;
+ for ( var x = 1; str.length > 0; x *= l ) {
+ retVal += alpahbets.indexOf( str.charAt( str.length - 1 ) ) * x;
+ str = str.substr( 0, str.length - 1 );
+ }
+ return retVal;
+ }
+
+ var listBaseIndent = 0,
+ previousListItemMargin = null,
+ previousListId;
+
+ var plugin = ( CKEDITOR.plugins.pastefromword = {
+ utils: {
+ // Create a <cke:listbullet> which indicate an list item type.
+ createListBulletMarker: function( bullet, bulletText ) {
+ var marker = new CKEDITOR.htmlParser.element( 'cke:listbullet' );
+ marker.attributes = { 'cke:listsymbol': bullet[ 0 ] };
+ marker.add( new CKEDITOR.htmlParser.text( bulletText ) );
+ return marker;
+ },
+
+ isListBulletIndicator: function( element ) {
+ var styleText = element.attributes && element.attributes.style;
+ if ( /mso-list\s*:\s*Ignore/i.test( styleText ) )
+ return true;
+ },
+
+ isContainingOnlySpaces: function( element ) {
+ var text;
+ return ( ( text = element.onlyChild() ) && ( /^(:?\s|&nbsp;)+$/ ).test( text.value ) );
+ },
+
+ resolveList: function( element ) {
+ // <cke:listbullet> indicate a list item.
+ var attrs = element.attributes,
+ listMarker;
+
+ if ( ( listMarker = element.removeAnyChildWithName( 'cke:listbullet' ) ) && listMarker.length && ( listMarker = listMarker[ 0 ] ) ) {
+ element.name = 'cke:li';
+
+ if ( attrs.style ) {
+ attrs.style = plugin.filters.stylesFilter( [
+ // Text-indent is not representing list item level any more.
+ [ 'text-indent' ],
+ [ 'line-height' ],
+ // First attempt is to resolve indent level from on a constant margin increment.
+ [ ( /^margin(:?-left)?$/ ), null, function( margin ) {
+ // Deal with component/short-hand form.
+ var values = margin.split( ' ' );
+ margin = CKEDITOR.tools.convertToPx( values[ 3 ] || values[ 1 ] || values[ 0 ] );
+
+ // Figure out the indent unit by checking the first time of incrementation.
+ if ( !listBaseIndent && previousListItemMargin !== null && margin > previousListItemMargin )
+ listBaseIndent = margin - previousListItemMargin;
+
+ previousListItemMargin = margin;
+
+ attrs[ 'cke:indent' ] = listBaseIndent && ( Math.ceil( margin / listBaseIndent ) + 1 ) || 1;
+ }],
+ // The best situation: "mso-list:l0 level1 lfo2" tells the belonged list root, list item indentation, etc.
+ [ ( /^mso-list$/ ), null, function( val ) {
+ val = val.split( ' ' );
+ var listId = Number( val[ 0 ].match( /\d+/ ) ),
+ indent = Number( val[ 1 ].match( /\d+/ ) );
+
+ if ( indent == 1 ) {
+ listId !== previousListId && ( attrs[ 'cke:reset' ] = 1 );
+ previousListId = listId;
+ }
+ attrs[ 'cke:indent' ] = indent;
+ }]
+ ] )( attrs.style, element ) || '';
+ }
+
+ // First level list item might be presented without a margin.
+
+
+ // In case all above doesn't apply.
+ if ( !attrs[ 'cke:indent' ] ) {
+ previousListItemMargin = 0;
+ attrs[ 'cke:indent' ] = 1;
+ }
+
+ // Inherit attributes from bullet.
+ CKEDITOR.tools.extend( attrs, listMarker.attributes );
+ return true;
+ }
+ // Current list disconnected.
+ else
+ previousListId = previousListItemMargin = listBaseIndent = null;
+
+ return false;
+ },
+
+ // Providing a shorthand style then retrieve one or more style component values.
+ getStyleComponents: (function() {
+ var calculator = CKEDITOR.dom.element.createFromHtml( '<div style="position:absolute;left:-9999px;top:-9999px;"></div>', CKEDITOR.document );
+ CKEDITOR.document.getBody().append( calculator );
+
+ return function( name, styleValue, fetchList ) {
+ calculator.setStyle( name, styleValue );
+ var styles = {},
+ count = fetchList.length;
+ for ( var i = 0; i < count; i++ )
+ styles[ fetchList[ i ] ] = calculator.getStyle( fetchList[ i ] );
+
+ return styles;
+ };
+ })(),
+
+ listDtdParents: CKEDITOR.dtd.parentOf( 'ol' )
+ },
+
+ filters: {
+ // Transform a normal list into flat list items only presentation.
+ // E.g. <ul><li>level1<ol><li>level2</li></ol></li> =>
+ // <cke:li cke:listtype="ul" cke:indent="1">level1</cke:li>
+ // <cke:li cke:listtype="ol" cke:indent="2">level2</cke:li>
+ flattenList: function( element, level ) {
+ level = typeof level == 'number' ? level : 1;
+
+ var attrs = element.attributes,
+ listStyleType;
+
+ // All list items are of the same type.
+ switch ( attrs.type ) {
+ case 'a':
+ listStyleType = 'lower-alpha';
+ break;
+ case '1':
+ listStyleType = 'decimal';
+ break;
+ // TODO: Support more list style type from MS-Word.
+ }
+
+ var children = element.children,
+ child;
+
+ for ( var i = 0; i < children.length; i++ ) {
+ child = children[ i ];
+
+ if ( child.name in CKEDITOR.dtd.$listItem ) {
+ var attributes = child.attributes,
+ listItemChildren = child.children,
+ count = listItemChildren.length,
+ last = listItemChildren[ count - 1 ];
+
+ // Move out nested list.
+ if ( last.name in CKEDITOR.dtd.$list ) {
+ element.add( last, i + 1 );
+
+ // Remove the parent list item if it's just a holder.
+ if ( !--listItemChildren.length )
+ children.splice( i--, 1 );
+ }
+
+ child.name = 'cke:li';
+
+ // Inherit numbering from list root on the first list item.
+ attrs.start && !i && ( attributes.value = attrs.start );
+
+ plugin.filters.stylesFilter( [
+ [ 'tab-stops', null, function( val ) {
+ var margin = val.split( ' ' )[ 1 ].match( cssLengthRelativeUnit );
+ margin && ( previousListItemMargin = CKEDITOR.tools.convertToPx( margin[ 0 ] ) );
+ }],
+ ( level == 1 ? [ 'mso-list', null, function( val ) {
+ val = val.split( ' ' );
+ var listId = Number( val[ 0 ].match( /\d+/ ) );
+ listId !== previousListId && ( attributes[ 'cke:reset' ] = 1 );
+ previousListId = listId;
+ }] : null )
+ ] )( attributes.style );
+
+ attributes[ 'cke:indent' ] = level;
+ attributes[ 'cke:listtype' ] = element.name;
+ attributes[ 'cke:list-style-type' ] = listStyleType;
+ }
+ // Flatten sub list.
+ else if ( child.name in CKEDITOR.dtd.$list ) {
+ // Absorb sub list children.
+ arguments.callee.apply( this, [ child, level + 1 ] );
+ children = children.slice( 0, i ).concat( child.children ).concat( children.slice( i + 1 ) );
+ element.children = [];
+ for ( var j = 0, num = children.length; j < num; j++ )
+ element.add( children[ j ] );
+ }
+ }
+
+ delete element.name;
+
+ // We're loosing tag name here, signalize this element as a list.
+ attrs[ 'cke:list' ] = 1;
+ },
+
+ // Try to collect all list items among the children and establish one
+ // or more HTML list structures for them.
+ // @param element
+ assembleList: function( element ) {
+ var children = element.children,
+ child, listItem, // The current processing cke:li element.
+ listItemAttrs, listItemIndent, // Indent level of current list item.
+ lastIndent, lastListItem, // The previous one just been added to the list.
+ list, // Current staging list and it's parent list if any.
+ openedLists = [],
+ previousListStyleType, previousListType;
+
+ // Properties of the list item are to be resolved from the list bullet.
+ var bullet, listType, listStyleType, itemNumeric;
+
+ for ( var i = 0; i < children.length; i++ ) {
+ child = children[ i ];
+
+ if ( 'cke:li' == child.name ) {
+ child.name = 'li';
+ listItem = child;
+ listItemAttrs = listItem.attributes;
+ bullet = listItemAttrs[ 'cke:listsymbol' ];
+ bullet = bullet && bullet.match( /^(?:[(]?)([^\s]+?)([.)]?)$/ );
+ listType = listStyleType = itemNumeric = null;
+
+ if ( listItemAttrs[ 'cke:ignored' ] ) {
+ children.splice( i--, 1 );
+ continue;
+ }
+
+
+ // This's from a new list root.
+ listItemAttrs[ 'cke:reset' ] && ( list = lastIndent = lastListItem = null );
+
+ // List item indent level might come from a real list indentation or
+ // been resolved from a pseudo list item's margin value, even get
+ // no indentation at all.
+ listItemIndent = Number( listItemAttrs[ 'cke:indent' ] );
+
+ // We're moving out of the current list, cleaning up.
+ if ( listItemIndent != lastIndent )
+ previousListType = previousListStyleType = null;
+
+ // List type and item style are already resolved.
+ if ( !bullet ) {
+ listType = listItemAttrs[ 'cke:listtype' ] || 'ol';
+ listStyleType = listItemAttrs[ 'cke:list-style-type' ];
+ } else {
+ // Probably share the same list style type with previous list item,
+ // give it priority to avoid ambiguous between C(Alpha) and C.(Roman).
+ if ( previousListType && listMarkerPatterns[ previousListType ][ previousListStyleType ].test( bullet[ 1 ] ) ) {
+ listType = previousListType;
+ listStyleType = previousListStyleType;
+ } else {
+ for ( var type in listMarkerPatterns ) {
+ for ( var style in listMarkerPatterns[ type ] ) {
+ if ( listMarkerPatterns[ type ][ style ].test( bullet[ 1 ] ) ) {
+ // Small numbering has higher priority, when dealing with ambiguous
+ // between C(Alpha) and C.(Roman).
+ if ( type == 'ol' && ( /alpha|roman/ ).test( style ) ) {
+ var num = /roman/.test( style ) ? fromRoman( bullet[ 1 ] ) : fromAlphabet( bullet[ 1 ] );
+ if ( !itemNumeric || num < itemNumeric ) {
+ itemNumeric = num;
+ listType = type;
+ listStyleType = style;
+ }
+ } else {
+ listType = type;
+ listStyleType = style;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Simply use decimal/disc for the rest forms of unrepresentable
+ // numerals, e.g. Chinese..., but as long as there a second part
+ // included, it has a bigger chance of being a order list ;)
+ !listType && ( listType = bullet[ 2 ] ? 'ol' : 'ul' );
+ }
+
+ previousListType = listType;
+ previousListStyleType = listStyleType || ( listType == 'ol' ? 'decimal' : 'disc' );
+ if ( listStyleType && listStyleType != ( listType == 'ol' ? 'decimal' : 'disc' ) )
+ listItem.addStyle( 'list-style-type', listStyleType );
+
+ // Figure out start numbering.
+ if ( listType == 'ol' && bullet ) {
+ switch ( listStyleType ) {
+ case 'decimal':
+ itemNumeric = Number( bullet[ 1 ] );
+ break;
+ case 'lower-roman':
+ case 'upper-roman':
+ itemNumeric = fromRoman( bullet[ 1 ] );
+ break;
+ case 'lower-alpha':
+ case 'upper-alpha':
+ itemNumeric = fromAlphabet( bullet[ 1 ] );
+ break;
+ }
+
+ // Always create the numbering, swipe out unnecessary ones later.
+ listItem.attributes.value = itemNumeric;
+ }
+
+ // Start the list construction.
+ if ( !list ) {
+ openedLists.push( list = new CKEDITOR.htmlParser.element( listType ) );
+ list.add( listItem );
+ children[ i ] = list;
+ } else {
+ if ( listItemIndent > lastIndent ) {
+ openedLists.push( list = new CKEDITOR.htmlParser.element( listType ) );
+ list.add( listItem );
+ lastListItem.add( list );
+ } else if ( listItemIndent < lastIndent ) {
+ // There might be a negative gap between two list levels. (#4944)
+ var diff = lastIndent - listItemIndent,
+ parent;
+ while ( diff-- && ( parent = list.parent ) )
+ list = parent.parent;
+
+ list.add( listItem );
+ } else
+ list.add( listItem );
+
+ children.splice( i--, 1 );
+ }
+
+ lastListItem = listItem;
+ lastIndent = listItemIndent;
+ } else if ( list )
+ list = lastIndent = lastListItem = null;
+ }
+
+ for ( i = 0; i < openedLists.length; i++ )
+ postProcessList( openedLists[ i ] );
+
+ list = lastIndent = lastListItem = previousListId = previousListItemMargin = listBaseIndent = null;
+ },
+
+ // A simple filter which always rejecting.
+ falsyFilter: function( value ) {
+ return false;
+ },
+
+ // A filter dedicated on the 'style' attribute filtering, e.g. dropping/replacing style properties.
+ // @param styles {Array} in form of [ styleNameRegexp, styleValueRegexp,
+ // newStyleValue/newStyleGenerator, newStyleName ] where only the first
+ // parameter is mandatory.
+ // @param whitelist {Boolean} Whether the {@param styles} will be considered as a white-list.
+ stylesFilter: function( styles, whitelist ) {
+ return function( styleText, element ) {
+ var rules = [];
+ // html-encoded quote might be introduced by 'font-family'
+ // from MS-Word which confused the following regexp. e.g.
+ //'font-family: &quot;Lucida, Console&quot;'
+ ( styleText || '' ).replace( /&quot;/g, '"' ).replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function( match, name, value ) {
+ name = name.toLowerCase();
+ name == 'font-family' && ( value = value.replace( /["']/g, '' ) );
+
+ var namePattern, valuePattern, newValue, newName;
+ for ( var i = 0; i < styles.length; i++ ) {
+ if ( styles[ i ] ) {
+ namePattern = styles[ i ][ 0 ];
+ valuePattern = styles[ i ][ 1 ];
+ newValue = styles[ i ][ 2 ];
+ newName = styles[ i ][ 3 ];
+
+ if ( name.match( namePattern ) && ( !valuePattern || value.match( valuePattern ) ) ) {
+ name = newName || name;
+ whitelist && ( newValue = newValue || value );
+
+ if ( typeof newValue == 'function' )
+ newValue = newValue( value, element, name );
+
+ // Return an couple indicate both name and value
+ // changed.
+ if ( newValue && newValue.push )
+ name = newValue[ 0 ], newValue = newValue[ 1 ];
+
+ if ( typeof newValue == 'string' )
+ rules.push( [ name, newValue ] );
+ return;
+ }
+ }
+ }
+
+ !whitelist && rules.push( [ name, value ] );
+
+ });
+
+ for ( var i = 0; i < rules.length; i++ )
+ rules[ i ] = rules[ i ].join( ':' );
+ return rules.length ? ( rules.join( ';' ) + ';' ) : false;
+ };
+ },
+
+ // Migrate the element by decorate styles on it.
+ // @param styleDefinition
+ // @param variables
+ elementMigrateFilter: function( styleDefinition, variables ) {
+ return styleDefinition ? function( element ) {
+ var styleDef = variables ? new CKEDITOR.style( styleDefinition, variables )._.definition : styleDefinition;
+ element.name = styleDef.element;
+ CKEDITOR.tools.extend( element.attributes, CKEDITOR.tools.clone( styleDef.attributes ) );
+ element.addStyle( CKEDITOR.style.getStyleText( styleDef ) );
+ } : function(){};
+ },
+
+ // Migrate styles by creating a new nested stylish element.
+ // @param styleDefinition
+ styleMigrateFilter: function( styleDefinition, variableName ) {
+
+ var elementMigrateFilter = this.elementMigrateFilter;
+ return styleDefinition ? function( value, element ) {
+ // Build an stylish element first.
+ var styleElement = new CKEDITOR.htmlParser.element( null ),
+ variables = {};
+
+ variables[ variableName ] = value;
+ elementMigrateFilter( styleDefinition, variables )( styleElement );
+ // Place the new element inside the existing span.
+ styleElement.children = element.children;
+ element.children = [ styleElement ];
+
+ // #10285 - later on styleElement will replace element if element won't have any attributes.
+ // However, in some cases styleElement is identical to element and therefore should not be filtered
+ // to avoid inf loop. Unfortunately calling element.filterChildren() does not prevent from that (#10327).
+ // However, we can assume that we don't need to filter styleElement at all, so it is safe to replace
+ // its filter method.
+ styleElement.filter = function() {};
+ styleElement.parent = element;
+ } : function(){};
+ },
+
+ // A filter which remove cke-namespaced-attribute on
+ // all none-cke-namespaced elements.
+ // @param value
+ // @param element
+ bogusAttrFilter: function( value, element ) {
+ if ( element.name.indexOf( 'cke:' ) == -1 )
+ return false;
+ },
+
+ // A filter which will be used to apply inline css style according the stylesheet
+ // definition rules, is generated lazily when filtering.
+ applyStyleFilter: null
+
+ },
+
+ getRules: function( editor, filter ) {
+ var dtd = CKEDITOR.dtd,
+ blockLike = CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent ),
+ config = editor.config,
+ filters = this.filters,
+ falsyFilter = filters.falsyFilter,
+ stylesFilter = filters.stylesFilter,
+ elementMigrateFilter = filters.elementMigrateFilter,
+ styleMigrateFilter = CKEDITOR.tools.bind( this.filters.styleMigrateFilter, this.filters ),
+ createListBulletMarker = this.utils.createListBulletMarker,
+ flattenList = filters.flattenList,
+ assembleList = filters.assembleList,
+ isListBulletIndicator = this.utils.isListBulletIndicator,
+ containsNothingButSpaces = this.utils.isContainingOnlySpaces,
+ resolveListItem = this.utils.resolveList,
+ convertToPx = function( value ) {
+ value = CKEDITOR.tools.convertToPx( value );
+ return isNaN( value ) ? value : value + 'px';
+ },
+ getStyleComponents = this.utils.getStyleComponents,
+ listDtdParents = this.utils.listDtdParents,
+ removeFontStyles = config.pasteFromWordRemoveFontStyles !== false,
+ removeStyles = config.pasteFromWordRemoveStyles !== false;
+
+ return {
+
+ elementNames: [
+ // Remove script, meta and link elements.
+ [ ( /meta|link|script/ ), '' ]
+ ],
+
+ root: function( element ) {
+ element.filterChildren( filter );
+ assembleList( element );
+ },
+
+ elements: {
+ '^': function( element ) {
+ // Transform CSS style declaration to inline style.
+ var applyStyleFilter;
+ if ( CKEDITOR.env.gecko && ( applyStyleFilter = filters.applyStyleFilter ) )
+ applyStyleFilter( element );
+ },
+
+ $: function( element ) {
+ var tagName = element.name || '',
+ attrs = element.attributes;
+
+ // Convert length unit of width/height on blocks to
+ // a more editor-friendly way (px).
+ if ( tagName in blockLike && attrs.style ) {
+ attrs.style = stylesFilter( [ [ ( /^(:?width|height)$/ ), null, convertToPx ] ] )( attrs.style ) || '';
+ }
+
+ // Processing headings.
+ if ( tagName.match( /h\d/ ) ) {
+ element.filterChildren( filter );
+ // Is the heading actually a list item?
+ if ( resolveListItem( element ) )
+ return;
+
+ // Adapt heading styles to editor's convention.
+ elementMigrateFilter( config[ 'format_' + tagName ] )( element );
+ }
+ // Remove inline elements which contain only empty spaces.
+ else if ( tagName in dtd.$inline ) {
+ element.filterChildren( filter );
+ if ( containsNothingButSpaces( element ) )
+ delete element.name;
+ }
+ // Remove element with ms-office namespace,
+ // with it's content preserved, e.g. 'o:p'.
+ else if ( tagName.indexOf( ':' ) != -1 && tagName.indexOf( 'cke' ) == -1 ) {
+ element.filterChildren( filter );
+
+ // Restore image real link from vml.
+ if ( tagName == 'v:imagedata' ) {
+ var href = element.attributes[ 'o:href' ];
+ if ( href )
+ element.attributes.src = href;
+ element.name = 'img';
+ return;
+ }
+ delete element.name;
+ }
+
+ // Assembling list items into a whole list.
+ if ( tagName in listDtdParents ) {
+ element.filterChildren( filter );
+ assembleList( element );
+ }
+ },
+
+ // We'll drop any style sheet, but Firefox conclude
+ // certain styles in a single style element, which are
+ // required to be changed into inline ones.
+ 'style': function( element ) {
+ if ( CKEDITOR.env.gecko ) {
+ // Grab only the style definition section.
+ var styleDefSection = element.onlyChild().value.match( /\/\* Style Definitions \*\/([\s\S]*?)\/\*/ ),
+ styleDefText = styleDefSection && styleDefSection[ 1 ],
+ rules = {}; // Storing the parsed result.
+
+ if ( styleDefText ) {
+ styleDefText
+ // Remove line-breaks.
+ .replace( /[\n\r]/g, '' )
+ // Extract selectors and style properties.
+ .replace( /(.+?)\{(.+?)\}/g, function( rule, selectors, styleBlock ) {
+ selectors = selectors.split( ',' );
+ var length = selectors.length,
+ selector;
+ for ( var i = 0; i < length; i++ ) {
+ // Assume MS-Word mostly generate only simple
+ // selector( [Type selector][Class selector]).
+ CKEDITOR.tools.trim( selectors[ i ] ).replace( /^(\w+)(\.[\w-]+)?$/g, function( match, tagName, className ) {
+ tagName = tagName || '*';
+ className = className.substring( 1, className.length );
+
+ // Reject MS-Word Normal styles.
+ if ( className.match( /MsoNormal/ ) )
+ return;
+
+ if ( !rules[ tagName ] )
+ rules[ tagName ] = {};
+ if ( className )
+ rules[ tagName ][ className ] = styleBlock;
+ else
+ rules[ tagName ] = styleBlock;
+ });
+ }
+ });
+
+ filters.applyStyleFilter = function( element ) {
+ var name = rules[ '*' ] ? '*' : element.name,
+ className = element.attributes && element.attributes[ 'class' ],
+ style;
+ if ( name in rules ) {
+ style = rules[ name ];
+ if ( typeof style == 'object' )
+ style = style[ className ];
+ // Maintain style rules priorities.
+ style && element.addStyle( style, true );
+ }
+ };
+ }
+ }
+ return false;
+ },
+
+ 'p': function( element ) {
+ // A a fall-back approach to resolve list item in browsers
+ // that doesn't include "mso-list:Ignore" on list bullets,
+ // note it's not perfect as not all list style (e.g. "heading list") is shipped
+ // with this pattern. (#6662)
+ if ( ( /MsoListParagraph/i ).exec( element.attributes[ 'class' ] ) || element.getStyle( 'mso-list' ) ) {
+ var bulletText = element.firstChild( function( node ) {
+ return node.type == CKEDITOR.NODE_TEXT && !containsNothingButSpaces( node.parent );
+ });
+
+ var bullet = bulletText && bulletText.parent;
+ if ( bullet ) {
+ bullet.addStyle( 'mso-list', 'Ignore' );
+ }
+ }
+
+ element.filterChildren( filter );
+
+ // Is the paragraph actually a list item?
+ if ( resolveListItem( element ) )
+ return;
+
+ // Adapt paragraph formatting to editor's convention
+ // according to enter-mode.
+ if ( config.enterMode == CKEDITOR.ENTER_BR ) {
+ // We suffer from attribute/style lost in this situation.
+ delete element.name;
+ element.add( new CKEDITOR.htmlParser.element( 'br' ) );
+ } else
+ elementMigrateFilter( config[ 'format_' + ( config.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ) ] )( element );
+ },
+
+ 'div': function( element ) {
+ // Aligned table with no text surrounded is represented by a wrapper div, from which
+ // table cells inherit as text-align styles, which is wrong.
+ // Instead we use a clear-float div after the table to properly achieve the same layout.
+ var singleChild = element.onlyChild();
+ if ( singleChild && singleChild.name == 'table' ) {
+ var attrs = element.attributes;
+ singleChild.attributes = CKEDITOR.tools.extend( singleChild.attributes, attrs );
+ attrs.style && singleChild.addStyle( attrs.style );
+
+ var clearFloatDiv = new CKEDITOR.htmlParser.element( 'div' );
+ clearFloatDiv.addStyle( 'clear', 'both' );
+ element.add( clearFloatDiv );
+ delete element.name;
+ }
+ },
+
+ 'td': function( element ) {
+ // 'td' in 'thead' is actually <th>.
+ if ( element.getAncestor( 'thead' ) )
+ element.name = 'th';
+ },
+
+ // MS-Word sometimes present list as a mixing of normal list
+ // and pseudo-list, normalize the previous ones into pseudo form.
+ 'ol': flattenList,
+ 'ul': flattenList,
+ 'dl': flattenList,
+
+ 'font': function( element ) {
+ // Drop the font tag if it comes from list bullet text.
+ if ( isListBulletIndicator( element.parent ) ) {
+ delete element.name;
+ return;
+ }
+
+ element.filterChildren( filter );
+
+ var attrs = element.attributes,
+ styleText = attrs.style,
+ parent = element.parent;
+
+ if ( 'font' == parent.name ) // Merge nested <font> tags.
+ {
+ CKEDITOR.tools.extend( parent.attributes, element.attributes );
+ styleText && parent.addStyle( styleText );
+ delete element.name;
+ }
+ // Convert the merged into a span with all attributes preserved.
+ else {
+ styleText = styleText || '';
+ // IE's having those deprecated attributes, normalize them.
+ if ( attrs.color ) {
+ attrs.color != '#000000' && ( styleText += 'color:' + attrs.color + ';' );
+ delete attrs.color;
+ }
+ if ( attrs.face ) {
+ styleText += 'font-family:' + attrs.face + ';';
+ delete attrs.face;
+ }
+ // TODO: Mapping size in ranges of xx-small,
+ // x-small, small, medium, large, x-large, xx-large.
+ if ( attrs.size ) {
+ styleText += 'font-size:' +
+ ( attrs.size > 3 ? 'large' : ( attrs.size < 3 ? 'small' : 'medium' ) ) + ';';
+ delete attrs.size;
+ }
+
+ element.name = 'span';
+ element.addStyle( styleText );
+ }
+ },
+
+ 'span': function( element ) {
+ // Remove the span if it comes from list bullet text.
+ if ( isListBulletIndicator( element.parent ) )
+ return false;
+
+ element.filterChildren( filter );
+ if ( containsNothingButSpaces( element ) ) {
+ delete element.name;
+ return null;
+ }
+
+ // List item bullet type is supposed to be indicated by
+ // the text of a span with style 'mso-list : Ignore' or an image.
+ if ( isListBulletIndicator( element ) ) {
+ var listSymbolNode = element.firstChild( function( node ) {
+ return node.value || node.name == 'img';
+ });
+
+ var listSymbol = listSymbolNode && ( listSymbolNode.value || 'l.' ),
+ listType = listSymbol && listSymbol.match( /^(?:[(]?)([^\s]+?)([.)]?)$/ );
+
+ if ( listType ) {
+ var marker = createListBulletMarker( listType, listSymbol );
+ // Some non-existed list items might be carried by an inconsequential list, indicate by "mso-hide:all/display:none",
+ // those are to be removed later, now mark it with "cke:ignored".
+ var ancestor = element.getAncestor( 'span' );
+ if ( ancestor && ( / mso-hide:\s*all|display:\s*none / ).test( ancestor.attributes.style ) )
+ marker.attributes[ 'cke:ignored' ] = 1;
+ return marker;
+ }
+ }
+
+ // Update the src attribute of image element with href.
+ var children = element.children,
+ attrs = element.attributes,
+ styleText = attrs && attrs.style,
+ firstChild = children && children[ 0 ];
+
+ // Assume MS-Word mostly carry font related styles on <span>,
+ // adapting them to editor's convention.
+ if ( styleText ) {
+ attrs.style = stylesFilter( [
+ // Drop 'inline-height' style which make lines overlapping.
+ [ 'line-height' ],
+ [ ( /^font-family$/ ), null, !removeFontStyles ? styleMigrateFilter( config[ 'font_style' ], 'family' ) : null ],
+ [ ( /^font-size$/ ), null, !removeFontStyles ? styleMigrateFilter( config[ 'fontSize_style' ], 'size' ) : null ],
+ [ ( /^color$/ ), null, !removeFontStyles ? styleMigrateFilter( config[ 'colorButton_foreStyle' ], 'color' ) : null ],
+ [ ( /^background-color$/ ), null, !removeFontStyles ? styleMigrateFilter( config[ 'colorButton_backStyle' ], 'color' ) : null ]
+ ] )( styleText, element ) || '';
+ }
+
+ if ( !attrs.style )
+ delete attrs.style;
+
+ if ( CKEDITOR.tools.isEmpty( attrs ) )
+ delete element.name;
+
+ return null;
+ },
+
+ // Migrate basic style formats to editor configured ones.
+ 'b': elementMigrateFilter( config[ 'coreStyles_bold' ] ),
+ 'i': elementMigrateFilter( config[ 'coreStyles_italic' ] ),
+ 'u': elementMigrateFilter( config[ 'coreStyles_underline' ] ),
+ 's': elementMigrateFilter( config[ 'coreStyles_strike' ] ),
+ 'sup': elementMigrateFilter( config[ 'coreStyles_superscript' ] ),
+ 'sub': elementMigrateFilter( config[ 'coreStyles_subscript' ] ),
+ // Editor doesn't support anchor with content currently (#3582),
+ // drop such anchors with content preserved.
+ 'a': function( element ) {
+ var attrs = element.attributes;
+ if ( attrs && !attrs.href && attrs.name )
+ delete element.name;
+ else if ( CKEDITOR.env.webkit && attrs.href && attrs.href.match( /file:\/\/\/[\S]+#/i ) )
+ attrs.href = attrs.href.replace( /file:\/\/\/[^#]+/i, '' );
+ },
+ 'cke:listbullet': function( element ) {
+ if ( element.getAncestor( /h\d/ ) && !config.pasteFromWordNumberedHeadingToList )
+ delete element.name;
+ }
+ },
+
+ attributeNames: [
+ // Remove onmouseover and onmouseout events (from MS Word comments effect)
+ [ ( /^onmouse(:?out|over)/ ), '' ],
+ // Onload on image element.
+ [ ( /^onload$/ ), '' ],
+ // Remove office and vml attribute from elements.
+ [ ( /(?:v|o):\w+/ ), '' ],
+ // Remove lang/language attributes.
+ [ ( /^lang/ ), '' ]
+ ],
+
+ attributes: {
+ 'style': stylesFilter( removeStyles ?
+ // Provide a white-list of styles that we preserve, those should
+ // be the ones that could later be altered with editor tools.
+ [
+ // Leave list-style-type
+ [ ( /^list-style-type$/ ), null ],
+
+ // Preserve margin-left/right which used as default indent style in the editor.
+ [ ( /^margin$|^margin-(?!bottom|top)/ ), null, function( value, element, name ) {
+ if ( element.name in { p:1,div:1 } ) {
+ var indentStyleName = config.contentsLangDirection == 'ltr' ? 'margin-left' : 'margin-right';
+
+ // Extract component value from 'margin' shorthand.
+ if ( name == 'margin' ) {
+ value = getStyleComponents( name, value, [ indentStyleName ] )[ indentStyleName ];
+ } else if ( name != indentStyleName )
+ return null;
+
+ if ( value && !emptyMarginRegex.test( value ) )
+ return [ indentStyleName, value ];
+ }
+
+ return null;
+ }],
+
+ // Preserve clear float style.
+ [ ( /^clear$/ ) ],
+
+ [ ( /^border.*|margin.*|vertical-align|float$/ ), null, function( value, element ) {
+ if ( element.name == 'img' )
+ return value;
+ }],
+
+ [ ( /^width|height$/ ), null, function( value, element ) {
+ if ( element.name in { table:1,td:1,th:1,img:1 } )
+ return value;
+ }]
+ ] :
+ // Otherwise provide a black-list of styles that we remove.
+ [
+ [ ( /^mso-/ ) ],
+ // Fixing color values.
+ [ ( /-color$/ ), null, function( value ) {
+ if ( value == 'transparent' )
+ return false;
+ if ( CKEDITOR.env.gecko )
+ return value.replace( /-moz-use-text-color/g, 'transparent' );
+ }],
+ // Remove empty margin values, e.g. 0.00001pt 0em 0pt
+ [ ( /^margin$/ ), emptyMarginRegex ],
+ [ 'text-indent', '0cm' ],
+ [ 'page-break-before' ],
+ [ 'tab-stops' ],
+ [ 'display', 'none' ],
+ removeFontStyles ? [ ( /font-?/ ) ] : null
+ ], removeStyles ),
+
+ // Prefer width styles over 'width' attributes.
+ 'width': function( value, element ) {
+ if ( element.name in dtd.$tableContent )
+ return false;
+ },
+ // Prefer border styles over table 'border' attributes.
+ 'border': function( value, element ) {
+ if ( element.name in dtd.$tableContent )
+ return false;
+ },
+
+ // Only Firefox carry style sheet from MS-Word, which
+ // will be applied by us manually. For other browsers
+ // the css className is useless.
+ 'class': falsyFilter,
+
+ // MS-Word always generate 'background-color' along with 'bgcolor',
+ // simply drop the deprecated attributes.
+ 'bgcolor': falsyFilter,
+
+ // Deprecate 'valign' attribute in favor of 'vertical-align'.
+ 'valign': removeStyles ? falsyFilter : function( value, element ) {
+ element.addStyle( 'vertical-align', value );
+ return false;
+ }
+ },
+
+ // Fore none-IE, some useful data might be buried under these IE-conditional
+ // comments where RegExp were the right approach to dig them out where usual approach
+ // is transform it into a fake element node which hold the desired data.
+ comment: !CKEDITOR.env.ie ? function( value, node ) {
+ var imageInfo = value.match( /<img.*?>/ ),
+ listInfo = value.match( /^\[if !supportLists\]([\s\S]*?)\[endif\]$/ );
+
+ // Seek for list bullet indicator.
+ if ( listInfo ) {
+ // Bullet symbol could be either text or an image.
+ var listSymbol = listInfo[ 1 ] || ( imageInfo && 'l.' ),
+ listType = listSymbol && listSymbol.match( />(?:[(]?)([^\s]+?)([.)]?)</ );
+ return createListBulletMarker( listType, listSymbol );
+ }
+
+ // Reveal the <img> element in conditional comments for Firefox.
+ if ( CKEDITOR.env.gecko && imageInfo ) {
+ var img = CKEDITOR.htmlParser.fragment.fromHtml( imageInfo[ 0 ] ).children[ 0 ],
+ previousComment = node.previous,
+ // Try to dig the real image link from vml markup from previous comment text.
+ imgSrcInfo = previousComment && previousComment.value.match( /<v:imagedata[^>]*o:href=['"](.*?)['"]/ ),
+ imgSrc = imgSrcInfo && imgSrcInfo[ 1 ];
+
+ // Is there a real 'src' url to be used?
+ imgSrc && ( img.attributes.src = imgSrc );
+ return img;
+ }
+
+ return false;
+ } : falsyFilter
+ };
+ }
+ });
+
+ // The paste processor here is just a reduced copy of html data processor.
+ var pasteProcessor = function() {
+ this.dataFilter = new CKEDITOR.htmlParser.filter();
+ };
+
+ pasteProcessor.prototype = {
+ toHtml: function( data ) {
+ var fragment = CKEDITOR.htmlParser.fragment.fromHtml( data ),
+ writer = new CKEDITOR.htmlParser.basicWriter();
+
+ fragment.writeHtml( writer, this.dataFilter );
+ return writer.getHtml( true );
+ }
+ };
+
+ CKEDITOR.cleanWord = function( data, editor ) {
+ // Firefox will be confused by those downlevel-revealed IE conditional
+ // comments, fixing them first( convert it to upperlevel-revealed one ).
+ // e.g. <![if !vml]>...<![endif]>
+ if ( CKEDITOR.env.gecko )
+ data = data.replace( /(<!--\[if[^<]*?\])-->([\S\s]*?)<!--(\[endif\]-->)/gi, '$1$2$3' );
+
+ // #9456 - Webkit doesn't wrap list number with span, which is crucial for filter to recognize list.
+ //
+ // <p class="MsoListParagraphCxSpLast" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2">
+ // <!--[if !supportLists]-->
+ // 3.<span style="font-size: 7pt; line-height: normal; font-family: 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+ // <!--[endif]-->Test3<o:p></o:p>
+ // </p>
+ //
+ // Transform to:
+ //
+ // <p class="MsoListParagraphCxSpLast" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2">
+ // <!--[if !supportLists]-->
+ // <span>
+ // 3.<span style="font-size: 7pt; line-height: normal; font-family: 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+ // </span>
+ // <!--[endif]-->Test3<o:p></o:p>
+ // </p>
+ if ( CKEDITOR.env.webkit ) {
+ data = data.replace( /(class="MsoListParagraph[^>]+><!--\[if !supportLists\]-->)([^<]+<span[^<]+<\/span>)(<!--\[endif\]-->)/gi, '$1<span>$2</span>$3' );
+ }
+
+ var dataProcessor = new pasteProcessor(),
+ dataFilter = dataProcessor.dataFilter;
+
+ // These rules will have higher priorities than default ones.
+ dataFilter.addRules( CKEDITOR.plugins.pastefromword.getRules( editor, dataFilter ) );
+
+ // Allow extending data filter rules.
+ editor.fire( 'beforeCleanWord', { filter: dataFilter } );
+
+ try {
+ data = dataProcessor.toHtml( data );
+ } catch ( e ) {
+ alert( editor.lang.pastefromword.error );
+ }
+
+ // Below post processing those things that are unable to delivered by filter rules.
+
+ // Remove 'cke' namespaced attribute used in filter rules as marker.
+ data = data.replace( /cke:.*?".*?"/g, '' );
+
+ // Remove empty style attribute.
+ data = data.replace( /style=""/g, '' );
+
+ // Remove the dummy spans ( having no inline style ).
+ data = data.replace( /<span>/g, '' );
+
+ return data;
+ };
+})();
+
+/**
+ * Whether to ignore all font related formatting styles, including:
+ *
+ * * font size;
+ * * font family;
+ * * font foreground/background color.
+ *
+ * config.pasteFromWordRemoveFontStyles = false;
+ *
+ * @since 3.1
+ * @cfg {Boolean} [pasteFromWordRemoveFontStyles=true]
+ * @member CKEDITOR.config
+ */
+
+/**
+ * Whether to transform MS Word outline numbered headings into lists.
+ *
+ * config.pasteFromWordNumberedHeadingToList = true;
+ *
+ * @since 3.1
+ * @cfg {Boolean} [pasteFromWordNumberedHeadingToList=false]
+ * @member CKEDITOR.config
+ */
+
+/**
+ * Whether to remove element styles that can't be managed with the editor. Note
+ * that this doesn't handle the font specific styles, which depends on the
+ * {@link #pasteFromWordRemoveFontStyles} setting instead.
+ *
+ * config.pasteFromWordRemoveStyles = false;
+ *
+ * @since 3.1
+ * @cfg {Boolean} [pasteFromWordRemoveStyles=true]
+ * @member CKEDITOR.config
+ */
diff --git a/plugins/smiley/dialogs/smiley.js b/plugins/smiley/dialogs/smiley.js
index a1a1968..7127842 100644
--- a/plugins/smiley/dialogs/smiley.js
+++ b/plugins/smiley/dialogs/smiley.js
@@ -1,7 +1,192 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-CKEDITOR.dialog.add('smiley',function(a){var b=a.config,c=a.lang.smiley,d=b.smiley_images,e=b.smiley_columns||8,f,g,h=function(o){var p=o.data.getTarget(),q=p.getName();if(q=='a')p=p.getChild(0);else if(q!='img')return;var r=p.getAttribute('cke_src'),s=p.getAttribute('title'),t=a.document.createElement('img',{attributes:{src:r,'data-cke-saved-src':r,title:s,alt:s,width:p.$.width,height:p.$.height}});a.insertElement(t);g.hide();o.data.preventDefault();},i=CKEDITOR.tools.addFunction(function(o,p){o=new CKEDITOR.dom.event(o);p=new CKEDITOR.dom.element(p);var q,r,s=o.getKeystroke(),t=a.lang.dir=='rtl';switch(s){case 38:if(q=p.getParent().getParent().getPrevious()){r=q.getChild([p.getParent().getIndex(),0]);r.focus();}o.preventDefault();break;case 40:if(q=p.getParent().getParent().getNext()){r=q.getChild([p.getParent().getIndex(),0]);if(r)r.focus();}o.preventDefault();break;case 32:h({data:o});o.preventDefault();break;case t?37:39:case 9:if(q=p.getParent().getNext()){r=q.getChild(0);r.focus();o.preventDefault(true);}else if(q=p.getParent().getParent().getNext()){r=q.getChild([0,0]);if(r)r.focus();o.preventDefault(true);}break;case t?39:37:case CKEDITOR.SHIFT+9:if(q=p.getParent().getPrevious()){r=q.getChild(0);r.focus();o.preventDefault(true);}else if(q=p.getParent().getParent().getPrevious()){r=q.getLast().getChild(0);r.focus();o.preventDefault(true);}break;default:return;}}),j=CKEDITOR.tools.getNextId()+'_smiley_emtions_label',k=['<div><span id="'+j+'" class="cke_voice_label">'+c.options+'</span>','<table role="listbox" aria-labelledby="'+j+'" style="width:100%;height:100%" cellspacing="2" cellpadding="2"',CKEDITOR.env.ie&&CKEDITOR.env.quirks?' style="position:absolute;"':'','><tbody>'],l=d.length;for(f=0;f<l;f++){if(f%e===0)k.push('<tr>');var m='cke_smile_label_'+f+'_'+CKEDITOR.tools.getNextNumber();k.push('<td class="cke_dark_background cke_centered" style="vertical-align: middle;"><a href="javascript:void(0)" role="option"',' aria-posinset="'+(f+1)+'"',' aria-setsize="'+l+'"',' aria-labelledby="'+m+'"',' class="cke_smile cke_hand" tabindex="-1" onkeydown="CKEDITOR.tools.callFunction( ',i,', event, this );">','<img class="cke_hand" title="',b.smiley_descriptions[f],'" cke_src="',CKEDITOR.tools.htmlEncode(b.smiley_path+d[f]),'" alt="',b.smiley_descriptions[f],'"',' src="',CKEDITOR.tools.htmlEncode(b.smiley_path+d[f]),'"',CKEDITOR.env.ie?" onload=\"this.setAttribute('width', 2); this.removeAttribute('width');\" ":'','><span id="'+m+'" class="cke_voice_label">'+b.smiley_descriptions[f]+'</span>'+'</a>','</td>');
-if(f%e==e-1)k.push('</tr>');}if(f<e-1){for(;f<e-1;f++)k.push('<td></td>');k.push('</tr>');}k.push('</tbody></table></div>');var n={type:'html',id:'smileySelector',html:k.join(''),onLoad:function(o){g=o.sender;},focus:function(){var o=this;setTimeout(function(){var p=o.getElement().getElementsByTag('a').getItem(0);p.focus();},0);},onClick:h,style:'width: 100%; border-collapse: separate;'};return{title:a.lang.smiley.title,minWidth:270,minHeight:120,contents:[{id:'tab1',label:'',title:'',expand:true,padding:0,elements:[n]}],buttons:[CKEDITOR.dialog.cancelButton]};});
+CKEDITOR.dialog.add( 'smiley', function( editor ) {
+ var config = editor.config,
+ lang = editor.lang.smiley,
+ images = config.smiley_images,
+ columns = config.smiley_columns || 8,
+ i;
+
+ // Simulate "this" of a dialog for non-dialog events.
+ // @type {CKEDITOR.dialog}
+ var dialog;
+ var onClick = function( evt ) {
+ var target = evt.data.getTarget(),
+ targetName = target.getName();
+
+ if ( targetName == 'a' )
+ target = target.getChild( 0 );
+ else if ( targetName != 'img' )
+ return;
+
+ var src = target.getAttribute( 'cke_src' ),
+ title = target.getAttribute( 'title' );
+
+ var img = editor.document.createElement( 'img', {
+ attributes: {
+ src: src,
+ 'data-cke-saved-src': src,
+ title: title,
+ alt: title,
+ width: target.$.width,
+ height: target.$.height
+ }
+ });
+
+ editor.insertElement( img );
+
+ dialog.hide();
+ evt.data.preventDefault();
+ };
+
+ var onKeydown = CKEDITOR.tools.addFunction( function( ev, element ) {
+ ev = new CKEDITOR.dom.event( ev );
+ element = new CKEDITOR.dom.element( element );
+ var relative, nodeToMove;
+
+ var keystroke = ev.getKeystroke(),
+ rtl = editor.lang.dir == 'rtl';
+ switch ( keystroke ) {
+ // UP-ARROW
+ case 38:
+ // relative is TR
+ if ( ( relative = element.getParent().getParent().getPrevious() ) ) {
+ nodeToMove = relative.getChild( [ element.getParent().getIndex(), 0 ] );
+ nodeToMove.focus();
+ }
+ ev.preventDefault();
+ break;
+ // DOWN-ARROW
+ case 40:
+ // relative is TR
+ if ( ( relative = element.getParent().getParent().getNext() ) ) {
+ nodeToMove = relative.getChild( [ element.getParent().getIndex(), 0 ] );
+ if ( nodeToMove )
+ nodeToMove.focus();
+ }
+ ev.preventDefault();
+ break;
+ // ENTER
+ // SPACE
+ case 32:
+ onClick({ data: ev } );
+ ev.preventDefault();
+ break;
+
+ // RIGHT-ARROW
+ case rtl ? 37:
+ 39 :
+ // relative is TD
+ if ( ( relative = element.getParent().getNext() ) ) {
+ nodeToMove = relative.getChild( 0 );
+ nodeToMove.focus();
+ ev.preventDefault( true );
+ }
+ // relative is TR
+ else if ( ( relative = element.getParent().getParent().getNext() ) ) {
+ nodeToMove = relative.getChild( [ 0, 0 ] );
+ if ( nodeToMove )
+ nodeToMove.focus();
+ ev.preventDefault( true );
+ }
+ break;
+
+ // LEFT-ARROW
+ case rtl ? 39:
+ 37 :
+ // relative is TD
+ if ( ( relative = element.getParent().getPrevious() ) ) {
+ nodeToMove = relative.getChild( 0 );
+ nodeToMove.focus();
+ ev.preventDefault( true );
+ }
+ // relative is TR
+ else if ( ( relative = element.getParent().getParent().getPrevious() ) ) {
+ nodeToMove = relative.getLast().getChild( 0 );
+ nodeToMove.focus();
+ ev.preventDefault( true );
+ }
+ break;
+ default:
+ // Do not stop not handled events.
+ return;
+ }
+ });
+
+ // Build the HTML for the smiley images table.
+ var labelId = CKEDITOR.tools.getNextId() + '_smiley_emtions_label';
+ var html = [
+ '<div>' +
+ '<span id="' + labelId + '" class="cke_voice_label">' + lang.options + '</span>',
+ '<table role="listbox" aria-labelledby="' + labelId + '" style="width:100%;height:100%;border-collapse:separate;" cellspacing="2" cellpadding="2"',
+ CKEDITOR.env.ie && CKEDITOR.env.quirks ? ' style="position:absolute;"' : '',
+ '><tbody>'
+ ];
+
+ var size = images.length;
+ for ( i = 0; i < size; i++ ) {
+ if ( i % columns === 0 )
+ html.push( '<tr role="presentation">' );
+
+ var smileyLabelId = 'cke_smile_label_' + i + '_' + CKEDITOR.tools.getNextNumber();
+ html.push( '<td class="cke_dark_background cke_centered" style="vertical-align: middle;" role="presentation">' +
+ '<a href="javascript:void(0)" role="option"', ' aria-posinset="' + ( i + 1 ) + '"', ' aria-setsize="' + size + '"', ' aria-labelledby="' + smileyLabelId + '"', ' class="cke_smile cke_hand" tabindex="-1" onkeydown="CKEDITOR.tools.callFunction( ', onKeydown, ', event, this );">', '<img class="cke_hand" title="', config.smiley_descriptions[ i ], '"' +
+ ' cke_src="', CKEDITOR.tools.htmlEncode( config.smiley_path + images[ i ] ), '" alt="', config.smiley_descriptions[ i ], '"', ' src="', CKEDITOR.tools.htmlEncode( config.smiley_path + images[ i ] ), '"',
+ // IE BUG: Below is a workaround to an IE image loading bug to ensure the image sizes are correct.
+ ( CKEDITOR.env.ie ? ' onload="this.setAttribute(\'width\', 2); this.removeAttribute(\'width\');" ' : '' ), '>' +
+ '<span id="' + smileyLabelId + '" class="cke_voice_label">' + config.smiley_descriptions[ i ] + '</span>' +
+ '</a>', '</td>' );
+
+ if ( i % columns == columns - 1 )
+ html.push( '</tr>' );
+ }
+
+ if ( i < columns - 1 ) {
+ for ( ; i < columns - 1; i++ )
+ html.push( '<td></td>' );
+ html.push( '</tr>' );
+ }
+
+ html.push( '</tbody></table></div>' );
+
+ var smileySelector = {
+ type: 'html',
+ id: 'smileySelector',
+ html: html.join( '' ),
+ onLoad: function( event ) {
+ dialog = event.sender;
+ },
+ focus: function() {
+ var self = this;
+ // IE need a while to move the focus (#6539).
+ setTimeout( function() {
+ var firstSmile = self.getElement().getElementsByTag( 'a' ).getItem( 0 );
+ firstSmile.focus();
+ }, 0 );
+ },
+ onClick: onClick,
+ style: 'width: 100%; border-collapse: separate;'
+ };
+
+ return {
+ title: editor.lang.smiley.title,
+ minWidth: 270,
+ minHeight: 120,
+ contents: [
+ {
+ id: 'tab1',
+ label: '',
+ title: '',
+ expand: true,
+ padding: 0,
+ elements: [
+ smileySelector
+ ]
+ }
+ ],
+ buttons: [ CKEDITOR.dialog.cancelButton ]
+ };
+});
diff --git a/plugins/specialchar/dialogs/specialchar.js b/plugins/specialchar/dialogs/specialchar.js
index ac19d18..6950d5e 100644
--- a/plugins/specialchar/dialogs/specialchar.js
+++ b/plugins/specialchar/dialogs/specialchar.js
@@ -1,7 +1,304 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-CKEDITOR.dialog.add('specialchar',function(a){var b,c=a.lang.specialChar,d=function(j){var k,l;if(j.data)k=j.data.getTarget();else k=new CKEDITOR.dom.element(j);if(k.getName()=='a'&&(l=k.getChild(0).getHtml())){k.removeClass('cke_light_background');b.hide();var m=a.document.createElement('span');m.setHtml(l);a.insertText(m.getText());}},e=CKEDITOR.tools.addFunction(d),f,g=function(j,k){var l;k=k||j.data.getTarget();if(k.getName()=='span')k=k.getParent();if(k.getName()=='a'&&(l=k.getChild(0).getHtml())){if(f)h(null,f);var m=b.getContentElement('info','htmlPreview').getElement();b.getContentElement('info','charPreview').getElement().setHtml(l);m.setHtml(CKEDITOR.tools.htmlEncode(l));k.getParent().addClass('cke_light_background');f=k;}},h=function(j,k){k=k||j.data.getTarget();if(k.getName()=='span')k=k.getParent();if(k.getName()=='a'){b.getContentElement('info','charPreview').getElement().setHtml('&nbsp;');b.getContentElement('info','htmlPreview').getElement().setHtml('&nbsp;');k.getParent().removeClass('cke_light_background');f=undefined;}},i=CKEDITOR.tools.addFunction(function(j){j=new CKEDITOR.dom.event(j);var k=j.getTarget(),l,m,n=j.getKeystroke(),o=a.lang.dir=='rtl';switch(n){case 38:if(l=k.getParent().getParent().getPrevious()){m=l.getChild([k.getParent().getIndex(),0]);m.focus();h(null,k);g(null,m);}j.preventDefault();break;case 40:if(l=k.getParent().getParent().getNext()){m=l.getChild([k.getParent().getIndex(),0]);if(m&&m.type==1){m.focus();h(null,k);g(null,m);}}j.preventDefault();break;case 32:d({data:j});j.preventDefault();break;case o?37:39:case 9:if(l=k.getParent().getNext()){m=l.getChild(0);if(m.type==1){m.focus();h(null,k);g(null,m);j.preventDefault(true);}else h(null,k);}else if(l=k.getParent().getParent().getNext()){m=l.getChild([0,0]);if(m&&m.type==1){m.focus();h(null,k);g(null,m);j.preventDefault(true);}else h(null,k);}break;case o?39:37:case CKEDITOR.SHIFT+9:if(l=k.getParent().getPrevious()){m=l.getChild(0);m.focus();h(null,k);g(null,m);j.preventDefault(true);}else if(l=k.getParent().getParent().getPrevious()){m=l.getLast().getChild(0);m.focus();h(null,k);g(null,m);j.preventDefault(true);}else h(null,k);break;default:return;}});return{title:c.title,minWidth:430,minHeight:280,buttons:[CKEDITOR.dialog.cancelButton],charColumns:17,onLoad:function(){var j=this.definition.charColumns,k=a.config.extraSpecialChars,l=a.config.specialChars,m=CKEDITOR.tools.getNextId()+'_specialchar_table_label',n=['<table role="listbox" aria-labelledby="'+m+'"'+' style="width: 320px; height: 100%; border-collapse: separate;"'+' align="center" cellspacing="2" cellpadding="2" border="0">'],o=0,p=l.length,q,r;
-while(o<p){n.push('<tr>');for(var s=0;s<j;s++,o++){if(q=l[o]){r='';if(q instanceof Array){r=q[1];q=q[0];}else{var t=q.replace('&','').replace(';','').replace('#','');r=c[t]||q;}var u='cke_specialchar_label_'+o+'_'+CKEDITOR.tools.getNextNumber();n.push('<td class="cke_dark_background" style="cursor: default" role="presentation"><a href="javascript: void(0);" role="option" aria-posinset="'+(o+1)+'"',' aria-setsize="'+p+'"',' aria-labelledby="'+u+'"',' style="cursor: inherit; display: block; height: 1.25em; margin-top: 0.25em; text-align: center;" title="',CKEDITOR.tools.htmlEncode(r),'" onkeydown="CKEDITOR.tools.callFunction( '+i+', event, this )"'+' onclick="CKEDITOR.tools.callFunction('+e+', this); return false;"'+' tabindex="-1">'+'<span style="margin: 0 auto;cursor: inherit">'+q+'</span>'+'<span class="cke_voice_label" id="'+u+'">'+r+'</span></a>');}else n.push('<td class="cke_dark_background">&nbsp;');n.push('</td>');}n.push('</tr>');}n.push('</tbody></table>','<span id="'+m+'" class="cke_voice_label">'+c.options+'</span>');this.getContentElement('info','charContainer').getElement().setHtml(n.join(''));},contents:[{id:'info',label:a.lang.common.generalTab,title:a.lang.common.generalTab,padding:0,align:'top',elements:[{type:'hbox',align:'top',widths:['320px','90px'],children:[{type:'html',id:'charContainer',html:'',onMouseover:g,onMouseout:h,focus:function(){var j=this.getElement().getElementsByTag('a').getItem(0);setTimeout(function(){j.focus();g(null,j);},0);},onShow:function(){var j=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){j.focus();g(null,j);},0);},onLoad:function(j){b=j.sender;}},{type:'hbox',align:'top',widths:['100%'],children:[{type:'vbox',align:'top',children:[{type:'html',html:'<div></div>'},{type:'html',id:'charPreview',className:'cke_dark_background',style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'<div>&nbsp;</div>'},{type:'html',id:'htmlPreview',className:'cke_dark_background',style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'<div>&nbsp;</div>'}]}]}]}]}]};});
+CKEDITOR.dialog.add( 'specialchar', function( editor ) {
+ // Simulate "this" of a dialog for non-dialog events.
+ // @type {CKEDITOR.dialog}
+ var dialog,
+ lang = editor.lang.specialchar;
+
+ var onChoice = function( evt ) {
+ var target, value;
+ if ( evt.data )
+ target = evt.data.getTarget();
+ else
+ target = new CKEDITOR.dom.element( evt );
+
+ if ( target.getName() == 'a' && ( value = target.getChild( 0 ).getHtml() ) ) {
+ target.removeClass( "cke_light_background" );
+ dialog.hide();
+
+ // We must use "insertText" here to keep text styled.
+ var span = editor.document.createElement( 'span' );
+ span.setHtml( value );
+ editor.insertText( span.getText() );
+ }
+ };
+
+ var onClick = CKEDITOR.tools.addFunction( onChoice );
+
+ var focusedNode;
+
+ var onFocus = function( evt, target ) {
+ var value;
+ target = target || evt.data.getTarget();
+
+ if ( target.getName() == 'span' )
+ target = target.getParent();
+
+ if ( target.getName() == 'a' && ( value = target.getChild( 0 ).getHtml() ) ) {
+ // Trigger blur manually if there is focused node.
+ if ( focusedNode )
+ onBlur( null, focusedNode );
+
+ var htmlPreview = dialog.getContentElement( 'info', 'htmlPreview' ).getElement();
+
+ dialog.getContentElement( 'info', 'charPreview' ).getElement().setHtml( value );
+ htmlPreview.setHtml( CKEDITOR.tools.htmlEncode( value ) );
+ target.getParent().addClass( "cke_light_background" );
+
+ // Memorize focused node.
+ focusedNode = target;
+ }
+ };
+
+ var onBlur = function( evt, target ) {
+ target = target || evt.data.getTarget();
+
+ if ( target.getName() == 'span' )
+ target = target.getParent();
+
+ if ( target.getName() == 'a' ) {
+ dialog.getContentElement( 'info', 'charPreview' ).getElement().setHtml( '&nbsp;' );
+ dialog.getContentElement( 'info', 'htmlPreview' ).getElement().setHtml( '&nbsp;' );
+ target.getParent().removeClass( "cke_light_background" );
+
+ focusedNode = undefined;
+ }
+ };
+
+ var onKeydown = CKEDITOR.tools.addFunction( function( ev ) {
+ ev = new CKEDITOR.dom.event( ev );
+
+ // Get an Anchor element.
+ var element = ev.getTarget();
+ var relative, nodeToMove;
+ var keystroke = ev.getKeystroke(),
+ rtl = editor.lang.dir == 'rtl';
+
+ switch ( keystroke ) {
+ // UP-ARROW
+ case 38:
+ // relative is TR
+ if ( ( relative = element.getParent().getParent().getPrevious() ) ) {
+ nodeToMove = relative.getChild( [ element.getParent().getIndex(), 0 ] );
+ nodeToMove.focus();
+ onBlur( null, element );
+ onFocus( null, nodeToMove );
+ }
+ ev.preventDefault();
+ break;
+ // DOWN-ARROW
+ case 40:
+ // relative is TR
+ if ( ( relative = element.getParent().getParent().getNext() ) ) {
+ nodeToMove = relative.getChild( [ element.getParent().getIndex(), 0 ] );
+ if ( nodeToMove && nodeToMove.type == 1 ) {
+ nodeToMove.focus();
+ onBlur( null, element );
+ onFocus( null, nodeToMove );
+ }
+ }
+ ev.preventDefault();
+ break;
+ // SPACE
+ // ENTER is already handled as onClick
+ case 32:
+ onChoice({ data: ev } );
+ ev.preventDefault();
+ break;
+
+ // RIGHT-ARROW
+ case rtl ? 37:
+ 39 :
+ // relative is TD
+ if ( ( relative = element.getParent().getNext() ) ) {
+ nodeToMove = relative.getChild( 0 );
+ if ( nodeToMove.type == 1 ) {
+ nodeToMove.focus();
+ onBlur( null, element );
+ onFocus( null, nodeToMove );
+ ev.preventDefault( true );
+ } else
+ onBlur( null, element );
+ }
+ // relative is TR
+ else if ( ( relative = element.getParent().getParent().getNext() ) ) {
+ nodeToMove = relative.getChild( [ 0, 0 ] );
+ if ( nodeToMove && nodeToMove.type == 1 ) {
+ nodeToMove.focus();
+ onBlur( null, element );
+ onFocus( null, nodeToMove );
+ ev.preventDefault( true );
+ } else
+ onBlur( null, element );
+ }
+ break;
+
+ // LEFT-ARROW
+ case rtl ? 39:
+ 37 :
+ // relative is TD
+ if ( ( relative = element.getParent().getPrevious() ) ) {
+ nodeToMove = relative.getChild( 0 );
+ nodeToMove.focus();
+ onBlur( null, element );
+ onFocus( null, nodeToMove );
+ ev.preventDefault( true );
+ }
+ // relative is TR
+ else if ( ( relative = element.getParent().getParent().getPrevious() ) ) {
+ nodeToMove = relative.getLast().getChild( 0 );
+ nodeToMove.focus();
+ onBlur( null, element );
+ onFocus( null, nodeToMove );
+ ev.preventDefault( true );
+ } else
+ onBlur( null, element );
+ break;
+ default:
+ // Do not stop not handled events.
+ return;
+ }
+ });
+
+ return {
+ title: lang.title,
+ minWidth: 430,
+ minHeight: 280,
+ buttons: [ CKEDITOR.dialog.cancelButton ],
+ charColumns: 17,
+ onLoad: function() {
+ var columns = this.definition.charColumns,
+ extraChars = editor.config.extraSpecialChars,
+ chars = editor.config.specialChars;
+
+ var charsTableLabel = CKEDITOR.tools.getNextId() + '_specialchar_table_label';
+ var html = [ '<table role="listbox" aria-labelledby="' + charsTableLabel + '"' +
+ ' style="width: 320px; height: 100%; border-collapse: separate;"' +
+ ' align="center" cellspacing="2" cellpadding="2" border="0">' ];
+
+ var i = 0,
+ size = chars.length,
+ character, charDesc;
+
+ while ( i < size ) {
+ html.push( '<tr role="presentation">' );
+
+ for ( var j = 0; j < columns; j++, i++ ) {
+ if ( ( character = chars[ i ] ) ) {
+ charDesc = '';
+
+ if ( character instanceof Array ) {
+ charDesc = character[ 1 ];
+ character = character[ 0 ];
+ } else {
+ var _tmpName = character.replace( '&', '' ).replace( ';', '' ).replace( '#', '' );
+
+ // Use character in case description unavailable.
+ charDesc = lang[ _tmpName ] || character;
+ }
+
+ var charLabelId = 'cke_specialchar_label_' + i + '_' + CKEDITOR.tools.getNextNumber();
+
+ html.push( '<td class="cke_dark_background" style="cursor: default" role="presentation">' +
+ '<a href="javascript: void(0);" role="option"' +
+ ' aria-posinset="' + ( i + 1 ) + '"', ' aria-setsize="' + size + '"', ' aria-labelledby="' + charLabelId + '"', ' class="cke_specialchar" title="', CKEDITOR.tools.htmlEncode( charDesc ), '"' +
+ ' onkeydown="CKEDITOR.tools.callFunction( ' + onKeydown + ', event, this )"' +
+ ' onclick="CKEDITOR.tools.callFunction(' + onClick + ', this); return false;"' +
+ ' tabindex="-1">' +
+ '<span style="margin: 0 auto;cursor: inherit">' +
+ character +
+ '</span>' +
+ '<span class="cke_voice_label" id="' + charLabelId + '">' +
+ charDesc +
+ '</span></a>' );
+ } else
+ html.push( '<td class="cke_dark_background">&nbsp;' );
+
+ html.push( '</td>' );
+ }
+ html.push( '</tr>' );
+ }
+
+ html.push( '</tbody></table>', '<span id="' + charsTableLabel + '" class="cke_voice_label">' + lang.options + '</span>' );
+
+ this.getContentElement( 'info', 'charContainer' ).getElement().setHtml( html.join( '' ) );
+ },
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.common.generalTab,
+ title: editor.lang.common.generalTab,
+ padding: 0,
+ align: 'top',
+ elements: [
+ {
+ type: 'hbox',
+ align: 'top',
+ widths: [ '320px', '90px' ],
+ children: [
+ {
+ type: 'html',
+ id: 'charContainer',
+ html: '',
+ onMouseover: onFocus,
+ onMouseout: onBlur,
+ focus: function() {
+ var firstChar = this.getElement().getElementsByTag( 'a' ).getItem( 0 );
+ setTimeout( function() {
+ firstChar.focus();
+ onFocus( null, firstChar );
+ }, 0 );
+ },
+ onShow: function() {
+ var firstChar = this.getElement().getChild( [ 0, 0, 0, 0, 0 ] );
+ setTimeout( function() {
+ firstChar.focus();
+ onFocus( null, firstChar );
+ }, 0 );
+ },
+ onLoad: function( event ) {
+ dialog = event.sender;
+ }
+ },
+ {
+ type: 'hbox',
+ align: 'top',
+ widths: [ '100%' ],
+ children: [
+ {
+ type: 'vbox',
+ align: 'top',
+ children: [
+ {
+ type: 'html',
+ html: '<div></div>'
+ },
+ {
+ type: 'html',
+ id: 'charPreview',
+ className: 'cke_dark_background',
+ style: 'border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;text-align:center;',
+ html: '<div>&nbsp;</div>'
+ },
+ {
+ type: 'html',
+ id: 'htmlPreview',
+ className: 'cke_dark_background',
+ style: 'border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;text-align:center;',
+ html: '<div>&nbsp;</div>'
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ };
+});
diff --git a/plugins/specialchar/lang/_translationstatus.txt b/plugins/specialchar/lang/_translationstatus.txt
index 569238a..a36ae3c 100644
--- a/plugins/specialchar/lang/_translationstatus.txt
+++ b/plugins/specialchar/lang/_translationstatus.txt
@@ -1,19 +1,63 @@
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-cs.js Found: 118 Missing: 0
-cy.js Found: 118 Missing: 0
-de.js Found: 118 Missing: 0
-eo.js Found: 118 Missing: 0
-et.js Found: 31 Missing: 87
-fa.js Found: 24 Missing: 94
-fi.js Found: 23 Missing: 95
-fr.js Found: 118 Missing: 0
-hr.js Found: 23 Missing: 95
-it.js Found: 118 Missing: 0
-nb.js Found: 118 Missing: 0
-nl.js Found: 118 Missing: 0
-no.js Found: 118 Missing: 0
-tr.js Found: 118 Missing: 0
-ug.js Found: 39 Missing: 79
-zh-cn.js Found: 118 Missing: 0
+af.js Found: 3 Missing: 118
+ar.js Found: 2 Missing: 119
+bg.js Found: 3 Missing: 118
+bn.js Found: 2 Missing: 119
+bs.js Found: 2 Missing: 119
+ca.js Found: 3 Missing: 118
+cs.js Found: 121 Missing: 0
+cy.js Found: 121 Missing: 0
+da.js Found: 3 Missing: 118
+de.js Found: 121 Missing: 0
+el.js Found: 19 Missing: 102
+en-au.js Found: 2 Missing: 119
+en-ca.js Found: 2 Missing: 119
+en-gb.js Found: 3 Missing: 118
+eo.js Found: 121 Missing: 0
+es.js Found: 3 Missing: 118
+et.js Found: 34 Missing: 87
+eu.js Found: 2 Missing: 119
+fa.js Found: 27 Missing: 94
+fi.js Found: 26 Missing: 95
+fo.js Found: 3 Missing: 118
+fr-ca.js Found: 2 Missing: 119
+fr.js Found: 121 Missing: 0
+gl.js Found: 2 Missing: 119
+gu.js Found: 3 Missing: 118
+he.js Found: 3 Missing: 118
+hi.js Found: 2 Missing: 119
+hr.js Found: 26 Missing: 95
+hu.js Found: 3 Missing: 118
+is.js Found: 2 Missing: 119
+it.js Found: 121 Missing: 0
+ja.js Found: 3 Missing: 118
+ka.js Found: 3 Missing: 118
+km.js Found: 2 Missing: 119
+ko.js Found: 2 Missing: 119
+lt.js Found: 3 Missing: 118
+lv.js Found: 2 Missing: 119
+mk.js Found: 0 Missing: 121
+mn.js Found: 2 Missing: 119
+ms.js Found: 2 Missing: 119
+nb.js Found: 121 Missing: 0
+nl.js Found: 121 Missing: 0
+no.js Found: 121 Missing: 0
+pl.js Found: 3 Missing: 118
+pt-br.js Found: 3 Missing: 118
+pt.js Found: 2 Missing: 119
+ro.js Found: 3 Missing: 118
+ru.js Found: 3 Missing: 118
+sk.js Found: 3 Missing: 118
+sl.js Found: 2 Missing: 119
+sr-latn.js Found: 2 Missing: 119
+sr.js Found: 2 Missing: 119
+sv.js Found: 3 Missing: 118
+th.js Found: 2 Missing: 119
+tr.js Found: 121 Missing: 0
+ug.js Found: 42 Missing: 79
+uk.js Found: 3 Missing: 118
+vi.js Found: 3 Missing: 118
+zh-cn.js Found: 121 Missing: 0
+zh.js Found: 2 Missing: 119
diff --git a/plugins/specialchar/lang/cs.js b/plugins/specialchar/lang/cs.js
index 9617ea4..465c6b1 100644
--- a/plugins/specialchar/lang/cs.js
+++ b/plugins/specialchar/lang/cs.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','cs',{euro:'Znak eura',lsquo:'Počáteční uvozovka jednoduchá',rsquo:'Koncová uvozovka jednoduchá',ldquo:'Počáteční uvozovka dvojitá',rdquo:'Koncová uvozovka dvojitá',ndash:'En pomlčka',mdash:'Em pomlčka',iexcl:'Obrácený vykřičník',cent:'Znak centu',pound:'Znak libry',curren:'Znak měny',yen:'Znak jenu',brvbar:'Přerušená svislá čára',sect:'Znak oddílu',uml:'Přehláska',copy:'Znak copyrightu',ordf:'Ženský indikátor rodu',laquo:'Znak dvojitých lomených uvozovek vlevo',not:'Logistický zápor',reg:'Znak registrace',macr:'Pomlčka nad',deg:'Znak stupně',sup2:'Dvojka jako horní index',sup3:'Trojka jako horní index',acute:'Čárka nad vpravo',micro:'Znak mikro',para:'Znak odstavce',middot:'Tečka uprostřed',cedil:'Ocásek vlevo',sup1:'Jednička jako horní index',ordm:'Mužský indikátor rodu',raquo:'Znak dvojitých lomených uvozovek vpravo',frac14:'Obyčejný zlomek jedna čtvrtina',frac12:'Obyčejný zlomek jedna polovina',frac34:'Obyčejný zlomek tři čtvrtiny',iquest:'Znak obráceného otazníku',Agrave:'Velké písmeno latinky A s čárkou nad vlevo',Aacute:'Velké písmeno latinky A s čárkou nad vpravo',Acirc:'Velké písmeno latinky A s vokáněm',Atilde:'Velké písmeno latinky A s tildou',Auml:'Velké písmeno latinky A s dvěma tečkami',Aring:'Velké písmeno latinky A s kroužkem nad',AElig:'Velké písmeno latinky Ae',Ccedil:'Velké písmeno latinky C s ocáskem vlevo',Egrave:'Velké písmeno latinky E s čárkou nad vlevo',Eacute:'Velké písmeno latinky E s čárkou nad vpravo',Ecirc:'Velké písmeno latinky E s vokáněm',Euml:'Velké písmeno latinky E s dvěma tečkami',Igrave:'Velké písmeno latinky I s čárkou nad vlevo',Iacute:'Velké písmeno latinky I s čárkou nad vpravo',Icirc:'Velké písmeno latinky I s vokáněm',Iuml:'Velké písmeno latinky I s dvěma tečkami',ETH:'Velké písmeno latinky Eth',Ntilde:'Velké písmeno latinky N s tildou',Ograve:'Velké písmeno latinky O s čárkou nad vlevo',Oacute:'Velké písmeno latinky O s čárkou nad vpravo',Ocirc:'Velké písmeno latinky O s vokáněm',Otilde:'Velké písmeno latinky O s tildou',Ouml:'Velké písmeno latinky O s dvěma tečkami',times:'Znak násobení',Oslash:'Velké písmeno latinky O přeškrtnuté',Ugrave:'Velké písmeno latinky U s čárkou nad vlevo',Uacute:'Velké písmeno latinky U s čárkou nad vpravo',Ucirc:'Velké písmeno latinky U s vokáněm',Uuml:'Velké písmeno latinky U s dvěma tečkami',Yacute:'Velké písmeno latinky Y s čárkou nad vpravo',THORN:'Velké písmeno latinky Thorn',szlig:'Malé písmeno latinky ostré s',agrave:'Malé písmeno latinky a s čárkou nad vlevo',aacute:'Malé písmeno latinky a s čárkou nad vpravo',acirc:'Malé písmeno latinky a s vokáněm',atilde:'Malé písmeno latinky a s tildou',auml:'Malé písmeno latinky a s dvěma tečkami',aring:'Malé písmeno latinky a s kroužkem nad',aelig:'Malé písmeno latinky ae',ccedil:'Malé písmeno latinky c s ocáskem vlevo',egrave:'Malé písmeno latinky e s čárkou nad vlevo',eacute:'Malé písmeno latinky e s čárkou nad vpravo',ecirc:'Malé písmeno latinky e s vokáněm',euml:'Malé písmeno latinky e s dvěma tečkami',igrave:'Malé písmeno latinky i s čárkou nad vlevo',iacute:'Malé písmeno latinky i s čárkou nad vpravo',icirc:'Malé písmeno latinky i s vokáněm',iuml:'Malé písmeno latinky i s dvěma tečkami',eth:'Malé písmeno latinky eth',ntilde:'Malé písmeno latinky n s tildou',ograve:'Malé písmeno latinky o s čárkou nad vlevo',oacute:'Malé písmeno latinky o s čárkou nad vpravo',ocirc:'Malé písmeno latinky o s vokáněm',otilde:'Malé písmeno latinky o s tildou',ouml:'Malé písmeno latinky o s dvěma tečkami',divide:'Znak dělení',oslash:'Malé písmeno latinky o přeškrtnuté',ugrave:'Malé písmeno latinky u s čárkou nad vlevo',uacute:'Malé písmeno latinky u s čárkou nad vpravo',ucirc:'Malé písmeno latinky u s vokáněm',uuml:'Malé písmeno latinky u s dvěma tečkami',yacute:'Malé písmeno latinky y s čárkou nad vpravo',thorn:'Malé písmeno latinky thorn',yuml:'Malé písmeno latinky y s dvěma tečkami',OElig:'Velká ligatura latinky OE',oelig:'Malá ligatura latinky OE',372:'Velké písmeno latinky W s vokáněm',374:'Velké písmeno latinky Y s vokáněm',373:'Malé písmeno latinky w s vokáněm',375:'Malé písmeno latinky y s vokáněm',sbquo:'Dolní 9 uvozovka jednoduchá',8219:'Horní obrácená 9 uvozovka jednoduchá',bdquo:'Dolní 9 uvozovka dvojitá',hellip:'Trojtečkový úvod',trade:'Obchodní značka',9658:'Černý ukazatel směřující vpravo',bull:'Kolečko',rarr:'Šipka vpravo',rArr:'Dvojitá šipka vpravo',hArr:'Dvojitá šipka vlevo a vpravo',diams:'Černé piky',asymp:'Téměř se rovná'});
+CKEDITOR.plugins.setLang( 'specialchar', 'cs', {
+ options: 'Nastavení speciálních znaků',
+ title: 'Výběr speciálního znaku',
+ toolbar: 'Vložit speciální znaky'
+});
diff --git a/plugins/specialchar/lang/cy.js b/plugins/specialchar/lang/cy.js
index 8dbafae..a8c4e22 100644
--- a/plugins/specialchar/lang/cy.js
+++ b/plugins/specialchar/lang/cy.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','cy',{euro:'Arwydd yr Ewro',lsquo:'Dyfynnod chwith unigol',rsquo:'Dyfynnod dde unigol',ldquo:'Dyfynnod chwith dwbl',rdquo:'Dyfynnod dde dwbl',ndash:'Cysylltnod en',mdash:'Cysylltnod em',iexcl:'Ebychnod gwrthdro',cent:'Arwydd sent',pound:'Arwydd punt',curren:'Arwydd arian cyfred',yen:'Arwydd yen',brvbar:'Bar toriedig',sect:'Arwydd adran',uml:'Didolnod',copy:'Arwydd hawlfraint',ordf:'Dangosydd benywaidd',laquo:"Dyfynnod dwbl ar ongl i'r chwith",not:'Arwydd Nid',reg:'Arwydd cofrestredig',macr:'Macron',deg:'Arwydd gradd',sup2:'Dau uwchsgript',sup3:'Tri uwchsgript',acute:'Acen ddyrchafedig',micro:'Arwydd micro',para:'Arwydd pilcrow',middot:'Dot canol',cedil:'Sedila',sup1:'Un uwchsgript',ordm:'Dangosydd gwrywaidd',raquo:"Dyfynnod dwbl ar ongl i'r dde",frac14:'Ffracsiwn cyffredin un cwarter',frac12:'Ffracsiwn cyffredin un hanner',frac34:'Ffracsiwn cyffredin tri chwarter',iquest:'Marc cwestiwn gwrthdroëdig',Agrave:'Priflythyren A Lladinaidd gydag acen ddisgynedig',Aacute:'Priflythyren A Lladinaidd gydag acen ddyrchafedig',Acirc:'Priflythyren A Lladinaidd gydag acen grom',Atilde:'Priflythyren A Lladinaidd gyda thild',Auml:'Priflythyren A Lladinaidd gyda didolnod',Aring:'Priflythyren A Lladinaidd gyda chylch uwchben',AElig:'Priflythyren Æ Lladinaidd',Ccedil:'Priflythyren C Lladinaidd gyda sedila',Egrave:'Priflythyren E Lladinaidd gydag acen ddisgynedig',Eacute:'Priflythyren E Lladinaidd gydag acen ddyrchafedig',Ecirc:'Priflythyren E Lladinaidd gydag acen grom',Euml:'Priflythyren E Lladinaidd gyda didolnod',Igrave:'Priflythyren I Lladinaidd gydag acen ddisgynedig',Iacute:'Priflythyren I Lladinaidd gydag acen ddyrchafedig',Icirc:'Priflythyren I Lladinaidd gydag acen grom',Iuml:'Priflythyren I Lladinaidd gyda didolnod',ETH:'Priflythyren Eth',Ntilde:'Priflythyren N Lladinaidd gyda thild',Ograve:'Priflythyren O Lladinaidd gydag acen ddisgynedig',Oacute:'Priflythyren O Lladinaidd gydag acen ddyrchafedig',Ocirc:'Priflythyren O Lladinaidd gydag acen grom',Otilde:'Priflythyren O Lladinaidd gyda thild',Ouml:'Priflythyren O Lladinaidd gyda didolnod',times:'Arwydd lluosi',Oslash:'Priflythyren O Lladinaidd gyda strôc',Ugrave:'Priflythyren U Lladinaidd gydag acen ddisgynedig',Uacute:'Priflythyren U Lladinaidd gydag acen ddyrchafedig',Ucirc:'Priflythyren U Lladinaidd gydag acen grom',Uuml:'Priflythyren U Lladinaidd gyda didolnod',Yacute:'Priflythyren Y Lladinaidd gydag acen ddyrchafedig',THORN:'Priflythyren Thorn',szlig:'Llythyren s fach Lladinaidd siarp ',agrave:'Llythyren a fach Lladinaidd gydag acen ddisgynedig',aacute:'Llythyren a fach Lladinaidd gydag acen ddyrchafedig',acirc:'Llythyren a fach Lladinaidd gydag acen grom',atilde:'Llythyren a fach Lladinaidd gyda thild',auml:'Llythyren a fach Lladinaidd gyda didolnod',aring:'Llythyren a fach Lladinaidd gyda chylch uwchben',aelig:'Llythyren æ fach Lladinaidd',ccedil:'Llythyren c fach Lladinaidd gyda sedila',egrave:'Llythyren e fach Lladinaidd gydag acen ddisgynedig',eacute:'Llythyren e fach Lladinaidd gydag acen ddyrchafedig',ecirc:'Llythyren e fach Lladinaidd gydag acen grom',euml:'Llythyren e fach Lladinaidd gyda didolnod',igrave:'Llythyren i fach Lladinaidd gydag acen ddisgynedig',iacute:'Llythyren i fach Lladinaidd gydag acen ddyrchafedig',icirc:'Llythyren i fach Lladinaidd gydag acen grom',iuml:'Llythyren i fach Lladinaidd gyda didolnod',eth:'Llythyren eth fach',ntilde:'Llythyren n fach Lladinaidd gyda thild',ograve:'Llythyren o fach Lladinaidd gydag acen ddisgynedig',oacute:'Llythyren o fach Lladinaidd gydag acen ddyrchafedig',ocirc:'Llythyren o fach Lladinaidd gydag acen grom',otilde:'Llythyren o fach Lladinaidd gyda thild',ouml:'Llythyren o fach Lladinaidd gyda didolnod',divide:'Arwydd rhannu',oslash:'Llyth',ugrave:'Llythyren u fach Lladinaidd gydag acen ddisgynedig',uacute:'Llythyren u fach Lladinaidd gydag acen ddyrchafedig',ucirc:'Llythyren u fach Lladinaidd gydag acen grom',uuml:'Llythyren u fach Lladinaidd gyda didolnod',yacute:'Llythyren y fach Lladinaidd gydag acen ddisgynedig',thorn:'Llythyren o fach Lladinaidd gyda strôc',yuml:'Llythyren y fach Lladinaidd gyda didolnod',OElig:'Priflythyren cwlwm OE Lladinaidd ',oelig:'Priflythyren cwlwm oe Lladinaidd ',372:'Priflythyren W gydag acen grom',374:'Priflythyren Y gydag acen grom',373:'Llythyren w fach gydag acen grom',375:'Llythyren y fach gydag acen grom',sbquo:'Dyfynnod sengl 9-isel',8219:'Dyfynnod sengl 9-uchel cildro',bdquo:'Dyfynnod dwbl 9-isel',hellip:'Coll geiriau llorweddol',trade:'Arwydd marc masnachol',9658:"Pwyntydd du i'r dde",bull:'Bwled',rarr:"Saeth i'r dde",rArr:"Saeth ddwbl i'r dde",hArr:"Saeth ddwbl i'r chwith",diams:'Siwt diemwnt du',asymp:'Bron yn hafal iddo'});
+CKEDITOR.plugins.setLang( 'specialchar', 'cy', {
+ options: 'Opsiynau Nodau Arbennig',
+ title: 'Dewis Nod Arbennig',
+ toolbar: 'Mewnosod Nodau Arbennig'
+});
diff --git a/plugins/specialchar/lang/de.js b/plugins/specialchar/lang/de.js
index ee03cb8..405db33 100644
--- a/plugins/specialchar/lang/de.js
+++ b/plugins/specialchar/lang/de.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','de',{euro:'Euro Zeichen',lsquo:'Hochkomma links',rsquo:'Hochkomma rechts',ldquo:'Anführungszeichen links',rdquo:'Anführungszeichen rechts',ndash:'kleiner Strich',mdash:'mittlerer Strich',iexcl:'invertiertes Ausrufezeichen',cent:'Cent',pound:'Pfund',curren:'Währung',yen:'Yen',brvbar:'gestrichelte Linie',sect:'§ Zeichen',uml:'Diäresis',copy:'Copyright',ordf:'Feminine ordinal Anzeige',laquo:'Nach links zeigenden Doppel-Winkel Anführungszeichen',not:'Not-Zeichen',reg:'Registriert',macr:'Längezeichen',deg:'Grad',sup2:'Hoch 2',sup3:'Hoch 3',acute:'Akzentzeichen ',micro:'Micro',para:'Pilcrow-Zeichen',middot:'Mittelpunkt',cedil:'Cedilla',sup1:'Hoch 1',ordm:'Männliche Ordnungszahl Anzeige',raquo:'Nach rechts zeigenden Doppel-Winkel Anführungszeichen',frac14:'ein Viertel',frac12:'Hälfte',frac34:'Dreiviertel',iquest:'Umgekehrtes Fragezeichen',Agrave:'Lateinischer Buchstabe A mit AkzentGrave',Aacute:'Lateinischer Buchstabe A mit Akutakzent',Acirc:'Lateinischer Buchstabe A mit Zirkumflex',Atilde:'Lateinischer Buchstabe A mit Tilde',Auml:'Lateinischer Buchstabe A mit Trema',Aring:'Lateinischer Buchstabe A mit Ring oben',AElig:'Lateinischer Buchstabe Æ',Ccedil:'Lateinischer Buchstabe C mit Cedille',Egrave:'Lateinischer Buchstabe E mit AkzentGrave',Eacute:'Lateinischer Buchstabe E mit Akutakzent',Ecirc:'Lateinischer Buchstabe E mit Zirkumflex',Euml:'Lateinischer Buchstabe E Trema',Igrave:'Lateinischer Buchstabe I mit AkzentGrave',Iacute:'Lateinischer Buchstabe I mit Akutakzent',Icirc:'Lateinischer Buchstabe I mit Zirkumflex',Iuml:'Lateinischer Buchstabe I mit Trema',ETH:'Lateinischer Buchstabe Eth',Ntilde:'Lateinischer Buchstabe N mit Tilde',Ograve:'Lateinischer Buchstabe O mit AkzentGrave',Oacute:'Lateinischer Buchstabe O mit Akutakzent',Ocirc:'Lateinischer Buchstabe O mit Zirkumflex',Otilde:'Lateinischer Buchstabe O mit Tilde',Ouml:'Lateinischer Buchstabe O mit Trema',times:'Multiplikation',Oslash:'Lateinischer Buchstabe O durchgestrichen',Ugrave:'Lateinischer Buchstabe U mit Akzentgrave',Uacute:'Lateinischer Buchstabe U mit Akutakzent',Ucirc:'Lateinischer Buchstabe U mit Zirkumflex',Uuml:'Lateinischer Buchstabe a mit Trema',Yacute:'Lateinischer Buchstabe a mit Akzent',THORN:'Lateinischer Buchstabe mit Dorn',szlig:'Kleiner lateinischer Buchstabe scharfe s',agrave:'Kleiner lateinischer Buchstabe a mit Accent grave',aacute:'Kleiner lateinischer Buchstabe a mit Akut',acirc:'Lateinischer Buchstabe a mit Zirkumflex',atilde:'Lateinischer Buchstabe a mit Tilde',auml:'Kleiner lateinischer Buchstabe a mit Trema',aring:'Kleiner lateinischer Buchstabe a mit Ring oben',aelig:'Lateinischer Buchstabe æ',ccedil:'Kleiner lateinischer Buchstabe c mit Cedille',egrave:'Kleiner lateinischer Buchstabe e mit Accent grave',eacute:'Kleiner lateinischer Buchstabe e mit Akut',ecirc:'Kleiner lateinischer Buchstabe e mit Zirkumflex',euml:'Kleiner lateinischer Buchstabe e mit Trema',igrave:'Kleiner lateinischer Buchstabe i mit AkzentGrave',iacute:'Kleiner lateinischer Buchstabe i mit Akzent',icirc:'Kleiner lateinischer Buchstabe i mit Zirkumflex',iuml:'Kleiner lateinischer Buchstabe i mit Trema',eth:'Kleiner lateinischer Buchstabe eth',ntilde:'Kleiner lateinischer Buchstabe n mit Tilde',ograve:'Kleiner lateinischer Buchstabe o mit Accent grave',oacute:'Kleiner lateinischer Buchstabe o mit Akzent',ocirc:'Kleiner lateinischer Buchstabe o mit Zirkumflex',otilde:'Lateinischer Buchstabe i mit Tilde',ouml:'Kleiner lateinischer Buchstabe o mit Trema',divide:'Divisionszeichen',oslash:'Kleiner lateinischer Buchstabe o durchgestrichen',ugrave:'Kleiner lateinischer Buchstabe u mit Accent grave',uacute:'Kleiner lateinischer Buchstabe u mit Akut',ucirc:'Kleiner lateinischer Buchstabe u mit Zirkumflex',uuml:'Kleiner lateinischer Buchstabe u mit Trema',yacute:'Kleiner lateinischer Buchstabe y mit Akut',thorn:'Kleiner lateinischer Buchstabe Dorn',yuml:'Kleiner lateinischer Buchstabe y mit Trema',OElig:'Lateinischer Buchstabe Ligatur OE',oelig:'Kleiner lateinischer Buchstabe Ligatur OE',372:'Lateinischer Buchstabe W mit Zirkumflex',374:'Lateinischer Buchstabe Y mit Zirkumflex',373:'Kleiner lateinischer Buchstabe w mit Zirkumflex',375:'Kleiner lateinischer Buchstabe y mit Zirkumflex',sbquo:'Tiefergestelltes Komma',8219:'Rumgedrehtes Komma',bdquo:'Doppeltes Anführungszeichen unten',hellip:'horizontale Auslassungspunkte',trade:'Handelszeichen',9658:'Dreickspfeil rechts',bull:'Bullet',rarr:'Pfeil rechts',rArr:'Doppelpfeil rechts',hArr:'Doppelpfeil links',diams:'Karo',asymp:'Ungefähr'});
+CKEDITOR.plugins.setLang( 'specialchar', 'de', {
+ options: 'Sonderzeichen Optionen',
+ title: 'Sonderzeichen auswählen',
+ toolbar: 'Sonderzeichen einfügen/editieren'
+});
diff --git a/plugins/specialchar/lang/en.js b/plugins/specialchar/lang/en.js
index 575001f..5a73ea6 100644
--- a/plugins/specialchar/lang/en.js
+++ b/plugins/specialchar/lang/en.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','en',{euro:'Euro sign',lsquo:'Left single quotation mark',rsquo:'Right single quotation mark',ldquo:'Left double quotation mark',rdquo:'Right double quotation mark',ndash:'En dash',mdash:'Em dash',iexcl:'Inverted exclamation mark',cent:'Cent sign',pound:'Pound sign',curren:'Currency sign',yen:'Yen sign',brvbar:'Broken bar',sect:'Section sign',uml:'Diaeresis',copy:'Copyright sign',ordf:'Feminine ordinal indicator',laquo:'Left-pointing double angle quotation mark',not:'Not sign',reg:'Registered sign',macr:'Macron',deg:'Degree sign',sup2:'Superscript two',sup3:'Superscript three',acute:'Acute accent',micro:'Micro sign',para:'Pilcrow sign',middot:'Middle dot',cedil:'Cedilla',sup1:'Superscript one',ordm:'Masculine ordinal indicator',raquo:'Right-pointing double angle quotation mark',frac14:'Vulgar fraction one quarter',frac12:'Vulgar fraction one half',frac34:'Vulgar fraction three quarters',iquest:'Inverted question mark',Agrave:'Latin capital letter A with grave accent',Aacute:'Latin capital letter A with acute accent',Acirc:'Latin capital letter A with circumflex',Atilde:'Latin capital letter A with tilde',Auml:'Latin capital letter A with diaeresis',Aring:'Latin capital letter A with ring above',AElig:'Latin Capital letter Æ',Ccedil:'Latin capital letter C with cedilla',Egrave:'Latin capital letter E with grave accent',Eacute:'Latin capital letter E with acute accent',Ecirc:'Latin capital letter E with circumflex',Euml:'Latin capital letter E with diaeresis',Igrave:'Latin capital letter I with grave accent',Iacute:'Latin capital letter I with acute accent',Icirc:'Latin capital letter I with circumflex',Iuml:'Latin capital letter I with diaeresis',ETH:'Latin capital letter Eth',Ntilde:'Latin capital letter N with tilde',Ograve:'Latin capital letter O with grave accent',Oacute:'Latin capital letter O with acute accent',Ocirc:'Latin capital letter O with circumflex',Otilde:'Latin capital letter O with tilde',Ouml:'Latin capital letter O with diaeresis',times:'Multiplication sign',Oslash:'Latin capital letter O with stroke',Ugrave:'Latin capital letter U with grave accent',Uacute:'Latin capital letter U with acute accent',Ucirc:'Latin capital letter U with circumflex',Uuml:'Latin capital letter U with diaeresis',Yacute:'Latin capital letter Y with acute accent',THORN:'Latin capital letter Thorn',szlig:'Latin small letter sharp s',agrave:'Latin small letter a with grave accent',aacute:'Latin small letter a with acute accent',acirc:'Latin small letter a with circumflex',atilde:'Latin small letter a with tilde',auml:'Latin small letter a with diaeresis',aring:'Latin small letter a with ring above',aelig:'Latin small letter æ',ccedil:'Latin small letter c with cedilla',egrave:'Latin small letter e with grave accent',eacute:'Latin small letter e with acute accent',ecirc:'Latin small letter e with circumflex',euml:'Latin small letter e with diaeresis',igrave:'Latin small letter i with grave accent',iacute:'Latin small letter i with acute accent',icirc:'Latin small letter i with circumflex',iuml:'Latin small letter i with diaeresis',eth:'Latin small letter eth',ntilde:'Latin small letter n with tilde',ograve:'Latin small letter o with grave accent',oacute:'Latin small letter o with acute accent',ocirc:'Latin small letter o with circumflex',otilde:'Latin small letter o with tilde',ouml:'Latin small letter o with diaeresis',divide:'Division sign',oslash:'Latin small letter o with stroke',ugrave:'Latin small letter u with grave accent',uacute:'Latin small letter u with acute accent',ucirc:'Latin small letter u with circumflex',uuml:'Latin small letter u with diaeresis',yacute:'Latin small letter y with acute accent',thorn:'Latin small letter thorn',yuml:'Latin small letter y with diaeresis',OElig:'Latin capital ligature OE',oelig:'Latin small ligature oe',372:'Latin capital letter W with circumflex',374:'Latin capital letter Y with circumflex',373:'Latin small letter w with circumflex',375:'Latin small letter y with circumflex',sbquo:'Single low-9 quotation mark',8219:'Single high-reversed-9 quotation mark',bdquo:'Double low-9 quotation mark',hellip:'Horizontal ellipsis',trade:'Trade mark sign',9658:'Black right-pointing pointer',bull:'Bullet',rarr:'Rightwards arrow',rArr:'Rightwards double arrow',hArr:'Left right double arrow',diams:'Black diamond suit',asymp:'Almost equal to'});
+CKEDITOR.plugins.setLang( 'specialchar', 'en', {
+ options: 'Special Character Options',
+ title: 'Select Special Character',
+ toolbar: 'Insert Special Character'
+});
diff --git a/plugins/specialchar/lang/eo.js b/plugins/specialchar/lang/eo.js
index e9cdb39..ae5c790 100644
--- a/plugins/specialchar/lang/eo.js
+++ b/plugins/specialchar/lang/eo.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','eo',{euro:'Eŭrosigno',lsquo:'Supra 6-citilo',rsquo:'Supra 9-citilo',ldquo:'Supra 66-citilo',rdquo:'Supra 99-citilo',ndash:'Streketo',mdash:'Substreko',iexcl:'Renversita krisigno',cent:'Cendosigno',pound:'Pundosigno',curren:'Monersigno',yen:'Enosigno',brvbar:'Rompita vertikala streko',sect:'Kurba paragrafo',uml:'Tremao',copy:'Kopirajtosigno',ordf:'Adjektiva numerfinaĵo',laquo:'Duobla malplio-citilo',not:'Negohoko',reg:'Registrita marko',macr:'Superstreko',deg:'Gradosigno',sup2:'Supra indico 2',sup3:'Supra indico 3',acute:'Dekstra korno',micro:'Mikrosigno',para:'Rekta paragrafo',middot:'Meza punkto',cedil:'Zoeto',sup1:'Supra indico 1',ordm:'Substantiva numerfinaĵo',raquo:'Duobla plio-citilo',frac14:'Kvaronosigno',frac12:'Duonosigno',frac34:'Trikvaronosigno',iquest:'renversita demandosigno',Agrave:'Latina ĉeflitero A kun liva korno',Aacute:'Latina ĉeflitero A kun dekstra korno',Acirc:'Latina ĉeflitero A kun ĉapelo',Atilde:'Latina ĉeflitero A kun tildo',Auml:'Latina ĉeflitero A kun tremao',Aring:'Latina ĉeflitero A kun superringo',AElig:'Latina ĉeflitera ligaturo Æ',Ccedil:'Latina ĉeflitero C kun zoeto',Egrave:'Latina ĉeflitero E kun liva korno',Eacute:'Latina ĉeflitero E kun dekstra korno',Ecirc:'Latina ĉeflitero E kun ĉapelo',Euml:'Latina ĉeflitero E kun tremao',Igrave:'Latina ĉeflitero I kun liva korno',Iacute:'Latina ĉeflitero I kun dekstra korno',Icirc:'Latina ĉeflitero I kun ĉapelo',Iuml:'Latina ĉeflitero I kun tremao',ETH:'Latina ĉeflitero islanda edo',Ntilde:'Latina ĉeflitero N kun tildo',Ograve:'Latina ĉeflitero O kun liva korno',Oacute:'Latina ĉeflitero O kun dekstra korno',Ocirc:'Latina ĉeflitero O kun ĉapelo',Otilde:'Latina ĉeflitero O kun tildo',Ouml:'Latina ĉeflitero O kun tremao',times:'Multipliko',Oslash:'Latina ĉeflitero O trastrekita',Ugrave:'Latina ĉeflitero U kun liva korno',Uacute:'Latina ĉeflitero U kun dekstra korno',Ucirc:'Latina ĉeflitero U kun ĉapelo',Uuml:'Latina ĉeflitero U kun tremao',Yacute:'Latina ĉeflitero Y kun dekstra korno',THORN:'Latina ĉeflitero islanda dorno',szlig:'Latina etlitero germana sozo (akra s)',agrave:'Latina etlitero a kun liva korno',aacute:'Latina etlitero a kun dekstra korno',acirc:'Latina etlitero a kun ĉapelo',atilde:'Latina etlitero a kun tildo',auml:'Latina etlitero a kun tremao',aring:'Latina etlitero a kun superringo',aelig:'Latina etlitera ligaturo æ',ccedil:'Latina etlitero c kun zoeto',egrave:'Latina etlitero e kun liva korno',eacute:'Latina etlitero e kun dekstra korno',ecirc:'Latina etlitero e kun ĉapelo',euml:'Latina etlitero e kun tremao',igrave:'Latina etlitero i kun liva korno',iacute:'Latina etlitero i kun dekstra korno',icirc:'Latina etlitero i kun ĉapelo',iuml:'Latina etlitero i kun tremao',eth:'Latina etlitero islanda edo',ntilde:'Latina etlitero n kun tildo',ograve:'Latina etlitero o kun liva korno',oacute:'Latina etlitero o kun dekstra korno',ocirc:'Latina etlitero o kun ĉapelo',otilde:'Latina etlitero o kun tildo',ouml:'Latina etlitero o kun tremao',divide:'Dividosigno',oslash:'Latina etlitero o trastrekita',ugrave:'Latina etlitero u kun liva korno',uacute:'Latina etlitero u kun dekstra korno',ucirc:'Latina etlitero u kun ĉapelo',uuml:'Latina etlitero u kun tremao',yacute:'Latina etlitero y kun dekstra korno',thorn:'Latina etlitero islanda dorno',yuml:'Latina etlitero y kun tremao',OElig:'Latina ĉeflitera ligaturo Œ',oelig:'Latina etlitera ligaturo œ',372:'Latina ĉeflitero W kun ĉapelo',374:'Latina ĉeflitero Y kun ĉapelo',373:'Latina etlitero w kun ĉapelo',375:'Latina etlitero y kun ĉapelo',sbquo:'Suba 9-citilo',8219:'Supra renversita 9-citilo',bdquo:'Suba 99-citilo',hellip:'Tripunkto',trade:'Varmarka signo',9658:'Nigra sago dekstren',bull:'Bulmarko',rarr:'Sago dekstren',rArr:'Duobla sago dekstren',hArr:'Duobla sago maldekstren',diams:'Nigra kvadrato',asymp:'Preskaŭ egala'});
+CKEDITOR.plugins.setLang( 'specialchar', 'eo', {
+ options: 'Opcioj pri Specialaj Signoj',
+ title: 'Selekti Specialan Signon',
+ toolbar: 'Enmeti Specialan Signon'
+});
diff --git a/plugins/specialchar/lang/et.js b/plugins/specialchar/lang/et.js
index b0f71c4..5217a0d 100644
--- a/plugins/specialchar/lang/et.js
+++ b/plugins/specialchar/lang/et.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','et',{euro:'Euromärk',lsquo:'Alustav ühekordne jutumärk',rsquo:'Lõpetav ühekordne jutumärk',ldquo:'Alustav kahekordne jutumärk',rdquo:'Lõpetav kahekordne jutumärk',ndash:'Enn-kriips',mdash:'Emm-kriips',iexcl:'Pööratud hüüumärk',cent:'Sendimärk',pound:'Naela märk',curren:'Valuutamärk',yen:'Jeeni märk',brvbar:'Katkestatud kriips',sect:'Lõigu märk',uml:'Täpid',copy:'Autoriõiguse märk',ordf:'Feminine ordinal indicator',laquo:'Left-pointing double angle quotation mark',not:'Ei-märk',reg:'Registered sign',macr:'Macron',deg:'Kraadimärk',sup2:'Ülaindeks kaks',sup3:'Ülaindeks kolm',acute:'Acute accent',micro:'Mikro-märk',para:'Pilcrow sign',middot:'Keskpunkt',cedil:'Cedilla',sup1:'Ülaindeks üks',ordm:'Masculine ordinal indicator',raquo:'Right-pointing double angle quotation mark',frac14:'Vulgar fraction one quarter',frac12:'Vulgar fraction one half',frac34:'Vulgar fraction three quarters',iquest:'Inverted question mark',Agrave:'Latin capital letter A with grave accent',Aacute:'Latin capital letter A with acute accent',Acirc:'Latin capital letter A with circumflex',Atilde:'Ladina suur A tildega',Auml:'Latin capital letter A with diaeresis',Aring:'Latin capital letter A with ring above',AElig:'Latin Capital letter Æ',Ccedil:'Latin capital letter C with cedilla',Egrave:'Latin capital letter E with grave accent',Eacute:'Latin capital letter E with acute accent',Ecirc:'Latin capital letter E with circumflex',Euml:'Latin capital letter E with diaeresis',Igrave:'Latin capital letter I with grave accent',Iacute:'Latin capital letter I with acute accent',Icirc:'Latin capital letter I with circumflex',Iuml:'Latin capital letter I with diaeresis',ETH:'Latin capital letter Eth',Ntilde:'Latin capital letter N with tilde',Ograve:'Latin capital letter O with grave accent',Oacute:'Latin capital letter O with acute accent',Ocirc:'Latin capital letter O with circumflex',Otilde:'Latin capital letter O with tilde',Ouml:'Täppidega ladina suur O',times:'Multiplication sign',Oslash:'Latin capital letter O with stroke',Ugrave:'Latin capital letter U with grave accent',Uacute:'Latin capital letter U with acute accent',Ucirc:'Kandilise katusega suur ladina U',Uuml:'Täppidega ladina suur U',Yacute:'Latin capital letter Y with acute accent',THORN:'Latin capital letter Thorn',szlig:'Ladina väike terav s',agrave:'Latin small letter a with grave accent',aacute:'Latin small letter a with acute accent',acirc:'Kandilise katusega ladina väike a',atilde:'Tildega ladina väike a',auml:'Täppidega ladina väike a',aring:'Latin small letter a with ring above',aelig:'Latin small letter æ',ccedil:'Latin small letter c with cedilla',egrave:'Latin small letter e with grave accent',eacute:'Latin small letter e with acute accent',ecirc:'Latin small letter e with circumflex',euml:'Latin small letter e with diaeresis',igrave:'Latin small letter i with grave accent',iacute:'Latin small letter i with acute accent',icirc:'Latin small letter i with circumflex',iuml:'Latin small letter i with diaeresis',eth:'Latin small letter eth',ntilde:'Latin small letter n with tilde',ograve:'Latin small letter o with grave accent',oacute:'Latin small letter o with acute accent',ocirc:'Latin small letter o with circumflex',otilde:'Latin small letter o with tilde',ouml:'Latin small letter o with diaeresis',divide:'Division sign',oslash:'Latin small letter o with stroke',ugrave:'Latin small letter u with grave accent',uacute:'Latin small letter u with acute accent',ucirc:'Latin small letter u with circumflex',uuml:'Latin small letter u with diaeresis',yacute:'Latin small letter y with acute accent',thorn:'Latin small letter thorn',yuml:'Latin small letter y with diaeresis',OElig:'Latin capital ligature OE',oelig:'Latin small ligature oe',372:'Latin capital letter W with circumflex',374:'Latin capital letter Y with circumflex',373:'Latin small letter w with circumflex',375:'Latin small letter y with circumflex',sbquo:'Single low-9 quotation mark',8219:'Single high-reversed-9 quotation mark',bdquo:'Double low-9 quotation mark',hellip:'Horizontal ellipsis',trade:'Trade mark sign',9658:'Black right-pointing pointer',bull:'Bullet',rarr:'Rightwards arrow',rArr:'Rightwards double arrow',hArr:'Left right double arrow',diams:'Black diamond suit',asymp:'Almost equal to'});
+CKEDITOR.plugins.setLang( 'specialchar', 'et', {
+ options: 'Erimärkide valikud',
+ title: 'Erimärgi valimine',
+ toolbar: 'Erimärgi sisestamine'
+});
diff --git a/plugins/specialchar/lang/fa.js b/plugins/specialchar/lang/fa.js
index 25c8792..ece6b73 100644
--- a/plugins/specialchar/lang/fa.js
+++ b/plugins/specialchar/lang/fa.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','fa',{euro:'نشان یورو',lsquo:'علامت نقل قول تکی چپ',rsquo:'علامت نقل قول تکی راست',ldquo:'علامت دوتایی نقل قول چپ',rdquo:'علامت دوتایی نقل قول راست',ndash:'En dash',mdash:'Em dash',iexcl:'علامت گذاری به عنوان علامت تعجب وارونه',cent:'نشان سنت',pound:'نشان پوند',curren:'نشان ارز',yen:'نشان ین',brvbar:'نوار شکسته',sect:'نشان بخش',uml:'Diaeresis',copy:'نشان کپی رایت',ordf:'Feminine ordinal indicator',laquo:'Left-pointing double angle quotation mark',not:'علامت ثبت نشده',reg:'علامت ثبت شده',macr:'Macron',deg:'نشان درجه',sup2:'بالانویس دو',sup3:'بالانویس سه',acute:'لهجه غلیظ',micro:'نشان مایکرو',para:'Pilcrow sign',middot:'نقطه میانی',cedil:'Cedilla',sup1:'Superscript one',ordm:'Masculine ordinal indicator',raquo:'نشان زاویهدار دوتایی نقل قول راست چین',frac14:'Vulgar fraction one quarter',frac12:'Vulgar fraction one half',frac34:'Vulgar fraction three quarters',iquest:'Inverted question mark',Agrave:'Latin capital letter A with grave accent',Aacute:'Latin capital letter A with acute accent',Acirc:'Latin capital letter A with circumflex',Atilde:'Latin capital letter A with tilde',Auml:'Latin capital letter A with diaeresis',Aring:'Latin capital letter A with ring above',AElig:'Latin Capital letter Æ',Ccedil:'Latin capital letter C with cedilla',Egrave:'Latin capital letter E with grave accent',Eacute:'Latin capital letter E with acute accent',Ecirc:'Latin capital letter E with circumflex',Euml:'Latin capital letter E with diaeresis',Igrave:'Latin capital letter I with grave accent',Iacute:'Latin capital letter I with acute accent',Icirc:'Latin capital letter I with circumflex',Iuml:'Latin capital letter I with diaeresis',ETH:'Latin capital letter Eth',Ntilde:'Latin capital letter N with tilde',Ograve:'Latin capital letter O with grave accent',Oacute:'Latin capital letter O with acute accent',Ocirc:'Latin capital letter O with circumflex',Otilde:'Latin capital letter O with tilde',Ouml:'Latin capital letter O with diaeresis',times:'Multiplication sign',Oslash:'Latin capital letter O with stroke',Ugrave:'Latin capital letter U with grave accent',Uacute:'Latin capital letter U with acute accent',Ucirc:'Latin capital letter U with circumflex',Uuml:'Latin capital letter U with diaeresis',Yacute:'Latin capital letter Y with acute accent',THORN:'Latin capital letter Thorn',szlig:'Latin small letter sharp s',agrave:'Latin small letter a with grave accent',aacute:'Latin small letter a with acute accent',acirc:'Latin small letter a with circumflex',atilde:'Latin small letter a with tilde',auml:'Latin small letter a with diaeresis',aring:'Latin small letter a with ring above',aelig:'Latin small letter æ',ccedil:'Latin small letter c with cedilla',egrave:'Latin small letter e with grave accent',eacute:'Latin small letter e with acute accent',ecirc:'Latin small letter e with circumflex',euml:'Latin small letter e with diaeresis',igrave:'Latin small letter i with grave accent',iacute:'Latin small letter i with acute accent',icirc:'Latin small letter i with circumflex',iuml:'Latin small letter i with diaeresis',eth:'Latin small letter eth',ntilde:'Latin small letter n with tilde',ograve:'Latin small letter o with grave accent',oacute:'Latin small letter o with acute accent',ocirc:'Latin small letter o with circumflex',otilde:'Latin small letter o with tilde',ouml:'Latin small letter o with diaeresis',divide:'Division sign',oslash:'Latin small letter o with stroke',ugrave:'Latin small letter u with grave accent',uacute:'Latin small letter u with acute accent',ucirc:'Latin small letter u with circumflex',uuml:'Latin small letter u with diaeresis',yacute:'Latin small letter y with acute accent',thorn:'Latin small letter thorn',yuml:'Latin small letter y with diaeresis',OElig:'Latin capital ligature OE',oelig:'Latin small ligature oe',372:'Latin capital letter W with circumflex',374:'Latin capital letter Y with circumflex',373:'Latin small letter w with circumflex',375:'Latin small letter y with circumflex',sbquo:'Single low-9 quotation mark',8219:'Single high-reversed-9 quotation mark',bdquo:'Double low-9 quotation mark',hellip:'Horizontal ellipsis',trade:'Trade mark sign',9658:'Black right-pointing pointer',bull:'Bullet',rarr:'Rightwards arrow',rArr:'Rightwards double arrow',hArr:'جهتنمای دوتایی چپ به راست',diams:'Black diamond suit',asymp:'تقریبا برابر با'});
+CKEDITOR.plugins.setLang( 'specialchar', 'fa', {
+ options: 'گزینههای نویسههای ویژه',
+ title: 'گزینش نویسهٴ ویژه',
+ toolbar: 'گنجاندن نویسهٴ ویژه'
+});
diff --git a/plugins/specialchar/lang/fi.js b/plugins/specialchar/lang/fi.js
index f710025..5e597dc 100644
--- a/plugins/specialchar/lang/fi.js
+++ b/plugins/specialchar/lang/fi.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','fi',{euro:'Euron merkki',lsquo:'Vasen yksittäinen lainausmerkki',rsquo:'Oikea yksittäinen lainausmerkki',ldquo:'Vasen kaksoislainausmerkki',rdquo:'Oikea kaksoislainausmerkki',ndash:'En dash',mdash:'Em dash',iexcl:'Inverted exclamation mark',cent:'Sentin merkki',pound:'Punnan merkki',curren:'Valuuttamerkki',yen:'Yenin merkki',brvbar:'Broken bar',sect:'Section sign',uml:'Diaeresis',copy:'Copyright sign',ordf:'Feminine ordinal indicator',laquo:'Left-pointing double angle quotation mark',not:'Not sign',reg:'Rekisteröity merkki',macr:'Macron',deg:'Asteen merkki',sup2:'Yläindeksi kaksi',sup3:'Yläindeksi kolme',acute:'Acute accent',micro:'Mikron merkki',para:'Pilcrow sign',middot:'Middle dot',cedil:'Cedilla',sup1:'Yläindeksi yksi',ordm:'Masculine ordinal indicator',raquo:'Right-pointing double angle quotation mark',frac14:'Vulgar fraction one quarter',frac12:'Vulgar fraction one half',frac34:'Vulgar fraction three quarters',iquest:'Ylösalaisin oleva kysymysmerkki',Agrave:'Latin capital letter A with grave accent',Aacute:'Latin capital letter A with acute accent',Acirc:'Latin capital letter A with circumflex',Atilde:'Latin capital letter A with tilde',Auml:'Latin capital letter A with diaeresis',Aring:'Latin capital letter A with ring above',AElig:'Latin Capital letter Æ',Ccedil:'Latin capital letter C with cedilla',Egrave:'Latin capital letter E with grave accent',Eacute:'Latin capital letter E with acute accent',Ecirc:'Latin capital letter E with circumflex',Euml:'Latin capital letter E with diaeresis',Igrave:'Latin capital letter I with grave accent',Iacute:'Latin capital letter I with acute accent',Icirc:'Latin capital letter I with circumflex',Iuml:'Latin capital letter I with diaeresis',ETH:'Latin capital letter Eth',Ntilde:'Latin capital letter N with tilde',Ograve:'Latin capital letter O with grave accent',Oacute:'Latin capital letter O with acute accent',Ocirc:'Latin capital letter O with circumflex',Otilde:'Latin capital letter O with tilde',Ouml:'Latin capital letter O with diaeresis',times:'Kertomerkki',Oslash:'Latin capital letter O with stroke',Ugrave:'Latin capital letter U with grave accent',Uacute:'Latin capital letter U with acute accent',Ucirc:'Latin capital letter U with circumflex',Uuml:'Latin capital letter U with diaeresis',Yacute:'Latin capital letter Y with acute accent',THORN:'Latin capital letter Thorn',szlig:'Latin small letter sharp s',agrave:'Latin small letter a with grave accent',aacute:'Latin small letter a with acute accent',acirc:'Latin small letter a with circumflex',atilde:'Latin small letter a with tilde',auml:'Latin small letter a with diaeresis',aring:'Latin small letter a with ring above',aelig:'Latin small letter æ',ccedil:'Latin small letter c with cedilla',egrave:'Latin small letter e with grave accent',eacute:'Latin small letter e with acute accent',ecirc:'Latin small letter e with circumflex',euml:'Latin small letter e with diaeresis',igrave:'Latin small letter i with grave accent',iacute:'Latin small letter i with acute accent',icirc:'Latin small letter i with circumflex',iuml:'Latin small letter i with diaeresis',eth:'Latin small letter eth',ntilde:'Latin small letter n with tilde',ograve:'Latin small letter o with grave accent',oacute:'Latin small letter o with acute accent',ocirc:'Latin small letter o with circumflex',otilde:'Latin small letter o with tilde',ouml:'Latin small letter o with diaeresis',divide:'Jakomerkki',oslash:'Latin small letter o with stroke',ugrave:'Latin small letter u with grave accent',uacute:'Latin small letter u with acute accent',ucirc:'Latin small letter u with circumflex',uuml:'Latin small letter u with diaeresis',yacute:'Latin small letter y with acute accent',thorn:'Latin small letter thorn',yuml:'Latin small letter y with diaeresis',OElig:'Latin capital ligature OE',oelig:'Latin small ligature oe',372:'Latin capital letter W with circumflex',374:'Latin capital letter Y with circumflex',373:'Latin small letter w with circumflex',375:'Latin small letter y with circumflex',sbquo:'Single low-9 quotation mark',8219:'Single high-reversed-9 quotation mark',bdquo:'Double low-9 quotation mark',hellip:'Horizontal ellipsis',trade:'Tavaramerkki merkki',9658:'Black right-pointing pointer',bull:'Bullet',rarr:'Nuoli oikealle',rArr:'Kaksoisnuoli oikealle',hArr:'Kaksoisnuoli oikealle ja vasemmalle',diams:'Black diamond suit',asymp:'Noin'});
+CKEDITOR.plugins.setLang( 'specialchar', 'fi', {
+ options: 'Erikoismerkin ominaisuudet',
+ title: 'Valitse erikoismerkki',
+ toolbar: 'Lisää erikoismerkki'
+});
diff --git a/plugins/specialchar/lang/fr.js b/plugins/specialchar/lang/fr.js
index b128113..343340c 100644
--- a/plugins/specialchar/lang/fr.js
+++ b/plugins/specialchar/lang/fr.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','fr',{euro:'Symbole Euro',lsquo:'Guillemet simple ouvrant',rsquo:'Guillemet simple fermant',ldquo:'Guillemet double ouvrant',rdquo:'Guillemet double fermant',ndash:'Tiret haut',mdash:'Tiret bas underscore',iexcl:"Point d'exclamation inversé",cent:'Symbole Cent',pound:'Symbole Livre Sterling',curren:'Symbole monétaire',yen:'Symbole Yen',brvbar:'Barre verticale scindée',sect:'Section',uml:'Tréma',copy:'Symbole Copyright',ordf:'Indicateur ordinal féminin',laquo:'Guillemet français ouvrant',not:'Crochet de négation',reg:'Marque déposée',macr:'Macron',deg:'Degré',sup2:'Exposant 2',sup3:'\\tExposant 3',acute:'Accent aigu',micro:'Omicron',para:'Paragraphe',middot:'Point médian',cedil:'Cédille',sup1:'\\tExposant 1',ordm:'Indicateur ordinal masculin',raquo:'Guillemet français fermant',frac14:'Un quart',frac12:'Un demi',frac34:'Trois quarts',iquest:"Point d'interrogation inversé",Agrave:'A majuscule accent grave',Aacute:'A majuscule accent aigu',Acirc:'A majuscule accent circonflexe',Atilde:'A majuscule avec caron',Auml:'A majuscule tréma',Aring:'A majuscule avec un rond au-dessus',AElig:'Æ majuscule ligaturés',Ccedil:'C majuscule cédille',Egrave:'E majuscule accent grave',Eacute:'E majuscule accent aigu',Ecirc:'E majuscule accent circonflexe',Euml:'E majuscule tréma',Igrave:'I majuscule accent grave',Iacute:'I majuscule accent aigu',Icirc:'I majuscule accent circonflexe',Iuml:'I majuscule tréma',ETH:'Lettre majuscule islandaise ED',Ntilde:'N majuscule avec caron',Ograve:'O majuscule accent grave',Oacute:'O majuscule accent aigu',Ocirc:'O majuscule accent circonflexe',Otilde:'O majuscule avec caron',Ouml:'O majuscule tréma',times:'Multiplication',Oslash:'O majuscule barré',Ugrave:'U majuscule accent grave',Uacute:'U majuscule accent aigu',Ucirc:'U majuscule accent circonflexe',Uuml:'U majuscule tréma',Yacute:'Y majuscule accent aigu',THORN:'Lettre islandaise Thorn majuscule',szlig:'Lettre minuscule allemande s dur',agrave:'a minuscule accent grave',aacute:'a minuscule accent aigu',acirc:'a minuscule accent circonflexe',atilde:'a minuscule avec caron',auml:'a minuscule tréma',aring:'a minuscule avec un rond au-dessus',aelig:'æ minuscule ligaturés',ccedil:'c minuscule cédille',egrave:'e minuscule accent grave',eacute:'e minuscule accent aigu',ecirc:'e minuscule accent circonflexe',euml:'e minuscule tréma',igrave:'i minuscule accent grave',iacute:'i minuscule accent aigu',icirc:'i minuscule accent circonflexe',iuml:'i minuscule tréma',eth:'Lettre minuscule islandaise ED',ntilde:'n minuscule avec caron',ograve:'o minuscule accent grave',oacute:'o minuscule accent aigu',ocirc:'o minuscule accent circonflexe',otilde:'o minuscule avec caron',ouml:'o minuscule tréma',divide:'Division',oslash:'o minuscule barré',ugrave:'u minuscule accent grave',uacute:'u minuscule accent aigu',ucirc:'u minuscule accent circonflexe',uuml:'u minuscule tréma',yacute:'y minuscule accent aigu',thorn:'Lettre islandaise thorn minuscule',yuml:'y minuscule tréma',OElig:'ligature majuscule latine Œ',oelig:'ligature minuscule latine œ',372:'W majuscule accent circonflexe',374:'Y majuscule accent circonflexe',373:'w minuscule accent circonflexe',375:'y minuscule accent circonflexe',sbquo:'Guillemet simple fermant (anglais)',8219:'Guillemet-virgule supérieur culbuté',bdquo:'Guillemet-virgule double inférieur',hellip:'Points de suspension',trade:'Marque commerciale (trade mark)',9658:'Flèche noire pointant vers la droite',bull:'Gros point médian',rarr:'Flèche vers la droite',rArr:'Double flèche vers la droite',hArr:'Double flèche vers la gauche',diams:'Carreau noir',asymp:'Presque égal'});
+CKEDITOR.plugins.setLang( 'specialchar', 'fr', {
+ options: 'Options des caractères spéciaux',
+ title: 'Sélectionnez un caractère',
+ toolbar: 'Insérer un caractère spécial'
+});
diff --git a/plugins/specialchar/lang/hr.js b/plugins/specialchar/lang/hr.js
index bd5629f..f2e19ef 100644
--- a/plugins/specialchar/lang/hr.js
+++ b/plugins/specialchar/lang/hr.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','hr',{euro:'Euro znak',lsquo:'Lijevi jednostruki navodnik',rsquo:'Desni jednostruki navodnik',ldquo:'Lijevi dvostruki navodnik',rdquo:'Desni dvostruki navodnik',ndash:'En crtica',mdash:'Em crtica',iexcl:'Naopaki uskličnik',cent:'Cent znak',pound:'Funta znak',curren:'Znak valute',yen:'Yen znak',brvbar:'Potrgana prečka',sect:'Znak odjeljka',uml:'Diaeresis',copy:'Copyright znak',ordf:'Feminine ordinal indicator',laquo:'Lijevi dvostruki uglati navodnik',not:'Not znak',reg:'Registered znak',macr:'Macron',deg:'Stupanj znak',sup2:'Superscript two',sup3:'Superscript three',acute:'Acute accent',micro:'Micro sign',para:'Pilcrow sign',middot:'Srednja točka',cedil:'Cedilla',sup1:'Superscript one',ordm:'Masculine ordinal indicator',raquo:'Desni dvostruku uglati navodnik',frac14:'Vulgar fraction one quarter',frac12:'Vulgar fraction one half',frac34:'Vulgar fraction three quarters',iquest:'Naopaki upitnik',Agrave:'Veliko latinsko slovo A s akcentom',Aacute:'Latin capital letter A with acute accent',Acirc:'Latin capital letter A with circumflex',Atilde:'Latin capital letter A with tilde',Auml:'Latin capital letter A with diaeresis',Aring:'Latin capital letter A with ring above',AElig:'Latin Capital letter Æ',Ccedil:'Latin capital letter C with cedilla',Egrave:'Latin capital letter E with grave accent',Eacute:'Latin capital letter E with acute accent',Ecirc:'Latin capital letter E with circumflex',Euml:'Latin capital letter E with diaeresis',Igrave:'Latin capital letter I with grave accent',Iacute:'Latin capital letter I with acute accent',Icirc:'Latin capital letter I with circumflex',Iuml:'Latin capital letter I with diaeresis',ETH:'Latin capital letter Eth',Ntilde:'Latin capital letter N with tilde',Ograve:'Latin capital letter O with grave accent',Oacute:'Latin capital letter O with acute accent',Ocirc:'Latin capital letter O with circumflex',Otilde:'Latin capital letter O with tilde',Ouml:'Latin capital letter O with diaeresis',times:'Multiplication sign',Oslash:'Latin capital letter O with stroke',Ugrave:'Latin capital letter U with grave accent',Uacute:'Latin capital letter U with acute accent',Ucirc:'Latin capital letter U with circumflex',Uuml:'Latin capital letter U with diaeresis',Yacute:'Latin capital letter Y with acute accent',THORN:'Latin capital letter Thorn',szlig:'Latin small letter sharp s',agrave:'Latin small letter a with grave accent',aacute:'Latin small letter a with acute accent',acirc:'Latin small letter a with circumflex',atilde:'Latin small letter a with tilde',auml:'Latin small letter a with diaeresis',aring:'Latin small letter a with ring above',aelig:'Latin small letter æ',ccedil:'Latin small letter c with cedilla',egrave:'Latin small letter e with grave accent',eacute:'Latin small letter e with acute accent',ecirc:'Latin small letter e with circumflex',euml:'Latin small letter e with diaeresis',igrave:'Latin small letter i with grave accent',iacute:'Latin small letter i with acute accent',icirc:'Latin small letter i with circumflex',iuml:'Latin small letter i with diaeresis',eth:'Latin small letter eth',ntilde:'Latin small letter n with tilde',ograve:'Latin small letter o with grave accent',oacute:'Latin small letter o with acute accent',ocirc:'Latin small letter o with circumflex',otilde:'Latin small letter o with tilde',ouml:'Latin small letter o with diaeresis',divide:'Division sign',oslash:'Latin small letter o with stroke',ugrave:'Latin small letter u with grave accent',uacute:'Latin small letter u with acute accent',ucirc:'Latin small letter u with circumflex',uuml:'Latin small letter u with diaeresis',yacute:'Latin small letter y with acute accent',thorn:'Latin small letter thorn',yuml:'Latin small letter y with diaeresis',OElig:'Latin capital ligature OE',oelig:'Latin small ligature oe',372:'Latin capital letter W with circumflex',374:'Latin capital letter Y with circumflex',373:'Latin small letter w with circumflex',375:'Latin small letter y with circumflex',sbquo:'Single low-9 quotation mark',8219:'Single high-reversed-9 quotation mark',bdquo:'Double low-9 quotation mark',hellip:'Horizontal ellipsis',trade:'Trade mark sign',9658:'Black right-pointing pointer',bull:'Bullet',rarr:'Rightwards arrow',rArr:'Rightwards double arrow',hArr:'Left right double arrow',diams:'Black diamond suit',asymp:'Almost equal to'});
+CKEDITOR.plugins.setLang( 'specialchar', 'hr', {
+ options: 'Opcije specijalnih znakova',
+ title: 'Odaberite posebni karakter',
+ toolbar: 'Ubaci posebne znakove'
+});
diff --git a/plugins/specialchar/lang/it.js b/plugins/specialchar/lang/it.js
index 735a91f..6fd8516 100644
--- a/plugins/specialchar/lang/it.js
+++ b/plugins/specialchar/lang/it.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','it',{euro:'Simbolo Euro',lsquo:'Virgoletta singola sinistra',rsquo:'Virgoletta singola destra',ldquo:'Virgolette aperte',rdquo:'Virgolette chiuse',ndash:'Trattino',mdash:'Trattino lungo',iexcl:'Punto esclavamativo invertito',cent:'Simbolo Cent',pound:'Simbolo Sterlina',curren:'Simbolo Moneta',yen:'Simbolo Yen',brvbar:'Barra interrotta',sect:'Simbolo di sezione',uml:'Dieresi',copy:'Simbolo Copyright',ordf:'Indicatore ordinale femminile',laquo:'Virgolette basse aperte',not:'Nessun segno',reg:'Simbolo Registrato',macr:'Macron',deg:'Simbolo Grado',sup2:'Apice Due',sup3:'Apice Tre',acute:'Accento acuto',micro:'Simbolo Micro',para:'Simbolo Paragrafo',middot:'Punto centrale',cedil:'Cediglia',sup1:'Apice Uno',ordm:'Indicatore ordinale maschile',raquo:'Virgolette basse chiuse',frac14:'Frazione volgare un quarto',frac12:'Frazione volgare un mezzo',frac34:'Frazione volgare tre quarti',iquest:'Punto interrogativo invertito',Agrave:'Lettera maiuscola latina A con accento grave',Aacute:'Lettera maiuscola latina A con accento acuto',Acirc:'Lettera maiuscola latina A con accento circonflesso',Atilde:'Lettera maiuscola latina A con tilde',Auml:'Lettera maiuscola latina A con dieresi',Aring:'Lettera maiuscola latina A con anello sopra',AElig:'Lettera maiuscola latina AE',Ccedil:'Lettera maiuscola latina C con cediglia',Egrave:'Lettera maiuscola latina E con accento grave',Eacute:'Lettera maiuscola latina E con accento acuto',Ecirc:'Lettera maiuscola latina E con accento circonflesso',Euml:'Lettera maiuscola latina E con dieresi',Igrave:'Lettera maiuscola latina I con accento grave',Iacute:'Lettera maiuscola latina I con accento acuto',Icirc:'Lettera maiuscola latina I con accento circonflesso',Iuml:'Lettera maiuscola latina I con dieresi',ETH:'Lettera maiuscola latina Eth',Ntilde:'Lettera maiuscola latina N con tilde',Ograve:'Lettera maiuscola latina O con accento grave',Oacute:'Lettera maiuscola latina O con accento acuto',Ocirc:'Lettera maiuscola latina O con accento circonflesso',Otilde:'Lettera maiuscola latina O con tilde',Ouml:'Lettera maiuscola latina O con dieresi',times:'Simbolo di moltiplicazione',Oslash:'Lettera maiuscola latina O barrata',Ugrave:'Lettera maiuscola latina U con accento grave',Uacute:'Lettera maiuscola latina U con accento acuto',Ucirc:'Lettera maiuscola latina U con accento circonflesso',Uuml:'Lettera maiuscola latina U con accento circonflesso',Yacute:'Lettera maiuscola latina Y con accento acuto',THORN:'Lettera maiuscola latina Thorn',szlig:'Lettera latina minuscola doppia S',agrave:'Lettera minuscola latina a con accento grave',aacute:'Lettera minuscola latina a con accento acuto',acirc:'Lettera minuscola latina a con accento circonflesso',atilde:'Lettera minuscola latina a con tilde',auml:'Lettera minuscola latina a con dieresi',aring:'Lettera minuscola latina a con anello superiore',aelig:'Lettera minuscola latina ae',ccedil:'Lettera minuscola latina c con cediglia',egrave:'Lettera minuscola latina e con accento grave',eacute:'Lettera minuscola latina e con accento acuto',ecirc:'Lettera minuscola latina e con accento circonflesso',euml:'Lettera minuscola latina e con dieresi',igrave:'Lettera minuscola latina i con accento grave',iacute:'Lettera minuscola latina i con accento acuto',icirc:'Lettera minuscola latina i con accento circonflesso',iuml:'Lettera minuscola latina i con dieresi',eth:'Lettera minuscola latina eth',ntilde:'Lettera minuscola latina n con tilde',ograve:'Lettera minuscola latina o con accento grave',oacute:'Lettera minuscola latina o con accento acuto',ocirc:'Lettera minuscola latina o con accento circonflesso',otilde:'Lettera minuscola latina o con tilde',ouml:'Lettera minuscola latina o con dieresi',divide:'Simbolo di divisione',oslash:'Lettera minuscola latina o barrata',ugrave:'Lettera minuscola latina u con accento grave',uacute:'Lettera minuscola latina u con accento acuto',ucirc:'Lettera minuscola latina u con accento circonflesso',uuml:'Lettera minuscola latina u con dieresi',yacute:'Lettera minuscola latina y con accento acuto',thorn:'Lettera minuscola latina thorn',yuml:'Lettera minuscola latina y con dieresi',OElig:'Legatura maiuscola latina OE',oelig:'Legatura minuscola latina oe',372:'Lettera maiuscola latina W con accento circonflesso',374:'Lettera maiuscola latina Y con accento circonflesso',373:'Lettera minuscola latina w con accento circonflesso',375:'Lettera minuscola latina y con accento circonflesso',sbquo:'Singola virgoletta bassa low-9',8219:'Singola virgoletta bassa low-9 inversa',bdquo:'Doppia virgoletta bassa low-9',hellip:'Ellissi orizzontale',trade:'Simbolo TM',9658:'Puntatore nero rivolto verso destra',bull:'Punto',rarr:'Freccia verso destra',rArr:'Doppia freccia verso destra',hArr:'Doppia freccia sinistra destra',diams:'Simbolo nero diamante',asymp:'Quasi uguale a'});
+CKEDITOR.plugins.setLang( 'specialchar', 'it', {
+ options: 'Opzioni carattere speciale',
+ title: 'Seleziona carattere speciale',
+ toolbar: 'Inserisci carattere speciale'
+});
diff --git a/plugins/specialchar/lang/nb.js b/plugins/specialchar/lang/nb.js
index 86910bf..2bfadd8 100644
--- a/plugins/specialchar/lang/nb.js
+++ b/plugins/specialchar/lang/nb.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','nb',{euro:'Eurosymbol',lsquo:'Venstre enkelt anførselstegn',rsquo:'Høyre enkelt anførselstegn',ldquo:'Venstre dobbelt anførselstegn',rdquo:'Høyre anførsesltegn',ndash:'Kort tankestrek',mdash:'Lang tankestrek',iexcl:'Omvendt utropstegn',cent:'Centsymbol',pound:'Pundsymbol',curren:'Valutategn',yen:'Yensymbol',brvbar:'Brutt loddrett strek',sect:'Paragraftegn',uml:'Tøddel',copy:'Copyrighttegn',ordf:'Feminin ordensindikator',laquo:'Venstre anførselstegn',not:'Negasjonstegn',reg:'Registrert varemerke-tegn',macr:'Makron',deg:'Gradsymbol',sup2:'Hevet totall',sup3:'Hevet tretall',acute:'Akutt aksent',micro:'Mikrosymbol',para:'Avsnittstegn',middot:'Midtstilt prikk',cedil:'Cedille',sup1:'Hevet ettall',ordm:'Maskulin ordensindikator',raquo:'Høyre anførselstegn',frac14:'Fjerdedelsbrøk',frac12:'Halvbrøk',frac34:'Tre fjerdedelers brøk',iquest:'Omvendt spørsmålstegn',Agrave:'Stor A med grav aksent',Aacute:'Stor A med akutt aksent',Acirc:'Stor A med cirkumfleks',Atilde:'Stor A med tilde',Auml:'Stor A med tøddel',Aring:'Stor Å',AElig:'Stor Æ',Ccedil:'Stor C med cedille',Egrave:'Stor E med grav aksent',Eacute:'Stor E med akutt aksent',Ecirc:'Stor E med cirkumfleks',Euml:'Stor E med tøddel',Igrave:'Stor I med grav aksent',Iacute:'Stor I med akutt aksent',Icirc:'Stor I med cirkumfleks',Iuml:'Stor I med tøddel',ETH:'Stor Edd/stungen D',Ntilde:'Stor N med tilde',Ograve:'Stor O med grav aksent',Oacute:'Stor O med akutt aksent',Ocirc:'Stor O med cirkumfleks',Otilde:'Stor O med tilde',Ouml:'Stor O med tøddel',times:'Multiplikasjonstegn',Oslash:'Stor Ø',Ugrave:'Stor U med grav aksent',Uacute:'Stor U med akutt aksent',Ucirc:'Stor U med cirkumfleks',Uuml:'Stor U med tøddel',Yacute:'Stor Y med akutt aksent',THORN:'Stor Thorn',szlig:'Liten dobbelt-s/Eszett',agrave:'Liten a med grav aksent',aacute:'Liten a med akutt aksent',acirc:'Liten a med cirkumfleks',atilde:'Liten a med tilde',auml:'Liten a med tøddel',aring:'Liten å',aelig:'Liten æ',ccedil:'Liten c med cedille',egrave:'Liten e med grav aksent',eacute:'Liten e med akutt aksent',ecirc:'Liten e med cirkumfleks',euml:'Liten e med tøddel',igrave:'Liten i med grav aksent',iacute:'Liten i med akutt aksent',icirc:'Liten i med cirkumfleks',iuml:'Liten i med tøddel',eth:'Liten edd/stungen d',ntilde:'Liten n med tilde',ograve:'Liten o med grav aksent',oacute:'Liten o med akutt aksent',ocirc:'Liten o med cirkumfleks',otilde:'Liten o med tilde',ouml:'Liten o med tøddel',divide:'Divisjonstegn',oslash:'Liten ø',ugrave:'Liten u med grav aksent',uacute:'Liten u med akutt aksent',ucirc:'Liten u med cirkumfleks',uuml:'Liten u med tøddel',yacute:'Liten y med akutt aksent',thorn:'Liten thorn',yuml:'Liten y med tøddel',OElig:'Stor ligatur av O og E',oelig:'Liten ligatur av o og e',372:'Stor W med cirkumfleks',374:'Stor Y med cirkumfleks',373:'Liten w med cirkumfleks',375:'Liten y med cirkumfleks',sbquo:'Enkelt lavt 9-anførselstegn',8219:'Enkelt høyt reversert 9-anførselstegn',bdquo:'Dobbelt lavt 9-anførselstegn',hellip:'Ellipse',trade:'Varemerkesymbol',9658:'Svart høyrevendt peker',bull:'Tykk interpunkt',rarr:'Høyrevendt pil',rArr:'Dobbel høyrevendt pil',hArr:'Dobbel venstrevendt pil',diams:'Svart ruter',asymp:'Omtrent likhetstegn'});
+CKEDITOR.plugins.setLang( 'specialchar', 'nb', {
+ options: 'Alternativer for spesialtegn',
+ title: 'Velg spesialtegn',
+ toolbar: 'Sett inn spesialtegn'
+});
diff --git a/plugins/specialchar/lang/nl.js b/plugins/specialchar/lang/nl.js
index 56876fb..839e1e4 100644
--- a/plugins/specialchar/lang/nl.js
+++ b/plugins/specialchar/lang/nl.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','nl',{euro:'Euro-teken',lsquo:'Linker enkel aanhalingsteken',rsquo:'Rechter enkel aanhalingsteken',ldquo:'Linker dubbel aanhalingsteken',rdquo:'Rechter dubbel aanhalingsteken',ndash:'En dash',mdash:'Em dash',iexcl:'Omgekeerd uitroepteken',cent:'Cent-teken',pound:'Pond-teken',curren:'Valuta-teken',yen:'Yen-teken',brvbar:'Gebroken streep',sect:'Paragraaf-teken',uml:'Trema',copy:'Copyright-teken',ordf:'Vrouwelijk ordinaal',laquo:'Linker guillemet',not:'Ongelijk-teken',reg:'Geregistreerd handelsmerk-teken',macr:'Macron',deg:'Graden-teken',sup2:'Superscript twee',sup3:'Superscript drie',acute:'Accent aigu',micro:'Mico-teken',para:'Alinea-teken',middot:'Halfhoge punt',cedil:'Cedille',sup1:'Superscript een',ordm:'Mannelijk ordinaal',raquo:'Rechter guillemet',frac14:'Breuk kwart',frac12:'Breuk half',frac34:'Breuk driekwart',iquest:'Omgekeerd vraagteken',Agrave:'Latijnse hoofdletter A met een accent grave',Aacute:'Latijnse hoofdletter A met een accent aigu',Acirc:'Latijnse hoofdletter A met een circonflexe',Atilde:'Latijnse hoofdletter A met een tilde',Auml:'Latijnse hoofdletter A met een trema',Aring:'Latijnse hoofdletter A met een corona',AElig:'Latijnse hoofdletter Æ',Ccedil:'Latijnse hoofdletter C met een cedille',Egrave:'Latijnse hoofdletter E met een accent grave',Eacute:'Latijnse hoofdletter E met een accent aigu',Ecirc:'Latijnse hoofdletter E met een circonflexe',Euml:'Latijnse hoofdletter E met een trema',Igrave:'Latijnse hoofdletter I met een accent grave',Iacute:'Latijnse hoofdletter I met een accent aigu',Icirc:'Latijnse hoofdletter I met een circonflexe',Iuml:'Latijnse hoofdletter I met een trema',ETH:'Latijnse hoofdletter Eth',Ntilde:'Latijnse hoofdletter N met een tilde',Ograve:'Latijnse hoofdletter O met een accent grave',Oacute:'Latijnse hoofdletter O met een accent aigu',Ocirc:'Latijnse hoofdletter O met een circonflexe',Otilde:'Latijnse hoofdletter O met een tilde',Ouml:'Latijnse hoofdletter O met een trema',times:'Maal-teken',Oslash:'Latijnse hoofdletter O met een schuine streep',Ugrave:'Latijnse hoofdletter U met een accent grave',Uacute:'Latijnse hoofdletter U met een accent aigu',Ucirc:'Latijnse hoofdletter U met een circonflexe',Uuml:'Latijnse hoofdletter U met een trema',Yacute:'Latijnse hoofdletter Y met een accent aigu',THORN:'Latijnse hoofdletter Thorn',szlig:'Latijnse kleine ringel-s',agrave:'Latijnse kleine letter a met een accent grave',aacute:'Latijnse kleine letter a met een accent aigu',acirc:'Latijnse kleine letter a met een circonflexe',atilde:'Latijnse kleine letter a met een tilde',auml:'Latijnse kleine letter a met een trema',aring:'Latijnse kleine letter a met een corona',aelig:'Latijnse kleine letter æ',ccedil:'Latijnse kleine letter c met een cedille',egrave:'Latijnse kleine letter e met een accent grave',eacute:'Latijnse kleine letter e met een accent aigu',ecirc:'Latijnse kleine letter e met een circonflexe',euml:'Latijnse kleine letter e met een trema',igrave:'Latijnse kleine letter i met een accent grave',iacute:'Latijnse kleine letter i met een accent aigu',icirc:'Latijnse kleine letter i met een circonflexe',iuml:'Latijnse kleine letter i met een trema',eth:'Latijnse kleine letter eth',ntilde:'Latijnse kleine letter n met een tilde',ograve:'Latijnse kleine letter o met een accent grave',oacute:'Latijnse kleine letter o met een accent aigu',ocirc:'Latijnse kleine letter o met een circonflexe',otilde:'Latijnse kleine letter o met een tilde',ouml:'Latijnse kleine letter o met een trema',divide:'Deel-teken',oslash:'Latijnse kleine letter o met een schuine streep',ugrave:'Latijnse kleine letter u met een accent grave',uacute:'Latijnse kleine letter u met een accent aigu',ucirc:'Latijnse kleine letter u met een circonflexe',uuml:'Latijnse kleine letter u met een trema',yacute:'Latijnse kleine letter y met een accent aigu',thorn:'Latijnse kleine letter thorn',yuml:'Latijnse kleine letter y met een trema',OElig:'Latijnse hoofdletter Œ',oelig:'Latijnse kleine letter œ',372:'Latijnse hoofdletter W met een circonflexe',374:'Latijnse hoofdletter Y met een circonflexe',373:'Latijnse kleine letter w met een circonflexe',375:'Latijnse kleine letter y met een circonflexe',sbquo:'Lage enkele aanhalingsteken',8219:'Hoge omgekeerde enkele aanhalingsteken',bdquo:'Lage dubbele aanhalingsteken',hellip:'Beletselteken',trade:'Trademark-teken',9658:'Zwarte driehoek naar rechts',bull:'Bullet',rarr:'Pijl naar rechts',rArr:'Dubbele pijl naar rechts',hArr:'Dubbele pijl naar links',diams:'Zwart ruitje',asymp:'Benaderingsteken'});
+CKEDITOR.plugins.setLang( 'specialchar', 'nl', {
+ options: 'Speciale tekens opties',
+ title: 'Selecteer speciaal teken',
+ toolbar: 'Speciaal teken invoegen'
+});
diff --git a/plugins/specialchar/lang/no.js b/plugins/specialchar/lang/no.js
index 2ced887..afecb0a 100644
--- a/plugins/specialchar/lang/no.js
+++ b/plugins/specialchar/lang/no.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','no',{euro:'Eurosymbol',lsquo:'Venstre enkelt anførselstegn',rsquo:'Høyre enkelt anførselstegn',ldquo:'Venstre dobbelt anførselstegn',rdquo:'Høyre anførsesltegn',ndash:'Kort tankestrek',mdash:'Lang tankestrek',iexcl:'Omvendt utropstegn',cent:'Centsymbol',pound:'Pundsymbol',curren:'Valutategn',yen:'Yensymbol',brvbar:'Brutt loddrett strek',sect:'Paragraftegn',uml:'Tøddel',copy:'Copyrighttegn',ordf:'Feminin ordensindikator',laquo:'Venstre anførselstegn',not:'Negasjonstegn',reg:'Registrert varemerke-tegn',macr:'Makron',deg:'Gradsymbol',sup2:'Hevet totall',sup3:'Hevet tretall',acute:'Akutt aksent',micro:'Mikrosymbol',para:'Avsnittstegn',middot:'Midtstilt prikk',cedil:'Cedille',sup1:'Hevet ettall',ordm:'Maskulin ordensindikator',raquo:'Høyre anførselstegn',frac14:'Fjerdedelsbrøk',frac12:'Halvbrøk',frac34:'Tre fjerdedelers brøk',iquest:'Omvendt spørsmålstegn',Agrave:'Stor A med grav aksent',Aacute:'Stor A med akutt aksent',Acirc:'Stor A med cirkumfleks',Atilde:'Stor A med tilde',Auml:'Stor A med tøddel',Aring:'Stor Å',AElig:'Stor Æ',Ccedil:'Stor C med cedille',Egrave:'Stor E med grav aksent',Eacute:'Stor E med akutt aksent',Ecirc:'Stor E med cirkumfleks',Euml:'Stor E med tøddel',Igrave:'Stor I med grav aksent',Iacute:'Stor I med akutt aksent',Icirc:'Stor I med cirkumfleks',Iuml:'Stor I med tøddel',ETH:'Stor Edd/stungen D',Ntilde:'Stor N med tilde',Ograve:'Stor O med grav aksent',Oacute:'Stor O med akutt aksent',Ocirc:'Stor O med cirkumfleks',Otilde:'Stor O med tilde',Ouml:'Stor O med tøddel',times:'Multiplikasjonstegn',Oslash:'Stor Ø',Ugrave:'Stor U med grav aksent',Uacute:'Stor U med akutt aksent',Ucirc:'Stor U med cirkumfleks',Uuml:'Stor U med tøddel',Yacute:'Stor Y med akutt aksent',THORN:'Stor Thorn',szlig:'Liten dobbelt-s/Eszett',agrave:'Liten a med grav aksent',aacute:'Liten a med akutt aksent',acirc:'Liten a med cirkumfleks',atilde:'Liten a med tilde',auml:'Liten a med tøddel',aring:'Liten å',aelig:'Liten æ',ccedil:'Liten c med cedille',egrave:'Liten e med grav aksent',eacute:'Liten e med akutt aksent',ecirc:'Liten e med cirkumfleks',euml:'Liten e med tøddel',igrave:'Liten i med grav aksent',iacute:'Liten i med akutt aksent',icirc:'Liten i med cirkumfleks',iuml:'Liten i med tøddel',eth:'Liten edd/stungen d',ntilde:'Liten n med tilde',ograve:'Liten o med grav aksent',oacute:'Liten o med akutt aksent',ocirc:'Liten o med cirkumfleks',otilde:'Liten o med tilde',ouml:'Liten o med tøddel',divide:'Divisjonstegn',oslash:'Liten ø',ugrave:'Liten u med grav aksent',uacute:'Liten u med akutt aksent',ucirc:'Liten u med cirkumfleks',uuml:'Liten u med tøddel',yacute:'Liten y med akutt aksent',thorn:'Liten thorn',yuml:'Liten y med tøddel',OElig:'Stor ligatur av O og E',oelig:'Liten ligatur av o og e',372:'Stor W med cirkumfleks',374:'Stor Y med cirkumfleks',373:'Liten w med cirkumfleks',375:'Liten y med cirkumfleks',sbquo:'Enkelt lavt 9-anførselstegn',8219:'Enkelt høyt reversert 9-anførselstegn',bdquo:'Dobbelt lavt 9-anførselstegn',hellip:'Ellipse',trade:'Varemerkesymbol',9658:'Svart høyrevendt peker',bull:'Tykk interpunkt',rarr:'Høyrevendt pil',rArr:'Dobbel høyrevendt pil',hArr:'Dobbel venstrevendt pil',diams:'Svart ruter',asymp:'Omtrent likhetstegn'});
+CKEDITOR.plugins.setLang( 'specialchar', 'no', {
+ options: 'Alternativer for spesialtegn',
+ title: 'Velg spesialtegn',
+ toolbar: 'Sett inn spesialtegn'
+});
diff --git a/plugins/specialchar/lang/tr.js b/plugins/specialchar/lang/tr.js
index 8384241..8814631 100644
--- a/plugins/specialchar/lang/tr.js
+++ b/plugins/specialchar/lang/tr.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','tr',{euro:'Euro işareti',lsquo:'Sol tek tırnak işareti',rsquo:'Sağ tek tırnak işareti',ldquo:'Sol çift tırnak işareti',rdquo:'Sağ çift tırnak işareti',ndash:'En tire',mdash:'Em tire',iexcl:'Ters ünlem işareti',cent:'Cent işareti',pound:'Pound işareti',curren:'Para birimi işareti',yen:'Yen işareti',brvbar:'Kırık bar',sect:'Bölüm işareti',uml:'İki sesli harfin ayrılması',copy:'Telif hakkı işareti',ordf:'Dişil sıralı gösterge',laquo:'Sol-işaret çift açı tırnak işareti',not:'Not işareti',reg:'Kayıtlı işareti',macr:'Makron',deg:'Derece işareti',sup2:'İkili üstsimge',sup3:'Üçlü üstsimge',acute:'Aksan işareti',micro:'Mikro işareti',para:'Pilcrow işareti',middot:'Orta nokta',cedil:'Kedilla',sup1:'Üstsimge',ordm:'Eril sıralı gösterge',raquo:'Sağ işaret çift açı tırnak işareti',frac14:'Bayağı kesrin dörtte biri',frac12:'Bayağı kesrin bir yarım',frac34:'Bayağı kesrin dörtte üç',iquest:'Ters soru işareti',Agrave:'Aksanlı latin harfi',Aacute:'Aşırı aksanıyla Latin harfi',Acirc:'Çarpık Latin harfi',Atilde:'Tilde latin harfi',Auml:'Sesli harf ayrılımlıı latin harfi',Aring:'Halkalı latin büyük A harfi',AElig:'Latin büyük Æ harfi',Ccedil:'Latin büyük C harfi ile kedilla',Egrave:'Aksanlı latin büyük E harfi',Eacute:'Aşırı vurgulu latin büyük E harfi',Ecirc:'Çarpık latin büyük E harfi',Euml:'Sesli harf ayrılımlıı latin büyük E harfi',Igrave:'Aksanlı latin büyük I harfi',Iacute:'Aşırı aksanlı latin büyük I harfi',Icirc:'Çarpık latin büyük I harfi',Iuml:'Sesli harf ayrılımlıı latin büyük I harfi',ETH:'Latin büyük Eth harfi',Ntilde:'Tildeli latin büyük N harfi',Ograve:'Aksanlı latin büyük O harfi',Oacute:'Aşırı aksanlı latin büyük O harfi',Ocirc:'Çarpık latin büyük O harfi',Otilde:'Tildeli latin büyük O harfi',Ouml:'Sesli harf ayrılımlı latin büyük O harfi',times:'Çarpma işareti',Oslash:'Vurgulu latin büyük O harfi',Ugrave:'Aksanlı latin büyük U harfi',Uacute:'Aşırı aksanlı latin büyük U harfi',Ucirc:'Çarpık latin büyük U harfi',Uuml:'Sesli harf ayrılımlı latin büyük U harfi',Yacute:'Aşırı aksanlı latin büyük Y harfi',THORN:'Latin büyük Thorn harfi',szlig:'Latin küçük keskin s harfi',agrave:'Aksanlı latin küçük a harfi',aacute:'Aşırı aksanlı latin küçük a harfi',acirc:'Çarpık latin küçük a harfi',atilde:'Tildeli latin küçük a harfi',auml:'Sesli harf ayrılımlı latin küçük a harfi',aring:'Halkalı latin küçük a harfi',aelig:'Latin büyük æ harfi',ccedil:'Kedillalı latin küçük c harfi',egrave:'Aksanlı latin küçük e harfi',eacute:'Aşırı aksanlı latin küçük e harfi',ecirc:'Çarpık latin küçük e harfi',euml:'Sesli harf ayrılımlı latin küçük e harfi',igrave:'Aksanlı latin küçük i harfi',iacute:'Aşırı aksanlı latin küçük i harfi',icirc:'Çarpık latin küçük i harfi',iuml:'Sesli harf ayrılımlı latin küçük i harfi',eth:'Latin küçük eth harfi',ntilde:'Tildeli latin küçük n harfi',ograve:'Aksanlı latin küçük o harfi',oacute:'Aşırı aksanlı latin küçük o harfi',ocirc:'Çarpık latin küçük o harfi',otilde:'Tildeli latin küçük o harfi',ouml:'Sesli harf ayrılımlı latin küçük o harfi',divide:'Bölme işareti',oslash:'Vurgulu latin küçük o harfi',ugrave:'Aksanlı latin küçük u harfi',uacute:'Aşırı aksanlı latin küçük u harfi',ucirc:'Çarpık latin küçük u harfi',uuml:'Sesli harf ayrılımlı latin küçük u harfi',yacute:'Aşırı aksanlı latin küçük y harfi',thorn:'Latin küçük thorn harfi',yuml:'Sesli harf ayrılımlı latin küçük y harfi',OElig:'Latin büyük bağlı OE harfi',oelig:'Latin küçük bağlı oe harfi',372:'Çarpık latin büyük W harfi',374:'Çarpık latin büyük Y harfi',373:'Çarpık latin küçük w harfi',375:'Çarpık latin küçük y harfi',sbquo:'Tek düşük-9 tırnak işareti',8219:'Tek yüksek-ters-9 tırnak işareti',bdquo:'Çift düşük-9 tırnak işareti',hellip:'Yatay elips',trade:'Marka tescili işareti',9658:'Siyah sağ işaret işaretçisi',bull:'Koyu nokta',rarr:'Sağa doğru ok',rArr:'Sağa doğru çift ok',hArr:'Sol, sağ çift ok',diams:'Siyah elmas takımı',asymp:'Hemen hemen eşit'});
+CKEDITOR.plugins.setLang( 'specialchar', 'tr', {
+ options: 'Özel Karakter Seçenekleri',
+ title: 'Özel Karakter Seç',
+ toolbar: 'Özel Karakter Ekle'
+});
diff --git a/plugins/specialchar/lang/ug.js b/plugins/specialchar/lang/ug.js
index f42a167..2f01983 100644
--- a/plugins/specialchar/lang/ug.js
+++ b/plugins/specialchar/lang/ug.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','ug',{euro:'ياۋرو بەلگىسى',lsquo:'يالاڭ پەش سول',rsquo:'يالاڭ پەش ئوڭ',ldquo:'قوش پەش سول',rdquo:'قوش پەش ئوڭ',ndash:'سىزىقچە',mdash:'سىزىق',iexcl:'ئۈندەش',cent:'تىيىن بەلگىسى',pound:'فوند ستېرلىڭ',curren:'پۇل بەلگىسى',yen:'ياپونىيە يىنى',brvbar:'ئۈزۈك بالداق',sect:'پاراگراف بەلگىسى',uml:'تاۋۇش ئايرىش بەلگىسى',copy:'نەشر ھوقۇقى بەلگىسى',ordf:'Feminine ordinal indicator',laquo:'قوش تىرناق سول',not:'غەيرى بەلگە',reg:'خەتلەتكەن تاۋار ماركىسى',macr:'سوزۇش بەلگىسى',deg:'گىرادۇس بەلگىسى',sup2:'يۇقىرى ئىندېكىس 2',sup3:'يۇقىرى ئىندېكىس 3',acute:'ئۇرغۇ بەلگىسى',micro:'Micro sign',para:'ئابزاس بەلگىسى',middot:'ئوتتۇرا چېكىت',cedil:'ئاستىغا قوشۇلىدىغان بەلگە',sup1:'يۇقىرى ئىندېكىس 1',ordm:'Masculine ordinal indicator',raquo:'قوش تىرناق ئوڭ',frac14:'ئاددىي كەسىر تۆتتىن بىر',frac12:'ئاددىي كەسىر ئىككىدىن بىر',frac34:'ئاددىي كەسىر ئۈچتىن تۆرت',iquest:'Inverted question mark',Agrave:'Latin capital letter A with grave accent',Aacute:'Latin capital letter A with acute accent',Acirc:'Latin capital letter A with circumflex',Atilde:'Latin capital letter A with tilde',Auml:'Latin capital letter A with diaeresis',Aring:'Latin capital letter A with ring above',AElig:'Latin Capital letter Æ',Ccedil:'Latin capital letter C with cedilla',Egrave:'Latin capital letter E with grave accent',Eacute:'Latin capital letter E with acute accent',Ecirc:'Latin capital letter E with circumflex',Euml:'Latin capital letter E with diaeresis',Igrave:'Latin capital letter I with grave accent',Iacute:'Latin capital letter I with acute accent',Icirc:'Latin capital letter I with circumflex',Iuml:'Latin capital letter I with diaeresis',ETH:'Latin capital letter Eth',Ntilde:'Latin capital letter N with tilde',Ograve:'قوش پەش ئوڭ',Oacute:'Latin capital letter O with acute accent',Ocirc:'Latin capital letter O with circumflex',Otilde:'Latin capital letter O with tilde',Ouml:'Latin capital letter O with diaeresis',times:'Multiplication sign',Oslash:'Latin capital letter O with stroke',Ugrave:'Latin capital letter U with grave accent',Uacute:'Latin capital letter U with acute accent',Ucirc:'Latin capital letter U with circumflex',Uuml:'Latin capital letter U with diaeresis',Yacute:'Latin capital letter Y with acute accent',THORN:'Latin capital letter Thorn',szlig:'Latin small letter sharp s',agrave:'Latin small letter a with grave accent',aacute:'Latin small letter a with acute accent',acirc:'Latin small letter a with circumflex',atilde:'Latin small letter a with tilde',auml:'Latin small letter a with diaeresis',aring:'Latin small letter a with ring above',aelig:'Latin small letter æ',ccedil:'Latin small letter c with cedilla',egrave:'Latin small letter e with grave accent',eacute:'Latin small letter e with acute accent',ecirc:'Latin small letter e with circumflex',euml:'Latin small letter e with diaeresis',igrave:'Latin small letter i with grave accent',iacute:'Latin small letter i with acute accent',icirc:'Latin small letter i with circumflex',iuml:'Latin small letter i with diaeresis',eth:'Latin small letter eth',ntilde:'تىك موللاق سوئال بەلگىسى',ograve:'Latin small letter o with grave accent',oacute:'Latin small letter o with acute accent',ocirc:'Latin small letter o with circumflex',otilde:'Latin small letter o with tilde',ouml:'Latin small letter o with diaeresis',divide:'Division sign',oslash:'Latin small letter o with stroke',ugrave:'Latin small letter u with grave accent',uacute:'Latin small letter u with acute accent',ucirc:'Latin small letter u with circumflex',uuml:'Latin small letter u with diaeresis',yacute:'Latin small letter y with acute accent',thorn:'Latin small letter thorn',yuml:'Latin small letter y with diaeresis',OElig:'Latin capital ligature OE',oelig:'Latin small ligature oe',372:'Latin capital letter W with circumflex',374:'Latin capital letter Y with circumflex',373:'Latin small letter w with circumflex',375:'Latin small letter y with circumflex',sbquo:'Single low-9 quotation mark',8219:'Single high-reversed-9 quotation mark',bdquo:'Double low-9 quotation mark',hellip:'Horizontal ellipsis',trade:'Trade mark sign',9658:'Black right-pointing pointer',bull:'Bullet',rarr:'ئوڭ يا ئوق',rArr:'ئوڭ قوش سىزىق يا ئوق',hArr:'ئوڭ سول قوش سىزىق يا ئوق',diams:'ئۇيۇل غىچ',asymp:'تەخمىنەن تەڭ'});
+CKEDITOR.plugins.setLang( 'specialchar', 'ug', {
+ options: 'ئالاھىدە ھەرپ تاللانمىسى',
+ title: 'ئالاھىدە ھەرپ تاللاڭ',
+ toolbar: 'ئالاھىدە ھەرپ قىستۇر'
+});
diff --git a/plugins/specialchar/lang/zh-cn.js b/plugins/specialchar/lang/zh-cn.js
index 3848cbf..444b232 100644
--- a/plugins/specialchar/lang/zh-cn.js
+++ b/plugins/specialchar/lang/zh-cn.js
@@ -1,6 +1,9 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-
-CKEDITOR.plugins.setLang('specialchar','zh-cn',{euro:'欧元符号',lsquo:'左单引号',rsquo:'右单引号',ldquo:'左双引号',rdquo:'右双引号',ndash:'短划线',mdash:'破折号',iexcl:'竖翻叹号',cent:'分币标记',pound:'英镑标记',curren:'货币标记',yen:'日元标记',brvbar:'间断条',sect:'节标记',uml:'分音符',copy:'版权所有标记',ordf:'阴性顺序指示符',laquo:'左指双尖引号',not:'非标记',reg:'注册标记',macr:'长音符',deg:'度标记',sup2:'上标二',sup3:'上标三',acute:'锐音符',micro:'微符',para:'段落标记',middot:'中间点',cedil:'下加符',sup1:'上标一',ordm:'阳性顺序指示符',raquo:'右指双尖引号',frac14:'普通分数四分之一',frac12:'普通分数二分之一',frac34:'普通分数四分之三',iquest:'竖翻问号',Agrave:'带抑音符的拉丁文大写字母 A',Aacute:'带锐音符的拉丁文大写字母 A',Acirc:'带扬抑符的拉丁文大写字母 A',Atilde:'带颚化符的拉丁文大写字母 A',Auml:'带分音符的拉丁文大写字母 A',Aring:'带上圆圈的拉丁文大写字母 A',AElig:'拉丁文大写字母 Ae',Ccedil:'带下加符的拉丁文大写字母 C',Egrave:'带抑音符的拉丁文大写字母 E',Eacute:'带锐音符的拉丁文大写字母 E',Ecirc:'带扬抑符的拉丁文大写字母 E',Euml:'带分音符的拉丁文大写字母 E',Igrave:'带抑音符的拉丁文大写字母 I',Iacute:'带锐音符的拉丁文大写字母 I',Icirc:'带扬抑符的拉丁文大写字母 I',Iuml:'带分音符的拉丁文大写字母 I',ETH:'拉丁文大写字母 Eth',Ntilde:'带颚化符的拉丁文大写字母 N',Ograve:'带抑音符的拉丁文大写字母 O',Oacute:'带锐音符的拉丁文大写字母 O',Ocirc:'带扬抑符的拉丁文大写字母 O',Otilde:'带颚化符的拉丁文大写字母 O',Ouml:'带分音符的拉丁文大写字母 O',times:'乘号',Oslash:'带粗线的拉丁文大写字母 O',Ugrave:'带抑音符的拉丁文大写字母 U',Uacute:'带锐音符的拉丁文大写字母 U',Ucirc:'带扬抑符的拉丁文大写字母 U',Uuml:'带分音符的拉丁文大写字母 U',Yacute:'带抑音符的拉丁文大写字母 Y',THORN:'拉丁文大写字母 Thorn',szlig:'拉丁文小写字母清音 S',agrave:'带抑音符的拉丁文小写字母 A',aacute:'带锐音符的拉丁文小写字母 A',acirc:'带扬抑符的拉丁文小写字母 A',atilde:'带颚化符的拉丁文小写字母 A',auml:'带分音符的拉丁文小写字母 A',aring:'带上圆圈的拉丁文小写字母 A',aelig:'拉丁文小写字母 Ae',ccedil:'带下加符的拉丁文小写字母 C',egrave:'带抑音符的拉丁文小写字母 E',eacute:'带锐音符的拉丁文小写字母 E',ecirc:'带扬抑符的拉丁文小写字母 E',euml:'带分音符的拉丁文小写字母 E',igrave:'带抑音符的拉丁文小写字母 I',iacute:'带锐音符的拉丁文小写字母 I',icirc:'带扬抑符的拉丁文小写字母 I',iuml:'带分音符的拉丁文小写字母 I',eth:'拉丁文小写字母 Eth',ntilde:'带颚化符的拉丁文小写字母 N',ograve:'带抑音符的拉丁文小写字母 O',oacute:'带锐音符的拉丁文小写字母 O',ocirc:'带扬抑符的拉丁文小写字母 O',otilde:'带颚化符的拉丁文小写字母 O',ouml:'带分音符的拉丁文小写字母 O',divide:'除号',oslash:'带粗线的拉丁文小写字母 O',ugrave:'带抑音符的拉丁文小写字母 U',uacute:'带锐音符的拉丁文小写字母 U',ucirc:'带扬抑符的拉丁文小写字母 U',uuml:'带分音符的拉丁文小写字母 U',yacute:'带抑音符的拉丁文小写字母 Y',thorn:'拉丁文小写字母 Thorn',yuml:'带分音符的拉丁文小写字母 Y',OElig:'拉丁文大写连字 Oe',oelig:'拉丁文小写连字 Oe',372:'带扬抑符的拉丁文大写字母 W',374:'带扬抑符的拉丁文大写字母 Y',373:'带扬抑符的拉丁文小写字母 W',375:'带扬抑符的拉丁文小写字母 Y',sbquo:'单下 9 形引号',8219:'单高横翻 9 形引号',bdquo:'双下 9 形引号',hellip:'水平省略号',trade:'商标标志',9658:'实心右指指针',bull:'加重号',rarr:'向右箭头',rArr:'向右双线箭头',hArr:'左右双线箭头',diams:'实心方块纸牌',asymp:'约等于'});
+CKEDITOR.plugins.setLang( 'specialchar', 'zh-cn', {
+ options: '特殊符号选项',
+ title: '选择特殊符号',
+ toolbar: '插入特殊符号'
+});
diff --git a/plugins/table/dialogs/table.js b/plugins/table/dialogs/table.js
index 6c48c20..681d0b9 100644
--- a/plugins/table/dialogs/table.js
+++ b/plugins/table/dialogs/table.js
@@ -1,9 +1,556 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-(function(){var a=CKEDITOR.tools.cssLength,b=function(f){var g=this.id;if(!f.info)f.info={};f.info[g]=this.getValue();};function c(f){var g=0,h=0;for(var i=0,j,k=f.$.rows.length;i<k;i++){j=f.$.rows[i],g=0;for(var l=0,m,n=j.cells.length;l<n;l++){m=j.cells[l];g+=m.colSpan;}g>h&&(h=g);}return h;};function d(f){return function(){var g=this.getValue(),h=!!(CKEDITOR.dialog.validate.integer()(g)&&g>0);if(!h){alert(f);this.select();}return h;};};function e(f,g){var h=function(j){return new CKEDITOR.dom.element(j,f.document);},i=f.plugins.dialogadvtab;return{title:f.lang.table.title,minWidth:310,minHeight:CKEDITOR.env.ie?310:280,onLoad:function(){var j=this,k=j.getContentElement('advanced','advStyles');if(k)k.on('change',function(l){var m=this.getStyle('width',''),n=j.getContentElement('info','txtWidth');n&&n.setValue(m,true);var o=this.getStyle('height',''),p=j.getContentElement('info','txtHeight');p&&p.setValue(o,true);});},onShow:function(){var r=this;var j=f.getSelection(),k=j.getRanges(),l=null,m=r.getContentElement('info','txtRows'),n=r.getContentElement('info','txtCols'),o=r.getContentElement('info','txtWidth'),p=r.getContentElement('info','txtHeight');if(g=='tableProperties'){if(l=j.getSelectedElement())l=l.getAscendant('table',true);else if(k.length>0){if(CKEDITOR.env.webkit)k[0].shrink(CKEDITOR.NODE_ELEMENT);var q=k[0].getCommonAncestor(true);l=q.getAscendant('table',true);}r._.selectedElement=l;}if(l){r.setupContent(l);m&&m.disable();n&&n.disable();}else{m&&m.enable();n&&n.enable();}o&&o.onChange();p&&p.onChange();},onOk:function(){var j=f.getSelection(),k=this._.selectedElement&&j.createBookmarks(),l=this._.selectedElement||h('table'),m=this,n={};this.commitContent(n,l);if(n.info){var o=n.info;if(!this._.selectedElement){var p=l.append(h('tbody')),q=parseInt(o.txtRows,10)||0,r=parseInt(o.txtCols,10)||0;for(var s=0;s<q;s++){var t=p.append(h('tr'));for(var u=0;u<r;u++){var v=t.append(h('td'));if(!CKEDITOR.env.ie)v.append(h('br'));}}}var w=o.selHeaders;if(!l.$.tHead&&(w=='row'||w=='both')){var x=new CKEDITOR.dom.element(l.$.createTHead());p=l.getElementsByTag('tbody').getItem(0);var y=p.getElementsByTag('tr').getItem(0);for(s=0;s<y.getChildCount();s++){var z=y.getChild(s);if(z.type==CKEDITOR.NODE_ELEMENT&&!z.data('cke-bookmark')){z.renameNode('th');z.setAttribute('scope','col');}}x.append(y.remove());}if(l.$.tHead!==null&&!(w=='row'||w=='both')){x=new CKEDITOR.dom.element(l.$.tHead);p=l.getElementsByTag('tbody').getItem(0);var A=p.getFirst();while(x.getChildCount()>0){y=x.getFirst();
-for(s=0;s<y.getChildCount();s++){var B=y.getChild(s);if(B.type==CKEDITOR.NODE_ELEMENT){B.renameNode('td');B.removeAttribute('scope');}}y.insertBefore(A);}x.remove();}if(!this.hasColumnHeaders&&(w=='col'||w=='both'))for(t=0;t<l.$.rows.length;t++){B=new CKEDITOR.dom.element(l.$.rows[t].cells[0]);B.renameNode('th');B.setAttribute('scope','row');}if(this.hasColumnHeaders&&!(w=='col'||w=='both'))for(s=0;s<l.$.rows.length;s++){t=new CKEDITOR.dom.element(l.$.rows[s]);if(t.getParent().getName()=='tbody'){B=new CKEDITOR.dom.element(t.$.cells[0]);B.renameNode('td');B.removeAttribute('scope');}}o.txtHeight?l.setStyle('height',o.txtHeight):l.removeStyle('height');o.txtWidth?l.setStyle('width',o.txtWidth):l.removeStyle('width');if(!l.getAttribute('style'))l.removeAttribute('style');}if(!this._.selectedElement){f.insertElement(l);setTimeout(function(){var C=new CKEDITOR.dom.element(l.$.rows[0].cells[0]),D=new CKEDITOR.dom.range(f.document);D.moveToPosition(C,CKEDITOR.POSITION_AFTER_START);D.select(1);},0);}else try{j.selectBookmarks(k);}catch(C){}},contents:[{id:'info',label:f.lang.table.title,elements:[{type:'hbox',widths:[null,null],styles:['vertical-align:top'],children:[{type:'vbox',padding:0,children:[{type:'text',id:'txtRows','default':3,label:f.lang.table.rows,required:true,controlStyle:'width:5em',validate:d(f.lang.table.invalidRows),setup:function(j){this.setValue(j.$.rows.length);},commit:b},{type:'text',id:'txtCols','default':2,label:f.lang.table.columns,required:true,controlStyle:'width:5em',validate:d(f.lang.table.invalidCols),setup:function(j){this.setValue(c(j));},commit:b},{type:'html',html:'&nbsp;'},{type:'select',id:'selHeaders','default':'',label:f.lang.table.headers,items:[[f.lang.table.headersNone,''],[f.lang.table.headersRow,'row'],[f.lang.table.headersColumn,'col'],[f.lang.table.headersBoth,'both']],setup:function(j){var k=this.getDialog();k.hasColumnHeaders=true;for(var l=0;l<j.$.rows.length;l++){var m=j.$.rows[l].cells[0];if(m&&m.nodeName.toLowerCase()!='th'){k.hasColumnHeaders=false;break;}}if(j.$.tHead!==null)this.setValue(k.hasColumnHeaders?'both':'row');else this.setValue(k.hasColumnHeaders?'col':'');},commit:b},{type:'text',id:'txtBorder','default':1,label:f.lang.table.border,controlStyle:'width:3em',validate:CKEDITOR.dialog.validate.number(f.lang.table.invalidBorder),setup:function(j){this.setValue(j.getAttribute('border')||'');},commit:function(j,k){if(this.getValue())k.setAttribute('border',this.getValue());else k.removeAttribute('border');
-}},{id:'cmbAlign',type:'select','default':'',label:f.lang.common.align,items:[[f.lang.common.notSet,''],[f.lang.common.alignLeft,'left'],[f.lang.common.alignCenter,'center'],[f.lang.common.alignRight,'right']],setup:function(j){this.setValue(j.getAttribute('align')||'');},commit:function(j,k){if(this.getValue())k.setAttribute('align',this.getValue());else k.removeAttribute('align');}}]},{type:'vbox',padding:0,children:[{type:'hbox',widths:['5em'],children:[{type:'text',id:'txtWidth',controlStyle:'width:5em',label:f.lang.common.width,title:f.lang.common.cssLengthTooltip,'default':500,getValue:a,validate:CKEDITOR.dialog.validate.cssLength(f.lang.common.invalidCssLength.replace('%1',f.lang.common.width)),onChange:function(){var j=this.getDialog().getContentElement('advanced','advStyles');j&&j.updateStyle('width',this.getValue());},setup:function(j){var k=j.getStyle('width');k&&this.setValue(k);},commit:b}]},{type:'hbox',widths:['5em'],children:[{type:'text',id:'txtHeight',controlStyle:'width:5em',label:f.lang.common.height,title:f.lang.common.cssLengthTooltip,'default':'',getValue:a,validate:CKEDITOR.dialog.validate.cssLength(f.lang.common.invalidCssLength.replace('%1',f.lang.common.height)),onChange:function(){var j=this.getDialog().getContentElement('advanced','advStyles');j&&j.updateStyle('height',this.getValue());},setup:function(j){var k=j.getStyle('height');k&&this.setValue(k);},commit:b}]},{type:'html',html:'&nbsp;'},{type:'text',id:'txtCellSpace',controlStyle:'width:3em',label:f.lang.table.cellSpace,'default':1,validate:CKEDITOR.dialog.validate.number(f.lang.table.invalidCellSpacing),setup:function(j){this.setValue(j.getAttribute('cellSpacing')||'');},commit:function(j,k){if(this.getValue())k.setAttribute('cellSpacing',this.getValue());else k.removeAttribute('cellSpacing');}},{type:'text',id:'txtCellPad',controlStyle:'width:3em',label:f.lang.table.cellPad,'default':1,validate:CKEDITOR.dialog.validate.number(f.lang.table.invalidCellPadding),setup:function(j){this.setValue(j.getAttribute('cellPadding')||'');},commit:function(j,k){if(this.getValue())k.setAttribute('cellPadding',this.getValue());else k.removeAttribute('cellPadding');}}]}]},{type:'html',align:'right',html:''},{type:'vbox',padding:0,children:[{type:'text',id:'txtCaption',label:f.lang.table.caption,setup:function(j){var n=this;n.enable();var k=j.getElementsByTag('caption');if(k.count()>0){var l=k.getItem(0),m=l.getFirst(CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT));if(m&&!m.equals(l.getBogus())){n.disable();
-n.setValue(l.getText());return;}l=CKEDITOR.tools.trim(l.getText());n.setValue(l);}},commit:function(j,k){if(!this.isEnabled())return;var l=this.getValue(),m=k.getElementsByTag('caption');if(l){if(m.count()>0){m=m.getItem(0);m.setHtml('');}else{m=new CKEDITOR.dom.element('caption',f.document);if(k.getChildCount())m.insertBefore(k.getFirst());else m.appendTo(k);}m.append(new CKEDITOR.dom.text(l,f.document));}else if(m.count()>0)for(var n=m.count()-1;n>=0;n--)m.getItem(n).remove();}},{type:'text',id:'txtSummary',label:f.lang.table.summary,setup:function(j){this.setValue(j.getAttribute('summary')||'');},commit:function(j,k){if(this.getValue())k.setAttribute('summary',this.getValue());else k.removeAttribute('summary');}}]}]},i&&i.createAdvancedTab(f)]};};CKEDITOR.dialog.add('table',function(f){return e(f,'table');});CKEDITOR.dialog.add('tableProperties',function(f){return e(f,'tableProperties');});})();
+(function() {
+ var defaultToPixel = CKEDITOR.tools.cssLength;
+
+ var commitValue = function( data ) {
+ var id = this.id;
+ if ( !data.info )
+ data.info = {};
+ data.info[ id ] = this.getValue();
+ };
+
+ function tableColumns( table ) {
+ var cols = 0,
+ maxCols = 0;
+ for ( var i = 0, row, rows = table.$.rows.length; i < rows; i++ ) {
+ row = table.$.rows[ i ], cols = 0;
+ for ( var j = 0, cell, cells = row.cells.length; j < cells; j++ ) {
+ cell = row.cells[ j ];
+ cols += cell.colSpan;
+ }
+
+ cols > maxCols && ( maxCols = cols );
+ }
+
+ return maxCols;
+ }
+
+
+ // Whole-positive-integer validator.
+ function validatorNum( msg ) {
+ return function() {
+ var value = this.getValue(),
+ pass = !!( CKEDITOR.dialog.validate.integer()( value ) && value > 0 );
+
+ if ( !pass ) {
+ alert( msg );
+ this.select();
+ }
+
+ return pass;
+ };
+ }
+
+ function tableDialog( editor, command ) {
+ var makeElement = function( name ) {
+ return new CKEDITOR.dom.element( name, editor.document );
+ };
+
+ var editable = editor.editable();
+
+ var dialogadvtab = editor.plugins.dialogadvtab;
+
+ return {
+ title: editor.lang.table.title,
+ minWidth: 310,
+ minHeight: CKEDITOR.env.ie ? 310 : 280,
+
+ onLoad: function() {
+ var dialog = this;
+
+ var styles = dialog.getContentElement( 'advanced', 'advStyles' );
+
+ if ( styles ) {
+ styles.on( 'change', function( evt ) {
+ // Synchronize width value.
+ var width = this.getStyle( 'width', '' ),
+ txtWidth = dialog.getContentElement( 'info', 'txtWidth' );
+
+ txtWidth && txtWidth.setValue( width, true );
+
+ // Synchronize height value.
+ var height = this.getStyle( 'height', '' ),
+ txtHeight = dialog.getContentElement( 'info', 'txtHeight' );
+
+ txtHeight && txtHeight.setValue( height, true );
+ });
+ }
+ },
+
+ onShow: function() {
+ // Detect if there's a selected table.
+ var selection = editor.getSelection(),
+ ranges = selection.getRanges(),
+ table;
+
+ var rowsInput = this.getContentElement( 'info', 'txtRows' ),
+ colsInput = this.getContentElement( 'info', 'txtCols' ),
+ widthInput = this.getContentElement( 'info', 'txtWidth' ),
+ heightInput = this.getContentElement( 'info', 'txtHeight' );
+
+ if ( command == 'tableProperties' ) {
+ var selected = selection.getSelectedElement();
+ if ( selected && selected.is( 'table' ) )
+ table = selected;
+ else if ( ranges.length > 0 ) {
+ // Webkit could report the following range on cell selection (#4948):
+ // <table><tr><td>[&nbsp;</td></tr></table>]
+ if ( CKEDITOR.env.webkit )
+ ranges[ 0 ].shrink( CKEDITOR.NODE_ELEMENT );
+
+ table = editor.elementPath( ranges[ 0 ].getCommonAncestor( true ) ).contains( 'table', 1 );
+ }
+
+ // Save a reference to the selected table, and push a new set of default values.
+ this._.selectedElement = table;
+ }
+
+ // Enable or disable the row, cols, width fields.
+ if ( table ) {
+ this.setupContent( table );
+ rowsInput && rowsInput.disable();
+ colsInput && colsInput.disable();
+ } else {
+ rowsInput && rowsInput.enable();
+ colsInput && colsInput.enable();
+ }
+
+ // Call the onChange method for the widht and height fields so
+ // they get reflected into the Advanced tab.
+ widthInput && widthInput.onChange();
+ heightInput && heightInput.onChange();
+ },
+ onOk: function() {
+ var selection = editor.getSelection(),
+ bms = this._.selectedElement && selection.createBookmarks();
+
+ var table = this._.selectedElement || makeElement( 'table' ),
+ me = this,
+ data = {};
+
+ this.commitContent( data, table );
+
+ if ( data.info ) {
+ var info = data.info;
+
+ // Generate the rows and cols.
+ if ( !this._.selectedElement ) {
+ var tbody = table.append( makeElement( 'tbody' ) ),
+ rows = parseInt( info.txtRows, 10 ) || 0,
+ cols = parseInt( info.txtCols, 10 ) || 0;
+
+ for ( var i = 0; i < rows; i++ ) {
+ var row = tbody.append( makeElement( 'tr' ) );
+ for ( var j = 0; j < cols; j++ ) {
+ var cell = row.append( makeElement( 'td' ) );
+ if ( !CKEDITOR.env.ie )
+ cell.append( makeElement( 'br' ) );
+ }
+ }
+ }
+
+ // Modify the table headers. Depends on having rows and cols generated
+ // correctly so it can't be done in commit functions.
+
+ // Should we make a <thead>?
+ var headers = info.selHeaders;
+ if ( !table.$.tHead && ( headers == 'row' || headers == 'both' ) ) {
+ var thead = new CKEDITOR.dom.element( table.$.createTHead() );
+ tbody = table.getElementsByTag( 'tbody' ).getItem( 0 );
+ var theRow = tbody.getElementsByTag( 'tr' ).getItem( 0 );
+
+ // Change TD to TH:
+ for ( i = 0; i < theRow.getChildCount(); i++ ) {
+ var th = theRow.getChild( i );
+ // Skip bookmark nodes. (#6155)
+ if ( th.type == CKEDITOR.NODE_ELEMENT && !th.data( 'cke-bookmark' ) ) {
+ th.renameNode( 'th' );
+ th.setAttribute( 'scope', 'col' );
+ }
+ }
+ thead.append( theRow.remove() );
+ }
+
+ if ( table.$.tHead !== null && !( headers == 'row' || headers == 'both' ) ) {
+ // Move the row out of the THead and put it in the TBody:
+ thead = new CKEDITOR.dom.element( table.$.tHead );
+ tbody = table.getElementsByTag( 'tbody' ).getItem( 0 );
+
+ var previousFirstRow = tbody.getFirst();
+ while ( thead.getChildCount() > 0 ) {
+ theRow = thead.getFirst();
+ for ( i = 0; i < theRow.getChildCount(); i++ ) {
+ var newCell = theRow.getChild( i );
+ if ( newCell.type == CKEDITOR.NODE_ELEMENT ) {
+ newCell.renameNode( 'td' );
+ newCell.removeAttribute( 'scope' );
+ }
+ }
+ theRow.insertBefore( previousFirstRow );
+ }
+ thead.remove();
+ }
+
+ // Should we make all first cells in a row TH?
+ if ( !this.hasColumnHeaders && ( headers == 'col' || headers == 'both' ) ) {
+ for ( row = 0; row < table.$.rows.length; row++ ) {
+ newCell = new CKEDITOR.dom.element( table.$.rows[ row ].cells[ 0 ] );
+ newCell.renameNode( 'th' );
+ newCell.setAttribute( 'scope', 'row' );
+ }
+ }
+
+ // Should we make all first TH-cells in a row make TD? If 'yes' we do it the other way round :-)
+ if ( ( this.hasColumnHeaders ) && !( headers == 'col' || headers == 'both' ) ) {
+ for ( i = 0; i < table.$.rows.length; i++ ) {
+ row = new CKEDITOR.dom.element( table.$.rows[ i ] );
+ if ( row.getParent().getName() == 'tbody' ) {
+ newCell = new CKEDITOR.dom.element( row.$.cells[ 0 ] );
+ newCell.renameNode( 'td' );
+ newCell.removeAttribute( 'scope' );
+ }
+ }
+ }
+
+ // Set the width and height.
+ info.txtHeight ? table.setStyle( 'height', info.txtHeight ) : table.removeStyle( 'height' );
+ info.txtWidth ? table.setStyle( 'width', info.txtWidth ) : table.removeStyle( 'width' );
+
+ if ( !table.getAttribute( 'style' ) )
+ table.removeAttribute( 'style' );
+ }
+
+ // Insert the table element if we're creating one.
+ if ( !this._.selectedElement ) {
+ editor.insertElement( table );
+ // Override the default cursor position after insertElement to place
+ // cursor inside the first cell (#7959), IE needs a while.
+ setTimeout( function() {
+ var firstCell = new CKEDITOR.dom.element( table.$.rows[ 0 ].cells[ 0 ] );
+ var range = editor.createRange();
+ range.moveToPosition( firstCell, CKEDITOR.POSITION_AFTER_START );
+ range.select();
+ }, 0 );
+ }
+ // Properly restore the selection, (#4822) but don't break
+ // because of this, e.g. updated table caption.
+ else
+ try {
+ selection.selectBookmarks( bms );
+ } catch ( er ) {}
+ },
+ contents: [
+ {
+ id: 'info',
+ label: editor.lang.table.title,
+ elements: [
+ {
+ type: 'hbox',
+ widths: [ null, null ],
+ styles: [ 'vertical-align:top' ],
+ children: [
+ {
+ type: 'vbox',
+ padding: 0,
+ children: [
+ {
+ type: 'text',
+ id: 'txtRows',
+ 'default': 3,
+ label: editor.lang.table.rows,
+ required: true,
+ controlStyle: 'width:5em',
+ validate: validatorNum( editor.lang.table.invalidRows ),
+ setup: function( selectedElement ) {
+ this.setValue( selectedElement.$.rows.length );
+ },
+ commit: commitValue
+ },
+ {
+ type: 'text',
+ id: 'txtCols',
+ 'default': 2,
+ label: editor.lang.table.columns,
+ required: true,
+ controlStyle: 'width:5em',
+ validate: validatorNum( editor.lang.table.invalidCols ),
+ setup: function( selectedTable ) {
+ this.setValue( tableColumns( selectedTable ) );
+ },
+ commit: commitValue
+ },
+ {
+ type: 'html',
+ html: '&nbsp;'
+ },
+ {
+ type: 'select',
+ id: 'selHeaders',
+ requiredContent: 'th',
+ 'default': '',
+ label: editor.lang.table.headers,
+ items: [
+ [ editor.lang.table.headersNone, '' ],
+ [ editor.lang.table.headersRow, 'row' ],
+ [ editor.lang.table.headersColumn, 'col' ],
+ [ editor.lang.table.headersBoth, 'both' ]
+ ],
+ setup: function( selectedTable ) {
+ // Fill in the headers field.
+ var dialog = this.getDialog();
+ dialog.hasColumnHeaders = true;
+
+ // Check if all the first cells in every row are TH
+ for ( var row = 0; row < selectedTable.$.rows.length; row++ ) {
+ // If just one cell isn't a TH then it isn't a header column
+ var headCell = selectedTable.$.rows[ row ].cells[ 0 ];
+ if ( headCell && headCell.nodeName.toLowerCase() != 'th' ) {
+ dialog.hasColumnHeaders = false;
+ break;
+ }
+ }
+
+ // Check if the table contains <thead>.
+ if ( ( selectedTable.$.tHead !== null ) )
+ this.setValue( dialog.hasColumnHeaders ? 'both' : 'row' );
+ else
+ this.setValue( dialog.hasColumnHeaders ? 'col' : '' );
+ },
+ commit: commitValue
+ },
+ {
+ type: 'text',
+ id: 'txtBorder',
+ requiredContent: 'table[border]',
+ // Avoid setting border which will then disappear.
+ 'default': editor.filter.check( 'table[border]' ) ? 1 : 0,
+ label: editor.lang.table.border,
+ controlStyle: 'width:3em',
+ validate: CKEDITOR.dialog.validate[ 'number' ]( editor.lang.table.invalidBorder ),
+ setup: function( selectedTable ) {
+ this.setValue( selectedTable.getAttribute( 'border' ) || '' );
+ },
+ commit: function( data, selectedTable ) {
+ if ( this.getValue() )
+ selectedTable.setAttribute( 'border', this.getValue() );
+ else
+ selectedTable.removeAttribute( 'border' );
+ }
+ },
+ {
+ id: 'cmbAlign',
+ type: 'select',
+ requiredContent: 'table[align]',
+ 'default': '',
+ label: editor.lang.common.align,
+ items: [
+ [ editor.lang.common.notSet, '' ],
+ [ editor.lang.common.alignLeft, 'left' ],
+ [ editor.lang.common.alignCenter, 'center' ],
+ [ editor.lang.common.alignRight, 'right' ]
+ ],
+ setup: function( selectedTable ) {
+ this.setValue( selectedTable.getAttribute( 'align' ) || '' );
+ },
+ commit: function( data, selectedTable ) {
+ if ( this.getValue() )
+ selectedTable.setAttribute( 'align', this.getValue() );
+ else
+ selectedTable.removeAttribute( 'align' );
+ }
+ }
+ ]
+ },
+ {
+ type: 'vbox',
+ padding: 0,
+ children: [
+ {
+ type: 'hbox',
+ widths: [ '5em' ],
+ children: [
+ {
+ type: 'text',
+ id: 'txtWidth',
+ requiredContent: 'table{width}',
+ controlStyle: 'width:5em',
+ label: editor.lang.common.width,
+ title: editor.lang.common.cssLengthTooltip,
+ // Smarter default table width. (#9600)
+ 'default': editor.filter.check( 'table{width}' ) ? ( editable.getSize( 'width' ) < 500 ? '100%' : 500 ) : 0,
+ getValue: defaultToPixel,
+ validate: CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength.replace( '%1', editor.lang.common.width ) ),
+ onChange: function() {
+ var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' );
+ styles && styles.updateStyle( 'width', this.getValue() );
+ },
+ setup: function( selectedTable ) {
+ var val = selectedTable.getStyle( 'width' );
+ this.setValue( val );
+ },
+ commit: commitValue
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '5em' ],
+ children: [
+ {
+ type: 'text',
+ id: 'txtHeight',
+ requiredContent: 'table{height}',
+ controlStyle: 'width:5em',
+ label: editor.lang.common.height,
+ title: editor.lang.common.cssLengthTooltip,
+ 'default': '',
+ getValue: defaultToPixel,
+ validate: CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength.replace( '%1', editor.lang.common.height ) ),
+ onChange: function() {
+ var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' );
+ styles && styles.updateStyle( 'height', this.getValue() );
+ },
+
+ setup: function( selectedTable ) {
+ var val = selectedTable.getStyle( 'height' );
+ val && this.setValue( val );
+ },
+ commit: commitValue
+ }
+ ]
+ },
+ {
+ type: 'html',
+ html: '&nbsp;'
+ },
+ {
+ type: 'text',
+ id: 'txtCellSpace',
+ requiredContent: 'table[cellspacing]',
+ controlStyle: 'width:3em',
+ label: editor.lang.table.cellSpace,
+ 'default': editor.filter.check( 'table[cellspacing]' ) ? 1 : 0,
+ validate: CKEDITOR.dialog.validate.number( editor.lang.table.invalidCellSpacing ),
+ setup: function( selectedTable ) {
+ this.setValue( selectedTable.getAttribute( 'cellSpacing' ) || '' );
+ },
+ commit: function( data, selectedTable ) {
+ if ( this.getValue() )
+ selectedTable.setAttribute( 'cellSpacing', this.getValue() );
+ else
+ selectedTable.removeAttribute( 'cellSpacing' );
+ }
+ },
+ {
+ type: 'text',
+ id: 'txtCellPad',
+ requiredContent: 'table[cellpadding]',
+ controlStyle: 'width:3em',
+ label: editor.lang.table.cellPad,
+ 'default': editor.filter.check( 'table[cellpadding]' ) ? 1 : 0,
+ validate: CKEDITOR.dialog.validate.number( editor.lang.table.invalidCellPadding ),
+ setup: function( selectedTable ) {
+ this.setValue( selectedTable.getAttribute( 'cellPadding' ) || '' );
+ },
+ commit: function( data, selectedTable ) {
+ if ( this.getValue() )
+ selectedTable.setAttribute( 'cellPadding', this.getValue() );
+ else
+ selectedTable.removeAttribute( 'cellPadding' );
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ type: 'html',
+ align: 'right',
+ html: ''
+ },
+ {
+ type: 'vbox',
+ padding: 0,
+ children: [
+ {
+ type: 'text',
+ id: 'txtCaption',
+ requiredContent: 'caption',
+ label: editor.lang.table.caption,
+ setup: function( selectedTable ) {
+ this.enable();
+
+ var nodeList = selectedTable.getElementsByTag( 'caption' );
+ if ( nodeList.count() > 0 ) {
+ var caption = nodeList.getItem( 0 );
+ var firstElementChild = caption.getFirst( CKEDITOR.dom.walker.nodeType( CKEDITOR.NODE_ELEMENT ) );
+
+ if ( firstElementChild && !firstElementChild.equals( caption.getBogus() ) ) {
+ this.disable();
+ this.setValue( caption.getText() );
+ return;
+ }
+
+ caption = CKEDITOR.tools.trim( caption.getText() );
+ this.setValue( caption );
+ }
+ },
+ commit: function( data, table ) {
+ if ( !this.isEnabled() )
+ return;
+
+ var caption = this.getValue(),
+ captionElement = table.getElementsByTag( 'caption' );
+ if ( caption ) {
+ if ( captionElement.count() > 0 ) {
+ captionElement = captionElement.getItem( 0 );
+ captionElement.setHtml( '' );
+ } else {
+ captionElement = new CKEDITOR.dom.element( 'caption', editor.document );
+ if ( table.getChildCount() )
+ captionElement.insertBefore( table.getFirst() );
+ else
+ captionElement.appendTo( table );
+ }
+ captionElement.append( new CKEDITOR.dom.text( caption, editor.document ) );
+ } else if ( captionElement.count() > 0 ) {
+ for ( var i = captionElement.count() - 1; i >= 0; i-- )
+ captionElement.getItem( i ).remove();
+ }
+ }
+ },
+ {
+ type: 'text',
+ id: 'txtSummary',
+ requiredContent: 'table[summary]',
+ label: editor.lang.table.summary,
+ setup: function( selectedTable ) {
+ this.setValue( selectedTable.getAttribute( 'summary' ) || '' );
+ },
+ commit: function( data, selectedTable ) {
+ if ( this.getValue() )
+ selectedTable.setAttribute( 'summary', this.getValue() );
+ else
+ selectedTable.removeAttribute( 'summary' );
+ }
+ }
+ ]
+ }
+ ]
+ },
+ dialogadvtab && dialogadvtab.createAdvancedTab( editor, null, 'table' )
+ ]
+ };
+ }
+
+ CKEDITOR.dialog.add( 'table', function( editor ) {
+ return tableDialog( editor, 'table' );
+ });
+ CKEDITOR.dialog.add( 'tableProperties', function( editor ) {
+ return tableDialog( editor, 'tableProperties' );
+ });
+})();
diff --git a/plugins/tabletools/dialogs/tableCell.js b/plugins/tabletools/dialogs/tableCell.js
index eaa89ee..fff7e0e 100644
--- a/plugins/tabletools/dialogs/tableCell.js
+++ b/plugins/tabletools/dialogs/tableCell.js
@@ -1,8 +1,418 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-CKEDITOR.dialog.add('cellProperties',function(a){var b=a.lang.table,c=b.cell,d=a.lang.common,e=CKEDITOR.dialog.validate,f=/^(\d+(?:\.\d+)?)(px|%)$/,g=/^(\d+(?:\.\d+)?)px$/,h=CKEDITOR.tools.bind,i={type:'html',html:'&nbsp;'},j=a.lang.dir=='rtl';function k(l,m){var n=function(){var r=this;p(r);m(r,r._.parentDialog);r._.parentDialog.changeFocus();},o=function(){p(this);this._.parentDialog.changeFocus();},p=function(r){r.removeListener('ok',n);r.removeListener('cancel',o);},q=function(r){r.on('ok',n);r.on('cancel',o);};a.execCommand(l);if(a._.storedDialogs.colordialog)q(a._.storedDialogs.colordialog);else CKEDITOR.on('dialogDefinition',function(r){if(r.data.name!=l)return;var s=r.data.definition;r.removeListener();s.onLoad=CKEDITOR.tools.override(s.onLoad,function(t){return function(){q(this);s.onLoad=t;if(typeof t=='function')t.call(this);};});});};return{title:c.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?450:410,minHeight:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?230:200,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:d.width,validate:e.number(c.invalidWidth),onLoad:function(){var l=this.getDialog().getContentElement('info','widthType'),m=l.getElement(),n=this.getInputElement(),o=n.getAttribute('aria-labelledby');n.setAttribute('aria-labelledby',[o,m.$.id].join(' '));},setup:function(l){var m=parseInt(l.getAttribute('width'),10),n=parseInt(l.getStyle('width'),10);!isNaN(m)&&this.setValue(m);!isNaN(n)&&this.setValue(n);},commit:function(l){var m=parseInt(this.getValue(),10),n=this.getDialog().getValueOf('info','widthType');if(!isNaN(m))l.setStyle('width',m+n);else l.removeStyle('width');l.removeAttribute('width');},'default':''},{type:'select',id:'widthType',label:a.lang.table.widthUnit,labelStyle:'visibility:hidden','default':'px',items:[[b.widthPx,'px'],[b.widthPc,'%']],setup:function(l){var m=f.exec(l.getStyle('width')||l.getAttribute('width'));if(m)this.setValue(m[2]);}}]},{type:'hbox',widths:['70%','30%'],children:[{type:'text',id:'height',label:d.height,width:'100px','default':'',validate:e.number(c.invalidHeight),onLoad:function(){var l=this.getDialog().getContentElement('info','htmlHeightType'),m=l.getElement(),n=this.getInputElement(),o=n.getAttribute('aria-labelledby');n.setAttribute('aria-labelledby',[o,m.$.id].join(' '));},setup:function(l){var m=parseInt(l.getAttribute('height'),10),n=parseInt(l.getStyle('height'),10);
-!isNaN(m)&&this.setValue(m);!isNaN(n)&&this.setValue(n);},commit:function(l){var m=parseInt(this.getValue(),10);if(!isNaN(m))l.setStyle('height',CKEDITOR.tools.cssLength(m));else l.removeStyle('height');l.removeAttribute('height');}},{id:'htmlHeightType',type:'html',html:'<br />'+b.widthPx}]},i,{type:'select',id:'wordWrap',label:c.wordWrap,'default':'yes',items:[[c.yes,'yes'],[c.no,'no']],setup:function(l){var m=l.getAttribute('noWrap'),n=l.getStyle('white-space');if(n=='nowrap'||m)this.setValue('no');},commit:function(l){if(this.getValue()=='no')l.setStyle('white-space','nowrap');else l.removeStyle('white-space');l.removeAttribute('noWrap');}},i,{type:'select',id:'hAlign',label:c.hAlign,'default':'',items:[[d.notSet,''],[d.alignLeft,'left'],[d.alignCenter,'center'],[d.alignRight,'right']],setup:function(l){var m=l.getAttribute('align'),n=l.getStyle('text-align');this.setValue(n||m||'');},commit:function(l){var m=this.getValue();if(m)l.setStyle('text-align',m);else l.removeStyle('text-align');l.removeAttribute('align');}},{type:'select',id:'vAlign',label:c.vAlign,'default':'',items:[[d.notSet,''],[d.alignTop,'top'],[d.alignMiddle,'middle'],[d.alignBottom,'bottom'],[c.alignBaseline,'baseline']],setup:function(l){var m=l.getAttribute('vAlign'),n=l.getStyle('vertical-align');switch(n){case 'top':case 'middle':case 'bottom':case 'baseline':break;default:n='';}this.setValue(n||m||'');},commit:function(l){var m=this.getValue();if(m)l.setStyle('vertical-align',m);else l.removeStyle('vertical-align');l.removeAttribute('vAlign');}}]},i,{type:'vbox',padding:0,children:[{type:'select',id:'cellType',label:c.cellType,'default':'td',items:[[c.data,'td'],[c.header,'th']],setup:function(l){this.setValue(l.getName());},commit:function(l){l.renameNode(this.getValue());}},i,{type:'text',id:'rowSpan',label:c.rowSpan,'default':'',validate:e.integer(c.invalidRowSpan),setup:function(l){var m=parseInt(l.getAttribute('rowSpan'),10);if(m&&m!=1)this.setValue(m);},commit:function(l){var m=parseInt(this.getValue(),10);if(m&&m!=1)l.setAttribute('rowSpan',this.getValue());else l.removeAttribute('rowSpan');}},{type:'text',id:'colSpan',label:c.colSpan,'default':'',validate:e.integer(c.invalidColSpan),setup:function(l){var m=parseInt(l.getAttribute('colSpan'),10);if(m&&m!=1)this.setValue(m);},commit:function(l){var m=parseInt(this.getValue(),10);if(m&&m!=1)l.setAttribute('colSpan',this.getValue());else l.removeAttribute('colSpan');}},i,{type:'hbox',padding:0,widths:['60%','40%'],children:[{type:'text',id:'bgColor',label:c.bgColor,'default':'',setup:function(l){var m=l.getAttribute('bgColor'),n=l.getStyle('background-color');
-this.setValue(n||m);},commit:function(l){var m=this.getValue();if(m)l.setStyle('background-color',this.getValue());else l.removeStyle('background-color');l.removeAttribute('bgColor');}},{type:'button',id:'bgColorChoose','class':'colorChooser',label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle('vertical-align','bottom');},onClick:function(){var l=this;k('colordialog',function(m){l.getDialog().getContentElement('info','bgColor').setValue(m.getContentElement('picker','selectedColor').getValue());});}}]},i,{type:'hbox',padding:0,widths:['60%','40%'],children:[{type:'text',id:'borderColor',label:c.borderColor,'default':'',setup:function(l){var m=l.getAttribute('borderColor'),n=l.getStyle('border-color');this.setValue(n||m);},commit:function(l){var m=this.getValue();if(m)l.setStyle('border-color',this.getValue());else l.removeStyle('border-color');l.removeAttribute('borderColor');}},{type:'button',id:'borderColorChoose','class':'colorChooser',label:c.chooseColor,style:(j?'margin-right':'margin-left')+': 10px',onLoad:function(){this.getElement().getParent().setStyle('vertical-align','bottom');},onClick:function(){var l=this;k('colordialog',function(m){l.getDialog().getContentElement('info','borderColor').setValue(m.getContentElement('picker','selectedColor').getValue());});}}]}]}]}]}],onShow:function(){var l=this;l.cells=CKEDITOR.plugins.tabletools.getSelectedCells(l._.editor.getSelection());l.setupContent(l.cells[0]);},onOk:function(){var p=this;var l=p._.editor.getSelection(),m=l.createBookmarks(),n=p.cells;for(var o=0;o<n.length;o++)p.commitContent(n[o]);p._.editor.forceNextSelectionCheck();l.selectBookmarks(m);p._.editor.selectionChange();}};});
+CKEDITOR.dialog.add( 'cellProperties', function( editor ) {
+ var langTable = editor.lang.table,
+ langCell = langTable.cell,
+ langCommon = editor.lang.common,
+ validate = CKEDITOR.dialog.validate,
+ widthPattern = /^(\d+(?:\.\d+)?)(px|%)$/,
+ heightPattern = /^(\d+(?:\.\d+)?)px$/,
+ bind = CKEDITOR.tools.bind,
+ spacer = { type: 'html', html: '&nbsp;' },
+ rtl = editor.lang.dir == 'rtl',
+ colorDialog = editor.plugins.colordialog;
+
+ return {
+ title: langCell.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: langCell.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: langCommon.width,
+ validate: validate[ 'number' ]( langCell.invalidWidth ),
+
+ // Extra labelling of width unit type.
+ onLoad: function() {
+ var widthType = this.getDialog().getContentElement( 'info', 'widthType' ),
+ labelElement = widthType.getElement(),
+ inputElement = this.getInputElement(),
+ ariaLabelledByAttr = inputElement.getAttribute( 'aria-labelledby' );
+
+ inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) );
+ },
+
+ setup: function( element ) {
+ var widthAttr = parseInt( element.getAttribute( 'width' ), 10 ),
+ widthStyle = parseInt( element.getStyle( 'width' ), 10 );
+
+ !isNaN( widthAttr ) && this.setValue( widthAttr );
+ !isNaN( widthStyle ) && this.setValue( widthStyle );
+ },
+ commit: function( element ) {
+ var value = parseInt( this.getValue(), 10 ),
+ unit = this.getDialog().getValueOf( 'info', 'widthType' );
+
+ if ( !isNaN( value ) )
+ element.setStyle( 'width', value + unit );
+ else
+ element.removeStyle( 'width' );
+
+ element.removeAttribute( 'width' );
+ },
+ 'default': ''
+ },
+ {
+ type: 'select',
+ id: 'widthType',
+ label: editor.lang.table.widthUnit,
+ labelStyle: 'visibility:hidden',
+ 'default': 'px',
+ items: [
+ [ langTable.widthPx, 'px' ],
+ [ langTable.widthPc, '%' ]
+ ],
+ setup: function( selectedCell ) {
+ var widthMatch = widthPattern.exec( selectedCell.getStyle( 'width' ) || selectedCell.getAttribute( 'width' ) );
+ if ( widthMatch )
+ this.setValue( widthMatch[ 2 ] );
+ }
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ widths: [ '70%', '30%' ],
+ children: [
+ {
+ type: 'text',
+ id: 'height',
+ label: langCommon.height,
+ width: '100px',
+ 'default': '',
+ validate: validate[ 'number' ]( langCell.invalidHeight ),
+
+ // Extra labelling of height unit type.
+ onLoad: function() {
+ var heightType = this.getDialog().getContentElement( 'info', 'htmlHeightType' ),
+ labelElement = heightType.getElement(),
+ inputElement = this.getInputElement(),
+ ariaLabelledByAttr = inputElement.getAttribute( 'aria-labelledby' );
+
+ inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) );
+ },
+
+ setup: function( element ) {
+ var heightAttr = parseInt( element.getAttribute( 'height' ), 10 ),
+ heightStyle = parseInt( element.getStyle( 'height' ), 10 );
+
+ !isNaN( heightAttr ) && this.setValue( heightAttr );
+ !isNaN( heightStyle ) && this.setValue( heightStyle );
+ },
+ commit: function( element ) {
+ var value = parseInt( this.getValue(), 10 );
+
+ if ( !isNaN( value ) )
+ element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) );
+ else
+ element.removeStyle( 'height' );
+
+ element.removeAttribute( 'height' );
+ }
+ },
+ {
+ id: 'htmlHeightType',
+ type: 'html',
+ html: '<br />' + langTable.widthPx
+ }
+ ]
+ },
+ spacer,
+ {
+ type: 'select',
+ id: 'wordWrap',
+ label: langCell.wordWrap,
+ 'default': 'yes',
+ items: [
+ [ langCell.yes, 'yes' ],
+ [ langCell.no, 'no' ]
+ ],
+ setup: function( element ) {
+ var wordWrapAttr = element.getAttribute( 'noWrap' ),
+ wordWrapStyle = element.getStyle( 'white-space' );
+
+ if ( wordWrapStyle == 'nowrap' || wordWrapAttr )
+ this.setValue( 'no' );
+ },
+ commit: function( element ) {
+ if ( this.getValue() == 'no' )
+ element.setStyle( 'white-space', 'nowrap' );
+ else
+ element.removeStyle( 'white-space' );
+
+ element.removeAttribute( 'noWrap' );
+ }
+ },
+ spacer,
+ {
+ type: 'select',
+ id: 'hAlign',
+ label: langCell.hAlign,
+ 'default': '',
+ items: [
+ [ langCommon.notSet, '' ],
+ [ langCommon.alignLeft, 'left' ],
+ [ langCommon.alignCenter, 'center' ],
+ [ langCommon.alignRight, 'right' ]
+ ],
+ setup: function( element ) {
+ var alignAttr = element.getAttribute( 'align' ),
+ textAlignStyle = element.getStyle( 'text-align' );
+
+ this.setValue( textAlignStyle || alignAttr || '' );
+ },
+ commit: function( selectedCell ) {
+ var value = this.getValue();
+
+ if ( value )
+ selectedCell.setStyle( 'text-align', value );
+ else
+ selectedCell.removeStyle( 'text-align' );
+
+ selectedCell.removeAttribute( 'align' );
+ }
+ },
+ {
+ type: 'select',
+ id: 'vAlign',
+ label: langCell.vAlign,
+ 'default': '',
+ items: [
+ [ langCommon.notSet, '' ],
+ [ langCommon.alignTop, 'top' ],
+ [ langCommon.alignMiddle, 'middle' ],
+ [ langCommon.alignBottom, 'bottom' ],
+ [ langCell.alignBaseline, 'baseline' ]
+ ],
+ setup: function( element ) {
+ var vAlignAttr = element.getAttribute( 'vAlign' ),
+ vAlignStyle = element.getStyle( 'vertical-align' );
+
+ switch ( vAlignStyle ) {
+ // Ignore all other unrelated style values..
+ case 'top':
+ case 'middle':
+ case 'bottom':
+ case 'baseline':
+ break;
+ default:
+ vAlignStyle = '';
+ }
+
+ this.setValue( vAlignStyle || vAlignAttr || '' );
+ },
+ commit: function( element ) {
+ var value = this.getValue();
+
+ if ( value )
+ element.setStyle( 'vertical-align', value );
+ else
+ element.removeStyle( 'vertical-align' );
+
+ element.removeAttribute( 'vAlign' );
+ }
+ }
+ ]
+ },
+ spacer,
+ {
+ type: 'vbox',
+ padding: 0,
+ children: [
+ {
+ type: 'select',
+ id: 'cellType',
+ label: langCell.cellType,
+ 'default': 'td',
+ items: [
+ [ langCell.data, 'td' ],
+ [ langCell.header, 'th' ]
+ ],
+ setup: function( selectedCell ) {
+ this.setValue( selectedCell.getName() );
+ },
+ commit: function( selectedCell ) {
+ selectedCell.renameNode( this.getValue() );
+ }
+ },
+ spacer,
+ {
+ type: 'text',
+ id: 'rowSpan',
+ label: langCell.rowSpan,
+ 'default': '',
+ validate: validate.integer( langCell.invalidRowSpan ),
+ setup: function( selectedCell ) {
+ var attrVal = parseInt( selectedCell.getAttribute( 'rowSpan' ), 10 );
+ if ( attrVal && attrVal != 1 )
+ this.setValue( attrVal );
+ },
+ commit: function( selectedCell ) {
+ var value = parseInt( this.getValue(), 10 );
+ if ( value && value != 1 )
+ selectedCell.setAttribute( 'rowSpan', this.getValue() );
+ else
+ selectedCell.removeAttribute( 'rowSpan' );
+ }
+ },
+ {
+ type: 'text',
+ id: 'colSpan',
+ label: langCell.colSpan,
+ 'default': '',
+ validate: validate.integer( langCell.invalidColSpan ),
+ setup: function( element ) {
+ var attrVal = parseInt( element.getAttribute( 'colSpan' ), 10 );
+ if ( attrVal && attrVal != 1 )
+ this.setValue( attrVal );
+ },
+ commit: function( selectedCell ) {
+ var value = parseInt( this.getValue(), 10 );
+ if ( value && value != 1 )
+ selectedCell.setAttribute( 'colSpan', this.getValue() );
+ else
+ selectedCell.removeAttribute( 'colSpan' );
+ }
+ },
+ spacer,
+ {
+ type: 'hbox',
+ padding: 0,
+ widths: [ '60%', '40%' ],
+ children: [
+ {
+ type: 'text',
+ id: 'bgColor',
+ label: langCell.bgColor,
+ 'default': '',
+ setup: function( element ) {
+ var bgColorAttr = element.getAttribute( 'bgColor' ),
+ bgColorStyle = element.getStyle( 'background-color' );
+
+ this.setValue( bgColorStyle || bgColorAttr );
+ },
+ commit: function( selectedCell ) {
+ var value = this.getValue();
+
+ if ( value )
+ selectedCell.setStyle( 'background-color', this.getValue() );
+ else
+ selectedCell.removeStyle( 'background-color' );
+
+ selectedCell.removeAttribute( 'bgColor' );
+ }
+ },
+ colorDialog ? {
+ type: 'button',
+ id: 'bgColorChoose',
+ "class": 'colorChooser',
+ label: langCell.chooseColor,
+ onLoad: function() {
+ // Stick the element to the bottom (#5587)
+ this.getElement().getParent().setStyle( 'vertical-align', 'bottom' );
+ },
+ onClick: function() {
+ editor.getColorFromDialog( function( color ) {
+ if ( color )
+ this.getDialog().getContentElement( 'info', 'bgColor' ).setValue( color );
+ this.focus();
+ }, this );
+ }
+ } : spacer
+ ]
+ },
+ spacer,
+ {
+ type: 'hbox',
+ padding: 0,
+ widths: [ '60%', '40%' ],
+ children: [
+ {
+ type: 'text',
+ id: 'borderColor',
+ label: langCell.borderColor,
+ 'default': '',
+ setup: function( element ) {
+ var borderColorAttr = element.getAttribute( 'borderColor' ),
+ borderColorStyle = element.getStyle( 'border-color' );
+
+ this.setValue( borderColorStyle || borderColorAttr );
+ },
+ commit: function( selectedCell ) {
+ var value = this.getValue();
+ if ( value )
+ selectedCell.setStyle( 'border-color', this.getValue() );
+ else
+ selectedCell.removeStyle( 'border-color' );
+
+ selectedCell.removeAttribute( 'borderColor' );
+ }
+ },
+
+ colorDialog ? {
+ type: 'button',
+ id: 'borderColorChoose',
+ "class": 'colorChooser',
+ label: langCell.chooseColor,
+ style: ( rtl ? 'margin-right' : 'margin-left' ) + ': 10px',
+ onLoad: function() {
+ // Stick the element to the bottom (#5587)
+ this.getElement().getParent().setStyle( 'vertical-align', 'bottom' );
+ },
+ onClick: function() {
+ editor.getColorFromDialog( function( color ) {
+ if ( color )
+ this.getDialog().getContentElement( 'info', 'borderColor' ).setValue( color );
+ this.focus();
+ }, this );
+ }
+ } : spacer
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ onShow: function() {
+ this.cells = CKEDITOR.plugins.tabletools.getSelectedCells( this._.editor.getSelection() );
+ this.setupContent( this.cells[ 0 ] );
+ },
+ onOk: function() {
+ var selection = this._.editor.getSelection(),
+ bookmarks = selection.createBookmarks();
+
+ var cells = this.cells;
+ for ( var i = 0; i < cells.length; i++ )
+ this.commitContent( cells[ i ] );
+
+ this._.editor.forceNextSelectionCheck();
+ selection.selectBookmarks( bookmarks );
+ this._.editor.selectionChange();
+ }
+ };
+});
diff --git a/plugins/templates/dialogs/templates.js b/plugins/templates/dialogs/templates.js
index 6e761e0..8b3b70f 100644
--- a/plugins/templates/dialogs/templates.js
+++ b/plugins/templates/dialogs/templates.js
@@ -1,7 +1,203 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-(function(){var a=CKEDITOR.document;CKEDITOR.dialog.add('templates',function(b){function c(k,l){k.setHtml('');for(var m=0,n=l.length;m<n;m++){var o=CKEDITOR.getTemplates(l[m]),p=o.imagesPath,q=o.templates,r=q.length;for(var s=0;s<r;s++){var t=q[s],u=d(t,p);u.setAttribute('aria-posinset',s+1);u.setAttribute('aria-setsize',r);k.append(u);}}};function d(k,l){var m=CKEDITOR.dom.element.createFromHtml('<a href="javascript:void(0)" tabIndex="-1" role="option" ><div class="cke_tpl_item"></div></a>'),n='<table style="width:350px;" class="cke_tpl_preview" role="presentation"><tr>';if(k.image&&l)n+='<td class="cke_tpl_preview_img"><img src="'+CKEDITOR.getUrl(l+k.image)+'"'+(CKEDITOR.env.ie6Compat?' onload="this.width=this.width"':'')+' alt="" title=""></td>';n+='<td style="white-space:normal;"><span class="cke_tpl_title">'+k.title+'</span><br/>';if(k.description)n+='<span>'+k.description+'</span>';n+='</td></tr></table>';m.getFirst().setHtml(n);m.on('click',function(){e(k.html);});return m;};function e(k){var l=CKEDITOR.dialog.getCurrent(),m=l.getValueOf('selectTpl','chkInsertOpt');if(m){b.on('contentDom',function(n){n.removeListener();l.hide();var o=new CKEDITOR.dom.range(b.document);o.moveToElementEditStart(b.document.getBody());o.select(1);setTimeout(function(){b.fire('saveSnapshot');},0);});b.fire('saveSnapshot');b.setData(k);}else{b.insertHtml(k);l.hide();}};function f(k){var l=k.data.getTarget(),m=g.equals(l);if(m||g.contains(l)){var n=k.data.getKeystroke(),o=g.getElementsByTag('a'),p;if(o){if(m)p=o.getItem(0);else switch(n){case 40:p=l.getNext();break;case 38:p=l.getPrevious();break;case 13:case 32:l.fire('click');}if(p){p.focus();k.data.preventDefault();}}}};CKEDITOR.skins.load(b,'templates');var g,h='cke_tpl_list_label_'+CKEDITOR.tools.getNextNumber(),i=b.lang.templates,j=b.config;return{title:b.lang.templates.title,minWidth:CKEDITOR.env.ie?440:400,minHeight:340,contents:[{id:'selectTpl',label:i.title,elements:[{type:'vbox',padding:5,children:[{id:'selectTplText',type:'html',html:'<span>'+i.selectPromptMsg+'</span>'},{id:'templatesList',type:'html',focus:true,html:'<div class="cke_tpl_list" tabIndex="-1" role="listbox" aria-labelledby="'+h+'">'+'<div class="cke_tpl_loading"><span></span></div>'+'</div>'+'<span class="cke_voice_label" id="'+h+'">'+i.options+'</span>'},{id:'chkInsertOpt',type:'checkbox',label:i.insertOption,'default':j.templates_replaceContent}]}]}],buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var k=this.getContentElement('selectTpl','templatesList');
-g=k.getElement();CKEDITOR.loadTemplates(j.templates_files,function(){var l=(j.templates||'default').split(',');if(l.length){c(g,l);k.focus();}else g.setHtml('<div class="cke_tpl_empty"><span>'+i.emptyListMsg+'</span>'+'</div>');});this._.element.on('keydown',f);},onHide:function(){this._.element.removeListener('keydown',f);}};});})();
+(function() {
+ var doc = CKEDITOR.document;
+
+ CKEDITOR.dialog.add( 'templates', function( editor ) {
+ // Constructs the HTML view of the specified templates data.
+ function renderTemplatesList( container, templatesDefinitions ) {
+ // clear loading wait text.
+ container.setHtml( '' );
+
+ for ( var i = 0, totalDefs = templatesDefinitions.length; i < totalDefs; i++ ) {
+ var definition = CKEDITOR.getTemplates( templatesDefinitions[ i ] ),
+ imagesPath = definition.imagesPath,
+ templates = definition.templates,
+ count = templates.length;
+
+ for ( var j = 0; j < count; j++ ) {
+ var template = templates[ j ],
+ item = createTemplateItem( template, imagesPath );
+ item.setAttribute( 'aria-posinset', j + 1 );
+ item.setAttribute( 'aria-setsize', count );
+ container.append( item );
+ }
+ }
+ }
+
+ function createTemplateItem( template, imagesPath ) {
+ var item = CKEDITOR.dom.element.createFromHtml( '<a href="javascript:void(0)" tabIndex="-1" role="option" >' +
+ '<div class="cke_tpl_item"></div>' +
+ '</a>' );
+
+ // Build the inner HTML of our new item DIV.
+ var html = '<table style="width:350px;" class="cke_tpl_preview" role="presentation"><tr>';
+
+ if ( template.image && imagesPath )
+ html += '<td class="cke_tpl_preview_img"><img src="' + CKEDITOR.getUrl( imagesPath + template.image ) + '"' + ( CKEDITOR.env.ie6Compat ? ' onload="this.width=this.width"' : '' ) + ' alt="" title=""></td>';
+
+ html += '<td style="white-space:normal;"><span class="cke_tpl_title">' + template.title + '</span><br/>';
+
+ if ( template.description )
+ html += '<span>' + template.description + '</span>';
+
+ html += '</td></tr></table>';
+
+ item.getFirst().setHtml( html );
+
+ item.on( 'click', function() {
+ insertTemplate( template.html );
+ });
+
+ return item;
+ }
+
+ // Insert the specified template content into editor.
+ // @param {Number} index
+ function insertTemplate( html ) {
+ var dialog = CKEDITOR.dialog.getCurrent(),
+ isReplace = dialog.getValueOf( 'selectTpl', 'chkInsertOpt' );
+
+ if ( isReplace ) {
+ editor.fire( 'saveSnapshot' );
+ // Everything should happen after the document is loaded (#4073).
+ editor.setData( html, function() {
+ dialog.hide();
+
+ // Place the cursor at the first editable place.
+ var range = editor.createRange();
+ range.moveToElementEditStart( editor.editable() );
+ range.select();
+ setTimeout( function() {
+ editor.fire( 'saveSnapshot' );
+ }, 0 );
+
+ } );
+ } else {
+ editor.insertHtml( html );
+ dialog.hide();
+ }
+ }
+
+ function keyNavigation( evt ) {
+ var target = evt.data.getTarget(),
+ onList = listContainer.equals( target );
+
+ // Keyboard navigation for template list.
+ if ( onList || listContainer.contains( target ) ) {
+ var keystroke = evt.data.getKeystroke(),
+ items = listContainer.getElementsByTag( 'a' ),
+ focusItem;
+
+ if ( items ) {
+ // Focus not yet onto list items?
+ if ( onList )
+ focusItem = items.getItem( 0 );
+ else {
+ switch ( keystroke ) {
+ case 40: // ARROW-DOWN
+ focusItem = target.getNext();
+ break;
+
+ case 38: // ARROW-UP
+ focusItem = target.getPrevious();
+ break;
+
+ case 13: // ENTER
+ case 32: // SPACE
+ target.fire( 'click' );
+ }
+ }
+
+ if ( focusItem ) {
+ focusItem.focus();
+ evt.data.preventDefault();
+ }
+ }
+ }
+ }
+
+ // Load skin at first.
+ var plugin = CKEDITOR.plugins.get( 'templates' );
+ CKEDITOR.document.appendStyleSheet( CKEDITOR.getUrl( plugin.path + 'dialogs/templates.css' ) );
+
+
+ var listContainer;
+
+ var templateListLabelId = 'cke_tpl_list_label_' + CKEDITOR.tools.getNextNumber(),
+ lang = editor.lang.templates,
+ config = editor.config;
+ return {
+ title: editor.lang.templates.title,
+
+ minWidth: CKEDITOR.env.ie ? 440 : 400,
+ minHeight: 340,
+
+ contents: [
+ {
+ id: 'selectTpl',
+ label: lang.title,
+ elements: [
+ {
+ type: 'vbox',
+ padding: 5,
+ children: [
+ {
+ id: 'selectTplText',
+ type: 'html',
+ html: '<span>' +
+ lang.selectPromptMsg +
+ '</span>'
+ },
+ {
+ id: 'templatesList',
+ type: 'html',
+ focus: true,
+ html: '<div class="cke_tpl_list" tabIndex="-1" role="listbox" aria-labelledby="' + templateListLabelId + '">' +
+ '<div class="cke_tpl_loading"><span></span></div>' +
+ '</div>' +
+ '<span class="cke_voice_label" id="' + templateListLabelId + '">' + lang.options + '</span>'
+ },
+ {
+ id: 'chkInsertOpt',
+ type: 'checkbox',
+ label: lang.insertOption,
+ 'default': config.templates_replaceContent
+ }
+ ]
+ }
+ ]
+ }
+ ],
+
+ buttons: [ CKEDITOR.dialog.cancelButton ],
+
+ onShow: function() {
+ var templatesListField = this.getContentElement( 'selectTpl', 'templatesList' );
+ listContainer = templatesListField.getElement();
+
+ CKEDITOR.loadTemplates( config.templates_files, function() {
+ var templates = ( config.templates || 'default' ).split( ',' );
+
+ if ( templates.length ) {
+ renderTemplatesList( listContainer, templates );
+ templatesListField.focus();
+ } else {
+ listContainer.setHtml( '<div class="cke_tpl_empty">' +
+ '<span>' + lang.emptyListMsg + '</span>' +
+ '</div>' );
+ }
+ });
+
+ this._.element.on( 'keydown', keyNavigation );
+ },
+
+ onHide: function() {
+ this._.element.removeListener( 'keydown', keyNavigation );
+ }
+ };
+ });
+})();
diff --git a/plugins/templates/templates/default.js b/plugins/templates/templates/default.js
index f1bb531..7cab991 100644
--- a/plugins/templates/templates/default.js
+++ b/plugins/templates/templates/default.js
@@ -1,6 +1,88 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-CKEDITOR.addTemplates('default',{imagesPath:CKEDITOR.getUrl(CKEDITOR.plugins.getPath('templates')+'templates/images/'),templates:[{title:'Image and Title',image:'template1.gif',description:'One main image with a title and text that surround the image.',html:'<h3><img style="margin-right: 10px" height="100" width="100" align="left"/>Type the title here</h3><p>Type the text here</p>'},{title:'Strange Template',image:'template2.gif',description:'A template that defines two colums, each one with a title, and some text.',html:'<table cellspacing="0" cellpadding="0" style="width:100%" border="0"><tr><td style="width:50%"><h3>Title 1</h3></td><td></td><td style="width:50%"><h3>Title 2</h3></td></tr><tr><td>Text 1</td><td></td><td>Text 2</td></tr></table><p>More text goes here.</p>'},{title:'Text and Table',image:'template3.gif',description:'A title with some text and a table.',html:'<div style="width: 80%"><h3>Title goes here</h3><table style="width:150px;float: right" cellspacing="0" cellpadding="0" border="1"><caption style="border:solid 1px black"><strong>Table title</strong></caption></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></table><p>Type the text here</p></div>'}]});
+// Register a templates definition set named "default".
+CKEDITOR.addTemplates( 'default', {
+ // The name of sub folder which hold the shortcut preview images of the
+ // templates.
+ imagesPath: CKEDITOR.getUrl( CKEDITOR.plugins.getPath( 'templates' ) + 'templates/images/' ),
+
+ // The templates definitions.
+ templates: [
+ {
+ title: 'Image and Title',
+ image: 'template1.gif',
+ description: 'One main image with a title and text that surround the image.',
+ html: '<h3>' +
+ '<img style="margin-right: 10px" height="100" width="100" align="left"/>' +
+ 'Type the title here' +
+ '</h3>' +
+ '<p>' +
+ 'Type the text here' +
+ '</p>'
+ },
+ {
+ title: 'Strange Template',
+ image: 'template2.gif',
+ description: 'A template that defines two colums, each one with a title, and some text.',
+ html: '<table cellspacing="0" cellpadding="0" style="width:100%" border="0">' +
+ '<tr>' +
+ '<td style="width:50%">' +
+ '<h3>Title 1</h3>' +
+ '</td>' +
+ '<td></td>' +
+ '<td style="width:50%">' +
+ '<h3>Title 2</h3>' +
+ '</td>' +
+ '</tr>' +
+ '<tr>' +
+ '<td>' +
+ 'Text 1' +
+ '</td>' +
+ '<td></td>' +
+ '<td>' +
+ 'Text 2' +
+ '</td>' +
+ '</tr>' +
+ '</table>' +
+ '<p>' +
+ 'More text goes here.' +
+ '</p>'
+ },
+ {
+ title: 'Text and Table',
+ image: 'template3.gif',
+ description: 'A title with some text and a table.',
+ html: '<div style="width: 80%">' +
+ '<h3>' +
+ 'Title goes here' +
+ '</h3>' +
+ '<table style="width:150px;float: right" cellspacing="0" cellpadding="0" border="1">' +
+ '<caption style="border:solid 1px black">' +
+ '<strong>Table title</strong>' +
+ '</caption>' +
+ '<tr>' +
+ '<td>&nbsp;</td>' +
+ '<td>&nbsp;</td>' +
+ '<td>&nbsp;</td>' +
+ '</tr>' +
+ '<tr>' +
+ '<td>&nbsp;</td>' +
+ '<td>&nbsp;</td>' +
+ '<td>&nbsp;</td>' +
+ '</tr>' +
+ '<tr>' +
+ '<td>&nbsp;</td>' +
+ '<td>&nbsp;</td>' +
+ '<td>&nbsp;</td>' +
+ '</tr>' +
+ '</table>' +
+ '<p>' +
+ 'Type the text here' +
+ '</p>' +
+ '</div>'
+ }
+ ]
+});
diff --git a/plugins/wsc/dialogs/ciframe.html b/plugins/wsc/dialogs/ciframe.html
index 0a96d82..1d6ba5a 100644
--- a/plugins/wsc/dialogs/ciframe.html
+++ b/plugins/wsc/dialogs/ciframe.html
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<html>
@@ -38,9 +38,26 @@ function sendData2Master()
catch (e) {}
}
+function OnMessage (event) {
+ var message = event.data;
+ var destination = window.parent.parent;
+ destination.XDTMaster.read( [ 'end', message, 'fpm' ] ) ;
+}
+
+function listenPostMessage() {
+ if (window.addEventListener) { // all browsers except IE before version 9
+ window.addEventListener ("message", OnMessage, false);
+ }else {
+ if (window.attachEvent) { // IE before version 9
+ window.attachEvent("onmessage", OnMessage);
+ }
+ }
+}
+
function onLoad()
{
interval = window.setInterval( sendData2Master, 100 );
+ listenPostMessage();
}
</script>
diff --git a/plugins/wsc/dialogs/tmpFrameset.html b/plugins/wsc/dialogs/tmpFrameset.html
index 41abd6e..88e1afe 100644
--- a/plugins/wsc/dialogs/tmpFrameset.html
+++ b/plugins/wsc/dialogs/tmpFrameset.html
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<!--
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<html>
diff --git a/plugins/wsc/dialogs/wsc.css b/plugins/wsc/dialogs/wsc.css
index 74dd4e1..e163948 100644
--- a/plugins/wsc/dialogs/wsc.css
+++ b/plugins/wsc/dialogs/wsc.css
@@ -3,4 +3,80 @@ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
-html,body{background-color:transparent;margin:0;padding:0;}body{padding:10px;}body,td,input,select,textarea{font-size:11px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;}.midtext{padding:0;margin:10px;}.midtext p{padding:0;margin:10px;}.Button{border:#737357 1px solid;color:#3b3b1f;background-color:#c7c78f;}.PopupTabArea{color:#737357;background-color:#e3e3c7;}.PopupTitleBorder{border-bottom:#d5d59d 1px solid;}.PopupTabEmptyArea{padding-left:10px;border-bottom:#d5d59d 1px solid;}.PopupTab,.PopupTabSelected{border-right:#d5d59d 1px solid;border-top:#d5d59d 1px solid;border-left:#d5d59d 1px solid;padding:3px 5px 3px 5px;color:#737357;}.PopupTab{margin-top:1px;border-bottom:#d5d59d 1px solid;cursor:pointer;}.PopupTabSelected{font-weight:bold;cursor:default;padding-top:4px;border-bottom:#f1f1e3 1px solid;background-color:#f1f1e3;}
+html, body
+{
+ background-color: transparent;
+ margin: 0px;
+ padding: 0px;
+}
+
+body
+{
+ padding: 10px;
+}
+
+body, td, input, select, textarea
+{
+ font-size: 11px;
+ font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
+}
+
+.midtext
+{
+ padding:0px;
+ margin:10px;
+}
+
+.midtext p
+{
+ padding:0px;
+ margin:10px;
+}
+
+.Button
+{
+ border: #737357 1px solid;
+ color: #3b3b1f;
+ background-color: #c7c78f;
+}
+
+.PopupTabArea
+{
+ color: #737357;
+ background-color: #e3e3c7;
+}
+
+.PopupTitleBorder
+{
+ border-bottom: #d5d59d 1px solid;
+}
+.PopupTabEmptyArea
+{
+ padding-left: 10px;
+ border-bottom: #d5d59d 1px solid;
+}
+
+.PopupTab, .PopupTabSelected
+{
+ border-right: #d5d59d 1px solid;
+ border-top: #d5d59d 1px solid;
+ border-left: #d5d59d 1px solid;
+ padding: 3px 5px 3px 5px;
+ color: #737357;
+}
+
+.PopupTab
+{
+ margin-top: 1px;
+ border-bottom: #d5d59d 1px solid;
+ cursor: pointer;
+}
+
+.PopupTabSelected
+{
+ font-weight: bold;
+ cursor: default;
+ padding-top: 4px;
+ border-bottom: #f1f1e3 1px solid;
+ background-color: #f1f1e3;
+}
diff --git a/plugins/wsc/dialogs/wsc.js b/plugins/wsc/dialogs/wsc.js
index 8ca567b..f71918a 100644
--- a/plugins/wsc/dialogs/wsc.js
+++ b/plugins/wsc/dialogs/wsc.js
@@ -1,7 +1,2092 @@
-/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
-*/
+/**
+ * @license Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
-CKEDITOR.dialog.add('checkspell',function(a){var b=CKEDITOR.tools.getNextNumber(),c='cke_frame_'+b,d='cke_data_'+b,e='cke_error_'+b,f,g=document.location.protocol||'http:',h=a.lang.spellCheck.notAvailable,i='<textarea style="display: none" id="'+d+'"'+' rows="10"'+' cols="40">'+' </textarea><div'+' id="'+e+'"'+' style="display:none;color:red;font-size:16px;font-weight:bold;padding-top:160px;text-align:center;z-index:11;">'+'</div><iframe'+' src=""'+' style="width:100%;background-color:#f1f1e3;"'+' frameborder="0"'+' name="'+c+'"'+' id="'+c+'"'+' allowtransparency="1">'+'</iframe>',j=a.config.wsc_customLoaderScript||g+'//loader.webspellchecker.net/sproxy_fck/sproxy.php'+'?plugin=fck2'+'&customerid='+a.config.wsc_customerId+'&cmd=script&doc=wsc&schema=22';if(a.config.wsc_customLoaderScript)h+='<p style="color:#000;font-size:11px;font-weight: normal;text-align:center;padding-top:10px">'+a.lang.spellCheck.errorLoading.replace(/%s/g,a.config.wsc_customLoaderScript)+'</p>';function k(m,n){var o=0;return function(){if(typeof window.doSpell=='function'){if(typeof f!='undefined')window.clearInterval(f);l(m);}else if(o++==180)window._cancelOnError(n);};};window._cancelOnError=function(m){if(typeof window.WSC_Error=='undefined'){CKEDITOR.document.getById(c).setStyle('display','none');var n=CKEDITOR.document.getById(e);n.setStyle('display','block');n.setHtml(m||a.lang.spellCheck.notAvailable);}};function l(m){var n=new window._SP_FCK_LangCompare(),o=CKEDITOR.getUrl(a.plugins.wsc.path+'dialogs/'),p=o+'tmpFrameset.html';window.gFCKPluginName='wsc';n.setDefaulLangCode(a.config.defaultLanguage);window.doSpell({ctrl:d,lang:a.config.wsc_lang||n.getSPLangCode(a.langCode),intLang:a.config.wsc_uiLang||n.getSPLangCode(a.langCode),winType:c,onCancel:function(){m.hide();},onFinish:function(q){a.focus();m.getParentEditor().setData(q.value);m.hide();},staticFrame:p,framesetPath:p,iframePath:o+'ciframe.html',schemaURI:o+'wsc.css',userDictionaryName:a.config.wsc_userDictionaryName,customDictionaryName:a.config.wsc_customDictionaryIds&&a.config.wsc_customDictionaryIds.split(','),domainName:a.config.wsc_domainName});CKEDITOR.document.getById(e).setStyle('display','none');CKEDITOR.document.getById(c).setStyle('display','block');};return{title:a.config.wsc_dialogTitle||a.lang.spellCheck.title,minWidth:485,minHeight:380,buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var m=this.getContentElement('general','content').getElement();m.setHtml(i);m.getChild(2).setStyle('height',this._.contentSize.height+'px');
-if(typeof window.doSpell!='function')CKEDITOR.document.getHead().append(CKEDITOR.document.createElement('script',{attributes:{type:'text/javascript',src:j}}));var n=a.getData();CKEDITOR.document.getById(d).setValue(n);f=window.setInterval(k(this,h),250);},onHide:function(){window.ooo=undefined;window.int_framsetLoaded=undefined;window.framesetLoaded=undefined;window.is_window_opened=false;},contents:[{id:'general',label:a.config.wsc_dialogTitle||a.lang.spellCheck.title,padding:0,elements:[{type:'html',id:'content',html:''}]}]};});CKEDITOR.dialog.on('resize',function(a){var b=a.data,c=b.dialog;if(c._.name=='checkspell'){var d=c.getContentElement('general','content').getElement(),e=d&&d.getChild(2);e&&e.setSize('height',b.height);e&&e.setSize('width',b.width);}});
+/** ManagerPostMessage
+ *************************/
+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,
+ objObject = "[object Object]";
+ fn = o.fn || null;
+ id = o.id || '';
+ target = o.target || window;
+ message = o.message || {
+ 'id': id
+ };
+
+ if (type.call(o.message) == objObject) {
+ (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
+ }
+};
+
+/** Tools
+ *************************/
+var tools = {
+ hash: {
+ create: function(o, fn) {
+ var fn = fn || null;
+ var str = JSON.stringify(o, fn);
+ return str;
+ },
+ parse: function(str, fn) {
+ var fn = fn || null;
+ return JSON.parse(str, fn);
+ }
+ },
+ filter4html: function(str) {
+ return str.replace(/"/g, "&quot;").replace(/'/g, "&#146;");
+ },
+ setCookie: function(name, value, options) {
+ options = options || {};
+
+ var expires = options.expires;
+
+ if (typeof expires == "number" && expires) {
+ var d = new Date();
+ d.setTime(d.getTime() + expires*1000);
+ expires = options.expires = d;
+ }
+ if (expires && expires.toUTCString) {
+ options.expires = expires.toUTCString();
+ }
+
+ value = encodeURIComponent(value);
+
+ var updatedCookie = name + "=" + value;
+
+ for(var propName in options) {
+ updatedCookie += "; " + propName;
+ var propValue = options[propName];
+ if (propValue !== true) {
+ updatedCookie += "=" + propValue;
+ }
+ }
+
+ document.cookie = updatedCookie;
+ },
+ getCookie: function(name) {
+ var matches = document.cookie.match(new RegExp(
+ "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
+ ));
+ return matches ? decodeURIComponent(matches[1]) : undefined;
+ },
+ deleteCookie: function(name) {
+ setCookie(name, "", { expires: -1 })
+ }
+};
+
+var optionsDataObject = {};
+var NS = {};
+var nameNode = null;
+NS.targetFromFrame = {};
+//NS.currentLang = CKEDITOR.config.wsc_lang || 'en_US';
+NS.wsc_customerId = CKEDITOR.config.wsc_customerId;
+NS.cust_dic_ids = CKEDITOR.config.wsc_customDictionaryIds;
+NS.userDictionaryName = CKEDITOR.config.wsc_userDictionaryName;
+NS.defaultLanguage = CKEDITOR.config.defaultLanguage;
+NS.LocalizationComing = {};
+
+function OptionsConfirm(state) {
+ if (state) {
+ nameNode.setValue('');
+ };
+};
+
+CKEDITOR.dialog.add('checkspell', function(editor) {
+
+ CKEDITOR.on('dialogDefinition', function(dialogDefinitionEvent) {
+ var dialogDefinition = dialogDefinitionEvent.data.definition;
+ dialogDefinition.dialog.on('cancel', function(cancelEvent) {
+ return false;
+ }, this, null, -1);
+ });
+
+ /* NameSpace Plugin
+ *************************/
+ NS.CKNumber = CKEDITOR.tools.getNextNumber();
+ NS.iframeNumber = 'cke_frame_' + NS.CKNumber;
+ NS.TextAreaNumber = 'cke_textarea_' + NS.CKNumber;
+ NS.pluginPath = CKEDITOR.getUrl(editor.plugins.wsc.path);
+ NS.logotype = DefaultParams.logoPath;
+ NS.templatePath = NS.pluginPath + 'dialogs/tmp.html';
+ NS.div_overlay_no_check = null;
+ NS.loadIcon = DefaultParams.iconPath;
+ NS.loadIconEmptyEditor = DefaultParams.iconPathEmptyEditor;
+ NS.LangComparer = new _SP_FCK_LangCompare();
+ NS.LangComparer.setDefaulLangCode( NS.defaultLanguage );
+ NS.currentLang = editor.config.wsc_lang || NS.LangComparer.getSPLangCode( editor.langCode );
+ NS.LocalizationButton = {
+ 'ChangeTo': {
+ 'instance' : null,
+ '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'
+ }
+ };
+
+ NS.LocalizationLabel = {
+ 'ChangeTo': {
+ 'instance' : null,
+ 'text' : 'Change to'
+ },
+
+ 'Suggestions': {
+ 'instance' : null,
+ 'text' : 'Suggestions'
+ }
+ };
+
+ var SetLocalizationButton = function(obj) {
+
+ for(var i in obj) {
+ obj[i].instance.getElement().setText(NS.LocalizationComing[i]);
+ };
+ };
+
+ var SetLocalizationLabel = function(obj) {
+
+ for(var i in obj) {
+ if (!obj[i].instance.setLabel) {
+ return;
+ };
+ obj[i].instance.setLabel(NS.LocalizationComing[i]);
+ };
+ };
+
+
+ NS.load = true;
+ NS.cmd = {
+ "SpellTab": 'spell',
+ "Thesaurus": 'thes',
+ "GrammTab": 'grammar'
+ };
+ NS.dialog = null;
+ NS.optionNode = null;
+ NS.selectNode = null;
+ NS.grammerSuggest = null;
+ NS.textNode = {};
+ NS.iframeMain = null;
+ NS.dataTemp = '';
+ NS.div_overlay = null;
+ NS.textNodeInfo = {};
+ NS.selectNode = {};
+ NS.selectNodeResponce = {};
+ NS.selectingLang = NS.currentLang;//NS.LangComparer.getSPLangCode( NS.currentLang ) || NS.LangComparer.getDefaulLangCode();
+ NS.langList = null;
+ NS.serverLocationHash = DefaultParams.serviceHost;
+ NS.serverLocation = '#server=' + NS.serverLocationHash;
+ NS.langSelectbox = null;
+ NS.banner = '';
+
+ var manageMessage = null;
+ iframeOnload = false;
+
+
+ NS.framesetHtml = function(tab) {
+ var str = '<iframe src="' + NS.templatePath + NS.serverLocation +'" id=' + NS.iframeNumber + '_' + tab + ' frameborder="0" allowtransparency="1" style="width:100%;border: 1px solid #AEB3B9;overflow: auto;background:#fff; border-radius: 3px;"></iframe>'
+ return str;
+ };
+
+ NS.setIframe = function(that, nameTab) {
+ var str = NS.framesetHtml(nameTab);
+ return that.getElement().setHtml(str);
+ };
+
+ NS.setCurrentIframe = function(currentTab) {
+ var that = NS.dialog._.contents[currentTab].Content,
+ tabID, iframe;
+
+ NS.setIframe(that, currentTab);
+
+ };
+
+ NS.sendData = function() {
+ var currentTab = NS.dialog._.currentTabId,
+ that = NS.dialog._.contents[currentTab].Content,
+ tabID, iframe;
+
+ NS.setIframe(that, currentTab);
+ NS.dialog.parts.tabs.removeAllListeners();
+
+ NS.dialog.parts.tabs.on('click', function(event) {
+ event = event || window.event;
+ if (!event.data.getTarget().is('a')) {
+ return
+ };
+
+ if (currentTab == NS.dialog._.currentTabId) { return };
+
+ currentTab = NS.dialog._.currentTabId;
+ that = NS.dialog._.contents[currentTab].Content;
+ tabID = NS.iframeNumber + '_' + currentTab;
+
+
+ if (that.getElement().$.children.length == 0) {
+ NS.setIframe(that, currentTab);
+ iframe = document.getElementById(tabID);
+
+ /* iframe.onload = function() {
+ NS.targetFromFrame[tabID] = iframe.contentWindow;
+ //sendData(NS.targetFromFrame[tabID], NS.cmd[currentTab], null);
+ };*/
+ NS.targetFromFrame[tabID] = iframe.contentWindow;
+ //NS.div_overlay.setDisable();
+ } else {
+ sendData(NS.targetFromFrame[tabID], NS.cmd[currentTab]);
+ //NS.div_overlay.setDisable();
+ };
+ });
+
+ };
+
+ NS.buildOptionSynonyms = function(key) {
+ var syn = NS.selectNodeResponce[key];
+ NS.selectNode['synonyms'].clear();
+
+ for (var item = 0; item < syn.length; item++) {
+ NS.selectNode['synonyms'].add(syn[item], syn[item]);
+ };
+
+ NS.selectNode['synonyms'].getInputElement().$.firstChild.selected = true;
+ NS.textNode['Thesaurus'].setValue(NS.selectNode['synonyms'].getInputElement().getValue())
+ };
+
+ NS.buildSelectLang = function() {
+ var divContainer = new CKEDITOR.dom.element('div'),
+ selectContainer = new CKEDITOR.dom.element('select'),
+ id = "wscLang" + NS.CKNumber;
+
+ divContainer.addClass("cke_dialog_ui_input_select");
+ divContainer.setAttribute("role", "presentation");
+ divContainer.setStyles({
+ 'height': 'auto',
+ 'position': 'absolute',
+ 'right': '0',
+ 'top': '-1px',
+ 'width': '160px',
+ 'white-space': 'normal'
+ });
+
+ selectContainer.setAttribute('id', id)
+ selectContainer.addClass("cke_dialog_ui_input_select");
+ selectContainer.setStyles({
+ 'width': '160px'
+ });
+ var currentTabId = NS.dialog._.currentTabId,
+ frameId = NS.iframeNumber + '_' + currentTabId;
+
+ divContainer.append(selectContainer);
+
+ return divContainer;
+
+ };
+
+ NS.buildOptionLang = function(key) {
+ var id = "wscLang" + NS.CKNumber;
+ var select = document.getElementById(id),
+ create_option, txt_option;
+
+ if(select.options.length === 0) {
+ for (var lang in key) {
+ create_option=document.createElement("option");
+ create_option.setAttribute("value", key[lang]);
+ txt_option = document.createTextNode(lang);
+ create_option.appendChild(txt_option);
+
+ if (key[lang] == NS.selectingLang) {
+ create_option.selected = true;
+ };
+
+ select.appendChild(create_option);
+ };
+ };
+
+ for (var i = 0; i < select.options.length; i++) {
+ if (select.options[i].value == NS.selectingLang) {
+ select.options[i].selected = true;
+ };
+ continue;
+ };
+
+ };
+
+ // banner add
+ var setBannerInPlace = function(htmlBanner) {
+ var findBannerPlace = NS.dialog.getContentElement(NS.dialog._.currentTabId, 'banner').getElement();
+ findBannerPlace.setHtml(htmlBanner);
+ };
+
+
+ // Create overlay block on iframe when run button "options"
+ var overlayBlock = function overlayBlock(opt) {
+ var progress = opt.progress || "",
+ doc = document,
+ target = opt.target || doc.body,
+ overlayId = opt.id || "overlayBlock",
+ opacity = opt.opacity || "0.9",
+ background = opt.background || "#f1f1f1",
+ getOverlay = doc.getElementById(overlayId),
+ thisOverlay = getOverlay || doc.createElement("div");
+
+ thisOverlay.style.cssText = "position: absolute;" +
+ "top:30px;" +
+ "bottom:40px;" +
+ "left:1px;" +
+ "right:1px;" +
+ "z-index: 10020;" +
+ "padding:0;" +
+ "margin:0;" +
+ "background:" + background + ";" +
+ "opacity: " + opacity + ";" +
+ "filter: alpha(opacity=" + opacity * 100 + ");" +
+ "display: none;"
+ thisOverlay.id = overlayId;
+
+ if (!getOverlay) {
+ target.appendChild(thisOverlay);
+ }
+
+ return {
+ setDisable: function() {
+ thisOverlay.style.display = "none";
+ },
+ setEnable: function() {
+ thisOverlay.style.display = "block";
+ }
+ }
+ };
+
+
+ var buildRadioInputs = function(key, value, check) {
+ var divContainer = new CKEDITOR.dom.element('div'),
+ radioButton = new CKEDITOR.dom.element('input'),
+ radioLabel = new CKEDITOR.dom.element('label'),
+ id = "wscGrammerSuggest" + key + "_" + value;
+
+
+ divContainer.addClass("cke_dialog_ui_input_radio");
+ divContainer.setAttribute("role", "presentation");
+ divContainer.setStyles({
+ width: "97%",
+ padding: "5px",
+ 'white-space': 'normal'
+ });
+
+ radioButton.setAttributes({
+ type: "radio",
+ value: value,
+ name: 'wscGrammerSuggest',
+ id: id
+ });
+ radioButton.setStyles({
+ "float":"left"
+ });
+
+ radioButton.on("click", function(data) {
+ NS.textNode['GrammTab'].setValue(data.sender.getValue())
+ });
+
+ (check) ? radioButton.setAttribute("checked", true) : false;
+
+ radioButton.addClass("cke_dialog_ui_radio_input");
+
+ radioLabel.appendText(key);
+ radioLabel.setAttribute("for", id);
+ radioLabel.setStyles({
+ 'display': "block",
+ 'line-height': '16px',
+ 'margin-left': '18px',
+ 'white-space': 'normal'
+ });
+
+ divContainer.append(radioButton);
+ divContainer.append(radioLabel);
+
+ return divContainer;
+ };
+
+var langConstructor = function(lang) {
+ var langSelectBox = new __constructLangSelectbox(lang),
+ selectId = "wscLang" + NS.CKNumber,
+ selectContainer = document.getElementById(selectId),
+ currentTabId = NS.dialog._.currentTabId,
+ frameId = NS.iframeNumber + '_' + currentTabId;
+
+ NS.buildOptionLang(langSelectBox.setLangList);
+
+ //tabView[langSelectBox.getCurrentLangGroup(NS.selectingLang)]();
+
+ selectContainer.onchange = function(e){
+ e = e || window.event;
+ tabView[langSelectBox.getCurrentLangGroup(this.value)]();
+ NS.div_overlay.setEnable();
+
+ NS.selectingLang = this.value;
+
+ manageMessage.send({
+ 'message': {
+ 'changeLang': NS.selectingLang,
+ 'text': NS.dataTemp
+ },
+ 'target': NS.targetFromFrame[frameId],
+ 'id': 'selectionLang_outer__page'
+ });
+ //NS.div_overlay.setDisable();
+ };
+
+};
+
+var disableButtonSuggest = function(word) {
+ if (word == 'no_any_suggestions') {
+ word = 'No suggestions';
+ NS.LocalizationButton['ChangeTo'].instance.disable();
+ NS.LocalizationButton['ChangeAll'].instance.disable();
+
+ // hack for css disable button ckeditor 4
+ function styleDisable(/* string */instanceButton) {
+ var button = NS.LocalizationButton[instanceButton].instance;
+ button.getElement().hasClass('cke_disabled') ? button.getElement().setStyle('color', '#a0a0a0') : button.disable();
+ };
+
+ styleDisable('ChangeTo');
+ styleDisable('ChangeAll');
+
+ return word;
+ } else {
+ NS.LocalizationButton['ChangeTo'].instance.enable();
+ NS.LocalizationButton['ChangeAll'].instance.enable();
+ NS.LocalizationButton['ChangeTo'].instance.getElement().setStyle('color', '#333');
+ NS.LocalizationButton['ChangeAll'].instance.getElement().setStyle('color', '#333');
+ return word;
+ };
+
+};
+
+ var handlerId = {
+ iframeOnload: function(response) {
+ NS.div_overlay.setEnable();
+ iframeOnload = true;
+ var currentTab = NS.dialog._.currentTabId,
+ tabId = NS.iframeNumber + '_' + currentTab;
+ //debugger
+
+ sendData(NS.targetFromFrame[tabId], NS.cmd[currentTab]);
+ },
+
+ suggestlist: function(response) {
+ delete response.id;
+ NS.div_overlay_no_check.setDisable();
+ hideCurrentFinishChecking();
+ langConstructor(NS.langList);
+
+
+ var word = disableButtonSuggest(response.word),
+ suggestionsList = '';
+
+ if (word instanceof Array) {
+ word = response.word[0];
+
+ };
+ word = word.split(',');
+
+
+ //NS.langSelectbox = new __constructLangSelectbox(NS.langList);
+
+ //tabView[NS.langSelectbox.getCurrentLangGroup(NS.selectingLang)]();
+
+ //NS.buildOptionLang(NS.langSelectbox.setLangList);
+
+ suggestionsList = word;
+
+ selectNode.clear();
+ NS.textNode['SpellTab'].setValue(suggestionsList[0]);
+
+ for (var item = 0; item < suggestionsList.length; item++) {
+ selectNode.add(suggestionsList[item], suggestionsList[item]);
+ };
+
+ showCurrentTabs();
+ //NS.div_overlay.setEnable();
+ NS.div_overlay.setDisable();
+
+ },
+
+ grammerSuggest: function(response) {
+ delete response.id;
+// NS.langList = response.mocklangs;
+
+// langConstructor(NS.langList);
+ delete response.mocklangs;
+
+ hideCurrentFinishChecking();
+ var firstSuggestValue = response.grammSuggest[0];// ? firstSuggestValue = response.grammSuggest[0] : firstSuggestValue = 'No suggestion for this words';
+ NS.grammerSuggest.getElement().setHtml('');
+ NS.textNode['GrammTab'].reset();
+ NS.textNode['GrammTab'].setValue(firstSuggestValue);
+
+ NS.textNodeInfo['GrammTab'].getElement().setHtml('');
+ NS.textNodeInfo['GrammTab'].getElement().setText(response.info);
+
+ var arr = response.grammSuggest,
+ len = arr.length,
+ check = true;
+
+ for (var i = 0; i < len; i++) {
+ NS.grammerSuggest.getElement().append(buildRadioInputs(arr[i], arr[i], check));
+ check = false;
+ };
+
+ showCurrentTabs();
+ NS.div_overlay.setDisable();
+ },
+
+ thesaurusSuggest: function(response) {
+ delete response.id;
+// NS.langList = response.mocklangs;
+// langConstructor(NS.langList);
+ delete response.mocklangs;
+
+ hideCurrentFinishChecking();
+
+ NS.selectNodeResponce = response;
+
+ NS.textNode['Thesaurus'].reset();
+ NS.selectNode['categories'].clear();
+
+ for (var i in response) {
+ NS.selectNode['categories'].add(i, i);
+ };
+
+ var synKey = NS.selectNode['categories'].getInputElement().getChildren().$[0].value;
+
+ NS.selectNode['categories'].getInputElement().getChildren().$[0].selected = true;
+
+ NS.buildOptionSynonyms(synKey);
+
+ showCurrentTabs();
+ NS.div_overlay.setDisable();
+ },
+ finish: function(response) {
+ delete response.id;
+
+ hideCurrentTabs();
+ showCurrentFinishChecking();
+ NS.div_overlay.setDisable();
+ },
+ settext: function(response) {
+ delete response.id;
+
+ NS.dialog.getParentEditor().focus();
+ NS.dialog.getParentEditor().setData(response.text, NS.dialog.hide());
+ //NS.dataTemp = NS.dialog.getParentEditor().getData();
+
+ },
+ ReplaceText: function(response) {
+ delete response.id;
+ NS.div_overlay.setEnable();
+
+ NS.dataTemp = response.text;
+ NS.selectingLang = response.currentLang;
+
+ window.setTimeout(function() {
+ NS.div_overlay.setDisable();
+ }, 500);
+
+ SetLocalizationButton(NS.LocalizationButton);
+ SetLocalizationLabel(NS.LocalizationLabel);
+
+ },
+
+ options_checkbox_send: function(response) {
+ delete response.id;
+
+ var obj = {
+ 'osp': tools.getCookie('osp'),
+ 'udn': tools.getCookie('udn'),
+ //'ud': tools.getCookie('ud'),
+ 'cust_dic_ids': NS.cust_dic_ids
+ //'udnCmd': tools.getCookie('udnCmd')
+ }
+
+ var currentTabId = NS.dialog._.currentTabId,
+ frameId = NS.iframeNumber + '_' + currentTabId;
+
+ manageMessage.send({
+ 'message': obj,
+ 'target': NS.targetFromFrame[frameId],
+ 'id': 'options_outer__page'
+ });
+ },
+
+ getOptions: function(response) {
+ var udn = response.DefOptions.udn;
+ NS.LocalizationComing = response.DefOptions.localizationButtonsAndText;
+
+ NS.langList = response.lang;
+
+ setBannerInPlace(response.banner);
+
+ if (udn == 'undefined') {
+ if (NS.userDictionaryName) {
+ udn = NS.userDictionaryName;
+
+ var obj = {
+ 'osp': tools.getCookie('osp'),
+ 'udn': NS.userDictionaryName,
+ //'ud': tools.getCookie('ud'),
+ 'cust_dic_ids': NS.cust_dic_ids,
+ 'id': 'options_dic_send',
+ 'udnCmd': 'create'
+ };
+
+ manageMessage.send({
+ 'message': obj,
+ 'target': NS.targetFromFrame[frameId]
+ });
+
+ } else{
+ udn = '';
+ };
+ };
+
+ tools.setCookie('osp', response.DefOptions.osp);
+ tools.setCookie('udn', udn);
+ //tools.setCookie('ud', response.ud);
+ tools.setCookie('cust_dic_ids', response.DefOptions.cust_dic_ids);
+
+ manageMessage.send({
+ 'id': 'giveOptions'
+ });
+ },
+
+ options_dic_send: function(response) {
+ //delete response.id;
+
+ var obj = {
+ 'osp': tools.getCookie('osp'),
+ 'udn': tools.getCookie('udn'),
+ //'ud': tools.getCookie('ud'),
+ 'cust_dic_ids': NS.cust_dic_ids,
+ 'id': 'options_dic_send',
+ 'udnCmd': tools.getCookie('udnCmd')
+ };
+
+ var currentTabId = NS.dialog._.currentTabId,
+ frameId = NS.iframeNumber + '_' + currentTabId;
+
+ manageMessage.send({
+ 'message': obj,
+ 'target': NS.targetFromFrame[frameId]
+ });
+ },
+ data: function(response) {
+ delete response.id; // fix from ie9
+ },
+
+ giveOptions: function() {
+
+ },
+
+ setOptionsConfirmF:function() {
+ OptionsConfirm(false);
+ },
+
+ setOptionsConfirmT:function() {
+ OptionsConfirm(true);
+ },
+
+ clickBusy: function() {
+ NS.div_overlay.setEnable();
+ },
+
+ suggestAllCame: function() {
+ NS.div_overlay.setDisable();
+ NS.div_overlay_no_check.setDisable();
+ },
+
+ TextCorrect: function() {
+ langConstructor(NS.langList);
+ }
+
+ }
+
+ var handlerIncomingData = function(event) {
+ event = event || window.event;
+ var response = JSON.parse(event.data);
+
+ handlerId[response.id](response);
+ };
+
+ var handlerButtonOptions = function(event) {
+ event = event || window.event;
+
+ var currentTabId = NS.dialog._.currentTabId,
+ frameId = NS.iframeNumber + '_' + currentTabId;
+
+ manageMessage.send({
+ 'message': {
+ 'cmd': 'Options'
+ },
+ 'target': NS.targetFromFrame[frameId],
+ 'id': 'cmd'
+ });
+
+ };
+
+ var handlerButtons = function(event) {
+ event = event || window.event;
+ NS.div_overlay.setEnable();
+ var currentTabId = NS.dialog._.currentTabId,
+ frameId = NS.iframeNumber + '_' + currentTabId,
+ new_word = NS.textNode[currentTabId].getValue();
+
+ manageMessage.send({
+ 'message': {
+ 'cmd': this.getElement().getAttribute("title-cmd"),
+ 'tabId': currentTabId,
+ 'new_word': new_word
+ },
+ 'target': NS.targetFromFrame[frameId],
+ 'id': 'cmd_outer__page'
+ });
+
+ };
+
+ var sendData = function(frameTarget, cmd, sendText, reset_suggest) {
+ cmd = cmd || CKEDITOR.config.wsc_cmd || 'spell';
+ reset_suggest = reset_suggest || false;
+ sendText = sendText || NS.dataTemp;
+
+ manageMessage.send({
+ 'message': {
+ 'customerId': NS.wsc_customerId,
+ 'text': sendText,
+ 'txt_ctrl': NS.TextAreaNumber,
+ 'cmd': cmd,
+ 'cust_dic_ids': NS.cust_dic_ids,
+ 'udn': NS.userDictionaryName,
+ 'slang': NS.selectingLang,
+ 'reset_suggest': reset_suggest
+ },
+ 'target': frameTarget,
+ 'id': 'data_outer__page'
+ });
+NS.div_overlay.setEnable();
+ };
+
+ var tabView = {
+ "superset" : function() {
+ showThesaurusTab();
+ showGrammTab();
+ showSpellTab();
+ },
+ "usual" : function() {
+ hideThesaurusTab();
+ hideGrammTab();
+ showSpellTab();
+ }
+ };
+
+ var showFirstTab = function() {
+
+
+
+
+ var cmdManger = function(cmdView) {
+ var obj = {};
+ var _getCmd = function(cmd) {
+ for (var tabId in cmdView) {
+ obj[cmdView[tabId]] = tabId;
+ };
+ return obj[cmd];
+ };
+ return {
+ getCmdByTab: _getCmd
+ }
+ };
+
+ var cmdM = new cmdManger(NS.cmd);
+ NS.dialog.selectPage(cmdM.getCmdByTab(CKEDITOR.config.wsc_cmd));
+ NS.sendData();
+// tabView[langSelectBox.getCurrentLangGroup(NS.selectingLang)]()
+ //NS.dialog._.currentTabId.click();
+ };
+
+ var showThesaurusTab = function() {
+ NS.dialog.showPage('Thesaurus');
+ };
+
+ var hideThesaurusTab = function() {
+ NS.dialog.hidePage('Thesaurus');
+ };
+
+ var showGrammTab = function() {
+ NS.dialog.showPage('GrammTab');
+ };
+
+ var hideGrammTab = function() {
+ NS.dialog.hidePage('GrammTab');
+ };
+
+ var showSpellTab = function() {
+ NS.dialog.showPage('SpellTab');
+ };
+
+ var hideSpellTab = function() {
+ NS.dialog.hidePage('SpellTab');
+ };
+
+ var showCurrentTabs = function() {
+ /*if (NS.dialog._.currentTabId == 'Thesaurus') {
+ return;
+ };*/
+
+ NS.dialog.getContentElement(NS.dialog._.currentTabId, 'bottomGroup').getElement().show();
+ };
+
+ var hideCurrentTabs = function() {
+ /*if (NS.dialog._.currentTabId == 'Thesaurus') {
+ return;
+ };*/
+
+ NS.dialog.getContentElement(NS.dialog._.currentTabId, 'bottomGroup').getElement().hide();
+ };
+
+ var showCurrentFinishChecking = function() {
+ /*if (NS.dialog._.currentTabId == 'Thesaurus') {
+ return;
+ };*/
+
+ NS.dialog.getContentElement(NS.dialog._.currentTabId, 'BlockFinishChecking').getElement().show();
+ };
+
+ var hideCurrentFinishChecking = function() {
+ /*if (NS.dialog._.currentTabId == 'Thesaurus') {
+ return;
+ };*/
+
+ NS.dialog.getContentElement(NS.dialog._.currentTabId, 'BlockFinishChecking').getElement().hide();
+ };
+
+
+
+function __constructLangSelectbox(languageGroup) {
+
+ if ( !languageGroup ) throw "Languages-by-groups list are required for construct selectbox";
+
+ var that = this,
+ o_arr = [],
+ priorLang ="en_US",
+ priorLangTitle = "",
+ currLang = NS.selectingLang;
+
+
+ for ( var group in languageGroup){
+ for ( var langCode in languageGroup[group]){
+ var langName = languageGroup[group][langCode];
+ if ( langName == priorLang )
+ priorLangTitle = langName;
+ else
+ o_arr.push( langName );
+ }
+
+ }
+
+ o_arr.sort();
+ if(priorLangTitle) {
+ o_arr.unshift( priorLangTitle );
+ };
+
+ var searchGroup = function ( code ){
+ for ( var group in languageGroup){
+ for ( var langCode in languageGroup[group]){
+ if ( langCode.toUpperCase() === code.toUpperCase() )
+ return group;
+ };
+
+ };
+ return "";
+ };
+
+ var _setLangList = function() {
+ var langList = {},
+ langArray = [];
+ for (var group in languageGroup) {
+ for ( var langCode in languageGroup[group]){
+ langList[languageGroup[group][langCode]] = langCode;
+ };
+ };
+ return langList;
+ };
+
+
+ var _return = {
+ getCurrentLangGroup: function(code) {
+ return searchGroup(code);
+ },
+ setLangList: _setLangList()
+ };
+
+
+ return _return;
+
+};
+
+ return {
+ title: editor.config.wsc_dialogTitle || editor.lang.wsc.title,
+ minWidth: 560,
+ minHeight: 350,
+ resizable: CKEDITOR.DIALOG_RESIZE_NONE,
+ buttons: [CKEDITOR.dialog.cancelButton],
+ onLoad: function() {
+ manageMessage = new ManagerPostMessage();
+ NS.dialog = this;
+ showFirstTab();
+ NS.dataTemp = NS.dialog.getParentEditor().getData();
+ manageMessage.init(handlerIncomingData);
+
+ NS.div_overlay = new overlayBlock({
+ opacity: "0.95",
+ background: "#fff url(" + NS.loadIcon + ") no-repeat 50% 50%",
+ target: this.parts.tabs.getParent().$
+ });
+
+ NS.div_overlay_no_check = new overlayBlock({
+ opacity: "1",
+ id: 'no_check_over',
+ background: "#fff url(" + NS.loadIconEmptyEditor + ") no-repeat 50% 50%",
+ target: this.parts.tabs.getParent().$
+ });
+ //NS.div_overlay.setDisable();
+
+ //NS.sendData();
+ var number_ck = NS.CKNumber + 1,
+ id_tab = CKEDITOR.document.getById('cke_dialog_tabs_' + number_ck);
+
+ id_tab.setStyle('width', '97%');
+ id_tab.append(NS.buildSelectLang());
+
+ },
+ onShow: function() {
+ NS.div_overlay.setDisable();
+ /*var tabId = NS.iframeNumber + '_' + NS.dialog._.currentTabId;
+ NS.dataTemp = NS.dialog.getParentEditor().getData();*/
+ showFirstTab();
+ //sendData(NS.targetFromFrame[tabId], null, null, true);
+ if ( NS.dialog.getParentEditor().getData() == '' ) {
+ NS.div_overlay_no_check.setEnable();
+ //alert( 'Nothing to check' );
+ //NS.dialog.getParentEditor().focus();
+ //NS.dialog.hide()
+ };
+ },
+ onHide: function() {
+ //var firstTabId = NS.iframeNumber + '_SpellTab';
+ //sendData(NS.targetFromFrame[firstTabId], null, NS.dataTemp, true);
+ /*manageMessage.send({
+ 'message': { 'changeLang': NS.selectingLang},
+ 'target': NS.targetFromFrame[firstTabId],
+ 'id': 'selectionLang_outer__page'
+ });*/
+ NS.dataTemp = null;
+ },
+ contents: [
+ {
+ id: 'SpellTab',
+ label: 'SpellChecker',
+ accessKey: 'S',
+ elements: [
+ {
+ type: 'html',
+ id: 'banner',
+ label: 'banner',
+ html: '<div></div>'
+ },
+ {
+ type: 'html',
+ id: 'Content',
+ label: 'spellContent',
+ html: '',
+ onLoad: function() {
+ //NS.setCurrentIframe(NS.dialog._.currentTabId);
+ var tabId = NS.iframeNumber + '_' + NS.dialog._.currentTabId;
+ var iframe = document.getElementById(tabId);
+ NS.targetFromFrame[tabId] = iframe.contentWindow;
+
+ },
+ onShow: function() {
+ NS.dataTemp = NS.dialog.getParentEditor().getData();
+ var tabId = NS.iframeNumber + '_' + NS.dialog._.currentTabId;
+ //sendData(NS.targetFromFrame[tabId], null, NS.dataTemp);
+ NS.div_overlay.setEnable();
+ }
+ },
+ {
+ type: 'hbox',
+ id: 'bottomGroup',
+ 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: NS.LocalizationLabel['ChangeTo'].text + ':',
+ labelLayout: 'horizontal',
+ labelStyle: 'font: 12px/25px arial, sans-serif;',
+ width: '140px',
+ 'default': '',
+ onLoad: function() {
+ NS.textNode['SpellTab'] = this;
+ NS.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: NS.LocalizationLabel['Suggestions'].text + ':',
+ onLoad: function() {
+ NS.LocalizationLabel['Suggestions'].instance = this;
+ this.getInputElement().hide();
+ }
+ },
+ {
+ type: 'html',
+ id: 'logo',
+ html: '<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',
+ onShow: function() {
+ this.getElement().$.src = NS.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() {
+ selectNode = this;
+ },
+ onHide: function() {
+ this.clear();
+ },
+ onChange: function() {
+ NS.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: NS.LocalizationButton['ChangeTo'].text,
+ title: 'Change to',
+ style: 'width: 100%;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ NS.LocalizationButton['ChangeTo'].instance = this;
+ },
+ onClick: handlerButtons
+ },
+ {
+ type: 'button',
+ id: 'ChangeAll',
+ label: NS.LocalizationButton['ChangeAll'].text,
+ title: 'Change All',
+ style: 'width: 100%;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ NS.LocalizationButton['ChangeAll'].instance = this;
+ },
+ onClick: handlerButtons
+ },
+ {
+ type: 'button',
+ id: 'AddWord',
+ label: NS.LocalizationButton['AddWord'].text,
+ title: 'Add word',
+ style: 'width: 100%;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ NS.LocalizationButton['AddWord'].instance = this;
+ },
+ onClick: handlerButtons
+ },
+ {
+ type: 'button',
+ id: 'FinishChecking',
+ label: NS.LocalizationButton['FinishChecking'].text,
+ title: 'Finish Checking',
+ style: 'width: 100%;margin-top: 9px;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ NS.LocalizationButton['FinishChecking'].instance = this;
+ },
+ onClick: handlerButtons
+ }
+ ]
+ },
+ {
+ type: 'vbox',
+ id: 'rightCol_col__right',
+ widths: ['50%', '50%', '50%'],
+ children: [
+ {
+ type: 'button',
+ id: 'IgnoreWord',
+ label: NS.LocalizationButton['IgnoreWord'].text,
+ title: 'Ignore word',
+ style: 'width: 100%;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ NS.LocalizationButton['IgnoreWord'].instance = this;
+ },
+ onClick: handlerButtons
+ },
+ {
+ type: 'button',
+ id: 'IgnoreAllWords',
+ label: NS.LocalizationButton['IgnoreAllWords'].text,
+ title: 'Ignore all words',
+ style: 'width: 100%;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ NS.LocalizationButton['IgnoreAllWords'].instance = this;
+ },
+ onClick: handlerButtons
+ },
+ {
+ type: 'button',
+ id: 'option',
+ label: NS.LocalizationButton['Options'].text,
+ title: 'Option',
+ style: 'width: 100%;',
+ onLoad: function() {
+ NS.LocalizationButton['Options'].instance = this;
+ },
+ onClick: function() {
+ editor.openDialog('options');
+ }
+ }
+ ]
+ }
+
+ ]
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ id: 'BlockFinishChecking',
+ widths: ['70%', '30%'],
+ onShow: function() {
+ this.getElement().hide();
+ },
+ onHide: showCurrentTabs,
+ children: [
+
+ {
+ type: 'hbox',
+ id: 'leftCol',
+ align: 'left',
+ width: '70%',
+ 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;">',
+ onShow: function() {
+ this.getElement().$.src = NS.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: 'Option_button',
+ label: NS.LocalizationButton['Options'].text,
+ title: 'Option',
+ style: 'width: 100%;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ },
+ onClick: function() {
+ editor.openDialog('options');
+ }
+ },
+ {
+ type: 'button',
+ id: 'FinishChecking',
+ label: NS.LocalizationButton['FinishChecking'].text,
+ title: 'Finish Checking',
+ style: 'width: 100%;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ },
+ onClick: handlerButtons
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ id: 'GrammTab',
+ label: 'Grammar',
+ accessKey: 'G',
+ elements: [
+ {
+ type: 'html',
+ id: 'banner',
+ label: 'banner',
+ html: '<div></div>'
+ },
+ {
+ type: 'html',
+ id: 'Content',
+ label: 'GrammarContent',
+ html: '',
+ onShow: function() {
+ var tabId = NS.iframeNumber + '_' + NS.dialog._.currentTabId;
+ var iframe = document.getElementById(tabId);
+ NS.targetFromFrame[tabId] = iframe.contentWindow;
+ }
+ },
+ {
+ type: 'vbox',
+ id: 'bottomGroup',
+ children: [
+ {
+ type: 'hbox',
+ id: 'leftCol',
+ widths: ['66%', '34%'],
+ children: [
+ {
+ type: 'vbox',
+ children: [
+ {
+ type: 'text',
+ id: 'text',
+ label: "Change to:",
+ labelLayout: 'horizontal',
+ labelStyle: 'font: 12px/25px arial, sans-serif; float: right;margin-right: 80px;',
+ inputStyle: '',
+ width: '200px',
+ 'default': '',
+ onLoad: function(e) {
+ NS.textNode['GrammTab'] = this;
+ },
+ onHide: function() {
+ this.reset();
+ }
+ },
+ {
+
+ type: 'html',
+ id: 'html_text',
+ html: "<div style='min-height: 17px; width: 330px; line-height: 17px; padding: 5px; text-align: left;background: #F1F1F1;color: #595959; white-space: normal!important;'></div>",
+ onLoad: function(e) {
+ NS.textNodeInfo['GrammTab'] = this;
+ }
+ },
+ {
+ type: 'html',
+ id: 'radio',
+ html: "",
+ onLoad: function() {
+ NS.grammerSuggest = this;
+ }
+ }
+ ]
+ },
+ {
+ type: 'vbox',
+ 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: handlerButtons
+ },
+ {
+ 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: handlerButtons
+ },
+ {
+ type: 'button',
+ id: 'IgnoreAllWords',
+ label: 'Ignore Problem',
+ title: 'Ignore Problem',
+ style: 'width: 133px; float: right;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ },
+ onClick: handlerButtons
+ },
+ {
+ 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: handlerButtons
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ id: 'BlockFinishChecking',
+ widths: ['70%', '30%'],
+ onShow: function() {
+ this.getElement().hide();
+ },
+ onHide: showCurrentTabs,
+ children: [
+ {
+ type: 'hbox',
+ id: 'leftCol',
+ align: 'left',
+ width: '70%',
+ 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;">',
+ onShow: function() {
+ this.getElement().$.src = NS.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',
+ style: 'width: 100%;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ },
+ onClick: handlerButtons
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ id: 'Thesaurus',
+ label: 'Thesaurus',
+ accessKey: 'T',
+ elements: [
+ {
+ type: 'html',
+ id: 'banner',
+ label: 'banner',
+ html: '<div></div>'
+ },
+ {
+ type: 'html',
+ id: 'Content',
+ label: 'spellContent',
+ html: '',
+ onShow: function() {
+ var tabId = NS.iframeNumber + '_' + NS.dialog._.currentTabId;
+ var iframe = document.getElementById(tabId);
+ NS.targetFromFrame[tabId] = iframe.contentWindow;
+ }
+ },
+ {
+ type: 'vbox',
+ id: 'bottomGroup',
+ 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': '',
+ onLoad: function(e) {
+ NS.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", this.id);
+ },
+ onClick: handlerButtons
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ children: [
+ {
+ type: 'select',
+ id: 'categories',
+ label: "Categories:",
+ labelStyle: 'font: 12px/25px arial, sans-serif;',
+ size: '6',
+ inputStyle: 'width: 180px; height: auto;',
+ items: [],
+ onLoad: function(e) {
+ NS.selectNode['categories'] = this;
+
+ },
+ onHide: function() {
+ this.clear();
+ },
+ onChange: function() {
+ NS.buildOptionSynonyms(this.getValue())
+ }
+ },
+ {
+ type: 'select',
+ id: 'synonyms',
+ label: "Synonyms:",
+ labelStyle: 'font: 12px/25px arial, sans-serif;',
+ size: '6',
+ inputStyle: 'width: 180px; height: auto;',
+ items: [],
+ onLoad: function(e) {
+ NS.selectNode['synonyms'] = this;
+ },
+ onShow: function() {
+ NS.textNode['Thesaurus'].setValue(this.getValue());
+ },
+ onHide: function() {
+ this.clear();
+ },
+ onChange: function(e) {
+ NS.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;">',
+ onShow: function() {
+ this.getElement().$.src = NS.logotype;
+ this.getElement().getParent().setStyles({
+ "text-align": "center"
+ })
+ }
+ },
+ {
+ 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: handlerButtons
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ type: 'hbox',
+ id: 'BlockFinishChecking',
+ widths: ['70%', '30%'],
+ onShow: function() {
+ this.getElement().hide();
+ },
+ onHide: showCurrentTabs,
+ children: [
+ {
+ type: 'hbox',
+ id: 'leftCol',
+ align: 'left',
+ width: '70%',
+ 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;">',
+ onShow: function() {
+ this.getElement().$.src = NS.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',
+ style: 'width: 100%;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ },
+ onClick: handlerButtons
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ };
+});
+
+
+// Options dialog
+CKEDITOR.dialog.add('options', function(editor) {
+ var manageMessage = new ManagerPostMessage;
+ var dialog = null;
+ var linkOnCheckbox = {};
+ var checkboxState = {};
+ var ospString = null;
+ var OptionsTextError = null;
+ var cmd = null;
+
+ var set_osp = [];
+ var dictionaryState = {
+ 'udn': tools.getCookie('udn'),
+ 'osp': tools.getCookie('osp')
+ //'ud': tools.getCookie('ud'),
+ //'cmd': ''
+ }
+
+ var setHandlerOptions = function() {
+ var osp = tools.getCookie('osp');
+ strToArr = osp.split('');
+
+ checkboxState['IgnoreAllCapsWords'] = strToArr[0];
+ checkboxState['IgnoreWordsNumbers'] = strToArr[1];
+ checkboxState['IgnoreMixedCaseWords'] = strToArr[2];
+ checkboxState['IgnoreDomainNames'] = strToArr[3];
+ };
+
+ var sendDicOptions = function(event) {
+ event = event || window.event;
+ cmd = this.getElement().getAttribute("title-cmd");
+ var osp = [];
+
+ osp[0] = checkboxState['IgnoreAllCapsWords'];
+ osp[1] = checkboxState['IgnoreWordsNumbers'];
+ osp[2] = checkboxState['IgnoreMixedCaseWords'];
+ osp[3] = checkboxState['IgnoreDomainNames'];
+
+ osp = osp.toString().replace(/,/g, "");
+
+
+ tools.setCookie('osp', osp);
+ tools.setCookie('udnCmd', cmd ? cmd : 'ignore');
+ if (cmd == "delete") {
+
+ manageMessage.send({
+ 'id': 'options_dic_send'
+ });
+ } else {
+ tools.setCookie('udn', nameNode.getValue() == '' ? '' : nameNode.getValue());
+ manageMessage.send({
+ 'id': 'options_dic_send'
+ });
+ };
+
+ };
+
+
+ var sendAllOptions = function() {
+ var osp = [];
+
+ osp[0] = checkboxState['IgnoreAllCapsWords'];
+ osp[1] = checkboxState['IgnoreWordsNumbers'];
+ osp[2] = checkboxState['IgnoreMixedCaseWords'];
+ osp[3] = checkboxState['IgnoreDomainNames'];
+
+ osp = osp.toString().replace(/,/g, "");
+
+ tools.setCookie('osp', osp);
+ tools.setCookie('udn', nameNode.getValue());
+ //tools.setCookie('udnCmd', cmd ? cmd : 'ignore');
+ //tools.setCookie('ud', tools.getCookie('ud'));
+
+ manageMessage.send({
+ 'id': 'options_checkbox_send'
+ });
+
+
+ };
+
+ var cameOptions = function() {
+ OptionsTextError.getElement().setHtml(NS.LocalizationComing['error']);
+ OptionsTextError.getElement().show();
+ };
+
+ return {
+ title: NS.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",
+ html: '<div></div>',
+ onShow: function() {
+ OptionsTextError = 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 = NS.LocalizationComing['SpellCheckingOptions'];
+ },
+ children: [
+ {
+ type: 'vbox',
+ id: 'Options_checkbox',
+ children: [
+ {
+ type: 'checkbox',
+ id: 'IgnoreAllCapsWords',
+ label: 'Ignore All-Caps 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() {
+ checkboxState[this.id] = (this.getValue() == false) ? 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() {
+ checkboxState[this.id] = (this.getValue() == false) ? 0 : 1;
+ }
+ },
+ {
+ type: 'checkbox',
+ 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() {
+ checkboxState[this.id] = (this.getValue() == false) ? 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() {
+ checkboxState[this.id] = (this.getValue() == false) ? 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() {
+ nameNode = this;
+ var udn = NS.userDictionaryName ? NS.userDictionaryName : tools.getCookie('udn') && undefined ? ' ' : this.getValue();
+ this.setValue(udn);
+ },
+ onShow: function() {
+ nameNode = this;
+ var udn = !tools.getCookie('udn') ? this.getValue() : tools.getCookie('udn');
+ this.setValue(udn);
+
+ this.setLabel(NS.LocalizationComing['DictionaryName']);
+ },
+ 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(NS.LocalizationComing['Create']);
+ },
+ onClick: sendDicOptions
+ },
+ {
+ type: 'button',
+ id: 'restore',
+ label: 'Restore',
+ title: 'Restore',
+ style: 'width: 100%;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ },
+ onShow: function() {
+ this.getElement().setText(NS.LocalizationComing['Restore']);
+ },
+ onClick: sendDicOptions
+ }
+ ]
+ },
+ {
+ 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(NS.LocalizationComing['Rename']);
+ },
+ onClick: sendDicOptions
+ },
+ {
+ type: 'button',
+ id: 'delete',
+ label: 'Remove',
+ title: 'Remove',
+ style: 'width: 100%;',
+ onLoad: function() {
+ this.getElement().setAttribute("title-cmd", this.id);
+ },
+ onShow: function() {
+ this.getElement().setText(NS.LocalizationComing['Remove']);
+ },
+ onClick: sendDicOptions
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ 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>" + NS.LocalizationComing['OptionsTextIntro'] + "</div>",
+ onShow: function() {
+ this.getElement().setText(NS.LocalizationComing['OptionsTextIntro']);
+
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton],
+ onOk: function() {
+ //sendCheckboxOptions(checkboxState);
+ sendAllOptions();
+ OptionsTextError.getElement().hide();
+ OptionsTextError.getElement().setHtml(' ');
+ },
+ onLoad: function() {
+ dialog = this;
+ manageMessage.init(cameOptions);
+
+ linkOnCheckbox['IgnoreAllCapsWords'] = dialog.getContentElement('OptionsTab', 'IgnoreAllCapsWords');
+ linkOnCheckbox['IgnoreWordsNumbers'] = dialog.getContentElement('OptionsTab', 'IgnoreWordsNumbers');
+ linkOnCheckbox['IgnoreMixedCaseWords'] = dialog.getContentElement('OptionsTab', 'IgnoreMixedCaseWords');
+ linkOnCheckbox['IgnoreDomainNames'] = dialog.getContentElement('OptionsTab', 'IgnoreDomainNames');
+
+ },
+ onShow: function() {
+ setHandlerOptions();
+
+ (checkboxState['IgnoreAllCapsWords'] == 0) ? linkOnCheckbox['IgnoreAllCapsWords'].setValue('', false) : linkOnCheckbox['IgnoreAllCapsWords'].setValue('checked', false);
+ (checkboxState['IgnoreWordsNumbers'] == 0) ? linkOnCheckbox['IgnoreWordsNumbers'].setValue('', false) : linkOnCheckbox['IgnoreWordsNumbers'].setValue('checked', false);
+ (checkboxState['IgnoreMixedCaseWords'] == 0) ? linkOnCheckbox['IgnoreMixedCaseWords'].setValue('', false) : linkOnCheckbox['IgnoreMixedCaseWords'].setValue('checked', false);
+ (checkboxState['IgnoreDomainNames'] == 0) ? linkOnCheckbox['IgnoreDomainNames'].setValue('', false) : linkOnCheckbox['IgnoreDomainNames'].setValue('checked', false);
+
+ checkboxState['IgnoreAllCapsWords'] = (linkOnCheckbox['IgnoreAllCapsWords'].getValue() == false) ? 0 : 1;
+ checkboxState['IgnoreWordsNumbers'] = (linkOnCheckbox['IgnoreWordsNumbers'].getValue() == false) ? 0 : 1;
+ checkboxState['IgnoreMixedCaseWords'] = (linkOnCheckbox['IgnoreMixedCaseWords'].getValue() == false) ? 0 : 1;
+ checkboxState['IgnoreDomainNames'] = (linkOnCheckbox['IgnoreDomainNames'].getValue() == false) ? 0 : 1;
+
+ linkOnCheckbox['IgnoreAllCapsWords'].getElement().$.lastChild.innerHTML = NS.LocalizationComing['IgnoreAllCapsWords'];
+ linkOnCheckbox['IgnoreWordsNumbers'].getElement().$.lastChild.innerHTML = NS.LocalizationComing['IgnoreWordsWithNumbers'];
+ linkOnCheckbox['IgnoreMixedCaseWords'].getElement().$.lastChild.innerHTML = NS.LocalizationComing['IgnoreMixedCaseWords'];
+ linkOnCheckbox['IgnoreDomainNames'].getElement().$.lastChild.innerHTML = NS.LocalizationComing['IgnoreDomainNames'];
+ }
+ };
+});