| Revision 468,
985 bytes
checked in by jdalbey, 7 years ago
(diff) |
|
einotebook - multifile commit. Redesign to fix timing problem on some machines as well as improve file naming. Fixed #176.
|
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 | /** |
|---|
| 2 | * Stores each Incident. You must set Incident.doc to the document that incidents will be |
|---|
| 3 | * displayed on before using this class. |
|---|
| 4 | */ |
|---|
| 5 | var incidents = new Array(); |
|---|
| 6 | |
|---|
| 7 | //========== public members ==========/ |
|---|
| 8 | incidents.doc = null; |
|---|
| 9 | |
|---|
| 10 | //========== public methods ==========// |
|---|
| 11 | incidents.get = incidents_get; |
|---|
| 12 | incidents.add = incidents_add; |
|---|
| 13 | |
|---|
| 14 | //=========== method definitions ==========// |
|---|
| 15 | /** |
|---|
| 16 | * Searches through each Incident to find an Incident with the given number. |
|---|
| 17 | * @param number {Integer} The number of an incident. |
|---|
| 18 | * @return The Incident with the given number. |
|---|
| 19 | */ |
|---|
| 20 | function incidents_get(number) |
|---|
| 21 | { |
|---|
| 22 | var incident; |
|---|
| 23 | |
|---|
| 24 | // FOR each incident |
|---|
| 25 | for (var i = 0; i < this.length; i++) |
|---|
| 26 | { |
|---|
| 27 | // IF the incident's number matches |
|---|
| 28 | if (this[i].number == number) |
|---|
| 29 | { |
|---|
| 30 | // remember the incident |
|---|
| 31 | incident = this[i]; |
|---|
| 32 | } |
|---|
| 33 | } |
|---|
| 34 | return incident; |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | /** |
|---|
| 38 | * Adds an Incident. |
|---|
| 39 | * @param incident {Incident} The Incident to be added. |
|---|
| 40 | */ |
|---|
| 41 | function incidents_add(incident) |
|---|
| 42 | { |
|---|
| 43 | incidents.push(incident); |
|---|
| 44 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.