r56000 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55999‎ | r56000 | r56001 >
Date:22:02, 7 September 2009
Author:werdna
Status:deferred (Comments)
Tags:
Comment:
Update LiquidThreads JS:
* Throw in a spinner when loading stuff by AJAX.
* Fix AJAX calls for compatibility with r55973
Modified paths:
  • /trunk/extensions/LiquidThreads/lqt.css (modified) (history)
  • /trunk/extensions/LiquidThreads/lqt.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/lqt.css
@@ -461,3 +461,4 @@
462462 border: 1px solid #dddddd;
463463 background-color: #eeeeee;
464464 }
 465+
Index: trunk/extensions/LiquidThreads/lqt.js
@@ -49,9 +49,15 @@
5050
5151 liquidThreads.cancelEdit( container );
5252
 53+ var loadSpinner = $j('<div class="mw-ajax-loader"/>');
 54+ container.before( loadSpinner );
 55+
5356 $j(container).load(wgServer+wgScript, 'title='+encodeURIComponent(wgPageName)+
5457 query+'&lqt_inline=1',
5558 function() {
 59+ // Kill the loader.
 60+ loadSpinner.remove();
 61+
5662 if (preload) {
5763 $j("textarea", container)[0].value = preload;
5864 }
@@ -233,8 +239,8 @@
234240 threads.push(threadID);
235241 } );
236242
237 - var getData = { 'action' : 'query', 'list' : 'threads', 'lqtid' : threads.join('|'),
238 - 'format' : 'json', 'lqtprop' : 'id|subject|parent|modified' };
 243+ var getData = { 'action' : 'query', 'list' : 'threads', 'thid' : threads.join('|'),
 244+ 'format' : 'json', 'thprop' : 'id|subject|parent|modified' };
239245
240246 $j.get( wgScriptPath+'/api.php', getData,
241247 function(data) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r55973LiquidThreads: Clean up API module added in r55920:...catrope14:46, 7 September 2009

Comments

#Comment by Mdale (talk | contribs)   01:47, 8 September 2009

if using $j .. you could also use other convenience functions like: do_api_req({'data':getData},function(data){ }); although its one line either way ... some advantages of do_api_req (default action is "query" and it centralizes the way we access the api.php path. But not much more useful / readable than $j.get in most cases.

Status & tagging log