Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

May I suggest implementing a "save" command #20

Open
AlcherBlack opened this issue Apr 2, 2010 · 6 comments
Open

May I suggest implementing a "save" command #20

AlcherBlack opened this issue Apr 2, 2010 · 6 comments
Labels

Comments

@AlcherBlack
Copy link

Unixkcd is extremely convenient when browsing the comics one after another, so allowing to save a specific strip to your computer would be really nice. It shouldn't be too difficult to implement. [save + path]

@sgbeal
Copy link

sgbeal commented Apr 2, 2010

JavaScript alone cannot be used to save anything. Saving is a browser-specific feature. To save the comic, right-click the image and click "Save image" (or whatever it's called in your browser).

@chromakode
Copy link
Owner

I like the motivation behind this idea. I think we could have a "save" command that writes the current comic to a cookie, and perhaps a "load" command that gets you back to your saved position.

Or perhaps, we could just do this automatically, and when we detect that the user has a saved position, give them a "would you like to resume where you left off? [y/n]" prompt...

@AlcherBlack
Copy link
Author

Right-clicking kinda defeats my idea. Is there a way to pop up a "save image" dialog using javascript? (The idea with cookies is brilliant though, and definitely should be implemented)

@danopia
Copy link

danopia commented Apr 3, 2010

You can have the server return the image as an attachment so that the browser prompts to download (chrome will do it without asking). For saving your spot, though, chromakode has the right idea.

@NickNackGus
Copy link

In response to sgbeal:

Can't java read what web browser is viewing it? This would allow an if...else tree to save using different methods. I use Firefox, so I can just right click an image to save it, but if it makes people happy to save images using uni.xkcd.com, then they should be allowed by whoever writes the code.

@sgbeal
Copy link

sgbeal commented Jan 7, 2011

@nick: neither Java-in-a-browser nor JavaScript have access to save anything to the local machine with the exception of cookies. (This code is JavaScript, not Java, and they actually have nothing to do with each other despite the naming similarity.) Yes, the data could be streamed from the server as danopia suggested, using a separate ajax callback. The user might, depending on the browser, be prompted for where to save it or it might just be saved in the currently configured downloads directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants