1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Message Auto Save / Drafts - Prevent Members from Losing Content

Discussion in 'Add-on Releases [Archive]' started by moman, Jan 19, 2012.

  1. moman

    moman Active Member

    Consider this my first xenForo modification. It's a simple one- in fact, it's entirely client-side!

    It's based on this for vBulletin: http://www.vbulletin.org/forum/showthread.php?t=270236
    For this release, however, I re-wrote the script using jQuery so it should work cross-browser.

    ------------------------------------------

    Have you ever started writing a post and then accidentally closed the tab or forgotten about it? Well, with this installed, as soon as you navigate back to the page you were on, your message will be there! Enjoy! I've had this deployed on my vB forum for a while and it's been a life-saver more than once...

    This should work for quick reply, advanced reply, and PMs. I've tested it in FF9 and IE9 but do let me know if it doesn't work for you. Be sure to include your JS console errors if you notice any issues.
     

    Attached Files:

    resonansER, beduino, kkm323 and 19 others like this.
  2. moman

    moman Active Member

    Just for the record- since localStorage (the thing this uses to store your posts) is extremely persistent, you can use this for drafts if you so dare ;)
     
  3. M@rc

    M@rc Well-Known Member

    Great work MoMan, (y)
     
  4. The Dark Wizard

    The Dark Wizard Well-Known Member

    I will be trying this immediately. May the god(s) bless your soul and grant you access to your choice of the afterlife paradise.
     
    Morgain likes this.
  5. Brett Peters

    Brett Peters Well-Known Member

    Cheers for the much needed mod
     
  6. moman

    moman Active Member

    Cool- let me know if it works for you! The best way to test it is to write a post, copy the url, close the tab then paste the url and see if it's still there. Also, verify that the js file is properly linked to and included.
     
    Brett Peters likes this.
  7. Jaxel

    Jaxel Well-Known Member

    You should use the xenforo JS construct so that this plays nicer with CDNs:
    Code:
    <xen:require js="js/as.js" />
     
    TheVisitors, Deepmartini and moman like this.
  8. DRE

    DRE Well-Known Member

    H311 YEAH!
     
  9. Deepmartini

    Deepmartini Well-Known Member

    How does this work? Does it eat up lots of resources or cause conflict with other plugins? Seems like something that should be in the core.
     
  10. moman

    moman Active Member

    It's client-side, and no, it doesn't really use any resources. Just stores text as you type it and then flushes it out when you submit a post- all in your browser.
     
  11. Hyperion

    Hyperion Active Member

    Ha, figures that auto-draft only shows up after I convert to xenForo, as it is an add-on I have been searching the high seas for for many months. There was another guy working on such a feature for vBulletin 3.x, but he went missing and the add-on was put into the archives. That said, thanks for bringing this feature over.

    Love the look of your Pentax Forums, by the way.
     
  12. moman

    moman Active Member

    Thanks! PF has a custom designed style - I'm looking to have my designer come up with something unique for the new xF site also as time and money allows!
     
  13. Gabriel Pinho

    Gabriel Pinho Member

    Working.....



    Thanks a lot.
     
  14. Morgain

    Morgain Well-Known Member

    Oh WOW I have SO complained of XF losing posts on me
    does this work on the ghastly XF timeout?

    Sorry shoulda said it worked closing the tab. Thanks!
     
  15. Edrondol

    Edrondol Well-Known Member

    Nice job, man!
     
  16. Claudio

    Claudio Well-Known Member

    thank you very much, great work! :)
     
  17. Kintaro

    Kintaro Well-Known Member

    installed and works great!!
     
  18. lasertits

    lasertits Active Member

    This caused some oddities in certain areas which forced me to remove it. It would make the editor's area pure white (#FFF) and also make it so smilies didn't show up at all. The editors in Account Settings (signature, about me) and the editors in the XenCarta wiki were affected (the thread view and convo view ones work fine). Not sure if other areas were affected other than account settings / wiki. Basically it conflicted with the editor_js_setup, made it so certain lines didn't execute or something, such as this one:

    theme_xenforo_contents_css_url: "css.php?style={xen:urlencode $visitorStyle.style_id}&css=editor_contents&d={xen:urlencode $visitorStyle.last_modified_date}",

    Here's the HTML output WITHOUT as.js:
    [​IMG]

    And the HTML output WITH as.js:

    [​IMG]
    As you can see, the bottom one is missing the stylesheet line completely, and it's also missing a style="overflow-y: hidden;"> snippet on the end of the <body id> tag. No idea if this is just happening for me or everyone else that's using it as well. Perhaps someone can confirm?
     
  19. Trekkan

    Trekkan Well-Known Member

    I don't have the time to dig into it too deep right now myself, but my editor background doesn't go white, nor do my smilies disappear.
     
  20. lasertits

    lasertits Active Member

    And you tried this with an editor in account settings? E.g. about me or signature? :confused:
     

Share This Page