Index: branches/wmf-deployment/extensions/LiquidThreads/lqt.css |
— | — | @@ -488,3 +488,11 @@ |
489 | 489 | .mw-lqt-newmessages-left { |
490 | 490 | width: 10em ; |
491 | 491 | } |
| 492 | + |
| 493 | +.lqt-command-working { |
| 494 | + padding: 10px !important; |
| 495 | + margin-right: 0.6em; |
| 496 | + background-image: url(../../skins/common/images/spinner.gif); |
| 497 | + background-position: middle middle; |
| 498 | + background-repeat: no-repeat; |
| 499 | +} |
Index: branches/wmf-deployment/extensions/LiquidThreads/classes/View.php |
— | — | @@ -643,7 +643,7 @@ |
644 | 644 | wfLoadExtensionMessages( 'LiquidThreads' ); |
645 | 645 | |
646 | 646 | $messages = array( 'lqt-quote-intro', 'lqt-quote', 'lqt-ajax-updated', |
647 | | - 'lqt-ajax-update-link' ); |
| 647 | + 'lqt-ajax-update-link', 'watch', 'unwatch' ); |
648 | 648 | $data = array(); |
649 | 649 | |
650 | 650 | foreach( $messages as $msg ) { |
— | — | @@ -882,8 +882,10 @@ |
883 | 883 | $commands_html = ""; |
884 | 884 | } else { |
885 | 885 | $lis = $this->listItemsForCommands( $this->topLevelThreadCommands( $thread ) ); |
| 886 | + $id = 'lqt-threadlevel-commands-'.$thread->id(); |
886 | 887 | $commands_html = Xml::tags( 'ul', |
887 | | - array( 'class' => 'lqt_threadlevel_commands' ), |
| 888 | + array( 'class' => 'lqt_threadlevel_commands', |
| 889 | + 'id' => $id ), |
888 | 890 | $lis ); |
889 | 891 | } |
890 | 892 | |
— | — | @@ -1038,7 +1040,13 @@ |
1039 | 1041 | wfTimestamp( TS_MW, $thread->modified() ), |
1040 | 1042 | array( 'id' => 'lqt-thread-modified-'.$thread->id(), |
1041 | 1043 | 'class' => 'lqt-thread-modified' ) ); |
1042 | | - } |
| 1044 | + } |
| 1045 | + |
| 1046 | + // Add the thread's title |
| 1047 | + $html .= Xml::hidden( 'lqt-thread-title-'.$thread->id(), |
| 1048 | + $thread->title()->getPrefixedText(), |
| 1049 | + array( 'id' => 'lqt-thread-title-'.$thread->id(), |
| 1050 | + 'class' => 'lqt-thread-title-metadata' ) ); |
1043 | 1051 | |
1044 | 1052 | // Flush output to display thread |
1045 | 1053 | $this->output->addHTML( $html ); |
Index: branches/wmf-deployment/extensions/LiquidThreads/lqt.js |
— | — | @@ -480,6 +480,44 @@ |
481 | 481 | }, 'json' ); |
482 | 482 | |
483 | 483 | $j(this).remove(); |
| 484 | + }, |
| 485 | + |
| 486 | + 'asyncWatch' : function(e) { |
| 487 | + var button = $j(this); |
| 488 | + var tlcOffset = "lqt-threadlevel-commands-".length; |
| 489 | + |
| 490 | + // Find the title of the thread |
| 491 | + var threadLevelCommands = button.closest('.lqt_threadlevel_commands'); |
| 492 | + var threadID = threadLevelCommands.attr('id').substring( tlcOffset ); |
| 493 | + var title = $j('#lqt-thread-title-'+threadID).val(); |
| 494 | + |
| 495 | + // Check if we're watching or unwatching. |
| 496 | + var action = ''; |
| 497 | + if ( button.hasClass( 'lqt-command-watch' ) ) { |
| 498 | + button.removeClass( 'lqt-command-watch' ); |
| 499 | + action = 'watch'; |
| 500 | + } else if ( button.hasClass( 'lqt-command-unwatch' ) ) { |
| 501 | + button.removeClass( 'lqt-command-unwatch' ); |
| 502 | + action = 'unwatch'; |
| 503 | + } |
| 504 | + |
| 505 | + // Replace the watch link with a spinner |
| 506 | + button.empty().addClass( 'lqt-command-working' ); |
| 507 | + |
| 508 | + // Do the AJAX call. |
| 509 | + var apiParams = { 'action' : 'watch', 'title' : title, 'format' : 'json' }; |
| 510 | + |
| 511 | + if (action == 'unwatch') { |
| 512 | + apiParams.unwatch = 'yes'; |
| 513 | + } |
| 514 | + |
| 515 | + $j.get( wgScriptPath+'/api'+wgScriptExtension, apiParams, |
| 516 | + function( data ) { |
| 517 | + threadLevelCommands.load( window.location.href+' '+ |
| 518 | + '#'+threadLevelCommands.attr('id')+' > *' ); |
| 519 | + }, 'json' ); |
| 520 | + |
| 521 | + e.preventDefault(); |
484 | 522 | } |
485 | 523 | } |
486 | 524 | |
— | — | @@ -524,6 +562,10 @@ |
525 | 563 | liquidThreads.setupThread( this ); |
526 | 564 | } ); |
527 | 565 | |
| 566 | + // Live bind for unwatch/watch stuff. |
| 567 | + $j('.lqt-command-watch').live( 'click', liquidThreads.asyncWatch ); |
| 568 | + $j('.lqt-command-unwatch').live( 'click', liquidThreads.asyncWatch ); |
| 569 | + |
528 | 570 | // Set up periodic update checking |
529 | 571 | setInterval( liquidThreads.checkForUpdates, 60000 ); |
530 | 572 | } ); |
Property changes on: branches/wmf-deployment/extensions/LiquidThreads |
___________________________________________________________________ |
Modified: svn:mergeinfo |
531 | 573 | Merged /trunk/extensions/LiquidThreads:r57389 |
Property changes on: branches/wmf-deployment/includes/EditPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
532 | 574 | Merged /trunk/phase3/includes/EditPage.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/HTMLForm.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
533 | 575 | Merged /trunk/phase3/includes/HTMLForm.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/HistoryPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
534 | 576 | Merged /trunk/phase3/includes/HistoryPage.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/api/ApiMain.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
535 | 577 | Merged /trunk/phase3/includes/api/ApiMain.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/Title.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
536 | 578 | Merged /trunk/phase3/includes/Title.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/ConfEditor.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
537 | 579 | Merged /trunk/phase3/includes/ConfEditor.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/specials/SpecialUserrights.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
538 | 580 | Merged /trunk/phase3/includes/specials/SpecialUserrights.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/specials/SpecialContributions.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
539 | 581 | Merged /trunk/phase3/includes/specials/SpecialContributions.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/specials/SpecialUpload.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
540 | 582 | Merged /trunk/phase3/includes/specials/SpecialUpload.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/specials |
___________________________________________________________________ |
Modified: svn:mergeinfo |
541 | 583 | Merged /trunk/phase3/includes/specials:r57388-57389 |
Index: branches/wmf-deployment/includes/Skin.php |
— | — | @@ -355,7 +355,7 @@ |
356 | 356 | # Weird back-compat stuff. |
357 | 357 | $skinName = $skinName['skinname']; |
358 | 358 | } |
359 | | - global $wgScript, $wgTitle, $wgStylePath, $wgUser; |
| 359 | + global $wgScript, $wgTitle, $wgStylePath, $wgUser, $wgScriptExtension; |
360 | 360 | global $wgArticlePath, $wgScriptPath, $wgServer, $wgContLang, $wgLang; |
361 | 361 | global $wgCanonicalNamespaceNames, $wgOut, $wgArticle; |
362 | 362 | global $wgBreakFrames, $wgRequest, $wgVariantArticlePath, $wgActionPaths; |
— | — | @@ -385,6 +385,7 @@ |
386 | 386 | 'stylepath' => $wgStylePath, |
387 | 387 | 'wgArticlePath' => $wgArticlePath, |
388 | 388 | 'wgScriptPath' => $wgScriptPath, |
| 389 | + 'wgScriptExtension' => $wgScriptExtension, |
389 | 390 | 'wgScript' => $wgScript, |
390 | 391 | 'wgVariantArticlePath' => $wgVariantArticlePath, |
391 | 392 | 'wgActionPaths' => (object)$wgActionPaths, |
Property changes on: branches/wmf-deployment/includes/Skin.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
392 | 393 | Merged /trunk/phase3/includes/Skin.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/upload/UploadBase.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
393 | 394 | Merged /trunk/phase3/includes/upload/UploadBase.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/Xml.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
394 | 395 | Merged /trunk/phase3/includes/Xml.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/json/Services_JSON.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
395 | 396 | Merged /trunk/phase3/includes/json/Services_JSON.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes/Linker.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
396 | 397 | Merged /trunk/phase3/includes/Linker.php:r57388-57389 |
Property changes on: branches/wmf-deployment/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
397 | 398 | Merged /trunk/phase3/includes:r57388-57389 |