diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..e6e5067 --- /dev/null +++ b/README.txt @@ -0,0 +1,120 @@ +CONTENTS OF THIS FILE +--------------------- + + * Authors + * Description + * Installation + * Usage + +AUTHORS +------ + +7.x/6.x maintainer: Blackice2999 ( http://drupal.org/user/413429 ) +Originally by Rob Loach ( http://drupal.org/user/61114 ) + +DESCRIPTION +----------- + +Provides the jQuery Countdown plugin by Keith Wood, http://keith-wood.name/countdown.html +along with a simple API function (jquery_countdown_add) to easily add countdown/countup +timer elements to the page. + + +INSTALLATION +------------ + +Enable the date_popup module which is included in the date module. ( http://drupal.org/project/date ) +Then enable jquery_countdown. +For more info on installing contrib modules, see http://drupal.org/node/895232 + +USAGE +----- + +For standard usage, control the countdown settings at: + admin/config/user-interface/jquery-countdown + +Control the block 'jQuery Countdown Block' on the blocks config page, and +/admin/structure/block/manage/jquery_countdown/jquery_countdown/configure + +To create multiple countdown clocks as individual nodes: +- first create a content type to serve as a clock. +- Enable the date module. +- In Structure > Content Types > [Clock] > Manage Fields: + Select "Add a New Field" of type Date. You may select 'pop-up calendar' but any widget should work. + Select "Save". The default settings for the date field are acceptable. +- In Structure > Content Types > [Clock] > Manage Display: + On the date field you added, select Format: "jQuery Countdown". This switches the display. Note that +you may need to change "Teaser" as well as "Default" and/or other display modes. + +These countdown clock nodes can be displayed using a custom View including either Teaser, Default +node view modes or as individual fields. + +It is also possible to copy the original block using the Multiblock module. + http://drupal.org/project/multiblock + +Note that time zone handling for node Date fields can be set on a per-user basis if needed - look at +the field settings. + +API & THEMING +------------- + +Examples for development usage: + +1. We can use jQuery Countdown in two different ways, one is using theme('jquery_countdown'), the other +is using jquery_countdown_add(). This example counts down to the 20th day of October (10th month), 2013. + + 'countdown_' . $cid, + 'options' => array( + 'until' => date('F d, Y g:i a', mktime(0,0,0,10,20,2013)), + 'format' => 'YOWDHMS', + 'description' => '', + ), + 'content' => date('Y-M-D H:i:s', mktime(0,0,0,10,20,2013)), +)); +?> +See mktime() docs for format info: http://php.net/manual/en/function.mktime.php + +2. In this example, we display an alert box saying "You are done!" after counting down from 10. This can +be included in a node if PHP module & text format is enabled (though this is not advisable for security +reasons). + +10 seconds!'; + jquery_countdown_add(".countdown", array("until" => 10, "onExpiry" => "finished")); + drupal_add_js("function finished() { alert('You are done!'); }", 'inline'); +?> + +To change layouts - see similar code at http://drupal.org/node/1774406 + +To change themes - see http://drupal.org/node/1774406 + +The markup of the countdown comes from the Javascript library. Use the "layout" parameter in the Javascript library. The best point to inject them at the moment is to overwrite the theme function in your theme or module and put your layout parameter into the option array. + +See also: http://keith-wood.name/countdown.html#layouts + +' . $content . ''; +} +?> + +SUPPORT +------- + +Please file issues at http://drupal.org/project/issues/jquery_countdown but check to see if related +issues have been filed. + +------ +Readme written by Dan Feidt ("HongPong", http://drupal.org/user/60005/ )