r57944 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57943‎ | r57944 | r57945 >
Date:14:34, 20 October 2009
Author:werdna
Status:deferred
Tags:
Comment:
LiquidThreads AJAX save fixes
Modified paths:
  • /branches/wmf-deployment/extensions/LiquidThreads (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads/api/ApiThreadAction.php (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads/lqt.js (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/extensions/LiquidThreads/api/ApiThreadAction.php
@@ -344,13 +344,24 @@
345345
346346 $articleId = $editResult['edit']['pageid'];
347347
 348+ $article->getTitle()->resetArticleID( $articleId );
 349+ $title->resetArticleID( $articleId );
 350+
348351 $thread = LqtView::postEditUpdates( 'new', null, $articleId, $talkpage,
349352 $subject, $summary, null, $text );
350 -
 353+
 354+ $maxLag = wfGetLB()->getMaxLag();
 355+ $maxLag = $maxLag[1];
 356+
 357+ if ($maxLag == -1) {
 358+ $maxLag = 0;
 359+ }
 360+
351361 $result = array(
352362 'result' => 'Success',
353363 'thread-id' => $thread->id(),
354364 'thread-title' => $title->getPrefixedText(),
 365+ 'max-lag' => $maxLag,
355366 );
356367
357368 $result = array( 'thread' => $result );
@@ -431,9 +442,18 @@
432443 }
433444
434445 $articleId = $editResult['edit']['pageid'];
 446+ $article->getTitle()->resetArticleID( $articleId );
 447+ $title->resetArticleID( $articleId );
435448
436449 $thread = LqtView::postEditUpdates( 'reply', $replyTo, $articleId, $talkpage,
437450 $subject, $summary, null, $text );
 451+
 452+ $maxLag = wfGetLB()->getMaxLag();
 453+ $maxLag = $maxLag[1];
 454+
 455+ if ($maxLag == -1) {
 456+ $maxLag = 0;
 457+ }
438458
439459 $result = array(
440460 'action' => 'reply',
@@ -444,6 +464,7 @@
445465 'parent-title' => $replyTo->title()->getPrefixedText(),
446466 'ancestor-id' => $replyTo->topmostThread()->id(),
447467 'ancestor-title' => $replyTo->topmostThread()->title()->getPrefixedText(),
 468+ 'max-lag' => $maxLag,
448469 );
449470
450471 $result = array( 'thread' => $result );
Index: branches/wmf-deployment/extensions/LiquidThreads/lqt.js
@@ -642,14 +642,17 @@
643643 function() {
644644 // Set up thread.
645645 liquidThreads.setupThread( $j(this) );
 646+
 647+ targetOffset = $j(this).offset().top;
 648+ $j('html,body').animate(
 649+ {scrollTop: targetOffset},
 650+ 'slow');
646651 }
647652 );
648653 }, 'json' );
649654 }
650655
651656 var doneCallback = function(data) {
652 - spinner.remove();
653 -
654657 try {
655658 var result = data.threadaction.thread.result;
656659 } catch ( err ) {
@@ -671,13 +674,20 @@
672675 return;
673676 }
674677
 678+ var timeout = (data.threadaction.thread['max-lag'] + 1) * 1000;
 679+ var callback;
 680+
675681 if ( type == 'reply' ) {
676 - replyCallback( data );
 682+ callback = replyCallback;
677683 }
678684
679685 if ( type == 'talkpage_new_thread' ) {
680 - newCallback( data );
 686+ callback = newCallback;
681687 }
 688+
 689+ editform.empty().hide();
 690+
 691+ setTimeout( function() { spinner.remove(); callback(data); }, timeout );
682692 };
683693
684694 if ( type == 'reply' ) {
Property changes on: branches/wmf-deployment/extensions/LiquidThreads
___________________________________________________________________
Name: svn:mergeinfo
685695 - /branches/REL1_15/phase3/extensions/LiquidThreads:51646
/trunk/extensions/LiquidThreads:56151-57941
/trunk/phase3/extensions/LiquidThreads:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447
686696 + /branches/REL1_15/phase3/extensions/LiquidThreads:51646
/trunk/extensions/LiquidThreads:56151-57943
/trunk/phase3/extensions/LiquidThreads:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447

Status & tagging log