summaryrefslogtreecommitdiff
path: root/functions.js
diff options
context:
space:
mode:
Diffstat (limited to 'functions.js')
-rw-r--r--functions.js54
1 files changed, 37 insertions, 17 deletions
diff --git a/functions.js b/functions.js
index 6b064b2f0..bcbc93b36 100644
--- a/functions.js
+++ b/functions.js
@@ -28,7 +28,6 @@ function xmlhttp_ready(obj) {
return obj.readyState == 4 || obj.readyState == 0 || !obj.readyState;
}
-
function notify_callback() {
var container = document.getElementById('notify');
if (xmlhttp.readyState == 4) {
@@ -73,26 +72,31 @@ function delay(gap) {
}
}
-function p_notify(msg) {
-
- var n = parent.document.getElementById("notify");
- var nb = parent.document.getElementById("notify_body");
-
- if (!n || !nb) return;
-
- if (msg == "") {
- n.style.display = "none";
- } else {
- n.style.display = "block";
+var notify_hide_timerid = false;
+var notify_last_doc = false;
+
+function hide_notify() {
+ if (notify_last_doc) {
+ var n = notify_last_doc.getElementById("notify");
+ if (navigator.userAgent.match("Firefox")) {
+ if (notify_opacity >= 0) {
+ notify_opacity = notify_opacity - 0.2;
+ n.style.opacity = notify_opacity;
+ notify_hide_timerid = window.setTimeout(hide_notify, 20);
+ } else {
+ n.style.display = "none";
+ n.style.opacity = 1;
+ }
+ } else {
+ n.style.display = "none";
+ }
}
-
- nb.innerHTML = msg;
}
-function notify(msg) {
+function notify_real(msg, doc) {
- var n = document.getElementById("notify");
- var nb = document.getElementById("notify_body");
+ var n = doc.getElementById("notify");
+ var nb = doc.getElementById("notify_body");
if (!n || !nb) return;
@@ -104,6 +108,22 @@ function notify(msg) {
nb.innerHTML = msg;
+ if (notify_hide_timerid) {
+ window.clearTimeout(notify_hide_timerid);
+ }
+
+ notify_last_doc = doc;
+ notify_opacity = 1;
+
+ notify_hide_timerid = window.setTimeout(hide_notify, 3000);
+}
+
+function p_notify(msg) {
+ notify_real(msg, parent.document);
+}
+
+function notify(msg) {
+ notify_real(msg, document);
}
function printLockingError() {