static folders renamed to archive folders

This commit is contained in:
Jeff Parsons 2016-02-09 18:15:49 -08:00
commit a9e5979406
100 changed files with 461 additions and 461 deletions

View file

@ -1587,7 +1587,7 @@ HTMLOut.prototype.getManifestXML = function(sToken, sIndent, aParms)
var matchCover = null;
match = matchNode[2].match('<cover[^>]*href="([^"]*)"');
if (match && match[1].indexOf("static/") >= 0) {
if (match && match[1].indexOf("archive/") >= 0) {
matchCover = match[1];
if (obj.fDebug) {
sNodeLink = matchCover.replace("/thumbs/", '/').replace(/ ?[0-9]*\.(jpeg|jpg)/, ".pdf");

View file

@ -966,18 +966,18 @@ MarkOut.prototype.convertMDImageLinks = function(sBlock, sIndent)
asParts.splice(2, 1);
}
/*
* If the image link (aMatch[2]) contains "static/" but the sURL is external, AND we're in
* "reveal mode", then transform sURL into a "static/" URL as well; encodeURL() will take care
* If the image link (aMatch[2]) contains "archive/" but the sURL is external, AND we're in
* "reveal mode", then transform sURL into a "archive/" URL as well; encodeURL() will take care
* of the rest of the transformation.
*
* This feature is used with READMEs like /pubs/pc/programming/README.md, where normally we
* want to link to documents stored on sites like archive.org, minuszerodegrees.net or bitsavers,
* unless you're in "reveal mode", in which case we'll serve up our own "backup copies".
*
* The assumption here is that if we have "static" thumbs, then we should also have full "static"
* The assumption here is that if we have "archive" thumbs, then we should also have full "archive"
* copies as well.
*/
if (aMatch[2].indexOf("static/") >= 0 && sURL.indexOf("://") > 0 && (this.fDebug || net.hasParm(net.REVEAL_COMMAND, net.REVEAL_PDFS, this.req))) {
if (aMatch[2].indexOf("archive/") >= 0 && sURL.indexOf("://") > 0 && (this.fDebug || net.hasParm(net.REVEAL_COMMAND, net.REVEAL_PDFS, this.req))) {
sURL = aMatch[2].replace("/thumbs/", "/").replace(" 1.jpeg", ".pdf").replace(".jpg", ".pdf");
}
sURL = net.encodeURL(sURL, this.req, this.fDebug);

View file

@ -140,7 +140,7 @@ net.propagateParms = function(sURL, req)
* Used to encodes any URLs presented on the current page, using this 3-step (um, 4-step) process:
*
* 1) Replace any backslashes with slashes, in case the URL was derived from a file system path
* 2) Remap links that begin with "static/" to the corresponding URL at "http://static.pcjs.org/"
* 2) Remap links that begin with "archive/" to the corresponding URL at "http://archive.pcjs.org/"
* 3) Transform any "htmlspecialchars" into the corresponding entities, using encodeURI()
* 4) Massage the result with net.propagateParms(), so that any special parameters are passed along
*
@ -154,9 +154,9 @@ net.encodeURL = function(sURL, req, fDebug)
if (sURL) {
sURL = sURL.replace(/\\/g, '/');
if (!fDebug) {
if (sURL.match(/^[^:?]*static\//)) {
if (sURL.match(/^[^:?]*archive\//)) {
if (sURL.charAt(0) != '/') sURL = path.join(req.path, sURL);
sURL = "http://static.pcjs.org" + sURL.replace("/static/", "/");
sURL = "http://archive.pcjs.org" + sURL.replace("/archive/", "/");
}
}
return net.propagateParms(encodeURI(sURL), req);