From d0ad5e348f9c235ce0a7484444de6487ae4dc6e9 Mon Sep 17 00:00:00 2001 From: Viresh Ratnakar <39968616+viresh-ratnakar@users.noreply.github.com> Date: Wed, 20 Jan 2021 16:00:39 -0800 Subject: [PATCH] v1.00 ### Version: Exolve v1.00 January 20 2021 - Stop saving state in cookies. Stop including state in URL (but still provide URL for saving.sharing). Change the name of the addStateToUrl constructor param to the now-more-apt provideStateUrl. - Create a saveState constructor param, defaulting to true. Can be set to false for creating throwaway grids such as previews. - Provide an interface to see all the local-storage-saved states and delete some of them if needed. The interface also shows the amount of local storage used up in saved Exolve states. --- CHANGELOG.md | 11 ++ README.md | 50 ++++--- exolve-from-ipuz.js | 2 +- exolve-from-puz.js | 2 +- exolve-m-simple.html | 6 +- exolve-m.css | 17 ++- exolve-m.html | 6 +- exolve-m.js | 216 ++++++++++++++++++++++-------- exolve-player.html | 8 +- exolve-widget.html | 6 +- exolve.html | 231 +++++++++++++++++++++++++-------- test-15x15-unsolved.html | 4 +- test-3d-solved.html | 4 +- test-basic-solved.html | 4 +- test-basic-unsolved.html | 4 +- test-big-grid.html | 4 +- test-color-scheme.html | 4 +- test-customize-puzzle.html | 4 +- test-deleted-clues-solved.html | 4 +- test-diagramless-solved.html | 4 +- test-diagramless-unsolved.html | 4 +- test-exolve-div.html | 4 +- test-hindi.html | 4 +- test-ipuz-solved.html | 6 +- test-ipuz-unsolved.html | 6 +- test-jigsaw-solved.html | 4 +- test-jigsaw-unsolved.html | 4 +- test-linked-solved.html | 4 +- test-linked-unsolved.html | 8 +- test-mixed-solved.html | 8 +- test-ninas-colours.html | 4 +- test-no-clues.html | 4 +- test-nonnum.html | 4 +- test-numeric.html | 4 +- test-partial-solved.html | 4 +- test-questions.html | 4 +- test-russian.html | 4 +- test-scroll.html | 4 +- test-skipped-numbers.html | 4 +- test-two-puzzles.html | 4 +- test-widget.html | 4 +- 41 files changed, 475 insertions(+), 212 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6145c69..3d393469 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +### Version: Exolve v1.00 January 20 2021 + +- Stop saving state in cookies. Stop including state in URL (but still provide + URL for saving.sharing). Change the name of the addStateToUrl constructor + param to the now-more-apt provideStateUrl. +- Create a saveState constructor param, defaulting to true. Can be set to + false for creating throwaway grids such as previews. +- Provide an interface to see all the local-storage-saved states and delete + some of them if needed. The interface also shows the amount of local + storage used up in saved Exolve states. + ### Version: Exolve v0.99 January 2 2021 - Save puzzle state in the browser's local storage (in addition to cookies). diff --git a/README.md b/README.md index 33cf6a53..70b7a7a9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## An Easily Configurable Interactive Crossword Solver -### Version: Exolve v0.99 January 2 2021 +### Version: Exolve v1.00 January 20 2021 Exolve can help you create online interactively solvable crosswords (simple ones with blocks and/or bars as well as those that are jumbles or are @@ -1130,12 +1130,16 @@ Here are all the names of pieces of text that you can relabel: | `across-label` | Across | | `down-label` | Down | | `tools-link` | Tools | -| `tools-link.hover` | Show/hide tools: list of control keys and scratch pad| -| `tools-msg` | <ul> <li> <b>Tab/Shift-Tab: [longish list of all control keys]... </ul>| | +| `tools-link.hover` | Show/hide tools: manage storage, see list of control keys and scratch pad| +| `tools-msg` | Control keys: <ul> <li> <b>Tab/Shift-Tab: [longish list of all control keys]... </ul>| +| `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 (manage 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)| @@ -1186,14 +1190,24 @@ but just want to provide some/all of the separators. Example: ## Saving state The software automatically saves state. It does so in the browser's local -storage, as well as in a cookie, and in the URL after the # (unless URL-saving -is overridden in the constructor). In local storage and in cookies, the state -uses the puzzle id specified in the [`exolve-id`](#exolve-id) section as the -key. The cookie is retained for 90 days after the last change. +storage. Users can also copy and share a URL that saves the state after the # +(if requested through provideStateUrl=true in the constructor). The state uses +the puzzle id specified in the [`exolve-id`](#exolve-id) section as the key. Please note that a variety of factors control access to and size limits of -local storage and cookies. Especially when embedding Exolve puzzles in -cross-site iframes, state saving may not work. +local storage. Especially when embedding Exolve puzzles in cross-site iframes, +state saving may not work. + +Older versions of Exolve used to save state in a cookie. When loading a puzzle, +the state is restored in the following preferential order, if possible: +(1) from local storage, (2) from cookie, (3) from URL. + +Clicking on the "Tools" menu under the crossword grid makes a "Manage local +storage" button visible. If you have saved a *lot* of puzzle states, then +it's possible that you may fill up the local storage in the browser (you'll get +a warning thereafter when state-saving fails for the first time after opening a +puzzle). You can then choose to free up local storage by deleting the states of +old puzzles, after clicking on this button. ## Serving and sharing @@ -1413,9 +1427,9 @@ 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 @@ -1424,7 +1438,7 @@ var exolvePuzzles; function Exolve(puzzleText, containerId="", customizer=null, - addStateToUrl=true, + provideStateUrl=true, visTop=0, maxDim=0) {...} @@ -1434,17 +1448,17 @@ function Exolve(puzzleText, * See documentation of parameters above the Exolve constructor definition. */ function createExolve(puzzleText, containerId="", - addStateToUrl=true, visTop=0, maxDim=0) { + provideStateUrl=true, visTop=0, maxDim=0) { const customizer = (typeof customizeExolve === 'function') ? customizeExolve : null; let p = new Exolve(puzzleText, containerId, customizer, - addStateToUrl, visTop, maxDim); + provideStateUrl, visTop, maxDim); } /* * The global variable "puzzleText" should have been set to the puzzle specs. * inIframe can be set to true if the puzzle is embedded in an iframe, which - * will then set addStateToUrl to false. + * will then set provideStateUrl to false. * @deprecated use createExolve(). */ function createPuzzle(inIframe=false) { 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-simple.html b/exolve-m-simple.html index f47ab664..afcc8682 100644 --- a/exolve-m-simple.html +++ b/exolve-m-simple.html @@ -14,11 +14,11 @@ See the full Exolve license notice in exolve-m.js. -Version: Exolve v0.99 January 2 2021 +Version: Exolve v1.00 January 20 2021 --> - - + +