From 5c68233985b19262f44ff667417e0127df003854 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 26 Oct 2013 17:29:53 +0200 Subject: Fusionne notification.js dans main.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit notification.js était tout petit et occasionnait une requête supplémentaire et un événement JavaScript en plus. Proposition de fusion dans le nouveau main.js statique. --- public/scripts/main.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'public/scripts/main.js') diff --git a/public/scripts/main.js b/public/scripts/main.js index 72795be51..18df73820 100644 --- a/public/scripts/main.js +++ b/public/scripts/main.js @@ -408,6 +408,24 @@ function init_actualize() { }); } +function closeNotification () { + $(".notification").slideUp (200, function () { + $(".notification").remove (); + }); +} + +function init_notifications() { + notif = $(".notification"); + if (notif[0] !== undefined) { + timer = setInterval('closeNotification()', 5000); + + notif.find ("a.close").click (function () { + closeNotification (); + return false; + }); + } +} + $(function () { if (is_reader_mode()) { hide_posts = false; @@ -418,5 +436,6 @@ $(function () { init_stream_delegates($('#stream')); init_nav_entries(); init_templates(); + init_notifications(); init_actualize(); }); -- cgit v1.2.3