// Preloading Plugins (needs to be registered per area) HTMLArea.loadPlugin("TableOperations"); /**/ HTMLArea.loadStyle("__ixcustom/themes/blue/theme.css"); // All our custom buttons will call this function when clicked. // We use the buttonId parameter to determine what button // triggered the call. function clickHandler(editor, buttonId) { switch (buttonId) { case "ixclean": // remove HTML markup from current selection var l_strPlain = new String(); if ( HTMLArea.is_gecko ) { l_strPlain = editor._getSelection(); } else { // IE stuff (not relyable) var sel = editor._getSelection(); var range = editor._createRange(sel); l_strPlain = range.text; } editor.insertHTML(l_strPlain); break; case "ixforecolor": editor._popupDialog(_editor_url+"__ixcustom/colors.html", function(color) { if (color) { editor.surroundHTML("", ""); } }, HTMLArea._colorToRgb(editor._doc.queryCommandValue("forecolor")) ) break; case "ixhilitecolor": if ( HTMLArea.is_ie ) { // in IE hilitecolor is called backcolor editor._popupDialog(_editor_url+"__ixcustom/colors.html", function(color) { if (color) { editor.surroundHTML("", ""); } }, HTMLArea._colorToRgb(editor._doc.queryCommandValue("backcolor")) ) } else { editor._popupDialog(_editor_url+"__ixcustom/colors.html", function(color) { if (color) { editor.surroundHTML("", ""); } }, HTMLArea._colorToRgb(editor._doc.queryCommandValue("hilitecolor")) ) } break; case "ixlink": editor._popupDialog(_editor_url+"__ixcustom/intrexxlink.asp", function(link) { if (link) { var l_strSel = new String(); if ( HTMLArea.is_gecko ) { l_strSel = editor._getSelection(); } else { var sel = editor._getSelection(); var range = editor._createRange(sel); l_strSel = range.text; } if ( l_strSel != "" ) { editor.surroundHTML("", ""); } else { editor.insertHTML(""+link[1]+""); } } }, true ) break; case "iximage": editor._popupDialog(_editor_url+"__ixcustom/intrexximage.asp?rq_strImgDirEdit=true", function(image) { if(image) { editor.insertHTML('');} }, false ) break; case "ixcmsimage": editor._popupDialog(_editor_url+"__ixcustom/intrexximage.asp?rq_strImgDirEdit=true&rq_strImgDir="+editor.ImgDir, function(image) { if(image) { editor.insertHTML('');} }, false ) break; } }; function intrexx_config(p_config) { if ( ! document.getElementById('CustomStyle') ) { p_config.pageStyle = '@import url(../../../_UpStyle/css.asp);\n\n BODY{padding: 5px !important; }\n;'; } else { p_config.pageStyle = document.getElementById('CustomStyle').innerHTML; } p_config.width = '600px'; p_config.height = '300px'; p_config.registerButton("ixforecolor", HTMLArea.I18N.tooltips["forecolor"], _editor_url+"/images/ed_color_fg.gif", false, clickHandler); p_config.registerButton("ixhilitecolor", HTMLArea.I18N.tooltips["hilitecolor"], _editor_url+"/images/ed_color_bg.gif", false, clickHandler); p_config.registerButton("ixlink", HTMLArea.I18N.intrexx["Link to Application"], _editor_url+"/images/intrexxlink.gif", false, clickHandler); p_config.registerButton("iximage", HTMLArea.I18N.intrexx["Insert Image"], _editor_url+"/images/intrexximage.gif", false, clickHandler); p_config.registerButton("ixclean", HTMLArea.I18N.intrexx["Remove HTML-Markup from selection"], _editor_url+"/images/ixclean.gif", false, clickHandler); p_config.toolbar = [ ["fontname", "space", "fontsize", "space", "formatblock", "space", "bold", "italic", "underline", "strikethrough", "subscript", "superscript", "justifyleft", "justifycenter", "justifyright", "justifyfull", "linebreak", "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator", "ixforecolor", "ixhilitecolor", "separator", "inserthorizontalrule", "createlink", "ixlink", "iximage", "inserttable", "separator", "htmlmode", "ixclean", "separator", "showhelp" ] ]; } function intrexx_config_imgdir(p_config) { if ( ! document.getElementById('CustomStyle') ) { p_config.pageStyle = '@import url(../../../_UpStyle/css.asp);\n\n BODY{padding: 5px !important; }\n;'; } else { p_config.pageStyle = document.getElementById('CustomStyle').innerHTML; } p_config.width = '600px'; p_config.height = '300px'; p_config.registerButton("ixforecolor", HTMLArea.I18N.tooltips["forecolor"], _editor_url+"/images/ed_color_fg.gif", false, clickHandler); p_config.registerButton("ixhilitecolor", HTMLArea.I18N.tooltips["hilitecolor"], _editor_url+"/images/ed_color_bg.gif", false, clickHandler); p_config.registerButton("ixlink", HTMLArea.I18N.intrexx["Link to Application"], _editor_url+"/images/intrexxlink.gif", false, clickHandler); p_config.registerButton("ixcmsimage", HTMLArea.I18N.intrexx["Insert Image"], _editor_url+"/images/intrexximage.gif", false, clickHandler); p_config.registerButton("ixclean", HTMLArea.I18N.intrexx["Remove HTML-Markup from selection"], _editor_url+"/images/ixclean.gif", false, clickHandler); p_config.toolbar = [ ["fontname", "space", "fontsize", "space", "formatblock", "space", "bold", "italic", "underline", "strikethrough", "subscript", "superscript", "justifyleft", "justifycenter", "justifyright", "justifyfull", "linebreak", "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator", "ixforecolor", "ixhilitecolor", "separator", "inserthorizontalrule", "createlink", "ixlink", "ixcmsimage", "inserttable", "separator", "htmlmode", "ixclean", "separator", "showhelp" ] ]; } function editor_generate(p_strName, p_strImgDir) { document.getElementsByName(p_strName)[0].id = p_strName; if ( editor_generate.arguments.length == 1 ) { l_strFunction = "var cfg_"+p_strName+" = new HTMLArea.Config();"+ " "+"intrexx_config(cfg_"+p_strName+");"+ " "+p_strName+" = new HTMLArea('"+p_strName+"', cfg_"+p_strName+");"+ " "+p_strName+".registerPlugin(TableOperations);"+ " "+p_strName+".generate();"; } else { l_strFunction = "var cfg_"+p_strName+" = new HTMLArea.Config();"+ " "+"intrexx_config_imgdir(cfg_"+p_strName+");"+ " "+p_strName+" = new HTMLArea('"+p_strName+"', cfg_"+p_strName+");"+ " "+p_strName+".ImgDir = new String('"+p_strImgDir+"');"+ " "+p_strName+".registerPlugin(TableOperations);"+ " "+p_strName+".generate();"; } eval("ha_"+p_strName+" = new Function(\""+p_strName+"\", \""+l_strFunction+"\");"); eval(" if (window.attachEvent) window.attachEvent('onload', ha_"+p_strName+");\n"); eval(" if (window.addEventListener) window.addEventListener('load', ha_"+p_strName+", false);"); }