Uji Countdown - Version 1.3.3

Version Description

  • Important Fix: WP 3.9 color picker compatibility with jquery 1.10+
  • Important Fix: WP 3.9 compatibility
Download this release

Release Info

Developer ujimoto
Plugin Icon 128x128 Uji Countdown
Version 1.3.3
Comparing to
See all releases

Code changes from version 1.3.2 to 1.3.3

Files changed (88) hide show
  1. css/admin.countdown.css +0 -0
  2. css/jquery.countdown.css +0 -0
  3. images/align-center.png +0 -0
  4. images/align-left.png +0 -0
  5. images/align-none.png +0 -0
  6. images/align-right.png +0 -0
  7. images/icon.png +0 -0
  8. images/icon_large.png +0 -0
  9. images/ujic-ps.jpg +0 -0
  10. images/ujic-ps2.jpg +0 -0
  11. images/ujic-ps3.png +0 -0
  12. inc/css/colorpicker.css +0 -0
  13. inc/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  14. inc/css/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  15. inc/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  16. inc/css/images/ui-bg_flat_10_000000_40x100.png +0 -0
  17. inc/css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  18. inc/css/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  19. inc/css/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  20. inc/css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  21. inc/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  22. inc/css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  23. inc/css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  24. inc/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  25. inc/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  26. inc/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  27. inc/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  28. inc/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  29. inc/css/images/ui-icons_222222_256x240.png +0 -0
  30. inc/css/images/ui-icons_228ef1_256x240.png +0 -0
  31. inc/css/images/ui-icons_2e83ff_256x240.png +0 -0
  32. inc/css/images/ui-icons_454545_256x240.png +0 -0
  33. inc/css/images/ui-icons_888888_256x240.png +0 -0
  34. inc/css/images/ui-icons_cd0a0a_256x240.png +0 -0
  35. inc/css/images/ui-icons_ef8c08_256x240.png +0 -0
  36. inc/css/images/ui-icons_ffd27a_256x240.png +0 -0
  37. inc/css/images/ui-icons_ffffff_256x240.png +0 -0
  38. inc/css/jquery-ui-1.9.2.custom.css +0 -0
  39. inc/css/jquery-ui-timepicker-addon.css +0 -0
  40. inc/css/layout.css +0 -0
  41. inc/images/blank.gif +0 -0
  42. inc/images/colorpicker_background.png +0 -0
  43. inc/images/colorpicker_hex.png +0 -0
  44. inc/images/colorpicker_hsb_b.png +0 -0
  45. inc/images/colorpicker_hsb_h.png +0 -0
  46. inc/images/colorpicker_hsb_s.png +0 -0
  47. inc/images/colorpicker_indic.gif +0 -0
  48. inc/images/colorpicker_overlay.png +0 -0
  49. inc/images/colorpicker_rgb_b.png +0 -0
  50. inc/images/colorpicker_rgb_g.png +0 -0
  51. inc/images/colorpicker_rgb_r.png +0 -0
  52. inc/images/colorpicker_select.gif +0 -0
  53. inc/images/colorpicker_submit.png +0 -0
  54. inc/images/custom_background.png +0 -0
  55. inc/images/custom_hex.png +0 -0
  56. inc/images/custom_hsb_b.png +0 -0
  57. inc/images/custom_hsb_h.png +0 -0
  58. inc/images/custom_hsb_s.png +0 -0
  59. inc/images/custom_indic.gif +0 -0
  60. inc/images/custom_rgb_b.png +0 -0
  61. inc/images/custom_rgb_g.png +0 -0
  62. inc/images/custom_rgb_r.png +0 -0
  63. inc/images/custom_submit.png +0 -0
  64. inc/images/select.png +0 -0
  65. inc/images/select2.png +0 -0
  66. inc/images/slider.png +0 -0
  67. inc/js/admin.color.js +16 -14
  68. inc/js/colorpicker.js +0 -0
  69. inc/js/jquery-ui-old.min.js +0 -0
  70. inc/js/jquery-ui-timepicker-old.js +0 -0
  71. inc/js/jquery-ui-timepicker.js +0 -0
  72. inc/js/jquery-ui.min.js +0 -0
  73. inc/js/widget-js.js +0 -0
  74. js/countdown.js +0 -0
  75. js/jquery.countdown.dev.js +0 -953
  76. js/jquery.countdown.js +1 -1
  77. js/prev.countdown.js +10 -6
  78. js/serverTime.php +0 -0
  79. languages/uji-countdown-en_EN.mo +0 -0
  80. languages/uji-countdown-en_EN.po +0 -0
  81. readme.txt +7 -3
  82. screenshot-1.png +0 -0
  83. screenshot-2.png +0 -0
  84. screenshot-3.png +0 -0
  85. uji-countdown-add.php +0 -0
  86. uji-countdown-front.php +0 -0
  87. uji-countdown-widget.php +0 -0
  88. uji-countdown.php +3 -3
css/admin.countdown.css CHANGED
File without changes
css/jquery.countdown.css CHANGED
File without changes
images/align-center.png CHANGED
File without changes
images/align-left.png CHANGED
File without changes
images/align-none.png CHANGED
File without changes
images/align-right.png CHANGED
File without changes
images/icon.png CHANGED
File without changes
images/icon_large.png CHANGED
File without changes
images/ujic-ps.jpg CHANGED
File without changes
images/ujic-ps2.jpg CHANGED
File without changes
images/ujic-ps3.png CHANGED
File without changes
inc/css/colorpicker.css CHANGED
File without changes
inc/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png CHANGED
File without changes
inc/css/images/ui-bg_diagonals-thick_20_666666_40x40.png CHANGED
File without changes
inc/css/images/ui-bg_flat_0_aaaaaa_40x100.png CHANGED
File without changes
inc/css/images/ui-bg_flat_10_000000_40x100.png CHANGED
File without changes
inc/css/images/ui-bg_flat_75_ffffff_40x100.png CHANGED
File without changes
inc/css/images/ui-bg_glass_100_f6f6f6_1x400.png CHANGED
File without changes
inc/css/images/ui-bg_glass_100_fdf5ce_1x400.png CHANGED
File without changes
inc/css/images/ui-bg_glass_55_fbf9ee_1x400.png CHANGED
File without changes
inc/css/images/ui-bg_glass_65_ffffff_1x400.png CHANGED
File without changes
inc/css/images/ui-bg_glass_75_dadada_1x400.png CHANGED
File without changes
inc/css/images/ui-bg_glass_75_e6e6e6_1x400.png CHANGED
File without changes
inc/css/images/ui-bg_glass_95_fef1ec_1x400.png CHANGED
File without changes
inc/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png CHANGED
File without changes
inc/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png CHANGED
File without changes
inc/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png CHANGED
File without changes
inc/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png CHANGED
File without changes
inc/css/images/ui-icons_222222_256x240.png CHANGED
File without changes
inc/css/images/ui-icons_228ef1_256x240.png CHANGED
File without changes
inc/css/images/ui-icons_2e83ff_256x240.png CHANGED
File without changes
inc/css/images/ui-icons_454545_256x240.png CHANGED
File without changes
inc/css/images/ui-icons_888888_256x240.png CHANGED
File without changes
inc/css/images/ui-icons_cd0a0a_256x240.png CHANGED
File without changes
inc/css/images/ui-icons_ef8c08_256x240.png CHANGED
File without changes
inc/css/images/ui-icons_ffd27a_256x240.png CHANGED
File without changes
inc/css/images/ui-icons_ffffff_256x240.png CHANGED
File without changes
inc/css/jquery-ui-1.9.2.custom.css CHANGED
File without changes
inc/css/jquery-ui-timepicker-addon.css CHANGED
File without changes
inc/css/layout.css CHANGED
File without changes
inc/images/blank.gif CHANGED
File without changes
inc/images/colorpicker_background.png CHANGED
File without changes
inc/images/colorpicker_hex.png CHANGED
File without changes
inc/images/colorpicker_hsb_b.png CHANGED
File without changes
inc/images/colorpicker_hsb_h.png CHANGED
File without changes
inc/images/colorpicker_hsb_s.png CHANGED
File without changes
inc/images/colorpicker_indic.gif CHANGED
File without changes
inc/images/colorpicker_overlay.png CHANGED
File without changes
inc/images/colorpicker_rgb_b.png CHANGED
File without changes
inc/images/colorpicker_rgb_g.png CHANGED
File without changes
inc/images/colorpicker_rgb_r.png CHANGED
File without changes
inc/images/colorpicker_select.gif CHANGED
File without changes
inc/images/colorpicker_submit.png CHANGED
File without changes
inc/images/custom_background.png CHANGED
File without changes
inc/images/custom_hex.png CHANGED
File without changes
inc/images/custom_hsb_b.png CHANGED
File without changes
inc/images/custom_hsb_h.png CHANGED
File without changes
inc/images/custom_hsb_s.png CHANGED
File without changes
inc/images/custom_indic.gif CHANGED
File without changes
inc/images/custom_rgb_b.png CHANGED
File without changes
inc/images/custom_rgb_g.png CHANGED
File without changes
inc/images/custom_rgb_r.png CHANGED
File without changes
inc/images/custom_submit.png CHANGED
File without changes
inc/images/select.png CHANGED
File without changes
inc/images/select2.png CHANGED
File without changes
inc/images/slider.png CHANGED
File without changes
inc/js/admin.color.js CHANGED
@@ -15,13 +15,14 @@ if ( jQuery().ColorPicker && jQuery( '#ujic_col_dw, #ujic_col_up' ).length ) {
15
  jQuery('#colorSelector div').css('backgroundColor', '#' + hex);
16
  jQuery( '#ujic_col_dw' ).attr( 'value', '#' + hex );
17
  var color_up = jQuery( '#ujic_col_up' ).val();
18
-
19
- jQuery( '.countdown_amount').css("background-image", "linear-gradient(bottom, #"+hex+" 50%, "+color_up+" 50%)");
20
- jQuery( '.countdown_amount').css("background-image", "-o-linear-gradient(bottom, #"+hex+" 50%, "+color_up+" 50%)");
21
- jQuery( '.countdown_amount').css("background-image", "-moz-linear-gradient(bottom, #"+hex+" 50%, "+color_up+" 50%)");
22
- jQuery( '.countdown_amount').css("background-image", "-webkit-linear-gradient(bottom, #"+hex+" 50%, "+color_up+" 50%)");
23
- jQuery( '.countdown_amount').css("background-image", "-ms-linear-gradient(bottom, #"+hex+" 50%, "+color_up+" 50%)");
24
- jQuery( '.countdown_amount').css("filter", "progid:DXImageTransform.Microsoft.Gradient(startColorstr='#"+hex+"', endColorstr='"+color_up+"')");
 
25
 
26
  }
27
  });
@@ -40,13 +41,14 @@ if ( jQuery().ColorPicker && jQuery( '#ujic_col_dw, #ujic_col_up' ).length ) {
40
  jQuery('#colorSelector2 div').css('backgroundColor', '#' + hex);
41
  jQuery( '#ujic_col_up' ).attr( 'value', '#' + hex );
42
  var color_down = jQuery( '#ujic_col_dw' ).val();
43
-
44
- jQuery( '.countdown_amount').css("background-image", "linear-gradient(bottom, "+color_down+" 50%, #"+hex+" 50%)");
45
- jQuery( '.countdown_amount').css("background-image", "-o-linear-gradient(bottom, "+color_down+" 50%, #"+hex+" 50%)");
46
- jQuery( '.countdown_amount').css("background-image", "-moz-linear-gradient(bottom, "+color_down+" 50%, #"+hex+" 50%)");
47
- jQuery( '.countdown_amount').css("background-image", "-webkit-linear-gradient(bottom, "+color_down+" 50%, #"+hex+" 50%)");
48
- jQuery( '.countdown_amount').css("background-image", "-ms-linear-gradient(bottom, "+color_down+" 50%, #"+hex+" 50%)");
49
- jQuery( '.countdown_amount').css("filter", "progid:DXImageTransform.Microsoft.Gradient(startColorstr='"+color_down+"', endColorstr='#"+hex+"')");
 
50
  }
51
  });
52
  var color3 = jQuery('#ujic_col_txt' ).val();
15
  jQuery('#colorSelector div').css('backgroundColor', '#' + hex);
16
  jQuery( '#ujic_col_dw' ).attr( 'value', '#' + hex );
17
  var color_up = jQuery( '#ujic_col_up' ).val();
18
+ hex = "#"+hex;
19
+ jQuery( '.countdown_amount').css("background", "-moz-linear-gradient(top, "+color_up+" 50%, "+hex+" 50%)"); /* FF3.6+ */
20
+ jQuery( '.countdown_amount').css("background: -webkit-gradient(linear, left top, left bottom, color-stop(50%,"+color_up+"), color-stop(50%,"+hex+"))"); /* Chrome,Safari4+ */
21
+ jQuery( '.countdown_amount').css("background", "-webkit-linear-gradient(top, "+color_up+" 50%,"+hex+" 50%)"); /* Chrome10+,Safari5.1+ */
22
+ jQuery( '.countdown_amount').css("background", "-o-linear-gradient(top, "+color_up+" 50%,"+hex+" 50%)"); /* Opera 11.10+ */
23
+ jQuery( '.countdown_amount').css("background", "-ms-linear-gradient(top, "+color_up+" 50%,"+hex+" 50%)"); /* IE10+ */
24
+ jQuery( '.countdown_amount').css("background", "linear-gradient(to bottom, "+color_up+" 50%,"+hex+" 50%)"); /* W3C */
25
+ jQuery( '.countdown_amount').css("filter", "progid:DXImageTransform.Microsoft.gradient( startColorstr='"+color_up+"', endColorstr='"+hex+"',GradientType=0 )"); /* IE6-9 */
26
 
27
  }
28
  });
41
  jQuery('#colorSelector2 div').css('backgroundColor', '#' + hex);
42
  jQuery( '#ujic_col_up' ).attr( 'value', '#' + hex );
43
  var color_down = jQuery( '#ujic_col_dw' ).val();
44
+ hex = "#"+hex;
45
+ jQuery( '.countdown_amount').css("background", "-moz-linear-gradient(top, "+hex+" 50%, "+color_down+" 50%)"); /* FF3.6+ */
46
+ jQuery( '.countdown_amount').css("background: -webkit-gradient(linear, left top, left bottom, color-stop(50%,"+hex+"), color-stop(50%,"+color_down+"))"); /* Chrome,Safari4+ */
47
+ jQuery( '.countdown_amount').css("background", "-webkit-linear-gradient(top, "+hex+" 50%,"+color_down+" 50%)"); /* Chrome10+,Safari5.1+ */
48
+ jQuery( '.countdown_amount').css("background", "-o-linear-gradient(top, "+hex+" 50%,"+color_down+" 50%)"); /* Opera 11.10+ */
49
+ jQuery( '.countdown_amount').css("background", "-ms-linear-gradient(top, "+hex+" 50%,"+color_down+" 50%)"); /* IE10+ */
50
+ jQuery( '.countdown_amount').css("background", "linear-gradient(to bottom, "+hex+" 50%,"+color_down+" 50%)"); /* W3C */
51
+ jQuery( '.countdown_amount').css("filter", "progid:DXImageTransform.Microsoft.gradient( startColorstr='"+hex+"', endColorstr='"+color_down+"',GradientType=0 )"); /* IE6-9 */
52
  }
53
  });
54
  var color3 = jQuery('#ujic_col_txt' ).val();
inc/js/colorpicker.js CHANGED
File without changes
inc/js/jquery-ui-old.min.js CHANGED
File without changes
inc/js/jquery-ui-timepicker-old.js CHANGED
File without changes
inc/js/jquery-ui-timepicker.js CHANGED
File without changes
inc/js/jquery-ui.min.js CHANGED
File without changes
inc/js/widget-js.js CHANGED
File without changes
js/countdown.js CHANGED
File without changes
js/jquery.countdown.dev.js DELETED
@@ -1,953 +0,0 @@
1
- /* http://keith-wood.name/countdown.html
2
- Countdown for jQuery v1.6.3.
3
- Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
4
- Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license.
5
- Please attribute the author if you use it. */
6
-
7
- /* Display a countdown timer.
8
- Attach it with options like:
9
- $('div selector').countdown(
10
- {until: new Date(2009, 1 - 1, 1, 0, 0, 0), onExpiry: happyNewYear}); */
11
-
12
- (function($) { // Hide scope, no $ conflict
13
-
14
- /* Countdown manager. */
15
- function Countdown() {
16
- this.regional = []; // Available regional settings, indexed by language code
17
- this.regional[''] = { // Default regional settings
18
- // The display texts for the counters
19
- labels: ['Years', 'Months', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds'],
20
- // The display texts for the counters if only one
21
- labels1: ['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second'],
22
- compactLabels: ['y', 'm', 'w', 'd'], // The compact texts for the counters
23
- whichLabels: null, // Function to determine which labels to use
24
- digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], // The digits to display
25
- timeSeparator: ':', // Separator for time periods
26
- isRTL: false // True for right-to-left languages, false for left-to-right
27
- };
28
- this._defaults = {
29
- //<ujimoto
30
- text_size: '35',
31
- animate_sec: false,
32
- color_down : '#3A3A3A',
33
- color_up : '#635b63',
34
- color_txt : '#ffffff',
35
- color_sw : '#000000',
36
- ujic_txt : true,
37
- ujic_url : false,
38
- //ujimoto>
39
- until: null, // new Date(year, mth - 1, day, hr, min, sec) - date/time to count down to
40
- // or numeric for seconds offset, or string for unit offset(s):
41
- // 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
42
- since: null, // new Date(year, mth - 1, day, hr, min, sec) - date/time to count up from
43
- // or numeric for seconds offset, or string for unit offset(s):
44
- // 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
45
- timezone: null, // The timezone (hours or minutes from GMT) for the target times,
46
- // or null for client local
47
- serverSync: null, // A function to retrieve the current server time for synchronisation
48
- format: 'dHMS', // Format for display - upper case for always, lower case only if non-zero,
49
- // 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
50
- layout: '', // Build your own layout for the countdown
51
- compact: false, // True to display in a compact format, false for an expanded one
52
- significant: 0, // The number of periods with values to show, zero for all
53
- description: '', // The description displayed for the countdown
54
- expiryUrl: '', // A URL to load upon expiry, replacing the current page
55
- expiryText: '', // Text to display upon expiry, replacing the countdown
56
- alwaysExpire: false, // True to trigger onExpiry even if never counted down
57
- onExpiry: null, // Callback when the countdown expires -
58
- // receives no parameters and 'this' is the containing division
59
- onTick: null, // Callback when the countdown is updated -
60
- // receives int[7] being the breakdown by period (based on format)
61
- // and 'this' is the containing division
62
- tickInterval: 1 // Interval (seconds) between onTick callbacks
63
- };
64
- $.extend(this._defaults, this.regional['']);
65
- this._serverSyncs = [];
66
- var now = (typeof Date.now == 'function' ? Date.now :
67
- function() { return new Date().getTime(); });
68
- var perfAvail = (window.performance && typeof window.performance.now == 'function');
69
- // Shared timer for all countdowns
70
- function timerCallBack(timestamp) {
71
- var drawStart = (timestamp < 1e12 ? // New HTML5 high resolution timer
72
- (perfAvail ? (performance.now() + performance.timing.navigationStart) : now()) :
73
- // Integer milliseconds since unix epoch
74
- timestamp || now());
75
- if (drawStart - animationStartTime >= 1000) {
76
- plugin._updateTargets();
77
- animationStartTime = drawStart;
78
- }
79
- requestAnimationFrame(timerCallBack);
80
- }
81
- var requestAnimationFrame = window.requestAnimationFrame ||
82
- window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame ||
83
- window.oRequestAnimationFrame || window.msRequestAnimationFrame || null;
84
- // This is when we expect a fall-back to setInterval as it's much more fluid
85
- var animationStartTime = 0;
86
- if (!requestAnimationFrame || $.noRequestAnimationFrame) {
87
- $.noRequestAnimationFrame = null;
88
- setInterval(function() { plugin._updateTargets(); }, 980); // Fall back to good old setInterval
89
- }
90
- else {
91
- animationStartTime = window.animationStartTime ||
92
- window.webkitAnimationStartTime || window.mozAnimationStartTime ||
93
- window.oAnimationStartTime || window.msAnimationStartTime || now();
94
- requestAnimationFrame(timerCallBack);
95
- }
96
- }
97
-
98
- var Y = 0; // Years
99
- var O = 1; // Months
100
- var W = 2; // Weeks
101
- var D = 3; // Days
102
- var H = 4; // Hours
103
- var M = 5; // Minutes
104
- var S = 6; // Seconds
105
-
106
- $.extend(Countdown.prototype, {
107
- /* Class name added to elements to indicate already configured with countdown. */
108
- markerClassName: 'hasCountdown',
109
- /* Name of the data property for instance settings. */
110
- propertyName: 'countdown',
111
-
112
- /* Class name for the right-to-left marker. */
113
- _rtlClass: 'countdown_rtl',
114
- /* Class name for the countdown section marker. */
115
- _sectionClass: 'countdown_section',
116
- /* Class name for the period amount marker. */
117
- _amountClass: 'countdown_amount',
118
- /* Class name for the countdown row marker. */
119
- _rowClass: 'countdown_row',
120
- /* Class name for the holding countdown marker. */
121
- _holdingClass: 'countdown_holding',
122
- /* Class name for the showing countdown marker. */
123
- _showClass: 'countdown_show',
124
- /* Class name for the description marker. */
125
- _descrClass: 'countdown_descr',
126
-
127
- /* List of currently active countdown targets. */
128
- _timerTargets: [],
129
-
130
- /* Override the default settings for all instances of the countdown widget.
131
- @param options (object) the new settings to use as defaults */
132
- setDefaults: function(options) {
133
- this._resetExtraLabels(this._defaults, options);
134
- $.extend(this._defaults, options || {});
135
- },
136
-
137
- /* Convert a date/time to UTC.
138
- @param tz (number) the hour or minute offset from GMT, e.g. +9, -360
139
- @param year (Date) the date/time in that timezone or
140
- (number) the year in that timezone
141
- @param month (number, optional) the month (0 - 11) (omit if year is a Date)
142
- @param day (number, optional) the day (omit if year is a Date)
143
- @param hours (number, optional) the hour (omit if year is a Date)
144
- @param mins (number, optional) the minute (omit if year is a Date)
145
- @param secs (number, optional) the second (omit if year is a Date)
146
- @param ms (number, optional) the millisecond (omit if year is a Date)
147
- @return (Date) the equivalent UTC date/time */
148
- UTCDate: function(tz, year, month, day, hours, mins, secs, ms) {
149
- if (typeof year == 'object' && year.constructor == Date) {
150
- ms = year.getMilliseconds();
151
- secs = year.getSeconds();
152
- mins = year.getMinutes();
153
- hours = year.getHours();
154
- day = year.getDate();
155
- month = year.getMonth();
156
- year = year.getFullYear();
157
- }
158
- var d = new Date();
159
- d.setUTCFullYear(year);
160
- d.setUTCDate(1);
161
- d.setUTCMonth(month || 0);
162
- d.setUTCDate(day || 1);
163
- d.setUTCHours(hours || 0);
164
- d.setUTCMinutes((mins || 0) - (Math.abs(tz) < 30 ? tz * 60 : tz));
165
- d.setUTCSeconds(secs || 0);
166
- d.setUTCMilliseconds(ms || 0);
167
- return d;
168
- },
169
-
170
- /* Convert a set of periods into seconds.
171
- Averaged for months and years.
172
- @param periods (number[7]) the periods per year/month/week/day/hour/minute/second
173
- @return (number) the corresponding number of seconds */
174
- periodsToSeconds: function(periods) {
175
- return periods[0] * 31557600 + periods[1] * 2629800 + periods[2] * 604800 +
176
- periods[3] * 86400 + periods[4] * 3600 + periods[5] * 60 + periods[6];
177
- },
178
-
179
- /* Attach the countdown widget to a div.
180
- @param target (element) the containing division
181
- @param options (object) the initial settings for the countdown */
182
- _attachPlugin: function(target, options) {
183
- target = $(target);
184
- if (target.hasClass(this.markerClassName)) {
185
- return;
186
- }
187
- var inst = {options: $.extend({}, this._defaults), _periods: [0, 0, 0, 0, 0, 0, 0]};
188
- target.addClass(this.markerClassName).data(this.propertyName, inst);
189
- this._optionPlugin(target, options);
190
- },
191
-
192
- /* Add a target to the list of active ones.
193
- @param target (element) the countdown target */
194
- _addTarget: function(target) {
195
- if (!this._hasTarget(target)) {
196
- this._timerTargets.push(target);
197
- }
198
- },
199
-
200
- /* See if a target is in the list of active ones.
201
- @param target (element) the countdown target
202
- @return (boolean) true if present, false if not */
203
- _hasTarget: function(target) {
204
- return ($.inArray(target, this._timerTargets) > -1);
205
- },
206
-
207
- /* Remove a target from the list of active ones.
208
- @param target (element) the countdown target */
209
- _removeTarget: function(target) {
210
- this._timerTargets = $.map(this._timerTargets,
211
- function(value) { return (value == target ? null : value); }); // delete entry
212
- },
213
-
214
- /* Update each active timer target. */
215
- _updateTargets: function() {
216
- for (var i = this._timerTargets.length - 1; i >= 0; i--) {
217
- this._updateCountdown(this._timerTargets[i]);
218
- }
219
- },
220
-
221
- /* Reconfigure the settings for a countdown div.
222
- @param target (element) the control to affect
223
- @param options (object) the new options for this instance or
224
- (string) an individual property name
225
- @param value (any) the individual property value (omit if options
226
- is an object or to retrieve the value of a setting)
227
- @return (any) if retrieving a value */
228
- _optionPlugin: function(target, options, value) {
229
- target = $(target);
230
- var inst = target.data(this.propertyName);
231
- if (!options || (typeof options == 'string' && value == null)) { // Get option
232
- var name = options;
233
- options = (inst || {}).options;
234
- return (options && name ? options[name] : options);
235
- }
236
-
237
- if (!target.hasClass(this.markerClassName)) {
238
- return;
239
- }
240
- options = options || {};
241
- if (typeof options == 'string') {
242
- var name = options;
243
- options = {};
244
- options[name] = value;
245
- }
246
- if (options.layout) {
247
- options.layout = options.layout.replace(/&lt;/g, '<').replace(/&gt;/g, '>');
248
- }
249
- this._resetExtraLabels(inst.options, options);
250
- var timezoneChanged = (inst.options.timezone != options.timezone);
251
- $.extend(inst.options, options);
252
- this._adjustSettings(target, inst,
253
- options.until != null || options.since != null || timezoneChanged);
254
- var now = new Date();
255
- if ((inst._since && inst._since < now) || (inst._until && inst._until > now)) {
256
- this._addTarget(target[0]);
257
- }
258
- this._updateCountdown(target, inst);
259
- },
260
-
261
- /* Redisplay the countdown with an updated display.
262
- @param target (jQuery) the containing division
263
- @param inst (object) the current settings for this instance */
264
- _updateCountdown: function(target, inst) {
265
- var $target = $(target);
266
- inst = inst || $target.data(this.propertyName);
267
- if (!inst) {
268
- return;
269
- }
270
- $target.html(this._generateHTML(inst)).toggleClass(this._rtlClass, inst.options.isRTL);
271
-
272
- //<ujimoto
273
-
274
-
275
- var ujic_url = inst.options.ujic_url;
276
- var ujic_until = inst.options.until;
277
-
278
- var foo = new Date; // Generic JS date object
279
- var unixtime = parseInt(foo.getTime() / 1000);
280
- var until_time = parseInt(ujic_until.getTime() / 1000)-2;
281
- /*delay 2 seconds for run process*/
282
- if(ujic_url == "false") ujic_url = false;
283
- if(ujic_url && (unixtime>until_time)){
284
- window.location.replace(ujic_url);
285
- }
286
-
287
- var color_down = inst.options.color_down;
288
- var color_up = inst.options.color_up;
289
-
290
- jQuery('#ujiCountdown .countdown_amount').css("background-image", "linear-gradient(bottom, "+color_down+" 50%, "+color_up+" 50%)");
291
- jQuery('#ujiCountdown .countdown_amount').css("background-image", "-o-linear-gradient(bottom, "+color_down+" 50%, "+color_up+" 50%)");
292
- jQuery('#ujiCountdown .countdown_amount').css("background-image", "-moz-linear-gradient(bottom, "+color_down+" 50%, "+color_up+" 50%)");
293
- jQuery('#ujiCountdown .countdown_amount').css("background-image", "-webkit-linear-gradient(bottom, "+color_down+" 50%, "+color_up+" 50%)");
294
- jQuery('#ujiCountdown .countdown_amount').css("background-image", "-ms-linear-gradient(bottom, "+color_down+" 50%, "+color_up+" 50%)");
295
- jQuery('#ujiCountdown .countdown_amount').css("filter", "progid:DXImageTransform.Microsoft.Gradient(startColorstr='"+color_down+"', endColorstr='"+color_up+"')");
296
-
297
- var color_txt = inst.options.color_txt;
298
- var color_sw = inst.options.color_sw;
299
- jQuery('#ujiCountdown .countdown_amount').css("color", color_txt);
300
- jQuery('#ujiCountdown .countdown_amount').css("text-shadow",'1px 1px 1px ' + color_sw);
301
-
302
-
303
- var ujic_txt = inst.options.ujic_txt;
304
- if(ujic_txt){
305
- jQuery('#ujiCountdown .countdown_txt').css("display","block");
306
- }else{
307
- jQuery('#ujiCountdown .countdown_txt').css("display","none");
308
- }
309
- //Anime fix small font
310
- var text_size = inst.options.text_size;
311
- var anim_fix = 0;
312
- switch (parseInt(text_size))
313
- {
314
- case 10:
315
- anim_fix = 5;
316
- break;
317
- case 11:
318
- anim_fix = 3;
319
- break;
320
- case 12:
321
- anim_fix = 3;
322
- break;
323
- case 13:
324
- anim_fix = 1;
325
- break;
326
- }
327
-
328
- jQuery( '#ujiCountdown .countdown_amount').css("font", text_size+"px/1.5 'Open Sans Condensed',sans-serif");
329
- if(text_size < 15) {
330
- jQuery( '#ujiCountdown .countdown_amount').css({"padding" : "2px 5px", "margin-right" : "1px"});
331
- jQuery( '#ujiCountdown .countdown_section').css("margin", "0px 6px 0px 0px");
332
- jQuery( '#ujiCountdown .countdown_txt').css("font","9px 'Open Sans Condensed',sans-serif");
333
-
334
- }
335
-
336
- var animate_sec = inst.options.animate_sec;
337
- if(animate_sec){
338
- var wsec = jQuery('#ujiCountdown').find('#uji_sec').find('.countdown_section').width();
339
- jQuery('#ujiCountdown').find('#uji_sec').find('.countdown_section').css({"width": wsec+"px"});
340
- jQuery('#ujiCountdown').find('#uji_sec').find('.countdown_amount').eq(1).css({"top": "-74px", "right": 0, "position": "absolute", opacity:1});
341
- jQuery('#ujiCountdown').find('#uji_sec').find('.countdown_amount').eq(1).animate({"top": anim_fix+"px", "right": 0, opacity:1},700,function(){
342
- // Animation complete.
343
- // $("#uji_sec").find('.countdown_amount').eq(1).animate({ opacity:1}, 500);
344
- jQuery('#ujiCountdown').find('#uji_sec').find('.countdown_amount').eq(1).animate({opacity:0}, 300);
345
- });
346
- }
347
-
348
- //ujimoto>
349
-
350
- if ($.isFunction(inst.options.onTick)) {
351
- var periods = inst._hold != 'lap' ? inst._periods :
352
- this._calculatePeriods(inst, inst._show, inst.options.significant, new Date());
353
- if (inst.options.tickInterval == 1 ||
354
- this.periodsToSeconds(periods) % inst.options.tickInterval == 0) {
355
- inst.options.onTick.apply(target, [periods]);
356
- }
357
- }
358
- var expired = inst._hold != 'pause' &&
359
- (inst._since ? inst._now.getTime() < inst._since.getTime() :
360
- inst._now.getTime() >= inst._until.getTime());
361
- if (expired && !inst._expiring) {
362
- inst._expiring = true;
363
- if (this._hasTarget(target) || inst.options.alwaysExpire) {
364
- this._removeTarget(target);
365
- if ($.isFunction(inst.options.onExpiry)) {
366
- inst.options.onExpiry.apply(target, []);
367
- }
368
- if (inst.options.expiryText) {
369
- var layout = inst.options.layout;
370
- inst.options.layout = inst.options.expiryText;
371
- this._updateCountdown(target, inst);
372
- inst.options.layout = layout;
373
- }
374
- if (inst.options.expiryUrl) {
375
- window.location = inst.options.expiryUrl;
376
- }
377
- }
378
- inst._expiring = false;
379
- }
380
- else if (inst._hold == 'pause') {
381
- this._removeTarget(target);
382
- }
383
- $target.data(this.propertyName, inst);
384
- },
385
-
386
- /* Reset any extra labelsn and compactLabelsn entries if changing labels.
387
- @param base (object) the options to be updated
388
- @param options (object) the new option values */
389
- _resetExtraLabels: function(base, options) {
390
- var changingLabels = false;
391
- for (var n in options) {
392
- if (n != 'whichLabels' && n.match(/[Ll]abels/)) {
393
- changingLabels = true;
394
- break;
395
- }
396
- }
397
- if (changingLabels) {
398
- for (var n in base) { // Remove custom numbered labels
399
- if (n.match(/[Ll]abels[02-9]|compactLabels1/)) {
400
- base[n] = null;
401
- }
402
- }
403
- }
404
- },
405
-
406
- /* Calculate interal settings for an instance.
407
- @param target (element) the containing division
408
- @param inst (object) the current settings for this instance
409
- @param recalc (boolean) true if until or since are set */
410
- _adjustSettings: function(target, inst, recalc) {
411
- var now;
412
- var serverOffset = 0;
413
- var serverEntry = null;
414
- for (var i = 0; i < this._serverSyncs.length; i++) {
415
- if (this._serverSyncs[i][0] == inst.options.serverSync) {
416
- serverEntry = this._serverSyncs[i][1];
417
- break;
418
- }
419
- }
420
- if (serverEntry != null) {
421
- serverOffset = (inst.options.serverSync ? serverEntry : 0);
422
- now = new Date();
423
- }
424
- else {
425
- var serverResult = ($.isFunction(inst.options.serverSync) ?
426
- inst.options.serverSync.apply(target, []) : null);
427
- now = new Date();
428
- serverOffset = (serverResult ? now.getTime() - serverResult.getTime() : 0);
429
- this._serverSyncs.push([inst.options.serverSync, serverOffset]);
430
- }
431
- var timezone = inst.options.timezone;
432
- timezone = (timezone == null ? -now.getTimezoneOffset() : timezone);
433
- if (recalc || (!recalc && inst._until == null && inst._since == null)) {
434
- inst._since = inst.options.since;
435
- if (inst._since != null) {
436
- inst._since = this.UTCDate(timezone, this._determineTime(inst._since, null));
437
- if (inst._since && serverOffset) {
438
- inst._since.setMilliseconds(inst._since.getMilliseconds() + serverOffset);
439
- }
440
- }
441
- inst._until = this.UTCDate(timezone, this._determineTime(inst.options.until, now));
442
- if (serverOffset) {
443
- inst._until.setMilliseconds(inst._until.getMilliseconds() + serverOffset);
444
- }
445
- }
446
- inst._show = this._determineShow(inst);
447
- },
448
-
449
- /* Remove the countdown widget from a div.
450
- @param target (element) the containing division */
451
- _destroyPlugin: function(target) {
452
- target = $(target);
453
- if (!target.hasClass(this.markerClassName)) {
454
- return;
455
- }
456
- this._removeTarget(target[0]);
457
- target.removeClass(this.markerClassName).empty().removeData(this.propertyName);
458
- },
459
-
460
- /* Pause a countdown widget at the current time.
461
- Stop it running but remember and display the current time.
462
- @param target (element) the containing division */
463
- _pausePlugin: function(target) {
464
- this._hold(target, 'pause');
465
- },
466
-
467
- /* Pause a countdown widget at the current time.
468
- Stop the display but keep the countdown running.
469
- @param target (element) the containing division */
470
- _lapPlugin: function(target) {
471
- this._hold(target, 'lap');
472
- },
473
-
474
- /* Resume a paused countdown widget.
475
- @param target (element) the containing division */
476
- _resumePlugin: function(target) {
477
- this._hold(target, null);
478
- },
479
-
480
- /* Pause or resume a countdown widget.
481
- @param target (element) the containing division
482
- @param hold (string) the new hold setting */
483
- _hold: function(target, hold) {
484
- var inst = $.data(target, this.propertyName);
485
- if (inst) {
486
- if (inst._hold == 'pause' && !hold) {
487
- inst._periods = inst._savePeriods;
488
- var sign = (inst._since ? '-' : '+');
489
- inst[inst._since ? '_since' : '_until'] =
490
- this._determineTime(sign + inst._periods[0] + 'y' +
491
- sign + inst._periods[1] + 'o' + sign + inst._periods[2] + 'w' +
492
- sign + inst._periods[3] + 'd' + sign + inst._periods[4] + 'h' +
493
- sign + inst._periods[5] + 'm' + sign + inst._periods[6] + 's');
494
- this._addTarget(target);
495
- }
496
- inst._hold = hold;
497
- inst._savePeriods = (hold == 'pause' ? inst._periods : null);
498
- $.data(target, this.propertyName, inst);
499
- this._updateCountdown(target, inst);
500
- }
501
- },
502
-
503
- /* Return the current time periods.
504
- @param target (element) the containing division
505
- @return (number[7]) the current periods for the countdown */
506
- _getTimesPlugin: function(target) {
507
- var inst = $.data(target, this.propertyName);
508
- return (!inst ? null : (inst._hold == 'pause' ? inst._savePeriods : (!inst._hold ? inst._periods :
509
- this._calculatePeriods(inst, inst._show, inst.options.significant, new Date()))));
510
- },
511
-
512
- /* A time may be specified as an exact value or a relative one.
513
- @param setting (string or number or Date) - the date/time value
514
- as a relative or absolute value
515
- @param defaultTime (Date) the date/time to use if no other is supplied
516
- @return (Date) the corresponding date/time */
517
- _determineTime: function(setting, defaultTime) {
518
- var offsetNumeric = function(offset) { // e.g. +300, -2
519
- var time = new Date();
520
- time.setTime(time.getTime() + offset * 1000);
521
- return time;
522
- };
523
- var offsetString = function(offset) { // e.g. '+2d', '-4w', '+3h +30m'
524
- offset = offset.toLowerCase();
525
- var time = new Date();
526
- var year = time.getFullYear();
527
- var month = time.getMonth();
528
- var day = time.getDate();
529
- var hour = time.getHours();
530
- var minute = time.getMinutes();
531
- var second = time.getSeconds();
532
- var pattern = /([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;
533
- var matches = pattern.exec(offset);
534
- while (matches) {
535
- switch (matches[2] || 's') {
536
- case 's': second += parseInt(matches[1], 10); break;
537
- case 'm': minute += parseInt(matches[1], 10); break;
538
- case 'h': hour += parseInt(matches[1], 10); break;
539
- case 'd': day += parseInt(matches[1], 10); break;
540
- case 'w': day += parseInt(matches[1], 10) * 7; break;
541
- case 'o':
542
- month += parseInt(matches[1], 10);
543
- day = Math.min(day, plugin._getDaysInMonth(year, month));
544
- break;
545
- case 'y':
546
- year += parseInt(matches[1], 10);
547
- day = Math.min(day, plugin._getDaysInMonth(year, month));
548
- break;
549
- }
550
- matches = pattern.exec(offset);
551
- }
552
- return new Date(year, month, day, hour, minute, second, 0);
553
- };
554
- var time = (setting == null ? defaultTime :
555
- (typeof setting == 'string' ? offsetString(setting) :
556
- (typeof setting == 'number' ? offsetNumeric(setting) : setting)));
557
- if (time) time.setMilliseconds(0);
558
- return time;
559
- },
560
-
561
- /* Determine the number of days in a month.
562
- @param year (number) the year
563
- @param month (number) the month
564
- @return (number) the days in that month */
565
- _getDaysInMonth: function(year, month) {
566
- return 32 - new Date(year, month, 32).getDate();
567
- },
568
-
569
- /* Determine which set of labels should be used for an amount.
570
- @param num (number) the amount to be displayed
571
- @return (number) the set of labels to be used for this amount */
572
- _normalLabels: function(num) {
573
- return num;
574
- },
575
-
576
- /* Generate the HTML to display the countdown widget.
577
- @param inst (object) the current settings for this instance
578
- @return (string) the new HTML for the countdown display */
579
- _generateHTML: function(inst) {
580
- var self = this;
581
- // Determine what to show
582
- inst._periods = (inst._hold ? inst._periods :
583
- this._calculatePeriods(inst, inst._show, inst.options.significant, new Date()));
584
- // Show all 'asNeeded' after first non-zero value
585
- var shownNonZero = false;
586
- var showCount = 0;
587
- var sigCount = inst.options.significant;
588
- var show = $.extend({}, inst._show);
589
- for (var period = Y; period <= S; period++) {
590
- shownNonZero |= (inst._show[period] == '?' && inst._periods[period] > 0);
591
- show[period] = (inst._show[period] == '?' && !shownNonZero ? null : inst._show[period]);
592
- showCount += (show[period] ? 1 : 0);
593
- sigCount -= (inst._periods[period] > 0 ? 1 : 0);
594
- }
595
- var showSignificant = [false, false, false, false, false, false, false];
596
- for (var period = S; period >= Y; period--) { // Determine significant periods
597
- if (inst._show[period]) {
598
- if (inst._periods[period]) {
599
- showSignificant[period] = true;
600
- }
601
- else {
602
- showSignificant[period] = sigCount > 0;
603
- sigCount--;
604
- }
605
- }
606
- }
607
- var labels = (inst.options.compact ? inst.options.compactLabels : inst.options.labels);
608
- var whichLabels = inst.options.whichLabels || this._normalLabels;
609
- var showCompact = function(period) {
610
- var labelsNum = inst.options['compactLabels' + whichLabels(inst._periods[period])];
611
- return (show[period] ? self._translateDigits(inst, inst._periods[period]) +
612
- (labelsNum ? labelsNum[period] : labels[period]) + ' ' : '');
613
- };
614
- /*var showFull = function(period) {
615
- var labelsNum = inst.options['labels' + whichLabels(inst._periods[period])];
616
- return ((!inst.options.significant && show[period]) ||
617
- (inst.options.significant && showSignificant[period]) ?
618
- '<span class="' + plugin._sectionClass + '">' +
619
- '<span class="' + plugin._amountClass + '">' +
620
- self._translateDigits(inst, inst._periods[period]) + '</span><br/>' +
621
- (labelsNum ? labelsNum[period] : labels[period]) + '</span>' : '');
622
- };*/
623
-
624
- var showFull = function(period) {
625
- //ujimoto
626
- //var labelsNum = $.countdown._get(inst, 'labels' + whichLabels(inst._periods[period]));
627
- var labelsNum = inst.options['labels' + whichLabels(inst._periods[period])];
628
-
629
- if((!significant && show[period]) || (significant && showSignificant[period])){
630
- var ujinum ='';
631
- if(inst._periods[period].toString().length == 1){
632
- ujinum = '<span class="countdown_amount">' + 0+ '</span>' + '<span class="countdown_amount">' + inst._periods[period] + '</span>';
633
- } else{
634
- for (var i = 0; i < inst._periods[period].toString().length; i++) {
635
- ujinum += '<span class="countdown_amount">' + inst._periods[period].toString().charAt(i) + '</span>';
636
- }
637
- }
638
- return '<span class="countdown_section">' +
639
- ujinum + '<span class="countdown_txt">' +
640
- (labelsNum ? labelsNum[period] : labels[period]) + '</span></span>';
641
-
642
- }else {
643
- return '';
644
- }
645
- //ujimoto
646
- };
647
-
648
-
649
- var layout = inst.options.layout;
650
- var compact = inst.options.compact;
651
- var significant = inst.options.significant;
652
- var description = inst.options.description;
653
-
654
- return (layout ? this._buildLayout(inst, show, layout, compact, significant, showSignificant) :
655
- ((compact ? // Compact version
656
- '<span class="countdown_row countdown_amount' +
657
- (inst._hold ? ' countdown_holding' : '') + '">' +
658
- showCompact(Y) + showCompact(O) + showCompact(W) + showCompact(D) +
659
- (show[H] ? this._minDigits(inst._periods[H], 2) : '') +
660
- (show[M] ? (show[H] ? timeSeparator : '') +
661
- this._minDigits(inst._periods[M], 2) : '') +
662
- (show[S] ? (show[H] || show[M] ? timeSeparator : '') +
663
- this._minDigits(inst._periods[S], 2) : '') :
664
- // Full version
665
- '<span class="countdown_row countdown_show' + (significant || showCount) +
666
- (inst._hold ? ' countdown_holding' : '') + '">' +
667
- showFull(Y) + showFull(O) + showFull(W) + showFull(D) +
668
- showFull(H) + showFull(M) + '<span id="uji_sec">'+ showFull(S)) + '</span>' + '</span>' +
669
- (description ? '<span class="countdown_row countdown_descr">' + description + '</span>' : '')));
670
-
671
-
672
-
673
-
674
-
675
-
676
- /* return (inst.options.layout ? this._buildLayout(inst, show, inst.options.layout,
677
- inst.options.compact, inst.options.significant, showSignificant) :
678
- ((inst.options.compact ? // Compact version
679
- '<span class="' + this._rowClass + ' ' + this._amountClass +
680
- (inst._hold ? ' ' + this._holdingClass : '') + '">' +
681
- showCompact(Y) + showCompact(O) + showCompact(W) + showCompact(D) +
682
- (show[H] ? this._minDigits(inst, inst._periods[H], 2) : '') +
683
- (show[M] ? (show[H] ? inst.options.timeSeparator : '') +
684
- this._minDigits(inst, inst._periods[M], 2) : '') +
685
- (show[S] ? (show[H] || show[M] ? inst.options.timeSeparator : '') +
686
- this._minDigits(inst, inst._periods[S], 2) : '') :
687
- // Full version
688
- '<span class="' + this._rowClass + ' ' + this._showClass + (inst.options.significant || showCount) +
689
- (inst._hold ? ' ' + this._holdingClass : '') + '">' +
690
- showFull(Y) + showFull(O) + showFull(W) + showFull(D) +
691
- showFull(H) + showFull(M) + showFull(S)) + '</span>' +
692
- (inst.options.description ? '<span class="' + this._rowClass + ' ' + this._descrClass + '">' +
693
- inst.options.description + '</span>' : '')));*/
694
- },
695
-
696
-
697
- /* Construct a custom layout.
698
- @param inst (object) the current settings for this instance
699
- @param show (string[7]) flags indicating which periods are requested
700
- @param layout (string) the customised layout
701
- @param compact (boolean) true if using compact labels
702
- @param significant (number) the number of periods with values to show, zero for all
703
- @param showSignificant (boolean[7]) other periods to show for significance
704
- @return (string) the custom HTML */
705
- _buildLayout: function(inst, show, layout, compact, significant, showSignificant) {
706
- var labels = inst.options[compact ? 'compactLabels' : 'labels'];
707
- var whichLabels = inst.options.whichLabels || this._normalLabels;
708
- var labelFor = function(index) {
709
- return (inst.options[(compact ? 'compactLabels' : 'labels') +
710
- whichLabels(inst._periods[index])] || labels)[index];
711
- };
712
- var digit = function(value, position) {
713
- return inst.options.digits[Math.floor(value / position) % 10];
714
- };
715
- var subs = {desc: inst.options.description, sep: inst.options.timeSeparator,
716
- yl: labelFor(Y), yn: this._minDigits(inst, inst._periods[Y], 1),
717
- ynn: this._minDigits(inst, inst._periods[Y], 2),
718
- ynnn: this._minDigits(inst, inst._periods[Y], 3), y1: digit(inst._periods[Y], 1),
719
- y10: digit(inst._periods[Y], 10), y100: digit(inst._periods[Y], 100),
720
- y1000: digit(inst._periods[Y], 1000),
721
- ol: labelFor(O), on: this._minDigits(inst, inst._periods[O], 1),
722
- onn: this._minDigits(inst, inst._periods[O], 2),
723
- onnn: this._minDigits(inst, inst._periods[O], 3), o1: digit(inst._periods[O], 1),
724
- o10: digit(inst._periods[O], 10), o100: digit(inst._periods[O], 100),
725
- o1000: digit(inst._periods[O], 1000),
726
- wl: labelFor(W), wn: this._minDigits(inst, inst._periods[W], 1),
727
- wnn: this._minDigits(inst, inst._periods[W], 2),
728
- wnnn: this._minDigits(inst, inst._periods[W], 3), w1: digit(inst._periods[W], 1),
729
- w10: digit(inst._periods[W], 10), w100: digit(inst._periods[W], 100),
730
- w1000: digit(inst._periods[W], 1000),
731
- dl: labelFor(D), dn: this._minDigits(inst, inst._periods[D], 1),
732
- dnn: this._minDigits(inst, inst._periods[D], 2),
733
- dnnn: this._minDigits(inst, inst._periods[D], 3), d1: digit(inst._periods[D], 1),
734
- d10: digit(inst._periods[D], 10), d100: digit(inst._periods[D], 100),
735
- d1000: digit(inst._periods[D], 1000),
736
- hl: labelFor(H), hn: this._minDigits(inst, inst._periods[H], 1),
737
- hnn: this._minDigits(inst, inst._periods[H], 2),
738
- hnnn: this._minDigits(inst, inst._periods[H], 3), h1: digit(inst._periods[H], 1),
739
- h10: digit(inst._periods[H], 10), h100: digit(inst._periods[H], 100),
740
- h1000: digit(inst._periods[H], 1000),
741
- ml: labelFor(M), mn: this._minDigits(inst, inst._periods[M], 1),
742
- mnn: this._minDigits(inst, inst._periods[M], 2),
743
- mnnn: this._minDigits(inst, inst._periods[M], 3), m1: digit(inst._periods[M], 1),
744
- m10: digit(inst._periods[M], 10), m100: digit(inst._periods[M], 100),
745
- m1000: digit(inst._periods[M], 1000),
746
- sl: labelFor(S), sn: this._minDigits(inst, inst._periods[S], 1),
747
- snn: this._minDigits(inst, inst._periods[S], 2),
748
- snnn: this._minDigits(inst, inst._periods[S], 3), s1: digit(inst._periods[S], 1),
749
- s10: digit(inst._periods[S], 10), s100: digit(inst._periods[S], 100),
750
- s1000: digit(inst._periods[S], 1000)};
751
- var html = layout;
752
- // Replace period containers: {p<}...{p>}
753
- for (var i = Y; i <= S; i++) {
754
- var period = 'yowdhms'.charAt(i);
755
- var re = new RegExp('\\{' + period + '<\\}([\\s\\S]*)\\{' + period + '>\\}', 'g');
756
- html = html.replace(re, ((!significant && show[i]) ||
757
- (significant && showSignificant[i]) ? '$1' : ''));
758
- }
759
- // Replace period values: {pn}
760
- $.each(subs, function(n, v) {
761
- var re = new RegExp('\\{' + n + '\\}', 'g');
762
- html = html.replace(re, v);
763
- });
764
- return html;
765
- },
766
-
767
- /* Ensure a numeric value has at least n digits for display.
768
- @param inst (object) the current settings for this instance
769
- @param value (number) the value to display
770
- @param len (number) the minimum length
771
- @return (string) the display text */
772
- _minDigits: function(inst, value, len) {
773
- value = '' + value;
774
- if (value.length >= len) {
775
- return this._translateDigits(inst, value);
776
- }
777
- value = '0000000000' + value;
778
- return this._translateDigits(inst, value.substr(value.length - len));
779
- },
780
-
781
- /* Translate digits into other representations.
782
- @param inst (object) the current settings for this instance
783
- @param value (string) the text to translate
784
- @return (string) the translated text */
785
- _translateDigits: function(inst, value) {
786
- return ('' + value).replace(/[0-9]/g, function(digit) {
787
- return inst.options.digits[digit];
788
- });
789
- },
790
-
791
- /* Translate the format into flags for each period.
792
- @param inst (object) the current settings for this instance
793
- @return (string[7]) flags indicating which periods are requested (?) or
794
- required (!) by year, month, week, day, hour, minute, second */
795
- _determineShow: function(inst) {
796
- var format = inst.options.format;
797
- var show = [];
798
- show[Y] = (format.match('y') ? '?' : (format.match('Y') ? '!' : null));
799
- show[O] = (format.match('o') ? '?' : (format.match('O') ? '!' : null));
800
- show[W] = (format.match('w') ? '?' : (format.match('W') ? '!' : null));
801
- show[D] = (format.match('d') ? '?' : (format.match('D') ? '!' : null));
802
- show[H] = (format.match('h') ? '?' : (format.match('H') ? '!' : null));
803
- show[M] = (format.match('m') ? '?' : (format.match('M') ? '!' : null));
804
- show[S] = (format.match('s') ? '?' : (format.match('S') ? '!' : null));
805
- return show;
806
- },
807
-
808
- /* Calculate the requested periods between now and the target time.
809
- @param inst (object) the current settings for this instance
810
- @param show (string[7]) flags indicating which periods are requested/required
811
- @param significant (number) the number of periods with values to show, zero for all
812
- @param now (Date) the current date and time
813
- @return (number[7]) the current time periods (always positive)
814
- by year, month, week, day, hour, minute, second */
815
- _calculatePeriods: function(inst, show, significant, now) {
816
- // Find endpoints
817
- inst._now = now;
818
- inst._now.setMilliseconds(0);
819
- var until = new Date(inst._now.getTime());
820
- if (inst._since) {
821
- if (now.getTime() < inst._since.getTime()) {
822
- inst._now = now = until;
823
- }
824
- else {
825
- now = inst._since;
826
- }
827
- }
828
- else {
829
- until.setTime(inst._until.getTime());
830
- if (now.getTime() > inst._until.getTime()) {
831
- inst._now = now = until;
832
- }
833
- }
834
- // Calculate differences by period
835
- var periods = [0, 0, 0, 0, 0, 0, 0];
836
- if (show[Y] || show[O]) {
837
- // Treat end of months as the same
838
- var lastNow = plugin._getDaysInMonth(now.getFullYear(), now.getMonth());
839
- var lastUntil = plugin._getDaysInMonth(until.getFullYear(), until.getMonth());
840
- var sameDay = (until.getDate() == now.getDate() ||
841
- (until.getDate() >= Math.min(lastNow, lastUntil) &&
842
- now.getDate() >= Math.min(lastNow, lastUntil)));
843
- var getSecs = function(date) {
844
- return (date.getHours() * 60 + date.getMinutes()) * 60 + date.getSeconds();
845
- };
846
- var months = Math.max(0,
847
- (until.getFullYear() - now.getFullYear()) * 12 + until.getMonth() - now.getMonth() +
848
- ((until.getDate() < now.getDate() && !sameDay) ||
849
- (sameDay && getSecs(until) < getSecs(now)) ? -1 : 0));
850
- periods[Y] = (show[Y] ? Math.floor(months / 12) : 0);
851
- periods[O] = (show[O] ? months - periods[Y] * 12 : 0);
852
- // Adjust for months difference and end of month if necessary
853
- now = new Date(now.getTime());
854
- var wasLastDay = (now.getDate() == lastNow);
855
- var lastDay = plugin._getDaysInMonth(now.getFullYear() + periods[Y],
856
- now.getMonth() + periods[O]);
857
- if (now.getDate() > lastDay) {
858
- now.setDate(lastDay);
859
- }
860
- now.setFullYear(now.getFullYear() + periods[Y]);
861
- now.setMonth(now.getMonth() + periods[O]);
862
- if (wasLastDay) {
863
- now.setDate(lastDay);
864
- }
865
- }
866
- var diff = Math.floor((until.getTime() - now.getTime()) / 1000);
867
- var extractPeriod = function(period, numSecs) {
868
- periods[period] = (show[period] ? Math.floor(diff / numSecs) : 0);
869
- diff -= periods[period] * numSecs;
870
- };
871
- extractPeriod(W, 604800);
872
- extractPeriod(D, 86400);
873
- extractPeriod(H, 3600);
874
- extractPeriod(M, 60);
875
- extractPeriod(S, 1);
876
- if (diff > 0 && !inst._since) { // Round up if left overs
877
- var multiplier = [1, 12, 4.3482, 7, 24, 60, 60];
878
- var lastShown = S;
879
- var max = 1;
880
- for (var period = S; period >= Y; period--) {
881
- if (show[period]) {
882
- if (periods[lastShown] >= max) {
883
- periods[lastShown] = 0;
884
- diff = 1;
885
- }
886
- if (diff > 0) {
887
- periods[period]++;
888
- diff = 0;
889
- lastShown = period;
890
- max = 1;
891
- }
892
- }
893
- max *= multiplier[period];
894
- }
895
- }
896
- if (significant) { // Zero out insignificant periods
897
- for (var period = Y; period <= S; period++) {
898
- if (significant && periods[period]) {
899
- significant--;
900
- }
901
- else if (!significant) {
902
- periods[period] = 0;
903
- }
904
- }
905
- }
906
- return periods;
907
- }
908
- });
909
-
910
- // The list of commands that return values and don't permit chaining
911
- var getters = ['getTimes'];
912
-
913
- /* Determine whether a command is a getter and doesn't permit chaining.
914
- @param command (string, optional) the command to run
915
- @param otherArgs ([], optional) any other arguments for the command
916
- @return true if the command is a getter, false if not */
917
- function isNotChained(command, otherArgs) {
918
- if (command == 'option' && (otherArgs.length == 0 ||
919
- (otherArgs.length == 1 && typeof otherArgs[0] == 'string'))) {
920
- return true;
921
- }
922
- return $.inArray(command, getters) > -1;
923
- }
924
-
925
- /* Process the countdown functionality for a jQuery selection.
926
- @param options (object) the new settings to use for these instances (optional) or
927
- (string) the command to run (optional)
928
- @return (jQuery) for chaining further calls or
929
- (any) getter value */
930
- $.fn.countdown = function(options) {
931
- var otherArgs = Array.prototype.slice.call(arguments, 1);
932
- if (isNotChained(options, otherArgs)) {
933
- return plugin['_' + options + 'Plugin'].
934
- apply(plugin, [this[0]].concat(otherArgs));
935
- }
936
- return this.each(function() {
937
- if (typeof options == 'string') {
938
- if (!plugin['_' + options + 'Plugin']) {
939
- throw 'Unknown command: ' + options;
940
- }
941
- plugin['_' + options + 'Plugin'].
942
- apply(plugin, [this].concat(otherArgs));
943
- }
944
- else {
945
- plugin._attachPlugin(this, options || {});
946
- }
947
- });
948
- };
949
-
950
- /* Initialise the countdown functionality. */
951
- var plugin = $.countdown = new Countdown(); // Singleton instance
952
-
953
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/jquery.countdown.js CHANGED
@@ -1 +1 @@
1
- (function(e){function t(){function r(e){var o=e<1e12?n?performance.now()+performance.timing.navigationStart:t():e||t();if(o-s>=1e3){c._updateTargets();s=o}i(r)}this.regional=[];this.regional[""]={labels:["Years","Months","Weeks","Days","Hours","Minutes","Seconds"],labels1:["Year","Month","Week","Day","Hour","Minute","Second"],compactLabels:["y","m","w","d"],whichLabels:null,digits:["0","1","2","3","4","5","6","7","8","9"],timeSeparator:":",isRTL:false};this._defaults={text_size:"35",animate_sec:false,color_down:"#3A3A3A",color_up:"#635b63",color_txt:"#ffffff",color_sw:"#000000",ujic_txt:true,ujic_url:false,until:null,since:null,timezone:null,serverSync:null,format:"dHMS",layout:"",compact:false,significant:0,description:"",expiryUrl:"",expiryText:"",alwaysExpire:false,onExpiry:null,onTick:null,tickInterval:1};e.extend(this._defaults,this.regional[""]);this._serverSyncs=[];var t=typeof Date.now=="function"?Date.now:function(){return(new Date).getTime()};var n=window.performance&&typeof window.performance.now=="function";var i=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||null;var s=0;if(!i||e.noRequestAnimationFrame){e.noRequestAnimationFrame=null;setInterval(function(){c._updateTargets()},980)}else{s=window.animationStartTime||window.webkitAnimationStartTime||window.mozAnimationStartTime||window.oAnimationStartTime||window.msAnimationStartTime||t();i(r)}}function l(t,n){if(t=="option"&&(n.length==0||n.length==1&&typeof n[0]=="string")){return true}return e.inArray(t,f)>-1}var n=0;var r=1;var i=2;var s=3;var o=4;var u=5;var a=6;e.extend(t.prototype,{markerClassName:"hasCountdown",propertyName:"countdown",_rtlClass:"countdown_rtl",_sectionClass:"countdown_section",_amountClass:"countdown_amount",_rowClass:"countdown_row",_holdingClass:"countdown_holding",_showClass:"countdown_show",_descrClass:"countdown_descr",_timerTargets:[],setDefaults:function(t){this._resetExtraLabels(this._defaults,t);e.extend(this._defaults,t||{})},UTCDate:function(e,t,n,r,i,s,o,u){if(typeof t=="object"&&t.constructor==Date){u=t.getMilliseconds();o=t.getSeconds();s=t.getMinutes();i=t.getHours();r=t.getDate();n=t.getMonth();t=t.getFullYear()}var a=new Date;a.setUTCFullYear(t);a.setUTCDate(1);a.setUTCMonth(n||0);a.setUTCDate(r||1);a.setUTCHours(i||0);a.setUTCMinutes((s||0)-(Math.abs(e)<30?e*60:e));a.setUTCSeconds(o||0);a.setUTCMilliseconds(u||0);return a},periodsToSeconds:function(e){return e[0]*31557600+e[1]*2629800+e[2]*604800+e[3]*86400+e[4]*3600+e[5]*60+e[6]},_attachPlugin:function(t,n){t=e(t);if(t.hasClass(this.markerClassName)){return}var r={options:e.extend({},this._defaults),_periods:[0,0,0,0,0,0,0]};t.addClass(this.markerClassName).data(this.propertyName,r);this._optionPlugin(t,n)},_addTarget:function(e){if(!this._hasTarget(e)){this._timerTargets.push(e)}},_hasTarget:function(t){return e.inArray(t,this._timerTargets)>-1},_removeTarget:function(t){this._timerTargets=e.map(this._timerTargets,function(e){return e==t?null:e})},_updateTargets:function(){for(var e=this._timerTargets.length-1;e>=0;e--){this._updateCountdown(this._timerTargets[e])}},_optionPlugin:function(t,n,r){t=e(t);var i=t.data(this.propertyName);if(!n||typeof n=="string"&&r==null){var s=n;n=(i||{}).options;return n&&s?n[s]:n}if(!t.hasClass(this.markerClassName)){return}n=n||{};if(typeof n=="string"){var s=n;n={};n[s]=r}if(n.layout){n.layout=n.layout.replace(/&lt;/g,"<").replace(/&gt;/g,">")}this._resetExtraLabels(i.options,n);var o=i.options.timezone!=n.timezone;e.extend(i.options,n);this._adjustSettings(t,i,n.until!=null||n.since!=null||o);var u=new Date;if(i._since&&i._since<u||i._until&&i._until>u){this._addTarget(t[0])}this._updateCountdown(t,i)},_updateCountdown:function(t,n){var r=e(t);n=n||r.data(this.propertyName);if(!n){return}r.html(this._generateHTML(n)).toggleClass(this._rtlClass,n.options.isRTL);var i=n.options.ujic_url;var s=n.options.until;var o=new Date;var u=parseInt(o.getTime()/1e3);var a=parseInt(s.getTime()/1e3)-2;if(i=="false")i=false;if(i&&u>a){window.location.replace(i)}var f=n.options.color_down;var l=n.options.color_up;jQuery("#ujiCountdown .countdown_amount").css("background-image","linear-gradient(bottom, "+f+" 50%, "+l+" 50%)");jQuery("#ujiCountdown .countdown_amount").css("background-image","-o-linear-gradient(bottom, "+f+" 50%, "+l+" 50%)");jQuery("#ujiCountdown .countdown_amount").css("background-image","-moz-linear-gradient(bottom, "+f+" 50%, "+l+" 50%)");jQuery("#ujiCountdown .countdown_amount").css("background-image","-webkit-linear-gradient(bottom, "+f+" 50%, "+l+" 50%)");jQuery("#ujiCountdown .countdown_amount").css("background-image","-ms-linear-gradient(bottom, "+f+" 50%, "+l+" 50%)");jQuery("#ujiCountdown .countdown_amount").css("filter","progid:DXImageTransform.Microsoft.Gradient(startColorstr='"+f+"', endColorstr='"+l+"')");var c=n.options.color_txt;var h=n.options.color_sw;jQuery("#ujiCountdown .countdown_amount").css("color",c);jQuery("#ujiCountdown .countdown_amount").css("text-shadow","1px 1px 1px "+h);var p=n.options.ujic_txt;if(p){jQuery("#ujiCountdown .countdown_txt").css("display","block")}else{jQuery("#ujiCountdown .countdown_txt").css("display","none")}var d=n.options.text_size;var v=0;switch(parseInt(d)){case 10:v=5;break;case 11:v=3;break;case 12:v=3;break;case 13:v=1;break}jQuery("#ujiCountdown .countdown_amount").css("font",d+"px/1.5 'Open Sans Condensed',sans-serif");if(d<15){jQuery("#ujiCountdown .countdown_amount").css({padding:"2px 5px","margin-right":"1px"});jQuery("#ujiCountdown .countdown_section").css("margin","0px 6px 0px 0px");jQuery("#ujiCountdown .countdown_txt").css("font","9px 'Open Sans Condensed',sans-serif")}var m=n.options.animate_sec;if(m){var g=jQuery("#ujiCountdown").find("#uji_sec").find(".countdown_section").width();jQuery("#ujiCountdown").find("#uji_sec").find(".countdown_section").css({width:g+"px"});jQuery("#ujiCountdown").find("#uji_sec").find(".countdown_amount").eq(1).css({top:"-74px",right:0,position:"absolute",opacity:1});jQuery("#ujiCountdown").find("#uji_sec").find(".countdown_amount").eq(1).animate({top:v+"px",right:0,opacity:1},700,function(){jQuery("#ujiCountdown").find("#uji_sec").find(".countdown_amount").eq(1).animate({opacity:0},300)})}if(e.isFunction(n.options.onTick)){var y=n._hold!="lap"?n._periods:this._calculatePeriods(n,n._show,n.options.significant,new Date);if(n.options.tickInterval==1||this.periodsToSeconds(y)%n.options.tickInterval==0){n.options.onTick.apply(t,[y])}}var b=n._hold!="pause"&&(n._since?n._now.getTime()<n._since.getTime():n._now.getTime()>=n._until.getTime());if(b&&!n._expiring){n._expiring=true;if(this._hasTarget(t)||n.options.alwaysExpire){this._removeTarget(t);if(e.isFunction(n.options.onExpiry)){n.options.onExpiry.apply(t,[])}if(n.options.expiryText){var w=n.options.layout;n.options.layout=n.options.expiryText;this._updateCountdown(t,n);n.options.layout=w}if(n.options.expiryUrl){window.location=n.options.expiryUrl}}n._expiring=false}else if(n._hold=="pause"){this._removeTarget(t)}r.data(this.propertyName,n)},_resetExtraLabels:function(e,t){var n=false;for(var r in t){if(r!="whichLabels"&&r.match(/[Ll]abels/)){n=true;break}}if(n){for(var r in e){if(r.match(/[Ll]abels[02-9]|compactLabels1/)){e[r]=null}}}},_adjustSettings:function(t,n,r){var i;var s=0;var o=null;for(var u=0;u<this._serverSyncs.length;u++){if(this._serverSyncs[u][0]==n.options.serverSync){o=this._serverSyncs[u][1];break}}if(o!=null){s=n.options.serverSync?o:0;i=new Date}else{var a=e.isFunction(n.options.serverSync)?n.options.serverSync.apply(t,[]):null;i=new Date;s=a?i.getTime()-a.getTime():0;this._serverSyncs.push([n.options.serverSync,s])}var f=n.options.timezone;f=f==null?-i.getTimezoneOffset():f;if(r||!r&&n._until==null&&n._since==null){n._since=n.options.since;if(n._since!=null){n._since=this.UTCDate(f,this._determineTime(n._since,null));if(n._since&&s){n._since.setMilliseconds(n._since.getMilliseconds()+s)}}n._until=this.UTCDate(f,this._determineTime(n.options.until,i));if(s){n._until.setMilliseconds(n._until.getMilliseconds()+s)}}n._show=this._determineShow(n)},_destroyPlugin:function(t){t=e(t);if(!t.hasClass(this.markerClassName)){return}this._removeTarget(t[0]);t.removeClass(this.markerClassName).empty().removeData(this.propertyName)},_pausePlugin:function(e){this._hold(e,"pause")},_lapPlugin:function(e){this._hold(e,"lap")},_resumePlugin:function(e){this._hold(e,null)},_hold:function(t,n){var r=e.data(t,this.propertyName);if(r){if(r._hold=="pause"&&!n){r._periods=r._savePeriods;var i=r._since?"-":"+";r[r._since?"_since":"_until"]=this._determineTime(i+r._periods[0]+"y"+i+r._periods[1]+"o"+i+r._periods[2]+"w"+i+r._periods[3]+"d"+i+r._periods[4]+"h"+i+r._periods[5]+"m"+i+r._periods[6]+"s");this._addTarget(t)}r._hold=n;r._savePeriods=n=="pause"?r._periods:null;e.data(t,this.propertyName,r);this._updateCountdown(t,r)}},_getTimesPlugin:function(t){var n=e.data(t,this.propertyName);return!n?null:n._hold=="pause"?n._savePeriods:!n._hold?n._periods:this._calculatePeriods(n,n._show,n.options.significant,new Date)},_determineTime:function(e,t){var n=function(e){var t=new Date;t.setTime(t.getTime()+e*1e3);return t};var r=function(e){e=e.toLowerCase();var t=new Date;var n=t.getFullYear();var r=t.getMonth();var i=t.getDate();var s=t.getHours();var o=t.getMinutes();var u=t.getSeconds();var a=/([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;var f=a.exec(e);while(f){switch(f[2]||"s"){case"s":u+=parseInt(f[1],10);break;case"m":o+=parseInt(f[1],10);break;case"h":s+=parseInt(f[1],10);break;case"d":i+=parseInt(f[1],10);break;case"w":i+=parseInt(f[1],10)*7;break;case"o":r+=parseInt(f[1],10);i=Math.min(i,c._getDaysInMonth(n,r));break;case"y":n+=parseInt(f[1],10);i=Math.min(i,c._getDaysInMonth(n,r));break}f=a.exec(e)}return new Date(n,r,i,s,o,u,0)};var i=e==null?t:typeof e=="string"?r(e):typeof e=="number"?n(e):e;if(i)i.setMilliseconds(0);return i},_getDaysInMonth:function(e,t){return 32-(new Date(e,t,32)).getDate()},_normalLabels:function(e){return e},_generateHTML:function(t){var f=this;t._periods=t._hold?t._periods:this._calculatePeriods(t,t._show,t.options.significant,new Date);var l=false;var c=0;var h=t.options.significant;var p=e.extend({},t._show);for(var d=n;d<=a;d++){l|=t._show[d]=="?"&&t._periods[d]>0;p[d]=t._show[d]=="?"&&!l?null:t._show[d];c+=p[d]?1:0;h-=t._periods[d]>0?1:0}var v=[false,false,false,false,false,false,false];for(var d=a;d>=n;d--){if(t._show[d]){if(t._periods[d]){v[d]=true}else{v[d]=h>0;h--}}}var m=t.options.compact?t.options.compactLabels:t.options.labels;var g=t.options.whichLabels||this._normalLabels;var y=function(e){var n=t.options["compactLabels"+g(t._periods[e])];return p[e]?f._translateDigits(t,t._periods[e])+(n?n[e]:m[e])+" ":""};var b=function(e){var n=t.options["labels"+g(t._periods[e])];if(!x&&p[e]||x&&v[e]){var r="";if(t._periods[e].toString().length==1){r='<span class="countdown_amount">'+0+"</span>"+'<span class="countdown_amount">'+t._periods[e]+"</span>"}else{for(var i=0;i<t._periods[e].toString().length;i++){r+='<span class="countdown_amount">'+t._periods[e].toString().charAt(i)+"</span>"}}return'<span class="countdown_section">'+r+'<span class="countdown_txt">'+(n?n[e]:m[e])+"</span></span>"}else{return""}};var w=t.options.layout;var E=t.options.compact;var x=t.options.significant;var T=t.options.description;return w?this._buildLayout(t,p,w,E,x,v):(E?'<span class="countdown_row countdown_amount'+(t._hold?" countdown_holding":"")+'">'+y(n)+y(r)+y(i)+y(s)+(p[o]?this._minDigits(t._periods[o],2):"")+(p[u]?(p[o]?timeSeparator:"")+this._minDigits(t._periods[u],2):"")+(p[a]?(p[o]||p[u]?timeSeparator:"")+this._minDigits(t._periods[a],2):""):'<span class="countdown_row countdown_show'+(x||c)+(t._hold?" countdown_holding":"")+'">'+b(n)+b(r)+b(i)+b(s)+b(o)+b(u)+'<span id="uji_sec">'+b(a))+"</span>"+"</span>"+(T?'<span class="countdown_row countdown_descr">'+T+"</span>":"")},_buildLayout:function(t,f,l,c,h,p){var d=t.options[c?"compactLabels":"labels"];var v=t.options.whichLabels||this._normalLabels;var m=function(e){return(t.options[(c?"compactLabels":"labels")+v(t._periods[e])]||d)[e]};var g=function(e,n){return t.options.digits[Math.floor(e/n)%10]};var y={desc:t.options.description,sep:t.options.timeSeparator,yl:m(n),yn:this._minDigits(t,t._periods[n],1),ynn:this._minDigits(t,t._periods[n],2),ynnn:this._minDigits(t,t._periods[n],3),y1:g(t._periods[n],1),y10:g(t._periods[n],10),y100:g(t._periods[n],100),y1000:g(t._periods[n],1e3),ol:m(r),on:this._minDigits(t,t._periods[r],1),onn:this._minDigits(t,t._periods[r],2),onnn:this._minDigits(t,t._periods[r],3),o1:g(t._periods[r],1),o10:g(t._periods[r],10),o100:g(t._periods[r],100),o1000:g(t._periods[r],1e3),wl:m(i),wn:this._minDigits(t,t._periods[i],1),wnn:this._minDigits(t,t._periods[i],2),wnnn:this._minDigits(t,t._periods[i],3),w1:g(t._periods[i],1),w10:g(t._periods[i],10),w100:g(t._periods[i],100),w1000:g(t._periods[i],1e3),dl:m(s),dn:this._minDigits(t,t._periods[s],1),dnn:this._minDigits(t,t._periods[s],2),dnnn:this._minDigits(t,t._periods[s],3),d1:g(t._periods[s],1),d10:g(t._periods[s],10),d100:g(t._periods[s],100),d1000:g(t._periods[s],1e3),hl:m(o),hn:this._minDigits(t,t._periods[o],1),hnn:this._minDigits(t,t._periods[o],2),hnnn:this._minDigits(t,t._periods[o],3),h1:g(t._periods[o],1),h10:g(t._periods[o],10),h100:g(t._periods[o],100),h1000:g(t._periods[o],1e3),ml:m(u),mn:this._minDigits(t,t._periods[u],1),mnn:this._minDigits(t,t._periods[u],2),mnnn:this._minDigits(t,t._periods[u],3),m1:g(t._periods[u],1),m10:g(t._periods[u],10),m100:g(t._periods[u],100),m1000:g(t._periods[u],1e3),sl:m(a),sn:this._minDigits(t,t._periods[a],1),snn:this._minDigits(t,t._periods[a],2),snnn:this._minDigits(t,t._periods[a],3),s1:g(t._periods[a],1),s10:g(t._periods[a],10),s100:g(t._periods[a],100),s1000:g(t._periods[a],1e3)};var b=l;for(var w=n;w<=a;w++){var E="yowdhms".charAt(w);var x=new RegExp("\\{"+E+"<\\}([\\s\\S]*)\\{"+E+">\\}","g");b=b.replace(x,!h&&f[w]||h&&p[w]?"$1":"")}e.each(y,function(e,t){var n=new RegExp("\\{"+e+"\\}","g");b=b.replace(n,t)});return b},_minDigits:function(e,t,n){t=""+t;if(t.length>=n){return this._translateDigits(e,t)}t="0000000000"+t;return this._translateDigits(e,t.substr(t.length-n))},_translateDigits:function(e,t){return(""+t).replace(/[0-9]/g,function(t){return e.options.digits[t]})},_determineShow:function(e){var t=e.options.format;var f=[];f[n]=t.match("y")?"?":t.match("Y")?"!":null;f[r]=t.match("o")?"?":t.match("O")?"!":null;f[i]=t.match("w")?"?":t.match("W")?"!":null;f[s]=t.match("d")?"?":t.match("D")?"!":null;f[o]=t.match("h")?"?":t.match("H")?"!":null;f[u]=t.match("m")?"?":t.match("M")?"!":null;f[a]=t.match("s")?"?":t.match("S")?"!":null;return f},_calculatePeriods:function(e,t,f,l){e._now=l;e._now.setMilliseconds(0);var h=new Date(e._now.getTime());if(e._since){if(l.getTime()<e._since.getTime()){e._now=l=h}else{l=e._since}}else{h.setTime(e._until.getTime());if(l.getTime()>e._until.getTime()){e._now=l=h}}var p=[0,0,0,0,0,0,0];if(t[n]||t[r]){var d=c._getDaysInMonth(l.getFullYear(),l.getMonth());var v=c._getDaysInMonth(h.getFullYear(),h.getMonth());var m=h.getDate()==l.getDate()||h.getDate()>=Math.min(d,v)&&l.getDate()>=Math.min(d,v);var g=function(e){return(e.getHours()*60+e.getMinutes())*60+e.getSeconds()};var y=Math.max(0,(h.getFullYear()-l.getFullYear())*12+h.getMonth()-l.getMonth()+(h.getDate()<l.getDate()&&!m||m&&g(h)<g(l)?-1:0));p[n]=t[n]?Math.floor(y/12):0;p[r]=t[r]?y-p[n]*12:0;l=new Date(l.getTime());var b=l.getDate()==d;var w=c._getDaysInMonth(l.getFullYear()+p[n],l.getMonth()+p[r]);if(l.getDate()>w){l.setDate(w)}l.setFullYear(l.getFullYear()+p[n]);l.setMonth(l.getMonth()+p[r]);if(b){l.setDate(w)}}var E=Math.floor((h.getTime()-l.getTime())/1e3);var x=function(e,n){p[e]=t[e]?Math.floor(E/n):0;E-=p[e]*n};x(i,604800);x(s,86400);x(o,3600);x(u,60);x(a,1);if(E>0&&!e._since){var T=[1,12,4.3482,7,24,60,60];var N=a;var C=1;for(var k=a;k>=n;k--){if(t[k]){if(p[N]>=C){p[N]=0;E=1}if(E>0){p[k]++;E=0;N=k;C=1}}C*=T[k]}}if(f){for(var k=n;k<=a;k++){if(f&&p[k]){f--}else if(!f){p[k]=0}}}return p}});var f=["getTimes"];e.fn.countdown=function(e){var t=Array.prototype.slice.call(arguments,1);if(l(e,t)){return c["_"+e+"Plugin"].apply(c,[this[0]].concat(t))}return this.each(function(){if(typeof e=="string"){if(!c["_"+e+"Plugin"]){throw"Unknown command: "+e}c["_"+e+"Plugin"].apply(c,[this].concat(t))}else{c._attachPlugin(this,e||{})}})};var c=e.countdown=new t})(jQuery)
1
+ (function(e){function t(){function r(e){var o=e<1e12?n?performance.now()+performance.timing.navigationStart:t():e||t();if(o-s>=1e3){c._updateTargets();s=o}i(r)}this.regional=[];this.regional[""]={labels:["Years","Months","Weeks","Days","Hours","Minutes","Seconds"],labels1:["Year","Month","Week","Day","Hour","Minute","Second"],compactLabels:["y","m","w","d"],whichLabels:null,digits:["0","1","2","3","4","5","6","7","8","9"],timeSeparator:":",isRTL:false};this._defaults={text_size:"35",animate_sec:false,color_down:"#3A3A3A",color_up:"#635b63",color_txt:"#ffffff",color_sw:"#000000",ujic_txt:true,ujic_url:false,until:null,since:null,timezone:null,serverSync:null,format:"dHMS",layout:"",compact:false,significant:0,description:"",expiryUrl:"",expiryText:"",alwaysExpire:false,onExpiry:null,onTick:null,tickInterval:1};e.extend(this._defaults,this.regional[""]);this._serverSyncs=[];var t=typeof Date.now=="function"?Date.now:function(){return(new Date).getTime()};var n=window.performance&&typeof window.performance.now=="function";var i=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||null;var s=0;if(!i||e.noRequestAnimationFrame){e.noRequestAnimationFrame=null;setInterval(function(){c._updateTargets()},980)}else{s=window.animationStartTime||window.webkitAnimationStartTime||window.mozAnimationStartTime||window.oAnimationStartTime||window.msAnimationStartTime||t();i(r)}}function l(t,n){if(t=="option"&&(n.length==0||n.length==1&&typeof n[0]=="string")){return true}return e.inArray(t,f)>-1}var n=0;var r=1;var i=2;var s=3;var o=4;var u=5;var a=6;e.extend(t.prototype,{markerClassName:"hasCountdown",propertyName:"countdown",_rtlClass:"countdown_rtl",_sectionClass:"countdown_section",_amountClass:"countdown_amount",_rowClass:"countdown_row",_holdingClass:"countdown_holding",_showClass:"countdown_show",_descrClass:"countdown_descr",_timerTargets:[],setDefaults:function(t){this._resetExtraLabels(this._defaults,t);e.extend(this._defaults,t||{})},UTCDate:function(e,t,n,r,i,s,o,u){if(typeof t=="object"&&t.constructor==Date){u=t.getMilliseconds();o=t.getSeconds();s=t.getMinutes();i=t.getHours();r=t.getDate();n=t.getMonth();t=t.getFullYear()}var a=new Date;a.setUTCFullYear(t);a.setUTCDate(1);a.setUTCMonth(n||0);a.setUTCDate(r||1);a.setUTCHours(i||0);a.setUTCMinutes((s||0)-(Math.abs(e)<30?e*60:e));a.setUTCSeconds(o||0);a.setUTCMilliseconds(u||0);return a},periodsToSeconds:function(e){return e[0]*31557600+e[1]*2629800+e[2]*604800+e[3]*86400+e[4]*3600+e[5]*60+e[6]},_attachPlugin:function(t,n){t=e(t);if(t.hasClass(this.markerClassName)){return}var r={options:e.extend({},this._defaults),_periods:[0,0,0,0,0,0,0]};t.addClass(this.markerClassName).data(this.propertyName,r);this._optionPlugin(t,n)},_addTarget:function(e){if(!this._hasTarget(e)){this._timerTargets.push(e)}},_hasTarget:function(t){return e.inArray(t,this._timerTargets)>-1},_removeTarget:function(t){this._timerTargets=e.map(this._timerTargets,function(e){return e==t?null:e})},_updateTargets:function(){for(var e=this._timerTargets.length-1;e>=0;e--){this._updateCountdown(this._timerTargets[e])}},_optionPlugin:function(t,n,r){t=e(t);var i=t.data(this.propertyName);if(!n||typeof n=="string"&&r==null){var s=n;n=(i||{}).options;return n&&s?n[s]:n}if(!t.hasClass(this.markerClassName)){return}n=n||{};if(typeof n=="string"){var s=n;n={};n[s]=r}if(n.layout){n.layout=n.layout.replace(/&lt;/g,"<").replace(/&gt;/g,">")}this._resetExtraLabels(i.options,n);var o=i.options.timezone!=n.timezone;e.extend(i.options,n);this._adjustSettings(t,i,n.until!=null||n.since!=null||o);var u=new Date;if(i._since&&i._since<u||i._until&&i._until>u){this._addTarget(t[0])}this._updateCountdown(t,i)},_updateCountdown:function(t,n){var r=e(t);n=n||r.data(this.propertyName);if(!n){return}r.html(this._generateHTML(n)).toggleClass(this._rtlClass,n.options.isRTL);var i=n.options.ujic_url;var s=n.options.until;var o=new Date;var u=parseInt(o.getTime()/1e3);var a=parseInt(s.getTime()/1e3)-2;if(i=="false")i=false;if(i&&u>a){window.location.replace(i)}var f=n.options.color_down;var l=n.options.color_up;jQuery("#ujiCountdown .countdown_amount").css("background","-moz-linear-gradient(top, "+l+" 50%, "+f+" 50%)");jQuery("#ujiCountdown .countdown_amount").css("background: -webkit-gradient(linear, left top, left bottom, color-stop(50%,"+l+"), color-stop(50%,"+f+"))");jQuery("#ujiCountdown .countdown_amount").css("background","-webkit-linear-gradient(top, "+l+" 50%,"+f+" 50%)");jQuery("#ujiCountdown .countdown_amount").css("background","-o-linear-gradient(top, "+l+" 50%,"+f+" 50%)");jQuery("#ujiCountdown .countdown_amount").css("background","-ms-linear-gradient(top, "+l+" 50%,"+f+" 50%)");jQuery("#ujiCountdown .countdown_amount").css("background","linear-gradient(to bottom, "+l+" 50%,"+f+" 50%)");jQuery("#ujiCountdown .countdown_amount").css("filter","progid:DXImageTransform.Microsoft.gradient( startColorstr='"+l+"', endColorstr='"+f+"',GradientType=0 )");var c=n.options.color_txt;var h=n.options.color_sw;jQuery("#ujiCountdown .countdown_amount").css("color",c);jQuery("#ujiCountdown .countdown_amount").css("text-shadow","1px 1px 1px "+h);var p=n.options.ujic_txt;if(p){jQuery("#ujiCountdown .countdown_txt").css("display","block")}else{jQuery("#ujiCountdown .countdown_txt").css("display","none")}var d=n.options.text_size;var v=0;switch(parseInt(d)){case 10:v=5;break;case 11:v=3;break;case 12:v=3;break;case 13:v=1;break}jQuery("#ujiCountdown .countdown_amount").css("font",d+"px/1.5 'Open Sans Condensed',sans-serif");if(d<15){jQuery("#ujiCountdown .countdown_amount").css({padding:"2px 5px","margin-right":"1px"});jQuery("#ujiCountdown .countdown_section").css("margin","0px 6px 0px 0px");jQuery("#ujiCountdown .countdown_txt").css("font","9px 'Open Sans Condensed',sans-serif")}var m=n.options.animate_sec;if(m){var g=jQuery("#ujiCountdown").find("#uji_sec").find(".countdown_section").width();jQuery("#ujiCountdown").find("#uji_sec").find(".countdown_section").css({width:g+"px"});jQuery("#ujiCountdown").find("#uji_sec").find(".countdown_amount").eq(1).css({top:"-74px",right:0,position:"absolute",opacity:1});jQuery("#ujiCountdown").find("#uji_sec").find(".countdown_amount").eq(1).animate({top:v+"px",right:0,opacity:1},700,function(){jQuery("#ujiCountdown").find("#uji_sec").find(".countdown_amount").eq(1).animate({opacity:0},300)})}if(e.isFunction(n.options.onTick)){var y=n._hold!="lap"?n._periods:this._calculatePeriods(n,n._show,n.options.significant,new Date);if(n.options.tickInterval==1||this.periodsToSeconds(y)%n.options.tickInterval==0){n.options.onTick.apply(t,[y])}}var b=n._hold!="pause"&&(n._since?n._now.getTime()<n._since.getTime():n._now.getTime()>=n._until.getTime());if(b&&!n._expiring){n._expiring=true;if(this._hasTarget(t)||n.options.alwaysExpire){this._removeTarget(t);if(e.isFunction(n.options.onExpiry)){n.options.onExpiry.apply(t,[])}if(n.options.expiryText){var w=n.options.layout;n.options.layout=n.options.expiryText;this._updateCountdown(t,n);n.options.layout=w}if(n.options.expiryUrl){window.location=n.options.expiryUrl}}n._expiring=false}else if(n._hold=="pause"){this._removeTarget(t)}r.data(this.propertyName,n)},_resetExtraLabels:function(e,t){var n=false;for(var r in t){if(r!="whichLabels"&&r.match(/[Ll]abels/)){n=true;break}}if(n){for(var r in e){if(r.match(/[Ll]abels[02-9]|compactLabels1/)){e[r]=null}}}},_adjustSettings:function(t,n,r){var i;var s=0;var o=null;for(var u=0;u<this._serverSyncs.length;u++){if(this._serverSyncs[u][0]==n.options.serverSync){o=this._serverSyncs[u][1];break}}if(o!=null){s=n.options.serverSync?o:0;i=new Date}else{var a=e.isFunction(n.options.serverSync)?n.options.serverSync.apply(t,[]):null;i=new Date;s=a?i.getTime()-a.getTime():0;this._serverSyncs.push([n.options.serverSync,s])}var f=n.options.timezone;f=f==null?-i.getTimezoneOffset():f;if(r||!r&&n._until==null&&n._since==null){n._since=n.options.since;if(n._since!=null){n._since=this.UTCDate(f,this._determineTime(n._since,null));if(n._since&&s){n._since.setMilliseconds(n._since.getMilliseconds()+s)}}n._until=this.UTCDate(f,this._determineTime(n.options.until,i));if(s){n._until.setMilliseconds(n._until.getMilliseconds()+s)}}n._show=this._determineShow(n)},_destroyPlugin:function(t){t=e(t);if(!t.hasClass(this.markerClassName)){return}this._removeTarget(t[0]);t.removeClass(this.markerClassName).empty().removeData(this.propertyName)},_pausePlugin:function(e){this._hold(e,"pause")},_lapPlugin:function(e){this._hold(e,"lap")},_resumePlugin:function(e){this._hold(e,null)},_hold:function(t,n){var r=e.data(t,this.propertyName);if(r){if(r._hold=="pause"&&!n){r._periods=r._savePeriods;var i=r._since?"-":"+";r[r._since?"_since":"_until"]=this._determineTime(i+r._periods[0]+"y"+i+r._periods[1]+"o"+i+r._periods[2]+"w"+i+r._periods[3]+"d"+i+r._periods[4]+"h"+i+r._periods[5]+"m"+i+r._periods[6]+"s");this._addTarget(t)}r._hold=n;r._savePeriods=n=="pause"?r._periods:null;e.data(t,this.propertyName,r);this._updateCountdown(t,r)}},_getTimesPlugin:function(t){var n=e.data(t,this.propertyName);return!n?null:n._hold=="pause"?n._savePeriods:!n._hold?n._periods:this._calculatePeriods(n,n._show,n.options.significant,new Date)},_determineTime:function(e,t){var n=function(e){var t=new Date;t.setTime(t.getTime()+e*1e3);return t};var r=function(e){e=e.toLowerCase();var t=new Date;var n=t.getFullYear();var r=t.getMonth();var i=t.getDate();var s=t.getHours();var o=t.getMinutes();var u=t.getSeconds();var a=/([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;var f=a.exec(e);while(f){switch(f[2]||"s"){case"s":u+=parseInt(f[1],10);break;case"m":o+=parseInt(f[1],10);break;case"h":s+=parseInt(f[1],10);break;case"d":i+=parseInt(f[1],10);break;case"w":i+=parseInt(f[1],10)*7;break;case"o":r+=parseInt(f[1],10);i=Math.min(i,c._getDaysInMonth(n,r));break;case"y":n+=parseInt(f[1],10);i=Math.min(i,c._getDaysInMonth(n,r));break}f=a.exec(e)}return new Date(n,r,i,s,o,u,0)};var i=e==null?t:typeof e=="string"?r(e):typeof e=="number"?n(e):e;if(i)i.setMilliseconds(0);return i},_getDaysInMonth:function(e,t){return 32-(new Date(e,t,32)).getDate()},_normalLabels:function(e){return e},_generateHTML:function(t){var f=this;t._periods=t._hold?t._periods:this._calculatePeriods(t,t._show,t.options.significant,new Date);var l=false;var c=0;var h=t.options.significant;var p=e.extend({},t._show);for(var d=n;d<=a;d++){l|=t._show[d]=="?"&&t._periods[d]>0;p[d]=t._show[d]=="?"&&!l?null:t._show[d];c+=p[d]?1:0;h-=t._periods[d]>0?1:0}var v=[false,false,false,false,false,false,false];for(var d=a;d>=n;d--){if(t._show[d]){if(t._periods[d]){v[d]=true}else{v[d]=h>0;h--}}}var m=t.options.compact?t.options.compactLabels:t.options.labels;var g=t.options.whichLabels||this._normalLabels;var y=function(e){var n=t.options["compactLabels"+g(t._periods[e])];return p[e]?f._translateDigits(t,t._periods[e])+(n?n[e]:m[e])+" ":""};var b=function(e){var n=t.options["labels"+g(t._periods[e])];if(!x&&p[e]||x&&v[e]){var r="";if(t._periods[e].toString().length==1){r='<span class="countdown_amount">'+0+"</span>"+'<span class="countdown_amount">'+t._periods[e]+"</span>"}else{for(var i=0;i<t._periods[e].toString().length;i++){r+='<span class="countdown_amount">'+t._periods[e].toString().charAt(i)+"</span>"}}return'<span class="countdown_section">'+r+'<span class="countdown_txt">'+(n?n[e]:m[e])+"</span></span>"}else{return""}};var w=t.options.layout;var E=t.options.compact;var x=t.options.significant;var T=t.options.description;return w?this._buildLayout(t,p,w,E,x,v):(E?'<span class="countdown_row countdown_amount'+(t._hold?" countdown_holding":"")+'">'+y(n)+y(r)+y(i)+y(s)+(p[o]?this._minDigits(t._periods[o],2):"")+(p[u]?(p[o]?timeSeparator:"")+this._minDigits(t._periods[u],2):"")+(p[a]?(p[o]||p[u]?timeSeparator:"")+this._minDigits(t._periods[a],2):""):'<span class="countdown_row countdown_show'+(x||c)+(t._hold?" countdown_holding":"")+'">'+b(n)+b(r)+b(i)+b(s)+b(o)+b(u)+'<span id="uji_sec">'+b(a))+"</span>"+"</span>"+(T?'<span class="countdown_row countdown_descr">'+T+"</span>":"")},_buildLayout:function(t,f,l,c,h,p){var d=t.options[c?"compactLabels":"labels"];var v=t.options.whichLabels||this._normalLabels;var m=function(e){return(t.options[(c?"compactLabels":"labels")+v(t._periods[e])]||d)[e]};var g=function(e,n){return t.options.digits[Math.floor(e/n)%10]};var y={desc:t.options.description,sep:t.options.timeSeparator,yl:m(n),yn:this._minDigits(t,t._periods[n],1),ynn:this._minDigits(t,t._periods[n],2),ynnn:this._minDigits(t,t._periods[n],3),y1:g(t._periods[n],1),y10:g(t._periods[n],10),y100:g(t._periods[n],100),y1000:g(t._periods[n],1e3),ol:m(r),on:this._minDigits(t,t._periods[r],1),onn:this._minDigits(t,t._periods[r],2),onnn:this._minDigits(t,t._periods[r],3),o1:g(t._periods[r],1),o10:g(t._periods[r],10),o100:g(t._periods[r],100),o1000:g(t._periods[r],1e3),wl:m(i),wn:this._minDigits(t,t._periods[i],1),wnn:this._minDigits(t,t._periods[i],2),wnnn:this._minDigits(t,t._periods[i],3),w1:g(t._periods[i],1),w10:g(t._periods[i],10),w100:g(t._periods[i],100),w1000:g(t._periods[i],1e3),dl:m(s),dn:this._minDigits(t,t._periods[s],1),dnn:this._minDigits(t,t._periods[s],2),dnnn:this._minDigits(t,t._periods[s],3),d1:g(t._periods[s],1),d10:g(t._periods[s],10),d100:g(t._periods[s],100),d1000:g(t._periods[s],1e3),hl:m(o),hn:this._minDigits(t,t._periods[o],1),hnn:this._minDigits(t,t._periods[o],2),hnnn:this._minDigits(t,t._periods[o],3),h1:g(t._periods[o],1),h10:g(t._periods[o],10),h100:g(t._periods[o],100),h1000:g(t._periods[o],1e3),ml:m(u),mn:this._minDigits(t,t._periods[u],1),mnn:this._minDigits(t,t._periods[u],2),mnnn:this._minDigits(t,t._periods[u],3),m1:g(t._periods[u],1),m10:g(t._periods[u],10),m100:g(t._periods[u],100),m1000:g(t._periods[u],1e3),sl:m(a),sn:this._minDigits(t,t._periods[a],1),snn:this._minDigits(t,t._periods[a],2),snnn:this._minDigits(t,t._periods[a],3),s1:g(t._periods[a],1),s10:g(t._periods[a],10),s100:g(t._periods[a],100),s1000:g(t._periods[a],1e3)};var b=l;for(var w=n;w<=a;w++){var E="yowdhms".charAt(w);var x=new RegExp("\\{"+E+"<\\}([\\s\\S]*)\\{"+E+">\\}","g");b=b.replace(x,!h&&f[w]||h&&p[w]?"$1":"")}e.each(y,function(e,t){var n=new RegExp("\\{"+e+"\\}","g");b=b.replace(n,t)});return b},_minDigits:function(e,t,n){t=""+t;if(t.length>=n){return this._translateDigits(e,t)}t="0000000000"+t;return this._translateDigits(e,t.substr(t.length-n))},_translateDigits:function(e,t){return(""+t).replace(/[0-9]/g,function(t){return e.options.digits[t]})},_determineShow:function(e){var t=e.options.format;var f=[];f[n]=t.match("y")?"?":t.match("Y")?"!":null;f[r]=t.match("o")?"?":t.match("O")?"!":null;f[i]=t.match("w")?"?":t.match("W")?"!":null;f[s]=t.match("d")?"?":t.match("D")?"!":null;f[o]=t.match("h")?"?":t.match("H")?"!":null;f[u]=t.match("m")?"?":t.match("M")?"!":null;f[a]=t.match("s")?"?":t.match("S")?"!":null;return f},_calculatePeriods:function(e,t,f,l){e._now=l;e._now.setMilliseconds(0);var h=new Date(e._now.getTime());if(e._since){if(l.getTime()<e._since.getTime()){e._now=l=h}else{l=e._since}}else{h.setTime(e._until.getTime());if(l.getTime()>e._until.getTime()){e._now=l=h}}var p=[0,0,0,0,0,0,0];if(t[n]||t[r]){var d=c._getDaysInMonth(l.getFullYear(),l.getMonth());var v=c._getDaysInMonth(h.getFullYear(),h.getMonth());var m=h.getDate()==l.getDate()||h.getDate()>=Math.min(d,v)&&l.getDate()>=Math.min(d,v);var g=function(e){return(e.getHours()*60+e.getMinutes())*60+e.getSeconds()};var y=Math.max(0,(h.getFullYear()-l.getFullYear())*12+h.getMonth()-l.getMonth()+(h.getDate()<l.getDate()&&!m||m&&g(h)<g(l)?-1:0));p[n]=t[n]?Math.floor(y/12):0;p[r]=t[r]?y-p[n]*12:0;l=new Date(l.getTime());var b=l.getDate()==d;var w=c._getDaysInMonth(l.getFullYear()+p[n],l.getMonth()+p[r]);if(l.getDate()>w){l.setDate(w)}l.setFullYear(l.getFullYear()+p[n]);l.setMonth(l.getMonth()+p[r]);if(b){l.setDate(w)}}var E=Math.floor((h.getTime()-l.getTime())/1e3);var x=function(e,n){p[e]=t[e]?Math.floor(E/n):0;E-=p[e]*n};x(i,604800);x(s,86400);x(o,3600);x(u,60);x(a,1);if(E>0&&!e._since){var T=[1,12,4.3482,7,24,60,60];var N=a;var C=1;for(var k=a;k>=n;k--){if(t[k]){if(p[N]>=C){p[N]=0;E=1}if(E>0){p[k]++;E=0;N=k;C=1}}C*=T[k]}}if(f){for(var k=n;k<=a;k++){if(f&&p[k]){f--}else if(!f){p[k]=0}}}return p}});var f=["getTimes"];e.fn.countdown=function(e){var t=Array.prototype.slice.call(arguments,1);if(l(e,t)){return c["_"+e+"Plugin"].apply(c,[this[0]].concat(t))}return this.each(function(){if(typeof e=="string"){if(!c["_"+e+"Plugin"]){throw"Unknown command: "+e}c["_"+e+"Plugin"].apply(c,[this].concat(t))}else{c._attachPlugin(this,e||{})}})};var c=e.countdown=new t})(jQuery)
js/prev.countdown.js CHANGED
@@ -19,12 +19,16 @@ function init(){
19
  /*-----box color---*/
20
  var color_down = jQuery( '#ujic_col_dw' ).val();
21
  var color_up = jQuery( '#ujic_col_up' ).val();
22
- jQuery( '.countdown_amount').css("background-image", "linear-gradient(bottom, "+color_down+" 50%, "+color_up+" 50%)");
23
- jQuery( '.countdown_amount').css("background-image", "-o-linear-gradient(bottom, "+color_down+" 50%, "+color_up+" 50%)");
24
- jQuery( '.countdown_amount').css("background-image", "-moz-linear-gradient(bottom, "+color_down+" 50%, "+color_up+" 50%)");
25
- jQuery( '.countdown_amount').css("background-image", "-webkit-linear-gradient(bottom, "+color_down+" 50%, "+color_up+" 50%)");
26
- jQuery( '.countdown_amount').css("background-image", "-ms-linear-gradient(bottom, "+color_down+" 50%, "+color_up+" 50%)");
27
- jQuery( '.countdown_amount').css("filter", "progid:DXImageTransform.Microsoft.Gradient(startColorstr='"+color_down+"', endColorstr='"+color_up+"')");
 
 
 
 
28
  /*-----text color---*/
29
  var color_txt = jQuery( '#ujic_col_txt' ).val();
30
  var color_sw = jQuery( '#ujic_col_sw' ).val();
19
  /*-----box color---*/
20
  var color_down = jQuery( '#ujic_col_dw' ).val();
21
  var color_up = jQuery( '#ujic_col_up' ).val();
22
+
23
+
24
+ jQuery( '.countdown_amount').css("background", "-moz-linear-gradient(top, "+color_up+" 50%, "+color_down+" 50%)"); /* FF3.6+ */
25
+ jQuery( '.countdown_amount').css("background: -webkit-gradient(linear, left top, left bottom, color-stop(50%,"+color_up+"), color-stop(50%,"+color_down+"))"); /* Chrome,Safari4+ */
26
+ jQuery( '.countdown_amount').css("background", "-webkit-linear-gradient(top, "+color_up+" 50%,"+color_down+" 50%)"); /* Chrome10+,Safari5.1+ */
27
+ jQuery( '.countdown_amount').css("background", "-o-linear-gradient(top, "+color_up+" 50%,"+color_down+" 50%)"); /* Opera 11.10+ */
28
+ jQuery( '.countdown_amount').css("background", "-ms-linear-gradient(top, "+color_up+" 50%,"+color_down+" 50%)"); /* IE10+ */
29
+ jQuery( '.countdown_amount').css("background", "linear-gradient(to bottom, "+color_up+" 50%,"+color_down+" 50%)"); /* W3C */
30
+ jQuery( '.countdown_amount').css("filter", "progid:DXImageTransform.Microsoft.gradient( startColorstr='"+color_up+"', endColorstr='"+color_down+"',GradientType=0 )"); /* IE6-9 */
31
+
32
  /*-----text color---*/
33
  var color_txt = jQuery( '#ujic_col_txt' ).val();
34
  var color_sw = jQuery( '#ujic_col_sw' ).val();
js/serverTime.php CHANGED
File without changes
languages/uji-countdown-en_EN.mo CHANGED
File without changes
languages/uji-countdown-en_EN.po CHANGED
File without changes
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: ujimoto
3
  Donate link: http://wpmanage.com/Uji-countdown
4
  Tags: countdown, counter, html5 countdown, animated countdown, countdown timer, count down, countdown clock, jQuery countdown, clock, timer
5
  Requires at least: 3.0
6
- Tested up to: 3.8
7
- Stable tag: 1.3.2
8
 
9
  Uji Countdown - HTML5 Customizable Countdown Timer
10
 
@@ -45,7 +45,11 @@ WPmanage [(http://www.wpmanage.com/uji-countdown/)](http://www.wpmanage.com/uji-
45
  2. Place your Countdown in Post/Page via Edit: Post or Page.
46
  3. Front-end view
47
 
48
- == Changelog ==
 
 
 
 
49
 
50
  = 1.3.2 =
51
 
3
  Donate link: http://wpmanage.com/Uji-countdown
4
  Tags: countdown, counter, html5 countdown, animated countdown, countdown timer, count down, countdown clock, jQuery countdown, clock, timer
5
  Requires at least: 3.0
6
+ Tested up to: 3.9
7
+ Stable tag: 1.3.3
8
 
9
  Uji Countdown - HTML5 Customizable Countdown Timer
10
 
45
  2. Place your Countdown in Post/Page via Edit: Post or Page.
46
  3. Front-end view
47
 
48
+ == Changelog ==
49
+
50
+ = 1.3.3 =
51
+ * Important Fix: WP 3.9 color picker compatibility with jquery 1.10+
52
+ * Important Fix: WP 3.9 compatibility
53
 
54
  = 1.3.2 =
55
 
screenshot-1.png CHANGED
File without changes
screenshot-2.png CHANGED
File without changes
screenshot-3.png CHANGED
File without changes
uji-countdown-add.php CHANGED
File without changes
uji-countdown-front.php CHANGED
File without changes
uji-countdown-widget.php CHANGED
File without changes
uji-countdown.php CHANGED
@@ -3,11 +3,11 @@
3
  Plugin Name: Uji Countdown
4
  Plugin URI: http://www.wpmanage.com/uji-countdown/
5
  Description: HTML5 Countdown.
6
- Version: 1.3.2
7
  Author: Ujog Raul
8
  Author URI: http://www.wpmanage.com
9
 
10
- Copyright (c) 2012-2013
11
  */
12
 
13
  if (!defined('UJI_PLUGIN_NAME'))
@@ -29,7 +29,7 @@ if (!defined('UJI_VERSION_KEY'))
29
  define('UJI_VERSION_KEY', 'UJI_version');
30
 
31
  if (!defined('UJI_VERSION_NUM'))
32
- define('UJI_VERSION_NUM', '1.1');
33
 
34
  ///////////////////////////////////DB///////////////////////////////////////
35
 
3
  Plugin Name: Uji Countdown
4
  Plugin URI: http://www.wpmanage.com/uji-countdown/
5
  Description: HTML5 Countdown.
6
+ Version: 1.3.3
7
  Author: Ujog Raul
8
  Author URI: http://www.wpmanage.com
9
 
10
+ Copyright (c) 2012-2014
11
  */
12
 
13
  if (!defined('UJI_PLUGIN_NAME'))
29
  define('UJI_VERSION_KEY', 'UJI_version');
30
 
31
  if (!defined('UJI_VERSION_NUM'))
32
+ define('UJI_VERSION_NUM', '1.3');
33
 
34
  ///////////////////////////////////DB///////////////////////////////////////
35