[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Preferences tabs should be horizontally scrollable
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/406124 ) Change subject: Preferences tabs should be horizontally scrollable .. Preferences tabs should be horizontally scrollable Change-Id: I6766b4ef5a99c66ebb54079b07739315294c86a7 --- M skinStyles/mediawiki.special.preferences.styles/styles.less 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/24/406124/1 diff --git a/skinStyles/mediawiki.special.preferences.styles/styles.less b/skinStyles/mediawiki.special.preferences.styles/styles.less index 7e5599b..a4838f9 100644 --- a/skinStyles/mediawiki.special.preferences.styles/styles.less +++ b/skinStyles/mediawiki.special.preferences.styles/styles.less @@ -3,6 +3,11 @@ // FIXME: All this code can be removed when T117781/T171238 is resolved. #preftoc { text-align: center; + // Horizontal scrolling + overflow-x: scroll; + overflow-y: hidden; + white-space: nowrap; + padding: 0; li { display: inline-block; -- To view, visit https://gerrit.wikimedia.org/r/406124 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6766b4ef5a99c66ebb54079b07739315294c86a7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove MobilePreferences in favor of core
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/406123 ) Change subject: Remove MobilePreferences in favor of core .. Remove MobilePreferences in favor of core Change-Id: I01a377494d77d39c5a620907dd22cec888a6f7b8 Depends-On: I6766b4ef5a99c66ebb54079b07739315294c86a7 Depends-On: Idbf62486c787179ee67deb22e4644f4fc742d9db --- M extension.json M includes/MobileFrontend.hooks.php D includes/specials/SpecialMobilePreferences.php 3 files changed, 0 insertions(+), 110 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/23/406123/1 diff --git a/extension.json b/extension.json index d45c9f3..b65224b 100644 --- a/extension.json +++ b/extension.json @@ -76,7 +76,6 @@ "SpecialNearby": "includes/specials/SpecialNearby.php", "SpecialMobileLanguages": "includes/specials/SpecialMobileLanguages.php", "SpecialMobileCite": "includes/specials/SpecialMobileCite.php", - "SpecialMobilePreferences": "includes/specials/SpecialMobilePreferences.php", "MobileSpecialPage": "includes/specials/MobileSpecialPage.php", "MobileSpecialPageFeed": "includes/specials/MobileSpecialPageFeed.php", "MFResourceLoaderParsedMessageModule": "includes/modules/MFResourceLoaderParsedMessageModule.php", diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index 457ca02..a4604ec 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -488,7 +488,6 @@ // Replace the standard watchlist view with our custom one $list['Watchlist'] = 'SpecialMobileWatchlist'; $list['EditWatchlist'] = 'SpecialMobileEditWatchlist'; - $list['Preferences'] = 'SpecialMobilePreferences'; /* Special:MobileContributions redefines Special:History in * such a way that for Special:Contributions/Foo, Foo is a diff --git a/includes/specials/SpecialMobilePreferences.php b/includes/specials/SpecialMobilePreferences.php deleted file mode 100644 index 58ea8c0..000 --- a/includes/specials/SpecialMobilePreferences.php +++ /dev/null @@ -1,108 +0,0 @@ -getUser(); - $ctx = $this->getContext(); - - // load any preferences element - $removePrefs = Preferences::getPreferences( $user, $ctx ); - // check, if the element shouldn't be rendered - foreach ( $removePrefs as $formElement => $formDescriptor ) { - if ( - // we render only preferences, which are in a specific section, ... - isset( $formDescriptor['section'] ) && - ( - // ...which is specified by the given $key - $formDescriptor['section'] === $key || - strpos( $formDescriptor['section'], $key ) !== false - ) - ) { - // remove the preferences element from the array of elements, which are removed - unset( $removePrefs[$formElement] ); - } - } - // we need the keys only - $removePrefs = array_keys( $removePrefs ); - - // get the form element (the $removePrefs param specifies, which elements shouldn't be rendered) - $htmlForm = Preferences::getFormObject( $user, $ctx, 'PreferencesForm', $removePrefs ); - $htmlForm->suppressReset(); - $htmlForm->setModifiedUser( $user ); - $htmlForm->setId( 'mw-prefs-form' ); - $htmlForm->setSubmitText( $ctx->msg( 'saveprefs' )->text() ); - $htmlForm->setSubmitCallback( [ 'Preferences', 'tryUISubmit' ] ); - $htmlForm->setAction( SpecialPage::getTitleFor( $this->getName(), $key )->getLocalUrl() ); - return $htmlForm; - } - - /** -* @param string $par Key of section to display -* -* @throws MWException -* @throws ReadOnlyError -* @throws UserNotLoggedIn -*/ - public function execute( $par = '' ) { - $this->setHeaders(); - $this->outputHeader(); - $out = $this->getOutput(); - - // Prevent hijacked user scripts from sniffing passwords etc. - $out->disallowUserJs(); - - $this->requireLogin( 'prefsnologintext2' ); - $this->checkReadOnly(); - - if ( $this->getRequest()->getCheck( 'success' ) ) { - $out->addHtml( MobileUI::successBox( $this->msg(
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Load preferences js/css in mobile
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/406125 ) Change subject: Load preferences js/css in mobile .. Load preferences js/css in mobile Change-Id: Idbf62486c787179ee67deb22e4644f4fc742d9db --- M resources/Resources.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/25/406125/1 diff --git a/resources/Resources.php b/resources/Resources.php index b494429..4405fe0 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -2112,6 +2112,7 @@ 'styles' => 'resources/src/mediawiki.special/mediawiki.special.pagesWithProp.css', ], 'mediawiki.special.preferences' => [ + 'targets' => [ 'desktop', 'mobile' ], 'scripts' => [ 'resources/src/mediawiki.special/mediawiki.special.preferences.confirmClose.js', 'resources/src/mediawiki.special/mediawiki.special.preferences.convertmessagebox.js', @@ -2132,6 +2133,7 @@ ], ], 'mediawiki.special.preferences.styles' => [ + 'targets' => [ 'desktop', 'mobile' ], 'styles' => 'resources/src/mediawiki.special/mediawiki.special.preferences.styles.css', ], 'mediawiki.special.recentchanges' => [ -- To view, visit https://gerrit.wikimedia.org/r/406125 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idbf62486c787179ee67deb22e4644f4fc742d9db Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Always load user styles on mobile user pages
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405824 ) Change subject: Always load user styles on mobile user pages .. Always load user styles on mobile user pages Previously the styles were only loaded if the user existed and they had no user page. While we want to do this for the content we don't want to do this for styles. Bug: T182162 Change-Id: I6e474562ba5f2c704364c9d7b49f982f7bab8a18 --- M includes/MobileFrontend.body.php 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/24/405824/1 diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php index 29a4549..82de6e2 100644 --- a/includes/MobileFrontend.body.php +++ b/includes/MobileFrontend.body.php @@ -66,14 +66,15 @@ // on whether the user is the owner of the page or not. if ( $title->inNamespace( NS_USER ) && !$title->isSubpage() ) { $pageUserId = User::idFromName( $title->getText() ); + + $out->addModuleStyles( [ + 'mediawiki.ui.icon', + 'mobile.userpage.styles', 'mobile.userpage.icons' + ] ); if ( $pageUserId && !$title->exists() ) { $pageUser = User::newFromId( $pageUserId ); $contentHtml = self::getUserPageContent( $out, $pageUser ); - $out->addModuleStyles( [ - 'mediawiki.ui.icon', - 'mobile.userpage.styles', 'mobile.userpage.icons' - ] ); } } -- To view, visit https://gerrit.wikimedia.org/r/405824 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e474562ba5f2c704364c9d7b49f982f7bab8a18 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Other less common lead paragraph edge cases
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405812 ) Change subject: Other less common lead paragraph edge cases .. Other less common lead paragraph edge cases * Sometimes a collapsible class wraps the infobox e.g. Ardrossan_Railway and Edinburgh_and_Dalkeith_Railway Change-Id: I82c099265c11612105ad3e790e66dd3e9d44b878 --- M includes/transforms/MoveLeadParagraphTransform.php M tests/phpunit/transforms/MoveLeadParagraphTransformTest.php 2 files changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/12/405812/1 diff --git a/includes/transforms/MoveLeadParagraphTransform.php b/includes/transforms/MoveLeadParagraphTransform.php index 08ef454..28d2f85 100644 --- a/includes/transforms/MoveLeadParagraphTransform.php +++ b/includes/transforms/MoveLeadParagraphTransform.php @@ -36,7 +36,7 @@ private static function matchElement( DOMElement $node, $requiredNodeName, $requiredClass ) { $classes = explode( ' ', $node->getAttribute( 'class' ) ); return strtolower( $node->nodeName ) === $requiredNodeName - && in_array( $requiredClass, $classes ); + && !empty( preg_grep( $requiredClass, $classes ) ); } /** @@ -45,12 +45,12 @@ * @param string $wrapperClass (optional) a required classname for wrapper * @return DomElement representing an unwrapped infobox or an element that wraps the infobox */ - public static function getInfoboxContainer( $node, $wrapperClass = 'mw-stack' ) { + public static function getInfoboxContainer( $node, $wrapperClass = '/(mw-stack|collapsible)/' ) { $infobox = false; // iterate to the top. while ( $node->parentNode ) { - if ( self::matchElement( $node, 'table', 'infobox' ) || + if ( self::matchElement( $node, 'table', '/infobox/' ) || self::matchElement( $node, 'div', $wrapperClass ) ) { $infobox = $node; } diff --git a/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php b/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php index bfd8dc7..21b837f 100644 --- a/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php +++ b/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php @@ -88,9 +88,15 @@ $multiStackInfobox = "$infobox$anotherInfobox"; $paragraph = 'first paragraph'; $emptyP = ''; + $collapsibleInfobox = ''; return [ [ + "$collapsibleInfoboxone", + "one$collapsibleInfobox", + 'Collapsible infoboxes are moved.' + ], + [ 'one', 'one' ], -- To view, visit https://gerrit.wikimedia.org/r/405812 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I82c099265c11612105ad3e790e66dd3e9d44b878 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: hide surpressed diff bodies from admins until they unhide
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405365 ) Change subject: hide surpressed diff bodies from admins until they unhide .. hide surpressed diff bodies from admins until they unhide Bug: T118864 Change-Id: I016bf2a4e093d485ae6670bb1978ea5f70ab95d6 --- M includes/diff/InlineDifferenceEngine.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/65/405365/1 diff --git a/includes/diff/InlineDifferenceEngine.php b/includes/diff/InlineDifferenceEngine.php index 015ea6a..45ff783 100644 --- a/includes/diff/InlineDifferenceEngine.php +++ b/includes/diff/InlineDifferenceEngine.php @@ -77,6 +77,9 @@ if ( $warnings ) { $warnings = MobileUI::warningBox( $warnings ); } + if ( $this->isHiddenFromUser() ) { + $diff = ''; + } $output->addHTML( $warnings . '' . -- To view, visit https://gerrit.wikimedia.org/r/405365 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I016bf2a4e093d485ae6670bb1978ea5f70ab95d6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[specialpages]: Merge branch 'master' into 'specialpages'
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405349 ) Change subject: Merge branch 'master' into 'specialpages' .. Merge branch 'master' into 'specialpages' Change-Id: I167f03477fd79e5ea0c7fa5cdf5df71bb8da31c2 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/49/405349/1 -- To view, visit https://gerrit.wikimedia.org/r/405349 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I167f03477fd79e5ea0c7fa5cdf5df71bb8da31c2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Update the font size on back button presses
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405233 ) Change subject: Update the font size on back button presses .. Update the font size on back button presses Bug: T185166 Change-Id: I4d3edda3d18711af19203b979cf9ec9919068c07 --- M resources/mobile.init/init.js 1 file changed, 32 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/33/405233/1 diff --git a/resources/mobile.init/init.js b/resources/mobile.init/init.js index f19af16..df86cea 100644 --- a/resources/mobile.init/init.js +++ b/resources/mobile.init/init.js @@ -5,16 +5,14 @@ * @class mw.mobileFrontend * @singleton */ -( function ( M, $ ) { - var currentPage, skin, +( function ( M, $, storage ) { + var currentPage, skin, userFontSize, PageGateway = M.require( 'mobile.startup/PageGateway' ), BetaOptinPanel = M.require( 'mobile.init/BetaOptinPanel' ), gateway = new PageGateway( new mw.Api() ), util = mw.util, user = mw.user, - storage = mw.storage, context = M.require( 'mobile.startup/context' ), - userFontSize = mw.storage.get( 'userFontSize' ), Page = M.require( 'mobile.startup/Page' ), experiments = mw.experiments, activeExperiments = mw.config.get( 'wgMFExperiments' ) || {}, @@ -157,9 +155,36 @@ } ); } } - if ( userFontSize !== '100' ) { - $( '#content p, .content p' ).css( 'font-size', userFontSize + '%' ); + + /** +* Updates the font size based on the current value in storage +* +* @method +* @ignore +*/ + function updateFontSize() { + if ( !userFontSize ) { + // first visit + userFontSize = storage.get( 'userFontSize' ); + if ( userFontSize === '100' ) { + // No need to change the font size from the normal size. + return; + } + } else { + userFontSize = storage.get( 'userFontSize' ); + } + // actually change the font size. + $( '#content p, .content p' ) + .css( 'font-size', userFontSize + '%' ); } + + // Font must be updated on back button press as users may click + // back after changing font. + $( window ).on( 'pageshow', function () { + updateFontSize(); + } ); + updateFontSize(); + if ( activeExperiments.betaoptin ) { displayBetaOptIn( activeExperiments.betaoptin, getCurrentPage() ); } @@ -169,4 +194,4 @@ } ); /* eslint-enable no-console */ -}( mw.mobileFrontend, jQuery ) ); +}( mw.mobileFrontend, jQuery, mw.storage ) ); -- To view, visit https://gerrit.wikimedia.org/r/405233 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d3edda3d18711af19203b979cf9ec9919068c07 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: DONOTMERGE: Test uncss
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404893 ) Change subject: DONOTMERGE: Test uncss .. DONOTMERGE: Test uncss Change-Id: I43c15ffefef29e5df811d8659b0648d35d36ff9d --- M includes/skins/SkinMinerva.php A resources/compressed.css M skin.json 3 files changed, 1,165 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/93/404893/1 diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index b0fc312..fdf8454 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -1435,6 +1435,7 @@ * @return array */ protected function getSkinStyles() { + return ['skin.compressed']; $title = $this->getTitle(); $styles = [ 'skins.minerva.base.reset', @@ -1462,7 +1463,7 @@ */ public function setupSkinUserCss( OutputPage $out ) { // Add Minerva-specific ResourceLoader modules to the page output - $out->addModuleStyles( $this->getSkinStyles() ); + $out->addModuleStyles( [ 'skin.compressed' ] ); } } diff --git a/resources/compressed.css b/resources/compressed.css new file mode 100644 index 000..b1ba9a8 --- /dev/null +++ b/resources/compressed.css @@ -0,0 +1,1156 @@ + +.hlist ul { + margin: 0; + padding: 0; +} +.hlist li { + margin: 0; + display: inline; +} + +/** + * This tweaks the default mediawiki.hlist module to provide performance optimisations + * as well as subtle tweaks to the appearance. It's a work in progress. + */ +.hlist > ul li, +ul.hlist li { + display: inline-block; + margin-right: 8px; +} +.hlist-separated li:after { + content: '•' !important; + padding-left: 8px; + font-size: 1em; + line-height: 1; +} +.hlist-separated :last-child:after { + content: none !important; +}/* stylelint-disable selector-no-vendor-prefix, at-rule-no-unknown */ +/* stylelint-enable selector-no-vendor-prefix, at-rule-no-unknown */ +.mw-ui-button { + font-family: inherit; + font-size: 1em; + display: inline-block; + min-width: 4em; + max-width: 28.75em; + padding: 0.546875em 1em; + line-height: 1.286; + margin: 0; + border-radius: 2px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-appearance: none; + *display: inline; + /* stylelint-disable-line declaration-block-no-duplicate-properties */ + zoom: 1; + vertical-align: middle; + background-color: #f8f9fa; + color: #22; + border: 1px solid #a2a9b1; + text-align: center; + font-weight: bold; + cursor: pointer; +} +.mw-ui-button:visited { + color: #22; +} +.mw-ui-button:hover { + background-color: #ff; + color: #44; + border-color: #a2a9b1; +} +.mw-ui-button:focus { + background-color: #ff; + color: #22; + border-color: #3366cc; + box-shadow: inset 0 0 0 1px #3366cc, inset 0 0 0 2px #ff; +} +.mw-ui-button:active { + background-color: #d9d9d9; + color: #00; + border-color: #72777d; + box-shadow: none; +} +.mw-ui-button:disabled { + background-color: #c8ccd1; + color: #fff; + border-color: #c8ccd1; +} +.mw-ui-button:disabled:hover, +.mw-ui-button:disabled:active { + background-color: #c8ccd1; + color: #fff; + box-shadow: none; + border-color: #c8ccd1; +} +.mw-ui-button:focus { + outline-width: 0; +} +.mw-ui-button:focus::-moz-focus-inner { + border-color: transparent; + padding: 0; +} +.mw-ui-button:not( :disabled ) { + -webkit-transition: background-color 100ms, color 100ms, border-color 100ms, box-shadow 100ms; + -moz-transition: background-color 100ms, color 100ms, border-color 100ms, box-shadow 100ms; + transition: background-color 100ms, color 100ms, border-color 100ms, box-shadow 100ms; +} +.mw-ui-button:disabled { + text-shadow: none; + cursor: default; +} +a.mw-ui-button { + text-decoration: none; +} +a.mw-ui-button:hover, +a.mw-ui-button:focus { + text-decoration: none; +}/* stylelint-disable selector-no-vendor-prefix, at-rule-no-unknown */ +/* stylelint-enable selector-no-vendor-prefix, at-rule-no-unknown */ +.mw-ui-icon { + position: relative; + line-height: 1.5em; + min-height: 1.5em; + min-width: 1.5em; +} +.mw-ui-icon.mw-ui-icon-element { + text-indent: -999px; + overflow: hidden; + width: 3.5em; + min-width: 3.5em; + max-width: 3.5em; +} +.mw-ui-icon.mw-ui-icon-element:before { + left: 0; + right: 0; + position: absolute; + margin: 0 1em; +} +.mw-ui-icon.mw-ui-icon-before:before, +.mw-ui-icon.mw-ui-icon-element:before { + background-position: 50% 50%; + background-repeat: no-repeat; + background-size: 100% auto; + float: left; + display: block; + min-height: 1.5em; + content: ''; +} +.mw-ui-icon.mw-ui-icon-before:before { + position: relative; + width: 1.5em; + margin-right: 1em; +}
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: WIP: Cleanup trailing punctuation
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404882 ) Change subject: WIP: Cleanup trailing punctuation .. WIP: Cleanup trailing punctuation Bug: T185161 Change-Id: I20d786e3a46c06fdd47a9faf7a50dcf56267b531 --- M lib/transformations/summarize.js M test/lib/transformations/summarize.js 2 files changed, 14 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/82/404882/1 diff --git a/lib/transformations/summarize.js b/lib/transformations/summarize.js index 6c55b25..97101e2 100644 --- a/lib/transformations/summarize.js +++ b/lib/transformations/summarize.js @@ -130,14 +130,16 @@ // 4. remove all double spaces created by the above html = html.replace(/ +/g, ' '); -// 5. Replace any leading whitespace before commas +// 5. Replace any leading whitespace before commas and full stops // (which could be the result of earlier transformations) -html = html.replace(/ , /g, ', '); +html = html.replace(/ ([,.!?]) /g, '$1 '); // 6. Same as 5 but for non-latin comma and no space afterwards -html = html.replace(/ ,/g, ','); +html = html.replace(/ ([,.!?])/g, '$1 '); -doc.body.innerHTML = html; +// remove any trailing spaces before closing node. +html = html.replace(/([.!]) +<\//g, '$1 { it('matches the spec', () => { const testCases = [ +// Should not leave double spaces after stripping parentheticals +[ +'Justice League (both 2017). Justice (is forever)!', +'Justice League. Justice!' +], // Should remove unwanted elements [ '.foo.', @@ -65,8 +70,8 @@ ], // math tags are stripped but any math images are shown [ -'The Planck–Einstein relation connects the particulate photon energy E with its associated wave frequency f:\n\nhttp://www.w3.org/1998/Math/MathML;>\n \n\n \n E\n=\nh\nf\n \n\n{\\displaystyle E=hf}\n \nhttps://wikimedia.org/api/rest_v1/media/math/render/svg/f39fac3593bb1e2dec0282c112c4dff7a99007f6; class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.671ex; width:7.533ex; height:2.509ex;">', -'The Planck–Einstein relation connects the particulate photon energy E with its associated wave frequency f:\n\nhttps://wikimedia.org/api/rest_v1/media/math/render/svg/f39fac3593bb1e2dec0282c112c4dff7a99007f6; class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.671ex; width:7.533ex; height:2.509ex;">' +'The Planck–Einstein relation connects the particulate photon energy E with its associated wave frequency f:http://www.w3.org/1998/Math/MathML;> E=hf {\\displaystyle E=hf} https://wikimedia.org/api/rest_v1/media/math/render/svg/f39fac3593bb1e2dec0282c112c4dff7a99007f6; class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.671ex; width:7.533ex; height:2.509ex;">', +'The Planck–Einstein relation connects the particulate photon energy E with its associated wave frequency f:https://wikimedia.org/api/rest_v1/media/math/render/svg/f39fac3593bb1e2dec0282c112c4dff7a99007f6; class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.671ex; width:7.533ex; height:2.509ex;">' ], // Parentheticals will be stripped [ @@ -169,7 +174,7 @@ ] ]; testCases.forEach((test) => { -assert.equal(summarize(test[0]).extract_html, test[1], test[2]); +assert.equal(summarize(test[0]).extract_html.replace(/\n/g, ''), test[1], test[2]); }); }); }); -- To view, visit https://gerrit.wikimedia.org/r/404882 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I20d786e3a46c06fdd47a9faf7a50dcf56267b531 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Use the correct Pashto Wikipedia wordmark on mobile site
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404828 ) Change subject: Use the correct Pashto Wikipedia wordmark on mobile site .. Use the correct Pashto Wikipedia wordmark on mobile site Bug: T184442 Change-Id: Icdf0cad97846537db288c8803b7f875b4f1d9a38 --- A static/images/mobile/copyright/wikipedia-wordmark-ps.svg M wmf-config/InitialiseSettings.php 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/28/404828/1 diff --git a/static/images/mobile/copyright/wikipedia-wordmark-ps.svg b/static/images/mobile/copyright/wikipedia-wordmark-ps.svg new file mode 100644 index 000..6d539e2 --- /dev/null +++ b/static/images/mobile/copyright/wikipedia-wordmark-ps.svg @@ -0,0 +1 @@ +http://www.w3.org/2000/svg;> \ No newline at end of file diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index a13a765..d72a15a 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -15670,6 +15670,11 @@ 'copyright-width' => 116, 'copyright-height' => 18, ], + 'pswiki' => [ + 'copyright' => '/static/images/mobile/copyright/wikipedia-wordmark-ps.svg', + 'copyright-width' => 66, + 'copyright-height' => 26, + ], 'arwiki' => [ 'copyright' => '/static/images/mobile/copyright/wikipedia-wordmark-ar.svg', 'copyright-width' => 79, -- To view, visit https://gerrit.wikimedia.org/r/404828 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icdf0cad97846537db288c8803b7f875b4f1d9a38 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[wmf/1.31.0-wmf.17]: Fix regressions with updated lead intro transform
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404811 ) Change subject: Fix regressions with updated lead intro transform .. Fix regressions with updated lead intro transform This is a combination of 2 commits: 1) Avoid notice in lead paragraph transform when encounter infobox like elements XPath query can return tables that look like infoboxes as contains(@class,"infobox") is not the same as hasClass('infobox'). Thus getInfoboxContainer can resolve to false. This test and fix guards against that. Bug: T185106 Change-Id: I5a8fbbb956365de9af09ee8d238fb3389e8f2cef 2) Remove blacklisted content before applying transforms Previously we removed all blacklisted elements AFTER applying transforms such as moving lead paragraph. This is unnecessary and can lead to problems, for example infoboxes inside elements which are to be removed, might be moved above the lead paragraph and skip the blacklisting altogether. This also leads to unnecessary logging when the move is not possible. HtmlFormatter::filterContent takes care of content removal so lets do that BEFORE our transformations explicitly. Bug: T185040 Change-Id: I18bc97fa37bdc53e61cb6de79fb6bc1158ffd9fe --- M includes/MobileFormatter.php M includes/transforms/MoveLeadParagraphTransform.php M tests/phpunit/transforms/MoveLeadParagraphTransformTest.php 3 files changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/11/404811/1 diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php index 55429ba..0774271 100644 --- a/includes/MobileFormatter.php +++ b/includes/MobileFormatter.php @@ -183,6 +183,8 @@ $this->doRemoveImages(); } + // Apply all removals before continuing with transforms (see T185040 for example) + $removed = parent::filterContent(); $transformOptions = [ 'images' => $removeImages, 'references' => $removeReferences, @@ -200,8 +202,7 @@ if ( $transformOptions['references'] ) { $this->doRewriteReferencesLinksForLazyLoading( $doc ); } - - return parent::filterContent(); + return $removed; } /** diff --git a/includes/transforms/MoveLeadParagraphTransform.php b/includes/transforms/MoveLeadParagraphTransform.php index d2d5b35..08ef454 100644 --- a/includes/transforms/MoveLeadParagraphTransform.php +++ b/includes/transforms/MoveLeadParagraphTransform.php @@ -107,7 +107,7 @@ if ( $listElementAfterParagraph !== null ) { $leadSectionBody->insertBefore( $listElementAfterParagraph, $where ); } - } elseif ( $infobox->parentNode !== $leadSectionBody ) { + } elseif ( $infobox && $infobox->parentNode !== $leadSectionBody ) { /** * @see https://phabricator.wikimedia.org/T149884 * @todo remove after research is done diff --git a/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php b/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php index c2cbc2c..bfd8dc7 100644 --- a/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php +++ b/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php @@ -91,6 +91,10 @@ return [ [ + 'one', + 'one' + ], + [ "$infobox$paragraph", "$paragraph$infobox", ], -- To view, visit https://gerrit.wikimedia.org/r/404811 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18bc97fa37bdc53e61cb6de79fb6bc1158ffd9fe Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: wmf/1.31.0-wmf.17 Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[wmf/1.31.0-wmf.16]: Fix regressions with updated lead intro transform
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404810 ) Change subject: Fix regressions with updated lead intro transform .. Fix regressions with updated lead intro transform This is a combination of 2 commits: 1) Avoid notice in lead paragraph transform when encounter infobox like elements XPath query can return tables that look like infoboxes as contains(@class,"infobox") is not the same as hasClass('infobox'). Thus getInfoboxContainer can resolve to false. This test and fix guards against that. Bug: T185106 Change-Id: I5a8fbbb956365de9af09ee8d238fb3389e8f2cef 2) Remove blacklisted content before applying transforms Previously we removed all blacklisted elements AFTER applying transforms such as moving lead paragraph. This is unnecessary and can lead to problems, for example infoboxes inside elements which are to be removed, might be moved above the lead paragraph and skip the blacklisting altogether. This also leads to unnecessary logging when the move is not possible. HtmlFormatter::filterContent takes care of content removal so lets do that BEFORE our transformations explicitly. Bug: T185040 Change-Id: I18bc97fa37bdc53e61cb6de79fb6bc1158ffd9fe --- M includes/MobileFormatter.php M includes/transforms/MoveLeadParagraphTransform.php M tests/phpunit/transforms/MoveLeadParagraphTransformTest.php 3 files changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/10/404810/1 diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php index 55429ba..0774271 100644 --- a/includes/MobileFormatter.php +++ b/includes/MobileFormatter.php @@ -183,6 +183,8 @@ $this->doRemoveImages(); } + // Apply all removals before continuing with transforms (see T185040 for example) + $removed = parent::filterContent(); $transformOptions = [ 'images' => $removeImages, 'references' => $removeReferences, @@ -200,8 +202,7 @@ if ( $transformOptions['references'] ) { $this->doRewriteReferencesLinksForLazyLoading( $doc ); } - - return parent::filterContent(); + return $removed; } /** diff --git a/includes/transforms/MoveLeadParagraphTransform.php b/includes/transforms/MoveLeadParagraphTransform.php index d2d5b35..08ef454 100644 --- a/includes/transforms/MoveLeadParagraphTransform.php +++ b/includes/transforms/MoveLeadParagraphTransform.php @@ -107,7 +107,7 @@ if ( $listElementAfterParagraph !== null ) { $leadSectionBody->insertBefore( $listElementAfterParagraph, $where ); } - } elseif ( $infobox->parentNode !== $leadSectionBody ) { + } elseif ( $infobox && $infobox->parentNode !== $leadSectionBody ) { /** * @see https://phabricator.wikimedia.org/T149884 * @todo remove after research is done diff --git a/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php b/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php index c2cbc2c..bfd8dc7 100644 --- a/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php +++ b/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php @@ -91,6 +91,10 @@ return [ [ + 'one', + 'one' + ], + [ "$infobox$paragraph", "$paragraph$infobox", ], -- To view, visit https://gerrit.wikimedia.org/r/404810 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18bc97fa37bdc53e61cb6de79fb6bc1158ffd9fe Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: wmf/1.31.0-wmf.16 Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove blacklisted content before applying transforms
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404780 ) Change subject: Remove blacklisted content before applying transforms .. Remove blacklisted content before applying transforms Previously we removed all blacklisted elements before applying transforms such as moving lead paragraph. This is unnecessary and can lead to problems, for example infoboxes inside elements which are to be removed, might be moved above the lead paragraph and skip the blacklisting altogether. This also leads to unnecessary logging when the move is not possible HtmlFormatter::filterContent takes care of content removal so lets do that before our transformations explicitly. Bug: T185040 Change-Id: I18bc97fa37bdc53e61cb6de79fb6bc1158ffd9fe --- M includes/MobileFormatter.php 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/80/404780/1 diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php index 55429ba..0774271 100644 --- a/includes/MobileFormatter.php +++ b/includes/MobileFormatter.php @@ -183,6 +183,8 @@ $this->doRemoveImages(); } + // Apply all removals before continuing with transforms (see T185040 for example) + $removed = parent::filterContent(); $transformOptions = [ 'images' => $removeImages, 'references' => $removeReferences, @@ -200,8 +202,7 @@ if ( $transformOptions['references'] ) { $this->doRewriteReferencesLinksForLazyLoading( $doc ); } - - return parent::filterContent(); + return $removed; } /** -- To view, visit https://gerrit.wikimedia.org/r/404780 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18bc97fa37bdc53e61cb6de79fb6bc1158ffd9fe Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Avoid notice in lead paragraph transform when encounter info...
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404774 ) Change subject: Avoid notice in lead paragraph transform when encounter infobox like elements .. Avoid notice in lead paragraph transform when encounter infobox like elements XPath query can return tables that look like infoboxes as contains(@class,"infobox") is not the same as hasClass('infobox'). Thus getInfoboxContainer can resolve to false. This test and fix guards against that. Bug: T185106 Change-Id: I5a8fbbb956365de9af09ee8d238fb3389e8f2cef --- M includes/transforms/MoveLeadParagraphTransform.php M tests/phpunit/transforms/MoveLeadParagraphTransformTest.php 2 files changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/74/404774/1 diff --git a/includes/transforms/MoveLeadParagraphTransform.php b/includes/transforms/MoveLeadParagraphTransform.php index d2d5b35..08ef454 100644 --- a/includes/transforms/MoveLeadParagraphTransform.php +++ b/includes/transforms/MoveLeadParagraphTransform.php @@ -107,7 +107,7 @@ if ( $listElementAfterParagraph !== null ) { $leadSectionBody->insertBefore( $listElementAfterParagraph, $where ); } - } elseif ( $infobox->parentNode !== $leadSectionBody ) { + } elseif ( $infobox && $infobox->parentNode !== $leadSectionBody ) { /** * @see https://phabricator.wikimedia.org/T149884 * @todo remove after research is done diff --git a/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php b/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php index c2cbc2c..bfd8dc7 100644 --- a/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php +++ b/tests/phpunit/transforms/MoveLeadParagraphTransformTest.php @@ -91,6 +91,10 @@ return [ [ + 'one', + 'one' + ], + [ "$infobox$paragraph", "$paragraph$infobox", ], -- To view, visit https://gerrit.wikimedia.org/r/404774 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a8fbbb956365de9af09ee8d238fb3389e8f2cef Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Remove unused ArticlePage props
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404752 ) Change subject: Hygiene: Remove unused ArticlePage props .. Hygiene: Remove unused ArticlePage props Change-Id: Ifbeaf4761e4af6dca503d6d4ea87f09308288ec8 --- M tests/browser/features/support/pages/article_page.rb 1 file changed, 0 insertions(+), 30 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/52/404752/1 diff --git a/tests/browser/features/support/pages/article_page.rb b/tests/browser/features/support/pages/article_page.rb index 064e9a7..4491deb 100644 --- a/tests/browser/features/support/pages/article_page.rb +++ b/tests/browser/features/support/pages/article_page.rb @@ -102,17 +102,6 @@ # toc div(:toc, css: '.toc-mobile') - # editor (common) - span(:overlay_editor_mode_switcher, css: '.editor-switcher .oo-ui-indicatorElement-indicator') - span(:source_editor_button, css: '.source-editor .oo-ui-icon-edit-source') - span(:visual_editor_button, css: '.visual-editor .oo-ui-icon-edit-ve') - - # editor - textarea(:editor_textarea, class: 'wikitext-editor') - button(:escape_button, class: 'mw-ui-icon-back') - button(:continue_button, class: 'continue') - button(:submit_button, class: 'submit') - # drawer div(:drawer, css: '.drawer.visible') @@ -126,21 +115,6 @@ # category li(:overlay_category_topic_item, css: '.topic-title-list li') - # visual editor - div(:overlay_ve, css: '.editor-overlay-ve') - div(:overlay_ve_header) do |page| -page.overlay_ve_element.div_element(css: '.overlay-header-container') - end - div(:overlay_ve_header_toolbar) do |page| -page.overlay_ve_header_element.div_element(css: '.oo-ui-toolbar-bar') - end - span(:overlay_ve_header_toolbar_bold_button) do |page| -page.overlay_ve_header_element.span_element(class: 'oo-ui-iconElement-icon oo-ui-icon-bold-b') - end - span(:overlay_ve_header_toolbar_italic_button) do |page| -page.overlay_ve_header_element.span_element(class: 'oo-ui-iconElement-icon oo-ui-icon-italic-i') - end - div(:editor_ve, css: '.ve-ce-documentNode') div(:spinner_loading, class: 'spinner loading') # toast @@ -189,10 +163,6 @@ div(:error_message, css: '.error') # talk overlay - a(:talkadd, css: '.add.continue') - p(:talk_overlay_content_header, css: '.talk-overlay .content-header') li(:talk_overlay_first_topic_title, css: '.talk-overlay .topic-title-list li:first-child') - text_field(:talk_overlay_summary, css: '.talk-overlay .summary') - text_area(:talk_overlay_wikitext_editor, css: '.talk-overlay .wikitext-editor') button(:talk_overlay_save_button, css: '.talk-overlay .confirm-save') end -- To view, visit https://gerrit.wikimedia.org/r/404752 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifbeaf4761e4af6dca503d6d4ea87f09308288ec8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[firsterpaint]: Merge remote-tracking branch 'origin/specialpages' into revi...
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404612 ) Change subject: Merge remote-tracking branch 'origin/specialpages' into review/jdlrobson/css-cull .. Merge remote-tracking branch 'origin/specialpages' into review/jdlrobson/css-cull Change-Id: Ide02648f3d7a0367d4cc59d8f54d491b9826cf22 --- M skin.json 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/12/404612/1 diff --git a/skin.json b/skin.json index c24e21c..df067ee 100644 --- a/skin.json +++ b/skin.json @@ -42,14 +42,12 @@ }, "ResourceModuleSkinStyles": { "minerva": { -<<< HEAD (75cbf8 Restrict gallery styles to only pages which need it) "mediawiki.page.gallery.styles": [ "skinStyles/mediawiki.page.gallery.styles/galleries.less", "skinStyles/mediawiki.page.gallery.styles/tablet.less" -=== + ], "mobile.special.mobileoptions.styles": [ "skinStyles/mobile.special.mobileoptions.styles/minerva.less" ->>> BRANCH (dede84 Minerva should use FeatureManagers class) ], "mediawiki.special.userlogin.common.styles": [ "skinStyles/mediawiki.special.userlogin.common.styles/minerva.less" -- To view, visit https://gerrit.wikimedia.org/r/404612 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide02648f3d7a0367d4cc59d8f54d491b9826cf22 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: firsterpaint Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Test case: Nested spans should be removed...
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404610 ) Change subject: Test case: Nested spans should be removed... .. Test case: Nested spans should be removed... No solution as of yet, but the logic to remove empty nodes is incorrect as rmElementsWithSelector(doc, 'span:empty,b:empty,i:empty,p:empty'); is not recursive. This can be seen on Ariana Grande wiki page - the summary results in a parenthetical with an empty span... Bug: T185050 Change-Id: I56f44e3a3d2825173c293429c73237db05e2a000 --- M test/lib/transformations/summarize.js 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/10/404610/1 diff --git a/test/lib/transformations/summarize.js b/test/lib/transformations/summarize.js index ec25458..7898069 100644 --- a/test/lib/transformations/summarize.js +++ b/test/lib/transformations/summarize.js @@ -8,6 +8,11 @@ describe('summarize', () => { it('matches the spec', () => { const testCases = [ +// Should remove nested empty spans +[ +'Hello () darkness', +'Hello darkness' +], // Should remove unwanted elements [ '.foo.', -- To view, visit https://gerrit.wikimedia.org/r/404610 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I56f44e3a3d2825173c293429c73237db05e2a000 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Do not completely flatten links with child nodes
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404609 ) Change subject: Do not completely flatten links with child nodes .. Do not completely flatten links with child nodes Only flatten an anchor link to text content. Bug: T185050 Change-Id: I05edcf02163289e2e735aff54743cd51cb7da42b --- M lib/transformations/flattenElements.js M test/lib/transformations/flattenElements.test.js 2 files changed, 14 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/09/404609/1 diff --git a/lib/transformations/flattenElements.js b/lib/transformations/flattenElements.js index 0ee39fc..8153bad 100644 --- a/lib/transformations/flattenElements.js +++ b/lib/transformations/flattenElements.js @@ -32,13 +32,13 @@ } function createReplacementNode(oldElement, document) { -if (hasAttribute(oldElement, KEEP_ATTRIBUTES)) { +if (hasAttribute(oldElement, KEEP_ATTRIBUTES) || oldElement.querySelectorAll('*').length) { const spanElement = document.createElement('span'); spanElement.innerHTML = oldElement.innerHTML; copyAttributes(oldElement, spanElement, KEEP_ATTRIBUTES); return spanElement; } else { -return document.createTextNode(oldElement.innerHTML); +return document.createTextNode(oldElement.textContent); } } diff --git a/test/lib/transformations/flattenElements.test.js b/test/lib/transformations/flattenElements.test.js index 3bc1c6c..afbd6ab 100644 --- a/test/lib/transformations/flattenElements.test.js +++ b/test/lib/transformations/flattenElements.test.js @@ -22,4 +22,16 @@ flattenElements(document, 'a'); assert.deepEqual(document.body.innerHTML, 'foo'); }); + +it('retains HTML inside elements', () => { +const document = domino.createDocument('The Mummy franchise'); +flattenElements(document, 'a'); +assert.deepEqual(document.body.innerHTML, 'The Mummy franchise'); +}); + +it('does not change the text content of the node', () => { +const document = domino.createDocument('uh oh'); +flattenElements(document, 'a'); +assert.deepEqual(document.body.innerHTML, 'uh oh'); +}); }); -- To view, visit https://gerrit.wikimedia.org/r/404609 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I05edcf02163289e2e735aff54743cd51cb7da42b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Summaries should not contain coordinates
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404603 ) Change subject: Summaries should not contain coordinates .. Summaries should not contain coordinates Bug: T185050 Change-Id: Idcb882eeabad8c63c18cf0e94a25ca799899445d --- M lib/summary.js 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/03/404603/1 diff --git a/lib/summary.js b/lib/summary.js index 62c57ce..6b6480c 100644 --- a/lib/summary.js +++ b/lib/summary.js @@ -91,6 +91,8 @@ if (isMainPage) { return EMPTY_EXTRACTS; } else { +// The summary should not present any html from removed elements e.g. geo tag +transforms.stripUnneededMarkup(doc) const leadSectionDoc = parsoidSections.justLeadSection(doc); const intro = transforms.extractLeadIntroduction(leadSectionDoc); if (intro.length) { -- To view, visit https://gerrit.wikimedia.org/r/404603 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idcb882eeabad8c63c18cf0e94a25ca799899445d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Merge remote-tracking branch 'origin/master' into specialpages
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403983 ) Change subject: Merge remote-tracking branch 'origin/master' into specialpages .. Merge remote-tracking branch 'origin/master' into specialpages Change-Id: Ia52d75aa53f0ce7c92a2ac60745f2e79275c520d --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/83/403983/1 -- To view, visit https://gerrit.wikimedia.org/r/403983 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia52d75aa53f0ce7c92a2ac60745f2e79275c520d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove exclusion in phpcs
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403941 ) Change subject: Remove exclusion in phpcs .. Remove exclusion in phpcs Given T184650 we should be able to remove this in the next release of wikimedia code sniffer (not happened yet) This removes all disabled sniffs. Bug: T170579 Change-Id: Ic784e8d0de1b08a2dcd0d37f5044b17079d8f581 --- M .phpcs.xml 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/41/403941/1 diff --git a/.phpcs.xml b/.phpcs.xml index 21aef4b..df74e81 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -1,8 +1,6 @@ - - - + MobileFrontend\.alias\.php -- To view, visit https://gerrit.wikimedia.org/r/403941 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic784e8d0de1b08a2dcd0d37f5044b17079d8f581 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Special:MobileOptions should only list features in beta but ...
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403841 ) Change subject: Special:MobileOptions should only list features in beta but not stable .. Special:MobileOptions should only list features in beta but not stable Change-Id: Ic99fc2505748945b9e22527f40a7d2247aa7a1f4 --- M includes/features/Feature.php M includes/specials/SpecialMobileOptions.php 2 files changed, 14 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/41/403841/1 diff --git a/includes/features/Feature.php b/includes/features/Feature.php index b29cd13..17cb862 100644 --- a/includes/features/Feature.php +++ b/includes/features/Feature.php @@ -37,6 +37,13 @@ /** * @inheritDoc */ + public function __toString() { + return $this->name; + } + + /** +* @inheritDoc +*/ public function isAvailable( $mode ) { return array_key_exists( $mode, $this->options ) ? $this->options[ $mode ] : self::DEFAULT_ENABLED_MODE; diff --git a/includes/specials/SpecialMobileOptions.php b/includes/specials/SpecialMobileOptions.php index 80cf3df..ec55151 100644 --- a/includes/specials/SpecialMobileOptions.php +++ b/includes/specials/SpecialMobileOptions.php @@ -104,9 +104,13 @@ ] ); - $features = \MediaWiki\MediaWikiServices::getInstance() - ->getService( 'MobileFrontend.FeaturesManager' ) - ->getAvailable( MobileContext::MODE_BETA ); + $manager = \MediaWiki\MediaWikiServices::getInstance() + ->getService( 'MobileFrontend.FeaturesManager' ); + + $features = array_diff( + $manager->getAvailable( MobileContext::MODE_BETA ), + $manager->getAvailable( 'base' ) + ); $classNames = [ 'mobile-options-beta-feature' ]; if ( $isInBeta ) { -- To view, visit https://gerrit.wikimedia.org/r/403841 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic99fc2505748945b9e22527f40a7d2247aa7a1f4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: i18n: Translate the tooltip for the lock icon
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403840 ) Change subject: i18n: Translate the tooltip for the lock icon .. i18n: Translate the tooltip for the lock icon Change-Id: If056adee7c05e6ca79db6217aed43c0e0d819c37 --- M i18n/en.json M i18n/qqq.json 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/40/403840/1 diff --git a/i18n/en.json b/i18n/en.json index ce5af11..94f4bbd 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -307,5 +307,6 @@ "mobile-frontend-mobile-option-MFExpandAllSectionsUserOption": "Expand all sections by default", "mobile-frontend-mobile-option-MFExpandAllSectionsUserOption-description": "Disable section collapsing on mobile web.", "mobile-frontend-mobile-option-MFEnableFontChanger": "Article font size", - "mobile-frontend-mobile-option-MFEnableFontChanger-description": "Control the font size of your reading experience." + "mobile-frontend-mobile-option-MFEnableFontChanger-description": "Control the font size of your reading experience.", + "mobile-frontend-beta-only": "Feature only available in beta mode" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 47addc6..f77f023 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -308,5 +308,6 @@ "mobile-frontend-mobile-option-MFExpandAllSectionsUserOption": "Expand all sections feature name", "mobile-frontend-mobile-option-MFExpandAllSectionsUserOption-description": "Expand sections feature description", "mobile-frontend-mobile-option-MFEnableFontChanger": "Article font size feature name", - "mobile-frontend-mobile-option-MFEnableFontChanger-description": "Font size feature description" + "mobile-frontend-mobile-option-MFEnableFontChanger-description": "Font size feature description", + "mobile-frontend-beta-only": "Tooltip for lock icons on mobile settings page." } -- To view, visit https://gerrit.wikimedia.org/r/403840 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If056adee7c05e6ca79db6217aed43c0e0d819c37 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Merge remote-tracking branch 'origin/master' into review/jdl...
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403728 ) Change subject: Merge remote-tracking branch 'origin/master' into review/jdlrobson/(HEAD .. Merge remote-tracking branch 'origin/master' into review/jdlrobson/(HEAD Change-Id: I6b3fbb28b32fc791296c7a71e0b43b83a9b0680a --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/28/403728/1 -- To view, visit https://gerrit.wikimedia.org/r/403728 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6b3fbb28b32fc791296c7a71e0b43b83a9b0680a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Remove MobileContext::getConfigVariable
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403727 ) Change subject: Hygiene: Remove MobileContext::getConfigVariable .. Hygiene: Remove MobileContext::getConfigVariable Going forward we will make use of the FeatureManager for these kinds of checks. Given the complexity of the shouldShowWikibaseDescriptions method I've not (yet) removed it, but have wired it up to the feature management system. We should also register features that have been promoted to stable as if they are ever demoted to beta they will not appear in Special:MobileOptions Change-Id: I6aa1c66ec131a8db75d6e6128d4e3af78f351af0 --- M includes/MobileContext.php M includes/MobileFrontend.body.php M includes/MobileFrontend.hooks.php M includes/ServiceWiring.php M tests/phpunit/MobileContextTest.php M tests/phpunit/context/MobileContextWikibaseDescriptionsTest.php A tests/phpunit/features/FeaturesManagerTest.php 7 files changed, 92 insertions(+), 150 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/27/403727/1 diff --git a/includes/MobileContext.php b/includes/MobileContext.php index 1da8860..84a6b30 100644 --- a/includes/MobileContext.php +++ b/includes/MobileContext.php @@ -141,90 +141,6 @@ } /** -* Gets the value of a config variable whose value depends on whether the -* user is a member of the beta group. -* -* @warning If the value of the config variable doesn't behave this way, then -* `null` is returned. -* -* @example -* ``` -* $wgFoo = [ -* 'beta' => 'bar', -* 'base' => 'baz', -* ]; -* $wgQux = 'quux'; -* $wgCorge = [ -* 'grault' => 'garply', -* ]; -* -* $context = MobileContext::singleton(); -* $context->getConfigVariable( 'Foo' ); // => 'baz' -* -* $context->setMobileMode( 'beta' ); -* $context->getConfigVariable( 'Foo' ); // => 'bar' -* -* // If the config variable isn't a dictionary, then its value will be -* // returned returned regardless of whether the user is a member of the beta -* // group. -* $context->getConfigVariable( 'Qux' ); // => 'quux' -* -* // If the config variable is a dictionary but doesn't have "beta" or "base" -* // entries, then `null` will be returned. -* $context->getConfigVariable( 'Corge' ); // => null -* ``` -* -* @param string $variableName Config variable to be returned -* @return mixed|null -* @throws ConfigException If the config variable doesn't exist -* -* @TODO Should this be renamed, e.g. `getFlag`, or extracted? -*/ - public function getConfigVariable( $variableName ) { - $configVariable = $this->getMFConfig()->get( $variableName ) ?: []; - - if ( !is_array( $configVariable ) ) { - return $configVariable; - } - - if ( $this->isBetaGroupMember() && array_key_exists( 'beta', $configVariable ) ) { - return $configVariable['beta']; - } elseif ( array_key_exists( 'base', $configVariable ) ) { - return $configVariable['base']; - } - return null; - } - - /** -* Checks whether references should be lazy loaded for the current user -* @return bool -*/ - public function isLazyLoadReferencesEnabled() { - return $this->getConfigVariable( 'MFLazyLoadReferences' ); - } - - /** -* Checks whether images should be lazy loaded for the current user -* @return bool -*/ - public function isLazyLoadImagesEnabled() { - return $this->getConfigVariable( 'MFLazyLoadImages' ); - } - - /** -* Checks whether the first paragraph from the lead section should be -* shown before all infoboxes that come earlier. -* @return bool -*/ - public function shouldShowFirstParagraphBeforeInfobox() { - if ( $this->showFirstParagraphBeforeInfobox === null ) { - $this->showFirstParagraphBeforeInfobox = $this->getConfigVariable( - 'MFShowFirstParagraphBeforeInfobox' ); - } - return $this->showFirstParagraphBeforeInfobox; - } - - /** * Detects whether the UA is sending the request from a device and, if so, * whether to display the mobile view to that device. * @@ -1150,6 +1066,8 @@ /** * Gets whether Wikibase descriptions should be shown in search results, including nearby search, * and watchlists; or as taglines on article pages. +* Doesn't take
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Hygiene: Remove MobileContext::getConfigVariable
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403550 ) Change subject: Hygiene: Remove MobileContext::getConfigVariable .. Hygiene: Remove MobileContext::getConfigVariable Going forward we will make use of the FeatureManager for these kinds of checks. Given the complexity of the shouldShowWikibaseDescriptions method I've not (yet) removed it, but have wired it up to the feature management system. Change-Id: I6aa1c66ec131a8db75d6e6128d4e3af78f351af0 --- M includes/MobileContext.php M includes/MobileFrontend.body.php M includes/MobileFrontend.hooks.php M includes/ServiceWiring.php M tests/phpunit/MobileContextTest.php A tests/phpunit/features/FeaturesManagerTest.php 6 files changed, 86 insertions(+), 135 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/50/403550/1 diff --git a/includes/MobileContext.php b/includes/MobileContext.php index 1da8860..49d7cb7 100644 --- a/includes/MobileContext.php +++ b/includes/MobileContext.php @@ -141,90 +141,6 @@ } /** -* Gets the value of a config variable whose value depends on whether the -* user is a member of the beta group. -* -* @warning If the value of the config variable doesn't behave this way, then -* `null` is returned. -* -* @example -* ``` -* $wgFoo = [ -* 'beta' => 'bar', -* 'base' => 'baz', -* ]; -* $wgQux = 'quux'; -* $wgCorge = [ -* 'grault' => 'garply', -* ]; -* -* $context = MobileContext::singleton(); -* $context->getConfigVariable( 'Foo' ); // => 'baz' -* -* $context->setMobileMode( 'beta' ); -* $context->getConfigVariable( 'Foo' ); // => 'bar' -* -* // If the config variable isn't a dictionary, then its value will be -* // returned returned regardless of whether the user is a member of the beta -* // group. -* $context->getConfigVariable( 'Qux' ); // => 'quux' -* -* // If the config variable is a dictionary but doesn't have "beta" or "base" -* // entries, then `null` will be returned. -* $context->getConfigVariable( 'Corge' ); // => null -* ``` -* -* @param string $variableName Config variable to be returned -* @return mixed|null -* @throws ConfigException If the config variable doesn't exist -* -* @TODO Should this be renamed, e.g. `getFlag`, or extracted? -*/ - public function getConfigVariable( $variableName ) { - $configVariable = $this->getMFConfig()->get( $variableName ) ?: []; - - if ( !is_array( $configVariable ) ) { - return $configVariable; - } - - if ( $this->isBetaGroupMember() && array_key_exists( 'beta', $configVariable ) ) { - return $configVariable['beta']; - } elseif ( array_key_exists( 'base', $configVariable ) ) { - return $configVariable['base']; - } - return null; - } - - /** -* Checks whether references should be lazy loaded for the current user -* @return bool -*/ - public function isLazyLoadReferencesEnabled() { - return $this->getConfigVariable( 'MFLazyLoadReferences' ); - } - - /** -* Checks whether images should be lazy loaded for the current user -* @return bool -*/ - public function isLazyLoadImagesEnabled() { - return $this->getConfigVariable( 'MFLazyLoadImages' ); - } - - /** -* Checks whether the first paragraph from the lead section should be -* shown before all infoboxes that come earlier. -* @return bool -*/ - public function shouldShowFirstParagraphBeforeInfobox() { - if ( $this->showFirstParagraphBeforeInfobox === null ) { - $this->showFirstParagraphBeforeInfobox = $this->getConfigVariable( - 'MFShowFirstParagraphBeforeInfobox' ); - } - return $this->showFirstParagraphBeforeInfobox; - } - - /** * Detects whether the UA is sending the request from a device and, if so, * whether to display the mobile view to that device. * @@ -1157,6 +1073,11 @@ * `wgMFDisplayWikibaseDescriptions` configuration variable for detail */ public function shouldShowWikibaseDescriptions( $feature ) { + $featureManager = \MediaWiki\MediaWikiServices::getInstance() + ->getService( 'MobileFrontend.FeaturesManager' ); + $isEnabled = $featureManager->isAvailableInContext( +
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: User page fully managed by MobileFrontend
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403541 ) Change subject: User page fully managed by MobileFrontend .. User page fully managed by MobileFrontend Previously styles and icons were managed by Minerva. This meant the icon and styles do not show up on other skins operating in mobile mode. e.g. http://localhost:/w/index.php?title=User:Kaldari=vector=mobile This rectifies this Change-Id: I9219eb0b18904811db0dec4c50f450c74848a68b --- M extension.json M includes/MobileFrontend.body.php M includes/user_page_cta.mustache A resources/mobile.userpage.icons/talk.svg A resources/mobile.userpage.icons/userpage.svg A resources/mobile.userpage.styles/userpage.less 6 files changed, 85 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/41/403541/1 diff --git a/extension.json b/extension.json index 1b0b831..4ee7e69 100644 --- a/extension.json +++ b/extension.json @@ -169,6 +169,23 @@ "resources/mobile.messageBox.styles/messageBox.less" ] }, + "mobile.userpage.icons": { + "class": "ResourceLoaderImageModule", + "selector": ".mw-ui-icon-{name}:before", + "images": { + "talk": "resources/mobile.userpage.icons/talk.svg", + "userpage": "resources/mobile.userpage.icons/userpage.svg" + } + }, + "mobile.userpage.styles": { + "targets": [ + "mobile", + "desktop" + ], + "styles": [ + "resources/mobile.userpage.styles/userpage.less" + ] + }, "mobile.messageBox": { "targets": [ "mobile", diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php index 45f4196..d808201 100644 --- a/includes/MobileFrontend.body.php +++ b/includes/MobileFrontend.body.php @@ -83,6 +83,10 @@ $pageUser = User::newFromId( $pageUserId ); $contentHtml = self::getUserPageContent( $out, $pageUser ); + $out->addModuleStyles( [ + 'mediawiki.ui.icon', + 'mobile.userpage.styles', 'mobile.userpage.icons' + ] ); } } @@ -102,6 +106,9 @@ // Is the current user viewing their own page? $isCurrentUser = $output->getUser()->getName() === $pageUsername; + $data = [ + 'userIconClass' => MobileUI::iconClass( 'userpage', 'element', 'mw-ui-icon-large icon' ), + ]; $data['ctaHeading'] = $isCurrentUser ? $context->msg( 'mobile-frontend-user-page-no-owner-page-yet' )->text() : $context->msg( 'mobile-frontend-user-page-no-page-yet', $pageUsername )->parse(); diff --git a/includes/user_page_cta.mustache b/includes/user_page_cta.mustache index 9c5d39b..a0ce8ef 100644 --- a/includes/user_page_cta.mustache +++ b/includes/user_page_cta.mustache @@ -1,5 +1,5 @@ - + {{ctaHeading}} {{ctaDescription}} diff --git a/resources/mobile.userpage.icons/talk.svg b/resources/mobile.userpage.icons/talk.svg new file mode 100644 index 000..d5845b4 --- /dev/null +++ b/resources/mobile.userpage.icons/talk.svg @@ -0,0 +1 @@ +http://www.w3.org/2000/svg; width="40" height="30" viewBox="0 0 40 30">talkpage \ No newline at end of file diff --git a/resources/mobile.userpage.icons/userpage.svg b/resources/mobile.userpage.icons/userpage.svg new file mode 100644 index 000..161686a --- /dev/null +++ b/resources/mobile.userpage.icons/userpage.svg @@ -0,0 +1 @@ +http://www.w3.org/2000/svg; width="88" height="118" viewBox="0 0 88 118">userpage \ No newline at end of file diff --git a/resources/mobile.userpage.styles/userpage.less b/resources/mobile.userpage.styles/userpage.less new file mode 100644 index 000..3ca7dfa --- /dev/null +++ b/resources/mobile.userpage.styles/userpage.less @@ -0,0 +1,58 @@ +@import 'mobile.variables'; +@import 'mediawiki.mixins'; + +.tagline { + color: @colorGray5; + font-size: 0.8em; + margin: 10px 0; +} + +.user-links { + margin: 15px 0 0 0; + li { + display: inline-block; + & + li { + margin-left: 4px; + &:before { +
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Merge remote-tracking branch 'origin/master' into HEAD
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403312 ) Change subject: Merge remote-tracking branch 'origin/master' into HEAD .. Merge remote-tracking branch 'origin/master' into HEAD Change-Id: I20fbe9f4ba2fff1f7a2bf953ee3cfdbacd01f54e --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/12/403312/1 -- To view, visit https://gerrit.wikimedia.org/r/403312 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I20fbe9f4ba2fff1f7a2bf953ee3cfdbacd01f54e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Hygiene: Introduce a isFeatureAvailableInContext() method
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403225 ) Change subject: Hygiene: Introduce a isFeatureAvailableInContext() method .. Hygiene: Introduce a isFeatureAvailableInContext() method Sometimes we want to check the feature availabilti in given context. Insted of replicating same logic in different extensions lets provide a helper function to detect the BETA mode first and then check the feature availability. The parameters order goes as it reads, first Feature, then Context Bug: T182362 Change-Id: Ie320d84b63298d3daad9cd1c2325dd4d53639d11 --- M includes/features/FeaturesManager.php M includes/features/IFeature.php 2 files changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/25/403225/1 diff --git a/includes/features/FeaturesManager.php b/includes/features/FeaturesManager.php index 2edecff..6b6b37c 100644 --- a/includes/features/FeaturesManager.php +++ b/includes/features/FeaturesManager.php @@ -2,6 +2,8 @@ namespace MobileFrontend\Features; +use MobileContext; + class FeaturesManager { /** * A collection of available features @@ -43,4 +45,15 @@ return $this->features[ $id ]; } + /** +* Verify that feature $featureId is available in $context +* +* @param string $featureId Feature id to verify +* @param MobileContext $context Mobile context to check +* @return bool +*/ + public function isFeatureAvailableInContext( $featureId, MobileContext $context ) { + $mode = $context->isBetaGroupMember() ? IFeature::CONFIG_BETA : IFeature::CONFIG_STABLE; + return $this->getFeature( $featureId )->isAvailable( $mode ); + } } diff --git a/includes/features/IFeature.php b/includes/features/IFeature.php index 6122541..1efae64 100644 --- a/includes/features/IFeature.php +++ b/includes/features/IFeature.php @@ -4,6 +4,17 @@ interface IFeature { /** +* Beta mode defined in config +* @var string +*/ + const CONFIG_BETA = 'beta'; + /** +* Stable mode defined in config +* @var string +*/ + const CONFIG_STABLE = 'base'; + + /** * Get the feature id * Used as a identifier in forms, database etc. Should be unique * -- To view, visit https://gerrit.wikimedia.org/r/403225 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie320d84b63298d3daad9cd1c2325dd4d53639d11 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: JdlrobsonGerrit-Reviewer: Pmiazga ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Prefix icons in Minerva
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403085 ) Change subject: Prefix icons in Minerva .. Prefix icons in Minerva Changes: * MinervaUI will now prefix any icons with `minerva` * Update definitions in skin.json, retaining selectors for cached HTML for icons that are rendered via PHP. Move skins.minerva.icons.images.variants into MobileFrontend? * anonymous and user icons actually live in MobileFrontend. They are not needed/used here so are removed * In I9021c53c2c04bdd7ce395eed33d89986acbfea6d watch and watched are moved to MobileFrontend so are removed here as they are not used directly in this repo. Depends-On: I9021c53c2c04bdd7ce395eed33d89986acbfea6d Bug: T182162 Change-Id: I93264024f4915fc910c792b1905b89cdc6b8b546 --- M includes/MinervaUI.php M includes/skins/MinervaTemplate.php M includes/skins/SkinMinerva.php M includes/skins/user_page_links.mustache D resources/skins.minerva.icons.images.scripts/watch.svg D resources/skins.minerva.icons.images.scripts/watched.svg M resources/skins.minerva.scripts/DownloadIcon.js M skin.json 8 files changed, 23 insertions(+), 28 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/85/403085/1 diff --git a/includes/MinervaUI.php b/includes/MinervaUI.php index d800514..416dc0f 100644 --- a/includes/MinervaUI.php +++ b/includes/MinervaUI.php @@ -22,7 +22,7 @@ $base = 'mw-ui-icon'; $modifiers = 'mw-ui-icon-' . $iconType; if ( $iconName ) { - $modifiers .= ' mw-ui-icon-' . $iconName; + $modifiers .= ' mw-ui-icon-minerva-' . $iconName; } return $base . ' ' . $modifiers . ' ' . $additionalClassNames; } diff --git a/includes/skins/MinervaTemplate.php b/includes/skins/MinervaTemplate.php index 7726d05..bf150d2 100644 --- a/includes/skins/MinervaTemplate.php +++ b/includes/skins/MinervaTemplate.php @@ -279,7 +279,7 @@ // which is problematic in Opera Mini (see T140490) 'searchButton' => Html::rawElement( 'button', [ 'id' => 'searchIcon', - 'class' => MinervaUI::iconClass( 'magnifying-glass', 'element' ), + 'class' => MinervaUI::iconClass( 'minerva-magnifying-glass', 'element' ), ], wfMessage( 'searchbutton' ) ), 'secondaryButtonData' => $data['secondaryButtonData'], 'mainmenuhtml' => $this->getMainMenuHtml( $data ), diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index b0fc312..1704247 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -460,7 +460,7 @@ ->addComponent( $this->msg( 'mobile-frontend-main-menu-contributions' )->escaped(), SpecialPage::getTitleFor( 'Contributions', $user->getName() )->getLocalUrl(), - MinervaUI::iconClass( 'mf-contributions', 'before' ), + MinervaUI::iconClass( 'contributions', 'before' ), [ 'data-event-name' => 'contributions' ] ); } @@ -498,7 +498,7 @@ 'mobile-frontend-watchlist-purpose', $watchlistQuery ), - MinervaUI::iconClass( 'mf-watchlist', 'before' ), + MinervaUI::iconClass( 'watchlist', 'before' ), [ 'data-event-name' => 'watchlist' ] ); } @@ -520,7 +520,7 @@ $this->msg( 'mobile-frontend-main-menu-settings' )->escaped(), SpecialPage::getTitleFor( 'MobileOptions' )-> getLocalUrl( [ 'returnto' => $returnToTitle ] ), - MinervaUI::iconClass( 'mf-settings', 'before' ), + MinervaUI::iconClass( 'settings', 'before' ), [ 'data-event-name' => 'settings' ] ); @@ -535,7 +535,7 @@ SpecialPage::getTitleFor( 'Preferences' ), 'prefsnologintext2' ), - MinervaUI::iconClass( 'mf-settings', 'before' ), + MinervaUI::iconClass( 'settings', 'before' ), [ 'data-event-name' => 'preferences' ] );
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[specialpages]: WIP:Prefix icons in Minerva
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403083 ) Change subject: WIP:Prefix icons in Minerva .. WIP:Prefix icons in Minerva These are all defined in MobileFrontend and do not need to be here Prefix icons that are loaded via JavaScript @todo: Icons rendered on server side will need to be made backwards compatible Move skins.minerva.icons.images.variants into MobileFrontend? Changes: * anonymous and user icons actually live in MobileFrontend. They are not needed/used here. * In I9021c53c2c04bdd7ce395eed33d89986acbfea6d watch and watched are moved to MobileFrontend so are removed here as they are not used in this repo. Depends-On: I9021c53c2c04bdd7ce395eed33d89986acbfea6d Bug: T182162 Change-Id: I93264024f4915fc910c792b1905b89cdc6b8b546 --- M includes/skins/MinervaTemplate.php M includes/skins/SkinMinerva.php D resources/skins.minerva.icons.images.scripts/watch.svg D resources/skins.minerva.icons.images.scripts/watched.svg M skin.json 5 files changed, 19 insertions(+), 25 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/83/403083/1 diff --git a/includes/skins/MinervaTemplate.php b/includes/skins/MinervaTemplate.php index 7726d05..83ff57b 100644 --- a/includes/skins/MinervaTemplate.php +++ b/includes/skins/MinervaTemplate.php @@ -110,7 +110,7 @@ $args = [ 'clockIconClass' => MinervaUI::iconClass( 'clock-gray', 'before' ), 'arrowIconClass' => MinervaUI::iconClass( - 'arrow-gray', 'element', 'mw-ui-icon-small mf-mw-ui-icon-rotate-anti-clockwise indicator' ), + 'minerva-arrow-gray', 'element', 'mw-ui-icon-small mf-mw-ui-icon-rotate-anti-clockwise indicator' ), ] + $data['historyLink']; $templateParser = new TemplateParser( __DIR__ ); return $templateParser->processTemplate( 'history', $args ); @@ -279,7 +279,7 @@ // which is problematic in Opera Mini (see T140490) 'searchButton' => Html::rawElement( 'button', [ 'id' => 'searchIcon', - 'class' => MinervaUI::iconClass( 'magnifying-glass', 'element' ), + 'class' => MinervaUI::iconClass( 'minerva-magnifying-glass', 'element' ), ], wfMessage( 'searchbutton' ) ), 'secondaryButtonData' => $data['secondaryButtonData'], 'mainmenuhtml' => $this->getMainMenuHtml( $data ), diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index b0fc312..d730327 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -460,7 +460,7 @@ ->addComponent( $this->msg( 'mobile-frontend-main-menu-contributions' )->escaped(), SpecialPage::getTitleFor( 'Contributions', $user->getName() )->getLocalUrl(), - MinervaUI::iconClass( 'mf-contributions', 'before' ), + MinervaUI::iconClass( 'minerva-contributions', 'before' ), [ 'data-event-name' => 'contributions' ] ); } @@ -498,7 +498,7 @@ 'mobile-frontend-watchlist-purpose', $watchlistQuery ), - MinervaUI::iconClass( 'mf-watchlist', 'before' ), + MinervaUI::iconClass( 'minerva-watchlist', 'before' ), [ 'data-event-name' => 'watchlist' ] ); } @@ -520,7 +520,7 @@ $this->msg( 'mobile-frontend-main-menu-settings' )->escaped(), SpecialPage::getTitleFor( 'MobileOptions' )-> getLocalUrl( [ 'returnto' => $returnToTitle ] ), - MinervaUI::iconClass( 'mf-settings', 'before' ), + MinervaUI::iconClass( 'minerva-settings', 'before' ), [ 'data-event-name' => 'settings' ] ); @@ -535,7 +535,7 @@ SpecialPage::getTitleFor( 'Preferences' ), 'prefsnologintext2' ), - MinervaUI::iconClass( 'mf-settings', 'before' ), + MinervaUI::iconClass( 'minerva-settings', 'before' ),
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[specialpages]: Merge remote-tracking branch 'origin/master' into HEAD
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403081 ) Change subject: Merge remote-tracking branch 'origin/master' into HEAD .. Merge remote-tracking branch 'origin/master' into HEAD Change-Id: Ia1a520d983be096e29cfe725f619be0423f9d110 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/81/403081/1 -- To view, visit https://gerrit.wikimedia.org/r/403081 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia1a520d983be096e29cfe725f619be0423f9d110 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: MobileFrontendFeaturesRegistration hook should be called ear...
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403078 ) Change subject: MobileFrontendFeaturesRegistration hook should be called earlier in stack .. MobileFrontendFeaturesRegistration hook should be called earlier in stack Bug: T182362 Change-Id: I03839d840d02ed84a850baef1d8625ecdbe6970d --- M includes/MobileFrontend.hooks.php 1 file changed, 10 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/78/403078/1 diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index 6fbb210..a2767c3 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -80,6 +80,15 @@ return true; } + // TODO, do we want to have a specific hook just for Mobile Features initialization + // or do we want to reuse the RequestContextCreateSkinMobile and use MediawikiService + // to retrieve the FeaturesManager + // Important: This must be run before RequestContextCreateSkinMobile which may make modifications + // to the skin based on enabled features. + $featureManager = \MediaWiki\MediaWikiServices::getInstance() + ->getService( 'MobileFrontend.FeaturesManager' ); + Hooks::run( 'MobileFrontendFeaturesRegistration', [ $featureManager ] ); + // enable wgUseMediaWikiUIEverywhere self::enableMediaWikiUI(); @@ -119,15 +128,9 @@ return false; } } + $skin = self::getDefaultMobileSkin( $context, $mobileContext ); Hooks::run( 'RequestContextCreateSkinMobile', [ $mobileContext, $skin ] ); - - // TODO, do we want to have a specific hook just for Mobile Features initialization - // or do we want to reuse the RequestContextCreateSkinMobile and use MediawikiService - // to retrieve the FeaturesManager - $featureManager = \MediaWiki\MediaWikiServices::getInstance() - ->getService( 'MobileFrontend.FeaturesManager' ); - Hooks::run( 'MobileFrontendFeaturesRegistration', [ $featureManager ] ); return false; } -- To view, visit https://gerrit.wikimedia.org/r/403078 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I03839d840d02ed84a850baef1d8625ecdbe6970d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[specialpages]: Minerva should use FeatureManagers class
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403065 ) Change subject: Minerva should use FeatureManagers class .. Minerva should use FeatureManagers class Bug: T182362 Change-Id: I6ba5bf49b9060c31ad2224a437072b3426a45619 --- M includes/Minerva.hooks.php M skin.json 2 files changed, 33 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/65/403065/1 diff --git a/includes/Minerva.hooks.php b/includes/Minerva.hooks.php index c65d939..f68bc02 100644 --- a/includes/Minerva.hooks.php +++ b/includes/Minerva.hooks.php @@ -28,6 +28,30 @@ } /** +* Register mobile web beta features +* @see https://www.mediawiki.org/wiki/ + * Extension:MobileFrontend/MobileFrontendFeaturesRegistration +* +* @param MobileFrontend\Features\FeaturesManager $featureManager +* @return bool +*/ + public static function onMobileFrontendFeaturesRegistration( $featureManager ) { + $config = MediaWikiServices::getInstance()->getConfigFactory() + ->makeConfig( 'minerva' ); + + $featureManager->registerFeature( + new MobileFrontend\Features\Feature( 'MinervaShowCategoriesButton', + $config->get( 'MinervaShowCategoriesButton' ) + ) + ); + $featureManager->registerFeature( + new MobileFrontend\Features\Feature( 'MinervaEnableBackToTop', + $config->get( 'MinervaEnableBackToTop' ) + ) + ); + } + + /** * Skin registration callback. */ public static function onRegistration() { @@ -132,13 +156,17 @@ ) { // setSkinOptions is not available if ( $skin instanceof SkinMinerva ) { + $featureManager = \MediaWiki\MediaWikiServices::getInstance(); + $skin->setSkinOptions( [ SkinMinerva::OPTIONS_MOBILE_BETA => $mobileContext->isBetaGroupMember(), + + // @todo SkinMinerva::OPTION_CATEGORIES - => $mobileContext->getConfigVariable( 'MinervaShowCategoriesButton' ), + => $featureManager->isFeatureEnabled( 'MinervaShowCategoriesButton'), SkinMinerva::OPTION_BACK_TO_TOP - => $mobileContext->getConfigVariable( 'MinervaEnableBackToTop' ), + => $featureManager->isFeatureEnabled( 'MinervaEnableBackToTop' ), SkinMinerva::OPTION_TOGGLING => true, SkinMinerva::OPTION_MOBILE_OPTIONS => true, ] ); diff --git a/skin.json b/skin.json index d00c5bf..dba27d1 100644 --- a/skin.json +++ b/skin.json @@ -15,6 +15,9 @@ "minerva": "GlobalVarConfig::newInstance" }, "Hooks": { + "MobileFrontendFeaturesRegistration": [ + "MinervaHooks::onMobileFrontendFeaturesRegistration" + ], "RequestContextCreateSkinMobile": [ "MinervaHooks::onRequestContextCreateSkinMobile" ], -- To view, visit https://gerrit.wikimedia.org/r/403065 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ba5bf49b9060c31ad2224a437072b3426a45619 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove Special:MobileOptions/Languages
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/403062 ) Change subject: Remove Special:MobileOptions/Languages .. Remove Special:MobileOptions/Languages This was added back in 2012 In the old version of the language overlay when a language did not exist we linked to this page. We don't do that anymore since the new language overlay we launched in August 2016. It's not linked to anywhere in the UI. Should probably remove as it caused me a big surprise to not only see it existed but to see I wrote the code haha Change-Id: I9c7cca88c4f3df42f2ced93b72011f18d911acce --- M i18n/en.json M i18n/qqq.json M includes/specials/SpecialMobileOptions.php 3 files changed, 3 insertions(+), 83 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/62/403062/1 diff --git a/i18n/en.json b/i18n/en.json index d946136..bd0c5bb 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -201,7 +201,6 @@ "mobile-frontend-settings-tagline": "Reading preferences", "mobile-frontend-settings-beta": "Beta", "mobile-frontend-settings-site-description": "{{SITENAME}} is available in $1 {{PLURAL:$1|language|languages}}. All available versions are listed below", - "mobile-frontend-settings-site-header": "{{SITENAME}} Languages", "mobile-frontend-settings-save": "Settings were saved successfully.", "mobile-frontend-talk-fullpage": "Read as wiki page", "mobile-frontend-talk-add-overlay-content-placeholder": "What is on your mind?", diff --git a/i18n/qqq.json b/i18n/qqq.json index ab92dfc..7229faf 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -202,7 +202,6 @@ "mobile-frontend-settings-tagline": "Tagline for Special:MobileOptions - will show under heading", "mobile-frontend-settings-beta": "Text for beta on settings page.\n{{Identical|Beta}}", "mobile-frontend-settings-site-description": "Shown on [[Special:MobileOptions]]. Parameters:\n* $1 - the number of other language versions for this wiki", - "mobile-frontend-settings-site-header": "Heading for the Special:MobileOptions/Language page - only visible to non JavaScript users", "mobile-frontend-settings-save": "Notification which shows to user when settings are saved.", "mobile-frontend-talk-fullpage": "Used as label for link to the talk page (Talk:ArticleName) in Talk Overlay.", "mobile-frontend-talk-add-overlay-content-placeholder": "Placeholder text to prompt user to add content to talk page content", diff --git a/includes/specials/SpecialMobileOptions.php b/includes/specials/SpecialMobileOptions.php index ebb9364..2019570 100644 --- a/includes/specials/SpecialMobileOptions.php +++ b/includes/specials/SpecialMobileOptions.php @@ -8,11 +8,6 @@ private $returnToTitle; /** @var boolean $hasDesktopVersion Whether this special page has a desktop version or not */ protected $hasDesktopVersion = true; - /** @var array $options Used in the execute() function as a map of subpages to -functions that are executed when the request method is defined. */ - private $options = [ - 'Language' => [ 'get' => 'chooseLanguage' ], - ]; /** * Construct function @@ -44,24 +39,11 @@ $this->setHeaders(); $context->setForceMobileView( true ); $context->setContentTransformations( false ); - // check, if the subpage has a registered function, that needs to be executed - if ( isset( $this->options[$par] ) ) { - $option = $this->options[$par]; - // select the correct function for the given request method (post, get) - if ( $this->getRequest()->wasPosted() && isset( $option['post'] ) ) { - $func = $option['post']; - } else { - $func = $option['get']; - } - // run the function - $this->$func(); + if ( $this->getRequest()->wasPosted() ) { + $this->submitSettingsForm(); } else { - if ( $this->getRequest()->wasPosted() ) { - $this->submitSettingsForm(); - } else { - $this->addSettingsForm(); - } + $this->addSettingsForm(); } } @@ -143,59 +125,6 @@ } /** -* Get a list of languages available for this project -* @return string parsed Html -*/ - private function getSiteSelector() { - $selector = ''; - $count = 0; - $language = $this->getLanguage(); -
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Remove Special:MobileOptions/Languages
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/402422 ) Change subject: Remove Special:MobileOptions/Languages .. Remove Special:MobileOptions/Languages This was added back in 2012 It's not linked to anywhere in the UI. Should probably remove as it caused me a big surprise to not only see it existed but to see I wrote the code haha Change-Id: I9c7cca88c4f3df42f2ced93b72011f18d911acce --- M i18n/en.json M i18n/qqq.json M includes/specials/SpecialMobileOptions.php 3 files changed, 0 insertions(+), 24 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/22/402422/1 diff --git a/i18n/en.json b/i18n/en.json index 9217300..a1a7a73 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -201,7 +201,6 @@ "mobile-frontend-settings-tagline": "Reading preferences", "mobile-frontend-settings-beta": "{{SITENAME}} βeta", "mobile-frontend-settings-site-description": "{{SITENAME}} is available in $1 {{PLURAL:$1|language|languages}}. All available versions are listed below", - "mobile-frontend-settings-site-header": "{{SITENAME}} Languages", "mobile-frontend-settings-save": "Settings were saved successfully.", "mobile-frontend-talk-fullpage": "Read as wiki page", "mobile-frontend-talk-add-overlay-content-placeholder": "What is on your mind?", diff --git a/i18n/qqq.json b/i18n/qqq.json index 91f2348..fbd953c 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -202,7 +202,6 @@ "mobile-frontend-settings-tagline": "Tagline for Special:MobileOptions - will show under heading", "mobile-frontend-settings-beta": "Text for beta on settings page.\n{{Identical|Beta}}", "mobile-frontend-settings-site-description": "Shown on [[Special:MobileOptions]]. Parameters:\n* $1 - the number of other language versions for this wiki", - "mobile-frontend-settings-site-header": "Heading for the Special:MobileOptions/Language page - only visible to non JavaScript users", "mobile-frontend-settings-save": "Notification which shows to user when settings are saved.", "mobile-frontend-talk-fullpage": "Used as label for link to the talk page (Talk:ArticleName) in Talk Overlay.", "mobile-frontend-talk-add-overlay-content-placeholder": "Placeholder text to prompt user to add content to talk page content", diff --git a/includes/specials/SpecialMobileOptions.php b/includes/specials/SpecialMobileOptions.php index e61354a..9cccbb8 100644 --- a/includes/specials/SpecialMobileOptions.php +++ b/includes/specials/SpecialMobileOptions.php @@ -11,11 +11,6 @@ private $returnToTitle; /** @var boolean $hasDesktopVersion Whether this special page has a desktop version or not */ protected $hasDesktopVersion = true; - /** @var array $options Used in the execute() function as a map of subpages to -functions that are executed when the request method is defined. */ - private $options = [ - 'Language' => [ 'get' => 'chooseLanguage' ], - ]; /** * Construct function @@ -240,16 +235,6 @@ } /** -* Render the language selector special page, callable through Special:MobileOptions/Language -* See the $options member variable of this class. -*/ - private function chooseLanguage() { - $out = $this->getOutput(); - $out->setPageTitle( $this->msg( 'mobile-frontend-settings-site-header' )->escaped() ); - $out->addHTML( $this->getSiteSelector() ); - } - - /** * Saves the settings submitted by the settings form */ private function submitSettingsForm() { @@ -293,12 +278,5 @@ $context->setMobileMode( $group ); $url = $this->getPageTitle()->getFullURL( 'success' ); $context->getOutput()->redirect( MobileContext::singleton()->getMobileUrl( $url ) ); - } - - /** -* @return string[] -*/ - public function getSubpagesForPrefixSearch() { - return array_keys( $this->options ); } } -- To view, visit https://gerrit.wikimedia.org/r/402422 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9c7cca88c4f3df42f2ced93b72011f18d911acce Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: WIP: Prefix icons with `mf-`
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/402409 ) Change subject: WIP: Prefix icons with `mf-` .. WIP: Prefix icons with `mf-` Prefix the following icons with `mf`: * refresh * spinner * cleanup * cleanup-gray * arrow * close * overlay-close * back * toc * citation * error * clear * search-content * anonymous * user * bytesadded * bytesneutral * bytesremoved Since icons are rendered on special pages or inside JS they are not subject to caching so no fallback icons using the old css selectors are needed. The following icons are added to MobileFrontend. Previously they lived in Minerva which doesn't make sense given they are used here. * watch * watched A follow up change will remove them from Minerva Note certain icons are repeated in Minerva (user + anonymous) - these will not be impacted by this change and will be updated separately. @todo: the follow icon glyph is defined and used in Minerva and needs to work on cached HTML so a change there will also be needed: * arrow I /think/ this icon can also be moved to MobileFrontend but I need to check this assumption to make sure! Bug: T182162 Change-Id: I9021c53c2c04bdd7ce395eed33d89986acbfea6d --- M extension.json M includes/specials/MobileSpecialPageFeed.php M includes/specials/SpecialMobileContributions.php M includes/specials/SpecialMobileDiff.php M includes/specials/SpecialMobileHistory.php M resources/mobile.ajax.styles/spinner.less M resources/mobile.editor.common/EditorOverlayBase.js M resources/mobile.issues/CleanupOverlay.js M resources/mobile.mediaViewer/ImageOverlay.js M resources/mobile.references/ReferencesDrawer.js M resources/mobile.search/SearchOverlay.js M resources/mobile.special.mobilediff.scripts/init.js M resources/mobile.special.nearby.scripts/nearby.js A resources/mobile.startup.images/watch.svg A resources/mobile.startup.images/watched.svg M resources/mobile.startup/CtaDrawer.js M resources/mobile.startup/Drawer.js M resources/mobile.startup/Overlay.js M resources/mobile.startup/icons.js M resources/mobile.talk.overlays/TalkSectionAddOverlay.js M resources/mobile.toc/TableOfContents.js M resources/mobile.toggle/toggle.js M resources/mobile.watchstar/Watchstar.js 23 files changed, 47 insertions(+), 43 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/09/402409/1 diff --git a/extension.json b/extension.json index 1b0b831..191d917 100644 --- a/extension.json +++ b/extension.json @@ -114,8 +114,8 @@ ] }, "mobile.overlay.images": { - "selectorWithoutVariant": ".mw-ui-icon-{name}:before", - "selectorWithVariant": ".mw-ui-icon-{name}-{variant}:before", + "selectorWithoutVariant": ".mw-ui-icon-mf-{name}:before", + "selectorWithVariant": ".mw-ui-icon-mf-{name}-{variant}:before", "class": "ResourceLoaderImageModule", "variants": { "gray": { @@ -139,7 +139,7 @@ }, "mobile.issues.images": { "class": "ResourceLoaderImageModule", - "selector": ".mw-ui-icon-{name}:before", + "selector": ".mw-ui-icon-mf-{name}:before", "images": { "cleanup": "resources/mobile.issues.images/blue-triangle.svg", "cleanup-gray": "resources/mobile.issues.images/gray-triangle.svg" @@ -147,14 +147,14 @@ }, "mobile.toc.images": { "class": "ResourceLoaderImageModule", - "selector": ".mw-ui-icon-{name}:before", + "selector": ".mw-ui-icon-mf-{name}:before", "images": { "toc": "resources/mobile.toc.images/contents-ltr.svg" } }, "mobile.references.images": { "class": "ResourceLoaderImageModule", - "selector": ".mw-ui-icon-{name}:before", + "selector": ".mw-ui-icon-mf-{name}:before", "images": { "citation": "resources/mobile.references.images/cite.svg" } @@ -261,9 +261,11 @@ }, "mobile.startup.images": { "class": "ResourceLoaderImageModule", - "selector": ".mw-ui-icon-{name}:before", + "selector": ".mw-ui-icon-mf-{name}:before", "images": { - "error": "resources/mobile.startup.images/error.svg" + "error": "resources/mobile.startup.images/error.svg", +
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Merge branch 'master' into HEAD
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/402398 ) Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD Change-Id: I5ff0f2d4a5be37b5fa6ca250968f4059d29e6677 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/98/402398/1 -- To view, visit https://gerrit.wikimedia.org/r/402398 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ff0f2d4a5be37b5fa6ca250968f4059d29e6677 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove `noimages` flag from MobileView API
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/402130 ) Change subject: Remove `noimages` flag from MobileView API .. Remove `noimages` flag from MobileView API This flag currently only exists in the mobile view API - it's not used in web page views. It thus begs the question why are we keeping it around. Unless it's used by apps, I think we should remove this to make the MobileFormatter a little less complicated to maintain. Change-Id: I6067efc97420939f73e1fd55db3e4652c4c4b58c --- M includes/MobileFormatter.php M includes/api/ApiMobileView.php M includes/api/ApiParseExtender.php M tests/phpunit/MobileFormatterTest.php 4 files changed, 3 insertions(+), 74 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/30/402130/1 diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php index a8c2e91..fb9d636 100644 --- a/includes/MobileFormatter.php +++ b/includes/MobileFormatter.php @@ -179,10 +179,6 @@ $this->remove( $removableClasses ); } - if ( $this->removeMedia ) { - $this->doRemoveImages(); - } - $transformOptions = [ 'images' => $removeImages, 'references' => $removeReferences, @@ -214,7 +210,7 @@ private function filterContentInSection( $el, DOMDocument $doc, $sectionNumber, $options = [] ) { - if ( !$this->removeMedia && $options['images'] && $sectionNumber > 0 ) { + if ( $options['images'] && $sectionNumber > 0 ) { $this->doRewriteImagesForLazyLoading( $el, $doc ); } if ( $options['references'] ) { @@ -423,29 +419,6 @@ $noscript->appendChild( $img ); // Insert the HTML only markup before the placeholder $parent->insertBefore( $noscript, $imgPlaceholder ); - } - } - - /** -* Replaces images with [annotations from alt] -*/ - private function doRemoveImages() { - $doc = $this->getDoc(); - $domElemsToReplace = []; - foreach ( $doc->getElementsByTagName( 'img' ) as $element ) { - $domElemsToReplace[] = $element; - } - /** @var $element DOMElement */ - foreach ( $domElemsToReplace as $element ) { - $alt = $element->getAttribute( 'alt' ); - if ( $alt === '' ) { - $alt = '[' . wfMessage( 'mobile-frontend-missing-image' )->inContentLanguage() . ']'; - } else { - $alt = '[' . $alt . ']'; - } - $replacement = $doc->createElement( 'span', htmlspecialchars( $alt ) ); - $replacement->setAttribute( 'class', 'mw-mf-image-replacement' ); - $element->parentNode->replaceChild( $replacement, $element ); } } diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php index 5653b7a..ad7006e 100644 --- a/includes/api/ApiMobileView.php +++ b/includes/api/ApiMobileView.php @@ -121,7 +121,7 @@ 'ns' => $namespace, ] ); } - $data = $this->getData( $title, $params['noimages'], $params['revision'] ); + $data = $this->getData( $title, $params['revision'] ); $plainData = [ 'lastmodified', 'lastmodifiedby', 'revision', 'languagecount', 'hasvariants', 'displaytitle', 'id', 'contentmodel' ]; foreach ( $plainData as $name ) { @@ -530,12 +530,11 @@ /** * Get data of requested article. * @param Title $title -* @param boolean $noImages * @param null|int [$oldid] Revision ID to get the text from, passing null or 0 will * get the current revision (default value) * @return array */ - private function getData( Title $title, $noImages, $oldid = null ) { + private function getData( Title $title, $oldid = null ) { global $wgMemc; $mfConfig = MobileContext::singleton()->getMFConfig(); @@ -573,7 +572,6 @@ 'mf', 'mobileview', self::CACHE_VERSION, - $noImages, $touched, $this->noTransform, $this->file->getSha1(), @@ -593,7 +591,6 @@ 'mf', 'mobileview',
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Feature flag Wikidata Descriptions
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/402126 ) Change subject: Feature flag Wikidata Descriptions .. Feature flag Wikidata Descriptions Wikidata descriptions are not protected by a feature flag and still use the isBetaGroupMember logic. To allow us to list all features in beta we'll want to make this configurable like all the others. Bug: T182362 Change-Id: Ic17435b5a5594690f6930e16b0cf79cd65e4bbb0 --- M README.md M extension.json M includes/MobileContext.php 3 files changed, 19 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/26/402126/1 diff --git a/README.md b/README.md index 4522da1..5673227 100644 --- a/README.md +++ b/README.md @@ -558,6 +558,20 @@ * Type: `Boolean` * Default: `false` + $wgMFEnableWikidataDescriptions + +If set to true, wikidata descriptions as defined in $wgMFDisplayWikibaseDescriptions will show up +in the UI in the environment they have been told to target. + +* Type: `Array` +* Default: +```php + [ +'beta' => true, +'base' => false, + ] +``` + $wgMFDisplayWikibaseDescriptions Set which features will use Wikibase descriptions, e.g. diff --git a/extension.json b/extension.json index 97895e4..f9e69bd 100644 --- a/extension.json +++ b/extension.json @@ -1306,6 +1306,10 @@ "beta": true }, "MFUseWikibase": false, + "MFEnableWikidataDescriptions": { + "base": false, + "beta": true + }, "MFDisplayWikibaseDescriptions": { "search": false, "nearby": false, diff --git a/includes/MobileContext.php b/includes/MobileContext.php index 4f4e6af..048fdd1 100644 --- a/includes/MobileContext.php +++ b/includes/MobileContext.php @@ -1168,7 +1168,7 @@ } if ( - $this->isBetaGroupMember() || + $this->getConfigVariable( 'MFEnableWikidataDescriptions' ) || ( $config->get( 'MFUseWikibase' ) && $displayWikibaseDescriptions[ $feature ] ) ) { return true; -- To view, visit https://gerrit.wikimedia.org/r/402126 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic17435b5a5594690f6930e16b0cf79cd65e4bbb0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: List all the features in beta (UI)
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/402127 ) Change subject: List all the features in beta (UI) .. List all the features in beta (UI) This takes care of the UI portion of listing all features in beta. @todo pending mock * Fix icons * Add separater above "beta" * Add star * Make feedback link at bottom of screen configurable and check whether it should be a button or a link (and how OOUI allows that) Bug: T182362 Change-Id: If0855122e388e2f6742b19bffaf078e90b18809e --- M extension.json M i18n/en.json M i18n/qqq.json M includes/specials/SpecialMobileOptions.php A resources/mobile.special.mobileoptions.icons/mobileoptions.less M resources/mobile.special.mobileoptions.styles/mobileoptions.less 6 files changed, 178 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/27/402127/1 diff --git a/extension.json b/extension.json index f9e69bd..34f7d34 100644 --- a/extension.json +++ b/extension.json @@ -940,6 +940,14 @@ ], "position": "top" }, + "mobile.special.mobileoptions.icons": { + "class": "ResourceLoaderImageModule", + "selector": ".oo-ui-icon-{name}", + "images": { + "mf-tick": "resources/mobile.special.mobileoptions.icons/tick.svg", + "mf-lock": "resources/mobile.special.mobileoptions.icons/lock.svg" + } + }, "mobile.special.mobileoptions.scripts": { "targets": "mobile", "position": "top", diff --git a/i18n/en.json b/i18n/en.json index d946136..9217300 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -178,7 +178,7 @@ "mobile-frontend-nearby-requirements-guidance": "Try a different browser or enable JavaScript if you've disabled it.", "mobile-frontend-nearby-title": "Nearby", "mobile-frontend-news-items": "In the news", - "mobile-frontend-opt-in-explain": "Join {{SITENAME}} Beta to get access to the latest experimental features!", + "mobile-frontend-opt-in-explain": "{{SITENAME}} βeta is a way for you to try these experimental features and provide us with valuable feedback", "mobile-frontend-overlay-close": "Close", "mobile-frontend-overlay-continue": "Continue", "mobile-frontend-page-edit-summary": "Edit summary $1", @@ -199,7 +199,7 @@ "mobile-frontend-search-content-no-results": "'''{{int:mobile-frontend-search-content}}''' to see if this phrase appears anywhere.", "mobile-frontend-search-no-results": "No page with this title.", "mobile-frontend-settings-tagline": "Reading preferences", - "mobile-frontend-settings-beta": "Beta", + "mobile-frontend-settings-beta": "{{SITENAME}} βeta", "mobile-frontend-settings-site-description": "{{SITENAME}} is available in $1 {{PLURAL:$1|language|languages}}. All available versions are listed below", "mobile-frontend-settings-site-header": "{{SITENAME}} Languages", "mobile-frontend-settings-save": "Settings were saved successfully.", @@ -297,5 +297,10 @@ "mobile-frontend-panel-betaoptin-msg": "Do you want to try some new features? By joining the beta, you will get access to experimental features, at the risk of encountering bugs and issues.", "mobile-frontend-search-feedback-link-text": "Give us your feedback.", "mobile-frontend-search-feedback-prompt": "Couldn't find what you were looking for?", - "mobile-frontend-notifications-filter-title": "Filter notifications" -} \ No newline at end of file + "mobile-frontend-notifications-filter-title": "Filter notifications", + "mobile-frontend-mobile-option-MFLazyLoadReferences": "Lazy load references", + "mobile-frontend-mobile-option-MFEnableWikidataDescriptions": "Title descriptions", + "mobile-frontend-mobile-option-MFEnableWikidataDescriptions-description": "Learn about the subject of the article with a short description below the title", + "mobile-frontend-mobile-option-MFLazyLoadReferences-description": "Load article references only when needed", + "mobile-frontend-send-feedback": "Send feedback" +} diff --git a/i18n/qqq.json b/i18n/qqq.json index ab92dfc..91f2348 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -298,5 +298,10 @@ "mobile-frontend-panel-betaoptin-msg": "Message in panel asking if user wants to opt in to beta.", "mobile-frontend-search-feedback-link-text": "Text of anchor linking to a form for the user to give feedback on search results.", "mobile-frontend-search-feedback-prompt": "Text shown in front of an anchor linking to a form for the user to give feedback on search results.", -
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Update: hide section expansion option on large displays
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/402113 ) Change subject: Update: hide section expansion option on large displays .. Update: hide section expansion option on large displays On large displays, don't show the "expand all sections" setting on Special:MobileOptions. This option is only considered for small displays. Bug: T183493 Change-Id: I8e2beb2a6d4466f563759561a2c3e225deeae620 --- M resources/mobile.special.mobileoptions.scripts/mobileoptions.js M resources/mobile.toggle/toggle.js 2 files changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/13/402113/1 diff --git a/resources/mobile.special.mobileoptions.scripts/mobileoptions.js b/resources/mobile.special.mobileoptions.scripts/mobileoptions.js index a4be225..944d7a1 100644 --- a/resources/mobile.special.mobileoptions.scripts/mobileoptions.js +++ b/resources/mobile.special.mobileoptions.scripts/mobileoptions.js @@ -1,5 +1,6 @@ ( function ( M, $ ) { var storage = mw.storage, + browser = M.require( 'mobile.startup/Browser' ).getSingleton(), toast = M.require( 'mobile.startup/toast' ), EXPAND_SECTIONS_KEY = 'expandSections', msg = mw.msg, @@ -161,7 +162,11 @@ }, 250 ); } ); - if ( mw.config.get( 'wgMFExpandAllSectionsUserOption' ) ) { + if ( mw.config.get( 'wgMFExpandAllSectionsUserOption' ) && + // Don't show this option on large screens since it's only honored for small screens. This + // logic should be kept in sync with Toggle._enable(). + !browser.isWideScreen() + ) { addExpandAllSectionsToForm( $form ); } diff --git a/resources/mobile.toggle/toggle.js b/resources/mobile.toggle/toggle.js index 621c52f..d325992 100644 --- a/resources/mobile.toggle/toggle.js +++ b/resources/mobile.toggle/toggle.js @@ -298,7 +298,9 @@ enableKeyboardActions( self, $heading ); if ( !isReferenceSection && ( !isClosed && browser.isWideScreen() || expandSections ) ) { - // Expand sections by default on wide screen devices or if the expand sections setting is set + // Expand sections by default on wide screen devices or if the expand sections setting is + // set. The wide screen logic for determining whether to collapse sections initially + // should be kept in sync with mobileoptions#initLocalStorageElements(). self.toggle( $heading ); } } -- To view, visit https://gerrit.wikimedia.org/r/402113 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e2beb2a6d4466f563759561a2c3e225deeae620 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: JdlrobsonGerrit-Reviewer: Sniedzielski ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Add debugging information to flakey test
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/401821 ) Change subject: Add debugging information to flakey test .. Add debugging information to flakey test Occasionally for unknown reasons this test fails to make an assertion. Rather than doing that we'll make an assertion that always fails with the exception that caused it. This should help us identify and fix the culprit. Bug: T179959 Change-Id: I0c1d57dd0292bef605f05a22f984cd81b0131a96 --- M tests/qunit/mobile.references.gateway/test_ReferencesMobileViewGateway.js 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/21/401821/1 diff --git a/tests/qunit/mobile.references.gateway/test_ReferencesMobileViewGateway.js b/tests/qunit/mobile.references.gateway/test_ReferencesMobileViewGateway.js index 79511ca..21ec573 100644 --- a/tests/qunit/mobile.references.gateway/test_ReferencesMobileViewGateway.js +++ b/tests/qunit/mobile.references.gateway/test_ReferencesMobileViewGateway.js @@ -69,7 +69,9 @@ return referencesGateway.getReference( '#cite_note-1', page ).always( function () { return referencesGateway.getReference( '#cite_note-2', page ).done( function ( ref ) { assert.strictEqual( ref.text, 'real lazy 2' ); - } ); + } ).catch( function ( err ) { + assert.ok( false, err ); + } ) } ); } ); -- To view, visit https://gerrit.wikimedia.org/r/401821 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c1d57dd0292bef605f05a22f984cd81b0131a96 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: LegacyMainPageTransform
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/401786 ) Change subject: Hygiene: LegacyMainPageTransform .. Hygiene: LegacyMainPageTransform The old way was a little hacky and returned a DOMNode. Instead of doing that we replace the existing body with the new body and modify the main page in place. Change-Id: Icc3dd4ee8fe336102f514af0350c79e3d16cb0fa --- M includes/MobileFormatter.php A includes/transforms/LegacyMainPageTransform.php 2 files changed, 111 insertions(+), 85 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/86/401786/1 diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php index 2ed464c..4db2f63 100644 --- a/includes/MobileFormatter.php +++ b/includes/MobileFormatter.php @@ -5,6 +5,7 @@ use MobileFrontend\Transforms\MoveLeadParagraphTransform; use MobileFrontend\Transforms\AddMobileTocTransform; use MobileFrontend\Transforms\NoTransform; +use MobileFrontend\Transforms\LegacyMainPageTransform; /** * Converts HTML into a mobile-friendly version @@ -457,94 +458,12 @@ */ public function getText( $element = null ) { if ( $this->mainPage ) { - $element = $this->parseMainPage( $this->getDoc() ); + $transform = new LegacyMainPageTransform(); + $doc = $this->getDoc(); + $transform->transform( $doc->getElementsByTagName( 'body' )->item( 0 ) ); } return parent::getText( $element ); - } - - /** -* Returns interface message text -* @param string $key Message key -* @return string Wiki text -*/ - protected function msg( $key ) { - return wfMessage( $key )->text(); - } - - /** -* Performs transformations specific to main page -* @param DOMDocument $mainPage Tree to process -* @return DOMElement|null -*/ - protected function parseMainPage( DOMDocument $mainPage ) { - $featuredArticle = $mainPage->getElementById( 'mp-tfa' ); - $newsItems = $mainPage->getElementById( 'mp-itn' ); - $centralAuthImages = $mainPage->getElementById( 'central-auth-images' ); - - // Collect all the Main Page DOM elements that have an id starting with 'mf-' - $xpath = new DOMXpath( $mainPage ); - $elements = $xpath->query( '//*[starts-with(@id, "mf-")]' ); - - // These elements will be handled specially - $commonAttributes = [ 'mp-tfa', 'mp-itn' ]; - - // Start building the new Main Page content in the $content var - $content = $mainPage->createElement( 'div' ); - $content->setAttribute( 'id', 'mainpage' ); - - // If there is a featured article section, add it to the new Main Page content - if ( $featuredArticle ) { - $h2FeaturedArticle = $mainPage->createElement( - 'h2', - $this->msg( 'mobile-frontend-featured-article' ) - ); - $content->appendChild( $h2FeaturedArticle ); - $content->appendChild( $featuredArticle ); - } - - // If there is a news section, add it to the new Main Page content - if ( $newsItems ) { - $h2NewsItems = $mainPage->createElement( 'h2', $this->msg( 'mobile-frontend-news-items' ) ); - $content->appendChild( $h2NewsItems ); - $content->appendChild( $newsItems ); - } - - // Go through all the collected Main Page DOM elements and format them for mobile - /** @var $element DOMElement */ - foreach ( $elements as $element ) { - if ( $element->hasAttribute( 'id' ) ) { - $id = $element->getAttribute( 'id' ); - // Filter out elements processed specially - if ( !in_array( $id, $commonAttributes ) ) { - // Convert title attributes into h2 headers - $sectionTitle = $element->hasAttribute( 'title' ) ? $element->getAttribute( 'title' ) : ''; - if ( $sectionTitle !== '' ) { - $element->removeAttribute( 'title' ); - $h2UnknownMobileSection = - $mainPage->createElement( 'h2', htmlspecialchars( $sectionTitle ) ); - $content->appendChild( $h2UnknownMobileSection ); -
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Begin refactoring of MobileFormatter mega class
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/401776 ) Change subject: Hygiene: Begin refactoring of MobileFormatter mega class .. Hygiene: Begin refactoring of MobileFormatter mega class After a discussion with Piotr we agreed that the MobileFormatter code is becoming unmanageable and hard to test. Going forward we will aim to reduce all transforms to simple classes that take a DomElement and transform it into another DomElement. This will improve testability and sanity. As a first pass we will only update the lead paragraph transform given that we are currently working on improving that feature in T170006 Bug: T170006 Change-Id: I1fb2dc9e7ad1fe0431819ce3ca6295b3df8410e0 --- M extension.json M includes/MobileFormatter.php A includes/transforms/IMobileTransform.php A includes/transforms/MoveLeadParagraphTransform.php A tests/phpunit/transforms/MoveLeadParagraphTransformTest.php 5 files changed, 176 insertions(+), 92 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/76/401776/1 diff --git a/extension.json b/extension.json index d650d4d..351d06e 100644 --- a/extension.json +++ b/extension.json @@ -45,6 +45,9 @@ "ExtensionMessagesFiles": { "MobileFrontendAlias": "MobileFrontend.alias.php" }, + "AutoloadNamespaces": { + "MobileFrontend\\Transforms\\": "includes/transforms/" + }, "AutoloadClasses": { "ExtMobileFrontend": "includes/MobileFrontend.body.php", "MobileFrontendHooks": "includes/MobileFrontend.hooks.php", diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php index cfabb07..7a39d4d 100644 --- a/includes/MobileFormatter.php +++ b/includes/MobileFormatter.php @@ -2,6 +2,7 @@ use HtmlFormatter\HtmlFormatter; use MobileFrontend\ContentProviders\IContentProvider; +use MobileFrontend\Transforms\MoveLeadParagraphTransform; /** * Converts HTML into a mobile-friendly version @@ -218,94 +219,6 @@ } } - /** -* Move the first paragraph in the lead section above the infobox -* -* In order for a paragraph to be moved the following conditions must be met: -* - the lead section contains at least one infobox; -* - the paragraph doesn't already appear before the first infobox -* if any in the DOM; -* - the paragraph contains text content, e.g. no ; -* - the paragraph doesn't contain coordinates, i.e. span#coordinates. -* - article belongs to the MAIN namespace -* -* Additionally if paragraph immediate sibling is a list (ol or ul element), the list -* is also moved along with paragraph above infobox. -* -* Note that the first paragraph is not moved before hatnotes, or mbox or other -* elements that are not infoboxes. -* -* @param DOMElement $leadSectionBody -* @param DOMDocument $doc Document to which the section belongs -*/ - private function moveFirstParagraphBeforeInfobox( $leadSectionBody, $doc ) { - // Move lead parapgraph only on pages in MAIN namespace (see @T163805) - if ( $this->title->getNamespace() !== NS_MAIN ) { - return; - } - $xPath = new DOMXPath( $doc ); - // Find infoboxes and paragraphs that have text content, i.e. paragraphs - // that are not empty nor are wrapper paragraphs that contain span#coordinates. - $infoboxAndParagraphs = $xPath->query( - './table[contains(@class,"infobox")] | ./p[string-length(text()) > 0]', - $leadSectionBody - ); - // We need both an infobox and a paragraph and the first element of our query result - // ought to be an infobox. - if ( $infoboxAndParagraphs->length >= 2 && - $infoboxAndParagraphs->item( 0 )->nodeName == 'table' - ) { - $firstP = null; - for ( $i = 1; $i < $infoboxAndParagraphs->length; $i++ ) { - if ( $infoboxAndParagraphs->item( $i )->nodeName == 'p' ) { - $firstP = $infoboxAndParagraphs->item( $i ); - break; - } - } - if ( $firstP ) { - $listElementAfterParagraph = null; - $where = $infoboxAndParagraphs->item( 0 ); - - $elementAfterParagraphQuery = $xPath->query( 'following-sibling::*[1]', $firstP ); - if ( $elementAfterParagraphQuery->length > 0 ) { -
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Fix and restrict sniffs to certain files
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/401625 ) Change subject: Fix and restrict sniffs to certain files .. Fix and restrict sniffs to certain files Rather than disabling all sniffs globally, limit certain sniffs to certain "special" PHP files. Fix remaining documentation and visibility sniffs to add context to various methods. Bug: T170579 Change-Id: Idd9ab3c0764b31b1e682a0a79b1e7c3ba8f06c61 --- M .phpcs.xml M includes/MobileContext.php M includes/MobileFormatter.php M includes/api/ApiMobileView.php M includes/devices/DeviceDetector.php M includes/devices/DeviceDetectorService.php M includes/diff/InlineDiffFormatter.php M includes/specials/SpecialMobileWatchlist.php 8 files changed, 41 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/25/401625/1 diff --git a/.phpcs.xml b/.phpcs.xml index 6948f7c..7e5740e 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -1,14 +1,24 @@ - - - - MobileFrontend\.alias\.php + + tests/phpunit/* + includes/MobileFrontend\.body\.php + includes/MobileFrontend\.hooks\.php + includes/MobileFrontend\.skin\.hooks\.php + + + tests/phpunit/* + + + includes/MobileFrontend\.body\.php + includes/MobileFrontend\.hooks\.php + includes/MobileFrontend\.skin\.hooks\.php + . diff --git a/includes/MobileContext.php b/includes/MobileContext.php index a788387..367a962 100644 --- a/includes/MobileContext.php +++ b/includes/MobileContext.php @@ -815,7 +815,7 @@ /** * Take a URL and return a copy that removes any mobile tokens -* @param string $url +* @param string $url representing a page on the mobile domain e.g. `en.m.wikipedia.org/` * @return string */ public function getDesktopUrl( $url ) { @@ -1050,8 +1050,8 @@ /** * Add key/value pairs for analytics purposes to $this->analyticsLogItems -* @param string $key -* @param string $val +* @param string $key for in `X-Analytics: =` +* @param string $val for in `X-Analytics: =` */ public function addAnalyticsLogItem( $key, $val ) { $key = trim( $key ); diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php index cfabb07..2aafd50 100644 --- a/includes/MobileFormatter.php +++ b/includes/MobileFormatter.php @@ -89,7 +89,8 @@ /** * Creates and returns a MobileFormatter * -* @param MobileContext $context +* @param MobileContext $context in which the page is being rendered. Needed to access page title +* and MobileFrontend configuration. * @param IContentProvider $provider ContentProvider interface * @param bool $enableSections (optional) * whether to wrap the content of sections @@ -640,7 +641,8 @@ * that the section bodies are clearly defined (to be "expandable" for * example). * -* @param DOMDocument $doc +* @param DOMDocument $doc representing the HTML of the current article. In the HTML the sections +* should not be wrapped. * @param DOMElement[] $headings The headings returned by * {@see MobileFormatter::getHeadings} * @param array $transformOptions Options to pass when transforming content per section diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php index 5653b7a..51448b9 100644 --- a/includes/api/ApiMobileView.php +++ b/includes/api/ApiMobileView.php @@ -469,7 +469,8 @@ } /** -* @param WikiPage $wikiPage +* Call makeParserOptions on a WikiPage with the wrapper output class disabled. +* @param WikiPage $wikiPage to call makeParserOptions on. * @return ParserOptions */ protected function makeParserOptions( WikiPage $wikiPage ) { diff --git a/includes/devices/DeviceDetector.php b/includes/devices/DeviceDetector.php index aa5399a..f5ff466 100644 --- a/includes/devices/DeviceDetector.php +++ b/includes/devices/DeviceDetector.php @@ -41,9 +41,10 @@ * `$_SERVER` superglobal within its API, it's expected to be passed as * additional context. * -* @param WebRequest $request +* @param WebRequest $request for the current page view. The HTTP headers of this request +* will be used to determine whether the page view should redirect to mobile * @param array $server Per the above, the `$_SERVER` superglobal * @return DeviceProperties|null */ - function detectDeviceProperties(
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Revert "Fix infobox styles to work well with multiple column...
Hello Divadsn, Pmiazga, jenkins-bot, I'd like you to do a code review. Please visit https://gerrit.wikimedia.org/r/401622 to review the following change. Change subject: Revert "Fix infobox styles to work well with multiple column infobox rows" .. Revert "Fix infobox styles to work well with multiple column infobox rows" This reverts commit b3dc650f15fed96c2c56a052f6c3cfe9d4035397. Change-Id: I18b4cfd30d0703844748a2b4fb934f5824537970 --- M resources/skins.minerva.content.styles/hacks.less M resources/skins.minerva.tablet.styles/hacks.less 2 files changed, 23 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/22/401622/1 diff --git a/resources/skins.minerva.content.styles/hacks.less b/resources/skins.minerva.content.styles/hacks.less index 3e5c78d..ce7b225 100644 --- a/resources/skins.minerva.content.styles/hacks.less +++ b/resources/skins.minerva.content.styles/hacks.less @@ -42,31 +42,29 @@ margin-left: 0 !important; margin-right: 0 !important; - &.infobox > tbody > tr > td, - &.infobox > tbody > tr > th { - flex: 1 0; - } - &.infobox { - display: flex; - flex: 1 1 100%; - flex-flow: column nowrap; + font-size: 90%; + position: relative; + border: 1px solid @colorGray14; + margin-bottom: 2em; + text-align: left; + background-color: @colorGray15; - td:only-child, - th:only-child { + th, td { + vertical-align: top; + border: 0; + border-bottom: 1px solid @colorGray14; + padding: 7px 10px; + } + + td { width: 100%; } - } - &.infobox > tbody { - display: flex; - flex-flow: column nowrap; - } - - &.infobox > tbody > tr { - min-width: 100%; - display: flex; - flex-flow: row nowrap; + tr:last-child th, + tr:last-child td { + border: 0; + } } } } diff --git a/resources/skins.minerva.tablet.styles/hacks.less b/resources/skins.minerva.tablet.styles/hacks.less index 102189a..c833a7b 100644 --- a/resources/skins.minerva.tablet.styles/hacks.less +++ b/resources/skins.minerva.tablet.styles/hacks.less @@ -22,6 +22,11 @@ width: auto !important; float: right !important; clear: right !important; + + td { + width: auto; + } + } // banners inserted by other extensions, i.e. Zero #mw-mf-page-center .mw-mf-banner { -- To view, visit https://gerrit.wikimedia.org/r/401622 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18b4cfd30d0703844748a2b4fb934f5824537970 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: master Gerrit-Owner: JdlrobsonGerrit-Reviewer: Divadsn Gerrit-Reviewer: Pmiazga Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Merge branch 'master' into HEAD
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/401618 ) Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD Change-Id: I11c43109b9ca5ce5d4827a55b33613a69266aaed --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/18/401618/1 -- To view, visit https://gerrit.wikimedia.org/r/401618 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I11c43109b9ca5ce5d4827a55b33613a69266aaed Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[specialpages]: Merge branch 'master' into HEAD
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/401617 ) Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD Change-Id: I220fbc57ee20d2a6717b39dba809401de2207ce0 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/17/401617/1 -- To view, visit https://gerrit.wikimedia.org/r/401617 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I220fbc57ee20d2a6717b39dba809401de2207ce0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Treat mw-stack elements as if they are infoboxes
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399562 ) Change subject: Treat mw-stack elements as if they are infoboxes .. Treat mw-stack elements as if they are infoboxes If the first element of the page is an element with class mw-stack that contains an infobox we should treat the entire element as if it's an infobox and hoist the paragraph. Bug: T170006 Change-Id: I212504e9b1f9b055ab25c15645364a8a27ba6f91 --- M includes/MobileFormatter.php M tests/phpunit/MobileFormatterTest.php 2 files changed, 82 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/62/399562/1 diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php index 938f90b..f784f61 100644 --- a/includes/MobileFormatter.php +++ b/includes/MobileFormatter.php @@ -224,6 +224,21 @@ } /** +* Determine whether a selected element can be classed as a "infobox" +* +* @param DOMElement $element +* @return bool +*/ + private function isInfoboxElement( $element ) { + return $element->nodeName == 'table' || + ( + strpos( $element->getAttribute( 'class' ), "mw-stack" ) !== false && + $element->getElementsByTagName( 'table' )->length === 1 && + $this->isInfoboxElement( $element->getElementsByTagName( 'table' )->item( 0 ) ) + ); + } + + /** * Move the first paragraph in the lead section above the infobox * * In order for a paragraph to be moved the following conditions must be met: @@ -249,16 +264,16 @@ return; } $xPath = new DOMXPath( $doc ); - // Find infoboxes and paragraphs that have text content, i.e. paragraphs + // Find infoboxes, certain wrapped infoboxes, and paragraphs that have text content, i.e. paragraphs // that are not empty nor are wrapper paragraphs that contain span#coordinates. $infoboxAndParagraphs = $xPath->query( - './table[contains(@class,"infobox")] | ./p[string-length(text()) > 0]', + './div[contains(@class,"mw-stack")] | ./table[contains(@class,"infobox")] | ./p[string-length(text()) > 0]', $leadSectionBody ); // We need both an infobox and a paragraph and the first element of our query result // ought to be an infobox. if ( $infoboxAndParagraphs->length >= 2 && - $infoboxAndParagraphs->item( 0 )->nodeName == 'table' + $this->isInfoboxElement( $infoboxAndParagraphs->item( 0 ) ) ) { $firstP = null; for ( $i = 1; $i < $infoboxAndParagraphs->length; $i++ ) { @@ -296,15 +311,19 @@ /** * Finds all infoboxes which are one or more levels deep in $xPath content. When at least one -* element is found - log the page title and revision +* element is found and that is not wrapped in an allowed element e.g. mw-stack or another infobox, +* log the page title and revision * * @see https://phabricator.wikimedia.org/T149884 * @param $leadSectionBody * @param DOMXPath $xPath */ private function logInfoboxesWrappedInContainers( $leadSectionBody, DOMXPath $xPath ) { - $infoboxes = $xPath->query( './*//table[contains(@class,"infobox")]' . - '[not(ancestor::table[contains(@class,"infobox")])]', $leadSectionBody ); + $query = './*//table[contains(@class,"infobox")]' . + '[not(ancestor::div[contains(@class,"mw-stack")]) and' . + 'not(ancestor::table[contains(@class,"infobox")])]'; + + $infoboxes = $xPath->query( $query, $leadSectionBody ); if ( $infoboxes->length > 0 ) { \MediaWiki\Logger\LoggerFactory::getInstance( 'mobile' )->info( "Found infobox wrapped with container on {$this->title} (rev:{$this->revId})" diff --git a/tests/phpunit/MobileFormatterTest.php b/tests/phpunit/MobileFormatterTest.php index 702d0c6..3c11200 100644 --- a/tests/phpunit/MobileFormatterTest.php +++ b/tests/phpunit/MobileFormatterTest.php @@ -675,6 +675,7 @@ // MobileFormatter#moveFirstParagraphBeforeInfobox will trigger a "Not // Found Error" warning. // Do not touch infoboxes that are not immediate children of the lead section + // unless... (see next test T170006)
[MediaWiki-commits] [Gerrit] mediawiki...PageImages[master]: Fix remaining php sniffs
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399559 ) Change subject: Fix remaining php sniffs .. Fix remaining php sniffs Bug: T170583 Change-Id: I3db5de11618f952eb7974c456445eaa1d5e4e6a4 --- M .phpcs.xml M extension.json A maintenance/InitImageData.php A tests/phpunit/ApiQueryPageImagesProxy.php M tests/phpunit/ApiQueryPageImagesTest.php 5 files changed, 144 insertions(+), 27 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageImages refs/changes/59/399559/1 diff --git a/.phpcs.xml b/.phpcs.xml index b5fc9ef..1a6c997 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -1,10 +1,6 @@ - - - - - + . diff --git a/extension.json b/extension.json index 9e53807..02effd5 100644 --- a/extension.json +++ b/extension.json @@ -22,7 +22,8 @@ }, "AutoloadClasses": { "PageImages": "includes/PageImages.php", - "PageImages\\PageImages": "includes/PageImages.php" + "PageImages\\PageImages": "includes/PageImages.php", + "PageImages\\Tests\\ApiQueryPageImagesProxy": "tests/phpunit/ApiQueryPageImagesProxy.php" }, "Hooks": { "AfterParserFetchFileAndTitle": "PageImages\\Hooks\\ParserFileProcessingHookHandlers::onAfterParserFetchFileAndTitle", diff --git a/maintenance/InitImageData.php b/maintenance/InitImageData.php new file mode 100644 index 000..329b525 --- /dev/null +++ b/maintenance/InitImageData.php @@ -0,0 +1,114 @@ +mDescription = 'Initializes PageImages data'; + $this->addOption( 'namespaces', + 'Comma-separated list of namespace(s) to refresh', false, true ); + $this->addOption( 'earlier-than', + 'Run only on pages earlier than this timestamp', false, true ); + $this->addOption( 'start', 'Starting page ID', false, true ); + $this->addOption( 'queue-pressure', 'Maximum number of jobs to enqueue at a time. ' . + 'If not provided or 0 will be run in-process.', false, true ); + $this->addOption( 'quiet', "Don't report on job queue pressure" ); + $this->setBatchSize( 100 ); + } + + /** +* Do the actual work of filling out page images +* @return null +*/ + public function execute() { + global $wgPageImagesNamespaces; + + $lastId = $this->getOption( 'start', 0 ); + $isQuiet = $this->getOption( 'quiet', false ); + $queue = null; + $maxPressure = $this->getOption( 'queue-pressure', 0 ); + if ( $maxPressure > 0 ) { + $queue = JobQueueGroup::singleton(); + } + + do { + $tables = [ 'page', 'imagelinks' ]; + $conds = [ + 'page_id > ' . (int)$lastId, + 'il_from IS NOT NULL', + 'page_is_redirect' => 0, + ]; + $fields = [ 'page_id' ]; + $joinConds = [ 'imagelinks' => [ + 'LEFT JOIN', 'page_id = il_from', + ] ]; + + $dbr = wfGetDB( DB_REPLICA ); + if ( $this->hasOption( 'namespaces' ) ) { + $ns = explode( ',', $this->getOption( 'namespaces' ) ); + $conds['page_namespace'] = $ns; + } else { + $conds['page_namespace'] = $wgPageImagesNamespaces; + } + if ( $this->hasOption( 'earlier-than' ) ) { + $conds[] = 'page_touched < ' + . $dbr->addQuotes( $this->getOption( 'earlier-than' ) ); + } + $res = $dbr->select( $tables, $fields, $conds, __METHOD__, + [ 'LIMIT' => $this->mBatchSize, 'ORDER_BY' => 'page_id', 'GROUP BY' => 'page_id' ], + $joinConds + ); + $pageIds = []; + foreach ( $res as $row ) { + $pageIds[] = $row->page_id; + } + $job = new InitImageDataJob( Title::newMainPage(), [ 'page_ids' => $pageIds ] ); + if ( $queue === null ) { + $job->run(); + } else { + $queue->push( $job ); + $this->waitForMaxPressure( $queue, $maxPressure, $isQuiet ); + } +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Experiment with npm assets
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399554 ) Change subject: Experiment with npm assets .. Experiment with npm assets Change-Id: I7c875a3b0a3c3bc358dec7002c02f26cacc04d91 --- M composer.json M resources/Resources.php D resources/lib/jquery/jquery.js 3 files changed, 2 insertions(+), 10,254 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/54/399554/1 -- To view, visit https://gerrit.wikimedia.org/r/399554 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c875a3b0a3c3bc358dec7002c02f26cacc04d91 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[firsterpaint]: Do not load overlay styles on page load
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399334 ) Change subject: Do not load overlay styles on page load .. Do not load overlay styles on page load * header > form rule no longer matches anything. * .overlay-header .overlay-title rule is not useful without JavaScript Change-Id: Ie69f6beaea25e9a04de7c87b0fe4252ddd39ebad --- M resources/skins.minerva.base.styles/ui.less M skinStyles/mobile.startup/Overlay.less 2 files changed, 16 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/34/399334/1 diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index 59b1f52..4a8805f 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -118,23 +118,6 @@ > .header-title { vertical-align: middle; } - - .header-action > * { - min-height: @headerHeight; - } -} - -.header > form, -.overlay-header .overlay-title { - padding: 0.15em 0; - - &:last-child { - // Reserve space to the right in case the search form in the header or - // overlay title in the overlay header is the last element. Use @iconGutterWidth - // because there is a hamburger or close/back icon next to this element and - // the space between them is exactly that. - padding-right: @iconGutterWidth; - } } #searchInput { diff --git a/skinStyles/mobile.startup/Overlay.less b/skinStyles/mobile.startup/Overlay.less index 3d44a02..f5d5239 100644 --- a/skinStyles/mobile.startup/Overlay.less +++ b/skinStyles/mobile.startup/Overlay.less @@ -4,6 +4,10 @@ .overlay { padding-top: @headerHeight; + .header-action > * { + min-height: @headerHeight; + } + > ul, button { width: @headerHeight; } @@ -24,6 +28,18 @@ } } +.overlay-header .overlay-title { + padding: 0.15em 0; + + &:last-child { + // Reserve space to the right in case the search form in the header or + // overlay title in the overlay header is the last element. Use @iconGutterWidth + // because there is a hamburger or close/back icon next to this element and + // the space between them is exactly that. + padding-right: @iconGutterWidth; + } +} + @media all and ( min-width: @width-breakpoint-desktop ) { .overlay-header { // Make sure the close button and secondary button icon images are aligned -- To view, visit https://gerrit.wikimedia.org/r/399334 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie69f6beaea25e9a04de7c87b0fe4252ddd39ebad Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: firsterpaint Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[firsterpaint]: Change way we lod mediawiki.ui.button
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399332 ) Change subject: Change way we lod mediawiki.ui.button .. Change way we lod mediawiki.ui.button Only load this via JavaScript. For less important buttons in secondary actions we style as minimilistically as possible so they are functional Change-Id: If291d88db9855f653c4ccd5da20c7882d44ef844 --- M includes/skins/SkinMinerva.php M resources/skins.minerva.base.styles/ui.less M skin.json 3 files changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/32/399332/1 diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index 854b04a..a8ea813 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -1443,7 +1443,6 @@ 'mediawiki.hlist', 'skins.minerva.tablet.styles', 'mediawiki.ui.icon', - 'mediawiki.ui.button', 'skins.minerva.icons.images', ]; if ( $title->isMainPage() ) { diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index 9634695..e9e8677 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -1,6 +1,8 @@ @import 'minerva.variables'; @import 'minerva.mixins'; @import 'mediawiki.mixins'; +@import 'mediawiki.ui/variables'; +@import 'mediawiki.ui/mixins'; /* stylelint-disable no-descending-specificity */ html, @@ -9,6 +11,14 @@ height: 100%; } +.mw-ui-button { + display: inline-block; + padding: 0.546875em 1em; + line-height: 1.286; + border-radius: @borderRadius; + .button-colors( @colorGray15, #fff, #d9d9d9 ); +} + body { background-color: @chromeColor; } diff --git a/skin.json b/skin.json index b7655a0..6c8c6e2 100644 --- a/skin.json +++ b/skin.json @@ -269,6 +269,7 @@ "desktop" ], "dependencies": [ + "mediawiki.ui.button", "mobile.init", "skins.minerva.scripts.styles", "skins.minerva.icons.images.scripts", -- To view, visit https://gerrit.wikimedia.org/r/399332 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If291d88db9855f653c4ccd5da20c7882d44ef844 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: firsterpaint Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[firsterpaint]: Move js-only css off critical path
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399329 ) Change subject: Move js-only css off critical path .. Move js-only css off critical path * there are no `input` elements in page-actions so remove outdated rule (last one we had was upload image button) * Move watchstar button page-action specific rule off critical path as will not apply to non-js users * cloaked-element is a creation of Skin.js and not used anywhere without JavaScript * position-fixed class is only used by JavaScript based components. Only exception in Special:MobileDiff which falls back gracefully * touch-events class is only added by Skin.js * Last modified bar can only become active with JS, so load the css for those styles via JavaScript * the truncated-text class is used by the main menu and last modified bar * multi-line and two-line classes are no longer used anywhere so removed (Note mw-mf-last-modified id element no longer exists) Before change: 9.2kb After: 9.1kb Change-Id: I885b5a23603dde7d2ce4f6be83534117905a9766 --- M resources/skins.minerva.base.styles/common.less M resources/skins.minerva.base.styles/footer.less M resources/skins.minerva.base.styles/pageactions.less M resources/skins.minerva.base.styles/ui.less A resources/skins.minerva.scripts.styles/styles.less M skin.json 6 files changed, 83 insertions(+), 91 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/29/399329/1 diff --git a/resources/skins.minerva.base.styles/common.less b/resources/skins.minerva.base.styles/common.less index cb0108a..7f56fa5 100644 --- a/resources/skins.minerva.base.styles/common.less +++ b/resources/skins.minerva.base.styles/common.less @@ -2,32 +2,6 @@ @import 'minerva.variables.less'; @import 'minerva.mixins.less'; -// Reusable components -// -// Styleguide 6. - -// Cloaked element -// -// Use this for elements that are clickable but not visible -// Examples: A file input who's parent is styled with an icon -// A shield that covers the entire screen and is made more opaque -// under a different circumstance -// -// Markup: -// -// -// -// -// Styleguide 6.1. -.cloaked-element { - opacity: 0; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; -} - .view-border-box *, .view-border-box { .box-sizing( border-box ); @@ -68,18 +42,6 @@ .no-js-only, .client-js .jsonly { display: inherit; -} - -/* stylelint-enable no-descending-specificity */ -.position-fixed { - // use !important to override more specific rules (e.g. in Overlay.less) - position: fixed !important; -} - -.touch-events { - :focus { - outline: 0; - } } // currently used to hide talk button diff --git a/resources/skins.minerva.base.styles/footer.less b/resources/skins.minerva.base.styles/footer.less index 51563b0..35f47c5 100644 --- a/resources/skins.minerva.base.styles/footer.less +++ b/resources/skins.minerva.base.styles/footer.less @@ -20,11 +20,6 @@ color: @lastModifiedBarTextColor; line-height: 1.5em; transition: background-color 0.2s ease, color 0.2s ease; - - &.active { - background-color: @lastModifiedBarActiveBackgroundColor; - color: #fff; - } } .last-modifier-tagline { diff --git a/resources/skins.minerva.base.styles/pageactions.less b/resources/skins.minerva.base.styles/pageactions.less index 0742202..2ff6bdc 100644 --- a/resources/skins.minerva.base.styles/pageactions.less +++ b/resources/skins.minerva.base.styles/pageactions.less @@ -63,16 +63,7 @@ margin-bottom: 0; float: right; - // FIXME: use .cloaked class - // file inputs are notoriously difficult to style - input { - opacity: 0; - } - - input, - a, - span, - button { + * { // Needed for non-JavaScript users position: absolute; display: block; @@ -82,12 +73,7 @@ margin: 0 0 8px; } - button { - text-indent: inherit; - outline: 0; - } - a, - button { + > * { cursor: pointer; } diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index 3a37d2a..c11ed59 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -60,18 +60,6 @@ padding-bottom: 5px; background-color: @colorGray14; } - - &.active { - -
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[firsterpaint]: Remove unused css rules
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399330 ) Change subject: Remove unused css rules .. Remove unused css rules * language-selector can only appear in secondary actions so only load rule on Main page * .no-js-only not used in MobileFrontend or Minerva * no-js-edit dates is no longer used to hide the edit icon (direct rule used instead) * Remove last-modified-bar rules from ui.less that are repeated inside footer less file * #mw-mf-last-modified id is no longer used post-footer rewrite * CSS rules for .mw-mf-banner are defined in Zero extension * mw-mf-image-replacement is no longer needed after we turned off the option to disable images in the mobile site Change-Id: I7abdbac4d2d16b931e2b110fcebf0dfc82146753 --- M resources/skins.minerva.base.styles/common.less M resources/skins.minerva.base.styles/pageactions.less M resources/skins.minerva.base.styles/ui.less M resources/skins.minerva.content.styles/links.less M resources/skins.minerva.editor/init.js M resources/skins.minerva.mainPage.styles/common.less M resources/skins.minerva.scripts.styles/styles.less M resources/skins.minerva.tablet.styles/common.less M resources/skins.minerva.tablet.styles/hacks.less 9 files changed, 5 insertions(+), 54 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/30/399330/1 diff --git a/resources/skins.minerva.base.styles/common.less b/resources/skins.minerva.base.styles/common.less index 7f56fa5..e2bbb17 100644 --- a/resources/skins.minerva.base.styles/common.less +++ b/resources/skins.minerva.base.styles/common.less @@ -7,15 +7,6 @@ .box-sizing( border-box ); } -.mw-mf-image-replacement { - font-style: italic; - color: @colorGray7; - text-decoration: underline; - border: dotted 1px @colorGray12; - padding: 10px; - display: inline-block; -} - textarea { padding: 5px 0 5px 5px; width: 100%; @@ -29,7 +20,6 @@ #toc, // We also need a more specific rule for tablet non-JS users who will load skins.minerva.tablet.styles .client-nojs .toc-mobile, -.client-js .no-js-only, .client-js .mw-redirectedfrom, // FIXME: Use generic rule for print stylesheets .printfooter, @@ -39,7 +29,6 @@ /* TODO: Fix specificity */ /* stylelint-disable no-descending-specificity */ -.no-js-only, .client-js .jsonly { display: inherit; } diff --git a/resources/skins.minerva.base.styles/pageactions.less b/resources/skins.minerva.base.styles/pageactions.less index 2ff6bdc..296bfec 100644 --- a/resources/skins.minerva.base.styles/pageactions.less +++ b/resources/skins.minerva.base.styles/pageactions.less @@ -13,10 +13,6 @@ display: none; } -#page-actions .nojs-edit { - display: inline-block; -} - .heading-holder { @pageActionsHeight: @pageActionFontSize + (2 * @iconGutterWidth); padding: @titleSectionSpacingTop 0 (@pageActionsHeight + 0.5em); diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index c11ed59..f3c4483 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -41,11 +41,6 @@ } .last-modified-bar { - background-color: transparent; - display: block; - color: @colorGray5; - transition: background-color 0.2s ease, color 0.2s ease; - a, a:visited { color: @colorGray5; @@ -53,12 +48,6 @@ &:nth-child( 2 ) { font-weight: bold; } - } - - #mw-mf-last-modified { - padding-top: 5px; - padding-bottom: 5px; - background-color: @colorGray14; } } @@ -268,9 +257,6 @@ a { margin: 10px 2px 2px 0; } - .language-selector { - margin-top: 1em; - } } // FIXME: Create generic class to represent both of these headers @@ -377,16 +363,9 @@ visibility: hidden; } -.content .nojs-edit { - display: inline-block !important; - visibility: visible; - float: right; -} - // It may be better to express these in a single class // or think about using extend or a mixin to stay with semantic selectors // https://css-tricks.com/the-extend-concept/ -.last-modified-bar #mw-mf-last-modified, #bodyContent .panel .content, .overlay .content-header, .overlay .panel, diff --git a/resources/skins.minerva.content.styles/links.less b/resources/skins.minerva.content.styles/links.less index db3860c..85aa1f1 100644 --- a/resources/skins.minerva.content.styles/links.less +++ b/resources/skins.minerva.content.styles/links.less @@ -38,8 +38,7 @@ } // Generic class name needed -.return-link, -#mw-mf-last-modified { +.return-link { display: block; font-size: 0.9em; margin-top: 1.5em; diff --git
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[firsterpaint]: Generalise page actions rule
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399336 ) Change subject: Generalise page actions rule .. Generalise page actions rule No need to have a whitelist of selectors Change-Id: I0b5d5339198bad252739a42a98d4aab622ed6864 --- D resources/skins.minerva.base.styles/icons.less 1 file changed, 0 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/36/399336/1 diff --git a/resources/skins.minerva.base.styles/icons.less b/resources/skins.minerva.base.styles/icons.less deleted file mode 100644 index e2b3baa..000 --- a/resources/skins.minerva.base.styles/icons.less +++ /dev/null @@ -1,10 +0,0 @@ -// FIXME: This file should be shared across repositories -@import 'minerva.variables'; -@import 'minerva.mixins'; -@import 'mediawiki.mixins'; - -// FIXME: Find better workaround for this -span.mw-ui-icon { - // a block inside an inline element is never a good idea - effects line height of mobile diff bytesadded class - display: inline-block; -} -- To view, visit https://gerrit.wikimedia.org/r/399336 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0b5d5339198bad252739a42a98d4aab622ed6864 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: firsterpaint Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[firsterpaint]: mw-ui-button-group only loaded where needed
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399333 ) Change subject: mw-ui-button-group only loaded where needed .. mw-ui-button-group only loaded where needed Change-Id: I2b363543d0356a18194a9d08922428a6cb944797 --- M resources/skins.minerva.base.styles/ui.less M skin.json M skinStyles/mobile.special.styles/minerva.less 3 files changed, 19 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/33/399333/1 diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index e9e8677..59b1f52 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -291,20 +291,6 @@ } } -// FIXME [mediawiki ui] These rules should not be needed in the mobile context -.mw-ui-button-group { - text-align: center; - - * { - float: none !important; - } - - // For talk and CTA drawer - .mw-ui-block { - width: auto; - } -} - // This is here rather than in mainmenu.less because we want to load these rules for non-js users too // Transparent shield hidden by default .transparent-shield, diff --git a/skin.json b/skin.json index 6c8c6e2..0a70fa2 100644 --- a/skin.json +++ b/skin.json @@ -106,7 +106,6 @@ "resources/skins.minerva.base.styles/ui.less", "resources/skins.minerva.base.styles/pageactions.less", "resources/skins.minerva.base.styles/common.less", - "resources/skins.minerva.base.styles/icons.less", "resources/skins.minerva.base.styles/images.less", "resources/skins.minerva.base.styles/footer.less", "resources/skins.minerva.base.styles/print/styles.less" diff --git a/skinStyles/mobile.special.styles/minerva.less b/skinStyles/mobile.special.styles/minerva.less index 8d78eaf..e4b1e72 100644 --- a/skinStyles/mobile.special.styles/minerva.less +++ b/skinStyles/mobile.special.styles/minerva.less @@ -1,5 +1,24 @@ @import 'minerva.variables'; +// FIXME [mediawiki ui] These rules should not be needed in the mobile context +.mw-ui-button-group { + text-align: center; + + * { + float: none !important; + } + + // For talk and CTA drawer + .mw-ui-block { + width: auto; + } +} + +span.mw-ui-icon { + // a block inside an inline element is never a good idea - effects line height of mobile diff bytesadded class + display: inline-block; +} + .ns-special { #content { @verticalPadding: 0.5em; -- To view, visit https://gerrit.wikimedia.org/r/399333 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b363543d0356a18194a9d08922428a6cb944797 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: firsterpaint Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[firsterpaint]: Restrict gallery styles to only pages which need it
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399337 ) Change subject: Restrict gallery styles to only pages which need it .. Restrict gallery styles to only pages which need it The mediawiki.page.gallery.styles module is only loaded when needed. Change-Id: I4afc91ad7f67ae66544708d25541b3e8dd247873 --- M resources/skins.minerva.content.styles/hacks.less M skin.json R skinStyles/mediawiki.page.gallery.styles/galleries.less A skinStyles/mediawiki.page.gallery.styles/tablet.less 4 files changed, 21 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/37/399337/1 diff --git a/resources/skins.minerva.content.styles/hacks.less b/resources/skins.minerva.content.styles/hacks.less index ce7b225..3b34000 100644 --- a/resources/skins.minerva.content.styles/hacks.less +++ b/resources/skins.minerva.content.styles/hacks.less @@ -135,17 +135,6 @@ // Hacks to render galleries and multicol tables better on mobile @media all and ( max-width: @deviceWidthTablet ) { - // Center images that might be less than the screen width. - // Image will appear centered and caption will take up full screen. - .gallery { - .gallerybox { - width: 100% !important; - div { - width: 100% !important; - } - } - } - .content { table { // Make {{col-beg}}, {{col-break}}, and {{col-end}} templates display single column tables diff --git a/skin.json b/skin.json index 7701d90..86a8b0d 100644 --- a/skin.json +++ b/skin.json @@ -39,6 +39,10 @@ }, "ResourceModuleSkinStyles": { "minerva": { + "mediawiki.page.gallery.styles": [ + "skinStyles/mediawiki.page.gallery.styles/galleries.less", + "skinStyles/mediawiki.page.gallery.styles/tablet.less" + ], "mediawiki.special.userlogin.common.styles": [ "skinStyles/mediawiki.special.userlogin.common.styles/minerva.less" ], diff --git a/resources/skins.minerva.content.styles/galleries.less b/skinStyles/mediawiki.page.gallery.styles/galleries.less similarity index 100% rename from resources/skins.minerva.content.styles/galleries.less rename to skinStyles/mediawiki.page.gallery.styles/galleries.less diff --git a/skinStyles/mediawiki.page.gallery.styles/tablet.less b/skinStyles/mediawiki.page.gallery.styles/tablet.less new file mode 100644 index 000..7bc3e97 --- /dev/null +++ b/skinStyles/mediawiki.page.gallery.styles/tablet.less @@ -0,0 +1,17 @@ +@import 'minerva.variables'; +@import 'minerva.mixins'; + +// Hacks to render galleries and multicol tables better on mobile +@media all and ( max-width: @deviceWidthTablet ) { + + // Center images that might be less than the screen width. + // Image will appear centered and caption will take up full screen. + .gallery { + .gallerybox { + width: 100% !important; + div { + width: 100% !important; + } + } + } +} -- To view, visit https://gerrit.wikimedia.org/r/399337 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4afc91ad7f67ae66544708d25541b3e8dd247873 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: firsterpaint Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[firsterpaint]: Only load notification icon for logged in users
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399331 ) Change subject: Only load notification icon for logged in users .. Only load notification icon for logged in users Change-Id: Ia72e7e45d276e8aac1ff5471bf6158705c7b5f99 --- M includes/skins/SkinMinerva.php M resources/skins.minerva.base.styles/ui.less A resources/skins.minerva.loggedin.styles/styles.less M skin.json 4 files changed, 71 insertions(+), 58 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/31/399331/1 diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index 439d47c..854b04a 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -1452,6 +1452,9 @@ $styles[] = 'skins.minerva.userpage.styles'; $styles[] = 'skins.minerva.userpage.icons'; } + if ( !$this->getUser()->isAnon() ) { + $styles[] = 'skins.minerva.loggedin.styles'; + } return $styles; } diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index f3c4483..9634695 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -281,64 +281,6 @@ } } -.notification-count { - @circleSize: 24px; - @borderSize: 2px; - margin: auto; - height: @circleSize; - background: @notificationBackgroundRead; - color: @notificationColorRead; - cursor: pointer; - - .circle { - border-radius: 50%; - border: @borderSize solid @notificationColorRead; - margin: auto; - height: @circleSize - @borderSize; - width: @circleSize - @borderSize; - - /* stylelint-disable declaration-block-no-duplicate-properties */ - // Center the text number inside the circle - display: block; // Fallback for old iOS - text-align: center; // Fallback for old iOS - display: -webkit-box; - display: flex; - -webkit-box-align: center; - align-items: center; - -webkit-box-pack: center; - justify-content: center; - - span { - font-weight: bold; - font-size: 13px; - line-height: 1; - letter-spacing: -0.5px; - } - } - - &.notification-unseen { - color: @notificationColorUnread; - - .circle { - background: @notificationBackgroundUnread; - border-color: @notificationBackgroundUnread; - } - } - - // FIXME: There must be a better way of doing this - &.max { - right: 0.2em; - width: 2em; - height: 2em; - line-height: 2em; - font-size: 0.7em; - } - - &:hover { - text-decoration: none; - } -} - // FIXME [mediawiki ui] These rules should not be needed in the mobile context .mw-ui-button-group { text-align: center; diff --git a/resources/skins.minerva.loggedin.styles/styles.less b/resources/skins.minerva.loggedin.styles/styles.less new file mode 100644 index 000..4fbcf84 --- /dev/null +++ b/resources/skins.minerva.loggedin.styles/styles.less @@ -0,0 +1,59 @@ +@import 'minerva.variables'; + +.notification-count { + @circleSize: 24px; + @borderSize: 2px; + margin: auto; + height: @circleSize; + background: @notificationBackgroundRead; + color: @notificationColorRead; + cursor: pointer; + + .circle { + border-radius: 50%; + border: @borderSize solid @notificationColorRead; + margin: auto; + height: @circleSize - @borderSize; + width: @circleSize - @borderSize; + + /* stylelint-disable declaration-block-no-duplicate-properties */ + // Center the text number inside the circle + display: block; // Fallback for old iOS + text-align: center; // Fallback for old iOS + display: -webkit-box; + display: flex; + -webkit-box-align: center; + align-items: center; + -webkit-box-pack: center; + justify-content: center; + + span { + font-weight: bold; + font-size: 13px; + line-height: 1; + letter-spacing: -0.5px; + } + } + + &.notification-unseen { + color: @notificationColorUnread; + + .circle { +
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[firsterpaint]: Logged in only styles
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399335 ) Change subject: Logged in only styles .. Logged in only styles The secondary page actions logged in only As are notification styles Change-Id: I20c25390a37b9fa51cfb428abf8e2a373257f721 --- M includes/skins/SkinMinerva.php M resources/skins.minerva.base.styles/ui.less M resources/skins.minerva.loggedin.styles/styles.less M skin.json 4 files changed, 39 insertions(+), 32 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/35/399335/1 diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index a8ea813..c15df58 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -1453,6 +1453,7 @@ } if ( !$this->getUser()->isAnon() ) { $styles[] = 'skins.minerva.loggedin.styles'; + $styles[] = 'skins.minerva.icons.loggedin'; } return $styles; diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index 4a8805f..5bb8e8a 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -243,37 +243,6 @@ } } -#page-secondary-actions { - // Clears floating on table of contents on stub pages. - clear: both; - - a { - margin: 10px 2px 2px 0; - } -} - -// FIXME: Create generic class to represent both of these headers -.overlay, -.header { - - // need to specify id or else other rules are more important - // FIXME: simplify when .icon class from Overlay used instead - #secondary-button.user-button, - .user-button { - // Make sure count is positioned correctly in relation to bell icon - position: relative; - - // can't use display:none class as icons must have a label to retain height - .label { - visibility: hidden; - } - - &.loading span { - display: none; - } - } -} - // This is here rather than in mainmenu.less because we want to load these rules for non-js users too // Transparent shield hidden by default .transparent-shield, diff --git a/resources/skins.minerva.loggedin.styles/styles.less b/resources/skins.minerva.loggedin.styles/styles.less index 4fbcf84..9bf7fbe 100644 --- a/resources/skins.minerva.loggedin.styles/styles.less +++ b/resources/skins.minerva.loggedin.styles/styles.less @@ -1,5 +1,27 @@ @import 'minerva.variables'; +// FIXME: Create generic class to represent both of these headers +.overlay, +.header { + + // need to specify id or else other rules are more important + // FIXME: simplify when .icon class from Overlay used instead + #secondary-button.user-button, + .user-button { + // Make sure count is positioned correctly in relation to bell icon + position: relative; + + // can't use display:none class as icons must have a label to retain height + .label { + visibility: hidden; + } + + &.loading span { + display: none; + } + } +} + .notification-count { @circleSize: 24px; @borderSize: 2px; @@ -57,3 +79,12 @@ text-decoration: none; } } + +#page-secondary-actions { + // Clears floating on table of contents on stub pages. + clear: both; + + a { + margin: 10px 2px 2px 0; + } +} diff --git a/skin.json b/skin.json index 0a70fa2..7701d90 100644 --- a/skin.json +++ b/skin.json @@ -131,11 +131,17 @@ "resources/skins.minerva.tablet.styles/styles.less" ] }, + "skins.minerva.icons.loggedin": { + "class": "ResourceLoaderImageModule", + "selector": ".mw-ui-icon-{name}:before", + "images": { + "notifications": "resources/skins.minerva.icons.images/bell.svg" + } + }, "skins.minerva.icons.images": { "class": "ResourceLoaderImageModule", "selector": ".mw-ui-icon-{name}:before", "images": { - "notifications": "resources/skins.minerva.icons.images/bell.svg", "mainmenu": "resources/skins.minerva.icons.images/hamburger.svg", "edit": "resources/skins.minerva.icons.images/editLocked.svg", "edit-enabled": "resources/skins.minerva.icons.images/edit.svg", -- To view,
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Drop use of MobileOptionsTracking schema
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399327 ) Change subject: Drop use of MobileOptionsTracking schema .. Drop use of MobileOptionsTracking schema Going forward we can rely on pageview data to get a sense of how many users are in beta. Bug: T182235 Change-Id: I365a31a2e4d1cce280d89fc2a2004290e8ff548d --- M includes/specials/SpecialMobileOptions.php 1 file changed, 2 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/27/399327/1 diff --git a/includes/specials/SpecialMobileOptions.php b/includes/specials/SpecialMobileOptions.php index 18ed4f1..84c52c1 100644 --- a/includes/specials/SpecialMobileOptions.php +++ b/includes/specials/SpecialMobileOptions.php @@ -202,12 +202,6 @@ * Saves the settings submitted by the settings form */ private function submitSettingsForm() { - $schema = 'MobileOptionsTracking'; - $schemaRevision = 16934032; - $schemaData = [ - 'action' => 'success', - 'beta' => "nochange", - ]; $context = MobileContext::singleton(); $request = $this->getRequest(); $user = $this->getUser(); @@ -218,27 +212,12 @@ $this->getOutput()->addHTML( '' . $this->msg( "mobile-frontend-save-error" )->parse() . '' - ); - $schemaData['action'] = 'error'; - $schemaData['errorText'] = $errorText; - ExtMobileFrontend::eventLog( $schema, $schemaRevision, $schemaData ); + ) $this->addSettingsForm(); return; } - if ( $request->getBool( 'enableBeta' ) ) { - $group = 'beta'; - if ( !$context->isBetaGroupMember() ) { - // The request was to turn on beta - $schemaData['beta'] = "on"; - } - } else { - $group = ''; - if ( $context->isBetaGroupMember() ) { - // beta was turned off - $schemaData['beta'] = "off"; - } - } + $group = $request->getBool( 'enableBeta' ) ? 'beta' : ''; $context->setMobileMode( $group ); $url = $this->getPageTitle()->getFullURL( 'success' ); $context->getOutput()->redirect( MobileContext::singleton()->getMobileUrl( $url ) ); -- To view, visit https://gerrit.wikimedia.org/r/399327 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I365a31a2e4d1cce280d89fc2a2004290e8ff548d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Merge remote-tracking branch 'origin/master' into HEAD
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399325 ) Change subject: Merge remote-tracking branch 'origin/master' into HEAD .. Merge remote-tracking branch 'origin/master' into HEAD Change-Id: I9b3fb4c754ea1bbe872bb361ac0d6a35adeff245 --- M includes/specials/SpecialMobileOptions.php 1 file changed, 0 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/25/399325/1 diff --git a/includes/specials/SpecialMobileOptions.php b/includes/specials/SpecialMobileOptions.php index d104436..18ed4f1 100644 --- a/includes/specials/SpecialMobileOptions.php +++ b/includes/specials/SpecialMobileOptions.php @@ -123,7 +123,6 @@ 'id' => 'beta-field', ] ); } -<<< HEAD (9df0ee Merge "Promote expand all sections and fontchanger to stable) $fields[] = new OOUI\ButtonInputWidget( [ 'id' => 'mw-mf-settings-save', @@ -139,15 +138,6 @@ 'value' => $user->getEditToken() ] ); } -=== - $className = MobileUI::buttonClass( 'progressive' ); - $html .= << - $token - $returnto - -HTML; ->>> BRANCH (5172ea Replace instances of constructive and remove option entirely) // @codingStandardsIgnoreEnd $form->appendContent( $fields -- To view, visit https://gerrit.wikimedia.org/r/399325 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b3fb4c754ea1bbe872bb361ac0d6a35adeff245 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Replace instances of constructive and remove option entirely
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/399324 ) Change subject: Replace instances of constructive and remove option entirely .. Replace instances of constructive and remove option entirely Removing 'constructive' button flag, which has been deprecated, entirely. Bug: T182730 Change-Id: Ia3b9b2c3fc8da3724f28bd210e6c3fd24fc99259 --- M includes/MobileUI.php M includes/specials/SpecialMobileOptions.php M resources/mobile.init/BetaOptinPanel.js M resources/mobile.startup/Anchor.js M resources/mobile.startup/Button.js M resources/mobile.startup/Overlay.less M resources/mobile.startup/anchor.hogan M resources/mobile.startup/button.hogan M resources/mobile.talk.overlays/TalkSectionOverlay.js 9 files changed, 8 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/24/399324/1 diff --git a/includes/MobileUI.php b/includes/MobileUI.php index 0206bbf..a1715e6 100644 --- a/includes/MobileUI.php +++ b/includes/MobileUI.php @@ -30,7 +30,7 @@ /** * Get CSS classes for a mediawiki ui semantic element * @param string $base The base class -* @param string $modifier Type of anchor (progressive, constructive, destructive) +* @param string $modifier Type of anchor (progressive, destructive) * @param string $additionalClassNames additional class names you want to associate * with the iconed element * @return string class name for use with HTML element @@ -42,7 +42,7 @@ /** * Get CSS classes for buttons -* @param string $modifier Type of button (progressive, constructive, destructive) +* @param string $modifier Type of button (progressive, destructive) * @param string $additionalClassNames additional class names you want to associate * with the button element * @return string class name for use with HTML element @@ -53,7 +53,7 @@ /** * Get CSS classes for anchors -* @param string $modifier Type of anchor (progressive, constructive, destructive) +* @param string $modifier Type of anchor (progressive, destructive) * @param string $additionalClassNames additional class names you want to associate * with the anchor element * @return string class name for use with HTML element diff --git a/includes/specials/SpecialMobileOptions.php b/includes/specials/SpecialMobileOptions.php index 7d61a47..acb3cda 100644 --- a/includes/specials/SpecialMobileOptions.php +++ b/includes/specials/SpecialMobileOptions.php @@ -148,7 +148,7 @@ $html .= $templateParser->processTemplate( 'checkbox', $data ); } } - $className = MobileUI::buttonClass( 'constructive' ); + $className = MobileUI::buttonClass( 'progressive' ); $html .= << $token diff --git a/resources/mobile.init/BetaOptinPanel.js b/resources/mobile.init/BetaOptinPanel.js index a0adeb0..cb6dd94 100644 --- a/resources/mobile.init/BetaOptinPanel.js +++ b/resources/mobile.init/BetaOptinPanel.js @@ -23,7 +23,7 @@ text: mw.msg( 'mobile-frontend-panel-betaoptin-msg' ), buttons: [ new Button( { - constructive: true, + progressive: true, additionalClassNames: 'optin', label: mw.msg( 'mobile-frontend-panel-ok' ) } ).options, diff --git a/resources/mobile.startup/Anchor.js b/resources/mobile.startup/Anchor.js index 7675322..f6169e8 100644 --- a/resources/mobile.startup/Anchor.js +++ b/resources/mobile.startup/Anchor.js @@ -17,8 +17,6 @@ /** * @cfg {Object} defaults Default options hash. * @cfg {boolean} defaults.progressive is progressive action -* @cfg {boolean} defaults.constructive is constructive action. -* This option is deprecated. Please use `progressive`. * @cfg {boolean} defaults.destructive is destructive action * @cfg {string} defaults.additionalClassNames Additional class name(s). * @cfg {string} defaults.href url @@ -27,7 +25,6 @@ defaults: { progressive: undefined, destructive: undefined, - constructive: undefined, additionalClassNames: '', href: undefined, label: undefined diff --git a/resources/mobile.startup/Button.js b/resources/mobile.startup/Button.js index 662077e..059fd3a 100644 ---
[MediaWiki-commits] [Gerrit] mediawiki...Popups[master]: Better error handling for unexpected responses
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/397927 ) Change subject: Better error handling for unexpected responses .. Better error handling for unexpected responses Bug: T182639 Change-Id: Iea04fe41b4be8e15927e93f16cbb4bb44328374f --- M resources/dist/index.js M resources/dist/index.js.json M src/gateway/rest.js M tests/node-qunit/gateway/rest.test.js 4 files changed, 28 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/27/397927/1 -- To view, visit https://gerrit.wikimedia.org/r/397927 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iea04fe41b4be8e15927e93f16cbb4bb44328374f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Popups[master]: Remove client side formatters in Popups code base
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/397919 ) Change subject: Remove client side formatters in Popups code base .. Remove client side formatters in Popups code base These are now taken care of by the Mobile-Content-Service's summary endpoint and no longer needed here! Change-Id: I2729dc9f172af0afee1c6f0cd563c556b4ae0aeb --- M resources/dist/index.js M resources/dist/index.js.json M src/formatter.js M src/gateway/restFormatters.js M tests/node-qunit/formatter.test.js M tests/node-qunit/gateway/mediawiki.test.js 6 files changed, 3 insertions(+), 94 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/19/397919/1 -- To view, visit https://gerrit.wikimedia.org/r/397919 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2729dc9f172af0afee1c6f0cd563c556b4ae0aeb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Correct API url for queries to Wikidata api
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/397702 ) Change subject: Correct API url for queries to Wikidata api .. Correct API url for queries to Wikidata api Bug: T182630 Change-Id: I16ab6f852a096eb727b1d901b2b525e099f0659c --- M lib/api-util.js 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/02/397702/1 diff --git a/lib/api-util.js b/lib/api-util.js index efb4686..8696842 100644 --- a/lib/api-util.js +++ b/lib/api-util.js @@ -21,6 +21,10 @@ query = query || {}; query.continue = query.continue || ''; +if ( domain === 'wikidata.org' ) { +// without www, it will redirect so avoid redirect...(T182630) +domain = 'www.wikidata.org'; +} const request = app.mwapi_tpl.expand({ request: { params: { domain }, -- To view, visit https://gerrit.wikimedia.org/r/397702 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I16ab6f852a096eb727b1d901b2b525e099f0659c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Popups[master]: Testtesttest: W00t
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/397639 ) Change subject: Testtesttest: W00t .. Testtesttest: W00t Change-Id: Id9663a1da99f6caecf6e04260f36089cabf7a905 --- M tests/selenium/specs/previews.js 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/39/397639/1 diff --git a/tests/selenium/specs/previews.js b/tests/selenium/specs/previews.js index 26baca2..3c606ce 100644 --- a/tests/selenium/specs/previews.js +++ b/tests/selenium/specs/previews.js @@ -12,13 +12,13 @@ it( 'I should see a preview', function () { page.open(); page.dwellLink(); - assert( page.seePreview() ); + assert( page.seePreview(), 'Preview is there!' ); } ); it( 'Abandoning link hides preview', function () { page.open(); page.dwellLink(); page.abandonLink(); - assert( page.doNotSeePreview() ); + assert( page.doNotSeePreview(), 'Preview is gone!' ); } ); } ); -- To view, visit https://gerrit.wikimedia.org/r/397639 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id9663a1da99f6caecf6e04260f36089cabf7a905 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: POC: List everything that's in beta (feature management FTW)
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396485 ) Change subject: POC: List everything that's in beta (feature management FTW) .. POC: List everything that's in beta (feature management FTW) Bug: T182362 Change-Id: I4b1bc734c6a9b8f5d6cf1de7bab5586d333afbe1 --- M extension.json M includes/MobileContext.php M includes/MobileFrontend.hooks.php M includes/specials/SpecialMobileOptions.php 4 files changed, 95 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/85/396485/1 diff --git a/extension.json b/extension.json index 97895e4..82e2c8e 100644 --- a/extension.json +++ b/extension.json @@ -1204,9 +1204,35 @@ ] }, "config": { - "MFEnableFontChanger": { - "base": false, - "beta": true + "MFFeatures": { + "MFEnableFontChanger": { + "base": false, + "beta": true + }, + "MFShowFirstParagraphBeforeInfobox": { + "base": true, + "beta": true + }, + "MFLazyLoadImages": { + "base": true, + "beta": true + }, + "MFLazyLoadReferences": { + "base": false, + "beta": true + }, + "MFDisplayWikibaseDescriptions": { + "base": false, + "beta": true, + "search": false, + "nearby": false, + "watchlist": false, + "tagline": false + }, + "MFExpandAllSectionsUserOption": { + "base": false, + "beta": true + } }, "MFContentProviderClass": "MobileFrontend\\ContentProviders\\DefaultContentProvider", "MFMwApiContentProviderBaseUri": "https://en.wikipedia.org/w/api.php;, @@ -1249,19 +1275,7 @@ ".nomobile" ] }, - "MFShowFirstParagraphBeforeInfobox": { - "base": true, - "beta": true - }, - "MFLazyLoadImages": { - "base": true, - "beta": true - }, "MFLazyLoadSkipSmallImages": false, - "MFLazyLoadReferences": { - "base": false, - "beta": true - }, "MFNoMobileCategory": false, "MFNoMobilePages": [], "MFSpecialPageTaglines": { @@ -1301,17 +1315,7 @@ "MFCollapseSectionsByDefault": true, "MFPhotoUploadWiki": null, "MFPhotoUploadEndpoint": "", - "MFExpandAllSectionsUserOption": { - "base": false, - "beta": true - }, "MFUseWikibase": false, - "MFDisplayWikibaseDescriptions": { - "search": false, - "nearby": false, - "watchlist": false, - "tagline": false - }, "MFRSSFeedLink": false, "MFSchemaEditSampleRate": 0.0625, "MFStripResponsiveImages": true, diff --git a/includes/MobileContext.php b/includes/MobileContext.php index 4f4e6af..bafaa4d 100644 --- a/includes/MobileContext.php +++ b/includes/MobileContext.php @@ -179,13 +179,17 @@ * * @param string $variableName * @return mixed|null +* @deprecated - use isFeatureEnabled * @throws ConfigException If the config variable doesn't exist * * @TODO Should this be renamed, e.g. `getFlag`, or extracted? */ public function getConfigVariable( $variableName ) { $configVariable = $this->getMFConfig()->get( $variableName ) ?: []; + return $this->isFeatureEnabledInContext( $configVariable ); + } + private function isFeatureEnabledInContext( $configVariable ) { if ( !is_array( $configVariable ) ) { return $configVariable; } @@ -198,12 +202,39 @@ return null; } + public function getFeatureConfiguration( $variableName ) { + $features = $this->getMFConfig()->get( 'MFFeatures' ); +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: POC: Package page objects into a library
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396440 ) Change subject: POC: Package page objects into a library .. POC: Package page objects into a library Doing this allows extensions to directly use the library rather than having to worry about paths to JS files Change-Id: If98216e262197ca36fbc372c5488d9c3b5dd7dc9 --- M package.json D tests/selenium/pageobjects/createaccount.page.js D tests/selenium/pageobjects/edit.page.js D tests/selenium/pageobjects/history.page.js D tests/selenium/pageobjects/page.js D tests/selenium/pageobjects/preferences.page.js D tests/selenium/pageobjects/userlogin.page.js M tests/selenium/specs/page.js M tests/selenium/specs/user.js 9 files changed, 9 insertions(+), 202 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/40/396440/1 diff --git a/package.json b/package.json index 2878eca..9f3c803 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "grunt-karma": "2.0.0", "grunt-stylelint": "0.9.0", "grunt-webdriver": "2.0.3", +"jdlrobson/mediawiki-selenium-pageobjects": "1.0.0", "karma": "1.7.1", "karma-chrome-launcher": "2.2.0", "karma-firefox-launcher": "1.0.1", diff --git a/tests/selenium/pageobjects/createaccount.page.js b/tests/selenium/pageobjects/createaccount.page.js deleted file mode 100644 index f54e31c..000 --- a/tests/selenium/pageobjects/createaccount.page.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; -const Page = require( './page' ); - -class CreateAccountPage extends Page { - - get username() { return browser.element( '#wpName2' ); } - get password() { return browser.element( '#wpPassword2' ); } - get confirmPassword() { return browser.element( '#wpRetype' ); } - get create() { return browser.element( '#wpCreateaccount' ); } - get heading() { return browser.element( '#firstHeading' ); } - - open() { - super.open( 'Special:CreateAccount' ); - } - - createAccount( username, password ) { - this.open(); - this.username.setValue( username ); - this.password.setValue( password ); - this.confirmPassword.setValue( password ); - this.create.click(); - } - - apiCreateAccount( username, password ) { - const url = require( 'url' ), // https://nodejs.org/docs/latest/api/url.html - baseUrl = url.parse( browser.options.baseUrl ), // http://webdriver.io/guide/testrunner/browserobject.html - Bot = require( 'nodemw' ), // https://github.com/macbre/nodemw - client = new Bot( { - protocol: baseUrl.protocol, - server: baseUrl.hostname, - port: baseUrl.port, - path: baseUrl.path, - debug: false - } ); - - return new Promise( ( resolve, reject ) => { - client.api.call( - { - action: 'query', - meta: 'tokens', - type: 'createaccount' - }, - /** -* @param {Error|null} err -* @param {Object} info Processed query result -* @param {Object} next More results? -* @param {Object} data Raw data -*/ - function ( err, info, next, data ) { - if ( err ) { - reject( err ); - return; - } - client.api.call( { - action: 'createaccount', - createreturnurl: browser.options.baseUrl, - createtoken: data.query.tokens.createaccounttoken, - username: username, - password: password, - retype: password - }, function ( err ) { - if ( err ) { - reject( err ); - return; - } - resolve(); - }, 'POST' ); -
[MediaWiki-commits] [Gerrit] mediawiki...RelatedArticles[master]: POC: Use mediawiki-selenium-pageobjects
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396441 ) Change subject: POC: Use mediawiki-selenium-pageobjects .. POC: Use mediawiki-selenium-pageobjects Change-Id: If48e0a885acdf4bca73ec2a9d613fe2f0403dd61 Depends-On: If98216e262197ca36fbc372c5488d9c3b5dd7dc9 --- M tests/selenium/pageobjects/readmore.page.js M tests/selenium/specs/readmore.js 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RelatedArticles refs/changes/41/396441/1 diff --git a/tests/selenium/pageobjects/readmore.page.js b/tests/selenium/pageobjects/readmore.page.js index 56aa3e0..b8d9ca0 100644 --- a/tests/selenium/pageobjects/readmore.page.js +++ b/tests/selenium/pageobjects/readmore.page.js @@ -1,6 +1,6 @@ 'use strict'; const CARD_SELECTOR = '.ext-related-articles-card', - Page = require( '../../../../../tests/selenium/pageobjects/page' ), + Page = require( 'mediawiki-selenium-pageobjects' ).Page, READ_MORE_MODULE_NAME = 'ext.relatedArticles.readMore'; class ReadMorePage extends Page { diff --git a/tests/selenium/specs/readmore.js b/tests/selenium/specs/readmore.js index a5ab153..d49fb16 100644 --- a/tests/selenium/specs/readmore.js +++ b/tests/selenium/specs/readmore.js @@ -1,7 +1,7 @@ 'use strict'; var assert = require( 'assert' ), - EditPage = require( '../../../../../tests/selenium/pageobjects/edit.page' ), + EditPage = require( 'mediawiki-selenium-pageobjects' ).EditPage, ReadMorePage = require( '../pageobjects/readmore.page' ); describe( 'ReadMore', function () { -- To view, visit https://gerrit.wikimedia.org/r/396441 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If48e0a885acdf4bca73ec2a9d613fe2f0403dd61 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/RelatedArticles Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: QA: Add additional steps to guard against slow test runs
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396287 ) Change subject: QA: Add additional steps to guard against slow test runs .. QA: Add additional steps to guard against slow test runs Bug: T182202 Change-Id: If46620941924b86c5403c9e928911b1aa5845d7a --- M tests/browser/features/search_loggedin.feature M tests/browser/features/step_definitions/talk_steps.rb M tests/browser/features/talk.feature 3 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/87/396287/1 diff --git a/tests/browser/features/search_loggedin.feature b/tests/browser/features/search_loggedin.feature index 291fe8e..982d768 100644 --- a/tests/browser/features/search_loggedin.feature +++ b/tests/browser/features/search_loggedin.feature @@ -11,5 +11,6 @@ And I click the search icon And I see the search overlay And I type into search box "Selenium search tes" + And I see the search in pages button When I click a search watch star Then I should see a toast notification diff --git a/tests/browser/features/step_definitions/talk_steps.rb b/tests/browser/features/step_definitions/talk_steps.rb index 911ed2c..4674419 100644 --- a/tests/browser/features/step_definitions/talk_steps.rb +++ b/tests/browser/features/step_definitions/talk_steps.rb @@ -19,6 +19,10 @@ end end +When(/^I see the talk overlay$/) do + on(ArticlePage).overlay_element.when_visible +end + When(/^I click the add discussion button$/) do on(ArticlePage).talkadd_element.when_present.click end diff --git a/tests/browser/features/talk.feature b/tests/browser/features/talk.feature index cf95b31..d81e04b 100644 --- a/tests/browser/features/talk.feature +++ b/tests/browser/features/talk.feature @@ -42,6 +42,7 @@ And I am logged into the mobile website And the page "Selenium talk test" exists When I click the talk button +And I see the talk overlay And no topic is present And I add a topic called "New topic" Then I should see the topic called "New topic" in the list of topics -- To view, visit https://gerrit.wikimedia.org/r/396287 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If46620941924b86c5403c9e928911b1aa5845d7a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Promote expand all sections and fontchanger to stable
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396284 ) Change subject: Promote expand all sections and fontchanger to stable .. Promote expand all sections and fontchanger to stable Bug: T169257 Bug: T109364 Change-Id: I5602fd1bc9d106ee408de57b67ac4ee509365066 --- M extension.json 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/84/396284/1 diff --git a/extension.json b/extension.json index 97895e4..529200d 100644 --- a/extension.json +++ b/extension.json @@ -1205,7 +1205,7 @@ }, "config": { "MFEnableFontChanger": { - "base": false, + "base": true, "beta": true }, "MFContentProviderClass": "MobileFrontend\\ContentProviders\\DefaultContentProvider", @@ -1302,7 +1302,7 @@ "MFPhotoUploadWiki": null, "MFPhotoUploadEndpoint": "", "MFExpandAllSectionsUserOption": { - "base": false, + "base": true, "beta": true }, "MFUseWikibase": false, -- To view, visit https://gerrit.wikimedia.org/r/396284 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5602fd1bc9d106ee408de57b67ac4ee509365066 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: POC: Rewrite self links as strong tags
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396136 ) Change subject: POC: Rewrite self links as strong tags .. POC: Rewrite self links as strong tags Bug: T181472 Change-Id: I68e2310f64d5a87d669dbd1252ec8e01925c7e50 --- M includes/MobileFormatter.php 1 file changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/36/396136/1 diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php index 34c6226..efd67cf 100644 --- a/includes/MobileFormatter.php +++ b/includes/MobileFormatter.php @@ -201,6 +201,7 @@ if ( $transformOptions['references'] ) { $this->doRewriteReferencesLinksForLazyLoading( $doc ); } + $this->doRewriteSelfLinks( $doc ); return parent::filterContent(); } @@ -464,6 +465,23 @@ } return false; } + + private function doRewriteSelfLinks( $doc ) { + foreach ( $doc->getElementsByTagName( 'a' ) as $a ) { + $className = $a->getAttribute( 'class' ); + if ( $className ) { + if ( strpos( $className, 'mw-selflink' ) !== false ) { + $parent = $a->parentNode; + if ( $parent ) { + $strong = $doc->createElement( 'strong' ); + $strong->nodeValue = $a->nodeValue; + $parent->replaceChild( $strong, $a ); + } + } + } + } + } + /** * Enables images to be loaded asynchronously * -- To view, visit https://gerrit.wikimedia.org/r/396136 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68e2310f64d5a87d669dbd1252ec8e01925c7e50 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Avoid OOUI/download icon nameclash
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396100 ) Change subject: Avoid OOUI/download icon nameclash .. Avoid OOUI/download icon nameclash Short term fix to ensure icon doesn't change when oo-ui is loaded. Prefix with 'mf-' (we do this in main menu) to avoid nameclashes Bug: T182162 Change-Id: Ia6ceb620ed2710d97387a326b74f1a02236cd0d0 --- M resources/skins.minerva.scripts/DownloadIcon.js M skin.json 2 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/00/396100/1 diff --git a/resources/skins.minerva.scripts/DownloadIcon.js b/resources/skins.minerva.scripts/DownloadIcon.js index 5f9e3d2..bbaeda2 100644 --- a/resources/skins.minerva.scripts/DownloadIcon.js +++ b/resources/skins.minerva.scripts/DownloadIcon.js @@ -2,6 +2,7 @@ var msg = mw.msg, MAX_PRINT_TIMEOUT = 3000, + GLYPH = 'mf-download', Icon = M.require( 'mobile.startup/Icon' ); /** @@ -17,7 +18,7 @@ this.skin = skin; options.tagName = 'li'; options.title = msg( 'minerva-download' ); - options.name = 'download'; + options.name = GLYPH; Icon.call( this, options ); } @@ -33,7 +34,7 @@ * Restore download icon from spinner state */ hideSpinner: function () { - this.options.name = 'download'; + this.options.name = GLYPH; this.render(); }, isTemplateMode: false, diff --git a/skin.json b/skin.json index c81b5c1..d137075 100644 --- a/skin.json +++ b/skin.json @@ -168,7 +168,7 @@ "selector": ".mw-ui-icon-{name}:before", "position": "bottom", "images": { - "download": "resources/skins.minerva.icons.images.scripts/download.svg", + "mf-download": "resources/skins.minerva.icons.images.scripts/download.svg", "watch": "resources/skins.minerva.icons.images.scripts/watch.svg", "watched": "resources/skins.minerva.icons.images.scripts/watched.svg", "user": "resources/skins.minerva.icons.images.scripts/userNormal.svg", -- To view, visit https://gerrit.wikimedia.org/r/396100 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia6ceb620ed2710d97387a326b74f1a02236cd0d0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Cookie must be set on server side
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396082 ) Change subject: Cookie must be set on server side .. Cookie must be set on server side Setting the cookie on the client doesn't work. It needs to be stored on the server. Submitting the form without an async save also avoids the problem of having to refresh the page. Bug: T169369 Change-Id: I4028a0d37f51d8f6c6e64d49b52a76781b38676c --- M includes/specials/SpecialMobileOptions.php M resources/mobile.special.mobileoptions.scripts/mobileoptions.js 2 files changed, 1 insertion(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/82/396082/1 diff --git a/includes/specials/SpecialMobileOptions.php b/includes/specials/SpecialMobileOptions.php index 62dc4fe..a91b55f 100644 --- a/includes/specials/SpecialMobileOptions.php +++ b/includes/specials/SpecialMobileOptions.php @@ -132,8 +132,6 @@ $fields[] = new OOUI\HiddenInputWidget( [ 'name' => 'token', 'value' => $user->getEditToken() ] ); } - $fields[] = new OOUI\HiddenInputWidget( [ 'name' => 'returnto', - 'value' => $this->returnToTitle->getFullText() ] ); // @codingStandardsIgnoreEnd $form->appendContent( diff --git a/resources/mobile.special.mobileoptions.scripts/mobileoptions.js b/resources/mobile.special.mobileoptions.scripts/mobileoptions.js index 228b142..e0c12f7 100644 --- a/resources/mobile.special.mobileoptions.scripts/mobileoptions.js +++ b/resources/mobile.special.mobileoptions.scripts/mobileoptions.js @@ -128,9 +128,8 @@ enableToggle = OO.ui.infuse( $( '#enable-beta-toggle' ) ), $form = $( '#mobile-options' ); - // The beta toggle will now work without clicking submit enableToggle.on( 'change', function () { - cookie( 'optin', this.isSelected() ? 'beta' : '' ); + $form.submit(); notify(); }.bind( enableToggle ) ); -- To view, visit https://gerrit.wikimedia.org/r/396082 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4028a0d37f51d8f6c6e64d49b52a76781b38676c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Merge remote-tracking branch 'origin/master' into HEAD
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396081 ) Change subject: Merge remote-tracking branch 'origin/master' into HEAD .. Merge remote-tracking branch 'origin/master' into HEAD Change-Id: Ie39553de6e96ae8d00fdeb42f0f3ea55b63537b4 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/81/396081/1 -- To view, visit https://gerrit.wikimedia.org/r/396081 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie39553de6e96ae8d00fdeb42f0f3ea55b63537b4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Do not load apply mw-ui-icon selector by default
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395679 ) Change subject: Do not load apply mw-ui-icon selector by default .. Do not load apply mw-ui-icon selector by default This keeps causing issues in the mobile site. For instance now if you click the edit icon on the mobile site and close the editor the download icon transforms into a new glyph. Where mw-ui-icon is being used selectorWithoutVariant should be used to override the default. This default is not helpful. Change-Id: I8eeb4a26f8b829cd40650f9e5958bf8e1dbb4593 --- M includes/resourceloader/ResourceLoaderOOUIImageModule.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/79/395679/1 diff --git a/includes/resourceloader/ResourceLoaderOOUIImageModule.php b/includes/resourceloader/ResourceLoaderOOUIImageModule.php index ee87d8d..19499c9 100644 --- a/includes/resourceloader/ResourceLoaderOOUIImageModule.php +++ b/includes/resourceloader/ResourceLoaderOOUIImageModule.php @@ -97,9 +97,9 @@ // Extra selectors to allow using the same icons for old-style MediaWiki UI code if ( substr( $module, 0, 5 ) === 'icons' ) { - $definition['selectorWithoutVariant'] = '.oo-ui-icon-{name}, .mw-ui-icon-{name}:before'; + $definition['selectorWithoutVariant'] = '.oo-ui-icon-{name}'; $definition['selectorWithVariant'] = ' - .oo-ui-image-{variant}.oo-ui-icon-{name}, .mw-ui-icon-{name}-{variant}:before, + .oo-ui-image-{variant}.oo-ui-icon-{name}, /* Hack for Flow, see T110051 */ .mw-ui-hovericon:hover .mw-ui-icon-{name}-{variant}-hover:before, .mw-ui-hovericon.mw-ui-icon-{name}-{variant}-hover:hover:before'; -- To view, visit https://gerrit.wikimedia.org/r/395679 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8eeb4a26f8b829cd40650f9e5958bf8e1dbb4593 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Babel[master]: Enable Babel on mobile
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395669 ) Change subject: Enable Babel on mobile .. Enable Babel on mobile Changes: * Turn on styles for mobile target * Restrict floating rules to tablet. Enforce them with !important to override table defaults Bug: T178782 Change-Id: I9902359276894b6e94d9794247f5bde02983abd7 --- M extension.json R resources/ext.babel.less 2 files changed, 19 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Babel refs/changes/69/395669/1 diff --git a/extension.json b/extension.json index b82550c..53b36ee 100644 --- a/extension.json +++ b/extension.json @@ -38,8 +38,9 @@ }, "ResourceModules": { "ext.babel": { + "targets": [ "desktop", "mobile" ], "position": "top", - "styles": "resources/ext.babel.css" + "styles": "resources/ext.babel.less" } }, "ResourceFileModulePaths": { diff --git a/resources/ext.babel.css b/resources/ext.babel.less similarity index 83% rename from resources/ext.babel.css rename to resources/ext.babel.less index 87f0d2f..26b2f14 100644 --- a/resources/ext.babel.css +++ b/resources/ext.babel.less @@ -21,18 +21,6 @@ border-spacing: 0; } -/* @noflip */ -.mw-content-ltr .mw-babel-wrapper { - float: right; - clear: right; -} - -/* @noflip */ -.mw-content-rtl .mw-babel-wrapper { - float: left; - clear: left; -} - /* Babel box layout */ /* @noflip */ .mw-babel-box { @@ -168,3 +156,20 @@ font-weight: normal; font-size: 85%; } + +@media all and ( min-width: @deviceWidthTablet ) { + /* @noflip */ + .mw-content-ltr .mw-babel-wrapper { + // !important is necessary for skins like Minerva which try to avoid floating tables + float: right !important; + clear: right; + } + + /* @noflip */ + .mw-content-rtl .mw-babel-wrapper { + // !important is necessary for skins like Minerva which try to avoid floating tables + float: left !important; + clear: left; + } +} + -- To view, visit https://gerrit.wikimedia.org/r/395669 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9902359276894b6e94d9794247f5bde02983abd7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Babel Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[specialpages]: Correct alignment of save button in Special:MobileOptions
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395644 ) Change subject: Correct alignment of save button in Special:MobileOptions .. Correct alignment of save button in Special:MobileOptions Bug: T180095 Change-Id: I3970ace69c0d3fc4ba5ea0dd7eeaf69077a48200 --- M resources/skins.minerva.base.styles/ui.less 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/44/395644/1 diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index 2fbfd81..d26b9bb 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -446,6 +446,8 @@ .pre-content, // Form only pages e.g Special:MobileOptions #mw-content-text > form .oo-ui-fieldLayout-body, +// Save button on Special:MobileOptions +#mw-content-text > form > .oo-ui-widget, .content, .post-content { margin: 0 @contentMargin; -- To view, visit https://gerrit.wikimedia.org/r/395644 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3970ace69c0d3fc4ba5ea0dd7eeaf69077a48200 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Default to regular font size in special mobileoptions
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395606 ) Change subject: Default to regular font size in special mobileoptions .. Default to regular font size in special mobileoptions Raynor flagged that in incognito window the font size defaults to small. This corrects that. Bug: T169369 Change-Id: Idbe4c0f99cbb27a246647537e5ef0399efc1f4d6 --- M resources/mobile.special.mobileoptions.scripts/mobileoptions.js 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/06/395606/1 diff --git a/resources/mobile.special.mobileoptions.scripts/mobileoptions.js b/resources/mobile.special.mobileoptions.scripts/mobileoptions.js index 4f454f9..228b142 100644 --- a/resources/mobile.special.mobileoptions.scripts/mobileoptions.js +++ b/resources/mobile.special.mobileoptions.scripts/mobileoptions.js @@ -48,10 +48,11 @@ * @ignore */ function addFontChangerToForm( $form ) { - var fontChanger, fontChangerDropdown; + var fontChanger, fontChangerDropdown, + currentFontSize = storage.get( FONT_SIZE_KEY ); fontChangerDropdown = new OO.ui.DropdownInputWidget( { - value: parseInt( storage.get( FONT_SIZE_KEY ), 10 ), + value: currentFontSize ? parseInt( currentFontSize, 10 ) : 100, options: [ { data: 90, -- To view, visit https://gerrit.wikimedia.org/r/395606 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idbe4c0f99cbb27a246647537e5ef0399efc1f4d6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Enable mobileoptions module in desktop target
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395601 ) Change subject: Enable mobileoptions module in desktop target .. Enable mobileoptions module in desktop target It's possible to reach this page in desktop mode and it looks broken without css or js so we might as well load it Change-Id: I947e66d2b371b6a406ae44a5935c128b5ac8a200 --- M extension.json 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/01/395601/1 diff --git a/extension.json b/extension.json index 8828a4a..9d64818 100644 --- a/extension.json +++ b/extension.json @@ -934,14 +934,14 @@ "position": "top" }, "mobile.special.mobileoptions.styles": { - "targets": "mobile", + "targets": [ "mobile", "desktop" ], "styles": [ "resources/mobile.special.mobileoptions.styles/mobileoptions.less" ], "position": "top" }, "mobile.special.mobileoptions.scripts": { - "targets": "mobile", + "targets": [ "mobile", "desktop" ], "position": "top", "dependencies": [ "jquery.cookie", -- To view, visit https://gerrit.wikimedia.org/r/395601 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I947e66d2b371b6a406ae44a5935c128b5ac8a200 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Tweak font size of special mobile options label
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395166 ) Change subject: Tweak font size of special mobile options label .. Tweak font size of special mobile options label Per Nirzar https://phabricator.wikimedia.org/T169369#3811256 Bug: T169369 Change-Id: Ie46abf350622844f3f55f4b856dc83ac45809384 --- M resources/mobile.special.mobileoptions.styles/mobileoptions.less 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/66/395166/1 diff --git a/resources/mobile.special.mobileoptions.styles/mobileoptions.less b/resources/mobile.special.mobileoptions.styles/mobileoptions.less index 10b4b3a..a67f027 100644 --- a/resources/mobile.special.mobileoptions.styles/mobileoptions.less +++ b/resources/mobile.special.mobileoptions.styles/mobileoptions.less @@ -16,7 +16,6 @@ padding-bottom: 40px; .oo-ui-fieldLayout-header strong { - font-size: 1.1em; font-weight: bold; } -- To view, visit https://gerrit.wikimedia.org/r/395166 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie46abf350622844f3f55f4b856dc83ac45809384 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Use OOUI\HiddenInputWidget
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395151 ) Change subject: Use OOUI\HiddenInputWidget .. Use OOUI\HiddenInputWidget Bug: T180095 Change-Id: Ifa53ffdfc66f2ff42398d8770376ba164dec5f0a --- M includes/specials/SpecialMobileOptions.php 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/51/395151/1 diff --git a/includes/specials/SpecialMobileOptions.php b/includes/specials/SpecialMobileOptions.php index 4b8a130..62dc4fe 100644 --- a/includes/specials/SpecialMobileOptions.php +++ b/includes/specials/SpecialMobileOptions.php @@ -129,11 +129,11 @@ ] ); if ( $user->isLoggedIn() ) { - $fields[] = new OOUI\HtmlSnippet( Html::hidden( 'token', $user->getEditToken() ) ); + $fields[] = new OOUI\HiddenInputWidget( [ 'name' => 'token', + 'value' => $user->getEditToken() ] ); } - $fields[] = new OOUI\HtmlSnippet( - Html::hidden( 'returnto', $this->returnToTitle->getFullText() ) - ); + $fields[] = new OOUI\HiddenInputWidget( [ 'name' => 'returnto', + 'value' => $this->returnToTitle->getFullText() ] ); // @codingStandardsIgnoreEnd $form->appendContent( -- To view, visit https://gerrit.wikimedia.org/r/395151 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa53ffdfc66f2ff42398d8770376ba164dec5f0a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[specialpages]: Center content-header for history/watchlist
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395140 ) Change subject: Center content-header for history/watchlist .. Center content-header for history/watchlist Bug: T180095 Change-Id: If851ddea593b27167ecc366c10896697e964e3db --- M resources/skins.minerva.base.styles/ui.less M resources/skins.minerva.tablet.styles/common.less M skinStyles/mobile.special.styles/minerva.less 3 files changed, 13 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/40/395140/1 diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index 2fbfd81..4b5fb13 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -444,6 +444,7 @@ .backtotop, .image-list, .pre-content, +.content-header, // Form only pages e.g Special:MobileOptions #mw-content-text > form .oo-ui-fieldLayout-body, .content, diff --git a/resources/skins.minerva.tablet.styles/common.less b/resources/skins.minerva.tablet.styles/common.less index 9fe89d3..506f7b9 100644 --- a/resources/skins.minerva.tablet.styles/common.less +++ b/resources/skins.minerva.tablet.styles/common.less @@ -59,6 +59,7 @@ // Form only pages e.g. Special:MobileOptions #mw-content-text > form, .content, + .content-header, .post-content { max-width: @contentMaxWidthTablet; margin: 0 @contentPaddingTablet; diff --git a/skinStyles/mobile.special.styles/minerva.less b/skinStyles/mobile.special.styles/minerva.less index 1e945b3..27de5b3 100644 --- a/skinStyles/mobile.special.styles/minerva.less +++ b/skinStyles/mobile.special.styles/minerva.less @@ -18,16 +18,20 @@ margin-bottom: 15px; } + .content-header { + // Avoid double bottom border on contributions + // (exists in MobileFrontend - should probably be removed there) + border-bottom: 0; + } + + .content-header + *, + .page-header-bar + * { + border-top: 1px solid @colorGray12; + } + h1, h2 { // Important given we have no idea which rules special pages are enforcing font-family: @fontFamily !important; - } - - .content-header { - h1, - h2 { - text-align: center; - } } } -- To view, visit https://gerrit.wikimedia.org/r/395140 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If851ddea593b27167ecc366c10896697e964e3db Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: Better undefined index protection
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395115 ) Change subject: Better undefined index protection .. Better undefined index protection * CollectionAPIResult::get has better error protection then directly accessing $response * A CollectionAPIResult may error, so check this before trying to access information from it. Bug: T182026 Change-Id: I0bbb8a00d010b8892cd12ec030c8358e42fd2e46 --- M Collection.body.php 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection refs/changes/15/395115/1 diff --git a/Collection.body.php b/Collection.body.php index 6321fc7..452f41c 100644 --- a/Collection.body.php +++ b/Collection.body.php @@ -1054,7 +1054,7 @@ $api = CollectionRenderingAPI::instance( $writer ); $response = $api->render( $collection ); - if ( !$this->handleResult( $response ) ) { + if ( !$this->handleResult( $response ) || $response->isError() ) { return; } @@ -1078,15 +1078,15 @@ $api = CollectionRenderingAPI::instance( $writer ); $response = $api->forceRender( $collectionID ); - if ( !$response ) { + if ( !$response || $response->isError() ) { return; } $query = 'bookcmd=rendering' . '_to=' . urlencode( $request->getVal( 'return_to', '' ) ) - . '_id=' . urlencode( $response->response['collection_id'] ) - . '=' . urlencode( $response->response['writer'] ); - if ( isset( $response->response['is_cached'] ) && $response->response['is_cached'] ) { + . '_id=' . urlencode( $response->get( 'collection_id' ) ) + . '=' . urlencode( $response->get( 'writer' ) ); + if ( $response->get( 'is_cached' ) ) { $query .= '_cached=1'; } $this->getOutput()->redirect( SkinTemplate::makeSpecialUrl( 'Book', $query ) ); -- To view, visit https://gerrit.wikimedia.org/r/395115 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0bbb8a00d010b8892cd12ec030c8358e42fd2e46 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Docs: Update documentation for MFMobileFormatterNamespaceBla...
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395065 ) Change subject: Docs: Update documentation for MFMobileFormatterNamespaceBlacklist .. Docs: Update documentation for MFMobileFormatterNamespaceBlacklist Bug: T168567 Change-Id: I75f98ebf93afb2abcdf4ded4cdbf0a7246e74dd4 --- M README.md 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/65/395065/1 diff --git a/README.md b/README.md index 514c9bc..628e263 100644 --- a/README.md +++ b/README.md @@ -267,11 +267,12 @@ ] ``` - $wgMFMobileFormaterNamespaceBlacklist + $wgMFMobileFormatterNamespaceBlacklist -Array of namespaces in which the usual transformation of page content for mobile view -doesn't happen, which prevents templates containing only content that doesn't show -on mobile from rendering as blank. +Array of namespaces that blacklists certain namespaces from applying mobile +transformations to page content. This will disable lazy loading images and +references; special casing and section formatting on the given page. +MFRemovableClasses will not apply for any blacklisted pages. * Type: `Array` * Default: -- To view, visit https://gerrit.wikimedia.org/r/395065 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I75f98ebf93afb2abcdf4ded4cdbf0a7246e74dd4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable Page Previews EventLogging instrumentation
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/395053 ) Change subject: Enable Page Previews EventLogging instrumentation .. Enable Page Previews EventLogging instrumentation This will allow us to learn about the time to first interaction with a greater degree of precision Bug: T181493 Change-Id: Icdfc23c31c3f216828e687a12f6d75a9ef03425e --- M wmf-config/InitialiseSettings.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/53/395053/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index c3468c4..1a97738 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -13791,6 +13791,9 @@ 'wgPopupsEventLogging' => [ 'default' => false, + // T181493 + 'enwiki' => true, + 'dewiki' => true, ], 'wgPopupsGateway' => [ -- To view, visit https://gerrit.wikimedia.org/r/395053 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icdfc23c31c3f216828e687a12f6d75a9ef03425e Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Upgrade checkboxes to ToggleSwitches on options form
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394634 ) Change subject: Upgrade checkboxes to ToggleSwitches on options form .. Upgrade checkboxes to ToggleSwitches on options form Bug: T169807 Change-Id: Ic2b203478f2d123129296d54ced0fd9ed9f070a2 --- M resources/mobile.special.mobileoptions.scripts/mobileoptions.js 1 file changed, 12 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/34/394634/1 diff --git a/resources/mobile.special.mobileoptions.scripts/mobileoptions.js b/resources/mobile.special.mobileoptions.scripts/mobileoptions.js index 4f454f9..992e82b 100644 --- a/resources/mobile.special.mobileoptions.scripts/mobileoptions.js +++ b/resources/mobile.special.mobileoptions.scripts/mobileoptions.js @@ -95,9 +95,9 @@ function addExpandAllSectionsToForm( $form ) { var cb, cbField; - cb = new OO.ui.CheckboxInputWidget( { + cb = new OO.ui.ToggleSwitchWidget( { name: EXPAND_SECTIONS_KEY, - selected: storage.get( EXPAND_SECTIONS_KEY ) === 'true' + value: storage.get( EXPAND_SECTIONS_KEY ) === 'true' } ); cbField = new OO.ui.FieldLayout( cb, @@ -108,8 +108,8 @@ ).$element } ); - cb.on( 'change', function () { - storage.set( EXPAND_SECTIONS_KEY, this.isSelected() ? 'true' : 'false' ); + cb.on( 'change', function ( value ) { + storage.set( EXPAND_SECTIONS_KEY, value ); notify(); }.bind( cb ) ); @@ -123,15 +123,19 @@ * @ignore */ function initLocalStorageElements() { - var + var cb, enableToggle = OO.ui.infuse( $( '#enable-beta-toggle' ) ), $form = $( '#mobile-options' ); + cb = new OO.ui.ToggleSwitchWidget( { + value: enableToggle.isSelected() + } ) + enableToggle.$element.replaceWith( cb.$element ); // The beta toggle will now work without clicking submit - enableToggle.on( 'change', function () { - cookie( 'optin', this.isSelected() ? 'beta' : '' ); + cb.on( 'change', function ( value ) { + cookie( 'optin', value ? 'beta' : '' ); notify(); - }.bind( enableToggle ) ); + }.bind( cb ) ); if ( mw.config.get( 'wgMFExpandAllSectionsUserOption' ) ) { addExpandAllSectionsToForm( $form ); -- To view, visit https://gerrit.wikimedia.org/r/394634 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic2b203478f2d123129296d54ced0fd9ed9f070a2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[specialpages]: Optimise Special:MobileOptions for tablet display
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394633 ) Change subject: Optimise Special:MobileOptions for tablet display .. Optimise Special:MobileOptions for tablet display Bug: T180095 Change-Id: I0ef0ce914a360848f8f66b39c40588f3fa04647c --- M resources/skins.minerva.tablet.styles/common.less M skin.json A skinStyles/mobile.special.mobileoptions.styles/minerva.less 3 files changed, 27 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/33/394633/1 diff --git a/resources/skins.minerva.tablet.styles/common.less b/resources/skins.minerva.tablet.styles/common.less index fba9301..5c57993 100644 --- a/resources/skins.minerva.tablet.styles/common.less +++ b/resources/skins.minerva.tablet.styles/common.less @@ -56,6 +56,8 @@ // FIXME: Have a class that identifies all of these selectors .pre-content, + // Form only pages e.g. Special:MobileOptions + #mw-content-text > form, .content, .post-content { max-width: @contentMaxWidthTablet; @@ -134,8 +136,8 @@ .content-unstyled, .pre-content, .post-content, - // Form only pages e.g Special:MobileOptions - #mw-content-text > form .oo-ui-fieldLayout-body, + // Form only pages e.g. Special:MobileOptions + #mw-content-text > form, // FIXME: remove need for id selector #mw-mf-page-center .pointer-overlay { margin-left: auto; diff --git a/skin.json b/skin.json index c81b5c1..b731766 100644 --- a/skin.json +++ b/skin.json @@ -39,6 +39,9 @@ }, "ResourceModuleSkinStyles": { "minerva": { + "mobile.special.mobileoptions.styles": [ + "skinStyles/mobile.special.mobileoptions.styles/minerva.less" + ], "mediawiki.special.userlogin.common.styles": [ "skinStyles/mediawiki.special.userlogin.common.styles/minerva.less" ], diff --git a/skinStyles/mobile.special.mobileoptions.styles/minerva.less b/skinStyles/mobile.special.mobileoptions.styles/minerva.less new file mode 100644 index 000..f326b5e --- /dev/null +++ b/skinStyles/mobile.special.mobileoptions.styles/minerva.less @@ -0,0 +1,20 @@ +@import 'minerva.variables'; + +@media all and ( min-width: @deviceWidthTablet ) { + .ns-special .pre-content { + background: #fff; + + .tagline, + h1 { + margin: 0 @contentMargin; + } + } + + .ns-special #content { + background: @colorGray14; + + form { + background: #fff; + } + } +} -- To view, visit https://gerrit.wikimedia.org/r/394633 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ef0ce914a360848f8f66b39c40588f3fa04647c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[specialpages]: Settings should take up full page on tablet
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394632 ) Change subject: Settings should take up full page on tablet .. Settings should take up full page on tablet Change-Id: If2e44279afb3c1d8a291d7b92bd6d32aa955b08a --- M resources/skins.minerva.tablet.styles/common.less 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/32/394632/1 diff --git a/resources/skins.minerva.tablet.styles/common.less b/resources/skins.minerva.tablet.styles/common.less index 9fe89d3..fba9301 100644 --- a/resources/skins.minerva.tablet.styles/common.less +++ b/resources/skins.minerva.tablet.styles/common.less @@ -56,8 +56,6 @@ // FIXME: Have a class that identifies all of these selectors .pre-content, - // Form only pages e.g. Special:MobileOptions - #mw-content-text > form, .content, .post-content { max-width: @contentMaxWidthTablet; @@ -136,8 +134,6 @@ .content-unstyled, .pre-content, .post-content, - // Form only pages e.g. Special:MobileOptions - #mw-content-text > form, // Form only pages e.g Special:MobileOptions #mw-content-text > form .oo-ui-fieldLayout-body, // FIXME: remove need for id selector -- To view, visit https://gerrit.wikimedia.org/r/394632 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2e44279afb3c1d8a291d7b92bd6d32aa955b08a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Set tagline on Special:MobileOptions page
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394435 ) Change subject: Set tagline on Special:MobileOptions page .. Set tagline on Special:MobileOptions page Restrict the existing setting of wikidata descriptions to pages in the main namespace. This will allow us to make the Minerva skin dumber about when it should render and when it should not. Also set a tagline for the special page MobileOptions Given, we anticipate other special pages to also have taglines, a configuration variable MFSpecialPageTaglines is added. Bug: T180095 Change-Id: I3f5886715f0632e67e46e077d362a988a648a123 --- M README.md M extension.json M i18n/en.json M i18n/qqq.json M includes/MobileFrontend.hooks.php 5 files changed, 46 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/35/394435/1 diff --git a/README.md b/README.md index eab92f1..4522da1 100644 --- a/README.md +++ b/README.md @@ -581,6 +581,23 @@ 'tagline' => false, ] ``` + $wgMFSpecialPageTaglines +Set taglines for special pages + +```php +$wgMFSpecialPageTaglines = [ + "SpecialPageName" => "valid-message-key", +]; +``` + +* Type: `Array` +* Default: +```php + [ +"MobileOptions" => "mobile-frontend-settings-tagline" + ] +``` + $wgMFStripResponsiveImages diff --git a/extension.json b/extension.json index 206625b..cbd6606 100644 --- a/extension.json +++ b/extension.json @@ -1264,6 +1264,9 @@ }, "MFNoMobileCategory": false, "MFNoMobilePages": [], + "MFSpecialPageTaglines": { + "MobileOptions": "mobile-frontend-settings-tagline" + }, "MFNearbyRange": 1, "MFNearby": false, "MFNearbyEndpoint": "", diff --git a/i18n/en.json b/i18n/en.json index fdfaf3a..56570a4 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -198,6 +198,7 @@ "mobile-frontend-search-content": "Search within pages", "mobile-frontend-search-content-no-results": "'''{{int:mobile-frontend-search-content}}''' to see if this phrase appears anywhere.", "mobile-frontend-search-no-results": "No page with this title.", + "mobile-frontend-settings-tagline": "Reading preferences", "mobile-frontend-settings-beta": "Beta", "mobile-frontend-settings-site-description": "{{SITENAME}} is available in $1 {{PLURAL:$1|language|languages}}. All available versions are listed below", "mobile-frontend-settings-site-header": "{{SITENAME}} Languages", diff --git a/i18n/qqq.json b/i18n/qqq.json index e78a15e..4baaf0b 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -199,6 +199,7 @@ "mobile-frontend-search-content": "Caption for a button performing full text search of a given search query.\n\nUsed in {{msg-mw|Mobile-frontend-search-content-no-results}}.", "mobile-frontend-search-content-no-results": "Used when no pages with matching titles were found.\n\nRefers to {{msg-mw|Mobile-frontend-search-content}}.", "mobile-frontend-search-no-results": "Message informing user that no pages were found for a given query.", + "mobile-frontend-settings-tagline": "Tagline for Special:MobileOptions - will show under heading", "mobile-frontend-settings-beta": "Text for beta on settings page.\n{{Identical|Beta}}", "mobile-frontend-settings-site-description": "Shown on [[Special:MobileOptions]]. Parameters:\n* $1 - the number of other language versions for this wiki", "mobile-frontend-settings-site-header": "Heading for the Special:MobileOptions/Language page - only visible to non JavaScript users", diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index caa2491..5b4b5b1 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -571,7 +571,9 @@ * @return bool */ public static function onSpecialPageBeforeExecute( SpecialPage $special, $subpage ) { - $isMobileView = MobileContext::singleton()->shouldDisplayMobileView(); + $context = MobileContext::singleton(); + $isMobileView = $context->shouldDisplayMobileView(); + $taglines = $context->getConfig()->get( 'MFSpecialPageTaglines', [] ); $name = $special->getName(); if ( $isMobileView ) { @@ -580,6 +582,10 @@ ); if ( $name === 'Userlogin' || $name === 'CreateAccount' ) { $special->getOutput()->addModules( 'mobile.special.userlogin.scripts' ); + } + if ( isset( $taglines[$name] ) ) { + self::setTagline( $special->getOutput(), + wfMessage( $taglines[$name] ) );
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[specialpages]: Fix broken QUnit test
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394360 ) Change subject: Fix broken QUnit test .. Fix broken QUnit test Correct some options names and make minor adjustments to the constructor function Bug: T181348 Change-Id: Ia9fe9d2923b895d3dc530280e3987e27c88d3282 (cherry picked from commit 89909ccf539f02403df9d1146ca3838cc1bd34bb) --- M resources/skins.minerva.notifications.badge/NotificationBadge.js M tests/qunit/skins.minerva.notifications.badge/test_NotificationBadge.js 2 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/60/394360/1 diff --git a/resources/skins.minerva.notifications.badge/NotificationBadge.js b/resources/skins.minerva.notifications.badge/NotificationBadge.js index 87293c4..18f67b3 100644 --- a/resources/skins.minerva.notifications.badge/NotificationBadge.js +++ b/resources/skins.minerva.notifications.badge/NotificationBadge.js @@ -14,7 +14,7 @@ */ function NotificationBadge( options ) { var $el, - count = 0, + count = options.notificationCountRaw || 0, el = options.el; if ( el ) { @@ -26,7 +26,7 @@ count = Number( $el.find( 'span' ).data( 'notification-count' ) ); } View.call( this, options ); - this.url = this.$el.find( 'a' ).attr( 'href' ); + this.url = options.url; this._bindOverlayManager(); this.setCount( count ); } diff --git a/tests/qunit/skins.minerva.notifications.badge/test_NotificationBadge.js b/tests/qunit/skins.minerva.notifications.badge/test_NotificationBadge.js index ae17500..9f08a08 100644 --- a/tests/qunit/skins.minerva.notifications.badge/test_NotificationBadge.js +++ b/tests/qunit/skins.minerva.notifications.badge/test_NotificationBadge.js @@ -15,7 +15,7 @@ overlayManager: this.OverlayManager, hasNotifications: true, hasUnseenNotifications: true, - notificationCountRawRaw: 5 + notificationCountRaw: 5 } ); initialClassExpectationsMet = badge.$el.find( '.mw-ui-icon' ).length === 0 && badge.$el.find( '.zero' ).length === 0; @@ -24,27 +24,27 @@ assert.ok( initialClassExpectationsMet, 'No icon and no zero class' ); assert.ok( badge.$el.find( '.zero' ).length === 1, 'A zero class is present on the badge' ); badge.setCount( 105 ); - assert.ok( badge.options.notificationCountRawRaw, 100, + assert.ok( badge.options.notificationCountRaw, 100, 'Number is capped to 100.' ); } ); QUnit.test( '#setCount (Eastern Arabic numerals)', function ( assert ) { var badge = new NotificationBadge( { overlayManager: this.OverlayManager, - el: $( '۲' ) + el: $( '۲' ) } ); - assert.ok( badge.options.notificationCountRawRaw, 2, + assert.ok( badge.options.notificationCountRaw, 2, 'Number is parsed from Eastern Arabic numerals' ); - assert.ok( badge.options.notificationCountRawRawString, '۲', + assert.ok( badge.options.notificationCountString, '۲', 'Number will be rendered in Eastern Arabic numerals' ); badge.setCount( 5 ); - assert.ok( badge.options.notificationCountRawRawString, '۵', + assert.ok( badge.options.notificationCountString, '۵', 'Number will be rendered in Eastern Arabic numerals' ); } ); QUnit.test( '#render [hasUnseenNotifications]', function ( assert ) { var badge = new NotificationBadge( { - notificationCountRawRaw: 0, + notificationCountRaw: 0, overlayManager: this.OverlayManager, hasNotifications: false, hasUnseenNotifications: false @@ -54,7 +54,7 @@ QUnit.test( '#markAsSeen', function ( assert ) { var badge = new NotificationBadge( { - notificationCountRawRaw: 2, + notificationCountRaw: 2, overlayManager: this.OverlayManager, hasNotifications: true, hasUnseenNotifications: true -- To view, visit https://gerrit.wikimedia.org/r/394360 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id:
[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: Use mobile-friendly warningbox class
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394126 ) Change subject: Use mobile-friendly warningbox class .. Use mobile-friendly warningbox class This appears unstlyed in the Minerva skin. Minerva understands the standard warningbox class so that should be used here. Given Html::warningBox doesn't allow additional classes or an id, have not used warningBox method. Change-Id: Ideeec5bddb28583c0e2da7dc9c3919e982a3ff0d --- M frontend/FlaggedRevsUI.hooks.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs refs/changes/26/394126/1 diff --git a/frontend/FlaggedRevsUI.hooks.php b/frontend/FlaggedRevsUI.hooks.php index 37f73f6..4afbb05 100644 --- a/frontend/FlaggedRevsUI.hooks.php +++ b/frontend/FlaggedRevsUI.hooks.php @@ -882,7 +882,8 @@ ); # Give a notice if pages on the users's wachlist have pending edits if ( $watchedOutdated ) { - $css = 'plainlinks fr-watchlist-pending-notice'; + $css = 'plainlinks fr-watchlist-pending-notice warningbox content'; + // @todo: Use Html::warningBox $out->prependHTML( "" . wfMessage( 'flaggedrevs-watched-pending' )->parse() . "" ); } -- To view, visit https://gerrit.wikimedia.org/r/394126 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ideeec5bddb28583c0e2da7dc9c3919e982a3ff0d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FlaggedRevs Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[specialpages]: Pages with only forms should take up entire page
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394123 ) Change subject: Pages with only forms should take up entire page .. Pages with only forms should take up entire page On Special:MobileOptions we want to make the form take up the full width but pad the fields in the form (per https://phabricator.wikimedia.org/T180095#3795514) This change is harmless but is necessary as soon as we port the page to OOjs UI (I70f68df9d2d305126444319b05675702af75de87) Bug: T180095 Change-Id: I1dda3eb4d0e7ebbec544dc0f5763b079e38f5cc8 --- M resources/skins.minerva.base.styles/ui.less M resources/skins.minerva.tablet.styles/common.less 2 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/23/394123/1 diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index 3a37d2a..2fbfd81 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -444,6 +444,8 @@ .backtotop, .image-list, .pre-content, +// Form only pages e.g Special:MobileOptions +#mw-content-text > form .oo-ui-fieldLayout-body, .content, .post-content { margin: 0 @contentMargin; diff --git a/resources/skins.minerva.tablet.styles/common.less b/resources/skins.minerva.tablet.styles/common.less index ba87302..9fe89d3 100644 --- a/resources/skins.minerva.tablet.styles/common.less +++ b/resources/skins.minerva.tablet.styles/common.less @@ -56,6 +56,8 @@ // FIXME: Have a class that identifies all of these selectors .pre-content, + // Form only pages e.g. Special:MobileOptions + #mw-content-text > form, .content, .post-content { max-width: @contentMaxWidthTablet; @@ -134,6 +136,10 @@ .content-unstyled, .pre-content, .post-content, + // Form only pages e.g. Special:MobileOptions + #mw-content-text > form, + // Form only pages e.g Special:MobileOptions + #mw-content-text > form .oo-ui-fieldLayout-body, // FIXME: remove need for id selector #mw-mf-page-center .pointer-overlay { margin-left: auto; -- To view, visit https://gerrit.wikimedia.org/r/394123 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1dda3eb4d0e7ebbec544dc0f5763b079e38f5cc8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Render taglines on special pages and update heading styles
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394116 ) Change subject: Render taglines on special pages and update heading styles .. Render taglines on special pages and update heading styles This causes problems with the display of Nearby but is restricted to a feature branch and will be fixed in a follow up. Depends-On: I3f5886715f0632e67e46e077d362a988a648a123 Change-Id: I3bce2a3472ab2e53261965c953572f35cc740eed Bug: T180095 --- M includes/skins/SkinMinerva.php M skinStyles/mobile.special.styles/minerva.less 2 files changed, 9 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/16/394116/1 diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index d5e3d2e..0060820 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -835,10 +835,8 @@ } else { $title = $this->getTitle(); if ( $title ) { - if ( !$title->isMainPage() && $title->inNamespace( NS_MAIN ) ) { - $vars = $this->getSkinConfigVariables(); - $tagline = $vars['wgMFDescription']; - } + $vars = $this->getSkinConfigVariables(); + $tagline = $vars['wgMFDescription']; } } diff --git a/skinStyles/mobile.special.styles/minerva.less b/skinStyles/mobile.special.styles/minerva.less index 8d78eaf..1e945b3 100644 --- a/skinStyles/mobile.special.styles/minerva.less +++ b/skinStyles/mobile.special.styles/minerva.less @@ -2,21 +2,22 @@ .ns-special { #content { - @verticalPadding: 0.5em; #section_0 { - padding: @verticalPadding 0; - text-align: center; - font-size: 1.25em; + padding: 34px 0 0; + font-size: 1.5em; font-weight: bold; - border: 0; } .pre-content { padding: 0; - border-bottom: 0; } } + // Specific to override mobile display + .heading-holder .tagline { + margin-bottom: 15px; + } + h1, h2 { // Important given we have no idea which rules special pages are enforcing -- To view, visit https://gerrit.wikimedia.org/r/394116 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3bce2a3472ab2e53261965c953572f35cc740eed Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[specialpages]: Render taglines on special pages and update heading styles
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/393920 ) Change subject: Render taglines on special pages and update heading styles .. Render taglines on special pages and update heading styles This causes problems with the display of Nearby but is restricted to a feature branch and will be fixed in a follow up. Depends-On: I3f5886715f0632e67e46e077d362a988a648a123 Change-Id: I3bce2a3472ab2e53261965c953572f35cc740eed Bug: T180095 --- M includes/skins/SkinMinerva.php M skinStyles/mobile.special.styles/minerva.less 2 files changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/20/393920/1 diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index d5e3d2e..0060820 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -835,10 +835,8 @@ } else { $title = $this->getTitle(); if ( $title ) { - if ( !$title->isMainPage() && $title->inNamespace( NS_MAIN ) ) { - $vars = $this->getSkinConfigVariables(); - $tagline = $vars['wgMFDescription']; - } + $vars = $this->getSkinConfigVariables(); + $tagline = $vars['wgMFDescription']; } } diff --git a/skinStyles/mobile.special.styles/minerva.less b/skinStyles/mobile.special.styles/minerva.less index 8d78eaf..8efcf71 100644 --- a/skinStyles/mobile.special.styles/minerva.less +++ b/skinStyles/mobile.special.styles/minerva.less @@ -4,19 +4,21 @@ #content { @verticalPadding: 0.5em; #section_0 { - padding: @verticalPadding 0; - text-align: center; - font-size: 1.25em; + padding: @verticalPadding 0 0; + font-size: 1.5em; font-weight: bold; - border: 0; } .pre-content { padding: 0; - border-bottom: 0; } } + // Specific to override mobile display + .heading-holder .tagline { + margin-bottom: 15px; + } + h1, h2 { // Important given we have no idea which rules special pages are enforcing -- To view, visit https://gerrit.wikimedia.org/r/393920 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3bce2a3472ab2e53261965c953572f35cc740eed Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: specialpages Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[specialpages]: Show tagline on Special:MobileOptions page
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/393881 ) Change subject: Show tagline on Special:MobileOptions page .. Show tagline on Special:MobileOptions page Restrict the existing setting of wikidata descriptions to pages in the main namespace. This will allow us to make the Minerva skin dumber about when it should render and when it should not. Also set a tagline for the special page MobileOptions Bug: T180095 Change-Id: I3f5886715f0632e67e46e077d362a988a648a123 --- M i18n/en.json M i18n/qqq.json M includes/MobileFrontend.hooks.php 3 files changed, 19 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/81/393881/1 diff --git a/i18n/en.json b/i18n/en.json index fdfaf3a..56570a4 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -198,6 +198,7 @@ "mobile-frontend-search-content": "Search within pages", "mobile-frontend-search-content-no-results": "'''{{int:mobile-frontend-search-content}}''' to see if this phrase appears anywhere.", "mobile-frontend-search-no-results": "No page with this title.", + "mobile-frontend-settings-tagline": "Reading preferences", "mobile-frontend-settings-beta": "Beta", "mobile-frontend-settings-site-description": "{{SITENAME}} is available in $1 {{PLURAL:$1|language|languages}}. All available versions are listed below", "mobile-frontend-settings-site-header": "{{SITENAME}} Languages", diff --git a/i18n/qqq.json b/i18n/qqq.json index e78a15e..4baaf0b 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -199,6 +199,7 @@ "mobile-frontend-search-content": "Caption for a button performing full text search of a given search query.\n\nUsed in {{msg-mw|Mobile-frontend-search-content-no-results}}.", "mobile-frontend-search-content-no-results": "Used when no pages with matching titles were found.\n\nRefers to {{msg-mw|Mobile-frontend-search-content}}.", "mobile-frontend-search-no-results": "Message informing user that no pages were found for a given query.", + "mobile-frontend-settings-tagline": "Tagline for Special:MobileOptions - will show under heading", "mobile-frontend-settings-beta": "Text for beta on settings page.\n{{Identical|Beta}}", "mobile-frontend-settings-site-description": "Shown on [[Special:MobileOptions]]. Parameters:\n* $1 - the number of other language versions for this wiki", "mobile-frontend-settings-site-header": "Heading for the Special:MobileOptions/Language page - only visible to non JavaScript users", diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index caa2491..08b2c68 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -580,6 +580,9 @@ ); if ( $name === 'Userlogin' || $name === 'CreateAccount' ) { $special->getOutput()->addModules( 'mobile.special.userlogin.scripts' ); + } else if ( $name === 'MobileOptions' ) { + self::setTagline( $special->getOutput(), + wfMessage( 'mobile-frontend-settings-tagline' ) ); } } @@ -1061,6 +1064,16 @@ } /** +* Sets a tagline for a given page that can be displayed by the skin. +* +* @param OutputPage $outputPage +* @param string $desc +*/ + private static function setTagline( OutputPage $outputPage, $desc ) { + $outputPage->setProperty( 'wgMFDescription', $desc ); + } + + /** * OutputPageParserOutput hook handler * Disables TOC in output before it grabs HTML * @see https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageParserOutput @@ -1075,13 +1088,14 @@ if ( $context->shouldDisplayMobileView() ) { $po->setTOCEnabled( false ); $outputPage->setProperty( 'MFTOC', $po->getTOCHTML() !== '' ); - - if ( $context->shouldShowWikibaseDescriptions( 'tagline' ) ) { + $title = $outputPage->getTitle(); + // Only set the tagline if the feature has been enabled and the article is in the main namespace + if ( $context->shouldShowWikibaseDescriptions( 'tagline' ) && $title->getNamespace() === NS_MAIN ) { $item = $po->getProperty( 'wikibase_item' ); if ( $item ) { $desc = ExtMobileFrontend::getWikibaseDescription( $item ); if ( $desc ) { - $outputPage->setProperty( 'wgMFDescription', $desc ); +
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Disable download button in all namespaces except main
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/393852 ) Change subject: Disable download button in all namespaces except main .. Disable download button in all namespaces except main Bug: T181152 Change-Id: Id78c1de9e8e9013530106bc0d45d3cf0297897b5 --- M resources/skins.minerva.scripts/init.js 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/52/393852/1 diff --git a/resources/skins.minerva.scripts/init.js b/resources/skins.minerva.scripts/init.js index 72eab1f..7533f6b 100644 --- a/resources/skins.minerva.scripts/init.js +++ b/resources/skins.minerva.scripts/init.js @@ -230,6 +230,8 @@ if ( config.get( 'wgMinervaDownloadIcon' ) && + // Download button can be confusing in other namespaces see T181152 + config.get( 'wgNamespaceNumber' ) === 0 && !page.isMainPage() && // The iOS print dialog does not provide pdf functionality (see T177215) !browser.isIos() && -- To view, visit https://gerrit.wikimedia.org/r/393852 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id78c1de9e8e9013530106bc0d45d3cf0297897b5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits