Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter

Categories

In this Discussion

Who's Online 10

GumCloudZvonkoericgillettelucperegrinesandino +4 guests

Disabling draft auto-saves

Is it possible to disable the Draft auto-save? I don't need or want it, and know that some users will find it confusing that a message pops up saying stuff was saved when they didn't ask for it. (Apologies if this has already been covered, but searching didn't give me an answer).
Tagged:

Comments

  • Posts: 101
    I'd like to know the answer to this as well. It's not 'normal' behavior for a forum, and I think some users may find it to feel invasive. Until they hit post, they should be able to feel confident that my server hasn't taken their words from them imo.
  • Posts: 93
    Yeah, WordPress does it as well, but the first thing I do on setting up a WP site is to disable it. If nobody provides an answer soon regarding switching it off, I'll hunt through the code and find out how to disable it. I guess a simple plugin would be best, but I don't have time right now to get into that.
  • Posts: 1,587
    There isn't any way to disable drafts. I've actually never heard that type of concern before.

    Vanilla co-founder

  • Posts: 93
    @Todd; I suppose it's a fairly minor concern in the great scheme of things, but users who don't frequent forums and networking sites can be alarmed by events they didn't instigate. Being alerted to background saving is definitely one of them.

    I've noticed that some people just say, "I noticed it auto-saving my text, which is neat", while others say, "Why is it doing things I didn't tell it to? Am I missing something important that I should have set?" I use various packages for different sites, and making everything plain and simple is usually the largest part of my work, as is convincing people that "it really is simple ... honest!"

    Any pointers as to where to look first to disable Draft auto-saves..?
  • Posts: 1,587
    I'm pretty sure you can just remove autosave.js. If you want to do this, but not change the core, make a plugin with the following methods:
    public function PostController_Render_Before($Sender) {
    $this->RemoveJsFile('autosave.js');
    }

    public function DiscussionController_Render_Before($Sender) {
    $this->RemoveJsFile('autosave.js');
    }

    Vanilla co-founder

  • Posts: 93
    Cheers @Todd. Attempt 1) nothing. Attempt 2) Crash (well, Big Red Error). Attempt 3) Learning how to write a plugin for Vanilla. What are Bank Holiday weekends for..?! :)
  • Posts: 93
    @Todd, @Lykaon; I've got it working after a lot of messing around (being new to Vanilla 2) using the following code;

    <?php if (!defined('APPLICATION')) exit();
    /*
    GNU GPL bit here.
    */

    $PluginInfo['DisableAutosave'] = array(
    'Name' => 'Disable Autosave',
    'Description' => "Stops auto-saving of Draft posts.",
    'Version' => '1.0',
    'Author' => 'Mikhael'
    );

    function PostController_Render_Before($Sender) {
    $this->RemoveJsFile('autosave.js');
    }

    function DiscussionController_Render_Before($Sender) {
    $this->RemoveJsFile('autosave.js');
    }

    It seems to work ok, but I'm concerned that it's overriding hiding core functionality. I tried setting up a class to extend Garden functions, but it turned into a bit of a nightmare. Any advice gratefully received.
  • Posts: 101
    @Mikhael: I've tried it out and it seems to work without any adverse side effects. I'll keep an eye on it and let you know if I see anything funky.
  • Posts: 93
    @Lykaon; What bothers me as an ex programmer is that the Class Reference section of the developer docs doesn't appear to exist yet, so I have no idea how to add these correctly. I've tried creating a class, but haven't fully grasped Vanilla 2's structure, and just end up with error after error. The problem here is that these function declarations may be 'hiding' the originally declared functions. (I'm not yet sure how PHP works in that respect as my pro work was all OOP/RAD in Windows). Hiding functions is a Bad Thing.

    @Todd; Any idea why the dev docs say, "An indent is 3 spaces, never a tab"? That adds 3 times the characters to every indent, which is a lot of extra junk when it's all a added up. And the Minify plugin causes some pages to display naked and nasty, so that's no help it seems...
  • Posts: 2,058
    @Mikhael Your concern about hiding core functionality is unfounded. You've done it precisely the right way.

    The developers decided on spaces instead of tabs as the coding standard. It just comes down to personal preference.

    Vanilla developer [GitHub, Twitter]

  • Posts: 93
    Thanks @Lincoln. I've uploaded it as a plugin in case anyone else finds it useful.
  • Mikhael said:

    Thanks @Lincoln. I've uploaded it as a plugin in case anyone else finds it useful.

    Hi Mikhael:
    What is the plugin?
    In my case, auto saves makes that comments, in Internet explorer, can't work well. When you spend time write your comment and the auto save work, the write comment button appears disabled and can't write a comment.

    It is really annoying for users
  • Posts: 93
    @tonipg39; It's just the code Todd gave above wrapped in a plugin for easy installation, and is available in the addons section. It hasn't been reviewed yet, but is perfectly safe.
  • Hi Mikhael: Thank you very much

    Umm in my case it doesn't work. The problem with Internet explorer continue. Furthemore when I write a comment with explorer, appears an navigation error with this message:

    error in disscusion.js in line 89, character 13

    and the message isn't it published.

    Someone more had this problem?

    My Vanilla version is 2.0.
  • Posts: 1,587
    @tonipg39 Are you Vanilla 2.0? What version of IE are you on?

    Vanilla co-founder

  • Hi Todd:
    Yes, version 2.0 and the IE version is 8
  • Posts: 93
    Interesting @tonipg39. I use Chrome, but just tested that again in IE8 (without 'Compatibility mode') and it works in terms of being able to post a comment. What's strange is that the draft auto-save is disabled in Chrome, but is still working on the same site in IE8, although the autosave.js file shouldn't be active. Any ideas @Todd?
  • TimTim
    Posts: 1,573
    Could IE8 have cached the page with Autosave still included?

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

  • Posts: 2,058
    Ctrl + F5 to force-refresh the page with the js changes (or manually clear your cache).

    Vanilla developer [GitHub, Twitter]

  • Posts: 101
    @Mikhael: As a follow-up, I don't think this plugin is working for me afterall. I still get the 'Autosaved' message the top of the screen for really long messages. I don't know if it's really auto-saving or not, but it at least appears to be.

    On the other hand, it's not causing any adverse effects either so overall it's not a problem.
  • Posts: 93
    I used Piriform's free CCleaner to scrape out everything, and IE8 still persists in acting as though Disable Autosave isn't working (in Vanilla 2.0.3). Odd. It's definitely working as it should in Google Chrome.

    @Lykaon; What browser are you using?
  • Posts: 101
    @Mikhael: Chrome. I looked at the source and autosave.js isn't being included as far as I can tell. After ~30 seconds or so (maybe up to 1 minute), I get a yellow message at the top that says "Draft Autosaved ".
  • Posts: 93
    @Lykaon; Strange! Perhaps something is misbehaving for me rather than you? Care to check it at one of my sites?
  • Hello Im tonipg39, but I have to create a new account, because i don't remember my login email. Sorry for that.

    Problem with IE8 continue. Is imposible write a comment in the forum without have to reload the site.

    In one minute that you have start to write the comment, the auto saved work, and button post answer appears disable.

    Now I am writting in this forum with IE 8 and the auto saved works well.

    It isn't only my case, because the users of my foro have the same problem.

    If you want, my forum is www.bolsacafe.com.

    Thank you very much

  • And in this forum I can write a post with IE 8 without problems :D
  • Posts: 93
    @tonip392; Thanks for the update. Sounds like help from @Todd is needed when he has a spare minute. I've looked at the core code, but can't see why this is happening in IE8, but not for me in IE8 (ie., it just fails to disable the draft auto-save, but posting a comment works fine).

    Edit; @tonip392; I'm on Vanilla 2.0.3. Just tried IE8 in 'Compatability mode' and the same thing happens; the Disable Autosave plugin has no effect, drafts are still auto-saved, but comment posting works fine.
  • Thank you very much Mikhael:

    And you use 2.0 version too?
    I think that post problems start at the first moment. I don't know if the cause is an addon.

    Here works very well both
  • Thanks Mikhael:

    I hope that @Todd will have a minute for this problem :)
    I will be waiting!

    Thanks again!
Sign In or Register to comment.