Thank you Brion,
I already implemented api function, it's described in bz ticket, I forgot to note that, but actually I was looking for someone with experiences :) who could join me and help finish that extension, it's no problem for me to insert some div which could be used by script to insert status there, unfortunately I don't know how to create that script because I never worked with JS, if no one was interested I will try to do it myself but that could take months to me to understand how to implement it, since there is consensus on english wp to have this and some folks are now already asking me when it would be installed, I don't like idea that I would work on that several months, while others who know this could make it in few hours. Everything else should be completed, all I need is to create a script which would download status from api and render it properly on page.
On Mon, Dec 5, 2011 at 7:38 PM, Brion Vibber brion@pobox.com wrote:
On Mon, Dec 5, 2011 at 8:29 AM, Petr Bena benapetr@gmail.com wrote:
Hi,
I have already noted that I work on extension which allows displaying of user online status, see https://bugzilla.wikimedia.org/show_bug.cgi?id=32128, Krinkle come with idea that it could use ajax on user pages for status bar in order to avoid cache issues while keep performance of interface (if cache would need to be suppressed it would have probably negative effect on performance althought it would happen rarely). I like that idea, however I have no experience with ajax. If anyone who understand ajax wanted to help it would be most appreciated!
You'll want to do a little work in three distinct places:
- Add an API module to return the online state information, or extend
ApiQueryUsers to return that info (action=query&list=users&ususers=Username&usprop=online ?)
To write or extend an API module, see docs: https://www.mediawiki.org/wiki/API%3AExtensions
- Output scaffolding HTML from your existing hook.
Don't do the full lookup and output, but you'll at least need an identifiable spot on the page where you can stick your data once you've loaded it. Make sure that it degrades gracefully if JavaScript is unavailable or disabled! (Don't be afraid to use <noscript>.)
- Add JavaScript to do the lookup and update the visible state.
For current versions of MediaWiki, the best way to organize client-side JS and CSS scripts is through ResourceLoader modules. See docs:
https://www.mediawiki.org/wiki/ResourceLoader
The actual API hit can be done using jQuery's $.ajax() function, which is much easier than manually dealing with an XMLHTTPRequest object:
http://api.jquery.com/jQuery.ajax/
Feel free to look at other extensions for how they do things (but beware, not all extensions have been modernized to use jQuery and ResourceLoader fully!)
And don't be shy about asking questions in the #mediawiki channel on irc.freenode.net -- we try not to bite!
-- brion vibber (brion @ wikimedia.org / brion @ pobox.com)
Thanks
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l