Jforrester has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/365997 )
Change subject: Hygiene: Drop MFAllowNonJavaScriptEditing and
Special:MobileEditor
......................................................................
Hygiene: Drop MFAllowNonJavaScriptEditing and Special:MobileEditor
Bug: T125174
Change-Id: I33c990e8399174a59ab022e6ed770f8592680f71
---
M MobileFrontend.alias.php
M README.md
M extension.json
M includes/MobileFrontend.hooks.php
D includes/specials/SpecialMobileEditor.php
5 files changed, 1 insertion(+), 141 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/97/365997/1
diff --git a/MobileFrontend.alias.php b/MobileFrontend.alias.php
index d393cd7..02850bc 100644
--- a/MobileFrontend.alias.php
+++ b/MobileFrontend.alias.php
@@ -15,7 +15,6 @@
'MobileOptions' => [ 'MobileOptions' ],
'Uploads' => [ 'Uploads' ],
'MobileDiff' => [ 'MobileDiff' ],
- 'MobileEditor' => [ 'MobileEditor' ],
'MobileMenu' => [ 'MobileMenu' ],
'MobileLanguages' => [ 'MobileLanguages' ],
'Nearby' => [ 'Nearby' ],
@@ -34,7 +33,6 @@
'MobileOptions' => [ 'خيارات_المحمول' ],
'Uploads' => [ 'مرفوعات' ],
'MobileDiff' => [ 'فرق_المحمول' ],
- 'MobileEditor' => [ 'محرر_المحمول' ],
'MobileMenu' => [ 'قائمة_المحمول' ],
'MobileLanguages' => [ 'لغات_المحمول' ],
'Nearby' => [ 'قريب' ],
@@ -46,7 +44,6 @@
'MobileOptions' => [ 'خيارات_الموبايل' ],
'Uploads' => [ 'مرفوعات' ],
'MobileDiff' => [ 'فرق_الموبايل' ],
- 'MobileEditor' => [ 'محرر_الموبايل' ],
'MobileMenu' => [ 'قايمه_الموبايل' ],
'MobileLanguages' => [ 'لغات_الموبايل' ],
'Nearby' => [ 'قريب' ],
@@ -79,7 +76,6 @@
'MobileOptions' => [ 'موبایل_ئی_تنزیمان' ],
'Uploads' => [ 'بُرز_بوته_ئینان' ],
'MobileDiff' => [ 'موبایل_ئی_پرک' ],
- 'MobileEditor' => [ 'موبایل_ئی_دستکار' ],
'MobileMenu' => [ 'موبایل_ئی_مینو' ],
'MobileLanguages' => [ 'موبایل_ئی_زبانان' ],
'Nearby' => [ 'بئ_نزینکی_ئا' ],
@@ -92,7 +88,6 @@
'MobileOptions' => [ 'মোবাইল_বিকল্প' ],
'Uploads' => [ 'আপলোডসমূহ' ],
'MobileDiff' => [ 'মোবাইল_পার্থক্য' ],
- 'MobileEditor' => [ 'মোবাইল_সম্পাদক' ],
'MobileMenu' => [ 'মোবাইল_মেনু' ],
'MobileLanguages' => [ 'মোবাইল_ভাষাসমূহ' ],
'Nearby' => [ 'কাছাকাছি' ],
@@ -119,7 +114,6 @@
'MobileOptions' => [ 'Mobilní_nastavení' ],
'Uploads' => [ 'Vaše_soubory' ],
'MobileDiff' => [ 'Mobilní_rozdíl' ],
- 'MobileEditor' => [ 'Mobilní_editor' ],
'MobileMenu' => [ 'Mobilní_menu' ],
'MobileLanguages' => [ 'Mobilní_jazyky' ],
'Nearby' => [ 'Poblíž' ],
@@ -131,7 +125,6 @@
'MobileOptions' => [ 'Mobile_Optionen' ],
'Uploads' => [ 'Hochgeladene_Dateien' ],
'MobileDiff' => [ 'Mobiler_Unterschied' ],
- 'MobileEditor' => [ 'Mobiler_Editor' ],
'MobileMenu' => [ 'Mobiles_Menü' ],
'MobileLanguages' => [ 'Mobile_Sprachen' ],
'Nearby' => [ 'In_der_Nähe' ],
@@ -143,7 +136,6 @@
'MobileOptions' => [ 'MobilWeçenegi' ],
'Uploads' => [ 'Barkerdışi' ],
'MobileDiff' => [ 'MobilVer' ],
- 'MobileEditor' => [ 'MobilVurnayoğ' ],
'MobileMenu' => [ 'MıobilMenu' ],
'MobileLanguages' => [ 'MobilZıwani' ],
'Nearby' => [ 'Nezdıra' ],
@@ -170,7 +162,6 @@
'MobileOptions' => [ 'Mobiili_suvandid' ],
'Uploads' => [ 'Üleslaaditud_failid' ],
'MobileDiff' => [ 'Mobiilierinevus' ],
- 'MobileEditor' => [ 'Mobiiliredaktor' ],
'MobileMenu' => [ 'Mobiili_menüü' ],
'MobileLanguages' => [ 'Mobiilikeeled' ],
'Nearby' => [ 'Lähikond' ],
@@ -182,7 +173,6 @@
'MobileOptions' => [ 'گزینههای_گوشی_همراه' ],
'Uploads' => [ 'بارگذاریها' ],
'MobileDiff' => [ 'تفاوت_گوشی_همراه' ],
- 'MobileEditor' => [ 'ویرایشگر_گوشی_همراه' ],
'MobileMenu' => [ 'گزینگان_گوشی_همراه' ],
'MobileLanguages' => [ 'زبانهای_گوشی_همراه' ],
'Nearby' => [ 'درنزدیکی', 'در_نزدیکی' ],
@@ -200,7 +190,6 @@
'MobileOptions' => [ 'הגדרות_נייד', 'הגדרות_פלאפון', 'הגדרות_סלולרי' ],
'Uploads' => [ 'העלאות' ],
'MobileDiff' => [ 'השוואה_ניידת' ],
- 'MobileEditor' => [ 'עריכה_ניידת' ],
'MobileMenu' => [ 'תפריט_נייד' ],
'MobileLanguages' => [ 'שפות_בנייד' ],
'Nearby' => [ 'בסביבה', 'קרוב' ],
@@ -210,7 +199,6 @@
$specialPageAliases['hi'] = [
'History' => [ 'इतिहास' ],
'MobileOptions' => [ 'मोबाइल_विकल्प' ],
- 'MobileEditor' => [ 'मोबाइल_सम्पादक' ],
'MobileLanguages' => [ 'मोबाइल_भाषा' ],
'Nearby' => [ 'आस-पास' ],
];
@@ -221,7 +209,6 @@
'MobileOptions' => [ 'Mobilne_opcije' ],
'Uploads' => [ 'Nahrate_dataje' ],
'MobileDiff' => [ 'Mobilny_rozdźěl' ],
- 'MobileEditor' => [ 'Mobilny_editor' ],
'MobileMenu' => [ 'Mobilny_meni' ],
'MobileLanguages' => [ 'Mobilne_rěče' ],
'Nearby' => [ 'W_bliskosći' ],
@@ -233,7 +220,6 @@
'MobileOptions' => [ 'OpzioniMobile' ],
'Uploads' => [ 'Caricamenti' ],
'MobileDiff' => [ 'DiffMobile' ],
- 'MobileEditor' => [ 'EditorMobile' ],
'MobileMenu' => [ 'MenuMobile' ],
'MobileLanguages' => [ 'LingueMobile' ],
'Nearby' => [ 'NelleVicinanze' ],
@@ -245,7 +231,6 @@
'MobileOptions' => [ '携帯機器オプション' ],
'Uploads' => [ '携帯機器アップロード' ],
'MobileDiff' => [ '携帯機器差分' ],
- 'MobileEditor' => [ '携帯機器編集' ],
'MobileMenu' => [ '携帯機器メニュー' ],
'MobileLanguages' => [ '携帯機器言語', '言語' ],
'Nearby' => [ '付近' ],
@@ -263,7 +248,6 @@
'MobileOptions' => [ '모바일설정' ],
'Uploads' => [ '올린파일' ],
'MobileDiff' => [ '모바일차이' ],
- 'MobileEditor' => [ '모바일편집기' ],
'MobileMenu' => [ '모바일메뉴' ],
'MobileLanguages' => [ '모바일언어' ],
'Nearby' => [ '근처' ],
@@ -275,7 +259,6 @@
'MobileOptions' => [ 'Mobil_Optiounen' ],
'Uploads' => [ 'Eropgeluede_Fichieren' ],
'MobileDiff' => [ 'Mobilen_Ënnerscheed' ],
- 'MobileEditor' => [ 'Mobilen_Editeur' ],
'MobileMenu' => [ 'Mobile_Menü' ],
'MobileLanguages' => [ 'Mobil_Sproochen' ],
'Nearby' => [ 'Nobäi' ],
@@ -287,7 +270,6 @@
'MobileOptions' => [ 'خوصوٙصیات_موبایلی' ],
'Uploads' => [ 'سوڤارکئردیا' ],
'MobileDiff' => [ 'فأرخ_موبایلی' ],
- 'MobileEditor' => [ 'ڤیرایئشتکار_موبایلی' ],
'MobileMenu' => [ 'نومیار_موبایلی' ],
'MobileLanguages' => [ 'زوٙنا_موبایل' ],
'Nearby' => [ 'نئزیک_ڤئ' ],
@@ -304,7 +286,6 @@
'MobileOptions' => [ 'МобилниПоставки' ],
'Uploads' => [ 'Подигања' ],
'MobileDiff' => [ 'МобилнаРазлика' ],
- 'MobileEditor' => [ 'МобиленУредувач' ],
'MobileMenu' => [ 'МобилноМени' ],
'MobileLanguages' => [ 'МобилниЈазици' ],
'Nearby' => [ 'ВоБлизина' ],
@@ -316,7 +297,6 @@
'MobileOptions' => [ 'മൊബൈൽഐച്ഛികങ്ങൾ' ],
'Uploads' => [ 'അപ്ലോഡുകൾ' ],
'MobileDiff' => [ 'മൊബൈൽവ്യത്യാസം' ],
- 'MobileEditor' => [ 'മൊബൈൽതിരുത്തൽ' ],
'MobileMenu' => [ 'മൊബൈൽമെനു' ],
'MobileLanguages' => [ 'മൊബൈൽഭാഷകൾ' ],
'Nearby' => [ 'സമീപസ്ഥം' ],
@@ -337,7 +317,6 @@
'History' => [ 'Geschiedenis' ],
'MobileOptions' => [ 'MobieleVoorkeuren' ],
'MobileDiff' => [ 'MobielVerschillen' ],
- 'MobileEditor' => [ 'MobielBewerken' ],
'MobileMenu' => [ 'MobielMenu' ],
'MobileLanguages' => [ 'MobielTalen' ],
'Nearby' => [ 'InDeBuurt' ],
@@ -413,7 +392,6 @@
'MobileOptions' => [ 'Tùy_chọn_di_động' ],
'Uploads' => [ 'Tập_tin_tải_lên' ],
'MobileDiff' => [ 'So_sánh_di_động' ],
- 'MobileEditor' => [ 'Sửa_đổi_di_động' ],
'MobileMenu' => [ 'Trình_đơn_di_động' ],
'MobileLanguages' => [ 'Ngôn_ngữ_di_động' ],
'Nearby' => [ 'Lân_cận', 'Kề_bên' ],
@@ -425,7 +403,6 @@
'MobileOptions' => [ '移动版选项', '手機版選項', '行動版選項' ],
'Uploads' => [ '上传', '上傳', '上載' ],
'MobileDiff' => [ '移动版差异', '手機版差異', '行動版差異' ],
- 'MobileEditor' => [ '移动版编辑器', '手機版編輯器', '行動版編輯器' ],
'MobileMenu' => [ '移动版菜单', '手機版菜單', '手機版選單', '行動版選單' ],
'MobileLanguages' => [ '移动版语言', '手機版語言', '行動版語言' ],
'Nearby' => [ '附近' ],
@@ -437,7 +414,6 @@
'MobileOptions' => [ '移动版选项' ],
'Uploads' => [ '上传' ],
'MobileDiff' => [ '移动版差异' ],
- 'MobileEditor' => [ '移动版编辑器' ],
'MobileMenu' => [ '移动版菜单' ],
'MobileLanguages' => [ '移动版语言' ],
'Nearby' => [ '附近' ],
@@ -449,7 +425,6 @@
'MobileOptions' => [ '行動版選項' ],
'Uploads' => [ '上載' ],
'MobileDiff' => [ '手機版差異' ],
- 'MobileEditor' => [ '手機版編輯器' ],
'MobileMenu' => [ '手機版選單' ],
'MobileLanguages' => [ '手機版語言' ],
'Nearby' => [ '附近' ],
diff --git a/README.md b/README.md
index 4569ab7..6c1f983 100644
--- a/README.md
+++ b/README.md
@@ -576,13 +576,6 @@
]
```
-#### $wgMFAllowNonJavaScriptEditing
-
-Adds support for non-JavaScript editing on mobile skins.
-
-* Type: `Boolean`
-* Default: `false`
-
#### $wgMFStripResponsiveImages
Whether to strip `srcset` attributes from all images on mobile renderings. This
diff --git a/extension.json b/extension.json
index ed9837f..0ea62e4 100644
--- a/extension.json
+++ b/extension.json
@@ -28,7 +28,6 @@
"History": "SpecialMobileHistory",
"MobileCite": "SpecialMobileCite",
"MobileDiff": "SpecialMobileDiff",
- "MobileEditor": "SpecialMobileEditor",
"MobileOptions": "SpecialMobileOptions",
"MobileMenu": "SpecialMobileMenu",
"MobileLanguages": "SpecialMobileLanguages",
@@ -66,7 +65,6 @@
"SpecialUploads": "includes/specials/SpecialUploads.php",
"SpecialMobileHistory":
"includes/specials/SpecialMobileHistory.php",
"SpecialMobileDiff": "includes/specials/SpecialMobileDiff.php",
- "SpecialMobileEditor":
"includes/specials/SpecialMobileEditor.php",
"SpecialMobileOptions":
"includes/specials/SpecialMobileOptions.php",
"SpecialMobileMenu": "includes/specials/SpecialMobileMenu.php",
"SpecialMobileWatchlist":
"includes/specials/SpecialMobileWatchlist.php",
@@ -1021,12 +1019,6 @@
"mobile-frontend-fontchanger-link"
]
},
- "mobile.special.mobileeditor.scripts": {
- "targets": "mobile",
- "scripts": [
-
"resources/mobile.special.mobileeditor.scripts/redirectmobileeditor.js"
- ]
- },
"mobile.special.nearby.styles": {
"targets": [
"mobile",
@@ -1200,9 +1192,6 @@
"BeforePageDisplay": [
"MobileFrontendHooks::onBeforePageDisplay"
],
- "CustomEditor": [
- "MobileFrontendHooks::onCustomEditor"
- ],
"GetPreferences": [
"MobileFrontendHooks::onGetPreferences"
],
@@ -1352,7 +1341,6 @@
},
"MFRSSFeedLink": false,
"MFSchemaEditSampleRate": 0.0625,
- "MFAllowNonJavaScriptEditing": false,
"MFStripResponsiveImages": true,
"MFResponsiveImageWhitelist": [
"image/svg+xml"
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index 5a9ad14..aaa75a5 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -681,7 +681,6 @@
$mfNoIndexPages = $config->get( 'MFNoindexPages' );
$mfMobileUrlTemplate = $context->getMobileUrlTemplate();
$lessVars = $config->get( 'ResourceLoaderLESSVars' );
- $noJsEditing = $config->get( 'MFAllowNonJavaScriptEditing' );
$title = $sk->getTitle();
$request = $context->getRequest();
@@ -779,7 +778,7 @@
// add fallback editor styles to action=edit page
$requestAction = $out->getRequest()->getVal( 'action' );
- if ( $noJsEditing && ( $requestAction === 'edit' ||
$requestAction === 'submit' ) ) {
+ if ( $requestAction === 'edit' || $requestAction ===
'submit' ) {
$out->addModuleStyles( [
'mobile.messageBox.styles'
] );
@@ -799,36 +798,6 @@
if ( $context->shouldDisplayMobileView() &&
!$context->getMFConfig()->get( 'MFRSSFeedLink' ) ) {
$tags = [];
}
- }
-
- /**
- * CustomEditor hook handler
- * @see https://www.mediawiki.org/wiki/Manual:Hooks/CustomEditor
- *
- * @param Article $article
- * @param User $user
- * @return bool
- */
- public static function onCustomEditor( $article, $user ) {
- $context = MobileContext::singleton();
-
- // redirect to Special:MobileEditor if no-JS editing disabled
- if ( !$context->getMFConfig()->get(
'MFAllowNonJavaScriptEditing' ) ) {
- // redirect to mobile editor instead of showing desktop
editor
- if ( $context->shouldDisplayMobileView() &&
!$context->getRequest()->wasPosted() ) {
- $output = $context->getOutput();
- $data = $output->getRequest()->getValues();
- // Unset these to avoid a redirect loop but
make sure we pass other
- // parameters to edit e.g. undo actions
- unset( $data['action'] );
- unset( $data['title'] );
-
- $output->redirect( SpecialPage::getTitleFor(
'MobileEditor', $article->getTitle() )
- ->getFullURL( $data ) );
- return false;
- }
- }
- return true;
}
/**
diff --git a/includes/specials/SpecialMobileEditor.php
b/includes/specials/SpecialMobileEditor.php
deleted file mode 100644
index e05e6f8..0000000
--- a/includes/specials/SpecialMobileEditor.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-/**
- * SpecialMobileEditor.php
- */
-
-/**
- * Provides a special page to redirect to the editor of an article page
- */
-class SpecialMobileEditor extends MobileSpecialPage {
- /**
- * Construct function
- */
- public function __construct() {
- parent::__construct( 'MobileEditor' );
- $this->listed = false;
- }
-
- /**
- * Render the special page and redirect the user to the editor (if page
exists)
- * @param string $subpage The name of the page to edit
- */
- public function executeWhenAvailable( $subpage ) {
- if ( !is_string( $subpage ) ) {
- $this->showPageNotFound();
- return;
- } else {
- $title = Title::newFromText( $subpage );
- if ( is_null( $title ) ) {
- $this->showPageNotFound();
- return;
- }
- }
-
- $data = $this->getRequest()->getValues();
- unset( $data['title'] ); // Remove the title of the special page
-
- $section = (int)$this->getRequest()->getVal( 'section', 0 );
-
- $output = $this->getOutput();
- $output->addModules( 'mobile.special.mobileeditor.scripts' );
- $output->setPageTitle( $this->msg(
'mobile-frontend-editor-redirect-title' )->text() );
-
- $context = MobileContext::singleton();
- $articleUrl = $context->getMobileUrl( $title->getFullURL( $data
) );
- $targetUrl = $articleUrl . '#/editor/' . $section;
-
- $html =
- Html::openElement( 'div',
- [
- 'id' => 'mw-mf-editor',
- 'data-targeturl' => $targetUrl
- ]
- ) .
- Html::openElement( 'noscript' ) .
- MobileUI::errorBox( $this->msg(
'mobile-frontend-editor-unavailable' )->text() ) .
- Html::openElement( 'p' ) .
- Html::element( 'a',
- [ 'href' => $title->getLocalUrl() ],
- $this->msg( 'returnto',
$title->getText() )->text() ) .
- Html::closeElement( 'noscript' ) .
- Html::closeElement( 'div' ); // #mw-mf-editorunavailable
-
- $output->addHTML( $html );
- }
-}
--
To view, visit https://gerrit.wikimedia.org/r/365997
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I33c990e8399174a59ab022e6ed770f8592680f71
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits