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 +++++++++++++++++++ public/scripts/notification.js | 17 ----------------- 2 files changed, 19 insertions(+), 17 deletions(-) delete mode 100644 public/scripts/notification.js (limited to 'public') 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(); }); diff --git a/public/scripts/notification.js b/public/scripts/notification.js deleted file mode 100644 index e4f9fb649..000000000 --- a/public/scripts/notification.js +++ /dev/null @@ -1,17 +0,0 @@ -function closeNotification () { - $(".notification").slideUp (200, function () { - $(".notification").remove (); - }); -} - -$(document).ready (function () { - notif = $(".notification"); - if (notif[0] !== undefined) { - timer = setInterval('closeNotification()', 5000); - - notif.find ("a.close").click (function () { - closeNotification (); - return false; - }); - } -}); -- cgit v1.2.3