[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Remove CiteThisPage from blacklist for page previews

2017-08-23 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373300 )

Change subject: Remove CiteThisPage from blacklist for page previews
..

Remove CiteThisPage from blacklist for page previews

Bug: T173865
Change-Id: If64e5130f47169a755ae2b70d52b7e5e38441899
---
M wmf-config/InitialiseSettings.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/00/373300/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 838185c..132a541 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -13569,7 +13569,6 @@
'Special:TemplateSandbox',
'Special:MostLinkedFiles',
'Special:Book',
-   'Special:CiteThisPage',
],
 ],
 'wgPopupsAnonsEnabledSamplingRate' => [

-- 
To view, visit https://gerrit.wikimedia.org/r/373300
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If64e5130f47169a755ae2b70d52b7e5e38441899
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...Vector[master]: Set line height to 1 for sup and sub elements

2017-08-23 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373299 )

Change subject: Set line height to 1 for sup and sub elements
..

Set line height to 1 for sup and sub elements

Bug: T172501
Change-Id: Ib24900f93a671aeb739a497be9bcff5ee546b057
---
M print.less
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector 
refs/changes/99/373299/1

diff --git a/print.less b/print.less
index 1957008..28ef86e 100644
--- a/print.less
+++ b/print.less
@@ -140,6 +140,11 @@
}
}
 
+   sup,
+   sub {
+   line-height: 1;
+   }
+
// Using #toc rather than .toc to override default print style
#toc {
page-break-before: avoid;

-- 
To view, visit https://gerrit.wikimedia.org/r/373299
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib24900f93a671aeb739a497be9bcff5ee546b057
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
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.30.0-wmf.14]: Verify the existence of `url` key when parsing lang objects

2017-08-23 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373292 )

Change subject: Verify the existence of `url` key when parsing lang objects
..

Verify the existence of `url` key when parsing lang objects

Some langLinks retrieved from API call do not contain url property, only
code and title. If that happens do not throw PHP notice error. Log
the error and skip broken lang object.

Changes:
 - extracted langObject validation to a separate function
 - added url property existence check
 - renamed $code to $index as $langLinks is an array without keys
 - introduced MobileContext::LOGGER_CHANNEL as it's used in couple
   places

Bug: T172316
Change-Id: I4ef5b1ad4a37b96407f7f758680a6177cafdf128
(cherry picked from commit 456264d8c2b67bfe665bc153af6143e8597cd3b7)
---
M includes/MobileContext.php
M includes/specials/SpecialMobileLanguages.php
M tests/phpunit/specials/SpecialMobileLanguagesTest.php
3 files changed, 67 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/92/373292/1

diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index 330a39a..cd7be3d 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -21,7 +21,7 @@
const LAZY_LOAD_IMAGES_COOKIE_VALUE = 'A';
const LAZY_LOAD_REFERENCES_COOKIE_NAME = 'mfLazyLoadReferences';
const LAZY_LOAD_REFERENCES_COOKIE_VALUE = 'A';
-
+   const LOGGER_CHANNEL = 'mobile';
/**
 * Saves the testing mode user has opted in: 'beta' or 'stable'
 * @var string $mobileMode
diff --git a/includes/specials/SpecialMobileLanguages.php 
b/includes/specials/SpecialMobileLanguages.php
index 91e9783..735645e 100644
--- a/includes/specials/SpecialMobileLanguages.php
+++ b/includes/specials/SpecialMobileLanguages.php
@@ -58,15 +58,14 @@
// Set the name of each language based on the system 
list of language names
$languageMap = Language::fetchLanguageNames();
$languages = $page['langlinks'];
-   foreach ( $page['langlinks'] as $code => $langObject ) {
-   if ( !isset( $languageMap[$langObject['lang']] 
) ) {
-   // Bug T93500: DB might still have 
preantiquated rows with bogus languages
-   unset( $languages[$code] );
+   foreach ( $page['langlinks'] as $index => $langObject ) 
{
+   if ( !$this->isLanguageObjectValid( 
$languageMap, $langObject ) ) {
+   unset( $languages[$index] );
continue;
}
$langObject['langname'] = 
$languageMap[$langObject['lang']];
$langObject['url'] = 
MobileContext::singleton()->getMobileUrl( $langObject['url'] );
-   $languages[$code] = $langObject;
+   $languages[$index] = $langObject;
}
$compareLanguage = function ( $a, $b ) {
return strcasecmp( $a['langname'], 
$b['langname'] );
@@ -80,6 +79,33 @@
}
 
/**
+* Verify if passed language object contains all necessary information
+*
+* @see https://phabricator.wikimedia.org/T93500
+* @see https://phabricator.wikimedia.org/T172316
+* @param array $languageMap array of language names, indexed by code.
+* @param array $langObject array of lang objects
+* @return bool
+*/
+   private function isLanguageObjectValid( $languageMap, $langObject ) {
+   if ( !isset( $languageMap[$langObject['lang']] ) ) {
+   // Bug T93500: DB might still have preantiquated rows 
with bogus languages
+   return false;
+   }
+   if ( !array_key_exists( 'url', $langObject ) ) {
+   // Bug T172316: Some lang objects do not have url. We 
would like to log those instances
+   \MediaWiki\Logger\LoggerFactory::getInstance( 
MobileContext::LOGGER_CHANNEL )->warning(
+   '`url` key is undefined in language object',
+   [
+   'uri' => 
RequestContext::getMain()->getRequest()->getFullRequestURL(),
+   'langObject' => $langObject,
+   ]
+   );
+   return false;
+   }
+   return true;
+   }
+   /**
 * Returns an array of language variants that the page is available in
 * @return array
 */
diff --git a/tests/phpunit/sp

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: WIP: Limit usage of global jQuery in preference of ES6

2017-08-22 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373139 )

Change subject: WIP: Limit usage of global jQuery in preference of ES6
..

WIP: Limit usage of global jQuery in preference of ES6

* ESLint will now complain if you use global jQuery
* Object.assign used instead of $.extend
* global $ is now allowed inside initialisation scripts, tests
* it is also allowed View/OverlayManager which are in control of
rendering and state

TODO:
* Add polyfills for Object.assign
* Fix BackToTopOverlay FIXME in a patch before this
* Replace $.Deferred calls where possible
* Review/Reconsider usages of $.inArray and $.proxy and $.noop

Change-Id: Ia3a6a5d13df1a3f96121c6a755ac7822d77afcf6
---
M .eslintrc.json
M resources/mobile.abusefilter/AbuseFilterOverlay.js
M resources/mobile.backtotop/BackToTopOverlay.js
M resources/mobile.betaoptin/BetaOptinPanel.js
M resources/mobile.categories.overlays/CategoryAddOverlay.js
M resources/mobile.categories.overlays/CategoryGateway.js
M resources/mobile.categories.overlays/CategoryLookupInputWidget.js
M resources/mobile.categories.overlays/CategoryOverlay.js
M resources/mobile.editor.api/EditorGateway.js
M resources/mobile.editor.common/EditorOverlayBase.js
M resources/mobile.editor.overlay/EditorOverlay.js
M resources/mobile.editor.ve/VisualEditorOverlay.js
M resources/mobile.fontchanger/FontChanger.js
M resources/mobile.foreignApi/JSONPForeignApi.js
M resources/mobile.gallery/PhotoList.js
M resources/mobile.gallery/PhotoListGateway.js
M resources/mobile.gallery/test_PhotoListApiGateway.js
M resources/mobile.infiniteScroll/InfiniteScroll.js
M resources/mobile.issues/CleanupOverlay.js
M resources/mobile.languages.structured/LanguageOverlay.js
M resources/mobile.mediaViewer/ImageGateway.js
M resources/mobile.mediaViewer/ImageOverlay.js
M resources/mobile.nearby/Nearby.js
M resources/mobile.nearby/NearbyGateway.js
M resources/mobile.notifications.filter.overlay/NotificationsFilterOverlay.js
M resources/mobile.notifications.overlay/NotificationsOverlay.js
M resources/mobile.pagelist.scripts/WatchstarPageList.js
M resources/mobile.patrol.ajax/init.js
M resources/mobile.pointerOverlay/PointerOverlay.js
M resources/mobile.references.gateway/ReferencesHtmlScraperGateway.js
M resources/mobile.references.gateway/ReferencesMobileViewGateway.js
M resources/mobile.references/ReferencesDrawer.js
M resources/mobile.search.api/SearchGateway.js
M resources/mobile.search.util/extendSearchParams.js
M resources/mobile.search/SearchOverlay.js
M resources/mobile.special.mobileeditor.scripts/redirectmobileeditor.js
M resources/mobile.special.mobileoptions.scripts.fontchanger/init.js
M resources/mobile.special.mobileoptions.scripts/mobileoptions.js
M resources/mobile.special.nearby.scripts/nearby.js
M resources/mobile.special.uploads.scripts/uploads.js
M resources/mobile.special.userlogin.scripts/userlogin.js
M resources/mobile.startup/CtaDrawer.js
M resources/mobile.startup/Drawer.js
M resources/mobile.startup/Icon.js
M resources/mobile.startup/Overlay.js
M resources/mobile.startup/OverlayManager.js
M resources/mobile.startup/Page.js
M resources/mobile.startup/PageGateway.js
M resources/mobile.startup/PageList.js
M resources/mobile.startup/Skin.js
M resources/mobile.startup/View.js
M resources/mobile.startup/browser.js
M resources/mobile.startup/icons.js
M resources/mobile.startup/oo-extend.js
M resources/mobile.startup/time.js
M resources/mobile.startup/toast.js
M resources/mobile.startup/user.js
M resources/mobile.startup/util.js
M resources/mobile.talk.overlays/TalkOverlay.js
M resources/mobile.talk.overlays/TalkSectionAddOverlay.js
M resources/mobile.talk.overlays/TalkSectionOverlay.js
M resources/mobile.toggle/toggle.js
M resources/mobile.watchlist/WatchList.js
M resources/mobile.watchlist/WatchListGateway.js
M resources/mobile.watchstar/WatchstarGateway.js
M tests/qunit/mobile.editor.api/test_EditorGateway.js
M tests/qunit/mobile.editor.overlay/test_EditorOverlay.js
M tests/qunit/mobile.infiniteScroll/test_InfiniteScroll.js
M tests/qunit/mobile.languages.structured/test_util.js
M tests/qunit/mobile.mediaViewer/test_ImageOverlay.js
M tests/qunit/mobile.nearby/test_Nearby.js
M tests/qunit/mobile.nearby/test_NearbyGateway.js
M tests/qunit/mobile.pagelist.scripts/test_WatchstarPageList.js
M tests/qunit/mobile.references.gateway/test_ReferencesHtmlScraperGateway.js
M tests/qunit/mobile.references.gateway/test_ReferencesMobileViewGateway.js
M tests/qunit/mobile.references/test_ReferencesDrawer.js
M tests/qunit/mobile.search.api/test_SearchGateway.js
M tests/qunit/mobile.search.util/test_extendSearchParams.js
M tests/qunit/mobile.startup/test_Overlay.js
M tests/qunit/mobile.startup/test_OverlayManager.js
M tests/qunit/mobile.startup/test_Page.js
M tests/qunit/mobile.startup/test_PageGateway.js
M tests/qunit/mobile.startup/test_Skin.js
M tests/qunit/mobile.startup/test_View.js
M tests/qunit/mobile.startup/te

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Use String.prototype.trim

2017-08-22 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373138 )

Change subject: Hygiene: Use String.prototype.trim
..

Hygiene: Use String.prototype.trim

No need to use $.trim when we support ES5

Change-Id: Ifc9b17a25b6be9014c5b0ae24fae44561c5680f5
---
M tests/qunit/mobile.talk.overlays/test_TalkOverlay.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/38/373138/1

diff --git a/tests/qunit/mobile.talk.overlays/test_TalkOverlay.js 
b/tests/qunit/mobile.talk.overlays/test_TalkOverlay.js
index 0d89040..df367ec 100644
--- a/tests/qunit/mobile.talk.overlays/test_TalkOverlay.js
+++ b/tests/qunit/mobile.talk.overlays/test_TalkOverlay.js
@@ -59,7 +59,7 @@
} );
 
assert.ok( overlay.$( '.add' ).length > 0, 'There is an "Add 
discussion" button' );
-   assert.strictEqual( $.trim( overlay.$( '.content-header' 
).text() ),
+   assert.strictEqual( overlay.$( '.content-header' 
).text().trim(),
mw.msg( 'mobile-frontend-talk-explained-empty' ),
'Check the header knows it is empty.' );
} );
@@ -75,7 +75,7 @@
'The text of the second item is the section heading.' );
assert.strictEqual( overlay.$( '.topic-title-list li a' ).data( 
'id' ), 50,
'The data id is set.' );
-   assert.strictEqual( $.trim( overlay.$( '.content-header' 
).text() ),
+   assert.strictEqual( overlay.$( '.content-header' 
).text().trim() ),
mw.msg( 'mobile-frontend-talk-explained' ),
'Check the header knows it is not empty.' );
} );

-- 
To view, visit https://gerrit.wikimedia.org/r/373138
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc9b17a25b6be9014c5b0ae24fae44561c5680f5
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...Vector[master]: Adjust TOC print styles

2017-08-22 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373120 )

Change subject: Adjust TOC print styles
..

Adjust TOC print styles

* Font size shrunk and declared in pt
* Margin adjustment
* page-break-before now uses avoid

Bug: T173767
Change-Id: Ieeabc22079978cdf1f8484f3ac9961d990901336
---
M print.less
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector 
refs/changes/20/373120/1

diff --git a/print.less b/print.less
index d770e3f..1957008 100644
--- a/print.less
+++ b/print.less
@@ -142,8 +142,8 @@
 
// Using #toc rather than .toc to override default print style
#toc {
-   page-break-before: always;
-   page-break-after: always;
+   page-break-before: avoid;
+   page-break-after: avoid;
background: none;
border: 0;
display: block;
@@ -156,7 +156,7 @@
> ul {
 
> li {
-   margin-bottom: 20px;
+   margin-bottom: 4px;
font-weight: bold;
 
> ul {
@@ -184,7 +184,7 @@
li.toclevel-1 {
> a {
font-weight: bold;
-   font-size: 16px;
+   font-size: 10pt;
}
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/373120
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieeabc22079978cdf1f8484f3ac9961d990901336
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
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]: Hygiene: Correct summary spec test

2017-08-22 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373093 )

Change subject: Hygiene: Correct summary spec test
..

Hygiene: Correct summary spec test

The spec comment incorrectly says a link will be flattened but
the test was simplified to only test  retainment.

Change-Id: If75524cd95c4a117bd360e744d663ddc0d45957c
---
M test/lib/transformations/summarize.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/93/373093/1

diff --git a/test/lib/transformations/summarize.js 
b/test/lib/transformations/summarize.js
index 1a2b3ca..1091f56 100644
--- a/test/lib/transformations/summarize.js
+++ b/test/lib/transformations/summarize.js
@@ -18,7 +18,7 @@
 'This summary should be nice and clean (noexcerpts will be omitted).',
 'This summary should be nice and clean.'
 ],
-// sup elements are retained and links are flattened
+// sup elements are retained
 [
 'A googolplex is the number 10googol, or 
equivalently, 10(10100).',
 'A googolplex is the number 10googol, or 
equivalently, 10(10100).'

-- 
To view, visit https://gerrit.wikimedia.org/r/373093
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If75524cd95c4a117bd360e744d663ddc0d45957c
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...MinervaNeue[master]: QA: Do not run various toast notification browser tests on BC

2017-08-22 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373085 )

Change subject: QA: Do not run various toast notification browser tests on BC
..

QA: Do not run various toast notification browser tests on BC

These flake too much. We have coverage in @firefox or @integration
so let's remove these test runs from the beta cluster job.

All tests will run somewhere.

Change-Id: I269991a22ab5a2b54aed8ad453013bb9be648502
---
M tests/browser/features/editor_wikitext_saving.feature
M tests/browser/features/language.feature
2 files changed, 10 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/85/373085/1

diff --git a/tests/browser/features/editor_wikitext_saving.feature 
b/tests/browser/features/editor_wikitext_saving.feature
index cc4cf16..07b9517 100644
--- a/tests/browser/features/editor_wikitext_saving.feature
+++ b/tests/browser/features/editor_wikitext_saving.feature
@@ -4,7 +4,7 @@
   Background:
 Given I am logged into the mobile website
 
-  @smoke @editing @integration @chrome
+  @smoke @editing @integration
   Scenario: Successful edit on page without languages shows no language button 
[bug 63675]
 Given the page "Selenium no languages test page" exists
 When I click the edit button
diff --git a/tests/browser/features/language.feature 
b/tests/browser/features/language.feature
index f45a064..d17d090 100644
--- a/tests/browser/features/language.feature
+++ b/tests/browser/features/language.feature
@@ -4,31 +4,35 @@
   Background:
 Given I am using the mobile site
 
-  @smoke @integration
+  @smoke @integration @en.m.wikipedia.beta.wmflabs.org
   Scenario: Language button
 Given I go to a page that has languages
 Then I should see the switch-language page action
 
-  @smoke @integration
+  @smoke @integration @en.m.wikipedia.beta.wmflabs.org
   Scenario: Language button (on a page that doesn't have languages)
 Given I go to a page that does not have languages
 Then I should see the disabled switch-language page action
 
+  @en.m.wikipedia.beta.wmflabs.org
   Scenario: Tapping icon opens language overlay
 Given I go to a page that has languages
 When I click the switch-language page action
 Then I should see the language overlay
 
+  @en.m.wikipedia.beta.wmflabs.org
   Scenario: Tapping icon does not open language overlay (on a page that 
doesn't have languages)
 Given I go to a page that does not have languages
 When I click the switch-language page action
 Then I should not see the languages overlay
 
+  @integration
   Scenario: Tapping the disabled icon shows a toast
 Given I go to a page that does not have languages
 When I click the switch-language page action
 Then I should see a toast with message "This page is not available in 
other languages."
 
+  @en.m.wikipedia.beta.wmflabs.org
   Scenario: Closing language overlay (overlay button)
 Given I go to a page that has languages
 When I click the switch-language page action
@@ -36,6 +40,7 @@
 And I click the language overlay close button
 Then I should not see the languages overlay
 
+  @en.m.wikipedia.beta.wmflabs.org
   Scenario: Closing language overlay (browser button)
 Given I go to a page that has languages
 When I click the switch-language page action
@@ -43,6 +48,7 @@
 And I click the browser back button
 Then I should not see the languages overlay
 
+  @en.m.wikipedia.beta.wmflabs.org
   Scenario: Checking that there are no suggested language links
 Given I go to a page that has languages
 When I click the switch-language page action
@@ -50,7 +56,7 @@
 Then I should not see a suggested language link
 Then I should see a non-suggested language link
 
-  @smoke
+  @smoke @en.m.wikipedia.beta.wmflabs.org @integration
   Scenario: Checking that the suggested language link has been created
 Given I go to a page that has languages
 And I click the switch-language page action

-- 
To view, visit https://gerrit.wikimedia.org/r/373085
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I269991a22ab5a2b54aed8ad453013bb9be648502
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[master]: Disable wikitext editor on non-wikitext content models

2017-08-22 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373076 )

Change subject: Disable wikitext editor on non-wikitext content models
..

Disable wikitext editor on non-wikitext content models

Do not allow editing via JavaScript on non-wikitext content models
For these pages ?action=edit will be used

Bug: T173800
Change-Id: Ic62a0c1397ab8a6a59e5382c2999b63b3c60a19f
---
M resources/skins.minerva.editor/init.js
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/76/373076/1

diff --git a/resources/skins.minerva.editor/init.js 
b/resources/skins.minerva.editor/init.js
index c6b5b6d..0a15ce4 100644
--- a/resources/skins.minerva.editor/init.js
+++ b/resources/skins.minerva.editor/init.js
@@ -24,7 +24,9 @@
popup = M.require( 'mobile.startup/toast' ),
// FIXME: Disable on IE < 10 for time being
blacklisted = /MSIE \d\./.test( navigator.userAgent ),
-   isEditingSupported = router.isSupported() && !blacklisted,
+   // Only load the wikitext editor on wikitext. Otherwise we'll 
rely on the ?action=edit url (T173800)
+   contentModel = mw.config.get( 'wgPageContentModel' ),
+   isEditingSupported = router.isSupported() && !blacklisted && 
contentModel === 'wikitext',
// FIXME: Use currentPage.getId()
isNewPage = currentPage.options.id === 0,
isNewFile = currentPage.inNamespace( 'file' ) && isNewPage,

-- 
To view, visit https://gerrit.wikimedia.org/r/373076
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic62a0c1397ab8a6a59e5382c2999b63b3c60a19f
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[master]: Make sure referenced file exists

2017-08-21 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372882 )

Change subject: Make sure referenced file exists
..

Make sure referenced file exists

Change-Id: I9fd767646f1b02cf9ca0865a0d7ed9823929f839
---
A skinStyles/mobile.startup/error.svg
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/82/372882/1

diff --git a/skinStyles/mobile.startup/error.svg 
b/skinStyles/mobile.startup/error.svg
new file mode 100644
index 000..1317ec6
--- /dev/null
+++ b/skinStyles/mobile.startup/error.svg
@@ -0,0 +1 @@
+http://www.w3.org/2000/svg";>
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/372882
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9fd767646f1b02cf9ca0865a0d7ed9823929f839
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...mobileapps[master]: Add test case for summary endpoint

2017-08-21 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372875 )

Change subject: Add test case for summary endpoint
..

Add test case for summary endpoint

Change-Id: Id550eba05ff9d2746834b7802bf5f987aa216e09
---
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/75/372875/1

diff --git a/test/lib/transformations/summarize.js 
b/test/lib/transformations/summarize.js
index 2b19517..f6438fb 100644
--- a/test/lib/transformations/summarize.js
+++ b/test/lib/transformations/summarize.js
@@ -76,6 +76,11 @@
 [
 'Der Deutsche Orden, auch Deutschherrenorden 
oder Deutschritterorden genannt, ist eine römisch-katholische 
Ordensgemeinschaft. Mit dem Johanniter- und dem 
Malteserorden steht er in der (Rechts-)Nachfolge der Ritterorden 
aus der Zeit der Kreuzzüge. Die Mitglieder des Ordens sind seit der 
Reform der Ordensregel 1929 regulierte Chorherren. Der Orden hat 
gegenwärtig 1100 Mitglieder, darunter 100 Priester und 200 
Ordensschwestern, die sich vorwiegend karitativen Aufgaben widmen. Der 
Hauptsitz befindet sich heute in Wien.',
 'Der Deutsche Orden, auch Deutschherrenorden 
oder Deutschritterorden genannt, ist eine römisch-katholische 
Ordensgemeinschaft. Mit dem Johanniter- und dem 
Malteserorden steht er in der (Rechts-)Nachfolge der 
Ritterorden aus der Zeit der Kreuzzüge. Die 
Mitglieder des Ordens sind seit der Reform der Ordensregel 1929 
regulierte Chorherren. Der Orden hat gegenwärtig 1100 Mitglieder, 
darunter 100 Priester und 200 Ordensschwestern, die sich 
vorwiegend karitativen Aufgaben widmen. Der Hauptsitz befindet sich heute in 
Wien.'
+],
+// Full stops do not limit the summaey length (T173640)
+[
+  'Arm. 
gen. Ing. Petr Pavel, 
M.A., (* 1. listopadu 1961 Planá) je český voják, generál 
Armády 
České republiky a od června 2015 předseda vojenského výboru NATO. Jako první zástupce zemí bývalé Varšavské smlouvy 
tak nastoupil do nejvyšší vojenské funkce Severoatlantické aliance.[1][2]',
+  'Arm. gen. Ing. Petr Pavel, 
M.A., je český voják, 
generál Armády České republiky a od 
června 2015 předseda vojenského výboru NATO. Jako první zástupce 
zemí bývalé Varšavské smlouvy tak nastoupil do nejvyšší vojenské 
funkce Severoatlantické aliance.'
 ]
 ];
 testCases.forEach((test) => {

-- 
To view, visit https://gerrit.wikimedia.org/r/372875
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id550eba05ff9d2746834b7802bf5f987aa216e09
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]: Hygiene: Remove dead config variable

2017-08-21 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372838 )

Change subject: Hygiene: Remove dead config variable
..

Hygiene: Remove dead config variable

Change-Id: I2c3ae7e0e7bbd5c173c37a4fbc82fb63ae82bd52
---
M wmf-config/mobile.php
1 file changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/38/372838/1

diff --git a/wmf-config/mobile.php b/wmf-config/mobile.php
index 1fcd38d..3bb3233 100644
--- a/wmf-config/mobile.php
+++ b/wmf-config/mobile.php
@@ -67,9 +67,6 @@
 
$wgMFEnableBeta = true;
 
-   // Allow editing for non-JavaScript users
-   $wgMFAllowNonJavaScriptEditing = true;
-
// Turn on volunteer recruitment
$wgMFEnableJSConsoleRecruitment = true;
 

-- 
To view, visit https://gerrit.wikimedia.org/r/372838
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c3ae7e0e7bbd5c173c37a4fbc82fb63ae82bd52
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[master]: Revert "Import the right files"

2017-08-18 Thread Jdlrobson (Code Review)
Hello Pmiazga, jenkins-bot,

I'd like you to do a code review.  Please visit

https://gerrit.wikimedia.org/r/372562

to review the following change.


Change subject: Revert "Import the right files"
..

Revert "Import the right files"

This wasnn't the appropriate thing to do.
These skinStyles need to be moved to the Minerva skin.
I'll open a task.

This reverts commit 366f4f7f552dfcccb3c01fad3803c0e170153f2f.

Change-Id: I75c9bf25e6efb32bd680a61f3afcd5f175e33895
---
M skinStyles/mobile.editor.ve/minerva.less
M skinStyles/mobile.notifications.overlay/minerva.less
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/62/372562/1

diff --git a/skinStyles/mobile.editor.ve/minerva.less 
b/skinStyles/mobile.editor.ve/minerva.less
index c4f5ab4..5e10e88 100644
--- a/skinStyles/mobile.editor.ve/minerva.less
+++ b/skinStyles/mobile.editor.ve/minerva.less
@@ -1,5 +1,5 @@
 @import 'mediawiki.mixins.less';
-@import 'mobile.variables';
+@import 'minerva.variables';
 
 .editor-overlay-ve {
.content {
diff --git a/skinStyles/mobile.notifications.overlay/minerva.less 
b/skinStyles/mobile.notifications.overlay/minerva.less
index 589177f..2f6903c 100644
--- a/skinStyles/mobile.notifications.overlay/minerva.less
+++ b/skinStyles/mobile.notifications.overlay/minerva.less
@@ -1,4 +1,4 @@
-@import 'mobile.variables';
+@import 'minerva.variables';
 
 .notifications-overlay .overlay-content {
top: @headerHeight;

-- 
To view, visit https://gerrit.wikimedia.org/r/372562
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75c9bf25e6efb32bd680a61f3afcd5f175e33895
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 
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/core[master]: Enable mediawiki.special.userlogin.common.styles on mobile a...

2017-08-18 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372561 )

Change subject: Enable mediawiki.special.userlogin.common.styles on mobile and 
allow skins to style it
..

Enable mediawiki.special.userlogin.common.styles on mobile and allow skins to 
style it

Bug: T173597
Change-Id: I36e596e4d6060ef168464732028cd0dcbf21d0f8
---
M resources/Resources.php
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/61/372561/1

diff --git a/resources/Resources.php b/resources/Resources.php
index 09bd4dc..229ac34 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -2180,9 +2180,10 @@
'styles' => 
'resources/src/mediawiki.special/mediawiki.special.upload.styles.css',
],
'mediawiki.special.userlogin.common.styles' => [
-   'styles' => [
-   
'resources/src/mediawiki.special/mediawiki.special.userlogin.common.css',
-   ],
+   'targets' => [ 'desktop', 'mobile' ],
+   'skinStyles' => {
+   'default' => 
'resources/src/mediawiki.special/mediawiki.special.userlogin.common.css',
+   },
],
'mediawiki.special.userlogin.login.styles' => [
'styles' => [

-- 
To view, visit https://gerrit.wikimedia.org/r/372561
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I36e596e4d6060ef168464732028cd0dcbf21d0f8
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[master]: WIP: Remove special page handling

2017-08-18 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372560 )

Change subject: WIP: Remove special page handling
..

WIP: Remove special page handling

This is handled by MobileFrontend now, just as it should do.
We rely on skinStyles where possible.

Depends-On: I665f6fe60939475249786fdc951149c38473fda6
Change-Id: I0fe9efcf98bbd8e188d91a29d4cfda897d47808d
---
M includes/skins/SkinMinerva.php
D resources/skins.minerva.special.styles/common.less
D resources/skins.minerva.special.styles/forms.less
D resources/skins.minerva.special.watchlist.scripts/watchlist.js
D resources/skins.minerva.special.watchlist.styles/specialWatchlist.less
M skin.json
A skinStyles/mobile.special.styles/minerva.less
7 files changed, 31 insertions(+), 186 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/60/372560/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index d108b48..4730d42 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -264,8 +264,6 @@
 
if ( $title->isMainPage() ) {
$className .= ' page-Main_Page ';
-   } elseif ( $title->isSpecialPage() ) {
-   $className .= ' mw-mf-special ';
}
 
if ( $this->isAuthenticatedUser() ) {
@@ -1369,12 +1367,6 @@
} elseif ( $this->getUserPageHelper()->isUserPage() ) {
$styles[] = 'skins.minerva.userpage.styles';
$styles[] = 'skins.minerva.userpage.icons';
-   } elseif ( $title->isSpecialPage() ) {
-   $styles[] = 'mobile.messageBox.styles';
-   $styles['special'] = 'skins.minerva.special.styles';
-   }
-   if ( $this->getOutput()->getRequest()->getText( 'oldid' ) ) {
-   $styles[] = 'mobile.messageBox.styles';
}
 
return $styles;
diff --git a/resources/skins.minerva.special.styles/common.less 
b/resources/skins.minerva.special.styles/common.less
deleted file mode 100644
index 5d2d0c7..000
--- a/resources/skins.minerva.special.styles/common.less
+++ /dev/null
@@ -1,63 +0,0 @@
-@import 'minerva.variables';
-@import 'minerva.mixins';
-
-// FIXME: Apply these styles to all special pages
-.mw-mf-special #content {
-   @verticalPadding: 0.5em;
-   #section_0 {
-   padding: @verticalPadding 0;
-   text-align: center;
-   font-size: 1.25em;
-   font-weight: bold;
-   border: 0;
-   }
-
-   .pre-content {
-   padding: 0;
-   border-bottom: 0;
-   }
-}
-
-// used in Special:Nearby and Special:UserLogin
-.errorbox,
-.error {
-   color: @colorErrorText;
-   background: @colorErrorBackground;
-}
-
-.mw-mf-special {
-   h1,
-   h2 {
-   font-family: @fontFamily;
-   }
-
-   .content-header {
-   padding: 0 0 20px;
-   border-bottom: 1px solid @colorGray12;
-
-   h2 {
-   padding: 0;
-   font-size: 1.1em;
-   font-weight: bold;
-   border-bottom: 0;
-   text-align: center;
-   }
-   }
-
-   .content {
-   // don't apply these styles to headings in message boxes
-   > h2 {
-   text-align: center;
-   margin: 0.7em 0;
-   font-size: 1.1em;
-   color: @grayMedium;
-   }
-   }
-
-   .error {
-   h2 {
-   margin-top: 0;
-   text-transform: none;
-   }
-   }
-}
diff --git a/resources/skins.minerva.special.styles/forms.less 
b/resources/skins.minerva.special.styles/forms.less
deleted file mode 100644
index 1f3bbf5..000
--- a/resources/skins.minerva.special.styles/forms.less
+++ /dev/null
@@ -1,51 +0,0 @@
-@import 'mediawiki.mixins.less';
-@import 'minerva.variables.less';
-@import 'minerva.mixins.less';
-
-form {
-   // FIXME: work out what to do with these
-   #mw-prefs-restoreprefs {
-   display: none;
-   }
-
-   fieldset {
-   font-size: 0.9em;
-
-   .htmlform-tip {
-   display: none;
-   }
-
-   .mw-label,
-   .mw-ui-checkbox {
-   font-style: italic;
-   font-size: 0.9em;
-   }
-
-   legend {
-   color: @grayMedium;
-   font-size: 0.8em;
-   font-weight: bold;
-   text-transform: uppercase;
-   }
-
-   fieldset {
-   margin: 0 0 

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Remove and tidy some Minerva references

2017-08-18 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372558 )

Change subject: Hygiene: Remove and tidy some Minerva references
..

Hygiene: Remove and tidy some Minerva references

* Update inline comments refering Minerva
* Correct a test name
* Drop an unnecessary config variable
* Correct folder where Grunt looks
* No need to register MinervaHooks registration function

Change-Id: I15cab5e51aee6796259f2a61ba0204bec2a64d23
---
M Gruntfile.js
M includes/MobileFrontend.hooks.php
M includes/modules/MobileSiteModule.php
M includes/specials/MobileSpecialPage.php
M resources/mobile.special.uploads.styles/default.less
M tests/browser/LocalSettings.php
M tests/phpunit/MobileFrontend.skin.hooksTest.php
7 files changed, 10 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/58/372558/1

diff --git a/Gruntfile.js b/Gruntfile.js
index ba64921..f20c340 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -24,7 +24,7 @@
syntax: 'less'
},
all: [
-   'minerva.less/**/*.less',
+   'mobile.less/**/*.less',
'resources/**/*.less'
]
},
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 594fac5..787a00d 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -830,9 +830,8 @@
$preferences[SpecialMobileWatchlist::FILTER_OPTION_NAME] = 
$definition;
$preferences[SpecialMobileWatchlist::VIEW_OPTION_NAME] = 
$definition;
 
-   // Remove the Minerva skin from the preferences unless Minerva 
has been enabled in
-   // BetaFeatures provided that the user has not set it as the 
default skin.
-   // FIXME: This can be removed when Minerva lives in its own 
repository.
+   // Remove the Minerva skin from the preferences page
+   // FIXME: This can be removed when T171644 has been resolved.
if ( $defaultSkin !== 'minerva' ) {
// Preference key/values are backwards. The value is 
the name of the skin. The
// key is the text+links to display.
@@ -1290,10 +1289,6 @@
} else {
Hooks::register( 'UserLoginForm', 
'MobileFrontendHooks::onUserLoginForm' );
Hooks::register( 'UserCreateForm', 
'MobileFrontendHooks::onUserCreateForm' );
-   }
-
-   if ( class_exists( 'MinervaHooks' ) ) {
-   MinervaHooks::onRegistration();
}
}
 }
diff --git a/includes/modules/MobileSiteModule.php 
b/includes/modules/MobileSiteModule.php
index 64880ee..9c39d30 100644
--- a/includes/modules/MobileSiteModule.php
+++ b/includes/modules/MobileSiteModule.php
@@ -5,8 +5,8 @@
 
 /**
  * Alternate of ResourceLoaderSiteModule for mobile web.
- * Mobile.[css|js] is a temporary drop-in replacement for Common.css/js, which
- * predates Minerva and is not compatible.
+ * Mobile.[css|js] is a temporary drop-in replacement for Common.css/js which 
contains JS that
+ * is usually incompatible
  */
 class MobileSiteModule extends ResourceLoaderWikiModule {
// Should not be enabled on desktop which has ResourceLoaderSiteModule 
instead
diff --git a/includes/specials/MobileSpecialPage.php 
b/includes/specials/MobileSpecialPage.php
index 641ba95..31b6a7c 100644
--- a/includes/specials/MobileSpecialPage.php
+++ b/includes/specials/MobileSpecialPage.php
@@ -99,7 +99,10 @@
$specialScriptModuleName = 'mobile.special.' . $id . '.scripts';
 
if ( $rl->isModuleRegistered( $specialStyleModuleName ) ) {
-   $out->addModuleStyles( $specialStyleModuleName );
+   $out->addModuleStyles( [
+   'mobile.special.styles',
+   $specialStyleModuleName
+   ] );
}
 
if ( $rl->isModuleRegistered( $specialScriptModuleName ) ) {
diff --git a/resources/mobile.special.uploads.styles/default.less 
b/resources/mobile.special.uploads.styles/default.less
index 32ebf50..072dbe8 100644
--- a/resources/mobile.special.uploads.styles/default.less
+++ b/resources/mobile.special.uploads.styles/default.less
@@ -1,4 +1,3 @@
-// These skins adjust the Special:Uploads page for non-Minerva skins
 .image-list {
li {
text-align: left;
diff --git a/tests/browser/LocalSettings.php b/tests/browser/LocalSettings.php
index 6826133..30de340 100644
--- a/tests/browser/LocalSettings.php
+++ b/tests/browser/LocalSettings.php
@@ -21,9 +21,6 @@
 
 $wgMFEnableBeta = true;
 
-// needed for testing whether the lan

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: MobileFrontend should not add Minerva modules for its specia...

2017-08-18 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372559 )

Change subject: MobileFrontend should not add Minerva modules for its special 
pages
..

MobileFrontend should not add Minerva modules for its special pages

The styles/js should apply to the special pages in all skins when
operating in mobile mode.

This improves rendering of other skins when operating in mobile mode.
e.g.
?title=Special:EditWatchlist&useskin=vector&useformat=mobile

Additional changes:
* Add an icon pack `mobile.special.user.icons` for special pages
so its not using Minerva

Change-Id: I665f6fe60939475249786fdc951149c38473fda6
---
M extension.json
M includes/MobileFrontend.hooks.php
M includes/specials/MobileSpecialPageFeed.php
M includes/specials/SpecialMobileContributions.php
M includes/specials/SpecialMobileDiff.php
M includes/specials/SpecialMobileEditWatchlist.php
M includes/specials/SpecialMobileWatchlist.php
M mobile.less/mobile.variables.less
A resources/mobile.special.styles/common.less
A resources/mobile.special.styles/forms.less
A resources/mobile.special.user.icons/userAnonymous.svg
A resources/mobile.special.user.icons/userNormal.svg
A resources/mobile.special.watchlist.scripts/watchlist.js
A resources/mobile.special.watchlist.styles/specialWatchlist.less
14 files changed, 212 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/59/372559/1

diff --git a/extension.json b/extension.json
index 585f996..f3f8325 100644
--- a/extension.json
+++ b/extension.json
@@ -974,6 +974,40 @@
],
"class": "MobileSiteModule"
},
+   "mobile.special.styles": {
+   "targets": "mobile",
+   "position": "top",
+   "styles": [
+   "resources/mobile.special.styles/common.less",
+   "resources/mobile.special.styles/forms.less"
+   ]
+   },
+   "mobile.special.watchlist.styles": {
+   "targets": "mobile",
+   "position": "top",
+   "styles": [
+   
"resources/mobile.special.watchlist.styles/specialWatchlist.less"
+   ]
+   },
+   "mobile.special.user.icons": {
+   "class": "ResourceLoaderImageModule",
+   "selector": ".mw-ui-icon-{name}:before",
+   "position": "bottom",
+   "images": {
+   "user": 
"resources/mobile.special.user.icons/userNormal.svg",
+   "anonymous": 
"resources/mobile.special.user.icons/userAnonymous.svg"
+   }
+   },
+   "mobile.special.watchlist.scripts": {
+   "targets": "mobile",
+   "dependencies": [
+   "mobile.startup",
+   "mobile.watchlist"
+   ],
+   "scripts": [
+   
"resources/mobile.special.watchlist.scripts/watchlist.js"
+   ]
+   },
"mobile.special.mobilecite.styles": {
"targets": "mobile",
"styles": [
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 787a00d..7f37a8c 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -580,8 +580,11 @@
$isMobileView = 
MobileContext::singleton()->shouldDisplayMobileView();
$name = $special->getName();
 
-   if ( $isMobileView && ( $name === 'Userlogin' || $name === 
'CreateAccount' ) ) {
-   $special->getOutput()->addModules( 
'mobile.special.userlogin.scripts' );
+   if ( $isMobileView ) {
+   $special->getOutput()->addModuleStyles( [ 
'mobile.special.styles', 'mobile.messageBox.styles' ] );
+   if ( $name === 'Userlogin' || $name === 'CreateAccount' 
) {
+   $special->getOutput()->addModules( 
'mobile.special.userlogin.scripts' );
+   }
}
 
return true;
@@ -784,6 +787,10 @@
// We load MediaWiki:Mobile.css/js instead
$out->addModules( [ 'mobile.site' ] );
 
+   if ( $out->getRequest()->getText( 'oldid' ) ) {
+   $styles[] = 'mobile.messageBox.styles';
+   }
+
// Allow modifications in mobile only mode
Hooks::run( 'BeforePageDisplayMobile', [ &$out, &$sk ] 
);
 
diff --git a/includ

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add mobile and desktop thresholds

2017-08-18 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372551 )

Change subject: Add mobile and desktop thresholds
..

Add mobile and desktop thresholds

This will allow us to centralise these values similar to tablet
device width and allow us to remove a Minerva/MobileFrontend
dependency

Bug: T171365
Change-Id: Ib9f843147db4473ce5590741e0fb490384b0007e
---
M includes/DefaultSettings.php
1 file changed, 14 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/372551/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 4e162f6..bf8fcdc 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -3826,12 +3826,25 @@
  */
 $wgResourceLoaderLESSVars = [
/**
-* Minimum available screen width at which a device can be considered a 
tablet/desktop
+* Minimum available screen width at which a device can be considered a 
tablet
 * The number is currently based on the device width of a Samsung 
Galaxy S5 mini and is low
 * enough to cover iPad (768px). Number is prone to change with new 
information.
 * @since 1.27
 */
'deviceWidthTablet' => '720px',
+   /**
+* Minimum available screen width at which a device can be considered a 
desktop
+* Number is prone to change with new information.
+* @since 1.28
+*/
+   'deviceWidthDesktop' => '1000px',
+   /**
+* Minimum available screen width at which a device can be considered a 
mobile device
+* Many older feature phones have screens smaller than this value.
+* Number is prone to change with new information.
+* @since 1.28
+*/
+   'deviceWidthMobile' => '320px',
 ];
 
 /**

-- 
To view, visit https://gerrit.wikimedia.org/r/372551
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9f843147db4473ce5590741e0fb490384b0007e
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]: Import the right files

2017-08-18 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372539 )

Change subject: Import the right files
..

Import the right files

These modules are throwing Less compiler errors.
The variables being seeked are in mobile.variables

Change-Id: Iadf1acc14278e6158b3285034a0ea5140da2d45d
---
M skinStyles/mobile.editor.ve/minerva.less
M skinStyles/mobile.notifications.overlay/minerva.less
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/39/372539/1

diff --git a/skinStyles/mobile.editor.ve/minerva.less 
b/skinStyles/mobile.editor.ve/minerva.less
index 7818562..e6163ec 100644
--- a/skinStyles/mobile.editor.ve/minerva.less
+++ b/skinStyles/mobile.editor.ve/minerva.less
@@ -1,5 +1,5 @@
 @import 'mediawiki.mixins.less';
-@import 'minerva.variables';
+@import 'mobile.variables';
 
 .editor-overlay-ve {
.content {
diff --git a/skinStyles/mobile.notifications.overlay/minerva.less 
b/skinStyles/mobile.notifications.overlay/minerva.less
index 2f6903c..589177f 100644
--- a/skinStyles/mobile.notifications.overlay/minerva.less
+++ b/skinStyles/mobile.notifications.overlay/minerva.less
@@ -1,4 +1,4 @@
-@import 'minerva.variables';
+@import 'mobile.variables';
 
 .notifications-overlay .overlay-content {
top: @headerHeight;

-- 
To view, visit https://gerrit.wikimedia.org/r/372539
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iadf1acc14278e6158b3285034a0ea5140da2d45d
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: Do not use numbered grays

2017-08-18 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372538 )

Change subject: Hygiene: Do not use numbered grays
..

Hygiene: Do not use numbered grays

We have names for a reason.
We should limit our use of the more ambiguious grays

Change-Id: I2c9d21ab0ec0bbbf02fa8767936401dbe9ec4177
---
M resources/mobile.categories.overlays/categories.less
M resources/mobile.editor.common/editor.less
M resources/mobile.gallery/gallery.less
M resources/mobile.issues/issues.less
M resources/mobile.languages.structured/LanguageOverlay.less
M resources/mobile.messageBox.styles/messageBox.less
M resources/mobile.notifications.filter.overlay/NotificationsFilterOverlay.less
M resources/mobile.notifications.overlay/NotificationsOverlay.less
M resources/mobile.pagelist.styles/pagelist.less
M resources/mobile.pagesummary.styles/pagesummary.less
M resources/mobile.references/references.less
M resources/mobile.search/SearchOverlay.less
M resources/mobile.special.mobilediff.styles/mobilediff.less
M resources/mobile.special.pagefeed.styles/pagefeed.less
M resources/mobile.startup/Overlay.less
M skinStyles/mobile.editor.ve/minerva.less
16 files changed, 34 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/38/372538/1

diff --git a/resources/mobile.categories.overlays/categories.less 
b/resources/mobile.categories.overlays/categories.less
index 247e55f..ada7108 100644
--- a/resources/mobile.categories.overlays/categories.less
+++ b/resources/mobile.categories.overlays/categories.less
@@ -15,14 +15,14 @@
margin: 0 0 0 -1px;
border-width: 0 0 1px 1px;
border-style: solid;
-   border-color: @colorGray12;
+   border-color: @grayLight;
padding: 5px 0 0;
line-height: 1.5;
text-align: center;
 
a {
display: block;
-   color: @colorGray5;
+   color: @grayMediumDark;
margin: 0 1px 0 0;
border-bottom: 3px solid transparent;
}
diff --git a/resources/mobile.editor.common/editor.less 
b/resources/mobile.editor.common/editor.less
index 264ac8d..451a28f 100644
--- a/resources/mobile.editor.common/editor.less
+++ b/resources/mobile.editor.common/editor.less
@@ -25,7 +25,7 @@
.message {
margin: 0 0 0.7em;
padding: 0 0 0.3em;
-   border-bottom: 1px solid @colorGray12;
+   border-bottom: 1px solid @grayLight;
color: @infoColor;
 
p {
@@ -37,7 +37,7 @@
}
 
.editor-switcher {
-   border-left: 1px solid @colorGray12;
+   border-left: 1px solid @grayLight;
 
.oo-ui-toolbar-bar {
font-size: unit( 0.8 * @targetIconSize / @baseIconSize, 
em );
diff --git a/resources/mobile.gallery/gallery.less 
b/resources/mobile.gallery/gallery.less
index a8fe481..6bf7453 100644
--- a/resources/mobile.gallery/gallery.less
+++ b/resources/mobile.gallery/gallery.less
@@ -9,7 +9,7 @@
padding-bottom: 20px;
 
p { // description
-   color: @colorGray5;
+   color: @grayMediumDark;
line-height: 1.2;
}
}
diff --git a/resources/mobile.issues/issues.less 
b/resources/mobile.issues/issues.less
index aa62e58..f0c8726 100644
--- a/resources/mobile.issues/issues.less
+++ b/resources/mobile.issues/issues.less
@@ -8,7 +8,7 @@
margin: 0;
padding: 0;
font-size: 0.8em;
-   color: @colorGray7;
+   color: @grayMedium;
 }
 
 // overlay styles
diff --git a/resources/mobile.languages.structured/LanguageOverlay.less 
b/resources/mobile.languages.structured/LanguageOverlay.less
index 506b2ed..c9af9ac 100644
--- a/resources/mobile.languages.structured/LanguageOverlay.less
+++ b/resources/mobile.languages.structured/LanguageOverlay.less
@@ -1,10 +1,10 @@
 @import 'mobile.variables';
 
 .language-overlay {
-   background-color: @colorGray14;
+   background-color: @grayLightest;
 
.overlay-content {
-   background-color: @colorGray14;
+   background-color: @grayLightest;
}
 
.panel {
@@ -41,7 +41,7 @@
}
 
a {
-   border-top: solid 1px @colorGray14;
+   border-top: solid 1px @grayLightest;
cursor: pointer;
display: block;
padding: 0.75em 1em;
@@ -61,7 +61,7 @@
}
 
.title {
-   color: @colorGray7;
+   

[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Standardise on MinervaNeue skin name

2017-08-17 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372472 )

Change subject: Standardise on MinervaNeue skin name
..

Standardise on MinervaNeue skin name

Bug: T171644
Change-Id: Ieffb6334168047dcf05dcb60281865ab47056dc0
---
M includes/skins/SkinMinerva.php
M skin.json
2 files changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/72/372472/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index e6d66f4..3f14562 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -21,7 +21,7 @@
const OPTIONS_MOBILE_BETA = 'beta';
 
/** @var string $skinname Name of this skin */
-   public $skinname = 'minerva';
+   public $skinname = 'minervaneue';
/** @var string $template Name of this used template */
public $template = 'MinervaTemplate';
/** @var bool $useHeadElement Specify whether show head elements */
diff --git a/skin.json b/skin.json
index 54548c2..e503645 100644
--- a/skin.json
+++ b/skin.json
@@ -35,7 +35,7 @@
"remoteSkinPath": "MinervaNeue"
},
"ResourceModuleSkinStyles": {
-   "minerva": {
+   "minervaneue": {
"mediawiki.skinning.content.parsoid": [],
"mediawiki.hlist": [
"skinStyles/mediawiki.hlist/minerva.less"
@@ -514,8 +514,7 @@
}
},
"ValidSkinNames": {
-   "minervaneue": "MinervaNeue",
-   "minerva": "Minerva"
+   "minervaneue": "MinervaNeue"
},
"author": [],
"config": {

-- 
To view, visit https://gerrit.wikimedia.org/r/372472
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieffb6334168047dcf05dcb60281865ab47056dc0
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[master]: Check if SpecialMobileWatchlist exist

2017-08-17 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372470 )

Change subject: Check if SpecialMobileWatchlist exist
..

Check if SpecialMobileWatchlist exist

If MobileFrontend doesn't exist this will throw an error

Bug: T171241
Change-Id: Ie61cfa61b78a53598ac59aea15c8a4e6a261238d
---
M includes/skins/SkinMinerva.php
1 file changed, 10 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/70/372470/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 2435f1d..94fe7bc 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -470,13 +470,16 @@
$watchlistQuery = [];
$user = $this->getUser();
if ( $user ) {
-   $view = $user->getOption( 
SpecialMobileWatchlist::VIEW_OPTION_NAME, false );
-   $filter = $user->getOption( 
SpecialMobileWatchlist::FILTER_OPTION_NAME, false );
-   if ( $view ) {
-   $watchlistQuery['watchlistview'] = $view;
-   }
-   if ( $filter && $view === 'feed' ) {
-   $watchlistQuery['filter'] = $filter;
+   // Avoid fatal when MobileFrontend not available 
(T171241)
+   if ( class_exists( 'SpecialMobileWatchlist' ) ) {
+   $view = $user->getOption( 
SpecialMobileWatchlist::VIEW_OPTION_NAME, false );
+   $filter = $user->getOption( 
SpecialMobileWatchlist::FILTER_OPTION_NAME, false );
+   if ( $view ) {
+   $watchlistQuery['watchlistview'] = 
$view;
+   }
+   if ( $filter && $view === 'feed' ) {
+   $watchlistQuery['filter'] = $filter;
+   }
}
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/372470
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie61cfa61b78a53598ac59aea15c8a4e6a261238d
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[master]: Give the Special:preferences page on desktop some love

2017-08-17 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372461 )

Change subject: Give the Special:preferences page on desktop some love
..

Give the Special:preferences page on desktop some love

The preferences page is accessible if a user opts into the Minerva
desktop experience. It's not a great first experience.

These changes make the page usable.

* Provide styling for tabs
* Provide padding/borders for unstyled button elements

Change-Id: I107ed3c685910a5e9502b25d22ef7cc489ce3c34
---
M skin.json
A skinStyles/mediawiki.special.preferences.styles/styles.less
2 files changed, 52 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/61/372461/1

diff --git a/skin.json b/skin.json
index 4e54d71..54548c2 100644
--- a/skin.json
+++ b/skin.json
@@ -59,6 +59,9 @@
"mediawiki.action.edit.styles": [

"skinStyles/mediawiki.action.edit.styles/minerva.less"
],
+   "mediawiki.special.preferences.styles": [
+   
"skinStyles/mediawiki.special.preferences.styles/styles.less"
+   ],
"mobile.pointerOverlay": [
"skinStyles/mobile.pointerOverlay/minerva.less"
],
diff --git a/skinStyles/mediawiki.special.preferences.styles/styles.less 
b/skinStyles/mediawiki.special.preferences.styles/styles.less
new file mode 100644
index 000..882acda
--- /dev/null
+++ b/skinStyles/mediawiki.special.preferences.styles/styles.less
@@ -0,0 +1,49 @@
+@import 'minerva.variables';
+
+// FIXME: All this code can be removed when T117781 is resolved.
+#preftoc {
+   text-align: center;
+
+   li {
+   display: inline-block;
+   color: @colorGray2;
+   border: 1px solid @colorFieldBorder;
+   border-radius: 0;
+
+   &:first-child {
+   border-top-left-radius: 2px;
+   border-bottom-left-radius: 2px;
+   }
+
+   &:last-child {
+   border-top-right-radius: 2px;
+   border-bottom-right-radius: 2px;
+   }
+
+   &:not( :first-child ) {
+   border-left: 0;
+   }
+
+   &.selected {
+   background-color: @colorProgressiveActive;
+   border-color: @colorProgressiveActive;
+   color: #fff;
+   box-shadow: none;
+   }
+
+   a {
+   padding: 0.5em 1em;
+   color: inherit;
+   display: block;
+   }
+   }
+}
+
+.mw-htmlform-submit-buttons,
+.mw-input {
+   select,
+   input {
+   border: solid 1px @colorFieldBorder;
+   padding: 8px;
+   }
+}
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/372461
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I107ed3c685910a5e9502b25d22ef7cc489ce3c34
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]: Hygiene: Correct documentation

2017-08-17 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372420 )

Change subject: Hygiene: Correct documentation
..

Hygiene: Correct documentation

Result of code review session on 17th August 2017.
We noticed the documentation for the talk overlay was incorrect.

Change-Id: Ib737eeb24a452599616c8d2377abb24d6fb70eb8
---
M resources/mobile.talk.overlays/TalkOverlay.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/20/372420/1

diff --git a/resources/mobile.talk.overlays/TalkOverlay.js 
b/resources/mobile.talk.overlays/TalkOverlay.js
index f0c4cdb..c09641e 100644
--- a/resources/mobile.talk.overlays/TalkOverlay.js
+++ b/resources/mobile.talk.overlays/TalkOverlay.js
@@ -5,7 +5,7 @@
user = M.require( 'mobile.startup/user' );
/**
 * Overlay for talk page
-* @extends Overlay
+* @extends TalkOverlayBase
 * @class TalkOverlay
 * @uses Page
 * @uses TalkSectionOverlay

-- 
To view, visit https://gerrit.wikimedia.org/r/372420
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib737eeb24a452599616c8d2377abb24d6fb70eb8
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/core[master]: MediawikiUI: Introduce mw-ui-icon-large

2017-08-17 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372403 )

Change subject: MediawikiUI: Introduce mw-ui-icon-large
..

MediawikiUI: Introduce mw-ui-icon-large

This will allow MobileFrontend and Minerva to share rules for icons

See Ib29736dc80ac2f84747e920c5b5c30918df12978

Bug: T143264
Change-Id: I456714086d2548b2e10cceb2a05f7a0fadf94a3b
---
M resources/src/mediawiki.ui/components/icons.less
1 file changed, 15 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/372403/1

diff --git a/resources/src/mediawiki.ui/components/icons.less 
b/resources/src/mediawiki.ui/components/icons.less
index f169d1b..7faac2e 100644
--- a/resources/src/mediawiki.ui/components/icons.less
+++ b/resources/src/mediawiki.ui/components/icons.less
@@ -39,7 +39,9 @@
//
// Styleguide 6.1.1.
&.mw-ui-icon-element {
-   @width: @iconSize + ( 2 * @iconGutterWidth );
+   @iconMargins: 2 * @iconGutterWidth;
+   @width: @iconSize + @iconMargins;
+   @largeIcon: ( @iconSize * 1.75) + @iconMargins;
 
text-indent: -999px;
overflow: hidden;
@@ -53,6 +55,18 @@
position: absolute;
margin: 0 @iconGutterWidth;
}
+
+   &.mw-ui-icon-large {
+   width: @largeIcon;
+   min-width: @largeIcon;
+   max-width: @largeIcon;
+   line-height: @largeIcon;
+   min-height: @largeIcon;
+
+   &:before {
+   min-height: @largeIcon;
+   }
+   }
}
 
&.mw-ui-icon-before:before,

-- 
To view, visit https://gerrit.wikimedia.org/r/372403
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I456714086d2548b2e10cceb2a05f7a0fadf94a3b
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]: User page should use mw-ui-icon-large

2017-08-17 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372402 )

Change subject: User page should use mw-ui-icon-large
..

User page should use mw-ui-icon-large

Bug: T143264
Depends-On: I456714086d2548b2e10cceb2a05f7a0fadf94a3b
Change-Id: Ib29736dc80ac2f84747e920c5b5c30918df12978
---
M includes/user_page_cta.mustache
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/02/372402/1

diff --git a/includes/user_page_cta.mustache b/includes/user_page_cta.mustache
index 4de6c4d..9c5d39b 100644
--- a/includes/user_page_cta.mustache
+++ b/includes/user_page_cta.mustache
@@ -1,5 +1,5 @@
 
-   
+   
{{ctaHeading}}
{{ctaDescription}}


-- 
To view, visit https://gerrit.wikimedia.org/r/372402
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib29736dc80ac2f84747e920c5b5c30918df12978
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]: Do not assume MobileFrontend special pages exist

2017-08-16 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372183 )

Change subject: Do not assume MobileFrontend special pages exist
..

Do not assume MobileFrontend special pages exist

If they don't exist attempts to use them will throw errors.
This will only happen if MobileFrontend is not installed

Change-Id: Iee674011bbd59d79914a144d1738b912eceea6b1
---
M includes/skins/SkinMinerva.php
1 file changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/83/372183/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 558b560..850d14e 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -629,6 +629,7 @@
 
// Nearby link (if supported)
if (
+   SpecialPageFactory::exists( 'Nearby' ) &&
$config->get( 'MFNearby' ) &&
( $config->get( 'MFNearbyEndpoint' ) || class_exists( 
'GeoData\GeoData' ) )
) {
@@ -738,11 +739,18 @@
$this->getLanguage()->userTime( $timestamp, 
$user )
)->parse();
}
+
+   if ( SpecialPageFactory::exists( 'History' ) ) {
+   $historyUrl = SpecialPage::getTitleFor( 'History', 
$title )->getLocalURL();
+   } else {
+   $historyUrl = $title->getLocalURL( [ 'action' => 
'history' ] );
+   }
+
$edit = $mp->getLatestEdit();
$link = [
// Use $edit['timestamp'] (Unix format) instead of 
$timestamp (MW format)
'data-timestamp' => $isMainPage ? '' : 
$edit['timestamp'],
-   'href' => SpecialPage::getTitleFor( 'History', $title 
)->getLocalURL(),
+   'href' => $historyUrl,
'text' => $lastModified,
'data-user-name' => $edit['name'],
'data-user-gender' => $edit['gender'],
@@ -864,7 +872,9 @@
 */
protected function prepareMenuButton( BaseTemplate $tpl ) {
// menu button
-   $url = SpecialPage::getTitleFor( 'MobileMenu' )->getLocalUrl();
+   $url = SpecialPageFactory::exists( 'MobileMenu' ) ?
+   SpecialPage::getTitleFor( 'MobileMenu' )->getLocalUrl() 
: '#';
+
$tpl->set( 'menuButton',
Html::element( 'a', [
'title' => $this->msg( 
'mobile-frontend-main-menu-button-tooltip' ),

-- 
To view, visit https://gerrit.wikimedia.org/r/372183
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee674011bbd59d79914a144d1738b912eceea6b1
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[master]: WIP: Break the MobileFrontend dependency on Minerva

2017-08-16 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372186 )

Change subject: WIP: Break the MobileFrontend dependency on Minerva
..

WIP: Break the MobileFrontend dependency on Minerva

Remaining issues:
* Unknown dependency errors are thrown due to the missing
JS libraries e.g. mobile.watchstar
thus JS based UI components are unusable e.g. search autocomplete,
and edit button
* Language button navigates to a missing special page without
MobileFrontend (see T104660)

Bug: T171000
Change-Id: I89e2e15faabab73b0cba91afc2f2c5e785edef29
---
A includes/MFResourceLoaderParsedMessageModule.php
A includes/MobileUI.php
M includes/skins/SkinMinerva.php
M skin.json
4 files changed, 260 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/86/372186/1

diff --git a/includes/MFResourceLoaderParsedMessageModule.php 
b/includes/MFResourceLoaderParsedMessageModule.php
new file mode 100644
index 000..7e3bcbe
--- /dev/null
+++ b/includes/MFResourceLoaderParsedMessageModule.php
@@ -0,0 +1,106 @@
+ $option ) {
+   switch ( $member ) {
+   case 'messages':
+   $this->processMessages( $option );
+   $this->hasHackedScriptMode = true;
+   // Prevent them being reinitialised 
when parent construct is called.
+   unset( $options[$member] );
+   break;
+   }
+   }
+
+   parent::__construct( $options );
+   }
+
+   /**
+* Process messages which have been marked as needing parsing
+*
+* @param ResourceLoaderContext $context
+* @return string JavaScript code
+*/
+   public function addParsedMessages( ResourceLoaderContext $context ) {
+   if ( !$this->parsedMessages ) {
+   return '';
+   }
+   $messages = [];
+   foreach ( $this->parsedMessages as $key ) {
+   $messages[ $key ] = $context->msg( $key )->parse();
+   }
+   return Xml::encodeJsCall( 'mw.messages.set', [ $messages ] );
+   }
+
+   /**
+* Separate messages which have been marked as needing parsing from 
standard messages
+* @param array $messages Array of messages to process
+*/
+   private function processMessages( $messages ) {
+   foreach ( $messages as $key => $value ) {
+   if ( is_array( $value ) ) {
+   foreach ( $value as $directive ) {
+   if ( $directive == 'parse' ) {
+   $this->parsedMessages[] = $key;
+   }
+   }
+   } else {
+   $this->messages[] = $value;
+   }
+   }
+   }
+
+   /**
+* Gets all scripts for a given context concatenated together including 
processed messages
+*
+* @param ResourceLoaderContext $context Context in which to generate 
script
+* @return string JavaScript code for $context
+*/
+   public function getScript( ResourceLoaderContext $context ) {
+   $script = parent::getScript( $context );
+   return $this->addParsedMessages( $context ) . $script;
+   }
+
+   /**
+* Get the URL or URLs to load for this module's JS in debug mode.
+* @param ResourceLoaderContext $context
+* @return array list of urls
+* @see ResourceLoaderModule::getScriptURLsForDebug
+*/
+   public function getScriptURLsForDebug( ResourceLoaderContext $context ) 
{
+   if ( $this->hasHackedScriptMode ) {
+   $derivative = new DerivativeResourceLoaderContext( 
$context );
+   $derivative->setDebug( true );
+   $derivative->setModules( [ $this->getName() ] );
+   // @todo FIXME: Make this templates and update
+   // makeModuleResponse so that it only outputs template 
code.
+   // When this is done you can merge with parent array and
+   // retain file names.
+   $derivative->setOnly( 'scripts' );
+   $rl = $derivative->getResourceLoader();
+   $urls = [
+   $rl->createLoaderURL( $this->getSource(), 
$derivative ),
+   ];
+   } else {
+   $urls = parent::getScriptURLsForDebug( $context );
+   }
+   return $urls;
+   }
+}
diff -

[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: i18n: Add Minerva specific message key for last modified bar

2017-08-16 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372184 )

Change subject: i18n: Add Minerva specific message key for last modified bar
..

i18n: Add Minerva specific message key for last modified bar

This is currently defined in MobileFrontend which uses it for
Special:MobileWatchlist.

We shouldn't use two messages for 2 purposes so let's give it
its own dedicated message.

Change-Id: Id5df6aad20815b88b8bd2685514e7eb3237a5b3b
---
M i18n/en.json
M i18n/qqq.json
M includes/skins/SkinMinerva.php
3 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/84/372184/1

diff --git a/i18n/en.json b/i18n/en.json
index f7d2b38..cf941eb 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -3,6 +3,7 @@
"authors": []
},
"skinname-minervaneue": "MinervaNeue",
+   "minerva-last-modified-date": "Last edited on $1, at $2",
"minerva-talk-add-topic": "Add discussion",
"mobile-frontend-console-recruit": "\\o/ Hey! This is open source 
software and we need volunteers to help us build this thing, make it better and 
fix any bugs that you might be seeing in this JavaScript console!\n\nYou can 
find our backlog @ https://phabricator.wikimedia.org/project/profile/67/";,
"mobile-frontend-cookies-required": "Cookies are required to switch 
view modes. Please enable them and try again.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 9a23537..daf5fe1 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -12,6 +12,7 @@
]
},
"skinname-minervaneue": "The skin name for MinervaNeue.",
+   "minerva-last-modified-date": "Text that displays the date the page was 
last modified. Parameters:\n* $1 - date\n* $2 - 
time\n{{Related|Mobile-frontend-last-modified}}",
"minerva-talk-add-topic": "Label for button which shows at bottom of 
talk pages in mobile view prompting addition of topic",
"mobile-frontend-console-recruit": "Message that is displayed in the 
JavaScript console aimed at developers in an attempt to recruit volunteers. The 
\\o/ emoticon is a man with his arms in the air with the purpose of drawing 
attention to the message. If this doesn't translate into the destination 
language feel free to omit it or use something more applicable.",
"mobile-frontend-cookies-required": "Error message shown when user 
attempts to switch site modes and cookies are not enabled.",
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 850d14e..e6d66f4 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -734,7 +734,7 @@
$lastModified = $this->msg( 'mobile-frontend-history' 
)->plain();
} else {
$lastModified = $this->msg(
-   'mobile-frontend-last-modified-date',
+   'minerva-last-modified-date',
$this->getLanguage()->userDate( $timestamp, 
$user ),
$this->getLanguage()->userTime( $timestamp, 
$user )
)->parse();

-- 
To view, visit https://gerrit.wikimedia.org/r/372184
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5df6aad20815b88b8bd2685514e7eb3237a5b3b
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[master]: WIP: Port over minimum required LESS variables

2017-08-16 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372185 )

Change subject: WIP: Port over minimum required LESS variables
..

WIP: Port over minimum required LESS variables

Change-Id: I05430963cc2fb66b50c063bc8e95621abcbbbea1
---
M minerva.less/minerva.mixins.less
M minerva.less/minerva.variables.less
2 files changed, 17 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/85/372185/1

diff --git a/minerva.less/minerva.mixins.less b/minerva.less/minerva.mixins.less
index fd123ed..aae771e 100644
--- a/minerva.less/minerva.mixins.less
+++ b/minerva.less/minerva.mixins.less
@@ -1,4 +1,3 @@
-@import 'mobile.variables';
 @import 'mediawiki.mixins.less';
 @import 'mediawiki.mixins.animation.less';
 
diff --git a/minerva.less/minerva.variables.less 
b/minerva.less/minerva.variables.less
index 89d83e3..923eb0f 100644
--- a/minerva.less/minerva.variables.less
+++ b/minerva.less/minerva.variables.less
@@ -1,6 +1,21 @@
 @import 'mediawiki.ui/variables';
-// FIXME: Remove this dependency. Should not depend on mobile.variables
-@import 'mobile.variables.less';
+
+@z-indexBase: 0;
+@fontFamily: 'Helvetica Neue', 'Helvetica', 'Nimbus Sans L', 'Arial', 
'Liberation Sans', sans-serif;
+@tocFontSize: 0.8em;
+
+//
+@indicatorFontSize: 0.4em;
+
+
+// colors
+@grayMediumDark: @colorGray5;
+@grayMedium: @colorGray7;
+@grayLight: @colorGray12;
+@grayLightest: @colorGray14;
+
+@wgMFDeviceWidthMobileSmall: 320px;
+@wgMFDeviceWidthDesktop: 1000px;
 
 @skinContentBgColor: #fff;
 

-- 
To view, visit https://gerrit.wikimedia.org/r/372185
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05430963cc2fb66b50c063bc8e95621abcbbbea1
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...Popups[master]: Return promises from QUnit test

2017-08-16 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372173 )

Change subject: Return promises from QUnit test
..

Return promises from QUnit test

Simplify all our tests to return to promises
Use catch rather than fail when testing error cases.

Bug: T170812
Change-Id: I37c4e3f86343052c946d8586f8ff840a81f631f8
---
M tests/node-qunit/actions.test.js
M tests/node-qunit/gateway/mediawiki.test.js
M tests/node-qunit/gateway/rest.test.js
M tests/node-qunit/integration.test.js
M tests/node-qunit/ui/renderer.test.js
M tests/node-qunit/wait.test.js
6 files changed, 47 insertions(+), 90 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/73/372173/1

diff --git a/tests/node-qunit/actions.test.js b/tests/node-qunit/actions.test.js
index 7ce116e..c52c0cc 100644
--- a/tests/node-qunit/actions.test.js
+++ b/tests/node-qunit/actions.test.js
@@ -114,7 +114,7 @@
 } );
 
 QUnit.test( '#linkDwell', function ( assert ) {
-   var done = assert.async(),
+   var p,
event = {},
dispatch = this.sandbox.spy();
 
@@ -150,22 +150,21 @@
 
// ---
 
-   this.waitPromises[ 0 ].then( function () {
+   p = this.waitPromises[ 0 ].then( function () {
assert.strictEqual(
dispatch.callCount,
2,
'The fetch action is dispatched after FETCH_COMPLETE 
milliseconds.'
);
-
-   done();
} );
 
// After FETCH_START_DELAY milliseconds...
this.waitDeferreds[ 0 ].resolve();
+   return p;
 } );
 
 QUnit.test( '#linkDwell doesn\'t continue when previews are disabled', 
function ( assert ) {
-   var done = assert.async(),
+   var p,
event = {},
dispatch = this.sandbox.spy();
 
@@ -183,18 +182,17 @@
 
assert.strictEqual( this.wait.callCount, 1 );
 
-   this.waitPromises[ 0 ].then( function () {
+   p = this.waitPromises[ 0 ].then( function () {
assert.strictEqual( dispatch.callCount, 1 );
-
-   done();
} );
 
// After FETCH_START_DELAY milliseconds...
this.waitDeferreds[ 0 ].resolve();
+   return p;
 } );
 
 QUnit.test( '#linkDwell doesn\'t continue if the token has changed', function 
( assert ) {
-   var done = assert.async(),
+   var p,
event = {},
dispatch = this.sandbox.spy();
 
@@ -222,18 +220,17 @@
activeToken: 'banana'
};
 
-   this.waitPromises[ 0 ].then( function () {
+   p = this.waitPromises[ 0 ].then( function () {
assert.strictEqual( dispatch.callCount, 1 );
-
-   done();
} );
 
// After FETCH_START_DELAY milliseconds...
this.waitDeferreds[ 0 ].resolve();
+   return p;
 } );
 
 QUnit.test( '#linkDwell dispatches the fetch action', function ( assert ) {
-   var done = assert.async(),
+   var p,
event = {},
dispatch = this.sandbox.spy();
 
@@ -247,14 +244,13 @@
this.getState
);
 
-   this.waitPromises[ 0 ].then( function () {
+   p = this.waitPromises[ 0 ].then( function () {
assert.strictEqual( dispatch.callCount, 2 );
-
-   done();
} );
 
// After FETCH_START_DELAY milliseconds...
this.waitDeferreds[ 0 ].resolve();
+   return p;
 } );
 
 QUnit.module( 'ext.popups/actions#fetch', {
@@ -308,15 +304,14 @@
 } );
 
 QUnit.test( 'it should dispatch the FETCH_END action when the API request 
ends', function ( assert ) {
-   var that = this,
-   done = assert.async();
+   var that = this;
 
this.fetch();
 
this.now += 115;
this.gatewayDeferred.resolve( {} );
 
-   this.gatewayPromise.then( function () {
+   return this.gatewayPromise.then( function () {
assert.deepEqual(
that.dispatch.getCall( 1 ).args[ 0 ],
{
@@ -325,8 +320,6 @@
timestamp: 115
}
);
-
-   done();
} );
 } );
 
@@ -335,8 +328,7 @@
whenSpy,
args,
result = {},
-   that = this,
-   done = assert.async();
+   that = this;
 
whenSpy = this.sandbox.stub( $, 'when' )
.returns( whenDeferred.promise() );
@@ -362,7 +354,7 @@
this.now += 500;
whenDeferred.resolve( result );
 
-   whenDeferred.then( function () {
+   return whenDeferred.then( function () {
 
// Ensure the following assertions are made after all callbacks 
have been
// executed. Use setTimeout( _, 0 ) since it's not critical 
that these
@@ -379,8 +371,6 @@

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Use proto current not proto relative

2017-08-16 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372167 )

Change subject: Use proto current not proto relative
..

Use proto current not proto relative

Per the usage instructions what we actually want to use is the
protocol of the current request.

Running getimagesizefromstring on
a // or http:// url will not resolve correctly due to redirects.
(I checked this by manually testing where
$appleTouchIconUrl = 
'http://en.m.wikipedia.org/static/apple-touch/wikipedia.png';)

Bug: T153811
Change-Id: I88ea475afe0b991c1774defda6e7374773b1f1f6
---
M includes/api/ApiWebappManifest.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/67/372167/1

diff --git a/includes/api/ApiWebappManifest.php 
b/includes/api/ApiWebappManifest.php
index d70ccc7..a038051 100644
--- a/includes/api/ApiWebappManifest.php
+++ b/includes/api/ApiWebappManifest.php
@@ -27,7 +27,7 @@
 
$appleTouchIcon = $config->get( 'AppleTouchIcon' );
if ( $appleTouchIcon !== false ) {
-   $appleTouchIconUrl = wfExpandUrl( $appleTouchIcon, 
PROTO_RELATIVE );
+   $appleTouchIconUrl = wfExpandUrl( $appleTouchIcon, 
PROTO_CURRENT );
$request = MWHttpRequest::factory( $appleTouchIconUrl );
$request->execute();
$appleTouchIconContent = $request->getContent();

-- 
To view, visit https://gerrit.wikimedia.org/r/372167
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I88ea475afe0b991c1774defda6e7374773b1f1f6
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]: Roll page previews out to all wikis except en and de wiki

2017-08-16 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372160 )

Change subject: Roll page previews out to all wikis except en and de wiki
..

Roll page previews out to all wikis except en and de wiki

Bug: T162672
Change-Id: I47dacfd125322564bc7fa1cfe4b879e8606987a3
---
M dblists/pp_stage1.dblist
1 file changed, 152 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/60/372160/1

diff --git a/dblists/pp_stage1.dblist b/dblists/pp_stage1.dblist
index 5f49fa9..bee10a2 100644
--- a/dblists/pp_stage1.dblist
+++ b/dblists/pp_stage1.dblist
@@ -1,6 +1,3 @@
-# Generated with:
-#
-#   ./multiversion/bin/expanddblist dblists/pp_stage1_raw.dblist | tail -n 302 
| head -n 50 > dblists/pp_stage1.dblist
 aawiki
 abwiki
 acewiki
@@ -149,3 +146,155 @@
 lbewiki
 lbwiki
 lezwiki
+lgwiki
+lijwiki
+liwiki
+lmowiki
+lnwiki
+lowiki
+lrcwiki
+ltgwiki
+ltwiki
+lvwiki
+maiwiki
+map_bmswiki
+mdfwiki
+mgwiki
+mhrwiki
+mhwiki
+minwiki
+miwiki
+mkwiki
+mlwiki
+mnwiki
+mowiki
+mrjwiki
+mrwiki
+mswiki
+mtwiki
+muswiki
+mwlwiki
+myvwiki
+mywiki
+mznwiki
+nahwiki
+napwiki
+nawiki
+nds_nlwiki
+ndswiki
+newiki
+newwiki
+ngwiki
+nlwiki
+nnwiki
+novwiki
+nowiki
+nrmwiki
+nsowiki
+nvwiki
+nywiki
+ocwiki
+olowiki
+omwiki
+orwiki
+oswiki
+pagwiki
+pamwiki
+papwiki
+pawiki
+pcdwiki
+pdcwiki
+pflwiki
+pihwiki
+piwiki
+plwiki
+pmswiki
+pnbwiki
+pntwiki
+pswiki
+ptwiki
+quwiki
+rmwiki
+rmywiki
+rnwiki
+roa_rupwiki
+roa_tarawiki
+rowiki
+ruewiki
+rwwiki
+sahwiki
+sawiki
+scnwiki
+scowiki
+scwiki
+sdwiki
+sewiki
+sgwiki
+shwiki
+simplewiki
+siwiki
+skwiki
+slwiki
+smwiki
+snwiki
+sowiki
+sqwiki
+srnwiki
+srwiki
+sswiki
+stqwiki
+stwiki
+suwiki
+svwiki
+swwiki
+szlwiki
+tawiki
+tcywiki
+tenwiki
+test2wiki
+testwiki
+tetwiki
+tewiki
+tgwiki
+thwiki
+tiwiki
+tkwiki
+tlwiki
+tnwiki
+towiki
+tpiwiki
+trwiki
+tswiki
+ttwiki
+tumwiki
+twwiki
+tyvwiki
+tywiki
+udmwiki
+ugwiki
+ukwiki
+urwiki
+uzwiki
+vecwiki
+vepwiki
+vewiki
+viwiki
+vlswiki
+vowiki
+warwiki
+wawiki
+wg_enwiki
+wowiki
+wuuwiki
+xalwiki
+xhwiki
+xmfwiki
+yiwiki
+yowiki
+zawiki
+zeawiki
+zh_classicalwiki
+zh_min_nanwiki
+zh_yuewiki
+zhwiki
+zuwiki

-- 
To view, visit https://gerrit.wikimedia.org/r/372160
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47dacfd125322564bc7fa1cfe4b879e8606987a3
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...mobileapps[master]: Add tests for extractLeadIntroduction and fix edge case

2017-08-15 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372079 )

Change subject: Add tests for extractLeadIntroduction and fix edge case
..

Add tests for extractLeadIntroduction and fix edge case

Add some tests for the extractLeadIntroduction method

Previously any tables that followed a lead paragraph may have
been included in the introduction. This is not wanted. Fix.

Change-Id: Ifa3e9fb5c684ee71ab69f95305de71b21214d4dd
---
M lib/transformations/extractLeadIntroduction.js
A test/lib/transformations/extractLeadIntroduction.js
2 files changed, 55 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/79/372079/1

diff --git a/lib/transformations/extractLeadIntroduction.js 
b/lib/transformations/extractLeadIntroduction.js
index 3e4f803..e360ecf 100644
--- a/lib/transformations/extractLeadIntroduction.js
+++ b/lib/transformations/extractLeadIntroduction.js
@@ -19,6 +19,7 @@
 function extractLeadIntroduction(doc) {
 let p = '';
 const remove = [];
+const blacklist = [ 'P', 'TABLE' ];
 const nodes = doc.querySelectorAll('body > p');
 
 Array.prototype.forEach.call(nodes, (node) => {
@@ -27,8 +28,10 @@
 p = node.outerHTML;
 remove.push(node);
 nextSibling = node.nextSibling;
-// check the next element is a text node or not a P tag
-while (nextSibling && (nextSibling.nodeType === 3 || 
nextSibling.tagName !== 'P')) {
+// check the next element is a text node or not in list of 
blacklisted elements
+while (nextSibling && (nextSibling.nodeType === 3 ||
+blacklist.indexOf(nextSibling.tagName) === -1
+)) {
 // Deal with text nodes
 if (nextSibling.nodeType === 3) {
 if (!isEmpty(nextSibling)) {
diff --git a/test/lib/transformations/extractLeadIntroduction.js 
b/test/lib/transformations/extractLeadIntroduction.js
new file mode 100644
index 000..b1ea6a1
--- /dev/null
+++ b/test/lib/transformations/extractLeadIntroduction.js
@@ -0,0 +1,50 @@
+"use strict";
+
+/* eslint-disable max-len */
+const domino = require('domino');
+const assert = require('./../../utils/assert.js');
+const extractLeadIntroduction = 
require('./../../../lib/transformations/extractLeadIntroduction');
+
+describe('extractLeadIntroduction', () => {
+it('matches the spec', () => {
+const testCases = [
+// Only the first paragraph is selected
+[
+'OneTwo',
+'One'
+],
+// Text nodes and children (e.g. b tags) are included in the intro
+[
+'Colombo Airport may refer to:',
+'Colombo Airport may refer to:'
+],
+// Lists are included in the lead intro
+[
+'Colombo Airport may refer 
to:item',
+'Colombo Airport may refer 
to:item'
+],
+// Tables are not part of the lead introduction.
+[
+'Colombo Airport may refer 
to:itemText',
+'Colombo Airport may refer 
to:item'
+],
+// We take the first available P tag
+[
+'List itemThe lead paragraph is 
here.',
+'The lead paragraph is here.'
+],
+// We do not take nested P tags as being the intro.
+[
+'List itemThe lead paragraph is not 
here.',
+''
+]
+];
+
+testCases.forEach((test) => {
+const doc = 
domino.createDocument(`${test[0]}`);
+const lead = extractLeadIntroduction(doc);
+assert.equal(lead, test[1]);
+});
+});
+});
+/* eslint-enable max-len */

-- 
To view, visit https://gerrit.wikimedia.org/r/372079
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa3e9fb5c684ee71ab69f95305de71b21214d4dd
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]: Make it easier to run unit tests

2017-08-15 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372080 )

Change subject: Make it easier to run unit tests
..

Make it easier to run unit tests

Currently `npm test` runs integration tests which can be very slow
This adds an alias for unit tests to encourage their usage.

Change-Id: Ibb5a4b779de9ad8e8aafc55cf1c17646f28d9195
---
M package.json
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/80/372080/1

diff --git a/package.json b/package.json
index ace1ab6..8d9ae38 100644
--- a/package.json
+++ b/package.json
@@ -6,6 +6,7 @@
   "scripts": {
 "start": "service-runner",
 "test": "npm run -s lint && PREQ_CONNECT_TIMEOUT=15 mocha && nsp check",
+"test:unit": "PREQ_CONNECT_TIMEOUT=15 mocha test/lib",
 "lint": "eslint --cache --max-warnings 0 --ext .js --ext .json .",
 "docker-start": "service-runner docker-start",
 "docker-test": "service-runner docker-test",

-- 
To view, visit https://gerrit.wikimedia.org/r/372080
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb5a4b779de9ad8e8aafc55cf1c17646f28d9195
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[master]: User always passed in as an argument to classes

2017-08-15 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372077 )

Change subject: User always passed in as an argument to classes
..

User always passed in as an argument to classes

Depends-On: To be written

Bug: T172455
Change-Id: I34be76d6cdb5cbd6d624b92ed6575c31bbf6da52
---
M resources/mobile.betaoptin/BetaOptinPanel.js
M resources/mobile.editor.common/EditorOverlayBase.js
M resources/mobile.pagelist.scripts/WatchstarPageList.js
M resources/mobile.search/MobileWebSearchLogger.js
M resources/mobile.talk.overlays/TalkOverlay.js
M resources/mobile.talk.overlays/TalkOverlayBase.js
M resources/mobile.talk.overlays/TalkSectionOverlay.js
M resources/mobile.watchstar/Watchstar.js
M tests/qunit/mobile.pagelist.scripts/test_WatchstarPageList.js
M tests/qunit/mobile.talk.overlays/test_TalkSectionOverlay.js
M tests/qunit/mobile.watchlist/test_WatchList.js
M tests/qunit/mobile.watchstar/test_Watchstar.js
12 files changed, 41 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/77/372077/1

diff --git a/resources/mobile.betaoptin/BetaOptinPanel.js 
b/resources/mobile.betaoptin/BetaOptinPanel.js
index a1d506c..0b21e3b 100644
--- a/resources/mobile.betaoptin/BetaOptinPanel.js
+++ b/resources/mobile.betaoptin/BetaOptinPanel.js
@@ -6,8 +6,11 @@
/**
 * @class BetaOptinPanel
 * @extends Panel
+* @param {Object} options
+* @param {User} user
 */
-   function BetaOptinPanel() {
+   function BetaOptinPanel( options, user ) {
+   this.user = user;
Panel.apply( this, arguments );
}
 
@@ -19,7 +22,7 @@
template: mw.template.get( 'mobile.betaoptin', 'Panel.hogan' ),
defaults: $.extend( {}, Panel.prototype.defaults, {
postUrl: undefined,
-   editToken: mw.user.tokens.get( 'editToken' ),
+   editToken: user.tokens.get( 'editToken' ),
text: mw.msg( 'mobile-frontend-panel-betaoptin-msg' ),
buttons: [
new Button( {
diff --git a/resources/mobile.editor.common/EditorOverlayBase.js 
b/resources/mobile.editor.common/EditorOverlayBase.js
index ebb2f9f..8dbd16f 100644
--- a/resources/mobile.editor.common/EditorOverlayBase.js
+++ b/resources/mobile.editor.common/EditorOverlayBase.js
@@ -3,8 +3,7 @@
PageGateway = M.require( 'mobile.startup/PageGateway' ),
browser = M.require( 'mobile.startup/Browser' ).getSingleton(),
Icon = M.require( 'mobile.startup/Icon' ),
-   toast = M.require( 'mobile.startup/toast' ),
-   user = M.require( 'mobile.startup/user' );
+   toast = M.require( 'mobile.startup/toast' );
 
/**
 * 'Edit' button
@@ -41,19 +40,20 @@
 * @class EditorOverlayBase
 * @extends Overlay
 * @uses Icon
-* @uses user
 * @param {Object} options Configuration options
+* @param {User} user current user
 */
-   function EditorOverlayBase( options ) {
+   function EditorOverlayBase( options, user ) {
var self = this;
 
if ( options.isNewPage ) {
-   options.placeholder = mw.msg( 
'mobile-frontend-editor-placeholder-new-page', mw.user );
+   options.placeholder = mw.msg( 
'mobile-frontend-editor-placeholder-new-page', user );
}
// change the message to request a summary when not in article 
namespace
if ( mw.config.get( 'wgNamespaceNumber' ) !== 0 ) {
options.summaryRequestMsg = mw.msg( 
'mobile-frontend-editor-summary' );
}
+   this.user = user;
this.pageGateway = new PageGateway( options.api );
this.editCount = user.getEditCount();
this.isNewPage = options.isNewPage;
@@ -162,7 +162,7 @@
if ( this.isNewPage &&
// TODO: Replace with an OOUI dialog
// eslint-disable-next-line no-alert
-   !window.confirm( mw.msg( 
'mobile-frontend-editor-new-page-confirm', mw.user ) )
+   !window.confirm( mw.msg( 
'mobile-frontend-editor-new-page-confirm', this.user ) )
) {
return false;
} else {
diff --git a/resources/mobile.pagelist.scripts/WatchstarPageList.js 
b/resources/mobile.pagelist.scripts/WatchstarPageList.js
index ab41157..9666e3d 100644
--- a/resources/mobile.pagelist.scripts/WatchstarPageList.js
+++ b/resources/mobile.pagelist.scripts/WatchstarPageList.js
@@ -2,7 +2,6 @@
 
var PageList = M.require( 'mobile.startup/Pa

[MediaWiki-commits] [Gerrit] mediawiki...Popups[master]: Add phan config to Popups

2017-08-15 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372062 )

Change subject: Add phan config to Popups
..

Add phan config to Popups

Bug: T133664
Change-Id: I57de60a783cd011e93aef87c81187dbbf92cb270
---
A tests/phan/config.php
1 file changed, 307 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/62/372062/1

diff --git a/tests/phan/config.php b/tests/phan/config.php
new file mode 100644
index 000..803503b
--- /dev/null
+++ b/tests/phan/config.php
@@ -0,0 +1,307 @@
+ [
+   ],
+
+   /**
+* A list of directories that should be parsed for class and
+* method information. After excluding the directories
+* defined in exclude_analysis_directory_list, the remaining
+* files will be statically analyzed for errors.
+*
+* Thus, both first-party and third-party code being used by
+* your application should be included in this list.
+*/
+   'directory_list' => [
+   'src/',
+   'tests/phan/stubs/',
+   './../../includes',
+   './../../languages',
+   './../../maintenance',
+   './../../vendor',
+   './../../extensions/BetaFeatures/includes',
+   ],
+
+   /**
+* A file list that defines files that will be excluded
+* from parsing and analysis and will not be read at all.
+*
+* This is useful for excluding hopelessly unanalyzable
+* files that can't be removed for whatever reason.
+*/
+   'exclude_file_list' => function_exists( 'xcache_get' ) ? [] : [
+   ],
+
+   /**
+* A list of directories holding code that we want
+* to parse, but not analyze. Also works for individual
+* files.
+*/
+   "exclude_analysis_directory_list" => [
+   'tests/phan/stubs/',
+   './../../includes',
+   './../../languages',
+   './../../maintenance',
+   './../../vendor',
+   './../../extensions/BetaFeatures/includes',
+   ],
+
+   /**
+* Backwards Compatibility Checking. This is slow
+* and expensive, but you should consider running
+* it before upgrading your version of PHP to a
+* new version that has backward compatibility
+* breaks.
+*/
+   'backward_compatibility_checks' => false,
+
+   /**
+* A set of fully qualified class-names for which
+* a call to parent::__construct() is required
+*/
+   'parent_constructor_required' => [
+   ],
+
+   /**
+* Run a quick version of checks that takes less
+* time at the cost of not running as thorough
+* an analysis. You should consider setting this
+* to true only when you wish you had more issues
+* to fix in your code base.
+*
+* In quick-mode the scanner doesn't rescan a function
+* or a method's code block every time a call is seen.
+* This means that the problem here won't be detected:
+*
+* ```php
+*  false,
+
+   /**
+* By default, Phan will not analyze all node types
+* in order to save time. If this config is set to true,
+* Phan will dig deeper into the AST tree and do an
+* analysis on all nodes, possibly finding more issues.
+*
+* See \Phan\Analysis::shouldVisit for the set of skipped
+* nodes.
+*/
+   'should_visit_all_nodes' => true,
+
+   /**
+* If enabled, check all methods that override a
+* parent method to make sure its signature is
+* compatible with the parent's. This check
+* can add quite a bit of time to the analysis.
+*/
+   'analyze_signature_compatibility' => true,
+
+   // Emit all issues. They are then supressed via
+   // suppress_issue_types, rather than a minimum
+   // severity.
+   "minimum_severity" => 0,
+
+   /**
+* If true, missing properties will be created when
+* they are first seen. If false, we'll report an
+* error message if there is an attempt to write
+* to a class property that wasn't explicitly
+* defined.
+*/
+   'allow_missing_properties' => false,
+
+   /**
+* Allow null to be cast as any type and for any
+* type to be cast to null. Setting this to false
+* will cut down on false positives.
+*/
+   'null_casts_as_any_type' => true,
+
+   /**
+* If enabled, scalars (int, float, bool, string, null)
+* are treated as if they can cast to each other.
+*
+* MediaWiki is pretty lax and uses many scalar
+* types interchangably.
+*/
+   'scalar_implicit_cast' => true,
+
+   /**
+

[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Add phan config to MinervaNeue

2017-08-15 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372061 )

Change subject: Add phan config to MinervaNeue
..

Add phan config to MinervaNeue

phantastic!

Bug: T133664
Change-Id: I3b8f1120b3e3103359166f2716e1218729beef17
---
A tests/phan/config_new.php
1 file changed, 307 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/61/372061/1

diff --git a/tests/phan/config_new.php b/tests/phan/config_new.php
new file mode 100644
index 000..803503b
--- /dev/null
+++ b/tests/phan/config_new.php
@@ -0,0 +1,307 @@
+ [
+   ],
+
+   /**
+* A list of directories that should be parsed for class and
+* method information. After excluding the directories
+* defined in exclude_analysis_directory_list, the remaining
+* files will be statically analyzed for errors.
+*
+* Thus, both first-party and third-party code being used by
+* your application should be included in this list.
+*/
+   'directory_list' => [
+   'src/',
+   'tests/phan/stubs/',
+   './../../includes',
+   './../../languages',
+   './../../maintenance',
+   './../../vendor',
+   './../../extensions/BetaFeatures/includes',
+   ],
+
+   /**
+* A file list that defines files that will be excluded
+* from parsing and analysis and will not be read at all.
+*
+* This is useful for excluding hopelessly unanalyzable
+* files that can't be removed for whatever reason.
+*/
+   'exclude_file_list' => function_exists( 'xcache_get' ) ? [] : [
+   ],
+
+   /**
+* A list of directories holding code that we want
+* to parse, but not analyze. Also works for individual
+* files.
+*/
+   "exclude_analysis_directory_list" => [
+   'tests/phan/stubs/',
+   './../../includes',
+   './../../languages',
+   './../../maintenance',
+   './../../vendor',
+   './../../extensions/BetaFeatures/includes',
+   ],
+
+   /**
+* Backwards Compatibility Checking. This is slow
+* and expensive, but you should consider running
+* it before upgrading your version of PHP to a
+* new version that has backward compatibility
+* breaks.
+*/
+   'backward_compatibility_checks' => false,
+
+   /**
+* A set of fully qualified class-names for which
+* a call to parent::__construct() is required
+*/
+   'parent_constructor_required' => [
+   ],
+
+   /**
+* Run a quick version of checks that takes less
+* time at the cost of not running as thorough
+* an analysis. You should consider setting this
+* to true only when you wish you had more issues
+* to fix in your code base.
+*
+* In quick-mode the scanner doesn't rescan a function
+* or a method's code block every time a call is seen.
+* This means that the problem here won't be detected:
+*
+* ```php
+*  false,
+
+   /**
+* By default, Phan will not analyze all node types
+* in order to save time. If this config is set to true,
+* Phan will dig deeper into the AST tree and do an
+* analysis on all nodes, possibly finding more issues.
+*
+* See \Phan\Analysis::shouldVisit for the set of skipped
+* nodes.
+*/
+   'should_visit_all_nodes' => true,
+
+   /**
+* If enabled, check all methods that override a
+* parent method to make sure its signature is
+* compatible with the parent's. This check
+* can add quite a bit of time to the analysis.
+*/
+   'analyze_signature_compatibility' => true,
+
+   // Emit all issues. They are then supressed via
+   // suppress_issue_types, rather than a minimum
+   // severity.
+   "minimum_severity" => 0,
+
+   /**
+* If true, missing properties will be created when
+* they are first seen. If false, we'll report an
+* error message if there is an attempt to write
+* to a class property that wasn't explicitly
+* defined.
+*/
+   'allow_missing_properties' => false,
+
+   /**
+* Allow null to be cast as any type and for any
+* type to be cast to null. Setting this to false
+* will cut down on false positives.
+*/
+   'null_casts_as_any_type' => true,
+
+   /**
+* If enabled, scalars (int, float, bool, string, null)
+* are treated as if they can cast to each other.
+*
+* MediaWiki is pretty lax and uses many scalar
+* types interchangably.
+*/
+   'scalar_

[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Add MinervaNeue Doxyfile

2017-08-15 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372060 )

Change subject: Add MinervaNeue Doxyfile
..

Add MinervaNeue Doxyfile

We forgot to copy this across when migrating Minerva out of
MobileFrontend.

Bug: T173255
Change-Id: I449d2a0705fe12d6edec332b5a2275dd85e1b189
---
A Doxyfile
1 file changed, 36 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/60/372060/1

diff --git a/Doxyfile b/Doxyfile
new file mode 100644
index 000..724d013
--- /dev/null
+++ b/Doxyfile
@@ -0,0 +1,36 @@
+# Configuration file for Doxygen
+
+PROJECT_NAME   = MinervaNeue
+PROJECT_BRIEF  = A responsive mobile first skin
+
+OUTPUT_DIRECTORY   = docs
+HTML_OUTPUT= php
+
+JAVADOC_AUTOBRIEF  = YES
+QT_AUTOBRIEF   = YES
+
+WARN_NO_PARAMDOC   = YES
+
+INPUT  = README.md ./
+EXCLUDE_PATTERNS   = */vendor/*
+EXCLUDE_PATTERNS  += */docs/*
+EXCLUDE_PATTERNS  += */node_modules/*
+FILE_PATTERNS  = *.php
+RECURSIVE  = YES
+# Requires doxygen 1.8.3+
+USE_MDFILE_AS_MAINPAGE = README.md
+
+HTML_DYNAMIC_SECTIONS  = YES
+GENERATE_TREEVIEW  = YES
+TREEVIEW_WIDTH = 250
+
+GENERATE_LATEX = NO
+
+HAVE_DOT   = YES
+DOT_FONTNAME   = Helvetica
+DOT_FONTSIZE   = 10
+TEMPLATE_RELATIONS = YES
+CALL_GRAPH = NO
+CALLER_GRAPH   = NO
+# Makes dot run faster. Requires graphviz >1.8.10
+DOT_MULTI_TARGETS  = YES

-- 
To view, visit https://gerrit.wikimedia.org/r/372060
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I449d2a0705fe12d6edec332b5a2275dd85e1b189
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[master]: MobileFrontend should be responsible for adding mobile.site ...

2017-08-11 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371498 )

Change subject: MobileFrontend should be responsible for adding mobile.site 
module
..

MobileFrontend should be responsible for adding mobile.site module

Change-Id: I4508762629333c96dc6b11f6c0f63b675b367209
Depends-On: I094a57532a4e7dac47d06f25c56dbd4935ec707c
Bug: T171062
---
M includes/skins/SkinMinerva.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/98/371498/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 31cedd0..558b560 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -1306,8 +1306,7 @@
$this->getContextSpecificModules(),
[
'skins.minerva.scripts.top',
-   'skins.minerva.scripts',
-   'mobile.site',
+   'skins.minerva.scripts'
]
);
 

-- 
To view, visit https://gerrit.wikimedia.org/r/371498
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4508762629333c96dc6b11f6c0f63b675b367209
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]: Load mobile.site on all mobile skins

2017-08-11 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371499 )

Change subject: Load mobile.site on all mobile skins
..

Load mobile.site on all mobile skins

Bug: T171062
Change-Id: I094a57532a4e7dac47d06f25c56dbd4935ec707c
---
M includes/MobileFrontend.hooks.php
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/99/371499/1

diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 70eec12..f9a07c1 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -780,6 +780,10 @@
);
}
 
+   // In mobile mode 
MediaWiki:Common.css/MediaWiki:Common.js is not loaded.
+   // We load MediaWiki:Mobile.css/js instead
+   $out->addModules(['mobile.site']);
+
// Allow modifications in mobile only mode
Hooks::run( 'BeforePageDisplayMobile', [ &$out, &$sk ] 
);
 

-- 
To view, visit https://gerrit.wikimedia.org/r/371499
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I094a57532a4e7dac47d06f25c56dbd4935ec707c
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...Popups[master]: WIP: A/B test infrastructure

2017-08-10 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371129 )

Change subject: WIP: A/B test infrastructure
..

WIP: A/B test infrastructure

Introduce getUserBucket which determines whether a user is in a bucket on, off 
or control
based on the value of PopupsAnonsEnabledSamplingRate
Add tests showing how these buckets are calculated.

TODO:
* We'll make sure events get logged for buckets on and control.
* We'll add the bucket field to all events logged so we can determine
who's who.

Bug: T171853
Change-Id: If2a0c5fceae78262c44cb522af38a925cc5919d3
---
M resources/dist/index.js
M resources/dist/index.js.map
A src/getUserBucket.js
M src/isEnabled.js
A tests/node-qunit/getUserBucket.test.js
M tests/node-qunit/stubs.js
6 files changed, 70 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/29/371129/1


-- 
To view, visit https://gerrit.wikimedia.org/r/371129
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2a0c5fceae78262c44cb522af38a925cc5919d3
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] operations/mediawiki-config[master]: Correct config - commonswiki not commons

2017-08-09 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370924 )

Change subject: Correct config - commonswiki not commons
..

Correct config - commonswiki not commons

Bug: T170687
Change-Id: I1543147666a1a89ef02b87fa3314fef69acd7325
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/24/370924/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index fab2d9d..b089754 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19382,7 +19382,7 @@
 'wgShortPagesNamespaceBlacklist' => [
'default' => [],
// T170687
-   'commons' => [ NS_FILE ],
+   'commonswiki' => [ NS_FILE ],
 ],
 
 // Temporarily enable until 1.30.0-wmf.12 rolls out -RK

-- 
To view, visit https://gerrit.wikimedia.org/r/370924
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1543147666a1a89ef02b87fa3314fef69acd7325
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...MinervaNeue[master]: QA: Simplify toast notification step some more

2017-08-09 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370880 )

Change subject: QA: Simplify toast notification step some more
..

QA: Simplify toast notification step some more

If mediawiki.notification has loaded that should be enough to assume
the toast is ready to have its text checked.

Change-Id: Ic546877eae0ea6dd59dbf88bf9267bcd1957f779
---
M tests/browser/features/step_definitions/common_article_steps.rb
1 file changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/80/370880/1

diff --git a/tests/browser/features/step_definitions/common_article_steps.rb 
b/tests/browser/features/step_definitions/common_article_steps.rb
index c08ee3a..d2296a2 100644
--- a/tests/browser/features/step_definitions/common_article_steps.rb
+++ b/tests/browser/features/step_definitions/common_article_steps.rb
@@ -39,9 +39,6 @@
 Then(/^I should see a toast with message "(.+)"$/) do |msg|
   on(ArticlePage) do |page|
 page.wait_until_rl_module_ready('mediawiki.notification')
-page.wait_until do
-  page.toast_element.when_present.text.include? msg
-end
 expect(page.toast_element.when_present.text).to match msg
   end
 end

-- 
To view, visit https://gerrit.wikimedia.org/r/370880
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic546877eae0ea6dd59dbf88bf9267bcd1957f779
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...RelatedArticles[master]: Merge footer hooks with Hooks

2017-08-09 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370876 )

Change subject: Merge footer hooks with Hooks
..

Merge footer hooks with Hooks

per Baha's suggestion we have no need for two Hooks files now
so let's merge them

Bug: T165991
Change-Id: I12c62aef837f50589297477f46bdf0f0d6b5536a
---
M extension.json
D includes/FooterHooks.php
M includes/Hooks.php
3 files changed, 206 insertions(+), 215 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RelatedArticles 
refs/changes/76/370876/1

diff --git a/extension.json b/extension.json
index 21f4c85..e2be270 100644
--- a/extension.json
+++ b/extension.json
@@ -14,7 +14,6 @@
"AutoloadClasses": {
"RelatedArticles\\ResourceLoaderMuHoganModule": 
"includes/ResourceLoaderMuhoganModule.php",
"RelatedArticles\\Hooks": "includes/Hooks.php",
-   "RelatedArticles\\FooterHooks": "includes/FooterHooks.php"
},
"ExtensionMessagesFiles": {
"RelatedArticlesMagic": "RelatedArticles.i18n.magic.php"
@@ -32,19 +31,19 @@
],
 
"MakeGlobalVariablesScript": [
-   
"RelatedArticles\\FooterHooks::onMakeGlobalVariablesScript"
+   "RelatedArticles\\Hooks::onMakeGlobalVariablesScript"
],
"BeforePageDisplay": [
-   "RelatedArticles\\FooterHooks::onBeforePageDisplay"
+   "RelatedArticles\\Hooks::onBeforePageDisplay"
],
"EventLoggingRegisterSchemas": [
-   
"RelatedArticles\\FooterHooks::onEventLoggingRegisterSchemas"
+   "RelatedArticles\\Hooks::onEventLoggingRegisterSchemas"
],
"ResourceLoaderGetConfigVars": [
-   
"RelatedArticles\\FooterHooks::onResourceLoaderGetConfigVars"
+   "RelatedArticles\\Hooks::onResourceLoaderGetConfigVars"
],
"ResourceLoaderRegisterModules": [
-   
"RelatedArticles\\FooterHooks::onResourceLoaderRegisterModules"
+   
"RelatedArticles\\Hooks::onResourceLoaderRegisterModules"
]
},
"MessagesDirs": {
diff --git a/includes/FooterHooks.php b/includes/FooterHooks.php
deleted file mode 100644
index d6d832b..000
--- a/includes/FooterHooks.php
+++ /dev/null
@@ -1,209 +0,0 @@
-MakeGlobalVariablesScript hook.
-*
-* Sets the value of the wgRelatedArticles global variable
-* to the list of related articles in the cached parser output.
-*
-* @param array &$vars variables to be added into the output of 
OutputPage::headElement.
-* @param OutputPage $out OutputPage instance calling the hook
-* @return bool Always true
-*/
-   public static function onMakeGlobalVariablesScript( &$vars, OutputPage 
$out ) {
-   $config = MediaWikiServices::getInstance()->getConfigFactory()
-   ->makeConfig( 'RelatedArticles' );
-
-   $vars['wgRelatedArticles'] = $out->getProperty( 
'RelatedArticles' );
-   $vars['wgRelatedArticlesUseCirrusSearch'] = $config->get( 
'RelatedArticlesUseCirrusSearch' );
-   $vars['wgRelatedArticlesOnlyUseCirrusSearch'] =
-   $config->get( 'RelatedArticlesOnlyUseCirrusSearch' );
-
-   return true;
-   }
-
-   /**
-* Uses the Disambiguator extension to test whether the page is a 
disambiguation page.
-*
-* If the Disambiguator extension isn't installed, then the test always 
fails, i.e. the page is
-* never a disambiguation page.
-*
-* @return boolean
-*/
-   private static function isDisambiguationPage( Title $title ) {
-   return \ExtensionRegistry::getInstance()->isLoaded( 
'Disambiguator' ) &&
-   DisambiguatorHooks::isDisambiguationPage( $title );
-   }
-
-   /**
-* Check whether the output page is a diff page
-*
-* @param OutputPage $out
-* @return bool
-*/
-   private static function isDiffPage( OutputPage $out ) {
-   $request = $out->getRequest();
-   $type = $request->getText( 'type' );
-   $diff = $request->getText( 'diff' );
-   $oldId = $request->getText( 'oldid' );
-   $isSpecialMobileDiff = $out->getTitle()->isSpecial( 
'MobileDiff' );
-
-   return $type === 'revision' || $diff || $oldId || 
$isSpecialMobileDiff;
-   }
-
-   /**
-* Is ReadMore allowed on skin?
-*
-* The feature is allowed on all skins as long as they are whitelisted
-* in the configuration variable 
`RelatedArticlesFooterWhitelistedSkins`.
-*
-* @para

[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: QA: Disable browser test in @chrome

2017-08-09 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370844 )

Change subject: QA: Disable browser test in @chrome
..

QA: Disable browser test in @chrome

This is failing consistently due to T172835. Let's not run it in the
@chrome job and just rely on the Firefox coverage.

Change-Id: Ic417148574208389b66249b2d98e009beef70fa2
---
M tests/browser/features/editor_wikitext_saving.feature
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/44/370844/1

diff --git a/tests/browser/features/editor_wikitext_saving.feature 
b/tests/browser/features/editor_wikitext_saving.feature
index 66f33dd..a3585a9 100644
--- a/tests/browser/features/editor_wikitext_saving.feature
+++ b/tests/browser/features/editor_wikitext_saving.feature
@@ -1,10 +1,10 @@
-@chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org @login
+@en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org @login
 Feature: Wikitext Editor (Makes actual saves)
 
   Background:
 Given I am logged into the mobile website
 
-  @smoke @editing @integration
+  @smoke @editing @integration @chrome
   Scenario: Successful edit on page without languages shows no language button 
[bug 63675]
 Given the page "Selenium no languages test page" exists
 When I click the edit button
@@ -27,7 +27,7 @@
   And I do not see the wikitext editor overlay
 Then I should see a toast notification
 
-  @editing
+  @editing @chrome
   Scenario: Redirects
 Given the page "Selenium wikitext editor test" exists
   And I am on a page that does not exist
@@ -40,7 +40,7 @@
   And I do not see the wikitext editor overlay
 Then the text of the first heading should be "Selenium wikitext editor 
test"
 
-  @editing
+  @editing @chrome
   Scenario: Broken redirects
 Given I am on a page that does not exist
 When I click the edit button

-- 
To view, visit https://gerrit.wikimedia.org/r/370844
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic417148574208389b66249b2d98e009beef70fa2
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[master]: QA: Workaround for T172835

2017-08-09 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370806 )

Change subject: QA: Workaround for T172835
..

QA: Workaround for T172835

Ensure the user is logged in and has made several edits to avoid
errors due to newly registered users not being allowed to edit

Change-Id: I6bd66dc7ed6607771020ff6d25691fb7859b1502
---
M tests/browser/features/editor_wikitext_saving.feature
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/06/370806/1

diff --git a/tests/browser/features/editor_wikitext_saving.feature 
b/tests/browser/features/editor_wikitext_saving.feature
index 66f33dd..d00a4b8 100644
--- a/tests/browser/features/editor_wikitext_saving.feature
+++ b/tests/browser/features/editor_wikitext_saving.feature
@@ -1,10 +1,10 @@
-@chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org @login
+@chrome @firefox @test2.m.wikipedia.org @login
 Feature: Wikitext Editor (Makes actual saves)
 
   Background:
-Given I am logged into the mobile website
+Given I am logged in as a user with a > 10 edit count
 
-  @smoke @editing @integration
+  @smoke @editing @integration @en.m.wikipedia.beta.wmflabs.org
   Scenario: Successful edit on page without languages shows no language button 
[bug 63675]
 Given the page "Selenium no languages test page" exists
 When I click the edit button
@@ -16,7 +16,7 @@
 Then I should see a toast notification
   And the text of the first heading should be "Selenium no languages test 
page"
 
-  @editing
+  @editing @en.m.wikipedia.beta.wmflabs.org
   Scenario: Successful edit reloads language button
 Given I go to a page that has languages
 When I click the edit button

-- 
To view, visit https://gerrit.wikimedia.org/r/370806
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6bd66dc7ed6607771020ff6d25691fb7859b1502
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...mobileapps[master]: POC: Send all the links for disambiguation pages in the summary

2017-08-08 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370754 )

Change subject: POC: Send all the links for disambiguation pages in the summary
..

POC: Send all the links for disambiguation pages in the summary

Playing with async functions... :)

Bug: T171052
Change-Id: I8272e45b296e7c75adfc82dc0b33b2a9d3ca268b
---
M routes/mobile-sections.js
1 file changed, 54 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/54/370754/1

diff --git a/routes/mobile-sections.js b/routes/mobile-sections.js
index 9d6684d..625e3ca 100644
--- a/routes/mobile-sections.js
+++ b/routes/mobile-sections.js
@@ -352,6 +352,32 @@
 });
 }
 
+/*
+ * Get disambiguation links for a given page
+ * @param {!Request} req
+ * @return {!BBPromise}
+ */
+function getDisambiguationLinks(req) {
+const p = req.params;
+const query = {
+action: 'query',
+titles: p.title,
+prop: 'links',
+format: 'json',
+formatversion: '2'
+};
+
+return apiUtil.mwApiGet(app, p.domain, query).then((resp) => {
+const result = resp.body;
+const page = result && result.query && result.query.pages && 
result.query.pages[0];
+const links = page && page.links;
+if (links) {
+  return links.map((page)=>page.title);
+} else {
+  return [];
+}
+});
+}
 
 /*
  * Build a summary for the page given in req
@@ -360,25 +386,36 @@
  *  of deprecating.
  * @return {!BBPromise}
  */
-function buildSummary(req) {
-return buildLeadObject(req, false).then((lead) => {
-let summary = {};
-const type = 'standard';
-let code = 200;
+async function buildSummary(req) {
+const lead = await buildLeadObject(req, false);
+let summary = {};
+let disambiguation_links;
+let type = 'standard';
+let code = 200;
+let d;
 
-if (!lead) {
-return false;
-} else if (lead.contentmodel || lead.ns !== 0) {
-code = 204;
-} else if (lead.intro) {
-summary = transforms.summarize(lead.intro);
+if (!lead) {
+return false;
+} else if (lead.contentmodel || lead.ns !== 0) {
+code = 204;
+} else if (lead.intro) {
+summary = transforms.summarize(lead.intro);
+}
+if (lead.disambiguation) {
+type = 'disambiguation';
+try {
+disambiguation_links = await getDisambiguationLinks(req);
+} catch (e) {
+console.log(e)
+disambiguation_links = [];
 }
-return Object.assign({
-code,
-type,
-revision: lead.revision
-}, summary);
-});
+}
+return Object.assign({
+code,
+disambiguation_links,
+type,
+revision: lead.revision
+}, summary);
 }
 
 /**

-- 
To view, visit https://gerrit.wikimedia.org/r/370754
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8272e45b296e7c75adfc82dc0b33b2a9d3ca268b
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]: Always extract an infobox and paragraph

2017-08-08 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370736 )

Change subject: Always extract an infobox and paragraph
..

Always extract an infobox and paragraph

There is undocumented logic limiting lead paragraph and infobox
extraction to pages where there are more than 1 section.

For disambiguation pages e.g. https://en.m.wikipedia.org/wiki/Colombo_Airport
this is not helpful.

Change-Id: I393c7068cb9d1317530a9e010fe87b28d0275c81
---
M routes/mobile-sections.js
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/36/370736/1

diff --git a/routes/mobile-sections.js b/routes/mobile-sections.js
index 9073ffe..9d6684d 100644
--- a/routes/mobile-sections.js
+++ b/routes/mobile-sections.js
@@ -100,10 +100,8 @@
 }
 
 if (!legacy) {
-if (input.page.sections.length > 1) {
-infobox = transforms.extractInfobox(lead);
-intro = transforms.extractLeadIntroduction(lead);
-}
+infobox = transforms.extractInfobox(lead);
+intro = transforms.extractLeadIntroduction(lead);
 text = lead.body.innerHTML;
 } else {
 // update text after extractions have taken place

-- 
To view, visit https://gerrit.wikimedia.org/r/370736
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I393c7068cb9d1317530a9e010fe87b28d0275c81
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]: Empty tags are omitted from summary output

2017-08-08 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370697 )

Change subject: Empty tags are omitted from summary output
..

Empty tags are omitted from summary output

Change-Id: I28e6c6518036daa331dd181f437e4997903a3f21
---
M lib/transformations/summarize.js
M test/lib/transformations/summarize.js
2 files changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/97/370697/1

diff --git a/lib/transformations/summarize.js b/lib/transformations/summarize.js
index 7668c07..8c78d2e 100644
--- a/lib/transformations/summarize.js
+++ b/lib/transformations/summarize.js
@@ -15,5 +15,6 @@
 rmElementsWithSelector(doc, '.mw-ref');
 rmElementsWithSelector(doc, '.noexcerpts');
 rmElementsWithSelector(doc, 'math');
+rmElementsWithSelector(doc, 'span:empty,b:empty,i:empty,p:empty');
 return doc.body.innerHTML;
 };
diff --git a/test/lib/transformations/summarize.js 
b/test/lib/transformations/summarize.js
index 43a2914..47f0745 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 flatten empty nodes
+[
+'f',
+'f'
+],
 // Should flatten links
 [
 'This is some content with a link.',
@@ -31,7 +36,7 @@
 // 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  \nE\n=\n
h\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:\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;\">'
 ]
 ];
 testCases.forEach((test) => {

-- 
To view, visit https://gerrit.wikimedia.org/r/370697
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28e6c6518036daa331dd181f437e4997903a3f21
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]: Per spec return summary type

2017-08-08 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370694 )

Change subject: Per spec return summary type
..

Per spec return summary type

Change-Id: I4e1c84cc490dc86551cae86bc4b96eafad42a89e
---
M routes/mobile-sections.js
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/94/370694/1

diff --git a/routes/mobile-sections.js b/routes/mobile-sections.js
index 6110b35..81a5f38 100644
--- a/routes/mobile-sections.js
+++ b/routes/mobile-sections.js
@@ -366,6 +366,7 @@
 function buildSummary(req) {
 return buildLeadObject(req, false).then((lead) => {
 let summary = '';
+let type = 'standard';
 let code = 200;
 
 if (!lead) {
@@ -377,6 +378,7 @@
 }
 return {
 code,
+type,
 html: summary,
 revision: lead.revision
 };

-- 
To view, visit https://gerrit.wikimedia.org/r/370694
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4e1c84cc490dc86551cae86bc4b96eafad42a89e
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]: Pages with empty lead sections should send a 204

2017-08-08 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370692 )

Change subject: Pages with empty lead sections should send a 204
..

Pages with empty lead sections should send a 204

If preview is an empty string we'll want to return a 204
per the spec.

Change-Id: Ib889905d647853e50afa2de656ee47882eee89d8
---
M routes/mobile-sections.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/92/370692/1

diff --git a/routes/mobile-sections.js b/routes/mobile-sections.js
index 6110b35..6a64dbd 100644
--- a/routes/mobile-sections.js
+++ b/routes/mobile-sections.js
@@ -370,7 +370,7 @@
 
 if (!lead) {
 return false;
-} else if (lead.contentmodel || lead.ns !== 0) {
+} else if (lead.contentmodel || lead.ns !== 0 || !lead.html) {
 code = 204;
 } else if (lead.intro) {
 summary = transforms.summarize(lead.intro);

-- 
To view, visit https://gerrit.wikimedia.org/r/370692
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib889905d647853e50afa2de656ee47882eee89d8
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...MinervaNeue[master]: QA: Relax toast notification QA steps

2017-08-08 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370667 )

Change subject: QA: Relax toast notification QA steps
..

QA: Relax toast notification QA steps

It seems trying to test both the steps can cause
false positives. Relaxing these checks seems to make
our Jenkins job happy without breaking the tests themselves

Change-Id: I119111e97f23d2f0dac7cbb0e5b86c1df0562598
---
M tests/browser/features/step_definitions/common_article_steps.rb
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/67/370667/1

diff --git a/tests/browser/features/step_definitions/common_article_steps.rb 
b/tests/browser/features/step_definitions/common_article_steps.rb
index df5d4fd..c08ee3a 100644
--- a/tests/browser/features/step_definitions/common_article_steps.rb
+++ b/tests/browser/features/step_definitions/common_article_steps.rb
@@ -32,14 +32,13 @@
 # Minerva loads mediawiki.notify at startup which defers the loading of 
this module
 # We must wait until the lazy loading has happened before checking for the 
toast (T170890)
 page.wait_until_rl_module_ready('mediawiki.notification')
+expect(page.notification_area_element.when_visible).to be_visible
   end
-  expect(on(ArticlePage).notification_area_element.when_visible).to be_visible
-  expect(on(ArticlePage).toast_element.when_visible).to be_visible
 end
 
 Then(/^I should see a toast with message "(.+)"$/) do |msg|
-  step "I should see a toast notification"
   on(ArticlePage) do |page|
+page.wait_until_rl_module_ready('mediawiki.notification')
 page.wait_until do
   page.toast_element.when_present.text.include? msg
 end

-- 
To view, visit https://gerrit.wikimedia.org/r/370667
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I119111e97f23d2f0dac7cbb0e5b86c1df0562598
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] integration/config[master]: WebdriverIO tests should look for LocalSettings.php in selen...

2017-08-08 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370662 )

Change subject: WebdriverIO tests should look for LocalSettings.php in selenium 
folder
..

WebdriverIO tests should look for LocalSettings.php in selenium folder

The browser folder is reserved for ruby based tests. If a WebDriverIO job
is being used it should source this file from the same place as the tests

Bug: T164024
Change-Id: Ib069004f8dcb76550fe96a6544f2846d4a7af1b9
---
M jjb/macro.yaml
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/62/370662/1

diff --git a/jjb/macro.yaml b/jjb/macro.yaml
index 6513e58..5f8d53b 100644
--- a/jjb/macro.yaml
+++ b/jjb/macro.yaml
@@ -325,8 +325,8 @@
  - shell: |
  # Change to the working directory. EXT_NAME is set by Zuul parameters
  # functions
- if [ -f ./src/extensions/$EXT_NAME/tests/browser/LocalSettings.php ]; 
then
-   cd ./src/extensions/$EXT_NAME/tests/browser
+ if [ -f ./src/extensions/$EXT_NAME/tests/selenium/LocalSettings.php 
]; then
+   cd ./src/extensions/$EXT_NAME/tests/selenium
. 
'/srv/deployment/integration/slave-scripts/bin/mw-selenium-setup.sh'
  fi
 

-- 
To view, visit https://gerrit.wikimedia.org/r/370662
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib069004f8dcb76550fe96a6544f2846d4a7af1b9
Gerrit-PatchSet: 1
Gerrit-Project: integration/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...MinervaNeue[master]: DONOTMERGE

2017-08-08 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370657 )

Change subject: DONOTMERGE
..

DONOTMERGE

Change-Id: I31ee31b6239106d92735519b9c25028fa92a4599
---
D tests/browser/features/category.feature
D tests/browser/features/diff.feature
D tests/browser/features/editor_wikitext_nosave.feature
D tests/browser/features/editor_wikitext_saving.feature
D tests/browser/features/issues.feature
D tests/browser/features/mainmenu.feature
D tests/browser/features/mainmenu_loggedin.feature
D tests/browser/features/no_javascript_site.feature
D tests/browser/features/notification.feature
D tests/browser/features/pageactions.feature
D tests/browser/features/pageactions_protected.feature
D tests/browser/features/references.feature
D tests/browser/features/signup_edit_tutorial.feature
D tests/browser/features/talk.feature
D tests/browser/features/toc.feature
D tests/browser/features/toggling.feature
D tests/browser/features/toggling_tablet.feature
D tests/browser/features/ui.feature
D tests/browser/features/user_page.feature
D tests/browser/features/watchstar.feature
D tests/browser/features/wikidata_descriptions.feature
21 files changed, 0 insertions(+), 472 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/57/370657/1

diff --git a/tests/browser/features/category.feature 
b/tests/browser/features/category.feature
deleted file mode 100644
index 090ab6d..000
--- a/tests/browser/features/category.feature
+++ /dev/null
@@ -1,11 +0,0 @@
-@chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org 
@vagrant @login
-Feature: Categories
-
-  Scenario: I can view categories
-Given I am in a wiki that has categories
-  And I am using the mobile site
-  And I am in beta mode
-  And I am on the "Selenium categories test page" page
-When I click on the category button
-Then I should see the categories overlay
-  And I should see a list of categories
diff --git a/tests/browser/features/diff.feature 
b/tests/browser/features/diff.feature
deleted file mode 100644
index 98f7d3d..000
--- a/tests/browser/features/diff.feature
+++ /dev/null
@@ -1,14 +0,0 @@
-@chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org 
@vagrant @login
-Feature: Page diff
-
-  @smoke @editing @integration
-  Scenario: Added and removed content
-Given I am logged into the mobile website
-  And I am on a page that has the following edits:
-| text |
-| ABC DEF  |
-| ABC GHI  |
-  And I click on the history link in the last modified bar
-  And I open the latest diff
-Then I should see "GHI" as added content
-  And I should see "DEF" as removed content
diff --git a/tests/browser/features/editor_wikitext_nosave.feature 
b/tests/browser/features/editor_wikitext_nosave.feature
deleted file mode 100644
index eba39de..000
--- a/tests/browser/features/editor_wikitext_nosave.feature
+++ /dev/null
@@ -1,17 +0,0 @@
-@chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org 
@vagrant @login
-Feature: Wikitext Editor
-
-  Background:
-Given I am logged into the mobile website
-  And I am on a page that does not exist
-  And I click the edit button
-  And I see the wikitext editor overlay
-
-  @smoke @integration
-  Scenario: Closing editor (overlay button)
-When I click the wikitext editor overlay close button
-Then I should not see the wikitext editor overlay
-
-  Scenario: Closing editor (browser button)
-When I click the browser back button
-Then I should not see the wikitext editor overlay
diff --git a/tests/browser/features/editor_wikitext_saving.feature 
b/tests/browser/features/editor_wikitext_saving.feature
deleted file mode 100644
index 66f33dd..000
--- a/tests/browser/features/editor_wikitext_saving.feature
+++ /dev/null
@@ -1,53 +0,0 @@
-@chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org @login
-Feature: Wikitext Editor (Makes actual saves)
-
-  Background:
-Given I am logged into the mobile website
-
-  @smoke @editing @integration
-  Scenario: Successful edit on page without languages shows no language button 
[bug 63675]
-Given the page "Selenium no languages test page" exists
-When I click the edit button
-  And I see the wikitext editor overlay
-  And I type "ABC GHI" into the editor
-  And I click continue
-  And I click submit
-  And I do not see the wikitext editor overlay
-Then I should see a toast notification
-  And the text of the first heading should be "Selenium no languages test 
page"
-
-  @editing
-  Scenario: Successful edit reloads language button
-Given I go to a page that has languages
-When I click the edit button
-  And I see the wikitext editor overlay
-  And I type "ABC GHI" into the editor
-  And I click continue
-  And I click submit
-  

[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Reflect template change

2017-08-07 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370513 )

Change subject: Reflect template change
..

Reflect template change

Link has changed
from Help:IPA/English
https://en.m.wikipedia.org/wiki/Special:MobileDiff/794002013

Change-Id: I91a840fa0d6e6fe5a57a235285dc4bbdf5297929
---
M 
test/diff/results/page_formatted-enwiki-User%3ABSitzmann_(WMF)_MCS_Test_Frankenstein.json
M 
test/diff/results/page_mobile-sections-enwiki-User%3ABSitzmann_(WMF)_MCS_Test_Frankenstein.json
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/13/370513/1

diff --git 
"a/test/diff/results/page_formatted-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json"
 
"b/test/diff/results/page_formatted-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json"
index d80bea7..a4339e7 100644
--- 
"a/test/diff/results/page_formatted-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json"
+++ 
"b/test/diff/results/page_formatted-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json"
@@ -36,7 +36,7 @@
   },
   {
 "id": 3,
-"text": "\nKonjac (English:  
/ˈkoʊnjæk/
 KOHN-yak)\n\n",
+"text": "\nKonjac (English:  
/ˈkoʊnjæk/
 KOHN-yak)\n\n",
 "toclevel": 1,
 "line": "Pronunciation aids",
 "anchor": "Pronunciation_aids"
diff --git 
"a/test/diff/results/page_mobile-sections-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json"
 
"b/test/diff/results/page_mobile-sections-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json"
index 7676792..9484fba 100644
--- 
"a/test/diff/results/page_mobile-sections-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json"
+++ 
"b/test/diff/results/page_mobile-sections-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json"
@@ -190,7 +190,7 @@
   },
   {
 "id": 3,
-"text": "\nKonjac (English:  /ˈkoʊnjæk/
 KOHN-yak)\n\n",
+"text": "\nKonjac (English:  /ˈkoʊnjæk/
 KOHN-yak)\n\n",
 "toclevel": 1,
 "line": "Pronunciation aids",
 "anchor": "Pronunciation_aids"

-- 
To view, visit https://gerrit.wikimedia.org/r/370513
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91a840fa0d6e6fe5a57a235285dc4bbdf5297929
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]: Look for dablinks when extracting hatnotes

2017-08-06 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370371 )

Change subject: Look for dablinks when extracting hatnotes
..

Look for dablinks when extracting hatnotes

Certain wiki pages use older wiki templates and disambiguation links
are marked with .dablink

e.g.
https://en.wikivoyage.org/wiki/Mumbai

Change-Id: Ieac31f6492e9d8ca3c15f787d0e5a2925777af45
---
M lib/transformations/extractHatnotes.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/71/370371/1

diff --git a/lib/transformations/extractHatnotes.js 
b/lib/transformations/extractHatnotes.js
index e4bbd48..219dc5e 100644
--- a/lib/transformations/extractHatnotes.js
+++ b/lib/transformations/extractHatnotes.js
@@ -7,7 +7,7 @@
  */
 function extractHatnotes(lead, removeNodes) {
 const hatnotes = [];
-const hatnoteNodes = lead.querySelectorAll('.hatnote');
+const hatnoteNodes = lead.querySelectorAll('.hatnote,.dablink');
 Array.prototype.forEach.call(hatnoteNodes, (hatnoteNode, i) => {
 hatnotes.push(hatnoteNode.innerHTML);
 if (removeNodes) {

-- 
To view, visit https://gerrit.wikimedia.org/r/370371
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieac31f6492e9d8ca3c15f787d0e5a2925777af45
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]: Scrub #coordinates from response

2017-08-04 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370253 )

Change subject: Scrub #coordinates from response
..

Scrub #coordinates from response

Now we are using the MediaWiki coordinates
prop to source coordinates there is no need to keep this element in
the HTML. On many pages it may be the first paragraph so removing it
will help us serve the first paragraph of content to our users

Bug: T172021
Change-Id: Ia854f7f6808a745634d9b72e12ea2880fe579c66
---
M lib/transforms.js
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/53/370253/1

diff --git a/lib/transforms.js b/lib/transforms.js
index e0f59b7..b0fb92d 100644
--- a/lib/transforms.js
+++ b/lib/transforms.js
@@ -255,6 +255,7 @@
 'span.Z3988',  // Remove 
 'span:empty',  // Remove empty 
 'link',
+'#coordinates',
 'table.navbox',
 '.geo-nondefault',
 '.geo-multi-punct',

-- 
To view, visit https://gerrit.wikimedia.org/r/370253
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia854f7f6808a745634d9b72e12ea2880fe579c66
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...MinervaNeue[master]: Don't output empty footer items in desktop Minerva

2017-08-04 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370215 )

Change subject: Don't output empty footer items in desktop Minerva
..

Don't output empty footer items in desktop Minerva

These fields can be false. Make sure we don't output them

Change-Id: If40c27f85e61558d09b14f4f4cfe394f581929b5
---
M includes/skins/MinervaTemplate.php
M includes/skins/minerva.mustache
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/15/370215/1

diff --git a/includes/skins/MinervaTemplate.php 
b/includes/skins/MinervaTemplate.php
index e804da3..3062456 100644
--- a/includes/skins/MinervaTemplate.php
+++ b/includes/skins/MinervaTemplate.php
@@ -49,7 +49,7 @@
foreach ( $data['footerlinks'] as $category => $links ) {
$items = [];
foreach ( $links as $link ) {
-   if ( isset( $this->data[$link] ) && 
$data[$link] !== '' ) {
+   if ( isset( $this->data[$link] ) && 
$data[$link] !== '' && $data[$link] !== false ) {
$items[] = [
'category' => $category,
'name' => $link,
diff --git a/includes/skins/minerva.mustache b/includes/skins/minerva.mustache
index e43504d..16a5aa6 100644
--- a/includes/skins/minerva.mustache
+++ b/includes/skins/minerva.mustache
@@ -32,4 +32,4 @@
{{>footer}}

 
-
+

-- 
To view, visit https://gerrit.wikimedia.org/r/370215
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If40c27f85e61558d09b14f4f4cfe394f581929b5
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[master]: Hygiene: The main page check is not necessary

2017-08-03 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370109 )

Change subject: Hygiene: The main page check is not necessary
..

Hygiene: The main page check is not necessary

The main page in the Minerva skin is not editable so this code is
just cruft.

Change-Id: Ifcd30be0d4e328b056cc7fcfb714c9783b62c913
---
M resources/skins.minerva.editor/init.js
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/09/370109/1

diff --git a/resources/skins.minerva.editor/init.js 
b/resources/skins.minerva.editor/init.js
index 1def74e..60cf3dd 100644
--- a/resources/skins.minerva.editor/init.js
+++ b/resources/skins.minerva.editor/init.js
@@ -249,8 +249,7 @@
if ( $caEdit.find( '.edit-page' ).length === 0 ) {
$( '.nojs-edit' ).removeClass( 'nojs-edit' );
$( '#ca-edit a' ).remove();
-   // FIXME: unfortunately the main page is special cased.
-   if ( mw.config.get( 'wgIsMainPage' ) || isNewPage || ( 
leadSection && leadSection.text() ) ) {
+   if ( isNewPage || ( leadSection && leadSection.text() ) 
) {
// if lead section is not empty, open editor 
with lead section
addEditButton( 0, '#ca-edit' );
} else {

-- 
To view, visit https://gerrit.wikimedia.org/r/370109
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifcd30be0d4e328b056cc7fcfb714c9783b62c913
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...Vector[master]: Padding tweak for all lists

2017-08-03 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370105 )

Change subject: Padding tweak for all lists
..

Padding tweak for all lists

This is particularly important in references where this small
change saves a large number of pages from being printed.

Bug: T172144
Change-Id: I7ceb244dc7be847cbe0fdc58c6a1cac6b0de3e0a
---
M print.less
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector 
refs/changes/05/370105/1

diff --git a/print.less b/print.less
index c518577..40bcc0a 100644
--- a/print.less
+++ b/print.less
@@ -118,7 +118,7 @@
padding: 0;
 
li {
-   padding: 5px 0;
+   padding: 2px 0;
font-size: 10pt;
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/370105
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ceb244dc7be847cbe0fdc58c6a1cac6b0de3e0a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
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]: Page.js getLeadSectionElement

2017-08-03 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370087 )

Change subject: Page.js getLeadSectionElement
..

Page.js getLeadSectionElement

* Add tests
* When pages are not mobile formatted return entire content as lead
- this avoids breakages with editor and page issues

Change-Id: I41e4ff1c35425b69a0fb8f007cc0c2a1b1a1c6a5
---
M resources/mobile.startup/Page.js
M tests/qunit/mobile.startup/test_Page.js
2 files changed, 19 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/87/370087/1

diff --git a/resources/mobile.startup/Page.js b/resources/mobile.startup/Page.js
index ab7ecfa..9668d84 100644
--- a/resources/mobile.startup/Page.js
+++ b/resources/mobile.startup/Page.js
@@ -104,6 +104,8 @@
 
/**
 * Get the lead section of the page view.
+* If it's impossible to locate any sections in the page via 
HTML markup, the element that
+* represents the entire page content is returned.
 * @method
 * @return {jQuery.Object|null}
 */
@@ -119,15 +121,11 @@
 *   
 * 
 */
-   if ( $( '.mf-section-0' ).length ) {
-   return $( '.mf-section-0' );
-   }
-   // for cached pages that are still using 
mw-mobilefrontend-leadsection
-   if ( $( '.mw-mobilefrontend-leadsection' ).length ) {
-   return $( '.mw-mobilefrontend-leadsection' );
+   if ( this.$( '.mf-section-0' ).length ) {
+   return this.$( '.mf-section-0' );
}
// no lead section found
-   return null;
+   return this.$el;
},
 
/**
diff --git a/tests/qunit/mobile.startup/test_Page.js 
b/tests/qunit/mobile.startup/test_Page.js
index 58f31ed..6460184 100644
--- a/tests/qunit/mobile.startup/test_Page.js
+++ b/tests/qunit/mobile.startup/test_Page.js
@@ -15,6 +15,20 @@
assert.strictEqual( p2.isMainPage(), false, 'check not marked 
as main page' );
} );
 
+   QUnit.test( '#getLeadSectionElement', 2, function ( assert ) {
+   var nonMobileFormattedPage, formattedPage;
+   nonMobileFormattedPage = new Page( {
+   el: $( 'TestEditHello' )
+   } );
+   formattedPage = new Page( {
+   el: $( 'TestEditHello' )
+   } );
+   assert.strictEqual( 
nonMobileFormattedPage.getLeadSectionElement().attr( 'class' )
+   , 'mw-parser-output', 'When no sections found, return 
the entire page content.' );
+   assert.strictEqual( 
nonMobileFormattedPage.getLeadSectionElement().attr( 'class' )
+   , 'mf-section-0', 'When no sections found, return the 
entire page content.' );
+   } );
+
QUnit.test( '#getThumbnails', 11, function ( assert ) {
var p, textPage, pLegacyUrls, thumbs, pNoViewer, pMetadata, 
pLazyImages, metadataTable,
pLazyImagesTypo, pMetadataNested;

-- 
To view, visit https://gerrit.wikimedia.org/r/370087
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41e4ff1c35425b69a0fb8f007cc0c2a1b1a1c6a5
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...RelatedArticles[master]: QA: Move LocalSettings to folder with other browser tests

2017-08-02 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369666 )

Change subject: QA: Move LocalSettings to folder with other browser tests
..

QA: Move LocalSettings to folder with other browser tests

Change-Id: Iaae9709b7407738850cdfc47c7ff56cc6eb2b1ca
---
R tests/selenium/LocalSettings.php
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RelatedArticles 
refs/changes/66/369666/1

diff --git a/tests/browser/LocalSettings.php b/tests/selenium/LocalSettings.php
similarity index 100%
rename from tests/browser/LocalSettings.php
rename to tests/selenium/LocalSettings.php

-- 
To view, visit https://gerrit.wikimedia.org/r/369666
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaae9709b7407738850cdfc47c7ff56cc6eb2b1ca
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...mobileapps[master]: MCS no longer uses mobile view API under the hood

2017-08-01 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369580 )

Change subject: MCS no longer uses mobile view API under the hood
..

MCS no longer uses mobile view API under the hood

After this change we will only use it for the mainpage
Yay!

Changes:
* Remove getMobileViewMetadata
* Remove call to getMobileViewMetadata
* Decrease indent - all code stays same

Bug: T103362
Change-Id: Iebf446c29dfe9cb944f0bf8cc335513ded0abc72
---
M lib/mwapi.js
1 file changed, 78 insertions(+), 106 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/80/369580/1

diff --git a/lib/mwapi.js b/lib/mwapi.js
index 400e060..d739e65 100644
--- a/lib/mwapi.js
+++ b/lib/mwapi.js
@@ -125,30 +125,6 @@
 };
 
 /**
- * Builds the request to get page metadata from MW API action=mobileview.
- * The plan is to deprecate this method and usage of the mobileview api 
(T103362).
- * Please use getMetaData and queries that do not hit the mobileview api.
- * @param {!Object} app the application object
- * @param {!Object} req the request object
- * @return {!Promise} a promise resolving as an JSON object containing the 
response
- */
-function getMobileViewMetadata(app, req) {
-const props = [];
-
-const query = apiParams({
-action: 'mobileview',
-page: req.params.title,
-prop: props.join('|'),
-thumbwidth: mwapi.LEAD_IMAGE_XL
-});
-return api.mwApiGet(app, req.params.domain, query)
-.then((response) => {
-mwapi.checkForMobileviewInResponse(req.logger, response);
-return response;
-});
-}
-
-/**
  * Given protection status for an article simplify it to allow easy reference
  * @param {!Array} mwApiProtectionObj e.g.
  *  [ { type: 'edit', level: 'autoconfirmed', expiry: 'infinity' }
@@ -180,90 +156,86 @@
 const props = ['coordinates','pageprops', 'pageimages', 'pageterms', 
'revisions',
 'info', 'langlinks'];
 
-return getMobileViewMetadata(app, req)
-  .then((mvResponse) => {
-  const query = apiParams({
-  action: 'query',
-  lllimit: 'max',
-  meta: 'siteinfo',
-  pilicense: 'any',
-  pithumbsize: 320,
-  pageprops: ['wikibase_item',
-  'disambiguation', 'displaytitle', 
'normalizedtitle'].join('|'),
-  wbptterms: 'description',
-  inprop: ['protection'].join('|'),
-  rvprop: ['ids', 'timestamp', 'user', 'contentmodel'].join('|'),
-  titles: req.params.title,
+const query = apiParams({
+action: 'query',
+lllimit: 'max',
+meta: 'siteinfo',
+pilicense: 'any',
+pithumbsize: 320,
+pageprops: ['wikibase_item',
+'disambiguation', 'displaytitle', 'normalizedtitle'].join('|'),
+wbptterms: 'description',
+inprop: ['protection'].join('|'),
+rvprop: ['ids', 'timestamp', 'user', 'contentmodel'].join('|'),
+titles: req.params.title,
+redirects: 1,
+prop: props.join('|')
+});
+
+return api.mwApiGet(app, req.params.domain, query)
+  .then((apiResponse) => {
+  const mv = mvResponse.body.mobileview;
+  const body = apiResponse.body;
+  const page = body.query && body.query.pages
+  && body.query.pages[0];
+  const coords = page && page.coordinates && page.coordinates[0];
+  const revision = page && page.revisions && page.revisions[0];
+  const pageprops = page && page.pageprops;
+  const siteinfo = body.query && body.query.general;
+  let mainpage, geo;
+
+  // Extract coordinates from the API response
+  if (coords) {
+  geo = {
+  latitude: coords.lat,
+  longitude: coords.lon
+  };
+  }
+  const normalized = body.query
+  && body.query.normalized && body.query.normalized[0]
+  && body.query.normalized[0].to;
+  const displayTitle = pageprops && pageprops.displaytitle;
+  const redirect = body.query.redirects && body.query.redirects.to;
+  const title = redirect || page.title;
+  const thumbUrl = page.thumbnail && page.thumbnail.source;
+  const image = page.pageimage ? {
+  file: page.pageimage.replace(/ /g, '_'),
+  urls: {
+  320: thumbUrl,
+  640: thumbUrl.replace('320', '640'),
+  800: thumbUrl.replace('320', '800'),
+  1024: thumbUrl.replace('320', '1024')
+  }
+  } : undefined;
+  const protection = simplifyProtectionObject(page.protection);
+  const modifier = revision.anon !== undefined ? { anon: true } : {};
+  modifier.user = revision.user;
+  // Always set to unknown until support in A

[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: QA: Use css rather than class for finding toast

2017-08-01 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369561 )

Change subject: QA: Use css rather than class for finding toast
..

QA: Use css rather than class for finding toast

Bug: T170890
Change-Id: I86e48e00ebb83772149da7c7f20097b5436a0cf5
---
M tests/browser/features/support/pages/article_page.rb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/61/369561/1

diff --git a/tests/browser/features/support/pages/article_page.rb 
b/tests/browser/features/support/pages/article_page.rb
index 2b733ae..6b146b0 100644
--- a/tests/browser/features/support/pages/article_page.rb
+++ b/tests/browser/features/support/pages/article_page.rb
@@ -145,7 +145,7 @@
 
   # toast
   div(:notification_area, id: 'mw-notification-area')
-  div(:toast, class: 'mw-notification')
+  div(:toast, css: 'mw-notification')
 
   # loader
   div(:content_wrapper, id: 'content')

-- 
To view, visit https://gerrit.wikimedia.org/r/369561
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86e48e00ebb83772149da7c7f20097b5436a0cf5
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] operations/mediawiki-config[master]: Exclude files from Special:ShortPages on commons

2017-08-01 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369503 )

Change subject: Exclude files from Special:ShortPages on commons
..

Exclude files from Special:ShortPages on commons

Bug: T170687
Change-Id: I1183e1a1ad6bd9044dced484186ed6ee49bbc375
---
M wmf-config/InitialiseSettings.php
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/03/369503/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 32af7bc..ecd0115 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19190,6 +19190,12 @@
'labtestwiki' => true,
 ],
 
+'wgShortPagesNamespaceBlacklist' => [
+   'default' => [],
+   // T170687
+   'commons' => [ NS_FILE ],
+],
+
 // Temporarily enable until 1.30.0-wmf.12 rolls out -RK
 'wgStructuredChangeFiltersEnableExperimentalViews' => [
'default' => true,

-- 
To view, visit https://gerrit.wikimedia.org/r/369503
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1183e1a1ad6bd9044dced484186ed6ee49bbc375
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] operations/mediawiki-config[master]: Disable page previews on a variety of pages

2017-08-01 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369494 )

Change subject: Disable page previews on a variety of pages
..

Disable page previews on a variety of pages

Bug: T170893
Change-Id: Ia353086e2cfb9b2e955f4b5645a89abc59b8b107
---
M wmf-config/InitialiseSettings.php
1 file changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/94/369494/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 32af7bc..428fb6b 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -13468,6 +13468,29 @@
'huwiki' => true,
 ],
 
+'wgPopupsPageBlacklist' => [
+   'default' = [
+   'Special:CreateAccount',
+   'Special:GlobalRenameRequest',
+   'Special:UserLogin',
+   'Special:MergeAccount',
+   'Special:ChangeCredentials',
+   'Special:OAuthListConsumers',
+   'Special:GlobalUserRights',
+   'Special:Notifications',
+   'Special:UserRights',
+   'Special:Upload',
+   'Special:VipsTest',
+   'Special:ApiFeatureUsage',
+   'Special:ExpandTemplates',
+   'Special:GadgetUsage',
+   'Special:GraphSandbox',
+   'Special:TemplateSandbox',
+   'Special:MostLinkedFiles',
+   'Special:Book',
+   'Special:CiteThisPage',
+   ],
+],
 'wgPopupsAnonsEnabledSamplingRate' => [
'default' => 0,
'sewikimedia' => 1, // T68374

-- 
To view, visit https://gerrit.wikimedia.org/r/369494
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia353086e2cfb9b2e955f4b5645a89abc59b8b107
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] operations/mediawiki-config[master]: Update wordmark for Wikipedia Atikamekw

2017-08-01 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369464 )

Change subject: Update wordmark for Wikipedia Atikamekw
..

Update wordmark for Wikipedia Atikamekw

Bug: T168203
* Editor should jump to top when opened (scroll then click edit broken)

Change-Id: Icb8b5c7bda3df0b6dc1c67f0050d0039cc5a6433
---
A static/images/mobile/copyright/wikipedia-wordmark-atj.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/64/369464/1

diff --git a/static/images/mobile/copyright/wikipedia-wordmark-atj.svg 
b/static/images/mobile/copyright/wikipedia-wordmark-atj.svg
new file mode 100644
index 000..33c174c
--- /dev/null
+++ b/static/images/mobile/copyright/wikipedia-wordmark-atj.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 32af7bc..355f0cd 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15381,6 +15381,11 @@
'copyright-width' => 79,
'copyright-height' => 22,
],
+   'atjwiki' => [
+   'copyright' => 
'/static/images/mobile/copyright/wikipedia-wordmark-atj.svg',
+   'copyright-width' => 133,
+   'copyright-height' => 18,
+   ],
'bnwiki' => [
'copyright' => 
'/static/images/mobile/copyright/wikipedia-wordmark-bn.svg',
'copyright-width' => 92,

-- 
To view, visit https://gerrit.wikimedia.org/r/369464
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb8b5c7bda3df0b6dc1c67f0050d0039cc5a6433
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...MinervaNeue[master]: Relax navbox hack

2017-08-01 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369453 )

Change subject: Relax navbox hack
..

Relax navbox hack

Per discussion in T172078 let's relax these rules so navbox shows
up in the desktop mode of the site.

Note: this will not impact the mobile site as navboxes are stripped
from the HTML.

Bug: T172078
Change-Id: I59d229d75dbcb790eb75dc4b838b2afafd2f3980
---
M resources/skins.minerva.content.styles/hacks.less
1 file changed, 16 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/53/369453/1

diff --git a/resources/skins.minerva.content.styles/hacks.less 
b/resources/skins.minerva.content.styles/hacks.less
index f1a954a..0f07ee6 100644
--- a/resources/skins.minerva.content.styles/hacks.less
+++ b/resources/skins.minerva.content.styles/hacks.less
@@ -17,6 +17,11 @@
 }
 
 .content {
+   .vertical-navbox,
+   .navbox {
+   display: none;
+   }
+
// Hide cleanup templates by default to non-javascript users as these 
stop them from reading the article itself
// Talk page informational boxes
.tmbox,
@@ -24,7 +29,7 @@
.ambox,
#coordinates,
// Hide article badges, clean-up notices, stub notices, and navigation 
boxes
-   .navbox, .vertical-navbox, .topicon, .metadata {
+   .topicon, .metadata {
// It's important as some of these are tables which become 
display: table on larger screens
display: none !important;
}
@@ -112,6 +117,16 @@
width: auto !important;
 }
 
+@media all and ( min-width: @deviceWidthTablet ) {
+   // When in the HTML these should be revealed at tablet resolution 
(T172078)
+   .content {
+   .vertical-navbox,
+   .navbox {
+   display: inherit;
+   }
+   }
+}
+
 // Hacks to render galleries and multicol tables better on mobile
 @media all and ( max-width: @deviceWidthTablet ) {
 

-- 
To view, visit https://gerrit.wikimedia.org/r/369453
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I59d229d75dbcb790eb75dc4b838b2afafd2f3980
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[master]: QA: Make sure toast is not empty before checking text value

2017-08-01 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369450 )

Change subject: QA: Make sure toast is not empty before checking text value
..

QA: Make sure toast is not empty before checking text value

Bug: T170890
Change-Id: Iba8a503a2aea30cb46fba27f000843183e9c46f1
---
M tests/browser/features/step_definitions/common_article_steps.rb
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/50/369450/1

diff --git a/tests/browser/features/step_definitions/common_article_steps.rb 
b/tests/browser/features/step_definitions/common_article_steps.rb
index c16a05d..a9827e3 100644
--- a/tests/browser/features/step_definitions/common_article_steps.rb
+++ b/tests/browser/features/step_definitions/common_article_steps.rb
@@ -34,7 +34,11 @@
 
 Then(/^I should see a toast with message "(.+)"$/) do |msg|
   step "I should see a toast notification"
-  expect(on(ArticlePage).toast_element.when_present.text).to match msg
+  on(ArticlePage) do |page|
+page.wait_until do
+  page.toast_element.text.to match msg
+end
+  end
 end
 
 Then /^I should see a drawer with message "(.+)"$/ do |text|

-- 
To view, visit https://gerrit.wikimedia.org/r/369450
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba8a503a2aea30cb46fba27f000843183e9c46f1
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[master]: Style Parsoid generated references

2017-08-01 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369399 )

Change subject: Style Parsoid generated references
..

Style Parsoid generated references

Bug: T171727
Change-Id: I34838562360ec7d4fc55e1f3a7dad8a926e4da52
---
M resources/skins.minerva.content.styles/text.less
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/99/369399/1

diff --git a/resources/skins.minerva.content.styles/text.less 
b/resources/skins.minerva.content.styles/text.less
index b36db8f..37a2500 100644
--- a/resources/skins.minerva.content.styles/text.less
+++ b/resources/skins.minerva.content.styles/text.less
@@ -58,6 +58,7 @@
padding: 1em;
 }
 
+.mw-ref,
 sup {
vertical-align: super;
 }
@@ -66,6 +67,7 @@
vertical-align: sub;
 }
 
+.mw-ref,
 sub,
 sup {
font-size: 0.75em;

-- 
To view, visit https://gerrit.wikimedia.org/r/369399
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I34838562360ec7d4fc55e1f3a7dad8a926e4da52
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...mobileapps[master]: WIP: Do not use MobileView to source metadata

2017-07-31 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368959 )

Change subject: WIP: Do not use MobileView to source metadata
..

WIP: Do not use MobileView to source metadata

Bug: T103362
Change-Id: Ica94d831d18faf0d2a7f220c7a1277da14efa20a
---
M lib/mwapi.js
1 file changed, 21 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/59/368959/1

diff --git a/lib/mwapi.js b/lib/mwapi.js
index 8319320..3340a23 100644
--- a/lib/mwapi.js
+++ b/lib/mwapi.js
@@ -133,15 +133,16 @@
  * @return {!Promise} a promise resolving as an JSON object containing the 
response
  */
 function getMobileViewMetadata(app, req) {
-const props = ['languagecount', 'thumb', 'image', 'id', 'revision', 
'description',
-'lastmodified', 'lastmodifiedby', 'normalizedtitle', 'displaytitle', 
'protection',
-'editable', 'namespace', 'pageprops', 'contentmodel'];
+const props = ['languagecount', 'image',
+// need gender
+'lastmodifiedby',
+'protection',
+'editable', 'contentmodel'];
 
 const query = apiParams({
 action: 'mobileview',
 page: req.params.title,
 prop: props.join('|'),
-pageprops: 'wikibase_item|disambiguation',
 thumbwidth: mwapi.LEAD_IMAGE_XL
 });
 return api.mwApiGet(app, req.params.domain, query)
@@ -158,12 +159,14 @@
  * @return {!Promise} a promise resolving as an JSON object containing the 
response
  */
 mwapi.getMetadata = function(app, req) {
-const props = ['coordinates'];
+const props = ['coordinates','pageprops', 'pageimages', 'pageterms', 
'revisions'];
 
 return getMobileViewMetadata(app, req)
   .then((mvResponse) => {
   const query = apiParams({
   action: 'query',
+  pageprops: 
'wikibase_item|disambiguation|displaytitle|normalizedtitle',
+  wbptterms: 'description',
   titles: req.params.title,
   prop: props.join('|')
   });
@@ -174,6 +177,8 @@
 const page = body.query && body.query.pages
 && body.query.pages[0];
 const coords = page && page.coordinates && page.coordinates[0];
+const revision = page && page.revisions && page.revisions[0];
+const pageprops = page && page.pageprops;
 
 // Extract coordinates from the API response
 if (coords) {
@@ -182,6 +187,17 @@
 longitude: coords.lon
 };
 }
+Object.assign(mvResponse.body.mobileview, {
+normalizedtitle: body.query && body.query.normalized && 
body.query.normalized.to,
+displaytitle: pageprops && pageprops.displaytitle,
+pageprops: pageprops,
+id: page.pageid,
+lastmodified: revision && revision.timestamp,
+thumbnail: page.thumbnail,
+ns: page.ns,
+revision: revision && revision.revid,
+terms: page.terms
+});
 
 return mvResponse;
 });

-- 
To view, visit https://gerrit.wikimedia.org/r/368959
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica94d831d18faf0d2a7f220c7a1277da14efa20a
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]: Source coordinates from GeoData

2017-07-31 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368954 )

Change subject: Source coordinates from GeoData
..

Source coordinates from GeoData

Rather than rely on Parsoid HTML, source geodata from
the query prop API. It's more future-proof given the adoption of
MediaWiki indicators 
(https://www.mediawiki.org/wiki/Help:Page_status_indicators)
and the fact that HTML markup can change.

This will help us commence removing the mobile view API call
(T103362)

Bug: T152441
Change-Id: Ifa8d271718475df5b950890ef3ca4c8f4e6e6794
---
M lib/mwapi.js
M lib/parseProperty.js
M lib/parsoid-access.js
M lib/transforms.js
M routes/mobile-sections.js
M test/features/mobile-sections-lead/pagecontent.js
6 files changed, 45 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/54/368954/1

diff --git a/lib/mwapi.js b/lib/mwapi.js
index 4396f52..8e363c9 100644
--- a/lib/mwapi.js
+++ b/lib/mwapi.js
@@ -126,11 +126,14 @@
 
 /**
  * Builds the request to get page metadata from MW API action=mobileview.
+ * The plan is to deprecate this method and usage of the mobileview api 
(T103362).
+ * Please use getMetaData and queries that do not hit the mobileview api.
+ *
  * @param {!Object} app the application object
  * @param {!Object} req the request object
  * @return {!Promise} a promise resolving as an JSON object containing the 
response
  */
-mwapi.getMetadata = function(app, req) {
+function getMobileViewMetadata(app, req) {
 const props = ['languagecount', 'thumb', 'image', 'id', 'revision', 
'description',
 'lastmodified', 'lastmodifiedby', 'normalizedtitle', 'displaytitle', 
'protection',
 'editable', 'namespace', 'pageprops', 'contentmodel'];
@@ -150,6 +153,43 @@
 };
 
 /**
+ * Builds the request to get page metadata from MW API action=query
+ * @param {!Object} app the application object
+ * @param {!Object} req the request object
+ * @return {!Promise} a promise resolving as an JSON object containing the 
response
+ */
+mwapi.getMetadata = function(app, req) {
+  const props = ['coordinates'];
+
+  return getMobileViewMetadata(app, req)
+.then((mvResponse) => {
+  const query = apiParams({
+  action: 'query',
+  titles: req.params.title,
+  prop: props.join('|')
+  });
+
+  return api.mwApiGet(app, req.params.domain, query)
+.then((apiResponse) => {
+  const body = apiResponse.body;
+  const page = body.query && body.query.pages
+&& body.query.pages[0];
+  const coords = page && page.coordinates && page.coordinates[0];
+
+  // Extract coordinates from the API response
+  if (coords) {
+mvResponse.body.mobileview.geo = {
+  latitude: coords.lat,
+  longitude: coords.lon
+};
+  }
+
+  return mvResponse;
+})
+});
+};
+
+/**
  * Builds the request to get all sections from MW API action=mobileview.
  * @param {!Object} app the application object
  * @param {!Object} req the request object
diff --git a/lib/parseProperty.js b/lib/parseProperty.js
index 8f38bef..4e49ac5 100644
--- a/lib/parseProperty.js
+++ b/lib/parseProperty.js
@@ -28,38 +28,6 @@
 }
 
 /**
- * @param {?string} latLngStr a string consisting of latitude and longitude. 
The values should be
- * separated by ; or , or space.
- * @return {?Geo} if latitude or longitude is truthy, else undefined.
- */
-function latLngStrToGeo(latLngStr) {
-const latLng = latLngStr && latLngStr.split(/[;, ]+/) || [];
-const geo = latLng.length &&
-{ latitude: latLng[0] && parseFloat(latLng[0]),
-longitude: latLng[1] && parseFloat(latLng[1]) };
-return mUtil.defaultVal(mUtil.filterEmpty(geo));
-}
-
-/**
- * Searches for Geo coordinates and adds them to the given page object
- */
-function parseGeo(lead, page) {
-let lat;
-let lng;
-let coordinates = lead.querySelector('span#coordinates .geo');
-let geo = coordinates && latLngStrToGeo(coordinates.textContent);
-if (!geo) {
-coordinates = lead.querySelector('#geoCoord .geo');
-lat = coordinates && coordinates.querySelector('.latitude');
-lng = coordinates && coordinates.querySelector('.longitude');
-geo = lat && lng && 
latLngStrToGeo(`${lat.textContent};${lng.textContent}`);
-}
-if (geo) {
-page.geo = geo;
-}
-}
-
-/**
  * Searches for Spoken Wikipedia audio files and adds them to the given page 
object.
  * 
https://en.wikipedia.org/wiki/Wikipedia:WikiProject_Spoken_Wikipedia/Template_guidelines
  */
@@ -98,6 +66,5 @@
 module.exports = {
 parseInfobox,
 parsePronunciation,
-parseSpokenWikipedia,
-parseGeo
+parseSpokenWikipedia
 };
diff --git a/lib/parsoid-access.js b/lib/parsoid-access.js
index 3cc4e6b..b6df4b8 100644
--- a/lib/parsoid-access.js
+++ b/lib/pa

[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: DRY: Save repetition of formatversion and format api parameters

2017-07-31 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368953 )

Change subject: DRY: Save repetition of formatversion and format api parameters
..

DRY: Save repetition of formatversion and format api parameters

Change-Id: Ie629cdbdcbf287c9c8c6111497a60a6cb63b102b
---
M lib/mwapi.js
1 file changed, 20 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/53/368953/1

diff --git a/lib/mwapi.js b/lib/mwapi.js
index 0ade581..4396f52 100644
--- a/lib/mwapi.js
+++ b/lib/mwapi.js
@@ -23,6 +23,18 @@
 
 mwapi.WIDTH_IN_IMAGE_URL_REGEX = /\/(\d+)px-/;
 
+/**
+ * Extends an object of keys for an api query with
+ * common api parameters.
+ * @param {!Object} query
+ * @return {!Object}
+ */
+function apiParams(query) {
+return Object.assign(query, {
+format: 'json',
+formatversion: 2
+});
+}
 
 mwapi.checkForMobileviewInResponse = function(logger, response) {
 if (!(response && response.body && response.body.mobileview)) {
@@ -89,13 +101,11 @@
 mwapi.getSiteInfo = function(app, req) {
 const rp = req.params;
 if (!siteInfoCache[rp.domain]) {
-const query = {
+const query = apiParams({
 action: 'query',
-format: 'json',
-formatversion: 2,
 meta: 'siteinfo',
 siprop: 'general|namespaces|namespacealiases|specialpagealiases'
-};
+});
 siteInfoCache[rp.domain] = api.mwApiGet(app, req.params.domain, query)
 .then((res) => {
 return {
@@ -125,15 +135,13 @@
 'lastmodified', 'lastmodifiedby', 'normalizedtitle', 'displaytitle', 
'protection',
 'editable', 'namespace', 'pageprops', 'contentmodel'];
 
-const query = {
+const query = apiParams({
 action: 'mobileview',
-format: 'json',
-formatversion: 2,
 page: req.params.title,
 prop: props.join('|'),
 pageprops: 'wikibase_item|disambiguation',
 thumbwidth: mwapi.LEAD_IMAGE_XL
-};
+});
 return api.mwApiGet(app, req.params.domain, query)
 .then((response) => {
 mwapi.checkForMobileviewInResponse(req.logger, response);
@@ -152,17 +160,15 @@
 'description', 'lastmodified', 'normalizedtitle', 'displaytitle', 
'protection',
 'editable'];
 
-const query = {
+const query = apiParams({
 action: 'mobileview',
-format: 'json',
-formatversion: 2,
 page: req.params.title,
 prop: props.join('|'),
 sections: 'all',
 sectionprop: 'toclevel|line|anchor',
 noheadings: true,
 thumbwidth: mwapi.LEAD_IMAGE_XL
-};
+});
 return api.mwApiGet(app, req.params.domain, query)
 .then((response) => {
 mwapi.checkForMobileviewInResponse(req.logger, response);
@@ -195,14 +201,12 @@
 };
 
 mwapi.getMostReadMetadata = function(app, req, titlesList) {
-const query = {
+const query = apiParams({
 action: 'query',
-format: 'json',
-formatversion: 2,
 meta: 'siteinfo',
 siprop: 'general',
 titles: titlesList
-};
+});
 return api.mwApiGet(app, req.params.domain, query);
 };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/368953
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie629cdbdcbf287c9c8c6111497a60a6cb63b102b
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...MinervaNeue[master]: QA: Minor tweaks to how we check toast notifications

2017-07-31 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368942 )

Change subject: QA: Minor tweaks to how we check toast notifications
..

QA: Minor tweaks to how we check toast notifications

A toast autohides within 5 seconds and its display properties are
inherited from #mw-notification-area. This slight tweak waits for
mw-notification-area to be visible before verifying toast and its
contents

Change-Id: I89beaf9d131155e958cc9aae84a9e30ffd8e9e4f
---
M tests/browser/features/step_definitions/common_article_steps.rb
M tests/browser/features/support/pages/article_page.rb
2 files changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/42/368942/1

diff --git a/tests/browser/features/step_definitions/common_article_steps.rb 
b/tests/browser/features/step_definitions/common_article_steps.rb
index 0e89e9e..089c896 100644
--- a/tests/browser/features/step_definitions/common_article_steps.rb
+++ b/tests/browser/features/step_definitions/common_article_steps.rb
@@ -27,7 +27,9 @@
 end
 
 Then(/^I should see a toast notification$/) do
-  expect(on(ArticlePage).toast_element.when_present(10)).to be_visible
+  # To avoid flakey tests check the notification area element first (T170890)
+  expect(on(ArticlePage)).notification_area_element.when_visible).to be_visible
+  expect(on(ArticlePage).toast_element.when_visible).to be_visible
 end
 
 Then(/^I should see a toast with message "(.+)"$/) do |msg|
diff --git a/tests/browser/features/support/pages/article_page.rb 
b/tests/browser/features/support/pages/article_page.rb
index 064e9a7..2b733ae 100644
--- a/tests/browser/features/support/pages/article_page.rb
+++ b/tests/browser/features/support/pages/article_page.rb
@@ -144,6 +144,7 @@
   div(:spinner_loading, class: 'spinner loading')
 
   # toast
+  div(:notification_area, id: 'mw-notification-area')
   div(:toast, class: 'mw-notification')
 
   # loader

-- 
To view, visit https://gerrit.wikimedia.org/r/368942
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89beaf9d131155e958cc9aae84a9e30ffd8e9e4f
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...mobileapps[master]: Fix pronounication portion of API

2017-07-28 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368526 )

Change subject: Fix pronounication portion of API
..

Fix pronounication portion of API

Bug:  T170325
Change-Id: I01d173f1ff54fd0719097772c8eb12072e9001c7
---
M lib/parseProperty.js
M test/features/mobile-sections-lead/pagecontent.js
2 files changed, 14 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/26/368526/1

diff --git a/lib/parseProperty.js b/lib/parseProperty.js
index 9bb5461..8625a02 100644
--- a/lib/parseProperty.js
+++ b/lib/parseProperty.js
@@ -22,7 +22,7 @@
 }
 
 function parsePronunciationFilePageUrls(doc) {
-const ipaFileWithExtensionPageUrlSelector = 'span.IPA a[href*=.]';
+const ipaFileWithExtensionPageUrlSelector = 'span.IPA a[href*=.], 
.metadata .haudio a[href]';
 return doc.querySelectorAll(ipaFileWithExtensionPageUrlSelector)
 .map((anchor) => {
 return anchor.getAttribute('href');
@@ -69,11 +69,15 @@
 
 function parsePronunciation(doc, title) {
 const pageUrls = parsePronunciationFilePageUrls(doc);
-const pageUrl = pageUrls && pickPronunciationFilePageUrl(pageUrls, title);
-const selector = pageUrl && filePageUrlToFileUrlSelector(pageUrl);
-const fileAnchor = selector && doc.querySelector(selector);
-const url = fileAnchor && fileAnchor.getAttribute('href');
-return url && { url };
+let url = pageUrls.filter((url) => url.match( /\/\// ));
+if(!url.length) {
+const pageUrl = pageUrls && pickPronunciationFilePageUrl(pageUrls, 
title);
+const selector = pageUrl && filePageUrlToFileUrlSelector(pageUrl);
+const fileAnchor = selector && doc.querySelector(selector);
+url = fileAnchor && fileAnchor.getAttribute('href');
+return url && { url };
+}
+return url;
 }
 
 /**
diff --git a/test/features/mobile-sections-lead/pagecontent.js 
b/test/features/mobile-sections-lead/pagecontent.js
index 020e4ba..f409371 100644
--- a/test/features/mobile-sections-lead/pagecontent.js
+++ b/test/features/mobile-sections-lead/pagecontent.js
@@ -138,8 +138,7 @@
 assert.ok(!{}.hasOwnProperty.call(lead, 'geo'));
 });
 });
-// T170325
-it.skip('Barack Obama should have a pronunciation', () => {
+it('Barack Obama should have a pronunciation', () => {
 const title = 'Barack_Obama';
 const uri = 
`${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/${title}`;
 const exp = 
'//upload.wikimedia.org/wikipedia/commons/8/82/En-us-Barack-Hussein-Obama.ogg';
@@ -159,8 +158,7 @@
   'The infobox has not been removed for backwards 
compatibility.');
 });
 });
-// T170325
-it.skip('Enwiki Uranus loads successfully (no pronunciation parsing 
TypeErrors)', () => {
+it('Enwiki Uranus loads successfully (no pronunciation parsing 
TypeErrors)', () => {
 const uri = 
`${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/Uranus`;
 const exp = 
'//upload.wikimedia.org/wikipedia/commons/1/1c/En-us-Uranus.ogg';
 return preq.get({ uri })
@@ -170,8 +168,7 @@
 assert.deepEqual(lead.pronunciation.url, exp);
 });
 });
-// T170325
-it.skip('Enwiki Odisha loads successfully (no pronunciation parsing 
TypeErrors)', () => {
+it('Enwiki Odisha loads successfully (no pronunciation parsing 
TypeErrors)', () => {
 const uri = 
`${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/Odisha`;
 const path = `//upload.wikimedia.org/wikipedia/commons/c/c2`;
 const exp = 
`${path}/Pronunciation_of_the_Odia_language_word_%22Odisha%22.ogg`;
@@ -182,8 +179,7 @@
 assert.deepEqual(lead.pronunciation.url, exp);
 });
 });
-// T170325
-it.skip('Enwiki Yazidis loads successfully (no pronunciation parsing 
TypeErrors)', () => {
+it('Enwiki Yazidis loads successfully (no pronunciation parsing 
TypeErrors)', () => {
 const uri = 
`${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/Yazidis`;
 const path = `//upload.wikimedia.org/wikipedia/commons/8/8d`;
 const exp = 
`${path}/En-us-Yazidis_from_Iraq_pronunciation_%28Voice_of_America%29.ogg`;

-- 
To view, visit https://gerrit.wikimedia.org/r/368526
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I01d173f1ff54fd0719097772c8eb12072e9001c7
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]: Fix broken tests (do not skip)

2017-07-28 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368520 )

Change subject: Fix broken tests (do not skip)
..

Fix broken tests (do not skip)

Skipping should only be used as a short term measure.
It's an anti-pattern - if tests are broken they should be either
fixed promptly or removed. They may be masking real bugs that
deserve debugging attention.

Since articles are living breathing documents these integration
tests should be run against the revisions they were written
against where possible.
This updates all queries to pass a known safe revision
to test against where this fixes the problem

"Page with IPA content" test is broken due to a change in
the underlying content. Let's fix that.

Where a test is being skipped because of an upstream problem
mark it with the bug number.

Change-Id: I6afd85f0f82df7d40ea7f84d0fa49a4fb6f3f94e
---
M test/features/mobile-sections-lead/pagecontent.js
M test/features/mobile-sections/pagecontent-v2.js
M test/features/mobile-sections/pagecontent.js
3 files changed, 21 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/20/368520/1

diff --git a/test/features/mobile-sections-lead/pagecontent.js 
b/test/features/mobile-sections-lead/pagecontent.js
index 95a612f..f0a1f9d 100644
--- a/test/features/mobile-sections-lead/pagecontent.js
+++ b/test/features/mobile-sections-lead/pagecontent.js
@@ -5,6 +5,9 @@
 const server = require('../../utils/server.js');
 const headers = require('../../utils/headers.js');
 
+const wikivoyageSectionsLead = 
'en.wikivoyage.org/v1/page/mobile-sections-lead/';
+const wikiSectionsLead = 'en.wikipedia.org/v1/page/mobile-sections-lead/';
+
 describe('mobile-sections-lead', function() {
 
 this.timeout(2); // eslint-disable-line no-invalid-this
@@ -118,9 +121,9 @@
 assert.deepEqual(lead.geo.longitude, 28.88305556);
 });
 });
-// TODO: FIX OR REMOVE
-it.skip('Wikivoyage en Paris should have a lead object with a geo 
property', () => {
-const uri = 
`${server.config.uri}en.wikivoyage.org/v1/page/mobile-sections-lead/Paris`;
+it('Wikivoyage en Paris should have a lead object with a geo property', () 
=> {
+const rev = 3092864;
+const uri = 
`${server.config.uri}${wikivoyageSectionsLead}Paris/${rev}`;
 return preq.get({ uri })
 .then((res) => {
 const lead = res.body;
@@ -136,6 +139,7 @@
 assert.ok(!{}.hasOwnProperty.call(lead, 'geo'));
 });
 });
+// T170325
 it.skip('Barack Obama should have a pronunciation', () => {
 const title = 'Barack_Obama';
 const uri = 
`${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/${title}`;
@@ -156,6 +160,7 @@
   'The infobox has not been removed for backwards 
compatibility.');
 });
 });
+// T170325
 it.skip('Enwiki Uranus loads successfully (no pronunciation parsing 
TypeErrors)', () => {
 const uri = 
`${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/Uranus`;
 const exp = 
'//upload.wikimedia.org/wikipedia/commons/1/1c/En-us-Uranus.ogg';
@@ -166,6 +171,7 @@
 assert.deepEqual(lead.pronunciation.url, exp);
 });
 });
+// T170325
 it.skip('Enwiki Odisha loads successfully (no pronunciation parsing 
TypeErrors)', () => {
 const uri = 
`${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/Odisha`;
 const path = `//upload.wikimedia.org/wikipedia/commons/c/c2`;
@@ -177,6 +183,7 @@
 assert.deepEqual(lead.pronunciation.url, exp);
 });
 });
+// T170325
 it.skip('Enwiki Yazidis loads successfully (no pronunciation parsing 
TypeErrors)', () => {
 const uri = 
`${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/Yazidis`;
 const path = `//upload.wikimedia.org/wikipedia/commons/8/8d`;
@@ -208,9 +215,9 @@
 Actual text ${res.body.sections[0].text}`);
 });
 });
-it.skip('Enwiki hatnotes are promoted to the lead object', () => {
+it('Enwiki hatnotes are promoted to the lead object', () => {
 const title = `Chivalric%20order`;
-const uri = 
`${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/${title}`;
+const uri = 
`${server.config.uri}${wikiSectionsLead}${title}/699553745`;
 const anchor = ``;
 return preq.get({ uri })
 .then((res) => {
diff --git a/test/features/mobile-sections/pagecontent-v2.js 
b/test/features/mobile-sections/pagecontent-v2.js
index 5194690..0fbcb63 100644
--- a/test/features/mobile-sections/pagecontent-v2.js
+++ b/test/features/mobile-sections/pagecontent-v2.js
@@ -41,8 +41,9 @@
});
 });
 
-it.skip('Hatnotes do not appear

[MediaWiki-commits] [Gerrit] mediawiki...RelatedArticles[master]: WIP: Having 2 folders for browser tests is confusing.

2017-07-28 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368457 )

Change subject: WIP: Having 2 folders for browser tests is confusing.
..

WIP: Having 2 folders for browser tests is confusing.

Should we move LocalSettings to tests/selenium ?
Is ci.yml and environments.yml still needed? IF so can they
also live in tests/selenium

Bug: T164024
Change-Id: Ifec8bf2b3cd7d4db105c254248cdfcdf773472ef
---
D tests/browser/LocalSettings.php
D tests/browser/README.mediawiki
D tests/browser/ci.yml
D tests/browser/environments.yml
4 files changed, 0 insertions(+), 127 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RelatedArticles 
refs/changes/57/368457/1

diff --git a/tests/browser/LocalSettings.php b/tests/browser/LocalSettings.php
deleted file mode 100644
index 968379d..000
--- a/tests/browser/LocalSettings.php
+++ /dev/null
@@ -1,7 +0,0 @@
-https://rvm.io/) and on
-Windows RubyInstaller (http://rubyinstaller.org/).
-
-Open terminal in tests/browser. Update RubyGems and install required
-gems with:
-
-  gem update --system
-  gem install bundler
-  bundle install
-
-Environment variables MEDIAWIKI_USER and MEDIAWIKI_PASSWORD are required for
-tests tagged `@login`. For local testing, create a test user on your local wiki
-and export the user and password as the values for those variables.
-For example:
-
-  export MEDIAWIKI_USER= # Linux/Unix/Mac
-  set MEDIAWIKI_USER= # Windows
-
-  export MEDIAWIKI_PASSWORD= # Linux/Unix/Mac
-  set MEDIAWIKI_PASSWORD= # Windows
-
-In addition to this create another user which will be reserved for new uploads
-"Selenium_newuser". The password for this user should be the same as
-MEDIAWIKI_PASSWORD
-
-Tests that use the "Given I create a random page using the API" step need to 
set
-the MEDIAWIKI_API_URL environment variable, e.g.
-export MEDIAWIKI_API_URL=http://en.wikipedia.beta.wmflabs.org/w/api.php
-
-Run the tests from the RelatedArticles directory with:
-
-  make cucumber
-
-If you want to run a single set of tests, go to the tests/browser directory and
-call 'bundle exec cucumber' with the path to the test file. For example, to run
-only the watchlist tests:
-
-  bundle exec cucumber features/read_more_desktop.feature
-
-XML report (for Jenkins) is created at tests/browser/reports/junit.
-
-Jenkins is hosted at https://wmf.ci.cloudbees.com/ and it drives
-browsers at http://saucelabs.com/
-
-For more information about running Selenium tests please see
-https://github.com/wikimedia/mediawiki-selenium
diff --git a/tests/browser/ci.yml b/tests/browser/ci.yml
deleted file mode 100644
index 59db8be..000
--- a/tests/browser/ci.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-BROWSER:
-  - chrome
-
-MEDIAWIKI_ENVIRONMENT:
-  - beta-desktop
-  - beta-mobile
-
-PLATFORM:
-  - Linux
diff --git a/tests/browser/environments.yml b/tests/browser/environments.yml
deleted file mode 100644
index dc42d7f..000
--- a/tests/browser/environments.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-# Customize this configuration as necessary to provide defaults for various
-# test environments.
-#
-# The set of defaults to use is determined by the MEDIAWIKI_ENVIRONMENT
-# environment variable.
-#
-#   export MEDIAWIKI_ENVIRONMENT=mw-vagrant-host
-#   bundle exec cucumber
-#
-# Additional variables set by the environment will override the corresponding
-# defaults defined here.
-#
-#   export MEDIAWIKI_ENVIRONMENT=mw-vagrant-host
-#   export MEDIAWIKI_USER=Selenium_user2
-#   bundle exec cucumber
-#
-mw-vagrant-host: &default
-  mediawiki_url: http://127.0.0.1:8080/wiki/
-  user_factory: true
-
-barry:
-  browser: phantomjs
-  user_factory: false
-  # mediawiki_url: Will be set manually
-
-mw-vagrant-guest:
-  mediawiki_url: http://127.0.0.1/wiki/
-  user_factory: true
-
-beta-desktop:
-  mediawiki_url: https://en.wikipedia.beta.wmflabs.org/wiki/
-  mediawiki_user: Selenium_user
-  # mediawiki_password: SET THIS IN THE ENVIRONMENT!
-
-beta-mobile:
-  mediawiki_url: https://en.m.wikipedia.beta.wmflabs.org/wiki/
-  mediawiki_user: Selenium_user
-  # mediawiki_password: SET THIS IN THE ENVIRONMENT!
-
-staging:
-  mediawiki_url: http://reading-web-staging.wmflabs.org/wiki/
-  mediawiki_user: Selenium_user
-  # mediawiki_password: SET THIS IN THE ENVIRONMENT!
-
-test2:
-  mediawiki_url: https://test2.wikipedia.org/wiki/
-  mediawiki_user: Selenium_user
-  # mediawiki_password: SET THIS IN THE ENVIRONMENT!
-
-integration:
-  browser: chrome
-  user_factory: true
-  # mediawiki_url: JENKINS WILL SET THIS
-
-default: *default

-- 
To view, visit https://gerrit.wikimedia.org/r/368457
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifec8bf2b3cd7d4db105c254248cdfcdf773472ef
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RelatedArticles
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

___

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: MwContentProvider should honour the skin name

2017-07-28 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368452 )

Change subject: MwContentProvider should honour the skin name
..

MwContentProvider should honour the skin name

As we've discovered the skin being used can impact the parse.
This removes the annoying edit link that has been showing up while
we test the Vector skin.

Change-Id: I4a7801092d0f626d115043d062e8337689f7f8ee
---
M includes/content-providers/ContentProviderFactory.php
M includes/content-providers/MwApiContentProvider.php
2 files changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/52/368452/1

diff --git a/includes/content-providers/ContentProviderFactory.php 
b/includes/content-providers/ContentProviderFactory.php
index 43f36f0..7da09d2 100644
--- a/includes/content-providers/ContentProviderFactory.php
+++ b/includes/content-providers/ContentProviderFactory.php
@@ -29,8 +29,9 @@
 
switch ( $contentProviderClass ) {
case self::MW_API:
+   $skinName = $out->getSkin()->getSkinName();
$baseUrl = $config->get( 
'MFMwApiContentProviderBaseUri' );
-   return new $contentProviderClass( $baseUrl, 
$out );
+   return new $contentProviderClass( $baseUrl, 
$out, $skinName );
case self::PHP_PARSER:
return new $contentProviderClass( $html ? $html 
: $out->getHTML() );
default:
diff --git a/includes/content-providers/MwApiContentProvider.php 
b/includes/content-providers/MwApiContentProvider.php
index 0335948..8e9e399 100644
--- a/includes/content-providers/MwApiContentProvider.php
+++ b/includes/content-providers/MwApiContentProvider.php
@@ -13,10 +13,12 @@
 *
 * @param string $baseUrl for the MediaWiki API to be used minus query 
string e.g. /w/api.php
 * @param OutputPage $out so that the ResourceLoader modules specific 
to the page can be added
+* @param string $skinName the skin name the content is being provided 
for
 */
-   public function __construct( $baseUrl, OutputPage $out ) {
+   public function __construct( $baseUrl, OutputPage $out, $skinName ) {
$this->baseUrl = $baseUrl;
$this->out = $out;
+   $this->skinName = $skinName;
}
 
/**
@@ -27,6 +29,7 @@
$title = $out->getTitle();
$url = $this->baseUrl . 
'?formatversion=2&format=json&action=parse&prop=text|modules&page=';
$url .= $title->getPrefixedDBKey();
+   $url .= '&useskin=' . $this->skinName;
 
$resp = file_get_contents( $url, false );
$json = json_decode( $resp, true );

-- 
To view, visit https://gerrit.wikimedia.org/r/368452
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a7801092d0f626d115043d062e8337689f7f8ee
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/core[master]: Allow blacklisting certain namespaces in Special:ShortPages

2017-07-27 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368325 )

Change subject: Allow blacklisting certain namespaces in Special:ShortPages
..

Allow blacklisting certain namespaces in Special:ShortPages

This new config variable ($wgShortPagesNamespaceBlacklist)
allows wikis to specify namespaces which should be excluded from
Special:ShortPages.

This will be used by Commons, for which NS_FILE is a content namespace
(accessible via Special:Random and Special:Nearby) but is not useful
to list on Special:ShortPages.

If the blacklist cancels out all namespace in wgContentNamespaces then
all namespaces will show up on the page.

Bug: T170687
Change-Id: I10b4849a5d7f3f8af75ccc6cfba230d03725c898
---
M includes/DefaultSettings.php
M includes/specials/SpecialShortpages.php
2 files changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/25/368325/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 74d5fa4..2fcf6ad 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -4089,7 +4089,14 @@
  * contain "content" which should be considered when generating a count of the
  * number of articles in the wiki.
  */
-$wgContentNamespaces = [ NS_MAIN ];
+$wgContentNamespaces = [];
+
+/**
+ * Optional array of namespaces which should be blacklisted from 
Special:ShortPages
+ * Only pages inside $wgContentNamespaces but not 
$wgShortPagesNamespaceBlacklist will
+ * be shown on that page.
+ */
+$wgShortPagesNamespaceBlacklist = [];
 
 /**
  * Array of namespaces, in addition to the talk namespaces, where signatures
diff --git a/includes/specials/SpecialShortpages.php 
b/includes/specials/SpecialShortpages.php
index f980e71..e9c15e7 100644
--- a/includes/specials/SpecialShortpages.php
+++ b/includes/specials/SpecialShortpages.php
@@ -41,9 +41,11 @@
}
 
public function getQueryInfo() {
+   $config = $this->getConfig();
+   $blacklist = $config->get( 'ShortPagesNamespaceBlacklist' );
$tables = [ 'page' ];
$conds = [
-   'page_namespace' => MWNamespace::getContentNamespaces(),
+   'page_namespace' => array_diff( 
MWNamespace::getContentNamespaces(), $blacklist ),
'page_is_redirect' => 0
];
$joinConds = [];

-- 
To view, visit https://gerrit.wikimedia.org/r/368325
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I10b4849a5d7f3f8af75ccc6cfba230d03725c898
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]: Code review session: DONOTMERGE

2017-07-27 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368314 )

Change subject: Code review session: DONOTMERGE
..

Code review session: DONOTMERGE

Please comment on the lines of code in this patch.
The purpose is to discuss the frontend architecure of
MobileFrontend and improve understanding and ultimately
improve the code.

Change-Id: I8234245d69c85852a77c07a8de0e60183ba84dc8
---
D resources/mobile.talk.overlays/TalkOverlay.js
D resources/mobile.talk.overlays/TalkSectionAddOverlay.js
2 files changed, 0 insertions(+), 339 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/14/368314/1

diff --git a/resources/mobile.talk.overlays/TalkOverlay.js 
b/resources/mobile.talk.overlays/TalkOverlay.js
deleted file mode 100644
index f0c4cdb..000
--- a/resources/mobile.talk.overlays/TalkOverlay.js
+++ /dev/null
@@ -1,158 +0,0 @@
-( function ( M, $ ) {
-   var TalkOverlayBase = M.require( 'mobile.talk.overlays/TalkOverlayBase' 
),
-   Page = M.require( 'mobile.startup/Page' ),
-   Anchor = M.require( 'mobile.startup/Anchor' ),
-   user = M.require( 'mobile.startup/user' );
-   /**
-* Overlay for talk page
-* @extends Overlay
-* @class TalkOverlay
-* @uses Page
-* @uses TalkSectionOverlay
-* @uses TalkSectionAddOverlay
-*/
-   function TalkOverlay() {
-   TalkOverlayBase.apply( this, arguments );
-   }
-
-   OO.mfExtend( TalkOverlay, TalkOverlayBase, {
-   templatePartials: $.extend( {}, 
TalkOverlayBase.prototype.templatePartials, {
-   content: mw.template.get( 'mobile.talk.overlays', 
'content.hogan' )
-   } ),
-   /**
-* @inheritdoc
-* @cfg {Object} defaults Default options hash.
-* @cfg {Array} defaults.headings A list of {Section} objects 
to render heading links
-* for. If not set ajax request will be performed.
-* @cfg {string} defaults.heading Heading for talk overlay.
-* @cfg {string} defaults.leadHeading Heading for a discussion 
which has no heading
-* (lead section of talk page).
-* @cfg {string} defaults.headerButtonsListClassName Class name 
of the header buttons
-* list
-* @cfg {Array} defaults.headerButtons Objects that will be 
used as defaults for
-* generating header buttons. Default list includes an 'add' 
button, which opens
-* a new talk overlay.
-*/
-   defaults: $.extend( {}, TalkOverlayBase.prototype.defaults, {
-   headings: undefined,
-   heading: '' + mw.msg( 
'mobile-frontend-talk-overlay-header' ) + '',
-   leadHeading: mw.msg( 
'mobile-frontend-talk-overlay-lead-header' ),
-   headerButtonsListClassName: 'header-action',
-   headerButtons: [ {
-   href: '#/talk/new',
-   className: 'add continue hidden',
-   msg: mw.msg( 
'mobile-frontend-talk-add-overlay-submit' )
-   } ],
-   footerAnchor: new Anchor( {
-   progressive: true,
-   additionalClassNames: 'footer-link 
talk-fullpage',
-   label: mw.msg( 'mobile-frontend-talk-fullpage' )
-   } ).options
-   } ),
-
-   /** @inheritdoc */
-   postRender: function () {
-   TalkOverlayBase.prototype.postRender.apply( this );
-   this.$board = this.$( '.board' );
-   this.$( '.talk-fullpage' ).attr( 'href', 
mw.util.getUrl( this.options.title ) )
-   .removeClass( 'hidden' );
-   if ( !this.options.headings ) {
-   this._loadContent( this.options );
-   }
-   this._setupAddDiscussionButton( this.options );
-   this.showHidden( '.initial-header' );
-   },
-
-   /**
-* Show a loading spinner
-* @method
-*/
-   showSpinner: function () {
-   this.$board.hide();
-   TalkOverlayBase.prototype.showSpinner.apply( this, 
arguments );
-   },
-
-   /**
-* Hide the loading spinner
-* @method
-*/
-   clearSpinner: function () {
-   TalkOverlayBase.prototype.clearSpinner.apply( this, 
arguments );
-   this.$board.show(

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mediawiki.legacy.shared can be run in mobile target

2017-07-27 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368313 )

Change subject: mediawiki.legacy.shared can be run in mobile target
..

mediawiki.legacy.shared can be run in mobile target

Minerva explicitly disables it
These are needed for rendering for:
?useformat=mobile&useskin=vector

Change-Id: I759c023b4ce63186929b893953042fc0a5059aa2
---
M resources/Resources.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/13/368313/1

diff --git a/resources/Resources.php b/resources/Resources.php
index f725efe..64ecc96 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -2239,6 +2239,7 @@
],
// Used in the web installer. Test it after modifying this definition!
'mediawiki.legacy.shared' => [
+   'targets' => [ 'desktop', 'mobile' ],
'styles' => [
'resources/src/mediawiki.legacy/shared.css' => [ 
'media' => 'screen' ]
],

-- 
To view, visit https://gerrit.wikimedia.org/r/368313
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I759c023b4ce63186929b893953042fc0a5059aa2
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[master]: Blank parsoid styles, update thumbnail selectors for Parsoid...

2017-07-27 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368306 )

Change subject: Blank parsoid styles, update thumbnail selectors for Parsoid 
content
..

Blank parsoid styles, update thumbnail selectors for Parsoid content

This brings Parsoid styles when viewed in Minerva consistent with
MediaWiki parser output styles.

Bug: T171727
Change-Id: If4bd7671a99aefdf074061dd1d5b0bac93620e9e
---
M resources/skins.minerva.content.styles/thumbnails.less
M resources/skins.minerva.tablet.styles/common.less
M skin.json
3 files changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/06/368306/1

diff --git a/resources/skins.minerva.content.styles/thumbnails.less 
b/resources/skins.minerva.content.styles/thumbnails.less
index 5533068..1f2858e 100644
--- a/resources/skins.minerva.content.styles/thumbnails.less
+++ b/resources/skins.minerva.content.styles/thumbnails.less
@@ -13,6 +13,7 @@
 //
 // Styleguide 1.2.
 .content {
+   figure,
.thumb {
margin: 0.6em 0;
 
@@ -24,12 +25,16 @@
}
}
 
+   figcaption,
.thumbcaption {
margin: 0.5em 0 0;
font-size: 0.8em;
line-height: 1.5;
padding: 0 !important;
color: @grayMediumDark;
+   }
+
+   .thumbcaption {
width: auto !important;
}
 
diff --git a/resources/skins.minerva.tablet.styles/common.less 
b/resources/skins.minerva.tablet.styles/common.less
index 2f4fefa..8274c19 100644
--- a/resources/skins.minerva.tablet.styles/common.less
+++ b/resources/skins.minerva.tablet.styles/common.less
@@ -90,7 +90,11 @@
// e.g. [[File:Scholars mate 
animation.gif|frame|left|"[[Scholar's mate]]"]]
// We use @noflip because we still want .tleft to be on the 
left and
// .tright to be on the right in RTL languages.
+   figure,
.thumb {
+   width: 320px;
+
+   &.mw-halign-left,
&.tleft {
/* @noflip */
float: left;
@@ -100,6 +104,8 @@
margin-right: 1.4em;
}
 
+   &.mw-default-size,
+   &.mw-halign-right,
&.tright {
/* @noflip */
float: right;
diff --git a/skin.json b/skin.json
index 5bb2f25..41956f9 100644
--- a/skin.json
+++ b/skin.json
@@ -36,6 +36,7 @@
},
"ResourceModuleSkinStyles": {
"minerva": {
+   "mediawiki.skinning.content.parsoid": [],
"mediawiki.hlist": [
"skinStyles/mediawiki.hlist/minerva.less"
],

-- 
To view, visit https://gerrit.wikimedia.org/r/368306
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4bd7671a99aefdf074061dd1d5b0bac93620e9e
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]: Allow content to be sourced from Parsoid

2017-07-27 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368287 )

Change subject: Allow content to be sourced from Parsoid
..

Allow content to be sourced from Parsoid

This helps with testing Apps related bugs and Parsoid related
bugs e.g. T171727

To use:
$wgMFContentProviderClass = 
'MobileFrontend\ContentProviders\McsContentProvider';
$wgMFMcsContentProviderBaseUri = "https://en.wikipedia.org/api/rest_v1";;

Change-Id: I648ed26e1826aaca4d6616097fdfc3019ca7a848
---
M extension.json
M includes/content-providers/ContentProviderFactory.php
A includes/content-providers/McsContentProvider.php
3 files changed, 60 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/87/368287/1

diff --git a/extension.json b/extension.json
index ef0f5c1..c08fd65 100644
--- a/extension.json
+++ b/extension.json
@@ -86,6 +86,7 @@
"MobileFrontend\\ContentProviders\\ContentProviderFactory": 
"includes/content-providers/ContentProviderFactory.php",
"MobileFrontend\\ContentProviders\\DefaultContentProvider": 
"includes/content-providers/DefaultContentProvider.php",
"MobileFrontend\\ContentProviders\\IContentProvider": 
"includes/content-providers/IContentProvider.php",
+   "MobileFrontend\\ContentProviders\\McsContentProvider": 
"includes/content-providers/McsContentProvider.php",
"MobileFrontend\\ContentProviders\\MwApiContentProvider": 
"includes/content-providers/MwApiContentProvider.php"
},
"ResourceModules": {
diff --git a/includes/content-providers/ContentProviderFactory.php 
b/includes/content-providers/ContentProviderFactory.php
index 43f36f0..8017fea 100644
--- a/includes/content-providers/ContentProviderFactory.php
+++ b/includes/content-providers/ContentProviderFactory.php
@@ -8,6 +8,7 @@
 class ContentProviderFactory {
const MW_API = 'MobileFrontend\\ContentProviders\\MwApiContentProvider';
const PHP_PARSER = 
'MobileFrontend\\ContentProviders\\DefaultContentProvider';
+   const MCS_API = 'MobileFrontend\\ContentProviders\\McsContentProvider';
 
/**
 * Create an instance of IContentProvider
@@ -28,6 +29,9 @@
}
 
switch ( $contentProviderClass ) {
+   case self::MCS_API:
+   $baseUrl = $config->get( 
'MFMcsContentProviderBaseUri' );
+   return new $contentProviderClass( $baseUrl, 
$out );
case self::MW_API:
$baseUrl = $config->get( 
'MFMwApiContentProviderBaseUri' );
return new $contentProviderClass( $baseUrl, 
$out );
diff --git a/includes/content-providers/McsContentProvider.php 
b/includes/content-providers/McsContentProvider.php
new file mode 100644
index 000..59380e7
--- /dev/null
+++ b/includes/content-providers/McsContentProvider.php
@@ -0,0 +1,55 @@
+baseUrl = $baseUrl;
+   $this->out = $out;
+   }
+
+   /**
+* @inheritdoc
+*/
+   public function getHTML() {
+   $out = $this->out;
+   $title = $out->getTitle();
+   $url = $this->baseUrl . '/page/mobile-sections/';
+   $url .= $title->getPrefixedDBKey();
+
+   $resp = file_get_contents( $url, false );
+   $json = json_decode( $resp, true );
+   if ( !is_bool( $json ) ) {
+   $lead = $json['lead'];
+   $html = isset( $lead['sections'][0]['text'] ) ? 
$lead['sections'][0]['text'] : '';
+
+   $remaining = $json['remaining'];
+
+   foreach( $remaining['sections'] as $section ) {
+   if ( isset( $section['line'] ) ) {
+   $toc = $section['toclevel'] + 1;
+   $line = $section['line'];
+   $html .= "$line";
+   }
+   if ( isset( $section['text'] ) ) {
+   $html .= $section['text'];
+   }
+   }
+
+   return $html;
+   } else {
+   return '';
+   }
+   }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/368287
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I648ed26e1826aaca4d6616097fdfc3019ca7a848
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-c

[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Browser tests: Use generic toast step

2017-07-27 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368260 )

Change subject: Browser tests: Use generic toast step
..

Browser tests: Use generic toast step

Change-Id: Ic8b91c78f6df088244f15223ee4ed658847a05b5
---
M tests/browser/features/search_loggedin.feature
M tests/browser/features/step_definitions/search_steps.rb
2 files changed, 1 insertion(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/60/368260/1

diff --git a/tests/browser/features/search_loggedin.feature 
b/tests/browser/features/search_loggedin.feature
index 52cc5e9..291fe8e 100644
--- a/tests/browser/features/search_loggedin.feature
+++ b/tests/browser/features/search_loggedin.feature
@@ -12,4 +12,4 @@
   And I see the search overlay
   And I type into search box "Selenium search tes"
 When I click a search watch star
-Then I should see a toast
+Then I should see a toast notification
diff --git a/tests/browser/features/step_definitions/search_steps.rb 
b/tests/browser/features/step_definitions/search_steps.rb
index bd89290..3420aac 100644
--- a/tests/browser/features/step_definitions/search_steps.rb
+++ b/tests/browser/features/step_definitions/search_steps.rb
@@ -78,7 +78,3 @@
 Then(/^I should not see '#\/search' in URL$/) do
   expect(on(ArticlePage).current_url.end_with? '#/search').to be false
 end
-
-Then(/^I should see a toast$/) do
-  expect(on(ArticlePage).toast_element.when_present).to be_visible
-end

-- 
To view, visit https://gerrit.wikimedia.org/r/368260
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8b91c78f6df088244f15223ee4ed658847a05b5
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] operations/mediawiki-config[master]: Compute list of English Wikipedia logos

2017-07-27 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368237 )

Change subject: Compute list of English Wikipedia logos
..

Compute list of English Wikipedia logos

Change-Id: I002e8f774dae145b26a0dea7bf3420111aa6fe29
---
A dblists/wikipedia-english-computed.dblist
A docroot/noc/conf/wikipedia-english-computed.dblist
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
4 files changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/37/368237/1

diff --git a/dblists/wikipedia-english-computed.dblist 
b/dblists/wikipedia-english-computed.dblist
new file mode 100644
index 000..c4f44a7
--- /dev/null
+++ b/dblists/wikipedia-english-computed.dblist
@@ -0,0 +1 @@
+%% wikipedia.dblist - wikipedia-e-acute.dblist - wikipedia-devanagari.dblist - 
wikipedia-cyrillic.dblist
diff --git a/docroot/noc/conf/wikipedia-english-computed.dblist 
b/docroot/noc/conf/wikipedia-english-computed.dblist
new file mode 12
index 000..a063a64
--- /dev/null
+++ b/docroot/noc/conf/wikipedia-english-computed.dblist
@@ -0,0 +1 @@
+../../../dblists/wikipedia-english-computed.dblist
\ No newline at end of file
diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 679e3f6..c378e13 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -177,6 +177,7 @@
'commonsuploads', 'nonbetafeatures', 'group0', 
'group1', 'group2', 'wikipedia', 'nonglobal',
'wikitech', 'nonecho', 'mobilemainpagelegacy', 
'compact-language-links',
'wikipedia-cyrillic', 'wikipedia-e-acute', 
'wikipedia-devanagari',
+   'wikipedia-english',
'nowikidatadescriptiontaglines',
'related-articles-footer-blacklisted-skins',
'top6-wikipedia'
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index cae9569..0a53f11 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15360,7 +15360,7 @@
 
 'wgMinervaCustomLogos' => [
'default' => [],
-   'wikipedia' => [
+   'wikipedia-english' => [
'copyright' => 
'/static/images/mobile/copyright/wikipedia-wordmark-en.svg',
'copyright-width' => 116,
'copyright-height' => 18,

-- 
To view, visit https://gerrit.wikimedia.org/r/368237
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I002e8f774dae145b26a0dea7bf3420111aa6fe29
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] operations/mediawiki-config[master]: Define custom logos using wmg

2017-07-27 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368236 )

Change subject: Define custom logos using wmg
..

Define custom logos using wmg

The merge strategy of arrays is problematic. To avoid
dblist entry and generic 'wikipedia' entry not merging
appropriately, set the variable explicitly

Change-Id: Idde0722f640a5537d0aa9173028374000e54e68f
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/36/368236/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 679e3f6..4a93647 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2924,6 +2924,10 @@
}
 }
 
+// wmgMinervaCustomLogos is an array. To ensure default does not get merged
+// with a dblist we need to define it like so.
+$wgMinervaCustomLogos = $wmgMinervaCustomLogos;
+
 // Workaround for T142663 - override flat arrays
 $wgExtensionFunctions[] = function () {
global $wmgRelatedArticlesFooterWhitelistedSkins, 
$wgRelatedArticlesFooterWhitelistedSkins;
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 0a6135e..10ba68a 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15358,7 +15358,7 @@
'wikitech' => true, // Not behind Varnish
 ],
 
-'wgMinervaCustomLogos' => [
+'wmgMinervaCustomLogos' => [
'default' => [],
'wikipedia' => [
'copyright' => 
'/static/images/mobile/copyright/wikipedia-wordmark-en.svg',

-- 
To view, visit https://gerrit.wikimedia.org/r/368236
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idde0722f640a5537d0aa9173028374000e54e68f
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/core[master]: Run stylelint in `npm test`

2017-07-27 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368202 )

Change subject: Run stylelint in `npm test`
..

Run stylelint in `npm test`

This ensures Jenkin will complain if stylelint errors are
introduced to the codebase.

Change-Id: I29b6134da2eb26333be63a3f885d1d2384711478
---
M Gruntfile.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/02/368202/1

diff --git a/Gruntfile.js b/Gruntfile.js
index 811d2c0..027d56b 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -143,6 +143,6 @@
grunt.registerTask( 'lint', [ 'eslint', 'banana', 'stylelint' ] );
grunt.registerTask( 'qunit', [ 'assert-mw-env', 'karma:main' ] );
 
-   grunt.registerTask( 'test', [ 'lint' ] );
+   grunt.registerTask( 'test', [ 'lint', 'stylelint' ] );
grunt.registerTask( 'default', 'test' );
 };

-- 
To view, visit https://gerrit.wikimedia.org/r/368202
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29b6134da2eb26333be63a3f885d1d2384711478
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]: DONOTMERGE: testing someting

2017-07-26 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368115 )

Change subject: DONOTMERGE: testing someting
..

DONOTMERGE: testing someting

Change-Id: I6908872ece922772ddcf5f22daae6bb61ab8ddaa
---
M resources/mobile.startup/toast.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/15/368115/1

diff --git a/resources/mobile.startup/toast.js 
b/resources/mobile.startup/toast.js
index 91687af..59a91dc 100644
--- a/resources/mobile.startup/toast.js
+++ b/resources/mobile.startup/toast.js
@@ -28,7 +28,7 @@
}
 
options = $.extend( {
-   tag: 'toast'
+   tag: 'toast toast-class'
}, options );
 
this.notification = mw.notify( msg, options );

-- 
To view, visit https://gerrit.wikimedia.org/r/368115
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6908872ece922772ddcf5f22daae6bb61ab8ddaa
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]: Hygiene: Toast selector should be more flexible

2017-07-26 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368114 )

Change subject: Hygiene: Toast selector should be more flexible
..

Hygiene: Toast selector should be more flexible

A toast can carry other classes.
I have a hunch that using class here is wrong as class will not
match a toast with other classes.

Bug: T170890
Change-Id: I9fbb21f8d262890d4c9d2a508351f33fe2023297
---
M tests/browser/features/support/pages/article_page.rb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/14/368114/1

diff --git a/tests/browser/features/support/pages/article_page.rb 
b/tests/browser/features/support/pages/article_page.rb
index 064e9a7..e7c14e8 100644
--- a/tests/browser/features/support/pages/article_page.rb
+++ b/tests/browser/features/support/pages/article_page.rb
@@ -144,7 +144,7 @@
   div(:spinner_loading, class: 'spinner loading')
 
   # toast
-  div(:toast, class: 'mw-notification')
+  div(:toast, css: '.mw-notification')
 
   # loader
   div(:content_wrapper, id: 'content')

-- 
To view, visit https://gerrit.wikimedia.org/r/368114
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9fbb21f8d262890d4c9d2a508351f33fe2023297
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]: DONOTMERGE: Remove main page special casing code

2017-07-26 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368109 )

Change subject: DONOTMERGE: Remove main page special casing code
..

DONOTMERGE: Remove main page special casing code

Change-Id: I1c23fce015fd058eff6766b95e85db1befe4b3eb
---
M README.md
M extension.json
M includes/MobileFormatter.php
M includes/api/ApiMobileView.php
4 files changed, 4 insertions(+), 155 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/09/368109/1

diff --git a/README.md b/README.md
index 07b303d..ae0385b 100644
--- a/README.md
+++ b/README.md
@@ -213,19 +213,6 @@
 * Type: `Array`
 * Default: `['h1', 'h2', 'h3', 'h4', 'h5', 'h6']`
 
- $wgMFSpecialCaseMainPage
-
-If set to true, main page HTML will receive special massaging.
-
-See 
-
-Use is discouraged as it leads to unnecessary technical debt and on the long
-term the goal is to deprecate usage of this config variable. Use at your own
-risk!
-
-* Type: `Boolean`
-* Default: `false`
-
  $wgMFMobileHeader
 
 Requests containing header with this name will be considered as coming from
diff --git a/extension.json b/extension.json
index e80cc56..d79b9b3 100644
--- a/extension.json
+++ b/extension.json
@@ -1281,7 +1281,6 @@
"h5",
"h6"
],
-   "MFSpecialCaseMainPage": false,
"MFMobileHeader": "X-Subdomain",
"MFRemovableClasses": {
"beta": [],
diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index 53ab00d..8b5a34b 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -58,11 +58,6 @@
 * @var boolean $expandableSections
 */
protected $expandableSections = false;
-   /**
-* Whether actual page is the main page
-* @var boolean $mainPage
-*/
-   protected $mainPage = false;
 
/**
 * Name of the transformation option
@@ -107,18 +102,14 @@
IContentProvider $provider,
$enableSections = false, $includeTOC = false
) {
-   $mfSpecialCaseMainPage = $context->getMFConfig()->get( 
'MFSpecialCaseMainPage' );
 
$title = $context->getTitle();
-   $isMainPage = $title->isMainPage() && $mfSpecialCaseMainPage;
$isFilePage = $title->inNamespace( NS_FILE );
$isSpecialPage = $title->isSpecialPage();
 
$html = self::wrapHTML( $provider->getHTML() );
$formatter = new MobileFormatter( $html, $title );
-   $formatter->enableExpandableSections( !$isMainPage && 
!$isSpecialPage );
-
-   $formatter->setIsMainPage( $isMainPage );
+   $formatter->enableExpandableSections( !$isSpecialPage );
 
$formatter->enableExpandableSections( $enableSections );
$formatter->enableTOCPlaceholder( $includeTOC );
@@ -142,14 +133,6 @@
 */
public function enableExpandableSections( $flag = true ) {
$this->expandableSections = $flag;
-   }
-
-   /**
-* Change mainPage (is this the main page) to $value (standard: true)
-* @param boolean $value
-*/
-   public function setIsMainPage( $value = true ) {
-   $this->mainPage = $value;
}
 
/**
@@ -191,7 +174,7 @@
self::SHOW_FIRST_PARAGRAPH_BEFORE_INFOBOX => 
$showFirstParagraphBeforeInfobox
];
// Sectionify the content and transform it if necessary per 
section
-   if ( !$this->mainPage && $this->expandableSections ) {
+   if ( $this->expandableSections ) {
list( $headings, $subheadings ) = $this->getHeadings( 
$doc );
$this->makeHeadingsEditable( $subheadings );
$this->makeSections( $doc, $headings, $transformOptions 
);
@@ -547,10 +530,6 @@
 * @return string Processed HTML
 */
public function getText( $element = null ) {
-   if ( $this->mainPage ) {
-   $element = $this->parseMainPage( $this->getDoc() );
-   }
-
return parent::getText( $element );
}
 
@@ -561,81 +540,6 @@
 */
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' );
-

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Update several Wikipedia projects to existing wordmarks

2017-07-26 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367938 )

Change subject: Update several Wikipedia projects to existing wordmarks
..

Update several Wikipedia projects to existing wordmarks

Bug: T171556
Change-Id: I20711163d03c8bbb7bacca9ffafed79c13ddffad
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 16 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/38/367938/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index d913d60..8099153 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -174,7 +174,9 @@
foreach ( [ 'private', 'fishbowl', 'special', 'closed', 'flow', 
'flaggedrevs', 'small', 'medium',
'large', 'wikimania', 'wikidata', 'wikidataclient', 
'visualeditor-nondefault',
'commonsuploads', 'nonbetafeatures', 'group0', 
'group1', 'group2', 'wikipedia', 'nonglobal',
-   'wikitech', 'nonecho', 'mobilemainpagelegacy', 
'compact-language-links', 'nowikidatadescriptiontaglines',
+   'wikitech', 'nonecho', 'mobilemainpagelegacy', 
'compact-language-links',
+   'wikipedia-cyrillic', 'wikipedia-e-acute', 
'wikipedia-devanagari',
+   'nowikidatadescriptiontaglines',
'related-articles-footer-blacklisted-skins',
'top6-wikipedia'
] as $tag ) {
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 34d2c5c..0a6135e 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15375,7 +15375,17 @@
'copyright-width' => 79,
'copyright-height' => 22,
],
+   'arzwiki' => [
+   'copyright' => 
'/static/images/mobile/copyright/wikipedia-wordmark-ar.svg',
+   'copyright-width' => 79,
+   'copyright-height' => 22,
+   ],
'bnwiki' => [
+   'copyright' => 
'/static/images/mobile/copyright/wikipedia-wordmark-bn.svg',
+   'copyright-width' => 92,
+   'copyright-height' => 21,
+   ],
+   'bpywiki' => [
'copyright' => 
'/static/images/mobile/copyright/wikipedia-wordmark-bn.svg',
'copyright-width' => 92,
'copyright-height' => 21,
@@ -15385,7 +15395,7 @@
'copyright-width' => 116,
'copyright-height' => 18,
],
-   'frwiki' => [
+   'wikipedia-e-acute' => [
'copyright' => 
'/static/images/mobile/copyright/wikipedia-wordmark-fr.svg',
'copyright-width' => 116,
'copyright-height' => 18,
@@ -15395,7 +15405,7 @@
'copyright-width' => 116,
'copyright-height' => 18,
],
-   'ruwiki' => [
+   'wikipedia-cyrillic' => [
'copyright' => 
'/static/images/mobile/copyright/wikipedia-wordmark-ru.svg',
'copyright-width' => 126,
'copyright-height' => 20,
@@ -15405,7 +15415,7 @@
'copyright-width' => 95,
'copyright-height' => 18,
],
-   'hiwiki' => [
+   'wikipedia-devanagari' => [
'copyright' => 
'/static/images/mobile/copyright/wikipedia-wordmark-hi.svg',
'copyright-width' => 78,
'copyright-height' => 18,

-- 
To view, visit https://gerrit.wikimedia.org/r/367938
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I20711163d03c8bbb7bacca9ffafed79c13ddffad
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...Vector[master]: Print styles: Border bottom of headings should not overlap i...

2017-07-25 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367817 )

Change subject: Print styles: Border bottom of headings should not overlap 
infoboxes
..

Print styles: Border bottom of headings should not overlap infoboxes

Specifically this avoids the issue highlighted here:
https://phabricator.wikimedia.org/T169823#3461814

Bug: T169823
Change-Id: Ie73b727e26876b027e5c4276f82a9ae98caff2bb
---
M print.less
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector 
refs/changes/17/367817/1

diff --git a/print.less b/print.less
index 8c40082..4b3604f 100644
--- a/print.less
+++ b/print.less
@@ -67,6 +67,8 @@
font-size: 18pt;
line-height: 24pt;
margin-bottom: 0.25em;
+   /* To avoid the bottom border of section headings with 
floated elements */
+   overflow: hidden;
}
 
h3 {

-- 
To view, visit https://gerrit.wikimedia.org/r/367817
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie73b727e26876b027e5c4276f82a9ae98caff2bb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
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...Vector[master]: Print styles: Apply padding and margins to ol as well as ul

2017-07-25 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367814 )

Change subject: Print styles: Apply padding and margins to ol as well as ul
..

Print styles: Apply padding and margins to ol as well as ul

Bug: T169823
Change-Id: I60638f18ea5ca4362699e7ea930b426be4e8eee1
---
M print.less
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector 
refs/changes/14/367814/1

diff --git a/print.less b/print.less
index 024be87..8c40082 100644
--- a/print.less
+++ b/print.less
@@ -93,6 +93,7 @@
padding-left: 20px;
}
 
+   ol,
ul {
margin: 10px 0 0 1.6em;
padding: 0;

-- 
To view, visit https://gerrit.wikimedia.org/r/367814
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60638f18ea5ca4362699e7ea930b426be4e8eee1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
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...Vector[master]: Print mode: Define when to use serif and when to use sans-serif

2017-07-25 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367812 )

Change subject: Print mode: Define when to use serif and when to use sans-serif
..

Print mode: Define when to use serif and when to use sans-serif

Additional changes:
* Define variables for fonts and use them
* Group and make clearer where fonts apply

Bug: T169823
Change-Id: I0b7d557048859936f2eb2f646202bc8071bb84ba
---
M print.less
M variables.less
2 files changed, 26 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector 
refs/changes/12/367812/1

diff --git a/print.less b/print.less
index 86d988a..06e3447 100644
--- a/print.less
+++ b/print.less
@@ -1,10 +1,28 @@
-@pureBlack: #000;
+@import 'variables.less';
 
 @media print {
 
+   /* These styles retain the existing typography in screen.less
+   In future (when deploying these styles) we may want to refactor 
skins.vector.styles
+   to apply certain styles in print as well as screen mode. */
+   #toc,
body.vector-experimental-print-styles {
padding: 10px;
-   font-family: serif;
+   font-family: @font-family-serif;
+   }
+
+   .printfooter,
+   #footer,
+   // Tables, thumbs and lists are sans-serif in print mode (unlike screen 
mode) because these will render
+   // more legibly on print media in a smaller font sizes
+   .thumb,
+   table,
+   ul,
+   h3,
+   h4,
+   h5,
+   h6 {
+   font-family: @font-family-sans-serif;
}
 
.vector-experimental-print-styles {
@@ -32,7 +50,6 @@
h5,
h6 {
margin: 30px 0 0;
-   font-family: sans-serif;
}
 
h2,
@@ -88,7 +105,6 @@
#toc {
page-break-before: always;
page-break-after: always;
-   font-family: serif;
background: none;
border: 0;
display: block;
diff --git a/variables.less b/variables.less
index 7a5d1e6..70e9575 100755
--- a/variables.less
+++ b/variables.less
@@ -1,16 +1,20 @@
 @html-font-size: 100%;
 
+@font-family-serif: 'Linux Libertine', 'Georgia', 'Times', serif;
+@font-family-sans-serif: sans-serif;
+
 // Page content
 // FIXME: Use global variable since Echo and CentralNotice use this variable
 @content-border-color: #a7d7f9;
 // FIXME: Find an open font that works with this stack and is readable by 
Windows users
-@content-font-family: sans-serif;
+@content-font-family: @font-family-sans-serif;
 @content-font-color: #222;
 @content-font-size: 0.875em;
+@pureBlack: #000;
 @content-line-height: 1.6;
 @content-padding: 1em;
 @content-heading-font-size: 1.8em;
-@content-heading-font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
+@content-heading-font-family: @font-family-serif;
 @content-heading-font-family-generic: sans-serif;
 @body-background-color: #fff;
 @heading-line-height: 1.3;

-- 
To view, visit https://gerrit.wikimedia.org/r/367812
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b7d557048859936f2eb2f646202bc8071bb84ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
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...RelatedArticles[master]: Restore default MediaWiki codesniffer configuration

2017-07-25 Thread Jdlrobson (Code Review)
Jdlrobson has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/365042 )

Change subject: Restore default MediaWiki codesniffer configuration
..


Restore default MediaWiki codesniffer configuration

Changes:
 - re-enabled all sniffs
 - fixed code to meet MW code standards

Bug: T170589
Depends-On: Ib7f0bd15dd0a9255e1e5140907e800478b658b92
Change-Id: Idb08a3e105226877804a84b120c70e5defa7398c
---
M includes/FooterHooks.php
M includes/Hooks.php
M includes/ResourceLoaderMuhoganModule.php
M includes/SidebarHooks.php
M phpcs.xml
5 files changed, 21 insertions(+), 18 deletions(-)

Approvals:
  jenkins-bot: Verified
  Phuedx: Looks good to me, approved



diff --git a/includes/FooterHooks.php b/includes/FooterHooks.php
index 9e9185d..2a76369 100644
--- a/includes/FooterHooks.php
+++ b/includes/FooterHooks.php
@@ -19,8 +19,8 @@
 * Sets the value of the wgRelatedArticles global variable
 * to the list of related articles in the cached parser output.
 *
-* @param array $vars
-* @param OutputPage $out
+* @param array &$vars variables to be added into the output of 
OutputPage::headElement.
+* @param OutputPage $out OutputPage instance calling the hook
 * @return boolean Always true
 */
public static function onMakeGlobalVariablesScript( &$vars, OutputPage 
$out ) {
@@ -100,8 +100,8 @@
 *   The feature is allowed on the skin (see 
isReadMoreAllowedOnSkin() above)
 * 
 *
-* @param OutputPage $out
-* @param Skin $skin
+* @param OutputPage $out The OutputPage object
+* @param Skin $skin Skin object that will be used to generate the page
 * @return boolean Always true
 */
public static function onBeforePageDisplay( OutputPage $out, Skin $skin 
) {
@@ -137,7 +137,7 @@
 * If the module has already been registered in
 * onResourceLoaderRegisterModules, then it is overwritten.
 *
-* @param array $schemas The schemas currently registered with the 
EventLogging
+* @param array &$schemas The schemas currently registered with the 
EventLogging
 *  extension
 * @return bool Always true
 */
@@ -152,7 +152,7 @@
 * ResourceLoaderGetConfigVars hook handler for setting a config 
variable
 * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderGetConfigVars
 *
-* @param array $vars
+* @param array &$vars Array of variables to be added into the output 
of the startup module.
 * @return boolean
 */
public static function onResourceLoaderGetConfigVars( &$vars ) {
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 8362df4..e64164d 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -14,7 +14,7 @@
 * Registers the related parser function (see
 * {@see Hooks::onFuncRelated}).
 *
-* @param Parser $parser
+* @param Parser &$parser Paser object
 * @return boolean Always true
 */
public static function onParserFirstCallInit( Parser &$parser ) {
@@ -32,7 +32,7 @@
 * to store it as a page prop in the database, only in the cache.
 *
 * @todo Test for uniqueness
-* @param Parser $parser
+* @param Parser $parser Parser object
 *
 * @return string Always ''
 */
@@ -62,8 +62,8 @@
 * The list of related pages will be retrieved using
 * ParserOutput#getExtensionData.
 *
-* @param OutputPage $out
-* @param ParserOutput $parserOutput
+* @param OutputPage &$out the OutputPage object
+* @param ParserOutput $parserOutput ParserOutput object
 * @return boolean Always true
 */
public static function onOutputPageParserOutput( OutputPage &$out, 
ParserOutput $parserOutput ) {
@@ -80,8 +80,8 @@
 * Register QUnit tests.
 * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules
 *
-* @param array $modules
-* @param \ResourceLoader $rl
+* @param array &$modules array of javascript testing modules
+* @param \ResourceLoader &$rl Resource Loader
 * @return bool
 */
public static function onResourceLoaderTestModules( &$modules, &$rl ) {
diff --git a/includes/ResourceLoaderMuhoganModule.php 
b/includes/ResourceLoaderMuhoganModule.php
index 28258e2..31f2a1a 100644
--- a/includes/ResourceLoaderMuhoganModule.php
+++ b/includes/ResourceLoaderMuhoganModule.php
@@ -12,6 +12,13 @@
  * share the code or use mustache in MobileFrontend too.
  */
 class ResourceLoaderMuHoganModule extends ResourceLoaderFileModule {
+
+   /**
+* Gets list of names of modules this module depends on.
+*
+* @param ResourceLoaderContext|null $context Resource loader context

[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Hygiene: Drop MFAllowNonJavaScriptEditing and Special:Mobile...

2017-07-25 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367688 )

Change subject: Hygiene: Drop MFAllowNonJavaScriptEditing and 
Special:MobileEditor
..

Hygiene: Drop MFAllowNonJavaScriptEditing and Special:MobileEditor

Bug: T125174
Change-Id: Ifc0efcb87605e5cd678343d1ac91a2ce53b33664
---
M includes/skins/SkinMinerva.php
1 file changed, 5 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/88/367688/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 85ed2de..d88b7aa 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -223,10 +223,8 @@
 * @return string
 */
public function doEditSectionLink( Title $nt, $section, $tooltip = 
null, $lang = false ) {
-   $noJsEdit = $this->getConfig()->get( 
'MFAllowNonJavaScriptEditing' );
 
if ( $this->isAllowedPageAction( 'edit' ) ) {
-   $additionalClass = $noJsEdit ? ' nojs-edit': '';
$lang = wfGetLangObj( $lang );
$message = $this->msg( 'mobile-frontend-editor-edit' 
)->inLanguage( $lang )->text();
$html = Html::openElement( 'span' );
@@ -236,7 +234,7 @@
'data-section' => $section,
// Note visibility of the edit section link 
button is controlled by .edit-page in ui.less so
// we default to enabled even though this may 
not be true.
-   'class' => MobileUI::iconClass( 'edit-enabled', 
'element', 'edit-page' . $additionalClass ),
+   'class' => MobileUI::iconClass( 'edit-enabled', 
'element', 'edit-page blah' ),
], $message );
$html .= Html::closeElement( 'span' );
return $html;
@@ -665,7 +663,6 @@
 */
protected function insertLogInOutMenuItem( MenuBuilder $menu ) {
$query = [];
-   $canEdit = $this->getConfig()->get( 
'MFAllowNonJavaScriptEditing' );
if ( !$this->getRequest()->wasPosted() ) {
$returntoquery = $this->getRequest()->getValues();
unset( $returntoquery['title'] );
@@ -686,7 +683,7 @@
$url = SpecialPage::getTitleFor( 'Userlogout' 
)->getLocalURL( $query );
$username = $user->getName();
 
-   $menu->insert( 'auth', $isJSOnly = !$canEdit )
+   $menu->insert( 'auth', false )
->addComponent(
$username,
Title::newFromText( $username, NS_USER 
)->getLocalUrl(),
@@ -708,7 +705,7 @@
unset( $returntoquery['campaign'] );
$query[ 'returntoquery' ] = wfArrayToCgi( 
$returntoquery );
$url = $this->getLoginUrl( $query );
-   $menu->insert( 'auth', $isJSOnly = !$canEdit )
+   $menu->insert( 'auth', false )
->addComponent(
$this->msg( 
'mobile-frontend-main-menu-login' )->escaped(),
$url,
@@ -1053,20 +1050,18 @@
 * @return array A map compatible with BaseTemplate#makeListItem
 */
protected function createEditPageAction() {
-   $noJsEdit = $this->getConfig()->get( 
'MFAllowNonJavaScriptEditing' );
-   $additionalClass = $noJsEdit ? ' nojs-edit' : '';
 
return [
'id' => 'ca-edit',
'text' => '',
'itemtitle' => $this->msg( 
'mobile-frontend-pageaction-edit-tooltip' ),
-   'class' => MobileUI::iconClass( 'edit-enabled', 
'element' . $additionalClass ),
+   'class' => MobileUI::iconClass( 'edit-enabled', 
'element' ),
'links' => [
'edit' => [
'href' => 
$this->getTitle()->getLocalURL( [ 'action' => 'edit', 'section' => 0 ] )
],
],
-   'is_js_only' => !$noJsEdit
+   'is_js_only' => false
];
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/367688
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc0efcb87605e5cd678343d1ac91a2ce53b33664
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/MinervaNeue
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

___
MediaWiki-commits mailing list
Me

[MediaWiki-commits] [Gerrit] mediawiki...Vector[master]: Fix stylesheet

2017-07-24 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367627 )

Change subject: Fix stylesheet
..

Fix stylesheet

You can't nest like this. It creates the invalid selector
.vector-experimental-print-stylesbody

This is a follow up to I453ae43099796a74c39d965b796f2fa13942106c

Bug: T169823
Change-Id: I9cc2f474fdcafdcc68378185391607b72b0f667a
---
M print.less
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector 
refs/changes/27/367627/1

diff --git a/print.less b/print.less
index 50c3d30..6f597dc 100644
--- a/print.less
+++ b/print.less
@@ -2,11 +2,11 @@
 
 @media print {
 
+   body.vector-experimental-print-styles {
+   padding: 10px;
+   font-family: serif;
+   }
.vector-experimental-print-styles {
-   &body {
-   padding: 10px;
-   font-family: serif;
-   }
 
// Normalize Blue links in the article
a {

-- 
To view, visit https://gerrit.wikimedia.org/r/367627
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9cc2f474fdcafdcc68378185391607b72b0f667a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
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]: SkinMinerva should deal with edit section link not MobileFor...

2017-07-24 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367477 )

Change subject: SkinMinerva should deal with edit section link not 
MobileFormatter
..

SkinMinerva should deal with edit section link not MobileFormatter

Bug: T171519
Change-Id: Ic4dcf24e6036c00277ee3c436de43983cd0397ca
---
M extension.json
M includes/MobileFormatter.php
2 files changed, 0 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/77/367477/1

diff --git a/extension.json b/extension.json
index 473a130..e80cc56 100644
--- a/extension.json
+++ b/extension.json
@@ -1287,7 +1287,6 @@
"beta": [],
"base": [
".toc",
-   ".mw-editsection",
".navbox",
".nomobile"
]
diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index 9f1d7d1..4e16d15 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -742,11 +742,6 @@
if ( $isCollapsible ) {
$heading->setAttribute( 'onclick', 
'javascript:mfTempOpenSection(' . $sectionNumber . ')' );
}
-
-   // prepend indicator
-   $indicator = $doc->createElement( 'div' );
-   $indicator->setAttribute( 'class', MobileUI::iconClass( '', 
'element', 'indicator' ) );
-   $heading->insertBefore( $indicator, $heading->firstChild );
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/367477
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4dcf24e6036c00277ee3c436de43983cd0397ca
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]: Allow us to run mobile formatter on desktop skin

2017-07-24 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367471 )

Change subject: Allow us to run mobile formatter on desktop skin
..

Allow us to run mobile formatter on desktop skin

We won't use this in production but the new config variable
MFAlwaysUseMobileFormatter will allow us to test the new print
styles on real world content with the following three lines:

$wgMFContentProviderClass = 
'MobileFrontend\ContentProviders\MwApiContentProvider';
$wgMFMwApiContentProviderBaseUri = "https://en.m.wikipedia.org/w/api.php";;
$wgMFAlwaysUseMobileFormatter = true;

Change-Id: Id600e1f06b0f59de0134d91d77fd68991d45f4a3
---
M README.md
M extension.json
M includes/MobileFrontend.hooks.php
3 files changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/71/367471/1

diff --git a/README.md b/README.md
index 3a5e24f..07b303d 100644
--- a/README.md
+++ b/README.md
@@ -196,6 +196,13 @@
 * Type: `string`
 * Default: `https://en.wikipedia.org/w/api.php`
 
+ $wgMFAlwaysUseMobileFormatter
+
+When enabled the MobileFormatter will run on desktop views as well as mobile 
views.
+
+* Type: `boolean`
+* Default: `false`
+
  $wgMFMobileFormatterHeadings
 
 This is a list of html tags, that could be recognized as the first heading of
diff --git a/extension.json b/extension.json
index 3772ed9..473a130 100644
--- a/extension.json
+++ b/extension.json
@@ -1272,6 +1272,7 @@
"_merge_strategy": "array_plus_2d"
},
"MFEnableJSConsoleRecruitment": false,
+   "MFAlwaysUseMobileFormatter": false,
"MFMobileFormatterHeadings": [
"h1",
"h2",
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 5a9ad14..aaa7d7c 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -193,13 +193,14 @@
public static function onOutputPageBeforeHTML( &$out, &$text ) {
$context = MobileContext::singleton();
$title = $context->getTitle();
+   $config =  MediaWikiServices::getInstance()->getService( 
'MobileFrontend.Config' );
 
if ( !$title ) {
return true;
}
 
// Perform a few extra changes if we are in mobile mode
-   if ( $context->shouldDisplayMobileView() ) {
+   if ( $context->shouldDisplayMobileView() || $config->get( 
'MFAlwaysUseMobileFormatter' ) ) {
$text = ExtMobileFrontend::DOMParse( $out, $text );
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/367471
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id600e1f06b0f59de0134d91d77fd68991d45f4a3
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


<    1   2   3   4   5   6   7   8   9   10   >