Last modified: 2006-12-27 06:34:09 UTC
Currently, when you click the watch/unwatch tab, it brings you to a new page confirming that the page has been watched/unwatched. Could we use Ajax for this by default, keeping the current behavior as a fallback? There's a script to do this at http://wikipedia.quarl.org/scripts/watchbutton.js (I've asked about licensing on [[User talk:Quarl]]).
There's another open bug which, if fulfilled in whole or part, would mean that the user was returned to the article view once a watchlist operation was completed. That might be quick enough to not require this.
Bug 7129? Closely related, yes, now that you point it out, but there's not really any point in leaving the page to begin with, if you think about it.
No, of course not, but I'd suggest that we make the fallback behaviour "apparently identical" to the fancy AJAX behaviour.
By the way, as far as I can tell, that script would make the experience somewhat better for the user, although without some server-side changes, no bandwidth or processing time will be saved.
Created attachment 2303 [details] patch Adds ajax watch/unwatch functionality. Test it out at http://www.dtopo.afraid.org/svnwiki/index.php?title=Special:Userlogin&returnto=User:Dto/Sandbox (user: Test123; pass: test). Some of the bigger changes: New file skins/common/ajaxwatch.js: adds main client-side logic New system message Ajaxwatch.js: used to customize/internationalize user interface used by ajaxwatch.js New configuration setting $wgAjaxWatch: flag to turn this functionality on/off New ajax function wfAjaxWatch: the function that is called through AJAX If the browser does not support this feature, it should not become effective on the client side and the default HTML link should remain. I have tested this successfully on Windows with Firefox 1.5, IE 6, and Opera 9.
Some limitations: Only works with SkinTemplate-based templates (which have the ca-watch/ca-unwatch tabs), i.e. MonoBook, Chick, MySkin, and Simple. MySkin is the only one of those four skins which does *not* have a .usermessage css class (so far only used for "you have new messages", I believe), so the message is currently barely visible.
Currently rewriting patch so we don't suffer from the same problems that Monobook.js (bug 5376) does...
Created attachment 2310 [details] better patch Updated patch. Same demo installation as before. Big changes (ignore big changes in previous comment): New file skins/common/ajaxwatch.js: adds main client-side logic New system messages addedwatchajaxtext, removedwatchajaxtext, watching, unwatching: interface text New configuration setting $wgAjaxWatch: flag to turn functionality on/off New ajax function wfAjaxWatch: the function that is called through AJAX Several new functions in wikibits.js: facilitate updating access key/tooltip for just one element The internationalization through the new system messages (and the existing messages watch and unwatch) is done through some javascript appended to the site js (i.e. action=raw&gen=js). If the browser does not support this feature, it should not become effective on the client side and the default HTML link should remain. I have tested this successfully on Windows with Firefox 1.5, IE 6, and Opera 9.
Created attachment 2315 [details] betterer patch Small changes. This is hopefully the final patch.
Applied with modifications in r18598.
Thank you!