Merge branch 'next-release'
This commit is contained in:
commit
50f1b5b1a1
9 changed files with 399 additions and 385 deletions
|
|
@ -43,9 +43,9 @@ in your Downloads folder, so the OS X Terminal command `chmod -w PCDOS200-DISK2.
|
|||
Saving Machines
|
||||
---
|
||||
|
||||
Saving the entire state of any existing IBM PC machine is also possible with a single click. You can choose to save
|
||||
a machine in its initial state, or make changes to any of the machine's disks and then save it. All your changes should
|
||||
be preserved.
|
||||
Saving the entire state of any existing IBM PC machine is also easy now, thanks to the new **Save Machine** link.
|
||||
You can choose to save a machine in its initial state, or make changes to any of the machine's disks and then save it.
|
||||
All your changes should be preserved.
|
||||
|
||||
Under the bottom-left corner of any IBM PC on the PCjs [website](/), you should now see a
|
||||
[**Save Machine**] link. When you click that link, PCjs will generate a large "blob" of JavaScript containing
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -156,6 +156,7 @@ function parseXML(sXML, sXMLFile, idMachine, sParms, fResolve, display, done)
|
|||
*
|
||||
* Until/unless that changes, components.xsl cannot be simplified as much as I might have hoped.
|
||||
*/
|
||||
if (typeof resources == 'object') sURL = null; // turn off URL inclusion if we have embedded resources
|
||||
sXML = sXML.replace(/(<machine[^>]*\sid=)(['"]).*?\2/, "$1$2" + idMachine + "$2" + (sParms? " parms='" + sParms + "'" : "") + (sURL? ' url="' + sURL + '"' : ''));
|
||||
}
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -197,29 +197,38 @@ function downloadPC(sURL, sCSS, nErrorCode, aMachineInfo)
|
|||
sPCJS = matchScript[1] + "var resources=" + sResources + ";" + matchScript[2] + matchScript[3];
|
||||
Component.log("saving machine: '" + idMachine + "' (" + sPCJS.length + " bytes)");
|
||||
|
||||
var uri;
|
||||
var sURI, sAlert;
|
||||
var link = document.createElement('a');
|
||||
var fDownload = (!DEBUG && typeof link.download == 'string');
|
||||
|
||||
if (MAXDEBUG) {
|
||||
sPCJS = sPCJS.replace(/[\u00A0-\u2666]/g, function(c) {
|
||||
return '&#' + c.charCodeAt(0) + ';';
|
||||
});
|
||||
uri = "data:application/javascript;base64," + btoa(sPCJS);
|
||||
sURI = "data:application/javascript;base64," + btoa(encodeURI(sPCJS));
|
||||
} else {
|
||||
sPCJS = sPCJS.replace(/\u00A9/g, "©");
|
||||
uri = "data:application/javascript," + (web.isUserAgent("Firefox")? encodeURIComponent(sPCJS) : encodeURI(sPCJS));
|
||||
sURI = "data:application/javascript,";
|
||||
if (!web.isUserAgent("Firefox")) {
|
||||
fDownload = false;
|
||||
sURI += encodeURI(sPCJS);
|
||||
} else {
|
||||
sURI += encodeURIComponent(sPCJS);
|
||||
}
|
||||
}
|
||||
|
||||
var link = document.createElement('a');
|
||||
if (!DEBUG && typeof link.download == 'string') {
|
||||
link.href = uri;
|
||||
link.download = sScript + ".json";
|
||||
document.body.appendChild(link); // Firefox requires the link to be in the body (?)
|
||||
if (fDownload) {
|
||||
link.href = sURI;
|
||||
link.download = sScript + ".js";
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
sAlert = 'Check your Downloads folder for "' + link.download + '", ';
|
||||
} else {
|
||||
window.open(uri);
|
||||
window.open(sURI);
|
||||
sAlert = 'Check your browser for a new window/tab containing the PCjs script, ';
|
||||
}
|
||||
|
||||
var sAlert = 'Check your Downloads folder for "' + sScript + '.json", ';
|
||||
sAlert += 'copy it to your web server as "' + sScript + '.js", and then add the following to your web page:\n\n';
|
||||
sAlert += '<div id="' + idMachine + '"></div>\n';
|
||||
sAlert += '...\n';
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue