Countdown, Coming Soon – Countdown & Clock - Version 1.9.0

Version Description

  • Inside Sticky Countdown type, added possibility select another countdown type to show countdown
  • Coming Soon type code improvements
Download this release

Release Info

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

Code changes from version 1.8.9 to 1.9.0

assets/views/admin/comingSoon/comingSoonSettings.php CHANGED
@@ -2,8 +2,9 @@
2
  use ycd\AdminHelper;
3
  use ycd\MultipleChoiceButton;
4
  $defaultData = AdminHelper::defaultData();
5
- $createCountdown = YCD_COUNTDOWN_ADMIN_URL.'edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE.'&page='.YCD_COUNTDOWN_POST_TYPE;
6
- $countdownsIdAndTitle = \ycd\Countdown::getCountdownsIdAndTitle();
 
7
  if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
8
  $isPro = '-pro';
9
  $proSpan = '<span class="ycd-pro-span">'.__('pro', YCD_TEXT_DOMAIN).'</span>';
2
  use ycd\AdminHelper;
3
  use ycd\MultipleChoiceButton;
4
  $defaultData = AdminHelper::defaultData();
5
+ $createCountdown = AdminHelper::getCreateCountdownUrl();
6
+ $args = array('allowTypes' => array('circle'), 'except' => array('sticky'));
7
+ $countdownsIdAndTitle = \ycd\Countdown::getCountdownsIdAndTitle($args);
8
  if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
9
  $isPro = '-pro';
10
  $proSpan = '<span class="ycd-pro-span">'.__('pro', YCD_TEXT_DOMAIN).'</span>';
assets/views/main/stickyMainView.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  use ycd\AdminHelper;
 
3
  $defaultData = AdminHelper::defaultData();
4
  $type = $this->getCurrentTypeFromOptions();
5
 
@@ -9,9 +10,12 @@ if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
9
  $isPro = '-pro';
10
  $proSpan = '<span class="ycd-pro-span">'.__('pro', YCD_TEXT_DOMAIN).'</span>';
11
  }
 
 
 
12
  ?>
13
  <div class="ycd-bootstrap-wrapper">
14
- <!-- Button settings start -->
15
  <div class="row form-group">
16
  <div class="col-md-6">
17
  <label class="ycd-label-of-input"><?php _e('Button settings', YCD_TEXT_DOMAIN); ?></label>
@@ -19,7 +23,7 @@ if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
19
  <div class="col-md-5">
20
  </div>
21
  </div>
22
- <div class="ycd-sub-options-settings">
23
  <div class="row form-group">
24
  <div class="col-md-6">
25
  <label class="ycd-label-of-input" for="ycd-sticky-button-text"><?php _e('Text', YCD_TEXT_DOMAIN); ?></label>
@@ -48,7 +52,7 @@ if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
48
  </div>
49
  </div>
50
  </div>
51
- <div class="row form-group">
52
  <div class="col-md-6">
53
  <label class="ycd-label-of-input" for="ycd-sticky-url"><?php _e('URL', YCD_TEXT_DOMAIN); ?></label>
54
  </div>
@@ -56,109 +60,80 @@ if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
56
  <input type="url" placeholder="https://www.example.com" name="ycd-sticky-url" id="ycd-sticky-url" class="form-control" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-url')); ?>">
57
  </div>
58
  </div>
59
- <div class="row">
60
- <div class="col-md-6">
61
- <label for="ycd-sticky-button-redirect-new-tab" class="ycd-label-of-switch"><?php _e('Redirect to new tab', YCD_TEXT_DOMAIN); ?></label>
62
- </div>
63
- <div class="col-md-6">
64
- <label class="ycd-switch">
65
- <input type="checkbox" id="ycd-sticky-button-redirect-new-tab" class="" name="ycd-sticky-button-redirect-new-tab" <?php echo $this->getOptionValue('ycd-sticky-button-redirect-new-tab'); ?>>
66
- <span class="ycd-slider ycd-round"></span>
67
- </label>
68
- </div>
69
- </div>
70
- <div class="row">
71
- <div class="col-md-6">
72
- <label for="ycd-sticky-button-padding-enable" class="ycd-label-of-switch"><?php _e('Enable padding', YCD_TEXT_DOMAIN); ?></label>
73
- </div>
74
- <div class="col-md-6">
75
- <label class="ycd-switch">
76
- <input type="checkbox" id="ycd-sticky-button-padding-enable" class="ycd-accordion-checkbox" name="ycd-sticky-button-padding-enable" <?php echo $this->getOptionValue('ycd-sticky-button-padding-enable'); ?>>
77
- <span class="ycd-slider ycd-round"></span>
78
- </label>
79
- </div>
80
- </div>
81
- <div class="ycd-accordion-content ycd-hide-content">
82
- <div class="row form-group">
83
- <div class="col-md-6">
84
- <label class="ycd-label-of-input" for="ycd-sticky-button-padding"><?php _e('Padding', YCD_TEXT_DOMAIN); ?></label>
85
- </div>
86
- <div class="col-md-5">
87
- <input type="text" name="ycd-sticky-button-padding" id="ycd-sticky-button-padding" class="form-control" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-button-padding')); ?>">
88
- </div>
89
- </div>
90
- </div>
91
- <div class="row">
92
- <div class="col-md-6">
93
- <label for="ycd-sticky-button-border-enable" class="ycd-label-of-switch"><?php _e('Enable border', YCD_TEXT_DOMAIN); ?></label>
94
- </div>
95
- <div class="col-md-6">
96
- <label class="ycd-switch">
97
- <input type="checkbox" id="ycd-sticky-button-border-enable" class="ycd-sticky-button-border-enable ycd-accordion-checkbox" name="ycd-sticky-button-border-enable" <?php echo $this->getOptionValue('ycd-sticky-button-border-enable'); ?>>
98
- <span class="ycd-slider ycd-round"></span>
99
- </label>
100
- </div>
101
- </div>
102
- <div class="ycd-accordion-content ycd-hide-content">
103
- <div class="row form-group">
104
- <div class="col-md-6">
105
- <label class="ycd-label-of-input" for="ycd-sticky-button-border-width"><?php _e('width', YCD_TEXT_DOMAIN); ?></label>
106
- </div>
107
- <div class="col-md-5">
108
- <input type="text" name="ycd-sticky-button-border-width" id="ycd-sticky-button-border-width" class="form-control" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-button-border-width')); ?>">
109
- </div>
110
- </div>
111
- <div class="row form-group">
112
- <div class="col-md-6">
113
- <label class="ycd-label-of-input" for="ycd-sticky-button-border-radius"><?php _e('radius', YCD_TEXT_DOMAIN); ?></label>
114
- </div>
115
- <div class="col-md-5">
116
- <input type="text" name="ycd-sticky-button-border-radius" id="ycd-sticky-button-border-radius" class="form-control" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-button-border-radius')); ?>">
117
- </div>
118
- </div>
119
- <div class="row form-group">
120
- <div class="col-md-6">
121
- <label class="ycd-label-of-input" for="ycd-sticky-button-border-color"><?php _e('Background color', YCD_TEXT_DOMAIN); ?></label>
122
- </div>
123
- <div class="col-md-5 ycd-option-wrapper<?php echo $isPro; ?>">
124
- <div class="minicolors minicolors-theme-default minicolors-position-bottom minicolors-position-left">
125
- <input type="text" id="ycd-sticky-button-border-color" placeholder="<?php _e('Select color', YCD_TEXT_DOMAIN)?>" name="ycd-sticky-button-border-color" class="minicolors-input form-control js-ycd-sticky-color" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-button-border-color')); ?>">
126
- </div>
127
- </div>
128
- </div>
129
- </div>
130
- </div>
131
- <!-- Button settings end -->
132
- <!-- Button Countdown start -->
133
- <div class="row form-group">
134
- <div class="col-md-6">
135
- <label class="ycd-label-of-input"><?php _e('Countdown section', YCD_TEXT_DOMAIN); ?></label>
136
- </div>
137
- <div class="col-md-5">
138
- </div>
139
- </div>
140
- <div class="row form-group">
141
- <div class="col-md-4">
142
- <label class="ycd-label-of-input"><?php _e('Texts', YCD_TEXT_DOMAIN); ?></label>
143
- </div>
144
- <div class="col-md-2">
145
- <label for="ycd-sticky-countdown-days" class="yrm-label"><?php _e('Days', YCD_TEXT_DOMAIN); ?></label>
146
- <input type="text" id="ycd-sticky-countdown-days" name="ycd-sticky-countdown-days" class="form-control button-padding" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-countdown-days')); ?>">
147
- </div>
148
- <div class="col-md-2">
149
- <label for="ycd-sticky-countdown-hours" class="yrm-label"><?php _e('Hours', YCD_TEXT_DOMAIN); ?></label>
150
- <input type="text" id="ycd-sticky-countdown-hours" name="ycd-sticky-countdown-hours" class="form-control button-padding" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-countdown-hours')); ?>">
151
- </div>
152
- <div class="col-md-2">
153
- <label for="ycd-sticky-countdown-minutes" class="yrm-label"><?php _e('Minutes', YCD_TEXT_DOMAIN); ?></label>
154
- <input type="text" id="ycd-sticky-countdown-minutes" name="ycd-sticky-countdown-minutes" class="form-control button-padding" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-countdown-minutes')); ?>">
155
- </div>
156
- <div class="col-md-2">
157
- <label for="ycd-sticky-countdown-seconds" class="yrm-label"><?php _e('Seconds', YCD_TEXT_DOMAIN); ?></label>
158
- <input type="text" id="ycd-sticky-countdown-seconds" name="ycd-sticky-countdown-seconds" class="form-control button-padding" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-countdown-seconds')); ?>">
159
- </div>
160
- </div>
161
- <!-- Button Countdown end -->
162
  <div class="row form-group">
163
  <div class="col-md-6">
164
  <label class="ycd-label-of-input"><?php _e('Text section', YCD_TEXT_DOMAIN); ?></label>
@@ -166,7 +141,7 @@ if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
166
  <div class="col-md-5">
167
  </div>
168
  </div>
169
- <div class="ycd-sub-options-settings">
170
  <div class="row form-group">
171
  <div class="col-md-12">
172
  <?php
@@ -179,57 +154,107 @@ if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
179
  <?php wp_editor($content, $editorId, $settings); ?>
180
  </div>
181
  </div>
182
- <div class="row form-group">
183
- <div class="col-md-6">
184
- <label class="ycd-label-of-input" for="ycd-sticky-text-color"><?php _e('Color', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
185
- </div>
186
- <div class="col-md-5 ycd-option-wrapper<?php echo $isPro; ?>">
187
- <div class="minicolors minicolors-theme-default minicolors-position-bottom minicolors-position-left">
188
- <input type="text" id="ycd-sticky-text-color" placeholder="<?php _e('Select color', YCD_TEXT_DOMAIN)?>" name="ycd-sticky-text-color" class="minicolors-input form-control js-ycd-sticky-color" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-text-color')); ?>">
189
- </div>
190
- </div>
191
- </div>
192
- </div>
193
  <div class="row form-group">
194
  <div class="col-md-6">
195
- <label class="ycd-label-of-input"><?php _e('Countdown', YCD_TEXT_DOMAIN); ?></label>
196
- </div>
197
- <div class="col-md-5">
198
-
199
- </div>
200
- </div>
201
- <div class="ycd-sub-options-settings">
202
- <div class="row form-group">
203
- <div class="col-md-6">
204
- <label class="ycd-label-of-input"><?php _e('Color', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
205
  </div>
206
  <div class="col-md-5 ycd-option-wrapper<?php echo $isPro; ?>">
207
- <div class="minicolors minicolors-theme-default minicolors-position-bottom minicolors-position-left">
208
- <input type="text" id="ycd-sticky-countdown-text-color" placeholder="<?php _e('Select color', YCD_TEXT_DOMAIN)?>" name="ycd-sticky-countdown-text-color" class="minicolors-input form-control js-ycd-sticky-color" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-countdown-text-color')); ?>">
209
- </div>
210
  </div>
211
  </div>
212
- <div class="row form-group">
 
 
 
213
  <div class="col-md-6">
214
- <label class="ycd-label-of-input"><?php _e('Font wight', YCD_TEXT_DOMAIN); ?></label>
215
  </div>
216
  <div class="col-md-5">
217
- <?php echo AdminHelper::selectBox($defaultData['font-weight'], $this->getOptionValue('ycd-stick-countdown-font-weight'), array('name' => 'ycd-stick-countdown-font-weight', 'class' => 'js-ycd-select'))?>
218
  </div>
219
  </div>
220
- <div class="row form-group">
221
- <div class="col-md-6">
222
- <label class="ycd-label-of-input"><?php _e('Font size', YCD_TEXT_DOMAIN); ?></label>
 
 
 
223
  </div>
224
- <div class="col-md-5">
225
- <input type="number" class="form-control" name="ycd-stick-countdown-font-size" value="<?php echo esc_attr($this->getOptionValue('ycd-stick-countdown-font-size'));?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  </div>
227
- <div class="col-md-1">
228
- <?php _e('Px', YCD_TEXT_DOMAIN); ?>
229
- </div>
230
  </div>
231
- </div>
232
- <div class="row form-group">
233
  <div class="col-md-6">
234
  <label class="ycd-label-of-input"><?php _e('General', YCD_TEXT_DOMAIN); ?></label>
235
  </div>
@@ -237,20 +262,20 @@ if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
237
 
238
  </div>
239
  </div>
240
- <div class="ycd-sub-options-settings">
241
- <div class="row form-group">
242
  <div class="col-md-6">
243
  <label class="ycd-label-of-input"><?php _e('Background color', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
244
  </div>
245
  <div class="col-md-5 ycd-option-wrapper<?php echo $isPro; ?>">
246
- <div class="minicolors minicolors-theme-default minicolors-position-bottom minicolors-position-left">
247
- <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')); ?>">
248
- </div>
249
  </div>
250
  </div>
251
- </div>
252
  <?php if(YCD_PKG_VERSION != YCD_FREE_VERSION) : ?>
253
- <div class="row form-group">
254
  <div class="col-md-6">
255
  <label class="ycd-label-of-input"><?php _e('Display rule', YCD_TEXT_DOMAIN); ?></label>
256
  </div>
@@ -258,19 +283,19 @@ if(YCD_PKG_VERSION == YCD_FREE_VERSION) {
258
 
259
  </div>
260
  </div>
261
- <div class="ycd-sub-options-settings">
262
  <div class="row form-group">
263
  <div class="col-md-6">
264
  <label class="ycd-label-of-input" for="ycd-sticky-all-pages"><?php _e('All pages', YCD_TEXT_DOMAIN); ?></label>
265
  </div>
266
  <div class="col-md-5">
267
  <label class="ycd-switch">
268
- <input type="checkbox" id="ycd-sticky-all-pages" name="ycd-sticky-all-pages" class="ycd-accordion-checkbox js-ycd-time-status" <?php echo $this->getOptionValue('ycd-sticky-all-pages'); ?>>
269
- <span class="ycd-slider ycd-round"></span>
270
- </label>
271
  </div>
272
  </div>
273
- </div>
274
  <?php endif; ?>
275
  </div>
276
  <input type="hidden" name="ycd-type" value="<?php echo esc_attr($type); ?>">
1
  <?php
2
  use ycd\AdminHelper;
3
+ use ycd\MultipleChoiceButton;
4
  $defaultData = AdminHelper::defaultData();
5
  $type = $this->getCurrentTypeFromOptions();
6
 
10
  $isPro = '-pro';
11
  $proSpan = '<span class="ycd-pro-span">'.__('pro', YCD_TEXT_DOMAIN).'</span>';
12
  }
13
+ $createCountdown = AdminHelper::getCreateCountdownUrl();
14
+ $args = array('allowTypes' => array('circle'), 'except' => array('sticky'));
15
+ $countdownsIdAndTitle = \ycd\Countdown::getCountdownsIdAndTitle($args);
16
  ?>
17
  <div class="ycd-bootstrap-wrapper">
18
+ <!-- Button settings start -->
19
  <div class="row form-group">
20
  <div class="col-md-6">
21
  <label class="ycd-label-of-input"><?php _e('Button settings', YCD_TEXT_DOMAIN); ?></label>
23
  <div class="col-md-5">
24
  </div>
25
  </div>
26
+ <div class="ycd-sub-options-settings">
27
  <div class="row form-group">
28
  <div class="col-md-6">
29
  <label class="ycd-label-of-input" for="ycd-sticky-button-text"><?php _e('Text', YCD_TEXT_DOMAIN); ?></label>
52
  </div>
53
  </div>
54
  </div>
55
+ <div class="row form-group">
56
  <div class="col-md-6">
57
  <label class="ycd-label-of-input" for="ycd-sticky-url"><?php _e('URL', YCD_TEXT_DOMAIN); ?></label>
58
  </div>
60
  <input type="url" placeholder="https://www.example.com" name="ycd-sticky-url" id="ycd-sticky-url" class="form-control" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-url')); ?>">
61
  </div>
62
  </div>
63
+ <div class="row">
64
+ <div class="col-md-6">
65
+ <label for="ycd-sticky-button-redirect-new-tab" class="ycd-label-of-switch"><?php _e('Redirect to new tab', YCD_TEXT_DOMAIN); ?></label>
66
+ </div>
67
+ <div class="col-md-6">
68
+ <label class="ycd-switch">
69
+ <input type="checkbox" id="ycd-sticky-button-redirect-new-tab" class="" name="ycd-sticky-button-redirect-new-tab" <?php echo $this->getOptionValue('ycd-sticky-button-redirect-new-tab'); ?>>
70
+ <span class="ycd-slider ycd-round"></span>
71
+ </label>
72
+ </div>
73
+ </div>
74
+ <div class="row">
75
+ <div class="col-md-6">
76
+ <label for="ycd-sticky-button-padding-enable" class="ycd-label-of-switch"><?php _e('Enable padding', YCD_TEXT_DOMAIN); ?></label>
77
+ </div>
78
+ <div class="col-md-6">
79
+ <label class="ycd-switch">
80
+ <input type="checkbox" id="ycd-sticky-button-padding-enable" class="ycd-accordion-checkbox" name="ycd-sticky-button-padding-enable" <?php echo $this->getOptionValue('ycd-sticky-button-padding-enable'); ?>>
81
+ <span class="ycd-slider ycd-round"></span>
82
+ </label>
83
+ </div>
84
+ </div>
85
+ <div class="ycd-accordion-content ycd-hide-content">
86
+ <div class="row form-group">
87
+ <div class="col-md-6">
88
+ <label class="ycd-label-of-input" for="ycd-sticky-button-padding"><?php _e('Padding', YCD_TEXT_DOMAIN); ?></label>
89
+ </div>
90
+ <div class="col-md-5">
91
+ <input type="text" name="ycd-sticky-button-padding" id="ycd-sticky-button-padding" class="form-control" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-button-padding')); ?>">
92
+ </div>
93
+ </div>
94
+ </div>
95
+ <div class="row">
96
+ <div class="col-md-6">
97
+ <label for="ycd-sticky-button-border-enable" class="ycd-label-of-switch"><?php _e('Enable border', YCD_TEXT_DOMAIN); ?></label>
98
+ </div>
99
+ <div class="col-md-6">
100
+ <label class="ycd-switch">
101
+ <input type="checkbox" id="ycd-sticky-button-border-enable" class="ycd-sticky-button-border-enable ycd-accordion-checkbox" name="ycd-sticky-button-border-enable" <?php echo $this->getOptionValue('ycd-sticky-button-border-enable'); ?>>
102
+ <span class="ycd-slider ycd-round"></span>
103
+ </label>
104
+ </div>
105
+ </div>
106
+ <div class="ycd-accordion-content ycd-hide-content">
107
+ <div class="row form-group">
108
+ <div class="col-md-6">
109
+ <label class="ycd-label-of-input" for="ycd-sticky-button-border-width"><?php _e('width', YCD_TEXT_DOMAIN); ?></label>
110
+ </div>
111
+ <div class="col-md-5">
112
+ <input type="text" name="ycd-sticky-button-border-width" id="ycd-sticky-button-border-width" class="form-control" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-button-border-width')); ?>">
113
+ </div>
114
+ </div>
115
+ <div class="row form-group">
116
+ <div class="col-md-6">
117
+ <label class="ycd-label-of-input" for="ycd-sticky-button-border-radius"><?php _e('radius', YCD_TEXT_DOMAIN); ?></label>
118
+ </div>
119
+ <div class="col-md-5">
120
+ <input type="text" name="ycd-sticky-button-border-radius" id="ycd-sticky-button-border-radius" class="form-control" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-button-border-radius')); ?>">
121
+ </div>
122
+ </div>
123
+ <div class="row form-group">
124
+ <div class="col-md-6">
125
+ <label class="ycd-label-of-input" for="ycd-sticky-button-border-color"><?php _e('Background color', YCD_TEXT_DOMAIN); ?></label>
126
+ </div>
127
+ <div class="col-md-5 ycd-option-wrapper<?php echo $isPro; ?>">
128
+ <div class="minicolors minicolors-theme-default minicolors-position-bottom minicolors-position-left">
129
+ <input type="text" id="ycd-sticky-button-border-color" placeholder="<?php _e('Select color', YCD_TEXT_DOMAIN)?>" name="ycd-sticky-button-border-color" class="minicolors-input form-control js-ycd-sticky-color" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-button-border-color')); ?>">
130
+ </div>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ </div>
135
+ <!-- Button settings end -->
136
+ <!-- Text start -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  <div class="row form-group">
138
  <div class="col-md-6">
139
  <label class="ycd-label-of-input"><?php _e('Text section', YCD_TEXT_DOMAIN); ?></label>
141
  <div class="col-md-5">
142
  </div>
143
  </div>
144
+ <div class="ycd-sub-options-settings">
145
  <div class="row form-group">
146
  <div class="col-md-12">
147
  <?php
154
  <?php wp_editor($content, $editorId, $settings); ?>
155
  </div>
156
  </div>
 
 
 
 
 
 
 
 
 
 
 
157
  <div class="row form-group">
158
  <div class="col-md-6">
159
+ <label class="ycd-label-of-input" for="ycd-sticky-text-color"><?php _e('Color', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
 
 
 
 
 
 
 
 
 
160
  </div>
161
  <div class="col-md-5 ycd-option-wrapper<?php echo $isPro; ?>">
162
+ <div class="minicolors minicolors-theme-default minicolors-position-bottom minicolors-position-left">
163
+ <input type="text" id="ycd-sticky-text-color" placeholder="<?php _e('Select color', YCD_TEXT_DOMAIN)?>" name="ycd-sticky-text-color" class="minicolors-input form-control js-ycd-sticky-color" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-text-color')); ?>">
164
+ </div>
165
  </div>
166
  </div>
167
+ </div>
168
+ <!-- Text End -->
169
+ <!-- Countdown Section Start -->
170
+ <div class="row form-group">
171
  <div class="col-md-6">
172
+ <label class="ycd-label-of-input"><?php _e('Countdown', YCD_TEXT_DOMAIN); ?></label>
173
  </div>
174
  <div class="col-md-5">
175
+
176
  </div>
177
  </div>
178
+ <div class="ycd-sub-options-settings">
179
+ <div class="ycd-multichoice-wrapper">
180
+ <?php
181
+ $multipleChoiceButton = new MultipleChoiceButton($defaultData['stickyCountdownMode'], esc_attr($this->getOptionValue('ycd-sticky-countdown-mode')));
182
+ echo $multipleChoiceButton;
183
+ ?>
184
  </div>
185
+ <div id="ycd-sticky-countdown-custom" class="ycd-sub-option ycd-hide">
186
+ <div class="row form-group">
187
+ <div class="col-md-6">
188
+ <label class="ycd-label-of-input"><?php _e('Select Countdown', YCD_TEXT_DOMAIN); ?></label>
189
+ </div>
190
+ <div class="col-md-4">
191
+ <?php
192
+ if (count(array_keys($countdownsIdAndTitle)) <= 1) {
193
+ echo '<a href="'.$createCountdown.'">Create Countdown</a>';
194
+ }
195
+ else {
196
+ echo AdminHelper::selectBox($countdownsIdAndTitle, esc_attr($this->getOptionValue('ycd-sticky-countdown')), array('name' => 'ycd-sticky-countdown', 'class' => 'js-ycd-select'));
197
+ }
198
+ ?>
199
+ </div>
200
+ </div>
201
+ </div>
202
+ <div id="ycd-sticky-countdown-default" class="ycd-sub-option ycd-hide">
203
+
204
+ <div class="row form-group">
205
+ <div class="col-md-4">
206
+ <label class="ycd-label-of-input"><?php _e('Texts', YCD_TEXT_DOMAIN); ?></label>
207
+ </div>
208
+ <div class="col-md-2">
209
+ <label for="ycd-sticky-countdown-days" class="yrm-label"><?php _e('Days', YCD_TEXT_DOMAIN); ?></label>
210
+ <input type="text" id="ycd-sticky-countdown-days" name="ycd-sticky-countdown-days" class="form-control button-padding" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-countdown-days')); ?>">
211
+ </div>
212
+ <div class="col-md-2">
213
+ <label for="ycd-sticky-countdown-hours" class="yrm-label"><?php _e('Hours', YCD_TEXT_DOMAIN); ?></label>
214
+ <input type="text" id="ycd-sticky-countdown-hours" name="ycd-sticky-countdown-hours" class="form-control button-padding" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-countdown-hours')); ?>">
215
+ </div>
216
+ <div class="col-md-2">
217
+ <label for="ycd-sticky-countdown-minutes" class="yrm-label"><?php _e('Minutes', YCD_TEXT_DOMAIN); ?></label>
218
+ <input type="text" id="ycd-sticky-countdown-minutes" name="ycd-sticky-countdown-minutes" class="form-control button-padding" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-countdown-minutes')); ?>">
219
+ </div>
220
+ <div class="col-md-2">
221
+ <label for="ycd-sticky-countdown-seconds" class="yrm-label"><?php _e('Seconds', YCD_TEXT_DOMAIN); ?></label>
222
+ <input type="text" id="ycd-sticky-countdown-seconds" name="ycd-sticky-countdown-seconds" class="form-control button-padding" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-countdown-seconds')); ?>">
223
+ </div>
224
+ </div>
225
+ <div class="row form-group">
226
+ <div class="col-md-6">
227
+ <label class="ycd-label-of-input"><?php _e('Color', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
228
+ </div>
229
+ <div class="col-md-5 ycd-option-wrapper<?php echo $isPro; ?>">
230
+ <div class="minicolors minicolors-theme-default minicolors-position-bottom minicolors-position-left">
231
+ <input type="text" id="ycd-sticky-countdown-text-color" placeholder="<?php _e('Select color', YCD_TEXT_DOMAIN)?>" name="ycd-sticky-countdown-text-color" class="minicolors-input form-control js-ycd-sticky-color" value="<?php echo esc_attr($this->getOptionValue('ycd-sticky-countdown-text-color')); ?>">
232
+ </div>
233
+ </div>
234
+ </div>
235
+ <div class="row form-group">
236
+ <div class="col-md-6">
237
+ <label class="ycd-label-of-input"><?php _e('Font wight', YCD_TEXT_DOMAIN); ?></label>
238
+ </div>
239
+ <div class="col-md-5">
240
+ <?php echo AdminHelper::selectBox($defaultData['font-weight'], $this->getOptionValue('ycd-stick-countdown-font-weight'), array('name' => 'ycd-stick-countdown-font-weight', 'class' => 'js-ycd-select'))?>
241
+ </div>
242
+ </div>
243
+ <div class="row form-group">
244
+ <div class="col-md-6">
245
+ <label class="ycd-label-of-input"><?php _e('Font size', YCD_TEXT_DOMAIN); ?></label>
246
+ </div>
247
+ <div class="col-md-5">
248
+ <input type="number" class="form-control" name="ycd-stick-countdown-font-size" value="<?php echo esc_attr($this->getOptionValue('ycd-stick-countdown-font-size'));?>">
249
+ </div>
250
+ <div class="col-md-1">
251
+ <?php _e('Px', YCD_TEXT_DOMAIN); ?>
252
+ </div>
253
+ </div>
254
  </div>
 
 
 
255
  </div>
256
+ <!-- Countdown Section End -->
257
+ <div class="row form-group">
258
  <div class="col-md-6">
259
  <label class="ycd-label-of-input"><?php _e('General', YCD_TEXT_DOMAIN); ?></label>
260
  </div>
262
 
263
  </div>
264
  </div>
265
+ <div class="ycd-sub-options-settings">
266
+ <div class="row form-group">
267
  <div class="col-md-6">
268
  <label class="ycd-label-of-input"><?php _e('Background color', YCD_TEXT_DOMAIN); echo $proSpan; ?></label>
269
  </div>
270
  <div class="col-md-5 ycd-option-wrapper<?php echo $isPro; ?>">
271
+ <div class="minicolors minicolors-theme-default minicolors-position-bottom minicolors-position-left">
272
+ <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')); ?>">
273
+ </div>
274
  </div>
275
  </div>
276
+ </div>
277
  <?php if(YCD_PKG_VERSION != YCD_FREE_VERSION) : ?>
278
+ <div class="row form-group">
279
  <div class="col-md-6">
280
  <label class="ycd-label-of-input"><?php _e('Display rule', YCD_TEXT_DOMAIN); ?></label>
281
  </div>
283
 
284
  </div>
285
  </div>
286
+ <div class="ycd-sub-options-settings">
287
  <div class="row form-group">
288
  <div class="col-md-6">
289
  <label class="ycd-label-of-input" for="ycd-sticky-all-pages"><?php _e('All pages', YCD_TEXT_DOMAIN); ?></label>
290
  </div>
291
  <div class="col-md-5">
292
  <label class="ycd-switch">
293
+ <input type="checkbox" id="ycd-sticky-all-pages" name="ycd-sticky-all-pages" class="ycd-accordion-checkbox js-ycd-time-status" <?php echo $this->getOptionValue('ycd-sticky-all-pages'); ?>>
294
+ <span class="ycd-slider ycd-round"></span>
295
+ </label>
296
  </div>
297
  </div>
298
+ </div>
299
  <?php endif; ?>
300
  </div>
301
  <input type="hidden" name="ycd-type" value="<?php echo esc_attr($type); ?>">
classes/countdown/Countdown.php CHANGED
@@ -301,8 +301,8 @@ abstract class Countdown {
301
  $cdData = array();
302
 
303
  if (empty($data)) {
304
- return $cdData;
305
- }
306
 
307
  foreach ($data as $key => $value) {
308
  if (strpos($key, 'ycd') === 0) {
@@ -497,18 +497,18 @@ abstract class Countdown {
497
  $metaboxes = $this->getMetaBoxes();
498
  $typeMetaboxObj = $this;
499
  foreach ($metaboxes as $key => $metabox) {
500
- $defaultActionView = array($this, $key);
501
- if (!empty($metabox['defaultActionView'])) {
502
- $defaultActionView = $metabox['defaultActionView'];
503
- }
504
  add_meta_box($key, __($metabox['title'], YCD_TEXT_DOMAIN), $defaultActionView, YCD_COUNTDOWN_POST_TYPE, $metabox['position'], $metabox['prioritet'], array('typeObj' => $this));
505
  }
506
  }
507
 
508
  public function countdownButton() {
509
- $typeObj = $this;
510
- require_once YCD_VIEWS_PATH.'countdownButton.php';
511
- }
512
 
513
  public function afterCountdownExpire() {
514
  require_once YCD_VIEWS_PATH.'afterExpire.php';
@@ -894,20 +894,20 @@ abstract class Countdown {
894
  }
895
 
896
  public function renderView() {
897
- $id = $this->getId();
898
- $content = '<div class="ycd-all-content-wrapper ycd-countdown-content-wrapper-'.$id.'">';
899
- $content .= apply_filters('ycdCountdownBeforeContent', '', $this);
900
- $content .= $this->getViewContent();
901
 
902
- do_action('ycdGeneralScripts');
903
- $content .= apply_filters('ycdCountdownAfterContent', '', $this);
904
- $content .= '</div>';
905
- return $content;
906
- }
907
 
908
- public function addToContent() {
909
 
910
- }
911
 
912
  public function getTheContentFilter($content) {
913
  $id = $this->getId();
@@ -924,36 +924,41 @@ abstract class Countdown {
924
  $allContent .= '<style>.ycd-circle-'.$id.'-wrapper {text-align: '.$horizontal.' !important;}</style>';
925
  return $allContent;
926
  }
927
-
928
- public function chanegSavedDataFromArgs() {
929
  $args = $this->getShortCodeArgs();
930
  $savedData = $this->getSavedData();
931
  if (!empty($args['date'])) {
932
  $savedData['ycd-date-time-picker'] = $args['date'];
933
  }
934
  $this->setSavedData($savedData);
935
- }
936
-
937
- public static function getCountdownsIdAndTitle() {
 
938
  $allCountdowns = self::getCountdownsObj();
939
- $allowedTypes = array('circle');
940
- $idTitles = array('' => 'Select Countdown');
941
-
942
- foreach ($allCountdowns as $countdown) {
943
- $type = $countdown->getType();
944
- if (!in_array($type, $allowedTypes)) {
945
- continue;
946
- }
947
- $id = $countdown->getId();
948
- $title = $countdown->getTitle();
949
-
950
- if (empty($title)) {
951
- $title = '(no title)';
952
- }
953
- $idTitles[$id] = $title;
954
- }
955
-
956
- return $idTitles;
 
 
 
 
957
  }
958
 
959
  protected function getCountdownTimerAttrSeconds() {
301
  $cdData = array();
302
 
303
  if (empty($data)) {
304
+ return $cdData;
305
+ }
306
 
307
  foreach ($data as $key => $value) {
308
  if (strpos($key, 'ycd') === 0) {
497
  $metaboxes = $this->getMetaBoxes();
498
  $typeMetaboxObj = $this;
499
  foreach ($metaboxes as $key => $metabox) {
500
+ $defaultActionView = array($this, $key);
501
+ if (!empty($metabox['defaultActionView'])) {
502
+ $defaultActionView = $metabox['defaultActionView'];
503
+ }
504
  add_meta_box($key, __($metabox['title'], YCD_TEXT_DOMAIN), $defaultActionView, YCD_COUNTDOWN_POST_TYPE, $metabox['position'], $metabox['prioritet'], array('typeObj' => $this));
505
  }
506
  }
507
 
508
  public function countdownButton() {
509
+ $typeObj = $this;
510
+ require_once YCD_VIEWS_PATH.'countdownButton.php';
511
+ }
512
 
513
  public function afterCountdownExpire() {
514
  require_once YCD_VIEWS_PATH.'afterExpire.php';
894
  }
895
 
896
  public function renderView() {
897
+ $id = $this->getId();
898
+ $content = '<div class="ycd-all-content-wrapper ycd-countdown-content-wrapper-'.$id.'">';
899
+ $content .= apply_filters('ycdCountdownBeforeContent', '', $this);
900
+ $content .= $this->getViewContent();
901
 
902
+ do_action('ycdGeneralScripts');
903
+ $content .= apply_filters('ycdCountdownAfterContent', '', $this);
904
+ $content .= '</div>';
905
+ return $content;
906
+ }
907
 
908
+ public function addToContent() {
909
 
910
+ }
911
 
912
  public function getTheContentFilter($content) {
913
  $id = $this->getId();
924
  $allContent .= '<style>.ycd-circle-'.$id.'-wrapper {text-align: '.$horizontal.' !important;}</style>';
925
  return $allContent;
926
  }
927
+
928
+ public function chanegSavedDataFromArgs() {
929
  $args = $this->getShortCodeArgs();
930
  $savedData = $this->getSavedData();
931
  if (!empty($args['date'])) {
932
  $savedData['ycd-date-time-picker'] = $args['date'];
933
  }
934
  $this->setSavedData($savedData);
935
+ }
936
+
937
+ public static function getCountdownsIdAndTitle($args) {
938
+
939
  $allCountdowns = self::getCountdownsObj();
940
+ $allowedTypes = (!empty($args['allowTypes'])) ? $args['allowTypes'] : array();
941
+ $exceptTypes = (!empty($args['except'])) ? $args['except'] : array();
942
+ $idTitles = array('' => 'Select Countdown');
943
+
944
+ foreach ($allCountdowns as $countdown) {
945
+ $type = $countdown->getType();
946
+ if (is_array($allowedTypes) && !empty($allowedTypes) && !in_array($type, $allowedTypes)) {
947
+ continue;
948
+ }
949
+ if (is_array($exceptTypes) && !empty($exceptTypes) && in_array($type, $exceptTypes)) {
950
+ continue;
951
+ }
952
+ $id = $countdown->getId();
953
+ $title = $countdown->getTitle();
954
+
955
+ if (empty($title)) {
956
+ $title = '(no title)';
957
+ }
958
+ $idTitles[$id] = $title;
959
+ }
960
+
961
+ return $idTitles;
962
  }
963
 
964
  protected function getCountdownTimerAttrSeconds() {
classes/countdown/StickyCountdown.php CHANGED
@@ -7,14 +7,14 @@ class StickyCountdown extends Countdown {
7
  parent::__construct();
8
  add_action('add_meta_boxes', array($this, 'mainOptions'));
9
  add_filter('ycdCountdownDefaultOptions', array($this, 'defaultOptions'), 1, 1);
10
- add_action('ycdGeneralMetaboxes', array($this, 'metaboxes'), 10, 1);
11
  }
12
 
13
- public function metaboxes($metaboxes) {
14
- $metaboxes[YCD_PROGRESS_METABOX_KEY] = array('title' => YCD_PROGRESS_METABOX_TITLE, 'position' => 'normal', 'prioritet' => 'high');
15
-
16
- return $metaboxes;
17
- }
18
 
19
  public function defaultOptions($options) {
20
 
@@ -24,11 +24,11 @@ class StickyCountdown extends Countdown {
24
  public function includeStyles() {
25
  $this->includeGeneralScripts();
26
  $data = array(
27
- 'days' => $this->getOptionValue('ycd-sticky-countdown-days'),
28
- 'hours' => $this->getOptionValue('ycd-sticky-countdown-hours'),
29
- 'minutes' => $this->getOptionValue('ycd-sticky-countdown-minutes'),
30
- 'seconds' => $this->getOptionValue('ycd-sticky-countdown-seconds')
31
- );
32
  ScriptsIncluder::registerScript('Sticky.js', array('dirUrl' => YCD_COUNTDOWN_JS_URL, 'dep' => array('jquery')));
33
  ScriptsIncluder::localizeScript('Sticky.js', 'YCD_STICKY_ARGS', $data);
34
  ScriptsIncluder::enqueueScript('Sticky.js');
@@ -46,150 +46,163 @@ class StickyCountdown extends Countdown {
46
 
47
  public function renderLivePreview() {
48
  $typeObj = $this;
49
- require_once YCD_PREVIEW_VIEWS_PATH.'circlePreview.php';
50
- }
51
-
52
- private function renderStyles() {
53
- $id = $this->getId();
54
- $important = ' !important';
55
-
56
- if(is_admin()) {
57
- $important = '';
58
- }
59
- $paddingEnable = $this->getOptionValue('ycd-sticky-button-padding-enable');
60
- $buttonPadding = $this->getOptionValue('ycd-sticky-button-padding');
61
- $inputBgColor = $this->getOptionValue('ycd-sticky-bg-color');
62
- $inputColor = $this->getOptionValue('ycd-sticky-button-color');
63
- $stickyTextColor = $this->getOptionValue('ycd-sticky-text-color');
64
- $stickyBgColor = $this->getOptionValue('ycd-sticky-text-background-color');
65
- $stickyCountdownColor = $this->getOptionValue('ycd-sticky-countdown-text-color');
66
- $countdownSize = (int)$this->getOptionValue('ycd-stick-countdown-font-size');
67
- $countdownWeight = $this->getOptionValue('ycd-stick-countdown-font-weight');
68
-
69
- $enableBorder = $this->getOptionValue('ycd-sticky-button-border-enable');
70
- $borderWidth = $this->getOptionValue('ycd-sticky-button-border-width');
71
- $borderRadius = $this->getOptionValue('ycd-sticky-button-border-radius');
72
- $borderColor = $this->getOptionValue('ycd-sticky-button-border-color');
73
-
74
- ob_start();
75
- ?>
76
- <style type="text/css">
77
- .ycd-sticky-header-countdown {
78
- color: <?php echo $stickyCountdownColor; ?>;
79
- font-size: <?php echo $countdownSize; ?>px;
80
- font-weight: <?php echo $countdownWeight; ?>;
81
- }
82
- /* Style the header */
83
- .ycd-sticky-header {
84
- padding: 10px 16px;
85
- background: <?php echo esc_attr($stickyBgColor); ?>;
86
- color: <?php echo $stickyTextColor; ?>;
87
- }
88
-
89
- .ycd-sticky-header-child {
90
- width: 33%;
91
- display: inline-block;
92
- text-align: center;
93
- }
94
-
95
- /* Page content */
96
- .ycd-sticky-content {
97
- padding: 16px;
98
- }
99
-
100
- /* The sticky class is added to the header with JS when it reaches its scroll position */
101
- .ycd-sticky {
102
- position: fixed;
103
- top: 0;
104
- width: 100%;
105
- z-index: 9999999999999999999999999999999999999999;
106
- }
107
-
108
- /* Add some top padding to the page content to prevent sudden quick movement (as the header gets a new position at the top of the page (position:fixed and top:0) */
109
- .ycd-sticky + .ycd-sticky-content {
110
- padding-top: 102px;
111
- }
112
- .ycd-sticky-button {
113
- background-color: <?php echo $inputBgColor.$important; ?>;
114
- color: <?php echo $inputColor.$important; ?>;
115
- }
116
- <?php if (!empty($paddingEnable)): ?>
117
- .ycd-sticky-button {
118
- padding: <?php echo $buttonPadding.' '.$important; ?>;
119
- }
120
- <?php endif; ?>
121
- <?php if (!empty($enableBorder)): ?>
122
- .ycd-sticky-button {
123
- border: <?php echo $borderWidth.' solid '.$borderColor.' '.$important; ?>;
124
- border-radius: <?php echo $borderRadius.' '.$important; ?>;
125
- <?php endif; ?>
126
- </style>
127
- <?php
128
- $styles = ob_get_contents();
129
- ob_get_clean();
130
-
131
- echo $styles;
132
- }
133
-
134
- private function getStickyContent() {
135
- $id = $this->getId();
136
-
137
- // time setting
138
- $settings = array();
139
- $endDate = $this->getOptionValue('ycd-date-time-picker');
140
- $timeZone = $this->getOptionValue('ycd-circle-time-zone');
141
- $settings['endDate'] = $endDate;
142
- $settings['timeZone'] = $timeZone;
143
- $settings['ycd-countdown-end-sound'] = $this->getOptionValue('ycd-countdown-end-sound');
144
- $settings['ycd-countdown-end-sound-url'] = $this->getOptionValue('ycd-countdown-end-sound-url');
145
- $settings['ycd-sticky-button-redirect-new-tab'] = $this->getOptionValue('ycd-sticky-button-redirect-new-tab');
146
- $settings['ycd-countdown-expire-behavior'] = $this->getOptionValue('ycd-countdown-expire-behavior');
147
- $settings['ycd-expire-text'] = $this->getOptionValue('ycd-expire-text');
148
- $settings['ycd-expire-url'] = $this->getOptionValue('ycd-expire-url');
149
- $settings['id'] = $id;
150
- $settings['ycd-countdown-date-type'] = $this->getOptionValue('ycd-countdown-date-type');
151
- $settings += $this->generalOptionsData();
 
 
 
 
 
 
 
 
 
 
 
 
 
152
 
153
- $settings = json_encode($settings);
154
-
155
- $stickyUrl = $this->getOptionValue('ycd-sticky-url');
156
- $actionUrl = "window.location.href = $stickyUrl";
157
-
158
- if (!empty($settings['ycd-sticky-button-redirect-new-tab'])) {
159
- $actionUrl = "window.open('$stickyUrl')";
160
- }
161
-
162
- $textContent = $this->getOptionValue('ycd-sticky-text');
163
- $buttonText = $this->getOptionValue('ycd-sticky-button-text');
164
-
165
- ob_start();
166
- ?>
167
- <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); ?>">
168
- <div class="ycd-sticky-header-child ycd-sticky-header-text">
169
- <?php echo $textContent; ?>
170
- </div>
171
- <div class="ycd-sticky-header-child ycd-sticky-header-countdown">
172
- <div class="ycd-sticky-clock"></div>
173
- <?php echo $this->renderProgressBar(); ?>
174
- </div>
175
- <div class="ycd-sticky-header-child ycd-sticky-header-button">
176
- <input type="button" class="ycd-sticky-button" onclick="<?php echo $actionUrl; ?>" value="<?php echo esc_attr($buttonText); ?>">
177
- </div>
178
- <div>
179
- <?php echo $this->renderSubscriptionForm(); ?>
180
- </div>
181
- </div>
182
- <?php
183
- $content = ob_get_contents();
184
- ob_end_clean();
185
- $content .= $this->renderStyles();
186
-
187
- return $content;
188
- }
189
-
190
- public function addToContent() {
191
- return $this->getViewContent();
192
- }
193
 
194
  public function getViewContent() {
195
  $this->includeStyles();
7
  parent::__construct();
8
  add_action('add_meta_boxes', array($this, 'mainOptions'));
9
  add_filter('ycdCountdownDefaultOptions', array($this, 'defaultOptions'), 1, 1);
10
+ add_action('ycdGeneralMetaboxes', array($this, 'metaboxes'), 10, 1);
11
  }
12
 
13
+ public function metaboxes($metaboxes) {
14
+ $metaboxes[YCD_PROGRESS_METABOX_KEY] = array('title' => YCD_PROGRESS_METABOX_TITLE, 'position' => 'normal', 'prioritet' => 'high');
15
+
16
+ return $metaboxes;
17
+ }
18
 
19
  public function defaultOptions($options) {
20
 
24
  public function includeStyles() {
25
  $this->includeGeneralScripts();
26
  $data = array(
27
+ 'days' => $this->getOptionValue('ycd-sticky-countdown-days'),
28
+ 'hours' => $this->getOptionValue('ycd-sticky-countdown-hours'),
29
+ 'minutes' => $this->getOptionValue('ycd-sticky-countdown-minutes'),
30
+ 'seconds' => $this->getOptionValue('ycd-sticky-countdown-seconds')
31
+ );
32
  ScriptsIncluder::registerScript('Sticky.js', array('dirUrl' => YCD_COUNTDOWN_JS_URL, 'dep' => array('jquery')));
33
  ScriptsIncluder::localizeScript('Sticky.js', 'YCD_STICKY_ARGS', $data);
34
  ScriptsIncluder::enqueueScript('Sticky.js');
46
 
47
  public function renderLivePreview() {
48
  $typeObj = $this;
49
+ require_once YCD_PREVIEW_VIEWS_PATH.'circlePreview.php';
50
+ }
51
+
52
+ private function renderStyles() {
53
+ $id = $this->getId();
54
+ $important = ' !important';
55
+
56
+ if(is_admin()) {
57
+ $important = '';
58
+ }
59
+ $paddingEnable = $this->getOptionValue('ycd-sticky-button-padding-enable');
60
+ $buttonPadding = $this->getOptionValue('ycd-sticky-button-padding');
61
+ $inputBgColor = $this->getOptionValue('ycd-sticky-bg-color');
62
+ $inputColor = $this->getOptionValue('ycd-sticky-button-color');
63
+ $stickyTextColor = $this->getOptionValue('ycd-sticky-text-color');
64
+ $stickyBgColor = $this->getOptionValue('ycd-sticky-text-background-color');
65
+ $stickyCountdownColor = $this->getOptionValue('ycd-sticky-countdown-text-color');
66
+ $countdownSize = (int)$this->getOptionValue('ycd-stick-countdown-font-size');
67
+ $countdownWeight = $this->getOptionValue('ycd-stick-countdown-font-weight');
68
+
69
+ $enableBorder = $this->getOptionValue('ycd-sticky-button-border-enable');
70
+ $borderWidth = $this->getOptionValue('ycd-sticky-button-border-width');
71
+ $borderRadius = $this->getOptionValue('ycd-sticky-button-border-radius');
72
+ $borderColor = $this->getOptionValue('ycd-sticky-button-border-color');
73
+
74
+ ob_start();
75
+ ?>
76
+ <style type="text/css">
77
+ .ycd-sticky-header-countdown {
78
+ color: <?php echo $stickyCountdownColor; ?>;
79
+ font-size: <?php echo $countdownSize; ?>px;
80
+ font-weight: <?php echo $countdownWeight; ?>;
81
+ }
82
+ /* Style the header */
83
+ .ycd-sticky-header {
84
+ padding: 10px 16px;
85
+ background: <?php echo esc_attr($stickyBgColor); ?>;
86
+ color: <?php echo $stickyTextColor; ?>;
87
+ }
88
+
89
+ .ycd-sticky-header-child {
90
+ width: 33%;
91
+ display: inline-block;
92
+ text-align: center;
93
+ vertical-align: middle;
94
+ }
95
+
96
+ /* Page content */
97
+ .ycd-sticky-content {
98
+ padding: 16px;
99
+ }
100
+
101
+ /* The sticky class is added to the header with JS when it reaches its scroll position */
102
+ .ycd-sticky {
103
+ position: fixed;
104
+ top: 0;
105
+ width: 100%;
106
+ z-index: 9999999999999999999999999999999999999999;
107
+ }
108
+
109
+ /* Add some top padding to the page content to prevent sudden quick movement (as the header gets a new position at the top of the page (position:fixed and top:0) */
110
+ .ycd-sticky + .ycd-sticky-content {
111
+ padding-top: 102px;
112
+ }
113
+ .ycd-sticky-button {
114
+ background-color: <?php echo $inputBgColor.$important; ?>;
115
+ color: <?php echo $inputColor.$important; ?>;
116
+ }
117
+ <?php if (!empty($paddingEnable)): ?>
118
+ .ycd-sticky-button {
119
+ padding: <?php echo $buttonPadding.' '.$important; ?>;
120
+ }
121
+ <?php endif; ?>
122
+ <?php if (!empty($enableBorder)): ?>
123
+ .ycd-sticky-button {
124
+ border: <?php echo $borderWidth.' solid '.$borderColor.' '.$important; ?>;
125
+ border-radius: <?php echo $borderRadius.' '.$important; ?>;
126
+ <?php endif; ?>
127
+ </style>
128
+ <?php
129
+ $styles = ob_get_contents();
130
+ ob_get_clean();
131
+
132
+ echo $styles;
133
+ }
134
+
135
+ private function renderCountdown() {
136
+ $type = $this->getOptionValue('ycd-sticky-countdown-mode');
137
+
138
+ if ($type == 'stickyCountdownDefault') {
139
+ return '<div class="ycd-sticky-clock"></div>';
140
+ }
141
+ $id = $this->getOptionValue('ycd-sticky-countdown');
142
+ $content = do_shortcode('[ycd_countdown id='.$id.']');
143
+
144
+ return $content;
145
+ }
146
+
147
+ private function getStickyContent() {
148
+ $id = $this->getId();
149
+
150
+ // time setting
151
+ $settings = array();
152
+ $endDate = $this->getOptionValue('ycd-date-time-picker');
153
+ $timeZone = $this->getOptionValue('ycd-circle-time-zone');
154
+ $settings['endDate'] = $endDate;
155
+ $settings['timeZone'] = $timeZone;
156
+ $settings['ycd-countdown-end-sound'] = $this->getOptionValue('ycd-countdown-end-sound');
157
+ $settings['ycd-countdown-end-sound-url'] = $this->getOptionValue('ycd-countdown-end-sound-url');
158
+ $settings['ycd-sticky-button-redirect-new-tab'] = $this->getOptionValue('ycd-sticky-button-redirect-new-tab');
159
+ $settings['ycd-countdown-expire-behavior'] = $this->getOptionValue('ycd-countdown-expire-behavior');
160
+ $settings['ycd-expire-text'] = $this->getOptionValue('ycd-expire-text');
161
+ $settings['ycd-expire-url'] = $this->getOptionValue('ycd-expire-url');
162
+ $settings['id'] = $id;
163
+ $settings['ycd-countdown-date-type'] = $this->getOptionValue('ycd-countdown-date-type');
164
+ $settings += $this->generalOptionsData();
165
 
166
+ $settings = json_encode($settings);
167
+
168
+ $stickyUrl = $this->getOptionValue('ycd-sticky-url');
169
+ $actionUrl = "window.location.href = '$stickyUrl'";
170
+
171
+ if (!empty($settings['ycd-sticky-button-redirect-new-tab'])) {
172
+ $actionUrl = "window.open('$stickyUrl')";
173
+ }
174
+
175
+ $textContent = $this->getOptionValue('ycd-sticky-text');
176
+ $buttonText = $this->getOptionValue('ycd-sticky-button-text');
177
+
178
+ ob_start();
179
+ ?>
180
+ <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); ?>">
181
+ <div class="ycd-sticky-header-child ycd-sticky-header-text">
182
+ <?php echo $textContent; ?>
183
+ </div>
184
+ <div class="ycd-sticky-header-child ycd-sticky-header-countdown">
185
+ <?php echo $this->renderCountdown(); ?>
186
+ <?php echo $this->renderProgressBar(); ?>
187
+ </div>
188
+ <div class="ycd-sticky-header-child ycd-sticky-header-button">
189
+ <input type="button" class="ycd-sticky-button" onclick="<?php echo $actionUrl; ?>" value="<?php echo esc_attr($buttonText); ?>">
190
+ </div>
191
+ <div>
192
+ <?php echo $this->renderSubscriptionForm(); ?>
193
+ </div>
194
+ </div>
195
+ <?php
196
+ $content = ob_get_contents();
197
+ ob_end_clean();
198
+ $content .= $this->renderStyles();
199
+
200
+ return $content;
201
+ }
202
+
203
+ public function addToContent() {
204
+ return $this->getViewContent();
205
+ }
206
 
207
  public function getViewContent() {
208
  $this->includeStyles();
config/config.php CHANGED
@@ -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.8.9';
83
  if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
84
- $versionText = '1.7.5';
85
  }
86
  self::addDefine('YCD_VERSION_TEXT', $versionText);
87
- self::addDefine('YCD_LAST_UPDATE', 'Sep 29');
88
- self::addDefine('YCD_NEXT_UPDATE', 'Oct 29');
89
  }
90
 
91
  public static function displaySettings() {
79
  self::addDefine('YCD_EXTENSION_VERSION', 99);
80
  require_once(dirname(__FILE__).'/config-pkg.php');
81
 
82
+ $versionText = '1.9.0';
83
  if (YCD_PKG_VERSION != YCD_FREE_VERSION) {
84
+ $versionText = '1.7.6';
85
  }
86
  self::addDefine('YCD_VERSION_TEXT', $versionText);
87
+ self::addDefine('YCD_LAST_UPDATE', 'Oct 18');
88
+ self::addDefine('YCD_NEXT_UPDATE', 'Nov 28');
89
  }
90
 
91
  public static function displaySettings() {
config/optionsConfig.php CHANGED
@@ -290,6 +290,7 @@ class YcdCountdownOptionsConfig {
290
  $options[] = array('name' => 'ycd-sticky-button-border-radius', 'type' => 'text', 'defaultValue' => '0px');
291
  $options[] = array('name' => 'ycd-stick-countdown-font-weight', 'type' => 'text', 'defaultValue' => 'inherit');
292
  $options[] = array('name' => 'ycd-sticky-button-redirect-new-tab', 'type' => 'checkbox', 'defaultValue' => '');
 
293
 
294
  $YCD_OPTIONS = apply_filters('ycdCountdownDefaultOptions', $options);
295
  }
290
  $options[] = array('name' => 'ycd-sticky-button-border-radius', 'type' => 'text', 'defaultValue' => '0px');
291
  $options[] = array('name' => 'ycd-stick-countdown-font-weight', 'type' => 'text', 'defaultValue' => 'inherit');
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
 
295
  $YCD_OPTIONS = apply_filters('ycdCountdownDefaultOptions', $options);
296
  }
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.8.9
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.0
6
  * Author: Adam Skaat
7
  * Author URI: https://edmonsoft.com/countdown
8
  * License: GPLv2
helpers/AdminHelper.php CHANGED
@@ -329,6 +329,48 @@ class AdminHelper {
329
  )
330
  );
331
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  $data['woo-show-products'] = array(
333
  'template' => array(
334
  'fieldWrapperAttr' => array(
@@ -1376,4 +1418,8 @@ class AdminHelper {
1376
  delete_option($optionKey);
1377
  }
1378
  }
 
 
 
 
1379
  }
329
  )
330
  );
331
 
332
+ $data['stickyCountdownMode'] =array(
333
+ 'template' => array(
334
+ 'fieldWrapperAttr' => array(
335
+ 'class' => 'col-md-6 ycd-choice-option-wrapper'
336
+ ),
337
+ 'labelAttr' => array(
338
+ 'class' => 'col-md-6 ycd-choice-option-wrapper'
339
+ ),
340
+ 'groupWrapperAttr' => array(
341
+ 'class' => 'row form-group ycd-choice-wrapper'
342
+ )
343
+ ),
344
+ 'buttonPosition' => 'right',
345
+ 'nextNewLine' => true,
346
+ 'fields' => array(
347
+ array(
348
+ 'attr' => array(
349
+ 'type' => 'radio',
350
+ 'name' => 'ycd-sticky-countdown-mode',
351
+ 'class' => ' ycd-form-radio',
352
+ 'data-attr-href' => 'ycd-sticky-countdown-default',
353
+ 'value' => 'stickyCountdownDefault'
354
+ ),
355
+ 'label' => array(
356
+ 'name' => __('Default', YCD_TEXT_DOMAIN)
357
+ )
358
+ ),
359
+ array(
360
+ 'attr' => array(
361
+ 'type' => 'radio',
362
+ 'name' => 'ycd-sticky-countdown-mode',
363
+ 'class' => 'ycd-form-radio',
364
+ 'data-attr-href' => 'ycd-sticky-countdown-custom',
365
+ 'value' => 'stickyCountdownCustom'
366
+ ),
367
+ 'label' => array(
368
+ 'name' => __('Custom', YCD_TEXT_DOMAIN)
369
+ )
370
+ )
371
+ )
372
+ );
373
+
374
  $data['woo-show-products'] = array(
375
  'template' => array(
376
  'fieldWrapperAttr' => array(
1418
  delete_option($optionKey);
1419
  }
1420
  }
1421
+
1422
+ public static function getCreateCountdownUrl() {
1423
+ return (YCD_COUNTDOWN_ADMIN_URL.'edit.php?post_type='.YCD_COUNTDOWN_POST_TYPE.'&page='.YCD_COUNTDOWN_POST_TYPE);
1424
+ }
1425
  }
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.1
6
- Stable tag: 1.8.9
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -66,6 +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
  = 1.8.9 =
70
  * Added Demo website
71
  * Improved deactivation survey
3
  Tags: countdown, timer, countdown timer
4
  Requires at least: 3.8
5
  Tested up to: 5.5.1
6
+ Stable tag: 1.9.0
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.0 =
70
+ * Inside Sticky Countdown type, added possibility select another countdown type to show countdown
71
+ * Coming Soon type code improvements
72
+
73
  = 1.8.9 =
74
  * Added Demo website
75
  * Improved deactivation survey