From a0109c4933e0bfb5ed9dbcf94f932991ca689542 Mon Sep 17 00:00:00 2001 From: svncommit Date: Thu, 14 Sep 2006 03:49:28 +0000 Subject: Initial TinyMCE editor support (still need to work on spellcheck and skins) --- program/js/tiny_mce/utils/form_utils.js | 210 ++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 program/js/tiny_mce/utils/form_utils.js (limited to 'program/js/tiny_mce/utils/form_utils.js') diff --git a/program/js/tiny_mce/utils/form_utils.js b/program/js/tiny_mce/utils/form_utils.js new file mode 100644 index 000000000..f1e935809 --- /dev/null +++ b/program/js/tiny_mce/utils/form_utils.js @@ -0,0 +1,210 @@ +/** + * $RCSfile: form_utils.js,v $ + * $Revision: 1.11 $ + * $Date: 2006/04/07 15:53:12 $ + * + * Various form utilitiy functions. + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +function getColorPickerHTML(id, target_form_element) { + var html = ""; + + html += ''; + html += ''; + + return html; +} + +function pickColor(e, target_form_element) { + if ((e.keyCode == 32 || e.keyCode == 13) || e.type == "mousedown") + tinyMCEPopup.pickColor(e, target_form_element); +} + +function updateColor(img_id, form_element_id) { + document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; +} + +function setBrowserDisabled(id, state) { + var img = document.getElementById(id); + var lnk = document.getElementById(id + "_link"); + + if (lnk) { + if (state) { + lnk.setAttribute("realhref", lnk.getAttribute("href")); + lnk.removeAttribute("href"); + tinyMCE.switchClass(img, 'mceButtonDisabled', true); + } else { + lnk.setAttribute("href", lnk.getAttribute("realhref")); + tinyMCE.switchClass(img, 'mceButtonNormal', false); + } + } +} + +function getBrowserHTML(id, target_form_element, type, prefix) { + var option = prefix + "_" + type + "_browser_callback"; + var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback")); + if (cb == null) + return ""; + + var html = ""; + + html += ''; + html += ''; + + return html; +} + +function openBrower(img_id, target_form_element, type, option) { + var img = document.getElementById(img_id); + + if (img.className != "mceButtonDisabled") + tinyMCEPopup.openBrowser(target_form_element, type, option); +} + +function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { + if (!form_obj || !form_obj.elements[field_name]) + return; + + var sel = form_obj.elements[field_name]; + + var found = false; + for (var i=0; i