front_idill/src/mosaic/js/notifications.js
changeset 85 b244a7bc0844
parent 79 9eff85166868
child 89 b6a115568b52
child 93 417d4b573bc8
--- a/front_idill/src/mosaic/js/notifications.js	Sat Aug 18 02:51:09 2012 +0200
+++ b/front_idill/src/mosaic/js/notifications.js	Wed Aug 29 11:19:27 2012 +0200
@@ -1929,4 +1929,123 @@
 Mosaic.prototype.removeSearchExitIcon = function()
 {
 	$('#searchExitIcon').remove();
+}
+
+/*
+ * Affiche l'icone des credits.
+ * Est appelé dans les fichiers :
+ * mosaic > fonction loadMosaic.
+ * zoomInteractions > fonctions zoom et unzoom.
+*/
+Mosaic.prototype.creditsIcon = function()
+{
+	this.removeCreditsIcon();
+	//On construit le div.
+	var creditsIcon = "<img id='creditsIcon' src='./img/creditsIcon.png' />";
+	//On l'ajoute.
+	$('body').append(creditsIcon);
+	//On spécifie ses coordonnées.
+	$('#creditsIcon').css(
+	{
+		top: $(window).height() - $('#creditsIcon').height() - 2 * parseInt($('#creditsIcon').css('margin-left')),
+		left: $(window).width() - $('#creditsIcon').width() - 2 * parseInt($('#creditsIcon').css('margin-left'))
+	});
+}
+
+/*
+ * Supprime l'icone des credits.
+ * Est appelé dans les fichiers :
+ * zoomInteractions > fonctions zoom et unzoom.
+ * notifications > fonction helpIcon.
+*/
+Mosaic.prototype.removeCreditsIcon = function()
+{
+	this.isCreditsIconZooming = false;
+	this.isCreditsIconZoomed = false;
+	$('#creditsIcon').remove();
+}
+
+/*
+ * Agrandit l'icone des credits.
+ * Est appelé dans le fichier :
+ * mosaic > fonction onMouseMove.
+*/
+Mosaic.prototype.showBigCredits = function()
+{
+	//Si on a déjà zoomé on quitte.
+	if(this.isCreditsIconZoomed || this.isCreditsIconZooming)
+	{
+		return;
+	}
+	
+	this.isCreditsIconZooming = true;
+	
+	var _this = this;
+	
+	$('#creditsIcon').animate(
+	{
+		width: 100,
+		height: 100,
+		top: $(window).height() - 100 - 2 * parseInt($('#creditsIcon').css('margin-left')),
+		left: $(window).width() - 100 - 2 * parseInt($('#creditsIcon').css('margin-left'))
+	}, this.config.timeShowBigCredits, function()
+	{
+		_this.isCreditsIconZoomed = true;
+		_this.isCreditsIconZooming = false;
+	});
+}
+
+/*
+ * Rétrecit l'icone des credits.
+ * Est appelé dans le fichier :
+ * mosaic > fonction onMouseMove.
+*/
+Mosaic.prototype.showSmallCredits = function()
+{
+	//Si on n'a pas zoomé on quitte.
+	if(!this.isCreditsIconZoomed || this.isCreditsIconZooming)
+	{
+		return;
+	}
+	
+	this.isCreditsIconZooming = true;
+	
+	var _this = this;
+	
+	var creditsIconWidth = $('#creditsIcon').width();
+	
+	$('#creditsIcon').animate(
+	{
+		width: 50,
+		height: 50,
+		top: $(window).height() - 50 - 2 * parseInt($('#creditsIcon').css('margin-left')),
+		left: $(window).width() - 50 - 2 * parseInt($('#creditsIcon').css('margin-left'))
+	}, this.config.timeShowBigCredits, function()
+	{
+		_this.isCreditsIconZoomed = false;
+		_this.isCreditsIconZooming = false;
+	});
+}
+
+/*
+ * Affiche les crédits.
+*/
+Mosaic.prototype.notifyCredits = function()
+{
+	if($('#notify_credits').length())
+	{
+		return;
+	}
+	
+	var credits = "<div id='notify_credits'></div>";
+	
+	$('body').append(credits);
+}
+
+/*
+ * Supprime les crédits.
+*/
+Mosaic.prototype.removeCredits = function()
+{
+	$('#notify_credits').remove();
 }
\ No newline at end of file