Index: branches/5.2.x/core/ckeditor/plugins/table/dialogs/table.js =================================================================== diff -u -N -r15316 -r16404 --- branches/5.2.x/core/ckeditor/plugins/table/dialogs/table.js (.../table.js) (revision 15316) +++ branches/5.2.x/core/ckeditor/plugins/table/dialogs/table.js (.../table.js) (revision 16404) @@ -1,9 +1,21 @@ /* -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.md 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;ih&&(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;s0){y=x.getFirst(); -for(s=0;s0){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(){function r(a){for(var e=0,l=0,k=0,m,g=a.$.rows.length;kl&&(l=e)}return l}function o(a){return function(){var e=this.getValue(),e=!!(CKEDITOR.dialog.validate.integer()(e)&&0n.getSize("width")?"100%":500:0,getValue:q,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.width)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&& +a.updateStyle("width",this.getValue())},setup:function(a){this.setValue(a.getStyle("width"))},commit:k}]},{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtHeight",requiredContent:"table{height}",controlStyle:"width:5em",label:a.lang.common.height,title:a.lang.common.cssLengthTooltip,"default":"",getValue:q,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.height)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles"); +a&&a.updateStyle("height",this.getValue())},setup:function(a){(a=a.getStyle("height"))&&this.setValue(a)},commit:k}]},{type:"html",html:" "},{type:"text",id:"txtCellSpace",requiredContent:"table[cellspacing]",controlStyle:"width:3em",label:a.lang.table.cellSpace,"default":a.filter.check("table[cellspacing]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellSpacing),setup:function(a){this.setValue(a.getAttribute("cellSpacing")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellSpacing", +this.getValue()):d.removeAttribute("cellSpacing")}},{type:"text",id:"txtCellPad",requiredContent:"table[cellpadding]",controlStyle:"width:3em",label:a.lang.table.cellPad,"default":a.filter.check("table[cellpadding]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellPadding),setup:function(a){this.setValue(a.getAttribute("cellPadding")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellPadding",this.getValue()):d.removeAttribute("cellPadding")}}]}]},{type:"html",align:"right", +html:""},{type:"vbox",padding:0,children:[{type:"text",id:"txtCaption",requiredContent:"caption",label:a.lang.table.caption,setup:function(a){this.enable();a=a.getElementsByTag("caption");if(0