Active
Project:
Time Track
Version:
6.x-1.1-beta2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 May 2009 at 17:18 UTC
Updated:
12 Aug 2010 at 04:21 UTC
Base Drupal 6.11 install with only Time Tracker and Views 2 installed. Garland theme.
After including the file jquery.countdown.js, the timer on the node page (Time tracker block) displays the time for one second then changes to 'undefined' or sometimes alternates between 'undefined' and 'NaN'.
I'm not sure I have the correct jquery.countdown.js file. Here is the contents of the file that I have:
/**
* jQuery's Countdown Plugin
*
* display a countdown effect at given seconds, check out the following website for further information:
* http://heartstringz.net/blog/posts/show/jquery-countdown-plugin
*
* @author Felix Ding
* @version 0.1
* @copyright Copyright(c) 2008. Felix Ding
* @license http://www.opensource.org/licenses/bsd-license.php The BSD License
* @date 2008-03-09
* @lastmodified 2008-03-09 17:48
* @todo error & exceptions handling
*/
jQuery.fn.countdown = function(options) {
/**
* app init
*/
if(!options) options = '()';
if(jQuery(this).length == 0) return false;
var obj = this;
/**
* break out and execute callback (if any)
*/
if(options.seconds < 0 || options.seconds == 'undefined')
{
if(options.callback) eval(options.callback);
return null;
}
/**
* recursive countdown
*/
window.setTimeout(
function() {
jQuery(obj).html(String(options.seconds));
--options.seconds;
jQuery(obj).countdown(options);
}
, 1000
);
/**
* return null
*/
return this;
}
BrandTim
Comments
Comment #1
hunvreus commentedAre there anybody else experiencing the same issue ?
There is a known bug with the jQuery Countdown plug-in that makes countdowns not working when starting from 0, but then when starting from another number it should work fine. Except for that (I am working on it) I can't see other bugs, and can't reproduce your very issue BrandTim.
Comment #2
archnode commentedEdited: Is it coincidence that this module works with http://plugins.jquery.com/project/countdown2 ?
Comment #3
steveoliver commentedThis bug seems to have been fixed for me in the most recent version of the Time Track module.
Comment #4
hunvreus commented@Illithium : what do you mean coincidence? This is just a dependency... What is weird about that? :S
@steveoliver : happy to help, I still need to debug the views and the little bug on the count up when starting at 0.
@BrandTim : any feedback ?
Comment #5
marcus_clements commentedIn the README.txt it says :
But that plugin is just a file and not a zip
I think it should say http://plugins.jquery.com/project/countdown2 and that is the source of the confusion.
edit - When I start the time tracker on a given node for the first time, the numbers dont count up, although when I stop it, the total updates fine. Subsequent starts of the tracker it works fine.
Comment #6
hunvreus commentedThanks, I'll have it changed in the next version.
Regarding the bug, I am aware of that; that is what I meant when said "There is a known bug with the jQuery Countdown plug-in that makes countdowns not working when starting from 0, but then when starting from another number it should work fine. Except for that (I am working on it) I can't see other bugs, and can't reproduce your very issue BrandTim."
Comment #7
Christopher Herberte commentedjQuery Countdown2 http://keith-wood.name/countdown.html is GPLed, is there a reason not to include it in the project tarball?
Comment #8
BrandTim commented@hunvreus,
Sorry I didn't respond more quickly - I never received any emails from d.o that this thread had been updated.
The bug I was experiencing was caused because I was using the file at http://plugins.jquery.com/project/jquery-countdown rather than the ones at http://plugins.jquery.com/project/countdown2. Once I switched it started working correctly.
Thanks rayvaughn!
BrandTim
Comment #9
tpainton commentedHad the same problem. Countdown2 files solved it. Make sure you clear the cache in performance menu after you update the files otherwise, problem persists.
Comment #10
jziwenchen commentedhi, I am jackey.
You can go to http://plugins.jquery.com/project/countdown2 and download the jquery.countdown.package-1.5.2 (Why ? Because It can work in my project.. so...)
And upzip and copy the jquery.countdown.js to the place that the module readme.txt said.
Ok, now it can work well.
lucky!