summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2020-10-02 14:49:18 -0400
committerBrian Evans <grknight@gentoo.org>2020-10-02 14:49:18 -0400
commitd31271608550a4b9e7e5b616d8d5eeb83b892e53 (patch)
treeb06377cdc3748c3c1ac6d25eaa375824a1f7468b /CommentStreams/resources
parentUpdate CheckUser to 1.35 (diff)
downloadextensions-d31271608550a4b9e7e5b616d8d5eeb83b892e53.tar.gz
extensions-d31271608550a4b9e7e5b616d8d5eeb83b892e53.tar.bz2
extensions-d31271608550a4b9e7e5b616d8d5eeb83b892e53.zip
Update CommentStreams to 1.35
Signed-off-by: Brian Evans <grknight@gentoo.org>
Diffstat (limited to 'CommentStreams/resources')
-rw-r--r--CommentStreams/resources/CommentStreams.css2
-rw-r--r--CommentStreams/resources/CommentStreams.js28
-rw-r--r--CommentStreams/resources/CommentStreamsQuerier.js10
3 files changed, 20 insertions, 20 deletions
diff --git a/CommentStreams/resources/CommentStreams.css b/CommentStreams/resources/CommentStreams.css
index 574e6a82..0e1b648e 100644
--- a/CommentStreams/resources/CommentStreams.css
+++ b/CommentStreams/resources/CommentStreams.css
@@ -107,7 +107,7 @@
padding-left: 5px;
}
-button:hover {
+.cs-button:hover {
background-color: #8eddf5;
}
diff --git a/CommentStreams/resources/CommentStreams.js b/CommentStreams/resources/CommentStreams.js
index e16ed87e..45a2ce5a 100644
--- a/CommentStreams/resources/CommentStreams.js
+++ b/CommentStreams/resources/CommentStreams.js
@@ -333,7 +333,7 @@ var commentstreams_controller = ( function( mw, $ ) {
.addClass( 'cs-comment-header-right' );
if ( commentData.parentid === null && this.enableWatchlist &&
- !mw.user.isAnon() ) {
+ !this.isLoggedIn ) {
rightDiv.append( this.createWatchButton( commentData ) );
}
@@ -437,7 +437,7 @@ var commentstreams_controller = ( function( mw, $ ) {
'data-toggle': 'tooltip'
} );
var editimage = $( '<img>' );
- if ( mw.user.getName() !== username ) {
+ if ( mw.config.get( 'wgUserName' ) !== username ) {
editimage
.attr( {
title: mw.message( 'commentstreams-buttontooltip-moderator-edit' ),
@@ -471,7 +471,7 @@ var commentstreams_controller = ( function( mw, $ ) {
'data-toggle': 'tooltip'
} );
var deleteimage = $( '<img>' );
- if ( mw.user.getName() !== username ) {
+ if ( mw.config.get( 'wgUserName' ) !== username ) {
deleteimage
.attr( {
title: mw.message( 'commentstreams-buttontooltip-moderator-delete' ),
@@ -553,10 +553,7 @@ var commentstreams_controller = ( function( mw, $ ) {
var self = this;
var upButton;
- if ( mw.user.isAnon() ) {
- upButton = $( '<span>' )
- .addClass( 'cs-button' );
- } else {
+ if ( this.isLoggedIn ) {
upButton = $( '<button>' )
.addClass( 'cs-button' )
.addClass( 'cs-vote-button' )
@@ -564,6 +561,9 @@ var commentstreams_controller = ( function( mw, $ ) {
self.vote( $( this ), commentData.pageid, true,
commentData.created_timestamp );
} );
+ } else {
+ upButton = $( '<span>' )
+ .addClass( 'cs-button' );
}
var upimage = $( '<img>' )
.attr( 'title', mw.message( 'commentstreams-buttontooltip-upvote' ) )
@@ -581,10 +581,7 @@ var commentstreams_controller = ( function( mw, $ ) {
upButton.append( upcountspan );
var downButton;
- if ( mw.user.isAnon() ) {
- downButton = $( '<span>' )
- .addClass( 'cs-button' );
- } else {
+ if ( this.isLoggedIn ) {
downButton = $( '<button>' )
.addClass( 'cs-button' )
.addClass( 'cs-vote-button' )
@@ -592,6 +589,9 @@ var commentstreams_controller = ( function( mw, $ ) {
self.vote( $( this ), commentData.pageid, false,
commentData.created_timestamp );
} );
+ } else {
+ downButton = $( '<span>' )
+ .addClass( 'cs-button' );
}
var downimage = $( '<img>' )
.attr( 'title', mw.message( 'commentstreams-buttontooltip-downvote' ) )
@@ -1392,7 +1392,7 @@ var commentstreams_controller = ( function( mw, $ ) {
},
canEdit: function( comment ) {
var username = comment.username;
- if ( !mw.user.isAnon() && ( mw.user.getName() === username ||
+ if ( this.isLoggedIn && ( mw.config.get( 'wgUserName' ) === username ||
this.moderatorEdit ) ) {
return true;
}
@@ -1400,8 +1400,8 @@ var commentstreams_controller = ( function( mw, $ ) {
},
canDelete: function( comment ) {
var username = comment.username;
- if ( !mw.user.isAnon() &&
- ( mw.user.getName() === username || this.moderatorDelete ) &&
+ if ( this.isLoggedIn && ( mw.config.get( 'wgUserName' ) === username ||
+ this.moderatorDelete ) &&
( comment.numreplies === 0 || this.moderatorFastDelete ) ) {
return true;
}
diff --git a/CommentStreams/resources/CommentStreamsQuerier.js b/CommentStreams/resources/CommentStreamsQuerier.js
index b124656a..84d92403 100644
--- a/CommentStreams/resources/CommentStreamsQuerier.js
+++ b/CommentStreams/resources/CommentStreamsQuerier.js
@@ -42,7 +42,7 @@ var commentstreams_querier = ( function( mw ) {
api.post( {
action: 'csDeleteComment',
pageid: pageid,
- token: mw.user.tokens.get( 'editToken' )
+ token: mw.user.tokens.get( 'csrfToken' )
} )
.done( function( data ) {
reply( data );
@@ -59,7 +59,7 @@ var commentstreams_querier = ( function( mw ) {
action: 'csPostComment',
wikitext: wikitext,
associatedid: associatedid,
- token: mw.user.tokens.get( 'editToken' )
+ token: mw.user.tokens.get( 'csrfToken' )
};
if ( commenttitle !== null ) {
data.commenttitle = commenttitle;
@@ -85,7 +85,7 @@ var commentstreams_querier = ( function( mw ) {
pageid: pageid,
commenttitle: commenttitle,
wikitext: wikitext,
- token: mw.user.tokens.get( 'editToken' )
+ token: mw.user.tokens.get( 'csrfToken' )
} )
.done( function( data ) {
reply( data.csEditComment );
@@ -101,7 +101,7 @@ var commentstreams_querier = ( function( mw ) {
action: 'csVote',
pageid: pageid,
vote: vote,
- token: mw.user.tokens.get( 'editToken' )
+ token: mw.user.tokens.get( 'csrfToken' )
} )
.done( function( data ) {
reply( data.csVote );
@@ -116,7 +116,7 @@ var commentstreams_querier = ( function( mw ) {
api.post( {
action: action ? 'csWatch' : 'csUnwatch',
pageid: pageid,
- token: mw.user.tokens.get( 'editToken' )
+ token: mw.user.tokens.get( 'csrfToken' )
} )
.done( function( data ) {
if ( action ) {