TryNinja (OP)
Legendary
Offline
Activity: 2954
Merit: 7379
|
|
January 07, 2024, 03:34:05 AM Last edit: January 09, 2024, 04:48:19 PM by TryNinja Merited by fillippone (46), LoyceV (42), Welsh (20), ABCbits (12), Xal0lex (5), dkbit98 (5), DdmrDdmr (4), o_e_l_e_o (4), Halab (2), Husna QA (2), joker_josue (2), PrivacyG (2), libert19 (1), tbct_mt2 (1), hd49728 (1), FatFork (1), Apocollapse (1), Mia Chloe (1) |
|
Inspired by libert19's suggestion, I wrote a small script that auto saves your posts to the forum draft every couple of seconds (customizable). Once upon a time I was writing a middle sized post and missclicked F5, losing the entire thing. This script helps mitigate this dangerous mistake! Installation: https://greasyfork.org/en/scripts/484095-auto-save-draft-for-bitcointalk-orgEdit the INTERVAL_SECONDS variable at the top with the number of seconds you want your draft to automatically save (default: 60 seconds). If there are no changes on your post since the last draft (this includes pressing the "preview" button), the process is skipped. P.S: "Drafts are saved whenever you preview or post a topic, post, or PM. Up to 100 drafts are kept. Drafts are deleted after 7 days."
|
|
|
|
Gladitorcomeback
|
|
January 07, 2024, 03:43:02 AM |
|
Inspired by libert19's suggestion, I wrote a small script that auto saves your posts to the forum draft every couple of seconds (customizable). Once in time I was writing a middle sized post and missclicked F5, losing the entire thing. This script helps mitigate this dangerous mistake! That's is much needed script , Big thanks for script you created. Your effort in developing a tool whuch automatically saves forum posts to the draft is incredibly helpful because losing whole content just by small mistake is common here. It's a time-saver and enhances the user experience. Honestly I was writing large post in notepad and when I wrote fully then I copy pasted here and I hope now This script will save my time. A small question here: Will this script will be helpful too for mobile browser such as Kiwi and Mises or it is just for PC. I haven't checked script and will review after using.
|
|
|
|
libert19
|
|
January 07, 2024, 03:45:59 AM |
|
A small question here: Will this script will be helpful too for mobile browser such as Kiwi and Mises or it is just for PC. I haven't checked script and will review after using.
It works, I just tried it.
@TryNinja Great work! This words don't justify how handy your scripts are.
|
|
|
|
Mia Chloe
Sr. Member
Offline
Activity: 462
Merit: 627
Crypto Casino and Sportsbook
|
|
January 07, 2024, 09:02:47 AM |
|
Once upon a time I was writing a middle sized post and missclicked F5, losing the entire thing. This script helps mitigate this dangerous mistake! I must admit it you have done a great job TryNinja. Losing a post after making a very long write up is a big nightmare and can be very frustrating sometimes. One time I mistakenly reloaded a page and boom my long compiled post was lost . Since then I had to switch to using my html text editor to put together my posts before previewing and posting it here on bitcointalk. But with this script I can now do everything here . This will definitely come in handy especially for higher rank members who create very long and detailed posts. +1 for the effort
|
| | | | | | FIRST NO WAGERING BONUS CASINO & SPORTSBOOK SLOTS │ LIVE CASINO │ LIVE GAMES │ SPORTS | | | ► | WELCOME BONUS ─── UP TO ─── [ $500 ] | | ► | MULTI BET BONUS ─── UP TO ─── [ 200% ] | █████████████▄██▄ ████████████▐█████ ███▄██▄█████▐██████▄ ████████▄▄██████████▄ ███▐██▀██▀███████████ ██████████████████████▄ ███▐▄█████▄████████████▄ ▄▀▀███████████▄███████░█▌ ▀███████████████████████ ░███████████████████████ ░░▀▀▀▄██▄███████████████▄ ░░████▀█▀█████████████████▄▄ ██████▀███████████████████████▄ | [ | PLAY NOW | ] |
|
|
|
Upgrade00
Legendary
Online
Activity: 2156
Merit: 2313
Playgram - The Telegram Casino
|
|
January 07, 2024, 01:06:32 PM |
|
Great work TryNinja. I don't write long texts regularly, but it helps to have a back up for the situation where you risk losing a message you took a lot of effort to write.
Could be just me, but the message icon beneath the text box is a bit of an eye full. Might be easier on the eyes if only the time of the last update is shown and not the date. Also, when I go to drafts and return to the post the "Auto-Save draft is activated!" message pops up again and again, as I bounce back and forth.
|
|
|
|
▄▄███████▄▄███████ ▄███████████████▄▄▄▄▄ ▄████████████████████▀░ ▄█████████████████████▄░ ▄█████████▀▀████████████▄ ██████████████▀▀█████████ █████████████████████████ ██████████████▄▄█████████ ▀█████████▄▄████████████▀ ▀█████████████████████▀░ ▀████████████████████▄░ ▀███████████████▀▀▀▀▀ ▀▀███████▀▀███████ | ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ Playgram.io ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ | ▄▄▄░░ ▀▄ █ █ █ █ █ █ █ ▄▀ ▀▀▀░░
| │ | ▄▄▄███████▄▄▄ ▄▄███████████████▄▄ ▄███████████████████▄ ▄██████████████▀▀█████▄ ▄██████████▀▀███▄██▐████▄ ██████▀▀████▄▄▀▀█████████ ████▄▄███▄██▀█████▐██████ ██████████▀██████████████ ▀███████▌▐██▄████▐██████▀ ▀███████▄▄███▄████████▀ ▀███████████████████▀ ▀▀███████████████▀▀ ▀▀▀███████▀▀▀ | | │ | ██████▄▄███████▄▄████████ ███▄███████████████▄░░▀█▀ ███████████░█████████░░█ ░█████▀██▄▄░▄▄██▀█████░█ █████▄░▄███▄███▄░▄██████ ████████████████████████ ████████████████████████ ██░▄▄▄░██░▄▄▄░██░▄▄▄░███ ██░░░█░██░░░█░██░░░█░████ ██░░█░░██░░█░░██░░█░░████ ██▄▄▄▄▄██▄▄▄▄▄██▄▄▄▄▄████ ███████████████████████ ███████████████████████ | | │ | ► | |
|
|
|
joker_josue
Legendary
Offline
Activity: 1778
Merit: 4840
**In BTC since 2013**
|
|
January 07, 2024, 08:57:05 PM |
|
Another good script. Congratulations.
Although I've never felt the need for this type of script, I appreciate its value. I hope it is useful, for anyone who feels the need for this script.
|
|
|
|
TryNinja (OP)
Legendary
Offline
Activity: 2954
Merit: 7379
|
|
January 07, 2024, 09:59:35 PM Last edit: January 08, 2024, 10:22:07 PM by TryNinja |
|
Could be just me, but the message icon beneath the text box is a bit of an eye full. Might be easier on the eyes if only the time of the last update is shown and not the date.
Right. Changed the code so it only shows the time (i.e "17:56:17 UTC"). Also, when I go to drafts and return to the post the "Auto-Save draft is activated!" message pops up again and again, as I bounce back and forth.
There isn't much I can do since the script is stateless, meaning that every time you refresh, reload or navigate to another page the script runs from the beginning again. Maybe I could save the last draft to your browser's localStorage so it persists and checks if it's the same post you were writing before, but I feel like this is a bit too much.
|
|
|
|
tbct_mt2
|
|
January 08, 2024, 12:53:12 AM |
|
It's a helpful userscript, thanks for coding it. I noted some pros and cons of forum draft page. Draft page - Pros & ConsSome of cons are - Limited to only last 100 posts and drafts will be automatically deleted after 7 days
- Unable to recover your deleted posts to where it initially posted
- Almost unable to see where you post it (post ordinal number). Exception: You can only get which thread you post it, when you quote posts of others when reply them
- Unable to know when you post it
Could your userscript add something to reduce those cons? From the screenshot, it seems to save the time (when), but how about other points above?
|
|
|
|
TryNinja (OP)
Legendary
Offline
Activity: 2954
Merit: 7379
|
|
January 08, 2024, 01:04:37 AM |
|
I noted some pros and cons of forum draft page. Draft page - Pros & ConsSome of cons are - Limited to only last 100 posts and drafts will be automatically deleted after 7 days
- Unable to recover your deleted posts to where it initially posted
- Almost unable to see where you post it (post ordinal number). Exception: You can only get which thread you post it, when you quote posts of others when reply them
- Unable to know when you post it
Could your userscript add something to reduce those cons? I could create my own draft implementation where posts would be saved on my server, but I can't see enough demand for that and there may be some downsides like having to trust my server (even though the data isn't too sensitive) and privacy issues (sending requests to my server). Or I could make it save every post on your local browser. Cons: browser limitations, using too much space, etc... At this time I don't see the point. If i'm writing a post I only care about its latest version (i.e before I missclicked F5 and refreshed the page) and if you're looking for a deleted post, using the ninjastic.space archive is usually enough.
|
|
|
|
pinggoki
|
|
January 08, 2024, 05:13:29 AM |
|
Does it work on the phone right now? I've done the installation on my computer but I'm not really using my computer that much since I'm mostly at work so hopefully this is available on the phone. The phone browsers are the most notorious when it comes to that mistake that you've said and it's a frustrating feeling when you get your sentences already done halfway and your replies finished but then someone messages you or there's a notification that you need to answer then you come back only to see the webpage refreshed. I wish I could do programming like you, the stuff that I can do if only I know how to program and write code.
|
| Peach BTC bitcoin | │ | Buy and Sell Bitcoin P2P | │ | . .
▄▄███████▄▄ ▄██████████████▄ ▄███████████████████▄ ▄█████████████████████▄ ▄███████████████████████▄ █████████████████████████ █████████████████████████ █████████████████████████ ▀███████████████████████▀ ▀█████████████████████▀ ▀███████████████████▀ ▀███████████████▀ ▀▀███████▀▀
▀▀▀▀███████▀▀▀▀ | | Available in EUROPE | AFRICA LATIN AMERICA | | | ▄▀▀▀ █ █ █ █ █ █ █ █ █ █ █ ▀▄▄▄ |
███████▄█ ███████▀ ██▄▄▄▄▄░▄▄▄▄▄ █████████████▀ ▐███████████▌ ▐███████████▌ █████████████▄ ██████████████ ███▀███▀▀███▀ | . Download on the App Store | ▀▀▀▄ █ █ █ █ █ █ █ █ █ █ █ ▄▄▄▀ | ▄▀▀▀ █ █ █ █ █ █ █ █ █ █ █ ▀▄▄▄ |
▄██▄ ██████▄ █████████▄ ████████████▄ ███████████████ ████████████▀ █████████▀ ██████▀ ▀██▀ | . GET IT ON Google Play | ▀▀▀▄ █ █ █ █ █ █ █ █ █ █ █ ▄▄▄▀ |
|
|
|
ABCbits
Legendary
Offline
Activity: 2996
Merit: 7871
Crypto Swap Exchange
|
|
January 08, 2024, 09:16:54 AM |
|
Thanks for creating this script. I just tried it with Violentmonkey extension and it works without any problem. --snip-- I could create my own draft implementation where posts would be saved on my server, but I can't see enough demand for that and there may be some downsides like having to trust my server (even though the data isn't too sensitive) and privacy issues (sending requests to my server).
Or I could make it save every post on your local browser. Cons: browser limitations, using too much space, etc... --snip--
What exactly do you mean by using too much space? Text has very small size. I expect average post use 1KB or less of data.
|
|
|
|
libert19
|
|
January 08, 2024, 12:08:52 PM |
|
Does it work on the phone right now? I've done the installation on my computer but I'm not really using my computer that much since I'm mostly at work so hopefully this is available on the phone. The phone browsers are the most notorious when it comes to that mistake that you've said and it's a frustrating feeling when you get your sentences already done halfway and your replies finished but then someone messages you or there's a notification that you need to answer then you come back only to see the webpage refreshed. I wish I could do programming like you, the stuff that I can do if only I know how to program and write code.
Yes, it does work on mobile phones with extension supported browsers, I'm not sure about IOS since I don't have IOS device, but on android there are several extension supported browsers (Kiwi/Mask/Lemur/Mises), you can search respective names on play store. Then install Tampermonkey extension from extension store, then either paste the script manually, or just click 'install the script' in op's case. ..and you are right about reload thing, it is annoying especially on mobiles, even if mobile is capable, browsers somehow like to refresh page needlessly, this scripts saved me just minutes ago
|
|
|
|
Davidvictorson
|
|
January 08, 2024, 03:07:02 PM |
|
Great job TryNinja. I always knew we need something like this but never knew how it would have been done. I am happy you thought of it too and wrote this beautiful code which I do not understand but works perfecto. Could you guide me on how to provide a rating? I want express my appreciation through ratings, but unfortunately, the option doesn't seem to be editable on the https://greasyfork.org/en/scripts/484095-auto-save-draft-for-bitcointalk-org website.
|
|
|
|
TryNinja (OP)
Legendary
Offline
Activity: 2954
Merit: 7379
|
|
January 08, 2024, 05:34:32 PM |
|
What exactly do you mean by using too much space? Text has very small size. I expect average post use 1KB or less of data.
Your localStorage has a limitation of 5 MB. Every time you have a draft you're saving a post, meaning 1 post every 5 seconds (by default). If it's a big post and/or you're taking too long, that won't last a lot. While it's probably better than the forum's limit, it's not a foolproof solution. No idea, but I think you need a Greasyfork account then go to Feedback and write a review? There is no need, though.
^ I simulated how much space this post would have taken and I'm already using 60 KB of space.
|
|
|
|
dkbit98
Legendary
Offline
Activity: 2352
Merit: 7435
|
|
January 08, 2024, 08:33:41 PM |
|
Inspired by libert19's suggestion, I wrote a small script that auto saves your posts to the forum draft every couple of seconds (customizable). Simple script but it can be very useful. Maybe you could also add optional feature to do automatic export text to external file at specific time intervals. This can help in cases when electricity goes down, or when browser is shut down for whatever reason.
|
|
|
|
Upgrade00
Legendary
Online
Activity: 2156
Merit: 2313
Playgram - The Telegram Casino
|
|
January 08, 2024, 09:36:36 PM |
|
<snip>
There isn't much I can do since the script is stateless, meaning that every time you refresh, reload or navigate to another page the script runs from the beginning again. Maybe I could save the last draft to your browser's localStorage so it persists and checks if it's the same post you were writing before, but I feel like this is bit too much.
Thank you for the prompt attention. I guess I'll just try not to bounce back and forth much. There is no practical situation that needs that so you shouldn't bother much to fix what isn't really a problem. I just pointed it out incase it was a bug.
|
|
|
|
▄▄███████▄▄███████ ▄███████████████▄▄▄▄▄ ▄████████████████████▀░ ▄█████████████████████▄░ ▄█████████▀▀████████████▄ ██████████████▀▀█████████ █████████████████████████ ██████████████▄▄█████████ ▀█████████▄▄████████████▀ ▀█████████████████████▀░ ▀████████████████████▄░ ▀███████████████▀▀▀▀▀ ▀▀███████▀▀███████ | ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ Playgram.io ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ | ▄▄▄░░ ▀▄ █ █ █ █ █ █ █ ▄▀ ▀▀▀░░
| │ | ▄▄▄███████▄▄▄ ▄▄███████████████▄▄ ▄███████████████████▄ ▄██████████████▀▀█████▄ ▄██████████▀▀███▄██▐████▄ ██████▀▀████▄▄▀▀█████████ ████▄▄███▄██▀█████▐██████ ██████████▀██████████████ ▀███████▌▐██▄████▐██████▀ ▀███████▄▄███▄████████▀ ▀███████████████████▀ ▀▀███████████████▀▀ ▀▀▀███████▀▀▀ | | │ | ██████▄▄███████▄▄████████ ███▄███████████████▄░░▀█▀ ███████████░█████████░░█ ░█████▀██▄▄░▄▄██▀█████░█ █████▄░▄███▄███▄░▄██████ ████████████████████████ ████████████████████████ ██░▄▄▄░██░▄▄▄░██░▄▄▄░███ ██░░░█░██░░░█░██░░░█░████ ██░░█░░██░░█░░██░░█░░████ ██▄▄▄▄▄██▄▄▄▄▄██▄▄▄▄▄████ ███████████████████████ ███████████████████████ | | │ | ► | |
|
|
|
ABCbits
Legendary
Offline
Activity: 2996
Merit: 7871
Crypto Swap Exchange
|
|
January 09, 2024, 09:00:20 AM |
|
What exactly do you mean by using too much space? Text has very small size. I expect average post use 1KB or less of data.
Your localStorage has a limitation of 5 MB. Every time you have a draft you're saving a post, meaning 1 post every 5 seconds (by default). If it's a big post and/or you're taking too long, that won't last a lot. While it's probably better than the forum's limit, it's not a foolproof solution. I see, that makes sense when we're talking about creating big post/thread. And while we're at it, if your script use localStorage, how hard is it to delete old draft periodically to prevent reaching 5MB limit?
|
|
|
|
LoyceV
Legendary
Offline
Activity: 3430
Merit: 17366
Thick-Skinned Gang Leader and Golden Feather 2021
|
|
January 09, 2024, 11:08:15 AM |
|
(default: 5 seconds) Shouldn't that be like 5 minutes by default? Otherwise it takes only 8 minutes to completely overwrite the 100 drafts stored by Bitcointalk, which is especially annoying if you use multiple tabs to edit longer posts.
|
|
|
|
Adbitco
|
|
January 09, 2024, 12:35:53 PM |
|
Thank you TryNinja for the great job I hardly lost any post while posting although i do take my time to comment as well, i usually used the preview button to have the finished look of what i am posting. I may not install the script currently but if there may be any need then might come back to this thread to continue the whole process. And sorry to asked does this only work with windows or it can also be used both mobile? I don't know if this question already been asked here.
|
..Stake.com.. | | | ▄████████████████████████████████████▄ ██ ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ ██ ▄████▄ ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██ ██████ ██ ██████████ ██ ██ ██████████ ██ ▀██▀ ██ ██ ██ ██████ ██ ██ ██ ██ ██ ██ ██████ ██ █████ ███ ██████ ██ ████▄ ██ ██ █████ ███ ████ ████ █████ ███ ████████ ██ ████ ████ ██████████ ████ ████ ████▀ ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██ ██ ▀▀▀▀▀▀▀▀▀▀ ██ ▀█████████▀ ▄████████████▄ ▀█████████▀ ▄▄▄▄▄▄▄▄▄▄▄▄███ ██ ██ ███▄▄▄▄▄▄▄▄▄▄▄▄ ██████████████████████████████████████████ | | | | | | ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄ █ ▄▀▄ █▀▀█▀▄▄ █ █▀█ █ ▐ ▐▌ █ ▄██▄ █ ▌ █ █ ▄██████▄ █ ▌ ▐▌ █ ██████████ █ ▐ █ █ ▐██████████▌ █ ▐ ▐▌ █ ▀▀██████▀▀ █ ▌ █ █ ▄▄▄██▄▄▄ █ ▌▐▌ █ █▐ █ █ █▐▐▌ █ █▐█ ▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█ | | | | | | ▄▄█████████▄▄ ▄██▀▀▀▀█████▀▀▀▀██▄ ▄█▀ ▐█▌ ▀█▄ ██ ▐█▌ ██ ████▄ ▄█████▄ ▄████ ████████▄███████████▄████████ ███▀ █████████████ ▀███ ██ ███████████ ██ ▀█▄ █████████ ▄█▀ ▀█▄ ▄██▀▀▀▀▀▀▀██▄ ▄▄▄█▀ ▀███████ ███████▀ ▀█████▄ ▄█████▀ ▀▀▀███▄▄▄███▀▀▀ | | | ..PLAY NOW.. |
|
|
|
hugeblack
Legendary
Offline
Activity: 2632
Merit: 3891
|
|
January 09, 2024, 12:44:18 PM |
|
I think it takes about 1-2 minutes to write 100 words on average, so adjusting the default INTERVAL_SECONDS to 60 or 30 would be more appropriate. I suggest contacting @theymos to increase Drafts to 200 and thus
Shouldn't that be like 5 minutes by default? Otherwise it takes only 8 minutes to completely overwrite the 100 drafts stored by Bitcointalk, which is especially annoying if you use multiple tabs to edit longer posts.
you missed this part: If there are no changes on your post since the last draft (this includes pressing the "preview" button), the process is skipped.
|
|
|
|
|