mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-09-24 10:48:29 +00:00
Merge "Remove fancy block info popups (move to MobileFrontend)"
This commit is contained in:
commit
4f907cd148
|
@ -5,7 +5,6 @@
|
||||||
"minerva-last-modified-date": "Last edited on $1, at $2",
|
"minerva-last-modified-date": "Last edited on $1, at $2",
|
||||||
"minerva-talk-add-topic": "Add discussion",
|
"minerva-talk-add-topic": "Add discussion",
|
||||||
"mobile-frontend-cookies-required": "Cookies are required to switch view modes. Please enable them and try again.",
|
"mobile-frontend-cookies-required": "Cookies are required to switch view modes. Please enable them and try again.",
|
||||||
"mobile-frontend-editor-blocked-info-loggedin": "Your account is blocked from editing. The block was made by {{GENDER:$2|$2}} for the following reason: $1",
|
|
||||||
"mobile-frontend-editor-cta": "Help improve this page!",
|
"mobile-frontend-editor-cta": "Help improve this page!",
|
||||||
"minerva-pointer-dismiss": "Dismiss",
|
"minerva-pointer-dismiss": "Dismiss",
|
||||||
"mobile-frontend-editor-disabled": "This page is protected to prevent vandalism.",
|
"mobile-frontend-editor-disabled": "This page is protected to prevent vandalism.",
|
||||||
|
@ -61,9 +60,5 @@
|
||||||
"skin-minerva-mobile-option-MinervaShowCategoriesButton": "Categories",
|
"skin-minerva-mobile-option-MinervaShowCategoriesButton": "Categories",
|
||||||
"skin-minerva-mobile-option-MinervaShowCategoriesButton-description": "View categories of pages",
|
"skin-minerva-mobile-option-MinervaShowCategoriesButton-description": "View categories of pages",
|
||||||
"skin-minerva-mobile-option-MinervaEnableBackToTop": "Jump to top",
|
"skin-minerva-mobile-option-MinervaEnableBackToTop": "Jump to top",
|
||||||
"skin-minerva-mobile-option-MinervaEnableBackToTop-description": "Jump to top of the current page using a floating button",
|
"skin-minerva-mobile-option-MinervaEnableBackToTop-description": "Jump to top of the current page using a floating button"
|
||||||
"skin-minerva-blocked-drawer-title": "Your account has been blocked from editing {{SITENAME}}",
|
|
||||||
"skin-minerva-blocked-drawer-reason-header": "Reason for the block",
|
|
||||||
"skin-minerva-blocked-drawer-creator-header": "{{GENDER:$1|Blocked}} by",
|
|
||||||
"skin-minerva-blocked-drawer-expiry-header": "Block will expire in"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
"minerva-last-modified-date": "Text that displays the date the page was last modified. Parameters:\n* $1 - date\n* $2 - time\n{{Related|Mobile-frontend-last-modified}}",
|
"minerva-last-modified-date": "Text that displays the date the page was last modified. Parameters:\n* $1 - date\n* $2 - time\n{{Related|Mobile-frontend-last-modified}}",
|
||||||
"minerva-talk-add-topic": "Label for button which shows at bottom of talk pages in mobile view prompting addition of topic",
|
"minerva-talk-add-topic": "Label for button which shows at bottom of talk pages in mobile view prompting addition of topic",
|
||||||
"mobile-frontend-cookies-required": "Error message shown when user attempts to switch site modes and cookies are not enabled.",
|
"mobile-frontend-cookies-required": "Error message shown when user attempts to switch site modes and cookies are not enabled.",
|
||||||
"mobile-frontend-editor-blocked-info-loggedin": "Toast message for logged in users that appears (before the user see the editor) when a user tries to edit a page, but is blocked from editing with reason and blocked by information.\n\nParameters:\n* $1 - blocked by information (Username of the user who crated this block)\n* $2 - Reason for this block, if any",
|
|
||||||
"mobile-frontend-editor-cta": "Caption for call to action when an anonymous user clicks on edit icon. (Note the mobile site currently doesn't allow anonymous editing.)\n{{Identical|Help improve this page}}",
|
"mobile-frontend-editor-cta": "Caption for call to action when an anonymous user clicks on edit icon. (Note the mobile site currently doesn't allow anonymous editing.)\n{{Identical|Help improve this page}}",
|
||||||
"minerva-pointer-dismiss": "Label of button that dismisses overlay pointing at a particular new feature.",
|
"minerva-pointer-dismiss": "Label of button that dismisses overlay pointing at a particular new feature.",
|
||||||
"mobile-frontend-editor-disabled": "Toast message that appears when a user is unable to edit a page and clicks edit icon.",
|
"mobile-frontend-editor-disabled": "Toast message that appears when a user is unable to edit a page and clicks edit icon.",
|
||||||
|
@ -70,9 +69,5 @@
|
||||||
"skin-minerva-mobile-option-MinervaShowCategoriesButton": "Label for categories mobile web beta feature.\n{{Identical|Category}}",
|
"skin-minerva-mobile-option-MinervaShowCategoriesButton": "Label for categories mobile web beta feature.\n{{Identical|Category}}",
|
||||||
"skin-minerva-mobile-option-MinervaShowCategoriesButton-description": "Description label for categories mobile web beta feature.",
|
"skin-minerva-mobile-option-MinervaShowCategoriesButton-description": "Description label for categories mobile web beta feature.",
|
||||||
"skin-minerva-mobile-option-MinervaEnableBackToTop": "Label for jump to top mobile web beta feature",
|
"skin-minerva-mobile-option-MinervaEnableBackToTop": "Label for jump to top mobile web beta feature",
|
||||||
"skin-minerva-mobile-option-MinervaEnableBackToTop-description": "Description label for jump to top mobile web beta feature",
|
"skin-minerva-mobile-option-MinervaEnableBackToTop-description": "Description label for jump to top mobile web beta feature"
|
||||||
"skin-minerva-blocked-drawer-title": "Title for the drawer that appears when a blocked user attempts to edit.",
|
|
||||||
"skin-minerva-blocked-drawer-reason-header": "Header for the block reason message that appears when a blocked user attempts to edit.",
|
|
||||||
"skin-minerva-blocked-drawer-creator-header": "Header for the block creator that appears when a blocked user attempts to edit. \nParameters:\n* $1 - user's gender",
|
|
||||||
"skin-minerva-blocked-drawer-expiry-header": "Header for the block expiry that appears when a blocked user attempts to edit."
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1272,45 +1272,7 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin {
|
||||||
];
|
];
|
||||||
|
|
||||||
if ( $this->isAuthenticatedUser() ) {
|
if ( $this->isAuthenticatedUser() ) {
|
||||||
$blockInfo = false;
|
$vars['wgMinervaUserBlockInfo'] = $user->isBlockedFrom( $title, true );
|
||||||
if ( $user->isBlockedFrom( $title, true ) ) {
|
|
||||||
$block = $user->getBlock();
|
|
||||||
|
|
||||||
$blockReason = $block->mReason ?
|
|
||||||
Linker::formatComment( $block->mReason ) :
|
|
||||||
false;
|
|
||||||
|
|
||||||
$blockCreator = User::newFromName( $block->getByName() );
|
|
||||||
|
|
||||||
$blockExpiry = null;
|
|
||||||
$blockDuration = null;
|
|
||||||
if ( !wfIsInfinity( $block->getExpiry() ) ) {
|
|
||||||
$blockExpiry = $this->getLanguage()->translateBlockExpiry(
|
|
||||||
$block->getExpiry(),
|
|
||||||
$this->getUser(),
|
|
||||||
time()
|
|
||||||
);
|
|
||||||
// Use the largest unit returned from Language::formatDuraiton() since
|
|
||||||
// we do not need to display the level of percision that the method
|
|
||||||
// returns.
|
|
||||||
list( $blockDuration ) = explode(
|
|
||||||
', ',
|
|
||||||
$this->getLanguage()->formatDuration( wfTimestamp( TS_UNIX, $block->getExpiry() ) - time() )
|
|
||||||
);
|
|
||||||
}
|
|
||||||
$blockInfo = [
|
|
||||||
'creator' => [
|
|
||||||
'name' => $blockCreator->getName(),
|
|
||||||
'url' => $blockCreator->getUserPage()->getLinkURL(),
|
|
||||||
'gender' => $blockCreator->getOption( 'gender' ),
|
|
||||||
],
|
|
||||||
'expiry' => $blockExpiry,
|
|
||||||
'duration' => $blockDuration,
|
|
||||||
// check, if a reason for this block is saved, otherwise use "no reason given" msg
|
|
||||||
'reason' => $blockReason,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
$vars['wgMinervaUserBlockInfo'] = $blockInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $vars;
|
return $vars;
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
{{#collapseIcon}}{{>icon}}{{/collapseIcon}}
|
|
||||||
<div class="block-message">
|
|
||||||
<div class="block-message-icon">
|
|
||||||
{{#stopHandIcon}}{{>icon}}{{/stopHandIcon}}
|
|
||||||
</div>
|
|
||||||
<div class="block-message-info">
|
|
||||||
<div class="block-message-item block-message-title">
|
|
||||||
<h5>{{ title }}</h5>
|
|
||||||
</div>
|
|
||||||
<div class="block-message-data">
|
|
||||||
{{#reason}}
|
|
||||||
<div class="block-message-item">
|
|
||||||
<h6>{{ reasonHeader }}</h6>
|
|
||||||
<div><strong>{{{ reason }}}</strong></div>
|
|
||||||
</div>
|
|
||||||
{{/reason}}
|
|
||||||
<div class="block-message-item block-message-creator">
|
|
||||||
<h6>{{ creatorHeader }}</h6>
|
|
||||||
<div><strong><a href="{{ creator.url }}">{{#userIcon}}{{>icon}}{{/userIcon}}{{ creator.name }}</a></strong></div>
|
|
||||||
</div>
|
|
||||||
{{#expiry}}
|
|
||||||
<div class="block-message-item">
|
|
||||||
<h6>{{ expiryHeader }}</h6>
|
|
||||||
<div><strong>{{#duration}}{{ duration }} / {{/duration}}{{ expiry }}</strong></div>
|
|
||||||
</div>
|
|
||||||
{{/expiry}}
|
|
||||||
</div>
|
|
||||||
{{#okButton}}
|
|
||||||
<div class="block-message-item block-message-buttons">
|
|
||||||
{{>button}}
|
|
||||||
</div>
|
|
||||||
{{/okButton}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -1,53 +0,0 @@
|
||||||
( function ( M ) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var Drawer = M.require( 'mobile.startup/Drawer' ),
|
|
||||||
Button = M.require( 'mobile.startup/Button' ),
|
|
||||||
Icon = M.require( 'mobile.startup/Icon' ),
|
|
||||||
util = M.require( 'mobile.startup/util' );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This creates the drawer at the bottom of the screen that appears when a
|
|
||||||
* blocked user tries to edit.
|
|
||||||
* @class BlockReason
|
|
||||||
* @extends Drawer
|
|
||||||
*/
|
|
||||||
function BlockMessage() {
|
|
||||||
Drawer.apply( this, arguments );
|
|
||||||
}
|
|
||||||
|
|
||||||
OO.mfExtend( BlockMessage, Drawer, {
|
|
||||||
defaults: util.extend( {}, Drawer.prototype.defaults, {
|
|
||||||
stopHandIcon: new Icon( {
|
|
||||||
glyphPrefix: 'minerva',
|
|
||||||
name: 'stop-hand'
|
|
||||||
} ).options,
|
|
||||||
userIcon: new Icon( {
|
|
||||||
tagName: 'span',
|
|
||||||
glyphPrefix: 'minerva',
|
|
||||||
name: 'profile'
|
|
||||||
} ).options,
|
|
||||||
okButton: new Button( {
|
|
||||||
label: mw.msg( 'ok' ),
|
|
||||||
tagName: 'button',
|
|
||||||
progressive: true,
|
|
||||||
additionalClassNames: 'cancel'
|
|
||||||
} ).options,
|
|
||||||
title: mw.msg( 'skin-minerva-blocked-drawer-title' ),
|
|
||||||
reasonHeader: mw.msg( 'skin-minerva-blocked-drawer-reason-header' ),
|
|
||||||
creatorHeader: function () {
|
|
||||||
return mw.msg( 'skin-minerva-blocked-drawer-creator-header',
|
|
||||||
this.creator.gender || 'unknown' );
|
|
||||||
},
|
|
||||||
expiryHeader: mw.msg( 'skin-minerva-blocked-drawer-expiry-header' )
|
|
||||||
} ),
|
|
||||||
templatePartials: util.extend( {}, Drawer.prototype.templatePartials, {
|
|
||||||
button: Button.prototype.template,
|
|
||||||
icon: Icon.prototype.template
|
|
||||||
} ),
|
|
||||||
template: mw.template.get( 'skins.minerva.editor.blockMessage', 'BlockMessage.hogan' )
|
|
||||||
} );
|
|
||||||
|
|
||||||
M.define( 'skins.minerva.editor/BlockMessage', BlockMessage );
|
|
||||||
|
|
||||||
}( mw.mobileFrontend ) );
|
|
|
@ -1,52 +0,0 @@
|
||||||
@import 'mediawiki.ui/variables';
|
|
||||||
|
|
||||||
.block-message {
|
|
||||||
h5 {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
h6 {
|
|
||||||
margin-bottom: 0.187em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.block-message-icon {
|
|
||||||
float: left;
|
|
||||||
width: 20%;
|
|
||||||
margin-top: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.block-message-info {
|
|
||||||
float: left;
|
|
||||||
width: 80%;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.block-message-item {
|
|
||||||
margin-bottom: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.block-message-data {
|
|
||||||
margin-bottom: 1.875em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.block-message-buttons button.cancel {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.block-message-creator {
|
|
||||||
a {
|
|
||||||
color: inherit;
|
|
||||||
&:hover {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.mw-ui-icon {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
margin: 0 -@iconGutterWidth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.block-message-title {
|
|
||||||
color: @colorDestructive;
|
|
||||||
}
|
|
|
@ -10,7 +10,6 @@
|
||||||
Icon = M.require( 'mobile.startup/Icon' ),
|
Icon = M.require( 'mobile.startup/Icon' ),
|
||||||
Button = M.require( 'mobile.startup/Button' ),
|
Button = M.require( 'mobile.startup/Button' ),
|
||||||
Anchor = M.require( 'mobile.startup/Anchor' ),
|
Anchor = M.require( 'mobile.startup/Anchor' ),
|
||||||
BlockMessage = M.require( 'skins.minerva.editor/BlockMessage' ),
|
|
||||||
skin = M.require( 'skins.minerva.scripts/skin' ),
|
skin = M.require( 'skins.minerva.scripts/skin' ),
|
||||||
currentPage = M.getCurrentPage(),
|
currentPage = M.getCurrentPage(),
|
||||||
// TODO: create a utility method to generate class names instead of
|
// TODO: create a utility method to generate class names instead of
|
||||||
|
@ -48,10 +47,8 @@
|
||||||
|
|
||||||
if ( user.isAnon() ) {
|
if ( user.isAnon() ) {
|
||||||
blockInfo = false;
|
blockInfo = false;
|
||||||
} else if ( isEditable ) {
|
|
||||||
// for logged in users check if they are blocked from editing this page
|
|
||||||
isEditable = !blockInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: rename addEditSectionButton and evaluate whether the page edit button
|
// TODO: rename addEditSectionButton and evaluate whether the page edit button
|
||||||
// can leverage the same code. Also: change the CSS class name to use
|
// can leverage the same code. Also: change the CSS class name to use
|
||||||
// the word "section" instead of "page".
|
// the word "section" instead of "page".
|
||||||
|
@ -333,6 +330,10 @@
|
||||||
router.navigate( fragment );
|
router.navigate( fragment );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( blockInfo ) {
|
||||||
|
updateEditPageButton( false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -341,23 +342,12 @@
|
||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
function init() {
|
function init() {
|
||||||
var message;
|
|
||||||
|
|
||||||
if ( isEditable ) {
|
if ( isEditable ) {
|
||||||
// Edit button updated in setupEditor.
|
// Edit button updated in setupEditor.
|
||||||
setupEditor( currentPage );
|
setupEditor( currentPage );
|
||||||
} else {
|
} else {
|
||||||
updateEditPageButton( false );
|
updateEditPageButton( false );
|
||||||
if ( blockInfo ) {
|
showSorryToast( mw.msg( 'mobile-frontend-editor-disabled' ) );
|
||||||
message = new BlockMessage( blockInfo );
|
|
||||||
$( '#ca-edit' ).on( 'click', function ( ev ) {
|
|
||||||
message.toggle();
|
|
||||||
ev.preventDefault();
|
|
||||||
} );
|
|
||||||
$( '.edit-page' ).detach();
|
|
||||||
} else {
|
|
||||||
showSorryToast( mw.msg( 'mobile-frontend-editor-disabled' ) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><title>stop hand</title><path fill="#e03b3b" d="M13.2 11.8c0-.2-.4-.6-.7-.8V1.9c0-.5-.5-.9-1-.9s-.9.4-.9.9v8c-.3 0-.6-.1-.9-.1V1c0-.5-.4-.9-.9-.9s-.9.4-.9.9v8.8H7V1.7c0-.5-.4-.9-.9-.9s-.9.4-.9.9V10c-.3 0-.7.1-.9.1V4.7c0-.5-.3-.9-.7-.9-.4 0-.7.4-.7.9v7.5c0 8.9 5.8 7.7 5.8 7.7 5 0 6.2-6.2 6.2-6.2.2-1.1 2.4-4.2 2.4-4.2-1.9-2.3-4.1 2.3-4.1 2.3"/></svg>
|
|
Before Width: | Height: | Size: 448 B |
32
skin.json
32
skin.json
|
@ -261,8 +261,7 @@
|
||||||
"class": "ResourceLoaderImageModule",
|
"class": "ResourceLoaderImageModule",
|
||||||
"selector": ".mw-ui-icon-minerva-{name}:before",
|
"selector": ".mw-ui-icon-minerva-{name}:before",
|
||||||
"images": {
|
"images": {
|
||||||
"download": "resources/skins.minerva.icons.images.scripts.misc/download.svg",
|
"download": "resources/skins.minerva.icons.images.scripts.misc/download.svg"
|
||||||
"stop-hand": "resources/skins.minerva.icons.images.scripts.misc/stop-hand.svg"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"skins.minerva.icons.page.issues.uncolored": {
|
"skins.minerva.icons.page.issues.uncolored": {
|
||||||
|
@ -501,31 +500,6 @@
|
||||||
"desktop"
|
"desktop"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"skins.minerva.editor.blockMessage": {
|
|
||||||
"dependencies": [
|
|
||||||
"skins.minerva.scripts"
|
|
||||||
],
|
|
||||||
"messages": [
|
|
||||||
"ok",
|
|
||||||
"skin-minerva-blocked-drawer-title",
|
|
||||||
"skin-minerva-blocked-drawer-reason-header",
|
|
||||||
"skin-minerva-blocked-drawer-creator-header",
|
|
||||||
"skin-minerva-blocked-drawer-expiry-header"
|
|
||||||
],
|
|
||||||
"templates": {
|
|
||||||
"BlockMessage.hogan": "resources/skins.minerva.editor/BlockMessage.hogan"
|
|
||||||
},
|
|
||||||
"scripts": [
|
|
||||||
"resources/skins.minerva.editor/BlockMessage.js"
|
|
||||||
],
|
|
||||||
"styles": [
|
|
||||||
"resources/skins.minerva.editor/BlockMessage.less"
|
|
||||||
],
|
|
||||||
"targets": [
|
|
||||||
"mobile",
|
|
||||||
"desktop"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"skins.minerva.editor": {
|
"skins.minerva.editor": {
|
||||||
"targets": [
|
"targets": [
|
||||||
"mobile",
|
"mobile",
|
||||||
|
@ -539,14 +513,12 @@
|
||||||
"mediawiki.ui.input",
|
"mediawiki.ui.input",
|
||||||
"mobile.startup",
|
"mobile.startup",
|
||||||
"skins.minerva.toggling",
|
"skins.minerva.toggling",
|
||||||
"mediawiki.jqueryMsg",
|
"mediawiki.jqueryMsg"
|
||||||
"skins.minerva.editor.blockMessage"
|
|
||||||
],
|
],
|
||||||
"messages": [
|
"messages": [
|
||||||
"mobile-frontend-editor-disabled",
|
"mobile-frontend-editor-disabled",
|
||||||
"mobile-frontend-editor-unavailable",
|
"mobile-frontend-editor-unavailable",
|
||||||
"mobile-frontend-editor-uploadenable",
|
"mobile-frontend-editor-uploadenable",
|
||||||
"mobile-frontend-editor-blocked-info-loggedin",
|
|
||||||
"mobile-frontend-editor-cta",
|
"mobile-frontend-editor-cta",
|
||||||
"mobile-frontend-editor-undo-unsupported",
|
"mobile-frontend-editor-undo-unsupported",
|
||||||
"mobile-frontend-editor-edit",
|
"mobile-frontend-editor-edit",
|
||||||
|
|
Loading…
Reference in a new issue