![]() |
Message auto-save/drafts
1 Attachment(s)
An auto-save feature was recently added to vB4, so I figured it would be nice if we vB3 users could also get something similar ;)
While this this isn't a server-side solution, I think that it's still pretty solid, as it relies on the localStorage system in your browser, which is supported by Safari, FF 3.5+, Opera, Chrome, and IE8+. I have tested this on FF6, the latest Safari and Chrome, and IE9. I wrote it with IE8 in mind, but haven't tested IE8 as my forum skin doesn't support it (yup, it's a terrible browser). For now, I am marking this as a beta release until we're sure it works in all browsers that support localStorage and there aren't any outstanding bugs. Where does this work?
How does this work? You can start typing a post, close your browser, open the same page, and the post will still be there. Note that this mod keys data by URL in order to avoid collisions. The mod automatically and silently restores posts when possible. However, if the editor already contains something when you load the page (i.e. PM quick reply), then you will receive a prompt asking you whether or not you want to work with the recovered text. This mod works even if you disable the WYSIWYG editor and it will quite likely work with older versions of vB all the way down to 3.5. Installation Installation is simple.
HTML Code:
<script type="text/javascript" src="$vboptions[bburl]/clientscript/vbulletin_autosave.js"></script> *the script tags must be placed after the editor text area element; this doesn't necessarily have to be the very end of the template, although it's good practice to do so License: You are free to use, modify, re-post and re-distribute the code as long as you credit me in the script comments. Improvements and derivatives are welcome! Note: This is a CLIENT-SIDE mod. Please be sure that any issues you may report aren't related to the fact that a. your browser is misconfigured or b. you are using an old/unsupported browser. |
No worky.... FF 7.
|
UPDATE!
This mod Works great on my board (3.8.6) and with my browser (FF 7). Reason I didn't think it did before was, I use Cloud Flare and changes such as this aren't immediately visible! Takes awhile for such changes to propagate through the system! |
Great mod!! Thanks.
|
I've uploaded an updated version of the file in which I fixed PM quick reply compatibility in firefox and added better support for IE8.
Glad to hear you guys like it! |
I've upload version 0.3 which fixes a potential issue with data keys. I recommend that everyone updates their js file to guarantee correct URL association with the saved data.
|
Cool, thanks man.
|
Quote:
|
This started causing some issues. A few folks kept getting their browser closed whenever they went to showthread or PM box. It would just close out when they tried to open a thread or PM.
I removed the script tags from all areas and its back to normal. Any ideas? I uploaded the latest javascript file as well. |
Version 0.4 is up, with improvements to data clearing when a post is submitted as well as slightly shorter code.
This script shouldn't cause anyone's window to close. What browser were they using? Users of my site haven't observed this. |
Quote:
|
I'll try it again with the update .js and report back.
|
I've uploaded version 0.5. This introduces some efficiency fixes: if a user erases their post while typing it, it will now be completely removed from the browser storage (instead of being replaced by an empty string).
Also, an auto-save is no longer triggered simply by hovering your mouse over the text. This introduced some issues with quick reply, as you could technically submit your post and then get the auto-save system to store it after it had been submitted. |
Awesome, will install this on 3.8.5, quick question first, will this cause any significant increase in server load on a biggish forum (over 500 000 posts)?
|
Perfect Mod.. installed...
|
Quote:
|
thank :D,
good mod |
1 Attachment(s)
hi
this mod is really helpful but unfortunatly it has 1 disadvantage that , it disabled Links in vb Ajax dropdown menu.. you can understand by image below... Attachment 133267 it ads #.. instead of the original url... and after clicking on this button happens nothing... even users can not click on the notifications... |
anyone else has this thing happen on their board?
|
I also get the # but the link still works fine.
|
Thanks!
|
but for me, sometime links work, mostly does not work..
in Firefox 6.0.2 |
Make sure you're including the JS file on all the pages you want it to work on.
If it's still not working, you can uncomment the console.log statements in the code and trace the execution in firebug. If you find any issues then, let me know how to reproduce them and I'll look in to fixing them! |
Yes.. i fix it.. that was due to conflicting some ads code .. i have remove the ads now it is working fine.. sorry :S
|
Thank you for this very useful addon! :)
The need for it was proved, when I worked on this reply for the first time. Meanwhile I was kicked out by vbulletin.org with my idle-time and after hitting submit the text was gone. The mod works like a charm with my live-forum. Thus far I could test Firefox and Chrome on MacOSX. Perhaps I didn?t catch the description above accurately, but I don?t get any prompt to consent to the saved text or not. |
Glad to hear you like it and that it works! The prompt only shows up in the PM quick reply interface, as there, a quote of the PM is inserted into the editor by default, and you might not notice that the saved text had been inserted otherwise :)
|
Is there a way to show text when it happens like vB4?
|
Works good.
|
Quote:
|
Anyone have this running successfully on 3.7?
This is a better mousetrap than the one I know runs ok on 3.7. |
Should work fine on 3.7, as it's client-side and I don't think the editor templates were changed.
|
it didnt work for me. tried on ff and chrome
|
hello.
i installed it , and doesnt work at all can u tell me , where can i exactly use this code in my template. for example its my temp code in showthread: Code:
$stylevar[htmldoctype] |
excuseme,please answer me,i need the answer !
|
Quote:
|
1 Attachment(s)
first, how do you know if it works, i have it installed, went to close browser (safari) in the middle of a post as you said to do and i get this message see attachment. Here is the code i put in all threads you mentioned and i placed the code after &footer in all templates you suggested. Also changed the .txt to .js and uploaded the file to the client script folder. Am i doing something wrong?
Thanks in advanced. <if condition="$show['member']"><script type="text/javascript" src="$vboptions[bburl]/clientscript/vbulletin_autosave.js"></script></if> |
Great mod, thanks. But it doesn't work for me on IE9. Any idea why?
|
I as excited about this mod but it doesn't seem to do anything on 3.8.7 PL4
I installed it and get no errors but it just doesn't seem to do anything. Started typing a new thread, saved the URL and then closed the browser. Went to the link that I had save and there was nothing there. Am I misunderstanding how it works and/or how to test it? |
only firefox
chrom and edge not workin need more support |
All times are GMT. The time now is 05:46 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|