T(-) Countdown - Version 2.2.6

Version Description

  • Fixed issue with flashing animations on inactive tabs (again)
Download this release

Release Info

Developer baden03
Plugin Icon 128x128 T(-) Countdown
Version 2.2.6
Comparing to
See all releases

Code changes from version 2.2.5 to 2.2.6

countdown-timer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: T(-) Countdown
4
  Plugin URI: http://plugins.twinpictures.de/plugins/t-minus-countdown/
5
  Description: Display and configure multiple T(-) Countdown timers using a shortcode or sidebar widget.
6
- Version: 2.2.5
7
  Author: twinpictures, baden03
8
  Author URI: http://www.twinpictures.de/
9
  License: GPL2
@@ -32,7 +32,7 @@ function countdown_scripts(){
32
  //delete the old style system
33
  delete_option( 't-minus_styles' );
34
  //add version check
35
- add_option('t-minus_version', '2.2.4');
36
  }
37
 
38
  $styles_arr = array("TIE-fighter","c-3po","c-3po-mini","carbonite","carbonlite","darth","jedi");
@@ -57,7 +57,8 @@ function countdown_scripts(){
57
  }
58
  else{
59
  //lwtCountdown script
60
- wp_register_script('countdown-script', $plugin_url.'/js/jquery.t-countdown.min.js', array ('jquery'), '1.1' );
 
61
  wp_enqueue_script('countdown-script');
62
 
63
  //register all countdown styles for enqueue-as-needed
@@ -69,6 +70,14 @@ function countdown_scripts(){
69
  }
70
  add_action( 'init', 'countdown_scripts' );
71
 
 
 
 
 
 
 
 
 
72
  //style folders array
73
  function folder_array($path, $exclude = ".|..") {
74
  if(is_dir($path)){
3
  Plugin Name: T(-) Countdown
4
  Plugin URI: http://plugins.twinpictures.de/plugins/t-minus-countdown/
5
  Description: Display and configure multiple T(-) Countdown timers using a shortcode or sidebar widget.
6
+ Version: 2.2.6
7
  Author: twinpictures, baden03
8
  Author URI: http://www.twinpictures.de/
9
  License: GPL2
32
  //delete the old style system
33
  delete_option( 't-minus_styles' );
34
  //add version check
35
+ add_option('t-minus_version', '2.2.6');
36
  }
37
 
38
  $styles_arr = array("TIE-fighter","c-3po","c-3po-mini","carbonite","carbonlite","darth","jedi");
57
  }
58
  else{
59
  //lwtCountdown script
60
+ //wp_register_script('countdown-script', $plugin_url.'/js/jquery.t-countdown.js', array ('jquery'), '1.2' );
61
+ wp_register_script('countdown-script', $plugin_url.'/js/jquery.t-countdown.min.js', array ('jquery'), '1.2' );
62
  wp_enqueue_script('countdown-script');
63
 
64
  //register all countdown styles for enqueue-as-needed
70
  }
71
  add_action( 'init', 'countdown_scripts' );
72
 
73
+ //set the locaiton to throbber in a var
74
+ /*
75
+ function throbber_location() {
76
+ echo '<script type="text/javascript"> var throbber_url = "'.plugins_url() .'/'. dirname( plugin_basename(__FILE__) ).'/js/throbber.js"; </script>';
77
+ }
78
+ add_action('wp_head', 'throbber_location');
79
+ */
80
+
81
  //style folders array
82
  function folder_array($path, $exclude = ".|..") {
83
  if(is_dir($path)){
js/{jquery.t-countdown-1.0.js → jquery.t-countdown.js} RENAMED
@@ -1,5 +1,5 @@
1
  /*!
2
- * T- Countdown v1.1
3
  * http://plugins.twinpictures.de/plugins/t-minus-countdown/
4
  *
5
  * Copyright 2012, Twinpictures
@@ -124,8 +124,19 @@
124
  before = new Date();
125
  $.data($this[0], 'before', before);
126
  e = $this;
127
- t = setTimeout(function() { e.doCountDown(id, diffSecs-a) } , 1000);
128
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  }
130
  }
131
  else if (cb = $.data($this[0], 'callback')){
@@ -153,9 +164,9 @@
153
  }
154
  if ($(digit + ' div.top').html() != n + ''){
155
  $(digit + ' div.top').css({'display': 'none'});
156
- $(digit + ' div.top').html((n ? n : '0')).slideDown(duration);
157
 
158
- $(digit + ' div.bottom').animate({'height': ''}, duration, function() {
159
  $(digit + ' div.bottom').html($(digit + ' div.top').html());
160
  $(digit + ' div.bottom').css({'display': 'block', 'height': ''});
161
  $(digit + ' div.top').hide().slideUp(10);
1
  /*!
2
+ * T- Countdown v1.2
3
  * http://plugins.twinpictures.de/plugins/t-minus-countdown/
4
  *
5
  * Copyright 2012, Twinpictures
124
  before = new Date();
125
  $.data($this[0], 'before', before);
126
  e = $this;
 
127
 
128
+ //if(typeof(Worker)!=="undefined"){
129
+ // Yes! Web worker support!
130
+ //console.log(throbber_url);
131
+ //if(typeof(w)=="undefined"){
132
+ //w = new Worker(throbber_url);
133
+ //}
134
+ //w.onmessage = function( event ) { e.doCountDown(id, diffSecs-a) };
135
+ //}
136
+ //else{
137
+ // Sorry! No Web Worker support..
138
+ t = setTimeout(function() { e.doCountDown(id, diffSecs-a) } , 1000);
139
+ //}
140
  }
141
  }
142
  else if (cb = $.data($this[0], 'callback')){
164
  }
165
  if ($(digit + ' div.top').html() != n + ''){
166
  $(digit + ' div.top').css({'display': 'none'});
167
+ $(digit + ' div.top').html((n ? n : '0')).stop(true, true).slideDown(duration);
168
 
169
+ $(digit + ' div.bottom').stop(true, true).animate({'height': ''}, duration, function() {
170
  $(digit + ' div.bottom').html($(digit + ' div.top').html());
171
  $(digit + ' div.bottom').css({'display': 'block', 'height': ''});
172
  $(digit + ' div.top').hide().slideUp(10);
js/jquery.t-countdown.min.js CHANGED
@@ -1 +1 @@
1
- (function($){$.fn.countDown=function(options){config={};$.extend(config,options);diffSecs=this.setCountDown(config);before=new Date();$.data($(this)[0],'before',before);$.data($(this)[0],'status','play');style=config.style;$.data($(this)[0],'style',config.style);if(config.launchtarget){$.data($(this)[0],'launchtarget',config.launchtarget)}if(config.onComplete){$.data($(this)[0],'callback',config.onComplete)}if(config.hangtime){$.data($(this)[0],'hangtime',config.hangtime)}if(config.omitWeeks){$.data($(this)[0],'omitWeeks',config.omitWeeks)}$('#'+$(this).attr('id')+' .'+style+'-digit').html('<div class="top"></div><div class="bottom"></div>');$(this).doCountDown($(this).attr('id'),diffSecs,500);return this};$.fn.stopCountDown=function(){$.data(this[0],'status','stop')};$.fn.startCountDown=function(){$.data(this[0],'status','play');this.doCountDown($(this).attr('id'),$.data(this[0],'diffSecs'),500)};$.fn.setCountDown=function(options){var targetTime=new Date();if(options.targetDate){targetTime=new Date(options.targetDate.month+'/'+options.targetDate.day+'/'+options.targetDate.year+' '+options.targetDate.hour+':'+options.targetDate.min+':'+options.targetDate.sec+(options.targetDate.utc?' UTC':''))}else if(options.targetOffset){targetTime.setFullYear(options.targetOffset.year+targetTime.getFullYear());targetTime.setMonth(options.targetOffset.month+targetTime.getMonth());targetTime.setDate(options.targetOffset.day+targetTime.getDate());targetTime.setHours(options.targetOffset.hour+targetTime.getHours());targetTime.setMinutes(options.targetOffset.min+targetTime.getMinutes());targetTime.setSeconds(options.targetOffset.sec+targetTime.getSeconds())}var nowTime=new Date(options.targetDate.localtime);diffSecs=Math.floor((targetTime.valueOf()-nowTime.valueOf())/1000);$.data(this[0],'diffSecs',diffSecs);return diffSecs};$.fn.doCountDown=function(id,diffSecs,duration){$this=$('#'+id);if(diffSecs<=0){if($.data($this[0],'launchtarget')!='countup'){diffSecs=0;$.data($this[0],'status','stop')}}secs=Math.abs(diffSecs%60);mins=Math.floor(Math.abs(diffSecs/60)%60);hours=Math.floor(Math.abs(diffSecs/60/60)%24);if($.data($this[0],'omitWeeks')==true){days=Math.floor(Math.abs(diffSecs/60/60/24));weeks=Math.floor(Math.abs(diffSecs/60/60/24/7))}else{days=Math.floor(Math.abs(diffSecs/60/60/24)%7);weeks=Math.floor(Math.abs(diffSecs/60/60/24/7))}style=$.data($this[0],'style');$this.dashChangeTo(id,style+'-seconds_dash',secs,duration?duration:500);$this.dashChangeTo(id,style+'-minutes_dash',mins,duration?duration:1000);$this.dashChangeTo(id,style+'-hours_dash',hours,duration?duration:1000);$this.dashChangeTo(id,style+'-days_dash',days,duration?duration:1000);$this.dashChangeTo(id,style+'-days_trip_dash',days,duration?duration:1000);$this.dashChangeTo(id,style+'-weeks_dash',weeks,duration?duration:1000);$this.dashChangeTo(id,style+'-weeks_trip_dash',weeks,duration?duration:1000);$.data($this[0],'diffSecs',diffSecs);if(diffSecs>0||$.data($this[0],'launchtarget')=='countup'){if($.data($this[0],'status')=='play'){a=0;delay=1000;now=new Date();before=$.data($this[0],'before');elapsedTime=(now.getTime()-before.getTime());if(elapsedTime>=delay+1000){a+=Math.floor(1*(elapsedTime/delay))}else{a=1}before=new Date();$.data($this[0],'before',before);e=$this;t=setTimeout(function(){e.doCountDown(id,diffSecs-a)},1000)}}else if(cb=$.data($this[0],'callback')){if($.data($this[0],'hangtime')){}$.data($this[0],'callback')()}};$.fn.dashChangeTo=function(id,dash,n,duration){$this=$('#'+id);style=$.data($this[0],'style');for(var i=($this.find('.'+dash+' .'+style+'-digit').length-1);i>=0;i--){var d=n%10;n=(n-d)/10;$this.digitChangeTo('#'+$this.attr('id')+' .'+dash+' .'+style+'-digit:eq('+i+')',d,duration)}};$.fn.digitChangeTo=function(digit,n,duration){if(!duration){duration=500}if($(digit+' div.top').html()!=n+''){$(digit+' div.top').css({'display':'none'});$(digit+' div.top').html((n?n:'0')).slideDown(duration);$(digit+' div.bottom').animate({'height':''},duration,function(){$(digit+' div.bottom').html($(digit+' div.top').html());$(digit+' div.bottom').css({'display':'block','height':''});$(digit+' div.top').hide().slideUp(10)})}}})(jQuery);
1
+ (function($){$.fn.countDown=function(options){config={};$.extend(config,options);diffSecs=this.setCountDown(config);before=new Date();$.data($(this)[0],'before',before);$.data($(this)[0],'status','play');style=config.style;$.data($(this)[0],'style',config.style);if(config.launchtarget){$.data($(this)[0],'launchtarget',config.launchtarget)}if(config.onComplete){$.data($(this)[0],'callback',config.onComplete)}if(config.hangtime){$.data($(this)[0],'hangtime',config.hangtime)}if(config.omitWeeks){$.data($(this)[0],'omitWeeks',config.omitWeeks)}$('#'+$(this).attr('id')+' .'+style+'-digit').html('<div class="top"></div><div class="bottom"></div>');$(this).doCountDown($(this).attr('id'),diffSecs,500);return this};$.fn.stopCountDown=function(){$.data(this[0],'status','stop')};$.fn.startCountDown=function(){$.data(this[0],'status','play');this.doCountDown($(this).attr('id'),$.data(this[0],'diffSecs'),500)};$.fn.setCountDown=function(options){var targetTime=new Date();if(options.targetDate){targetTime=new Date(options.targetDate.month+'/'+options.targetDate.day+'/'+options.targetDate.year+' '+options.targetDate.hour+':'+options.targetDate.min+':'+options.targetDate.sec+(options.targetDate.utc?' UTC':''))}else if(options.targetOffset){targetTime.setFullYear(options.targetOffset.year+targetTime.getFullYear());targetTime.setMonth(options.targetOffset.month+targetTime.getMonth());targetTime.setDate(options.targetOffset.day+targetTime.getDate());targetTime.setHours(options.targetOffset.hour+targetTime.getHours());targetTime.setMinutes(options.targetOffset.min+targetTime.getMinutes());targetTime.setSeconds(options.targetOffset.sec+targetTime.getSeconds())}var nowTime=new Date(options.targetDate.localtime);diffSecs=Math.floor((targetTime.valueOf()-nowTime.valueOf())/1000);$.data(this[0],'diffSecs',diffSecs);return diffSecs};$.fn.doCountDown=function(id,diffSecs,duration){$this=$('#'+id);if(diffSecs<=0){if($.data($this[0],'launchtarget')!='countup'){diffSecs=0;$.data($this[0],'status','stop')}}secs=Math.abs(diffSecs%60);mins=Math.floor(Math.abs(diffSecs/60)%60);hours=Math.floor(Math.abs(diffSecs/60/60)%24);if($.data($this[0],'omitWeeks')==true){days=Math.floor(Math.abs(diffSecs/60/60/24));weeks=Math.floor(Math.abs(diffSecs/60/60/24/7))}else{days=Math.floor(Math.abs(diffSecs/60/60/24)%7);weeks=Math.floor(Math.abs(diffSecs/60/60/24/7))}style=$.data($this[0],'style');$this.dashChangeTo(id,style+'-seconds_dash',secs,duration?duration:500);$this.dashChangeTo(id,style+'-minutes_dash',mins,duration?duration:1000);$this.dashChangeTo(id,style+'-hours_dash',hours,duration?duration:1000);$this.dashChangeTo(id,style+'-days_dash',days,duration?duration:1000);$this.dashChangeTo(id,style+'-days_trip_dash',days,duration?duration:1000);$this.dashChangeTo(id,style+'-weeks_dash',weeks,duration?duration:1000);$this.dashChangeTo(id,style+'-weeks_trip_dash',weeks,duration?duration:1000);$.data($this[0],'diffSecs',diffSecs);if(diffSecs>0||$.data($this[0],'launchtarget')=='countup'){if($.data($this[0],'status')=='play'){a=0;delay=1000;now=new Date();before=$.data($this[0],'before');elapsedTime=(now.getTime()-before.getTime());if(elapsedTime>=delay+1000){a+=Math.floor(1*(elapsedTime/delay))}else{a=1}before=new Date();$.data($this[0],'before',before);e=$this;t=setTimeout(function(){e.doCountDown(id,diffSecs-a)},1000)}}else if(cb=$.data($this[0],'callback')){if($.data($this[0],'hangtime')){}$.data($this[0],'callback')()}};$.fn.dashChangeTo=function(id,dash,n,duration){$this=$('#'+id);style=$.data($this[0],'style');for(var i=($this.find('.'+dash+' .'+style+'-digit').length-1);i>=0;i--){var d=n%10;n=(n-d)/10;$this.digitChangeTo('#'+$this.attr('id')+' .'+dash+' .'+style+'-digit:eq('+i+')',d,duration)}};$.fn.digitChangeTo=function(digit,n,duration){if(!duration){duration=500}if($(digit+' div.top').html()!=n+''){$(digit+' div.top').css({'display':'none'});$(digit+' div.top').html((n?n:'0')).stop(true,true).slideDown(duration);$(digit+' div.bottom').stop(true,true).animate({'height':''},duration,function(){$(digit+' div.bottom').html($(digit+' div.top').html());$(digit+' div.bottom').css({'display':'block','height':''});$(digit+' div.top').hide().slideUp(10)})}}})(jQuery);
js/throbber.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ //this file currently not used
2
+ var i=0;
3
+ function throbber(){
4
+ i=i+1;
5
+ postMessage(i);
6
+ setTimeout("throbber()",1000);
7
+ }
8
+
9
+ throbber();
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: http://plugins.twinpictures.de/plugins/t-minus-countdown/
5
  Tags: countdown, timer, clock, ticker, widget, event, counter, count down, t minus, t-minus, twinpictures, plguin-oven, pluginoven, G2, spaceBros, littlewebtings, jQuery, javascript
6
  Requires at least: 3.3
7
  Tested up to: 3.4.2
8
- Stable tag: 2.2.5
9
 
10
  T(-) Countdown will display a highly customizable, sweet-n-sexy flash-free countdown timer in a sidebar, page or post.
11
 
@@ -54,6 +54,9 @@ Ah yes! <a href='http://twitter.com/#!/twinpictures'>@Twinpictures</a> is on the
54
 
55
  == Changelog ==
56
 
 
 
 
57
  = 2.2.5 =
58
  * Bug fix: missing single quote on launchtarget.
59
 
@@ -146,6 +149,9 @@ Ah yes! <a href='http://twitter.com/#!/twinpictures'>@Twinpictures</a> is on the
146
 
147
  == Upgrade Notice ==
148
 
 
 
 
149
  = 2.2.5 =
150
  * Fixed missing single quote that was causing JS error.
151
 
5
  Tags: countdown, timer, clock, ticker, widget, event, counter, count down, t minus, t-minus, twinpictures, plguin-oven, pluginoven, G2, spaceBros, littlewebtings, jQuery, javascript
6
  Requires at least: 3.3
7
  Tested up to: 3.4.2
8
+ Stable tag: 2.2.6
9
 
10
  T(-) Countdown will display a highly customizable, sweet-n-sexy flash-free countdown timer in a sidebar, page or post.
11
 
54
 
55
  == Changelog ==
56
 
57
+ = 2.2.6 =
58
+ * Fixed issue with flashing animations on inactive tabs (again)
59
+
60
  = 2.2.5 =
61
  * Bug fix: missing single quote on launchtarget.
62
 
149
 
150
  == Upgrade Notice ==
151
 
152
+ = 2.2.6 =
153
+ * Animations remain smooth for inactive tabs.
154
+
155
  = 2.2.5 =
156
  * Fixed missing single quote that was causing JS error.
157