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.
Safari and deleting comments
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...
to
...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.
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.
0
This discussion has been closed.
Comments
Posted: Tuesday, 12 June 2007 at 9:04AM