commit 5ccb68f6f39b455281036c4a131c7206ad710f52 Author: Pierre Date: Thu Dec 29 00:45:36 2022 +0100 v1.6 diff --git a/_define.php b/_define.php new file mode 100644 index 0000000..4eb4f76 --- /dev/null +++ b/_define.php @@ -0,0 +1,37 @@ +. +# +# ***** END LICENSE BLOCK ***** + +if (!defined('DC_RC_PATH')) {return;} + +$this->registerModule( + /* Name */ "CountDown", + /* Description*/ "Countdown and stopwatch", + /* Author */ "Moe (http://gniark.net/), Pierre Van Glabeke", + /* Version */ '1.6', + /* Properties */ + array( + 'permissions' => 'admin', + 'type' => 'plugin', + 'dc_min' => '2.24', + 'support' => 'http://lab.dotclear.org/wiki/plugin/countdown', + 'details' => 'http://plugins.dotaddict.org/dc2/details/countdown' + ) +); \ No newline at end of file diff --git a/_prepend.php b/_prepend.php new file mode 100644 index 0000000..fbbb162 --- /dev/null +++ b/_prepend.php @@ -0,0 +1,24 @@ +. +# +# ***** END LICENSE BLOCK ***** + +if (!defined('DC_RC_PATH')) {return;} + +require_once(dirname(__FILE__).'/_widget.php'); \ No newline at end of file diff --git a/_widget.php b/_widget.php new file mode 100644 index 0000000..0d54b0a --- /dev/null +++ b/_widget.php @@ -0,0 +1,286 @@ +. +# +# ***** END LICENSE BLOCK ***** + +if (!defined('DC_RC_PATH')) {return;} + +dcCore::app()->addBehavior('initWidgets', + array('CountDownBehaviors','initWidgets')); + +class CountDownBehaviors +{ + public static function initWidgets($w) + { + # set timezone + dcCore::app(); + $tz = dcCore::app()->blog->settings->system->blog_timezone; + + $w->create('CountDown',__('Countdown'), + array('CountDownBehaviors','Show'), + null, + __('A countdown to a future date or stopwatch to a past date')); + + $w->CountDown->setting('title',__('Title:'),__('CountDown'),'text'); + + $w->CountDown->setting('text_before', + __('Text displayed if the date is in the future:'),__('In'),'text'); + + $w->CountDown->setting('text_after', + __('Text displayed if the date is in the past:'),__('For'),'text'); + + # create arrays for year, month, day, hour, minute and second + $array_year = $array_month = $array_day = $array_hour = array(); + $array_minute = $array_number_of_times = array(); + for ($i = 1902;$i <= 2037;$i++) + { + $array_year[$i] = $i; + } + for ($i = 1;$i <= 12;$i++) + { + $i = str_repeat('0',(2-strlen($i))).$i; + $array_month[ucfirst(__(strftime('%B', mktime(0, 0, 0, $i, 1, 1970)))).' ('.$i.')'] = $i; + } + for ($i = 1;$i <= 31;$i++) + { + $i = str_repeat('0',(2-strlen($i))).$i; + $array_day[$i] = $i; + } + for ($i = 0;$i <= 23;$i++) + { + $i = str_repeat('0',(2-strlen($i))).$i; + $array_hour[$i] = $i; + } + for ($i = 0;$i <= 60;$i++) + { + $i = str_repeat('0',(2-strlen($i))).$i; + $array_minute[$i] = $i; + } + for ($i = 1;$i <= 5;$i++) + { + $array_number_of_times[$i] = $i; + } + $array_number_of_times['6 ('.__('all').')'] = 6; + # /create arrays + + $w->CountDown->setting('year',ucfirst(__('year')).':', + dt::str('%Y',null,$tz),'combo',$array_year); + $w->CountDown->setting('month',ucfirst(__('month')).':', + dt::str('%m',null,$tz),'combo',$array_month); + $w->CountDown->setting('day',ucfirst(__('day')).':', + dt::str('%d',null,$tz),'combo',$array_day); + $w->CountDown->setting('hour',ucfirst(__('hour')).':', + dt::str('%H',null,$tz),'combo',$array_hour); + $w->CountDown->setting('minute',ucfirst(__('minute')).':', + dt::str('%M',null,$tz),'combo',$array_minute); + $w->CountDown->setting('second',ucfirst(__('second')).':', + dt::str('%S',null,$tz),'combo',$array_minute); + + $w->CountDown->setting('number_of_times', + __('Number of values to be displayed:'),'6','combo', + $array_number_of_times); + + $w->CountDown->setting('zeros', + __('Show zeros before hours, minutes and seconds'),false,'check'); + + $w->CountDown->setting('dynamic', + __('Enable dynamic display'),false,'check'); + + $w->CountDown->setting('dynamic_format', + sprintf(__('Dynamic display format (see jQuery Countdown Reference):'), + 'http://keith-wood.name/countdownRef.html#format', + 'onclick="return window.confirm(\''. + __('Are you sure you want to leave this page?').'\')"'), + __('yowdHMS'),'text'); + + $w->CountDown->setting('dynamic_layout_before', + sprintf(__('Dynamic display layout if the date is in the future (see jQuery Countdown Reference):'), + 'http://keith-wood.name/countdownRef.html#layout', + 'onclick="return window.confirm(\''. + __('Are you sure you want to leave this page?').'\')"'), + __('In {y<}{yn} {yl}, {y>} {o<}{on} {ol}, {o>} {w<}{wn} {wl}, {w>} {d<}{dn} {dl}, {d>} {hn} {hl}, {mn} {ml} and {sn} {sl}'), + 'textarea'); + + $w->CountDown->setting('dynamic_layout_after', + sprintf(__('Dynamic display layout if the date is in the past (see jQuery Countdown Reference):'), + 'http://keith-wood.name/countdownRef.html#layout', + 'onclick="return window.confirm(\''. + __('Are you sure you want to leave this page?').'\')"'), + __('For {y<}{yn} {yl}, {y>} {o<}{on} {ol}, {o>} {w<}{wn} {wl}, {w>} {d<}{dn} {dl}, {d>} {hn} {hl}, {mn} {ml} and {sn} {sl}'), + 'textarea'); + + $w->CountDown->setting('homeonly',__('Display on:'),0,'combo', + array( + __('All pages') => 0, + __('Home page only') => 1, + __('Except on home page') => 2 + ) + ); + $w->CountDown->setting('content_only',__('Content only'),0,'check'); + $w->CountDown->setting('class',__('CSS class:'),''); + $w->CountDown->setting('offline',__('Offline'),0,'check'); + } + + # escape quotes but not XHTML tags + # inspired by html::escapeJS() + public static function escapeQuotes($str) + { + $str = str_replace("'","\'",$str); + $str = str_replace('"','\"',$str); + return $str; + } + + public static function Show($w) + { + # set timezone + dcCore::app(); + + if ($w->offline) + return; + + if (($w->homeonly == 1 && dcCore::app()->url->type != 'default') || + ($w->homeonly == 2 && dcCore::app()->url->type == 'default')) { + return; + } + + # get local time + $local_time = dt::addTimeZone(dcCore::app()->blog->settings->system->blog_timezone); + + $ts = mktime($w->hour,$w->minute,$w->second,$w->month,$w->day, + $w->year); + # get difference + (int)$diff = ($local_time - $ts); + $after = ($diff > 0) ? true : false; + $diff = abs($diff); + + $times = array(); + + $intervals = array + ( + (3600*24*365.24) => array('one'=>__('year'),'more'=>__('years'), + 'zeros'=>false), + (3600*24*30.4) => array('one'=>__('month'),'more'=>__('months'), + 'zeros'=>false), + (3600*24) => array('one'=>__('day'),'more'=>__('days'), + 'zeros'=>false), + (3600) => array('one'=>__('hour'),'more'=>__('hours'), + 'zeros'=>true), + (60) => array('one'=>__('minute'),'more'=>__('minutes'), + 'zeros'=>true), + (1) => array('one'=>__('second'),'more'=>__('seconds'), + 'zeros'=>true), + ); + + foreach ($intervals as $k => $v) + { + if ($diff >= $k) + { + $time = floor($diff/$k); + $times[] = (($w->zeros AND $v['zeros']) + ? sprintf('%02d',$time) : $time).' '.(($time <= 1) ? $v['one'] + : $v['more']); + $diff = $diff%$k; + } + } + + # output + $text = ($after) ? $w->text_after : $w->text_before; + if (strlen($text) > 0) {$text .= ' ';} + + # get times and make a string + $times = array_slice($times,0,$w->number_of_times); + if (count($times) > 1) + { + $last = array_pop($times); + $str = implode(', ',$times).' '.__('and').' '.$last; + } + else {$str = implode('',$times);} + + if (!$w->dynamic) + { + + $res = ($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : ''). + '

'.$text.''.$str.'

'; + return $w->renderDiv($w->content_only,'countdown '.$w->class,'',$res); + } + + else + { + # dynamic display with Countdown for jQuery + if (!is_numeric($GLOBALS['_ctx']->countdown)) + { + $GLOBALS['_ctx']->countdown = 0; + } + $id = $GLOBALS['_ctx']->countdown; + $GLOBALS['_ctx']->countdown += 1; + + $script = ''; + + if (!defined('COUNTDOWN_SCRIPT')) + { + $script = + ''."\n"; + + $l10n_file = + 'jquery.countdown-'.dcCore::app()->blog->settings->system->lang.'.js'; + if (file_exists(dirname(__FILE__).'/js/'.$l10n_file)) + { + $script .= + ''."\n"; + } + + define('COUNTDOWN_SCRIPT',(bool)true); + } + + if ($after) + { + $to = 'since'; + $layout = $w->dynamic_layout_after; + } + else + { + $to = 'until'; + $layout = $w->dynamic_layout_before; + } + + $res = ($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : ''). + '

'.$text.$str.'

'. + ''."\n"; + return $w->renderDiv($w->content_only,'countdown '.$w->class,'',$res); + } + } +} \ No newline at end of file diff --git a/changelog b/changelog new file mode 100644 index 0000000..b9084d6 --- /dev/null +++ b/changelog @@ -0,0 +1,7 @@ +v1.6 - 20-12-2022 - Pierre Van Glabeke +* màj partielle dc2.24 + +v1.5 - 29-07-2016 - Pierre Van Glabeke +* mise à jour script jquery 1.6.3 -> 2.0.2 +* mise à jour pour compatibilité avec dc2.9 +* dc2.9 requis \ No newline at end of file diff --git a/gpl-2.0.txt b/gpl-2.0.txt new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/gpl-2.0.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/js/countdownBasic.html b/js/countdownBasic.html new file mode 100644 index 0000000..19b3902 --- /dev/null +++ b/js/countdownBasic.html @@ -0,0 +1,32 @@ + + + + +jQuery Countdown + + + + + + + + +

jQuery Countdown Basics

+

This page demonstrates the very basics of the + jQuery Countdown plugin. + It contains the minimum requirements for using the plugin and + can be used as the basis for your own experimentation.

+

For more detail see the documentation reference page.

+

Counting down to 26 January 2014.

+
+ + diff --git a/js/countdownGlowing.gif b/js/countdownGlowing.gif new file mode 100644 index 0000000..fce60ec Binary files /dev/null and b/js/countdownGlowing.gif differ diff --git a/js/countdownLED.png b/js/countdownLED.png new file mode 100644 index 0000000..02c7a9d Binary files /dev/null and b/js/countdownLED.png differ diff --git a/js/jquery.countdown-ar.js b/js/jquery.countdown-ar.js new file mode 100644 index 0000000..873f057 --- /dev/null +++ b/js/jquery.countdown-ar.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Arabic (عربي) initialisation for the jQuery countdown extension + Translated by Talal Al Asmari (talal@psdgroups.com), April 2009. */ +(function($) { + $.countdown.regionalOptions['ar'] = { + labels: ['سنوات','أشهر','أسابيع','أيام','ساعات','دقائق','ثواني'], + labels1: ['سنة','شهر','أسبوع','يوم','ساعة','دقيقة','ثانية'], + compactLabels: ['س', 'ش', 'أ', 'ي'], + whichLabels: null, + digits: ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'], + timeSeparator: ':', isRTL: true}; + $.countdown.setDefaults($.countdown.regionalOptions['ar']); +})(jQuery); diff --git a/js/jquery.countdown-bg.js b/js/jquery.countdown-bg.js new file mode 100644 index 0000000..3995b63 --- /dev/null +++ b/js/jquery.countdown-bg.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Bulgarian initialisation for the jQuery countdown extension + * Written by Manol Trendafilov manol@rastermania.com (2010) */ +(function($) { + $.countdown.regionalOptions['bg'] = { + labels: ['Години', 'Месеца', 'Седмица', 'Дни', 'Часа', 'Минути', 'Секунди'], + 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.regionalOptions['bg']); +})(jQuery); diff --git a/js/jquery.countdown-bn.js b/js/jquery.countdown-bn.js new file mode 100644 index 0000000..505f4f9 Binary files /dev/null and b/js/jquery.countdown-bn.js differ diff --git a/js/jquery.countdown-bs.js b/js/jquery.countdown-bs.js new file mode 100644 index 0000000..17619b8 --- /dev/null +++ b/js/jquery.countdown-bs.js @@ -0,0 +1,16 @@ +/* http://keith-wood.name/countdown.html + * Bosnian Latin initialisation for the jQuery countdown extension + * Written by Miralem Mehic miralem@mehic.info (2011) */ +(function($) { + $.countdown.regionalOptions['bs'] = { + labels: ['Godina', 'Mjeseci', 'Sedmica', 'Dana', 'Sati', 'Minuta', 'Sekundi'], + labels1: ['Godina', 'Mjesec', 'Sedmica', 'Dan', 'Sat', 'Minuta', 'Sekunda'], + labels2: ['Godine', 'Mjeseca', 'Sedmica', 'Dana', 'Sata', 'Minute', 'Sekunde'], + compactLabels: ['g', 'm', 't', 'd'], + 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.regionalOptions['bs']); +})(jQuery); diff --git a/js/jquery.countdown-ca.js b/js/jquery.countdown-ca.js new file mode 100644 index 0000000..c4ef81f --- /dev/null +++ b/js/jquery.countdown-ca.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Catalan initialisation for the jQuery countdown extension + Written by Amanida Media www.amanidamedia.com (2010) */ +(function($) { + $.countdown.regionalOptions['ca'] = { + labels: ['Anys', 'Mesos', 'Setmanes', 'Dies', 'Hores', 'Minuts', 'Segons'], + 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.regionalOptions['ca']); +})(jQuery); diff --git a/js/jquery.countdown-cs.js b/js/jquery.countdown-cs.js new file mode 100644 index 0000000..ea36e1a --- /dev/null +++ b/js/jquery.countdown-cs.js @@ -0,0 +1,16 @@ +/* http://keith-wood.name/countdown.html + * Czech initialisation for the jQuery countdown extension + * Written by Roman Chlebec (creamd@c64.sk) (2008) */ +(function($) { + $.countdown.regionalOptions['cs'] = { + labels: ['Roků', 'Měsíců', 'Týdnů', 'Dní', 'Hodin', 'Minut', 'Sekund'], + labels1: ['Rok', 'Měsíc', 'Týden', 'Den', 'Hodina', 'Minuta', 'Sekunda'], + labels2: ['Roky', 'Měsíce', 'Týdny', 'Dny', 'Hodiny', 'Minuty', 'Sekundy'], + compactLabels: ['r', 'm', 't', 'd'], + 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.regionalOptions['cs']); +})(jQuery); diff --git a/js/jquery.countdown-cy.js b/js/jquery.countdown-cy.js new file mode 100644 index 0000000..adb797a --- /dev/null +++ b/js/jquery.countdown-cy.js @@ -0,0 +1 @@ +/* http://keith-wood.name/countdown.html Welsh initialisation for the jQuery countdown extension Written by Gareth Jones | http://garethvjones.com | October 2011. */ (function($) { $.countdown.regionalOptions['cy'] = { labels: ['Blynyddoedd', 'Mis', 'Wythnosau', 'Diwrnodau', 'Oriau', 'Munudau', 'Eiliadau'], labels1: ['Blwyddyn', 'Mis', 'Wythnos', 'Diwrnod', 'Awr', 'Munud', 'Eiliad'], compactLabels: ['b', 'm', 'w', 'd'], whichLabels: null, digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], timeSeparator: ':', isRTL: false}; $.countdown.setDefaults($.countdown.regionalOptions['cy']); })(jQuery); \ No newline at end of file diff --git a/js/jquery.countdown-da.js b/js/jquery.countdown-da.js new file mode 100644 index 0000000..6096a08 --- /dev/null +++ b/js/jquery.countdown-da.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Danish initialisation for the jQuery countdown extension + Written by Buch (admin@buch90.dk). */ +(function($) { + $.countdown.regionalOptions['da'] = { + labels: ['År', 'Måneder', 'Uger', 'Dage', 'Timer', 'Minutter', 'Sekunder'], + labels1: ['År', 'Måned', '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.regionalOptions['da']); +})(jQuery); diff --git a/js/jquery.countdown-de.js b/js/jquery.countdown-de.js new file mode 100644 index 0000000..3865659 --- /dev/null +++ b/js/jquery.countdown-de.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + German initialisation for the jQuery countdown extension + Written by Samuel Wulf. */ +(function($) { + $.countdown.regionalOptions['de'] = { + labels: ['Jahre', 'Monate', 'Wochen', 'Tage', 'Stunden', 'Minuten', 'Sekunden'], + 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.regionalOptions['de']); +})(jQuery); diff --git a/js/jquery.countdown-el.js b/js/jquery.countdown-el.js new file mode 100644 index 0000000..8424610 --- /dev/null +++ b/js/jquery.countdown-el.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Greek initialisation for the jQuery countdown extension + Written by Philip. */ +(function($) { + $.countdown.regionalOptions['el'] = { + labels: ['Χρόνια', 'Μήνες', 'Εβδομάδες', 'Μέρες', 'Ώρες', 'Λεπτά', 'Δευτερόλεπτα'], + labels1: ['Χρόνος', 'Μήνας', 'Εβδομάδα', 'Ημέρα', 'Ώρα', 'Λεπτό', 'Δευτερόλεπτο'], + compactLabels: ['Χρ.', 'Μην.', 'Εβδ.', 'Ημ.'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['el']); +})(jQuery); \ No newline at end of file diff --git a/js/jquery.countdown-es.js b/js/jquery.countdown-es.js new file mode 100644 index 0000000..c53a028 --- /dev/null +++ b/js/jquery.countdown-es.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Spanish initialisation for the jQuery countdown extension + * Written by Sergio Carracedo Martinez webmaster@neodisenoweb.com (2008) */ +(function($) { + $.countdown.regionalOptions['es'] = { + labels: ['Años', 'Meses', 'Semanas', 'Días', 'Horas', 'Minutos', 'Segundos'], + labels1: ['Año', 'Mes', 'Semana', 'Día', '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.regionalOptions['es']); +})(jQuery); diff --git a/js/jquery.countdown-et.js b/js/jquery.countdown-et.js new file mode 100644 index 0000000..7c98b96 --- /dev/null +++ b/js/jquery.countdown-et.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Estonian initialisation for the jQuery countdown extension + Written by Helmer */ +(function($) { + $.countdown.regionalOptions['et'] = { + labels: ['Aastat', 'Kuud', 'Nädalat', 'Päeva', 'Tundi', 'Minutit', 'Sekundit'], + 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.regionalOptions['et']); +})(jQuery); diff --git a/js/jquery.countdown-fa.js b/js/jquery.countdown-fa.js new file mode 100644 index 0000000..185dc62 --- /dev/null +++ b/js/jquery.countdown-fa.js @@ -0,0 +1,14 @@ +/* http://keith-wood.name/countdown.html + Persian (فارسی) initialisation for the jQuery countdown extension + Written by Alireza Ziaie (ziai@magfa.com) Oct 2008. + Digits corrected by Hamed Ramezanian Feb 2013. */ +(function($) { + $.countdown.regionalOptions['fa'] = { + labels: ['‌سال', 'ماه', 'هفته', 'روز', 'ساعت', 'دقیقه', 'ثانیه'], + labels1: ['سال', 'ماه', 'هفته', 'روز', 'ساعت', 'دقیقه', 'ثانیه'], + compactLabels: ['س', 'م', 'ه', 'ر'], + whichLabels: null, + digits: ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'], + timeSeparator: ':', isRTL: true}; + $.countdown.setDefaults($.countdown.regionalOptions['fa']); +})(jQuery); diff --git a/js/jquery.countdown-fi.js b/js/jquery.countdown-fi.js new file mode 100644 index 0000000..095101f --- /dev/null +++ b/js/jquery.countdown-fi.js @@ -0,0 +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@gmail.com). Corrected by Olli. */ +(function($) { + $.countdown.regionalOptions['fi'] = { + 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.regionalOptions['fi']); +})(jQuery); \ No newline at end of file diff --git a/js/jquery.countdown-fo.js b/js/jquery.countdown-fo.js new file mode 100644 index 0000000..e3d0019 --- /dev/null +++ b/js/jquery.countdown-fo.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Faroese initialisation for the jQuery countdown extension + Written by Kasper Friis Christensen (kasper@friischristensen.com). */ +(function($) { + $.countdown.regionalOptions['fo'] = { + labels: ['Ár', 'Mánaðir', 'Vikur', 'Dagar', 'Tímar', 'Minuttir', 'Sekund'], + labels1: ['Ár', 'Mánaður', 'Vika', 'Dagur', 'Tími', 'Minuttur', 'Sekund'], + compactLabels: ['Á', 'M', 'V', 'D'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['fo']); +})(jQuery); diff --git a/js/jquery.countdown-fr.js b/js/jquery.countdown-fr.js new file mode 100644 index 0000000..993481b --- /dev/null +++ b/js/jquery.countdown-fr.js @@ -0,0 +1,15 @@ +/* http://keith-wood.name/countdown.html + French initialisation for the jQuery countdown extension + Written by Keith Wood (kbwood{at}iinet.com.au) Jan 2008. */ +(function($) { + $.countdown.regionalOptions['fr'] = { + labels: ['Années', 'Mois', 'Semaines', 'Jours', 'Heures', 'Minutes', 'Secondes'], + labels1: ['Année', 'Mois', 'Semaine', 'Jour', 'Heure', 'Minute', 'Seconde'], + compactLabels: ['a', 'm', 's', 'j'], + 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.regionalOptions['fr']); +})(jQuery); diff --git a/js/jquery.countdown-gl.js b/js/jquery.countdown-gl.js new file mode 100644 index 0000000..da825ec --- /dev/null +++ b/js/jquery.countdown-gl.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Galician initialisation for the jQuery countdown extension + * Written by Moncho Pena ramon.pena.rodriguez@gmail.com (2009) and Angel Farrapeira */ +(function($) { + $.countdown.regionalOptions['gl'] = { + labels: ['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.regionalOptions['gl']); +})(jQuery); \ No newline at end of file diff --git a/js/jquery.countdown-gu.js b/js/jquery.countdown-gu.js new file mode 100644 index 0000000..7da3348 --- /dev/null +++ b/js/jquery.countdown-gu.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Gujarati initialization for the jQuery countdown extension + * Written by Sahil Jariwala jariwala.sahil@gmail.com (2012) */ +(function($) { + $.countdown.regionalOptions['gu'] = { + labels: ['વર્ષ', 'મહિનો', 'અઠવાડિયા', 'દિવસ', 'કલાક', 'મિનિટ','સેકન્ડ'], + labels1: ['વર્ષ','મહિનો','અઠવાડિયા','દિવસ','કલાક','મિનિટ', 'સેકન્ડ'], + compactLabels: ['વ', 'મ', 'અ', 'દિ'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['gu']); +})(jQuery); diff --git a/js/jquery.countdown-he.js b/js/jquery.countdown-he.js new file mode 100644 index 0000000..6349879 --- /dev/null +++ b/js/jquery.countdown-he.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Hebrew initialisation for the jQuery countdown extension + * Translated by Nir Livne, Dec 2008 */ +(function($) { + $.countdown.regionalOptions['he'] = { + labels: ['שנים', 'חודשים', 'שבועות', 'ימים', 'שעות', 'דקות', 'שניות'], + labels1: ['שנה', 'חודש', 'שבוע', 'יום', 'שעה', 'דקה', 'שנייה'], + compactLabels: ['שנ', 'ח', 'שב', 'י'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: true}; + $.countdown.setDefaults($.countdown.regionalOptions['he']); +})(jQuery); diff --git a/js/jquery.countdown-hr.js b/js/jquery.countdown-hr.js new file mode 100644 index 0000000..b10c6a7 --- /dev/null +++ b/js/jquery.countdown-hr.js @@ -0,0 +1,29 @@ +/** +* http://keith-wood.name/countdown.html +* Croatian l10n for the jQuery countdown plugin +* Written by Dejan Broz info@hqfactory.com (2011) +* Improved by zytzagoo (2014) +*/ +(function($) { + $.countdown.regionalOptions['hr'] = { + // plurals + labels: ['Godina', 'Mjeseci', 'Tjedana', 'Dana', 'Sati', 'Minuta', 'Sekundi'], + // singles + labels1: ['Godina', 'Mjesec', 'Tjedan', 'Dan', 'Sat', 'Minutu', 'Sekundu'], + // paucals + labels2: ['Godine', 'Mjeseca', 'Tjedana', 'Dana', 'Sata', 'Minute', 'Sekunde'], + compactLabels: ['g', 'm', 't', 'd'], + whichLabels: function(amount){ + amount = parseInt(amount, 10); + if (amount % 10 === 1 && amount % 100 !== 11) { + return 1; // singles (/.*1$/ && ! /.*11$/) + } + if (amount % 10 >= 2 && amount % 10 <= 4 && (amount % 100 < 10 || amount % 100 >= 20)) { + return 2; // paucals (/.*[234]$/ && ! /.*1[234]$/ + } + return 0; // default plural (most common case) + }, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['hr']); +})(jQuery); diff --git a/js/jquery.countdown-hu.js b/js/jquery.countdown-hu.js new file mode 100644 index 0000000..f6582e4 --- /dev/null +++ b/js/jquery.countdown-hu.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Hungarian initialisation for the jQuery countdown extension + * Written by Edmond L. (webmond@gmail.com). */ +(function($) { + $.countdown.regionalOptions['hu'] = { + labels: ['Év', 'Hónap', 'Hét', 'Nap', 'Óra', 'Perc', 'Másodperc'], + 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.regionalOptions['hu']); +})(jQuery); diff --git a/js/jquery.countdown-hy.js b/js/jquery.countdown-hy.js new file mode 100644 index 0000000..9992f60 --- /dev/null +++ b/js/jquery.countdown-hy.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Armenian initialisation for the jQuery countdown extension + * Written by Artur Martirosyan. (artur{at}zoom.am) October 2011. */ +(function($) { + $.countdown.regionalOptions['hy'] = { + labels: ['Տարի', 'Ամիս', 'Շաբաթ', 'Օր', 'Ժամ', 'Րոպե', 'Վարկյան'], + labels1: ['Տարի', 'Ամիս', 'Շաբաթ', 'Օր', 'Ժամ', 'Րոպե', 'Վարկյան'], + compactLabels: ['տ', 'ա', 'շ', 'օ'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['hy']); +})(jQuery); diff --git a/js/jquery.countdown-id.js b/js/jquery.countdown-id.js new file mode 100644 index 0000000..748ed04 --- /dev/null +++ b/js/jquery.countdown-id.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Indonesian initialisation for the jQuery countdown extension + Written by Erwin Yonathan Jan 2009. */ +(function($) { + $.countdown.regionalOptions['id'] = { + labels: ['tahun', 'bulan', 'minggu', 'hari', 'jam', 'menit', 'detik'], + 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.regionalOptions['id']); +})(jQuery); diff --git a/js/jquery.countdown-is.js b/js/jquery.countdown-is.js new file mode 100644 index 0000000..aaf6895 --- /dev/null +++ b/js/jquery.countdown-is.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Icelandic initialisation for the jQuery countdown extension + Written by Róbert K. L. */ +(function($) { + $.countdown.regionalOptions['is'] = { + labels: ['Ár', 'Mánuðir', 'Vikur', 'Dagar', 'Klukkustundir', 'Mínútur', 'Sekúndur'], + labels1: ['Ár', 'Mánuður', 'Vika', 'Dagur', 'Klukkustund', 'Mínúta', 'Sekúnda'], + compactLabels: ['ár.', 'mán.', 'vik.', 'dag.', 'klst.', 'mín.', 'sek.'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['is']); +})(jQuery); \ No newline at end of file diff --git a/js/jquery.countdown-it.js b/js/jquery.countdown-it.js new file mode 100644 index 0000000..6e01567 --- /dev/null +++ b/js/jquery.countdown-it.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Italian initialisation for the jQuery countdown extension + * Written by Davide Bellettini (davide.bellettini@gmail.com) and Roberto Chiaveri Feb 2008. */ +(function($) { + $.countdown.regionalOptions['it'] = { + labels: ['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.regionalOptions['it']); +})(jQuery); diff --git a/js/jquery.countdown-ja.js b/js/jquery.countdown-ja.js new file mode 100644 index 0000000..5d85e3a --- /dev/null +++ b/js/jquery.countdown-ja.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Japanese initialisation for the jQuery countdown extension + Written by Ken Ishimoto (ken@ksroom.com) Aug 2009. */ +(function($) { + $.countdown.regionalOptions['ja'] = { + labels: ['年', '月', '週', '日', '時', '分', '秒'], + labels1: ['年', '月', '週', '日', '時', '分', '秒'], + compactLabels: ['年', '月', '週', '日'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['ja']); +})(jQuery); diff --git a/js/jquery.countdown-kn.js b/js/jquery.countdown-kn.js new file mode 100644 index 0000000..377c954 --- /dev/null +++ b/js/jquery.countdown-kn.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Kannada initialization for the jQuery countdown extension + * Written by Guru Chaturvedi guru@gangarasa.com (2011) */ +(function($) { + $.countdown.regionalOptions['kn'] = { + labels: ['ವರ್ಷಗಳು', 'ತಿಂಗಳು', 'ವಾರಗಳು', 'ದಿನಗಳು', 'ಘಂಟೆಗಳು', 'ನಿಮಿಷಗಳು', 'ಕ್ಷಣಗಳು'], + labels1: ['ವರ್ಷ', 'ತಿಂಗಳು', 'ವಾರ', 'ದಿನ', 'ಘಂಟೆ', 'ನಿಮಿಷ', 'ಕ್ಷಣ'], + compactLabels: ['ವ', 'ತಿ', 'ವಾ', 'ದಿ'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['kn']); +})(jQuery); diff --git a/js/jquery.countdown-ko.js b/js/jquery.countdown-ko.js new file mode 100644 index 0000000..161ee89 --- /dev/null +++ b/js/jquery.countdown-ko.js @@ -0,0 +1,14 @@ +/* http://keith-wood.name/countdown.html + Korean initialisation for the jQuery countdown extension + Written by Ryan Yu (ryanyu79@gmail.com). */ +(function($) { + $.countdown.regionalOptions['ko'] = { + labels: ['년', '월', '주', '일', '시', '분', '초'], + labels1: ['년', '월', '주', '일', '시', '분', '초'], + compactLabels: ['년', '월', '주', '일'], + compactLabels1: ['년', '월', '주', '일'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['ko']); +})(jQuery); diff --git a/js/jquery.countdown-lt.js b/js/jquery.countdown-lt.js new file mode 100644 index 0000000..80122e4 --- /dev/null +++ b/js/jquery.countdown-lt.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Lithuanian localisation for the jQuery countdown extension + * Written by Moacir P. de Sá Pereira (moacir{at}gmail.com) (2009) */ +(function($) { + $.countdown.regionalOptions['lt'] = { + labels: ['Metų', 'Mėnesių', 'Savaičių', 'Dienų', 'Valandų', 'Minučių', 'Sekundžių'], + 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.regionalOptions['lt']); +})(jQuery); diff --git a/js/jquery.countdown-lv.js b/js/jquery.countdown-lv.js new file mode 100644 index 0000000..f426a02 --- /dev/null +++ b/js/jquery.countdown-lv.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Latvian initialisation for the jQuery countdown extension + * Written by Jānis Peisenieks janis.peisenieks@gmail.com (2010) */ +(function($) { + $.countdown.regionalOptions['lv'] = { + labels: ['Gadi', 'Mēneši', 'Nedēļas', 'Dienas', 'Stundas', 'Minūtes', 'Sekundes'], + 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.regionalOptions['lv']); +})(jQuery); diff --git a/js/jquery.countdown-ml.js b/js/jquery.countdown-ml.js new file mode 100644 index 0000000..2c48f0d --- /dev/null +++ b/js/jquery.countdown-ml.js @@ -0,0 +1,14 @@ +/* http://keith-wood.name/countdown.html + * Malayalam/(Indian>>Kerala) initialisation for the jQuery countdown extension + * Written by Harilal.B (harilal1234@gmail.com) Feb 2013. */ +(function($) { + $.countdown.regionalOptions['ml'] = { + labels: ['വര്‍ഷങ്ങള്‍', 'മാസങ്ങള്‍', 'ആഴ്ചകള്‍', 'ദിവസങ്ങള്‍', 'മണിക്കൂറുകള്‍', 'മിനിറ്റുകള്‍', 'സെക്കന്റുകള്‍'], + labels1: ['വര്‍ഷം', 'മാസം', 'ആഴ്ച', 'ദിവസം', 'മണിക്കൂര്‍', 'മിനിറ്റ്', 'സെക്കന്റ്'], + compactLabels: ['വ', 'മ', 'ആ', 'ദി'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], +// digits: ['൦', '൧', '൨', '൩', '൪', '൫', '൬', '൭', '൮', '൯'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['ml']); +})(jQuery); \ No newline at end of file diff --git a/js/jquery.countdown-ms.js b/js/jquery.countdown-ms.js new file mode 100644 index 0000000..50c7532 --- /dev/null +++ b/js/jquery.countdown-ms.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Malay initialisation for the jQuery countdown extension + Written by Jason Ong (jason{at}portalgroove.com) May 2010. */ +(function($) { + $.countdown.regionalOptions['ms'] = { + labels: ['Tahun', 'Bulan', 'Minggu', 'Hari', 'Jam', 'Minit', 'Saat'], + 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.regionalOptions['ms']); +})(jQuery); diff --git a/js/jquery.countdown-my.js b/js/jquery.countdown-my.js new file mode 100644 index 0000000..c163cc0 --- /dev/null +++ b/js/jquery.countdown-my.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Burmese initialisation for the jQuery countdown extension + Written by Win Lwin Moe (winnlwinmoe@gmail.com) Dec 2009. */ +(function($) { + $.countdown.regionalOptions['my'] = { + labels: ['နွစ္', 'လ', 'ရက္သတဿတပတ္', 'ရက္', 'နာရီ', 'မိနစ္', 'စကဿကန့္'], + labels1: ['နွစ္', 'လ', 'ရက္သတဿတပတ္', 'ရက္', 'နာရီ', 'မိနစ္', 'စကဿကန့္'], + compactLabels: ['နွစ္', 'လ', 'ရက္သတဿတပတ္', 'ရက္'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['my']); +})(jQuery); \ No newline at end of file diff --git a/js/jquery.countdown-nb.js b/js/jquery.countdown-nb.js new file mode 100644 index 0000000..b86adf9 --- /dev/null +++ b/js/jquery.countdown-nb.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Norwegian Bokmål translation + Written by Kristian Ravnevand */ +(function($) { + $.countdown.regionalOptions['nb'] = { + labels: ['År', 'Måneder', 'Uker', 'Dager', 'Timer', 'Minutter', 'Sekunder'], + 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.regionalOptions['nb']); +})(jQuery); diff --git a/js/jquery.countdown-nl.js b/js/jquery.countdown-nl.js new file mode 100644 index 0000000..a0c0a50 --- /dev/null +++ b/js/jquery.countdown-nl.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Dutch initialisation for the jQuery countdown extension + Written by Mathias Bynens Mar 2008. */ +(function($) { + $.countdown.regionalOptions['nl'] = { + labels: ['Jaren', 'Maanden', 'Weken', 'Dagen', 'Uren', 'Minuten', 'Seconden'], + 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.regionalOptions['nl']); +})(jQuery); diff --git a/js/jquery.countdown-pl.js b/js/jquery.countdown-pl.js new file mode 100644 index 0000000..952c53f --- /dev/null +++ b/js/jquery.countdown-pl.js @@ -0,0 +1,18 @@ +/* http://keith-wood.name/countdown.html + * Polish initialisation for the jQuery countdown extension + * Written by Pawel Lewtak lewtak@gmail.com (2008) */ +(function($) { + $.countdown.regionalOptions['pl'] = { + labels: ['lat', 'miesięcy', 'tygodni', 'dni', 'godzin', 'minut', 'sekund'], + labels1: ['rok', 'miesiąc', 'tydzień', 'dzień', 'godzina', 'minuta', 'sekunda'], + labels2: ['lata', 'miesiące', 'tygodnie', 'dni', 'godziny', 'minuty', 'sekundy'], + compactLabels: ['l', 'm', 't', 'd'], compactLabels1: ['r', 'm', 't', 'd'], + 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 : 0)); + }, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['pl']); +})(jQuery); diff --git a/js/jquery.countdown-pt-BR.js b/js/jquery.countdown-pt-BR.js new file mode 100644 index 0000000..16f3f23 --- /dev/null +++ b/js/jquery.countdown-pt-BR.js @@ -0,0 +1,14 @@ +/* http://keith-wood.name/countdown.html + Brazilian initialisation for the jQuery countdown extension + Translated by Marcelo Pellicano de Oliveira (pellicano@gmail.com) Feb 2008. + and Juan Roldan (juan.roldan[at]relayweb.com.br) Mar 2012. */ +(function($) { + $.countdown.regionalOptions['pt-BR'] = { + labels: ['Anos', 'Meses', 'Semanas', 'Dias', 'Horas', 'Minutos', 'Segundos'], + labels1: ['Ano', 'Ms', '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.regionalOptions['pt-BR']); +})(jQuery); diff --git a/js/jquery.countdown-ro.js b/js/jquery.countdown-ro.js new file mode 100644 index 0000000..37f34ac --- /dev/null +++ b/js/jquery.countdown-ro.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Romanian initialisation for the jQuery countdown extension + * Written by Edmond L. (webmond@gmail.com). */ +(function($) { + $.countdown.regionalOptions['ro'] = { + labels: ['Ani', 'Luni', 'Saptamani', 'Zile', 'Ore', 'Minute', 'Secunde'], + 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.regionalOptions['ro']); +})(jQuery); diff --git a/js/jquery.countdown-ru.js b/js/jquery.countdown-ru.js new file mode 100644 index 0000000..a53c1c9 --- /dev/null +++ b/js/jquery.countdown-ru.js @@ -0,0 +1,19 @@ +/* http://keith-wood.name/countdown.html + * Russian initialisation for the jQuery countdown extension + * Written by Sergey K. (xslade{at}gmail.com) June 2010. */ +(function($) { + $.countdown.regionalOptions['ru'] = { + labels: ['Лет', 'Месяцев', 'Недель', 'Дней', 'Часов', 'Минут', 'Секунд'], + labels1: ['Год', 'Месяц', 'Неделя', 'День', 'Час', 'Минута', 'Секунда'], + labels2: ['Года', 'Месяца', 'Недели', 'Дня', 'Часа', 'Минуты', 'Секунды'], + 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.regionalOptions['ru']); +})(jQuery); \ No newline at end of file diff --git a/js/jquery.countdown-sk.js b/js/jquery.countdown-sk.js new file mode 100644 index 0000000..341fbe0 --- /dev/null +++ b/js/jquery.countdown-sk.js @@ -0,0 +1,16 @@ +/* http://keith-wood.name/countdown.html + * Slovak initialisation for the jQuery countdown extension + * Written by Roman Chlebec (creamd@c64.sk) (2008) */ +(function($) { + $.countdown.regionalOptions['sk'] = { + labels: ['Rokov', 'Mesiacov', 'Týždňov', 'Dní', 'Hodín', 'Minút', 'Sekúnd'], + labels1: ['Rok', 'Mesiac', 'Týždeň', 'Deň', 'Hodina', 'Minúta', 'Sekunda'], + labels2: ['Roky', 'Mesiace', 'Týždne', 'Dni', 'Hodiny', 'Minúty', 'Sekundy'], + compactLabels: ['r', 'm', 't', 'd'], + 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.regionalOptions['sk']); +})(jQuery); diff --git a/js/jquery.countdown-sl.js b/js/jquery.countdown-sl.js new file mode 100644 index 0000000..7053149 --- /dev/null +++ b/js/jquery.countdown-sl.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Slovenian localisation for the jQuery countdown extension + * Written by Borut Tomažin (debijan{at}gmail.com) (2011) */ +(function($) { + $.countdown.regionalOptions['sl'] = { + labels: ['Let', 'Mesecev', 'Tednov', 'Dni', 'Ur', 'Minut', 'Sekund'], + 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.regionalOptions['sl']); +})(jQuery); diff --git a/js/jquery.countdown-sq.js b/js/jquery.countdown-sq.js new file mode 100644 index 0000000..db58bd8 --- /dev/null +++ b/js/jquery.countdown-sq.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Albanian initialisation for the jQuery countdown extension + Written by Erzen Komoni. */ +(function($) { + $.countdown.regionalOptions['sq'] = { + labels: ['Vite', 'Muaj', 'Javë', 'Ditë', 'Orë', 'Minuta', 'Sekonda'], + labels1: ['Vit', 'Muaj', 'Javë', 'Dit', 'Orë', 'Minutë', 'Sekond'], + compactLabels: ['V', 'M', 'J', 'D'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['sq']); +})(jQuery); \ No newline at end of file diff --git a/js/jquery.countdown-sr-SR.js b/js/jquery.countdown-sr-SR.js new file mode 100644 index 0000000..f13a8d6 --- /dev/null +++ b/js/jquery.countdown-sr-SR.js @@ -0,0 +1,16 @@ +/* http://keith-wood.name/countdown.html + * Serbian Latin initialisation for the jQuery countdown extension + * Written by Predrag Leka lp@lemurcake.com (2010) */ +(function($) { + $.countdown.regionalOptions['sr-SR'] = { + labels: ['Godina', 'Meseci', 'Nedelja', 'Dana', 'Časova', 'Minuta', 'Sekundi'], + labels1: ['Godina', 'Mesec', 'Nedelja', 'Dan', 'Čas', 'Minut', 'Sekunda'], + labels2: ['Godine', 'Meseca', 'Nedelje', 'Dana', 'Časa', 'Minuta', 'Sekunde'], + compactLabels: ['g', 'm', 'n', 'd'], + 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.regionalOptions['sr-SR']); +})(jQuery); diff --git a/js/jquery.countdown-sr.js b/js/jquery.countdown-sr.js new file mode 100644 index 0000000..085d2a9 --- /dev/null +++ b/js/jquery.countdown-sr.js @@ -0,0 +1,16 @@ +/* http://keith-wood.name/countdown.html + * Serbian Cyrillic initialisation for the jQuery countdown extension + * Written by Predrag Leka lp@lemurcake.com (2010) */ +(function($) { + $.countdown.regionalOptions['sr'] = { + labels: ['Година', 'Месеци', 'Недеља', 'Дана', 'Часова', 'Минута', 'Секунди'], + labels1: ['Година', 'месец', 'Недеља', 'Дан', 'Час', 'Минут', 'Секунда'], + labels2: ['Године', 'Месеца', 'Недеље', 'Дана', 'Часа', 'Минута', 'Секунде'], + compactLabels: ['г', 'м', 'н', 'д'], + 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.regionalOptions['sr']); +})(jQuery); diff --git a/js/jquery.countdown-sv.js b/js/jquery.countdown-sv.js new file mode 100644 index 0000000..ba81bc6 --- /dev/null +++ b/js/jquery.countdown-sv.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Swedish initialisation for the jQuery countdown extension + Written by Carl (carl@nordenfelt.com). */ +(function($) { + $.countdown.regionalOptions['sv'] = { + labels: ['År', 'Månader', 'Veckor', 'Dagar', 'Timmar', 'Minuter', 'Sekunder'], + 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.regionalOptions['sv']); +})(jQuery); diff --git a/js/jquery.countdown-th.js b/js/jquery.countdown-th.js new file mode 100644 index 0000000..31c0553 --- /dev/null +++ b/js/jquery.countdown-th.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Thai initialisation for the jQuery countdown extension + Written by Pornchai Sakulsrimontri (li_sin_th@yahoo.com). */ +(function($) { + $.countdown.regionalOptions['th'] = { + labels: ['ปี', 'เดือน', 'สัปดาห์', 'วัน', 'ชั่วโมง', 'นาที', 'วินาที'], + labels1: ['ปี', 'เดือน', 'สัปดาห์', 'วัน', 'ชั่วโมง', 'นาที', 'วินาที'], + compactLabels: ['ปี', 'เดือน', 'สัปดาห์', 'วัน'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['th']); +})(jQuery); diff --git a/js/jquery.countdown-tr.js b/js/jquery.countdown-tr.js new file mode 100644 index 0000000..095563e --- /dev/null +++ b/js/jquery.countdown-tr.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html +* Turkish initialisation for the jQuery countdown extension +* Written by Bekir Ahmetoğlu (bekir@cerek.com) Aug 2008. */ +(function($) { + $.countdown.regionalOptions['tr'] = { + labels: ['Yıl', 'Ay', 'Hafta', 'Gün', 'Saat', 'Dakika', 'Saniye'], + 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.regionalOptions['tr']); +})(jQuery); diff --git a/js/jquery.countdown-uk.js b/js/jquery.countdown-uk.js new file mode 100644 index 0000000..8eb2fa6 --- /dev/null +++ b/js/jquery.countdown-uk.js @@ -0,0 +1,16 @@ +/* http://keith-wood.name/countdown.html + * Ukrainian initialisation for the jQuery countdown extension + * Written by Goloborodko M misha.gm@gmail.com (2009), corrections by Iгор Kоновал */ +(function($) { + $.countdown.regionalOptions['uk'] = { + labels: ['Років', 'Місяців', 'Тижнів', 'Днів', 'Годин', 'Хвилин', 'Секунд'], + labels1: ['Рік', 'Місяць', 'Тиждень', 'День', 'Година', 'Хвилина', 'Секунда'], + labels2: ['Роки', 'Місяці', 'Тижні', 'Дні', 'Години', 'Хвилини', 'Секунди'], + compactLabels: ['r', 'm', 't', 'd'], + 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.regionalOptions['uk']); +})(jQuery); diff --git a/js/jquery.countdown-ur.js b/js/jquery.countdown-ur.js new file mode 100644 index 0000000..8edcc9d --- /dev/null +++ b/js/jquery.countdown-ur.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Urdu (اردو) initialisation for the jQuery countdown extension + Translated by Azhar Rasheed (azhar.rasheed19@gmail.com), November 2013. */ +(function($) { + $.countdown.regionalOptions['ur'] = { + labels: ['سال','مہينے','ہفتے','دن','گھنٹے','منٹس','سيکنڑز'], + labels1: ['سال','ماہ','ہفتہ','دن','گھنٹہ','منٹ','سیکنڈز'], + compactLabels: ['(ق)', 'سینٹ', 'ایک', 'J'], + whichLabels: null, + digits: ['٠', '١', '٢', '٣', '۴', '۵', '۶', '۷', '٨', '٩'], + timeSeparator: ':', isRTL: true}; + $.countdown.setDefaults($.countdown.regionalOptions['ur']); +})(jQuery); diff --git a/js/jquery.countdown-uz.js b/js/jquery.countdown-uz.js new file mode 100644 index 0000000..4e8cc17 --- /dev/null +++ b/js/jquery.countdown-uz.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Uzbek initialisation for the jQuery countdown extension + * Written by Alisher U. (ulugbekov{at}gmail.com) August 2012. */ +(function($) { + $.countdown.regionalOptions['uz'] = { + labels: ['Yil', 'Oy', 'Hafta', 'Kun', 'Soat', 'Daqiqa', 'Soniya'], + labels1: ['Yil', 'Oy', 'Hafta', 'Kun', 'Soat', 'Daqiqa', 'Soniya'], + compactLabels: ['y', 'o', 'h', 'k'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['uz']); +})(jQuery); \ No newline at end of file diff --git a/js/jquery.countdown-vi.js b/js/jquery.countdown-vi.js new file mode 100644 index 0000000..93be744 --- /dev/null +++ b/js/jquery.countdown-vi.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + * Vietnamese initialisation for the jQuery countdown extension + * Written by Pham Tien Hung phamtienhung@gmail.com (2010) */ +(function($) { + $.countdown.regionalOptions['vi'] = { + labels: ['Năm', 'Tháng', 'Tuần', 'Ngày', 'Giờ', 'Phút', 'Giây'], + 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.regionalOptions['vi']); +})(jQuery); \ No newline at end of file diff --git a/js/jquery.countdown-zh-CN.js b/js/jquery.countdown-zh-CN.js new file mode 100644 index 0000000..6d98e94 --- /dev/null +++ b/js/jquery.countdown-zh-CN.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Simplified Chinese initialisation for the jQuery countdown extension + Written by Cloudream (cloudream@gmail.com). */ +(function($) { + $.countdown.regionalOptions['zh-CN'] = { + labels: ['年', '月', '周', '天', '时', '分', '秒'], + labels1: ['年', '月', '周', '天', '时', '分', '秒'], + compactLabels: ['年', '月', '周', '天'], compactLabels1: ['年', '月', '周', '天'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['zh-CN']); +})(jQuery); diff --git a/js/jquery.countdown-zh-TW.js b/js/jquery.countdown-zh-TW.js new file mode 100644 index 0000000..3de5933 --- /dev/null +++ b/js/jquery.countdown-zh-TW.js @@ -0,0 +1,13 @@ +/* http://keith-wood.name/countdown.html + Traditional Chinese initialisation for the jQuery countdown extension + Written by Cloudream (cloudream@gmail.com). */ +(function($) { + $.countdown.regionalOptions['zh-TW'] = { + labels: ['年', '月', '周', '天', '時', '分', '秒'], + labels1: ['年', '月', '周', '天', '時', '分', '秒'], + compactLabels: ['年', '月', '周', '天'], compactLabels1: ['年', '月', '周', '天'], + whichLabels: null, + digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], + timeSeparator: ':', isRTL: false}; + $.countdown.setDefaults($.countdown.regionalOptions['zh-TW']); +})(jQuery); diff --git a/js/jquery.countdown.css b/js/jquery.countdown.css new file mode 100644 index 0000000..4e48b1c --- /dev/null +++ b/js/jquery.countdown.css @@ -0,0 +1,54 @@ +/* jQuery Countdown styles 2.0.0. */ +.is-countdown { + border: 1px solid #ccc; + background-color: #eee; +} +.countdown-rtl { + direction: rtl; +} +.countdown-holding span { + color: #888; +} +.countdown-row { + clear: both; + width: 100%; + padding: 0px 2px; + text-align: center; +} +.countdown-show1 .countdown-section { + width: 98%; +} +.countdown-show2 .countdown-section { + width: 48%; +} +.countdown-show3 .countdown-section { + width: 32.5%; +} +.countdown-show4 .countdown-section { + width: 24.5%; +} +.countdown-show5 .countdown-section { + width: 19.5%; +} +.countdown-show6 .countdown-section { + width: 16.25%; +} +.countdown-show7 .countdown-section { + width: 14%; +} +.countdown-section { + display: block; + float: left; + font-size: 75%; + text-align: center; +} +.countdown-amount { + font-size: 200%; +} +.countdown-period { + display: block; +} +.countdown-descr { + display: block; + width: 100%; +} diff --git a/js/jquery.countdown.js b/js/jquery.countdown.js new file mode 100644 index 0000000..d330372 --- /dev/null +++ b/js/jquery.countdown.js @@ -0,0 +1,885 @@ +/* http://keith-wood.name/countdown.html + Countdown for jQuery v2.0.2. + Written by Keith Wood (kbwood{at}iinet.com.au) January 2008. + Available under the MIT (http://keith-wood.name/licence.html) license. + Please attribute the author if you use it. */ + +(function($) { // Hide scope, no $ conflict + + var pluginName = 'countdown'; + + var Y = 0; // Years + var O = 1; // Months + var W = 2; // Weeks + var D = 3; // Days + var H = 4; // Hours + var M = 5; // Minutes + var S = 6; // Seconds + + /** Create the countdown plugin. +

Sets an element to show the time remaining until a given instant.

+

Expects HTML like:

+
<div></div>
+

Provide inline configuration like:

+
<div data-countdown="name: 'value'"></div>
+ @module Countdown + @augments JQPlugin + @example $(selector).countdown({until: +300}) */ + $.JQPlugin.createPlugin({ + + /** The name of the plugin. */ + name: pluginName, + + /** Countdown expiry callback. + Triggered when the countdown expires. + @callback expiryCallback */ + + /** Countdown server synchronisation callback. + Triggered when the countdown is initialised. + @callback serverSyncCallback + @return {Date} The current date/time on the server as expressed in the local timezone. */ + + /** Countdown tick callback. + Triggered on every tickInterval ticks of the countdown. + @callback tickCallback + @param periods {number[]} The breakdown by period (years, months, weeks, days, + hours, minutes, seconds) of the time remaining/passed. */ + + /** Countdown which labels callback. + Triggered when the countdown is being display to determine which set of labels + (labels, labels1, ...) are to be used for the current period value. + @callback whichLabelsCallback + @param num {number} The current period value. + @return {number} The suffix for the label set to use. */ + + /** Default settings for the plugin. + @property until {Date|number|string} The date/time to count down to, or number of seconds + offset from now, or string of amounts and units for offset(s) from now: + 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds. + @example until: new Date(2013, 12-1, 25, 13, 30) + until: +300 + until: '+1O -2D' + @property [since] {Date|number|string} The date/time to count up from, or + number of seconds offset from now, or string for unit offset(s): + 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds. + @example since: new Date(2013, 1-1, 1) + since: -300 + since: '-1O +2D' + @property [timezone=null] {number} The timezone (hours or minutes from GMT) for the target times, + or null for client local timezone. + @example timezone: +10 + timezone: -60 + @property [serverSync=null] {serverSyncCallback} A function to retrieve the current server time + for synchronisation. + @property [format='dHMS'] {string} The format for display - upper case for always, lower case only if non-zero, + 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds. + @property [layout=''] {string} Build your own layout for the countdown. + @example layout: '{d<}{dn} {dl}{d>} {hnn}:{mnn}:{snn}' + @property [compact=false] {boolean} True to display in a compact format, false for an expanded one. + @property [padZeroes=false] {boolean} True to add leading zeroes + @property [significant=0] {number} The number of periods with non-zero values to show, zero for all. + @property [description=''] {string} The description displayed for the countdown. + @property [expiryUrl=''] {string} A URL to load upon expiry, replacing the current page. + @property [expiryText=''] {string} Text to display upon expiry, replacing the countdown. This may be HTML. + @property [alwaysExpire=false] {boolean} True to trigger onExpiry even if target time has passed. + @property [onExpiry=null] {expiryCallback} Callback when the countdown expires - + receives no parameters and this is the containing division. + @example onExpiry: function() { + ... + } + @property [onTick=null] {tickCallback} Callback when the countdown is updated - + receives number[7] being the breakdown by period + (years, months, weeks, days, hours, minutes, seconds - based on + format) and this is the containing division. + @example onTick: function(periods) { + var secs = $.countdown.periodsToSeconds(periods); + if (secs < 300) { // Last five minutes + ... + } + } + @property [tickInterval=1] {number} The interval (seconds) between onTick callbacks. */ + defaultOptions: { + until: null, + since: null, + timezone: null, + serverSync: null, + format: 'dHMS', + layout: '', + compact: false, + padZeroes: false, + significant: 0, + description: '', + expiryUrl: '', + expiryText: '', + alwaysExpire: false, + onExpiry: null, + onTick: null, + tickInterval: 1 + }, + + /** Localisations for the plugin. + Entries are objects indexed by the language code ('' being the default US/English). + Each object has the following attributes. + @property [labels=['Years','Months','Weeks','Days','Hours','Minutes','Seconds']] {string[]} + The display texts for the counter periods. + @property [labels1=['Year','Month','Week','Day','Hour','Minute','Second']] {string[]} + The display texts for the counter periods if they have a value of 1. + Add other labelsn attributes as necessary to + cater for other numeric idiosyncrasies of the localisation. + @property [compactLabels=['y','m','w','d']] {string[]} The compact texts for the counter periods. + @property [whichLabels=null] {whichLabelsCallback} A function to determine which + labelsn to use. + @example whichLabels: function(num) { + return (num > 1 ? 0 : 1); + } + @property [digits=['0','1',...,'9']] {number[]} The digits to display (0-9). + @property [timeSeparator=':'] {string} Separator for time periods in the compact layout. + @property [isRTL=false] {boolean} True for right-to-left languages, false for left-to-right. */ + regionalOptions: { // Available regional settings, indexed by language/country code + '': { // Default regional settings - English/US + 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 + } + }, + + /** Names of getter methods - those that can't be chained. */ + _getters: ['getTimes'], + + /* Class name for the right-to-left marker. */ + _rtlClass: pluginName + '-rtl', + /* Class name for the countdown section marker. */ + _sectionClass: pluginName + '-section', + /* Class name for the period amount marker. */ + _amountClass: pluginName + '-amount', + /* Class name for the period name marker. */ + _periodClass: pluginName + '-period', + /* Class name for the countdown row marker. */ + _rowClass: pluginName + '-row', + /* Class name for the holding countdown marker. */ + _holdingClass: pluginName + '-holding', + /* Class name for the showing countdown marker. */ + _showClass: pluginName + '-show', + /* Class name for the description marker. */ + _descrClass: pluginName + '-descr', + + /* List of currently active countdown elements. */ + _timerElems: [], + + /** Additional setup for the countdown. + Apply default localisations. + Create the timer. */ + _init: function() { + var self = this; + this._super(); + 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 < 1e12 ? // New HTML5 high resolution timer + (perfAvail ? (performance.now() + performance.timing.navigationStart) : now()) : + // Integer milliseconds since unix epoch + timestamp || now()); + if (drawStart - animationStartTime >= 1000) { + self._updateElems(); + 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 animationStartTime = 0; + if (!requestAnimationFrame || $.noRequestAnimationFrame) { + $.noRequestAnimationFrame = null; + setInterval(function() { self._updateElems(); }, 980); // Fall back to good old setInterval + } + else { + animationStartTime = window.animationStartTime || + window.webkitAnimationStartTime || window.mozAnimationStartTime || + window.oAnimationStartTime || window.msAnimationStartTime || now(); + requestAnimationFrame(timerCallBack); + } + }, + + /** Convert a date/time to UTC. + @param tz {number} The hour or minute offset from GMT, e.g. +9, -360. + @param year {Date|number} the date/time in that timezone or the year in that timezone. + @param [month] {number} The month (0 - 11) (omit if year is a Date). + @param [day] {number} The day (omit if year is a Date). + @param [hours] {number} The hour (omit if year is a Date). + @param [mins] {number} The minute (omit if year is a Date). + @param [secs] {number} The second (omit if year is a Date). + @param [ms] {number} The millisecond (omit if year is a Date). + @return {Date} The equivalent UTC date/time. + @example $.countdown.UTCDate(+10, 2013, 12-1, 25, 12, 0) + $.countdown.UTCDate(-7, new Date(2013, 12-1, 25, 12, 0)) */ + UTCDate: function(tz, year, month, day, hours, mins, secs, ms) { + if (typeof year == 'object' && year.constructor == Date) { + ms = year.getMilliseconds(); + secs = year.getSeconds(); + mins = year.getMinutes(); + hours = year.getHours(); + day = year.getDate(); + month = year.getMonth(); + year = year.getFullYear(); + } + var d = new Date(); + d.setUTCFullYear(year); + d.setUTCDate(1); + d.setUTCMonth(month || 0); + d.setUTCDate(day || 1); + d.setUTCHours(hours || 0); + d.setUTCMinutes((mins || 0) - (Math.abs(tz) < 30 ? tz * 60 : tz)); + d.setUTCSeconds(secs || 0); + d.setUTCMilliseconds(ms || 0); + return d; + }, + + /** Convert a set of periods into seconds. + Averaged for months and years. + @param periods {number[]} The periods per year/month/week/day/hour/minute/second. + @return {number} The corresponding number of seconds. + @example var secs = $.countdown.periodsToSeconds(periods) */ + periodsToSeconds: function(periods) { + return periods[0] * 31557600 + periods[1] * 2629800 + periods[2] * 604800 + + periods[3] * 86400 + periods[4] * 3600 + periods[5] * 60 + periods[6]; + }, + + /** Resynchronise the countdowns with the server. + @example $.countdown.resync() */ + resync: function() { + var self = this; + $('.' + this._getMarker()).each(function() { // Each countdown + var inst = $.data(this, self.name); + if (inst.options.serverSync) { // If synced + var serverSync = null; + for (var i = 0; i < self._serverSyncs.length; i++) { + if (self._serverSyncs[i][0] == inst.options.serverSync) { // Find sync details + serverSync = self._serverSyncs[i]; + break; + } + } + if (serverSync[2] == null) { // Recalculate if missing + var serverResult = ($.isFunction(inst.options.serverSync) ? + inst.options.serverSync.apply(this, []) : null); + serverSync[2] = + (serverResult ? new Date().getTime() - serverResult.getTime() : 0) - serverSync[1]; + } + if (inst._since) { // Apply difference + inst._since.setMilliseconds(inst._since.getMilliseconds() + serverSync[2]); + } + inst._until.setMilliseconds(inst._until.getMilliseconds() + serverSync[2]); + } + }); + for (var i = 0; i < self._serverSyncs.length; i++) { // Update sync details + if (self._serverSyncs[i][2] != null) { + self._serverSyncs[i][1] += self._serverSyncs[i][2]; + delete self._serverSyncs[i][2]; + } + } + }, + + _instSettings: function(elem, options) { + return {_periods: [0, 0, 0, 0, 0, 0, 0]}; + }, + + /** Add an element to the list of active ones. + @private + @param elem {Element} The countdown element. */ + _addElem: function(elem) { + if (!this._hasElem(elem)) { + this._timerElems.push(elem); + } + }, + + /** See if an element is in the list of active ones. + @private + @param elem {Element} The countdown element. + @return {boolean} True if present, false if not. */ + _hasElem: function(elem) { + return ($.inArray(elem, this._timerElems) > -1); + }, + + /** Remove an element from the list of active ones. + @private + @param elem {Element} The countdown element. */ + _removeElem: function(elem) { + this._timerElems = $.map(this._timerElems, + function(value) { return (value == elem ? null : value); }); // delete entry + }, + + /** Update each active timer element. + @private */ + _updateElems: function() { + for (var i = this._timerElems.length - 1; i >= 0; i--) { + this._updateCountdown(this._timerElems[i]); + } + }, + + _optionsChanged: function(elem, inst, options) { + 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(elem, inst, + options.until != null || options.since != null || timezoneChanged); + var now = new Date(); + if ((inst._since && inst._since < now) || (inst._until && inst._until > now)) { + this._addElem(elem[0]); + } + this._updateCountdown(elem, inst); + }, + + /** Redisplay the countdown with an updated display. + @private + @param elem {Element|jQuery} The containing division. + @param inst {object} The current settings for this instance. */ + _updateCountdown: function(elem, inst) { + elem = elem.jquery ? elem : $(elem); + inst = inst || this._getInst(elem); + if (!inst) { + return; + } + elem.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, inst.options.significant, new Date()); + if (inst.options.tickInterval == 1 || + this.periodsToSeconds(periods) % inst.options.tickInterval == 0) { + inst.options.onTick.apply(elem[0], [periods]); + } + } + var expired = inst._hold != 'pause' && + (inst._since ? inst._now.getTime() < inst._since.getTime() : + inst._now.getTime() >= inst._until.getTime()); + if (expired && !inst._expiring) { + inst._expiring = true; + if (this._hasElem(elem[0]) || inst.options.alwaysExpire) { + this._removeElem(elem[0]); + if ($.isFunction(inst.options.onExpiry)) { + inst.options.onExpiry.apply(elem[0], []); + } + if (inst.options.expiryText) { + var layout = inst.options.layout; + inst.options.layout = inst.options.expiryText; + this._updateCountdown(elem[0], inst); + inst.options.layout = layout; + } + if (inst.options.expiryUrl) { + window.location = inst.options.expiryUrl; + } + } + inst._expiring = false; + } + else if (inst._hold == 'pause') { + this._removeElem(elem[0]); + } + }, + + /** Reset any extra labelsn and compactLabelsn entries if changing labels. + @private + @param base {object} The options to be updated. + @param options {object} The new option values. */ + _resetExtraLabels: function(base, options) { + for (var n in options) { + if (n.match(/[Ll]abels[02-9]|compactLabels1/)) { + base[n] = options[n]; + } + } + for (var n in base) { // Remove custom numbered labels + if (n.match(/[Ll]abels[02-9]|compactLabels1/) && typeof options[n] === 'undefined') { + base[n] = null; + } + } + }, + + /** Calculate internal settings for an instance. + @private + @param elem {jQuery} The containing division. + @param inst {object} The current settings for this instance. + @param recalc {boolean} True if until or since are set. */ + _adjustSettings: function(elem, inst, recalc) { + var serverEntry = null; + for (var i = 0; i < this._serverSyncs.length; i++) { + if (this._serverSyncs[i][0] == inst.options.serverSync) { + serverEntry = this._serverSyncs[i][1]; + break; + } + } + if (serverEntry != null) { + var serverOffset = (inst.options.serverSync ? serverEntry : 0); + var now = new Date(); + } + else { + var serverResult = ($.isFunction(inst.options.serverSync) ? + inst.options.serverSync.apply(elem[0], []) : null); + var now = new Date(); + var serverOffset = (serverResult ? now.getTime() - serverResult.getTime() : 0); + this._serverSyncs.push([inst.options.serverSync, serverOffset]); + } + var timezone = inst.options.timezone; + timezone = (timezone == null ? -now.getTimezoneOffset() : timezone); + 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._show = this._determineShow(inst); + }, + + /** Remove the countdown widget from a div. + @param elem {jQuery} The containing division. + @param inst {object} The current instance object. */ + _preDestroy: function(elem, inst) { + this._removeElem(elem[0]); + elem.empty(); + }, + + /** Pause a countdown widget at the current time. + Stop it running but remember and display the current time. + @param elem {Element} The containing division. + @example $(selector).countdown('pause') */ + pause: function(elem) { + this._hold(elem, 'pause'); + }, + + /** Pause a countdown widget at the current time. + Stop the display but keep the countdown running. + @param elem {Element} The containing division. + @example $(selector).countdown('lap') */ + lap: function(elem) { + this._hold(elem, 'lap'); + }, + + /** Resume a paused countdown widget. + @param elem {Element} The containing division. + @example $(selector).countdown('resume') */ + resume: function(elem) { + this._hold(elem, null); + }, + + /** Toggle a paused countdown widget. + @param elem {Element} The containing division. + @example $(selector).countdown('toggle') */ + toggle: function(elem) { + var inst = $.data(elem, this.name) || {}; + this[!inst._hold ? 'pause' : 'resume'](elem); + }, + + /** Toggle a lapped countdown widget. + @param elem {Element} The containing division. + @example $(selector).countdown('toggleLap') */ + toggleLap: function(elem) { + var inst = $.data(elem, this.name) || {}; + this[!inst._hold ? 'lap' : 'resume'](elem); + }, + + /** Pause or resume a countdown widget. + @private + @param elem {Element} The containing division. + @param hold {string} The new hold setting. */ + _hold: function(elem, hold) { + var inst = $.data(elem, this.name); + if (inst) { + if (inst._hold == 'pause' && !hold) { + inst._periods = inst._savePeriods; + var sign = (inst._since ? '-' : '+'); + inst[inst._since ? '_since' : '_until'] = + this._determineTime(sign + inst._periods[0] + 'y' + + sign + inst._periods[1] + 'o' + sign + inst._periods[2] + 'w' + + sign + inst._periods[3] + 'd' + sign + inst._periods[4] + 'h' + + sign + inst._periods[5] + 'm' + sign + inst._periods[6] + 's'); + this._addElem(elem); + } + inst._hold = hold; + inst._savePeriods = (hold == 'pause' ? inst._periods : null); + $.data(elem, this.name, inst); + this._updateCountdown(elem, inst); + } + }, + + /** Return the current time periods. + @param elem {Element} The containing division. + @return {number[]} The current periods for the countdown. + @example var periods = $(selector).countdown('getTimes') */ + getTimes: function(elem) { + var inst = $.data(elem, this.name); + 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. + @private + @param setting {string|number|Date} The date/time value as a relative or absolute value. + @param defaultTime {Date} The date/time to use if no other is supplied. + @return {Date} The corresponding date/time. */ + _determineTime: function(setting, defaultTime) { + var self = this; + var offsetNumeric = function(offset) { // e.g. +300, -2 + var time = new Date(); + time.setTime(time.getTime() + offset * 1000); + return time; + }; + var offsetString = function(offset) { // e.g. '+2d', '-4w', '+3h +30m' + offset = offset.toLowerCase(); + var time = new Date(); + var year = time.getFullYear(); + var month = time.getMonth(); + var day = time.getDate(); + var hour = time.getHours(); + var minute = time.getMinutes(); + var second = time.getSeconds(); + var pattern = /([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g; + var matches = pattern.exec(offset); + while (matches) { + switch (matches[2] || 's') { + case 's': second += parseInt(matches[1], 10); break; + case 'm': minute += parseInt(matches[1], 10); break; + case 'h': hour += parseInt(matches[1], 10); break; + case 'd': day += parseInt(matches[1], 10); break; + case 'w': day += parseInt(matches[1], 10) * 7; break; + case 'o': + month += parseInt(matches[1], 10); + day = Math.min(day, self._getDaysInMonth(year, month)); + break; + case 'y': + year += parseInt(matches[1], 10); + day = Math.min(day, self._getDaysInMonth(year, month)); + break; + } + matches = pattern.exec(offset); + } + return new Date(year, month, day, hour, minute, second, 0); + }; + var time = (setting == null ? defaultTime : + (typeof setting == 'string' ? offsetString(setting) : + (typeof setting == 'number' ? offsetNumeric(setting) : setting))); + if (time) time.setMilliseconds(0); + return time; + }, + + /** Determine the number of days in a month. + @private + @param year {number} The year. + @param month {number} The month. + @return {number} The days in that month. */ + _getDaysInMonth: function(year, month) { + return 32 - new Date(year, month, 32).getDate(); + }, + + /** Default implementation to determine which set of labels should be used for an amount. + Use the labels attribute with the same numeric suffix (if it exists). + @private + @param num {number} The amount to be displayed. + @return {number} The set of labels to be used for this amount. */ + _normalLabels: function(num) { + return num; + }, + + /** Generate the HTML to display the countdown widget. + @private + @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 + inst._periods = (inst._hold ? inst._periods : + 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 = inst.options.significant; + var show = $.extend({}, inst._show); + for (var period = Y; period <= S; period++) { + shownNonZero |= (inst._show[period] == '?' && inst._periods[period] > 0); + show[period] = (inst._show[period] == '?' && !shownNonZero ? null : inst._show[period]); + showCount += (show[period] ? 1 : 0); + sigCount -= (inst._periods[period] > 0 ? 1 : 0); + } + var showSignificant = [false, false, false, false, false, false, false]; + for (var period = S; period >= Y; period--) { // Determine significant periods + if (inst._show[period]) { + if (inst._periods[period]) { + showSignificant[period] = true; + } + else { + showSignificant[period] = sigCount > 0; + sigCount--; + } + } + } + var labels = (inst.options.compact ? inst.options.compactLabels : inst.options.labels); + var whichLabels = inst.options.whichLabels || this._normalLabels; + var showCompact = function(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 minDigits = (inst.options.padZeroes ? 2 : 1); + var showFull = function(period) { + var labelsNum = inst.options['labels' + whichLabels(inst._periods[period])]; + return ((!inst.options.significant && show[period]) || + (inst.options.significant && showSignificant[period]) ? + '' + + '' + + self._minDigits(inst, inst._periods[period], minDigits) + '' + + '' + + (labelsNum ? labelsNum[period] : labels[period]) + '' : ''); + }; + return (inst.options.layout ? this._buildLayout(inst, show, inst.options.layout, + inst.options.compact, inst.options.significant, showSignificant) : + ((inst.options.compact ? // Compact version + '' + + showCompact(Y) + showCompact(O) + showCompact(W) + showCompact(D) + + (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 + '' + + showFull(Y) + showFull(O) + showFull(W) + showFull(D) + + showFull(H) + showFull(M) + showFull(S)) + '' + + (inst.options.description ? '' + + inst.options.description + '' : ''))); + }, + + /** Construct a custom layout. + @private + @param inst {object} The current settings for this instance. + @param show {boolean[]} Flags indicating which periods are requested. + @param layout {string} The customised layout. + @param compact {boolean} True if using compact labels. + @param significant {number} The number of periods with values to show, zero for all. + @param showSignificant {boolean[]} Other periods to show for significance. + @return {string} The custom HTML. */ + _buildLayout: function(inst, show, layout, compact, significant, showSignificant) { + var labels = inst.options[compact ? 'compactLabels' : 'labels']; + var whichLabels = inst.options.whichLabels || this._normalLabels; + var labelFor = function(index) { + return (inst.options[(compact ? 'compactLabels' : 'labels') + + whichLabels(inst._periods[index])] || labels)[index]; + }; + var digit = function(value, position) { + return inst.options.digits[Math.floor(value / position) % 10]; + }; + 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: 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: 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: 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: 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: 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: 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 + '<\\}([\\s\\S]*)\\{' + period + '>\\}', 'g'); + html = html.replace(re, ((!significant && show[i]) || + (significant && showSignificant[i]) ? '$1' : '')); + } + // Replace period values: {pn} + $.each(subs, function(n, v) { + var re = new RegExp('\\{' + n + '\\}', 'g'); + html = html.replace(re, v); + }); + return html; + }, + + /** Ensure a numeric value has at least n digits for display. + @private + @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(inst, value, len) { + value = '' + value; + if (value.length >= len) { + return this._translateDigits(inst, value); + } + value = '0000000000' + value; + return this._translateDigits(inst, value.substr(value.length - len)); + }, + + /** Translate digits into other representations. + @private + @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. + @private + @param inst {object} The current settings for this instance. + @return {string[]} Flags indicating which periods are requested (?) or + required (!) by year, month, week, day, hour, minute, second. */ + _determineShow: function(inst) { + 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)); + show[W] = (format.match('w') ? '?' : (format.match('W') ? '!' : null)); + show[D] = (format.match('d') ? '?' : (format.match('D') ? '!' : null)); + show[H] = (format.match('h') ? '?' : (format.match('H') ? '!' : null)); + show[M] = (format.match('m') ? '?' : (format.match('M') ? '!' : null)); + show[S] = (format.match('s') ? '?' : (format.match('S') ? '!' : null)); + return show; + }, + + /** Calculate the requested periods between now and the target time. + @private + @param inst {object} The current settings for this instance. + @param show {string[]} Flags indicating which periods are requested/required. + @param significant {number} The number of periods with values to show, zero for all. + @param now {Date} The current date and time. + @return {number[]} The current time periods (always positive) + by year, month, week, day, hour, minute, second. */ + _calculatePeriods: function(inst, show, significant, now) { + // Find endpoints + inst._now = now; + inst._now.setMilliseconds(0); + var until = new Date(inst._now.getTime()); + if (inst._since) { + if (now.getTime() < inst._since.getTime()) { + inst._now = now = until; + } + else { + now = inst._since; + } + } + else { + until.setTime(inst._until.getTime()); + if (now.getTime() > inst._until.getTime()) { + inst._now = now = until; + } + } + // Calculate differences by period + var periods = [0, 0, 0, 0, 0, 0, 0]; + if (show[Y] || show[O]) { + // Treat end of months as the same + var lastNow = this._getDaysInMonth(now.getFullYear(), now.getMonth()); + var lastUntil = this._getDaysInMonth(until.getFullYear(), until.getMonth()); + var sameDay = (until.getDate() == now.getDate() || + (until.getDate() >= Math.min(lastNow, lastUntil) && + now.getDate() >= Math.min(lastNow, lastUntil))); + var getSecs = function(date) { + return (date.getHours() * 60 + date.getMinutes()) * 60 + date.getSeconds(); + }; + var months = Math.max(0, + (until.getFullYear() - now.getFullYear()) * 12 + until.getMonth() - now.getMonth() + + ((until.getDate() < now.getDate() && !sameDay) || + (sameDay && getSecs(until) < getSecs(now)) ? -1 : 0)); + periods[Y] = (show[Y] ? Math.floor(months / 12) : 0); + periods[O] = (show[O] ? months - periods[Y] * 12 : 0); + // Adjust for months difference and end of month if necessary + now = new Date(now.getTime()); + var wasLastDay = (now.getDate() == lastNow); + var lastDay = this._getDaysInMonth(now.getFullYear() + periods[Y], + now.getMonth() + periods[O]); + if (now.getDate() > lastDay) { + now.setDate(lastDay); + } + now.setFullYear(now.getFullYear() + periods[Y]); + now.setMonth(now.getMonth() + periods[O]); + if (wasLastDay) { + now.setDate(lastDay); + } + } + var diff = Math.floor((until.getTime() - now.getTime()) / 1000); + var extractPeriod = function(period, numSecs) { + periods[period] = (show[period] ? Math.floor(diff / numSecs) : 0); + diff -= periods[period] * numSecs; + }; + extractPeriod(W, 604800); + extractPeriod(D, 86400); + extractPeriod(H, 3600); + extractPeriod(M, 60); + extractPeriod(S, 1); + if (diff > 0 && !inst._since) { // Round up if left overs + var multiplier = [1, 12, 4.3482, 7, 24, 60, 60]; + var lastShown = S; + var max = 1; + for (var period = S; period >= Y; period--) { + if (show[period]) { + if (periods[lastShown] >= max) { + periods[lastShown] = 0; + diff = 1; + } + if (diff > 0) { + periods[period]++; + diff = 0; + lastShown = period; + max = 1; + } + } + max *= multiplier[period]; + } + } + if (significant) { // Zero out insignificant periods + for (var period = Y; period <= S; period++) { + if (significant && periods[period]) { + significant--; + } + else if (!significant) { + periods[period] = 0; + } + } + } + return periods; + } + }); + +})(jQuery); diff --git a/js/jquery.countdown.min.js b/js/jquery.countdown.min.js new file mode 100644 index 0000000..e6d1572 --- /dev/null +++ b/js/jquery.countdown.min.js @@ -0,0 +1,6 @@ +/* http://keith-wood.name/countdown.html + Countdown for jQuery v2.0.2. + Written by Keith Wood (kbwood{at}iinet.com.au) January 2008. + Available under the MIT (http://keith-wood.name/licence.html) license. + Please attribute the author if you use it. */ +(function($){var w='countdown';var Y=0;var O=1;var W=2;var D=3;var H=4;var M=5;var S=6;$.JQPlugin.createPlugin({name:w,defaultOptions:{until:null,since:null,timezone:null,serverSync:null,format:'dHMS',layout:'',compact:false,padZeroes:false,significant:0,description:'',expiryUrl:'',expiryText:'',alwaysExpire:false,onExpiry:null,onTick:null,tickInterval:1},regionalOptions:{'':{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}},_getters:['getTimes'],_rtlClass:w+'-rtl',_sectionClass:w+'-section',_amountClass:w+'-amount',_periodClass:w+'-period',_rowClass:w+'-row',_holdingClass:w+'-holding',_showClass:w+'-show',_descrClass:w+'-descr',_timerElems:[],_init:function(){var c=this;this._super();this._serverSyncs=[];var d=(typeof Date.now=='function'?Date.now:function(){return new Date().getTime()});var e=(window.performance&&typeof window.performance.now=='function');function timerCallBack(a){var b=(a<1e12?(e?(performance.now()+performance.timing.navigationStart):d()):a||d());if(b-g>=1000){c._updateElems();g=b}f(timerCallBack)}var f=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||null;var g=0;if(!f||$.noRequestAnimationFrame){$.noRequestAnimationFrame=null;setInterval(function(){c._updateElems()},980)}else{g=window.animationStartTime||window.webkitAnimationStartTime||window.mozAnimationStartTime||window.oAnimationStartTime||window.msAnimationStartTime||d();f(timerCallBack)}},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]},resync:function(){var d=this;$('.'+this._getMarker()).each(function(){var a=$.data(this,d.name);if(a.options.serverSync){var b=null;for(var i=0;i-1)},_removeElem:function(b){this._timerElems=$.map(this._timerElems,function(a){return(a==b?null:a)})},_updateElems:function(){for(var i=this._timerElems.length-1;i>=0;i--){this._updateCountdown(this._timerElems[i])}},_optionsChanged:function(a,b,c){if(c.layout){c.layout=c.layout.replace(/</g,'<').replace(/>/g,'>')}this._resetExtraLabels(b.options,c);var d=(b.options.timezone!=c.timezone);$.extend(b.options,c);this._adjustSettings(a,b,c.until!=null||c.since!=null||d);var e=new Date();if((b._since&&b._sincee)){this._addElem(a[0])}this._updateCountdown(a,b)},_updateCountdown:function(a,b){a=a.jquery?a:$(a);b=b||this._getInst(a);if(!b){return}a.html(this._generateHTML(b)).toggleClass(this._rtlClass,b.options.isRTL);if($.isFunction(b.options.onTick)){var c=b._hold!='lap'?b._periods:this._calculatePeriods(b,b._show,b.options.significant,new Date());if(b.options.tickInterval==1||this.periodsToSeconds(c)%b.options.tickInterval==0){b.options.onTick.apply(a[0],[c])}}var d=b._hold!='pause'&&(b._since?b._now.getTime()=b._until.getTime());if(d&&!b._expiring){b._expiring=true;if(this._hasElem(a[0])||b.options.alwaysExpire){this._removeElem(a[0]);if($.isFunction(b.options.onExpiry)){b.options.onExpiry.apply(a[0],[])}if(b.options.expiryText){var e=b.options.layout;b.options.layout=b.options.expiryText;this._updateCountdown(a[0],b);b.options.layout=e}if(b.options.expiryUrl){window.location=b.options.expiryUrl}}b._expiring=false}else if(b._hold=='pause'){this._removeElem(a[0])}},_resetExtraLabels:function(a,b){for(var n in b){if(n.match(/[Ll]abels[02-9]|compactLabels1/)){a[n]=b[n]}}for(var n in a){if(n.match(/[Ll]abels[02-9]|compactLabels1/)&&typeof b[n]==='undefined'){a[n]=null}}},_adjustSettings:function(a,b,c){var d=null;for(var i=0;i0);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['compactLabels'+l(c._periods[a])];return(h[a]?d._translateDigits(c,c._periods[a])+(b?b[a]:k[a])+' ':'')};var n=(c.options.padZeroes?2:1);var o=function(a){var b=c.options['labels'+l(c._periods[a])];return((!c.options.significant&&h[a])||(c.options.significant&&j[a])?''+''+d._minDigits(c,c._periods[a],n)+''+''+(b?b[a]:k[a])+'':'')};return(c.options.layout?this._buildLayout(c,h,c.options.layout,c.options.compact,c.options.significant,j):((c.options.compact?''+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):''):''+o(Y)+o(O)+o(W)+o(D)+o(H)+o(M)+o(S))+''+(c.options.description?''+c.options.description+'':'')))},_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._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: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);var g=new Date(c._now.getTime());if(c._since){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=this._getDaysInMonth(f.getFullYear(),f.getMonth());var j=this._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()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}})})(jQuery); \ No newline at end of file diff --git a/js/jquery.plugin.js b/js/jquery.plugin.js new file mode 100644 index 0000000..a05c163 --- /dev/null +++ b/js/jquery.plugin.js @@ -0,0 +1,344 @@ +/* Simple JavaScript Inheritance + * By John Resig http://ejohn.org/ + * MIT Licensed. + */ +// Inspired by base2 and Prototype +(function(){ + var initializing = false; + + // The base JQClass implementation (does nothing) + window.JQClass = function(){}; + + // Collection of derived classes + JQClass.classes = {}; + + // Create a new JQClass that inherits from this class + JQClass.extend = function extender(prop) { + var base = this.prototype; + + // Instantiate a base class (but only create the instance, + // don't run the init constructor) + initializing = true; + var prototype = new this(); + initializing = false; + + // Copy the properties over onto the new prototype + for (var name in prop) { + // Check if we're overwriting an existing function + prototype[name] = typeof prop[name] == 'function' && + typeof base[name] == 'function' ? + (function(name, fn){ + return function() { + var __super = this._super; + + // Add a new ._super() method that is the same method + // but on the super-class + this._super = function(args) { + return base[name].apply(this, args || []); + }; + + var ret = fn.apply(this, arguments); + + // The method only need to be bound temporarily, so we + // remove it when we're done executing + this._super = __super; + + return ret; + }; + })(name, prop[name]) : + prop[name]; + } + + // The dummy class constructor + function JQClass() { + // All construction is actually done in the init method + if (!initializing && this._init) { + this._init.apply(this, arguments); + } + } + + // Populate our constructed prototype object + JQClass.prototype = prototype; + + // Enforce the constructor to be what we expect + JQClass.prototype.constructor = JQClass; + + // And make this class extendable + JQClass.extend = extender; + + return JQClass; + }; +})(); + +(function($) { // Ensure $, encapsulate + + /** Abstract base class for collection plugins v1.0.1. + Written by Keith Wood (kbwood{at}iinet.com.au) December 2013. + Licensed under the MIT (http://keith-wood.name/licence.html) license. + @module $.JQPlugin + @abstract */ + JQClass.classes.JQPlugin = JQClass.extend({ + + /** Name to identify this plugin. + @example name: 'tabs' */ + name: 'plugin', + + /** Default options for instances of this plugin (default: {}). + @example defaultOptions: { + selectedClass: 'selected', + triggers: 'click' + } */ + defaultOptions: {}, + + /** Options dependent on the locale. + Indexed by language and (optional) country code, with '' denoting the default language (English/US). + @example regionalOptions: { + '': { + greeting: 'Hi' + } + } */ + regionalOptions: {}, + + /** Names of getter methods - those that can't be chained (default: []). + @example _getters: ['activeTab'] */ + _getters: [], + + /** Retrieve a marker class for affected elements. + @private + @return {string} The marker class. */ + _getMarker: function() { + return 'is-' + this.name; + }, + + /** Initialise the plugin. + Create the jQuery bridge - plugin name xyz + produces $.xyz and $.fn.xyz. */ + _init: function() { + // Apply default localisations + $.extend(this.defaultOptions, (this.regionalOptions && this.regionalOptions['']) || {}); + // Camel-case the name + var jqName = camelCase(this.name); + // Expose jQuery singleton manager + $[jqName] = this; + // Expose jQuery collection plugin + $.fn[jqName] = function(options) { + var otherArgs = Array.prototype.slice.call(arguments, 1); + if ($[jqName]._isNotChained(options, otherArgs)) { + return $[jqName][options].apply($[jqName], [this[0]].concat(otherArgs)); + } + return this.each(function() { + if (typeof options === 'string') { + if (options[0] === '_' || !$[jqName][options]) { + throw 'Unknown method: ' + options; + } + $[jqName][options].apply($[jqName], [this].concat(otherArgs)); + } + else { + $[jqName]._attach(this, options); + } + }); + }; + }, + + /** Set default values for all subsequent instances. + @param options {object} The new default options. + @example $.plugin.setDefauls({name: value}) */ + setDefaults: function(options) { + $.extend(this.defaultOptions, options || {}); + }, + + /** Determine whether a method is a getter and doesn't permit chaining. + @private + @param name {string} The method name. + @param otherArgs {any[]} Any other arguments for the method. + @return {boolean} True if this method is a getter, false otherwise. */ + _isNotChained: function(name, otherArgs) { + if (name === 'option' && (otherArgs.length === 0 || + (otherArgs.length === 1 && typeof otherArgs[0] === 'string'))) { + return true; + } + return $.inArray(name, this._getters) > -1; + }, + + /** Initialise an element. Called internally only. + Adds an instance object as data named for the plugin. + @param elem {Element} The element to enhance. + @param options {object} Overriding settings. */ + _attach: function(elem, options) { + elem = $(elem); + if (elem.hasClass(this._getMarker())) { + return; + } + elem.addClass(this._getMarker()); + options = $.extend({}, this.defaultOptions, this._getMetadata(elem), options || {}); + var inst = $.extend({name: this.name, elem: elem, options: options}, + this._instSettings(elem, options)); + elem.data(this.name, inst); // Save instance against element + this._postAttach(elem, inst); + this.option(elem, options); + }, + + /** Retrieve additional instance settings. + Override this in a sub-class to provide extra settings. + @param elem {jQuery} The current jQuery element. + @param options {object} The instance options. + @return {object} Any extra instance values. + @example _instSettings: function(elem, options) { + return {nav: elem.find(options.navSelector)}; + } */ + _instSettings: function(elem, options) { + return {}; + }, + + /** Plugin specific post initialisation. + Override this in a sub-class to perform extra activities. + @param elem {jQuery} The current jQuery element. + @param inst {object} The instance settings. + @example _postAttach: function(elem, inst) { + elem.on('click.' + this.name, function() { + ... + }); + } */ + _postAttach: function(elem, inst) { + }, + + /** Retrieve metadata configuration from the element. + Metadata is specified as an attribute: + data-<plugin name>="<setting name>: '<value>', ...". + Dates should be specified as strings in this format: 'new Date(y, m-1, d)'. + @private + @param elem {jQuery} The source element. + @return {object} The inline configuration or {}. */ + _getMetadata: function(elem) { + try { + var data = elem.data(this.name.toLowerCase()) || ''; + data = data.replace(/'/g, '"'); + data = data.replace(/([a-zA-Z0-9]+):/g, function(match, group, i) { + var count = data.substring(0, i).match(/"/g); // Handle embedded ':' + return (!count || count.length % 2 === 0 ? '"' + group + '":' : group + ':'); + }); + data = $.parseJSON('{' + data + '}'); + for (var name in data) { // Convert dates + var value = data[name]; + if (typeof value === 'string' && value.match(/^new Date\((.*)\)$/)) { + data[name] = eval(value); + } + } + return data; + } + catch (e) { + return {}; + } + }, + + /** Retrieve the instance data for element. + @param elem {Element} The source element. + @return {object} The instance data or {}. */ + _getInst: function(elem) { + return $(elem).data(this.name) || {}; + }, + + /** Retrieve or reconfigure the settings for a plugin. + @param elem {Element} The source element. + @param name {object|string} The collection of new option values or the name of a single option. + @param [value] {any} The value for a single named option. + @return {any|object} If retrieving a single value or all options. + @example $(selector).plugin('option', 'name', value) + $(selector).plugin('option', {name: value, ...}) + var value = $(selector).plugin('option', 'name') + var options = $(selector).plugin('option') */ + option: function(elem, name, value) { + elem = $(elem); + var inst = elem.data(this.name); + if (!name || (typeof name === 'string' && value == null)) { + var options = (inst || {}).options; + return (options && name ? options[name] : options); + } + if (!elem.hasClass(this._getMarker())) { + return; + } + var options = name || {}; + if (typeof name === 'string') { + options = {}; + options[name] = value; + } + this._optionsChanged(elem, inst, options); + $.extend(inst.options, options); + }, + + /** Plugin specific options processing. + Old value available in inst.options[name], new value in options[name]. + Override this in a sub-class to perform extra activities. + @param elem {jQuery} The current jQuery element. + @param inst {object} The instance settings. + @param options {object} The new options. + @example _optionsChanged: function(elem, inst, options) { + if (options.name != inst.options.name) { + elem.removeClass(inst.options.name).addClass(options.name); + } + } */ + _optionsChanged: function(elem, inst, options) { + }, + + /** Remove all trace of the plugin. + Override _preDestroy for plugin-specific processing. + @param elem {Element} The source element. + @example $(selector).plugin('destroy') */ + destroy: function(elem) { + elem = $(elem); + if (!elem.hasClass(this._getMarker())) { + return; + } + this._preDestroy(elem, this._getInst(elem)); + elem.removeData(this.name).removeClass(this._getMarker()); + }, + + /** Plugin specific pre destruction. + Override this in a sub-class to perform extra activities and undo everything that was + done in the _postAttach or _optionsChanged functions. + @param elem {jQuery} The current jQuery element. + @param inst {object} The instance settings. + @example _preDestroy: function(elem, inst) { + elem.off('.' + this.name); + } */ + _preDestroy: function(elem, inst) { + } + }); + + /** Convert names from hyphenated to camel-case. + @private + @param value {string} The original hyphenated name. + @return {string} The camel-case version. */ + function camelCase(name) { + return name.replace(/-([a-z])/g, function(match, group) { + return group.toUpperCase(); + }); + } + + /** Expose the plugin base. + @namespace "$.JQPlugin" */ + $.JQPlugin = { + + /** Create a new collection plugin. + @memberof "$.JQPlugin" + @param [superClass='JQPlugin'] {string} The name of the parent class to inherit from. + @param overrides {object} The property/function overrides for the new class. + @example $.JQPlugin.createPlugin({ + name: 'tabs', + defaultOptions: {selectedClass: 'selected'}, + _initSettings: function(elem, options) { return {...}; }, + _postAttach: function(elem, inst) { ... } + }); */ + createPlugin: function(superClass, overrides) { + if (typeof superClass === 'object') { + overrides = superClass; + superClass = 'JQPlugin'; + } + superClass = camelCase(superClass); + var className = camelCase(overrides.name); + JQClass.classes[className] = JQClass.classes[superClass].extend(overrides); + new JQClass.classes[className](); + } + }; + +})(jQuery); \ No newline at end of file diff --git a/js/jquery.plugin.min.js b/js/jquery.plugin.min.js new file mode 100644 index 0000000..a992db3 --- /dev/null +++ b/js/jquery.plugin.min.js @@ -0,0 +1,4 @@ +/** Abstract base class for collection plugins v1.0.1. + Written by Keith Wood (kbwood{at}iinet.com.au) December 2013. + Licensed under the MIT (http://keith-wood.name/licence.html) license. */ +(function(){var j=false;window.JQClass=function(){};JQClass.classes={};JQClass.extend=function extender(f){var g=this.prototype;j=true;var h=new this();j=false;for(var i in f){h[i]=typeof f[i]=='function'&&typeof g[i]=='function'?(function(d,e){return function(){var b=this._super;this._super=function(a){return g[d].apply(this,a||[])};var c=e.apply(this,arguments);this._super=b;return c}})(i,f[i]):f[i]}function JQClass(){if(!j&&this._init){this._init.apply(this,arguments)}}JQClass.prototype=h;JQClass.prototype.constructor=JQClass;JQClass.extend=extender;return JQClass}})();(function($){JQClass.classes.JQPlugin=JQClass.extend({name:'plugin',defaultOptions:{},regionalOptions:{},_getters:[],_getMarker:function(){return'is-'+this.name},_init:function(){$.extend(this.defaultOptions,(this.regionalOptions&&this.regionalOptions[''])||{});var c=camelCase(this.name);$[c]=this;$.fn[c]=function(a){var b=Array.prototype.slice.call(arguments,1);if($[c]._isNotChained(a,b)){return $[c][a].apply($[c],[this[0]].concat(b))}return this.each(function(){if(typeof a==='string'){if(a[0]==='_'||!$[c][a]){throw'Unknown method: '+a;}$[c][a].apply($[c],[this].concat(b))}else{$[c]._attach(this,a)}})}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_isNotChained:function(a,b){if(a==='option'&&(b.length===0||(b.length===1&&typeof b[0]==='string'))){return true}return $.inArray(a,this._getters)>-1},_attach:function(a,b){a=$(a);if(a.hasClass(this._getMarker())){return}a.addClass(this._getMarker());b=$.extend({},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c);this._postAttach(a,c);this.option(a,b)},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(d){try{var f=d.data(this.name.toLowerCase())||'';f=f.replace(/'/g,'"');f=f.replace(/([a-zA-Z0-9]+):/g,function(a,b,i){var c=f.substring(0,i).match(/"/g);return(!c||c.length%2===0?'"'+b+'":':b+':')});f=$.parseJSON('{'+f+'}');for(var g in f){var h=f[g];if(typeof h==='string'&&h.match(/^new Date\((.*)\)$/)){f[g]=eval(h)}}return f}catch(e){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name);if(!b||(typeof b==='string'&&c==null)){var e=(d||{}).options;return(e&&b?e[b]:e)}if(!a.hasClass(this._getMarker())){return}var e=b||{};if(typeof b==='string'){e={};e[b]=c}this._optionsChanged(a,d,e);$.extend(d.options,e)},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}this._preDestroy(a,this._getInst(a));a.removeData(this.name).removeClass(this._getMarker())},_preDestroy:function(a,b){}});function camelCase(c){return c.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}$.JQPlugin={createPlugin:function(a,b){if(typeof a==='object'){b=a;a='JQPlugin'}a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b);new JQClass.classes[c]()}}})(jQuery); \ No newline at end of file diff --git a/locales/fr/main.po b/locales/fr/main.po new file mode 100644 index 0000000..b03abb3 --- /dev/null +++ b/locales/fr/main.po @@ -0,0 +1,125 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: brol \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.7\n" + +msgid "Countdown and stopwatch" +msgstr "Compte à rebours ou chronomètre" + +msgid "A countdown to a future date or stopwatch to a past date" +msgstr "Un compte à rebours vers une date à venir ou un chronomètre vers une date passée" + +#: _widget.php:38 +msgid "Countdown" +msgstr "Chronomètre" + +#: _widget.php:41 +msgid "Text displayed if the date is in the future:" +msgstr "Texte affiché si la date est dans le futur :" + +#: _widget.php:41 +msgid "In" +msgstr "Dans" + +#: _widget.php:44 +msgid "Text displayed if the date is in the past:" +msgstr "Texte affiché si la date est passée :" + +#: _widget.php:44 +msgid "For" +msgstr "Depuis" + +#: _widget.php:77 +msgid "all" +msgstr "tous" + +#: _widget.php:162 +msgid "year" +msgstr "an" + +#: _widget.php:164 +msgid "month" +msgstr "mois" + +#: _widget.php:166 +msgid "day" +msgstr "jour" + +#: _widget.php:168 +msgid "hour" +msgstr "heure" + +#: _widget.php:170 +msgid "minute" +msgstr "minute" + +#: _widget.php:172 +msgid "second" +msgstr "seconde" + +#: _widget.php:94 +msgid "Number of values to be displayed:" +msgstr "Nombre de valeurs à afficher :" + +#: _widget.php:98 +msgid "Show zeros before hours, minutes and seconds" +msgstr "Afficher des zéros devant les heures, les minutes et les secondes" + +#: _widget.php:101 +msgid "Enable dynamic display" +msgstr "Activer l'affichage dynamique" + +#: _widget.php:104 +msgid "Dynamic display format (see jQuery Countdown Reference):" +msgstr "Format de l'affichage dynamique (voir jQuery Countdown Reference) :" + +#: _widget.php:111 +msgid "Dynamic display layout if the date is in the future (see jQuery Countdown Reference):" +msgstr "Mise en page de l'affichage dynamique si la date est dans le futur (voir jQuery Countdown Reference) :" + +#: _widget.php:115 +msgid "In {y<}{yn} {yl}, {y>} {o<}{on} {ol}, {o>} {w<}{wn} {wl}, {w>} {d<}{dn} {dl}, {d>} {hn} {hl}, {mn} {ml} and {sn} {sl}" +msgstr "Dans {y<}{yn} {yl}, {y>}{o<}{on} {ol}, {o>}{d<}{dn} {dl}, {d>}{hn} {hl}, {mn} {ml} et {sn} {sl}" + +#: _widget.php:119 +msgid "Dynamic display layout if the date is in the past (see jQuery Countdown Reference):" +msgstr "Mise en page de l'affichage dynamique si la date est passée (voir jQuery Countdown Reference) :" + +#: _widget.php:123 +msgid "For {y<}{yn} {yl}, {y>} {o<}{on} {ol}, {o>} {w<}{wn} {wl}, {w>} {d<}{dn} {dl}, {d>} {hn} {hl}, {mn} {ml} and {sn} {sl}" +msgstr "Depuis {y<}{yn} {yl}, {y>} {o<}{on} {ol}, {o>} {w<}{wn} {wl}, {w>} {d<}{dn} {dl}, {d>} {hn} {hl}, {mn} {ml} et {sn} {sl}" + +#: _widget.php:162 +msgid "years" +msgstr "ans" + +#: _widget.php:164 +msgid "months" +msgstr "mois" + +#: _widget.php:166 +msgid "days" +msgstr "jours" + +#: _widget.php:168 +msgid "hours" +msgstr "heures" + +#: _widget.php:170 +msgid "minutes" +msgstr "minutes" + +#: _widget.php:172 +msgid "seconds" +msgstr "secondes" + +#: _widget.php:199 +msgid "and" +msgstr "et"