http://www.mediawiki.org/wiki/Special:Code/MediaWiki/57395

Revision: 57395
Author:   werdna
Date:     2009-10-05 19:35:14 +0000 (Mon, 05 Oct 2009)

Log Message:
-----------
Merge r57388 and r57389 (LiquidThreads AJAX watching)

Modified Paths:
--------------
    branches/wmf-deployment/extensions/LiquidThreads/classes/View.php
    branches/wmf-deployment/extensions/LiquidThreads/lqt.css
    branches/wmf-deployment/extensions/LiquidThreads/lqt.js
    branches/wmf-deployment/includes/Skin.php

Property Changed:
----------------
    branches/wmf-deployment/extensions/LiquidThreads/
    branches/wmf-deployment/includes/
    branches/wmf-deployment/includes/ConfEditor.php
    branches/wmf-deployment/includes/EditPage.php
    branches/wmf-deployment/includes/HTMLForm.php
    branches/wmf-deployment/includes/HistoryPage.php
    branches/wmf-deployment/includes/Linker.php
    branches/wmf-deployment/includes/Skin.php
    branches/wmf-deployment/includes/Title.php
    branches/wmf-deployment/includes/Xml.php
    branches/wmf-deployment/includes/api/ApiMain.php
    branches/wmf-deployment/includes/json/Services_JSON.php
    branches/wmf-deployment/includes/specials/
    branches/wmf-deployment/includes/specials/SpecialContributions.php
    branches/wmf-deployment/includes/specials/SpecialUpload.php
    branches/wmf-deployment/includes/specials/SpecialUserrights.php
    branches/wmf-deployment/includes/upload/UploadBase.php


Property changes on: branches/wmf-deployment/extensions/LiquidThreads
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/extensions/LiquidThreads:51646
/trunk/extensions/LiquidThreads:56151-57116,57130-57134,57169,57193,57195,57198,57200-57206,57215,57219,57222,57225,57227,57229,57287
/trunk/phase3/extensions/LiquidThreads:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350
   + /branches/REL1_15/phase3/extensions/LiquidThreads:51646
/trunk/extensions/LiquidThreads:56151-57116,57130-57134,57169,57193,57195,57198,57200-57206,57215,57219,57222,57225,57227,57229,57287,57389
/trunk/phase3/extensions/LiquidThreads:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350

Modified: branches/wmf-deployment/extensions/LiquidThreads/classes/View.php
===================================================================
--- branches/wmf-deployment/extensions/LiquidThreads/classes/View.php   
2009-10-05 19:21:31 UTC (rev 57394)
+++ branches/wmf-deployment/extensions/LiquidThreads/classes/View.php   
2009-10-05 19:35:14 UTC (rev 57395)
@@ -643,7 +643,7 @@
                wfLoadExtensionMessages( 'LiquidThreads' );
                
                $messages = array( 'lqt-quote-intro', 'lqt-quote', 
'lqt-ajax-updated',
-                                                       'lqt-ajax-update-link' 
);
+                                                       'lqt-ajax-update-link', 
'watch', 'unwatch' );
                $data = array();
                
                foreach( $messages as $msg ) {
@@ -882,8 +882,10 @@
                                $commands_html = "";
                        } else {
                                $lis = $this->listItemsForCommands( 
$this->topLevelThreadCommands( $thread ) );
+                               $id = 'lqt-threadlevel-commands-'.$thread->id();
                                $commands_html = Xml::tags( 'ul',
-                                                                               
        array( 'class' => 'lqt_threadlevel_commands' ),
+                                                                               
        array( 'class' => 'lqt_threadlevel_commands',
+                                                                               
                'id' => $id ),
                                                                                
        $lis );
                        }
                        
@@ -1038,7 +1040,13 @@
                                                                        
wfTimestamp( TS_MW, $thread->modified() ),
                                                                        array( 
'id' => 'lqt-thread-modified-'.$thread->id(),
                                                                                
        'class' => 'lqt-thread-modified' ) );
-               }                                                               
+               }
+               
+               // Add the thread's title
+               $html .= Xml::hidden( 'lqt-thread-title-'.$thread->id(),
+                                       $thread->title()->getPrefixedText(),
+                                       array( 'id' => 
'lqt-thread-title-'.$thread->id(),
+                                               'class' => 
'lqt-thread-title-metadata' ) );
 
                // Flush output to display thread
                $this->output->addHTML( $html );

Modified: branches/wmf-deployment/extensions/LiquidThreads/lqt.css
===================================================================
--- branches/wmf-deployment/extensions/LiquidThreads/lqt.css    2009-10-05 
19:21:31 UTC (rev 57394)
+++ branches/wmf-deployment/extensions/LiquidThreads/lqt.css    2009-10-05 
19:35:14 UTC (rev 57395)
@@ -488,3 +488,11 @@
 .mw-lqt-newmessages-left {
        width: 10em     ;
 }
+
+.lqt-command-working {
+       padding: 10px !important;
+       margin-right: 0.6em;
+       background-image: url(../../skins/common/images/spinner.gif);
+       background-position: middle middle;
+       background-repeat: no-repeat;
+}

Modified: branches/wmf-deployment/extensions/LiquidThreads/lqt.js
===================================================================
--- branches/wmf-deployment/extensions/LiquidThreads/lqt.js     2009-10-05 
19:21:31 UTC (rev 57394)
+++ branches/wmf-deployment/extensions/LiquidThreads/lqt.js     2009-10-05 
19:35:14 UTC (rev 57395)
@@ -480,6 +480,44 @@
                        }, 'json' );
                        
                $j(this).remove();
+       },
+       
+       'asyncWatch' : function(e) {
+               var button = $j(this);
+               var tlcOffset = "lqt-threadlevel-commands-".length;
+               
+               // Find the title of the thread
+               var threadLevelCommands = 
button.closest('.lqt_threadlevel_commands');
+               var threadID = threadLevelCommands.attr('id').substring( 
tlcOffset );
+               var title = $j('#lqt-thread-title-'+threadID).val();
+               
+               // Check if we're watching or unwatching.
+               var action = '';
+               if ( button.hasClass( 'lqt-command-watch' ) ) {
+                       button.removeClass( 'lqt-command-watch' );
+                       action = 'watch';
+               } else if ( button.hasClass( 'lqt-command-unwatch' ) ) {
+                       button.removeClass( 'lqt-command-unwatch' );
+                       action = 'unwatch';
+               }
+               
+               // Replace the watch link with a spinner
+               button.empty().addClass( 'lqt-command-working' );
+               
+               // Do the AJAX call.
+               var apiParams = { 'action' : 'watch', 'title' : title, 'format' 
: 'json' };
+               
+               if (action == 'unwatch') {
+                       apiParams.unwatch = 'yes';
+               }
+               
+               $j.get( wgScriptPath+'/api'+wgScriptExtension, apiParams,
+                       function( data ) {
+                               threadLevelCommands.load( 
window.location.href+' '+
+                                               
'#'+threadLevelCommands.attr('id')+' > *' );
+                       }, 'json' );
+               
+               e.preventDefault();
        }
 }
 
@@ -524,6 +562,10 @@
                liquidThreads.setupThread( this );
        } );
        
+       // Live bind for unwatch/watch stuff.
+       $j('.lqt-command-watch').live( 'click', liquidThreads.asyncWatch );
+       $j('.lqt-command-unwatch').live( 'click', liquidThreads.asyncWatch );
+       
        // Set up periodic update checking
        setInterval( liquidThreads.checkForUpdates, 60000 );
 } );


Property changes on: branches/wmf-deployment/includes
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes:51646
/branches/wmf-deployment/includes:53381
/trunk/phase3/includes:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350
   + /branches/REL1_15/phase3/includes:51646
/branches/wmf-deployment/includes:53381
/trunk/phase3/includes:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,57388-57389


Property changes on: branches/wmf-deployment/includes/ConfEditor.php
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk/phase3/includes/ConfEditor.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350
   + 
/trunk/phase3/includes/ConfEditor.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,57388-57389


Property changes on: branches/wmf-deployment/includes/EditPage.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/EditPage.php:51646
/branches/wmf-deployment/includes/EditPage.php:53381
/trunk/phase3/includes/EditPage.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56478
   + /branches/REL1_15/phase3/includes/EditPage.php:51646
/branches/wmf-deployment/includes/EditPage.php:53381
/trunk/phase3/includes/EditPage.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56478,57388-57389


Property changes on: branches/wmf-deployment/includes/HTMLForm.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/HTMLForm.php:51646
/branches/wmf-deployment/includes/HTMLForm.php:53381
/trunk/phase3/includes/HTMLForm.php:56184,56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350
   + /branches/REL1_15/phase3/includes/HTMLForm.php:51646
/branches/wmf-deployment/includes/HTMLForm.php:53381
/trunk/phase3/includes/HTMLForm.php:56184,56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,57388-57389


Property changes on: branches/wmf-deployment/includes/HistoryPage.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/PageHistory.php:51646
/trunk/phase3/includes/HistoryPage.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350
   + /branches/REL1_15/phase3/includes/PageHistory.php:51646
/trunk/phase3/includes/HistoryPage.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,57388-57389


Property changes on: branches/wmf-deployment/includes/Linker.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/Linker.php:51646
/branches/wmf-deployment/includes/Linker.php:53381
/trunk/phase3/includes/Linker.php:56174,56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56514
   + /branches/REL1_15/phase3/includes/Linker.php:51646
/branches/wmf-deployment/includes/Linker.php:53381
/trunk/phase3/includes/Linker.php:56174,56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56514,57388-57389

Modified: branches/wmf-deployment/includes/Skin.php
===================================================================
--- branches/wmf-deployment/includes/Skin.php   2009-10-05 19:21:31 UTC (rev 
57394)
+++ branches/wmf-deployment/includes/Skin.php   2009-10-05 19:35:14 UTC (rev 
57395)
@@ -355,7 +355,7 @@
                        # Weird back-compat stuff.
                        $skinName = $skinName['skinname'];
                }
-               global $wgScript, $wgTitle, $wgStylePath, $wgUser;
+               global $wgScript, $wgTitle, $wgStylePath, $wgUser, 
$wgScriptExtension;
                global $wgArticlePath, $wgScriptPath, $wgServer, $wgContLang, 
$wgLang;
                global $wgCanonicalNamespaceNames, $wgOut, $wgArticle;
                global $wgBreakFrames, $wgRequest, $wgVariantArticlePath, 
$wgActionPaths;
@@ -385,6 +385,7 @@
                        'stylepath' => $wgStylePath,
                        'wgArticlePath' => $wgArticlePath,
                        'wgScriptPath' => $wgScriptPath,
+                       'wgScriptExtension' => $wgScriptExtension,
                        'wgScript' => $wgScript,
                        'wgVariantArticlePath' => $wgVariantArticlePath,
                        'wgActionPaths' => (object)$wgActionPaths,


Property changes on: branches/wmf-deployment/includes/Skin.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/Skin.php:51646
/branches/wmf-deployment/includes/Skin.php:53381
/trunk/phase3/includes/Skin.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56523
   + /branches/REL1_15/phase3/includes/Skin.php:51646
/branches/wmf-deployment/includes/Skin.php:53381
/trunk/phase3/includes/Skin.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56523,57388-57389


Property changes on: branches/wmf-deployment/includes/Title.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/Title.php:51646
/branches/wmf-deployment/includes/Title.php:53381
/trunk/phase3/includes/Title.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56492,56918
   + /branches/REL1_15/phase3/includes/Title.php:51646
/branches/wmf-deployment/includes/Title.php:53381
/trunk/phase3/includes/Title.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56492,56918,57388-57389


Property changes on: branches/wmf-deployment/includes/Xml.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/Xml.php:51646
/branches/wmf-deployment/includes/Xml.php:53381
/trunk/phase3/includes/Xml.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56496
   + /branches/REL1_15/phase3/includes/Xml.php:51646
/branches/wmf-deployment/includes/Xml.php:53381
/trunk/phase3/includes/Xml.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56496,57388-57389


Property changes on: branches/wmf-deployment/includes/api/ApiMain.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/api/ApiMain.php:51646
/branches/wmf-deployment/includes/api/ApiMain.php:53381
/trunk/phase3/includes/api/ApiMain.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56531
   + /branches/REL1_15/phase3/includes/api/ApiMain.php:51646
/branches/wmf-deployment/includes/api/ApiMain.php:53381
/trunk/phase3/includes/api/ApiMain.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56531,57388-57389


Property changes on: branches/wmf-deployment/includes/json/Services_JSON.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/api/ApiFormatJson_json.php:51646
/branches/wmf-deployment/includes/api/ApiFormatJson_json.php:53381
/trunk/phase3/includes/json/Services_JSON.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350
   + /branches/REL1_15/phase3/includes/api/ApiFormatJson_json.php:51646
/branches/wmf-deployment/includes/api/ApiFormatJson_json.php:53381
/trunk/phase3/includes/json/Services_JSON.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,57388-57389


Property changes on: branches/wmf-deployment/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/specials:51646
/branches/wmf-deployment/includes/specials:53381
/trunk/phase3/includes/specials:56188
   + /branches/REL1_15/phase3/includes/specials:51646
/branches/wmf-deployment/includes/specials:53381
/trunk/phase3/includes/specials:56188,57388-57389


Property changes on: 
branches/wmf-deployment/includes/specials/SpecialContributions.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/specials/SpecialContributions.php:51646
/branches/wmf-deployment/includes/specials/SpecialContributions.php:53381
/trunk/phase3/includes/specials/SpecialContributions.php:56188,56468
   + /branches/REL1_15/phase3/includes/specials/SpecialContributions.php:51646
/branches/wmf-deployment/includes/specials/SpecialContributions.php:53381
/trunk/phase3/includes/specials/SpecialContributions.php:56188,56468,57388-57389


Property changes on: branches/wmf-deployment/includes/specials/SpecialUpload.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/specials/SpecialUpload.php:51646
/branches/wmf-deployment/includes/specials/SpecialUpload.php:53381
/trunk/phase3/includes/specials/SpecialUpload.php:56188,56416,56524
   + /branches/REL1_15/phase3/includes/specials/SpecialUpload.php:51646
/branches/wmf-deployment/includes/specials/SpecialUpload.php:53381
/trunk/phase3/includes/specials/SpecialUpload.php:56188,56416,56524,57388-57389


Property changes on: 
branches/wmf-deployment/includes/specials/SpecialUserrights.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/specials/SpecialUserrights.php:51646
/branches/wmf-deployment/includes/specials/SpecialUserrights.php:53381
/trunk/phase3/includes/specials/SpecialUserrights.php:56188,57064
   + /branches/REL1_15/phase3/includes/specials/SpecialUserrights.php:51646
/branches/wmf-deployment/includes/specials/SpecialUserrights.php:53381
/trunk/phase3/includes/specials/SpecialUserrights.php:56188,57064,57388-57389


Property changes on: branches/wmf-deployment/includes/upload/UploadBase.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/upload/UploadBase.php:51646
/branches/wmf-deployment/includes/upload/UploadBase.php:53381
/trunk/phase3/includes/upload/UploadBase.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56416,56618,56631,56817
   + /branches/REL1_15/phase3/includes/upload/UploadBase.php:51646
/branches/wmf-deployment/includes/upload/UploadBase.php:53381
/trunk/phase3/includes/upload/UploadBase.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56416,56618,56631,56817,57388-57389



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to