Skip to content

Commit

Permalink
Release v4.0.0 (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 authored Jul 1, 2023
1 parent 6f0c16a commit e467cde
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-and-submit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Set tag name
id: tag_name
run: echo "::set-output name=tag_name::$(basename ${{ github.ref }})"
run: echo "tag_name=$(basename ${{ github.ref }})" >> $GITHUB_OUTPUT
- name: Build project
run: |
composer update --no-dev
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

Versions and bullets are arranged chronologically from latest to oldest.

## Unreleased version
## v4.0.0

- MediaWiki v1.40 or later is required.
- `$wgFemiwikiFacebookAppId` and `$wgFemiwikiTwitterAccount` configuration variables are removed. If you still need to use this feature, please see [Extension:WikiSEO](https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:WikiSEO).
- The default value of `$wgFemiwikiLegacySmallElementsForAnonymousUser` is now `false`.
- Adding icons to menu items using `[[MediaWiki:skin-femiwiki-xeicon-map.json]]` system message is now not supported. Instead you can add styles in `[[MediaWiki:Common.css]]`. Example:
Expand All @@ -18,6 +19,7 @@ Versions and bullets are arranged chronologically from latest to oldest.

## Previous Releases

- [REL1_39](https://github.com/femiwiki/FemiwikiSkin/blob/REL1_39/CHANGELOG.md)
- [REL1_38](https://github.com/femiwiki/FemiwikiSkin/blob/REL1_38/CHANGELOG.md)
- [REL1_37](https://github.com/femiwiki/FemiwikiSkin/blob/REL1_37/CHANGELOG.md)
- [REL1_36](https://github.com/femiwiki/FemiwikiSkin/blob/REL1_36/CHANGELOG.md)
Expand Down
2 changes: 0 additions & 2 deletions includes/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ final class Constants {
/** @var string */
public const CONFIG_ADD_LINK_CLASS = 'FemiwikiAddLinkClass';
/** @var string */
public const CONFIG_ADD_THIS_ID = 'FemiwikiAddThisId';
/** @var string */
public const CONFIG_FIREBASE_KEY = 'FemiwikiFirebaseKey';
/** @var string */
public const CONFIG_HEAD_ITEMS = 'FemiwikiHeadItems';
Expand Down
7 changes: 0 additions & 7 deletions includes/HookHandler/DefaultHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,8 @@ public function __construct( ConfigFactory $configFactory ) {
*/
public function onResourceLoaderGetConfigVars( array &$vars, $skin, Config $config ): void {
$firebaseKey = $config->get( Constants::CONFIG_FIREBASE_KEY );
$addThisId = $config->get( Constants::CONFIG_ADD_THIS_ID );

$vars['wgFemiwikiFirebaseKey'] = $firebaseKey;
if ( $addThisId ) {
$vars['wgFemiwikiUseAddThis'] = true;
if ( is_array( $addThisId ) && isset( $addThisId['tool'] ) ) {
$vars['wgFemiwikiAddThisToolId'] = $addThisId['tool'];
}
}
}

/**
Expand Down
12 changes: 0 additions & 12 deletions includes/SkinFemiwiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public function getTemplateData(): array {
'html-share-button' => $this->getShare(),
'data-toolbox' => $toolbox,
'html-lastmod' => $this->extractLastmod( $parentData ),
'text-add-this-pub-id' => $this->getAddThisPubId(),
'has-footer-icons' => $config->get( Constants::CONFIG_KEY_SHOW_FOOTER_ICONS ),
'has-indicator' => count( $parentData['array-indicators'] ) !== 0,

Expand Down Expand Up @@ -180,15 +179,4 @@ public function initPage( OutputPage $out ) {
$out->enableOOUI();
parent::initPage( $out );
}

private function getAddThisPubId(): ?string {
$config = $this->getConfig()->get( Constants::CONFIG_ADD_THIS_ID );
if ( !$config ) {
return null;
}
if ( is_array( $config ) ) {
return $config['pub'] ?? null;
}
return $config;
}
}
4 changes: 0 additions & 4 deletions includes/templates/skin.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@
{{/data-portlets.data-languages}}

{{>Footer}}

{{#text-add-this-pub-id}}
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid={{text-add-this-pub-id}}"></script>
{{/text-add-this-pub-id}}
66 changes: 22 additions & 44 deletions resources/skins.femiwiki.share.ui/mw.fw.ShareDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// Configuration initialization
config = config || {};

this.useAddThis = config.useAddThis;
this.addThisToolId = config.addThisToolId;
this.firebaseKey = config.firebaseKey;

// Parent constructor
Expand All @@ -32,29 +30,17 @@
this.$element.addClass('mw-fw-ui-shareDialog');

// Make SNS Buttons
if (this.useAddThis) {
// AddThis
this.$addThis = document.createElement('div');
this.$addThis.classList.add('addthis_inline_share_toolbox');
if (this.addThisToolId) {
this.$addThis.classList.add(
'addthis_inline_share_toolbox_' + this.addThisToolId
);
}
addthis.layers.refresh();
} else {
var items = [];
this.twitterButton = new OO.ui.ButtonWidget({
framed: false,
icon: 'newWindow',
label: mw.msg('skin-femiwiki-share-twitter'),
});
items.push(this.twitterButton);
this.twitterButton.$element.addClass('mw-fw-ui-twitterButton');
this.mediaButtonGroup = new OO.ui.ButtonGroupWidget({
items: items,
});
}
var items = [];
this.twitterButton = new OO.ui.ButtonWidget({
framed: false,
icon: 'newWindow',
label: mw.msg('skin-femiwiki-share-twitter'),
});
items.push(this.twitterButton);
this.twitterButton.$element.addClass('mw-fw-ui-twitterButton');
this.mediaButtonGroup = new OO.ui.ButtonGroupWidget({
items: items,
});

// Create a TextForm to copy
this.urlWidget = new OO.ui.TextInputWidget({
Expand All @@ -69,11 +55,7 @@
});

// Append elements
if (this.useAddThis) {
this.content.$element.append(this.$addThis);
} else {
this.content.$element.append(this.mediaButtonGroup.$element);
}
this.content.$element.append(this.mediaButtonGroup.$element);
this.content.$element.append(this.urlWidget.$element);
this.$body.append(this.content.$element);
};
Expand Down Expand Up @@ -106,20 +88,16 @@
mw.fw.ShareDialog.prototype.updateUrl = function (url) {
this.urlWidget.setValue(url);

if (this.useAddThis) {
addthis.layers.refresh(url);
} else {
var tweet =
mw.config.get('wgPageName').replace(/_/g, ' ') +
' ' +
url +
' #' +
mw.config.get('wgSiteName');

this.twitterButton.setHref(
'https://twitter.com/intent/tweet?text=' + encodeURIComponent(tweet)
);
}
var tweet =
mw.config.get('wgPageName').replace(/_/g, ' ') +
' ' +
url +
' #' +
mw.config.get('wgSiteName');

this.twitterButton.setHref(
'https://twitter.com/intent/tweet?text=' + encodeURIComponent(tweet)
);
};

mw.fw.ShareDialog.prototype.createShortUrl = function (url) {
Expand Down
65 changes: 26 additions & 39 deletions resources/skins.femiwiki.share/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,36 @@

function init() {
OO.ui.infuse($('#p-share')).on('click', function () {
var windowManager, shareDialog;
var firebaseKey = firebaseKey || mw.config.get('wgFemiwikiFirebaseKey');
var useAddThis = useAddThis || mw.config.get('wgFemiwikiUseAddThis');
var addThisToolId =
addThisToolId || mw.config.get('wgFemiwikiAddThisToolId');
if (navigator.share) {
navigator.share({
url: window.location.href,
title: mw.config.get('wgPageName').replace(/_/g, ' '),
});
} else {
var windowManager, shareDialog;
var firebaseKey = firebaseKey || mw.config.get('wgFemiwikiFirebaseKey');

if (useAddThis) {
addthis_config = addthis_config || {};
addthis_config['services_exclude'] = 'print';
addthis_config['ui_language'] = mw.config.get('wgUserLanguage');
addthis_share = addthis_share || {};
addthis_share = {
passthrough: {
twitter: {
text: mw.config.get('wgPageName').replace(/_/g, ' '),
hashtags: mw.config.get('wgSiteName'),
},
},
};
}
mw.loader.using(['skins.femiwiki.share.ui']).done(function () {
windowManager = windowManager || OO.ui.getWindowManager();
if (shareDialog === undefined) {
shareDialog = new mw.fw.ShareDialog({
firebaseKey: firebaseKey,
});
windowManager.addWindows([shareDialog]);
}

mw.loader.using(['skins.femiwiki.share.ui']).done(function () {
windowManager = windowManager || OO.ui.getWindowManager();
if (shareDialog === undefined) {
shareDialog = new mw.fw.ShareDialog({
useAddThis: useAddThis,
addThisToolId: addThisToolId,
firebaseKey: firebaseKey,
windowManager.openWindow(shareDialog, {
url: window.location.href,
actions: [
{
action: 'accept',
label: mw.msg('skin-femiwiki-share-dismiss'),
flags: 'primary',
},
],
});
windowManager.addWindows([shareDialog]);
}

windowManager.openWindow(shareDialog, {
url: window.location.href,
actions: [
{
action: 'accept',
label: mw.msg('skin-femiwiki-share-dismiss'),
flags: 'primary',
},
],
});
});
}
});
}

Expand Down
5 changes: 5 additions & 0 deletions resources/skins.femiwiki/interface.less
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@
p {
margin: 0;
}

hr {
border-top: 1px solid #aca8e088;
margin: 1em;
}
}

.mw-portlet-namespaces {
Expand Down
10 changes: 5 additions & 5 deletions resources/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@
figure[typeof~='mw:Image/Thumb'] {
font-size: 0.94rem;
max-width: 100%;
background-color: #f8f9fa;
border: 1px solid #c8ccd1;
background: none;
border: none;
overflow: hidden;
padding: 3px;
text-align: center;
Expand All @@ -600,8 +600,8 @@
}

.thumbimage {
background-color: #fff;
border: 1px solid #c8ccd1;
background: none;
border: none;
vertical-align: middle;
@media screen and (max-width: @width-breakpoint-mobile) {
border: none;
Expand All @@ -614,8 +614,8 @@
padding: 3px;
font-size: 0.8836rem;
line-height: 1.23704rem;
color: #888;
@media screen and (max-width: @width-breakpoint-mobile) {
color: #888;
text-align: center;
}
}
Expand Down
8 changes: 2 additions & 6 deletions skin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"namemsg": "skinname-femiwiki",
"type": "skin",
"author": "[https://femiwiki.com/ Femiwiki Team]",
"version": "1.3.0",
"version": "4.0.0",
"url": "https://github.com/femiwiki/FemiwikiSkin",
"descriptionmsg": "femiwiki-desc",
"license-name": "AGPL-3.0-or-later",
"requires": {
"MediaWiki": ">= 1.37.0"
"MediaWiki": ">= 1.40.0"
},
"ResourceFileModulePaths": {
"localBasePath": "resources",
Expand Down Expand Up @@ -228,10 +228,6 @@
"value": false,
"description": "@var array Additional head items used as parameter for OutputPage::addHeadItems()."
},
"FemiwikiAddThisId": {
"value": false,
"description": "@var array with keys,'pub': An AddThis profile ID., 'tool': An toolbox id. See https://www.addthis.com/academy/how-to-install-addthis-code/."
},
"FemiwikiUsePageLangForHeading": {
"value": true,
"description": "@var boolean Use the page language for the page heading. See https://phabricator.wikimedia.org/T36514 for further problems."
Expand Down

0 comments on commit e467cde

Please sign in to comment.