4
0
Эх сурвалжийг харах

Merge pull request #215 from Alkarex/notificationsMain

Fusionne notification.js dans main.js
Alexandre Alapetite 12 жил өмнө
parent
commit
7cf5e8ef33

+ 0 - 1
app/App_FrontController.php

@@ -65,7 +65,6 @@ class App_FrontController extends FrontController {
 		if ($this->conf->lazyload () === 'yes') {
 		if ($this->conf->lazyload () === 'yes') {
 			View::appendScript (Url::display ('/scripts/jquery.lazyload.min.js'));
 			View::appendScript (Url::display ('/scripts/jquery.lazyload.min.js'));
 		}
 		}
-		View::appendScript (Url::display ('/scripts/notification.js'));
 	}
 	}
 
 
 	private function loadNotifications () {
 	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 () {
 $(function () {
 	if (is_reader_mode()) {
 	if (is_reader_mode()) {
 		hide_posts = false;
 		hide_posts = false;
@@ -463,5 +481,6 @@ $(function () {
 	init_stream_delegates($('#stream'));
 	init_stream_delegates($('#stream'));
 	init_nav_entries();
 	init_nav_entries();
 	init_templates();
 	init_templates();
+	init_notifications();
 	init_actualize();
 	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;
-		});
-	}
-});