From: Andrew Dolgov Date: Thu, 18 May 2006 12:37:52 +0000 (+0100) Subject: notify system improvements X-Git-Tag: 1.2.0~82 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=0530ddd88b5314fe0f75a6c81ac317509feea6c6;p=tt-rss.git notify system improvements --- diff --git a/functions.js b/functions.js index 1914855d..ad6a95f9 100644 --- a/functions.js +++ b/functions.js @@ -93,7 +93,7 @@ function hide_notify() { } } -function notify_real(msg, doc, no_hide) { +function notify_real(msg, doc, no_hide, is_err) { var n = doc.getElementById("notify"); var nb = doc.getElementById("notify_body"); @@ -106,6 +106,16 @@ function notify_real(msg, doc, no_hide) { n.style.display = "block"; } + if (is_err) { + n.style.backgroundColor = "#ffaaaa"; + n.style.color = "white"; + n.style.borderColor = "#ff0000"; + } else { + n.style.backgroundColor = "#fff7d5"; + n.style.borderColor = "#d7c47a"; + n.style.color = "black"; + } + nb.innerHTML = msg; if (notify_hide_timerid) { @@ -120,12 +130,12 @@ function notify_real(msg, doc, no_hide) { } } -function p_notify(msg, no_hide) { - notify_real(msg, parent.document, no_hide); +function p_notify(msg, no_hide, is_err) { + notify_real(msg, parent.document, no_hide, is_err); } -function notify(msg, no_hide) { - notify_real(msg, document, no_hide); +function notify(msg, no_hide, is_err) { + notify_real(msg, document, no_hide, is_err); } function printLockingError() { diff --git a/tt-rss.js b/tt-rss.js index 3fc7c0eb..f82bb773 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -92,14 +92,14 @@ function refetch_callback() { last_refetch = date.getTime() / 1000; if (!xmlhttp.responseXML) { - notify("refetch_callback: backend did not return valid XML"); + notify("refetch_callback: backend did not return valid XML", true, true); return; } var reply = xmlhttp.responseXML.firstChild; if (!reply) { - notify("refetch_callback: backend did not return expected XML object"); + notify("refetch_callback: backend did not return expected XML object", true, true); updateTitle(""); return; } @@ -490,7 +490,7 @@ function quickMenuGo(opid) { var actid = getActiveFeedId(); if (!actid) { - notify("Please select some feed first."); + alert("Please select some feed first."); return; }