[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Update NavTabLayout to use BottomNavigationView
Mhutti1 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/329227 ) Change subject: Update NavTabLayout to use BottomNavigationView .. Update NavTabLayout to use BottomNavigationView The bottom bar on the main screen is now a BottomNavigationView. This is inline with the Material Design guidelines. As there are 4 tabs they now animate and text is only displayed for the current tab. Bug: T148791 Change-Id: I50c2b14f9920c5a38b0a20bc171ffdbf16512877 --- D app/src/androidTest/java/org/wikipedia/navtab/NavTabViewTest.java M app/src/main/java/org/wikipedia/main/MainFragment.java M app/src/main/java/org/wikipedia/navtab/NavTabLayout.java D app/src/main/java/org/wikipedia/navtab/NavTabView.java M app/src/main/res/values/attrs.xml M app/src/main/res/values/styles.xml M app/src/main/res/values/styles_dark.xml M app/src/main/res/values/styles_light.xml 8 files changed, 19 insertions(+), 157 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/27/329227/1 diff --git a/app/src/androidTest/java/org/wikipedia/navtab/NavTabViewTest.java b/app/src/androidTest/java/org/wikipedia/navtab/NavTabViewTest.java deleted file mode 100644 index 2f676ca..000 --- a/app/src/androidTest/java/org/wikipedia/navtab/NavTabViewTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.wikipedia.navtab; - -import android.support.annotation.NonNull; -import android.support.test.filters.SmallTest; - -import org.junit.Test; -import org.junit.experimental.theories.Theory; -import org.junit.experimental.theories.suppliers.TestedOn; -import org.wikipedia.test.view.FontScale; -import org.wikipedia.test.view.LayoutDirection; -import org.wikipedia.test.view.ViewTest; -import org.wikipedia.theme.Theme; - -import static org.hamcrest.Matchers.hasItemInArray; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; -import static org.junit.Assert.assertThat; - -@SmallTest public class NavTabViewTest extends ViewTest { -private NavTabView subject; - -@Theory public void testWidth(@TestedOn(ints = {WIDTH_DP_XL, WIDTH_DP_XS}) int widthDp, - @NonNull FontScale fontScale) { -setUp(widthDp, LayoutDirection.LOCALE, fontScale, Theme.LIGHT); -snap(subject); -} - -@Theory public void testLayoutDirection(@NonNull LayoutDirection direction) { -setUp(WIDTH_DP_XS, direction, FontScale.DEFAULT, Theme.LIGHT); -snap(subject); -} - -@Theory public void testTheme(@NonNull Theme theme) { -setUp(WIDTH_DP_XS, LayoutDirection.LOCALE, FontScale.DEFAULT, theme); -snap(subject); -} - -@Theory public void testSelect(@NonNull Theme theme) { -setUp(WIDTH_DP_XS, LayoutDirection.LOCALE, FontScale.DEFAULT, theme); -subject.setSelected(true); -snap(subject); -} - -@Test public void testText() { -setUp(WIDTH_DP_XS, LayoutDirection.LOCALE, FontScale.DEFAULT, Theme.LIGHT); -assertThat(subject.getText().toString(), is(str(NavTab.EXPLORE.text(; -} - -@Test public void testIcon() { -setUp(WIDTH_DP_XS, LayoutDirection.LOCALE, FontScale.DEFAULT, Theme.LIGHT); -assertThat(subject.getCompoundDrawables(), hasItemInArray(notNullValue())); -} - -@Override protected void setUp(int widthDp, @NonNull LayoutDirection layoutDirection, - @NonNull FontScale fontScale, @NonNull Theme theme) { -super.setUp(widthDp, layoutDirection, fontScale, theme); - -subject = new NavTabView(ctx()) -.text(NavTab.EXPLORE.text()) -.icon(NavTab.EXPLORE.icon()); -} -} \ No newline at end of file diff --git a/app/src/main/java/org/wikipedia/main/MainFragment.java b/app/src/main/java/org/wikipedia/main/MainFragment.java index b77aac2..8623751 100644 --- a/app/src/main/java/org/wikipedia/main/MainFragment.java +++ b/app/src/main/java/org/wikipedia/main/MainFragment.java @@ -15,11 +15,12 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.design.widget.AppBarLayout; +import android.support.design.widget.BottomNavigationView; import android.support.design.widget.CoordinatorLayout; -import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; +import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; @@ -42,6 +43,7 @@ import org.wikipedia.login.LoginActivity; import org.wikipedia.navtab.NavTab; import org.wikipedia.navtab.NavTabFragmentPagerAdapter; +import org.wikipedia.navtab.NavTabLayout; import org.wikipedia.nearby.NearbyFragment; import org.wikipedia.page.ExclusiveBottomSheetPresenter; import org.wikipedia.page.PageActivity; @@ -76,7 +78,7 @@ @BindView(R.id.fr
[MediaWiki-commits] [Gerrit] Adds current tag to changes in RecentChanges and Watchlist - change (mediawiki/core)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/266272 Change subject: Adds current tag to changes in RecentChanges and Watchlist .. Adds current tag to changes in RecentChanges and Watchlist Code now assigns current tag when attempting to add rollback link Watchlist needed some additional css to bold this tag. Bug: T10482 T116105 Change-Id: Ib65d65c2f9a37cc84c2fd8ed02813825cf612a88 --- M includes/changes/ChangesList.php M includes/specials/SpecialWatchlist.php 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/72/266272/1 diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index 1741e64..98ca80a 100644 --- a/includes/changes/ChangesList.php +++ b/includes/changes/ChangesList.php @@ -550,6 +550,7 @@ && $rc->mAttribs['rc_cur_id'] ) { $page = $rc->getTitle(); + $s .= ' ' . wfMessage( 'uctop' )->parse() . ''; /** Check for rollback and edit permissions, disallow special pages, and only * show a link on the top-most revision */ if ( $this->getUser()->isAllowed( 'rollback' ) diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 7ab6578..0361f67 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -46,6 +46,7 @@ $this->addHelpLink( 'Help:Watching pages' ); $output->addModules( array( 'mediawiki.special.changeslist.visitedstatus', + 'mediawiki.special', ) ); $mode = SpecialEditWatchlist::getMode( $request, $subpage ); -- To view, visit https://gerrit.wikimedia.org/r/266272 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib65d65c2f9a37cc84c2fd8ed02813825cf612a88 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed php7cc errors - change (mediawiki...Translate)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/265296 Change subject: Fixed php7cc errors .. Fixed php7cc errors Renamed duplicated parameter name $_ to $_1 and $_2 https://www.mediawiki.org/wiki/Topic:Sw9zx5f0flndzb2r Change-Id: Iad06993f2856f8abd0ff4dc99935d3477bccebdb --- M TranslateEditAddons.php M tag/PageTranslationHooks.php 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/96/265296/1 diff --git a/TranslateEditAddons.php b/TranslateEditAddons.php index f3ca88a..148ad4d 100644 --- a/TranslateEditAddons.php +++ b/TranslateEditAddons.php @@ -142,7 +142,7 @@ * Hook: PageContentSaveComplete */ public static function onSave( WikiPage $wikiPage, $user, $content, $summary, - $minor, $_, $_, $flags, $revision + $minor, $_1, $_2, $flags, $revision ) { if ( $content instanceof TextContent ) { diff --git a/tag/PageTranslationHooks.php b/tag/PageTranslationHooks.php index 10d2335..9ca 100644 --- a/tag/PageTranslationHooks.php +++ b/tag/PageTranslationHooks.php @@ -100,7 +100,7 @@ * Hook: PageContentSaveComplete */ public static function onSectionSave( WikiPage $wikiPage, User $user, $content, $summary, - $minor, $_, $_, $flags, $revision + $minor, $_1, $_2, $flags, $revision ) { $title = $wikiPage->getTitle(); @@ -389,7 +389,7 @@ * Hook: PageContentSave */ public static function tpSyntaxCheck( $wikiPage, $user, $content, $summary, - $minor, $_, $_, $flags, $status + $minor, $_1, $_2, $flags, $status ) { if ( $content instanceof TextContent ) { $text = $content->getNativeData(); @@ -419,7 +419,7 @@ * Hook: PageContentSaveComplete */ public static function addTranstag( $wikiPage, $user, $content, $summary, - $minor, $_, $_, $flags, $revision + $minor, $_1, $_2, $flags, $revision ) { // We are not interested in null revisions if ( $revision === null ) { -- To view, visit https://gerrit.wikimedia.org/r/265296 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad06993f2856f8abd0ff4dc99935d3477bccebdb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Search box can now be clicked on from pages which use Mobile... - change (mediawiki...MobileFrontend)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/265124 Change subject: Search box can now be clicked on from pages which use MobileFrontend.js .. Search box can now be clicked on from pages which use MobileFrontend.js Removed readonly attribute being attatched as I can't see why it is necessary. Change-Id: I956d5a042638deb3e36b640d70382389a059be8c --- M resources/skins.minerva.scripts/search.js 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/24/265124/1 diff --git a/resources/skins.minerva.scripts/search.js b/resources/skins.minerva.scripts/search.js index c47665e..bba9c29 100644 --- a/resources/skins.minerva.scripts/search.js +++ b/resources/skins.minerva.scripts/search.js @@ -54,8 +54,6 @@ // from user context event, so using it in route callback won't work // http://stackoverflow.com/questions/6837543/show-virtual-keyboard-on-mobile-phones-in-javascript $( '#searchInput' ).on( 'click', openSearchOverlay ) - // Apparently needed for main menu to work correctly. - .prop( 'readonly', true ); } M.require( 'mobile.search/MobileWebSearchLogger' ).register(); -- To view, visit https://gerrit.wikimedia.org/r/265124 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I956d5a042638deb3e36b640d70382389a059be8c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Changed wording of donate_interface-informationsharing - change (mediawiki...DonationInterface)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/263438 Change subject: Changed wording of donate_interface-informationsharing .. Changed wording of donate_interface-informationsharing https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Donate_interface-informationsharing/es Change-Id: Ie856e92b1ec47b298225d5fb53063fd6940a05a6 --- M gateway_common/i18n/interface/en.json M tests/Adapter/Worldpay/WorldpayTest.php 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/38/263438/1 diff --git a/gateway_common/i18n/interface/en.json b/gateway_common/i18n/interface/en.json index c897005..aed372d 100644 --- a/gateway_common/i18n/interface/en.json +++ b/gateway_common/i18n/interface/en.json @@ -392,7 +392,7 @@ "donate_interface-email-unsub-warning": "This will opt you out of emails from the Wikimedia Foundation sent to you as a donor. You may still receive emails to this email address if it is associated with an account on one of our projects. If you have any questions, please contact mailto:donati...@wikimedia.org\";>donati...@wikimedia.org.", "donate_interface-faqs": "Frequently asked questions", "donate_interface-tax-info": "Tax deductibility information", - "donate_interface-informationsharing": "By donating, you agree to share your personal information with the Wikimedia Foundation, the nonprofit organization that hosts Wikipedia and other Wikimedia projects, and its service providers pursuant to our donor policy. Wikimedia Foundation and its service providers are located in the United States and in other countries whose privacy laws may not be equivalent to your own. We do not sell or trade your information to anyone. For more information please read our donor policy.", + "donate_interface-informationsharing": "By donating, you agree to share your personal information with the Wikimedia Foundation, the nonprofit organization that hosts Wikipedia and other Wikimedia projects, and its service providers pursuant to our donor policy. Wikimedia Foundation and its service providers are located in the United States and in other countries whose privacy laws may not be equivalent to the ones in the country you live. We do not sell or trade your information to anyone. For more information please read our donor policy.", "donate_interface-currency-change": "Change?", "donate_interface-bank_transfer_message": "Please notice that your statement will show \"Global Collect\" as the recipient of this gift. Global Collect is authorized to accept and process payments on behalf of Wikimedia Foundation. Remember to include the reference number provided here on your bank transfer and feel free to email donati...@wikimedia.org if you have any questions or concerns.", "donate_interface-globalcollect-proxy": "Please notice that your statement will show \"Global Collect\" as the recipient of this gift. Global Collect is authorized to accept and process payments on behalf of Wikimedia Foundation.", diff --git a/tests/Adapter/Worldpay/WorldpayTest.php b/tests/Adapter/Worldpay/WorldpayTest.php index c121b82..56ac940 100644 --- a/tests/Adapter/Worldpay/WorldpayTest.php +++ b/tests/Adapter/Worldpay/WorldpayTest.php @@ -160,7 +160,7 @@ ), 'informationsharing' => array ( 'nodename' => 'p', - 'innerhtml' => "By donating, you agree to share your personal information with the Wikimedia Foundation, the nonprofit organization that hosts Wikipedia and other Wikimedia projects, and its service providers pursuant to our donor policy. Wikimedia Foundation and its service providers are located in the United States and in other countries whose privacy laws may not be equivalent to your own. We do not sell or trade your information to anyone. For more information please read our donor policy." + 'innerhtml' => "By donating, you agree to share your personal information with the Wikimedia Foundation, the nonprofit organization that hosts Wikipedia and other Wikimedia projects, and its service providers pursuant to our donor policy. Wikimedia Foundation and its service providers are located in the United States and in other countries whose privacy laws may not be equivalent to the ones in the country you live. We do not sell or trade your information to anyone. For more information please read our donor policy." ), ); -- To view, visit https://gerrit.wikimedia.org/r/263438 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie856e92b1ec47b298225d5fb53063fd6940a05a6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/ex
[MediaWiki-commits] [Gerrit] Fixed verification-error due to incorrect timeout handling - change (mediawiki...GWToolset)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/263142 Change subject: Fixed verification-error due to incorrect timeout handling .. Fixed verification-error due to incorrect timeout handling Passed timeout variable from config directly into fetchFile method and removed the redundant timeout code from WikiChecks. Bug: T11905 Change-Id: Ib57f74cd69864d3419120d4e4e862934f18862e2 --- M includes/Handlers/UploadHandler.php M includes/Helpers/WikiChecks.php 2 files changed, 3 insertions(+), 24 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GWToolset refs/changes/42/263142/1 diff --git a/includes/Handlers/UploadHandler.php b/includes/Handlers/UploadHandler.php index 2191d4b..7df5d2a 100644 --- a/includes/Handlers/UploadHandler.php +++ b/includes/Handlers/UploadHandler.php @@ -864,7 +864,6 @@ ) { // Initialize the upload object $upload = new UploadFromUrl(); - WikiChecks::increaseHTTPTimeout(); $upload->initialize( $Title->getBaseText(), @@ -872,8 +871,10 @@ false ); + $httpOptions['timeout'] = Config::$http_timeout; + // Fetch the file - returns a Status Object - $status = $upload->fetchFile(); + $status = $upload->fetchFile( $httpOptions ); if ( !$status->isOk() ) { $upload->cleanupTempFile(); return $status; diff --git a/includes/Helpers/WikiChecks.php b/includes/Helpers/WikiChecks.php index e771c40..6860a9f 100644 --- a/includes/Helpers/WikiChecks.php +++ b/includes/Helpers/WikiChecks.php @@ -172,28 +172,6 @@ } /** -* UploadFromUrl & Api->upload timeout on large files that take a long time -* to upload without this setting -* -* wiki default is 25 seconds -* e.g., http://academia.lndb.lv/xmlui/bitstream/handle/1/231/k_001_ktl1-1-27.jpg -* @todo: what is this limit set to on production? -* @todo: does ui need a notice to user about this limitation? -*/ - public static function increaseHTTPTimeout( $timeout = 0 ) { - global $wgHTTPTimeout; - - if ( empty( $timeout ) ) { - $timeout = Config::$http_timeout; - } - - if ( $wgHTTPTimeout < $timeout ) { - self::$wgHTTPTimeout = $wgHTTPTimeout; - $wgHTTPTimeout = $timeout; - } - } - - /** * @param {SpecialPage} $SpecialPage * @return {Status} */ -- To view, visit https://gerrit.wikimedia.org/r/263142 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib57f74cd69864d3419120d4e4e862934f18862e2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GWToolset Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Converted WikiLove to new extension registration - change (mediawiki...WikiLove)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/262719 Change subject: Converted WikiLove to new extension registration .. Converted WikiLove to new extension registration Created extension.json, removed obsolete i18n file and edited WikiLove.php Bug: T87996 Change-Id: Ifd383097406b8215fe5a49dd65b2afb122dc789a --- D WikiLove.i18n.php M WikiLove.php A extension.json 3 files changed, 408 insertions(+), 306 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLove refs/changes/19/262719/1 diff --git a/WikiLove.i18n.php b/WikiLove.i18n.php deleted file mode 100644 index 05b24ad..000 --- a/WikiLove.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShim0537f00da971af5a' ) ) { - function wfJsonI18nShim0537f00da971af5a( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim0537f00da971af5a'; -} diff --git a/WikiLove.php b/WikiLove.php index 558c2f3..b221641 100644 --- a/WikiLove.php +++ b/WikiLove.php @@ -26,274 +26,15 @@ * @licence MIT License */ -# Alert the user that this is not a valid entry point to MediaWiki if they try to access the file directly. -if ( !defined( 'MEDIAWIKI' ) ) { - echo << __FILE__, - 'name' => 'WikiLove', - 'version' => '1.3.0', - 'url' => 'https://www.mediawiki.org/wiki/Extension:WikiLove', - 'author' => array( - 'Ryan Kaldari', - 'Jan Paul Posma', - 'Sam Reed', - ), - 'descriptionmsg' => 'wikilove-desc', -); - -// default user options -$wgWikiLoveGlobal = false; // enable the extension for all users, removing the user preference -$wgWikiLoveTabIcon = true; // use an icon for skins that support them (i.e. Vector) -$wgWikiLoveLogging = false; // enable logging of giving of WikiLove - -// current directory including trailing slash -$dir = dirname( __FILE__ ) . '/'; - -// add autoload classes -$wgAutoloadClasses['ApiWikiLove'] = $dir . 'ApiWikiLove.php'; -$wgAutoloadClasses['WikiLoveHooks'] = $dir . 'WikiLove.hooks.php'; -$wgAutoloadClasses['WikiLoveLocal'] = $dir . 'WikiLove.local.php'; - -// i18n messages -$wgMessagesDirs['WikiLove'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['WikiLove'] = $dir . 'WikiLove.i18n.php'; - -// register hooks -$wgHooks['GetPreferences'][] = 'WikiLoveHooks::getPreferences'; -$wgHooks['SkinTemplateNavigation'][] = 'WikiLoveHooks::skinTemplateNavigation'; -$wgHooks['BeforePageDisplay'][] = 'WikiLoveHooks::beforePageDisplay'; -$wgHooks['LoadExtensionSchemaUpdates'][] = 'WikiLoveHooks::loadExtensionSchemaUpdates'; -$wgHooks['MakeGlobalVariablesScript'][] = 'WikiLoveHooks::makeGlobalVariablesScript'; -$wgHooks['ListDefinedTags'][] = 'WikiLoveHooks::onListDefinedTags'; -$wgHooks['ChangeTagsListActive'][]= 'WikiLoveHooks::onListDefinedTags'; -$wgHooks['UserMergeAccountFields'][] = 'WikiLoveHooks::onUserMergeAccountFields'; - -// api modules -$wgAPIModules['wikilove'] = 'ApiWikiLove'; - -$extWikiLoveTpl = array( - 'localBasePath' => dirname( __FILE__ ) . '/resources', - 'remoteExtPath' => 'WikiLove/resources', -); - -// messages for default options, because we want to use them in the default -// options module, but also for
[MediaWiki-commits] [Gerrit] extension.json accepts setting of $wgFeedClasses - change (mediawiki/core)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/262239 Change subject: extension.json accepts setting of $wgFeedClasses .. extension.json accepts setting of $wgFeedClasses Extensions can set $wgFeedClasses from extension.json Bug: T122770 Change-Id: I5362ec4c6ea01f4d49d576d5767e9cce4f421046 --- M docs/extension.schema.json M includes/registration/ExtensionProcessor.php 2 files changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/39/262239/1 diff --git a/docs/extension.schema.json b/docs/extension.schema.json index b635467..9315894 100644 --- a/docs/extension.schema.json +++ b/docs/extension.schema.json @@ -689,6 +689,10 @@ "ValidSkinNames": { "type": "object" }, + "FeedClasses": { + "type": "object", + "description": "Feed classes this extension uses" + }, "SkinOOUIThemes": { "type": "object" }, diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index 84e873d..9eb1eee 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -44,6 +44,7 @@ 'APIPropModules', 'APIListModules', 'ValidSkinNames', + 'FeedClasses' ); /** -- To view, visit https://gerrit.wikimedia.org/r/262239 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5362ec4c6ea01f4d49d576d5767e9cce4f421046 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Converted GoogleNewsSitemap to new extension registration - change (mediawiki...GoogleNewsSitemap)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/261948 Change subject: Converted GoogleNewsSitemap to new extension registration .. Converted GoogleNewsSitemap to new extension registration Created extension.json, removed obsolete i18n file and edited GoogleNewsSitemap.php Bug: GoogleNewsSitemap.php Change-Id: I0a80ed109f2f88b299c4d76ef33bd87ba5d1d107 --- D GoogleNewsSitemap.i18n.php M GoogleNewsSitemap.php A extension.json 3 files changed, 52 insertions(+), 78 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GoogleNewsSitemap refs/changes/48/261948/1 diff --git a/GoogleNewsSitemap.i18n.php b/GoogleNewsSitemap.i18n.php deleted file mode 100644 index af7cf97..000 --- a/GoogleNewsSitemap.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShimf17a956fe57e7da8' ) ) { - function wfJsonI18nShimf17a956fe57e7da8( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShimf17a956fe57e7da8'; -} diff --git a/GoogleNewsSitemap.php b/GoogleNewsSitemap.php index 6b74f80..a63fc03 100644 --- a/GoogleNewsSitemap.php +++ b/GoogleNewsSitemap.php @@ -1,11 +1,4 @@ http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ -$wgExtensionCredits['specialpage'][] = array( - 'path' => __FILE__, - 'name' => 'GoogleNewsSitemap', - 'author' => array( 'Amgine', '[http://mediawiki.org/wiki/User:Bawolff Brian Wolff]' ), - 'descriptionmsg' => 'googlenewssitemap-desc', - 'url' => 'https://www.mediawiki.org/wiki/Extension:GoogleNewsSitemap', - 'version' => '2.1.0', - 'license-name' => 'GPL-2.0+', -); -$dir = __DIR__ . '/'; -$wgMessagesDirs['GoogleNewsSitemap'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['GoogleNewsSitemap'] = $dir . 'GoogleNewsSitemap.i18n.php'; -$wgExtensionMessagesFiles['GoogleNewsSitemapAlias'] = $dir . 'GoogleNewsSitemap.alias.php'; -$wgAutoloadClasses['GoogleNewsSitemap'] = $dir . 'GoogleNewsSitemap_body.php'; -$wgAutoloadClasses['FeedSMItem'] = $dir . 'FeedSMItem.php'; -$wgAutoloadClasses['SitemapFeed'] = $dir . 'SitemapFeed.php'; -$wgSpecialPages['GoogleNewsSitemap'] = 'GoogleNewsSitemap'; -$wgFeedClasses['sitemap'] = 'SitemapFeed'; - -// Configuration options: -$wgGNSMmaxCategories = 6; // Maximum number of categories to look for -$wgGNSMmaxResultCount = 50; // Maximum number of results to allow - -// Fallback category if no categories are specified. -$wgGNSMfallbackCategory = 'Published'; - -// How long to put in squid cache. Note also cached using wgMemc (for 12 hours), -// but the wgMemc entries are checked to see if they are still relevant, where -// the squid cache is not checked. So this should be a small number. -$wgGNSMsmaxage = 1800; // = 30 minutes - -// $wgGNSMcommentNamespace can be false to mean do not include a element in the feeds, -// or it can be true, to mean use the talk page of the relevent page as the comments page -// or it can be a specific namespace number ( or NS_BLAH constant) to denote a specific namespace. -// For example, on many Wikinews sites, the comment namespace is Comments (102), not talk. -$wgGNSMcommentNamespace = true; +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'GoogleNewsSitemap' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['GoogleNewsSitemap'] = __DIR__ .
[MediaWiki-commits] [Gerrit] Converted LandingCheck to new extension registration - change (mediawiki...LandingCheck)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/261915 Change subject: Converted LandingCheck to new extension registration .. Converted LandingCheck to new extension registration Created extension.json, removed obsolete i18n file and edited LandingCheck.php Bug: T88055 Change-Id: Ic8ff88baf88daab139094c84050ddd02c55630b3 --- D LandingCheck.i18n.php M LandingCheck.php A extension.json 3 files changed, 43 insertions(+), 82 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LandingCheck refs/changes/15/261915/1 diff --git a/LandingCheck.i18n.php b/LandingCheck.i18n.php deleted file mode 100644 index f3d4580..000 --- a/LandingCheck.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShima8c877a247ccdc07' ) ) { - function wfJsonI18nShima8c877a247ccdc07( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShima8c877a247ccdc07'; -} diff --git a/LandingCheck.php b/LandingCheck.php index 65110ce..3baf6e1 100644 --- a/LandingCheck.php +++ b/LandingCheck.php @@ -1,50 +1,15 @@ https://www.mediawiki.org/wiki/Extension_registration for more details.' + );*/ + return; +} else { + die( 'This version of the LandingCheck extension requires MediaWiki 1.25+' ); } - -// Extension credits that will show up on Special:Version -$wgExtensionCredits['specialpage'][] = array( - 'path' => __FILE__, - 'name' => 'LandingCheck', - 'version' => '2.1.0', - 'url' => 'https://www.mediawiki.org/wiki/Extension:LandingCheck', - 'author' => array( 'Ryan Kaldari', 'Arthur Richards' ), - 'descriptionmsg' => 'landingcheck-desc', -); - -$dir = __DIR__ . '/'; - -$wgAutoloadClasses['SpecialLandingCheck'] = $dir . 'SpecialLandingCheck.php'; -$wgMessagesDirs['LandingCheck'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['LandingCheck'] = $dir . 'LandingCheck.i18n.php'; -$wgExtensionMessagesFiles['LandingCheckAlias'] = $dir . 'LandingCheck.alias.php'; -$wgSpecialPages['LandingCheck'] = 'SpecialLandingCheck'; - -// If there are any countries for which the country page should be the fallback rather than a -// language page, add its country code to this array. -$wgPriorityCountries = array(); - -/** - * It is possible to configure a separate server running LandingCheck to handle - * requests for priority countries and another for non-priority countries. By - * default, the local instance of LandingCheck will handle both unless the following - * variables are configured. - * - * The URLs contained in these variables should be the full URL to the location - * of LandingCheck - the query string will be appended. For example: - * $wgLandingCheckPriorityURLBase = '//wikimediafoundation.org/wiki/Special:LandingCheck'; - * - * LandingCheck will compare the host portion of these URLs to what is - * configured for $wgServer. If the hosts match, the LandingCheck will just - * handle the request locally. If these are not set, LandingCheck will default to - * handling the request locally. - */ -$wgLandingCheckPriorityURLBase = null; -$wgLandingCheckNormalURLBase = null; diff --git a/extension.json b/extension.json new file mode 100644 index 000..098a492 --- /dev/null +++ b/extension.json @@ -0,0 +1,31 @@ +{ + "name": "LandingCheck", + "version": "2.1.0", + "author": [ + "Ryan Kaldari", + "Arthur
[MediaWiki-commits] [Gerrit] Made new newsletter email notifications more specific - change (mediawiki...Newsletter)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/261629 Change subject: Made new newsletter email notifications more specific .. Made new newsletter email notifications more specific Changed the subject and body of the email notifications sent by Echo to be more specific to the newsletter extension. Bug: T119487 Change-Id: I48637eae6a64da65319b60669e3dddc89880cc02 --- M Newsletter.hooks.php M extension.json M i18n/en.json M i18n/qqq.json M includes/Echo/EchoNewsletterFormatter.php 5 files changed, 21 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/29/261629/1 diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php index 4ea8ea4..0b231b7 100755 --- a/Newsletter.hooks.php +++ b/Newsletter.hooks.php @@ -33,11 +33,15 @@ 'EchoNewsletterUserLocator::locateNewsletterSubscribedUsers', ), 'presentation-model' => 'EchoNewsletterPresentationModel', - // 'formatter-class' => 'EchoNewsletterFormatter', + 'formatter-class' => 'EchoNewsletterFormatter', 'title-message' => 'newsletter-notification-title', 'title-params' => array( 'newsletter', 'title', 'agent' ), 'flyout-message' => 'newsletter-notification-flyout', 'payload' => array( 'summary' ), + 'email-subject-message' => 'newsletter-email-subject', + 'email-subject-params' => array( 'newsletter' ), + 'email-body-batch-message' => 'newsletter-email-batch-body', + 'email-body-batch-params' => array( 'newsletter' , 'agent' ), ); return true; diff --git a/extension.json b/extension.json index cbdf1f7..a3fdae1 100644 --- a/extension.json +++ b/extension.json @@ -60,7 +60,8 @@ "ApiNewsletterManage": "includes/api/ApiNewsletterManage.php", "ApiNewsletterSubscribe": "includes/api/ApiNewsletterSubscribe.php", "EchoNewsletterPresentationModel": "includes/Echo/EchoNewsletterPresentationModel.php", - "EchoNewsletterUserLocator": "includes/Echo/EchoNewsletterUserLocator.php" + "EchoNewsletterUserLocator": "includes/Echo/EchoNewsletterUserLocator.php", + "EchoNewsletterFormatter": "includes/Echo/EchoNewsletterFormatter.php" }, "DefaultUserOptions": { "echo-subscriptions-web-newsletter": true, diff --git a/i18n/en.json b/i18n/en.json index 2f2013f..7c5f4cc 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -87,6 +87,8 @@ "newsletter-notification-flyout": "$3 has announced a new issue of $1.", "newsletter-notification-link-text-new-issue": "View new issue", "newsletter-notification-link-text-view-newsletter": "View newsletter", + "newsletter-email-subject": "A new issue of $1 has been announced", + "newsletter-email-batch-body": "$2 has announced a new issue of $1", "newsletter-header-name": "Name of newsletter", "newsletter-header-description": "Description", "newsletter-header-action": "Subscribed?", diff --git a/i18n/qqq.json b/i18n/qqq.json index d824ab9..46fcd07 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -90,6 +90,8 @@ "newsletter-notification-flyout": "Used as a Echo notification flyout message when a new issue of a newsletter is announced. \n* $1 is the name of the newsletter.\n* $2 is title of the issue page.\n* $3 is the username of the user who announced the new issue.", "newsletter-notification-link-text-new-issue": "Label of the primary link of the notification-newsletter-flyout, which on clicking navigates the user to the newly announced issue of a newsletter.", "newsletter-notification-link-text-view-newsletter": "Label for button that links to the newsletter page.", + "newsletter-email-subject": "Text of the email subject when a new newsletter is announced Parameters:\n* $1 is the name of the newsletter.", + "newsletter-email-batch-body" : "First line of the email body when a new newsletter is announced Parameters:\n* $1 is the name of the newsletter.\n* $2 is the username of the user who announced the new issue.", "newsletter-header-name": "Label of the newsletter name column of table in [[Special:Newsletters]] which lists the names of newsletters", "newsletter-header-description": "Label of the description column of table in [[Special:Newsletters]] which displays a description about the newsletter\n{{Identical|Description}}", "newsletter-header-action": "Label of the subscribe column of table in [[Special:Newsletters]] which provides radio buttons to subscribe/unsubscribe newsletters\n{{I
[MediaWiki-commits] [Gerrit] Split Export.php classes into seperate files - change (mediawiki/core)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/261284 Change subject: Split Export.php classes into seperate files .. Split Export.php classes into seperate files Moved classes in Export.php to seperate files in the new directory includes/export/ and updated autoload.php to these new locations. Bug: T122531 Change-Id: Idd3bba5a85d65c952f2ff503bea2ca76624c9b7f --- M autoload.php D includes/Export.php A includes/export/Dump7ZipOutput.php A includes/export/DumpBZip2Output.php A includes/export/DumpFileOutput.php A includes/export/DumpFilter.php A includes/export/DumpGZipOutput.php A includes/export/DumpLatestFilter.php A includes/export/DumpMultiWriter.php A includes/export/DumpNamespaceFilter.php A includes/export/DumpNotalkFilter.php A includes/export/DumpOutput.php A includes/export/DumpPipeOutput.php A includes/export/WikiExporter.php A includes/export/XmlDumpWriter 15 files changed, 1,839 insertions(+), 1,562 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/84/261284/1 diff --git a/autoload.php b/autoload.php index 8c5ec81..4d7ed5b 100644 --- a/autoload.php +++ b/autoload.php @@ -352,21 +352,21 @@ 'DoubleReplacer' => __DIR__ . '/includes/libs/replacers/DoubleReplacer.php', 'DummyLinker' => __DIR__ . '/includes/Linker.php', 'DummyTermColorer' => __DIR__ . '/maintenance/term/MWTerm.php', - 'Dump7ZipOutput' => __DIR__ . '/includes/Export.php', - 'DumpBZip2Output' => __DIR__ . '/includes/Export.php', + 'Dump7ZipOutput' => __DIR__ . '/includes/export/Dump7ZipOutput.php', + 'DumpBZip2Output' => __DIR__ . '/includes/export/DumpBZip2Output.php', 'DumpDBZip2Output' => __DIR__ . '/maintenance/backup.inc', - 'DumpFileOutput' => __DIR__ . '/includes/Export.php', - 'DumpFilter' => __DIR__ . '/includes/Export.php', - 'DumpGZipOutput' => __DIR__ . '/includes/Export.php', + 'DumpFileOutput' => __DIR__ . '/includes/export/DumpFileOutput.php', + 'DumpFilter' => __DIR__ . '/includes/export/DumpFilter.php', + 'DumpGZipOutput' => __DIR__ . '/includes/export/DumpGZipOutput.php', 'DumpIterator' => __DIR__ . '/maintenance/dumpIterator.php', - 'DumpLatestFilter' => __DIR__ . '/includes/Export.php', + 'DumpLatestFilter' => __DIR__ . '/includes/export/DumpLatestFilter.php', 'DumpLinks' => __DIR__ . '/maintenance/dumpLinks.php', 'DumpMessages' => __DIR__ . '/maintenance/language/dumpMessages.php', - 'DumpMultiWriter' => __DIR__ . '/includes/Export.php', - 'DumpNamespaceFilter' => __DIR__ . '/includes/Export.php', - 'DumpNotalkFilter' => __DIR__ . '/includes/Export.php', - 'DumpOutput' => __DIR__ . '/includes/Export.php', - 'DumpPipeOutput' => __DIR__ . '/includes/Export.php', + 'DumpMultiWriter' => __DIR__ . '/includes/export/DumpMultiWriter.php', + 'DumpNamespaceFilter' => __DIR__ . '/includes/export/DumpNamespaceFilter.php', + 'DumpNotalkFilter' => __DIR__ . '/includes/export/DumpNotalkFilter.php', + 'DumpOutput' => __DIR__ . '/includes/export/DumpOutput.php', + 'DumpPipeOutput' => __DIR__ . '/includes/export/DumpPipeOutput.php', 'DumpRenderer' => __DIR__ . '/maintenance/renderDump.php', 'DumpRev' => __DIR__ . '/maintenance/storage/dumpRev.php', 'DuplicateJob' => __DIR__ . '/includes/jobqueue/jobs/DuplicateJob.php', @@ -1386,7 +1386,7 @@ 'WebResponse' => __DIR__ . '/includes/WebResponse.php', 'WikiCategoryPage' => __DIR__ . '/includes/page/WikiCategoryPage.php', 'WikiDiff3' => __DIR__ . '/includes/diff/WikiDiff3.php', - 'WikiExporter' => __DIR__ . '/includes/Export.php', + 'WikiExporter' => __DIR__ . '/includes/export/WikiExporter.php', 'WikiFilePage' => __DIR__ . '/includes/page/WikiFilePage.php', 'WikiImporter' => __DIR__ . '/includes/Import.php', 'WikiMap' => __DIR__ . '/includes/WikiMap.php', @@ -1408,7 +1408,7 @@ 'XMPValidate' => __DIR__ . '/includes/media/XMPValidate.php', 'Xhprof' => __DIR__ . '/includes/libs/Xhprof.php', 'Xml' => __DIR__ . '/includes/Xml.php', - 'XmlDumpWriter' => __DIR__ . '/includes/Export.php', + 'XmlDumpWriter' => __DIR__ . '/includes/export/XmlDumpWriter.php', 'XmlJsCode' => __DIR__ . '/includes/Xml.php', 'XmlSelect' => __DIR__ . '/includes/XmlSelect.php', 'XmlTypeCheck' => __DIR__ . '/includes/libs/XmlTypeCheck.php', diff --git a/includes/Export.php b/includes/Export.php deleted file mode 100644 index b4d7737..000 --- a/includes/Export.php +++ /dev/null @@ -1,1549 +0,0 @@ - - * https://www.mediawiki.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (
[MediaWiki-commits] [Gerrit] Resized notification panel footer to be the same size as header - change (mediawiki...Echo)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/261188 Change subject: Resized notification panel footer to be the same size as header .. Resized notification panel footer to be the same size as header Changed footer buttons height to match the headers height. Bug: T119375 Change-Id: If215f109b74f2a645615fd89b7cbde6b2e6566d3 --- M modules/ooui/styles/mw.echo.ui.NotificationBadgeWidget.less 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/88/261188/1 diff --git a/modules/ooui/styles/mw.echo.ui.NotificationBadgeWidget.less b/modules/ooui/styles/mw.echo.ui.NotificationBadgeWidget.less index 059e965..8c14588 100644 --- a/modules/ooui/styles/mw.echo.ui.NotificationBadgeWidget.less +++ b/modules/ooui/styles/mw.echo.ui.NotificationBadgeWidget.less @@ -24,7 +24,7 @@ > .oo-ui-buttonElement-button { display: block; - line-height: 4em; + line-height: 2.6em; margin: 0; border: 0; padding: 0.5em; -- To view, visit https://gerrit.wikimedia.org/r/261188 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If215f109b74f2a645615fd89b7cbde6b2e6566d3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added a simple smoke test for export - change (mediawiki/core)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/260968 Change subject: Added a simple smoke test for export .. Added a simple smoke test for export Added ExportTest.php to check that exported xml is valid. Bug: T116883 Change-Id: I76151a6ab4f88ab1904627ad1d00ed487d0ab606 --- A tests/phpunit/includes/ExportTest.php 1 file changed, 72 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/68/260968/1 diff --git a/tests/phpunit/includes/ExportTest.php b/tests/phpunit/includes/ExportTest.php new file mode 100644 index 000..f8bb81c --- /dev/null +++ b/tests/phpunit/includes/ExportTest.php @@ -0,0 +1,72 @@ + + */ +class ExportTest extends MediaWikiLangTestCase { + + protected function setUp() { + + parent::setUp(); + $this->setMwGlobals( array( + 'wgContLang' => Language::factory( 'en' ), + 'wgLanguageCode' => 'en', + 'wgCapitalLinks' => true, + ) ); + } + protected function tearDown() { + parent::tearDown(); + } + + + /** +* @covers WikiExporter::pageByTitle +* @dataProvider providePageTitle +* @param string $pageTitle +*/ + public function testPageByTitle( $pageTitle ) { + global $wgContLang; + + $exporter = new WikiExporter( + $this->db, + WikiExporter::FULL + ); + + $title = Title::newFromText( $pageTitle); + + ob_start(); + $exporter->openStream(); + $exporter->pageByTitle( $title ); + $exporter->closeStream(); + $xmlString = ob_get_clean(); + + //This throws error if invalid xml output + $xmlObject = simplexml_load_string( $xmlString ); + + //Check Namespaces match to ensure xml isn't valid but meaningless + $xmlNamespaces = (array) $xmlObject->siteinfo->namespaces->namespace; + $xmlNamespaces = str_replace( ' ' , '_', $xmlNamespaces ); + unset ( $xmlNamespaces[ '@attributes' ] ); + foreach ( $xmlNamespaces as &$namespaceObject ) { + if ( gettype($namespaceObject) === 'object' ) { + $namespaceObject = ''; + } + } + + $actualNamespaces = (array) $wgContLang->getNamespaces(); + $actualNamespaces = array_values( $actualNamespaces ); + $this->assertEquals( $actualNamespaces, $xmlNamespaces ); + + + } + + public function providePageTitle() { + return array( array( 'UTPage' ) ); + } + + +} -- To view, visit https://gerrit.wikimedia.org/r/260968 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I76151a6ab4f88ab1904627ad1d00ed487d0ab606 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Moved uw.controller.Details.prototype.valid to use OO.ui.con... - change (mediawiki...UploadWizard)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/260740 Change subject: Moved uw.controller.Details.prototype.valid to use OO.ui.confirm() .. Moved uw.controller.Details.prototype.valid to use OO.ui.confirm() Changed the popup box to use OO.ui.confirm and as this always resolves added a check to make sure it returns true. Bug: T117077 Change-Id: I00a9407c95ecacfba40852ab7b4427f944f45684 --- M resources/controller/uw.controller.Details.js 1 file changed, 10 insertions(+), 25 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/40/260740/1 diff --git a/resources/controller/uw.controller.Details.js b/resources/controller/uw.controller.Details.js index ddbdec3..e3f9233 100644 --- a/resources/controller/uw.controller.Details.js +++ b/resources/controller/uw.controller.Details.js @@ -90,13 +90,15 @@ uw.controller.Details.prototype.startDetails = function () { var details = this; - this.valid().done( function () { - details.ui.hideEndButtons(); - details.submit(); - details.emit( 'start-details' ); - } ).fail( function () { - details.emit( 'details-error' ); - } ); + this.valid().done( function ( valid ) { + if ( valid ) { + details.ui.hideEndButtons(); + details.submit(); + details.emit( 'start-details' ); + } else { + details.emit( 'details-error' ); + } + } }; /** @@ -173,15 +175,8 @@ }; uw.controller.Details.prototype.confirmationDialog = function () { - var - windowManager = new OO.ui.WindowManager(), - confirmationDialog = new OO.ui.MessageDialog(); - windowManager.addWindows( [ confirmationDialog ] ); - $( 'body' ).append( windowManager.$element ); - - return windowManager.openWindow( confirmationDialog, { + return OO.ui.confirm( mw.message( 'mwe-upwiz-dialog-warning' ).text(), { title: mw.message( 'mwe-upwiz-dialog-title' ).text(), - message: mw.message( 'mwe-upwiz-dialog-warning' ).text(), verbose: true, actions: [ { @@ -196,16 +191,6 @@ flags: [ 'constructive', 'primary' ] } ] - } ).then( function ( opened ) { - return opened.then( function ( closing ) { - return closing.then( function ( data ) { - if ( data.action === 'accept' ) { - return $.Deferred().resolve(); - } - - return $.Deferred().reject(); - } ); - } ); } ); }; -- To view, visit https://gerrit.wikimedia.org/r/260740 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I00a9407c95ecacfba40852ab7b4427f944f45684 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] HistoryRevisionTools and DiffRevisionTools no longer use $wg... - change (mediawiki...Thanks)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/260342 Change subject: HistoryRevisionTools and DiffRevisionTools no longer use $wgUser .. HistoryRevisionTools and DiffRevisionTools no longer use $wgUser Modified insertThankLink to use passed in $user object instead of $wgUser. Bug: T121369 Change-Id: I1c9d1ff211bcec7815369509c5c50fad60d74643 --- M Thanks.hooks.php 1 file changed, 4 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Thanks refs/changes/42/260342/1 diff --git a/Thanks.hooks.php b/Thanks.hooks.php index bce2849..72604c1 100644 --- a/Thanks.hooks.php +++ b/Thanks.hooks.php @@ -40,9 +40,7 @@ * @param $oldRev Revision object of the "old" revision when viewing a diff * @return bool */ - public static function insertThankLink( $rev, &$links, $oldRev = null ) { - global $wgUser; - + public static function insertThankLink( $rev, &$links, $oldRev = null, $user ) { $recipientId = $rev->getUser(); $recipient = User::newFromId( $recipientId ); // Make sure Echo is turned on. @@ -51,9 +49,9 @@ // Exclude users who are blocked. // Check whether bots are allowed to receive thanks. if ( class_exists( 'EchoNotifier' ) - && !$wgUser->isAnon() - && $recipientId !== $wgUser->getId() - && !$wgUser->isBlocked() + && !$user->isAnon() + && $recipientId !== $user->getId() + && !$user->isBlocked() && self::canReceiveThanks( $recipient ) && !$rev->isDeleted( Revision::DELETED_TEXT ) && ( !$oldRev || $rev->getParentId() == $oldRev->getId() ) -- To view, visit https://gerrit.wikimedia.org/r/260342 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c9d1ff211bcec7815369509c5c50fad60d74643 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Thanks Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add tag parameter to API action=rollback - change (mediawiki/core)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/259428 Change subject: Add tag parameter to API action=rollback .. Add tag parameter to API action=rollback Added code to allow tag change in ApiRollback.php Bug: T111948 Change-Id: Ic8dcefe569f169041c9e0078a49af4ee87d2bbd6 --- M includes/api/ApiRollback.php 1 file changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/28/259428/1 diff --git a/includes/api/ApiRollback.php b/includes/api/ApiRollback.php index 6a3346f..550f21b 100644 --- a/includes/api/ApiRollback.php +++ b/includes/api/ApiRollback.php @@ -59,6 +59,16 @@ $pageObj = WikiPage::factory( $titleObj ); $summary = $params['summary']; $details = array(); + + // If change tagging was requested, check that the user is allowed to tag, + // and the tags are valid + if ( count( $params['tags'] ) ) { + $tagStatus = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $user ); + if ( !$tagStatus->isOK() ) { + $this->dieStatus( $tagStatus ); + } + } + $retval = $pageObj->doRollback( $this->getRbUser( $params ), $summary, @@ -80,6 +90,10 @@ // Watch pages $this->setWatch( $watch, $titleObj, 'watchrollback' ); + + if ( count( $params['tags'] ) ) { + ChangeTags::addTags( $params['tags'], null, null, $status->value, null); + } $info = array( 'title' => $titleObj->getPrefixedText(), @@ -107,6 +121,10 @@ 'pageid' => array( ApiBase::PARAM_TYPE => 'integer' ), + 'tags' => array( + ApiBase::PARAM_TYPE => ChangeTags::listExplicitlyDefinedTags(), + ApiBase::PARAM_ISMULTI => true, + ), 'user' => array( ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_REQUIRED => true -- To view, visit https://gerrit.wikimedia.org/r/259428 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8dcefe569f169041c9e0078a49af4ee87d2bbd6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Validates target title in WikiPageTarget - change (mediawiki...MassAction)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/259338 Change subject: Validates target title in WikiPageTarget .. Validates target title in WikiPageTarget If Title::newFromText(...) is null then throw and exception Bug: T100103 Change-Id: I7436a2b9af8d30704741757e8e9f03e5afa2112e --- M src/Targets/WikiPage/WikiPageTarget.php 1 file changed, 14 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassAction refs/changes/38/259338/1 diff --git a/src/Targets/WikiPage/WikiPageTarget.php b/src/Targets/WikiPage/WikiPageTarget.php index b79c1be..4f36390 100644 --- a/src/Targets/WikiPage/WikiPageTarget.php +++ b/src/Targets/WikiPage/WikiPageTarget.php @@ -73,17 +73,20 @@ if ( $targetData->getTitle() !== $newData->getTitle() ) { try { - $apiRequestor->makeAPIRequest( - array( - 'action' => 'move', - 'from' => $this->getNativeTarget()->getTitle()->getPrefixedText(), - //TODO check newFromText has not returned null - 'to' => Title::newFromText( $newData->getTitle() )->getPrefixedText(), - 'reason' => $task->getSummary(), - 'token' => $user->getEditToken(), - ), - $user - ); + if ( isset( Title::newFromText( $newData->getTitle() ) ) ) { + $apiRequestor->makeAPIRequest( + array( + 'action' => 'move', + 'from' => $this->getNativeTarget()->getTitle()->getPrefixedText(), + 'to' => Title::newFromText( $newData->getTitle() )->getPrefixedText(), + 'reason' => $task->getSummary(), + 'token' => $user->getEditToken(), + ), + $user + ); + } else { + throw new Exception( "The target can not be moved to here" ); + } } catch ( UsageException $e ) { wfDebugLog( 'massaction', $e->getMessage() ); -- To view, visit https://gerrit.wikimedia.org/r/259338 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7436a2b9af8d30704741757e8e9f03e5afa2112e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MassAction Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Show change tags on Special:RevisionDelete - change (mediawiki/core)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/259315 Change subject: Show change tags on Special:RevisionDelete .. Show change tags on Special:RevisionDelete RevDelRevisionItem.php has been modifed to display tags and RevDelREvisionList.php has been modifed to request tag data its database query. Bug: T109041 Change-Id: Icaae790b7d21a6670c692d11e25c6db7b7325530 --- M includes/revisiondelete/RevDelRevisionItem.php M includes/revisiondelete/RevDelRevisionList.php 2 files changed, 43 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/15/259315/1 diff --git a/includes/revisiondelete/RevDelRevisionItem.php b/includes/revisiondelete/RevDelRevisionItem.php index 17e1fd1..a374093 100644 --- a/includes/revisiondelete/RevDelRevisionItem.php +++ b/includes/revisiondelete/RevDelRevisionItem.php @@ -147,6 +147,10 @@ } } + /** +* @return string A HTML element representing this revision, showing +* change tags and everything +*/ public function getHTML() { $difflink = $this->list->msg( 'parentheses' ) ->rawParams( $this->getDiffLink() )->escaped(); @@ -156,8 +160,22 @@ if ( $this->isDeleted() ) { $revlink = "$revlink"; } + $content = "$difflink $revlink $userlink $comment"; + $attribs = array(); + $tags = $this->getTags(); + if ( $tags ) { + list( $tagSummary, $classes ) = ChangeTags::formatSummaryRow( $tags, 'edittags' ); + $content .= " $tagSummary"; + $attribs['class'] = implode( ' ', $classes ); + } + return Xml::tags( 'li', $attribs, $content ); + } - return "$difflink $revlink $userlink $comment"; + /** +* @return string Comma-separated list of tags +*/ + public function getTags() { + return $this->row->ts_tags; } public function getApiData( ApiResult $result ) { diff --git a/includes/revisiondelete/RevDelRevisionList.php b/includes/revisiondelete/RevDelRevisionList.php index 4a0fff8..ebce504 100644 --- a/includes/revisiondelete/RevDelRevisionList.php +++ b/includes/revisiondelete/RevDelRevisionList.php @@ -59,20 +59,36 @@ */ public function doQuery( $db ) { $ids = array_map( 'intval', $this->ids ); - $live = $db->select( - array( 'revision', 'page', 'user' ), - array_merge( Revision::selectFields(), Revision::selectUserFields() ), - array( + $queryInfo = array( + 'tables' => array( 'revision', 'user' ), + 'fields' => array_merge( Revision::selectFields(), Revision::selectUserFields() ), + 'conds' => array( 'rev_page' => $this->title->getArticleID(), 'rev_id' => $ids, ), - __METHOD__, - array( 'ORDER BY' => 'rev_id DESC' ), - array( + 'options' => array( 'ORDER BY' => 'rev_id DESC' ), + 'join_conds' => array( 'page' => Revision::pageJoinCond(), - 'user' => Revision::userJoinCond() ) + 'user' => Revision::userJoinCond(), + ), + ); + ChangeTags::modifyDisplayQuery( + $queryInfo['tables'], + $queryInfo['fields'], + $queryInfo['conds'], + $queryInfo['join_conds'], + $queryInfo['options'], + '' ); + $live = $db->select( + $queryInfo['tables'], + $queryInfo['fields'], + $queryInfo['conds'], + __METHOD__, + $queryInfo['options'], + $queryInfo['join_conds'] + ); if ( $live->numRows() >= count( $ids ) ) { // All requested revisions are live, keeps things simple! return $live; -- To view, visit https://gerrit.wikimedia.org/r/259315 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icaae790b7d21a6670c692d11e25c6db7b7325530 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikime
[MediaWiki-commits] [Gerrit] Introduce config.weblink_dead_days instead of day - change (pywikibot/core)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/259179 Change subject: Introduce config.weblink_dead_days instead of day .. Introduce config.weblink_dead_days instead of day Renamed the variable day and add it to 'config2.py' Bug: T76294 Change-Id: Ic95c31ecc7dbb557db8319b5857a4e94e4347db6 --- M pywikibot/config2.py M scripts/weblinkchecker.py 2 files changed, 13 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/79/259179/1 diff --git a/pywikibot/config2.py b/pywikibot/config2.py index 5f82eaa..5547271 100644 --- a/pywikibot/config2.py +++ b/pywikibot/config2.py @@ -622,6 +622,9 @@ report_dead_links_on_talk = False +# Don't alert on links days_dead old or younger +weblink_dead_days = 7 + # # DATABASE SETTINGS ## # Setting to connect the database or replica of the database of the wiki. # db_name_format can be used to manipulate the dbName of site. diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py index 86c0da7..cdf7fff 100755 --- a/scripts/weblinkchecker.py +++ b/scripts/weblinkchecker.py @@ -53,8 +53,8 @@ -notalk Overrides the report_dead_links_on_talk config variable, disabling the feature. --day the first time found dead link longer than x day ago, it should - probably be fixed or removed. if no set, default is 7 day. +-day Do not report broken link if the link is there only since + x days or less. If not set, the default is 7 days. The following config variables are supported: @@ -70,6 +70,9 @@ links on the article's talk page if (and ONLY if) the linked page has been unavailable at least two times during a timespan of at least one week. + +weblink_dead_days - sets the timespan (default: one week) after which 76 +a dead link will be reported Syntax examples: python pwb.py weblinkchecker -start:! @@ -563,7 +566,7 @@ else: pywikibot.output('*[[%s]] links to %s - %s.' % (self.page.title(), self.url, message)) -self.history.setLinkDead(self.url, message, self.page, self.day) +self.history.setLinkDead(self.url, message, self.page, config.weblink_dead_days) class History(object): @@ -637,7 +640,7 @@ self.reportThread.report(url, errorReport, containingPage, archiveURL) -def setLinkDead(self, url, error, page, day): +def setLinkDead(self, url, error, page, weblink_dead_days): """Add the fact that the link was found dead to the .dat file.""" self.semaphore.acquire() now = time.time() @@ -651,7 +654,7 @@ # if the first time we found this link longer than x day ago # (default is a week), it should probably be fixed or removed. # We'll list it in a file so that it can be removed manually. -if timeSinceFirstFound > 60 * 60 * 24 * day: +if timeSinceFirstFound > 60 * 60 * 24 * weblink_dead_days: # search for archived page try: archiveURL = get_archive_url(url) @@ -886,7 +889,6 @@ gen = None xmlFilename = None HTTPignore = [] -day = 7 if isinstance(memento_client, ImportError): warn('memento_client not imported: %s' % memento_client, ImportWarning) @@ -905,7 +907,7 @@ elif arg.startswith('-ignore:'): HTTPignore.append(int(arg[8:])) elif arg.startswith('-day:'): -day = int(arg[5:]) +config.weblink_dead_days = int(arg[5:]) elif arg.startswith('-xmlstart'): if len(arg) == 9: xmlStart = pywikibot.input( @@ -935,7 +937,7 @@ pageNumber = max(240, config.max_external_links * 2) gen = pagegenerators.PreloadingGenerator(gen, step=pageNumber) gen = pagegenerators.RedirectFilterPageGenerator(gen) -bot = WeblinkCheckerRobot(gen, HTTPignore, day) +bot = WeblinkCheckerRobot(gen, HTTPignore, config.weblink_dead_days) try: bot.run() finally: -- To view, visit https://gerrit.wikimedia.org/r/259179 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic95c31ecc7dbb557db8319b5857a4e94e4347db6 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Introduce config.weblink_dead_days instead of global day - change (pywikibot/core)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/259163 Change subject: Introduce config.weblink_dead_days instead of global day .. Introduce config.weblink_dead_days instead of global day Using "global day" prevents from importing linkchecker classes into another script. Rename the variable and add it to 'config2.py' Bug: T76294 Change-Id: I95bf650f70b4e9e491a51521d4aa4e138c689a29 --- M pywikibot/config2.py M scripts/weblinkchecker.py 2 files changed, 13 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/63/259163/1 diff --git a/pywikibot/config2.py b/pywikibot/config2.py index 5f82eaa..5547271 100644 --- a/pywikibot/config2.py +++ b/pywikibot/config2.py @@ -622,6 +622,9 @@ report_dead_links_on_talk = False +# Don't alert on links days_dead old or younger +weblink_dead_days = 7 + # # DATABASE SETTINGS ## # Setting to connect the database or replica of the database of the wiki. # db_name_format can be used to manipulate the dbName of site. diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py index 86c0da7..cdf7fff 100755 --- a/scripts/weblinkchecker.py +++ b/scripts/weblinkchecker.py @@ -53,8 +53,8 @@ -notalk Overrides the report_dead_links_on_talk config variable, disabling the feature. --day the first time found dead link longer than x day ago, it should - probably be fixed or removed. if no set, default is 7 day. +-day Do not report broken link if the link is there only since + x days or less. If not set, the default is 7 days. The following config variables are supported: @@ -70,6 +70,9 @@ links on the article's talk page if (and ONLY if) the linked page has been unavailable at least two times during a timespan of at least one week. + +weblink_dead_days - sets the timespan (default: one week) after which 76 +a dead link will be reported Syntax examples: python pwb.py weblinkchecker -start:! @@ -563,7 +566,7 @@ else: pywikibot.output('*[[%s]] links to %s - %s.' % (self.page.title(), self.url, message)) -self.history.setLinkDead(self.url, message, self.page, self.day) +self.history.setLinkDead(self.url, message, self.page, config.weblink_dead_days) class History(object): @@ -637,7 +640,7 @@ self.reportThread.report(url, errorReport, containingPage, archiveURL) -def setLinkDead(self, url, error, page, day): +def setLinkDead(self, url, error, page, weblink_dead_days): """Add the fact that the link was found dead to the .dat file.""" self.semaphore.acquire() now = time.time() @@ -651,7 +654,7 @@ # if the first time we found this link longer than x day ago # (default is a week), it should probably be fixed or removed. # We'll list it in a file so that it can be removed manually. -if timeSinceFirstFound > 60 * 60 * 24 * day: +if timeSinceFirstFound > 60 * 60 * 24 * weblink_dead_days: # search for archived page try: archiveURL = get_archive_url(url) @@ -886,7 +889,6 @@ gen = None xmlFilename = None HTTPignore = [] -day = 7 if isinstance(memento_client, ImportError): warn('memento_client not imported: %s' % memento_client, ImportWarning) @@ -905,7 +907,7 @@ elif arg.startswith('-ignore:'): HTTPignore.append(int(arg[8:])) elif arg.startswith('-day:'): -day = int(arg[5:]) +config.weblink_dead_days = int(arg[5:]) elif arg.startswith('-xmlstart'): if len(arg) == 9: xmlStart = pywikibot.input( @@ -935,7 +937,7 @@ pageNumber = max(240, config.max_external_links * 2) gen = pagegenerators.PreloadingGenerator(gen, step=pageNumber) gen = pagegenerators.RedirectFilterPageGenerator(gen) -bot = WeblinkCheckerRobot(gen, HTTPignore, day) +bot = WeblinkCheckerRobot(gen, HTTPignore, config.weblink_dead_days) try: bot.run() finally: -- To view, visit https://gerrit.wikimedia.org/r/259163 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95bf650f70b4e9e491a51521d4aa4e138c689a29 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added vagrent role for Extension:YouTube - change (mediawiki/vagrant)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/259070 Change subject: Added vagrent role for Extension:YouTube .. Added vagrent role for Extension:YouTube Added manifest file for Extension:Youtube in Vagrant. Bug: T121436 Change-Id: Ie4a5fd1277ed8ce20dd7a7ee49f2efc21ffc1a3f --- A puppet/modules/role/manifests/youtube.pp 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/70/259070/1 diff --git a/puppet/modules/role/manifests/youtube.pp b/puppet/modules/role/manifests/youtube.pp new file mode 100644 index 000..c89a6bd --- /dev/null +++ b/puppet/modules/role/manifests/youtube.pp @@ -0,0 +1,9 @@ +# == Class: role::youtube +# The YouTube extension allows users to embed YouTube and Google Video movies, +# Archive.org audio and video, WeGame and Gametrailers video, Tangler forum, +# and GoGreenTube video. +class role::youtube { + +mediawiki::extension { 'YouTube': } + +} -- To view, visit https://gerrit.wikimedia.org/r/259070 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie4a5fd1277ed8ce20dd7a7ee49f2efc21ffc1a3f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added input box to select the task ID to view - change (mediawiki...MassAction)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/259024 Change subject: Added input box to select the task ID to view .. Added input box to select the task ID to view Added a form to allow the user to enter a task ID which on submission will navigate to the correct page. Bug: T96411 Change-Id: Iab72e098d98fbaf543601791a7ea9347d233c426 --- M src/MassActionSpecialPage.php 1 file changed, 19 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassAction refs/changes/24/259024/1 diff --git a/src/MassActionSpecialPage.php b/src/MassActionSpecialPage.php index 0855432..064962e 100644 --- a/src/MassActionSpecialPage.php +++ b/src/MassActionSpecialPage.php @@ -75,8 +75,21 @@ $html = ''; $html .= Linker::specialLink( 'MassAction/New', 'massaction-newtask' ); $html .= HTML::element( 'br' ); - $html .= Linker::specialLink( 'MassAction/View', 'massaction-viewtask' ); $this->getOutput()->addHTML( $html ); + + $formDescriptor = array( + 'viewid' => array( + 'type' => 'text', + 'placeholder' => 'Task Id', + ), + ); + $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 'ViewIDForm' ); + $htmlForm->setSubmitText( 'View Task' ); + $htmlForm->setTitle( + Title::newFromText( 'MassAction/View/', NS_SPECIAL ) + ); + $htmlForm->prepareForm(); + $htmlForm->show(); } private function executeViewTask( $params ) { @@ -124,8 +137,11 @@ break; } } - - $taskId = isset( $params[0] ) ? $params[0] : ''; + if ( $this->getRequest()->getVal( 'wpviewid' ) ) { + $taskId = $this->getRequest()->getVal( 'wpviewid' ); + } else { + $taskId = isset( $params[0] ) ? $params[0] : ''; + } if ( empty( $taskId ) ) { throw new Exception( 'No taskId given to special page' ); } @@ -482,5 +498,4 @@ $link = Linker::specialLink( 'MassAction/View/' . $task->getId(), 'massaction-viewtask' ); $this->getOutput()->addHTML( '' . $link . '' ); } - } -- To view, visit https://gerrit.wikimedia.org/r/259024 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iab72e098d98fbaf543601791a7ea9347d233c426 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MassAction Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Converted MapSources to new extension registration system - change (mediawiki...MapSources)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/258706 Change subject: Converted MapSources to new extension registration system .. Converted MapSources to new extension registration system Moved most of MapSources.php to the new extension.json and added method for backward compatable implementation of the extension. Bug: T87939 Change-Id: I5db8a77ec61076b02a5ecbcc8ee950a076bc057c --- D MapSources.i18n.php M MapSources.php A extension.json 3 files changed, 50 insertions(+), 74 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MapSources refs/changes/06/258706/1 diff --git a/MapSources.i18n.php b/MapSources.i18n.php deleted file mode 100644 index fc2fbe9..000 --- a/MapSources.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShim092b743d4978dfd0' ) ) { - function wfJsonI18nShim092b743d4978dfd0( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim092b743d4978dfd0'; -} diff --git a/MapSources.php b/MapSources.php index a3fac9b..06599bc 100644 --- a/MapSources.php +++ b/MapSources.php @@ -11,42 +11,17 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'This file is a MediaWiki extension, it is not a valid entry point' ); -} - -// autoloader -$wgAutoloadClasses['MapSourcesHooks'] = __DIR__ . '/MapSources.hooks.php'; -$wgAutoloadClasses['MapSourcesPage'] = __DIR__ . '/MapSources_body.php'; -$wgAutoloadClasses['MapSourcesMath'] = __DIR__ . '/MapSources_math.php'; -$wgAutoloadClasses['MapSourcesTransform'] = __DIR__ . '/MapSources_transform.php'; - -// special page -$wgSpecialPages['MapSources'] = 'MapSourcesPage'; - -// parser hooks -$wgHooks['ParserFirstCallInit'][] = 'MapSourcesHooks::parserHooks'; - -// extension & magic words i18n -$wgMessagesDirs['MapSources'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['MapSources'] = __DIR__ . '/MapSources.i18n.php'; -$wgExtensionMessagesFiles['MapSourcesMagic'] = __DIR__ . '/MapSources.i18n.magic.php'; -$wgExtensionMessagesFiles['MapSourcesAlias'] = __DIR__ . '/MapSources.i18n.alias.php'; - -// credits -$wgExtensionCredits['specialpage'][] = array( - 'path' => __FILE__, - 'name' => 'MapSources', - 'url' => 'https://www.mediawiki.org/wiki/Extension:MapSources', - 'descriptionmsg' => 'mapsources-desc', - 'author' => array( 'Roland Unger', 'Egil Kvaleberg', 'Matthias Mullie' ), - 'version' => '1.8.0' -); -$wgExtensionCredits['parserhook'][] = array( - 'path' => __FILE__, - 'name' => 'MapSourcesMath', - 'url' => 'https://www.mediawiki.org/wiki/Extension:MapSources', - 'descriptionmsg' => 'mapsources-math-desc', - 'author' => array( 'Roland Unger', 'Matthias Mullie' ), - 'version' => '1.07' -); +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'MapSources' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['MapSources'] = __DIR__ . '/i18n'; + $wgExtensionMessagesFiles['MapSourcesAlias'] = __DIR__ . '/MapSources.i18n.alias.php'; + $wgExtensionMessagesFiles['MapSourcesMagic'] = __DIR__ . '/MapSources.i18n.magic.php'; + wfWarn( + 'Deprecated PHP entry point used for MapSources extension. Please use wfLoadExtension instead, ' . +
[MediaWiki-commits] [Gerrit] Converted Petition to new extension registration system - change (mediawiki...Petition)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/258686 Change subject: Converted Petition to new extension registration system .. Converted Petition to new extension registration system Moved most of Petition.php to the new extension.json and added method for backward compatable implementation of the extension. Moved update function to SpecialPetition.php Bug: T87958 Change-Id: If85dd702c147a25a301a66fbfb090d5901c0e24f --- M Petition.php M SpecialPetition.php A extension.json 3 files changed, 84 insertions(+), 55 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Petition refs/changes/86/258686/1 diff --git a/Petition.php b/Petition.php index 9cc3640..600c331 100644 --- a/Petition.php +++ b/Petition.php @@ -1,56 +1,14 @@ __FILE__, - 'name' => 'Petition', - 'author' => array('Peter Coombe', 'Andrew Garrett'), - 'url'=> 'https://www.mediawiki.org/wiki/Extension:Petition', - 'descriptionmsg' => 'petition-desc', - 'license-name' => 'GPL', -); - -$wgResourceModules['ext.Petition'] = array( - 'localBasePath' => __DIR__, - 'remoteExtPath' => 'Petition', - 'scripts' => 'petition.js', - 'styles'=> 'petition.css', - 'dependencies' => 'mediawiki.ui' -); - -## Petition form -$wgAutoloadClasses['SpecialPetition'] = __DIR__ . "/SpecialPetition.php"; -$wgSpecialPages['Petition'] = 'SpecialPetition'; - -## Petition data download page -$wgAutoloadClasses['SpecialPetitionData'] = __DIR__ . "/SpecialPetitionData.php"; -$wgSpecialPages['PetitionData'] = 'SpecialPetitionData'; - -$wgMessagesDirs['Petition'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['PetitionDataAlias'] = __DIR__ . '/Petition.alias.php'; - -$wgPetitionDatabase = false; - -$wgLogTypes[] = 'petition'; -$wgLogActionsHandlers['petition/sign'] = 'LogFormatter'; - -$wgLogRestrictions['petition'] = 'view-petition-data'; - -# Schema updates for update.php -$wgHooks['LoadExtensionSchemaUpdates'][] = function( DatabaseUpdater $updater ) { - $updater->addExtensionTable( 'petition_data', __DIR__ . '/table.sql', true ); - return true; -}; - -$wgGroupPermissions['petitiondata']['view-petition-data'] = true; -$wgAvailableRights[] = 'view-petition-data'; - -/** - * Options: - * - * $wgPetitionCountCacheTime - * time in seconds that the number of signatures count will be cached - * in memcached (if available). Default is 86400 i.e. 24 hours - */ - -$wgPetitionCountCacheTime = 86400; +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'Petition' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['Petition'] = __DIR__ . '/i18n'; + $wgExtensionMessagesFiles['PetitionAlias'] = __DIR__ . '/Petition.alias.php'; + /*wfWarn( + 'Deprecated PHP entry point used for Petition extension. Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + );*/ + return; +} else { + die( 'This version of the Petition extension requires MediaWiki 1.25+' ); +} \ No newline at end of file diff --git a/SpecialPetition.php b/SpecialPetition.php index da32998..dfe0611 100755 --- a/SpecialPetition.php +++ b/SpecialPetition.php @@ -130,6 +130,12 @@ ); } + # Schema updates for update.php + static function getUpdates( DatabaseUpdater $updater ){ + $updater->addExtensionTable( 'petition_data', __DIR__ . '/table.sql', true ); + return true; + } + /** * Retrieve the list of countries in given language via CLDR * diff --git a/extension.json b/extension.json new file mode 100644 index 000..5ed18d1 --- /dev/null +++ b/extension.json @@ -0,0 +1,65 @@ +{ + "name": "Petition", + "author": [ + "Peter Coombe", + "Andrew Garrett" + ], + "url": "https://www.mediawiki.org/wiki/Extension:Petition";, + "descriptionmsg": "petition-desc", + "license-name": "GPL", + "type": "other", + "GroupPermissions": { + "petitiondata": { + "view-petition-data": true + } + }, + "AvailableRights": [ + "view-petition-data" + ], + "SpecialPages": { + "Petition": "SpecialPetition", + "PetitionData": "SpecialPetitionData" + }, + "LogTypes": [ + "petition" + ], + "LogRestrictions": { + "petition": "view-petition-data" + }, + "LogActionsHandlers": { + "petition/sign": "LogFormatter" + }, + "MessagesDirs": { + "Petition": [ + "i18n" + ] + }, + "ExtensionMessagesFiles": { +
[MediaWiki-commits] [Gerrit] Fixed Special:PasswordReset message - change (mediawiki/core)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/258369 Change subject: Fixed Special:PasswordReset message .. Fixed Special:PasswordReset message The message no longer implies that an email address has been entered if it has not been. Bug: T118851 Change-Id: I6eb33e2409c391aa37ed8fe1196727c2e907719d --- M languages/i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/69/258369/1 diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 70a2b80..2eae6cd 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -554,7 +554,7 @@ "passwordreset-emailtext-ip": "Someone (probably you, from IP address $1) requested a reset of your\npassword for {{SITENAME}} ($4). The following user {{PLURAL:$3|account is|accounts are}}\nassociated with this email address:\n\n$2\n\n{{PLURAL:$3|This temporary password|These temporary passwords}} will expire in {{PLURAL:$5|one day|$5 days}}.\nYou should log in and choose a new password now. If someone else made this\nrequest, or if you have remembered your original password, and you no longer\nwish to change it, you may ignore this message and continue using your old\npassword.", "passwordreset-emailtext-user": "User $1 on {{SITENAME}} requested a reset of your password for {{SITENAME}}\n($4). The following user {{PLURAL:$3|account is|accounts are}} associated with this email address:\n\n$2\n\n{{PLURAL:$3|This temporary password|These temporary passwords}} will expire in {{PLURAL:$5|one day|$5 days}}.\nYou should log in and choose a new password now. If someone else made this\nrequest, or if you have remembered your original password, and you no longer\nwish to change it, you may ignore this message and continue using your old\npassword.", "passwordreset-emailelement": "Username:\n$1\n\nTemporary password:\n$2", - "passwordreset-emailsent": "If this is a registered email address for your account, then a password reset email will be sent.", + "passwordreset-emailsent": "If this account exists, then a password reset email will be sent.", "passwordreset-emailsent-capture": "A password reset email has been sent, which is shown below.", "passwordreset-emailerror-capture": "A password reset email was generated, which is shown below, but sending it to the {{GENDER:$2|user}} failed: $1", "changeemail": "Change or remove email address", -- To view, visit https://gerrit.wikimedia.org/r/258369 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6eb33e2409c391aa37ed8fe1196727c2e907719d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Converted TextExtracts to new extension registration system - change (mediawiki...TextExtracts)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/258065 Change subject: Converted TextExtracts to new extension registration system .. Converted TextExtracts to new extension registration system Moved most of TextExtracts.php to the new extension.json and added method for backward compatable implementation of the extension if still called though the php file. Moved unit test hook to Hooks.php and deleted old il8n.php. Bug: T87979 Change-Id: I3d26bd931ad2941268b94474f3e6327282da24ec --- D TextExtracts.i18n.php M TextExtracts.php A extension.json M includes/Hooks.php 4 files changed, 73 insertions(+), 102 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TextExtracts refs/changes/65/258065/1 diff --git a/TextExtracts.i18n.php b/TextExtracts.i18n.php deleted file mode 100644 index 0c65867..000 --- a/TextExtracts.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShim46d28b26aa21add6' ) ) { - function wfJsonI18nShim46d28b26aa21add6( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim46d28b26aa21add6'; -} diff --git a/TextExtracts.php b/TextExtracts.php index 93d680b..79d5245 100644 --- a/TextExtracts.php +++ b/TextExtracts.php @@ -18,71 +18,16 @@ * @file */ -$wgExtensionCredits['other'][] = array( - 'path' => __FILE__, - 'name' => 'TextExtracts', - 'author' => array( 'Max Semenik' ), - 'descriptionmsg' => 'textextracts-desc', - 'url' => 'https://www.mediawiki.org/wiki/Extension:TextExtracts', -); - -define( 'TEXT_EXTRACTS_INSTALLED', true ); - -$dir = __DIR__; -$wgMessagesDirs['TextExtracts'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['TextExtracts'] = "$dir/TextExtracts.i18n.php"; - - -$wgConfigRegistry['textextracts'] = 'GlobalVarConfig::newInstance'; -$wgAutoloadClasses['TextExtracts\ApiQueryExtracts'] = "$dir/includes/ApiQueryExtracts.php"; -$wgAutoloadClasses['TextExtracts\ExtractFormatter'] = "$dir/includes/ExtractFormatter.php"; -$wgAutoloadClasses['TextExtracts\Hooks'] = "$dir/includes/Hooks.php"; -$wgAPIPropModules['extracts'] = array( - 'class' => 'TextExtracts\ApiQueryExtracts', - 'factory' => 'wfNewApiQueryExtracts' -); - -/** - * @param ApiQuery $query - * @param string $action - * @return TextExtracts\ApiQueryExtracts - */ -function wfNewApiQueryExtracts( $query, $action ) { - $config = ConfigFactory::getDefaultInstance()->makeConfig( 'textextracts' ); - return new TextExtracts\ApiQueryExtracts( $query, $action, $config ); +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'TextExtracts' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['TextExtracts'] = __DIR__ . '/i18n'; + /*wfWarn( + 'Deprecated PHP entry point used for TextExtracts extension. ' . + 'Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + );*/ + return; +} else { + die( 'This version of the TextExtracts extension requires MediaWiki 1.25+' ); } - -$wgHooks['OpenSearchXml'][] = 'TextExtracts\Hooks::onApiOpenSearchSuggest'; -$wgHooks['ApiOpenSearchSuggest'][] = 'TextExtracts\Hooks::onApiOpenSearchSuggest'; -$wgHooks['UnitTestsList'][] = function( &$files ) { - $files[] = __DIR__ . '/tests/Ext
[MediaWiki-commits] [Gerrit] Converted TextExtracts to new extension registration system - change (mediawiki...TextExtracts)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/257985 Change subject: Converted TextExtracts to new extension registration system .. Converted TextExtracts to new extension registration system Moved most of TextExtracts.php to the new extension.json and added method for backward compatable implementation of the extension if still called though the php file. Moved unit test hook to Hooks.php and deleted old il8n.php. Bug: T87979 Change-Id: Idfc933bbd5809e3bc38a1a850ffc2890b4376cb9 --- D TextExtracts.i18n.php M TextExtracts.php A extension.json M includes/Hooks.php 4 files changed, 70 insertions(+), 102 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TextExtracts refs/changes/85/257985/1 diff --git a/TextExtracts.i18n.php b/TextExtracts.i18n.php deleted file mode 100644 index 0c65867..000 --- a/TextExtracts.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShim46d28b26aa21add6' ) ) { - function wfJsonI18nShim46d28b26aa21add6( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim46d28b26aa21add6'; -} diff --git a/TextExtracts.php b/TextExtracts.php index 93d680b..79d5245 100644 --- a/TextExtracts.php +++ b/TextExtracts.php @@ -18,71 +18,16 @@ * @file */ -$wgExtensionCredits['other'][] = array( - 'path' => __FILE__, - 'name' => 'TextExtracts', - 'author' => array( 'Max Semenik' ), - 'descriptionmsg' => 'textextracts-desc', - 'url' => 'https://www.mediawiki.org/wiki/Extension:TextExtracts', -); - -define( 'TEXT_EXTRACTS_INSTALLED', true ); - -$dir = __DIR__; -$wgMessagesDirs['TextExtracts'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['TextExtracts'] = "$dir/TextExtracts.i18n.php"; - - -$wgConfigRegistry['textextracts'] = 'GlobalVarConfig::newInstance'; -$wgAutoloadClasses['TextExtracts\ApiQueryExtracts'] = "$dir/includes/ApiQueryExtracts.php"; -$wgAutoloadClasses['TextExtracts\ExtractFormatter'] = "$dir/includes/ExtractFormatter.php"; -$wgAutoloadClasses['TextExtracts\Hooks'] = "$dir/includes/Hooks.php"; -$wgAPIPropModules['extracts'] = array( - 'class' => 'TextExtracts\ApiQueryExtracts', - 'factory' => 'wfNewApiQueryExtracts' -); - -/** - * @param ApiQuery $query - * @param string $action - * @return TextExtracts\ApiQueryExtracts - */ -function wfNewApiQueryExtracts( $query, $action ) { - $config = ConfigFactory::getDefaultInstance()->makeConfig( 'textextracts' ); - return new TextExtracts\ApiQueryExtracts( $query, $action, $config ); +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'TextExtracts' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['TextExtracts'] = __DIR__ . '/i18n'; + /*wfWarn( + 'Deprecated PHP entry point used for TextExtracts extension. ' . + 'Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + );*/ + return; +} else { + die( 'This version of the TextExtracts extension requires MediaWiki 1.25+' ); } - -$wgHooks['OpenSearchXml'][] = 'TextExtracts\Hooks::onApiOpenSearchSuggest'; -$wgHooks['ApiOpenSearchSuggest'][] = 'TextExtracts\Hooks::onApiOpenSearchSuggest'; -$wgHooks['UnitTestsList'][] = function( &$files ) { - $files[] = __DIR__ . '/tests/Ext
[MediaWiki-commits] [Gerrit] Converted LabeledSectionTransclusion to new extension regist... - change (mediawiki...LabeledSectionTransclusion)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/257943 Change subject: Converted LabeledSectionTransclusion to new extension registration system .. Converted LabeledSectionTransclusion to new extension registration system Moved most of LabeledSectionTransclusion.php to the new extension.json and added method for backward compatable implementation of the extension if still called though the php file. Bug: T87933 Change-Id: Iadf82864f3fbe04d53ad2f62a7963a82eba2e078 --- M LabeledSectionTransclusion.php A extension.json 2 files changed, 46 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LabeledSectionTransclusion refs/changes/43/257943/1 diff --git a/LabeledSectionTransclusion.php b/LabeledSectionTransclusion.php index cf9a06c..9d8b72d 100644 --- a/LabeledSectionTransclusion.php +++ b/LabeledSectionTransclusion.php @@ -19,25 +19,17 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ -$wgHooks['ParserFirstCallInit'][] = 'LabeledSectionTransclusion::setup'; -// @todo FIXME: LanguageGetMagic is obsolete, but LabeledSectionTransclusion::setupMagic() -// contains magic hack that $magicWords cannot handle. -$wgHooks['LanguageGetMagic'][] = 'LabeledSectionTransclusion::setupMagic'; - -$wgExtensionCredits['parserhook'][] = array( - 'path' => __FILE__, - 'name' => 'LabeledSectionTransclusion', - 'author' => 'Steve Sanbeg', - 'url'=> 'https://www.mediawiki.org/wiki/Extension:Labeled_Section_Transclusion', - 'descriptionmsg' => 'lst-desc', -); - -$dir = __DIR__; -$wgAutoloadClasses['LabeledSectionTransclusion'] = $dir . '/LabeledSectionTransclusion.class.php'; -$wgParserTestFiles[] = $dir . '/lstParserTests.txt'; -$wgParserTestFiles[] = $dir . '/lstIncorrectParserTest.txt'; -$wgParserTestFiles[] = $dir . '/lsthParserTests.txt'; -$wgMessagesDirs['LabeledSectionTransclusion'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['LabeledSectionTransclusion'] = $dir . '/lst.i18n.php'; - -$wgLstLocal = null; +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'LabeledSectionTransclusion' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['LabeledSectionTransclusion'] = __DIR__ . '/i18n'; + $wgExtensionMessagesFiles['FooBarAlias'] = __DIR__ . '/LabeledSectionTransclusion.alias.php'; + wfWarn( + 'Deprecated PHP entry point used for LabeledSectionTransclusion extension. ' . + 'Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + ); + return; +} else { + die( 'This version of the LabeledSectionTransclusion extension requires MediaWiki 1.25+' ); +} diff --git a/extension.json b/extension.json new file mode 100644 index 000..53ead38 --- /dev/null +++ b/extension.json @@ -0,0 +1,32 @@ +{ + "name": "LabeledSectionTransclusion", + "author": "Steve Sanbeg", + "url": "https://www.mediawiki.org/wiki/Extension:Labeled_Section_Transclusion";, + "descriptionmsg": "lst-desc", + "type": "parserhook", + "MessagesDirs": { + "LabeledSectionTransclusion": [ + "i18n" + ] + }, + "AutoloadClasses": { + "LabeledSectionTransclusion": "LabeledSectionTransclusion.class.php" + }, + "Hooks": { + "ParserFirstCallInit": [ + "LabeledSectionTransclusion::setup" + ], + "LanguageGetMagic": [ + "LabeledSectionTransclusion::setupMagic" + ] + }, + "ParserTestFiles": [ + "lstParserTests.txt", + "lstIncorrectParserTest.txt", + "lsthParserTests.txt" + ], + "config": { + "LstLocal": null + }, + "manifest_version": 1 +} -- To view, visit https://gerrit.wikimedia.org/r/257943 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iadf82864f3fbe04d53ad2f62a7963a82eba2e078 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LabeledSectionTransclusion Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Converted GoogleLogin to new extension registration system - change (mediawiki...GoogleLogin)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/257698 Change subject: Converted GoogleLogin to new extension registration system .. Converted GoogleLogin to new extension registration system Moved most of GoogleLogin.php to the new extension.json and added method for backward compatable implementation of the extension if still called though the php file. Bug: T120644 Change-Id: I523ab79687debcaecd9c20b5b310b29ef258fc2b --- M GoogleLogin.php A extension.json 2 files changed, 168 insertions(+), 191 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GoogleLogin refs/changes/98/257698/1 diff --git a/GoogleLogin.php b/GoogleLogin.php index 1f58798..d6f4099 100644 --- a/GoogleLogin.php +++ b/GoogleLogin.php @@ -25,195 +25,16 @@ if ( !defined( 'MEDIAWIKI' ) ) { die( 'This is an extension for Mediawiki and can not run standalone.' ); } - -// master and v2.x requires MediaWiki 1.26 -if ( version_compare( $wgVersion, '1.26c', '<' ) ) { - echo "This version of GoogleLogin requires MediaWiki 1.26, you have $wgVersion. - You can upgrade your MediaWiki Installation - or download a - version of GoogleLogin which supports your MediaWiki version."; - die( -1 ); +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'GoogleLogin' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['GoogleLogin'] = __DIR__ . '/i18n'; + $wgExtensionMessagesFiles['GoogleLogin'] = __DIR__ . '/GoogleLogin.alias.php'; + wfWarn( + 'Deprecated PHP entry point used for GoogleLogin extension. Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + ); + return; +} else { + die( 'This version of the Google Login extension requires MediaWiki 1.25+' ); } - -$wgExtensionCredits['specialpage'][] = array( - 'path' => __FILE__, - 'name' => 'GoogleLogin', - 'author' => 'Florian Schmidt', - 'url' => 'https://www.mediawiki.org/wiki/Extension:GoogleLogin', - 'descriptionmsg' => 'googlelogin-desc', - 'version' => '0.3.1-git', - 'license-name' => "MIT", -); - -// Autoload Classes -$wgAutoloadClasses[ 'GoogleLogin' ] = __DIR__ . '/includes/GoogleLogin.body.php'; -$wgAutoloadClasses[ 'SpecialGoogleLogin' ] = __DIR__ . '/includes/specials/SpecialGoogleLogin.php'; -$wgAutoloadClasses[ 'SpecialManageGoogleLogin' ] = - __DIR__ . '/includes/specials/SpecialManageGoogleLogin.php'; -$wgAutoloadClasses[ 'GoogleLoginHooks' ] = __DIR__ . '/includes/GoogleLogin.hooks.php'; -$wgAutoloadClasses[ 'GoogleLogin\\GoogleUser' ] = __DIR__ . '/includes/GoogleUser.php'; -$wgAutoloadClasses[ 'ApiGoogleLoginInfo' ] = __DIR__ . '/includes/api/ApiGoogleLoginInfo.php'; - -// i18n directory and aliases -$wgExtensionMessagesFiles[ 'GoogleLoginAlias' ] = __DIR__ . '/GoogleLogin.alias.php'; -$wgMessagesDirs['GoogleLogin'] = __DIR__ . '/i18n'; - -// new user rights for this extension -$wgGroupPermissions['sysop']['managegooglelogin'] = true; -$wgAvailableRights[] = 'managegooglelogin'; - -// Special Page -$wgSpecialPages[ 'GoogleLogin' ] = 'SpecialGoogleLogin'; -$wgSpecialPages[ 'ManageGoogleLogin' ] = 'SpecialManageGoogleLogin'; - -// API Modules -$wgAPIModules['googleplusprofileinfo'] = 'ApiGoogleLoginInfo'; - -// Hooks -$wgHooks['UserLogoutComplete'][] = 'GoogleLoginHooks::onUserLogoutComplete'; -$wgHooks['LoadExtensionSchemaUpdates'][] = 'GoogleLoginHooks::onLoadExtensionSchemaUpdates'; -$wgHooks['UserLoginForm'][] = 'GoogleLoginHooks::onUserLoginForm'; -$wgHooks['UserCreateForm'][] = 'GoogleLoginHooks::onUserCreateForm'; -$wgHooks['PersonalUrls'][] = 'GoogleLoginHooks::onPersonalUrls'; -$wgHooks['SpecialPage_initList'][] = 'GoogleLoginHooks::onSpecialPage_initList'; -$wgHooks['GetPreferences'][] = 'GoogleLoginHooks::onGetPreferences'; -$wgHooks['RecentChange_save'][] = 'GoogleLoginHooks::onRecentChange_save'; -$wgHooks['ListDefinedTags'][] = 'GoogleLoginHooks::onListDefinedAndActiveTags'; -$wgHooks['ChangeTagsListActive'][] = 'GoogleLoginHooks::onListDefinedAndActiveTags'; -$wgHooks['LoginFormValidErrorMessages'][] = 'GoogleLoginHooks::onLoginFormValidErrorMessages'; -$wgHooks['UnitTestsList'][] = 'GoogleLoginHooks::onUnitTestsList'; - -// ResourceLoader modules -// path template -$wgGLResourcePath = array( - 'localBasePath' => __DIR__, - 'remoteExtPath' => 'GoogleLogin' -); - -$wgResourceModules += array( - 'ext.GoogleLogin.style' => $wgGLResourcePath + array( - 'styles' => 'style/ext.GoogleLogin.css', - 'position' => 'top', - 'targets' => array( 'desktop', 'mobile' ), - ), - 'ext.GoogleLogin.right.style' => $wgGLResourcePath + array( - 'styles' => 'style/ext.GoogleLogin.right.css',
[MediaWiki-commits] [Gerrit] Redirects annonomous user to login page from Special:Notific... - change (mediawiki...Echo)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/257661 Change subject: Redirects annonomous user to login page from Special:Notifications .. Redirects annonomous user to login page from Special:Notifications Added code to redirect user and display a short message informing them of the need to login. Change-Id: I2145bc1502dbd19d660302d9f19e0d4a2ad5ad50 Task: T118873 --- M Echo.php M Hooks.php M i18n/en.json M includes/special/SpecialNotifications.php 4 files changed, 12 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/61/257661/1 diff --git a/Echo.php b/Echo.php index c6f1408..cbbadc5 100644 --- a/Echo.php +++ b/Echo.php @@ -79,6 +79,7 @@ $wgHooks['UserClearNewTalkNotification'][] = 'EchoHooks::onUserClearNewTalkNotification'; $wgHooks['ParserTestTables'][] = 'EchoHooks::onParserTestTables'; $wgHooks['EmailUserComplete'][] = 'EchoHooks::onEmailUserComplete'; +$wgHooks['LoginFormValidErrorMessages'][] = 'EchoHooks::onLoginFormValidErrorMessages'; // Extension:UserMerge support $wgHooks['UserMergeAccountFields'][] = 'EchoHooks::onUserMergeAccountFields'; diff --git a/Hooks.php b/Hooks.php index 00e4842..0a70db5 100644 --- a/Hooks.php +++ b/Hooks.php @@ -1070,4 +1070,11 @@ return true; } + + //Sets custom login message for redirect from notification page + public static function onLoginFormValidErrorMessages( &$messages ) { + $messages[] = 'echo-notification-loginrequired'; + return true; + } + } diff --git a/i18n/en.json b/i18n/en.json index 204a0f3..7f6db13 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -52,6 +52,7 @@ "echo-quotation-marks": "\"$1\"", "echo-api-failure": "Could not retrieve notifications. Please try again. (Error $1)", "echo-notification-placeholder": "There are no notifications.", + "echo-notification-loginrequired": "You must login to see notifications.", "notification-link-text-view-message": "View message", "notification-link-text-view-mention": "View mention", "notification-link-text-view-changes": "View changes", diff --git a/includes/special/SpecialNotifications.php b/includes/special/SpecialNotifications.php index a67090a..a6b0e85 100644 --- a/includes/special/SpecialNotifications.php +++ b/includes/special/SpecialNotifications.php @@ -20,16 +20,8 @@ $user = $this->getUser(); if ( $user->isAnon() ) { - // return to this title upon login - $returnTo = array( 'returnto' => $this->getPageTitle()->getPrefixedDBkey() ); - // the html message for anon users - $anonMsgHtml = $this->msg( - 'echo-anon', - SpecialPage::getTitleFor( 'Userlogin', 'signup' )->getFullURL( $returnTo ), - SpecialPage::getTitleFor( 'Userlogin' )->getFullURL( $returnTo ) - )->parse(); - $out->addHTML( Html::rawElement( 'span', array( 'class' => 'plainlinks' ), $anonMsgHtml ) ); - + //Redirect to login page and inform user of the need to login + $this->requireLogin( 'echo-notification-loginrequired' ); return; } @@ -151,7 +143,7 @@ $echoSeenTime->setTime( wfTimestamp( TS_MW ) ); } ); } - + /** * Build the subtitle (more info and preference links) * @return string HTML for the subtitle -- To view, visit https://gerrit.wikimedia.org/r/257661 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2145bc1502dbd19d660302d9f19e0d4a2ad5ad50 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adds Confirmation box to publisher removal - change (mediawiki...Newsletter)
Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/257494 Change subject: Adds Confirmation box to publisher removal .. Adds Confirmation box to publisher removal Gives user an option to cancel their removal action. Change-Id: I9c6949aadca3d1ab67054043914dc68763202b13 Task: T108937 --- M modules/ext.newslettermanage.js 1 file changed, 15 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/94/257494/1 diff --git a/modules/ext.newslettermanage.js b/modules/ext.newslettermanage.js index 1321a83..bb2d461 100644 --- a/modules/ext.newslettermanage.js +++ b/modules/ext.newslettermanage.js @@ -6,19 +6,22 @@ 'use strict'; var api = new mw.Api(); $( 'input[type=button]').click( function() { - var remNewsletterId = this.name; - var publisherId = this.id; - var $that = $( this ); + var r = confirm("Are you certain you wish to remove this publisher?"); + if (r == true) { + var remNewsletterId = this.name; + var publisherId = this.id; + var $that = $( this ); - api.postWithToken( 'edit', { - action: 'newslettermanage', - publisher: publisherId, - id: remNewsletterId, - do: 'removepublisher' + api.postWithToken( 'edit', { + action: 'newslettermanage', + publisher: publisherId, + id: remNewsletterId, + do: 'removepublisher' - } ).done( function ( data ) { - mw.log( data ); - $that.closest( 'tr' ).remove(); - } ); + } ).done( function ( data ) { + mw.log( data ); + $that.closest( 'tr' ).remove(); + } ); + } } ); } )( jQuery, mediaWiki ); -- To view, visit https://gerrit.wikimedia.org/r/257494 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9c6949aadca3d1ab67054043914dc68763202b13 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Mhutti1 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits