Mercurial > js4py
annotate source/counters-example.rst @ 213:0ea90a1819c2 default tip
Custom theming
| author | Radomir Dopieralski <radomir.dopieralski@allegro.pl> |
|---|---|
| date | Wed, 27 Jun 2012 16:35:54 +0200 |
| parents | 347e10783e7f |
| children |
| rev | line source |
|---|---|
|
29
6523230ac679
counters-example.rst: Included source for example and provided download.
Jonathan Fine <jfine@pytex.org>
parents:
diff
changeset
|
1 Counters example |
|
6523230ac679
counters-example.rst: Included source for example and provided download.
Jonathan Fine <jfine@pytex.org>
parents:
diff
changeset
|
2 ================ |
|
6523230ac679
counters-example.rst: Included source for example and provided download.
Jonathan Fine <jfine@pytex.org>
parents:
diff
changeset
|
3 |
|
33
faff8a586a44
counters-example.rst: Started to display counters.js as code chunks.
Jonathan Fine <jfine@pytex.org>
parents:
32
diff
changeset
|
4 Goal |
|
faff8a586a44
counters-example.rst: Started to display counters.js as code chunks.
Jonathan Fine <jfine@pytex.org>
parents:
32
diff
changeset
|
5 ---- |
|
faff8a586a44
counters-example.rst: Started to display counters.js as code chunks.
Jonathan Fine <jfine@pytex.org>
parents:
32
diff
changeset
|
6 |
|
45
e16512d188a0
counters-example.rst: Added link to _downloads/counters.html
Jonathan Fine <jfine@pytex.org>
parents:
40
diff
changeset
|
7 The goal is to create a web page which contains several independent |
|
e16512d188a0
counters-example.rst: Added link to _downloads/counters.html
Jonathan Fine <jfine@pytex.org>
parents:
40
diff
changeset
|
8 counters. Each time a counter is clicked, it is incremented. Here's |
|
e16512d188a0
counters-example.rst: Added link to _downloads/counters.html
Jonathan Fine <jfine@pytex.org>
parents:
40
diff
changeset
|
9 you can `try out a working example <./_downloads/counters.html>`_ of |
|
e16512d188a0
counters-example.rst: Added link to _downloads/counters.html
Jonathan Fine <jfine@pytex.org>
parents:
40
diff
changeset
|
10 what's wanted. |
|
e16512d188a0
counters-example.rst: Added link to _downloads/counters.html
Jonathan Fine <jfine@pytex.org>
parents:
40
diff
changeset
|
11 |
|
58
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
12 Below is the complete code of this example. To simplify the matter, |
|
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
13 it is completely self-contained. It does not use any library code. |
|
38
f0e1e6c6bb8a
counters-example.rst: Drafted Namespace, Create, Global object.
Jonathan Fine <jfine@pytex.org>
parents:
37
diff
changeset
|
14 |
|
58
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
15 In general library code is a good idea. This example is designed to |
|
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
16 teach you the basics of JavaScript, and not the use of a library. We |
| 90 | 17 hope that what you learn here will help you choose (and contribute to) |
| 18 a library. | |
|
39
f38240437168
counters-example.rst: Drafted 'Counter class' and 'Counter properties'
Jonathan Fine <jfine@pytex.org>
parents:
38
diff
changeset
|
19 |
|
f38240437168
counters-example.rst: Drafted 'Counter class' and 'Counter properties'
Jonathan Fine <jfine@pytex.org>
parents:
38
diff
changeset
|
20 |
|
58
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
21 counters.html |
|
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
22 ------------- |
|
39
f38240437168
counters-example.rst: Drafted 'Counter class' and 'Counter properties'
Jonathan Fine <jfine@pytex.org>
parents:
38
diff
changeset
|
23 |
|
58
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
24 .. literalinclude:: /examples/counters.html |
|
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
25 :language: html |
|
39
f38240437168
counters-example.rst: Drafted 'Counter class' and 'Counter properties'
Jonathan Fine <jfine@pytex.org>
parents:
38
diff
changeset
|
26 |
|
58
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
27 counters.css |
|
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
28 ------------ |
|
39
f38240437168
counters-example.rst: Drafted 'Counter class' and 'Counter properties'
Jonathan Fine <jfine@pytex.org>
parents:
38
diff
changeset
|
29 |
|
58
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
30 .. literalinclude:: /examples/counters.css |
|
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
31 :language: css |
|
39
f38240437168
counters-example.rst: Drafted 'Counter class' and 'Counter properties'
Jonathan Fine <jfine@pytex.org>
parents:
38
diff
changeset
|
32 |
|
58
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
33 counters.js |
|
660cb6581eca
counters-example.rst: Deleted much, added all source files and two paras.
Jonathan Fine <jfine@pytex.org>
parents:
45
diff
changeset
|
34 ----------- |
|
39
f38240437168
counters-example.rst: Drafted 'Counter class' and 'Counter properties'
Jonathan Fine <jfine@pytex.org>
parents:
38
diff
changeset
|
35 |
|
f38240437168
counters-example.rst: Drafted 'Counter class' and 'Counter properties'
Jonathan Fine <jfine@pytex.org>
parents:
38
diff
changeset
|
36 .. literalinclude:: /examples/counters.js |
|
f38240437168
counters-example.rst: Drafted 'Counter class' and 'Counter properties'
Jonathan Fine <jfine@pytex.org>
parents:
38
diff
changeset
|
37 :language: javascript |
