X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Ftiny_mce%2Futils%2Fform_utils.js;h=59da01399e1e7c2fe9025f20db26b300ecf06015;hb=b05f4eef4014db3885787ef15107cba93c932ac9;hp=e3774c143c21f7f1896b5294c2f4ca7c473f517d;hpb=11d9e4ed8d4dfe0f5f4f35dc36fdd69008fa081e;p=citadel.git
diff --git a/webcit/tiny_mce/utils/form_utils.js b/webcit/tiny_mce/utils/form_utils.js
index e3774c143..59da01399 100644
--- a/webcit/tiny_mce/utils/form_utils.js
+++ b/webcit/tiny_mce/utils/form_utils.js
@@ -1,203 +1,210 @@
-/**
- * $RCSfile$
- * $Revision$
- * $Date$
- *
- * Various form utilitiy functions.
- *
- * @author Moxiecode
- * @copyright Copyright © 2005, Moxiecode Systems AB, All rights reserved.
- */
-
-function renderColorPicker(id, target_form_element) {
- var html = "";
-
- html += '';
- html += '';
-
- document.write(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 renderBrowser(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 += '';
-
- document.write(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) {
- if (!form_obj || !form_obj.elements[field_name])
- return;
-
- var sel = form_obj.elements[field_name];
-
- var found = false;
- for (var i=0; i';
+ h += ' ' + tinyMCEPopup.getLang('browse') + '';
+
+ 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;
+
+ if (!value)
+ value = "";
+
+ var sel = form_obj.elements[field_name];
+
+ var found = false;
+ for (var i=0; i