Last modified: 2006-12-27 06:34:09 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T9169, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7169 - Use Ajax to watch/unwatch articles
Use Ajax to watch/unwatch articles
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
unspecified
All All
: Normal enhancement with 5 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-29 20:08 UTC by Aryeh Gregor (not reading bugmail, please e-mail directly)
Modified: 2006-12-27 06:34 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
patch (7.87 KB, patch)
2006-09-03 06:47 UTC, Dan Li
Details
better patch (13.52 KB, patch)
2006-09-04 05:52 UTC, Dan Li
Details
betterer patch (13.42 KB, patch)
2006-09-04 19:17 UTC, Dan Li
Details

Description Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-29 20:08:24 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]]).
Comment 1 Rob Church 2006-08-29 20:33:19 UTC
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.
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-30 01:03:01 UTC
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.
Comment 3 Rob Church 2006-08-30 02:22:02 UTC
No, of course not, but I'd suggest that we make the fallback behaviour
"apparently identical" to the fancy AJAX behaviour.
Comment 4 Dan Li 2006-08-31 00:59:22 UTC
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.
Comment 5 Dan Li 2006-09-03 06:47:16 UTC
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.
Comment 6 Dan Li 2006-09-03 07:04:12 UTC
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.
Comment 7 Dan Li 2006-09-03 17:13:44 UTC
Currently rewriting patch so we don't suffer from the same problems that
Monobook.js (bug 5376) does...
Comment 8 Dan Li 2006-09-04 05:52:45 UTC
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.
Comment 9 Dan Li 2006-09-04 19:17:52 UTC
Created attachment 2315 [details]
betterer patch

Small changes. This is hopefully the final patch.
Comment 10 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-12-26 23:53:54 UTC
Applied with modifications in r18598.
Comment 11 Dan Li 2006-12-27 06:34:09 UTC
Thank you!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links