Changed the onclick handlers for Keyboard CLICKCODES to let updateFocus() scroll the canvas into view as needed, because (at least on iOS) the code that tries prevent the page from scrolling has an annoying "jerking" side-effect; also fixed the old Node web server code that would install onclick handlers for disk images, triggering automatic conversion of JSON to IMG files
This commit is contained in:
parent
ed75397b83
commit
7ca8fa18a1
12 changed files with 19 additions and 18 deletions
|
|
@ -519,9 +519,9 @@ HTMLOut.filter = function(req, res, next)
|
|||
HTMLOut.logError(err);
|
||||
next(); // alternatively: res.status(404).send("Cannot GET " + req.path);
|
||||
} else {
|
||||
sData = sData.replace(/^([ \t]*import\s+\S+\s+from\s+(['"]).*?\1;)/gm, "// $1");
|
||||
sData = sData.replace(/^([ \t]*import\s+\S+\s+from\s+['"].*?['"];)/gm, "// $1");
|
||||
sData = sData.replace(/^([ \t]*export\s+default\s+\S+;)/gm, "// $1");
|
||||
sData = sData.replace(/^([ \t]*var\s+\S+\s*=\s*require\((['"]).*?\1\);)/gm, "// $1");
|
||||
sData = sData.replace(/^([ \t]*var\s+\S+\s*=\s*require\(['"].*?['"]\);)/gm, "// $1");
|
||||
sData = sData.replace(/^([ \t]*(if\s+\(NODE\)\s*|)module\.exports\s*=\s*\S+;)/gm, "// $1");
|
||||
res.set("Content-Type", "application/javascript");
|
||||
res.status(200).send(sData);
|
||||
|
|
@ -1643,7 +1643,7 @@ HTMLOut.prototype.getManifestXML = function(sToken, sIndent, aParms)
|
|||
}
|
||||
|
||||
if (sNodeLink) {
|
||||
if (str.endsWith(sNodeLink, ".json") && sNodeLink.indexOf("/disks/") === 0) {
|
||||
if (str.endsWith(sNodeLink, ".json") && (!sNodeLink.indexOf("/apps/") || !sNodeLink.indexOf("/disks/"))) {
|
||||
sOnClick = obj.genOnClick(sNodeLink);
|
||||
}
|
||||
sNodeValue = '<a href="' + net.encodeURL(sNodeLink, obj.req, obj.fDebug) + '"' + sOnClick + '>' + sNodeValue + '</a>';
|
||||
|
|
|
|||
|
|
@ -715,7 +715,7 @@ HTTPAPI.processDumpAPI = function(req, res)
|
|||
if (sDisk.indexOf("..") < 0 || req.app.settings.port == 8088) {
|
||||
|
||||
sFormat = req.query[DumpAPI.QUERY.FORMAT] || DumpAPI.FORMAT.JSON;
|
||||
fComments = (req.query[DumpAPI.QUERY.COMMENTS]? true : false);
|
||||
fComments = !!req.query[DumpAPI.QUERY.COMMENTS];
|
||||
var sSize = req.query[DumpAPI.QUERY.MBHD];
|
||||
if (sSize) {
|
||||
sSize = (sSize * 1000).toString();
|
||||
|
|
@ -751,7 +751,7 @@ HTTPAPI.processDumpAPI = function(req, res)
|
|||
if (sFile.indexOf("..") < 0 || req.app.settings.port == 8088) {
|
||||
|
||||
sFormat = req.query[DumpAPI.QUERY.FORMAT] || DumpAPI.FORMAT.JSON;
|
||||
fComments = (req.query[DumpAPI.QUERY.COMMENTS]? true : false);
|
||||
fComments = !!req.query[DumpAPI.QUERY.COMMENTS];
|
||||
var fDecimal;
|
||||
if (req.query[DumpAPI.QUERY.DECIMAL]) {
|
||||
fDecimal = (req.query[DumpAPI.QUERY.DECIMAL] == "true");
|
||||
|
|
@ -793,7 +793,7 @@ HTTPAPI.dumpDisk = function(err, disk, res)
|
|||
sAttachment = path.basename(disk.sDiskPath);
|
||||
var i = sAttachment.lastIndexOf('.');
|
||||
if (i > 0) sAttachment = sAttachment.substring(0, i+1) + DumpAPI.FORMAT.IMG;
|
||||
sResponse = disk.convertToIMG();
|
||||
sResponse = disk.convertToIMG(true);
|
||||
} else {
|
||||
// res.charset = "utf-8";
|
||||
sMIMEType = "application/json; charset=utf-8";
|
||||
|
|
|
|||
Loading…
Reference in a new issue