cobuild-angular-stack
Version:
Base stack angular sass jade gulp
3 lines • 1.47 kB
JavaScript
CKEDITOR.dialog.add("labelDialog",function(c){return{title:"label Properties",minWidth:400,minHeight:200,contents:[{id:"tab-basic",label:"Basic Settings",elements:[{type:"text",id:"label",label:"Label Text",validate:CKEDITOR.dialog.validate.notEmpty("Label Text field cannot be empty."),setup:function(a){this.setValue(a.getText())},commit:function(a){a.setText(this.getValue())}},{type:"text",id:"for",label:"For (Form field name)",validate:CKEDITOR.dialog.validate.notEmpty("For field cannot be empty."),
setup:function(a){this.setValue(a.getAttribute("for"))},commit:function(a){a.setAttribute("for",this.getValue())}}]},{id:"tab-adv",label:"Advanced Settings",elements:[{type:"text",id:"class",label:"CSS Classes",setup:function(a){this.setValue(a.getAttribute("class"))},commit:function(a){var b=this.getValue();b?a.setAttribute("class",b):this.insertMode||a.removeAttribute("class")}},{type:"text",id:"style",label:"CSS Styles",setup:function(a){this.setValue(a.getAttribute("style"))},commit:function(a){var b=
this.getValue();b?a.setAttribute("style",b):this.insertMode||a.removeAttribute("style")}}]}],onShow:function(){var a=c.getSelection().getStartElement();a&&(a=a.getAscendant("label",!0));a&&"label"==a.getName()?this.insertMode=!1:(a=c.document.createElement("label"),this.insertMode=!0);this.element=a;this.insertMode||this.setupContent(this.element)},onOk:function(){var a=this.element;this.commitContent(a);this.insertMode&&c.insertElement(a)}}});