|
|
|
|
@ -2,6 +2,8 @@ var Module = {
|
|
|
|
|
preRun: [], |
|
|
|
|
postRun: [], |
|
|
|
|
|
|
|
|
|
arguments: [], |
|
|
|
|
|
|
|
|
|
printErr: function(message) { |
|
|
|
|
var log = document.getElementById('log'); |
|
|
|
|
log.innerHTML += Array.prototype.slice.call(arguments).join(' ') + '\n'; |
|
|
|
|
@ -39,6 +41,20 @@ var Module = {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/* Parse arguments, e.g. /app/?foo=bar&fizz&buzz=3 goes to the app as |
|
|
|
|
['--foo', 'bar', '--fizz', '--buzz', '3'] */ |
|
|
|
|
var args = decodeURIComponent(window.location.search.substr(1)).trim().split('&'); |
|
|
|
|
for(var i = 0; i != args.length; ++i) { |
|
|
|
|
var j = args[i].indexOf('='); |
|
|
|
|
/* Key + value */ |
|
|
|
|
if(j != -1) { |
|
|
|
|
Module.arguments.push('--' + args[i].substring(0, j)); |
|
|
|
|
Module.arguments.push(args[i].substring(j + 1)); |
|
|
|
|
|
|
|
|
|
/* Just key */ |
|
|
|
|
} else Module.arguments.push('--' + args[i]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Module.setStatus('Downloading...'); |
|
|
|
|
|
|
|
|
|
Module.canvas.addEventListener('contextmenu', function(event) { |
|
|
|
|
|