Просмотр исходного кода

Merge pull request #215 from Alkarex/notificationsMain

Fusionne notification.js dans main.js
Alexandre Alapetite 12 лет назад
Родитель
Сommit
7cf5e8ef33
3 измененных файлов с 19 добавлено и 18 удалено
  1. 0 1
      app/App_FrontController.php
  2. 19 0
      public/scripts/main.js
  3. 0 17
      public/scripts/notification.js

+ 0 - 1
app/App_FrontController.php

@@ -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 () {

+ 19 - 0
public/scripts/main.js

@@ -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();
 });

+ 0 - 17
public/scripts/notification.js

@@ -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;
-		});
-	}
-});