From f61b5b0597e0c25f084ee67d402f12a43a7a9947 Mon Sep 17 00:00:00 2001 From: hukl Date: Tue, 17 Feb 2009 21:54:39 +0100 Subject: added tinymce editor for body area of pages --- public/javascripts/tiny_mce/utils/form_utils.js | 199 ++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100755 public/javascripts/tiny_mce/utils/form_utils.js (limited to 'public/javascripts/tiny_mce/utils/form_utils.js') diff --git a/public/javascripts/tiny_mce/utils/form_utils.js b/public/javascripts/tiny_mce/utils/form_utils.js new file mode 100755 index 0000000..c1f1409 --- /dev/null +++ b/public/javascripts/tiny_mce/utils/form_utils.js @@ -0,0 +1,199 @@ +/** + * $Id: form_utils.js 673 2008-03-06 13:26:20Z spocke $ + * + * Various form utilitiy functions. + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme")); + +function getColorPickerHTML(id, target_form_element) { + var h = ""; + + h += ''; + h += ''; + + return h; +} + +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"); + tinyMCEPopup.dom.addClass(img, 'disabled'); + } else { + if (lnk.getAttribute("realhref")) + lnk.setAttribute("href", lnk.getAttribute("realhref")); + + tinyMCEPopup.dom.removeClass(img, 'disabled'); + } + } +} + +function getBrowserHTML(id, target_form_element, type, prefix) { + var option = prefix + "_" + type + "_browser_callback", cb, html; + + cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); + + if (!cb) + return ""; + + html = ""; + html += ''; + html += ''; + + return html; +} + +function openBrowser(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