From a655339911213f3e4f0f46bbd3dc8afc026e5a6a Mon Sep 17 00:00:00 2001 From: Dave Winer Date: Wed, 24 Jun 2015 19:28:27 -0400 Subject: [PATCH] v0.61 --- README.md | 12 +++++++++++- pagepark.js | 7 ++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 02417e5..c2f1f71 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,17 @@ There will always be more work to do here. ;-) ##### v0.61 6/24/15 by DW -Files with the extension .opml are now be rendered as outlines. There's a template for outlines, it uses the new outlineBrowser toolkit. If you want the raw OPML text from the server, add an Accept header with the value: text/x-opml, following a convention established by the OPML Editor. Here's an example of an OPML file rendered through the new template. +Files with the extension .opml are now rendered as outlines. + +There's a template for outlines, it uses the new outlineBrowser toolkit. Here's an example of an OPML file rendered through the new template. + +If you want the raw OPML text from the server, you can do it one of two ways: + +1. Add ?format=opml at the end of the url. Example. + +2. If you're making the request in a program, you can add an Accept header with the value: text/x-opml, following a convention established by the OPML Editor. + +As with scripts and markdown files, you can turn the feature off in config.json. ##### v0.60 5/26/15 by DW diff --git a/pagepark.js b/pagepark.js index dbf0a53..95d2db1 100644 --- a/pagepark.js +++ b/pagepark.js @@ -1,4 +1,4 @@ -var myVersion = "0.61s", myProductName = "PagePark"; +var myVersion = "0.61t", myProductName = "PagePark"; //The MIT License (MIT) @@ -257,6 +257,7 @@ function handleHttpRequest (httpRequest, httpResponse) { }); } function serveFile (f, config) { + var formatParam = parsedUrl.query.format.toLowerCase (); //url ends with ?format=abc -- 6/24/15 by DW function httpReturn (val, type) { //2/17/15 by DW httpResponse.writeHead (200, {"Content-Type": type}); httpResponse.end (val.toString ()); @@ -306,8 +307,8 @@ function handleHttpRequest (httpRequest, httpResponse) { } break; case config.extOpmlFiles: //6/23/15 by DW - var flReturnHtml = !hasAcceptHeader ("text/x-opml"); - if (pageparkPrefs.flProcessOpmlFiles && config.flProcessOpmlFiles && flReturnHtml) { //xxx + var flReturnHtml = (!hasAcceptHeader ("text/x-opml")) && (formatParam != "opml"); + if (pageparkPrefs.flProcessOpmlFiles && config.flProcessOpmlFiles && flReturnHtml) { //6/24/15 by DW getOpmlTemplate (function (theTemplate) { var opmltext = data.toString (), pagetable = new Object (); opmlLib.readOpmlString (opmltext, function (theOutline) {