OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2014 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
| 7 /* globals NaClTerm, lib */ |
| 8 |
7 'use strict'; | 9 'use strict'; |
8 | 10 |
9 NaClTerm.nmf = 'gforth.nmf' | 11 NaClTerm.nmf = 'gforth.nmf'; |
10 | 12 |
11 function onFailure() { | 13 function onFailure() { |
12 console.log('Failed to allocate space!\n'); | 14 console.log('Failed to allocate space!\n'); |
13 NaClTerm.init(); | 15 NaClTerm.init(); |
14 } | 16 } |
15 | 17 |
16 function requestTemporary(amount, success, failure) { | 18 function requestTemporary(amount, success, failure) { |
17 navigator.webkitTemporaryStorage.requestQuota(amount, function(bytes) { | 19 navigator.webkitTemporaryStorage.requestQuota(amount, function(bytes) { |
18 window.webkitRequestFileSystem( | 20 window.webkitRequestFileSystem( |
19 window.TEMPORARY, bytes, success, failure); | 21 window.TEMPORARY, bytes, success, failure); |
(...skipping 15 matching lines...) Expand all Loading... |
35 | 37 |
36 function onInit() { | 38 function onInit() { |
37 requestStorage(NaClTerm.init, onFailure); | 39 requestStorage(NaClTerm.init, onFailure); |
38 } | 40 } |
39 | 41 |
40 window.onload = function() { | 42 window.onload = function() { |
41 lib.init(function() { | 43 lib.init(function() { |
42 onInit(); | 44 onInit(); |
43 }); | 45 }); |
44 }; | 46 }; |
OLD | NEW |