From ed02ccffb07a41e86a52a870e8f0abdc5d5078d0 Mon Sep 17 00:00:00 2001 From: pacien Date: Wed, 24 Oct 2018 04:39:48 +0200 Subject: Use URL anchor to avoid query cache miss --- index.html | 2 +- pointless/viewer/init.js | 7 ++++++- readme.md | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index ce02062..c03dffb 100644 --- a/index.html +++ b/index.html @@ -74,7 +74,7 @@
  • Bug tracker
  • Source repository
  • Powered by PDF.js
  • -
  • Demo
  • +
  • Demo
  • diff --git a/pointless/viewer/init.js b/pointless/viewer/init.js index 01f550c..e76ab1b 100644 --- a/pointless/viewer/init.js +++ b/pointless/viewer/init.js @@ -20,7 +20,7 @@ const params = function() { const queryDict = {}; - location.search.substr(1).split("&").forEach(function(item) { + location.hash.substr(1).split("&").forEach(item => { const pair = item.split("="); queryDict[pair[0]] = pair[1]; }); @@ -58,5 +58,10 @@ function init() { viewer.load(params["file"]); } +function load(file) { + location.hash = "file=" + file; + location.reload(); +} + if (isController()) init(); diff --git a/readme.md b/readme.md index 5f6b64a..40ce682 100644 --- a/readme.md +++ b/readme.md @@ -11,7 +11,7 @@ An instance of this web application is deployed at [pointlessviewer.pacien.org]( A double-width presentation may be generated with _Beamer_ using `\setbeameroption{show notes on second screen=right}`. -A demonstration is available [here](https://pointlessviewer.pacien.org/?file=sample/demo.pdf). +A demonstration is available [here](https://pointlessviewer.pacien.org/#file=sample/demo.pdf). ## License -- cgit v1.2.3