MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/183894
Change subject: Revert "Hygiene: Organise our long list of globals" ...................................................................... Revert "Hygiene: Organise our long list of globals" My eyes! How is looking through billion hfiles is easier? This reverts commit b704237705a2d13abed81eb63d71a2accb1c79e0. Change-Id: I672eefc6b643e142eeaedbabe8f41eee30ad5ebd --- M MobileFrontend.php D includes/Config.php D includes/config/Analytics.php D includes/config/Apps.php D includes/config/Editing.php D includes/config/Experimental.php D includes/config/Legacy.php D includes/config/Nearby.php D includes/config/Site.php D includes/config/Skin.php D includes/config/Uploads.php M includes/config/Wikidata.php M includes/skins/SkinMinerva.php M javascripts/api.js 14 files changed, 382 insertions(+), 426 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/94/183894/1 diff --git a/MobileFrontend.php b/MobileFrontend.php index 3c4543d..69f2693 100644 --- a/MobileFrontend.php +++ b/MobileFrontend.php @@ -236,4 +236,383 @@ /** * Begin configuration variables */ -require_once __DIR__ . "/includes/Config.php"; + +/** + * The default skin for MobileFrontend + * Defaults to SkinMinerva + */ +$wgMFDefaultSkinClass = 'SkinMinerva'; + +/* + * Allow editing (uploading) to external CentralAuth-enabled wikis where + * the user might not be logged in. + */ +$wgMFUseCentralAuthToken = false; + +/** + * An api to which any photos should be uploaded + * e.g. $wgMFPhotoUploadEndpoint = 'https://commons.wikimedia.org/w/api.php'; + * Defaults to the current wiki + */ +$wgMFPhotoUploadEndpoint = ''; + +/** + * An optional alternative api to query for nearby pages + * e.g. https://en.m.wikipedia.org/w/api.php + * + * If set forces nearby to operate in JSONP mode + * @var String + */ +$wgMFNearbyEndpoint = ''; + +/** + * API for querying Wikidata instance. + * e.g. https://en.m.wikipedia.org/w/api.php + * + * @var String + */ +$wgMFWikiDataEndpoint = 'https://m.wikidata.org/w/api.php'; + +/** + * The content namespace(s) that Special:Nearby and Special:Random should use. + * Should be one or more of NS_* constants, pipe-separated. + * @var int|string + */ +$wgMFContentNamespace = NS_MAIN; + +/** + * The wiki id/dbname for where photos are uploaded, if photos are uploaded to + * a wiki other than the local wiki (eg commonswiki). + * @var string + */ +$wgMFPhotoUploadWiki = null; + +/** + * Path to the logo used in the login/signup form + * The standard height is 72px + */ +$wgMobileFrontendLogo = false; + +/** + * Template for mobile URLs. + * + * This will be used to transcode regular URLs into mobile URLs for the + * mobile view. + * + * It's possible to specify the 'mobileness' of the URL in the host portion of + * the URL. + * + * You can either statically or dynamically create the host-portion of your + * mobile URL. To statically create it, just set $wgMobileUrlTemplate to + * the static hostname. For example: + * $wgMobileUrlTemplate = "mobile.mydomain.com"; + * + * Alternatively, the host definition can include placeholders for different + * parts of the 'host' section of a URL. The placeholders are denoted by '%h' + * and followed with a digit that maps to the position of a host-part of the + * original, non-mobile URL. Take the host 'en.wikipedia.org' for example. + * '%h0' maps to 'en', '%h1' maps to 'wikipedia', and '%h2' maps to 'org'. + * So, if you wanted a mobile URL scheme that turned "en.wikipedia.org" into + * "en.m.wikipedia.org", your URL template would look like: + * %h0.m.%h1.%h2 + */ +$wgMobileUrlTemplate = ''; + +/** + * The number of seconds the 'useformat' cookie should be valid + * + * The useformat cookie gets set when a user manually elects to view + * either the mobile or desktop view of the site. + * + * If this value is not set, it will default to $wgCookieExpiration + */ +$wgMobileFrontendFormatCookieExpiry = null; + +/** + * Make the classes, tags and ids stripped from page content configurable. + * Each item will be stripped from the page. + */ +$wgMFRemovableClasses = array( + // These rules will be used for all transformations + 'base' => array(), + // HTML view + 'HTML' => array(), +); + +/** + * Make the logos configurable. + * + * Currently, 'copyright', 'copyright-width', and 'copyright-height' elements are supported. + * 'copyright' is the URL of the logo for your content license. + * 'copyright-width' (optional) is the width in pixels of the copyright image you want to display + * 'copyright-height' (optional) is the height in pixels of the copyright image you want to display + * If the actual 'copyright' dimensions are 200x30, then you may want to set the width and height + * to 100 and 15 respectively (in order to support retina screens). + * + * Example: array( + * 'copyright' => '/images/mysite_copyright_logo.png', + * 'copyright-width' => 100, + * 'copyright-height' => 15, + * ); + */ +$wgMFCustomLogos = array(); + +/** + * Set to false to allow search engines to index your mobile pages. So far, Google seems + * to mix mobile and non-mobile pages in its search results, creating confusion. + */ +$wgMFNoindexPages = true; + +/** + * Set the domain of the stopMobileRedirect cookie + * + * If this value is not set, it will default to the top domain of the host name + * (eg en.wikipedia.org = .wikipedia.org) + * If you want to set this to a top domain (to cover all subdomains), be sure + * to include the preceding '.' (eg .wikipedia.org NOT wikipedia.org) + */ +$wgMFStopRedirectCookieHost = null; + +/** + * Whether to append ™ to the sitename in page footer, or + * ® to the sitename for alt text in footer if using a custom copyright logo. + * + * Defaults off to avoid being confusing. + * + * You can also edit the 'mobile-frontend-footer-sitename' message directly. + */ +$wgMFTrademarkSitename = false; + +/** + * Name of the class used for mobile device detection, must be inherited from + * IDeviceDetector. + */ +$wgDeviceDetectionClass = 'DeviceDetection'; + + +/** + * Whether geodata related functionality should be enabled + * + * Defaults to false. + */ +$wgMFNearby = false; + +/** + * The range in meters that should be searched to find nearby pages on + * Special:Nearby (defaults to 10km). + */ +$wgMFNearbyRange = 10000; + +/** + * Pages with smaller parsed HTML size are not cached + * Set to 0 to cache everything or to some large value to disable caching completely + */ +$wgMFMinCachedPageSize = 64 * 1024; + +/** + * Set this to true to automatically show mobile view depending on people's user-agent. + * WARNING: Make sure that your caching infrastructure is configured appropriately, to avoid + * people receiving cached versions of pages intended for someone else's devices. + */ +$wgMFAutodetectMobileView = false; + +/** + * Controls whether site notices should be shown. + */ +$wgMFEnableSiteNotice = false; + +/** + * Controls whether tablets should be shown the mobile site. Works only if + * $wgMFAutodetectMobileView is true. + */ +$wgMFShowMobileViewToTablets = true; + +/** + * (wiki)text to append to photo description during photo upload. + */ +$wgMFPhotoUploadAppendToDesc = ''; + +/** + * Whether or not to enable the use of the X-Analytics HTTP response header + * + * This header is used for analytics purposes. + * @see https://www.mediawiki.org/wiki/Analytics/Kraken/Data_Formats/X-Analytics + * @var bool + */ +$wgMFEnableXAnalyticsLogging = false; + +/** + * Options to control several functions of the mobile editor. + * Possible values: + * - 'anonymousEditing': + * Whether or not anonymous (not logged in) users should be able to edit. + * Note this is highly experimental and comes without any warranty and may introduce bugs + * until anonymous editing experience is addressed in this extension. Anonymous editing + * on mobile is still a big unknown. See bug 53069. + * Thoughts welcomed on https://www.mediawiki.org/wiki/Mobile_wikitext_editing#Anonymous_editing + */ +$wgMFEditorOptions = array( + 'anonymousEditing' => false, +); + +/** + * A css selector which is used by mf-photo.js to test whether to prompt the user photo uploads on + * the current page. When the selector matches no elements the photo uploader will show. + * This is an advanced config variable so use caution in editing. + */ +$wgMFLeadPhotoUploadCssSelector = 'img, .navbox'; + +/** + * DB key of the category which members will never display mobile view + */ +$wgMFNoMobileCategory = false; + +/** + * Prefixed names of pages that will never display mobile view + */ +$wgMFNoMobilePages = array(); + +/** + * Temporary boolean variable to enable/disable progress bars in the photo uploader + * @var bool + */ +$wgMFAjaxUploadProgressSupport = true; + +/** + * Minimum available screen width at which a device can be considered a tablet/desktop + */ +$wgMFDeviceWidthTablet = 768; + +/** + * Devices with available screen of this value and less will have some styles + * adapted for improved reading on small screens. + */ +$wgMFDeviceWidthMobileSmall = 280; + +/** + * Controls whether API action=mobileview should have every HTML section tidied for invalid markup + */ +$wgMFTidyMobileViewSections = true; + +/** + * Requests containing header with this name will be considered as coming from mobile devices. + * The default value is for backwards compatibility. + * Set to false to explicitly disable this way of detection. + */ +$wgMFMobileHeader = 'X-WAP'; + +/** + * Controls whether the "Minerva as a desktop skin" beta feature is enabled + */ +$wgMFEnableMinervaBetaFeature = false; + +/** + * Controls whether to collapse sections by default. + * + * Leave at default true for "encyclopedia style", where the section 0 lead text will + * always be visible and subsequent sections may be collapsed by default. + * + * Set to false for "dictionary style", sections are not collapsed. + */ +$wgMFCollapseSectionsByDefault = true; + +/** + * ID of the App to deep link to replacing the browser. Set 'false' to have no such link. + * See https://developers.google.com/app-indexing/webmasters/details + */ +$wgMFAppPackageId = false; + +/** + * Scheme to use for the deep link. Per default, 'http' is used. + */ +$wgMFAppScheme = 'http'; + +/** + * Controls, which page action show and which not. Allowed: + * edit, talk, upload, watch + */ +$wgMFPageActions = array( 'edit', 'talk', 'upload', 'watch' ); + +/** + * Specify whether to show redlinks (page doesn't exist) for logged in users using stable mode. + * This hasn't any effect to beta and alpha mode! + * This variable is temporary only. + */ +$wgMFShowRedLinks = false; + +/** + * Specify whether show redlinks (page doesn't exist) for anonymous users using stable mode. + * This hasn't any effect to beta and alpha mode! + */ +$wgMFShowRedLinksAnon = false; + +/** + * Set the minimum edits the user needs before they can upload images in mobile mode + */ +$wgMFUploadMinEdits = 0; + +/** + * Controls whether the WikiGrok feature is enabled + */ +$wgMFEnableWikiGrok = false; + +/** + * Controls whether WikiGrok is displayed to anonymous users + * (If $wgMFEnableWikiGrok is false, this setting is moot) + */ +$wgMFEnableWikiGrokForAnons = false; + +/** + * Controls whether WikiGrok is permitted on all devices + */ +$wgMFEnableWikiGrokOnAllDevices = false; + +/** + * Controls whether WikiGrok in Sidebar is enabled + */ +$wgMFEnableWikiGrokInSidebar = false; + +/** + * Whether beta and alpha modes are enabled + */ +$wgMFEnableBeta = false; + +/** + * Optional string to mobile friendly url for donation page. + */ +$wgMFDonationUrl = false; + +/** + * In which namespaces sections shoudn't be collapsed + */ +$wgMFNamespacesWithoutCollapsibleSections = array( + // Authorship and licensing information should be visible initially + NS_FILE, + // Otherwise category contents will be hidden + NS_CATEGORY, + // Don't collapse various forms + NS_SPECIAL, + // Just don't + NS_MEDIA, +); + +/** + * If set to true and running alpha, will add Wikidata description to page JS as + * wgMFDescription variable + */ +$wgMFUseWikibaseDescription = false; + +/** + * Property to use for instance of claim. + */ +$wgWikiBasePropertyConfig = array( + 'instanceOf' => 'P31', +); + +require_once __DIR__ . "/includes/config/Wikidata.php"; + +/** + * If set to true, main page HTML will receive special massaging that removes everything + * but a few select pieces. + */ +$wgMFSpecialCaseMainPage = true; diff --git a/includes/Config.php b/includes/Config.php deleted file mode 100644 index 64442c9..0000000 --- a/includes/Config.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - require_once __DIR__ . "/config/Apps.php"; - require_once __DIR__ . "/config/Analytics.php"; - require_once __DIR__ . "/config/Editing.php"; - require_once __DIR__ . "/config/Experimental.php"; - require_once __DIR__ . "/config/Legacy.php"; - require_once __DIR__ . "/config/Nearby.php"; - require_once __DIR__ . "/config/Site.php"; - require_once __DIR__ . "/config/Skin.php"; - require_once __DIR__ . "/config/Uploads.php"; - require_once __DIR__ . "/config/Wikidata.php"; diff --git a/includes/config/Analytics.php b/includes/config/Analytics.php deleted file mode 100644 index df0a4e2..0000000 --- a/includes/config/Analytics.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'Not an entry point.' ); -} - -/** - * Whether or not to enable the use of the X-Analytics HTTP response header - * - * This header is used for analytics purposes. - * @see https://www.mediawiki.org/wiki/Analytics/Kraken/Data_Formats/X-Analytics - * @var bool - */ -$wgMFEnableXAnalyticsLogging = false; diff --git a/includes/config/Apps.php b/includes/config/Apps.php deleted file mode 100644 index 59be62c..0000000 --- a/includes/config/Apps.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'Not an entry point.' ); -} - -/** - * ID of the App to deep link to replacing the browser. Set 'false' to have no such link. - * See https://developers.google.com/app-indexing/webmasters/details - */ -$wgMFAppPackageId = false; - -/** - * Scheme to use for the deep link. Per default, 'http' is used. - */ -$wgMFAppScheme = 'http'; diff --git a/includes/config/Editing.php b/includes/config/Editing.php deleted file mode 100644 index 9602fd5..0000000 --- a/includes/config/Editing.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'Not an entry point.' ); -} - -/** - * Specify whether to show redlinks (page doesn't exist) for logged in users using stable mode. - * This hasn't any effect to beta and alpha mode! - * This variable is temporary only. - */ -$wgMFShowRedLinks = false; - -/** - * Specify whether show redlinks (page doesn't exist) for anonymous users using stable mode. - * This hasn't any effect to beta and alpha mode! - */ -$wgMFShowRedLinksAnon = false; - -/** - * Options to control several functions of the mobile editor. - * Possible values: - * - 'anonymousEditing': - * Whether or not anonymous (not logged in) users should be able to edit. - * Note this is highly experimental and comes without any warranty and may introduce bugs - * until anonymous editing experience is addressed in this extension. Anonymous editing - * on mobile is still a big unknown. See bug 53069. - * Thoughts welcomed on https://www.mediawiki.org/wiki/Mobile_wikitext_editing#Anonymous_editing - */ -$wgMFEditorOptions = array( - 'anonymousEditing' => false, -); diff --git a/includes/config/Experimental.php b/includes/config/Experimental.php deleted file mode 100644 index 73be0e1..0000000 --- a/includes/config/Experimental.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php -// Needs to be called within MediaWiki; not standalone -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'Not an entry point.' ); -} - -/** - * Controls whether the "Minerva as a desktop skin" beta feature is enabled - */ -$wgMFEnableMinervaBetaFeature = false; diff --git a/includes/config/Legacy.php b/includes/config/Legacy.php deleted file mode 100644 index 4e40859..0000000 --- a/includes/config/Legacy.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -// Needs to be called within MediaWiki; not standalone -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'Not an entry point.' ); -} - -/* - * Allow editing (uploading) to external CentralAuth-enabled wikis where - * the user might not be logged in. - * FIXME: This should be determined by whether central auth is installed or not. - */ -$wgMFUseCentralAuthToken = false; - -/** - * If set to true, main page HTML will receive special massaging that removes everything - * but a few select pieces. - */ -$wgMFSpecialCaseMainPage = true; - -/** - * Controls whether site notices should be shown. - */ -$wgMFEnableSiteNotice = false; - -/** - * Controls whether API action=mobileview should have every HTML section tidied for invalid markup - */ -$wgMFTidyMobileViewSections = true; - -/** - * Requests containing header with this name will be considered as coming from mobile devices. - * The default value is for backwards compatibility. - * Set to false to explicitly disable this way of detection. - */ -$wgMFMobileHeader = 'X-WAP'; - -/** - * Make the classes, tags and ids stripped from page content configurable. - * Each item will be stripped from the page. - */ -$wgMFRemovableClasses = array( - // These rules will be used for all transformations - 'base' => array(), - // HTML view - 'HTML' => array(), -); - -/** - * DB key of the category which members will never display mobile view - */ -$wgMFNoMobileCategory = false; - -/** - * Prefixed names of pages that will never display mobile view - */ -$wgMFNoMobilePages = array(); diff --git a/includes/config/Nearby.php b/includes/config/Nearby.php deleted file mode 100644 index 5e79a5e..0000000 --- a/includes/config/Nearby.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php -// Needs to be called within MediaWiki; not standalone -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'Not an entry point.' ); -} - -/** - * The range in meters that should be searched to find nearby pages on - * Special:Nearby (defaults to 10km). - */ -$wgMFNearbyRange = 10000; - -/** - * Whether geodata related functionality should be enabled - * - * Defaults to false. - */ -$wgMFNearby = false; - -/** - * An optional alternative api to query for nearby pages - * e.g. https://en.m.wikipedia.org/w/api.php - * - * If set forces nearby to operate in JSONP mode - * @var String - */ -$wgMFNearbyEndpoint = ''; diff --git a/includes/config/Site.php b/includes/config/Site.php deleted file mode 100644 index 1bedc91..0000000 --- a/includes/config/Site.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'Not an entry point.' ); -} - -/** - * Pages with smaller parsed HTML size are not cached - * Set to 0 to cache everything or to some large value to disable caching completely - */ -$wgMFMinCachedPageSize = 64 * 1024; - -/** - * Set this to true to automatically show mobile view depending on people's user-agent. - * WARNING: Make sure that your caching infrastructure is configured appropriately, to avoid - * people receiving cached versions of pages intended for someone else's devices. - */ -$wgMFAutodetectMobileView = false; - - -/** - * Controls whether tablets should be shown the mobile site. Works only if - * $wgMFAutodetectMobileView is true. - */ -$wgMFShowMobileViewToTablets = true; - -/** - * Devices with available screen of this value and less will have some styles - * adapted for improved reading on small screens. - */ -$wgMFDeviceWidthMobileSmall = 280; - -/** - * Minimum available screen width at which a device can be considered a tablet/desktop - */ -$wgMFDeviceWidthTablet = 768; - -/** - * Template for mobile URLs. - * - * This will be used to transcode regular URLs into mobile URLs for the - * mobile view. - * - * It's possible to specify the 'mobileness' of the URL in the host portion of - * the URL. - * - * You can either statically or dynamically create the host-portion of your - * mobile URL. To statically create it, just set $wgMobileUrlTemplate to - * the static hostname. For example: - * $wgMobileUrlTemplate = "mobile.mydomain.com"; - * - * Alternatively, the host definition can include placeholders for different - * parts of the 'host' section of a URL. The placeholders are denoted by '%h' - * and followed with a digit that maps to the position of a host-part of the - * original, non-mobile URL. Take the host 'en.wikipedia.org' for example. - * '%h0' maps to 'en', '%h1' maps to 'wikipedia', and '%h2' maps to 'org'. - * So, if you wanted a mobile URL scheme that turned "en.wikipedia.org" into - * "en.m.wikipedia.org", your URL template would look like: - * %h0.m.%h1.%h2 - */ -$wgMobileUrlTemplate = ''; - -/** - * The number of seconds the 'useformat' cookie should be valid - * - * The useformat cookie gets set when a user manually elects to view - * either the mobile or desktop view of the site. - * - * If this value is not set, it will default to $wgCookieExpiration - */ -$wgMobileFrontendFormatCookieExpiry = null; - -/** - * Set to false to allow search engines to index your mobile pages. So far, Google seems - * to mix mobile and non-mobile pages in its search results, creating confusion. - */ -$wgMFNoindexPages = true; - -/** - * Set the domain of the stopMobileRedirect cookie - * - * If this value is not set, it will default to the top domain of the host name - * (eg en.wikipedia.org = .wikipedia.org) - * If you want to set this to a top domain (to cover all subdomains), be sure - * to include the preceding '.' (eg .wikipedia.org NOT wikipedia.org) - */ -$wgMFStopRedirectCookieHost = null; - -/** - * Whether to append ™ to the sitename in page footer, or - * ® to the sitename for alt text in footer if using a custom copyright logo. - * - * Defaults off to avoid being confusing. - * - * You can also edit the 'mobile-frontend-footer-sitename' message directly. - */ -$wgMFTrademarkSitename = false; - -/** - * Name of the class used for mobile device detection, must be inherited from - * IDeviceDetector. - */ -$wgDeviceDetectionClass = 'DeviceDetection'; - -/** - * Whether beta and alpha modes are enabled - */ -$wgMFEnableBeta = false; - -/** - * Optional string to mobile friendly url for donation page. - */ -$wgMFDonationUrl = false; - -/** - * The content namespace(s) that Special:Nearby and Special:Random should use. - * Should be one or more of NS_* constants, pipe-separated. - * @var int|string - */ -$wgMFContentNamespace = NS_MAIN; diff --git a/includes/config/Skin.php b/includes/config/Skin.php deleted file mode 100644 index 2147641..0000000 --- a/includes/config/Skin.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'Not an entry point.' ); -} - -/** - * The default skin for MobileFrontend - * Defaults to SkinMinerva - */ -$wgMFDefaultSkinClass = 'SkinMinerva'; - -/** - * Make the logos configurable. - * - * Currently, 'copyright', 'copyright-width', and 'copyright-height' elements are supported. - * 'copyright' is the URL of the logo for your content license. - * 'copyright-width' (optional) is the width in pixels of the copyright image you want to display - * 'copyright-height' (optional) is the height in pixels of the copyright image you want to display - * If the actual 'copyright' dimensions are 200x30, then you may want to set the width and height - * to 100 and 15 respectively (in order to support retina screens). - * - * Example: array( - * 'copyright' => '/images/mysite_copyright_logo.png', - * 'copyright-width' => 100, - * 'copyright-height' => 15, - * ); - */ -$wgMFCustomLogos = array(); - -/** - * Path to the logo used in the login/signup form - * The standard height is 72px - * FIXME: Merge with $wgMFCustomLogos - */ -$wgMobileFrontendLogo = false; - -/** - * Controls, which page action show and which not. Allowed: - * edit, talk, upload, watch - */ -$wgMFPageActions = array( 'edit', 'talk', 'upload', 'watch' ); - -/** - * In which namespaces sections shoudn't be collapsed - */ -$wgMFNamespacesWithoutCollapsibleSections = array( - // Authorship and licensing information should be visible initially - NS_FILE, - // Otherwise category contents will be hidden - NS_CATEGORY, - // Don't collapse various forms - NS_SPECIAL, - // Just don't - NS_MEDIA, -); - -/** - * Controls whether to collapse sections by default. - * - * Leave at default true for "encyclopedia style", where the section 0 lead text will - * always be visible and subsequent sections may be collapsed by default. - * - * Set to false for "dictionary style", sections are not collapsed. - */ -$wgMFCollapseSectionsByDefault = true; diff --git a/includes/config/Uploads.php b/includes/config/Uploads.php deleted file mode 100644 index f09299f..0000000 --- a/includes/config/Uploads.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'Not an entry point.' ); -} - -/** - * A css selector which is used by mf-photo.js to test whether to prompt the user photo uploads on - * the current page. When the selector matches no elements the photo uploader will show. - * This is an advanced config variable so use caution in editing. - */ -$wgMFLeadPhotoUploadCssSelector = 'img, .navbox'; - -/** - * The wiki id/dbname for where photos are uploaded, if photos are uploaded to - * a wiki other than the local wiki (eg commonswiki). - * @var string - */ -$wgMFPhotoUploadWiki = null; - -/** - * An api to which any photos should be uploaded - * e.g. $wgMFPhotoUploadEndpoint = 'https://commons.wikimedia.org/w/api.php'; - * Defaults to the current wiki - */ -$wgMFPhotoUploadEndpoint = ''; - -/** - * (wiki)text to append to photo description during photo upload. - */ -$wgMFPhotoUploadAppendToDesc = ''; - -/** - * Set the minimum edits the user needs before they can upload images in mobile mode - */ -$wgMFUploadMinEdits = 0; diff --git a/includes/config/Wikidata.php b/includes/config/Wikidata.php index 1cd84dd..aa624f1 100644 --- a/includes/config/Wikidata.php +++ b/includes/config/Wikidata.php @@ -6,48 +6,6 @@ } /** - * API for querying Wikidata instance. - * e.g. https://en.m.wikipedia.org/w/api.php - * - * @var String - */ -$wgMFWikiDataEndpoint = 'https://m.wikidata.org/w/api.php'; - -/** - * Controls whether the WikiGrok feature is enabled - */ -$wgMFEnableWikiGrok = false; - -/** - * Controls whether WikiGrok is displayed to anonymous users - * (If $wgMFEnableWikiGrok is false, this setting is moot) - */ -$wgMFEnableWikiGrokForAnons = false; - -/** - * Controls whether WikiGrok is permitted on all devices - */ -$wgMFEnableWikiGrokOnAllDevices = false; - -/** - * Controls whether WikiGrok in Sidebar is enabled - */ -$wgMFEnableWikiGrokInSidebar = false; - -/** - * If set to true and running alpha, will add Wikidata description to page JS as - * wgMFDescription variable - */ -$wgMFUseWikibaseDescription = false; - -/** - * Property to use for instance of claim. - */ -$wgWikiBasePropertyConfig = array( - 'instanceOf' => 'P31', -); - -/** * Configuration for Infobox experiment */ $wgMFInfoboxConfig = array( diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index 3ad8ac4..7c16c41 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -853,6 +853,7 @@ $vars = array( 'wgMFWikiDataEndpoint' => $wgMFWikiDataEndpoint, 'wgMFUseCentralAuthToken' => $wgMFUseCentralAuthToken, + 'wgMFAjaxUploadProgressSupport' => $wgMFAjaxUploadProgressSupport, 'wgMFEditorOptions' => $wgMFEditorOptions, 'wgMFPhotoUploadAppendToDesc' => $wgMFPhotoUploadAppendToDesc, 'wgMFLeadPhotoUploadCssSelector' => $wgMFLeadPhotoUploadCssSelector, diff --git a/javascripts/api.js b/javascripts/api.js index 04621d5..218f8c1 100644 --- a/javascripts/api.js +++ b/javascripts/api.js @@ -79,7 +79,7 @@ */ options.xhr = function () { var xhr = $.ajaxSettings.xhr(); - if ( xhr.upload ) { + if ( xhr.upload && ( mw.config.get( 'wgMFAjaxUploadProgressSupport' ) ) ) { // need to bind this event before we open the connection (see note at // https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest#Monitoring_progress) xhr.upload.addEventListener( 'progress', function ( ev ) { -- To view, visit https://gerrit.wikimedia.org/r/183894 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I672eefc6b643e142eeaedbabe8f41eee30ad5ebd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: MaxSem <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
