Countdown, Coming Soon – Countdown & Clock - Version 2.0.3

Version Description

  • Simple countdown double digits
Download this release

Release Info

Developer adamskaat
Plugin Icon 128x128 Countdown, Coming Soon – Countdown & Clock
Version 2.0.3
Comparing to
See all releases

Code changes from version 2.0.2 to 2.0.3

assets/js/YcdSimpleCountdown.js CHANGED
@@ -1,6 +1,7 @@
1
  function YcdSimpleCountdown()
2
  {
3
  this.seconds = 0;
 
4
  this.countdownContainer = jQuery('.ycd-simple-container');
5
  }
6
 
@@ -27,6 +28,8 @@ YcdSimpleCountdown.run = function()
27
 
28
  YcdSimpleCountdown.prototype.init = function()
29
  {
 
 
30
  this.render();
31
  this.livePreview();
32
  };
@@ -178,6 +181,7 @@ YcdSimpleCountdown.prototype.livePreview = function()
178
  this.changeFontSizes();
179
  this.changeFontFamily();
180
  this.changeColor();
 
181
  };
182
 
183
  YcdSimpleCountdown.prototype.changeText = function()
@@ -190,6 +194,17 @@ YcdSimpleCountdown.prototype.changeText = function()
190
  });
191
  };
192
 
 
 
 
 
 
 
 
 
 
 
 
193
  YcdSimpleCountdown.prototype.changeSwitch = function()
194
  {
195
  var status = jQuery('.js-ycd-time-status');
@@ -197,9 +212,7 @@ YcdSimpleCountdown.prototype.changeSwitch = function()
197
  if (!status.length) {
198
  return false;
199
  }
200
- var hasVisibleElement = function (element) {
201
 
202
- };
203
  status.bind('change', function () {
204
  var currentStatus = jQuery(this).is(':checked');
205
  var type = jQuery(this).data('time-type');
@@ -246,7 +259,11 @@ YcdSimpleCountdown.prototype.countdown = function()
246
  for (var i in unites) {
247
  var unite = unites[i];
248
  var selector = '.ycd-simple-countdown-'+unite+'-time';
249
- jQuery(selector).text(unitesValues[unite]);
 
 
 
 
250
  }
251
 
252
  // If the count down is finished, write some text
1
  function YcdSimpleCountdown()
2
  {
3
  this.seconds = 0;
4
+ this.doubeleDigits = false;
5
  this.countdownContainer = jQuery('.ycd-simple-container');
6
  }
7
 
28
 
29
  YcdSimpleCountdown.prototype.init = function()
30
  {
31
+ this.doubeleDigits = this.options['ycd-enable-simple-double-digits'];
32
+
33
  this.render();
34
  this.livePreview();
35
  };
181
  this.changeFontSizes();
182
  this.changeFontFamily();
183
  this.changeColor();
184
+ this.changeDoubeleDigits();
185
  };
186
 
187
  YcdSimpleCountdown.prototype.changeText = function()
194
  });
195
  };
196
 
197
+ YcdSimpleCountdown.prototype.changeDoubeleDigits = function()
198
+ {
199
+ var texts = jQuery('#enable-double-digits');
200
+ var that = this;
201
+
202
+ texts.bind('change', function () {
203
+ var status = jQuery(this).is(':checked');
204
+ that.doubeleDigits = status;
205
+ });
206
+ };
207
+
208
  YcdSimpleCountdown.prototype.changeSwitch = function()
209
  {
210
  var status = jQuery('.js-ycd-time-status');
212
  if (!status.length) {
213
  return false;
214
  }
 
215
 
 
216
  status.bind('change', function () {
217
  var currentStatus = jQuery(this).is(':checked');
218
  var type = jQuery(this).data('time-type');
259
  for (var i in unites) {
260
  var unite = unites[i];
261
  var selector = '.ycd-simple-countdown-'+unite+'-time';
262
+ var currentUniteValue = unitesValues[unite];
263
+ if (currentUniteValue < 10 && that.doubeleDigits) {
264
+ currentUniteValue = "0" +currentUniteValue;
265
+ }
266
+ jQuery(selector).text(currentUniteValue);
267
  }
268
 
269
  // If the count down is finished, write some text
assets/views/main/simpleMainView.php CHANGED
@@ -207,6 +207,26 @@ $defaultData = AdminHelper::defaultData();
207
  <!-- Text Styles end -->
208
  </div>
209
  <!-- Styles end -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  <?php
211
  require_once YCD_VIEWS_PATH.'preview.php';
212
  ?>
207
  <!-- Text Styles end -->
208
  </div>
209
  <!-- Styles end -->
210
+ <div class="row form-group">
211
+ <div class="col-md-6">
212
+ <label class="ycd-label-of-switch"><?php _e('Settings', YCD_TEXT_DOMAIN); ?></label>
213
+ </div>
214
+ <div class="col-md-6">
215
+ </div>
216
+ </div>
217
+ <div class="ycd-sub-option-wrapper">
218
+ <div class="row form-group">
219
+ <div class="col-md-6">
220
+ <label class="ycd-label-of-switch" for="enable-double-digits"><?php _e('Double Digits', YCD_TEXT_DOMAIN); ?></label>
221
+ </div>
222
+ <div class="col-md-6">
223
+ <label class="ycd-switch">
224
+ <input type="checkbox" id="enable-double-digits" data-time-type="hours" name="ycd-enable-simple-double-digits" class="ycd-accordion-checkbox" <?php echo $typeObj->getOptionValue('ycd-enable-simple-double-digits'); ?>>
225
+ <span class="ycd-slider ycd-round"></span>
226
+ </label>
227
+ </div>
228
+ </div>
229
+ </div>
230
  <?php
231
  require_once YCD_VIEWS_PATH.'preview.php';
232
  ?>
classes/countdown/SimpleCountdown.php CHANGED
@@ -156,6 +156,7 @@ class SimpleCountdown extends Countdown
156
  private function getAllOptions()
157
  {
158
  $options = array();
 
159
  $allDataOptions = $this->getDataAllOptions();
160
  $generalOptionsData = $this->generalOptionsData();
161
  $unites = $this->getTimeUnites();
@@ -169,6 +170,10 @@ class SimpleCountdown extends Countdown
169
  $options += $allDataOptions;
170
  $options += $generalOptionsData;
171
 
 
 
 
 
172
  return $options;
173
  }
174
 
156
  private function getAllOptions()
157
  {
158
  $options = array();
159
+ $optionNames = array('ycd-enable-simple-double-digits');
160
  $allDataOptions = $this->getDataAllOptions();
161
  $generalOptionsData = $this->generalOptionsData();
162
  $unites = $this->getTimeUnites();
170
  $options += $allDataOptions;
171
  $options += $generalOptionsData;
172
 
173
+ foreach ($optionNames as $optionName) {
174
+ $options[$optionName] = $this->getOptionValue($optionName);
175
+ }
176
+
177
  return $options;
178
  }
179
 
config/config.php CHANGED
@@ -74,8 +74,8 @@ class YcdCountdownConfig
74
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
75
  self::addDefine('YCD_AJAX_SUCCESS', 1);
76
  self::addDefine('YCD_TABLE_LIMIT', 15);
77
- self::addDefine('YCD_VERSION_PRO', 1.87);
78
- self::addDefine('YCD_VERSION', 2.01);
79
  self::addDefine('YCD_FREE_VERSION', 1);
80
  self::addDefine('YCD_SILVER_VERSION', 2);
81
  self::addDefine('YCD_GOLD_VERSION', 3);
74
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
75
  self::addDefine('YCD_AJAX_SUCCESS', 1);
76
  self::addDefine('YCD_TABLE_LIMIT', 15);
77
+ self::addDefine('YCD_VERSION_PRO', 1.90);
78
+ self::addDefine('YCD_VERSION', 2.03);
79
  self::addDefine('YCD_FREE_VERSION', 1);
80
  self::addDefine('YCD_SILVER_VERSION', 2);
81
  self::addDefine('YCD_GOLD_VERSION', 3);
config/optionsConfig.php CHANGED
@@ -336,6 +336,7 @@ class YcdCountdownOptionsConfig
336
  $options[] = array('name' => 'ycd-simple-minutes-text', 'type' => 'text', 'defaultValue' => __('Mins', YCD_TEXT_DOMAIN));
337
  $options[] = array('name' => 'ycd-simple-enable-seconds', 'type' => 'checkbox', 'defaultValue' => 'on');
338
  $options[] = array('name' => 'ycd-simple-seconds-text', 'type' => 'text', 'defaultValue' => __('Secs', YCD_TEXT_DOMAIN));
 
339
 
340
  $options[] = array('name' => 'ycd-simple-numbers-font-size', 'type' => 'text', 'defaultValue' => __('35px', YCD_TEXT_DOMAIN));
341
  $options[] = array('name' => 'ycd-simple-text-font-size', 'type' => 'text', 'defaultValue' => __('12px', YCD_TEXT_DOMAIN));
336
  $options[] = array('name' => 'ycd-simple-minutes-text', 'type' => 'text', 'defaultValue' => __('Mins', YCD_TEXT_DOMAIN));
337
  $options[] = array('name' => 'ycd-simple-enable-seconds', 'type' => 'checkbox', 'defaultValue' => 'on');
338
  $options[] = array('name' => 'ycd-simple-seconds-text', 'type' => 'text', 'defaultValue' => __('Secs', YCD_TEXT_DOMAIN));
339
+ $options[] = array('name' => 'ycd-enable-simple-double-digits', 'type' => 'checkbox', 'defaultValue' => 'on');
340
 
341
  $options[] = array('name' => 'ycd-simple-numbers-font-size', 'type' => 'text', 'defaultValue' => __('35px', YCD_TEXT_DOMAIN));
342
  $options[] = array('name' => 'ycd-simple-text-font-size', 'type' => 'text', 'defaultValue' => __('12px', YCD_TEXT_DOMAIN));
countdown-builder.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Countdown builder
4
  * Description: The best countdown plugin by Adam skaat
5
- * Version: 2.0.2
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 by Adam skaat
5
+ * Version: 2.0.3
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.7
6
- Stable tag: 2.0.2
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -67,6 +67,9 @@ Yes you can, we have Circle and Flipclock countdown popups.
67
  You need to select the .zip file, there is no need to extract the zip file, just upload it.
68
 
69
  == Changelog ==
 
 
 
70
  = 2.0.2 =
71
  * Simple countdown live preview labels on/off issue fixed
72
  * Code improvement related to WordPress 5.7
3
  Tags: countdown, timer, countdown timer
4
  Requires at least: 3.8
5
  Tested up to: 5.7
6
+ Stable tag: 2.0.3
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
67
  You need to select the .zip file, there is no need to extract the zip file, just upload it.
68
 
69
  == Changelog ==
70
+ = 2.0.3 =
71
+ * Simple countdown double digits
72
+
73
  = 2.0.2 =
74
  * Simple countdown live preview labels on/off issue fixed
75
  * Code improvement related to WordPress 5.7