Allow gzipped disk images

This commit is contained in:
Jeff Parsons 2015-11-08 10:30:47 -08:00
commit 231bc201e7
7 changed files with 41 additions and 42 deletions

View file

@ -67,6 +67,7 @@ var DumpAPI = {
},
FORMAT: {
JSON: "json", // default
JSON_GZ: "gz", // gzip is currently used ONLY for compressed JSON
DATA: "data", // same as "json", but built without JSON.stringify() (DiskDump only)
HEX: "hex", // deprecated
BYTES: "bytes", // displays data as hex bytes; normally used only when comments are enabled
@ -77,9 +78,9 @@ var DumpAPI = {
/*
* Because we use an overloaded API endpoint (ie, one that's shared with the FileDump module), we must
* also provide a list of commands which, when combined with the endpoint, define a unique request.
* also provide a list of commands which, when combined with the endpoint, define a unique request.
*/
DumpAPI.asDiskCommands = [DumpAPI.QUERY.DIR, DumpAPI.QUERY.DISK, DumpAPI.QUERY.PATH];
DumpAPI.asFileCommands = [DumpAPI.QUERY.FILE];
if (NODE) module.exports = DumpAPI;
if (NODE) module.exports = DumpAPI;

View file

@ -203,7 +203,6 @@ web.loadResource = function(sURL, fAsync, data, componentNotify, fnNotify, pNoti
}
var nErrorCode = 0;
var sURLData = null;
var sURLName = str.getBaseName(sURL);
var xmlHTTP = (window.XMLHttpRequest? new window.XMLHttpRequest() : new window.ActiveXObject("Microsoft.XMLHTTP"));
if (fAsync) {
xmlHTTP.onreadystatechange = function() {
@ -231,9 +230,9 @@ web.loadResource = function(sURL, fAsync, data, componentNotify, fnNotify, pNoti
}
if (fnNotify) {
if (!componentNotify) {
fnNotify(sURLName, sURLData, nErrorCode, pNotify);
fnNotify(sURL, sURLData, nErrorCode, pNotify);
} else {
fnNotify.call(componentNotify, sURLName, sURLData, nErrorCode, pNotify);
fnNotify.call(componentNotify, sURL, sURLData, nErrorCode, pNotify);
}
}
}
@ -267,9 +266,9 @@ web.loadResource = function(sURL, fAsync, data, componentNotify, fnNotify, pNoti
}
if (fnNotify) {
if (!componentNotify) {
fnNotify(sURLName, sURLData, nErrorCode, pNotify);
fnNotify(sURL, sURLData, nErrorCode, pNotify);
} else {
fnNotify.call(componentNotify, sURLName, sURLData, nErrorCode, pNotify);
fnNotify.call(componentNotify, sURL, sURLData, nErrorCode, pNotify);
}
}
response = [nErrorCode, sURLData];