Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons

Reply
 
Thread Tools
Message auto-save/drafts Details »»
Message auto-save/drafts
Version: 0.5, by MoMan MoMan is offline
Developer Last Online: Oct 2022 Show Printable Version Email this Page

Category: New Posting Features - Version: 3.8.x Rating:
Released: 09-13-2011 Last Update: 09-17-2011 Installs: 55
Template Edits
Re-useable Code Additional Files Is in Beta Stage  
No support by the author.

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?
  • Quick reply
  • New reply/New thread
  • PM quick reply
  • New PM
  • PM regular reply
  • Anywhere else you want, given that the page contains a form named "vbform" and a textarea named "message" (or the vbulletin wysiwyg editor)

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.
  1. [1]Download the attached file (or download the file directly and skip step 2)
    [2]Change the extension to .js from .js.txt
    [3]Upload it to your forum's clientscript directory
    [4]Add the following code to the bottom of your forum templates* wherever you want this mod to work:

HTML Code:
<script type="text/javascript" src="$vboptions[bburl]/clientscript/vbulletin_autosave.js"></script>
If you don't care about http overhead, you can put this code in your footer template as it will die gracefully on pages without an editor. However, I recommend only putting it in templates that use it. On my forum, I've added it to the following templates: SHOWTHREAD, newreply, newthread, pm_showpm, pm_newpm On top of that, if you don't allow guests to post, wrap the code in a member-only conditional: <if condition="$show['member']">...</if>

*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.

Download Now

File Type: txt vbulletin_autosave.js.txt (4.8 KB, 261 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
4 благодарности(ей) от:
Mandushi, NAZIA, viper357, xorex

Comments
  #22  
Old 09-28-2011, 03:29 PM
jrap jrap is offline
 
Join Date: Jan 2005
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!
Reply With Quote
  #23  
Old 09-28-2011, 03:35 PM
NAZIA's Avatar
NAZIA NAZIA is offline
 
Join Date: Feb 2008
Location: Multan Pakistan
Posts: 322
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

but for me, sometime links work, mostly does not work..

in Firefox 6.0.2
Reply With Quote
  #24  
Old 09-28-2011, 05:58 PM
MoMan MoMan is offline
 
Join Date: Oct 2005
Location: USA
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #25  
Old 09-28-2011, 10:11 PM
NAZIA's Avatar
NAZIA NAZIA is offline
 
Join Date: Feb 2008
Location: Multan Pakistan
Posts: 322
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes.. i fix it.. that was due to conflicting some ads code .. i have remove the ads now it is working fine.. sorry :S
Reply With Quote
  #26  
Old 10-03-2011, 04:29 PM
drsli's Avatar
drsli drsli is offline
 
Join Date: Jan 2008
Location: Germany
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #27  
Old 10-03-2011, 04:44 PM
MoMan MoMan is offline
 
Join Date: Oct 2005
Location: USA
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #28  
Old 10-18-2011, 04:35 PM
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to show text when it happens like vB4?
Reply With Quote
  #29  
Old 10-19-2011, 02:50 PM
MentaL's Avatar
MentaL MentaL is offline
 
Join Date: Jan 2003
Posts: 550
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works good.
Reply With Quote
  #30  
Old 10-26-2011, 10:48 PM
MoMan MoMan is offline
 
Join Date: Oct 2005
Location: USA
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RTMdotORG View Post
Is there a way to show text when it happens like vB4?
Since this fires as soon as you start typing and for every character you enter, it would have to work differently. For a future release I'm planning to have it work differently
Reply With Quote
  #31  
Old 01-02-2012, 10:30 PM
bitwise2000 bitwise2000 is offline
 
Join Date: Apr 2008
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone have this running successfully on 3.7?

This is a better mousetrap than the one I know runs ok on 3.7.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:38 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07427 seconds
  • Memory Usage 2,322KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (4)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete