0byt3m1n1
Path:
/
home
/
mgatv524
/
medcenter.mgaplay.com.br
/
web
/
dist
/
vendor
/
ckeditor
/
plugins
/
tabletools
/
dialogs
/
[
Home
]
File: tableCell.js
CKEDITOR.dialog.add("cellProperties",(function(t){function e(t){return{isSpacer:!0,type:"html",html:" ",requiredContent:t||void 0}}function i(e){return{requiredContent:"td{"+e+"}",type:"hbox",widths:["70%","30%"],children:[{type:"text",id:e,width:"100px",label:d[e],validate:s.number(c["invalid"+CKEDITOR.tools.capitalize(e)]),onLoad:function(){var t=this.getDialog().getContentElement("info",e+"Type").getElement(),i=this.getInputElement(),o=i.getAttribute("aria-labelledby");i.setAttribute("aria-labelledby",[o,t.$.id].join(" "))},setup:o((function(t){var i=parseFloat(t.getAttribute(e),10);return t=parseFloat(t.getStyle(e),10),isNaN(t)?isNaN(i)?void 0:i:t})),commit:function(t){var i=parseFloat(this.getValue(),10),o=this.getDialog().getValueOf("info",e+"Type")||n(t,e);isNaN(i)?t.removeStyle(e):t.setStyle(e,i+o),t.removeAttribute(e)},default:""},{type:"select",id:e+"Type",label:t.lang.table[e+"Unit"],labelStyle:"visibility:hidden;display:block;width:0;overflow:hidden",default:"px",items:[[u.widthPx,"px"],[u.widthPc,"%"]],setup:o((function(t){return n(t,e)}))}]}}function o(t){return function(e){for(var i=t(e[0]),o=1;o<e.length;o++)if(t(e[o])!==i){i=null;break}void 0!==i&&(this.setValue(i),CKEDITOR.env.gecko&&"select"==this.type&&!i&&(this.getInputElement().$.selectedIndex=-1))}}function n(t,e){var i=/^(\d+(?:\.\d+)?)(px|%)$/.exec(t.getStyle(e)||t.getAttribute(e));if(i)return i[2]}function r(e,i){t.getColorFromDialog((function(t){t&&e.getDialog().getContentElement("info",i).setValue(t),e.focus()}),e)}function l(t,e,i){(t=t.getValue())?e.setStyle(i,t):e.removeStyle(i),"background-color"==i?e.removeAttribute("bgColor"):"border-color"==i&&e.removeAttribute("borderColor")}var a,u=t.lang.table,c=u.cell,d=t.lang.common,s=CKEDITOR.dialog.validate,g="rtl"==t.lang.dir,p=t.plugins.colordialog,h=[i("width"),i("height"),e(["td{width}","td{height}"]),{type:"select",id:"wordWrap",requiredContent:"td{white-space}",label:c.wordWrap,default:"yes",items:[[c.yes,"yes"],[c.no,"no"]],setup:o((function(t){var e=t.getAttribute("noWrap");if("nowrap"==t.getStyle("white-space")||e)return"no"})),commit:function(t){"no"==this.getValue()?t.setStyle("white-space","nowrap"):t.removeStyle("white-space"),t.removeAttribute("noWrap")}},e("td{white-space}"),{type:"select",id:"hAlign",requiredContent:"td{text-align}",label:c.hAlign,default:"",items:[[d.notSet,""],[d.left,"left"],[d.center,"center"],[d.right,"right"],[d.justify,"justify"]],setup:o((function(t){var e=t.getAttribute("align");return t.getStyle("text-align")||e||""})),commit:function(t){var e=this.getValue();e?t.setStyle("text-align",e):t.removeStyle("text-align"),t.removeAttribute("align")}},{type:"select",id:"vAlign",requiredContent:"td{vertical-align}",label:c.vAlign,default:"",items:[[d.notSet,""],[d.alignTop,"top"],[d.alignMiddle,"middle"],[d.alignBottom,"bottom"],[c.alignBaseline,"baseline"]],setup:o((function(t){var e=t.getAttribute("vAlign");switch(t=t.getStyle("vertical-align")){case"top":case"middle":case"bottom":case"baseline":break;default:t=""}return t||e||""})),commit:function(t){var e=this.getValue();e?t.setStyle("vertical-align",e):t.removeStyle("vertical-align"),t.removeAttribute("vAlign")}},e(["td{text-align}","td{vertical-align}"]),{type:"select",id:"cellType",requiredContent:"th",label:c.cellType,default:"td",items:[[c.data,"td"],[c.header,"th"]],setup:o((function(t){return t.getName()})),commit:function(t){t.renameNode(this.getValue())}},e("th"),{type:"text",id:"rowSpan",requiredContent:"td[rowspan]",label:c.rowSpan,default:"",validate:s.integer(c.invalidRowSpan),setup:o((function(t){if((t=parseInt(t.getAttribute("rowSpan"),10))&&1!=t)return t})),commit:function(t){var e=parseInt(this.getValue(),10);e&&1!=e?t.setAttribute("rowSpan",this.getValue()):t.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",requiredContent:"td[colspan]",label:c.colSpan,default:"",validate:s.integer(c.invalidColSpan),setup:o((function(t){if((t=parseInt(t.getAttribute("colSpan"),10))&&1!=t)return t})),commit:function(t){var e=parseInt(this.getValue(),10);e&&1!=e?t.setAttribute("colSpan",this.getValue()):t.removeAttribute("colSpan")}},e(["td[colspan]","td[rowspan]"]),{type:"hbox",padding:0,widths:p?["60%","40%"]:["100%"],requiredContent:"td{background-color}",children:(a=[{type:"text",id:"bgColor",label:c.bgColor,default:"",setup:o((function(t){var e=t.getAttribute("bgColor");return t.getStyle("background-color")||e})),commit:function(t){l(this,t,"background-color")}}],p&&a.push({type:"button",id:"bgColorChoose",class:"colorChooser",label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){r(this,"bgColor")}}),a)},{type:"hbox",padding:0,widths:p?["60%","40%"]:["100%"],requiredContent:"td{border-color}",children:function(){var t=[{type:"text",id:"borderColor",label:c.borderColor,default:"",setup:o((function(t){var e=t.getAttribute("borderColor");return t.getStyle("border-color")||e})),commit:function(t){l(this,t,"border-color")}}];return p&&t.push({type:"button",id:"borderColorChoose",class:"colorChooser",label:c.chooseColor,style:(g?"margin-right":"margin-left")+": 10px",onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){r(this,"borderColor")}}),t}()}],b=0,f=-1,m=[{type:"vbox",padding:0,children:[]}];return h=CKEDITOR.tools.array.filter(h,(function(e){var i=e.requiredContent;return delete e.requiredContent,(i=t.filter.check(i))&&!e.isSpacer&&b++,i})),5<b&&(m=m.concat([e(),{type:"vbox",padding:0,children:[]}])),CKEDITOR.tools.array.forEach(h,(function(t){t.isSpacer||f++,5<b&&f>=b/2?m[2].children.push(t):m[0].children.push(t)})),CKEDITOR.tools.array.forEach(m,(function(t){t.isSpacer||(t=t.children)[t.length-1].isSpacer&&t.pop()})),{title:c.title,minWidth:1===m.length?205:410,minHeight:50,contents:[{id:"info",label:c.title,accessKey:"I",elements:[{type:"hbox",widths:1===m.length?["100%"]:["40%","5%","40%"],children:m}]}],getModel:function(t){return CKEDITOR.plugins.tabletools.getSelectedCells(t.getSelection())},onShow:function(){var t=this.getModel(this.getParentEditor());this.setupContent(t)},onOk:function(){for(var t=this._.editor.getSelection(),e=t.createBookmarks(),i=this.getParentEditor(),o=this.getModel(i),n=0;n<o.length;n++)this.commitContent(o[n]);i.forceNextSelectionCheck(),t.selectBookmarks(e),i.selectionChange()},onLoad:function(){var t={};this.foreach((function(e){e.setup&&e.commit&&(e.setup=CKEDITOR.tools.override(e.setup,(function(i){return function(){i.apply(this,arguments),t[e.id]=e.getValue()}})),e.commit=CKEDITOR.tools.override(e.commit,(function(i){return function(){t[e.id]!==e.getValue()&&i.apply(this,arguments)}})))}))}}}));