X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Ftiny_mce%2Futils%2Fform_utils.js;h=59da01399e1e7c2fe9025f20db26b300ecf06015;hb=b05f4eef4014db3885787ef15107cba93c932ac9;hp=8fba405f8fa14f8627f914c36143b19c94f65652;hpb=26a4a07bdacdaa7013bf45cc235df207708acfde;p=citadel.git
diff --git a/webcit/tiny_mce/utils/form_utils.js b/webcit/tiny_mce/utils/form_utils.js
index 8fba405f8..59da01399 100644
--- a/webcit/tiny_mce/utils/form_utils.js
+++ b/webcit/tiny_mce/utils/form_utils.js
@@ -1,31 +1,26 @@
/**
- * $RCSfile: form_utils.js,v $
- * $Revision: 1.5 $
- * $Date: 2005/10/25 16:01:51 $
+ * form_utils.js
*
- * Various form utilitiy functions.
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
*
- * @author Moxiecode
- * @copyright Copyright © 2005, Moxiecode Systems AB, All rights reserved.
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
*/
+var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
+
function getColorPickerHTML(id, target_form_element) {
- var html = "";
+ var h = "", dom = tinyMCEPopup.dom;
- html += '';
- html += '';
+ if (label = dom.select('label[for=' + target_form_element + ']')[0]) {
+ label.id = label.id || dom.uniqueId();
+ }
- return html;
-}
+ h += '';
+ h += ' ' + tinyMCEPopup.getLang('browse') + '';
-function pickColor(e, target_form_element) {
- if ((e.keyCode == 32 || e.keyCode == 13) || e.type == "mousedown")
- tinyMCEPopup.pickColor(e, target_form_element);
+ return h;
}
function updateColor(img_id, form_element_id) {
@@ -40,51 +35,52 @@ function setBrowserDisabled(id, state) {
if (state) {
lnk.setAttribute("realhref", lnk.getAttribute("href"));
lnk.removeAttribute("href");
- tinyMCE.switchClass(img, 'mceButtonDisabled', true);
+ tinyMCEPopup.dom.addClass(img, 'disabled');
} else {
- lnk.setAttribute("href", lnk.getAttribute("realhref"));
- tinyMCE.switchClass(img, 'mceButtonNormal', false);
+ 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";
- var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback"));
- if (cb == null)
- return "";
+ var option = prefix + "_" + type + "_browser_callback", cb, html;
+
+ cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
- var html = "";
+ if (!cb)
+ return "";
- html += '';
- html += '';
+ html = "";
+ html += '';
+ html += ' ';
return html;
}
-function openBrower(img_id, target_form_element, type, option) {
+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) {
+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