[Openfirst-cvscommit] base/config/functions/wysiwyg/modules behavior_css.js,NONE,1.1 behavior_menu_i
Brought to you by:
xtimg
Update of /cvsroot/openfirst/base/config/functions/wysiwyg/modules In directory sc8-pr-cvs1:/tmp/cvs-serv12208 Added Files: behavior_css.js behavior_menu_invisible.js behavior_remove_phptags.js behavior_remove_xmltags.js button_about.js button_hr.gif button_hr.js button_html.htm button_html.js button_image.js button_imagemap.js button_log.js button_table_properties.html button_table_properties.js button_table_properties_gecko.html grid_small.js listbox_paragraph.js listbox_styleclass.js listbox_template.js listbox_template_example.html Log Message: initial upload --- NEW FILE: behavior_css.js --- //Init Function function MODUL__behaviorLoadCSS(cssSrc,cssHtml) {/*{{{*/ var apiInfoArray = new Array(); apiInfoArray['typ'] = 'behavior'; apiInfoArray['header'] = ''; //OLD & Deprecated /*{{{*/ /* if (cssSrc && cssSrc.length) { apiInfoArray['header'] += '<link salomondhtmldesignmetainfo=\"this_tag_will_removed_automaticaly_by_dhtmlEditorGecko\" REL="stylesheet" TYPE="text/css" HREF="'+cssSrc+'">'; apiInfoArray['GECKO_COMPATIBLE'] = true; } */ /*}}}*/ //New CSS Syntax for Import /*{{{*/ if ( (cssHtml && cssHtml.length) || (cssSrc && cssSrc.length) ) { apiInfoArray['header'] += "<style type=\"text/css\">\n"; if (cssSrc && cssSrc.length) apiInfoArray['header'] += "@import url("+cssSrc+") all;\n" if (cssHtml && cssHtml.length) apiInfoArray['header'] += cssHtml; apiInfoArray['header'] += "\n</style>"; apiInfoArray['header'] += '<link salomondhtmldesignmetainfo=\"this_tag_will_removed_automaticaly_by_dhtmlEditorGecko\" REL="stylesheet" TYPE="text/css" HREF="'+cssSrc+'">'; apiInfoArray['GECKO_COMPATIBLE'] = true; } /*}}}*/ return apiInfoArray; }/*}}}*/ --- NEW FILE: behavior_menu_invisible.js --- //init function MODUL__behaviorMenuInvisible(editor) {/*{{{*/ var apiInfoArray = new Array(); apiInfoArray['typ'] = 'behavior'; apiInfoArray['onclick'] = MODUL__behaviorMenuInvisible_onclick; apiInfoArray['onDocumentComplete'] = MODUL__behaviorMenuInvisible_onDocumentComplete; if (editor) { editor.hideButtonBarOnInit = true; editor.disableDisplayEvent = true; } //enable ContextMenu entry(s) apiInfoArray['ContextMenu'] = new Array(); var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].menuString = MENU_SEPARATOR__; apiInfoArray['ContextMenu'][_L].grid = DECMD_PASTE; var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); //apiInfoArray['ContextMenu'][_L].queryStatus = OLE_TRISTATE_UNCHECKED;//''; apiInfoArray['ContextMenu'][_L].queryStatusFunction = MODUL__behaviorMenuInvisible_ContextQueryStatusFunction;//more prio than apiInfoArray['ContextMenu'][_L].queryStatus apiInfoArray['ContextMenu'][_L].menuString = 'Hide Menu Bar'; apiInfoArray['ContextMenu'][_L].ContextMenuActionFunction = MODUL__behaviorMenuInvisible_ToggleMenuDisplay_onContextMenuAction; apiInfoArray['ContextMenu'][_L].queryStatusCmdId = ''; apiInfoArray['ContextMenu'][_L].grid = DECMD_PASTE; var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].menuString = MENU_SEPARATOR__; apiInfoArray['ContextMenu'][_L].grid = DECMD_PASTE; //Gecko apiInfoArray['GECKO_COMPATIBLE'] = true; apiInfoArray['GECKO_onDocumentComplete'] = MODUL__behaviorMenuInvisible_onDocumentComplete_GECKO; return apiInfoArray; }/*}}}*/ //M$ function MODUL__behaviorMenuInvisible_ToggleMenuDisplay(_thisId) {/*{{{*/ var _this = false; var tblId = _thisId+'ButtonBarTbl'; if (!_thisId) return; //search my object in the global object collection for(var i=0;i<document[document.____GLOBAL_VAR_PREFIX____+'__allEditorInfos'].length;i++) { if (document[document.____GLOBAL_VAR_PREFIX____+'__allEditorInfos'][i].obj && document[document.____GLOBAL_VAR_PREFIX____+'__allEditorInfos'][i].obj.objectId == _thisId) { _this = document[document.____GLOBAL_VAR_PREFIX____+'__allEditorInfos'][i].obj; break; } } if (!_this) return; //alert(_this.disableDisplayEvent); if (document.getElementById(tblId).style.display == 'none') { document.getElementById(tblId).style.display = 'block'; _this.disableDisplayEvent = false; } else { document.getElementById(tblId).style.display = 'none'; _this.disableDisplayEvent = true; } }/*}}}*/ function MODUL__behaviorMenuInvisible_ToggleMenuDisplay_onContextMenuAction (_this) {/*{{{*/ if (document.getElementById(_this.objectId+'ButtonBarTbl').style.display == 'none') { document.getElementById(_this.objectId+'ButtonBarTbl').style.display = 'block'; _this.disableDisplayEvent = false; } else { document.getElementById(_this.objectId+'ButtonBarTbl').style.display = 'none'; _this.disableDisplayEvent = true; } }/*}}}*/ function MODUL__behaviorMenuInvisible_onclick(_this) {/*{{{*/ document.getElementById(_this.objectId+'ButtonBarTbl').style.display = 'none'; _this.disableDisplayEvent = true; return true; }/*}}}*/ function MODUL__behaviorMenuInvisible_onDocumentComplete(_this) {/*{{{*/ var content = ''; var width = _this.width content += '<span title="Click here to display/hide the menu" style="cursor:hand;" onclick="void(MODUL__behaviorMenuInvisible_ToggleMenuDisplay(\''+_this.objectId+'\'))" style="BACKGROUND-COLOR: buttonface; BORDER-BOTTOM: buttonshadow solid 1px; BORDER-LEFT: buttonhighlight solid 1px; BORDER-RIGHT: buttonshadow solid 1px; BORDER-TOP: buttonhighlight solid 1px; HEIGHT: 3px; WIDTH: '+width+'px;">'; content += '<div align="center"><font title="Click here to display/hide the menu" color="blue" style="font-size:10px" face="Arial">Menu</font></div></span>'; document.getElementById(_this.objectId+'ButtonBarTbl').insertAdjacentHTML("BeforeBegin",content); document.getElementById(_this.objectId+'ButtonBarTbl').style.display = 'none'; _this.disableDisplayEvent = true; return true; }/*}}}*/ function MODUL__behaviorMenuInvisible_ContextQueryStatusFunction(xPos,yPos,contextMenuCollectionItem,_this) {/*{{{*/ if (document.getElementById(_this.objectId+'ButtonBarTbl').style.display == 'none') { return OLE_TRISTATE_CHECKED;// = 1 } return OLE_TRISTATE_UNCHECKED; }/*}}}*/ //GECKO function MODUL__behaviorMenuInvisible_onclick_GECKO(ObjectId) {/*{{{*/ if (document.getElementById(ObjectId+'ButtonBarTbl2').style.display=='none') { document.getElementById(ObjectId+'ButtonBarTbl2').style.display=''; //Workaround 4 Gecko-Dhtml-Bug: re-init buttons cause mouseXXX Effects are lost... if (!dhtmlEditorGecko.GET_MY_OBJECT_INSTANCE_FROM_OBJECT_ID(ObjectId).tmp______MODUL__behaviorMenuInvisible_onclick_GECKO) { dhtmlEditorGecko.GET_MY_OBJECT_INSTANCE_FROM_OBJECT_ID(ObjectId).tmp______MODUL__behaviorMenuInvisible_onclick_GECKO=true;//only1time dhtmlEditorGecko.GET_MY_OBJECT_INSTANCE_FROM_OBJECT_ID(ObjectId).InitToolbarButtons(); } } else { document.getElementById(ObjectId+'ButtonBarTbl2').style.display='none'; } }/*}}}*/ function MODUL__behaviorMenuInvisible_onDocumentComplete_GECKO(api_info) {/*{{{*/ var content = ''; var width = parseInt(document.getElementById(api_info['ObjectId']).style.width); content += '<span title="Click here to display/hide the menu" style="cursor:hand;" onclick="" style="BACKGROUND-COLOR: buttonface; BORDER-BOTTOM: buttonshadow solid 1px; BORDER-LEFT: buttonhighlight solid 1px; BORDER-RIGHT: buttonshadow solid 1px; BORDER-TOP: buttonhighlight solid 1px; HEIGHT: 3px; WIDTH: '+width+'px;">'; content += '<div align="center"><a href="javascript:MODUL__behaviorMenuInvisible_onclick_GECKO(\''+api_info['ObjectId']+'\')"><font title="Click here to display/hide the menu" color="blue" style="font-size:10px" face="Arial">Menu</font></a></div></span>'; document.getElementById(api_info['ObjectId']+'ButtonBarTbl2').style.display='none'; document.getElementById(api_info['ObjectId']+'ButtonBarTbl1').innerHTML = content+document.getElementById(api_info['ObjectId']+'ButtonBarTbl1').innerHTML; return true; }/*}}}*/ --- NEW FILE: behavior_remove_phptags.js --- //init function MODUL__behaviorRemovePHPTagsGetApiInfoArray() {/*{{{*/ var apiInfoArray = new Array(); apiInfoArray['typ'] = 'behavior'; apiInfoArray['onDocumentComplete'] = MODUL__behaviorRemovePHPTagsOnDocumentComplete; apiInfoArray['onprepare'] = MODUL__behaviorRemovePHPTagsOnPrepare; apiInfoArray['onGetHtmlSource'] = MODUL__behaviorRemovePHPTagsOnPrepare; //Gecko apiInfoArray['GECKO_COMPATIBLE'] = true; apiInfoArray['GECKO_onprepare'] = MODUL__behaviorRemovePHPTagsOnPrepare_GECKO; apiInfoArray['GECKO_onGetHtmlSource'] = MODUL__behaviorRemovePHPTagsOnPrepare_GECKO; return apiInfoArray; }/*}}}*/ //M$ function MODUL__behaviorRemovePHPTagsOnDocumentComplete(_this) {/*{{{*/ //MODUL__behaviorRemovePHPTagsOnPrepare(_this) return true; }/*}}}*/ function MODUL__behaviorRemovePHPTagsOnPrepare(_this) {/*{{{*/ try { var gt='>';//avoid php ending var content=false; eval("content = document[_this.getObjectId()].DOM.body.innerHTML.replace(/<\\?/g,'<?');"); eval("content = document[_this.getObjectId()].DOM.body.innerHTML.replace(/\\?>/g,'>?');"); if (content) document[_this.getObjectId()].DOM.body.innerHTML = content ; } catch(e){return false;}; return true; }/*}}}*/ //GECKO function MODUL__behaviorRemovePHPTagsOnPrepare_GECKO(api_info) {/*{{{*/ try { var gt='>';//avoid php ending var content=false; eval("content = document.getElementById(api_info['ObjectId']).contentWindow.document.body.innerHTML.replace(/<\\?/g,'<?');"); eval("content = document.getElementById(api_info['ObjectId']).contentWindow.document.body.innerHTML.replace(/\\?>/g,'>?');"); if (content) document[_this.getObjectId()].DOM.body.innerHTML = content ; } catch(e){return false;}; return true; }/*}}}*/ --- NEW FILE: behavior_remove_xmltags.js --- //init function MODUL__behaviorRemoveXmlTagsGetApiInfoArray() {/*{{{*/ var apiInfoArray = new Array(); apiInfoArray['typ'] = 'behavior'; apiInfoArray['onDocumentComplete'] = MODUL__behaviorRemoveXmlTagsOnDocumentComplete; apiInfoArray['onprepare'] = MODUL__behaviorRemoveXmlTagsOnPrepare; apiInfoArray['onGetHtmlSource'] = MODUL__behaviorRemoveXmlTagsOnPrepare; //Gecko apiInfoArray['GECKO_COMPATIBLE'] = true; apiInfoArray['GECKO_onprepare'] = MODUL__behaviorRemoveXmlTagsOnPrepare_GECKO; apiInfoArray['GECKO_onGetHtmlSource'] = MODUL__behaviorRemoveXmlTagsOnPrepare_GECKO; return apiInfoArray; }/*}}}*/ //M$ function MODUL__behaviorRemoveXmlTagsOnDocumentComplete(_this) {/*{{{*/ //MODUL__behaviorRemoveXmlTagsOnPrepare(_this) return true; }/*}}}*/ function MODUL__behaviorRemoveXmlTagsOnPrepare(_this) {/*{{{*/ try { var gt='>';//avoid php ending var content=false; eval("content = document[_this.getObjectId()].DOM.body.innerHTML.replace(/<\\?xml[\\w\\W]{0,}?"+gt+"/ig,'');"); if (content) document[_this.getObjectId()].DOM.body.innerHTML = content ; } catch(e){return false;}; return true; }/*}}}*/ //GECKO function MODUL__behaviorRemoveXmlTagsOnPrepare_GECKO(api_info) {/*{{{*/ try { var gt='>';//avoid php ending var content=false; eval("content = document.getElementById(api_info['ObjectId']).contentWindow.document.body.innerHTML.replace(/<\\?xml[\\w\\W]{0,}?"+gt+"/ig,'');"); if (content) document[_this.getObjectId()].DOM.body.innerHTML = content ; } catch(e){return false;}; return true; }/*}}}*/ --- NEW FILE: button_about.js --- (This appears to be a binary file; contents omitted.) --- NEW FILE: button_hr.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: button_hr.js --- //init function MODUL__HrInsertGetApiInfoArray(_image) {/*{{{*/ var apiInfoArray = new Array(); apiInfoArray['typ'] = 'button'; apiInfoArray['image'] = _image; apiInfoArray['title'] = 'Insert Line'; apiInfoArray['onclick'] = MODUL__HRinsertOnClick; apiInfoArray['exec'] = MODUL__HRinsertExec; // Set the position of the button apiInfoArray['grid'] = DECMD_HYPERLINK; //See js/dhtmled.js for valid values //apiInfoArray['gridSeperatorBefore'] = true; //apiInfoArray['gridSeperatorAfter'] = true; apiInfoArray['GECKO_COMPATIBLE'] = true; apiInfoArray['GECKO_onclick'] = MODUL__HRinsertOnClick_GECKO; return apiInfoArray; }/*}}}*/ //M$ function MODUL__HRinsertExec(_this,elementObject) {/*{{{*/ var sel; var range; var DOMobj = document[_this.objectId].DOM; if (DOMobj) { sel = DOMobj.selection; //window.status=sel.type.toLowerCase(); if (sel && sel.type && (sel.type.toLowerCase() == "text" || sel.type.toLowerCase() == "none")) { elementObject.className = 'sglButton'; elementObject.children.tags("IMG")[0].className = 'sglIcon'; elementObject.children.tags("IMG")[0].style.filter = ''; } else { elementObject.className = 'sglButton'; elementObject.children.tags("IMG")[0].className = 'sglIcon'; elementObject.children.tags("IMG")[0].style.filter = 'alpha(opacity=25)'; } } }/*}}}*/ function MODUL__HRinsertOnClick(_this) {/*{{{*/ if (!document[_this.getObjectId()] || document[_this.getObjectId()].Busy) return false; try{ var selection = document[_this.objectId].DOM.selection.createRange(); selection.pasteHTML('<hr>'); document[_this.objectId].focus(); } catch(e){;} return true; }/*}}}*/ //GECKO function MODUL__HRinsertOnClick_GECKO(api_info) {/*{{{*/ document.getElementById(api_info['ObjectId']).contentWindow.document.execCommand('inserthorizontalrule', false, null) }/*}}}*/ --- NEW FILE: button_html.htm --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Edit HTML Source - Resize the window with F1-F4</title> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> var editorObject = false; var _opener = false; function ________init() { editorObject = window.dialogArguments[0]; _opener = window.dialogArguments[1]; document.getElementById('tsource').style.width="100%";//parseInt(dialogWidth); document.getElementById('tsource').style.height="90%";//parseInt(dialogHeight); document.getElementById('tsource').style.backgroundColor ="#d3d3d3"; document.getElementById('tsource').value = _opener.document[editorObject.getObjectId()].DOM.body.innerHTML document.getElementById('tsource').focus(); } function ________put() { if (editorObject.setHtmlSource(document.getElementById('tsource').value) == true) { self.close(); } } </SCRIPT> <SCRIPT LANGUAGE=JavaScript FOR=document EVENT=onkeydown> if (event.keyCode == 27) self.close(); if (event.keyCode == 112) document.getElementById('tsource').style.fontSize = parseInt(document.getElementById('tsource').style.fontSize)+2+'px'; if (event.keyCode == 113 && parseInt(document.getElementById('tsource').style.fontSize)>0) document.getElementById('tsource').style.fontSize = parseInt(document.getElementById('tsource').style.fontSize)-2+'px'; if (event.keyCode == 114) { dialogWidth = parseInt(dialogWidth)+20+'px'; dialogHeight = parseInt(dialogHeight)+20+'px'; } if (event.keyCode == 115 && parseInt(dialogWidth)>20 && parseInt(dialogHeight)>20) { dialogWidth = parseInt(dialogWidth)-20+'px'; dialogHeight = parseInt(dialogHeight)-20+'px'; } </SCRIPT> </head> <body onload="________init()" bgcolor="#d3d3d3" id="bo"> <textarea style="font-size:12px;" wrap="off" id="tsource"></textarea><br><div align="center"><input type="button" value="OK" onclick="________put()"> <input onclick="self.close()" type="button" value="Cancel"></div> </body> </html> --- NEW FILE: button_html.js --- //Init Function function MODUL__toggleEditModeGetApiInfoArray(_image) {/*{{{*/ var apiInfoArray = new Array(); apiInfoArray['typ'] = 'button'; apiInfoArray['image'] = _image; apiInfoArray['title'] = 'HTML'; apiInfoArray['onclick'] = MODUL__toggleEditMode; apiInfoArray['onprepare'] = MODUL__toggleEditModeOnPrepare; apiInfoArray['onGetHtmlSource'] = MODUL__toggleEditModeOnPrepare; apiInfoArray['onDocumentComplete'] = MODUL__toggleEditModeOnDocumentComplete; //apiInfoArray['grid'] = DECMD_HYPERLINK;//Set the Position here- See js/dhtmled.js for valid values //apiInfoArray['gridSeperatorBefore'] = true; //apiInfoArray['gridSeperatorAfter'] = true; //enable ContextMenu entry(s) apiInfoArray['ContextMenu'] = new Array(); var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].menuString = MENU_SEPARATOR__; apiInfoArray['ContextMenu'][_L].grid = DECMD_PASTE; var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].queryStatus = ''; apiInfoArray['ContextMenu'][_L].queryStatusFunction = MODUL__toggleEditModeContextQueryStatusFunction; apiInfoArray['ContextMenu'][_L].menuString = apiInfoArray['title']; apiInfoArray['ContextMenu'][_L].ContextMenuActionFunction = MODUL__toggleEditModeContextMenuAction; apiInfoArray['ContextMenu'][_L].queryStatusCmdId = ''; apiInfoArray['ContextMenu'][_L].grid = DECMD_PASTE; var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].menuString = MENU_SEPARATOR__; apiInfoArray['ContextMenu'][_L].grid = DECMD_PASTE; //Gecko Wilco Support //apiInfoArray['typ'] = 'button'; //apiInfoArray['title'] = 'HTML'; apiInfoArray['GECKO_COMPATIBLE'] = true; apiInfoArray['GECKO_image'] = _image; apiInfoArray['GECKO_onclick'] = MODUL__toggleEditMode_GECKO; apiInfoArray['GECKO_onprepare'] = MODUL__toggleEditMode_onprepare_GECKO; apiInfoArray['GECKO_onGetHtmlSource'] = MODUL__toggleEditMode_onprepare_GECKO; apiInfoArray['GECKO_exec'] = MODUL__toggleEditMode_EXEC_GECKO; return apiInfoArray; }/*}}}*/ //MSDHTML Functions function MODUL__toggleEditModeOnDocumentComplete(_this) {/*{{{*/ //____toggleEditMode(_this); return true; }/*}}}*/ function MODUL__toggleEditModeOnPrepare(_this) {/*{{{*/ var _display = document[_this.getObjectId()].style.display; if (_display.toLowerCase() == 'none' && _this.outPutMode != 'makeonly' ) { //refresh by switching ;-) MODUL__toggleEditMode(_this); MODUL__toggleEditMode(_this); } return true; }/*}}}*/ function MODUL__toggleEditMode(_this,__mode) {/*{{{*/ if (!document[_this.getObjectId()] || document[_this.getObjectId()].Busy) return false; if (__mode == -9 ||!document.getElementById(_this.getElementId()) || _this.outPutMode == 'makeonly' )//|| mode_==2)//|| _this.outPutMode == 'replaceTextarea') { //alert('Not Supportet'); var w = _this.width; var h = _this.height; if (true || w<600 || w>1300) w=700; if (true || h<400 || h>800) h=500; var arg = new Array(); arg[0] = _this; arg[1] = window; var arr = showModalDialog( document.dhtmlEditors_home+'modules/button_html.htm', arg, "font-family:Verdana; font-size:12; dialogWidth:"+w+"px; dialogHeight:"+h+"px" ); return true; } var _display = document[_this.getObjectId()].style.display; var i ; if (_display == '' || _display.toLowerCase() == 'block') { document[_this.getObjectId()].Refresh(); document.getElementById(_this.getElementId()).value = document[_this.getObjectId()].DOM.body.innerHTML; _this.disableAllButtons(); //except me for (i=0; i<_this.QueryStatusToolbarButtons.length; i++) { if (_this.QueryStatusToolbarButtons[i].element && _this.QueryStatusToolbarButtons[i].element.className && _this.QueryStatusToolbarButtons[i].element.children && _this.QueryStatusToolbarButtons[i].element.children.tags && _this.QueryStatusToolbarButtons[i].element.children.tags("IMG") && _this.QueryStatusToolbarButtons[i].element.children.tags("IMG")[0] && _this.QueryStatusToolbarButtons[i].element.children.tags("IMG")[0].className && _this.QueryStatusToolbarButtons[i].element.children.tags("IMG")[0].title == 'HTML' ) { _this.QueryStatusToolbarButtons[i].element.className = 'sglButton'; _this.QueryStatusToolbarButtons[i].element.children.tags("IMG")[0].className = 'sglIcon'; _this.QueryStatusToolbarButtons[i].element.children.tags("IMG")[0].style.filter = ''; } } if (!document.getElementById(_this.getElementId()).style.backgroundColorSaved) { document.getElementById(_this.getElementId()).style.widthSaved = document.getElementById(_this.getElementId()).style.width; document.getElementById(_this.getElementId()).style.heightSaved = document.getElementById(_this.getElementId()).style.height; document.getElementById(_this.getElementId()).wrapSaved = document.getElementById(_this.getElementId()).wrap; document.getElementById(_this.getElementId()).style.backgroundColorSaved = document.getElementById(_this.getElementId()).style.backgroundColor; } document.getElementById(_this.getElementId()).style.width = _this.width;//+'px'; document.getElementById(_this.getElementId()).style.height = _this.height;//+'px'; document.getElementById(_this.getElementId()).wrap = 'off'; document.getElementById(_this.getElementId()).style.backgroundColor = "#d3d3d3"; document.getElementById(_this.getObjectId()).style.display = 'none'; document.getElementById(_this.getElementId()).style.display = 'block'; //document.getElementById(_this.getElementId()).focus(); //document.getElementById(_this.getElementId()).focus(); } else { document.getElementById(_this.getElementId()).style.display = 'none'; document[_this.getObjectId()].style.display = 'block'; document[_this.getObjectId()].DOM.body.innerHTML = document.getElementById(_this.getElementId()).value; document[_this.getObjectId()].Refresh(); //restore the settings of textarea document.getElementById(_this.getElementId()).style.width = document.getElementById(_this.getElementId()).style.widthSaved; document.getElementById(_this.getElementId()).style.height = document.getElementById(_this.getElementId()).style.heightSaved; document.getElementById(_this.getElementId()).wrap = document.getElementById(_this.getElementId()).wrapSaved; document.getElementById(_this.getElementId()).style.backgroundColor = document.getElementById(_this.getElementId()).style.backgroundColorSaved; _this.enableAllButtons(); } }/*}}}*/ function MODUL__toggleEditModeContextMenuAction(_this) {/*{{{*/ MODUL__toggleEditMode(_this,-9); }/*}}}*/ function MODUL__toggleEditModeContextQueryStatusFunction(xPos,yPos,contextMenuCollectionItem,_this) {/*{{{*/ return OLE_TRISTATE_UNCHECKED; }/*}}}*/ //Gecko Plugin Functions function MODUL__toggleEditMode_onprepare_GECKO(api_info) {/*{{{*/ var myEditObjId = api_info['ObjectId']; if (dhtmlEditorGecko.GET_MY_OBJECT_INSTANCE_FROM_OBJECT_ID(api_info['ObjectId']).API_tmp_MODUL__toggleEditMode_GECKO) { document.getElementById(myEditObjId).contentWindow.document.body.innerHTML=document.getElementById(myEditObjId+'modultoggleeditmodegeckoplugintxt').value; } }/*}}}*/ function MODUL__toggleEditMode_GECKO(api_info) {/*{{{*/ dhtmlEditorGecko.GET_MY_OBJECT_INSTANCE_FROM_OBJECT_ID(api_info['ObjectId']).API_tmp_MODUL__toggleEditMode_GECKO= !dhtmlEditorGecko.GET_MY_OBJECT_INSTANCE_FROM_OBJECT_ID(api_info['ObjectId']).API_tmp_MODUL__toggleEditMode_GECKO; var ws=4; var hs=0; //alert(dhtmlEditorGecko.GET_MY_OBJECT_INSTANCE_FROM_OBJECT_ID(api_info['ObjectId']).API_tmp_MODUL__toggleEditMode_GECKO) var myEditObjId = api_info['ObjectId']; if (dhtmlEditorGecko.GET_MY_OBJECT_INSTANCE_FROM_OBJECT_ID(api_info['ObjectId']).API_tmp_MODUL__toggleEditMode_GECKO) { if(!document.getElementById(myEditObjId+'modultoggleeditmodegeckoplugintxt')) { var txtArea = document.getElementById(myEditObjId).contentWindow.document.createElement("textarea"); txtArea.setAttribute("id", myEditObjId+"modultoggleeditmodegeckoplugintxt"); var w = parseInt(document.getElementById(myEditObjId).style.width); var h = parseInt(document.getElementById(myEditObjId).style.height); w+=ws; h+=hs; txtArea.setAttribute("style",'display:none; width:'+w+'px; height:'+h+'px;'); document.getElementById(myEditObjId+'iframecontainer').appendChild(txtArea); } MODUL__toggleEditMode_ButtonsGECKO(api_info,0); document.getElementById(myEditObjId+'modultoggleeditmodegeckoplugintxt').value=document.getElementById(myEditObjId).contentWindow.document.body.innerHTML; document.getElementById(myEditObjId).style.visibility="hidden"; document.getElementById(myEditObjId).style.width="0px"; document.getElementById(myEditObjId).style.height="0px"; document.getElementById(myEditObjId+'modultoggleeditmodegeckoplugintxt').style.display="block"; document.getElementById(myEditObjId+'modultoggleeditmodegeckoplugintxt').focus(); return; } else { //alert(1); MODUL__toggleEditMode_ButtonsGECKO(api_info,1); document.getElementById(myEditObjId).contentWindow.document.body.innerHTML=document.getElementById(myEditObjId+'modultoggleeditmodegeckoplugintxt').value; document.getElementById(myEditObjId+'modultoggleeditmodegeckoplugintxt').style.display="none"; document.getElementById(myEditObjId).style.width=parseInt(document.getElementById(myEditObjId+'modultoggleeditmodegeckoplugintxt').style.width)-ws; document.getElementById(myEditObjId).style.height=parseInt(document.getElementById(myEditObjId+'modultoggleeditmodegeckoplugintxt').style.height)-hs; document.getElementById(myEditObjId).style.visibility="visible"; document.getElementById(myEditObjId).contentWindow.focus(); return; } }/*}}}*/ function MODUL__toggleEditMode_ButtonsGECKO(api_info,_do) {/*{{{*/ var _this = new Array('disable','enable'); eval("dhtmlEditorGecko.GET_MY_OBJECT_INSTANCE_FROM_OBJECT_ID(api_info['ObjectId']).onthefly_"+_this[_do]+"AllButtons()"); document.getElementById(api_info['ObjectId']+'APIB'+api_info['id']).style.visibility='visible'; }/*}}}*/ function MODUL__toggleEditMode_EXEC_GECKO(api_info) {/*{{{*/ return dhtmlEditorGecko.GET_MY_OBJECT_INSTANCE_FROM_OBJECT_ID(api_info['ObjectId']).API_tmp_MODUL__toggleEditMode_GECKO; return true; }/*}}}*/ --- NEW FILE: button_image.js --- function MODUL__ImageAddEdit_EXEC(_this,elementObject) { var s = document[_this.objectId].QueryStatus(DECMD_IMAGE); if (s == DECMDF_DISABLED || s == DECMDF_NOTSUPPORTED) { if (!elementObject.children.tags("IMG")[0].style.filter.length) { elementObject.className = 'sglButton'; elementObject.children.tags("IMG")[0].className = 'sglIcon'; elementObject.children.tags("IMG")[0].style.filter = 'alpha(opacity=25)'; } } else if (s == DECMDF_ENABLED || s == DECMDF_NINCHED) { if (elementObject.className!='sglButtonMouseOverUp' || elementObject.children.tags("IMG")[0].style.filter.length) { elementObject.className = 'sglButton'; elementObject.children.tags("IMG")[0].className = 'sglIcon'; elementObject.children.tags("IMG")[0].style.filter = ''; } } else { // DECMDF_LATCHED if (elementObject.className!='sglButtonDown' || elementObject.children.tags("IMG")[0].style.filter.length) { elementObject.className = 'sglButtonDown'; elementObject.children.tags("IMG")[0].className = 'sglIconDown'; elementObject.children.tags("IMG")[0].style.filter = ''; } } } function MODUL__ImageAddEdit_queryStatusFunction(xPos,yPos,contextMenuCollectionItem,_this) { if (document[_this.objectId].Busy) return -1; var state = document[_this.objectId].QueryStatus(DECMD_INSERTROW); if (state==DECMDF_DISABLED) { //lets look of we are inside a table if ( !(document[_this.getObjectId()] && document[_this.getObjectId()].DOM && document[_this.getObjectId()].DOM.selection && document[_this.getObjectId()].DOM.selection.createRange) ) return -1; var selection = selection = document[_this.getObjectId()].DOM.selection.createRange(); if (!selection || !selection.parentElement || !selection.parentElement()) return -1;; if (MODUL__ImageAddEdit___small_helperlein__find_parent('table',selection.parentElement())) { //We are inside a table but QueryStatus returns DECMDF_DISABLED (that can be possible) //We show a OLE_TRISTATE_GRAY entry in the menu context in this case return OLE_TRISTATE_GRAY;; } return -1;//else we show nothink, cause we are not in a table } if (state == DECMDF_DISABLED || state == DECMDF_NOTSUPPORTED) { return OLE_TRISTATE_GRAY; } else if (state == DECMDF_ENABLED || state == DECMDF_NINCHED) { //lets look if action possible bacause DECMD_DELETECOLS is too raw if (contextMenuCollectionItem.menuString == 'Cell Properties' || contextMenuCollectionItem.menuString == 'Row Properties') { if ( !(document[_this.getObjectId()] && document[_this.getObjectId()].DOM && document[_this.getObjectId()].DOM.selection && document[_this.getObjectId()].DOM.selection.createRange) ) return -1; var selection = selection = document[_this.getObjectId()].DOM.selection.createRange(); if (!selection || !selection.parentElement || !selection.parentElement()) return -1;; var _tagName; if(contextMenuCollectionItem.menuString == 'Cell Properties') _tagName='td'; else _tagName='tr'; if (!MODUL__ImageAddEdit___small_helperlein__find_parent(_tagName,selection.parentElement())) { //We are inside a table but QueryStatus returns DECMDF_DISABLED (that can be possible) //We show a OLE_TRISTATE_GRAY entry in the menu context in this case return OLE_TRISTATE_GRAY;; } } return OLE_TRISTATE_UNCHECKED; } else { // DECMDF_LATCHED return OLE_TRISTATE_CHECKED; } //should never arrived :-) return -1; return OLE_TRISTATE_UNCHECKED;// = 0 return OLE_TRISTATE_CHECKED;// = 1 return OLE_TRISTATE_GRAY ;//= 2 } function MODUL__ImageAddEdit_ContextMenuAction(_this,contextMenuCollection) { //Busy ?! if ( !(document[_this.getObjectId()] && document[_this.getObjectId()].DOM && document[_this.getObjectId()].DOM.selection && document[_this.getObjectId()].DOM.selection.createRange) ) return false; var selection = selection = document[_this.getObjectId()].DOM.selection.createRange(); if (!selection || !selection.parentElement || !selection.parentElement()) return false; var pElement=false; if (contextMenuCollection['menuString'] == 'Row Properties')//users choice pElement = MODUL__ImageAddEdit___small_helperlein__find_parent('tr',selection.parentElement()); if (contextMenuCollection['menuString'] == 'Cell Properties')//users choice pElement = MODUL__ImageAddEdit___small_helperlein__find_parent('td',selection.parentElement()); if (contextMenuCollection['menuString'] == 'Table Properties')//users choice pElement = MODUL__ImageAddEdit___small_helperlein__find_parent('table',selection.parentElement()); if (!pElement) return false; var tagName = pElement.tagName; tagName = tagName.toLowerCase(); //alert(tagName); if(true) { if (true) { var ret var arg = new Array(); arg['attributes'] = new Array(); arg['attributes'][arg['attributes'].length] = 'bgColor'; arg['attributes'][arg['attributes'].length] = 'borderColor'; if (tagName =='table') arg['attributes'][arg['attributes'].length] = 'border'; if (tagName =='table') arg['attributes'][arg['attributes'].length] = 'cellSpacing'; if (tagName =='table') arg['attributes'][arg['attributes'].length] = 'cellPadding'; if (tagName !='tr') arg['attributes'][arg['attributes'].length] = 'width'; if (tagName !='tr') arg['attributes'][arg['attributes'].length] = 'height'; arg['attributes'][arg['attributes'].length] = 'align'; if (tagName !='table') arg['attributes'][arg['attributes'].length] = 'valign'; arg['attributes_advanced'] = new Array(); if (tagName !='tr') arg['attributes_advanced'][arg['attributes_advanced'].length] = 'backGround'; if (tagName !='tr') arg['attributes_advanced'][arg['attributes_advanced'].length] = 'borderColordark'; if (tagName !='tr') arg['attributes_advanced'][arg['attributes_advanced'].length] = 'borderColorlight'; if (false) arg['attributes_advanced'][arg['attributes_advanced'].length] = 'class'; if (false) arg['attributes_advanced'][arg['attributes_advanced'].length] = 'colspan'; if (false) arg['attributes_advanced'][arg['attributes_advanced'].length] = 'rowspan'; if (false) arg['attributes_advanced'][arg['attributes_advanced'].length] = 'style'; arg['attributes'][arg['attributes'].length] = 'title'; arg['attributes_advanced'][arg['attributes_advanced'].length] = 'dir'; arg['attributes_advanced'][arg['attributes_advanced'].length] = 'lang'; arg['attributes_advanced'][arg['attributes_advanced'].length] = 'id'; arg['pElement'] = pElement; arg['_this'] = _this; arg['_window'] = window; arg['title'] = contextMenuCollection['menuString']; var w = 350; var h = 500; var ret = showModalDialog( document.dhtmlEditors_home+'modules/button_table_properties.html', arg, "font-family:Verdana; dialogWidth:"+w+"px; dialogHeight:"+h+"px" ); if (ret && ret['attributes']) { for(var i=0;i<ret['attributes'].length;i++) { var name = ret['attributes'][i]['name']; var value = ret['attributes'][i]['value']; if (value.length<1) { try{ pElement.removeAttribute(name); }catch(_E){ alert(name+ ' '+value);}; } else { try{ pElement.setAttribute(name,value); }catch(_E){ alert(name+ ' '+value);}; } } } // document[_this.getObjectId()].style.display='none'; // document[_this.getObjectId()].style.display='block'; document[_this.getObjectId()].Refresh(); return true; } } return false; alert(contextMenuCollection['menuString']); } function MODUL__ImageAddEdit___small_helperlein__find_parent(_tagName,_element) { var escapE=0; while(_element && ++escapE<333*6) { if (_tagName.toLowerCase() != 'table' && _element.tagName.toLowerCase() == 'table') return false; if (_element.tagName && _element.tagName.toLowerCase() == _tagName.toLowerCase()) return _element; _element=_element.parentElement; } return false; //alert(_element.tagName); } function MODUL__ImageAddEdit_GetApiInfoArray(_image) { var apiInfoArray = new Array(); apiInfoArray['typ'] = 'button'; apiInfoArray['image'] = _image; apiInfoArray['title'] = 'Image';//if you change this title Change it below too!!! apiInfoArray['onclick'] = MODUL__ImageAddEdit_ONCLICK; apiInfoArray['exec'] = MODUL__ImageAddEdit_EXEC; // Set the position of the button apiInfoArray['grid'] = DECMD_INSERTTABLE; //See js/dhtmled.js for valid values //apiInfoArray['gridSeperatorBefore'] = true; //apiInfoArray['gridSeperatorAfter'] = true; //enable ContextMenu entry(s) apiInfoArray['ContextMenu'] = new Array(); var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].queryStatus = ''; apiInfoArray['ContextMenu'][_L].queryStatusFunction = MODUL__ImageAddEdit_queryStatusFunction; apiInfoArray['ContextMenu'][_L].menuString = apiInfoArray['title']; apiInfoArray['ContextMenu'][_L].ContextMenuActionFunction = MODUL__ImageAddEdit_ContextMenuAction; apiInfoArray['ContextMenu'][_L].queryStatusCmdId = ''; apiInfoArray['ContextMenu'][_L].grid = DECMD_INSERTTABLE; var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].queryStatus = ''; apiInfoArray['ContextMenu'][_L].queryStatusFunction = MODUL__ImageAddEdit_queryStatusFunction; apiInfoArray['ContextMenu'][_L].menuString = "Cell Properties"; apiInfoArray['ContextMenu'][_L].ContextMenuActionFunction = MODUL__ImageAddEdit_ContextMenuAction; apiInfoArray['ContextMenu'][_L].queryStatusCmdId = ''; apiInfoArray['ContextMenu'][_L].grid = DECMD_INSERTTABLE; var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].queryStatus = ''; apiInfoArray['ContextMenu'][_L].queryStatusFunction = MODUL__ImageAddEdit_queryStatusFunction; apiInfoArray['ContextMenu'][_L].menuString = "Row Properties"; apiInfoArray['ContextMenu'][_L].ContextMenuActionFunction = MODUL__ImageAddEdit_ContextMenuAction; apiInfoArray['ContextMenu'][_L].queryStatusCmdId = ''; apiInfoArray['ContextMenu'][_L].grid = DECMD_INSERTTABLE; var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].menuString = MENU_SEPARATOR__; apiInfoArray['ContextMenu'][_L].grid = DECMD_INSERTTABLE; return apiInfoArray; } function MODUL__ImageAddEdit_ONCLICK(_this) { if ( !(document[_this.getObjectId()] && document[_this.getObjectId()].DOM && document[_this.getObjectId()].DOM.selection && document[_this.getObjectId()].DOM.selection.createRange) ) return -1; var selection = document[_this.getObjectId()].DOM.selection; if (selection && selection.type && selection.type.toLowerCase() == 'control') { S } } --- NEW FILE: button_imagemap.js --- function MODUL_DECMD_IMAGEMAP_onclick(_this) { //DECMD_IMAGEMAP_RANGE = ''; //DECMD_IMAGEMAP_RANGE_ITEM = ''; var oSel ,sType, range_; oSel = document[_this.objectId].DOM.selection; range_ = oSel.createRange() if (range_.length <= 0 || !range_.item || range_.item(range_.length-1).tagName.toLowerCase() != 'img') { alert('Please click on an Image for using the Salomon Image Map Editor'); return; } args=new Array(); args['opener'] = window; args['dhtmlobj'] = document[_this.objectId]; d_ = new Date(); var arr = showModalDialog( document.dhtmlEditors_home+"modules/imagemap/index.php?fkproxy="+d_.getMilliseconds(),args,"dialogWidth:750px; dialogHeight:550px; center: Yes; help: No; resizable: Yes; status: Yes;" ); } function MODUL_DECMD_IMAGEMAP_getApiInfoArray(_image) { var apiInfoArray = new Array(); apiInfoArray['typ'] = 'button'; apiInfoArray['image'] = _image; apiInfoArray['title'] = 'Image Map'; apiInfoArray['onclick'] = MODUL_DECMD_IMAGEMAP_onclick; //apiInfoArray['exec'] = MODUL__HRinsertExec; // Set the position of the button apiInfoArray['grid'] = DECMD_SETBACKCOLOR; //See js/dhtmled.js for valid values //apiInfoArray['gridSeperatorBefore'] = true; //apiInfoArray['gridSeperatorAfter'] = true; return apiInfoArray; } --- NEW FILE: button_log.js --- function MODUL__dhtmlEditorDoShowLogs(_this) { //this.ALLLOG_TYPES //this.ALLLOG var content=''; for (var i=0;i<_this.ALLLOG.length;i++) { content+=_this.ALLLOG[i]+"\n"; } //alert(content); var W_HANDLE; W_HANDLE = window.open("about:blank","_blank"); W_HANDLE.document.writeln('<NOBR>'); W_HANDLE.document.writeln('<xmp>'); W_HANDLE.document.writeln(content); W_HANDLE.document.writeln('</xmp>'); W_HANDLE.document.writeln('</NOBR>'); return true; } function MODUL__dhtmlEditorShowLogsGetApiInfoArray(_image) { var apiInfoArray = new Array(); apiInfoArray['typ'] = 'button'; apiInfoArray['image'] = _image; apiInfoArray['title'] = 'Show Logs'; apiInfoArray['onclick'] = MODUL__dhtmlEditorDoShowLogs; //apiInfoArray['onprepare'] = MODUL__toggleEditModeOnPrepare; //apiInfoArray['onDocumentComplete'] = MODUL__toggleEditModeOnDocumentComplete; //apiInfoArray['grid'] = DECMD_HYPERLINK; //apiInfoArray['gridSeperatorBefore'] = true; //apiInfoArray['gridSeperatorAfter'] = true; return apiInfoArray; } --- NEW FILE: button_table_properties.html --- <HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- document.writeln('<title>'+window.dialogArguments['title']+'</title>'); //--> </SCRIPT> <STYLE TYPE="text/css"> BODY {margin-left:10; font-family:Verdana; font-size:12; background:menu} BUTTON {width:5em} TABLE,TD,INPUT {font-family:Verdana; font-size:10px} P {text-align:center} </STYLE> <SCRIPT LANGUAGE=JavaScript> function _return() { var arg = window.dialogArguments; var ret = new Array(); ret['attributes'] = new Array(); for ( var i=0;i<arg['attributes'].length;i++ ) { ret['attributes'][i] = new Array(); ret['attributes'][i]['name'] = arg['attributes'][i]; ret['attributes'][i]['value'] = document.getElementById(arg['attributes'][i]).value; } for ( var i=0;i<arg['attributes_advanced'].length;i++ ) { var l=ret['attributes'].length; ret['attributes'][l] = new Array(); ret['attributes'][l]['name'] = arg['attributes_advanced'][i]; ret['attributes'][l]['value'] = document.getElementById(arg['attributes_advanced'][i]).value; } window.returnValue = ret; window.close(); } </SCRIPT> <SCRIPT LANGUAGE=JavaScript FOR=document EVENT=onkeydown> if (event.keyCode == 27) self.close(); if (event.keyCode == 114) { dialogWidth = parseInt(dialogWidth)+20+'px'; dialogHeight = parseInt(dialogHeight)+20+'px'; } if (event.keyCode == 115 && parseInt(dialogWidth)>20 && parseInt(dialogHeight)>20) { dialogWidth = parseInt(dialogWidth)-20+'px'; dialogHeight = parseInt(dialogHeight)-20+'px'; } </SCRIPT> </HEAD> <BODY> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- var attributes = window.dialogArguments['attributes']; var attributes_advanced = window.dialogArguments['attributes_advanced']; var pElement = window.dialogArguments['pElement']; var thisAttribute; document.writeln('<TABLE CELLSPACING=3>'); for ( var i=0;i<attributes.length;i++ ) { var thisAttribute = attributes[i]; document.writeln('<TR>'); document.writeln('<TD>'); document.writeln(thisAttribute); document.writeln('</TD>'); document.writeln('<TD>'); document.writeln('<INPUT value="'+pElement.getAttribute(thisAttribute)+'" ID="'+thisAttribute+'"></TD>'); document.writeln('</TD>'); document.writeln('</TR>'); } for ( var i=0;i<attributes_advanced.length;i++ ) { var thisAttribute = attributes_advanced[i]; document.writeln('<TR>'); document.writeln('<TD>'); document.writeln(thisAttribute); document.writeln('</TD>'); document.writeln('<TD>'); document.writeln('<INPUT value="'+pElement.getAttribute(thisAttribute)+'" ID="'+thisAttribute+'"></TD>'); document.writeln('</TD>'); document.writeln('</TR>'); } document.writeln('</TABLE>'); //--> </SCRIPT> <P> <BUTTON TYPE=SUBMIT onclick="_return()">OK</BUTTON> <BUTTON ONCLICK="window.close();">Cancel</BUTTON> </BODY> </HTML> --- NEW FILE: button_table_properties.js --- //init function MODUL__TableProperties_GetApiInfoArray(_image) {/*{{{*/ var apiInfoArray = new Array(); apiInfoArray['typ'] = 'button'; apiInfoArray['image'] = _image; apiInfoArray['title'] = 'Table Properties';//if you change this title Change it below too!!! apiInfoArray['onclick'] = MODUL__TableProperties_ONCLICK; apiInfoArray['exec'] = MODUL__TableProperties_EXEC; // Set the position of the button apiInfoArray['grid'] = DECMD_INSERTTABLE; //See js/dhtmled.js for valid values //apiInfoArray['gridSeperatorBefore'] = true; //apiInfoArray['gridSeperatorAfter'] = true; //enable ContextMenu entry(s) apiInfoArray['ContextMenu'] = new Array(); var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].queryStatus = ''; apiInfoArray['ContextMenu'][_L].queryStatusFunction = MODUL__TableProperties_queryStatusFunction; apiInfoArray['ContextMenu'][_L].menuString = apiInfoArray['title']; apiInfoArray['ContextMenu'][_L].ContextMenuActionFunction = MODUL__TableProperties_ContextMenuAction; apiInfoArray['ContextMenu'][_L].queryStatusCmdId = ''; apiInfoArray['ContextMenu'][_L].grid = DECMD_INSERTTABLE; var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].queryStatus = ''; apiInfoArray['ContextMenu'][_L].queryStatusFunction = MODUL__TableProperties_queryStatusFunction; apiInfoArray['ContextMenu'][_L].menuString = "Cell Properties"; apiInfoArray['ContextMenu'][_L].ContextMenuActionFunction = MODUL__TableProperties_ContextMenuAction; apiInfoArray['ContextMenu'][_L].queryStatusCmdId = ''; apiInfoArray['ContextMenu'][_L].grid = DECMD_INSERTTABLE; var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].queryStatus = ''; apiInfoArray['ContextMenu'][_L].queryStatusFunction = MODUL__TableProperties_queryStatusFunction; apiInfoArray['ContextMenu'][_L].menuString = "Row Properties"; apiInfoArray['ContextMenu'][_L].ContextMenuActionFunction = MODUL__TableProperties_ContextMenuAction; apiInfoArray['ContextMenu'][_L].queryStatusCmdId = ''; apiInfoArray['ContextMenu'][_L].grid = DECMD_INSERTTABLE; var _L = apiInfoArray['ContextMenu'].length; apiInfoArray['ContextMenu'][_L] = new Array(); apiInfoArray['ContextMenu'][_L].menuString = MENU_SEPARATOR__; apiInfoArray['ContextMenu'][_L].grid = DECMD_INSERTTABLE; //GECKO apiInfoArray['GECKO_COMPATIBLE'] = true; apiInfoArray['GECKO_onclick'] = MODUL__TableProperties_ONCLICK_GECKO; return apiInfoArray; }/*}}}*/ //M$ function MODUL__TableProperties_EXEC(_this,elementObject) {/*{{{*/ var s = document[_this.objectId].QueryStatus(DECMD_INSERTROW); if (s == DECMDF_DISABLED || s == DECMDF_NOTSUPPORTED) { if (!elementObject.children.tags("IMG")[0].style.filter.length) { elementObject.className = 'sglButton'; elementObject.children.tags("IMG")[0].className = 'sglIcon'; elementObject.children.tags("IMG")[0].style.filter = 'alpha(opacity=25)'; } } else if (s == DECMDF_ENABLED || s == DECMDF_NINCHED) { if (elementObject.className!='sglButtonMouseOverUp' || elementObject.children.tags("IMG")[0].style.filter.length) { elementObject.className = 'sglButton'; elementObject.children.tags("IMG")[0].className = 'sglIcon'; elementObject.children.tags("IMG")[0].style.filter = ''; } } else { // DECMDF_LATCHED if (elementObject.className!='sglButtonDown' || elementObject.children.tags("IMG")[0].style.filter.length) { elementObject.className = 'sglButtonDown'; elementObject.children.tags("IMG")[0].className = 'sglIconDown'; elementObject.children.tags("IMG")[0].style.filter = ''; } } }/*}}}*/ function MODUL__TableProperties_ONCLICK(_this) {/*{{{*/ //We simulate contextMenuCollection var contextMenuCollection = new Array(); contextMenuCollection['menuString'] = 'Table Properties'; return MODUL__TableProperties_ContextMenuAction(_this,contextMenuCollection); }/*}}}*/ function MODUL__TableProperties_queryStatusFunction(xPos,yPos,contextMenuCollectionItem,_this) {/*{{{*/ if (document[_this.objectId].Busy) return -1; var state = document[_this.objectId].QueryStatus(DECMD_INSERTROW); if (state==DECMDF_DISABLED) { //lets look of we are inside a table if ( !(document[_this.getObjectId()] && document[_this.getObjectId()].DOM && document[_this.getObjectId()].DOM.selection && document[_this.getObjectId()].DOM.selection.createRange) ) return -1; var selection = selection = document[_this.getObjectId()].DOM.selection.createRange(); if (!selection || !selection.parentElement || !selection.parentElement()) return -1;; if (MODUL__TableProperties___small_helperlein__find_parent('table',selection.parentElement())) { //We are inside a table but QueryStatus returns DECMDF_DISABLED (that can be possible) //We show a OLE_TRISTATE_GRAY entry in the menu context in this case return OLE_TRISTATE_GRAY;; } return -1;//else we show nothink, cause we are not in a table } if (state == DECMDF_DISABLED || state == DECMDF_NOTSUPPORTED) { return OLE_TRISTATE_GRAY; } else if (state == DECMDF_ENABLED || state == DECMDF_NINCHED) { //lets look if action possible bacause DECMD_DELETECOLS is too raw if (contextMenuCollectionItem.menuString == 'Cell Properties' || contextMenuCollectionItem.menuString == 'Row Properties') { if ( !(document[_this.getObjectId()] && document[_this.getObjectId()].DOM && document[_this.getObjectId()].DOM.selection && document[_this.getObjectId()].DOM.selection.createRange) ) return -1; var selection = selection = document[_this.getObjectId()].DOM.selection.createRange(); if (!selection || !selection.parentElement || !selection.parentElement()) return -1;; var _tagName; if(contextMenuCollectionItem.menuString == 'Cell Properties') _tagName='td'; else _tagName='tr'; if (!MODUL__TableProperties___small_helperlein__find_parent(_tagName,selection.parentElement())) { //We are inside a table but QueryStatus returns DECMDF_DISABLED (that can be possible) //We show a OLE_TRISTATE_GRAY entry in the menu context in this case return OLE_TRISTATE_GRAY;; } } return OLE_TRISTATE_UNCHECKED; } else { // DECMDF_LATCHED return OLE_TRISTATE_CHECKED; } //should never arrived :-) return -1; return OLE_TRISTATE_UNCHECKED;// = 0 return OLE_TRISTATE_CHECKED;// = 1 return OLE_TRISTATE_GRAY ;//= 2 }/*}}}*/ function MODUL__TableProperties_ContextMenuAction(_this,contextMenuCollection) {/*{{{*/ //Busy ?! if ( !(document[_this.getObjectId()] && document[_this.getObjectId()].DOM && document[_this.getObjectId()].DOM.selection && document[_this.getObjectId()].DOM.selection.createRange) ) return false; var selection = selection = document[_this.getObjectId()].DOM.selection.createRange(); if (!selection || !selection.parentElement || !selection.parentElement()) return false; var pElement=false; if (contextMenuCollection['menuString'] == 'Row Properties')//users choice pElement = MODUL__TableProperties___small_helperlein__find_parent('tr',selection.parentElement()); if (contextMenuCollection['menuString'] == 'Cell Properties')//users choice pElement = MODUL__TableProperties___small_helperlein__find_parent('td',selection.parentElement()); if (contextMenuCollection['menuString'] == 'Table Properties')//users choice pElement = MODUL__TableProperties___small_helperlein__find_parent('table',selection.parentElement()); if (!pElement) return false; var tagName = pElement.tagName; tagName = tagName.toLowerCase(); //alert(tagName); if(true) { if (true) { var ret var arg = new Array(); arg['attributes'] = new Array(); arg['attributes'][arg['attributes'].length] = 'bgColor'; arg['attributes'][arg['attributes'].length] = 'borderColor'; if (tagName =='table') arg['attributes'][arg['attributes'].length] = 'border'; if (tagName =='table') arg['attributes'][arg['attributes'].length] = 'cellSpacing'; if (tagName =='table') arg['attributes'][arg['attributes'].length] = 'cellPadding'; if (tagName !='tr') arg['attributes'][arg['attributes'].length] = 'width'; if (tagName !='tr') arg['attributes'][arg['attributes'].length] = 'height'; arg['attributes'][arg['attributes'].length] = 'align'; if (tagName !='table') arg['attributes'][arg['attributes'].length] = 'valign'; arg['attributes_advanced'] = new Array(); if (tagName !='tr') arg['attributes_advanced'][arg['attributes_advanced'].length] = 'backGround'; if (tagName !='tr') arg['attributes_advanced'][arg['attributes_advanced'].length] = 'borderColordark'; if (tagName !='tr') arg['attributes_advanced'][arg['attributes_advanced'].length] = 'borderColorlight'; if (false) arg['attributes_advanced'][arg['attributes_advanced'].length] = 'class'; if (false) arg['attributes_advanced'][arg['attributes_advanced'].length] = 'colspan'; if (false) arg['attributes_advanced'][arg['attributes_advanced'].length] = 'rowspan'; if (false) arg['attributes_advanced'][arg['attributes_advanced'].length] = 'style'; arg['attributes'][arg['attributes'].length] = 'title'; arg['attributes_advanced'][arg['attributes_advanced'].length] = 'dir'; arg['attributes_advanced'][arg['attributes_advanced'].length] = 'lang'; arg['attributes_advanced'][arg['attributes_advanced'].length] = 'id'; arg['pElement'] = pElement; arg['_this'] = _this; arg['_window'] = window; arg['title'] = contextMenuCollection['menuString']; var w = 350; var h = 500; var ret = showModalDialog( document.dhtmlEditors_home+'modules/button_table_properties.html', arg, "font-family:Verdana; dialogWidth:"+w+"px; dialogHeight:"+h+"px" ); if (ret && ret['attributes']) { for(var i=0;i<ret['attributes'].length;i++) { var name = ret['attributes'][i]['name']; var value = ret['attributes'][i]['value']; if (value.length<1) { try{ pElement.removeAttribute(name); }catch(_E){ alert(name+ ' '+value);}; } else { try{ pElement.setAttribute(name,value); }catch(_E){ alert(name+ ' '+value);}; } } } // document[_this.getObjectId()].style.display='none'; // document[_this.getObjectId()].style.display='block'; document[_this.getObjectId()].Refresh(); return true; } } return false; alert(contextMenuCollection['menuString']); }/*}}}*/ function MODUL__TableProperties___small_helperlein__find_parent(_tagName,_element) {/*{{{*/ var escapE=0; while(_element && ++escapE<333*6) { if (_tagName.toLowerCase() != 'table' && _element.tagName.toLowerCase() == 'table') return false; if (_element.tagName && _element.tagName.toLowerCase() == _tagName.toLowerCase()) return _element; _element=_element.parentElement; } return false; //alert(_element.tagName); }/*}}}*/ //GECKO function MODUL__TableProperties_ONCLICK_GECKO(api_info) {/*{{{*/ var ObjectId; var Obj; var win; var doc; var body; var sel; var range; ObjectId = api_info['ObjectId']; Obj = dhtmlEditorGecko.GET_MY_OBJECT_INSTANCE_FROM_OBJECT_ID(ObjectId); win = document.getElementById(ObjectId).contentWindow; doc = win.document; body = doc.body; sel = win.getSelection() //range = sel.getRangeAt(0); //var node_td = sel.focusNode.parentNode; if (!sel || !sel.focusNode) return; var node_td = MODUL__TableProperties_ONCLICK_GECKO__find__('TD',sel.focusNode); var node_tr = MODUL__TableProperties_ONCLICK_GECKO__find__('TR',node_td); var node_table = MODUL__TableProperties_ONCLICK_GECKO__find__('TABLE',node_tr); if(!(node_td && node_tr && node_table)) return; //ok - got all nodes... var att_td = new Array(); var att_tr = new Array(); var att_table = new Array(); att_td[att_td.length] = 'bgColor'; att_td[att_td.length] = 'borderColor'; att_td[att_td.length] = 'width'; att_td[att_td.length] = 'height'; att_td[att_td.length] = 'align'; att_td[att_td.length] = 'valign'; att_td[att_td.length] = 'backGround'; att_td[att_td.length] = 'borderColordark'; att_td[att_td.length] = 'borderColorlight'; att_td[att_td.length] = 'title'; att_td[att_td.length] = 'dir'; att_td[att_td.length] = 'lang'; att_td[att_td.length] = 'id'; att_tr[att_tr.length] = 'bgColor'; att_tr[att_tr.length] = 'borderColor'; att_tr[att_tr.length] = 'align'; att_tr[att_tr.length] = 'valign'; att_tr[att_tr.length] = 'title'; att_tr[att_tr.length] = 'dir'; att_tr[att_tr.length] = 'lang'; att_tr[att_tr.length] = 'id'; att_table[att_table.length] = 'border'; att_table[att_table.length] = 'bgColor'; att_table[att_table.length] = 'borderColor'; att_table[att_table.length] = 'cellSpacing'; att_table[att_table.length] = 'cellPadding'; att_table[att_table.length] = 'width'; att_table[att_table.length] = 'height'; att_table[att_table.length] = 'backGround'; att_table[att_table.length] = 'borderColordark'; att_table[att_table.length] = 'borderColorlight'; att_table[att_table.length] = 'title'; att_table[att_table.length] = 'dir'; att_table[att_table.length] = 'lang'; att_table[att_table.length] = 'id'; var info = new Array(); info['table'] = new Array(); info['table']['node'] = node_table; info['table']['att'] = att_table; info['table']['desc'] = 'Table Properties'; info['tr'] = new Array(); info['tr']['node'] = node_tr; info['tr']['att'] = att_tr; info['tr']['desc'] = 'Row Properties'; info['td'] = new Array(); info['td']['node'] = node_td; info['td']['att'] = att_td; info['td']['desc'] = 'Cell Properties'; MODUL__TableProperties_ONCLICK_GECKO__doGUI(info); }/*}}}*/ function MODUL__TableProperties_ONCLICK_GECKO__doGUI(info) {/*{{{*/ document.MODUL__TableProperties_ONCLICK_GECKO__GUIINFO=info; window.open(document.dhtmlEditors_home+'modules/button_table_properties_gecko.html','_blank','width=500,height=400,left=30,top=30,scrolling=auto,scrollbars=1,resizable=1,status=1'); }/*}}}*/ function MODUL__TableProperties_ONCLICK_GECKO__find__(tag,node) {/*{{{*//*{{{*/ if (node && node.nodeName && node.nodeName.toUpperCase && node.nodeName.toUpperCase() == tag.toUpperCase()) { return node; } if (node && node.parentNode) { return MODUL__TableProperties_ONCLICK_GECKO__find__(tag,node.parentNode); } return false; }/*}}}*//*}}}*/ --- NEW FILE: button_table_properties_gecko.html --- <HTML> <HEAD> <title>Set Table Preferences :: Gecko's Midas DhtmlEditor</title> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- //document.writeln('<title>'+window.dialogArguments['title']+'</title>'); //--> </SCRIPT> <STYLE TYPE="text/css"> BODY {margin-left:10; font-family:Verdana; font-size:12; background:menu} BUTTON {width:5em} TABLE,TD,INPUT {font-family:Verdana; font-size:10px} P {text-align:center} </STYLE> <SCRIPT LANGUAGE=JavaScript> function _return(info,close_) { var t; var i; for(t in info) { for(i=0;i<info[t]['att'].length;i++) { var v=document.formd['info['+t+'][att]['+i+']'].value; if(!v.toString().length) { ... [truncated message content] |