Bsitu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/73531


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, 10 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/31/73531/1

diff --git a/api/ApiEchoNotifications.php b/api/ApiEchoNotifications.php
index 32cdd86..0dd675b 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( 'notcachetime' );
+
                $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..854346c 100644
--- a/modules/overlay/ext.echo.overlay.js
+++ b/modules/overlay/ext.echo.overlay.js
@@ -39,7 +39,8 @@
                                'meta' : 'notifications',
                                'notformat' : 'flyout',
                                'notlimit' : notificationLimit,
-                               'notprop' : 'index|list|count'
+                               'notprop' : 'index|list|count',
+                               'notcachetime': new Date().getTime()
                        } ).done( function ( result ) {
                                var notifications = result.query.notifications,
                                        unread = [],
@@ -123,7 +124,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 +225,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..0a4ef63 100644
--- a/modules/special/ext.echo.special.js
+++ b/modules/special/ext.echo.special.js
@@ -73,7 +73,8 @@
                                'notformat' : 'html',
                                'notprop' : 'index|list',
                                'notcontinue': this.notcontinue,
-                               'notlimit': mw.config.get( 'wgEchoDisplayNum' )
+                               'notlimit': mw.config.get( 'wgEchoDisplayNum' ),
+                               'notcachetime': new Date().getTime()
                        } ).done( function ( result ) {
                                container = $( '#mw-echo-special-container' );
                                notifications = result.query.notifications;
@@ -128,7 +129,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: newchange
Gerrit-Change-Id: Iaacdf41d85dc31a07d3d981086bcd919ba1a40e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>

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

Reply via email to