tick
event and reset when 10 seconds has elapsed
25 |
26 | ```js
27 | $('').stopwatch().bind('tick.stopwatch', function(e, elapsed){
28 | if (elapsed >= 10000) {
29 | $(this).stopwatch('reset');
30 | }
31 | }).stopwatch('start')
32 | ```
33 |
34 | * Start at non-zero elapsed time
35 |
36 | ```js
37 | $('').stopwatch({startTime: 10000000}).stopwatch('start')
38 | ```
39 |
40 | ## Formatting
41 |
42 | Provided by the [jintervals](https://github.com/nene/jintervals) lib. If you don't
43 | include this library, the default output format `HH:MM:SS` is used.
44 |
45 | ### Formats
46 |
47 | Pass a format pattern as the `format` option. jsintervals provides a rich syntax for formatting
48 | time intervals, perhaps best illustrated by some examples.
49 |
50 | ```js
51 | '{MM}:{ss}' --> 01:05
52 | '{MMM}:{ss}' --> 001:05
53 | '{M}m, {s}s' --> 1m, 5s
54 | '{Minutes} and {seconds}' --> 1 minute and 5 seconds
55 | '{Greatest} ago' --> 1 minute ago
56 | ```
57 |
58 | The full documentation of the syntax is at http://code.google.com/p/jintervals/wiki/Documentation.
59 |
60 | ### Custom formatter
61 |
62 | A formatter function can be supplied as `formatter` in options. It receives `milliseconds` and
63 | `options` and must return a string.
64 |
65 | ## Licence
66 |
67 | Copyright (c) 2012 Rob Cowie. Licensed under the MIT license.
--------------------------------------------------------------------------------
/docs/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line.
5 | SPHINXOPTS =
6 | SPHINXBUILD = sphinx-build
7 | PAPER =
8 | BUILDDIR = _build
9 |
10 | # Internal variables.
11 | PAPEROPT_a4 = -D latex_paper_size=a4
12 | PAPEROPT_letter = -D latex_paper_size=letter
13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
14 | # the i18n builder cannot share the environment and doctrees with the others
15 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
16 |
17 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
18 |
19 | help:
20 | @echo "Please use \`make Expected: | ' + expected + ' |
---|---|
Result: | ' + actual + ' |
Diff: | ' + QUnit.diff(expected, actual) + ' |
Source: | ' + escapeHtml(source) + ' |