OLD | NEW |
---|---|
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html i18n-values="dir:textdirection;"> | 2 <html i18n-values="dir:textdirection;"> |
3 <head> | 3 <head> |
4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
5 <title i18n-content="title"></title> | 5 <title i18n-content="title"></title> |
6 <link rel="icon" href="../../app/theme/downloads_favicon.png"> | 6 <link rel="icon" href="../../app/theme/downloads_favicon.png"> |
7 <style type="text/css"> | 7 <style type="text/css"> |
8 *:-khtml-drag { | 8 *:-khtml-drag { |
9 background-color: rgba(238,238,238, 0.5); | 9 background-color: rgba(238,238,238, 0.5); |
10 } | 10 } |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 <script src="shared/js/util.js"></script> | 213 <script src="shared/js/util.js"></script> |
214 <script> | 214 <script> |
215 | 215 |
216 var localStrings = null; | 216 var localStrings = null; |
217 var downloadRowList = null; | 217 var downloadRowList = null; |
218 | 218 |
219 function init() { | 219 function init() { |
220 localStrings = new LocalStrings(); | 220 localStrings = new LocalStrings(); |
221 initTestHarness(); | 221 initTestHarness(); |
222 | 222 |
223 // Suppress browser shortcuts. | |
224 window.onkeydown = function(e) { | |
rginda
2011/05/25 04:13:38
LGTM as long as you're sure you want to suppress *
achuithb
2011/05/25 06:58:25
I don't think we want any shortcuts for the pop-up
xiyuan
2011/05/25 16:55:51
Ctrl+W is useful, I think.
Yeah, I saw the TEST s
| |
225 e.preventDefault(); | |
226 }; | |
227 | |
223 $('showalldownloadstext').textContent = | 228 $('showalldownloadstext').textContent = |
224 localStrings.getString('showalldownloads'); | 229 localStrings.getString('showalldownloads'); |
225 | 230 |
226 downloadRowList = new DownloadRowList(); | 231 downloadRowList = new DownloadRowList(); |
227 chrome.send('getDownloads', []); | 232 chrome.send('getDownloads', []); |
228 } | 233 } |
229 | 234 |
230 /** | 235 /** |
231 * Testing. Allow this page to be loaded in a browser. | 236 * Testing. Allow this page to be loaded in a browser. |
232 * Create stubs for localStrings and chrome.send. | 237 * Create stubs for localStrings and chrome.send. |
(...skipping 24 matching lines...) Expand all Loading... | |
257 ary[0] == 'chrome://downloads')) | 262 ary[0] == 'chrome://downloads')) |
258 sendTestResults(); | 263 sendTestResults(); |
259 }; | 264 }; |
260 document.body.oncontextmenu = ''; | 265 document.body.oncontextmenu = ''; |
261 } | 266 } |
262 } | 267 } |
263 | 268 |
264 /** | 269 /** |
265 * Create a results array with test data and call downloadsList. | 270 * Create a results array with test data and call downloadsList. |
266 */ | 271 */ |
267 var id = 1; | 272 var id = 0; |
rginda
2011/05/25 04:13:38
Is this here on purpose?
achuithb
2011/05/25 06:58:25
Ya, test code. 0 is a better place to start.
| |
268 var results = []; | 273 var results = []; |
269 function sendTestResults() { | 274 function sendTestResults() { |
270 results.push({ | 275 results.push({ |
271 state: (id % 2 ? 'DANGEROUS' : 'COMPLETE'), | 276 state: (id % 2 ? 'DANGEROUS' : 'COMPLETE'), |
272 percent: (id % 2 ? 90 : 100), | 277 percent: (id % 2 ? 90 : 100), |
273 id: id, | 278 id: id, |
274 file_name: ' Test' + id + '.pdf', | 279 file_name: ' Test' + id + '.pdf', |
275 file_path: '/home/achuith/Downloads/Test' + id + '.pdf', | 280 file_path: '/home/achuith/Downloads/Test' + id + '.pdf', |
276 progress_status_text : (id % 2 ? | 281 progress_status_text : (id % 2 ? |
277 'download progressing nicely' : 'download complete'), | 282 'download progressing nicely' : 'download complete'), |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
795 </script> | 800 </script> |
796 <body onload="init();" onclick="menu.clear();" onselectstart="return false;" | 801 <body onload="init();" onclick="menu.clear();" onselectstart="return false;" |
797 i18n-values=".style.fontFamily:fontfamily" oncontextmenu="return false;"> | 802 i18n-values=".style.fontFamily:fontfamily" oncontextmenu="return false;"> |
798 <div id="main" class="columnlist"></div> | 803 <div id="main" class="columnlist"></div> |
799 <div id="showalldownloads" class="showalldownloads"> | 804 <div id="showalldownloads" class="showalldownloads"> |
800 <span id="showalldownloadstext" class="showalldownloadstext" | 805 <span id="showalldownloadstext" class="showalldownloadstext" |
801 onclick="showAllDownloads()"></span> | 806 onclick="showAllDownloads()"></span> |
802 </div> | 807 </div> |
803 </body> | 808 </body> |
804 </html> | 809 </html> |
OLD | NEW |