Countdown, Coming Soon – Countdown & Clock - Version 1.9.2

Version Description

  • Added possibility close Sticky Countdown
  • Added possibility to change Sticky Countdown close text
  • Admin side type sections improvement
Download this release

Release Info

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

Code changes from version 1.9.1 to 1.9.2

assets/css/admin.css CHANGED
@@ -179,12 +179,24 @@
179
  height: 50px;
180
  width: 100%;
181
  bottom: 0px;
 
 
 
182
  }
183
 
184
  .ycd-promotion-video {
185
  display: inline-block;
186
- margin-top: 13px;
187
  margin-left: 9px;
 
 
 
 
 
 
 
 
 
 
188
  }
189
 
190
  .ycd-play-promotion-video {
179
  height: 50px;
180
  width: 100%;
181
  bottom: 0px;
182
+ font-size: 15px;
183
+ padding-top: 11px;
184
+ box-sizing: border-box;
185
  }
186
 
187
  .ycd-promotion-video {
188
  display: inline-block;
 
189
  margin-left: 9px;
190
+ vertical-align: middle;
191
+ color: black;
192
+ }
193
+
194
+ .ycd-types-wrapper {
195
+ padding-left: 6px;
196
+ }
197
+
198
+ .countdowns-div:hover .ycd-promotion-video {
199
+ color: #337ab7;
200
  }
201
 
202
  .ycd-play-promotion-video {
assets/js/Sticky.js CHANGED
@@ -101,6 +101,24 @@ YcdSticky.prototype.endBehavior = function(countdown, options) {
101
  }
102
  };
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  YcdSticky.prototype.header = function() {
105
  var header = jQuery('.ycd-sticky-header');
106
 
@@ -108,6 +126,8 @@ YcdSticky.prototype.header = function() {
108
  return false;
109
  }
110
 
 
 
111
  var sticky = header.offset().top;
112
  ycdAddEvent(window, 'scroll', function(e) {
113
  if (window.pageYOffset > sticky) {
101
  }
102
  };
103
 
104
+ YcdSticky.prototype.initClose = function () {
105
+ var closeButton = jQuery('.ycd-sticky-close-text');
106
+
107
+ if (!closeButton.length) {
108
+ return false;
109
+ }
110
+
111
+ closeButton.bind('click', function () {
112
+ var id = jQuery(this).parent().data('id');
113
+ var currentHeader = jQuery('.ycd-sticky-header-'+id);
114
+
115
+ if (currentHeader.length) {
116
+ currentHeader.hide();
117
+ jQuery(window).trigger('ycdStickyCountdownClose', [id]);
118
+ }
119
+ });
120
+ };
121
+
122
  YcdSticky.prototype.header = function() {
123
  var header = jQuery('.ycd-sticky-header');
124
 
126
  return false;
127
  }
128
 
129
+ this.initClose();
130
+
131
  var sticky = header.offset().top;
132
  ycdAddEvent(window, 'scroll', function(e) {
133
  if (window.pageYOffset > sticky) {
assets/views/main/stickyMainView.php CHANGED
@@ -255,6 +255,8 @@ $stickySectionsOrder = $defaultData['stickySectionsOrder'];
255
  </div>
256
  </div>
257
  <!-- Countdown Section End -->
 
 
258
  <div class="row form-group">
259
  <div class="col-md-6">
260
  <label class="ycd-label-of-input"><?php _e('General', YCD_TEXT_DOMAIN); ?></label>
@@ -264,25 +266,46 @@ $stickySectionsOrder = $defaultData['stickySectionsOrder'];
264
  </div>
265
  </div>
266
  <div class="ycd-sub-options-settings">
267
- <div class="row form-group">
268
- <div class="col-md-6">
269
- <label class="ycd-label-of-input"><?php _e('Background color', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
270
- </div>
271
- <div class="col-md-5 ycd-option-wrapper<?php echo $isPro; ?>">
272
- <div class="minicolors minicolors-theme-default minicolors-position-bottom minicolors-position-left">
273
- <input type="text" id="ycd-sticky-text-background-color" placeholder="<?php _e('Select color', YCD_TEXT_DOMAIN)?>" name="ycd-sticky-text-background-color" class="minicolors-input form-control js-ycd-sticky-color" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-text-background-color')); ?>">
 
274
  </div>
275
  </div>
276
- </div>
277
- <div class="row form-group">
278
- <div class="col-md-6">
279
- <label class="ycd-label-of-input"><?php _e('Sections order', YCD_TEXT_DOMAIN); ?></label>
 
 
 
 
 
 
280
  </div>
281
- <div class="col-md-5">
282
- <?php echo AdminHelper::selectBox($stickySectionsOrder, esc_attr($this->getOptionValue('ycd-sticky-countdown-sections')), array('name' => 'ycd-sticky-countdown-sections', 'class' => 'js-ycd-select')); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  </div>
284
  </div>
285
- </div>
286
  <?php if(YCD_PKG_VERSION != YCD_FREE_VERSION) : ?>
287
  <div class="row form-group">
288
  <div class="col-md-6">
@@ -306,5 +329,6 @@ $stickySectionsOrder = $defaultData['stickySectionsOrder'];
306
  </div>
307
  </div>
308
  <?php endif; ?>
 
309
  </div>
310
  <input type="hidden" name="ycd-type" value="<?php echo esc_attr($type); ?>">
255
  </div>
256
  </div>
257
  <!-- Countdown Section End -->
258
+
259
+ <!-- General Section Start -->
260
  <div class="row form-group">
261
  <div class="col-md-6">
262
  <label class="ycd-label-of-input"><?php _e('General', YCD_TEXT_DOMAIN); ?></label>
266
  </div>
267
  </div>
268
  <div class="ycd-sub-options-settings">
269
+ <div class="row form-group">
270
+ <div class="col-md-6">
271
+ <label class="ycd-label-of-input"><?php _e('Background color', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
272
+ </div>
273
+ <div class="col-md-5 ycd-option-wrapper<?php echo $isPro; ?>">
274
+ <div class="minicolors minicolors-theme-default minicolors-position-bottom minicolors-position-left">
275
+ <input type="text" id="ycd-sticky-text-background-color" placeholder="<?php _e('Select color', YCD_TEXT_DOMAIN)?>" name="ycd-sticky-text-background-color" class="minicolors-input form-control js-ycd-sticky-color" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-text-background-color')); ?>">
276
+ </div>
277
  </div>
278
  </div>
279
+ <div class="row form-group">
280
+ <div class="col-md-6">
281
+ <label class="ycd-label-of-input" for="ycd-sticky-enable-close"><?php _e('Enable close', YCD_TEXT_DOMAIN); ?></label>
282
+ </div>
283
+ <div class="col-md-5">
284
+ <label class="ycd-switch">
285
+ <input type="checkbox" id="ycd-sticky-enable-close" class="ycd-accordion-checkbox" name="ycd-sticky-enable-close" <?php echo $this->getOptionValue('ycd-sticky-enable-close'); ?>>
286
+ <span class="ycd-slider ycd-round"></span>
287
+ </label>
288
+ </div>
289
  </div>
290
+ <div class="ycd-accordion-content ycd-hide-content">
291
+ <div class="row form-group">
292
+ <div class="col-md-6">
293
+ <label class="ycd-label-of-input" for="ycd-sticky-close-text"><?php _e('Text', YCD_TEXT_DOMAIN); ?></label>
294
+ </div>
295
+ <div class="col-md-5">
296
+ <input type="text" name="ycd-sticky-close-text" id="ycd-sticky-close-text" class="form-control" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-close-text')); ?>">
297
+ </div>
298
+ </div>
299
+ </div>
300
+ <div class="row form-group">
301
+ <div class="col-md-6">
302
+ <label class="ycd-label-of-input"><?php _e('Sections order', YCD_TEXT_DOMAIN); ?></label>
303
+ </div>
304
+ <div class="col-md-5">
305
+ <?php echo AdminHelper::selectBox($stickySectionsOrder, esc_attr($this->getOptionValue('ycd-sticky-countdown-sections')), array('name' => 'ycd-sticky-countdown-sections', 'class' => 'js-ycd-select')); ?>
306
+ </div>
307
  </div>
308
  </div>
 
309
  <?php if(YCD_PKG_VERSION != YCD_FREE_VERSION) : ?>
310
  <div class="row form-group">
311
  <div class="col-md-6">
329
  </div>
330
  </div>
331
  <?php endif; ?>
332
+ <!-- General Section Start -->
333
  </div>
334
  <input type="hidden" name="ycd-type" value="<?php echo esc_attr($type); ?>">
assets/views/types.php CHANGED
@@ -5,7 +5,7 @@ $types = Countdown::getCountdownTypes();
5
  $currentExtensions = YcdCountdownConfig::extensions();
6
  $extensionsResult = AdminHelper::separateToActiveAndNotActive($currentExtensions);
7
  ?>
8
- <div class="ycd-bootstrap-wrapper">
9
  <div class="row">
10
  <div class="col-md-12">
11
  <h3><?php _e('Add New Countdown', YCD_TEXT_DOMAIN); ?></h3>
5
  $currentExtensions = YcdCountdownConfig::extensions();
6
  $extensionsResult = AdminHelper::separateToActiveAndNotActive($currentExtensions);
7
  ?>
8
+ <div class="ycd-bootstrap-wrapper ycd-types-wrapper">
9
  <div class="row">
10
  <div class="col-md-12">
11
  <h3><?php _e('Add New Countdown', YCD_TEXT_DOMAIN); ?></h3>
classes/countdown/StickyCountdown.php CHANGED
@@ -95,6 +95,7 @@ class StickyCountdown extends Countdown {
95
  padding: 10px 16px;
96
  background: <?php echo esc_attr($stickyBgColor); ?>;
97
  color: <?php echo $stickyTextColor; ?>;
 
98
  }
99
 
100
  .ycd-sticky-header-child {
@@ -155,6 +156,38 @@ class StickyCountdown extends Countdown {
155
  return $content;
156
  }
157
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  private function getStickyContent() {
159
  $id = $this->getId();
160
 
@@ -187,6 +220,8 @@ class StickyCountdown extends Countdown {
187
  $buttonText = $this->getOptionValue('ycd-sticky-button-text');
188
  $sectionsOrder = $this->getOptionValue('ycd-sticky-countdown-sections');
189
  $sectionsOrderArray = explode('-', $sectionsOrder);
 
 
190
 
191
  $sectionsHtml = array();
192
 
@@ -222,7 +257,7 @@ class StickyCountdown extends Countdown {
222
  ob_start();
223
  ?>
224
  <div class="ycd-sticky-header ycd-sticky-header-<?php echo esc_attr($id); ?>" data-id="<?php echo esc_attr($id); ?>" data-settings="<?php echo esc_attr($settings); ?>">
225
-
226
  <?php foreach ($sectionsOrderArray as $sectionKey) {
227
  echo $sectionsHtml[$sectionKey];
228
  }?>
95
  padding: 10px 16px;
96
  background: <?php echo esc_attr($stickyBgColor); ?>;
97
  color: <?php echo $stickyTextColor; ?>;
98
+ position: relative;
99
  }
100
 
101
  .ycd-sticky-header-child {
156
  return $content;
157
  }
158
 
159
+ private function getCloseSectionHTML() {
160
+ $allowCloseSection = $this->getOptionValue('ycd-sticky-enable-close');
161
+
162
+ if (empty($allowCloseSection)) {
163
+ return '';
164
+ }
165
+ $id = $this->getId();
166
+ $text = $this->getOptionValue('ycd-sticky-close-text');
167
+ ob_start();
168
+ ?>
169
+ <div class="ycd-sticky-close-wrapper ycd-sticky-close-wrapper-<?php echo esc_attr($id); ?> " data-id="<?php echo esc_attr($id); ?>">
170
+ <span class="ycd-sticky-close-text ycd-sticky-close-text-<?php echo esc_attr($id); ?>"><?php echo esc_attr($text); ?></span>
171
+ </div>
172
+ <style type="text/css">
173
+ .ycd-sticky-close-wrapper {
174
+ display: inline-block;
175
+ position: absolute;
176
+ top: 8px;
177
+ right: 8px;
178
+ line-height: 1;
179
+ }
180
+ .ycd-sticky-close-text {
181
+ cursor: pointer;
182
+ }
183
+ </style>
184
+ <?php
185
+ $content = ob_get_contents();
186
+ ob_end_clean();
187
+
188
+ return $content;
189
+ }
190
+
191
  private function getStickyContent() {
192
  $id = $this->getId();
193
 
220
  $buttonText = $this->getOptionValue('ycd-sticky-button-text');
221
  $sectionsOrder = $this->getOptionValue('ycd-sticky-countdown-sections');
222
  $sectionsOrderArray = explode('-', $sectionsOrder);
223
+
224
+ $closeSectionHtml = $this->getCloseSectionHTML();
225
 
226
  $sectionsHtml = array();
227
 
257
  ob_start();
258
  ?>
259
  <div class="ycd-sticky-header ycd-sticky-header-<?php echo esc_attr($id); ?>" data-id="<?php echo esc_attr($id); ?>" data-settings="<?php echo esc_attr($settings); ?>">
260
+ <?php echo $closeSectionHtml; ?>
261
  <?php foreach ($sectionsOrderArray as $sectionKey) {
262
  echo $sectionsHtml[$sectionKey];
263
  }?>
config/config.php CHANGED
@@ -70,8 +70,8 @@ class YcdCountdownConfig {
70
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
71
  self::addDefine('YCD_AJAX_SUCCESS', 1);
72
  self::addDefine('YCD_TABLE_LIMIT', 15);
73
- self::addDefine('YCD_VERSION_PRO', 1.77);
74
- self::addDefine('YCD_VERSION', 1.91);
75
  self::addDefine('YCD_FREE_VERSION', 1);
76
  self::addDefine('YCD_SILVER_VERSION', 2);
77
  self::addDefine('YCD_GOLD_VERSION', 3);
@@ -79,13 +79,13 @@ class YcdCountdownConfig {
79
  self::addDefine('YCD_EXTENSION_VERSION', 99);
80
  require_once(dirname(__FILE__).'/config-pkg.php');
81
 
82
- $versionText = '1.9.1';
83
  if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
84
- $versionText = '1.7.7';
85
  }
86
  self::addDefine('YCD_VERSION_TEXT', $versionText);
87
- self::addDefine('YCD_LAST_UPDATE', 'Nov 2');
88
- self::addDefine('YCD_NEXT_UPDATE', 'Dec 2');
89
  }
90
 
91
  public static function displaySettings() {
70
  self::addDefine('YCD_CRON_REPEAT_INTERVAL', 1);
71
  self::addDefine('YCD_AJAX_SUCCESS', 1);
72
  self::addDefine('YCD_TABLE_LIMIT', 15);
73
+ self::addDefine('YCD_VERSION_PRO', 1.78);
74
+ self::addDefine('YCD_VERSION', 1.92);
75
  self::addDefine('YCD_FREE_VERSION', 1);
76
  self::addDefine('YCD_SILVER_VERSION', 2);
77
  self::addDefine('YCD_GOLD_VERSION', 3);
79
  self::addDefine('YCD_EXTENSION_VERSION', 99);
80
  require_once(dirname(__FILE__).'/config-pkg.php');
81
 
82
+ $versionText = '1.9.2';
83
  if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
84
+ $versionText = '1.7.8';
85
  }
86
  self::addDefine('YCD_VERSION_TEXT', $versionText);
87
+ self::addDefine('YCD_LAST_UPDATE', 'Nov 8');
88
+ self::addDefine('YCD_NEXT_UPDATE', 'Dec 8');
89
  }
90
 
91
  public static function displaySettings() {
config/optionsConfig.php CHANGED
@@ -7,8 +7,8 @@ class YcdCountdownOptionsConfig {
7
 
8
  $YCD_TYPES['typeName'] = apply_filters('ycdTypes', array(
9
  'circle' => YCD_FREE_VERSION,
10
- 'timer' => YCD_FREE_VERSION,
11
  'sticky' => YCD_FREE_VERSION,
 
12
  'clock1' => YCD_FREE_VERSION,
13
  'clock2' => YCD_FREE_VERSION,
14
  'clock3' => YCD_FREE_VERSION,
@@ -24,8 +24,8 @@ class YcdCountdownOptionsConfig {
24
 
25
  $YCD_TYPES['typePath'] = apply_filters('ycdTypePaths', array(
26
  'circle' => YCD_COUNTDOWNS_PATH,
27
- 'timer' => YCD_COUNTDOWNS_PATH,
28
  'sticky' => YCD_COUNTDOWNS_PATH,
 
29
  'clock1' => YCD_COUNTDOWNS_PATH,
30
  'clock2' => YCD_COUNTDOWNS_PATH,
31
  'clock3' => YCD_COUNTDOWNS_PATH,
@@ -41,8 +41,8 @@ class YcdCountdownOptionsConfig {
41
 
42
  $YCD_TYPES['titles'] = apply_filters('ycdTitles', array(
43
  'circle' => __('Circle', YCD_TEXT_DOMAIN),
44
- 'timer' => __('Timer', YCD_TEXT_DOMAIN),
45
  'sticky' => __('Sticky Countdown', YCD_TEXT_DOMAIN),
 
46
  'clock1' => __('Clock 1', YCD_TEXT_DOMAIN),
47
  'clock2' => __('Clock 2', YCD_TEXT_DOMAIN),
48
  'clock3' => __('Clock 3', YCD_TEXT_DOMAIN),
@@ -292,6 +292,8 @@ class YcdCountdownOptionsConfig {
292
  $options[] = array('name' => 'ycd-sticky-button-redirect-new-tab', 'type' => 'checkbox', 'defaultValue' => '');
293
  $options[] = array('name' => 'ycd-sticky-countdown-mode', 'type' => 'text', 'defaultValue' => 'stickyCountdownDefault');
294
  $options[] = array('name' => 'ycd-sticky-countdown-sections', 'type' => 'text', 'defaultValue' => 'Text-Countdown-Button');
 
 
295
 
296
  $YCD_OPTIONS = apply_filters('ycdCountdownDefaultOptions', $options);
297
  }
7
 
8
  $YCD_TYPES['typeName'] = apply_filters('ycdTypes', array(
9
  'circle' => YCD_FREE_VERSION,
 
10
  'sticky' => YCD_FREE_VERSION,
11
+ 'timer' => YCD_FREE_VERSION,
12
  'clock1' => YCD_FREE_VERSION,
13
  'clock2' => YCD_FREE_VERSION,
14
  'clock3' => YCD_FREE_VERSION,
24
 
25
  $YCD_TYPES['typePath'] = apply_filters('ycdTypePaths', array(
26
  'circle' => YCD_COUNTDOWNS_PATH,
 
27
  'sticky' => YCD_COUNTDOWNS_PATH,
28
+ 'timer' => YCD_COUNTDOWNS_PATH,
29
  'clock1' => YCD_COUNTDOWNS_PATH,
30
  'clock2' => YCD_COUNTDOWNS_PATH,
31
  'clock3' => YCD_COUNTDOWNS_PATH,
41
 
42
  $YCD_TYPES['titles'] = apply_filters('ycdTitles', array(
43
  'circle' => __('Circle', YCD_TEXT_DOMAIN),
 
44
  'sticky' => __('Sticky Countdown', YCD_TEXT_DOMAIN),
45
+ 'timer' => __('Timer', YCD_TEXT_DOMAIN),
46
  'clock1' => __('Clock 1', YCD_TEXT_DOMAIN),
47
  'clock2' => __('Clock 2', YCD_TEXT_DOMAIN),
48
  'clock3' => __('Clock 3', YCD_TEXT_DOMAIN),
292
  $options[] = array('name' => 'ycd-sticky-button-redirect-new-tab', 'type' => 'checkbox', 'defaultValue' => '');
293
  $options[] = array('name' => 'ycd-sticky-countdown-mode', 'type' => 'text', 'defaultValue' => 'stickyCountdownDefault');
294
  $options[] = array('name' => 'ycd-sticky-countdown-sections', 'type' => 'text', 'defaultValue' => 'Text-Countdown-Button');
295
+ $options[] = array('name' => 'ycd-sticky-enable-close', 'type' => 'checkbox', 'defaultValue' => '');
296
+ $options[] = array('name' => 'ycd-sticky-close-text', 'type' => 'text', 'defaultValue' => __('Close', YCD_TEXT_DOMAIN));
297
 
298
  $YCD_OPTIONS = apply_filters('ycdCountdownDefaultOptions', $options);
299
  }
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: 1.9.1
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: 1.9.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.5.3
6
- Stable tag: 1.9.1
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -66,7 +66,10 @@ Yes you can, we have Circle and Flipclock countdown popups.
66
  You need to select the .zip file, there is no need to extract the zip file, just upload it.
67
 
68
  == Changelog ==
69
-
 
 
 
70
  = 1.9.1 =
71
  * Sticky Countdown Sections Order
72
 
3
  Tags: countdown, timer, countdown timer
4
  Requires at least: 3.8
5
  Tested up to: 5.5.3
6
+ Stable tag: 1.9.2
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
66
  You need to select the .zip file, there is no need to extract the zip file, just upload it.
67
 
68
  == Changelog ==
69
+ = 1.9.2 =
70
+ * Added possibility close Sticky Countdown
71
+ * Added possibility to change Sticky Countdown close text
72
+ * Admin side type sections improvement
73
  = 1.9.1 =
74
  * Sticky Countdown Sections Order
75