Kaldari has uploaded a new change for review.
https://gerrit.wikimedia.org/r/180696
Change subject: Revert "Load correct page actions images"
......................................................................
Revert "Load correct page actions images"
This causes the edit button to remain completely hidden if the user is
blocked or anonymous editing is enabled but an anonymous user doesn't
have permission to edit the page. The edit button must always be shown
(either enabled or disabled).
This reverts commit 65cc96f0dcb32c6911e6a9375bca1a47d346447a.
Change-Id: I359eaa45d82193ac3133daa425d83c3e4b0c1fea
(cherry picked from commit c9d4d2c50a9e970d60b93707718639eac7df8392)
---
M includes/skins/SkinMinerva.php
M javascripts/modules/editor/init.js
M javascripts/modules/uploads/PhotoUploaderButton.js
M javascripts/modules/watchstar/Watchstar.js
4 files changed, 10 insertions(+), 15 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/96/180696/1
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 693ce8b..9f6849a 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -778,7 +778,7 @@
if ( $this->isAllowedPageAction( 'edit' ) ) {
$menu['edit'] = array( 'id' => 'ca-edit', 'text' => '',
'itemtitle' => $this->msg(
'mobile-frontend-pageaction-edit-tooltip' ),
- 'class' => MobileUI::iconClass( 'edit',
'element', 'icon-32px hidden' ),
+ 'class' => MobileUI::iconClass( 'edit',
'element', 'icon-32px' ),
);
}
@@ -789,15 +789,14 @@
) {
$menu['photo'] = array( 'id' => 'ca-upload', 'text' =>
'',
'itemtitle' => $this->msg(
'mobile-frontend-pageaction-upload-tooltip' ),
- 'class' => MobileUI::iconClass( 'addimage',
'element', 'icon-32px hidden' ),
+ 'class' => MobileUI::iconClass( 'addimage',
'element', 'icon-32px' ),
);
}
if ( $this->isAllowedPageAction( 'watch' ) ) {
$watchTemplate = array(
'id' => 'ca-watch',
- 'class' => MobileUI::iconClass( 'watch',
'element',
- 'icon-32px watch-this-article hidden' ),
+ 'class' => MobileUI::iconClass( 'watch',
'element', 'icon-32px watch-this-article' ),
);
// standardise watch article into one menu item
if ( isset( $actions['watch'] ) ) {
diff --git a/javascripts/modules/editor/init.js
b/javascripts/modules/editor/init.js
index 18642e2..f80d572 100644
--- a/javascripts/modules/editor/init.js
+++ b/javascripts/modules/editor/init.js
@@ -33,8 +33,7 @@
returntoquery: 'article_action=signup-edit'
},
content: mw.msg( 'mobile-frontend-editor-cta' )
- } ),
- $caEdit = $( '#ca-edit' );
+ } );
if ( pendingToast ) {
// delete the pending toast
@@ -155,10 +154,10 @@
return result;
} );
- $caEdit.addClass( enabledClass ).removeClass( disabledClass
).removeClass( 'hidden' );
+ $( '#ca-edit' ).addClass( enabledClass ).removeClass(
disabledClass );
// Make sure we never create two edit links by accident
- if ( $caEdit.find( '.edit-page' ).length === 0 ) {
+ if ( $( '#ca-edit .edit-page' ).length === 0 ) {
// FIXME: unfortunately the main page is special cased.
if ( mw.config.get( 'wgIsMainPage' ) || isNewPage ||
page.getLeadSectionElement().text() ) {
// if lead section is not empty, open editor
with lead section
@@ -193,10 +192,9 @@
// Initialize edit button links (to show Cta) only, if page is
editable, otherwise show an error toast
M.getCurrentPage().isEditable( user ).done( function (
isEditable ) {
if ( isEditable ) {
- $caEdit
- .addClass( enabledClass ).removeClass(
disabledClass ).removeClass( 'hidden' );
+ $( '#ca-edit' ).addClass( enabledClass
).removeClass( disabledClass );
// Init lead section edit button
- makeCta( $caEdit, 0 );
+ makeCta( $( '#ca-edit' ), 0 );
// Init all edit links (including lead section,
if anonymous editing is enabled)
$( '.edit-page' ).each( function () {
diff --git a/javascripts/modules/uploads/PhotoUploaderButton.js
b/javascripts/modules/uploads/PhotoUploaderButton.js
index 97536c6..a4db3be 100644
--- a/javascripts/modules/uploads/PhotoUploaderButton.js
+++ b/javascripts/modules/uploads/PhotoUploaderButton.js
@@ -58,8 +58,6 @@
var self = this,
$input = this.$( 'input' );
- self.$el.removeClass( 'hidden' );
-
function handleFile( file ) {
// FIXME: this is hacky but it would be hard to
pass a file in a route
M.emit( '_upload-preview', file );
diff --git a/javascripts/modules/watchstar/Watchstar.js
b/javascripts/modules/watchstar/Watchstar.js
index 8125313..7f3fc42 100644
--- a/javascripts/modules/watchstar/Watchstar.js
+++ b/javascripts/modules/watchstar/Watchstar.js
@@ -122,9 +122,9 @@
// Add watched class if necessary
if ( !user.isAnon() && api.isWatchedPage( page ) ) {
- $el.addClass( watchedClass ).removeClass(
unwatchedClass ).removeClass( 'hidden' );
+ $el.addClass( watchedClass ).removeClass(
unwatchedClass );
} else {
- $el.addClass( unwatchedClass ).removeClass(
watchedClass ).removeClass( 'hidden' );
+ $el.addClass( unwatchedClass ).removeClass(
watchedClass );
}
}
} );
--
To view, visit https://gerrit.wikimedia.org/r/180696
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I359eaa45d82193ac3133daa425d83c3e4b0c1fea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: wmf/1.25wmf13
Gerrit-Owner: Kaldari <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits