Mercurial > browser-couch
comparison big.js @ 43:eba5866b6adc
Renamed a global variable called 'status' to 'statusArea' so the big test status area would show on Safari. VERY strange bug.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Tue, 14 Apr 2009 10:53:27 -0700 |
parents | 44005d894d1b |
children |
comparison
equal
deleted
inserted
replaced
42:2d4a0ca10783 | 43:eba5866b6adc |
---|---|
69 | 69 |
70 makeNextDocument(); | 70 makeNextDocument(); |
71 } | 71 } |
72 | 72 |
73 var config = document.getElementById("config"); | 73 var config = document.getElementById("config"); |
74 var status = document.getElementById("status"); | 74 var statusArea = document.getElementById("status"); |
75 var result = document.getElementById("result"); | 75 var result = document.getElementById("result"); |
76 | 76 |
77 status.textContent = "Please wait..."; | 77 statusArea.textContent = "Please wait..."; |
78 config.textContent = ("Counting word occurrences in a lexicon of " + | 78 config.textContent = ("Counting word occurrences in a lexicon of " + |
79 LEXICON_SIZE + " words, using a corpus of " + | 79 LEXICON_SIZE + " words, using a corpus of " + |
80 CORPUS_SIZE + " documents, each of which is " + | 80 CORPUS_SIZE + " documents, each of which is " + |
81 MIN_DOCUMENT_LENGTH + " to " + MAX_DOCUMENT_LENGTH + | 81 MIN_DOCUMENT_LENGTH + " to " + MAX_DOCUMENT_LENGTH + |
82 " words long."); | 82 " words long."); |
104 db.wipe(function() { | 104 db.wipe(function() { |
105 makeCorpus( | 105 makeCorpus( |
106 db, | 106 db, |
107 makeProgress( | 107 makeProgress( |
108 function(phase, percent) { | 108 function(phase, percent) { |
109 status.textContent = ("building new corpus (" + | 109 statusArea.textContent = ("building new corpus (" + |
110 Math.floor(percent * 100) + | 110 Math.floor(percent * 100) + |
111 "%)"); | 111 "%)"); |
112 }), | 112 }), |
113 25, | 113 25, |
114 run | 114 run |
115 ); | 115 ); |
116 }); | 116 }); |
133 chunkSize: 25, | 133 chunkSize: 25, |
134 progress: makeProgress( | 134 progress: makeProgress( |
135 function(phase, percent) { | 135 function(phase, percent) { |
136 percent = Math.floor(percent * 100); | 136 percent = Math.floor(percent * 100); |
137 var msg = phase + " (" + percent + "%)"; | 137 var msg = phase + " (" + percent + "%)"; |
138 status.textContent = msg; | 138 statusArea.textContent = msg; |
139 }), | 139 }), |
140 finished: function(aResult) { | 140 finished: function(aResult) { |
141 status.textContent = "Done."; | 141 statusArea.textContent = "Done."; |
142 | 142 |
143 ModuleLoader.require( | 143 ModuleLoader.require( |
144 "JSON", | 144 "JSON", |
145 function() { | 145 function() { |
146 result.textContent = JSON.stringify(aResult); | 146 result.textContent = JSON.stringify(aResult); |