Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Safari and deleting comments

edited April 2008 in Vanilla 1.0 Help
I'm testing Vanilla 1.1.2 at the moment (installed it only recently) and I've come across a few quirks with Safari that work ok in Firefox.

Firstly, Safari's pop-up blocker blocks the javascript popup asking if you're sure you want to delete the comment. If you're not bothered about asking for confirmation, since it only actually hides the comment, not deletes it anyway then I found changing vanilla.js's HideComment function like this...

function HideComment(AjaxUrl, Switch, DiscussionID, CommentID, ShowText, HideText, SenderID, PostBackKey) { var ConfirmText = (Switch==1?HideText:ShowText); if (confirm(ConfirmText)) { var Sender = document.getElementById(SenderID); if (Sender) { Sender.innerHTML = ' '; Sender.className = 'HideProgress'; } var dm = new DataManager(); dm.RequestCompleteEvent = RefreshPageWhenAjaxComplete; dm.RequestFailedEvent = HandleFailure; dm.LoadData(AjaxUrl+"?Type=Comment&Switch="+Switch+"&DiscussionID="+DiscussionID+"&CommentID="+CommentID+"&PostBackKey="+PostBackKey); } }

to

function HideComment(AjaxUrl, Switch, DiscussionID, CommentID, ShowText, HideText, SenderID, PostBackKey) { var Sender = document.getElementById(SenderID); if (Sender) { Sender.innerHTML = ' '; Sender.className = 'HideProgress'; } var dm = new DataManager(); dm.RequestCompleteEvent = RefreshPageWhenAjaxComplete; dm.RequestFailedEvent = HandleFailure; dm.LoadData(AjaxUrl+"?Type=Comment&Switch="+Switch+"&DiscussionID="+DiscussionID+"&CommentID="+CommentID+"&PostBackKey="+PostBackKey); }

...stops it from asking and stops Safari from sitting there constantly waiting. I'd guess Safari is thinking the confirm() is coming from something other than the main document and therefore blocking it.

The second problem I found is trickier. When Vanilla changes the 'delete' or 'show' text to the progress indicator, the Ajax event is expecting the page to be reloaded. That's not happening for me so the page looks like it's hung with the progress indicator still in place. I've not worked out how to get around that. Obviously, document.location.reload works most of the time but not in the case of delete/show comments.

Anyone got a fix for this?

Or possibly, to sidestep the issue, anyone modified Vanilla to not reload the page and just reload the comment. That would be more in keeping with the thrust of using AJAX anyway.

Comments

  • Options
    Has anyone looked at this in more detail, maybe there is some post that I am missing.
  • Options
    dan39dan39 New
    edited May 2007
    I'd advise you to test the Safari WebKit Nightly Builds before worrying about this too much. http://nightly.webkit.org/ I haven't tested Vanilla on the nightlies in awhile, but I think the WebKit open-source developers have been working on patching this kind of behavior in Safari. If the latest nightly is working properly (which I hope it is) then you can probably expect users to automatically get the stable patch in a few months. If it's still causing issues on the latest nightly, you should search the WebKit bugzilla: http://bugs.webkit.org ...and look for a similar open bug to check to see if they're still working on patching it up. If they're not aware of the problem, you can create a "reduction" and submit it to their bugzilla tracking system. A reduction is just the most simplified example of the bug without any extraneous markup in it. This helps them narrow the issue down. For more info on submitting bugs to Safari WebKit, see this link: http://webkit.org/quality/reporting.html And, if you're really up to the challenge, you can actually patch WebKit yourself and have them merge in the fix.
  • Options
    That's all well and good but ultimately it means there's currently a lot of users out there where Vanilla doesn't work and you're betting on a) Apple updating previous operating systems, which they tend not to when a new OS is out. b) Safari 3.0 working.
  • Options
    Check this out.

    Posted: Tuesday, 12 June 2007 at 9:04AM

  • Options
    Official site at http://www.apple.com/safari/ I've not given it a good work out yet to check if this problem is sorted.
  • Options
    I agree that Safari 3 will no doubt be the bee's knees, but meanwhile… Lots of users with hanging windows. Including me & most of my Forum.
  • Options
    In any case the fact that safari is available for windows, means that there is no more reason not to check out vanilla in that browser as well. Personally I'm a firefox user, but whenever I design a website, I also check IE, Opera, Konqueror (linux box), lynx (!!!) and from now on Safari. If I have access to a browser, I'll use it to verify my site.
  • Options
    "When Vanilla changes the 'delete' or 'show' text to the progress indicator, the Ajax event is expecting the page to be reloaded" I think I fixed this some months ago. I noticed it when bookmarking posts: it didn't reflected immediately. You have to add the "RefreshPageWhenAjaxComplete" somewere. Or maybe we are talking about different things.
This discussion has been closed.