Merge pull request #215 from Alkarex/notificationsMain

Fusionne notification.js dans main.js
pull/322/head
Alexandre Alapetite 11 years ago
commit 7cf5e8ef33
  1. 1
      app/App_FrontController.php
  2. 19
      public/scripts/main.js
  3. 17
      public/scripts/notification.js

@ -65,7 +65,6 @@ class App_FrontController extends FrontController {
if ($this->conf->lazyload () === 'yes') {
View::appendScript (Url::display ('/scripts/jquery.lazyload.min.js'));
}
View::appendScript (Url::display ('/scripts/notification.js'));
}
private function loadNotifications () {

@ -453,6 +453,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;
@ -463,5 +481,6 @@ $(function () {
init_stream_delegates($('#stream'));
init_nav_entries();
init_templates();
init_notifications();
init_actualize();
});

@ -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;
});
}
});
Loading…
Cancel
Save