( function(){ var exampleDialog = function(editor){ return { title : "gallery", minWidth : 220, minHeight : 300, buttons:[CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton], onOk: function(){ //onShow function for the dialog definition //... other code ... c=this.getParentEditor(); var sNewName = this.getContentElement("InfoTab","galleryInput").getInputElement().getValue(); var sNewTheme = this.getContentElement("InfoTab","themeInput").getInputElement().getValue(); var sNewDesign = this.getContentElement("InfoTab","designInput").getInputElement().getValue(); var siteRoot = CKEDITOR.plugins.getPath('gallery'); siteRoot = siteRoot.substring(0,siteRoot.lastIndexOf("/webassist/")); var imgLoc = siteRoot + "/galleries/"+sNewDesign+"/admin/"+sNewTheme+"_large.png"; b = (''); setTimeout(function(){c.fire('paste',{html:b});},0); //... other code... } , onLoad: function(){ //onShow function for the dialog definition getValues(this.getContentElement("InfoTab","galleryInput"),this.getContentElement("InfoTab","designInput"),this.getContentElement("InfoTab","themeInput")); } , onShow: function(){ //onShow function for the dialog definition //... other code ... //... other code... } , onHide: function(){ //onShow function for the dialog definition //... other code ... //... other code... } , onCancel: function(){ //onShow function for the dialog definition return; } , resizable: 'none', contents: [{ id: 'InfoTab', label: 'Gallery info', elements:[ { //input element for the width type: 'select', items: [' '], id: 'galleryInput', label: 'Gallery', labelLayout: 'vertical', setup: function(element){ } }, { //input element for the width type: 'select', items: [' '], id: 'designInput', label: 'Design', labelLayout: 'vertical', onChange: function(element){ var theTheme = this.getDialog().getContentElement("InfoTab","themeInput").getInputElement().getValue(); var theDesign = this.getValue(); var siteRoot = CKEDITOR.plugins.getPath('gallery'); siteRoot = siteRoot.substring(0,siteRoot.lastIndexOf("/webassist/")); var theDialog = this.getDialog().getContentElement("InfoTab","galleryInput").getInputElement().getId(); document.getElementById("preview_"+theDialog).src = siteRoot + "/galleries/"+theDesign+"/admin/"+theTheme+".png"; var themeSel = this.getInputElement().$; document.getElementById("desc_"+theDialog).innerHTML = themeSel.options[themeSel.selectedIndex].getAttribute("desc"); } }, { //input element for the width type: 'select', items: [' '], id: 'themeInput', label: 'Theme', labelLayout: 'vertical', onChange: function(element){ var theTheme = this.getValue(); var theDesign = this.getDialog().getContentElement("InfoTab","designInput").getInputElement().getValue(); var siteRoot = CKEDITOR.plugins.getPath('gallery'); var theDialog = this.getDialog().getContentElement("InfoTab","galleryInput").getInputElement().getId(); siteRoot = siteRoot.substring(0,siteRoot.lastIndexOf("/webassist/")); document.getElementById("preview_"+theDialog).src = siteRoot + "/galleries/"+theDesign+"/admin/"+theTheme+".png"; } }, { //input element for the width type: 'html', html: '
this is a sample description |