diff --git a/.github/workflows/release-and-submit.yml b/.github/workflows/release-and-submit.yml index 99ba90db..1870b0ed 100644 --- a/.github/workflows/release-and-submit.yml +++ b/.github/workflows/release-and-submit.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b576897..23ee9680 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: @@ -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) diff --git a/includes/Constants.php b/includes/Constants.php index abdddd97..96f16dcb 100644 --- a/includes/Constants.php +++ b/includes/Constants.php @@ -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'; diff --git a/includes/HookHandler/DefaultHooks.php b/includes/HookHandler/DefaultHooks.php index b43d6430..e2bbb07a 100644 --- a/includes/HookHandler/DefaultHooks.php +++ b/includes/HookHandler/DefaultHooks.php @@ -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']; - } - } } /** diff --git a/includes/SkinFemiwiki.php b/includes/SkinFemiwiki.php index 77f0a599..02fa6c06 100644 --- a/includes/SkinFemiwiki.php +++ b/includes/SkinFemiwiki.php @@ -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, @@ -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; - } } diff --git a/includes/templates/skin.mustache b/includes/templates/skin.mustache index 6064fa5d..5539c52c 100644 --- a/includes/templates/skin.mustache +++ b/includes/templates/skin.mustache @@ -17,7 +17,3 @@ {{/data-portlets.data-languages}} {{>Footer}} - -{{#text-add-this-pub-id}} - -{{/text-add-this-pub-id}} diff --git a/resources/skins.femiwiki.share.ui/mw.fw.ShareDialog.js b/resources/skins.femiwiki.share.ui/mw.fw.ShareDialog.js index f98ad56b..6b7ff16e 100644 --- a/resources/skins.femiwiki.share.ui/mw.fw.ShareDialog.js +++ b/resources/skins.femiwiki.share.ui/mw.fw.ShareDialog.js @@ -8,8 +8,6 @@ // Configuration initialization config = config || {}; - this.useAddThis = config.useAddThis; - this.addThisToolId = config.addThisToolId; this.firebaseKey = config.firebaseKey; // Parent constructor @@ -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({ @@ -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); }; @@ -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) { diff --git a/resources/skins.femiwiki.share/init.js b/resources/skins.femiwiki.share/init.js index a1e60b05..4fb83e4a 100644 --- a/resources/skins.femiwiki.share/init.js +++ b/resources/skins.femiwiki.share/init.js @@ -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', - }, - ], }); - }); + } }); } diff --git a/resources/skins.femiwiki/interface.less b/resources/skins.femiwiki/interface.less index 6c14a964..f38066c8 100644 --- a/resources/skins.femiwiki/interface.less +++ b/resources/skins.femiwiki/interface.less @@ -151,6 +151,11 @@ p { margin: 0; } + + hr { + border-top: 1px solid #aca8e088; + margin: 1em; + } } .mw-portlet-namespaces { diff --git a/resources/variables.less b/resources/variables.less index 88f2cf76..8b6dfa32 100644 --- a/resources/variables.less +++ b/resources/variables.less @@ -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; @@ -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; @@ -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; } } diff --git a/skin.json b/skin.json index 2558c86b..ac4a668b 100644 --- a/skin.json +++ b/skin.json @@ -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", @@ -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."