Comments (17)
Oops, I had not foreseen this consequence of migrating the file. Strangely, when I go to the old URL on chrome and it gets redirected, it seems that my progress has been saved (not sure how that works, some quirk of local storage?).
from qed.
If I read the discussion at https://stackoverflow.com/questions/12489999/response-redirect-kills-local-storage correctly, it seems that if one lingers on the original page long enough for local storage to load, then when one is redirected, all the storage (i.e., progress on the text) is saved. It's clunky, but perhaps that is enough of a workaround for now...
from qed.
from qed.
@TTimo can you try it again now, waiting the full amount of time for it to redirect? The "redirect" part of the QED.html file wasn't present for the past couple hours (by mistake I believe).
from qed.
Tried again .. still the same. I load http://www.math.ucla.edu/~tao/QED/QED.html, give it plenty of time, then click on the link at the top (https://teorth.github.io/QED) and end up at the new page but with none of my progress.
from qed.
Oh, I thought you were referring to the automatic redirect change last night from--
http://teorth.github.io/QED/QED.html to
http://teorth.github.io/QED/
I did confirm that works on Mac with Firefox.
For the old ucla.edu page, maybe something can be done on that page to permit transferring the data -- I'm not sure.
from qed.
I've tried replacing the http://www.math.ucla.edu/~tao/QED/QED.html page with a copy of the redirect page at http://teorth.github.io/QED/QED.html . Strangely, it does not seem that the local storage copied over this time (but perhaps this is because I already have some local storage for the new page?).
from qed.
Someone could try "resetting" on the target page to clear out their local storage there, but I'm guessing local storage doesn't propagate cross-domain by default for security reasons. There is probably a way to do it, but I'm guessing not straightforward.
from qed.
Yeah, I just tried resetting and it does indeed seem that localstorage doesn't propagate from one domain to another. There may be a way to export the localstorage keys to some file that one can then import to another page, perhaps.
from qed.
OK, after using the answer at this page https://stackoverflow.com/questions/13335967/export-data-in-localstorage-for-later-re-import I found a way for a user to move over the data manually, though it is a bit tricky. I put the instructions on the old page http://math.ucla.edu/~tao/QED/QED.html - they worked for me, hopefully they work for you also!
from qed.
The procedure worked! Thanks!
from qed.
To make it a bit more convenient/easy to use, you could do something like this:
function import_export() {
let input = window.prompt('Import/Export', JSON.stringify(window.localStorage));
if (input !== null) {
new_data = JSON.parse(input);
for (i in new_data) { // for in loop should'nt be a problem in this case
window.localStorage.setItem(i, new_data[i]);
}
}
}
import_export();
You could add this as a button to both the old and the new page:
<button onclick="import_export();">import/export</button>
To export, you would click the button, copy the text in the text field (ctrl-a), and press cancel (or ok, doesn't matter, really).
To import, you would click the button, paste the text (possibly replace the old text), press ok, and refresh.
e: forgot to mention refreshing
from qed.
I've implemented this suggestion now. Actually it is also a useful tool for debugging (I've needed to reset the text a few times and it was a pain to restore all the previous progress; now I can just save the state to an external text file and restore when needed.)
from qed.
Unfortunately I found an annoying issue with the button for editing localstorage: it seems that (in Chrome at least) the window.prompt string input can only be up to about 2000 characters in length before it starts truncating the string with ellipses, making it useless for copy/paste purposes once the local storage gets decently large. Not yet sure what the best fix is (simplest would be to have direct access to the clipboard, but not sure if the javascript sandbox actually has permission to do this).
from qed.
You could perhaps also do something like use a text area to transfer the text to and from instead of a prompt box.
from qed.
I didn't know Chrome had a limit. Firefox doesn't appear to and MDN doesn't specify any limit.
Unless <input type="text">
also has a maximum length (I tested a length of ~4000 with Chromium 68), this works as a PoC (don't know about bootstrap, have never used it).
from qed.
Thanks, I think I managed to implement this code successfully.
from qed.
Related Issues (20)
- Prevent the same formula/term/conclusion from being formed more than once HOT 1
- Add deduction `NOT FALSE` when dragging `FALSE` into an environment HOT 1
- Better ordering of available deductions: term-specific deductions before generic deductions HOT 2
- Add Prev/Next Exercise button and hotkeys HOT 1
- Matching not implemented for every proved law with THERE EXISTS and FOR ALL involved HOT 4
- Possibility to remove existing items? HOT 1
- Distinction between predicates and operators HOT 1
- Choose a better name for Notifications window, add new entries to the front HOT 1
- Add more variants of laws that are dependent of the order of `AND`/`OR` HOT 3
- Refactor Exercise creation HOT 3
- Reset single exercise HOT 3
- Start adding tests
- How to apply cancellation law?
- Bug or feature?: I could get the solution of every exercise without solving it. HOT 1
- Add setting of banning circular proof HOT 1
- The version displayed on the page is still 2.10.3 HOT 1
- Not showing no available deductions after press 'c' HOT 1
- bug: Ctrl click don't clear when restarting / switching exercises HOT 1
- Create iOS app?
- Solution to 7.1 is not fair, based on unlock from 6.2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qed.