Version Description
- NEW: Shortcode generator. Generate Timer Shortcode quickly. Compatible with all Wordpress Themes.
- Other bug fixes
Download this release
Release Info
Developer | ujimoto |
Plugin | Uji Countdown |
Version | 2.2 |
Comparing to | |
See all releases |
Code changes from version 2.1.3 to 2.2
- README.txt +5 -1
- assets/css/admin.css +96 -24
- assets/css/purple.png +0 -0
- assets/css/purple@2x.png +0 -0
- assets/css/ujic-style.css +4 -3
- assets/images/icon-sc.png +0 -0
- assets/js/admin-shortcode.js +195 -0
- assets/js/admin-ujic.js +607 -241
- assets/js/jquery.icheck.min.js +18 -11
- assets/js/ujic-popup-button.js +452 -352
- assets/js/widget.js +44 -40
- classes/class-uji-countdown-admin.php +213 -26
- classes/class-uji-countdown.php +19 -7
- classes/uji-functions.php +59 -0
- ujicountdown.php +13 -3
- views/admin.php +9 -3
README.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.wpmanage.com/uji-countdown
|
|
4 |
Tags: countdown timer, countdown, counter, js countdown, animated countdown, countdown timer, count down, countdown clock, jQuery countdown, clock, timer, recurring timer
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.9
|
7 |
-
Stable tag: 2.
|
8 |
|
9 |
Uji Countdown - Customizable Countdown Timer
|
10 |
|
@@ -51,6 +51,10 @@ Please feel free to visit our [demo site](http://wpmanage.com/project/ujicountdo
|
|
51 |
|
52 |
== Changelog ==
|
53 |
|
|
|
|
|
|
|
|
|
54 |
= 2.1.3 =
|
55 |
* Compatibility fixes
|
56 |
* Added redirect URL information in blocks
|
4 |
Tags: countdown timer, countdown, counter, js countdown, animated countdown, countdown timer, count down, countdown clock, jQuery countdown, clock, timer, recurring timer
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.9
|
7 |
+
Stable tag: 2.2
|
8 |
|
9 |
Uji Countdown - Customizable Countdown Timer
|
10 |
|
51 |
|
52 |
== Changelog ==
|
53 |
|
54 |
+
= 2.2 =
|
55 |
+
* NEW: Shortcode generator. Generate Timer Shortcode quickly. Compatible with all Wordpress Themes.
|
56 |
+
* Other bug fixes
|
57 |
+
|
58 |
= 2.1.3 =
|
59 |
* Compatibility fixes
|
60 |
* Added redirect URL information in blocks
|
assets/css/admin.css
CHANGED
@@ -1,3 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/*
|
2 |
============================================================================
|
3 |
Admin NEW
|
@@ -156,6 +222,13 @@ Admin Form
|
|
156 |
padding-bottom: 15px;
|
157 |
}
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
.ujic-settings .ujic-box {
|
160 |
border-bottom: 0;
|
161 |
}
|
@@ -265,13 +338,6 @@ Admin Form
|
|
265 |
background: url(../images/classic.png) center 1px no-repeat;
|
266 |
}
|
267 |
|
268 |
-
#ujic-style-modern{
|
269 |
-
background: url(../images/modern.png) center 1px no-repeat;
|
270 |
-
}
|
271 |
-
|
272 |
-
#ujic-style-custom{
|
273 |
-
background: url(../images/custom.png) center 1px no-repeat;
|
274 |
-
}
|
275 |
/*
|
276 |
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2) {
|
277 |
#ujic-style-classic{
|
@@ -434,13 +500,34 @@ Preview Style
|
|
434 |
margin: 5px 0 0 0;
|
435 |
}
|
436 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
/*
|
438 |
============================================================================
|
439 |
Newsletter
|
440 |
============================================================================
|
441 |
*/
|
442 |
|
443 |
-
|
444 |
.ujicf:after { clear: both; }
|
445 |
.ujicf { *zoom: 1; }
|
446 |
|
@@ -527,23 +614,8 @@ Newsletter
|
|
527 |
color: #fff;
|
528 |
background: linear-gradient(to bottom , #c816d0, #ab02b2) repeat scroll 0 0 rgba(0, 0, 0, 0);
|
529 |
float:left;
|
530 |
-
}
|
531 |
-
|
532 |
-
/*
|
533 |
-
============================================================================
|
534 |
-
Modern Style
|
535 |
-
============================================================================
|
536 |
-
*/
|
537 |
-
|
538 |
-
.ujic-modern .ujicircle{
|
539 |
-
display: inline-block;
|
540 |
-
margin: 0.5em;
|
541 |
-
}
|
542 |
|
543 |
-
.ujic-modern .circles-wrp span.countdown_txt {
|
544 |
-
text-align: center;
|
545 |
-
display: block;
|
546 |
-
}
|
547 |
|
548 |
/*
|
549 |
============================================================================
|
1 |
+
/* iCheck plugin Flat skin, purple
|
2 |
+
----------------------------------- */
|
3 |
+
.icheckbox_flat-purple,
|
4 |
+
.iradio_flat-purple {
|
5 |
+
display: inline-block;
|
6 |
+
*display: inline;
|
7 |
+
vertical-align: middle;
|
8 |
+
margin: 0;
|
9 |
+
padding: 0;
|
10 |
+
width: 20px;
|
11 |
+
height: 20px;
|
12 |
+
background: url(purple.png) no-repeat;
|
13 |
+
border: none;
|
14 |
+
cursor: pointer;
|
15 |
+
}
|
16 |
+
|
17 |
+
.icheckbox_flat-purple {
|
18 |
+
background-position: 0 0;
|
19 |
+
}
|
20 |
+
.icheckbox_flat-purple.checked {
|
21 |
+
background-position: -22px 0;
|
22 |
+
}
|
23 |
+
.icheckbox_flat-purple.disabled {
|
24 |
+
background-position: -44px 0;
|
25 |
+
cursor: default;
|
26 |
+
}
|
27 |
+
.icheckbox_flat-purple.checked.disabled {
|
28 |
+
background-position: -66px 0;
|
29 |
+
}
|
30 |
+
|
31 |
+
.iradio_flat-purple {
|
32 |
+
background-position: -88px 0;
|
33 |
+
}
|
34 |
+
.iradio_flat-purple.checked {
|
35 |
+
background-position: -110px 0;
|
36 |
+
}
|
37 |
+
.iradio_flat-purple.disabled {
|
38 |
+
background-position: -132px 0;
|
39 |
+
cursor: default;
|
40 |
+
}
|
41 |
+
.iradio_flat-purple.checked.disabled {
|
42 |
+
background-position: -154px 0;
|
43 |
+
}
|
44 |
+
|
45 |
+
/* HiDPI support */
|
46 |
+
@media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) {
|
47 |
+
.icheckbox_flat-purple,
|
48 |
+
.iradio_flat-purple {
|
49 |
+
background-image: url(purple@2x.png);
|
50 |
+
-webkit-background-size: 176px 22px;
|
51 |
+
background-size: 176px 22px;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
/*
|
58 |
+
============================================================================
|
59 |
+
Notyf v3.0.0
|
60 |
+
============================================================================
|
61 |
+
*/
|
62 |
+
|
63 |
+
|
64 |
+
@-webkit-keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@-webkit-keyframes notyf-fadeinleft{0%{opacity:0;transform:translateX(25%)}to{opacity:1;transform:translateX(0)}}@keyframes notyf-fadeinleft{0%{opacity:0;transform:translateX(25%)}to{opacity:1;transform:translateX(0)}}@-webkit-keyframes notyf-fadeoutright{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(25%)}}@keyframes notyf-fadeoutright{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(25%)}}@-webkit-keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@-webkit-keyframes ripple{0%{transform:scale(0) translateY(-45%) translateX(13%)}to{transform:scale(1) translateY(-45%) translateX(13%)}}@keyframes ripple{0%{transform:scale(0) translateY(-45%) translateX(13%)}to{transform:scale(1) translateY(-45%) translateX(13%)}}.notyf{position:fixed;top:0;left:0;height:100%;width:100%;color:#fff;z-index:9999;display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-end;pointer-events:none;box-sizing:border-box;padding:20px}.notyf__icon--error,.notyf__icon--success{height:21px;width:21px;background:#fff;border-radius:50%;display:block;margin:0 auto;position:relative}.notyf__icon--error:after,.notyf__icon--error:before{content:"";background:currentColor;display:block;position:absolute;width:3px;border-radius:3px;left:9px;height:12px;top:5px}.notyf__icon--error:after{transform:rotate(-45deg)}.notyf__icon--error:before{transform:rotate(45deg)}.notyf__icon--success:after,.notyf__icon--success:before{content:"";background:currentColor;display:block;position:absolute;width:3px;border-radius:3px}.notyf__icon--success:after{height:6px;transform:rotate(-45deg);top:9px;left:6px}.notyf__icon--success:before{height:11px;transform:rotate(45deg);top:5px;left:10px}.notyf__toast{display:block;overflow:hidden;pointer-events:auto;-webkit-animation:notyf-fadeinup .3s ease-in forwards;animation:notyf-fadeinup .3s ease-in forwards;box-shadow:0 3px 7px 0 rgba(0,0,0,.25);position:relative;padding:0 15px;border-radius:2px;max-width:300px;transform:translateY(25%);box-sizing:border-box;flex-shrink:0}.notyf__toast--disappear{transform:translateY(0);-webkit-animation:notyf-fadeoutdown .3s forwards;animation:notyf-fadeoutdown .3s forwards;-webkit-animation-delay:.25s;animation-delay:.25s}.notyf__toast--disappear .notyf__icon,.notyf__toast--disappear .notyf__message{-webkit-animation:notyf-fadeoutdown .3s forwards;animation:notyf-fadeoutdown .3s forwards;opacity:1;transform:translateY(0)}.notyf__toast--disappear .notyf__dismiss{-webkit-animation:notyf-fadeoutright .3s forwards;animation:notyf-fadeoutright .3s forwards;opacity:1;transform:translateX(0)}.notyf__toast--disappear .notyf__message{-webkit-animation-delay:.05s;animation-delay:.05s}.notyf__toast--upper{margin-bottom:20px}.notyf__toast--lower{margin-top:20px}.notyf__toast--dismissible .notyf__wrapper{padding-right:30px}.notyf__ripple{height:400px;width:400px;position:absolute;transform-origin:bottom right;right:0;top:0;border-radius:50%;transform:scale(0) translateY(-51%) translateX(13%);z-index:5;-webkit-animation:ripple .4s ease-out forwards;animation:ripple .4s ease-out forwards}.notyf__wrapper{display:flex;align-items:center;padding-top:17px;padding-bottom:17px;padding-right:15px;border-radius:3px;position:relative;z-index:10}.notyf__icon{width:22px;text-align:center;font-size:1.3em;opacity:0;-webkit-animation:notyf-fadeinup .3s forwards;animation:notyf-fadeinup .3s forwards;-webkit-animation-delay:.3s;animation-delay:.3s;margin-right:13px}.notyf__dismiss{position:absolute;top:0;right:0;height:100%;width:26px;margin-right:-15px;-webkit-animation:notyf-fadeinleft .3s forwards;animation:notyf-fadeinleft .3s forwards;-webkit-animation-delay:.35s;animation-delay:.35s;opacity:0}.notyf__dismiss-btn{background-color:rgba(0,0,0,.25);border:none;cursor:pointer;transition:opacity .2s ease,background-color .2s ease;outline:none;opacity:.35;height:100%;width:100%}.notyf__dismiss-btn:after,.notyf__dismiss-btn:before{content:"";background:#fff;height:12px;width:2px;border-radius:3px;position:absolute;left:calc(50% - 1px);top:calc(50% - 5px)}.notyf__dismiss-btn:after{transform:rotate(-45deg)}.notyf__dismiss-btn:before{transform:rotate(45deg)}.notyf__dismiss-btn:hover{opacity:.7;background-color:rgba(0,0,0,.15)}.notyf__dismiss-btn:active{opacity:.8}.notyf__message{vertical-align:middle;position:relative;opacity:0;-webkit-animation:notyf-fadeinup .3s forwards;animation:notyf-fadeinup .3s forwards;-webkit-animation-delay:.25s;animation-delay:.25s;line-height:1.5em}@media only screen and (max-width:480px){.notyf{padding:0}.notyf__ripple{height:600px;width:600px;-webkit-animation-duration:.5s;animation-duration:.5s}.notyf__toast{max-width:none;border-radius:0;box-shadow:0 -2px 7px 0 rgba(0,0,0,.13);width:100%}.notyf__dismiss{width:56px}}
|
65 |
+
|
66 |
+
|
67 |
/*
|
68 |
============================================================================
|
69 |
Admin NEW
|
222 |
padding-bottom: 15px;
|
223 |
}
|
224 |
|
225 |
+
.ujic-block-box{
|
226 |
+
display: block;
|
227 |
+
width: 100%;
|
228 |
+
padding: 15px 0 0 200px;
|
229 |
+
float: left;
|
230 |
+
}
|
231 |
+
|
232 |
.ujic-settings .ujic-box {
|
233 |
border-bottom: 0;
|
234 |
}
|
338 |
background: url(../images/classic.png) center 1px no-repeat;
|
339 |
}
|
340 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
/*
|
342 |
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2) {
|
343 |
#ujic-style-classic{
|
500 |
margin: 5px 0 0 0;
|
501 |
}
|
502 |
|
503 |
+
/*
|
504 |
+
============================================================================
|
505 |
+
Admin Shortcode
|
506 |
+
============================================================================
|
507 |
+
*/
|
508 |
+
|
509 |
+
.ujic_date_admin {
|
510 |
+
background: url("../images/data-picker.png") no-repeat scroll right top;
|
511 |
+
display:block;
|
512 |
+
|
513 |
+
}
|
514 |
+
|
515 |
+
#ujic-scode {
|
516 |
+
background: #efefef;
|
517 |
+
padding: 15px 20px;
|
518 |
+
font-size: 1em;
|
519 |
+
font-weight: 500;
|
520 |
+
margin-bottom: 10px;
|
521 |
+
}
|
522 |
+
|
523 |
+
|
524 |
/*
|
525 |
============================================================================
|
526 |
Newsletter
|
527 |
============================================================================
|
528 |
*/
|
529 |
|
530 |
+
/*.ujicf:before, .ujicf:after { content: ""; display: table; }
|
531 |
.ujicf:after { clear: both; }
|
532 |
.ujicf { *zoom: 1; }
|
533 |
|
614 |
color: #fff;
|
615 |
background: linear-gradient(to bottom , #c816d0, #ab02b2) repeat scroll 0 0 rgba(0, 0, 0, 0);
|
616 |
float:left;
|
617 |
+
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
618 |
|
|
|
|
|
|
|
|
|
619 |
|
620 |
/*
|
621 |
============================================================================
|
assets/css/purple.png
ADDED
Binary file
|
assets/css/purple@2x.png
ADDED
Binary file
|
assets/css/ujic-style.css
CHANGED
@@ -26,7 +26,7 @@ i.ujic-own-icon {
|
|
26 |
}
|
27 |
|
28 |
#uji-contdown-pop #ujic-datapick{
|
29 |
-
background: #f7f7f7 url(images/data-picker.png) right top no-repeat;
|
30 |
}
|
31 |
|
32 |
/* CSS for high-resolution devices */
|
@@ -35,12 +35,13 @@ i.ujic-own-icon {
|
|
35 |
(min-resolution: 192dpi) {
|
36 |
/* - datapicker */
|
37 |
#uji-contdown-pop #ujic-datapick{
|
38 |
-
background: #f7f7f7 url(images/data-picker@2.png) top right no-repeat;
|
39 |
}
|
40 |
}
|
41 |
|
42 |
#uji-contdown-pop #ujic_hou,
|
43 |
-
#uji-contdown-pop #ujic_min
|
|
|
44 |
width: 60px!important;
|
45 |
}
|
46 |
|
26 |
}
|
27 |
|
28 |
#uji-contdown-pop #ujic-datapick{
|
29 |
+
background: #f7f7f7 url(../images/data-picker.png) right top no-repeat;
|
30 |
}
|
31 |
|
32 |
/* CSS for high-resolution devices */
|
35 |
(min-resolution: 192dpi) {
|
36 |
/* - datapicker */
|
37 |
#uji-contdown-pop #ujic-datapick{
|
38 |
+
background: #f7f7f7 url(../images/data-picker@2.png) top right no-repeat;
|
39 |
}
|
40 |
}
|
41 |
|
42 |
#uji-contdown-pop #ujic_hou,
|
43 |
+
#uji-contdown-pop #ujic_min,
|
44 |
+
#uji-contdown-pop .mce-ujic_time_inp{
|
45 |
width: 60px!important;
|
46 |
}
|
47 |
|
assets/images/icon-sc.png
ADDED
Binary file
|
assets/js/admin-shortcode.js
ADDED
@@ -0,0 +1,195 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* clipboard.js v2.0.10
|
3 |
+
* https://clipboardjs.com/
|
4 |
+
*
|
5 |
+
* Licensed MIT © Zeno Rocha
|
6 |
+
*/
|
7 |
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return o}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),c=n.n(e);function a(t){try{return document.execCommand(t)}catch(t){return}}var f=function(t){t=c()(t);return a("cut"),t};var l=function(t){var e,n,o,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body},i="";return"string"==typeof t?(e=t,n="rtl"===document.documentElement.getAttribute("dir"),(o=document.createElement("textarea")).style.fontSize="12pt",o.style.border="0",o.style.padding="0",o.style.margin="0",o.style.position="absolute",o.style[n?"right":"left"]="-9999px",n=window.pageYOffset||document.documentElement.scrollTop,o.style.top="".concat(n,"px"),o.setAttribute("readonly",""),o.value=e,o=o,r.container.appendChild(o),i=c()(o),a("copy"),o.remove()):(i=c()(t),a("copy")),i};function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.action,n=void 0===e?"copy":e,o=t.container,e=t.target,t=t.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==e){if(!e||"object"!==r(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return t?l(t,{container:o}):e?"cut"===n?f(e):l(e,{container:o}):void 0};function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=m(n);return t=o?(t=m(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments),e=this,!(t=t)||"object"!==p(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}}function m(t){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e){t="data-clipboard-".concat(t);if(e.hasAttribute(t))return e.getAttribute(t)}var o=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(r,i());var t,e,n,o=h(r);function r(t,e){var n;return function(t){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this),(n=o.call(this)).resolveOptions(e),n.listenClick(t),n}return t=r,n=[{key:"copy",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body};return l(t,e)}},{key:"cut",value:function(t){return f(t)}},{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof t?[t]:t,e=!!document.queryCommandSupported;return t.forEach(function(t){e=e&&!!document.queryCommandSupported(t)}),e}}],(e=[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===p(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=u()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,n=this.action(e)||"copy",t=s({action:n,container:this.container,target:this.target(e),text:this.text(e)});this.emit(t?"success":"error",{action:n,text:t,trigger:e,clearSelection:function(){e&&e.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(t){return v("action",t)}},{key:"defaultTarget",value:function(t){t=v("target",t);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(t){return v("text",t)}},{key:"destroy",value:function(){this.listener.destroy()}}])&&d(t.prototype,e),n&&d(t,n),r}()},828:function(t){var e;"undefined"==typeof Element||Element.prototype.matches||((e=Element.prototype).matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector),t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},438:function(t,e,n){var u=n(828);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=u(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},879:function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},370:function(t,e,n){var f=n(879),l=n(438);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!f.string(e))throw new TypeError("Second argument must be a String");if(!f.fn(n))throw new TypeError("Third argument must be a Function");if(f.node(t))return c=e,a=n,(u=t).addEventListener(c,a),{destroy:function(){u.removeEventListener(c,a)}};if(f.nodeList(t))return o=t,r=e,i=n,Array.prototype.forEach.call(o,function(t){t.addEventListener(r,i)}),{destroy:function(){Array.prototype.forEach.call(o,function(t){t.removeEventListener(r,i)})}};if(f.string(t))return t=t,e=e,n=n,l(document.body,t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,u,c,a}},817:function(t){t.exports=function(t){var e,n="SELECT"===t.nodeName?(t.focus(),t.value):"INPUT"===t.nodeName||"TEXTAREA"===t.nodeName?((e=t.hasAttribute("readonly"))||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),e||t.removeAttribute("readonly"),t.value):(t.hasAttribute("contenteditable")&&t.focus(),n=window.getSelection(),(e=document.createRange()).selectNodeContents(t),n.removeAllRanges(),n.addRange(e),n.toString());return n}},279:function(t){function e(){}e.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,u=o.length;i<u;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=e,t.exports.TinyEmitter=e}},r={},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o(686).default;function o(t){if(r[t])return r[t].exports;var e=r[t]={exports:{}};return n[t](e,e.exports,o),e.exports}var n,r});
|
8 |
+
|
9 |
+
|
10 |
+
jQuery( function( $ ) {
|
11 |
+
// Hide Preview Shortcode
|
12 |
+
$('.ujic-sc').hide();
|
13 |
+
|
14 |
+
// Init Clipboard
|
15 |
+
var clipboard = new ClipboardJS('.ujibtn-sc-copy');
|
16 |
+
|
17 |
+
// Init Notyf
|
18 |
+
var notyf = new Notyf({position: {x:'right',y:'center'}, duration: 8000, dismissible: true });
|
19 |
+
|
20 |
+
// Init Datapicker
|
21 |
+
$('.ujic-date').find('.ujic_date_admin').datepicker({
|
22 |
+
dateFormat: 'yy/mm/dd',
|
23 |
+
});
|
24 |
+
|
25 |
+
// Init Timer Type
|
26 |
+
if ( $('input[name="ujic_type"]').is(':not(:checked)') ) {
|
27 |
+
$('.ujic_seltime').hide();
|
28 |
+
$('.ujic-date').hide();
|
29 |
+
$('.ujic-time').hide();
|
30 |
+
}
|
31 |
+
|
32 |
+
// Init After expiration
|
33 |
+
if ( $('#ujic_exp_hide').is(':checked') ) {
|
34 |
+
$('#ujic_url').parent().hide();
|
35 |
+
} else {
|
36 |
+
$('#ujic_url').parent().show();
|
37 |
+
}
|
38 |
+
|
39 |
+
// Live
|
40 |
+
|
41 |
+
// Timer Type:
|
42 |
+
$('input[name="ujic_type"]').on('ifChecked', function(event){
|
43 |
+
var radioValue = $("input[name='ujic_type']:checked").val();
|
44 |
+
|
45 |
+
if( radioValue == 'onetime' ) {
|
46 |
+
$('.ujic_seltime').show();
|
47 |
+
$('.ujic-date').show();
|
48 |
+
$('.ujic-time').hide();
|
49 |
+
}
|
50 |
+
if ( radioValue == 'repeat' ) {
|
51 |
+
$('.ujic_seltime').hide();
|
52 |
+
$('.ujic-date').hide();
|
53 |
+
$('.ujic-time').show();
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
});
|
58 |
+
|
59 |
+
// After expiration
|
60 |
+
$('#ujic_exp_hide').on('ifChecked', function(event){
|
61 |
+
$('#ujic_url').parent().hide();
|
62 |
+
});
|
63 |
+
$('#ujic_exp_hide').on('ifUnchecked', function(event){
|
64 |
+
$('#ujic_url').parent().show();
|
65 |
+
});
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
$('#uji-gen-shortcode').on('click', function(event){
|
73 |
+
event.preventDefault();
|
74 |
+
|
75 |
+
var errStart = true;
|
76 |
+
|
77 |
+
// Timer Type:
|
78 |
+
if ( errStart && !$('#ujic_style').val() ) {
|
79 |
+
notyf.error('Please select Timer Style');
|
80 |
+
errStart = false;
|
81 |
+
}
|
82 |
+
|
83 |
+
// Timer Type:
|
84 |
+
if ( errStart && !$("input[name='ujic_type']:checked").val() ) {
|
85 |
+
notyf.error('Please select Timer Type');
|
86 |
+
errStart = false;
|
87 |
+
}
|
88 |
+
//Expiration Date:
|
89 |
+
if ( errStart && $("input[name='ujic_type']:checked").val() == 'onetime' && !$("input[name='ujic_exp_date']").val()) {
|
90 |
+
notyf.error('Please enter Expiration Date');
|
91 |
+
errStart = false;
|
92 |
+
}
|
93 |
+
// Expiration Time:
|
94 |
+
// Skip
|
95 |
+
|
96 |
+
//Repeat Every:
|
97 |
+
if ( errStart && $("input[name='ujic_type']:checked").val() == 'repeat' && ( !$("input[name='ujic_thou']").val() || !$("input[name='ujic_tmin']").val() || !$("input[name='ujic_tsec']").val() ) ) {
|
98 |
+
notyf.error('Please enter Repeat Time');
|
99 |
+
errStart = false;
|
100 |
+
}
|
101 |
+
|
102 |
+
// Or go to the Link: (empty)
|
103 |
+
if ( errStart && $('input[name="ujic_exp_hide"]').is(':not(:checked)') && !$("input[name='ujic_url']").val() ){
|
104 |
+
notyf.error('Please enter Link to go after timer expired.');
|
105 |
+
errStart = false;
|
106 |
+
}
|
107 |
+
// Or go to the Link: (invalid)
|
108 |
+
if ( errStart && $('input[name="ujic_exp_hide"]').is(':not(:checked)') && $("input[name='ujic_url']").val() && !ujicValidURL($("input[name='ujic_url']").val()) ){
|
109 |
+
notyf.error('Please enter a valid Link.');
|
110 |
+
errStart = false;
|
111 |
+
}
|
112 |
+
|
113 |
+
if( errStart ) {
|
114 |
+
$('.ujic-sc').show();
|
115 |
+
notyf.success('Your shordcode has been created!');
|
116 |
+
ujic_add_shortcode();
|
117 |
+
}
|
118 |
+
|
119 |
+
});
|
120 |
+
|
121 |
+
function ujic_add_shortcode() {
|
122 |
+
var ujisc = '[ujicountdown';
|
123 |
+
//Style
|
124 |
+
var usc_style = $('#ujic_style').val();
|
125 |
+
ujisc += ' id="'+usc_style+'"';
|
126 |
+
//Exp:
|
127 |
+
//onetime
|
128 |
+
if( $("input[name='ujic_exp_date']").val() && $("input[name='ujic_type']:checked").val() == 'onetime' ) {
|
129 |
+
var usc_exp_date = $("input[name='ujic_exp_date']").val();
|
130 |
+
var usc_exp_hh = $("select[name='ujic_hh']").val();
|
131 |
+
var usc_exp_mm = $("select[name='ujic_mm']").val();
|
132 |
+
|
133 |
+
ujisc += ' expire="' + usc_exp_date + ' ' + usc_exp_hh + ':' + usc_exp_mm + '"';
|
134 |
+
}
|
135 |
+
// repeat
|
136 |
+
if( $("input[name='ujic_type']:checked").val() == 'repeat' &&
|
137 |
+
( $("input[name='ujic_thou']").val() && $("input[name='ujic_tmin']").val() && $("input[name='ujic_tsec']").val() ) ) {
|
138 |
+
var usc_rep_hh = $("input[name='ujic_thou']").val();
|
139 |
+
var usc_rep_mm = $("input[name='ujic_tmin']").val();
|
140 |
+
var usc_rep_ss = $("input[name='ujic_tsec']").val();
|
141 |
+
|
142 |
+
ujisc += ' timer="' + usc_rep_hh + ':' + usc_rep_mm + ':' + usc_rep_ss + '"';
|
143 |
+
}
|
144 |
+
// Hide
|
145 |
+
if ( $('#ujic_exp_hide').is(':checked') ) {
|
146 |
+
ujisc += ' hide="true"';
|
147 |
+
} else {
|
148 |
+
if( $("input[name='ujic_url']").val() ) {
|
149 |
+
var usc_www = $("input[name='ujic_url']").val();
|
150 |
+
ujisc += ' url="'+usc_www+'"';
|
151 |
+
}
|
152 |
+
}
|
153 |
+
// Reccuring
|
154 |
+
if( $("input[name='ujic_rec_every']").val() ){
|
155 |
+
var usc_rec = $("input[name='ujic_rec_every']").val();
|
156 |
+
ujisc += ' recurring="'+usc_rec+'"';
|
157 |
+
}
|
158 |
+
|
159 |
+
if( $("select[name='ujic_rec_time']").val() ){
|
160 |
+
var usc_rec_typ = $("select[name='ujic_rec_time']").val();
|
161 |
+
ujisc += ' rectype="'+usc_rec_typ+'"';
|
162 |
+
}
|
163 |
+
|
164 |
+
if( $("input[name='ujic_rec_repeat']").val() ) {
|
165 |
+
var usc_repeats = $("input[name='ujic_rec_repeat']").val();
|
166 |
+
ujisc += ' repeats="'+usc_repeats+'"';
|
167 |
+
}
|
168 |
+
|
169 |
+
// Subscription
|
170 |
+
if( $("input[name='ujic_camp']").val() ) {
|
171 |
+
var usc_subs = $("input[name='ujic_camp']").val();
|
172 |
+
ujisc += ' subscr="'+usc_subs+'"';
|
173 |
+
}
|
174 |
+
|
175 |
+
// [ujicountdown id="style-blue" expire="2022/02/16 18:18" hide="true" recurring="1" rectype="day" repeats="2"]
|
176 |
+
|
177 |
+
|
178 |
+
ujisc += ']';
|
179 |
+
$('#ujic-scode').text(ujisc);
|
180 |
+
}
|
181 |
+
|
182 |
+
});
|
183 |
+
|
184 |
+
|
185 |
+
|
186 |
+
|
187 |
+
function ujicValidURL(str) {
|
188 |
+
var pattern = new RegExp('^(https?:\\/\\/)?'+ // protocol
|
189 |
+
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ // domain name
|
190 |
+
'((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address
|
191 |
+
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path
|
192 |
+
'(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string
|
193 |
+
'(\\#[-a-z\\d_]*)?$','i'); // fragment locator
|
194 |
+
return !!pattern.test(str);
|
195 |
+
}
|
assets/js/admin-ujic.js
CHANGED
@@ -1,101 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
jQuery.noConflict();
|
2 |
|
3 |
var slider_uji = [];
|
4 |
|
5 |
-
/** Fire up jQuery - let's dance!
|
6 |
*/
|
7 |
jQuery(document).ready(function ($) {
|
|
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
var sId = "#" + obj.data('id');
|
18 |
-
var val = parseInt(obj.data('val'));
|
19 |
-
var min = parseInt(obj.data('min'));
|
20 |
-
var max = parseInt(obj.data('max'));
|
21 |
-
var step = parseInt(obj.data('step'));
|
22 |
-
|
23 |
-
//slider init
|
24 |
-
obj.slider({
|
25 |
-
value: val,
|
26 |
-
min: min,
|
27 |
-
max: max,
|
28 |
-
step: step,
|
29 |
-
range: "min",
|
30 |
-
slide: function (event, ui) {
|
31 |
-
jQuery(sId).val(ui.value);
|
32 |
-
if("#ujic_size" == sId)
|
33 |
-
window[fname].the_size(ui.value);
|
34 |
-
if("#ujic_thick" == sId)
|
35 |
-
window[fname].the_thick(ui.value);
|
36 |
-
if("#ujic_lab_sz" == sId)
|
37 |
-
window[fname].the_lab_sz(ui.value);
|
38 |
-
|
39 |
-
//Ad Slider extension
|
40 |
-
if (typeof slider_uji !== 'undefined' && slider_uji.length > 0) {
|
41 |
-
//console.log(slider_uji.length);
|
42 |
-
for (s = 0; s < slider_uji.length; s++) {
|
43 |
-
if(slider_uji[s].id == sId)
|
44 |
-
window[slider_uji[s].callback](ui.value, fname);
|
45 |
-
}
|
46 |
-
}
|
47 |
-
|
48 |
-
}
|
49 |
-
});
|
50 |
-
|
51 |
-
});
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
|
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
|
|
|
|
|
|
76 |
|
|
|
|
|
|
|
|
|
77 |
});
|
78 |
|
79 |
-
|
80 |
//select styles
|
81 |
function sel_style(s) {
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
90 |
}
|
91 |
|
92 |
-
|
93 |
//redirect to home admin
|
94 |
function ujic_admin_home() {
|
95 |
-
|
96 |
}
|
97 |
|
98 |
-
|
99 |
/**
|
100 |
*
|
101 |
* Preview Clasic Panel Admin
|
@@ -104,175 +105,540 @@ function ujic_admin_home() {
|
|
104 |
*/
|
105 |
|
106 |
(function ($) {
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
|
190 |
-
|
191 |
-
|
192 |
-
new_colors: function (id, hex) {
|
193 |
-
var col_up = $('#ujic_col_up').val();
|
194 |
-
var col_dw = $('#ujic_col_dw').val();
|
195 |
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
|
245 |
-
|
246 |
-
$('.iCheck-helper').click(function () {
|
247 |
-
var id = $(this).parent().find(":checkbox").attr("id");
|
248 |
-
if (id == 'ujic_txt' && $(this).parent().hasClass('checked')) {
|
249 |
-
$('.countdown_txt').show();
|
250 |
-
}
|
251 |
-
else if (id == 'ujic_txt') {
|
252 |
-
$('.countdown_txt').hide();
|
253 |
-
}
|
254 |
-
});
|
255 |
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
|
274 |
-
|
275 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
|
277 |
-
|
278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Notyf v3.0.0
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
var Notyf=function(){"use strict";var e,o=function(){return(o=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var o in i=arguments[e])Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o]);return t}).apply(this,arguments)},n=(t.prototype.on=function(t,i){var e=this.listeners[t]||[];this.listeners[t]=e.concat([i])},t.prototype.triggerEvent=function(t,i){var e=this;(this.listeners[t]||[]).forEach(function(t){return t({target:e,event:i})})},t);function t(t){this.options=t,this.listeners={}}(i=e=e||{})[i.Add=0]="Add",i[i.Remove=1]="Remove";var f,i,s=(a.prototype.push=function(t){this.notifications.push(t),this.updateFn(t,e.Add,this.notifications)},a.prototype.splice=function(t,i){i=this.notifications.splice(t,i)[0];return this.updateFn(i,e.Remove,this.notifications),i},a.prototype.indexOf=function(t){return this.notifications.indexOf(t)},a.prototype.onUpdate=function(t){this.updateFn=t},a);function a(){this.notifications=[]}(i=f=f||{}).Dismiss="dismiss";var r={types:[{type:"success",className:"notyf__toast--success",backgroundColor:"#3dc763",icon:{className:"notyf__icon--success",tagName:"i"}},{type:"error",className:"notyf__toast--error",backgroundColor:"#ed3d3d",icon:{className:"notyf__icon--error",tagName:"i"}}],duration:2e3,ripple:!0,position:{x:"right",y:"bottom"},dismissible:!(i.Click="click")},c=(p.prototype.on=function(t,i){var e;this.events=o(o({},this.events),((e={})[t]=i,e))},p.prototype.update=function(t,i){i===e.Add?this.addNotification(t):i===e.Remove&&this.removeNotification(t)},p.prototype.removeNotification=function(t){var i,e,n=this,t=this._popRenderedNotification(t);t&&((e=t.node).classList.add("notyf__toast--disappear"),e.addEventListener(this.animationEndEventName,i=function(t){t.target===e&&(e.removeEventListener(n.animationEndEventName,i),n.container.removeChild(e))}))},p.prototype.addNotification=function(t){var i=this._renderNotification(t);this.notifications.push({notification:t,node:i}),this._announce(t.options.message||"Notification")},p.prototype._renderNotification=function(t){var i=this._buildNotificationCard(t),e=t.options.className;return e&&(t=i.classList).add.apply(t,e.split(" ")),this.container.appendChild(i),i},p.prototype._popRenderedNotification=function(t){for(var i=-1,e=0;e<this.notifications.length&&i<0;e++)this.notifications[e].notification===t&&(i=e);if(-1!==i)return this.notifications.splice(i,1)[0]},p.prototype.getXPosition=function(t){return(null===(t=null==t?void 0:t.position)||void 0===t?void 0:t.x)||"right"},p.prototype.getYPosition=function(t){return(null===(t=null==t?void 0:t.position)||void 0===t?void 0:t.y)||"bottom"},p.prototype.adjustContainerAlignment=function(t){var i=this.X_POSITION_FLEX_MAP[this.getXPosition(t)],e=this.Y_POSITION_FLEX_MAP[this.getYPosition(t)],t=this.container.style;t.setProperty("justify-content",e),t.setProperty("align-items",i)},p.prototype._buildNotificationCard=function(n){var o=this,t=n.options,i=t.icon;this.adjustContainerAlignment(t);var e=this._createHTMLElement({tagName:"div",className:"notyf__toast"}),s=this._createHTMLElement({tagName:"div",className:"notyf__ripple"}),a=this._createHTMLElement({tagName:"div",className:"notyf__wrapper"}),r=this._createHTMLElement({tagName:"div",className:"notyf__message"});r.innerHTML=t.message||"";var c,p,d,l,u=t.background||t.backgroundColor;i&&(c=this._createHTMLElement({tagName:"div",className:"notyf__icon"}),("string"==typeof i||i instanceof String)&&(c.innerHTML=new String(i).valueOf()),"object"==typeof i&&(p=i.tagName,d=i.className,l=i.text,i=void 0===(i=i.color)?u:i,l=this._createHTMLElement({tagName:void 0===p?"i":p,className:d,text:l}),i&&(l.style.color=i),c.appendChild(l)),a.appendChild(c)),a.appendChild(r),e.appendChild(a),u&&(t.ripple?(s.style.background=u,e.appendChild(s)):e.style.background=u),t.dismissible&&(s=this._createHTMLElement({tagName:"div",className:"notyf__dismiss"}),u=this._createHTMLElement({tagName:"button",className:"notyf__dismiss-btn"}),s.appendChild(u),a.appendChild(s),e.classList.add("notyf__toast--dismissible"),u.addEventListener("click",function(t){var i,e;null!==(e=(i=o.events)[f.Dismiss])&&void 0!==e&&e.call(i,{target:n,event:t}),t.stopPropagation()})),e.addEventListener("click",function(t){var i,e;return null===(e=(i=o.events)[f.Click])||void 0===e?void 0:e.call(i,{target:n,event:t})});t="top"===this.getYPosition(t)?"upper":"lower";return e.classList.add("notyf__toast--"+t),e},p.prototype._createHTMLElement=function(t){var i=t.tagName,e=t.className,t=t.text,i=document.createElement(i);return e&&(i.className=e),i.textContent=t||null,i},p.prototype._createA11yContainer=function(){var t=this._createHTMLElement({tagName:"div",className:"notyf-announcer"});t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live","polite"),t.style.border="0",t.style.clip="rect(0 0 0 0)",t.style.height="1px",t.style.margin="-1px",t.style.overflow="hidden",t.style.padding="0",t.style.position="absolute",t.style.width="1px",t.style.outline="0",document.body.appendChild(t),this.a11yContainer=t},p.prototype._announce=function(t){var i=this;this.a11yContainer.textContent="",setTimeout(function(){i.a11yContainer.textContent=t},100)},p.prototype._getAnimationEndEventName=function(){var t,i=document.createElement("_fake"),e={MozTransition:"animationend",OTransition:"oAnimationEnd",WebkitTransition:"webkitAnimationEnd",transition:"animationend"};for(t in e)if(void 0!==i.style[t])return e[t];return"animationend"},p);function p(){this.notifications=[],this.events={},this.X_POSITION_FLEX_MAP={left:"flex-start",center:"center",right:"flex-end"},this.Y_POSITION_FLEX_MAP={top:"flex-start",center:"center",bottom:"flex-end"};var t=document.createDocumentFragment(),i=this._createHTMLElement({tagName:"div",className:"notyf"});t.appendChild(i),document.body.appendChild(t),this.container=i,this.animationEndEventName=this._getAnimationEndEventName(),this._createA11yContainer()}function d(t){var e=this;this.dismiss=this._removeNotification,this.notifications=new s,this.view=new c;var i=this.registerTypes(t);this.options=o(o({},r),t),this.options.types=i,this.notifications.onUpdate(function(t,i){return e.view.update(t,i)}),this.view.on(f.Dismiss,function(t){var i=t.target,t=t.event;e._removeNotification(i),i.triggerEvent(f.Dismiss,t)}),this.view.on(f.Click,function(t){var i=t.target,t=t.event;return i.triggerEvent(f.Click,t)})}return d.prototype.error=function(t){t=this.normalizeOptions("error",t);return this.open(t)},d.prototype.success=function(t){t=this.normalizeOptions("success",t);return this.open(t)},d.prototype.open=function(i){var t=this.options.types.find(function(t){return t.type===i.type})||{},t=o(o({},t),i);this.assignProps(["ripple","position","dismissible"],t);t=new n(t);return this._pushNotification(t),t},d.prototype.dismissAll=function(){for(;this.notifications.splice(0,1););},d.prototype.assignProps=function(t,i){var e=this;t.forEach(function(t){i[t]=(null==i[t]?e.options:i)[t]})},d.prototype._pushNotification=function(t){var i=this;this.notifications.push(t);var e=(void 0!==t.options.duration?t:this).options.duration;e&&setTimeout(function(){return i._removeNotification(t)},e)},d.prototype._removeNotification=function(t){t=this.notifications.indexOf(t);-1!==t&&this.notifications.splice(t,1)},d.prototype.normalizeOptions=function(t,i){t={type:t};return"string"==typeof i?t.message=i:"object"==typeof i&&(t=o(o({},t),i)),t},d.prototype.registerTypes=function(t){var i=(t&&t.types||[]).slice();return r.types.map(function(e){var n=-1;i.forEach(function(t,i){t.type===e.type&&(n=i)});var t=-1!==n?i.splice(n,1)[0]:{};return o(o({},e),t)}).concat(i)},d}();
|
6 |
+
|
7 |
jQuery.noConflict();
|
8 |
|
9 |
var slider_uji = [];
|
10 |
|
11 |
+
/** Fire up jQuery - let's dance!
|
12 |
*/
|
13 |
jQuery(document).ready(function ($) {
|
14 |
+
var fname = jQuery('#ujic-style').val() + 'Select';
|
15 |
|
16 |
+
/* jQuery UI Slider */
|
17 |
+
jQuery('.ujic_sliderui').each(function () {
|
18 |
+
var obj = jQuery(this);
|
19 |
+
var sId = '#' + obj.data('id');
|
20 |
+
var val = parseInt(obj.data('val'));
|
21 |
+
var min = parseInt(obj.data('min'));
|
22 |
+
var max = parseInt(obj.data('max'));
|
23 |
+
var step = parseInt(obj.data('step'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
+
//slider init
|
26 |
+
obj.slider({
|
27 |
+
value: val,
|
28 |
+
min: min,
|
29 |
+
max: max,
|
30 |
+
step: step,
|
31 |
+
range: 'min',
|
32 |
+
slide: function (event, ui) {
|
33 |
+
jQuery(sId).val(ui.value);
|
34 |
+
if ('#ujic_size' == sId) window[fname].the_size(ui.value);
|
35 |
+
if ('#ujic_thick' == sId) window[fname].the_thick(ui.value);
|
36 |
+
if ('#ujic_lab_sz' == sId) window[fname].the_lab_sz(ui.value);
|
37 |
|
38 |
+
//Ad Slider extension
|
39 |
+
if (
|
40 |
+
typeof slider_uji !== 'undefined' &&
|
41 |
+
slider_uji.length > 0
|
42 |
+
) {
|
43 |
+
//console.log(slider_uji.length);
|
44 |
+
for (s = 0; s < slider_uji.length; s++) {
|
45 |
+
if (slider_uji[s].id == sId)
|
46 |
+
window[slider_uji[s].callback](ui.value, fname);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
},
|
50 |
+
});
|
51 |
+
});
|
52 |
|
53 |
+
/* jQuery Color Picker */
|
54 |
+
jQuery('.ujic_colorpick').wpColorPicker({
|
55 |
+
change: function (event, ui) {
|
56 |
+
window[fname].new_colors($(this).attr('id'), $(this).val());
|
57 |
+
},
|
58 |
+
});
|
59 |
|
60 |
+
/* JQuery Checkbox/Radio */
|
61 |
+
jQuery('input').iCheck({
|
62 |
+
checkboxClass: 'icheckbox_flat-pink',
|
63 |
+
radioClass: 'iradio_flat-pink',
|
64 |
+
});
|
|
|
65 |
|
66 |
+
jQuery('.ujic-preview').draggable();
|
67 |
+
jQuery('.ujic-preview').find('.handlediv').hide();
|
68 |
+
jQuery('.ujic-preview')
|
69 |
+
.find('.postbox')
|
70 |
+
.click(function () {
|
71 |
+
$(this).removeClass('closed');
|
72 |
+
});
|
73 |
|
74 |
+
if (jQuery('#ujic_name').length ) {
|
75 |
+
/* Style Preview */
|
76 |
+
window[fname].init();
|
77 |
+
}
|
78 |
});
|
79 |
|
|
|
80 |
//select styles
|
81 |
function sel_style(s) {
|
82 |
+
var lnk;
|
83 |
+
if (s == 'classic')
|
84 |
+
lnk =
|
85 |
+
'options-general.php?page=ujicountdown&tab=tab_ujic_new&style=classic';
|
86 |
+
if (s == 'modern')
|
87 |
+
lnk =
|
88 |
+
'options-general.php?page=ujicountdown&tab=tab_ujic_new&style=modern';
|
89 |
+
if (s == 'custom')
|
90 |
+
lnk =
|
91 |
+
'options-general.php?page=ujicountdown&tab=tab_ujic_new&style=custom';
|
92 |
+
window.location.href = '' + lnk + '';
|
93 |
}
|
94 |
|
|
|
95 |
//redirect to home admin
|
96 |
function ujic_admin_home() {
|
97 |
+
window.location.href = 'options-general.php?page=ujicountdown';
|
98 |
}
|
99 |
|
|
|
100 |
/**
|
101 |
*
|
102 |
* Preview Clasic Panel Admin
|
105 |
*/
|
106 |
|
107 |
(function ($) {
|
108 |
+
classicSelect = {
|
109 |
+
/// Init
|
110 |
+
init: function () {
|
111 |
+
var style = $('#ujic-style');
|
112 |
+
if (style.length) {
|
113 |
+
this.the_size();
|
114 |
+
this.the_lab_sz();
|
115 |
+
this.the_format();
|
116 |
+
this.the_colors();
|
117 |
+
this.the_labels();
|
118 |
+
this.the_fonts();
|
119 |
+
}
|
120 |
+
},
|
121 |
+
/// Size
|
122 |
+
the_size: function (val) {
|
123 |
+
var size = $('#ujic_size');
|
124 |
+
if (size.length) {
|
125 |
+
var newsize =
|
126 |
+
val && val != 'undefined' && val.length ? val : size.val();
|
127 |
+
}
|
128 |
+
$('#ujiCountdown')
|
129 |
+
.find('.countdown_amount')
|
130 |
+
.css('font-size', newsize + 'px');
|
131 |
+
},
|
132 |
+
/// Label Size
|
133 |
+
the_lab_sz: function (val) {
|
134 |
+
var size = $('#ujic_lab_sz');
|
135 |
+
if (size.length) {
|
136 |
+
$('.countdown_txt').css(
|
137 |
+
'font-size',
|
138 |
+
(val && val != 'undefined' && val.length
|
139 |
+
? val
|
140 |
+
: size.val()) + 'px'
|
141 |
+
);
|
142 |
+
}
|
143 |
+
},
|
144 |
+
/// Format
|
145 |
+
the_format: function () {
|
146 |
+
var format = new Array(
|
147 |
+
'ujic_d',
|
148 |
+
'ujic_h',
|
149 |
+
'ujic_m',
|
150 |
+
'ujic_s',
|
151 |
+
'ujic_y',
|
152 |
+
'ujic_o',
|
153 |
+
'ujic_w'
|
154 |
+
);
|
155 |
+
for (var i = 0; i < format.length; i++) {
|
156 |
+
// Init
|
157 |
+
if ( $('#' + format[i]).is(':checked') ){
|
158 |
+
var id = format[i];
|
159 |
+
$('#ujiCountdown')
|
160 |
+
.find('.' + id)
|
161 |
+
.show();
|
162 |
+
}
|
163 |
+
if ( $('#' + format[i]).is(':not(:checked)') ){
|
164 |
+
var id = format[i];
|
165 |
+
$('#ujiCountdown')
|
166 |
+
.find('.' + id)
|
167 |
+
.hide();
|
168 |
+
}
|
169 |
+
|
170 |
+
// Live
|
171 |
+
$('#' + format[i]).on('ifChecked', function(){
|
172 |
+
var id = $(this).attr('id');
|
173 |
+
$('#ujiCountdown')
|
174 |
+
.find('.' + id)
|
175 |
+
.show();
|
176 |
+
});
|
177 |
+
$('#' + format[i]).on('ifUnchecked', function(){
|
178 |
+
var id = $(this).attr('id');
|
179 |
+
$('#ujiCountdown')
|
180 |
+
.find('.' + id)
|
181 |
+
.hide();
|
182 |
+
});
|
183 |
+
}
|
184 |
+
},
|
185 |
+
//color light
|
186 |
+
shadeColor: function (color, percent) {
|
187 |
+
var num = parseInt(color.slice(1), 16),
|
188 |
+
amt = Math.round(2.55 * percent),
|
189 |
+
R = (num >> 16) + amt,
|
190 |
+
G = ((num >> 8) & 0x00ff) + amt,
|
191 |
+
B = (num & 0x0000ff) + amt;
|
192 |
+
return (
|
193 |
+
'#' +
|
194 |
+
(
|
195 |
+
0x1000000 +
|
196 |
+
(R < 255 ? (R < 1 ? 0 : R) : 255) * 0x10000 +
|
197 |
+
(G < 255 ? (G < 1 ? 0 : G) : 255) * 0x100 +
|
198 |
+
(B < 255 ? (B < 1 ? 0 : B) : 255)
|
199 |
+
)
|
200 |
+
.toString(16)
|
201 |
+
.slice(1)
|
202 |
+
);
|
203 |
+
},
|
204 |
+
/// Colors
|
205 |
+
the_colors: function (id, hex) {
|
206 |
+
var col_txt = $('#ujic_col_txt').val();
|
207 |
+
var col_sw = $('#ujic_col_sw').val();
|
208 |
+
var col_up = $('#ujic_col_up').val();
|
209 |
+
var col_dw = $('#ujic_col_dw').val();
|
210 |
+
var col_lab = $('#ujic_col_lab').val();
|
211 |
+
var col_sub = $('#ujic_subscrFrmSubmitColor').length
|
212 |
+
? $('#ujic_subscrFrmSubmitColor').val()
|
213 |
+
: '#000000';
|
214 |
|
215 |
+
$('.countdown_amount').css('color', col_txt);
|
216 |
+
$('.countdown_amount').css('text-shadow', '1px 1px 1px ' + col_sw);
|
|
|
|
|
|
|
217 |
|
218 |
+
$('.ujic-classic')
|
219 |
+
.find('.countdown_amount')
|
220 |
+
.css(
|
221 |
+
'background',
|
222 |
+
'-moz-linear-gradient(top, ' +
|
223 |
+
col_up +
|
224 |
+
' 50%, ' +
|
225 |
+
col_dw +
|
226 |
+
' 50%)'
|
227 |
+
); /* FF3.6+ */
|
228 |
+
$('.ujic-classic')
|
229 |
+
.find('.countdown_amount')
|
230 |
+
.css(
|
231 |
+
'background',
|
232 |
+
'-webkit-gradient(linear, left top, left bottom, color-stop(50%,' +
|
233 |
+
col_up +
|
234 |
+
'), color-stop(50%,' +
|
235 |
+
col_dw +
|
236 |
+
'))'
|
237 |
+
); /* Chrome,Safari4+ */
|
238 |
+
$('.ujic-classic')
|
239 |
+
.find('.countdown_amount')
|
240 |
+
.css(
|
241 |
+
'background',
|
242 |
+
'-webkit-linear-gradient(top, ' +
|
243 |
+
col_up +
|
244 |
+
' 50%,' +
|
245 |
+
col_dw +
|
246 |
+
' 50%)'
|
247 |
+
); /* Chrome10+,Safari5.1+ */
|
248 |
+
$('.ujic-classic')
|
249 |
+
.find('.countdown_amount')
|
250 |
+
.css(
|
251 |
+
'background',
|
252 |
+
'-o-linear-gradient(top, ' +
|
253 |
+
col_up +
|
254 |
+
' 50%,' +
|
255 |
+
col_dw +
|
256 |
+
' 50%)'
|
257 |
+
); /* Opera 11.10+ */
|
258 |
+
$('.ujic-classic')
|
259 |
+
.find('.countdown_amount')
|
260 |
+
.css(
|
261 |
+
'background',
|
262 |
+
'-ms-linear-gradient(top, ' +
|
263 |
+
col_up +
|
264 |
+
' 50%,' +
|
265 |
+
col_dw +
|
266 |
+
' 50%)'
|
267 |
+
); /* IE10+ */
|
268 |
+
$('.ujic-classic')
|
269 |
+
.find('.countdown_amount')
|
270 |
+
.css(
|
271 |
+
'background',
|
272 |
+
'linear-gradient(to bottom, ' +
|
273 |
+
col_up +
|
274 |
+
' 50%,' +
|
275 |
+
col_dw +
|
276 |
+
' 50%)'
|
277 |
+
); /* W3C */
|
278 |
+
$('.ujic-classic')
|
279 |
+
.find('.countdown_amount')
|
280 |
+
.css(
|
281 |
+
'filter',
|
282 |
+
"progid:DXImageTransform.Microsoft.gradient( startColorstr='" +
|
283 |
+
col_up +
|
284 |
+
"', endColorstr='" +
|
285 |
+
col_dw +
|
286 |
+
"',GradientType=0 )"
|
287 |
+
); /* IE6-9 */
|
288 |
|
289 |
+
$('.countdown_txt').css('color', col_lab);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
|
291 |
+
$('#ujiCountdown')
|
292 |
+
.find('input[type=submit]')
|
293 |
+
.css(
|
294 |
+
'background',
|
295 |
+
'-moz-linear-gradient(top, ' +
|
296 |
+
col_sub +
|
297 |
+
' 0%, ' +
|
298 |
+
this.shadeColor(col_sub, 20) +
|
299 |
+
' 100%)'
|
300 |
+
); /* FF3.6+ */
|
301 |
+
$('#ujiCountdown')
|
302 |
+
.find('input[type=submit]')
|
303 |
+
.css(
|
304 |
+
'background',
|
305 |
+
'-webkit-gradient(linear, left top, left bottom, color-stop(0%,' +
|
306 |
+
col_sub +
|
307 |
+
'), color-stop(100%,' +
|
308 |
+
this.shadeColor(col_sub, 20) +
|
309 |
+
'))'
|
310 |
+
); /* Chrome,Safari4+ */
|
311 |
+
$('#ujiCountdown')
|
312 |
+
.find('input[type=submit]')
|
313 |
+
.css(
|
314 |
+
'background',
|
315 |
+
'-webkit-linear-gradient(top, ' +
|
316 |
+
col_sub +
|
317 |
+
' 50%,' +
|
318 |
+
this.shadeColor(col_sub, 20) +
|
319 |
+
' 100%)'
|
320 |
+
); /* Chrome10+,Safari5.1+ */
|
321 |
+
$('#ujiCountdown')
|
322 |
+
.find('input[type=submit]')
|
323 |
+
.css(
|
324 |
+
'background',
|
325 |
+
'-o-linear-gradient(top, ' +
|
326 |
+
col_sub +
|
327 |
+
' 0%,' +
|
328 |
+
this.shadeColor(col_sub, 20) +
|
329 |
+
' 100%)'
|
330 |
+
); /* Opera 11.10+ */
|
331 |
+
$('#ujiCountdown')
|
332 |
+
.find('input[type=submit]')
|
333 |
+
.css(
|
334 |
+
'background',
|
335 |
+
'-ms-linear-gradient(top, ' +
|
336 |
+
col_sub +
|
337 |
+
' 0%,' +
|
338 |
+
this.shadeColor(col_sub, 20) +
|
339 |
+
' 100%)'
|
340 |
+
); /* IE10+ */
|
341 |
+
$('#ujiCountdown')
|
342 |
+
.find('input[type=submit]')
|
343 |
+
.css(
|
344 |
+
'background',
|
345 |
+
'linear-gradient(to bottom, ' +
|
346 |
+
col_sub +
|
347 |
+
' 0%,' +
|
348 |
+
this.shadeColor(col_sub, 20) +
|
349 |
+
' 100%)'
|
350 |
+
); /* W3C */
|
351 |
+
$('#ujiCountdown')
|
352 |
+
.find('input[type=submit]')
|
353 |
+
.css(
|
354 |
+
'filter',
|
355 |
+
"progid:DXImageTransform.Microsoft.gradient( startColorstr='" +
|
356 |
+
col_sub +
|
357 |
+
"', endColorstr='" +
|
358 |
+
this.shadeColor(col_sub, 20) +
|
359 |
+
"',GradientType=0 )"
|
360 |
+
); /* IE6-9 */
|
361 |
+
},
|
362 |
+
/// Colors
|
363 |
+
new_colors: function (id, hex) {
|
364 |
+
var col_up = $('#ujic_col_up').val();
|
365 |
+
var col_dw = $('#ujic_col_dw').val();
|
366 |
|
367 |
+
switch (id) {
|
368 |
+
case 'ujic_col_txt':
|
369 |
+
$('.countdown_amount').css('color', hex);
|
370 |
+
break;
|
371 |
+
case 'ujic_col_sw':
|
372 |
+
$('.countdown_amount').css(
|
373 |
+
'text-shadow',
|
374 |
+
'1px 1px 1px ' + hex
|
375 |
+
);
|
376 |
+
break;
|
377 |
+
case 'ujic_col_up':
|
378 |
+
$('.ujic-classic')
|
379 |
+
.find('.countdown_amount')
|
380 |
+
.css(
|
381 |
+
'background',
|
382 |
+
'-moz-linear-gradient(top, ' +
|
383 |
+
hex +
|
384 |
+
' 50%, ' +
|
385 |
+
col_dw +
|
386 |
+
' 50%)'
|
387 |
+
); /* FF3.6+ */
|
388 |
+
$('.ujic-classic')
|
389 |
+
.find('.countdown_amount')
|
390 |
+
.css(
|
391 |
+
'background',
|
392 |
+
'-webkit-gradient(linear, left top, left bottom, color-stop(50%,' +
|
393 |
+
hex +
|
394 |
+
'), color-stop(50%,' +
|
395 |
+
col_dw +
|
396 |
+
'))'
|
397 |
+
); /* Chrome,Safari4+ */
|
398 |
+
$('.ujic-classic')
|
399 |
+
.find('.countdown_amount')
|
400 |
+
.css(
|
401 |
+
'background',
|
402 |
+
'-webkit-linear-gradient(top, ' +
|
403 |
+
hex +
|
404 |
+
' 50%,' +
|
405 |
+
col_dw +
|
406 |
+
' 50%)'
|
407 |
+
); /* Chrome10+,Safari5.1+ */
|
408 |
+
$('.ujic-classic')
|
409 |
+
.find('.countdown_amount')
|
410 |
+
.css(
|
411 |
+
'background',
|
412 |
+
'-o-linear-gradient(top, ' +
|
413 |
+
hex +
|
414 |
+
' 50%,' +
|
415 |
+
col_dw +
|
416 |
+
' 50%)'
|
417 |
+
); /* Opera 11.10+ */
|
418 |
+
$('.ujic-classic')
|
419 |
+
.find('.countdown_amount')
|
420 |
+
.css(
|
421 |
+
'background',
|
422 |
+
'-ms-linear-gradient(top, ' +
|
423 |
+
hex +
|
424 |
+
' 50%,' +
|
425 |
+
col_dw +
|
426 |
+
' 50%)'
|
427 |
+
); /* IE10+ */
|
428 |
+
$('.ujic-classic')
|
429 |
+
.find('.countdown_amount')
|
430 |
+
.css(
|
431 |
+
'background',
|
432 |
+
'linear-gradient(to bottom, ' +
|
433 |
+
hex +
|
434 |
+
' 50%,' +
|
435 |
+
col_dw +
|
436 |
+
' 50%)'
|
437 |
+
); /* W3C */
|
438 |
+
$('.ujic-classic')
|
439 |
+
.find('.countdown_amount')
|
440 |
+
.css(
|
441 |
+
'filter',
|
442 |
+
"progid:DXImageTransform.Microsoft.gradient( startColorstr='" +
|
443 |
+
hex +
|
444 |
+
"', endColorstr='" +
|
445 |
+
col_dw +
|
446 |
+
"',GradientType=0 )"
|
447 |
+
); /* IE6-9 */
|
448 |
+
break;
|
449 |
+
case 'ujic_col_dw':
|
450 |
+
$('.ujic-classic')
|
451 |
+
.find('.countdown_amount')
|
452 |
+
.css(
|
453 |
+
'background',
|
454 |
+
'-moz-linear-gradient(top, ' +
|
455 |
+
col_up +
|
456 |
+
' 50%, ' +
|
457 |
+
hex +
|
458 |
+
' 50%)'
|
459 |
+
); /* FF3.6+ */
|
460 |
+
$('.ujic-classic')
|
461 |
+
.find('.countdown_amount')
|
462 |
+
.css(
|
463 |
+
'background',
|
464 |
+
'-webkit-gradient(linear, left top, left bottom, color-stop(50%,' +
|
465 |
+
col_up +
|
466 |
+
'), color-stop(50%,' +
|
467 |
+
hex +
|
468 |
+
'))'
|
469 |
+
); /* Chrome,Safari4+ */
|
470 |
+
$('.ujic-classic')
|
471 |
+
.find('.countdown_amount')
|
472 |
+
.css(
|
473 |
+
'background',
|
474 |
+
'-webkit-linear-gradient(top, ' +
|
475 |
+
col_up +
|
476 |
+
' 50%,' +
|
477 |
+
hex +
|
478 |
+
' 50%)'
|
479 |
+
); /* Chrome10+,Safari5.1+ */
|
480 |
+
$('.ujic-classic')
|
481 |
+
.find('.countdown_amount')
|
482 |
+
.css(
|
483 |
+
'background',
|
484 |
+
'-o-linear-gradient(top, ' +
|
485 |
+
col_up +
|
486 |
+
' 50%,' +
|
487 |
+
hex +
|
488 |
+
' 50%)'
|
489 |
+
); /* Opera 11.10+ */
|
490 |
+
$('.ujic-classic')
|
491 |
+
.find('.countdown_amount')
|
492 |
+
.css(
|
493 |
+
'background',
|
494 |
+
'-ms-linear-gradient(top, ' +
|
495 |
+
col_up +
|
496 |
+
' 50%,' +
|
497 |
+
hex +
|
498 |
+
' 50%)'
|
499 |
+
); /* IE10+ */
|
500 |
+
$('.ujic-classic')
|
501 |
+
.find('.countdown_amount')
|
502 |
+
.css(
|
503 |
+
'background',
|
504 |
+
'linear-gradient(to bottom, ' +
|
505 |
+
col_up +
|
506 |
+
' 50%,' +
|
507 |
+
hex +
|
508 |
+
' 50%)'
|
509 |
+
); /* W3C */
|
510 |
+
$('.ujic-classic')
|
511 |
+
.find('.countdown_amount')
|
512 |
+
.css(
|
513 |
+
'filter',
|
514 |
+
"progid:DXImageTransform.Microsoft.gradient( startColorstr='" +
|
515 |
+
col_up +
|
516 |
+
"', endColorstr='" +
|
517 |
+
hex +
|
518 |
+
"',GradientType=0 )"
|
519 |
+
); /* IE6-9 */
|
520 |
+
break;
|
521 |
+
case 'ujic_col_lab':
|
522 |
+
$('.countdown_txt').css('color', hex);
|
523 |
+
break;
|
524 |
+
case 'ujic_subscrFrmSubmitColor':
|
525 |
+
//console.log(this.shadeColor(hex, 70));
|
526 |
+
$('#ujiCountdown')
|
527 |
+
.find('input[type=submit]')
|
528 |
+
.css(
|
529 |
+
'background',
|
530 |
+
'-moz-linear-gradient(top, ' +
|
531 |
+
hex +
|
532 |
+
' 0%, ' +
|
533 |
+
this.shadeColor(hex, 20) +
|
534 |
+
' 100%)'
|
535 |
+
); /* FF3.6+ */
|
536 |
+
$('#ujiCountdown')
|
537 |
+
.find('input[type=submit]')
|
538 |
+
.css(
|
539 |
+
'background',
|
540 |
+
'-webkit-gradient(linear, left top, left bottom, color-stop(0%,' +
|
541 |
+
hex +
|
542 |
+
'), color-stop(100%,' +
|
543 |
+
this.shadeColor(hex, 20) +
|
544 |
+
'))'
|
545 |
+
); /* Chrome,Safari4+ */
|
546 |
+
$('#ujiCountdown')
|
547 |
+
.find('input[type=submit]')
|
548 |
+
.css(
|
549 |
+
'background',
|
550 |
+
'-webkit-linear-gradient(top, ' +
|
551 |
+
hex +
|
552 |
+
' 50%,' +
|
553 |
+
this.shadeColor(hex, 20) +
|
554 |
+
' 100%)'
|
555 |
+
); /* Chrome10+,Safari5.1+ */
|
556 |
+
$('#ujiCountdown')
|
557 |
+
.find('input[type=submit]')
|
558 |
+
.css(
|
559 |
+
'background',
|
560 |
+
'-o-linear-gradient(top, ' +
|
561 |
+
hex +
|
562 |
+
' 0%,' +
|
563 |
+
this.shadeColor(hex, 20) +
|
564 |
+
' 100%)'
|
565 |
+
); /* Opera 11.10+ */
|
566 |
+
$('#ujiCountdown')
|
567 |
+
.find('input[type=submit]')
|
568 |
+
.css(
|
569 |
+
'background',
|
570 |
+
'-ms-linear-gradient(top, ' +
|
571 |
+
hex +
|
572 |
+
' 0%,' +
|
573 |
+
this.shadeColor(hex, 20) +
|
574 |
+
' 100%)'
|
575 |
+
); /* IE10+ */
|
576 |
+
$('#ujiCountdown')
|
577 |
+
.find('input[type=submit]')
|
578 |
+
.css(
|
579 |
+
'background',
|
580 |
+
'linear-gradient(to bottom, ' +
|
581 |
+
hex +
|
582 |
+
' 0%,' +
|
583 |
+
this.shadeColor(hex, 20) +
|
584 |
+
' 100%)'
|
585 |
+
); /* W3C */
|
586 |
+
$('#ujiCountdown')
|
587 |
+
.find('input[type=submit]')
|
588 |
+
.css(
|
589 |
+
'filter',
|
590 |
+
"progid:DXImageTransform.Microsoft.gradient( startColorstr='" +
|
591 |
+
hex +
|
592 |
+
"', endColorstr='" +
|
593 |
+
this.shadeColor(hex, 20) +
|
594 |
+
"',GradientType=0 )"
|
595 |
+
); /* IE6-9 */
|
596 |
+
break;
|
597 |
+
}
|
598 |
+
},
|
599 |
+
/// Text Labels
|
600 |
+
the_labels: function () {
|
601 |
+
if ($('#ujic_txt').is(':checked')) {
|
602 |
+
$('.countdown_txt').show();
|
603 |
+
} else {
|
604 |
+
$('.countdown_txt').hide();
|
605 |
+
}
|
606 |
|
607 |
+
//live change
|
608 |
+
$('.iCheck-helper').click(function () {
|
609 |
+
var id = $(this).parent().find(':checkbox').attr('id');
|
610 |
+
if (id == 'ujic_txt' && $(this).parent().hasClass('checked')) {
|
611 |
+
$('.countdown_txt').show();
|
612 |
+
} else if (id == 'ujic_txt') {
|
613 |
+
$('.countdown_txt').hide();
|
614 |
+
}
|
615 |
+
});
|
616 |
+
},
|
617 |
+
/// Google Font
|
618 |
+
the_fonts: function () {
|
619 |
+
var val = $('#ujic_goof').val();
|
620 |
+
if (val && val != 'none') {
|
621 |
+
var the_font = val.replace(/\s+/g, '+');
|
622 |
+
//add reference to google font family
|
623 |
+
$('head').append(
|
624 |
+
'<link href="https://fonts.googleapis.com/css?family=' +
|
625 |
+
the_font +
|
626 |
+
'" rel="stylesheet" type="text/css">'
|
627 |
+
);
|
628 |
+
$('.countdown_amount').css('font-family', val + ', sans-serif');
|
629 |
+
}
|
630 |
+
//live change
|
631 |
+
$('#ujic_goof').bind('change keyup', function () {
|
632 |
+
var val = $(this).val();
|
633 |
+
var the_font = val.replace(/\s+/g, '+');
|
634 |
+
//add reference to google font family
|
635 |
+
$('head').append(
|
636 |
+
'<link href="https://fonts.googleapis.com/css?family=' +
|
637 |
+
the_font +
|
638 |
+
'" rel="stylesheet" type="text/css">'
|
639 |
+
);
|
640 |
+
$('.countdown_amount').css('font-family', val + ', sans-serif');
|
641 |
+
});
|
642 |
+
},
|
643 |
+
};
|
644 |
+
})(jQuery);
|
assets/js/jquery.icheck.min.js
CHANGED
@@ -1,11 +1,18 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
iCheck v1.0.3, http://git.io/arlzeA
|
3 |
+
===================================
|
4 |
+
Powerful jQuery and Zepto plugin for checkboxes and radio buttons customization
|
5 |
+
|
6 |
+
(c) 2013 Damir Sultanov, http://fronteed.com
|
7 |
+
MIT Licensed
|
8 |
+
*/
|
9 |
+
(function(k){function E(a,b,e){var c=a[0],f=/er/.test(e)?"indeterminate":/bl/.test(e)?"disabled":"checked",d="update"==e?{checked:c.checked,disabled:c.disabled,indeterminate:"true"==a.attr("indeterminate")||"false"==a.attr("determinate")}:c[f];if(/^(ch|di|in)/.test(e)&&!d)B(a,f);else if(/^(un|en|de)/.test(e)&&d)v(a,f);else if("update"==e)for(var l in d)d[l]?B(a,l,!0):v(a,l,!0);else b&&"toggle"!=e||(b||a.trigger("ifClicked"),d?"radio"!==c.type&&v(a,f):B(a,f))}function B(a,b,e){var c=a[0],f=a.parent(),
|
10 |
+
d="checked"==b,l="indeterminate"==b,t="disabled"==b,u=l?"determinate":d?"unchecked":"enabled",x=q(a,u+C(c.type)),y=q(a,b+C(c.type));if(!0!==c[b]){if(!e&&"checked"==b&&"radio"==c.type&&c.name){var z=a.closest("form"),r='input[name="'+c.name+'"]';r=z.length?z.find(r):k(r);r.each(function(){this!==c&&k(this).data("iCheck")&&v(k(this),b)})}l?(c[b]=!0,c.checked&&v(a,"checked","force")):(e||(c[b]=!0),d&&c.indeterminate&&v(a,"indeterminate",!1));I(a,d,b,e)}c.disabled&&q(a,"cursor",!0)&&f.find(".iCheck-helper").css("cursor",
|
11 |
+
"default");f.addClass(y||q(a,b)||"");f.attr("role")&&!l&&f.attr("aria-"+(t?"disabled":"checked"),"true");f.removeClass(x||q(a,u)||"")}function v(a,b,e){var c=a[0],f=a.parent(),d="checked"==b,l="indeterminate"==b,t="disabled"==b,u=l?"determinate":d?"unchecked":"enabled",x=q(a,u+C(c.type)),y=q(a,b+C(c.type));if(!1!==c[b]){if(l||!e||"force"==e)c[b]=!1;I(a,d,u,e)}!c.disabled&&q(a,"cursor",!0)&&f.find(".iCheck-helper").css("cursor","pointer");f.removeClass(y||q(a,b)||"");f.attr("role")&&!l&&f.attr("aria-"+
|
12 |
+
(t?"disabled":"checked"),"false");f.addClass(x||q(a,u)||"")}function J(a,b){a.data("iCheck")&&(a.parent().html(a.attr("style",a.data("iCheck").s||"")),b&&a.trigger(b),a.off(".i").unwrap(),k('label[for="'+a[0].id+'"]').add(a.closest("label")).off(".i"))}function q(a,b,e){if(a.data("iCheck"))return a.data("iCheck").o[b+(e?"":"Class")]}function C(a){return a.charAt(0).toUpperCase()+a.slice(1)}function I(a,b,e,c){c||(b&&a.trigger("ifToggled"),a.trigger("change").trigger("ifChanged").trigger("if"+C(e)))}
|
13 |
+
var G=/ip(hone|od|ad)|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent)||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints;k.fn.iCheck=function(a,b){var e='input[type="checkbox"], input[type="radio"]',c=k(),f=function(g){g.each(function(){var m=k(this);c=m.is(e)?c.add(m):c.add(m.find(e))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),f(this),c.each(function(){var g=k(this);"destroy"==a?
|
14 |
+
J(g,"ifDestroyed"):E(g,!0,a);k.isFunction(b)&&b()});if("object"!=typeof a&&a)return this;var d=k.extend({checkedClass:"checked",disabledClass:"disabled",indeterminateClass:"indeterminate",labelHover:!0},a),l=d.handle,t=d.hoverClass||"hover",u=d.focusClass||"focus",x=d.activeClass||"active",y=!!d.labelHover,z=d.labelHoverClass||"hover",r=(""+d.increaseArea).replace("%","")|0;if("checkbox"==l||"radio"==l)e='input[type="'+l+'"]';-50>r&&(r=-50);f(this);return c.each(function(){var g=k(this);J(g);var m=
|
15 |
+
this,H=m.id,F=-r+"%",w=100+2*r+"%";w={position:"absolute",top:F,left:F,display:"block",width:w,height:w,margin:0,padding:0,background:"#fff",border:0,opacity:0};F=G?{position:"absolute",visibility:"hidden"}:r?w:{position:"absolute",opacity:0};var M="checkbox"==m.type?d.checkboxClass||"icheckbox":d.radioClass||"iradio",D=k('label[for="'+H+'"]').add(g.closest("label")),K=!!d.aria,L="iCheck-"+Math.random().toString(36).substr(2,6),h='<div class="'+M+'" '+(K?'role="'+m.type+'" ':"");K&&D.each(function(){h+=
|
16 |
+
'aria-labelledby="';this.id?h+=this.id:(this.id=L,h+=L);h+='"'});h=g.wrap(h+"/>").trigger("ifCreated").parent().append(d.insert);w=k('<ins class="iCheck-helper"/>').css(w).appendTo(h);g.data("iCheck",{o:d,s:g.attr("style")}).css(F);d.inheritClass&&h.addClass(m.className||"");d.inheritID&&H&&h.attr("id","iCheck-"+H);"static"==h.css("position")&&h.css("position","relative");E(g,!0,"update");if(D.length)D.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i",function(p){var n=p.type,A=k(this);
|
17 |
+
if(!m.disabled){if("click"==n){if(k(p.target).is("a"))return;E(g,!1,!0)}else y&&(/ut|nd/.test(n)?(h.removeClass(t),A.removeClass(z)):(h.addClass(t),A.addClass(z)));if(G)p.stopPropagation();else return!1}});g.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(p){var n=p.type;p=p.keyCode;if("click"==n)return!1;if("keydown"==n&&32==p)return"radio"==m.type&&m.checked||(m.checked?v(g,"checked"):B(g,"checked")),!1;if("keyup"==n&&"radio"==m.type)!m.checked&&B(g,"checked");else if(/us|ur/.test(n))h["blur"==
|
18 |
+
n?"removeClass":"addClass"](u)});w.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(p){var n=p.type,A=/wn|up/.test(n)?x:t;if(!m.disabled){if("click"==n)E(g,!1,!0);else if(/wn|er|in/.test(n)?h.addClass(A):h.removeClass(A+" "+x),D.length&&y&&A==t)D[/ut|nd/.test(n)?"removeClass":"addClass"](z);if(G)p.stopPropagation();else return!1}})})}})(window.jQuery||window.Zepto);
|
assets/js/ujic-popup-button.js
CHANGED
@@ -1,353 +1,453 @@
|
|
1 |
-
(function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function () {
|
2 |
+
var ujic_styles = ujic_short_vars.ujic_style;
|
3 |
+
var ujic_min = ujic_short_vars.ujic_min;
|
4 |
+
var ujic_hou = ujic_short_vars.ujic_hou;
|
5 |
+
var ujic_reclab = ujic_short_vars.ujic_reclab;
|
6 |
+
//Extend plugins
|
7 |
+
var ujic_extends = typeof ujic_extend !== 'undefined' ? ujic_extend : '';
|
8 |
+
//Version multi check
|
9 |
+
var ujic_multi_msg = {
|
10 |
+
type: 'container',
|
11 |
+
html: '<div><p style="font-size:11px; padding-bottom: 15px;">Only one timer on page is allowed.<br>Check the <a href="http://www.wpmanage.com/uji-countdown" style="font-size:11px; color: #00A0D2" target="_blank">Pro version</a> for multiple countdown timers on the same page. <p></div><div class="uji_spacer"></div>',
|
12 |
+
};
|
13 |
+
var ujic_vers =
|
14 |
+
typeof ujic_pro !== 'undefined'
|
15 |
+
? ujic_pro.type !== 'pro'
|
16 |
+
? ujic_multi_msg
|
17 |
+
: ''
|
18 |
+
: ujic_multi_msg;
|
19 |
|
20 |
+
var cntType = typeof ujic_pro !== 'undefined' ? 'pro' : 'free';
|
21 |
+
|
22 |
+
tinymce.PluginManager.add('ujic_tc_button', function (editor, url) {
|
23 |
+
editor.addButton('ujic_tc_button', {
|
24 |
+
title: 'Uji Countdown',
|
25 |
+
type: 'button',
|
26 |
+
icon: 'mce-ico mce-i-icon dashicons-clock',
|
27 |
+
text: '',
|
28 |
+
onclick: function () {
|
29 |
+
if (typeof ujic_styles != 'undefined' && !ujic_styles) {
|
30 |
+
editor.windowManager.open({
|
31 |
+
id: 'uji-contdown-pop',
|
32 |
+
title: 'Add Countdown Shortcode',
|
33 |
+
body: [
|
34 |
+
ujic_vers,
|
35 |
+
{
|
36 |
+
type: 'container',
|
37 |
+
html: '<div style="font-size: 16px;">Plese create your countdown Style first. <br> \n\
|
38 |
+
<span style="color: red;font-size: 16px;">Go to:</span> Settings/Uji Countdown </div>',
|
39 |
+
},
|
40 |
+
],
|
41 |
+
});
|
42 |
+
} else {
|
43 |
+
var win = editor.windowManager.open({
|
44 |
+
id: 'uji-contdown-pop',
|
45 |
+
title: 'Add Countdown Shortcode',
|
46 |
+
body: [
|
47 |
+
ujic_vers,
|
48 |
+
{
|
49 |
+
type: 'listbox',
|
50 |
+
name: 'ujic_style',
|
51 |
+
label: 'Select Style:',
|
52 |
+
tooltip: 'Select saved style',
|
53 |
+
values: ujic_styles,
|
54 |
+
},
|
55 |
+
{
|
56 |
+
type: 'container',
|
57 |
+
html: '<div class="uji_spacer"></div>',
|
58 |
+
},
|
59 |
+
{
|
60 |
+
type: 'container',
|
61 |
+
label: 'Timer Type:',
|
62 |
+
items: [
|
63 |
+
{
|
64 |
+
type: 'radio',
|
65 |
+
name: 'ujic_type_one',
|
66 |
+
id: 'ujic_type_one',
|
67 |
+
label: 'One Time Timer',
|
68 |
+
text: 'One Time Timer',
|
69 |
+
style: 'display:inline-block; margin-right: 15px;',
|
70 |
+
tooltip:
|
71 |
+
'Timer will countinue until expiration time',
|
72 |
+
checked: true,
|
73 |
+
},
|
74 |
+
{
|
75 |
+
type: 'radio',
|
76 |
+
name: 'ujic_type_rep',
|
77 |
+
id: 'ujic_type_rep',
|
78 |
+
label: 'Repeat Timer',
|
79 |
+
text: 'Repeat Timer',
|
80 |
+
style: 'display:inline-block;',
|
81 |
+
tooltip:
|
82 |
+
'Timer will restart on page refresh',
|
83 |
+
checked: false,
|
84 |
+
},
|
85 |
+
],
|
86 |
+
},
|
87 |
+
{
|
88 |
+
type: 'textbox',
|
89 |
+
name: 'ujic_date',
|
90 |
+
label: 'Expire Date:',
|
91 |
+
tooltip: 'Select the date to expire',
|
92 |
+
id: 'ujic-datapick',
|
93 |
+
},
|
94 |
+
{
|
95 |
+
type: 'container',
|
96 |
+
id: 'ujic_sel_time',
|
97 |
+
label: 'Select Time:',
|
98 |
+
items: [
|
99 |
+
{
|
100 |
+
type: 'listbox',
|
101 |
+
name: 'ujic_hou',
|
102 |
+
tooltip: 'Select hour',
|
103 |
+
id: 'ujic_hou',
|
104 |
+
values: ujic_hou,
|
105 |
+
},
|
106 |
+
{
|
107 |
+
type: 'label',
|
108 |
+
id: 'ujic_time_space',
|
109 |
+
text: ' : ',
|
110 |
+
},
|
111 |
+
{
|
112 |
+
type: 'listbox',
|
113 |
+
name: 'ujic_min',
|
114 |
+
tooltip: 'Select minute',
|
115 |
+
id: 'ujic_min',
|
116 |
+
values: ujic_min,
|
117 |
+
},
|
118 |
+
],
|
119 |
+
},
|
120 |
+
{
|
121 |
+
type: 'container',
|
122 |
+
id: 'ujic_inp_time',
|
123 |
+
label: 'Repeat Every:',
|
124 |
+
items: [
|
125 |
+
{
|
126 |
+
type: 'textbox',
|
127 |
+
name: 'ujic_thou',
|
128 |
+
tooltip: 'Select hours',
|
129 |
+
id: 'ujic_thou',
|
130 |
+
classes: 'ujic_time_inp',
|
131 |
+
},
|
132 |
+
{
|
133 |
+
type: 'label',
|
134 |
+
id: 'ujic_time_space',
|
135 |
+
text: ' : ',
|
136 |
+
},
|
137 |
+
{
|
138 |
+
type: 'textbox',
|
139 |
+
name: 'ujic_tmin',
|
140 |
+
tooltip: 'Select minutes',
|
141 |
+
id: 'ujic_tmin',
|
142 |
+
classes: 'ujic_time_inp',
|
143 |
+
},
|
144 |
+
{
|
145 |
+
type: 'label',
|
146 |
+
id: 'ujic_time_space',
|
147 |
+
text: ' : ',
|
148 |
+
},
|
149 |
+
{
|
150 |
+
type: 'textbox',
|
151 |
+
name: 'ujic_tsec',
|
152 |
+
tooltip: 'Select seconds',
|
153 |
+
id: 'ujic_tsec',
|
154 |
+
classes: 'ujic_time_inp',
|
155 |
+
},
|
156 |
+
],
|
157 |
+
},
|
158 |
+
{
|
159 |
+
type: 'container',
|
160 |
+
html: '<div class="uji_spacer"></div>',
|
161 |
+
id: 'ujic_space_mv',
|
162 |
+
},
|
163 |
+
{
|
164 |
+
type: 'container',
|
165 |
+
label: 'After expiration:',
|
166 |
+
items: [
|
167 |
+
{
|
168 |
+
type: 'checkbox',
|
169 |
+
name: 'ujic_hide',
|
170 |
+
checked: true,
|
171 |
+
id: 'ujic_hide',
|
172 |
+
},
|
173 |
+
{
|
174 |
+
type: 'label',
|
175 |
+
id: 'ujic_hide_txt',
|
176 |
+
text: ' Hide countdown',
|
177 |
+
},
|
178 |
+
],
|
179 |
+
},
|
180 |
+
{
|
181 |
+
type: 'textbox',
|
182 |
+
name: 'ujic_url',
|
183 |
+
id: 'ujic_url',
|
184 |
+
label: 'Or go to URL',
|
185 |
+
text: 'http://',
|
186 |
+
tooltip: 'Redirect page to above link',
|
187 |
+
},
|
188 |
+
{
|
189 |
+
type: 'container',
|
190 |
+
html: '<div class="uji_spacer"></div>',
|
191 |
+
},
|
192 |
+
{
|
193 |
+
type: 'container',
|
194 |
+
label: 'Recurring Time:',
|
195 |
+
items: [
|
196 |
+
{
|
197 |
+
type: 'label',
|
198 |
+
id: 'ujic_rev_txt',
|
199 |
+
text: 'Every:',
|
200 |
+
},
|
201 |
+
{
|
202 |
+
type: 'textbox',
|
203 |
+
name: 'ujic_rev',
|
204 |
+
id: 'ujic_rev',
|
205 |
+
tooltip: 'Number of Unit',
|
206 |
+
},
|
207 |
+
{
|
208 |
+
type: 'listbox',
|
209 |
+
name: 'ujic_revlab',
|
210 |
+
tooltip: 'Select unit of time',
|
211 |
+
id: 'ujic_revlab',
|
212 |
+
values: ujic_reclab,
|
213 |
+
},
|
214 |
+
],
|
215 |
+
},
|
216 |
+
{
|
217 |
+
type: 'container',
|
218 |
+
label: ' ',
|
219 |
+
items: [
|
220 |
+
{
|
221 |
+
type: 'label',
|
222 |
+
id: 'ujic_rep_txt',
|
223 |
+
text: 'Repeats:',
|
224 |
+
},
|
225 |
+
{
|
226 |
+
type: 'textbox',
|
227 |
+
name: 'ujic_rep',
|
228 |
+
id: 'ujic_rep',
|
229 |
+
tooltip:
|
230 |
+
'Unit of time and number of repeats',
|
231 |
+
},
|
232 |
+
{
|
233 |
+
type: 'label',
|
234 |
+
id: 'ujic_rep_des',
|
235 |
+
text: 'leave it empty for unlimited',
|
236 |
+
},
|
237 |
+
],
|
238 |
+
},
|
239 |
+
{
|
240 |
+
type: 'container',
|
241 |
+
html: '<div class="uji_spacer"></div>',
|
242 |
+
},
|
243 |
+
|
244 |
+
ujic_extends,
|
245 |
+
],
|
246 |
+
onsubmit: function (e) {
|
247 |
+
//One Time Timer
|
248 |
+
if (e.data.ujic_type_one === true) {
|
249 |
+
var window_id = this._id;
|
250 |
+
if (e.data.ujic_date === '') {
|
251 |
+
var inputs = jQuery(
|
252 |
+
'#' + window_id + '-body'
|
253 |
+
).find('.mce-formitem input');
|
254 |
+
editor.windowManager.alert(
|
255 |
+
'Please fill Expire Date field.'
|
256 |
+
);
|
257 |
+
jQuery(inputs.get(0)).css(
|
258 |
+
'border-color',
|
259 |
+
'red'
|
260 |
+
);
|
261 |
+
return false;
|
262 |
+
}
|
263 |
+
|
264 |
+
var theTimer =
|
265 |
+
'" expire="' +
|
266 |
+
e.data.ujic_date +
|
267 |
+
' ' +
|
268 |
+
e.data.ujic_hou +
|
269 |
+
':' +
|
270 |
+
e.data.ujic_min;
|
271 |
+
}
|
272 |
+
//Repeat Timer
|
273 |
+
if (e.data.ujic_type_rep === true) {
|
274 |
+
var window_id = this._id;
|
275 |
+
|
276 |
+
if (
|
277 |
+
e.data.ujic_thou === '' ||
|
278 |
+
!jQuery.isNumeric(e.data.ujic_thou)
|
279 |
+
) {
|
280 |
+
var inputs = jQuery(
|
281 |
+
'#' + window_id + '-body'
|
282 |
+
).find('#ujic_thou');
|
283 |
+
editor.windowManager.alert(
|
284 |
+
'Please fill Hours field.'
|
285 |
+
);
|
286 |
+
jQuery(inputs.get(0)).css(
|
287 |
+
'border-color',
|
288 |
+
'red'
|
289 |
+
);
|
290 |
+
return false;
|
291 |
+
}
|
292 |
+
if (
|
293 |
+
e.data.ujic_tmin === '' ||
|
294 |
+
!jQuery.isNumeric(e.data.ujic_tmin)
|
295 |
+
) {
|
296 |
+
var inputs = jQuery(
|
297 |
+
'#' + window_id + '-body'
|
298 |
+
).find('#ujic_tmin');
|
299 |
+
editor.windowManager.alert(
|
300 |
+
'Please fill Minutes field.'
|
301 |
+
);
|
302 |
+
jQuery(inputs.get(0)).css(
|
303 |
+
'border-color',
|
304 |
+
'red'
|
305 |
+
);
|
306 |
+
return false;
|
307 |
+
}
|
308 |
+
if (
|
309 |
+
e.data.ujic_tsec === '' ||
|
310 |
+
!jQuery.isNumeric(e.data.ujic_tsec)
|
311 |
+
) {
|
312 |
+
var inputs = jQuery(
|
313 |
+
'#' + window_id + '-body'
|
314 |
+
).find('#ujic_tsec');
|
315 |
+
editor.windowManager.alert(
|
316 |
+
'Please fill Seconds field.'
|
317 |
+
);
|
318 |
+
jQuery(inputs.get(0)).css(
|
319 |
+
'border-color',
|
320 |
+
'red'
|
321 |
+
);
|
322 |
+
return false;
|
323 |
+
}
|
324 |
+
|
325 |
+
var theTimer =
|
326 |
+
'" timer="' +
|
327 |
+
e.data.ujic_thou +
|
328 |
+
':' +
|
329 |
+
e.data.ujic_tmin +
|
330 |
+
':' +
|
331 |
+
e.data.ujic_tsec;
|
332 |
+
}
|
333 |
+
//console.log(e);
|
334 |
+
editor.insertContent(
|
335 |
+
'[ujicountdown id="' +
|
336 |
+
e.data.ujic_style +
|
337 |
+
theTimer +
|
338 |
+
'" hide="' +
|
339 |
+
e.data.ujic_hide +
|
340 |
+
'" url="' +
|
341 |
+
e.data.ujic_url +
|
342 |
+
'" subscr="' +
|
343 |
+
e.data.ujic_camp +
|
344 |
+
'" recurring="' +
|
345 |
+
e.data.ujic_rev +
|
346 |
+
'" rectype="' +
|
347 |
+
e.data.ujic_revlab +
|
348 |
+
'" repeats="' +
|
349 |
+
e.data.ujic_rep +
|
350 |
+
'"]'
|
351 |
+
);
|
352 |
+
},
|
353 |
+
});
|
354 |
+
}
|
355 |
+
//Button name change
|
356 |
+
if (typeof ujic_styles != 'undefined' && !ujic_styles) {
|
357 |
+
jQuery('#uji-contdown-pop .mce-foot')
|
358 |
+
.find('button')
|
359 |
+
.first()
|
360 |
+
.parent()
|
361 |
+
.hide();
|
362 |
+
jQuery('#uji-contdown-pop .mce-foot')
|
363 |
+
.find('button')
|
364 |
+
.last()
|
365 |
+
.html('Got It!');
|
366 |
+
} else {
|
367 |
+
jQuery('#uji-contdown-pop .mce-foot')
|
368 |
+
.find('button')
|
369 |
+
.first()
|
370 |
+
.html('Insert');
|
371 |
+
}
|
372 |
+
|
373 |
+
//Datapicker Unfocus
|
374 |
+
jQuery('#uji-contdown-pop').on('click', function () {
|
375 |
+
jQuery('#ujic-datapick').blur();
|
376 |
+
});
|
377 |
+
//Datapicker Initiate
|
378 |
+
jQuery('#ujic-datapick').datepicker({
|
379 |
+
dateFormat: 'yy/mm/dd',
|
380 |
+
});
|
381 |
+
//URL http:// placeholder
|
382 |
+
jQuery('#uji-contdown-pop #ujic_url').attr(
|
383 |
+
'placeholder',
|
384 |
+
'http://'
|
385 |
+
);
|
386 |
+
|
387 |
+
//Check based on URL. Hide if empty
|
388 |
+
jQuery('#ujic_url').focusin(function () {
|
389 |
+
jQuery('#ujic_hide').attr('aria-checked', false);
|
390 |
+
jQuery('#ujic_hide').removeClass('mce-checked');
|
391 |
+
});
|
392 |
+
jQuery('#ujic_url').focusout(function () {
|
393 |
+
if (jQuery(this).val() === '') {
|
394 |
+
//console.log(jQuery(this).val());
|
395 |
+
jQuery('#ujic_hide').attr('aria-checked', true);
|
396 |
+
jQuery('#ujic_hide').addClass('mce-checked');
|
397 |
+
}
|
398 |
+
});
|
399 |
+
//Type
|
400 |
+
var input_type_timer = jQuery('#ujic_inp_time')
|
401 |
+
.parent()
|
402 |
+
.parent('.mce-container');
|
403 |
+
|
404 |
+
var size_sp_mv = cntType !== 'pro' ? '280' : '210';
|
405 |
+
var size_timer = cntType !== 'pro' ? '190' : '120';
|
406 |
+
|
407 |
+
jQuery('#ujic_space_mv').css('top', size_sp_mv + 'px');
|
408 |
+
input_type_timer.css('top', size_timer + 'px');
|
409 |
+
input_type_timer.hide();
|
410 |
+
|
411 |
+
jQuery('#uji-contdown-pop #ujic_thou').attr(
|
412 |
+
'placeholder',
|
413 |
+
'Hours'
|
414 |
+
);
|
415 |
+
jQuery('#uji-contdown-pop #ujic_tmin').attr(
|
416 |
+
'placeholder',
|
417 |
+
'Minutes'
|
418 |
+
);
|
419 |
+
jQuery('#uji-contdown-pop #ujic_tsec').attr(
|
420 |
+
'placeholder',
|
421 |
+
'Seconds'
|
422 |
+
);
|
423 |
+
|
424 |
+
jQuery('#ujic_type_rep').attr('aria-checked', false);
|
425 |
+
|
426 |
+
var input_type_one = jQuery('#ujic-datapick-l')
|
427 |
+
.parent()
|
428 |
+
.parent('.mce-container');
|
429 |
+
var input_type_time = jQuery('#ujic_sel_time-l')
|
430 |
+
.parent()
|
431 |
+
.parent('.mce-container');
|
432 |
+
|
433 |
+
jQuery('#ujic_type_rep').on('click', function () {
|
434 |
+
//console.log(jQuery(this).attr('aria-checked'));
|
435 |
+
if (jQuery(this).attr('aria-checked') === 'false') {
|
436 |
+
input_type_one.hide();
|
437 |
+
input_type_time.hide();
|
438 |
+
input_type_timer.show();
|
439 |
+
win.find('#ujic_type_one').checked(false);
|
440 |
+
}
|
441 |
+
});
|
442 |
+
jQuery('#ujic_type_one').on('click', function () {
|
443 |
+
if (jQuery(this).attr('aria-checked') === 'false') {
|
444 |
+
input_type_one.show();
|
445 |
+
input_type_time.show();
|
446 |
+
input_type_timer.hide();
|
447 |
+
win.find('#ujic_type_rep').checked(false);
|
448 |
+
}
|
449 |
+
});
|
450 |
+
},
|
451 |
+
});
|
452 |
+
});
|
453 |
+
})();
|
assets/js/widget.js
CHANGED
@@ -1,40 +1,44 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
jQuery('#widgets-right').on('mouseover', '.ujic_date', function () {
|
3 |
+
jQuery('#widgets-right').find('.ujic_date').datepicker({
|
4 |
+
dateFormat: 'yy/mm/dd',
|
5 |
+
});
|
6 |
+
});
|
7 |
+
|
8 |
+
jQuery('.ujic_link').each(function () {
|
9 |
+
jQuery(this).keyup(function () {
|
10 |
+
var value = jQuery(this).val();
|
11 |
+
var cname = jQuery(this)
|
12 |
+
.parent()
|
13 |
+
.parent()
|
14 |
+
.find('.ujic_exp')
|
15 |
+
.attr('name');
|
16 |
+
jQuery(this)
|
17 |
+
.parent()
|
18 |
+
.parent()
|
19 |
+
.find('.ujic_exp')
|
20 |
+
.css('border', 'red');
|
21 |
+
//alert(cname);
|
22 |
+
|
23 |
+
if (value) {
|
24 |
+
jQuery('input[name="' + cname + '"]').attr('checked', false);
|
25 |
+
} else {
|
26 |
+
jQuery('input[name="' + cname + '"]').attr('checked', true);
|
27 |
+
}
|
28 |
+
});
|
29 |
+
});
|
30 |
+
//Timer Type
|
31 |
+
|
32 |
+
jQuery('#widgets-right').on('click', '.ujic_type_radio', function () {
|
33 |
+
var chkVal = jQuery(this).val();
|
34 |
+
if (chkVal == 'ujic_type_one') {
|
35 |
+
jQuery('.ujict_one').show();
|
36 |
+
jQuery('.ujict_rep').hide();
|
37 |
+
}
|
38 |
+
if (chkVal == 'ujic_type_rep') {
|
39 |
+
jQuery('.ujict_one').hide();
|
40 |
+
jQuery('.ujict_rep').show();
|
41 |
+
}
|
42 |
+
});
|
43 |
+
// var selValue = $('input[name=rbnNumber]:checked').val();
|
44 |
+
});
|
classes/class-uji-countdown-admin.php
CHANGED
@@ -61,13 +61,14 @@ class Uji_Countdown_Admin {
|
|
61 |
if ( $this->saved_db_style() ) {
|
62 |
|
63 |
$table_headers = '
|
64 |
-
<th class="manage-column" scope="col"><span>' . __( '
|
65 |
<th class="manage-column" scope="col"><span>' . __( 'Name', 'ujicountdown' ) . '</span></th>
|
66 |
<th class="manage-column" scope="col"><span>' . __( 'Style', 'ujicountdown' ) . '</span></th>
|
67 |
<th class="manage-column" scope="col"><span>' . __( 'Change', 'ujicountdown' ) . '</span></th>';
|
68 |
|
69 |
$tab = '<div id="ujic_table" class="list">
|
70 |
-
<a href="?page=ujicountdown&tab=tab_ujic_new" class="button button-primary" id="ujic_table_new">' . __( 'Create a
|
|
|
71 |
<table cellspacing="0" class="widefat fixed">
|
72 |
<thead>
|
73 |
<tr>
|
@@ -96,6 +97,17 @@ class Uji_Countdown_Admin {
|
|
96 |
echo '<a href="?page=ujicountdown&tab=tab_ujic_new" class="ujic_butnew" id="ujic_table_new">' . __( 'Add New Style', 'ujicountdown' ) . '</a>';
|
97 |
echo '<div class="ujic_new_cnt"><h2>WHAT\'S NEW</h2>';
|
98 |
echo '<ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
<li>
|
100 |
<img alt="recurring time" src="' . UJICOUNTDOWN_URL . 'assets/images/icon-rec.png">
|
101 |
<h3>Recurring Timer</h3>
|
@@ -104,7 +116,7 @@ class Uji_Countdown_Admin {
|
|
104 |
</li>
|
105 |
<li>
|
106 |
<img alt="email subscription" src="' . UJICOUNTDOWN_URL . 'assets/images/icon-email.png">
|
107 |
-
<h3>Email Subscription
|
108 |
<p>Visitors have now the option to subscribe using the email subscription form</p>
|
109 |
<p>Create unlimited Campaigns</p>
|
110 |
</li>
|
@@ -117,7 +129,7 @@ class Uji_Countdown_Admin {
|
|
117 |
<img alt="more customization" src="' . UJICOUNTDOWN_URL . 'assets/images/icon-custom.png">
|
118 |
<h3>More Customization</h3>
|
119 |
<p>Option to enable/disable the units of the time</p>
|
120 |
-
|
121 |
</li>
|
122 |
<li>
|
123 |
<img alt="Multilanguage support" src="' . UJICOUNTDOWN_URL . 'assets/images/icon-glob.png">
|
@@ -135,11 +147,6 @@ class Uji_Countdown_Admin {
|
|
135 |
<h3>Right-To-Left (RTL)</h3>
|
136 |
<p>Support "Left to Right" to Arabic "Right to Left" </p>
|
137 |
</li>
|
138 |
-
<li>
|
139 |
-
<img alt="wordpress" src="' . UJICOUNTDOWN_URL . 'assets/images/icon-wp.png">
|
140 |
-
<h3>WordPress 5.0</h3>
|
141 |
-
<p>Fully supports WordPress 5.0, while maintaining compatibility through version 3.5+</p>
|
142 |
-
</li>
|
143 |
</ul>';
|
144 |
echo '</div></div>';
|
145 |
|
@@ -151,6 +158,68 @@ class Uji_Countdown_Admin {
|
|
151 |
if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'tab_ujic_new' )
|
152 |
$this->left_metaboxes();
|
153 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
/**
|
156 |
* Print template new/edit countdown.
|
@@ -172,8 +241,8 @@ class Uji_Countdown_Admin {
|
|
172 |
$cur_style = ( $this->cform_is_edit() ) ? $vars['ujic_style'] : ( ( isset( $_GET['style'] ) && !empty( $_GET['style'] ) ) ? $_GET['style'] : 'classic' );
|
173 |
|
174 |
//Build Forms
|
175 |
-
|
176 |
-
$cnt
|
177 |
$cnt .= $this->cform_style( $cur_style );
|
178 |
$cnt .= '<input name="ujic_style" id="ujic-style" type="hidden" class="normal-text" value="' . $cur_style . '"/>';
|
179 |
$cnt .= $this->cform_input( __( 'Timer Title:', 'ujicountdown' ), 'ujic_name', $vars['ujic_name'] );
|
@@ -238,7 +307,7 @@ class Uji_Countdown_Admin {
|
|
238 |
$form .= '<div class="ujic-chkbtn">';
|
239 |
$i = 0;
|
240 |
foreach ( $names as $name ) {
|
241 |
-
$form .= '<input id="' . $name . '" type="checkbox" value="true"
|
242 |
$form .= '<label for="' . $name . '">' . $name_val[$i] . '</label>';
|
243 |
$i++;
|
244 |
}
|
@@ -253,11 +322,17 @@ class Uji_Countdown_Admin {
|
|
253 |
*
|
254 |
* @since 2.0
|
255 |
*/
|
256 |
-
public function custom_metabox( $name, $cnt, $class = NULL ) {
|
257 |
$meta = '<div class="metabox-holder' . ( ( isset( $class ) && !empty( $class ) ) ? ' ' . $class : '' ) . '">
|
258 |
-
<div class="postbox">
|
259 |
-
|
260 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
<div class="inside">';
|
262 |
$meta .= $cnt;
|
263 |
$meta .= '</div></div></div>';
|
@@ -270,13 +345,17 @@ class Uji_Countdown_Admin {
|
|
270 |
*
|
271 |
* @since 2.0
|
272 |
*/
|
273 |
-
private function multi_custom_metabox( $name, $cnt, $class = NULL ) {
|
274 |
$meta = '<div class="metabox-holder' . ( ( isset( $class ) && !empty( $class ) ) ? ' ' . $class : '' ) . '">';
|
275 |
$i = 0;
|
|
|
276 |
foreach ( $cnt as $content ) {
|
277 |
$meta .= '<div class="postbox">';
|
278 |
-
$
|
279 |
-
|
|
|
|
|
|
|
280 |
$meta .= '<div class="inside">';
|
281 |
$meta .= $content;
|
282 |
$meta .= '</div>';
|
@@ -287,6 +366,23 @@ class Uji_Countdown_Admin {
|
|
287 |
|
288 |
return $meta;
|
289 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
|
291 |
/**
|
292 |
* Preview metaboxes.
|
@@ -342,7 +438,7 @@ class Uji_Countdown_Admin {
|
|
342 |
$prw = apply_filters( 'ujic_admin_add_preview', $countDownOptions, $prw, $style );
|
343 |
|
344 |
if( isset($prw) && !empty($prw) )
|
345 |
-
echo $this->custom_metabox( __( 'Preview Timer Style', 'ujicountdown' ), $prw, 'ujic-preview' );
|
346 |
}
|
347 |
|
348 |
/**
|
@@ -395,7 +491,7 @@ class Uji_Countdown_Admin {
|
|
395 |
$form .= '</div>';
|
396 |
return $form;
|
397 |
}
|
398 |
-
|
399 |
/**
|
400 |
* Print title.
|
401 |
*
|
@@ -432,8 +528,8 @@ class Uji_Countdown_Admin {
|
|
432 |
$form .= '<div class="ujic-radbtn">';
|
433 |
$i = 0;
|
434 |
foreach ( $types as $type ) {
|
435 |
-
$form .= '<input id="' . $type . '" type="radio" value="' . $type . '" class="iradio_flat-pink" name="' . $name . '" ' . checked( $val, $type, false ) . '>';
|
436 |
-
$form .= '<label for="' . $
|
437 |
$i++;
|
438 |
}
|
439 |
$form .= '</div>';
|
@@ -458,6 +554,51 @@ class Uji_Countdown_Admin {
|
|
458 |
$form .= '</div>';
|
459 |
return $form;
|
460 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
|
462 |
/**
|
463 |
* Print slider-ui field.
|
@@ -520,6 +661,52 @@ class Uji_Countdown_Admin {
|
|
520 |
|
521 |
return $form;
|
522 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
|
524 |
/**
|
525 |
* Form Type.
|
@@ -573,19 +760,19 @@ class Uji_Countdown_Admin {
|
|
573 |
|
574 |
//name not empty
|
575 |
if ( empty( $_POST['ujic_name'] ) ) {
|
576 |
-
$ujic_form_err .= __( "Please
|
577 |
}
|
578 |
|
579 |
//check format
|
580 |
if ( !isset( $_POST['ujic_d'] ) && !isset( $_POST['ujic_h'] ) && !isset( $_POST['ujic_m'] ) && !isset( $_POST['ujic_s'] ) && !isset( $_POST['ujic_y'] ) && !isset( $_POST['ujic_o'] ) && !isset( $_POST['ujic_w'] ) ) {
|
581 |
-
$ujic_form_err .= __( "Please
|
582 |
}
|
583 |
|
584 |
//check name exist
|
585 |
if ( !empty( $_POST['ujic_name'] ) && !$this->cform_is_edit() ) {
|
586 |
$cname = $wpdb->get_var( "SELECT title FROM " . $this->ujic_tab_name() . " WHERE title = '" . $_POST['ujic_name'] . "'" );
|
587 |
if ( !empty( $cname ) ) {
|
588 |
-
$ujic_form_err .= __( "This
|
589 |
}
|
590 |
}
|
591 |
|
61 |
if ( $this->saved_db_style() ) {
|
62 |
|
63 |
$table_headers = '
|
64 |
+
<th class="manage-column" scope="col"><span>' . __( 'Created On', 'ujicountdown' ) . '</span></th>
|
65 |
<th class="manage-column" scope="col"><span>' . __( 'Name', 'ujicountdown' ) . '</span></th>
|
66 |
<th class="manage-column" scope="col"><span>' . __( 'Style', 'ujicountdown' ) . '</span></th>
|
67 |
<th class="manage-column" scope="col"><span>' . __( 'Change', 'ujicountdown' ) . '</span></th>';
|
68 |
|
69 |
$tab = '<div id="ujic_table" class="list">
|
70 |
+
<a href="?page=ujicountdown&tab=tab_ujic_new" class="button button-primary" id="ujic_table_new">' . __( 'Create a New Timer Style', 'ujicountdown' ) . '</a>
|
71 |
+
<a href="?page=ujicountdown&tab=tab_ujic_shortcode" class="button button-secondary" id="ujic_table_new">' . __( 'Generate ShortCode', 'ujicountdown' ) . '</a>
|
72 |
<table cellspacing="0" class="widefat fixed">
|
73 |
<thead>
|
74 |
<tr>
|
97 |
echo '<a href="?page=ujicountdown&tab=tab_ujic_new" class="ujic_butnew" id="ujic_table_new">' . __( 'Add New Style', 'ujicountdown' ) . '</a>';
|
98 |
echo '<div class="ujic_new_cnt"><h2>WHAT\'S NEW</h2>';
|
99 |
echo '<ul>
|
100 |
+
<li>
|
101 |
+
<img alt="shortcode generator" src="' . UJICOUNTDOWN_URL . 'assets/images/icon-sc.png">
|
102 |
+
<h3>Shortcode Generator</h3>
|
103 |
+
<p>Quickly generate shortcode and copy/paste in your page or post.</p>
|
104 |
+
<p>Compatibility with any theme</p>
|
105 |
+
</li>
|
106 |
+
<li>
|
107 |
+
<img alt="wordpress" src="' . UJICOUNTDOWN_URL . 'assets/images/icon-wp.png">
|
108 |
+
<h3>WordPress Block Editor</h3>
|
109 |
+
<p>Fully supports WordPress Block Editor, while maintaining compatibility through Classic Editor</p>
|
110 |
+
</li>
|
111 |
<li>
|
112 |
<img alt="recurring time" src="' . UJICOUNTDOWN_URL . 'assets/images/icon-rec.png">
|
113 |
<h3>Recurring Timer</h3>
|
116 |
</li>
|
117 |
<li>
|
118 |
<img alt="email subscription" src="' . UJICOUNTDOWN_URL . 'assets/images/icon-email.png">
|
119 |
+
<h3>Email Subscription Add-on</h3>
|
120 |
<p>Visitors have now the option to subscribe using the email subscription form</p>
|
121 |
<p>Create unlimited Campaigns</p>
|
122 |
</li>
|
129 |
<img alt="more customization" src="' . UJICOUNTDOWN_URL . 'assets/images/icon-custom.png">
|
130 |
<h3>More Customization</h3>
|
131 |
<p>Option to enable/disable the units of the time</p>
|
132 |
+
<p>Option to change the label color and size</p>
|
133 |
</li>
|
134 |
<li>
|
135 |
<img alt="Multilanguage support" src="' . UJICOUNTDOWN_URL . 'assets/images/icon-glob.png">
|
147 |
<h3>Right-To-Left (RTL)</h3>
|
148 |
<p>Support "Left to Right" to Arabic "Right to Left" </p>
|
149 |
</li>
|
|
|
|
|
|
|
|
|
|
|
150 |
</ul>';
|
151 |
echo '</div></div>';
|
152 |
|
158 |
if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'tab_ujic_new' )
|
159 |
$this->left_metaboxes();
|
160 |
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Shortcode generator.
|
164 |
+
*
|
165 |
+
* @since 2.1.3
|
166 |
+
*/
|
167 |
+
public function admin_shortcode() {
|
168 |
+
|
169 |
+
//ID
|
170 |
+
$cur_id = ( $this->cform_is_edit() ) ? $_GET['edit'] : '';
|
171 |
+
|
172 |
+
//Get vars
|
173 |
+
$vars = $this->ujic_option( $cur_id );
|
174 |
+
|
175 |
+
//Curent style
|
176 |
+
$cur_style = ( $this->cform_is_edit() ) ? $vars['ujic_style'] : ( ( isset( $_GET['style'] ) && !empty( $_GET['style'] ) ) ? $_GET['style'] : 'classic' );
|
177 |
+
|
178 |
+
|
179 |
+
$cnt = '<form id="uji-shortcode">';
|
180 |
+
// Style
|
181 |
+
$cnt .= $this->cform_select( __( 'Select Style:', 'ujicountdown' ), 'ujic_style', ujic_styles_get('Select saved style'), '');
|
182 |
+
// Timer Type:
|
183 |
+
$vars['ujic_type'] = array( 'onetime', 'repeat' );
|
184 |
+
$cnt .= $this->cform_radiobox( __( 'Timer Type:', 'ujicountdown' ), 'ujic_type', array( __( 'One Time Timer', 'ujicountdown' ), __( 'Repeating Timer', 'ujicountdown' ) ), $vars['ujic_type'], '' );
|
185 |
+
// Expiration Date and Time:
|
186 |
+
$cnt .= $this->cform_date(__( 'Expiration Date:', 'ujicountdown' ), 'ujic_exp_date');
|
187 |
+
// Expiration Date and Time select HH:MM
|
188 |
+
$hh = ujic_datetime_get(23);
|
189 |
+
$mm = ujic_datetime_get(59);
|
190 |
+
$cnt .= $this->cform_select_time( __( 'Expiration Time:', 'ujicountdown' ), 'ujic_seltime', $hh, $mm );
|
191 |
+
// Repeat Every:
|
192 |
+
$cnt .= $this->cform_time(__( 'Repeat Every:', 'ujicountdown' ), 'ujic_time');
|
193 |
+
// After expire Hide
|
194 |
+
$cnt .= $this->cform_checkbox( __( 'After expiration:', 'ujicountdown' ), array( 'ujic_exp_hide' ), array( 'Hide countdown' ), array( "true" ) );
|
195 |
+
// Or go to URL
|
196 |
+
$cnt .= $this->cform_input( __( 'Or go to the Link:', 'ujicountdown' ), 'ujic_url', '' );
|
197 |
+
// Recurring Time:
|
198 |
+
$cnt .= $this->cform_reccur( __( 'Recurring Time:', 'ujicountdown' ), ujic_reclab_get(), __( 'leave it empty for unlimited', 'ujicountdown' ) );
|
199 |
+
// Subscription
|
200 |
+
if ( defined( 'UJICSU_VERS' ) ) {
|
201 |
+
$cnt .= $this->cform_input( __( 'Campaign Name:', 'ujicountdown' ), 'ujic_camp', '' );
|
202 |
+
}
|
203 |
+
|
204 |
+
$cnt .= '<div>
|
205 |
+
<button class="button button-primary" id="uji-gen-shortcode">
|
206 |
+
Generate Shortcode
|
207 |
+
</button>
|
208 |
+
</div>';
|
209 |
+
|
210 |
+
$cnt .= '</form>';
|
211 |
+
|
212 |
+
|
213 |
+
|
214 |
+
echo $this->custom_metabox( __( "Generate Shortcode", 'ujicountdown' ), $cnt, 'ujic-create' );
|
215 |
+
|
216 |
+
//Left Metaboxes
|
217 |
+
// $this->left_metaboxes();
|
218 |
+
|
219 |
+
//Preview Metaboxes
|
220 |
+
$this->sc_metaboxes( $cur_style, $vars );
|
221 |
+
|
222 |
+
}
|
223 |
|
224 |
/**
|
225 |
* Print template new/edit countdown.
|
241 |
$cur_style = ( $this->cform_is_edit() ) ? $vars['ujic_style'] : ( ( isset( $_GET['style'] ) && !empty( $_GET['style'] ) ) ? $_GET['style'] : 'classic' );
|
242 |
|
243 |
//Build Forms
|
244 |
+
// $cnt = '<form method="post" action="page=ujicountdown&tab=tab_ujic_new&style=' . $cur_style . '&save=true">';
|
245 |
+
$cnt = $this->cform_ftype( $cur_style, $cur_id );
|
246 |
$cnt .= $this->cform_style( $cur_style );
|
247 |
$cnt .= '<input name="ujic_style" id="ujic-style" type="hidden" class="normal-text" value="' . $cur_style . '"/>';
|
248 |
$cnt .= $this->cform_input( __( 'Timer Title:', 'ujicountdown' ), 'ujic_name', $vars['ujic_name'] );
|
307 |
$form .= '<div class="ujic-chkbtn">';
|
308 |
$i = 0;
|
309 |
foreach ( $names as $name ) {
|
310 |
+
$form .= '<input id="' . $name . '" type="checkbox" value="true" class="icheckbox_flat-pink" name="' . $name . '" ' . checked( $val[$i], "true", false ) . '>';
|
311 |
$form .= '<label for="' . $name . '">' . $name_val[$i] . '</label>';
|
312 |
$i++;
|
313 |
}
|
322 |
*
|
323 |
* @since 2.0
|
324 |
*/
|
325 |
+
public function custom_metabox( $name, $cnt, $class = NULL, $toggle = false ) {
|
326 |
$meta = '<div class="metabox-holder' . ( ( isset( $class ) && !empty( $class ) ) ? ' ' . $class : '' ) . '">
|
327 |
+
<div class="postbox">';
|
328 |
+
|
329 |
+
$hndl = '';
|
330 |
+
if( $toggle ) {
|
331 |
+
$meta .= '<div class="handlediv" title="Click to toggle"></div>';
|
332 |
+
$hndl = ' class="hndle"';
|
333 |
+
}
|
334 |
+
|
335 |
+
$meta .= '<h3'.$hndl.'><span>' . $name . '</span></h3>
|
336 |
<div class="inside">';
|
337 |
$meta .= $cnt;
|
338 |
$meta .= '</div></div></div>';
|
345 |
*
|
346 |
* @since 2.0
|
347 |
*/
|
348 |
+
private function multi_custom_metabox( $name, $cnt, $class = NULL, $hndle = false ) {
|
349 |
$meta = '<div class="metabox-holder' . ( ( isset( $class ) && !empty( $class ) ) ? ' ' . $class : '' ) . '">';
|
350 |
$i = 0;
|
351 |
+
$cls_hndle = '';
|
352 |
foreach ( $cnt as $content ) {
|
353 |
$meta .= '<div class="postbox">';
|
354 |
+
if( $hndle ){
|
355 |
+
$meta .= '<div class="handlediv" title="Click to toggle"><br/></div>';
|
356 |
+
$cls_hndle = ' class="hndle"';
|
357 |
+
}
|
358 |
+
$meta .= '<h3'.$cls_hndle.'><span>' . $name[$i] . '</span></h3>';
|
359 |
$meta .= '<div class="inside">';
|
360 |
$meta .= $content;
|
361 |
$meta .= '</div>';
|
366 |
|
367 |
return $meta;
|
368 |
}
|
369 |
+
|
370 |
+
/**
|
371 |
+
* Preview metaboxes.
|
372 |
+
*
|
373 |
+
* @since 2.0
|
374 |
+
*/
|
375 |
+
private function sc_metaboxes( $style, $countDownOptions ) {
|
376 |
+
$sc = '<div class="ujic-shortcode">
|
377 |
+
<div id="ujic-scode">[ujicountdown]</div>
|
378 |
+
<button class="ujibtn-sc-copy button button-secondary" data-clipboard-action="copy" data-clipboard-target="#ujic-scode">
|
379 |
+
Copy Shortcode
|
380 |
+
</button>
|
381 |
+
</div>';
|
382 |
+
|
383 |
+
if( isset($sc) && !empty($sc) )
|
384 |
+
echo $this->custom_metabox( __( 'Shortcode', 'ujicountdown' ), $sc, 'ujic-create ujic-sc', false );
|
385 |
+
}
|
386 |
|
387 |
/**
|
388 |
* Preview metaboxes.
|
438 |
$prw = apply_filters( 'ujic_admin_add_preview', $countDownOptions, $prw, $style );
|
439 |
|
440 |
if( isset($prw) && !empty($prw) )
|
441 |
+
echo $this->custom_metabox( __( 'Preview Timer Style', 'ujicountdown' ), $prw, 'ujic-preview', true );
|
442 |
}
|
443 |
|
444 |
/**
|
491 |
$form .= '</div>';
|
492 |
return $form;
|
493 |
}
|
494 |
+
|
495 |
/**
|
496 |
* Print title.
|
497 |
*
|
528 |
$form .= '<div class="ujic-radbtn">';
|
529 |
$i = 0;
|
530 |
foreach ( $types as $type ) {
|
531 |
+
$form .= '<input id="ujic-' . $type . '" type="radio" value="' . $type . '" class="iradio_flat-pink" name="' . $name . '" ' . checked( $val, $type, false ) . '>';
|
532 |
+
$form .= '<label for="ujic-' . $type . '" id="img-' . $type . '">' . $name_val[$i] . '</label>';
|
533 |
$i++;
|
534 |
}
|
535 |
$form .= '</div>';
|
554 |
$form .= '</div>';
|
555 |
return $form;
|
556 |
}
|
557 |
+
|
558 |
+
/**
|
559 |
+
* MM and SS.
|
560 |
+
*
|
561 |
+
* @since 2.1.3
|
562 |
+
*/
|
563 |
+
public function cform_select_time( $label, $cls, $hh, $mm ) {
|
564 |
+
$form = '<div class="ujic-box '.$cls.'">';
|
565 |
+
$form .= '<div class="label">' . $label . '</div>';
|
566 |
+
$form .= '<div class="ujic-select">';
|
567 |
+
$form .= '<select class="select of-input" name="ujic_hh" id="ujic_hh">';
|
568 |
+
foreach ( $hh as $time ) {
|
569 |
+
$form .= '<option value="' . $time['value'] . '" />' . $time['text'] . '</option>';
|
570 |
+
}
|
571 |
+
$form .= '</select> : ';
|
572 |
+
|
573 |
+
$form .= '<select class="select of-input" name="ujic_mm" id="ujic_mm">';
|
574 |
+
foreach ( $mm as $time ) {
|
575 |
+
$form .= '<option value="' . $time['value'] . '" />' . $time['text'] . '</option>';
|
576 |
+
}
|
577 |
+
$form .= '</select>';
|
578 |
+
|
579 |
+
$form .= '</div></div>';
|
580 |
+
return $form;
|
581 |
+
}
|
582 |
+
|
583 |
+
/**
|
584 |
+
* Recurring time
|
585 |
+
*
|
586 |
+
* @since 2.1.3
|
587 |
+
*/
|
588 |
+
public function cform_reccur ( $label, $timelabel, $info ) {
|
589 |
+
$form = '<div class="ujic-box">
|
590 |
+
<div class="label">' . $label . '</div>';
|
591 |
+
$form .= '<div class="ujic-select"><input type="text" value="" name="ujic_rec_every" id="ujic_rec_every" class="small-text">';
|
592 |
+
$form .= ' <select class="select of-input" name="ujic_rec_time" id="ujic_rec_time">';
|
593 |
+
foreach ( $timelabel as $time ) {
|
594 |
+
$form .= '<option value="' . $time['value'] . '" />' . $time['text'] . '</option>';
|
595 |
+
}
|
596 |
+
$form .= '</select></div>';
|
597 |
+
$form .= '<div class="ujic-block-box"> <input type="text" value="" name="ujic_rec_repeat" id="ujic_rec_repeat" class="small-text"> ' . $info . '</div>';
|
598 |
+
$form .= '</div>';
|
599 |
+
|
600 |
+
return $form;
|
601 |
+
}
|
602 |
|
603 |
/**
|
604 |
* Print slider-ui field.
|
661 |
|
662 |
return $form;
|
663 |
}
|
664 |
+
|
665 |
+
/**
|
666 |
+
* Form Date.
|
667 |
+
*
|
668 |
+
* @since 2.0
|
669 |
+
*/
|
670 |
+
private function cform_date( $label, $id ) {
|
671 |
+
wp_enqueue_script( 'jquery-ui-datepicker' );
|
672 |
+
wp_enqueue_style( 'jquery-ui', UJICOUNTDOWN_URL . 'assets/css/jquery-ui.min.css' );
|
673 |
+
// wp_enqueue_script( 'jquery-widget', UJICOUNTDOWN_URL . 'assets/js/widget.js' );
|
674 |
+
|
675 |
+
$form = '<div class="ujic-box ujic-date">';
|
676 |
+
$form .= '<div class="label">' . $label . '</div>';
|
677 |
+
|
678 |
+
$form .= '<input type="text" class="ujic_date_admin" name="' . $id . '" id="' . $id . '" />';
|
679 |
+
|
680 |
+
$form .= '</div>';
|
681 |
+
|
682 |
+
return $form;
|
683 |
+
|
684 |
+
|
685 |
+
}
|
686 |
+
|
687 |
+
/**
|
688 |
+
* Form Date.
|
689 |
+
*
|
690 |
+
* @since 2.0
|
691 |
+
*/
|
692 |
+
private function cform_time( $label ) {
|
693 |
+
wp_enqueue_script( 'jquery-ui-datepicker' );
|
694 |
+
wp_enqueue_style( 'jquery-ui', UJICOUNTDOWN_URL . 'assets/css/jquery-ui.min.css' );
|
695 |
+
// wp_enqueue_script( 'jquery-widget', UJICOUNTDOWN_URL . 'assets/js/widget.js' );
|
696 |
+
|
697 |
+
$form = '<div class="ujic-box ujic-time">';
|
698 |
+
$form .= '<div class="label">' . $label . '</div>';
|
699 |
+
|
700 |
+
$form .= '<input type="text" class="ujic_thou" name="ujic_thou" value="" placeholder="Hour(s)" class="small-text" style="max-width: 80px;"/> : ';
|
701 |
+
$form .= '<input type="text" class="ujic_tmin" name="ujic_tmin" value="" placeholder="Minute(s)" class="small-text" style="max-width: 80px;"/> : ';
|
702 |
+
$form .= '<input type="text" class="ujic_tsec" name="ujic_tsec" value="" placeholder="Second(s)" class="small-text" style="max-width: 80px;"/>';
|
703 |
+
|
704 |
+
$form .= '</div>';
|
705 |
+
|
706 |
+
return $form;
|
707 |
+
|
708 |
+
|
709 |
+
}
|
710 |
|
711 |
/**
|
712 |
* Form Type.
|
760 |
|
761 |
//name not empty
|
762 |
if ( empty( $_POST['ujic_name'] ) ) {
|
763 |
+
$ujic_form_err .= __( "Please enter timer title", 'ujicountdown' ) . '<br/>';
|
764 |
}
|
765 |
|
766 |
//check format
|
767 |
if ( !isset( $_POST['ujic_d'] ) && !isset( $_POST['ujic_h'] ) && !isset( $_POST['ujic_m'] ) && !isset( $_POST['ujic_s'] ) && !isset( $_POST['ujic_y'] ) && !isset( $_POST['ujic_o'] ) && !isset( $_POST['ujic_w'] ) ) {
|
768 |
+
$ujic_form_err .= __( "Please select the timer format", 'ujicountdown' ) . '<br/>';
|
769 |
}
|
770 |
|
771 |
//check name exist
|
772 |
if ( !empty( $_POST['ujic_name'] ) && !$this->cform_is_edit() ) {
|
773 |
$cname = $wpdb->get_var( "SELECT title FROM " . $this->ujic_tab_name() . " WHERE title = '" . $_POST['ujic_name'] . "'" );
|
774 |
if ( !empty( $cname ) ) {
|
775 |
+
$ujic_form_err .= __( "This name already exist. Please change the timer name. <br/>", 'ujicountdown' );
|
776 |
}
|
777 |
}
|
778 |
|
classes/class-uji-countdown.php
CHANGED
@@ -108,8 +108,12 @@ class Uji_Countdown extends Uji_Countdown_Admin
|
|
108 |
// Load public-facing style sheet and JavaScript.
|
109 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
110 |
|
111 |
-
// HOOKs Widget
|
112 |
-
|
|
|
|
|
|
|
|
|
113 |
|
114 |
if ( is_admin() )
|
115 |
{
|
@@ -543,9 +547,6 @@ class Uji_Countdown extends Uji_Countdown_Admin
|
|
543 |
|
544 |
if(empty($_GET['tab']) || $_GET['tab'] !== 'tab_ujic_news')
|
545 |
return;
|
546 |
-
|
547 |
-
if(!isset($_GET['edit']))
|
548 |
-
echo '<div class="error"><p>' . _('In order to avoid fake subscriptions we suggest to install <a target="_blank" href = "https://wordpress.org/plugins/goodbye-captcha/">GoodBye Captcha Plugin</a>') . '</p></div>';
|
549 |
}
|
550 |
|
551 |
/**
|
@@ -568,11 +569,16 @@ class Uji_Countdown extends Uji_Countdown_Admin
|
|
568 |
wp_enqueue_script( 'jquery-ui-slider' );
|
569 |
wp_enqueue_script( 'jquery-ui-draggable' );
|
570 |
|
571 |
-
if($_GET['tab'] != "tab_ujic_news")
|
572 |
{
|
573 |
wp_enqueue_script('ujicountdown-admin-icheck', UJICOUNTDOWN_URL . 'assets/js/jquery.icheck.min.js');
|
574 |
wp_enqueue_script('ujicountdown-admin-script', UJICOUNTDOWN_URL . 'assets/js/admin-ujic.js', array('wp-color-picker'), $this->version);
|
575 |
}
|
|
|
|
|
|
|
|
|
|
|
576 |
}
|
577 |
}
|
578 |
|
@@ -703,7 +709,13 @@ class Uji_Countdown extends Uji_Countdown_Admin
|
|
703 |
* @since 2.0.4
|
704 |
*/
|
705 |
public function ujic_reclab_get() {
|
706 |
-
$tlab = array('second'=> 'Second(s)', '
|
|
|
|
|
|
|
|
|
|
|
|
|
707 |
$i=0;
|
708 |
foreach ( $tlab as $v => $n ) {
|
709 |
$ujic_sel[$i]['text'] = $n;
|
108 |
// Load public-facing style sheet and JavaScript.
|
109 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
110 |
|
111 |
+
// HOOKs Widget
|
112 |
+
global $wp_version;
|
113 |
+
|
114 |
+
if ( version_compare( $wp_version, '5.7', '<=' ) ) {
|
115 |
+
add_action( 'widgets_init', array( $this, 'ujic_register_widgets' ) );
|
116 |
+
}
|
117 |
|
118 |
if ( is_admin() )
|
119 |
{
|
547 |
|
548 |
if(empty($_GET['tab']) || $_GET['tab'] !== 'tab_ujic_news')
|
549 |
return;
|
|
|
|
|
|
|
550 |
}
|
551 |
|
552 |
/**
|
569 |
wp_enqueue_script( 'jquery-ui-slider' );
|
570 |
wp_enqueue_script( 'jquery-ui-draggable' );
|
571 |
|
572 |
+
if( isset($_GET['tab']) && $_GET['tab'] != "tab_ujic_news")
|
573 |
{
|
574 |
wp_enqueue_script('ujicountdown-admin-icheck', UJICOUNTDOWN_URL . 'assets/js/jquery.icheck.min.js');
|
575 |
wp_enqueue_script('ujicountdown-admin-script', UJICOUNTDOWN_URL . 'assets/js/admin-ujic.js', array('wp-color-picker'), $this->version);
|
576 |
}
|
577 |
+
|
578 |
+
if( isset($_GET['tab']) && $_GET['tab'] == "tab_ujic_shortcode")
|
579 |
+
{
|
580 |
+
wp_enqueue_script('ujicountdown-admin-shortcode', UJICOUNTDOWN_URL . 'assets/js/admin-shortcode.js');
|
581 |
+
}
|
582 |
}
|
583 |
}
|
584 |
|
709 |
* @since 2.0.4
|
710 |
*/
|
711 |
public function ujic_reclab_get() {
|
712 |
+
$tlab = array('second'=> __( 'Second(s)', 'ujicountdown' ),
|
713 |
+
'minute'=> __( 'Minute(s)', 'ujicountdown' ),
|
714 |
+
'hour'=> __('Hour(s)', 'ujicountdown' ),
|
715 |
+
'day'=> __( 'Day(s)', 'ujicountdown' ),
|
716 |
+
'week'=> __( 'Week(s)', 'ujicountdown' ),
|
717 |
+
'month'=> __( 'Month(s)', 'ujicountdown' )
|
718 |
+
);
|
719 |
$i=0;
|
720 |
foreach ( $tlab as $v => $n ) {
|
721 |
$ujic_sel[$i]['text'] = $n;
|
classes/uji-functions.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Get all saved styles
|
4 |
+
*
|
5 |
+
* @since 2.1.3
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
function ujic_styles_get( $first = '') {
|
14 |
+
global $wpdb;
|
15 |
+
$ujic_styles = $wpdb->get_results("SELECT style, title, link FROM " . $wpdb->prefix . "uji_counter ORDER BY `time` DESC");
|
16 |
+
$ujic_sel = array();
|
17 |
+
|
18 |
+
if ( !empty($ujic_styles) ) {
|
19 |
+
foreach ( $ujic_styles as $ujic ) {
|
20 |
+
$ujic_sel[$ujic->link] = $ujic->title;
|
21 |
+
}
|
22 |
+
|
23 |
+
if($first){
|
24 |
+
$selop = array( '' => $first );
|
25 |
+
$ujic_sel = array_merge($selop, $ujic_sel);
|
26 |
+
}
|
27 |
+
return $ujic_sel;
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
function ujic_datetime_get($nr) {
|
33 |
+
$ujic_sel = array();
|
34 |
+
for ( $i = 0; $i <= $nr; $i++ ) {
|
35 |
+
$ujic_sel[$i]['text'] = $num[sprintf("%02s", $i)] = sprintf("%02s", $i);
|
36 |
+
$ujic_sel[$i]['value'] = $i;
|
37 |
+
}
|
38 |
+
|
39 |
+
return $ujic_sel;
|
40 |
+
}
|
41 |
+
|
42 |
+
function ujic_reclab_get() {
|
43 |
+
$tlab = array('second'=> __( 'Second(s)', 'ujicountdown' ),
|
44 |
+
'minute'=> __( 'Minute(s)', 'ujicountdown' ),
|
45 |
+
'hour'=> __('Hour(s)', 'ujicountdown' ),
|
46 |
+
'day'=> __( 'Day(s)', 'ujicountdown' ),
|
47 |
+
'week'=> __( 'Week(s)', 'ujicountdown' ),
|
48 |
+
'month'=> __( 'Month(s)', 'ujicountdown' ));
|
49 |
+
$i=0;
|
50 |
+
foreach ( $tlab as $v => $n ) {
|
51 |
+
$ujic_sel[$i]['text'] = $n;
|
52 |
+
$ujic_sel[$i]['value'] = $v;
|
53 |
+
$i++;
|
54 |
+
}
|
55 |
+
|
56 |
+
return $ujic_sel;
|
57 |
+
}
|
58 |
+
|
59 |
+
?>
|
ujicountdown.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Uji Countdown
|
4 |
Plugin URI: http://www.wpmanage.com/uji-countdown
|
5 |
Description: HTML5 Customizable Countdown.
|
6 |
-
Version: 2.
|
7 |
Text Domain: ujicountdown
|
8 |
Domain Path: /lang
|
9 |
Author: Wpmanage.com
|
@@ -21,7 +21,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
21 |
defined( 'WPINC' ) || exit;
|
22 |
|
23 |
define( 'UJIC_NAME', defined('UJIC_NAMEPRO') ? UJIC_NAMEPRO : 'Uji Countdown' );
|
24 |
-
define( 'UJIC_ORIG', '2.
|
25 |
define( 'UJIC_VERS', defined('UJIC_VERSPRO') ? UJIC_VERSPRO : UJIC_ORIG );
|
26 |
define( 'UJIC_FOLD', 'uji-countdown' );
|
27 |
define( 'UJICOUNTDOWN', trailingslashit( dirname(__FILE__) ) );
|
@@ -31,6 +31,8 @@ define( 'UJICOUNTDOWN_FILE', __FILE__ );
|
|
31 |
|
32 |
//Google Fonts
|
33 |
require_once( plugin_dir_path( __FILE__ ) . 'assets/googlefonts.php' );
|
|
|
|
|
34 |
|
35 |
/**
|
36 |
* Block Initializer.
|
@@ -41,7 +43,15 @@ require_once plugin_dir_path( __FILE__ ) . 'src/blocks.php';
|
|
41 |
require_once( plugin_dir_path( __FILE__ ) . 'classes/class-uji-countdown-admin.php' );
|
42 |
require_once( plugin_dir_path( __FILE__ ) . 'classes/class-uji-countdown.php' );
|
43 |
require_once( plugin_dir_path( __FILE__ ) . 'classes/class-uji-countdown-front.php' );
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
// INIT
|
47 |
Uji_Countdown::get_instance();
|
3 |
Plugin Name: Uji Countdown
|
4 |
Plugin URI: http://www.wpmanage.com/uji-countdown
|
5 |
Description: HTML5 Customizable Countdown.
|
6 |
+
Version: 2.2
|
7 |
Text Domain: ujicountdown
|
8 |
Domain Path: /lang
|
9 |
Author: Wpmanage.com
|
21 |
defined( 'WPINC' ) || exit;
|
22 |
|
23 |
define( 'UJIC_NAME', defined('UJIC_NAMEPRO') ? UJIC_NAMEPRO : 'Uji Countdown' );
|
24 |
+
define( 'UJIC_ORIG', '2.2' );
|
25 |
define( 'UJIC_VERS', defined('UJIC_VERSPRO') ? UJIC_VERSPRO : UJIC_ORIG );
|
26 |
define( 'UJIC_FOLD', 'uji-countdown' );
|
27 |
define( 'UJICOUNTDOWN', trailingslashit( dirname(__FILE__) ) );
|
31 |
|
32 |
//Google Fonts
|
33 |
require_once( plugin_dir_path( __FILE__ ) . 'assets/googlefonts.php' );
|
34 |
+
// Functions
|
35 |
+
require_once( plugin_dir_path( __FILE__ ) . 'classes/uji-functions.php' );
|
36 |
|
37 |
/**
|
38 |
* Block Initializer.
|
43 |
require_once( plugin_dir_path( __FILE__ ) . 'classes/class-uji-countdown-admin.php' );
|
44 |
require_once( plugin_dir_path( __FILE__ ) . 'classes/class-uji-countdown.php' );
|
45 |
require_once( plugin_dir_path( __FILE__ ) . 'classes/class-uji-countdown-front.php' );
|
46 |
+
|
47 |
+
global $wp_version;
|
48 |
+
|
49 |
+
if ( version_compare( $wp_version, '5.7', '<=' ) ) {
|
50 |
+
|
51 |
+
// Remove in version 5.8+
|
52 |
+
require_once( plugin_dir_path( __FILE__ ) . 'classes/class-uji-widget.php' );
|
53 |
+
}
|
54 |
+
|
55 |
|
56 |
// INIT
|
57 |
Uji_Countdown::get_instance();
|
views/admin.php
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
$active_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'tab_ujic_list';
|
18 |
!empty($_GET['_wp_http_referer']) && false !== strpos($_GET['_wp_http_referer'], 'tab_ujic_news') ? $active_tab = 'tab_ujic_news' : null;
|
19 |
|
20 |
-
$add_tab = __( 'Add
|
21 |
|
22 |
if ( isset( $_GET['tab'] ) )
|
23 |
{
|
@@ -26,7 +26,7 @@
|
|
26 |
}
|
27 |
|
28 |
$tab_view = '<h2 class="nav-tab-wrapper">';
|
29 |
-
$tab_view.= '<a href="?page=ujicountdown&tab=tab_ujic_list" class="nav-tab '.($active_tab == 'tab_ujic_list' ? 'nav-tab-active' : '').'"><i class="dashicons dashicons-menu ujic-mico"></i>'. __( '
|
30 |
$tab_view.= '<a href="?page=ujicountdown&tab=tab_ujic_new" class="nav-tab '.($active_tab == 'tab_ujic_new' ? 'nav-tab-active' : '').'"><i class="dashicons dashicons-clock ujic-mico"></i>'.$add_tab.'</a>';
|
31 |
|
32 |
echo $tab_view;
|
@@ -35,7 +35,8 @@
|
|
35 |
|
36 |
|
37 |
?>
|
38 |
-
<a href="?page=ujicountdown&
|
|
|
39 |
<a href="http://www.wpmanage.com/uji-countdown" target="_blank" class="nav-tab nav-tab-pro"><i class="dashicons dashicons-plus ujic-mico"></i><?php _e( 'Add-ons', 'uji-countdown' ); ?></a>
|
40 |
</h2>
|
41 |
|
@@ -54,6 +55,11 @@
|
|
54 |
$ujicount->admin_countdown();
|
55 |
}
|
56 |
|
|
|
|
|
|
|
|
|
|
|
57 |
//Add custom tab
|
58 |
do_action( 'admin_custom_tab_funct' );
|
59 |
|
17 |
$active_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'tab_ujic_list';
|
18 |
!empty($_GET['_wp_http_referer']) && false !== strpos($_GET['_wp_http_referer'], 'tab_ujic_news') ? $active_tab = 'tab_ujic_news' : null;
|
19 |
|
20 |
+
$add_tab = __( 'Add New Style', 'uji-countdown' );
|
21 |
|
22 |
if ( isset( $_GET['tab'] ) )
|
23 |
{
|
26 |
}
|
27 |
|
28 |
$tab_view = '<h2 class="nav-tab-wrapper">';
|
29 |
+
$tab_view.= '<a href="?page=ujicountdown&tab=tab_ujic_list" class="nav-tab '.($active_tab == 'tab_ujic_list' ? 'nav-tab-active' : '').'"><i class="dashicons dashicons-menu ujic-mico"></i>'. __( 'Timer Styles', 'uji-countdown' ).'</a>';
|
30 |
$tab_view.= '<a href="?page=ujicountdown&tab=tab_ujic_new" class="nav-tab '.($active_tab == 'tab_ujic_new' ? 'nav-tab-active' : '').'"><i class="dashicons dashicons-clock ujic-mico"></i>'.$add_tab.'</a>';
|
31 |
|
32 |
echo $tab_view;
|
35 |
|
36 |
|
37 |
?>
|
38 |
+
<a href="?page=ujicountdown&tab=tab_ujic_shortcode" class="nav-tab <?php echo $active_tab == 'tab_ujic_shortcode' ? 'nav-tab-active' : ''; ?>"><i class="dashicons dashicons-shortcode ujic-mico"></i><?php _e( 'Shortcode', 'uji-countdown' ); ?></a>
|
39 |
+
<a href="?page=ujicountdown&tab=tab_ujic_set" class="nav-tab <?php echo $active_tab == 'tab_ujic_set' ? 'nav-tab-active' : ''; ?>"><i class="dashicons dashicons-admin-tools ujic-mico"></i><?php _e( 'Settings', 'uji-countdown' ); ?></a>
|
40 |
<a href="http://www.wpmanage.com/uji-countdown" target="_blank" class="nav-tab nav-tab-pro"><i class="dashicons dashicons-plus ujic-mico"></i><?php _e( 'Add-ons', 'uji-countdown' ); ?></a>
|
41 |
</h2>
|
42 |
|
55 |
$ujicount->admin_countdown();
|
56 |
}
|
57 |
|
58 |
+
if ( $active_tab == 'tab_ujic_shortcode' ) {
|
59 |
+
$ujicount->admin_shortcode();
|
60 |
+
}
|
61 |
+
|
62 |
+
|
63 |
//Add custom tab
|
64 |
do_action( 'admin_custom_tab_funct' );
|
65 |
|