[LON-CAPA-cvs] cvs: loncom /html/adm/countdown jquery.countdown-ar.js jquery.countdown-bg.js jquery.countdown-bn.js jquery.countdown-ca.js jquery.countdown-cs.js jquery.countdown-da.js jquery.countdown-de.js jquery.countdown-el.js jquery.countdown-es.js jquery.countdown-et.js jquery.countdown-fa.js jquery.countdown-fi.js jquery.countdown-fr.js jquery.countdown-gl.js jquery.countdown-he.js jquery.countdown-hr.js jquery.countdown-hu.js jquery.countdown-id.js jquery.countdown-it.js jquery.countdown-ja.js jquery.countdown-ko.js jquery.countdown-lt.js jquery.countdown-lv.js jquery.countdown-ms.js jquery.countdown-my.js jquery.countdown-nb.js jquery.countdown-nl.js jquery.countdown-pl.js jquery.countdown-pt-BR.js jquery.countdown-ro.js jquery.countdown-ru.js jquery.countdown-sk.js jquery.countdown-sl.js jquery.countdown-sr-SR.js jquery.countdown-sr.js jquery.countdown-sv.js jquery.countdown-th.js jquery.countdown-tr.js jquery.countdown-uk.js jquery.countdown-vi.js jquery.countdown-zh-CN!.js jquery.countdown-zh-TW.js jquery.countdown.css jquery.countdown.js jquery.countdown.min.js
raeburn
raeburn at source.lon-capa.org
Wed Jan 15 09:45:12 EST 2014
raeburn Wed Jan 15 14:45:12 2014 EDT
Modified files:
/loncom/html/adm/countdown jquery.countdown-ar.js
jquery.countdown-bg.js
jquery.countdown-bn.js
jquery.countdown-ca.js
jquery.countdown-cs.js
jquery.countdown-da.js
jquery.countdown-de.js
jquery.countdown-el.js
jquery.countdown-es.js
jquery.countdown-et.js
jquery.countdown-fa.js
jquery.countdown-fi.js
jquery.countdown-fr.js
jquery.countdown-gl.js
jquery.countdown-he.js
jquery.countdown-hr.js
jquery.countdown-hu.js
jquery.countdown-id.js
jquery.countdown-it.js
jquery.countdown-ja.js
jquery.countdown-ko.js
jquery.countdown-lt.js
jquery.countdown-lv.js
jquery.countdown-ms.js
jquery.countdown-my.js
jquery.countdown-nb.js
jquery.countdown-nl.js
jquery.countdown-pl.js
jquery.countdown-pt-BR.js
jquery.countdown-ro.js
jquery.countdown-ru.js
jquery.countdown-sk.js
jquery.countdown-sl.js
jquery.countdown-sr-SR.js
jquery.countdown-sr.js
jquery.countdown-sv.js
jquery.countdown-th.js
jquery.countdown-tr.js
jquery.countdown-uk.js
jquery.countdown-vi.js
jquery.countdown-zh-CN.js
jquery.countdown-zh-TW.js
jquery.countdown.css jquery.countdown.js
jquery.countdown.min.js
Log:
- Update jquery.countdown to 1.6.3
-------------- next part --------------
Index: loncom/html/adm/countdown/jquery.countdown-ar.js
diff -u loncom/html/adm/countdown/jquery.countdown-ar.js:1.1 loncom/html/adm/countdown/jquery.countdown-ar.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-ar.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-ar.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['سÙØ©','Ø´Ùر','أسبÙع','ÙÙÙ
','ساعة','دÙÙÙØ©','ثاÙÙØ©'],
compactLabels: ['س', 'Ø´', 'Ø£', 'Ù'],
whichLabels: null,
+ digits: ['Ù ', 'Ù¡', 'Ù¢', 'Ù£', 'Ù¤', 'Ù¥', 'Ù¦', 'Ù§', 'Ù¨', 'Ù©'],
timeSeparator: ':', isRTL: true};
$.countdown.setDefaults($.countdown.regional['ar']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-bg.js
diff -u loncom/html/adm/countdown/jquery.countdown-bg.js:1.1 loncom/html/adm/countdown/jquery.countdown-bg.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-bg.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-bg.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Ðодина', 'ÐеÑеÑ', 'СедмиÑа', 'Ðен', 'ЧаÑ', 'ÐинÑÑа', 'СекÑнда'],
compactLabels: ['l', 'm', 'n', 'd'], compactLabels1: ['g', 'm', 'n', 'd'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['bg']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-bn.js
Index: loncom/html/adm/countdown/jquery.countdown-ca.js
diff -u loncom/html/adm/countdown/jquery.countdown-ca.js:1.1 loncom/html/adm/countdown/jquery.countdown-ca.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-ca.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-ca.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Anys', 'Mesos', 'Setmanes', 'Dies', 'Hores', 'Minuts', 'Segons'],
compactLabels: ['a', 'm', 's', 'g'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['ca']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-cs.js
diff -u loncom/html/adm/countdown/jquery.countdown-cs.js:1.1 loncom/html/adm/countdown/jquery.countdown-cs.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-cs.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-cs.js Wed Jan 15 14:45:11 2014
@@ -10,6 +10,7 @@
whichLabels: function(amount) {
return (amount == 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
},
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['cs']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-da.js
diff -u loncom/html/adm/countdown/jquery.countdown-da.js:1.1 loncom/html/adm/countdown/jquery.countdown-da.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-da.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-da.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Ã
r', 'MÃ¥nad', 'Uge', 'Dag', 'Time', 'Minut', 'Sekund'],
compactLabels: ['Ã
', 'M', 'U', 'D'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['da']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-de.js
diff -u loncom/html/adm/countdown/jquery.countdown-de.js:1.1 loncom/html/adm/countdown/jquery.countdown-de.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-de.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-de.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Jahr', 'Monat', 'Woche', 'Tag', 'Stunde', 'Minute', 'Sekunde'],
compactLabels: ['J', 'M', 'W', 'T'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['de']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-el.js
diff -u loncom/html/adm/countdown/jquery.countdown-el.js:1.1 loncom/html/adm/countdown/jquery.countdown-el.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-el.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-el.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['ΧÏÏνοÏ', 'ÎήναÏ', 'Îβδομάδα', 'ÎμÎÏα', 'ÎÏα', 'ÎεÏÏÏ', 'ÎεÏ
ÏεÏÏλεÏÏο'],
compactLabels: ['ΧÏ.', 'Îην.', 'Îβδ.', 'Îμ.'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['el']);
})(jQuery);
\ No newline at end of file
Index: loncom/html/adm/countdown/jquery.countdown-es.js
diff -u loncom/html/adm/countdown/jquery.countdown-es.js:1.1 loncom/html/adm/countdown/jquery.countdown-es.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-es.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-es.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Año', 'Mes', 'Semana', 'DÃa', 'Hora', 'Minuto', 'Segundo'],
compactLabels: ['a', 'm', 's', 'g'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['es']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-et.js
diff -u loncom/html/adm/countdown/jquery.countdown-et.js:1.1 loncom/html/adm/countdown/jquery.countdown-et.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-et.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-et.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Aasta', 'Kuu', 'Nädal', 'Päev', 'Tund', 'Minut', 'Sekund'],
compactLabels: ['a', 'k', 'n', 'p'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['et']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-fa.js
diff -u loncom/html/adm/countdown/jquery.countdown-fa.js:1.1 loncom/html/adm/countdown/jquery.countdown-fa.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-fa.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-fa.js Wed Jan 15 14:45:11 2014
@@ -1,12 +1,14 @@
/* http://keith-wood.name/countdown.html
Persian (ÙارسÛ) initialisation for the jQuery countdown extension
- Written by Alireza Ziaie (ziai at magfa.com) Oct 2008. */
+ Written by Alireza Ziaie (ziai at magfa.com) Oct 2008.
+ Digits corrected by Hamed Ramezanian Feb 2013. */
(function($) {
$.countdown.regional['fa'] = {
labels: ['âساÙ', 'Ù
اÙ', 'ÙÙتÙ', 'رÙز', 'ساعت', 'دÙÛÙÙ', 'ثاÙÛÙ'],
labels1: ['ساÙ', 'Ù
اÙ', 'ÙÙتÙ', 'رÙز', 'ساعت', 'دÙÛÙÙ', 'ثاÙÛÙ'],
compactLabels: ['س', 'Ù
', 'Ù', 'ر'],
whichLabels: null,
+ digits: ['Û°', 'Û±', 'Û²', 'Û³', 'Û´', 'Ûµ', 'Û¶', 'Û·', 'Û¸', 'Û¹'],
timeSeparator: ':', isRTL: true};
$.countdown.setDefaults($.countdown.regional['fa']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-fi.js
diff -u loncom/html/adm/countdown/jquery.countdown-fi.js:1.1 loncom/html/adm/countdown/jquery.countdown-fi.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-fi.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-fi.js Wed Jan 15 14:45:11 2014
@@ -1,12 +1,13 @@
/* http://keith-wood.name/countdown.html
Finnish initialisation for the jQuery countdown extension
- Written by Kalle Vänskä and Juha Suni (juhis.suni at gmail.com). */
+ Written by Kalle Vänskä and Juha Suni (juhis.suni at gmail.com). Corrected by Olli. */
(function($) {
$.countdown.regional['fi'] = {
- labels: ['Vuotta', 'Kuukautta', 'Viikkoa', 'Päivää', 'Tuntia', 'Minuuttia', 'Sekuntia'],
- labels1: ['Vuosi', 'Kuukausi', 'Viikko', 'Päivä', 'Tunti', 'Minuutti', 'Sekunti'],
+ labels: ['vuotta', 'kuukautta', 'viikkoa', 'päivää', 'tuntia', 'minuuttia', 'sekuntia'],
+ labels1: ['vuosi', 'kuukausi', 'viikko', 'päivä', 'tunti', 'minuutti', 'sekunti'],
compactLabels: ['v', 'kk', 'vk', 'pv'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['fi']);
-})(jQuery);
+})(jQuery);
\ No newline at end of file
Index: loncom/html/adm/countdown/jquery.countdown-fr.js
diff -u loncom/html/adm/countdown/jquery.countdown-fr.js:1.1 loncom/html/adm/countdown/jquery.countdown-fr.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-fr.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-fr.js Wed Jan 15 14:45:11 2014
@@ -6,7 +6,10 @@
labels: ['Années', 'Mois', 'Semaines', 'Jours', 'Heures', 'Minutes', 'Secondes'],
labels1: ['Année', 'Mois', 'Semaine', 'Jour', 'Heure', 'Minute', 'Seconde'],
compactLabels: ['a', 'm', 's', 'j'],
- whichLabels: null,
+ whichLabels: function(amount) {
+ return (amount > 1 ? 0 : 1);
+ },
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['fr']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-gl.js
diff -u loncom/html/adm/countdown/jquery.countdown-gl.js:1.1 loncom/html/adm/countdown/jquery.countdown-gl.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-gl.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-gl.js Wed Jan 15 14:45:11 2014
@@ -1,12 +1,13 @@
/* http://keith-wood.name/countdown.html
* Galician initialisation for the jQuery countdown extension
- * Written by Moncho Pena ramon.pena.rodriguez at gmail.com (2009) */
+ * Written by Moncho Pena ramon.pena.rodriguez at gmail.com (2009) and Angel Farrapeira */
(function($) {
$.countdown.regional['gl'] = {
labels: ['Anos', 'Meses', 'Semanas', 'DÃas', 'Horas', 'Minutos', 'Segundos'],
- labels1: ['Anos', 'Meses', 'Semanas', 'DÃas', 'Horas', 'Minutos', 'Segundos'],
+ labels1: ['Ano', 'Mes', 'Semana', 'DÃa', 'Hora', 'Minuto', 'Segundo'],
compactLabels: ['a', 'm', 's', 'g'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['gl']);
})(jQuery);
\ No newline at end of file
Index: loncom/html/adm/countdown/jquery.countdown-he.js
diff -u loncom/html/adm/countdown/jquery.countdown-he.js:1.1 loncom/html/adm/countdown/jquery.countdown-he.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-he.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-he.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['×©× ×', '×××ש', 'ש×××¢', '×××', 'שע×', '×ק×', '×©× ×××'],
compactLabels: ['×©× ', '×', 'ש×', '×'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: true};
$.countdown.setDefaults($.countdown.regional['he']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-hr.js
diff -u loncom/html/adm/countdown/jquery.countdown-hr.js:1.1 loncom/html/adm/countdown/jquery.countdown-hr.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-hr.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-hr.js Wed Jan 15 14:45:11 2014
@@ -10,6 +10,7 @@
whichLabels: function(amount) {
return (amount == 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
},
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['hr']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-hu.js
diff -u loncom/html/adm/countdown/jquery.countdown-hu.js:1.1 loncom/html/adm/countdown/jquery.countdown-hu.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-hu.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-hu.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Ãv', 'Hónap', 'Hét', 'Nap', 'Ãra', 'Perc', 'Másodperc'],
compactLabels: ['Ã', 'H', 'Hé', 'N'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['hu']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-id.js
diff -u loncom/html/adm/countdown/jquery.countdown-id.js:1.1 loncom/html/adm/countdown/jquery.countdown-id.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-id.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-id.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['tahun', 'bulan', 'minggu', 'hari', 'jam', 'menit', 'detik'],
compactLabels: ['t', 'b', 'm', 'h'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['id']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-it.js
diff -u loncom/html/adm/countdown/jquery.countdown-it.js:1.1 loncom/html/adm/countdown/jquery.countdown-it.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-it.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-it.js Wed Jan 15 14:45:11 2014
@@ -1,12 +1,13 @@
/* http://keith-wood.name/countdown.html
* Italian initialisation for the jQuery countdown extension
- * Written by Davide Bellettini (davide.bellettini at gmail.com) Feb 2008. */
+ * Written by Davide Bellettini (davide.bellettini at gmail.com) and Roberto Chiaveri Feb 2008. */
(function($) {
$.countdown.regional['it'] = {
labels: ['Anni', 'Mesi', 'Settimane', 'Giorni', 'Ore', 'Minuti', 'Secondi'],
- labels1: ['Anni', 'Mesi', 'Settimane', 'Giorni', 'Ore', 'Minuti', 'Secondi'],
+ labels1: ['Anno', 'Mese', 'Settimana', 'Giorno', 'Ora', 'Minuto', 'Secondo'],
compactLabels: ['a', 'm', 's', 'g'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['it']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-ja.js
diff -u loncom/html/adm/countdown/jquery.countdown-ja.js:1.1 loncom/html/adm/countdown/jquery.countdown-ja.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-ja.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-ja.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['å¹´', 'æ', 'é±', 'æ¥', 'æ', 'å', 'ç§'],
compactLabels: ['å¹´', 'æ', 'é±', 'æ¥'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['ja']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-ko.js
diff -u loncom/html/adm/countdown/jquery.countdown-ko.js:1.1 loncom/html/adm/countdown/jquery.countdown-ko.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-ko.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-ko.js Wed Jan 15 14:45:11 2014
@@ -1,4 +1,4 @@
-/* http://keith-wood.name/countdown.html
+/* http://keith-wood.name/countdown.html
Korean initialisation for the jQuery countdown extension
Written by Ryan Yu (ryanyu79 at gmail.com). */
(function($) {
@@ -8,6 +8,7 @@
compactLabels: ['ë
', 'ì', '주', 'ì¼'],
compactLabels1: ['ë
', 'ì', '주', 'ì¼'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['ko']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-lt.js
diff -u loncom/html/adm/countdown/jquery.countdown-lt.js:1.1 loncom/html/adm/countdown/jquery.countdown-lt.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-lt.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-lt.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Metai', 'MÄnuo', 'SavaitÄ', 'Diena', 'Valanda', 'MinutÄ', 'SekundÄ'],
compactLabels: ['m', 'm', 's', 'd'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['lt']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-lv.js
diff -u loncom/html/adm/countdown/jquery.countdown-lv.js:1.1 loncom/html/adm/countdown/jquery.countdown-lv.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-lv.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-lv.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Gads', 'MÄnesis', 'NedÄļa', 'Diena', 'Stunda', 'MinÅ«te', 'Sekunde'],
compactLabels: ['l', 'm', 'n', 'd'], compactLabels1: ['g', 'm', 'n', 'd'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['lv']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-ms.js
diff -u loncom/html/adm/countdown/jquery.countdown-ms.js:1.1 loncom/html/adm/countdown/jquery.countdown-ms.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-ms.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-ms.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Tahun', 'Bulan', 'Minggu', 'Hari', 'Jam', 'Minit', 'Saat'],
compactLabels: ['t', 'b', 'm', 'h'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['ms']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-my.js
diff -u loncom/html/adm/countdown/jquery.countdown-my.js:1.1 loncom/html/adm/countdown/jquery.countdown-my.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-my.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-my.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['áá½á
á¹', 'á', 'ááá¹ááá¿áááá¹', 'ááá¹', 'áá¬áá®', 'áááá
á¹', 'á
áá¿ááá¹á·'],
compactLabels: ['áá½á
á¹', 'á', 'ááá¹ááá¿áááá¹', 'ááá¹'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['my']);
})(jQuery);
\ No newline at end of file
Index: loncom/html/adm/countdown/jquery.countdown-nb.js
diff -u loncom/html/adm/countdown/jquery.countdown-nb.js:1.1 loncom/html/adm/countdown/jquery.countdown-nb.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-nb.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-nb.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Ã
r', 'MÃ¥ned', 'Uke', 'Dag', 'Time', 'Minutt', 'Sekund'],
compactLabels: ['Ã
', 'M', 'U', 'D'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['nb']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-nl.js
diff -u loncom/html/adm/countdown/jquery.countdown-nl.js:1.1 loncom/html/adm/countdown/jquery.countdown-nl.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-nl.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-nl.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Jaar', 'Maand', 'Week', 'Dag', 'Uur', 'Minuut', 'Seconde'],
compactLabels: ['j', 'm', 'w', 'd'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['nl']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-pl.js
diff -u loncom/html/adm/countdown/jquery.countdown-pl.js:1.1 loncom/html/adm/countdown/jquery.countdown-pl.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-pl.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-pl.js Wed Jan 15 14:45:11 2014
@@ -12,6 +12,7 @@
var tens = Math.floor((amount % 100) / 10);
return (amount == 1 ? 1 : (units >= 2 && units <= 4 && tens != 1 ? 2 : 0));
},
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['pl']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-pt-BR.js
diff -u loncom/html/adm/countdown/jquery.countdown-pt-BR.js:1.1 loncom/html/adm/countdown/jquery.countdown-pt-BR.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-pt-BR.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-pt-BR.js Wed Jan 15 14:45:11 2014
@@ -1,12 +1,14 @@
/* http://keith-wood.name/countdown.html
Brazilian initialisation for the jQuery countdown extension
- Translated by Marcelo Pellicano de Oliveira (pellicano at gmail.com) Feb 2008. */
+ Translated by Marcelo Pellicano de Oliveira (pellicano at gmail.com) Feb 2008.
+ and Juan Roldan (juan.roldan[at]relayweb.com.br) Mar 2012. */
(function($) {
$.countdown.regional['pt-BR'] = {
labels: ['Anos', 'Meses', 'Semanas', 'Dias', 'Horas', 'Minutos', 'Segundos'],
- labels1: ['Anos', 'Meses', 'Semanas', 'Dias', 'Horas', 'Minutos', 'Segundos'],
+ labels1: ['Ano', 'Mês', 'Semana', 'Dia', 'Hora', 'Minuto', 'Segundo'],
compactLabels: ['a', 'm', 's', 'd'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['pt-BR']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-ro.js
diff -u loncom/html/adm/countdown/jquery.countdown-ro.js:1.1 loncom/html/adm/countdown/jquery.countdown-ro.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-ro.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-ro.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['An', 'Luna', 'Saptamana', 'Ziua', 'Ora', 'Minutul', 'Secunda'],
compactLabels: ['A', 'L', 'S', 'Z'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['ro']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-ru.js
diff -u loncom/html/adm/countdown/jquery.countdown-ru.js:1.1 loncom/html/adm/countdown/jquery.countdown-ru.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-ru.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-ru.js Wed Jan 15 14:45:11 2014
@@ -6,13 +6,14 @@
labels: ['ÐеÑ', 'ÐеÑÑÑев', 'ÐеделÑ', 'Ðней', 'ЧаÑов', 'ÐинÑÑ', 'СекÑнд'],
labels1: ['Ðод', 'ÐеÑÑÑ', 'ÐеделÑ', 'ÐенÑ', 'ЧаÑ', 'ÐинÑÑа', 'СекÑнда'],
labels2: ['Ðода', 'ÐеÑÑÑа', 'Ðедели', 'ÐнÑ', 'ЧаÑа', 'ÐинÑÑÑ', 'СекÑндÑ'],
- compactLabels: ['l', 'm', 't', 'd'], compactLabels1: ['r', 'm', 't', 'd'],
+ compactLabels: ['л', 'м', 'н', 'д'], compactLabels1: ['г', 'м', 'н', 'д'],
whichLabels: function(amount) {
var units = amount % 10;
var tens = Math.floor((amount % 100) / 10);
return (amount == 1 ? 1 : (units >= 2 && units <= 4 && tens != 1 ? 2 :
(units == 1 && tens != 1 ? 1 : 0)));
},
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['ru']);
})(jQuery);
\ No newline at end of file
Index: loncom/html/adm/countdown/jquery.countdown-sk.js
diff -u loncom/html/adm/countdown/jquery.countdown-sk.js:1.1 loncom/html/adm/countdown/jquery.countdown-sk.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-sk.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-sk.js Wed Jan 15 14:45:11 2014
@@ -10,6 +10,7 @@
whichLabels: function(amount) {
return (amount == 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
},
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['sk']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-sl.js
diff -u loncom/html/adm/countdown/jquery.countdown-sl.js:1.1 loncom/html/adm/countdown/jquery.countdown-sl.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-sl.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-sl.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Leto', 'Mesec', 'Teden', 'Dan', 'Ura', 'Minuta', 'Sekunda'],
compactLabels: ['l', 'm', 't', 'd'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['sl']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-sr-SR.js
diff -u loncom/html/adm/countdown/jquery.countdown-sr-SR.js:1.1 loncom/html/adm/countdown/jquery.countdown-sr-SR.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-sr-SR.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-sr-SR.js Wed Jan 15 14:45:11 2014
@@ -10,6 +10,7 @@
whichLabels: function(amount) {
return (amount == 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
},
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['sr-SR']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-sr.js
diff -u loncom/html/adm/countdown/jquery.countdown-sr.js:1.1 loncom/html/adm/countdown/jquery.countdown-sr.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-sr.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-sr.js Wed Jan 15 14:45:11 2014
@@ -10,6 +10,7 @@
whichLabels: function(amount) {
return (amount == 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
},
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['sr']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-sv.js
diff -u loncom/html/adm/countdown/jquery.countdown-sv.js:1.1 loncom/html/adm/countdown/jquery.countdown-sv.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-sv.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-sv.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Ã
r', 'MÃ¥nad', 'Vecka', 'Dag', 'Timme', 'Minut', 'Sekund'],
compactLabels: ['Ã
', 'M', 'V', 'D'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['sv']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-th.js
diff -u loncom/html/adm/countdown/jquery.countdown-th.js:1.1 loncom/html/adm/countdown/jquery.countdown-th.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-th.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-th.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['à¸à¸µ', 'à¹à¸à¸·à¸à¸', 'สัà¸à¸à¸²à¸«à¹', 'วัà¸', 'à¸à¸±à¹à¸§à¹à¸¡à¸', 'à¸à¸²à¸à¸µ', 'วิà¸à¸²à¸à¸µ'],
compactLabels: ['à¸à¸µ', 'à¹à¸à¸·à¸à¸', 'สัà¸à¸à¸²à¸«à¹', 'วัà¸'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['th']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-tr.js
diff -u loncom/html/adm/countdown/jquery.countdown-tr.js:1.1 loncom/html/adm/countdown/jquery.countdown-tr.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-tr.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-tr.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['Yıl', 'Ay', 'Hafta', 'Gün', 'Saat', 'Dakika', 'Saniye'],
compactLabels: ['y', 'a', 'h', 'g'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['tr']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-uk.js
diff -u loncom/html/adm/countdown/jquery.countdown-uk.js:1.1 loncom/html/adm/countdown/jquery.countdown-uk.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-uk.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-uk.js Wed Jan 15 14:45:11 2014
@@ -1,12 +1,16 @@
/* http://keith-wood.name/countdown.html
* Ukrainian initialisation for the jQuery countdown extension
- * Written by Goloborodko M misha.gm at gmail.com (2009) */
+ * Written by Goloborodko M misha.gm at gmail.com (2009), corrections by IÐ³Ð¾Ñ Kоновал */
(function($) {
$.countdown.regional['uk'] = {
- labels: ['РокÑв', 'ÐÑÑÑÑÑв', 'ТижднÑв', 'ÐнÑв', 'Ðодин', 'Хвилин', 'СекÑнд'],
+ labels: ['РокÑв', 'ÐÑÑÑÑÑв', 'ТижнÑв', 'ÐнÑв', 'Ðодин', 'Хвилин', 'СекÑнд'],
labels1: ['Ð Ñк', 'ÐÑÑÑÑÑ', 'ТижденÑ', 'ÐенÑ', 'Ðодина', 'Хвилина', 'СекÑнда'],
+ labels2: ['Роки', 'ÐÑÑÑÑÑ', 'ТижнÑ', 'ÐнÑ', 'Ðодини', 'Хвилини', 'СекÑнди'],
compactLabels: ['r', 'm', 't', 'd'],
- whichLabels: null,
+ whichLabels: function(amount) {
+ return (amount == 1 ? 1 : (amount >=2 && amount <= 4 ? 2 : 0));
+ },
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['uk']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-vi.js
diff -u loncom/html/adm/countdown/jquery.countdown-vi.js:1.1 loncom/html/adm/countdown/jquery.countdown-vi.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-vi.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-vi.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['NÄm', 'Tháng', 'Tuần', 'Ngà y', 'Giá»', 'Phút', 'Giây'],
compactLabels: ['nÄm', 'th', 'tu', 'ng'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['vi']);
})(jQuery);
\ No newline at end of file
Index: loncom/html/adm/countdown/jquery.countdown-zh-CN.js
diff -u loncom/html/adm/countdown/jquery.countdown-zh-CN.js:1.1 loncom/html/adm/countdown/jquery.countdown-zh-CN.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-zh-CN.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-zh-CN.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['å¹´', 'æ', 'å¨', '天', 'æ¶', 'å', 'ç§'],
compactLabels: ['å¹´', 'æ', 'å¨', '天'], compactLabels1: ['å¹´', 'æ', 'å¨', '天'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['zh-CN']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown-zh-TW.js
diff -u loncom/html/adm/countdown/jquery.countdown-zh-TW.js:1.1 loncom/html/adm/countdown/jquery.countdown-zh-TW.js:1.2
--- loncom/html/adm/countdown/jquery.countdown-zh-TW.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown-zh-TW.js Wed Jan 15 14:45:11 2014
@@ -7,6 +7,7 @@
labels1: ['å¹´', 'æ', 'å¨', '天', 'æ', 'å', 'ç§'],
compactLabels: ['å¹´', 'æ', 'å¨', '天'], compactLabels1: ['å¹´', 'æ', 'å¨', '天'],
whichLabels: null,
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
$.countdown.setDefaults($.countdown.regional['zh-TW']);
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown.css
diff -u loncom/html/adm/countdown/jquery.countdown.css:1.1 loncom/html/adm/countdown/jquery.countdown.css:1.2
--- loncom/html/adm/countdown/jquery.countdown.css:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown.css Wed Jan 15 14:45:11 2014
@@ -1,4 +1,4 @@
-/* jQuery Countdown styles 1.5.11. */
+/* jQuery Countdown styles 1.6.3. */
.hasCountdown {
border: 1px solid #ccc;
background-color: #eee;
@@ -7,7 +7,7 @@
direction: rtl;
}
.countdown_holding span {
- background-color: #ccc;
+ color: #888;
}
.countdown_row {
clear: both;
Index: loncom/html/adm/countdown/jquery.countdown.js
diff -u loncom/html/adm/countdown/jquery.countdown.js:1.1 loncom/html/adm/countdown/jquery.countdown.js:1.2
--- loncom/html/adm/countdown/jquery.countdown.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown.js Wed Jan 15 14:45:11 2014
@@ -1,8 +1,7 @@
/* http://keith-wood.name/countdown.html
- Countdown for jQuery v1.5.11.
+ Countdown for jQuery v1.6.3.
Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
+ Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license.
Please attribute the author if you use it. */
/* Display a countdown timer.
@@ -22,6 +21,7 @@
labels1: ['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second'],
compactLabels: ['y', 'm', 'w', 'd'], // The compact texts for the counters
whichLabels: null, // Function to determine which labels to use
+ digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], // The digits to display
timeSeparator: ':', // Separator for time periods
isRTL: false // True for right-to-left languages, false for left-to-right
};
@@ -53,30 +53,38 @@
};
$.extend(this._defaults, this.regional['']);
this._serverSyncs = [];
+ var now = (typeof Date.now == 'function' ? Date.now :
+ function() { return new Date().getTime(); });
+ var perfAvail = (window.performance && typeof window.performance.now == 'function');
// Shared timer for all countdowns
function timerCallBack(timestamp) {
- var drawStart = (timestamp || new Date().getTime());
+ var drawStart = (timestamp < 1e12 ? // New HTML5 high resolution timer
+ (perfAvail ? (performance.now() + performance.timing.navigationStart) : now()) :
+ // Integer milliseconds since unix epoch
+ timestamp || now());
if (drawStart - animationStartTime >= 1000) {
- $.countdown._updateTargets();
+ plugin._updateTargets();
animationStartTime = drawStart;
}
requestAnimationFrame(timerCallBack);
}
- var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame ||
- window.mozRequestAnimationFrame || window.oRequestAnimationFrame ||
- window.msRequestAnimationFrame || null; // this is when we expect a fall-back to setInterval as it's much more fluid
+ var requestAnimationFrame = window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame || window.msRequestAnimationFrame || null;
+ // This is when we expect a fall-back to setInterval as it's much more fluid
var animationStartTime = 0;
- if (!requestAnimationFrame) {
- setInterval(function() { $.countdown._updateTargets(); }, 980); // Fall back to good old setInterval
+ if (!requestAnimationFrame || $.noRequestAnimationFrame) {
+ $.noRequestAnimationFrame = null;
+ setInterval(function() { plugin._updateTargets(); }, 980); // Fall back to good old setInterval
}
else {
- animationStartTime = window.mozAnimationStartTime || new Date().getTime();
+ animationStartTime = window.animationStartTime ||
+ window.webkitAnimationStartTime || window.mozAnimationStartTime ||
+ window.oAnimationStartTime || window.msAnimationStartTime || now();
requestAnimationFrame(timerCallBack);
}
}
-var PROP_NAME = 'countdown';
-
var Y = 0; // Years
var O = 1; // Months
var W = 2; // Weeks
@@ -88,6 +96,23 @@
$.extend(Countdown.prototype, {
/* Class name added to elements to indicate already configured with countdown. */
markerClassName: 'hasCountdown',
+ /* Name of the data property for instance settings. */
+ propertyName: 'countdown',
+
+ /* Class name for the right-to-left marker. */
+ _rtlClass: 'countdown_rtl',
+ /* Class name for the countdown section marker. */
+ _sectionClass: 'countdown_section',
+ /* Class name for the period amount marker. */
+ _amountClass: 'countdown_amount',
+ /* Class name for the countdown row marker. */
+ _rowClass: 'countdown_row',
+ /* Class name for the holding countdown marker. */
+ _holdingClass: 'countdown_holding',
+ /* Class name for the showing countdown marker. */
+ _showClass: 'countdown_show',
+ /* Class name for the description marker. */
+ _descrClass: 'countdown_descr',
/* List of currently active countdown targets. */
_timerTargets: [],
@@ -96,7 +121,7 @@
@param options (object) the new settings to use as defaults */
setDefaults: function(options) {
this._resetExtraLabels(this._defaults, options);
- extendRemove(this._defaults, options || {});
+ $.extend(this._defaults, options || {});
},
/* Convert a date/time to UTC.
@@ -141,31 +166,17 @@
periods[3] * 86400 + periods[4] * 3600 + periods[5] * 60 + periods[6];
},
- /* Retrieve one or more settings values.
- @param name (string, optional) the name of the setting to retrieve
- or 'all' for all instance settings or omit for all default settings
- @return (any) the requested setting(s) */
- _settingsCountdown: function(target, name) {
- if (!name) {
- return $.countdown._defaults;
- }
- var inst = $.data(target, PROP_NAME);
- return (name == 'all' ? inst.options : inst.options[name]);
- },
-
/* Attach the countdown widget to a div.
@param target (element) the containing division
@param options (object) the initial settings for the countdown */
- _attachCountdown: function(target, options) {
- var $target = $(target);
- if ($target.hasClass(this.markerClassName)) {
+ _attachPlugin: function(target, options) {
+ target = $(target);
+ if (target.hasClass(this.markerClassName)) {
return;
}
- $target.addClass(this.markerClassName);
- var inst = {options: $.extend({}, options),
- _periods: [0, 0, 0, 0, 0, 0, 0]};
- $.data(target, PROP_NAME, inst);
- this._changeCountdown(target);
+ var inst = {options: $.extend({}, this._defaults), _periods: [0, 0, 0, 0, 0, 0, 0]};
+ target.addClass(this.markerClassName).data(this.propertyName, inst);
+ this._optionPlugin(target, options);
},
/* Add a target to the list of active ones.
@@ -197,24 +208,62 @@
}
},
+ /* Reconfigure the settings for a countdown div.
+ @param target (element) the control to affect
+ @param options (object) the new options for this instance or
+ (string) an individual property name
+ @param value (any) the individual property value (omit if options
+ is an object or to retrieve the value of a setting)
+ @return (any) if retrieving a value */
+ _optionPlugin: function(target, options, value) {
+ target = $(target);
+ var inst = target.data(this.propertyName);
+ if (!options || (typeof options == 'string' && value == null)) { // Get option
+ var name = options;
+ options = (inst || {}).options;
+ return (options && name ? options[name] : options);
+ }
+
+ if (!target.hasClass(this.markerClassName)) {
+ return;
+ }
+ options = options || {};
+ if (typeof options == 'string') {
+ var name = options;
+ options = {};
+ options[name] = value;
+ }
+ if (options.layout) {
+ options.layout = options.layout.replace(/</g, '<').replace(/>/g, '>');
+ }
+ this._resetExtraLabels(inst.options, options);
+ var timezoneChanged = (inst.options.timezone != options.timezone);
+ $.extend(inst.options, options);
+ this._adjustSettings(target, inst,
+ options.until != null || options.since != null || timezoneChanged);
+ var now = new Date();
+ if ((inst._since && inst._since < now) || (inst._until && inst._until > now)) {
+ this._addTarget(target[0]);
+ }
+ this._updateCountdown(target, inst);
+ },
+
/* Redisplay the countdown with an updated display.
@param target (jQuery) the containing division
@param inst (object) the current settings for this instance */
_updateCountdown: function(target, inst) {
var $target = $(target);
- inst = inst || $.data(target, PROP_NAME);
+ inst = inst || $target.data(this.propertyName);
if (!inst) {
return;
}
- $target.html(this._generateHTML(inst));
- $target[(this._get(inst, 'isRTL') ? 'add' : 'remove') + 'Class']('countdown_rtl');
- var onTick = this._get(inst, 'onTick');
- if (onTick) {
+ $target.html(this._generateHTML(inst)).toggleClass(this._rtlClass, inst.options.isRTL);
+ if ($.isFunction(inst.options.onTick)) {
var periods = inst._hold != 'lap' ? inst._periods :
- this._calculatePeriods(inst, inst._show, this._get(inst, 'significant'), new Date());
- var tickInterval = this._get(inst, 'tickInterval');
- if (tickInterval == 1 || this.periodsToSeconds(periods) % tickInterval == 0) {
- onTick.apply(target, [periods]);
+ this._calculatePeriods(inst, inst._show, inst.options.significant, new Date());
+ if (inst.options.tickInterval == 1 ||
+ this.periodsToSeconds(periods) % inst.options.tickInterval == 0) {
+ inst.options.onTick.apply(target, [periods]);
}
}
var expired = inst._hold != 'pause' &&
@@ -222,22 +271,19 @@
inst._now.getTime() >= inst._until.getTime());
if (expired && !inst._expiring) {
inst._expiring = true;
- if (this._hasTarget(target) || this._get(inst, 'alwaysExpire')) {
+ if (this._hasTarget(target) || inst.options.alwaysExpire) {
this._removeTarget(target);
- var onExpiry = this._get(inst, 'onExpiry');
- if (onExpiry) {
- onExpiry.apply(target, []);
- }
- var expiryText = this._get(inst, 'expiryText');
- if (expiryText) {
- var layout = this._get(inst, 'layout');
- inst.options.layout = expiryText;
+ if ($.isFunction(inst.options.onExpiry)) {
+ inst.options.onExpiry.apply(target, []);
+ }
+ if (inst.options.expiryText) {
+ var layout = inst.options.layout;
+ inst.options.layout = inst.options.expiryText;
this._updateCountdown(target, inst);
inst.options.layout = layout;
}
- var expiryUrl = this._get(inst, 'expiryUrl');
- if (expiryUrl) {
- window.location = expiryUrl;
+ if (inst.options.expiryUrl) {
+ window.location = inst.options.expiryUrl;
}
}
inst._expiring = false;
@@ -245,35 +291,7 @@
else if (inst._hold == 'pause') {
this._removeTarget(target);
}
- $.data(target, PROP_NAME, inst);
- },
-
- /* Reconfigure the settings for a countdown div.
- @param target (element) the containing division
- @param options (object) the new settings for the countdown or
- (string) an individual property name
- @param value (any) the individual property value
- (omit if options is an object) */
- _changeCountdown: function(target, options, value) {
- options = options || {};
- if (typeof options == 'string') {
- var name = options;
- options = {};
- options[name] = value;
- }
- var inst = $.data(target, PROP_NAME);
- if (inst) {
- this._resetExtraLabels(inst.options, options);
- extendRemove(inst.options, options);
- this._adjustSettings(target, inst);
- $.data(target, PROP_NAME, inst);
- var now = new Date();
- if ((inst._since && inst._since < now) ||
- (inst._until && inst._until > now)) {
- this._addTarget(target);
- }
- this._updateCountdown(target, inst);
- }
+ $target.data(this.propertyName, inst);
},
/* Reset any extra labelsn and compactLabelsn entries if changing labels.
@@ -289,7 +307,7 @@
}
if (changingLabels) {
for (var n in base) { // Remove custom numbered labels
- if (n.match(/[Ll]abels[0-9]/)) {
+ if (n.match(/[Ll]abels[02-9]|compactLabels1/)) {
base[n] = null;
}
}
@@ -298,73 +316,75 @@
/* Calculate interal settings for an instance.
@param target (element) the containing division
- @param inst (object) the current settings for this instance */
- _adjustSettings: function(target, inst) {
+ @param inst (object) the current settings for this instance
+ @param recalc (boolean) true if until or since are set */
+ _adjustSettings: function(target, inst, recalc) {
var now;
- var serverSync = this._get(inst, 'serverSync');
var serverOffset = 0;
var serverEntry = null;
for (var i = 0; i < this._serverSyncs.length; i++) {
- if (this._serverSyncs[i][0] == serverSync) {
+ if (this._serverSyncs[i][0] == inst.options.serverSync) {
serverEntry = this._serverSyncs[i][1];
break;
}
}
if (serverEntry != null) {
- serverOffset = (serverSync ? serverEntry : 0);
+ serverOffset = (inst.options.serverSync ? serverEntry : 0);
now = new Date();
}
else {
- var serverResult = (serverSync ? serverSync.apply(target, []) : null);
+ var serverResult = ($.isFunction(inst.options.serverSync) ?
+ inst.options.serverSync.apply(target, []) : null);
now = new Date();
serverOffset = (serverResult ? now.getTime() - serverResult.getTime() : 0);
- this._serverSyncs.push([serverSync, serverOffset]);
+ this._serverSyncs.push([inst.options.serverSync, serverOffset]);
}
- var timezone = this._get(inst, 'timezone');
+ var timezone = inst.options.timezone;
timezone = (timezone == null ? -now.getTimezoneOffset() : timezone);
- inst._since = this._get(inst, 'since');
- if (inst._since != null) {
- inst._since = this.UTCDate(timezone, this._determineTime(inst._since, null));
- if (inst._since && serverOffset) {
- inst._since.setMilliseconds(inst._since.getMilliseconds() + serverOffset);
+ if (recalc || (!recalc && inst._until == null && inst._since == null)) {
+ inst._since = inst.options.since;
+ if (inst._since != null) {
+ inst._since = this.UTCDate(timezone, this._determineTime(inst._since, null));
+ if (inst._since && serverOffset) {
+ inst._since.setMilliseconds(inst._since.getMilliseconds() + serverOffset);
+ }
+ }
+ inst._until = this.UTCDate(timezone, this._determineTime(inst.options.until, now));
+ if (serverOffset) {
+ inst._until.setMilliseconds(inst._until.getMilliseconds() + serverOffset);
}
- }
- inst._until = this.UTCDate(timezone, this._determineTime(this._get(inst, 'until'), now));
- if (serverOffset) {
- inst._until.setMilliseconds(inst._until.getMilliseconds() + serverOffset);
}
inst._show = this._determineShow(inst);
},
/* Remove the countdown widget from a div.
@param target (element) the containing division */
- _destroyCountdown: function(target) {
- var $target = $(target);
- if (!$target.hasClass(this.markerClassName)) {
+ _destroyPlugin: function(target) {
+ target = $(target);
+ if (!target.hasClass(this.markerClassName)) {
return;
}
- this._removeTarget(target);
- $target.removeClass(this.markerClassName).empty();
- $.removeData(target, PROP_NAME);
+ this._removeTarget(target[0]);
+ target.removeClass(this.markerClassName).empty().removeData(this.propertyName);
},
/* Pause a countdown widget at the current time.
Stop it running but remember and display the current time.
@param target (element) the containing division */
- _pauseCountdown: function(target) {
+ _pausePlugin: function(target) {
this._hold(target, 'pause');
},
/* Pause a countdown widget at the current time.
Stop the display but keep the countdown running.
@param target (element) the containing division */
- _lapCountdown: function(target) {
+ _lapPlugin: function(target) {
this._hold(target, 'lap');
},
/* Resume a paused countdown widget.
@param target (element) the containing division */
- _resumeCountdown: function(target) {
+ _resumePlugin: function(target) {
this._hold(target, null);
},
@@ -372,7 +392,7 @@
@param target (element) the containing division
@param hold (string) the new hold setting */
_hold: function(target, hold) {
- var inst = $.data(target, PROP_NAME);
+ var inst = $.data(target, this.propertyName);
if (inst) {
if (inst._hold == 'pause' && !hold) {
inst._periods = inst._savePeriods;
@@ -386,7 +406,7 @@
}
inst._hold = hold;
inst._savePeriods = (hold == 'pause' ? inst._periods : null);
- $.data(target, PROP_NAME, inst);
+ $.data(target, this.propertyName, inst);
this._updateCountdown(target, inst);
}
},
@@ -394,19 +414,10 @@
/* Return the current time periods.
@param target (element) the containing division
@return (number[7]) the current periods for the countdown */
- _getTimesCountdown: function(target) {
- var inst = $.data(target, PROP_NAME);
- return (!inst ? null : (!inst._hold ? inst._periods :
- this._calculatePeriods(inst, inst._show, this._get(inst, 'significant'), new Date())));
- },
-
- /* Get a setting value, defaulting if necessary.
- @param inst (object) the current settings for this instance
- @param name (string) the name of the required setting
- @return (any) the setting's value or a default if not overridden */
- _get: function(inst, name) {
- return (inst.options[name] != null ?
- inst.options[name] : $.countdown._defaults[name]);
+ _getTimesPlugin: function(target) {
+ var inst = $.data(target, this.propertyName);
+ return (!inst ? null : (inst._hold == 'pause' ? inst._savePeriods : (!inst._hold ? inst._periods :
+ this._calculatePeriods(inst, inst._show, inst.options.significant, new Date()))));
},
/* A time may be specified as an exact value or a relative one.
@@ -440,11 +451,11 @@
case 'w': day += parseInt(matches[1], 10) * 7; break;
case 'o':
month += parseInt(matches[1], 10);
- day = Math.min(day, $.countdown._getDaysInMonth(year, month));
+ day = Math.min(day, plugin._getDaysInMonth(year, month));
break;
case 'y':
year += parseInt(matches[1], 10);
- day = Math.min(day, $.countdown._getDaysInMonth(year, month));
+ day = Math.min(day, plugin._getDaysInMonth(year, month));
break;
}
matches = pattern.exec(offset);
@@ -477,14 +488,14 @@
@param inst (object) the current settings for this instance
@return (string) the new HTML for the countdown display */
_generateHTML: function(inst) {
+ var self = this;
// Determine what to show
- var significant = this._get(inst, 'significant');
inst._periods = (inst._hold ? inst._periods :
- this._calculatePeriods(inst, inst._show, significant, new Date()));
+ this._calculatePeriods(inst, inst._show, inst.options.significant, new Date()));
// Show all 'asNeeded' after first non-zero value
var shownNonZero = false;
var showCount = 0;
- var sigCount = significant;
+ var sigCount = inst.options.significant;
var show = $.extend({}, inst._show);
for (var period = Y; period <= S; period++) {
shownNonZero |= (inst._show[period] == '?' && inst._periods[period] > 0);
@@ -504,41 +515,40 @@
}
}
}
- var compact = this._get(inst, 'compact');
- var layout = this._get(inst, 'layout');
- var labels = (compact ? this._get(inst, 'compactLabels') : this._get(inst, 'labels'));
- var whichLabels = this._get(inst, 'whichLabels') || this._normalLabels;
- var timeSeparator = this._get(inst, 'timeSeparator');
- var description = this._get(inst, 'description') || '';
+ var labels = (inst.options.compact ? inst.options.compactLabels : inst.options.labels);
+ var whichLabels = inst.options.whichLabels || this._normalLabels;
var showCompact = function(period) {
- var labelsNum = $.countdown._get(inst,
- 'compactLabels' + whichLabels(inst._periods[period]));
- return (show[period] ? inst._periods[period] +
+ var labelsNum = inst.options['compactLabels' + whichLabels(inst._periods[period])];
+ return (show[period] ? self._translateDigits(inst, inst._periods[period]) +
(labelsNum ? labelsNum[period] : labels[period]) + ' ' : '');
};
var showFull = function(period) {
- var labelsNum = $.countdown._get(inst, 'labels' + whichLabels(inst._periods[period]));
- return ((!significant && show[period]) || (significant && showSignificant[period]) ?
- '<span class="countdown_section"><span class="countdown_amount">' +
- inst._periods[period] + '</span><br/>' +
+ var labelsNum = inst.options['labels' + whichLabels(inst._periods[period])];
+ return ((!inst.options.significant && show[period]) ||
+ (inst.options.significant && showSignificant[period]) ?
+ '<span class="' + plugin._sectionClass + '">' +
+ '<span class="' + plugin._amountClass + '">' +
+ self._translateDigits(inst, inst._periods[period]) + '</span><br/>' +
(labelsNum ? labelsNum[period] : labels[period]) + '</span>' : '');
};
- return (layout ? this._buildLayout(inst, show, layout, compact, significant, showSignificant) :
- ((compact ? // Compact version
- '<span class="countdown_row countdown_amount' +
- (inst._hold ? ' countdown_holding' : '') + '">' +
+ return (inst.options.layout ? this._buildLayout(inst, show, inst.options.layout,
+ inst.options.compact, inst.options.significant, showSignificant) :
+ ((inst.options.compact ? // Compact version
+ '<span class="' + this._rowClass + ' ' + this._amountClass +
+ (inst._hold ? ' ' + this._holdingClass : '') + '">' +
showCompact(Y) + showCompact(O) + showCompact(W) + showCompact(D) +
- (show[H] ? this._minDigits(inst._periods[H], 2) : '') +
- (show[M] ? (show[H] ? timeSeparator : '') +
- this._minDigits(inst._periods[M], 2) : '') +
- (show[S] ? (show[H] || show[M] ? timeSeparator : '') +
- this._minDigits(inst._periods[S], 2) : '') :
+ (show[H] ? this._minDigits(inst, inst._periods[H], 2) : '') +
+ (show[M] ? (show[H] ? inst.options.timeSeparator : '') +
+ this._minDigits(inst, inst._periods[M], 2) : '') +
+ (show[S] ? (show[H] || show[M] ? inst.options.timeSeparator : '') +
+ this._minDigits(inst, inst._periods[S], 2) : '') :
// Full version
- '<span class="countdown_row countdown_show' + (significant || showCount) +
- (inst._hold ? ' countdown_holding' : '') + '">' +
+ '<span class="' + this._rowClass + ' ' + this._showClass + (inst.options.significant || showCount) +
+ (inst._hold ? ' ' + this._holdingClass : '') + '">' +
showFull(Y) + showFull(O) + showFull(W) + showFull(D) +
showFull(H) + showFull(M) + showFull(S)) + '</span>' +
- (description ? '<span class="countdown_row countdown_descr">' + description + '</span>' : '')));
+ (inst.options.description ? '<span class="' + this._rowClass + ' ' + this._descrClass + '">' +
+ inst.options.description + '</span>' : '')));
},
/* Construct a custom layout.
@@ -550,50 +560,56 @@
@param showSignificant (boolean[7]) other periods to show for significance
@return (string) the custom HTML */
_buildLayout: function(inst, show, layout, compact, significant, showSignificant) {
- var labels = this._get(inst, (compact ? 'compactLabels' : 'labels'));
- var whichLabels = this._get(inst, 'whichLabels') || this._normalLabels;
+ var labels = inst.options[compact ? 'compactLabels' : 'labels'];
+ var whichLabels = inst.options.whichLabels || this._normalLabels;
var labelFor = function(index) {
- return ($.countdown._get(inst,
- (compact ? 'compactLabels' : 'labels') + whichLabels(inst._periods[index])) ||
- labels)[index];
+ return (inst.options[(compact ? 'compactLabels' : 'labels') +
+ whichLabels(inst._periods[index])] || labels)[index];
};
var digit = function(value, position) {
- return Math.floor(value / position) % 10;
+ return inst.options.digits[Math.floor(value / position) % 10];
};
- var subs = {desc: this._get(inst, 'description'), sep: this._get(inst, 'timeSeparator'),
- yl: labelFor(Y), yn: inst._periods[Y], ynn: this._minDigits(inst._periods[Y], 2),
- ynnn: this._minDigits(inst._periods[Y], 3), y1: digit(inst._periods[Y], 1),
+ var subs = {desc: inst.options.description, sep: inst.options.timeSeparator,
+ yl: labelFor(Y), yn: this._minDigits(inst, inst._periods[Y], 1),
+ ynn: this._minDigits(inst, inst._periods[Y], 2),
+ ynnn: this._minDigits(inst, inst._periods[Y], 3), y1: digit(inst._periods[Y], 1),
y10: digit(inst._periods[Y], 10), y100: digit(inst._periods[Y], 100),
y1000: digit(inst._periods[Y], 1000),
- ol: labelFor(O), on: inst._periods[O], onn: this._minDigits(inst._periods[O], 2),
- onnn: this._minDigits(inst._periods[O], 3), o1: digit(inst._periods[O], 1),
+ ol: labelFor(O), on: this._minDigits(inst, inst._periods[O], 1),
+ onn: this._minDigits(inst, inst._periods[O], 2),
+ onnn: this._minDigits(inst, inst._periods[O], 3), o1: digit(inst._periods[O], 1),
o10: digit(inst._periods[O], 10), o100: digit(inst._periods[O], 100),
o1000: digit(inst._periods[O], 1000),
- wl: labelFor(W), wn: inst._periods[W], wnn: this._minDigits(inst._periods[W], 2),
- wnnn: this._minDigits(inst._periods[W], 3), w1: digit(inst._periods[W], 1),
+ wl: labelFor(W), wn: this._minDigits(inst, inst._periods[W], 1),
+ wnn: this._minDigits(inst, inst._periods[W], 2),
+ wnnn: this._minDigits(inst, inst._periods[W], 3), w1: digit(inst._periods[W], 1),
w10: digit(inst._periods[W], 10), w100: digit(inst._periods[W], 100),
w1000: digit(inst._periods[W], 1000),
- dl: labelFor(D), dn: inst._periods[D], dnn: this._minDigits(inst._periods[D], 2),
- dnnn: this._minDigits(inst._periods[D], 3), d1: digit(inst._periods[D], 1),
+ dl: labelFor(D), dn: this._minDigits(inst, inst._periods[D], 1),
+ dnn: this._minDigits(inst, inst._periods[D], 2),
+ dnnn: this._minDigits(inst, inst._periods[D], 3), d1: digit(inst._periods[D], 1),
d10: digit(inst._periods[D], 10), d100: digit(inst._periods[D], 100),
d1000: digit(inst._periods[D], 1000),
- hl: labelFor(H), hn: inst._periods[H], hnn: this._minDigits(inst._periods[H], 2),
- hnnn: this._minDigits(inst._periods[H], 3), h1: digit(inst._periods[H], 1),
+ hl: labelFor(H), hn: this._minDigits(inst, inst._periods[H], 1),
+ hnn: this._minDigits(inst, inst._periods[H], 2),
+ hnnn: this._minDigits(inst, inst._periods[H], 3), h1: digit(inst._periods[H], 1),
h10: digit(inst._periods[H], 10), h100: digit(inst._periods[H], 100),
h1000: digit(inst._periods[H], 1000),
- ml: labelFor(M), mn: inst._periods[M], mnn: this._minDigits(inst._periods[M], 2),
- mnnn: this._minDigits(inst._periods[M], 3), m1: digit(inst._periods[M], 1),
+ ml: labelFor(M), mn: this._minDigits(inst, inst._periods[M], 1),
+ mnn: this._minDigits(inst, inst._periods[M], 2),
+ mnnn: this._minDigits(inst, inst._periods[M], 3), m1: digit(inst._periods[M], 1),
m10: digit(inst._periods[M], 10), m100: digit(inst._periods[M], 100),
m1000: digit(inst._periods[M], 1000),
- sl: labelFor(S), sn: inst._periods[S], snn: this._minDigits(inst._periods[S], 2),
- snnn: this._minDigits(inst._periods[S], 3), s1: digit(inst._periods[S], 1),
+ sl: labelFor(S), sn: this._minDigits(inst, inst._periods[S], 1),
+ snn: this._minDigits(inst, inst._periods[S], 2),
+ snnn: this._minDigits(inst, inst._periods[S], 3), s1: digit(inst._periods[S], 1),
s10: digit(inst._periods[S], 10), s100: digit(inst._periods[S], 100),
s1000: digit(inst._periods[S], 1000)};
var html = layout;
// Replace period containers: {p<}...{p>}
for (var i = Y; i <= S; i++) {
var period = 'yowdhms'.charAt(i);
- var re = new RegExp('\\{' + period + '<\\}(.*)\\{' + period + '>\\}', 'g');
+ var re = new RegExp('\\{' + period + '<\\}([\\s\\S]*)\\{' + period + '>\\}', 'g');
html = html.replace(re, ((!significant && show[i]) ||
(significant && showSignificant[i]) ? '$1' : ''));
}
@@ -606,16 +622,27 @@
},
/* Ensure a numeric value has at least n digits for display.
+ @param inst (object) the current settings for this instance
@param value (number) the value to display
@param len (number) the minimum length
@return (string) the display text */
- _minDigits: function(value, len) {
+ _minDigits: function(inst, value, len) {
value = '' + value;
if (value.length >= len) {
- return value;
+ return this._translateDigits(inst, value);
}
value = '0000000000' + value;
- return value.substr(value.length - len);
+ return this._translateDigits(inst, value.substr(value.length - len));
+ },
+
+ /* Translate digits into other representations.
+ @param inst (object) the current settings for this instance
+ @param value (string) the text to translate
+ @return (string) the translated text */
+ _translateDigits: function(inst, value) {
+ return ('' + value).replace(/[0-9]/g, function(digit) {
+ return inst.options.digits[digit];
+ });
},
/* Translate the format into flags for each period.
@@ -623,7 +650,7 @@
@return (string[7]) flags indicating which periods are requested (?) or
required (!) by year, month, week, day, hour, minute, second */
_determineShow: function(inst) {
- var format = this._get(inst, 'format');
+ var format = inst.options.format;
var show = [];
show[Y] = (format.match('y') ? '?' : (format.match('Y') ? '!' : null));
show[O] = (format.match('o') ? '?' : (format.match('O') ? '!' : null));
@@ -665,8 +692,8 @@
var periods = [0, 0, 0, 0, 0, 0, 0];
if (show[Y] || show[O]) {
// Treat end of months as the same
- var lastNow = $.countdown._getDaysInMonth(now.getFullYear(), now.getMonth());
- var lastUntil = $.countdown._getDaysInMonth(until.getFullYear(), until.getMonth());
+ var lastNow = plugin._getDaysInMonth(now.getFullYear(), now.getMonth());
+ var lastUntil = plugin._getDaysInMonth(until.getFullYear(), until.getMonth());
var sameDay = (until.getDate() == now.getDate() ||
(until.getDate() >= Math.min(lastNow, lastUntil) &&
now.getDate() >= Math.min(lastNow, lastUntil)));
@@ -682,7 +709,7 @@
// Adjust for months difference and end of month if necessary
now = new Date(now.getTime());
var wasLastDay = (now.getDate() == lastNow);
- var lastDay = $.countdown._getDaysInMonth(now.getFullYear() + periods[Y],
+ var lastDay = plugin._getDaysInMonth(now.getFullYear() + periods[Y],
now.getMonth() + periods[O]);
if (now.getDate() > lastDay) {
now.setDate(lastDay);
@@ -737,41 +764,47 @@
}
});
-/* jQuery extend now ignores nulls!
- @param target (object) the object to update
- @param props (object) the new settings
- @return (object) the updated object */
-function extendRemove(target, props) {
- $.extend(target, props);
- for (var name in props) {
- if (props[name] == null) {
- target[name] = null;
- }
+// The list of commands that return values and don't permit chaining
+var getters = ['getTimes'];
+
+/* Determine whether a command is a getter and doesn't permit chaining.
+ @param command (string, optional) the command to run
+ @param otherArgs ([], optional) any other arguments for the command
+ @return true if the command is a getter, false if not */
+function isNotChained(command, otherArgs) {
+ if (command == 'option' && (otherArgs.length == 0 ||
+ (otherArgs.length == 1 && typeof otherArgs[0] == 'string'))) {
+ return true;
}
- return target;
+ return $.inArray(command, getters) > -1;
}
/* Process the countdown functionality for a jQuery selection.
- @param command (string) the command to run (optional, default 'attach')
- @param options (object) the new settings to use for these countdown instances
- @return (jQuery) for chaining further calls */
+ @param options (object) the new settings to use for these instances (optional) or
+ (string) the command to run (optional)
+ @return (jQuery) for chaining further calls or
+ (any) getter value */
$.fn.countdown = function(options) {
var otherArgs = Array.prototype.slice.call(arguments, 1);
- if (options == 'getTimes' || options == 'settings') {
- return $.countdown['_' + options + 'Countdown'].
- apply($.countdown, [this[0]].concat(otherArgs));
+ if (isNotChained(options, otherArgs)) {
+ return plugin['_' + options + 'Plugin'].
+ apply(plugin, [this[0]].concat(otherArgs));
}
return this.each(function() {
if (typeof options == 'string') {
- $.countdown['_' + options + 'Countdown'].apply($.countdown, [this].concat(otherArgs));
+ if (!plugin['_' + options + 'Plugin']) {
+ throw 'Unknown command: ' + options;
+ }
+ plugin['_' + options + 'Plugin'].
+ apply(plugin, [this].concat(otherArgs));
}
else {
- $.countdown._attachCountdown(this, options);
+ plugin._attachPlugin(this, options || {});
}
});
};
/* Initialise the countdown functionality. */
-$.countdown = new Countdown(); // singleton instance
+var plugin = $.countdown = new Countdown(); // Singleton instance
})(jQuery);
Index: loncom/html/adm/countdown/jquery.countdown.min.js
diff -u loncom/html/adm/countdown/jquery.countdown.min.js:1.1 loncom/html/adm/countdown/jquery.countdown.min.js:1.2
--- loncom/html/adm/countdown/jquery.countdown.min.js:1.1 Sun Mar 18 13:51:11 2012
+++ loncom/html/adm/countdown/jquery.countdown.min.js Wed Jan 15 14:45:11 2014
@@ -1,7 +1,6 @@
/* http://keith-wood.name/countdown.html
- Countdown for jQuery v1.5.11.
+ Countdown for jQuery v1.6.3.
Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
- Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
- MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
+ Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license.
Please attribute the author if you use it. */
-(function($){function Countdown(){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,timeSeparator:':',isRTL:false};this._defaults={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};$.extend(this._defaults,this.regional['']);this._serverSyncs=[];function timerCallBack(a){var b=(a||new Date().getTime());if(b-d>=1000){$.countdown._updateTargets();d=b}c(timerCallBack)}var c=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||null;var d=0;if(!c){setInterval(function(){$.countdown._updateTargets()},980)}else{d=window.mozAnimationStartTime||new Date().get!
Time();c(timerCallBack)}}var w='countdown';var Y=0;var O=1;var W=2;var D=3;var H=4;var M=5;var S=6;$.extend(Countdown.prototype,{markerClassName:'hasCountdown',_timerTargets:[],setDefaults:function(a){this._resetExtraLabels(this._defaults,a);extendRemove(this._defaults,a||{})},UTCDate:function(a,b,c,e,f,g,h,i){if(typeof b=='object'&&b.constructor==Date){i=b.getMilliseconds();h=b.getSeconds();g=b.getMinutes();f=b.getHours();e=b.getDate();c=b.getMonth();b=b.getFullYear()}var d=new Date();d.setUTCFullYear(b);d.setUTCDate(1);d.setUTCMonth(c||0);d.setUTCDate(e||1);d.setUTCHours(f||0);d.setUTCMinutes((g||0)-(Math.abs(a)<30?a*60:a));d.setUTCSeconds(h||0);d.setUTCMilliseconds(i||0);return d},periodsToSeconds:function(a){return a[0]*31557600+a[1]*2629800+a[2]*604800+a[3]*86400+a[4]*3600+a[5]*60+a[6]},_settingsCountdown:function(a,b){if(!b){return $.countdown._defaults}var c=$.data(a,w);return(b=='all'?c.options:c.options[b])},_attachCountdown:function(a,b){var c=$(a);if(c.hasClass(t!
his.markerClassName)){return}c.addClass(this.markerClassName);var d={o
ptions:$.extend({},b),_periods:[0,0,0,0,0,0,0]};$.data(a,w,d);this._changeCountdown(a)},_addTarget:function(a){if(!this._hasTarget(a)){this._timerTargets.push(a)}},_hasTarget:function(a){return($.inArray(a,this._timerTargets)>-1)},_removeTarget:function(b){this._timerTargets=$.map(this._timerTargets,function(a){return(a==b?null:a)})},_updateTargets:function(){for(var i=this._timerTargets.length-1;i>=0;i--){this._updateCountdown(this._timerTargets[i])}},_updateCountdown:function(a,b){var c=$(a);b=b||$.data(a,w);if(!b){return}c.html(this._generateHTML(b));c[(this._get(b,'isRTL')?'add':'remove')+'Class']('countdown_rtl');var d=this._get(b,'onTick');if(d){var e=b._hold!='lap'?b._periods:this._calculatePeriods(b,b._show,this._get(b,'significant'),new Date());var f=this._get(b,'tickInterval');if(f==1||this.periodsToSeconds(e)%f==0){d.apply(a,[e])}}var g=b._hold!='pause'&&(b._since?b._now.getTime()<b._since.getTime():b._now.getTime()>=b._until.getTime());if(g&&!b._expiring){b._expi!
ring=true;if(this._hasTarget(a)||this._get(b,'alwaysExpire')){this._removeTarget(a);var h=this._get(b,'onExpiry');if(h){h.apply(a,[])}var i=this._get(b,'expiryText');if(i){var j=this._get(b,'layout');b.options.layout=i;this._updateCountdown(a,b);b.options.layout=j}var k=this._get(b,'expiryUrl');if(k){window.location=k}}b._expiring=false}else if(b._hold=='pause'){this._removeTarget(a)}$.data(a,w,b)},_changeCountdown:function(a,b,c){b=b||{};if(typeof b=='string'){var d=b;b={};b[d]=c}var e=$.data(a,w);if(e){this._resetExtraLabels(e.options,b);extendRemove(e.options,b);this._adjustSettings(a,e);$.data(a,w,e);var f=new Date();if((e._since&&e._since<f)||(e._until&&e._until>f)){this._addTarget(a)}this._updateCountdown(a,e)}},_resetExtraLabels:function(a,b){var c=false;for(var n in b){if(n!='whichLabels'&&n.match(/[Ll]abels/)){c=true;break}}if(c){for(var n in a){if(n.match(/[Ll]abels[0-9]/)){a[n]=null}}}},_adjustSettings:function(a,b){var c;var d=this._get(b,'serverSync');var e=0;v!
ar f=null;for(var i=0;i<this._serverSyncs.length;i++){if(this._serverS
yncs[i][0]==d){f=this._serverSyncs[i][1];break}}if(f!=null){e=(d?f:0);c=new Date()}else{var g=(d?d.apply(a,[]):null);c=new Date();e=(g?c.getTime()-g.getTime():0);this._serverSyncs.push([d,e])}var h=this._get(b,'timezone');h=(h==null?-c.getTimezoneOffset():h);b._since=this._get(b,'since');if(b._since!=null){b._since=this.UTCDate(h,this._determineTime(b._since,null));if(b._since&&e){b._since.setMilliseconds(b._since.getMilliseconds()+e)}}b._until=this.UTCDate(h,this._determineTime(this._get(b,'until'),c));if(e){b._until.setMilliseconds(b._until.getMilliseconds()+e)}b._show=this._determineShow(b)},_destroyCountdown:function(a){var b=$(a);if(!b.hasClass(this.markerClassName)){return}this._removeTarget(a);b.removeClass(this.markerClassName).empty();$.removeData(a,w)},_pauseCountdown:function(a){this._hold(a,'pause')},_lapCountdown:function(a){this._hold(a,'lap')},_resumeCountdown:function(a){this._hold(a,null)},_hold:function(a,b){var c=$.data(a,w);if(c){if(c._hold=='pause'&&!b){!
c._periods=c._savePeriods;var d=(c._since?'-':'+');c[c._since?'_since':'_until']=this._determineTime(d+c._periods[0]+'y'+d+c._periods[1]+'o'+d+c._periods[2]+'w'+d+c._periods[3]+'d'+d+c._periods[4]+'h'+d+c._periods[5]+'m'+d+c._periods[6]+'s');this._addTarget(a)}c._hold=b;c._savePeriods=(b=='pause'?c._periods:null);$.data(a,w,c);this._updateCountdown(a,c)}},_getTimesCountdown:function(a){var b=$.data(a,w);return(!b?null:(!b._hold?b._periods:this._calculatePeriods(b,b._show,this._get(b,'significant'),new Date())))},_get:function(a,b){return(a.options[b]!=null?a.options[b]:$.countdown._defaults[b])},_determineTime:function(k,l){var m=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b};var n=function(a){a=a.toLowerCase();var b=new Date();var c=b.getFullYear();var d=b.getMonth();var e=b.getDate();var f=b.getHours();var g=b.getMinutes();var h=b.getSeconds();var i=/([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;var j=i.exec(a);while(j){switch(j[2]||'s'){case's':h+=parseInt(j[1!
],10);break;case'm':g+=parseInt(j[1],10);break;case'h':f+=parseInt(j[1
],10);break;case'd':e+=parseInt(j[1],10);break;case'w':e+=parseInt(j[1],10)*7;break;case'o':d+=parseInt(j[1],10);e=Math.min(e,$.countdown._getDaysInMonth(c,d));break;case'y':c+=parseInt(j[1],10);e=Math.min(e,$.countdown._getDaysInMonth(c,d));break}j=i.exec(a)}return new Date(c,d,e,f,g,h,0)};var o=(k==null?l:(typeof k=='string'?n(k):(typeof k=='number'?m(k):k)));if(o)o.setMilliseconds(0);return o},_getDaysInMonth:function(a,b){return 32-new Date(a,b,32).getDate()},_normalLabels:function(a){return a},_generateHTML:function(c){var d=this._get(c,'significant');c._periods=(c._hold?c._periods:this._calculatePeriods(c,c._show,d,new Date()));var e=false;var f=0;var g=d;var h=$.extend({},c._show);for(var i=Y;i<=S;i++){e|=(c._show[i]=='?'&&c._periods[i]>0);h[i]=(c._show[i]=='?'&&!e?null:c._show[i]);f+=(h[i]?1:0);g-=(c._periods[i]>0?1:0)}var j=[false,false,false,false,false,false,false];for(var i=S;i>=Y;i--){if(c._show[i]){if(c._periods[i]){j[i]=true}else{j[i]=g>0;g--}}}var k=this._get!
(c,'compact');var l=this._get(c,'layout');var m=(k?this._get(c,'compactLabels'):this._get(c,'labels'));var n=this._get(c,'whichLabels')||this._normalLabels;var o=this._get(c,'timeSeparator');var p=this._get(c,'description')||'';var q=function(a){var b=$.countdown._get(c,'compactLabels'+n(c._periods[a]));return(h[a]?c._periods[a]+(b?b[a]:m[a])+' ':'')};var r=function(a){var b=$.countdown._get(c,'labels'+n(c._periods[a]));return((!d&&h[a])||(d&&j[a])?'<span class="countdown_section"><span class="countdown_amount">'+c._periods[a]+'</span><br/>'+(b?b[a]:m[a])+'</span>':'')};return(l?this._buildLayout(c,h,l,k,d,j):((k?'<span class="countdown_row countdown_amount'+(c._hold?' countdown_holding':'')+'">'+q(Y)+q(O)+q(W)+q(D)+(h[H]?this._minDigits(c._periods[H],2):'')+(h[M]?(h[H]?o:'')+this._minDigits(c._periods[M],2):'')+(h[S]?(h[H]||h[M]?o:'')+this._minDigits(c._periods[S],2):''):'<span class="countdown_row countdown_show'+(d||f)+(c._hold?' countdown_holding':'')+'">'+r(Y)+r(O)+r(W!
)+r(D)+r(H)+r(M)+r(S))+'</span>'+(p?'<span class="countdown_row countd
own_descr">'+p+'</span>':'')))},_buildLayout:function(c,d,e,f,g,h){var j=this._get(c,(f?'compactLabels':'labels'));var k=this._get(c,'whichLabels')||this._normalLabels;var l=function(a){return($.countdown._get(c,(f?'compactLabels':'labels')+k(c._periods[a]))||j)[a]};var m=function(a,b){return Math.floor(a/b)%10};var o={desc:this._get(c,'description'),sep:this._get(c,'timeSeparator'),yl:l(Y),yn:c._periods[Y],ynn:this._minDigits(c._periods[Y],2),ynnn:this._minDigits(c._periods[Y],3),y1:m(c._periods[Y],1),y10:m(c._periods[Y],10),y100:m(c._periods[Y],100),y1000:m(c._periods[Y],1000),ol:l(O),on:c._periods[O],onn:this._minDigits(c._periods[O],2),onnn:this._minDigits(c._periods[O],3),o1:m(c._periods[O],1),o10:m(c._periods[O],10),o100:m(c._periods[O],100),o1000:m(c._periods[O],1000),wl:l(W),wn:c._periods[W],wnn:this._minDigits(c._periods[W],2),wnnn:this._minDigits(c._periods[W],3),w1:m(c._periods[W],1),w10:m(c._periods[W],10),w100:m(c._periods[W],100),w1000:m(c._periods[W],1000),dl:!
l(D),dn:c._periods[D],dnn:this._minDigits(c._periods[D],2),dnnn:this._minDigits(c._periods[D],3),d1:m(c._periods[D],1),d10:m(c._periods[D],10),d100:m(c._periods[D],100),d1000:m(c._periods[D],1000),hl:l(H),hn:c._periods[H],hnn:this._minDigits(c._periods[H],2),hnnn:this._minDigits(c._periods[H],3),h1:m(c._periods[H],1),h10:m(c._periods[H],10),h100:m(c._periods[H],100),h1000:m(c._periods[H],1000),ml:l(M),mn:c._periods[M],mnn:this._minDigits(c._periods[M],2),mnnn:this._minDigits(c._periods[M],3),m1:m(c._periods[M],1),m10:m(c._periods[M],10),m100:m(c._periods[M],100),m1000:m(c._periods[M],1000),sl:l(S),sn:c._periods[S],snn:this._minDigits(c._periods[S],2),snnn:this._minDigits(c._periods[S],3),s1:m(c._periods[S],1),s10:m(c._periods[S],10),s100:m(c._periods[S],100),s1000:m(c._periods[S],1000)};var p=e;for(var i=Y;i<=S;i++){var q='yowdhms'.charAt(i);var r=new RegExp('\\{'+q+'<\\}(.*)\\{'+q+'>\\}','g');p=p.replace(r,((!g&&d[i])||(g&&h[i])?'$1':''))}$.each(o,function(n,v){var a=new R!
egExp('\\{'+n+'\\}','g');p=p.replace(a,v)});return p},_minDigits:funct
ion(a,b){a=''+a;if(a.length>=b){return a}a='0000000000'+a;return a.substr(a.length-b)},_determineShow:function(a){var b=this._get(a,'format');var c=[];c[Y]=(b.match('y')?'?':(b.match('Y')?'!':null));c[O]=(b.match('o')?'?':(b.match('O')?'!':null));c[W]=(b.match('w')?'?':(b.match('W')?'!':null));c[D]=(b.match('d')?'?':(b.match('D')?'!':null));c[H]=(b.match('h')?'?':(b.match('H')?'!':null));c[M]=(b.match('m')?'?':(b.match('M')?'!':null));c[S]=(b.match('s')?'?':(b.match('S')?'!':null));return c},_calculatePeriods:function(c,d,e,f){c._now=f;c._now.setMilliseconds(0);var g=new Date(c._now.getTime());if(c._since){if(f.getTime()<c._since.getTime()){c._now=f=g}else{f=c._since}}else{g.setTime(c._until.getTime());if(f.getTime()>c._until.getTime()){c._now=f=g}}var h=[0,0,0,0,0,0,0];if(d[Y]||d[O]){var i=$.countdown._getDaysInMonth(f.getFullYear(),f.getMonth());var j=$.countdown._getDaysInMonth(g.getFullYear(),g.getMonth());var k=(g.getDate()==f.getDate()||(g.getDate()>=Math.min(i,j)&&f.g!
etDate()>=Math.min(i,j)));var l=function(a){return(a.getHours()*60+a.getMinutes())*60+a.getSeconds()};var m=Math.max(0,(g.getFullYear()-f.getFullYear())*12+g.getMonth()-f.getMonth()+((g.getDate()<f.getDate()&&!k)||(k&&l(g)<l(f))?-1:0));h[Y]=(d[Y]?Math.floor(m/12):0);h[O]=(d[O]?m-h[Y]*12:0);f=new Date(f.getTime());var n=(f.getDate()==i);var o=$.countdown._getDaysInMonth(f.getFullYear()+h[Y],f.getMonth()+h[O]);if(f.getDate()>o){f.setDate(o)}f.setFullYear(f.getFullYear()+h[Y]);f.setMonth(f.getMonth()+h[O]);if(n){f.setDate(o)}}var p=Math.floor((g.getTime()-f.getTime())/1000);var q=function(a,b){h[a]=(d[a]?Math.floor(p/b):0);p-=h[a]*b};q(W,604800);q(D,86400);q(H,3600);q(M,60);q(S,1);if(p>0&&!c._since){var r=[1,12,4.3482,7,24,60,60];var s=S;var t=1;for(var u=S;u>=Y;u--){if(d[u]){if(h[s]>=t){h[s]=0;p=1}if(p>0){h[u]++;p=0;s=u;t=1}}t*=r[u]}}if(e){for(var u=Y;u<=S;u++){if(e&&h[u]){e--}else if(!e){h[u]=0}}}return h}});function extendRemove(a,b){$.extend(a,b);for(var c in b){if(b[c]==n!
ull){a[c]=null}}return a}$.fn.countdown=function(a){var b=Array.protot
ype.slice.call(arguments,1);if(a=='getTimes'||a=='settings'){return $.countdown['_'+a+'Countdown'].apply($.countdown,[this[0]].concat(b))}return this.each(function(){if(typeof a=='string'){$.countdown['_'+a+'Countdown'].apply($.countdown,[this].concat(b))}else{$.countdown._attachCountdown(this,a)}})};$.countdown=new Countdown()})(jQuery);
\ No newline at end of file
+(function($){function Countdown(){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={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};$.extend(this._defaults,this.regional['']);this._serverSyncs=[];var c=(typeof Date.now=='function'?Date.now:function(){return new Date().getTime()});var d=(window.performance&&typeof window.performance.now=='function');function timerCallBack(a){var b=(a<1e12?(d?(performance.now()+performance.timing.navigationStart):c()):a||c());if(b-f>=1000){x._updateTargets();f=b}e(timerCallBack)}var e=window.requestAnimationFrame||window.webkitR!
equestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||null;var f=0;if(!e||$.noRequestAnimationFrame){$.noRequestAnimationFrame=null;setInterval(function(){x._updateTargets()},980)}else{f=window.animationStartTime||window.webkitAnimationStartTime||window.mozAnimationStartTime||window.oAnimationStartTime||window.msAnimationStartTime||c();e(timerCallBack)}}var Y=0;var O=1;var W=2;var D=3;var H=4;var M=5;var S=6;$.extend(Countdown.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(a){this._resetExtraLabels(this._defaults,a);$.extend(this._defaults,a||{})},UTCDate:function(a,b,c,e,f,g,h,i){if(typeof b=='object'&&b.constructor==Date){i=b.getMilliseconds();h=!
b.getSeconds();g=b.getMinutes();f=b.getHours();e=b.getDate();c=b.getMo
nth();b=b.getFullYear()}var d=new Date();d.setUTCFullYear(b);d.setUTCDate(1);d.setUTCMonth(c||0);d.setUTCDate(e||1);d.setUTCHours(f||0);d.setUTCMinutes((g||0)-(Math.abs(a)<30?a*60:a));d.setUTCSeconds(h||0);d.setUTCMilliseconds(i||0);return d},periodsToSeconds:function(a){return a[0]*31557600+a[1]*2629800+a[2]*604800+a[3]*86400+a[4]*3600+a[5]*60+a[6]},_attachPlugin:function(a,b){a=$(a);if(a.hasClass(this.markerClassName)){return}var c={options:$.extend({},this._defaults),_periods:[0,0,0,0,0,0,0]};a.addClass(this.markerClassName).data(this.propertyName,c);this._optionPlugin(a,b)},_addTarget:function(a){if(!this._hasTarget(a)){this._timerTargets.push(a)}},_hasTarget:function(a){return($.inArray(a,this._timerTargets)>-1)},_removeTarget:function(b){this._timerTargets=$.map(this._timerTargets,function(a){return(a==b?null:a)})},_updateTargets:function(){for(var i=this._timerTargets.length-1;i>=0;i--){this._updateCountdown(this._timerTargets[i])}},_optionPlugin:function(a,b,c){a=$(a!
);var d=a.data(this.propertyName);if(!b||(typeof b=='string'&&c==null)){var e=b;b=(d||{}).options;return(b&&e?b[e]:b)}if(!a.hasClass(this.markerClassName)){return}b=b||{};if(typeof b=='string'){var e=b;b={};b[e]=c}if(b.layout){b.layout=b.layout.replace(/</g,'<').replace(/>/g,'>')}this._resetExtraLabels(d.options,b);var f=(d.options.timezone!=b.timezone);$.extend(d.options,b);this._adjustSettings(a,d,b.until!=null||b.since!=null||f);var g=new Date();if((d._since&&d._since<g)||(d._until&&d._until>g)){this._addTarget(a[0])}this._updateCountdown(a,d)},_updateCountdown:function(a,b){var c=$(a);b=b||c.data(this.propertyName);if(!b){return}c.html(this._generateHTML(b)).toggleClass(this._rtlClass,b.options.isRTL);if($.isFunction(b.options.onTick)){var d=b._hold!='lap'?b._periods:this._calculatePeriods(b,b._show,b.options.significant,new Date());if(b.options.tickInterval==1||this.periodsToSeconds(d)%b.options.tickInterval==0){b.options.onTick.apply(a,[d])}}var e=b._hold!='paus!
e'&&(b._since?b._now.getTime()<b._since.getTime():b._now.getTime()>=b.
_until.getTime());if(e&&!b._expiring){b._expiring=true;if(this._hasTarget(a)||b.options.alwaysExpire){this._removeTarget(a);if($.isFunction(b.options.onExpiry)){b.options.onExpiry.apply(a,[])}if(b.options.expiryText){var f=b.options.layout;b.options.layout=b.options.expiryText;this._updateCountdown(a,b);b.options.layout=f}if(b.options.expiryUrl){window.location=b.options.expiryUrl}}b._expiring=false}else if(b._hold=='pause'){this._removeTarget(a)}c.data(this.propertyName,b)},_resetExtraLabels:function(a,b){var c=false;for(var n in b){if(n!='whichLabels'&&n.match(/[Ll]abels/)){c=true;break}}if(c){for(var n in a){if(n.match(/[Ll]abels[02-9]|compactLabels1/)){a[n]=null}}}},_adjustSettings:function(a,b,c){var d;var e=0;var f=null;for(var i=0;i<this._serverSyncs.length;i++){if(this._serverSyncs[i][0]==b.options.serverSync){f=this._serverSyncs[i][1];break}}if(f!=null){e=(b.options.serverSync?f:0);d=new Date()}else{var g=($.isFunction(b.options.serverSync)?b.options.serverSync.appl!
y(a,[]):null);d=new Date();e=(g?d.getTime()-g.getTime():0);this._serverSyncs.push([b.options.serverSync,e])}var h=b.options.timezone;h=(h==null?-d.getTimezoneOffset():h);if(c||(!c&&b._until==null&&b._since==null)){b._since=b.options.since;if(b._since!=null){b._since=this.UTCDate(h,this._determineTime(b._since,null));if(b._since&&e){b._since.setMilliseconds(b._since.getMilliseconds()+e)}}b._until=this.UTCDate(h,this._determineTime(b.options.until,d));if(e){b._until.setMilliseconds(b._until.getMilliseconds()+e)}}b._show=this._determineShow(b)},_destroyPlugin:function(a){a=$(a);if(!a.hasClass(this.markerClassName)){return}this._removeTarget(a[0]);a.removeClass(this.markerClassName).empty().removeData(this.propertyName)},_pausePlugin:function(a){this._hold(a,'pause')},_lapPlugin:function(a){this._hold(a,'lap')},_resumePlugin:function(a){this._hold(a,null)},_hold:function(a,b){var c=$.data(a,this.propertyName);if(c){if(c._hold=='pause'&&!b){c._periods=c._savePeriods;var d=(c._si!
nce?'-':'+');c[c._since?'_since':'_until']=this._determineTime(d+c._pe
riods[0]+'y'+d+c._periods[1]+'o'+d+c._periods[2]+'w'+d+c._periods[3]+'d'+d+c._periods[4]+'h'+d+c._periods[5]+'m'+d+c._periods[6]+'s');this._addTarget(a)}c._hold=b;c._savePeriods=(b=='pause'?c._periods:null);$.data(a,this.propertyName,c);this._updateCountdown(a,c)}},_getTimesPlugin:function(a){var b=$.data(a,this.propertyName);return(!b?null:(b._hold=='pause'?b._savePeriods:(!b._hold?b._periods:this._calculatePeriods(b,b._show,b.options.significant,new Date()))))},_determineTime:function(k,l){var m=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b};var n=function(a){a=a.toLowerCase();var b=new Date();var c=b.getFullYear();var d=b.getMonth();var e=b.getDate();var f=b.getHours();var g=b.getMinutes();var h=b.getSeconds();var i=/([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;var j=i.exec(a);while(j){switch(j[2]||'s'){case's':h+=parseInt(j[1],10);break;case'm':g+=parseInt(j[1],10);break;case'h':f+=parseInt(j[1],10);break;case'd':e+=parseInt(j[1],10);break;case'w':e+=parseInt!
(j[1],10)*7;break;case'o':d+=parseInt(j[1],10);e=Math.min(e,x._getDaysInMonth(c,d));break;case'y':c+=parseInt(j[1],10);e=Math.min(e,x._getDaysInMonth(c,d));break}j=i.exec(a)}return new Date(c,d,e,f,g,h,0)};var o=(k==null?l:(typeof k=='string'?n(k):(typeof k=='number'?m(k):k)));if(o)o.setMilliseconds(0);return o},_getDaysInMonth:function(a,b){return 32-new Date(a,b,32).getDate()},_normalLabels:function(a){return a},_generateHTML:function(c){var d=this;c._periods=(c._hold?c._periods:this._calculatePeriods(c,c._show,c.options.significant,new Date()));var e=false;var f=0;var g=c.options.significant;var h=$.extend({},c._show);for(var i=Y;i<=S;i++){e|=(c._show[i]=='?'&&c._periods[i]>0);h[i]=(c._show[i]=='?'&&!e?null:c._show[i]);f+=(h[i]?1:0);g-=(c._periods[i]>0?1:0)}var j=[false,false,false,false,false,false,false];for(var i=S;i>=Y;i--){if(c._show[i]){if(c._periods[i]){j[i]=true}else{j[i]=g>0;g--}}}var k=(c.options.compact?c.options.compactLabels:c.options.labels);var l=c.options!
.whichLabels||this._normalLabels;var m=function(a){var b=c.options['co
mpactLabels'+l(c._periods[a])];return(h[a]?d._translateDigits(c,c._periods[a])+(b?b[a]:k[a])+' ':'')};var n=function(a){var b=c.options['labels'+l(c._periods[a])];return((!c.options.significant&&h[a])||(c.options.significant&&j[a])?'<span class="'+x._sectionClass+'">'+'<span class="'+x._amountClass+'">'+d._translateDigits(c,c._periods[a])+'</span><br/>'+(b?b[a]:k[a])+'</span>':'')};return(c.options.layout?this._buildLayout(c,h,c.options.layout,c.options.compact,c.options.significant,j):((c.options.compact?'<span class="'+this._rowClass+' '+this._amountClass+(c._hold?' '+this._holdingClass:'')+'">'+m(Y)+m(O)+m(W)+m(D)+(h[H]?this._minDigits(c,c._periods[H],2):'')+(h[M]?(h[H]?c.options.timeSeparator:'')+this._minDigits(c,c._periods[M],2):'')+(h[S]?(h[H]||h[M]?c.options.timeSeparator:'')+this._minDigits(c,c._periods[S],2):''):'<span class="'+this._rowClass+' '+this._showClass+(c.options.significant||f)+(c._hold?' '+this._holdingClass:'')+'">'+n(Y)+n(O)+n(W)+n(D)+n(H)+n(M)+n(S))+!
'</span>'+(c.options.description?'<span class="'+this._rowClass+' '+this._descrClass+'">'+c.options.description+'</span>':'')))},_buildLayout:function(c,d,e,f,g,h){var j=c.options[f?'compactLabels':'labels'];var k=c.options.whichLabels||this._normalLabels;var l=function(a){return(c.options[(f?'compactLabels':'labels')+k(c._periods[a])]||j)[a]};var m=function(a,b){return c.options.digits[Math.floor(a/b)%10]};var o={desc:c.options.description,sep:c.options.timeSeparator,yl:l(Y),yn:this._minDigits(c,c._periods[Y],1),ynn:this._minDigits(c,c._periods[Y],2),ynnn:this._minDigits(c,c._periods[Y],3),y1:m(c._periods[Y],1),y10:m(c._periods[Y],10),y100:m(c._periods[Y],100),y1000:m(c._periods[Y],1000),ol:l(O),on:this._minDigits(c,c._periods[O],1),onn:this._minDigits(c,c._periods[O],2),onnn:this._minDigits(c,c._periods[O],3),o1:m(c._periods[O],1),o10:m(c._periods[O],10),o100:m(c._periods[O],100),o1000:m(c._periods[O],1000),wl:l(W),wn:this._minDigits(c,c._periods[W],1),wnn:this._minDigits!
(c,c._periods[W],2),wnnn:this._minDigits(c,c._periods[W],3),w1:m(c._pe
riods[W],1),w10:m(c._periods[W],10),w100:m(c._periods[W],100),w1000:m(c._periods[W],1000),dl:l(D),dn:this._minDigits(c,c._periods[D],1),dnn:this._minDigits(c,c._periods[D],2),dnnn:this._minDigits(c,c._periods[D],3),d1:m(c._periods[D],1),d10:m(c._periods[D],10),d100:m(c._periods[D],100),d1000:m(c._periods[D],1000),hl:l(H),hn:this._minDigits(c,c._periods[H],1),hnn:this._minDigits(c,c._periods[H],2),hnnn:this._minDigits(c,c._periods[H],3),h1:m(c._periods[H],1),h10:m(c._periods[H],10),h100:m(c._periods[H],100),h1000:m(c._periods[H],1000),ml:l(M),mn:this._minDigits(c,c._periods[M],1),mnn:this._minDigits(c,c._periods[M],2),mnnn:this._minDigits(c,c._periods[M],3),m1:m(c._periods[M],1),m10:m(c._periods[M],10),m100:m(c._periods[M],100),m1000:m(c._periods[M],1000),sl:l(S),sn:this._minDigits(c,c._periods[S],1),snn:this._minDigits(c,c._periods[S],2),snnn:this._minDigits(c,c._periods[S],3),s1:m(c._periods[S],1),s10:m(c._periods[S],10),s100:m(c._periods[S],100),s1000:m(c._periods[S],1000)!
};var p=e;for(var i=Y;i<=S;i++){var q='yowdhms'.charAt(i);var r=new RegExp('\\{'+q+'<\\}([\\s\\S]*)\\{'+q+'>\\}','g');p=p.replace(r,((!g&&d[i])||(g&&h[i])?'$1':''))}$.each(o,function(n,v){var a=new RegExp('\\{'+n+'\\}','g');p=p.replace(a,v)});return p},_minDigits:function(a,b,c){b=''+b;if(b.length>=c){return this._translateDigits(a,b)}b='0000000000'+b;return this._translateDigits(a,b.substr(b.length-c))},_translateDigits:function(b,c){return(''+c).replace(/[0-9]/g,function(a){return b.options.digits[a]})},_determineShow:function(a){var b=a.options.format;var c=[];c[Y]=(b.match('y')?'?':(b.match('Y')?'!':null));c[O]=(b.match('o')?'?':(b.match('O')?'!':null));c[W]=(b.match('w')?'?':(b.match('W')?'!':null));c[D]=(b.match('d')?'?':(b.match('D')?'!':null));c[H]=(b.match('h')?'?':(b.match('H')?'!':null));c[M]=(b.match('m')?'?':(b.match('M')?'!':null));c[S]=(b.match('s')?'?':(b.match('S')?'!':null));return c},_calculatePeriods:function(c,d,e,f){c._now=f;c._now.setMilliseconds(0);v!
ar g=new Date(c._now.getTime());if(c._since){if(f.getTime()<c._since.g
etTime()){c._now=f=g}else{f=c._since}}else{g.setTime(c._until.getTime());if(f.getTime()>c._until.getTime()){c._now=f=g}}var h=[0,0,0,0,0,0,0];if(d[Y]||d[O]){var i=x._getDaysInMonth(f.getFullYear(),f.getMonth());var j=x._getDaysInMonth(g.getFullYear(),g.getMonth());var k=(g.getDate()==f.getDate()||(g.getDate()>=Math.min(i,j)&&f.getDate()>=Math.min(i,j)));var l=function(a){return(a.getHours()*60+a.getMinutes())*60+a.getSeconds()};var m=Math.max(0,(g.getFullYear()-f.getFullYear())*12+g.getMonth()-f.getMonth()+((g.getDate()<f.getDate()&&!k)||(k&&l(g)<l(f))?-1:0));h[Y]=(d[Y]?Math.floor(m/12):0);h[O]=(d[O]?m-h[Y]*12:0);f=new Date(f.getTime());var n=(f.getDate()==i);var o=x._getDaysInMonth(f.getFullYear()+h[Y],f.getMonth()+h[O]);if(f.getDate()>o){f.setDate(o)}f.setFullYear(f.getFullYear()+h[Y]);f.setMonth(f.getMonth()+h[O]);if(n){f.setDate(o)}}var p=Math.floor((g.getTime()-f.getTime())/1000);var q=function(a,b){h[a]=(d[a]?Math.floor(p/b):0);p-=h[a]*b};q(W,604800);q(D,86400);q(H,360!
0);q(M,60);q(S,1);if(p>0&&!c._since){var r=[1,12,4.3482,7,24,60,60];var s=S;var t=1;for(var u=S;u>=Y;u--){if(d[u]){if(h[s]>=t){h[s]=0;p=1}if(p>0){h[u]++;p=0;s=u;t=1}}t*=r[u]}}if(e){for(var u=Y;u<=S;u++){if(e&&h[u]){e--}else if(!e){h[u]=0}}}return h}});var w=['getTimes'];function isNotChained(a,b){if(a=='option'&&(b.length==0||(b.length==1&&typeof b[0]=='string'))){return true}return $.inArray(a,w)>-1}$.fn.countdown=function(a){var b=Array.prototype.slice.call(arguments,1);if(isNotChained(a,b)){return x['_'+a+'Plugin'].apply(x,[this[0]].concat(b))}return this.each(function(){if(typeof a=='string'){if(!x['_'+a+'Plugin']){throw'Unknown command: '+a;}x['_'+a+'Plugin'].apply(x,[this].concat(b))}else{x._attachPlugin(this,a||{})}})};var x=$.countdown=new Countdown()})(jQuery);
\ No newline at end of file
More information about the LON-CAPA-cvs
mailing list