jenkins-bot has submitted this change and it was merged.

Change subject: (bug 48568) Bust IE browser ajax cache + some API clenaup
......................................................................


(bug 48568) Bust IE browser ajax cache + some API clenaup

Change-Id: Iaacdf41d85dc31a07d3d981086bcd919ba1a40e2
---
M api/ApiEchoNotifications.php
M modules/overlay/ext.echo.overlay.js
M modules/special/ext.echo.special.js
3 files changed, 8 insertions(+), 13 deletions(-)

Approvals:
  EBernhardson (WMF): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/api/ApiEchoNotifications.php b/api/ApiEchoNotifications.php
index 32cdd86..20182b0 100644
--- a/api/ApiEchoNotifications.php
+++ b/api/ApiEchoNotifications.php
@@ -6,6 +6,9 @@
        }
 
        public function execute() {
+               // To avoid API warning, register the parameter used to bust 
browser cache
+               $this->getMain()->getVal( '_' );
+
                $user = $this->getUser();
                if ( $user->isAnon() ) {
                        $this->dieUsage( 'Login is required', 'login-required' 
);
@@ -189,12 +192,6 @@
                                ApiBase::PARAM_MAX2 => ApiBase::LIMIT_SML2,
                        ),
                        'index' => false,
-                       'offset' => array(
-                               ApiBase::PARAM_TYPE => 'integer',
-                       ),
-                       'timestamp' => array(
-                               ApiBase::PARAM_TYPE => 'integer',
-                       ),
                        'continue' => null,
                );
        }
@@ -207,8 +204,6 @@
                        'format' => 'If specified, notifications will be 
returned formatted this way.',
                        'index' => 'If specified, a list of notification IDs, 
in order, will be returned.',
                        'limit' => 'The maximum number of notifications to 
return.',
-                       'offset' => 'Notification event id to start from 
(requires timestamp param to be passed as well)',
-                       'timestamp' => 'Timestamp to start from',
                        'continue' => 'When more results are available, use 
this to continue',
                );
        }
diff --git a/modules/overlay/ext.echo.overlay.js 
b/modules/overlay/ext.echo.overlay.js
index 54d4306..3f91cf3 100644
--- a/modules/overlay/ext.echo.overlay.js
+++ b/modules/overlay/ext.echo.overlay.js
@@ -23,7 +23,7 @@
                                $overlay = $( '<div></div>' ).addClass( 
'mw-echo-overlay' ),
                                $prefLink = $( '#pt-preferences a' ),
                                count = 0,
-                               api = new mw.Api();
+                               api = new mw.Api( { ajax: { cache: false } } );
 
                        // Set notification limit based on height of the window
                        notificationLimit = Math.floor( ( $( window ).height() 
- 134 ) / 90 );
@@ -123,7 +123,7 @@
                                        .text( mw.msg( 'echo-mark-all-as-read' 
) )
                                        .click( function ( e ) {
                                                e.preventDefault();
-                                               api.get( {
+                                               api.post( {
                                                        'action' : 'query',
                                                        'meta' : 
'notifications',
                                                        'notmarkallread' : true,
@@ -224,7 +224,7 @@
 
                                // only need to mark as read if there is unread 
item
                                if ( unread.length > 0 ) {
-                                       api.get( {
+                                       api.post( {
                                                'action' : 'query',
                                                'meta' : 'notifications',
                                                'notmarkread' : unread.join( 
'|' ),
diff --git a/modules/special/ext.echo.special.js 
b/modules/special/ext.echo.special.js
index 44cea2b..4432603 100644
--- a/modules/special/ext.echo.special.js
+++ b/modules/special/ext.echo.special.js
@@ -65,7 +65,7 @@
                 * Load more notification records.
                 */
                loadMore: function () {
-                       var api = new mw.Api(), notifications, data, container, 
$li, that = this, unread = [];
+                       var api = new mw.Api( { ajax: { cache: false } } ), 
notifications, data, container, $li, that = this, unread = [];
 
                        api.get( {
                                'action' : 'query',
@@ -128,7 +128,7 @@
                markAsRead: function ( unread ) {
                        var api = new mw.Api(), that = this;
 
-                       api.get( {
+                       api.post( {
                                'action' : 'query',
                                'meta' : 'notifications',
                                'notmarkread' : unread.join( '|' ),

-- 
To view, visit https://gerrit.wikimedia.org/r/73531
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaacdf41d85dc31a07d3d981086bcd919ba1a40e2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>
Gerrit-Reviewer: Bsitu <[email protected]>
Gerrit-Reviewer: EBernhardson (WMF) <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to