From dd06336a0dcf5d92507ea56a77fed8e2726acee5 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 19 Feb 2014 17:19:54 +0100 Subject: [PATCH] test messages --- js/main.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/js/main.js b/js/main.js index 17fadb67..c6eed95a 100644 --- a/js/main.js +++ b/js/main.js @@ -23,6 +23,9 @@ jQuery(document).ready(function($) { var news = []; var newsIndex = 0; + + var lastCompliment; + var compliment; (function checkVersion() { @@ -60,13 +63,19 @@ jQuery(document).ready(function($) { (function updateCompliment() { - var compliments = ['Hey, handsome!','Hi, sexy!','Hello, beauty!', 'You look sexy!', 'Wow, you look hot!']; - var i = Math.floor(Math.random()*compliments.length); - $('.compliment').updateWithText(compliments[i], 4000); + //var compliments = ['Hey, handsome!','Hi, sexy!','Hello, beauty!', 'You look sexy!', 'Wow, you look hot!']; + var compliments = ['Testing ...', 'Please wait ...']; + + while (compliment == lastCompliment) { + compliment = Math.floor(Math.random()*compliments.length); + } + $('.compliment').updateWithText(compliments[compliment], 4000); + + lastCompliment = compliment; setTimeout(function() { updateCompliment(); - }, 20000); + }, 5000); })(); (function updateWeather()