Copyright symbol work-around

This commit is contained in:
Jeff Parsons 2016-02-17 13:58:42 -08:00
commit 3bcf1dfc23
8 changed files with 54 additions and 53 deletions

View file

@ -55,7 +55,7 @@ function savePC(idMachine, sPCJSFile)
var sState = cmp.powerOff(true);
var sParms = cmp.saveMachineParms();
if (!sPCJSFile) {
if (DEBUG) {
if (MAXDEBUG) {
sPCJSFile = "/tmp/pcjs/" + (XMLVERSION || APPVERSION) + "/pc.js"
} else {
sPCJSFile = "/versions/pcjs/" + (XMLVERSION || APPVERSION) + "/pc" + (dbg? "-dbg" : "") + ".js";
@ -204,11 +204,12 @@ function downloadPC(sURL, sCSS, nErrorCode, aMachineInfo)
});
uri = "data:application/javascript;base64," + btoa(sPCJS);
} else {
sPCJS = sPCJS.replace(/\u00A9/g, "©");
uri = "data:application/javascript," + (web.isUserAgent("Firefox")? encodeURIComponent(sPCJS) : encodeURI(sPCJS));
}
var link = document.createElement('a');
if (typeof link.download == 'string' && sPCJS.length < 2000000) {
if (typeof link.download == 'string') {
link.href = uri;
link.download = sScript + ".json";
document.body.appendChild(link); // Firefox requires the link to be in the body (?)

View file

@ -1,10 +1,10 @@
/**
* @fileoverview String-related helper functions
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a> (@jeffpar)
* @version 1.0
* Created 2014-03-09
* @fileoverview String-related helper functions
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a> (@jeffpar)
* @version 1.0
* Created 2014-03-09
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.

View file

@ -1,10 +1,10 @@
/**
* @fileoverview Assorted helper functions
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a> (@jeffpar)
* @version 1.0
* Created 2014-03-09
* @fileoverview Assorted helper functions
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a> (@jeffpar)
* @version 1.0
* Created 2014-03-09
*
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
* Copyright © 2012-2016 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.