summaryrefslogtreecommitdiff
path: root/program/js/common.js
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2006-12-17 21:28:37 +0000
committerthomascube <thomas@roundcube.net>2006-12-17 21:28:37 +0000
commita7d5c6480cdef191b04e71005ffea0e35b84ac24 (patch)
tree2417f87ab39eb74765da109af8fb62bb730b9090 /program/js/common.js
parent5b0687dfcabb7258902f070057fc8a41ba27a776 (diff)
Added patch for resizeable preview pane
Diffstat (limited to 'program/js/common.js')
-rw-r--r--program/js/common.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/program/js/common.js b/program/js/common.js
index d5ecf8f89..2df349a91 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -530,6 +530,33 @@ function rcube_get_object_pos(obj)
return {x:iX, y:iY};
}
+
+
+/**
+ * Return the currently applied value of a css property
+ *
+ * @param {Object} html_element Node reference
+ * @param {String} css_property Property name to read in Javascript notation (eg. 'textAlign')
+ * @param {String} mozilla_equivalent Equivalent property name in CSS notation (eg. 'text-align')
+ * @return CSS property value
+ * @type String
+ */
+function get_elements_computed_style(html_element, css_property, mozilla_equivalent)
+ {
+ if (arguments.length==2)
+ mozilla_equivalent = css_property;
+
+ var el = html_element;
+ if (typeof(html_element)=='string')
+ el = nex_get_object(html_element);
+
+ if (el && el.currentStyle)
+ return el.currentStyle[css_property];
+ else if (el && document.defaultView && document.defaultView.getComputedStyle)
+ return document.defaultView.getComputedStyle(el, null).getPropertyValue(mozilla_equivalent);
+ else
+ return false;
+ }
// cookie functions by GoogieSpell
@@ -543,6 +570,8 @@ function setCookie(name, value, expires, path, domain, secure)
document.cookie = curCookie;
}
+roundcube_browser.prototype.set_cookie = setCookie;
+
function getCookie(name)
{
var dc = document.cookie;
@@ -561,5 +590,7 @@ function getCookie(name)
return unescape(dc.substring(begin + prefix.length, end));
}
+roundcube_browser.prototype.get_cookie = getCookie;
+
var bw = new roundcube_browser();