Version Description
- Countdown timer milliseconds (new)
Download this release
Release Info
Developer | adamskaat |
Plugin | Countdown, Coming Soon – Countdown & Clock |
Version | 1.7.2 |
Comparing to | |
See all releases |
Code changes from version 1.7.1 to 1.7.2
- assets/css/timer.css +14 -0
- assets/js/ycdTimer.js +40 -3
- assets/views/timerMainView.php +11 -0
- classes/countdown/TimerCountdown.php +11 -2
- config/config.php +2 -2
- config/optionsConfig.php +1 -0
- countdown-builder.php +1 -1
- readme.txt +5 -1
assets/css/timer.css
CHANGED
@@ -24,4 +24,18 @@
|
|
24 |
.ycd-timmer-buttons {
|
25 |
margin-top: 10px;
|
26 |
text-align: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
}
|
24 |
.ycd-timmer-buttons {
|
25 |
margin-top: 10px;
|
26 |
text-align: center;
|
27 |
+
}
|
28 |
+
|
29 |
+
.ycd-timer-span-wrapper span.ycd-timer-number {
|
30 |
+
width: 92px;
|
31 |
+
display: inline-block;
|
32 |
+
}
|
33 |
+
|
34 |
+
.ycd-milliseconds-value {
|
35 |
+
display: inline-block;
|
36 |
+
width: 150px;
|
37 |
+
}
|
38 |
+
|
39 |
+
.ycd-hide {
|
40 |
+
display: none !important;
|
41 |
}
|
assets/js/ycdTimer.js
CHANGED
@@ -18,6 +18,7 @@ YcdTimer.prototype.init = function() {
|
|
18 |
this.setAlarm();
|
19 |
|
20 |
this.remainingTime = 0;
|
|
|
21 |
this.countdownHandle = 0;
|
22 |
|
23 |
this.stopTimer();
|
@@ -173,7 +174,7 @@ YcdTimer.prototype.startTimer = function() {
|
|
173 |
var that = this;
|
174 |
this.countdownHandle = setInterval(function() {
|
175 |
that.decrementTimer();
|
176 |
-
},
|
177 |
};
|
178 |
|
179 |
YcdTimer.prototype.stopTimer = function() {
|
@@ -253,6 +254,7 @@ YcdTimer.prototype.animateTime = function(remainingHours, remainingMinutes, rema
|
|
253 |
secondsValueTarget.animate({top: '-=1em'});
|
254 |
jQuery('.ycd-seconds-next-value-'+id).animate({top: '-=1em'});
|
255 |
}
|
|
|
256 |
};
|
257 |
|
258 |
|
@@ -269,14 +271,22 @@ YcdTimer.prototype.decrementTimer = function() {
|
|
269 |
}
|
270 |
|
271 |
if (!this.countdown) {
|
272 |
-
this.remainingTime += (1 *
|
273 |
}
|
274 |
else {
|
275 |
-
this.remainingTime -= (1 *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
}
|
277 |
|
278 |
|
279 |
if(this.remainingTime < 1000) {
|
|
|
280 |
this.endBehavior();
|
281 |
this.onStopTimer();
|
282 |
}
|
@@ -284,6 +294,15 @@ YcdTimer.prototype.decrementTimer = function() {
|
|
284 |
this.renderTimer();
|
285 |
};
|
286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
YcdTimer.prototype.livePreview = function() {
|
288 |
this.changeTime();
|
289 |
this.changeFontFamily();
|
@@ -293,6 +312,24 @@ YcdTimer.prototype.livePreview = function() {
|
|
293 |
this.imageUpload();
|
294 |
this.changeBackgroundImage();
|
295 |
this.changeAlignment();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
};
|
297 |
|
298 |
YcdTimer.prototype.changeAlignment = function() {
|
18 |
this.setAlarm();
|
19 |
|
20 |
this.remainingTime = 0;
|
21 |
+
this.miliseconds = 1000;
|
22 |
this.countdownHandle = 0;
|
23 |
|
24 |
this.stopTimer();
|
174 |
var that = this;
|
175 |
this.countdownHandle = setInterval(function() {
|
176 |
that.decrementTimer();
|
177 |
+
}, 100);
|
178 |
};
|
179 |
|
180 |
YcdTimer.prototype.stopTimer = function() {
|
254 |
secondsValueTarget.animate({top: '-=1em'});
|
255 |
jQuery('.ycd-seconds-next-value-'+id).animate({top: '-=1em'});
|
256 |
}
|
257 |
+
jQuery('.ycd-milliseconds-value-'+id).text(this.miliseconds)
|
258 |
};
|
259 |
|
260 |
|
271 |
}
|
272 |
|
273 |
if (!this.countdown) {
|
274 |
+
this.remainingTime += (1 * 100);
|
275 |
}
|
276 |
else {
|
277 |
+
this.remainingTime -= (1 * 100);
|
278 |
+
}
|
279 |
+
|
280 |
+
if (!this.miliseconds) {
|
281 |
+
this.miliseconds = 1000;
|
282 |
+
}
|
283 |
+
else {
|
284 |
+
this.miliseconds -= 100;
|
285 |
}
|
286 |
|
287 |
|
288 |
if(this.remainingTime < 1000) {
|
289 |
+
this.finalize();
|
290 |
this.endBehavior();
|
291 |
this.onStopTimer();
|
292 |
}
|
294 |
this.renderTimer();
|
295 |
};
|
296 |
|
297 |
+
YcdTimer.prototype.finalize = function () {
|
298 |
+
this.miliseconds = '000';
|
299 |
+
var id = this.getId();
|
300 |
+
var secondsNext = jQuery('.ycd-seconds-next-value-'+id);
|
301 |
+
secondsNext.text('00');
|
302 |
+
secondsNext.css('top', '0em');
|
303 |
+
|
304 |
+
};
|
305 |
+
|
306 |
YcdTimer.prototype.livePreview = function() {
|
307 |
this.changeTime();
|
308 |
this.changeFontFamily();
|
312 |
this.imageUpload();
|
313 |
this.changeBackgroundImage();
|
314 |
this.changeAlignment();
|
315 |
+
this.changeMilliseconds();
|
316 |
+
};
|
317 |
+
|
318 |
+
YcdTimer.prototype.changeMilliseconds = function () {
|
319 |
+
var millisecondsCheckbox = jQuery('#ycd-countdown-timer-milliseconds');
|
320 |
+
if (!millisecondsCheckbox.length) {
|
321 |
+
return false;
|
322 |
+
}
|
323 |
+
|
324 |
+
millisecondsCheckbox.bind('change', function () {
|
325 |
+
var milliseconds = jQuery('.ycd-milliseconds');
|
326 |
+
if (jQuery(this).is(':checked')) {
|
327 |
+
milliseconds.removeClass('ycd-hide');
|
328 |
+
}
|
329 |
+
else {
|
330 |
+
milliseconds.addClass('ycd-hide');
|
331 |
+
}
|
332 |
+
});
|
333 |
};
|
334 |
|
335 |
YcdTimer.prototype.changeAlignment = function() {
|
assets/views/timerMainView.php
CHANGED
@@ -28,6 +28,17 @@ $textFontFamily = $this->getOptionValue('ycd-text-font-family');
|
|
28 |
</div>
|
29 |
</div>
|
30 |
<div class="row form-group">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
<div class="col-md-6">
|
32 |
<label for="ycd-countdown-timer-button" class="ycd-label-of-switch"><?php _e('Enable Button', YCD_TEXT_DOMAIN); ?></label>
|
33 |
</div>
|
28 |
</div>
|
29 |
</div>
|
30 |
<div class="row form-group">
|
31 |
+
<div class="col-md-6">
|
32 |
+
<label for="ycd-countdown-timer-milliseconds" class="ycd-label-of-switch"><?php _e('Enable Milliseconds', YCD_TEXT_DOMAIN); ?></label>
|
33 |
+
</div>
|
34 |
+
<div class="col-md-6">
|
35 |
+
<label class="ycd-switch">
|
36 |
+
<input type="checkbox" id="ycd-countdown-timer-milliseconds" name="ycd-countdown-timer-milliseconds" <?php echo $this->getOptionValue('ycd-countdown-timer-milliseconds'); ?>>
|
37 |
+
<span class="ycd-slider ycd-round"></span>
|
38 |
+
</label>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
<div class="row form-group">
|
42 |
<div class="col-md-6">
|
43 |
<label for="ycd-countdown-timer-button" class="ycd-label-of-switch"><?php _e('Enable Button', YCD_TEXT_DOMAIN); ?></label>
|
44 |
</div>
|
classes/countdown/TimerCountdown.php
CHANGED
@@ -126,6 +126,12 @@ class TimerCountdown extends Countdown {
|
|
126 |
$options = $this->getTimerSettings();
|
127 |
$options = json_encode($options);
|
128 |
$timerButton = $this->getOptionValue('ycd-countdown-timer-button');
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
|
130 |
$startTitle = $this->getOptionValue('ycd-timer-button-start-title');
|
131 |
$stopTitle = $this->getOptionValue('ycd-timer-button-stop-title');
|
@@ -138,9 +144,12 @@ class TimerCountdown extends Countdown {
|
|
138 |
<div class="ycd-countdown-wrapper ycd-timer-content-wrapper-<?php echo esc_attr($id); ?>">
|
139 |
<div class="ycd-timer-time ycd-timer-container ycd-timer-wrapper-<?php echo esc_attr($id); ?>" data-options='<?php echo $options; ?>' data-id="<?php echo esc_attr($id); ?>">
|
140 |
<div class="timer-time-set ycd-timer-box" id="currentTime">
|
141 |
-
<
|
|
|
|
|
|
|
142 |
</div>
|
143 |
-
<div class="timer-time-set ycd-timer-box" id="nextTime">
|
144 |
<span id="ycdHoursNext"class="ycd-hours-next-value-<?php echo esc_attr($id); ?>">00</span><span>:</span><span id="ycdMinutesNext" class="ycd-minutes-next-value-<?php echo esc_attr($id); ?>">00</span><span>:</span><span id="ycdSecondsNext" class="ycd-seconds-next-value-<?php echo esc_attr($id); ?>">00</span>
|
145 |
</div>
|
146 |
</div>
|
126 |
$options = $this->getTimerSettings();
|
127 |
$options = json_encode($options);
|
128 |
$timerButton = $this->getOptionValue('ycd-countdown-timer-button');
|
129 |
+
$enableMilliseconds = $this->getOptionValue('ycd-countdown-timer-milliseconds');
|
130 |
+
|
131 |
+
$millisecondsClass = 'ycd-hide';
|
132 |
+
if (!empty($enableMilliseconds)) {
|
133 |
+
$millisecondsClass = '';
|
134 |
+
}
|
135 |
|
136 |
$startTitle = $this->getOptionValue('ycd-timer-button-start-title');
|
137 |
$stopTitle = $this->getOptionValue('ycd-timer-button-stop-title');
|
144 |
<div class="ycd-countdown-wrapper ycd-timer-content-wrapper-<?php echo esc_attr($id); ?>">
|
145 |
<div class="ycd-timer-time ycd-timer-container ycd-timer-wrapper-<?php echo esc_attr($id); ?>" data-options='<?php echo $options; ?>' data-id="<?php echo esc_attr($id); ?>">
|
146 |
<div class="timer-time-set ycd-timer-box" id="currentTime">
|
147 |
+
<div class="ycd-timer-span-wrapper">
|
148 |
+
<span id="ycdHoursValue" class="ycd-hours-value-<?php echo esc_attr($id); ?> ycd-timer-number">00</span><span>:</span><span id="ycdMinutesValue" class="ycd-minutes-value-<?php echo esc_attr($id); ?> ycd-timer-number">00</span><span>:</span><span id="ycdSecondsValue" class="ycd-seconds-value-<?php echo esc_attr($id); ?> ycd-timer-number">00</span><span class="ycd-milliseconds <?php echo $millisecondsClass; ?>">.</span><span class="ycd-milliseconds <?php echo $millisecondsClass; ?> ycd-milliseconds-value ycd-milliseconds-value-<?php echo esc_attr($id); ?>">000</span>
|
149 |
+
</div>
|
150 |
+
|
151 |
</div>
|
152 |
+
<div class="timer-time-set ycd-timer-box" id="nextTime" style="opacity: 0;">
|
153 |
<span id="ycdHoursNext"class="ycd-hours-next-value-<?php echo esc_attr($id); ?>">00</span><span>:</span><span id="ycdMinutesNext" class="ycd-minutes-next-value-<?php echo esc_attr($id); ?>">00</span><span>:</span><span id="ycdSecondsNext" class="ycd-seconds-next-value-<?php echo esc_attr($id); ?>">00</span>
|
154 |
</div>
|
155 |
</div>
|
config/config.php
CHANGED
@@ -66,8 +66,8 @@ class YcdCountdownConfig {
|
|
66 |
self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
|
67 |
self::addDefine('YCD_AJAX_SUCCESS', 1);
|
68 |
self::addDefine('YCD_TABLE_LIMIT', 15);
|
69 |
-
self::addDefine('YCD_VERSION_PRO', 1.
|
70 |
-
self::addDefine('YCD_VERSION', 1.
|
71 |
self::addDefine('YCD_FREE_VERSION', 1);
|
72 |
self::addDefine('YCD_SILVER_VERSION', 2);
|
73 |
self::addDefine('YCD_GOLD_VERSION', 3);
|
66 |
self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
|
67 |
self::addDefine('YCD_AJAX_SUCCESS', 1);
|
68 |
self::addDefine('YCD_TABLE_LIMIT', 15);
|
69 |
+
self::addDefine('YCD_VERSION_PRO', 1.58);
|
70 |
+
self::addDefine('YCD_VERSION', 1.72);
|
71 |
self::addDefine('YCD_FREE_VERSION', 1);
|
72 |
self::addDefine('YCD_SILVER_VERSION', 2);
|
73 |
self::addDefine('YCD_GOLD_VERSION', 3);
|
config/optionsConfig.php
CHANGED
@@ -235,6 +235,7 @@ class YcdCountdownOptionsConfig {
|
|
235 |
$options[] = array('name' => 'ycd-position-countdown', 'type' => 'text', 'defaultValue' => 'top_center');
|
236 |
$options[] = array('name' => 'ycd-countdown-clock-mode', 'type' => 'text', 'defaultValue' => 'clock');
|
237 |
$options[] = array('name' => 'ycd-countdown-timer-button', 'type' => 'checkbox', 'defaultValue' => '');
|
|
|
238 |
$options[] = array('name' => 'ycd-timer-auto-counting', 'type' => 'checkbox', 'defaultValue' => 'on');
|
239 |
$options[] = array('name' => 'ycd-timer-button-start-title', 'type' => 'text', 'defaultValue' => __('Start', YCD_TEXT_DOMAIN));
|
240 |
$options[] = array('name' => 'ycd-timer-button-stop-title', 'type' => 'text', 'defaultValue' => __('Stop', YCD_TEXT_DOMAIN));
|
235 |
$options[] = array('name' => 'ycd-position-countdown', 'type' => 'text', 'defaultValue' => 'top_center');
|
236 |
$options[] = array('name' => 'ycd-countdown-clock-mode', 'type' => 'text', 'defaultValue' => 'clock');
|
237 |
$options[] = array('name' => 'ycd-countdown-timer-button', 'type' => 'checkbox', 'defaultValue' => '');
|
238 |
+
$options[] = array('name' => 'ycd-countdown-timer-milliseconds', 'type' => 'checkbox', 'defaultValue' => '');
|
239 |
$options[] = array('name' => 'ycd-timer-auto-counting', 'type' => 'checkbox', 'defaultValue' => 'on');
|
240 |
$options[] = array('name' => 'ycd-timer-button-start-title', 'type' => 'text', 'defaultValue' => __('Start', YCD_TEXT_DOMAIN));
|
241 |
$options[] = array('name' => 'ycd-timer-button-stop-title', 'type' => 'text', 'defaultValue' => __('Stop', YCD_TEXT_DOMAIN));
|
countdown-builder.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Countdown builder
|
4 |
* Description: The best countdown plugin
|
5 |
-
* Version: 1.7.
|
6 |
* Author: Adam Skaat
|
7 |
* Author URI: https://edmonsoft.com/countdown
|
8 |
* License: GPLv2
|
2 |
/**
|
3 |
* Plugin Name: Countdown builder
|
4 |
* Description: The best countdown plugin
|
5 |
+
* Version: 1.7.2
|
6 |
* Author: Adam Skaat
|
7 |
* Author URI: https://edmonsoft.com/countdown
|
8 |
* License: GPLv2
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: adamskaat
|
|
3 |
Tags: countdown, timer, countdown timer
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 5.3.2
|
6 |
-
Stable tag: 1.7.
|
7 |
Requires PHP: 5.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
@@ -23,6 +23,7 @@ Countdown types
|
|
23 |
|
24 |
* Circle Countdown
|
25 |
* Digital
|
|
|
26 |
* Clock 1
|
27 |
* Clock 2
|
28 |
* Clock 3
|
@@ -64,6 +65,9 @@ Yes you can, we have Circle and Flipclock countdown popups.
|
|
64 |
You need to select the .zip file, there is no need to extract the zip file, just upload it.
|
65 |
|
66 |
== Changelog ==
|
|
|
|
|
|
|
67 |
= 1.7.1 =
|
68 |
* Add duration Days option (new)
|
69 |
* Schedule 2 (new)
|
3 |
Tags: countdown, timer, countdown timer
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 5.3.2
|
6 |
+
Stable tag: 1.7.2
|
7 |
Requires PHP: 5.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
23 |
|
24 |
* Circle Countdown
|
25 |
* Digital
|
26 |
+
* Timer
|
27 |
* Clock 1
|
28 |
* Clock 2
|
29 |
* Clock 3
|
65 |
You need to select the .zip file, there is no need to extract the zip file, just upload it.
|
66 |
|
67 |
== Changelog ==
|
68 |
+
= 1.7.2 =
|
69 |
+
* Countdown timer milliseconds (new)
|
70 |
+
|
71 |
= 1.7.1 =
|
72 |
* Add duration Days option (new)
|
73 |
* Schedule 2 (new)
|