From 8fd9387a9b37c89e19af36dcb25cf1e19bfeb246 Mon Sep 17 00:00:00 2001 From: Viresh Ratnakar <39968616+viresh-ratnakar@users.noreply.github.com> Date: Wed, 20 Jan 2021 15:48:21 -0800 Subject: [PATCH] Exolve v1.00 --- exolve-from-ipuz.js | 2 +- exolve-from-puz.js | 2 +- exolve-m.css | 17 ++- exolve-m.js | 216 ++++++++++++++++++++++-------- exolve-player.html | 8 +- exolve-widget.html | 4 +- gussalufz-1-solved.html | 6 +- gussalufz-1-unsolved.html | 6 +- gussalufz-10-solved.html | 6 +- gussalufz-10-unsolved.html | 6 +- gussalufz-11-solved.html | 6 +- gussalufz-11-unsolved.html | 6 +- gussalufz-12-solved.html | 6 +- gussalufz-12-unsolved.html | 6 +- gussalufz-13-solved.html | 6 +- gussalufz-13-unsolved.html | 6 +- gussalufz-14-solved.html | 6 +- gussalufz-14-unsolved.html | 6 +- gussalufz-15-solved.html | 6 +- gussalufz-15-unsolved.html | 6 +- gussalufz-16-solved.html | 6 +- gussalufz-16-unsolved.html | 6 +- gussalufz-17-solved.html | 6 +- gussalufz-17-unsolved.html | 6 +- gussalufz-18-solved.html | 6 +- gussalufz-18-unsolved.html | 6 +- gussalufz-19-solved.html | 6 +- gussalufz-19-unsolved.html | 6 +- gussalufz-2-solved.html | 6 +- gussalufz-2-unsolved.html | 6 +- gussalufz-20-solved.html | 6 +- gussalufz-20-teaser-solved.html | 4 +- gussalufz-20-unsolved.html | 6 +- gussalufz-21-solved.html | 6 +- gussalufz-21-unsolved.html | 6 +- gussalufz-3-solved.html | 6 +- gussalufz-3-unsolved.html | 6 +- gussalufz-4-solved.html | 6 +- gussalufz-4-unsolved.html | 6 +- gussalufz-5-solved.html | 6 +- gussalufz-5-unsolved.html | 6 +- gussalufz-8-solved.html | 6 +- gussalufz-8-unsolved.html | 6 +- latc-temp.html | 6 +- ragitvach-1-solved.html | 6 +- ragitvach-1-unsolved.html | 6 +- ribelle-gussalufz-1-solved.html | 4 +- ribelle-gussalufz-1-unsolved.html | 4 +- 48 files changed, 307 insertions(+), 188 deletions(-) diff --git a/exolve-from-ipuz.js b/exolve-from-ipuz.js index 84c0a352..c9020ca6 100644 --- a/exolve-from-ipuz.js +++ b/exolve-from-ipuz.js @@ -24,7 +24,7 @@ SOFTWARE. The latest code and documentation for Exolve can be found at: https://github.com/viresh-ratnakar/exolve -Version: Exolve v0.99 January 2 2021 +Version: Exolve v1.00 January 20 2021 */ /** diff --git a/exolve-from-puz.js b/exolve-from-puz.js index eeac5a75..32a84631 100644 --- a/exolve-from-puz.js +++ b/exolve-from-puz.js @@ -24,7 +24,7 @@ SOFTWARE. The latest code and documentation for Exolve can be found at: https://github.com/viresh-ratnakar/exolve -Version: Exolve v0.99 January 2 2021 +Version: Exolve v1.00 January 20 2021 */ function exolveFromPuzNextNull(buffer, offset) { diff --git a/exolve-m.css b/exolve-m.css index 60a81916..2d446f83 100644 --- a/exolve-m.css +++ b/exolve-m.css @@ -5,7 +5,7 @@ Copyright (c) 2019 Viresh Ratnakar See the full license notice in exolve-m.js. -Version: Exolve v0.99 January 2 2021 +Version: Exolve v1.00 January 20 2021 */ @media (max-width: 500px) { @@ -282,6 +282,21 @@ Version: Exolve v0.99 January 2 2021 border-bottom: solid 2px #c9c9c9; background-color: inherit; } +.xlv-storage-list { + outline: solid 1px gray; + margin: 6px 1px; + padding: 0; + max-height: 400px; + overflow: auto; +} +.xlv-storage-list table { + border-collapse: collapse; + border-spacing: 0; + width: 100%; +} +.xlv-storage-list tr { + border: solid 1px gray; +} .xlv-scratchpad { border: 1px solid black; padding: 8px; diff --git a/exolve-m.js b/exolve-m.js index e1aac1d6..fd156c68 100644 --- a/exolve-m.js +++ b/exolve-m.js @@ -62,26 +62,30 @@ var exolvePuzzles; * web page. * customized is an optional function that will get called after the puzzle * is set up. The Exolve object will be passed to the function. - * addStateToUrl should be set to false only if you do *not* want to save - * the puzzle state in the URL (the puzzle state is also saved in local - * storage and a cookie). + * provideStateUrl should be set to true if you also want to provide a URL + * that includes the current state and can be bookmarked or shared. Note + * that the puzzle state is always attempted to be saved in local storage. * visTop should be set to the height of any sticky/fixed position elements * at the top of the page (normally just 0). * maxDim If non-zero, use this as the suggested max size of the container * in px. + * saveState If false, state is not saved in local storage. Useful for + * creating temporary/preview puzzles. */ function Exolve(puzzleSpec, containerId='', customizer=null, - addStateToUrl=true, + provideStateUrl=true, visTop=0, - maxDim=0) { - this.VERSION = 'Exolve v0.99 January 2 2021' + maxDim=0, + saveState=true) { + this.VERSION = 'Exolve v1.00 January 20 2021' this.puzzleText = puzzleSpec this.containerId = containerId this.customizer = customizer - this.addStateToUrl = addStateToUrl + this.provideStateUrl = provideStateUrl + this.saveState = saveState this.gridWidth = 0 this.gridHeight = 0 @@ -230,18 +234,23 @@ function Exolve(puzzleSpec, 'across-label': 'Across', 'down-label': 'Down', 'tools-link': 'Tools', - 'tools-link.hover': 'Show/hide tools: list of control keys and scratch pad', + 'tools-link.hover': 'Show/hide tools: manage storage, see list of control keys and scratch pad', 'tools-msg': ` + Control keys: `, + 'manage-storage': 'Manage local storage', + 'manage-storage.hover': 'View puzzle Ids for which state has been saved. Delete old saved states to free up local storage space if needed', + 'manage-storage-close': 'Close (local storage)', + 'manage-storage-close.hover': 'Close the local storage management panel', 'exolve-link': 'Exolve on GitHub', 'report-bug': 'Report bug', - 'saving-msg': 'Your entries are auto-saved in the the browser\'s local storage and in cookies, when possible.', - 'saving-bookmark': 'You can bookmark/save this link as additional back-up:', + 'saving-msg': 'Your entries are auto-saved in the the browser\'s local storage.', + 'saving-bookmark': 'You can save/share the current state using this link:', 'saving-url': 'URL', 'shuffle': 'Scratch pad: (click here to shuffle)', 'shuffle.hover': 'Shuffle selected text (or all text, if none selected)', @@ -359,12 +368,23 @@ Exolve.prototype.init = function() {
- ${this.textLabels['saving-msg']} + ${this.saveState ? this.textLabels['saving-msg'] : ''}