Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/181677
Change subject: Hygiene: Organise our long list of globals ...................................................................... Hygiene: Organise our long list of globals Help make them more discoverable. * Kill the now reundant upload progress bar global. Change-Id: Ie57c1737b2afe742d5b63d36e9e70eabb84ce699 --- M MobileFrontend.php A includes/Config.php A includes/config/Analytics.php A includes/config/Apps.php A includes/config/Editing.php A includes/config/Experimental.php A includes/config/Legacy.php A includes/config/Nearby.php A includes/config/Site.php A includes/config/Skin.php A includes/config/Uploads.php M includes/config/Wikidata.php M includes/skins/SkinMinerva.php M javascripts/api.js 14 files changed, 422 insertions(+), 376 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/77/181677/1 diff --git a/MobileFrontend.php b/MobileFrontend.php index bd207ea..5ccba11 100644 --- a/MobileFrontend.php +++ b/MobileFrontend.php @@ -237,377 +237,4 @@ * Begin configuration variables */ -/** - * 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; - -/** - * 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; +require_once __DIR__ . "/includes/Config.php"; diff --git a/includes/Config.php b/includes/Config.php new file mode 100644 index 0000000..64442c9 --- /dev/null +++ b/includes/Config.php @@ -0,0 +1,11 @@ +<?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 new file mode 100644 index 0000000..df0a4e2 --- /dev/null +++ b/includes/config/Analytics.php @@ -0,0 +1,13 @@ +<?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 new file mode 100644 index 0000000..59be62c --- /dev/null +++ b/includes/config/Apps.php @@ -0,0 +1,15 @@ +<?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 new file mode 100644 index 0000000..9602fd5 --- /dev/null +++ b/includes/config/Editing.php @@ -0,0 +1,31 @@ +<?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 new file mode 100644 index 0000000..73be0e1 --- /dev/null +++ b/includes/config/Experimental.php @@ -0,0 +1,10 @@ +<?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 new file mode 100644 index 0000000..4e40859 --- /dev/null +++ b/includes/config/Legacy.php @@ -0,0 +1,56 @@ +<?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 new file mode 100644 index 0000000..5e79a5e --- /dev/null +++ b/includes/config/Nearby.php @@ -0,0 +1,27 @@ +<?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 new file mode 100644 index 0000000..1bedc91 --- /dev/null +++ b/includes/config/Site.php @@ -0,0 +1,119 @@ +<?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 new file mode 100644 index 0000000..2147641 --- /dev/null +++ b/includes/config/Skin.php @@ -0,0 +1,65 @@ +<?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 new file mode 100644 index 0000000..f09299f --- /dev/null +++ b/includes/config/Uploads.php @@ -0,0 +1,35 @@ +<?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 846b3b2..2138e75 100644 --- a/includes/config/Wikidata.php +++ b/includes/config/Wikidata.php @@ -5,6 +5,44 @@ } /** + * 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; + + +/** + * 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 300602f..401483a 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -853,7 +853,6 @@ $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 218f8c1..04621d5 100644 --- a/javascripts/api.js +++ b/javascripts/api.js @@ -79,7 +79,7 @@ */ options.xhr = function () { var xhr = $.ajaxSettings.xhr(); - if ( xhr.upload && ( mw.config.get( 'wgMFAjaxUploadProgressSupport' ) ) ) { + if ( xhr.upload ) { // 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/181677 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie57c1737b2afe742d5b63d36e9e70eabb84ce699 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits