From: James D. Forrester Date: Thu, 20 Oct 2016 21:26:22 +0000 (-0700) Subject: Remove old "bulletin board style toolbar" from core X-Git-Tag: 1.34.0-rc.0~3678^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=cfa70ea6d003ae69d52aad67a543912449c71e00;p=lhc%2Fweb%2Fwiklou.git Remove old "bulletin board style toolbar" from core With this change, MediaWiki will no longer have a 'JavaScript-powered' wikitext toolbar, and instead sysadmins will be required to choose one (or more) of the several extensions available for this purpose if they need the functionality. For over half a decade MediaWiki's tarball has included the 2010-era replacement for this feature, WikiEditor. We are now working on replacing even that, with the 2013-era visual editor, a mode of which is the forthcoming 2017-era wikitext editor, and several more specialised editors like CodeEditor. Beyond this, the core editor toolbar is ancient, un-loved, and is used only exceptionally rarely, mostly by accident. It is unhelpful to give implicitly this as the primary editor for MediaWiki just because we've not removed it from core when it is not a very good experience for any kind of user, and has not received the attention that users deserve to be worth retaining in core. The old core preference, which was intended to govern whether this old toolbar should be shown, has since mutated into whether the to run the EditPageBeforeEditToolbar hook. The hook is used by several extensions to provide toolbars in lieu of the core one. This preference has been, in practice, a very confusing preference for MediaWiki users, who have to interact with quite similar preferences to toggle their real editor which sit next to this one on the preferences page. Consequently, this preference is also removed. The code could be made into an extension for those (very few) users of MediaWiki who might want to keep on using it. However, the author will offer their services but not their encouragement in said undertaking. Bug: T30856 Bug: T32795 Change-Id: I2b05f0ca25873ad8e0b33a5e4938bef52c4e9347 --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index 4ae590d215..0d8b4688a4 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -392,6 +392,26 @@ because of Phabricator reports. * ApiUsageException::getCodeString() (deprecated in 1.29) * ApiUsageException::getMessageArray() (deprecated in 1.29) * Class UsageException, deprecated in 1.29, has been removed. +* MediaWiki no longer has a 'JavaScript-powered' wikitext toolbar built in. The + old "bulletin board style toolbar", known as "the 2006 wikitext editor", has + been removed, and instead sysadmins will be required to choose one (or more) + of the several extensions available for this purpose if they need the + functionality. The MediaWiki "tarball" releases have included the replacement + extension for this, the WikiEditor extension aka "the 2010 wikitext editor", + for many years now. As part of this, several parts of MediaWiki have been + removed or simplified: + * The user option 'showtoolbar' (shown as "Show edit toolbar") is no longer + available; if an extension adds a toolbar via the EditPageBeforeEditToolbar + hook, it will be shown; extensions should provide a specific user preference + to disable themselves as needed. + * The public methods Language::getImageFile() and ::getImageFiles(), and the + related specification of $imageFiles within individual languages' code file, + as well as the referenced static media assets, all of which were only used + inside MediaWiki itself for providing the icons for the old toolbar, have + been removed without explicit deprecation. + * The internal ResourceLoader module "mediawiki.toolbar", which is unused + except by MediaWiki itself and back-compatibility code, has been removed. + * The internal ResourceLoaderEditToolbarModule class has been removed. === Deprecations in 1.32 === * HTMLForm::setSubmitProgressive() is deprecated. No need to call it. Submit diff --git a/autoload.php b/autoload.php index 3e6b4a20b7..125216b82c 100644 --- a/autoload.php +++ b/autoload.php @@ -1211,7 +1211,6 @@ $wgAutoloadLocalClasses = [ 'ResourceLoader' => __DIR__ . '/includes/resourceloader/ResourceLoader.php', 'ResourceLoaderClientHtml' => __DIR__ . '/includes/resourceloader/ResourceLoaderClientHtml.php', 'ResourceLoaderContext' => __DIR__ . '/includes/resourceloader/ResourceLoaderContext.php', - 'ResourceLoaderEditToolbarModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderEditToolbarModule.php', 'ResourceLoaderFileModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderFileModule.php', 'ResourceLoaderFilePath' => __DIR__ . '/includes/resourceloader/ResourceLoaderFilePath.php', 'ResourceLoaderForeignApiModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderForeignApiModule.php', diff --git a/docs/hooks.txt b/docs/hooks.txt index fd7b3005d7..5105cee78b 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1471,11 +1471,10 @@ textarea in the edit form. &$buttons: Array of edit buttons "Save", "Preview", "Live", and "Diff" &$tabindex: HTML tabindex of the last edit check/button -'EditPageBeforeEditToolbar': Allows modifying the edit toolbar above the -textarea in the edit form. -Hook subscribers can return false to avoid the default toolbar code being -loaded. -&$toolbar: The toolbar HTML +'EditPageBeforeEditToolbar': Allow adding an edit toolbar above the textarea in +the edit form. +&$toolbar: The toolbar HTML, initially an empty `
` +Hook subscribers can return false to have no toolbar HTML be loaded. 'EditPageCopyrightWarning': Allow for site and per-namespace customization of contribution/copyright notice. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 6a1ed925da..443346135d 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -4887,7 +4887,6 @@ $wgDefaultUserOptions = [ 'rows' => 25, // @deprecated since 1.29 No longer used in core 'showhiddencats' => 0, 'shownumberswatching' => 1, - 'showtoolbar' => 1, 'skin' => false, 'stubthreshold' => 0, 'thumbsize' => 5, diff --git a/includes/EditPage.php b/includes/EditPage.php index 7143c3f324..bb4243a9ab 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2479,13 +2479,6 @@ ERROR; $out->addModuleStyles( 'mediawiki.editfont.styles' ); $user = $this->context->getUser(); - if ( $user->getOption( 'showtoolbar' ) ) { - // The addition of default buttons is handled by getEditToolbar() which - // has its own dependency on this module. The call here ensures the module - // is loaded in time (it has position "top") for other modules to register - // buttons (e.g. extensions, gadgets, user scripts). - $out->addModules( 'mediawiki.toolbar' ); - } if ( $user->getOption( 'uselivepreview' ) ) { $out->addModules( 'mediawiki.action.edit.preview' ); @@ -2788,13 +2781,8 @@ ERROR; $out->addHTML( $this->editFormTextTop ); - $showToolbar = true; if ( $this->wasDeletedSinceLastEdit() ) { - if ( $this->formtype == 'save' ) { - // Hide the toolbar and edit area, user can click preview to get it back - // Add an confirmation checkbox and explanation. - $showToolbar = false; - } else { + if ( $this->formtype !== 'save' ) { $out->wrapWikiMsg( "
\n$1\n
", 'deletedwhileediting' ); } @@ -2932,7 +2920,7 @@ ERROR; $out->addHTML( $editConflictHelper->getEditFormHtmlBeforeContent() ); } - if ( !$this->mTitle->isUserConfigPage() && $showToolbar && $user->getOption( 'showtoolbar' ) ) { + if ( !$this->mTitle->isUserConfigPage() ) { $out->addHTML( self::getEditToolbar( $this->mTitle ) ); } @@ -4088,145 +4076,20 @@ ERROR; } /** - * Shows a bulletin board style toolbar for common editing functions. - * It can be disabled in the user preferences. + * Allow extensions to provide a toolbar. * * @param Title|null $title Title object for the page being edited (optional) - * @return string + * @return string|null */ public static function getEditToolbar( $title = null ) { - global $wgOut, $wgEnableUploads, $wgForeignFileRepos; - - $imagesAvailable = $wgEnableUploads || count( $wgForeignFileRepos ); - $showSignature = true; - if ( $title ) { - $showSignature = MWNamespace::wantSignatures( $title->getNamespace() ); - } - - $contLang = MediaWikiServices::getInstance()->getContentLanguage(); - - /** - * $toolarray is an array of arrays each of which includes the - * opening tag, the closing tag, optionally a sample text that is - * inserted between the two when no selection is highlighted - * and. The tip text is shown when the user moves the mouse - * over the button. - * - * Images are defined in ResourceLoaderEditToolbarModule. - */ - $toolarray = [ - [ - 'id' => 'mw-editbutton-bold', - 'open' => '\'\'\'', - 'close' => '\'\'\'', - 'sample' => wfMessage( 'bold_sample' )->text(), - 'tip' => wfMessage( 'bold_tip' )->text(), - ], - [ - 'id' => 'mw-editbutton-italic', - 'open' => '\'\'', - 'close' => '\'\'', - 'sample' => wfMessage( 'italic_sample' )->text(), - 'tip' => wfMessage( 'italic_tip' )->text(), - ], - [ - 'id' => 'mw-editbutton-link', - 'open' => '[[', - 'close' => ']]', - 'sample' => wfMessage( 'link_sample' )->text(), - 'tip' => wfMessage( 'link_tip' )->text(), - ], - [ - 'id' => 'mw-editbutton-extlink', - 'open' => '[', - 'close' => ']', - 'sample' => wfMessage( 'extlink_sample' )->text(), - 'tip' => wfMessage( 'extlink_tip' )->text(), - ], - [ - 'id' => 'mw-editbutton-headline', - 'open' => "\n== ", - 'close' => " ==\n", - 'sample' => wfMessage( 'headline_sample' )->text(), - 'tip' => wfMessage( 'headline_tip' )->text(), - ], - $imagesAvailable ? [ - 'id' => 'mw-editbutton-image', - 'open' => '[[' . $contLang->getNsText( NS_FILE ) . ':', - 'close' => ']]', - 'sample' => wfMessage( 'image_sample' )->text(), - 'tip' => wfMessage( 'image_tip' )->text(), - ] : false, - $imagesAvailable ? [ - 'id' => 'mw-editbutton-media', - 'open' => '[[' . $contLang->getNsText( NS_MEDIA ) . ':', - 'close' => ']]', - 'sample' => wfMessage( 'media_sample' )->text(), - 'tip' => wfMessage( 'media_tip' )->text(), - ] : false, - [ - 'id' => 'mw-editbutton-nowiki', - 'open' => "", - 'close' => "", - 'sample' => wfMessage( 'nowiki_sample' )->text(), - 'tip' => wfMessage( 'nowiki_tip' )->text(), - ], - $showSignature ? [ - 'id' => 'mw-editbutton-signature', - 'open' => wfMessage( 'sig-text', '~~~~' )->inContentLanguage()->text(), - 'close' => '', - 'sample' => '', - 'tip' => wfMessage( 'sig_tip' )->text(), - ] : false, - [ - 'id' => 'mw-editbutton-hr', - 'open' => "\n----\n", - 'close' => '', - 'sample' => '', - 'tip' => wfMessage( 'hr_tip' )->text(), - ] - ]; - - $script = ''; - foreach ( $toolarray as $tool ) { - if ( !$tool ) { - continue; - } - - $params = [ - // Images are defined in ResourceLoaderEditToolbarModule - false, - // Note that we use the tip both for the ALT tag and the TITLE tag of the image. - // Older browsers show a "speedtip" type message only for ALT. - // Ideally these should be different, realistically they - // probably don't need to be. - $tool['tip'], - $tool['open'], - $tool['close'], - $tool['sample'], - $tool['id'], - ]; + $startingToolbar = '
'; + $toolbar = $startingToolbar; - $script .= Xml::encodeJsCall( - 'mw.toolbar.addButton', - $params, - ResourceLoader::inDebugMode() - ); - } - - $toolbar = '
'; - - if ( Hooks::run( 'EditPageBeforeEditToolbar', [ &$toolbar ] ) ) { - // Only add the old toolbar cruft to the page payload if the toolbar has not - // been over-written by a hook caller - $nonce = $wgOut->getCSPNonce(); - $wgOut->addScript( Html::inlineScript( - ResourceLoader::makeInlineCodeWithModule( 'mediawiki.toolbar', $script ), - $nonce - ) ); + if ( !Hooks::run( 'EditPageBeforeEditToolbar', [ &$toolbar ] ) ) { + return null; }; - - return $toolbar; + // Don't add a pointless `
` to the page unless a hook caller populated it + return ( $toolbar === $startingToolbar ) ? null : $toolbar; } /** diff --git a/includes/resourceloader/ResourceLoaderEditToolbarModule.php b/includes/resourceloader/ResourceLoaderEditToolbarModule.php deleted file mode 100644 index 2a6af71502..0000000000 --- a/includes/resourceloader/ResourceLoaderEditToolbarModule.php +++ /dev/null @@ -1,44 +0,0 @@ -getLanguage() ); - foreach ( $language->getImageFiles() as $key => $value ) { - $vars[$key] = CSSMin::serializeStringValue( $value ); - } - return $vars; - } -} diff --git a/languages/Language.php b/languages/Language.php index fb78f13fc5..eabd0fef59 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -814,22 +814,6 @@ class Language { return self::$dataCache->getItem( $this->mCode, 'datePreferenceMigrationMap' ); } - /** - * @param string $image - * @return array|null - */ - function getImageFile( $image ) { - return self::$dataCache->getSubitem( $this->mCode, 'imageFiles', $image ); - } - - /** - * @return array - * @since 1.24 - */ - public function getImageFiles() { - return self::$dataCache->getItem( $this->mCode, 'imageFiles' ); - } - /** * @return array */ diff --git a/languages/i18n/en.json b/languages/i18n/en.json index ea6305423b..3929b8d940 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -11,7 +11,6 @@ "tog-extendwatchlist": "Expand watchlist to show all changes, not just the most recent", "tog-usenewrc": "Group changes by page in recent changes and watchlist", "tog-numberheadings": "Auto-number headings", - "tog-showtoolbar": "Show edit toolbar", "tog-editondblclick": "Edit pages on double click", "tog-editsectiononrightclick": "Enable section editing by right clicking on section titles", "tog-watchcreations": "Add pages I create and files I upload to my watchlist", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index a17cfca049..9cb4de0788 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -213,7 +213,6 @@ "tog-extendwatchlist": "[[Special:Preferences]], tab 'Watchlist'. Offers user to show all applicable changes in watchlist (by default only the last change to a page on the watchlist is shown). {{Gender}}", "tog-usenewrc": "{{Gender}}\nUsed as label for the checkbox in [[Special:Preferences]], tab \"Recent changes\".\n\nOffers user to use alternative representation of [[Special:RecentChanges]] and watchlist.", "tog-numberheadings": "[[Special:Preferences]], tab 'Misc'. Offers numbered headings on content pages to user. {{Gender}}", - "tog-showtoolbar": "{{Gender}}\n[[Special:Preferences]], tab 'Edit'. Offers user to show edit toolbar in page edit screen.\n\nThis is the toolbar: [[Image:Toolbar.png]]", "tog-editondblclick": "{{Gender}}\n[[Special:Preferences]], tab 'Edit'. Offers user to open edit page on double click.", "tog-editsectiononrightclick": "{{Gender}}\n[[Special:Preferences]], tab 'Edit'. Offers user to edit a section by clicking on a section title.", "tog-watchcreations": "[[Special:Preferences]], tab 'Watchlist'. Offers user to add created pages to watchlist. {{Gender}}", diff --git a/languages/messages/MessagesAr.php b/languages/messages/MessagesAr.php index 60be21c105..3a3529ab26 100644 --- a/languages/messages/MessagesAr.php +++ b/languages/messages/MessagesAr.php @@ -439,11 +439,3 @@ $specialPageAliases = [ * Arabic trails too. */ $linkTrail = '/^([a-zء-ي]+)(.*)$/sDu'; - -$imageFiles = [ - 'button-bold' => 'ar/button_bold.png', - 'button-italic' => 'ar/button_italic.png', - 'button-link' => 'ar/button_link.png', - 'button-headline' => 'ar/button_headline.png', - 'button-nowiki' => 'ar/button_nowiki.png', -]; diff --git a/languages/messages/MessagesBe_tarask.php b/languages/messages/MessagesBe_tarask.php index 00295fef87..21bd60c1ac 100644 --- a/languages/messages/MessagesBe_tarask.php +++ b/languages/messages/MessagesBe_tarask.php @@ -239,9 +239,3 @@ $separatorTransformTable = [ $minimumGroupingDigits = 2; $linkTrail = '/^([абвгґджзеёжзійклмнопрстуўфхцчшыьэюяćčłńśšŭźža-z]+)(.*)$/sDu'; - -$imageFiles = [ - 'button-bold' => 'be-tarask/button_bold.png', - 'button-italic' => 'be-tarask/button_italic.png', - 'button-link' => 'be-tarask/button_link.png', -]; diff --git a/languages/messages/MessagesDe.php b/languages/messages/MessagesDe.php index 5227eba842..d3167cc977 100644 --- a/languages/messages/MessagesDe.php +++ b/languages/messages/MessagesDe.php @@ -352,8 +352,3 @@ $bookstoreList = [ $separatorTransformTable = [ ',' => '.', '.' => ',' ]; $linkTrail = '/^([äöüßa-z]+)(.*)$/sDu'; - -$imageFiles = [ - 'button-bold' => 'de/button_bold.png', - 'button-italic' => 'de/button_italic.png', -]; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 7a7370f81e..4c078a61d6 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -531,23 +531,6 @@ $linkTrail = '/^([a-z]+)(.*)$/sD'; */ $linkPrefixCharset = 'a-zA-Z\\x{80}-\\x{10ffff}'; -/** - * List of filenames for some ui images that can be overridden per language - * basis if needed. - */ -$imageFiles = [ - 'button-bold' => 'en/button_bold.png', - 'button-italic' => 'en/button_italic.png', - 'button-link' => 'en/button_link.png', - 'button-extlink' => 'en/button_extlink.png', - 'button-headline' => 'en/button_headline.png', - 'button-image' => 'en/button_image.png', - 'button-media' => 'en/button_media.png', - 'button-nowiki' => 'en/button_nowiki.png', - 'button-sig' => 'en/button_sig.png', - 'button-hr' => 'en/button_hr.png', -]; - /** * A list of messages to preload for each request. * Here we add messages that are needed for a typical anonymous parser cache hit. diff --git a/languages/messages/MessagesFa.php b/languages/messages/MessagesFa.php index bda468cba4..a78233f439 100644 --- a/languages/messages/MessagesFa.php +++ b/languages/messages/MessagesFa.php @@ -412,11 +412,3 @@ $dateFormats = [ # Harakat are intentionally not included in the linkTrail. Their addition should # take place after enough tests. $linkTrail = "/^([ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهیآأئؤة‌]+)(.*)$/sDu"; - -$imageFiles = [ - 'button-bold' => 'fa/button_bold.png', - 'button-italic' => 'fa/button_italic.png', - 'button-link' => 'fa/button_link.png', - 'button-headline' => 'fa/button_headline.png', - 'button-nowiki' => 'fa/button_nowiki.png', -]; diff --git a/languages/messages/MessagesKsh.php b/languages/messages/MessagesKsh.php index c96c94df57..0687a42442 100644 --- a/languages/messages/MessagesKsh.php +++ b/languages/messages/MessagesKsh.php @@ -201,7 +201,3 @@ $magicWords = [ 'language' => [ '0', '#SHPROOCH:', '#SPROCH:', '#SPRACHE:', '#LANGUAGE:' ], 'hiddencat' => [ '1', '__VERSHTOCHE_SAACHJRUPP__', '__VERSTECKTE_KATEGORIE__', '__WARTUNGSKATEGORIE__', '__HIDDENCAT__' ], ]; - -$imageFiles = [ - 'button-italic' => 'ksh/button_italic.png', -]; diff --git a/languages/messages/MessagesRu.php b/languages/messages/MessagesRu.php index b513648810..fbd8096d80 100644 --- a/languages/messages/MessagesRu.php +++ b/languages/messages/MessagesRu.php @@ -425,10 +425,4 @@ $minimumGroupingDigits = 2; $fallback8bitEncoding = 'windows-1251'; $linkPrefixExtension = false; -$imageFiles = [ - 'button-bold' => 'ru/button_bold.png', - 'button-italic' => 'ru/button_italic.png', - 'button-link' => 'ru/button_link.png', -]; - $linkTrail = '/^([a-zабвгдеёжзийклмнопрстуфхцчшщъыьэюя]+)(.*)$/sDu'; diff --git a/maintenance/dictionary/mediawiki.dic b/maintenance/dictionary/mediawiki.dic index a0177b1737..0345ad62a3 100644 --- a/maintenance/dictionary/mediawiki.dic +++ b/maintenance/dictionary/mediawiki.dic @@ -3697,7 +3697,6 @@ showredirs showreviewed showsizediff showtoc -showtoolbar showunreviewed shtml si diff --git a/maintenance/jsduck/categories.json b/maintenance/jsduck/categories.json index 7ff972e8dd..54c1d38805 100644 --- a/maintenance/jsduck/categories.json +++ b/maintenance/jsduck/categories.json @@ -38,10 +38,6 @@ "mw.visibleTimeout" ] }, - { - "name": "Actions", - "classes": ["mw.toolbar"] - }, { "name": "API", "classes": ["mw.Api*", "mw.ForeignApi*"] diff --git a/resources/Resources.php b/resources/Resources.php index 9603830b84..7d2ed144df 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1394,12 +1394,6 @@ return [ 'dependencies' => 'jquery.cookie', 'targets' => [ 'desktop', 'mobile' ], ], - 'mediawiki.toolbar' => [ - 'class' => ResourceLoaderEditToolbarModule::class, - 'scripts' => 'resources/src/mediawiki.toolbar/toolbar.js', - 'styles' => 'resources/src/mediawiki.toolbar/toolbar.less', - 'dependencies' => 'jquery.textSelection', - ], 'mediawiki.experiments' => [ 'scripts' => 'resources/src/mediawiki.experiments.js', 'targets' => [ 'desktop', 'mobile' ], diff --git a/resources/src/mediawiki.toolbar/images/ar/button_bold.png b/resources/src/mediawiki.toolbar/images/ar/button_bold.png deleted file mode 100644 index 50e2ff034d..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/ar/button_bold.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/ar/button_headline.png b/resources/src/mediawiki.toolbar/images/ar/button_headline.png deleted file mode 100644 index 2e3e7819ac..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/ar/button_headline.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/ar/button_italic.png b/resources/src/mediawiki.toolbar/images/ar/button_italic.png deleted file mode 100644 index 6b54fb613d..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/ar/button_italic.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/ar/button_link.png b/resources/src/mediawiki.toolbar/images/ar/button_link.png deleted file mode 100644 index 4434e7f5ee..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/ar/button_link.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/ar/button_nowiki.png b/resources/src/mediawiki.toolbar/images/ar/button_nowiki.png deleted file mode 100644 index c9378de1d7..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/ar/button_nowiki.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/be-tarask/button_bold.png b/resources/src/mediawiki.toolbar/images/be-tarask/button_bold.png deleted file mode 100644 index df6700dd62..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/be-tarask/button_bold.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/be-tarask/button_italic.png b/resources/src/mediawiki.toolbar/images/be-tarask/button_italic.png deleted file mode 100644 index 872c00f1dc..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/be-tarask/button_italic.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/be-tarask/button_link.png b/resources/src/mediawiki.toolbar/images/be-tarask/button_link.png deleted file mode 100644 index d3dd88e6c8..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/be-tarask/button_link.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/de/button_bold.png b/resources/src/mediawiki.toolbar/images/de/button_bold.png deleted file mode 100644 index 8e6b389a4b..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/de/button_bold.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/de/button_italic.png b/resources/src/mediawiki.toolbar/images/de/button_italic.png deleted file mode 100644 index 5e3cd111f1..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/de/button_italic.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/en/button_bold.png b/resources/src/mediawiki.toolbar/images/en/button_bold.png deleted file mode 100644 index e582fb1ad2..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/en/button_bold.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/en/button_extlink.png b/resources/src/mediawiki.toolbar/images/en/button_extlink.png deleted file mode 100644 index 458943c1d1..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/en/button_extlink.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/en/button_headline.png b/resources/src/mediawiki.toolbar/images/en/button_headline.png deleted file mode 100644 index 7d64a16400..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/en/button_headline.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/en/button_hr.png b/resources/src/mediawiki.toolbar/images/en/button_hr.png deleted file mode 100644 index 47e1ca4013..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/en/button_hr.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/en/button_image.png b/resources/src/mediawiki.toolbar/images/en/button_image.png deleted file mode 100644 index 69192965c4..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/en/button_image.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/en/button_italic.png b/resources/src/mediawiki.toolbar/images/en/button_italic.png deleted file mode 100644 index 820efe26bd..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/en/button_italic.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/en/button_link.png b/resources/src/mediawiki.toolbar/images/en/button_link.png deleted file mode 100644 index 5dd362cf64..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/en/button_link.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/en/button_media.png b/resources/src/mediawiki.toolbar/images/en/button_media.png deleted file mode 100644 index 80c3156c6c..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/en/button_media.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/en/button_nowiki.png b/resources/src/mediawiki.toolbar/images/en/button_nowiki.png deleted file mode 100644 index 05a977af5a..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/en/button_nowiki.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/en/button_sig.png b/resources/src/mediawiki.toolbar/images/en/button_sig.png deleted file mode 100644 index 2cbcc0b31a..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/en/button_sig.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/fa/button_bold.png b/resources/src/mediawiki.toolbar/images/fa/button_bold.png deleted file mode 100644 index 54893430e4..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/fa/button_bold.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/fa/button_headline.png b/resources/src/mediawiki.toolbar/images/fa/button_headline.png deleted file mode 100644 index 4d48a5d18f..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/fa/button_headline.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/fa/button_italic.png b/resources/src/mediawiki.toolbar/images/fa/button_italic.png deleted file mode 100644 index 41098c7d71..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/fa/button_italic.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/fa/button_link.png b/resources/src/mediawiki.toolbar/images/fa/button_link.png deleted file mode 100644 index 8c2d85a7af..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/fa/button_link.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/fa/button_nowiki.png b/resources/src/mediawiki.toolbar/images/fa/button_nowiki.png deleted file mode 100644 index c9378de1d7..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/fa/button_nowiki.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/ksh/LICENSE b/resources/src/mediawiki.toolbar/images/ksh/LICENSE deleted file mode 100644 index 640bbff802..0000000000 --- a/resources/src/mediawiki.toolbar/images/ksh/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ - -button_italic.png -------------------- -Source : https://commons.wikimedia.org/wiki/Image:Button_S_italic.png -License: Public domain -Author : Purodha Blissenbach, https://ksh.wikipedia.org/wiki/User:Purodha - diff --git a/resources/src/mediawiki.toolbar/images/ksh/button_italic.png b/resources/src/mediawiki.toolbar/images/ksh/button_italic.png deleted file mode 100644 index 34268d9a84..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/ksh/button_italic.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/ru/LICENSE b/resources/src/mediawiki.toolbar/images/ru/LICENSE deleted file mode 100644 index 572864b1e8..0000000000 --- a/resources/src/mediawiki.toolbar/images/ru/LICENSE +++ /dev/null @@ -1,17 +0,0 @@ -button_bold.png ---------------- -Source : https://commons.wikimedia.org/wiki/File:Button_bold_ukr.png -License: Public domain -Author : Alexey Belomoev - -button_italic.png ------------------------- -Source : https://commons.wikimedia.org/wiki/File:Button_italic_ukr.png -License: Public domain -Author : Alexey Belomoev - -button_link.png ------------------ -Source : https://commons.wikimedia.org/wiki/File:Button_internal_link_ukr.png -License: GPL -Author : Saproj, Erik Möller diff --git a/resources/src/mediawiki.toolbar/images/ru/button_bold.png b/resources/src/mediawiki.toolbar/images/ru/button_bold.png deleted file mode 100644 index a7dceb1621..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/ru/button_bold.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/ru/button_italic.png b/resources/src/mediawiki.toolbar/images/ru/button_italic.png deleted file mode 100644 index 44a0a74145..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/ru/button_italic.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/images/ru/button_link.png b/resources/src/mediawiki.toolbar/images/ru/button_link.png deleted file mode 100644 index 36b90596f9..0000000000 Binary files a/resources/src/mediawiki.toolbar/images/ru/button_link.png and /dev/null differ diff --git a/resources/src/mediawiki.toolbar/toolbar.js b/resources/src/mediawiki.toolbar/toolbar.js deleted file mode 100644 index be49d26b6e..0000000000 --- a/resources/src/mediawiki.toolbar/toolbar.js +++ /dev/null @@ -1,208 +0,0 @@ -/** - * Interface for the classic edit toolbar. - * - * @class mw.toolbar - * @singleton - */ -( function () { - var toolbar, isReady, $toolbar, queue, slice, $currentFocused; - - /** - * Internal helper that does the actual insertion of the button into the toolbar. - * - * For backwards-compatibility, passing `imageFile`, `speedTip`, `tagOpen`, `tagClose`, - * `sampleText` and `imageId` as separate arguments (in this order) is also supported. - * - * @private - * - * @param {Object} button Object with the following properties. - * You are required to provide *either* the `onClick` parameter, or the three parameters - * `tagOpen`, `tagClose` and `sampleText`, but not both (they're mutually exclusive). - * @param {string} [button.imageFile] Image to use for the button. - * @param {string} button.speedTip Tooltip displayed when user mouses over the button. - * @param {Function} [button.onClick] Function to be executed when the button is clicked. - * @param {string} [button.tagOpen] - * @param {string} [button.tagClose] - * @param {string} [button.sampleText] Alternative to `onClick`. `tagOpen`, `tagClose` and - * `sampleText` together provide the markup that should be inserted into page text at - * current cursor position. - * @param {string} [button.imageId] `id` attribute of the button HTML element. Can be - * used to define the image with CSS if it's not provided as `imageFile`. - * @param {string} [speedTip] - * @param {string} [tagOpen] - * @param {string} [tagClose] - * @param {string} [sampleText] - * @param {string} [imageId] - */ - function insertButton( button, speedTip, tagOpen, tagClose, sampleText, imageId ) { - var $button; - - // Backwards compatibility - if ( typeof button !== 'object' ) { - button = { - imageFile: button, - speedTip: speedTip, - tagOpen: tagOpen, - tagClose: tagClose, - sampleText: sampleText, - imageId: imageId - }; - } - - if ( button.imageFile ) { - $button = $( '' ).attr( { - src: button.imageFile, - alt: button.speedTip, - title: button.speedTip, - id: button.imageId || undefined, - 'class': 'mw-toolbar-editbutton' - } ); - } else { - $button = $( '
' ).attr( { - title: button.speedTip, - id: button.imageId || undefined, - 'class': 'mw-toolbar-editbutton' - } ); - } - - $button.click( function ( e ) { - if ( button.onClick !== undefined ) { - button.onClick( e ); - } else { - toolbar.insertTags( button.tagOpen, button.tagClose, button.sampleText ); - } - - return false; - } ); - - $toolbar.append( $button ); - } - - isReady = false; - $toolbar = false; - - /** - * @private - * @property {Array} - * Contains button objects (and for backwards compatibility, it can - * also contains an arguments array for insertButton). - */ - queue = []; - slice = queue.slice; - - toolbar = { - - /** - * Add buttons to the toolbar. - * - * Takes care of race conditions and time-based dependencies by placing buttons in a queue if - * this method is called before the toolbar is created. - * - * For backwards-compatibility, passing `imageFile`, `speedTip`, `tagOpen`, `tagClose`, - * `sampleText` and `imageId` as separate arguments (in this order) is also supported. - * - * @inheritdoc #insertButton - */ - addButton: function () { - if ( isReady ) { - insertButton.apply( toolbar, arguments ); - } else { - // Convert arguments list to array - queue.push( slice.call( arguments ) ); - } - }, - - /** - * Add multiple buttons to the toolbar (see also #addButton). - * - * Example usage: - * - * addButtons( [ { .. }, { .. }, { .. } ] ); - * addButtons( { .. }, { .. } ); - * - * @param {...Object|Array} [buttons] An array of button objects or the first - * button object in a list of variadic arguments. - */ - addButtons: function ( buttons ) { - if ( !Array.isArray( buttons ) ) { - buttons = slice.call( arguments ); - } - if ( isReady ) { - buttons.forEach( function ( button ) { - insertButton( button ); - } ); - } else { - // Push each button into the queue - queue.push.apply( queue, buttons ); - } - }, - - /** - * Apply tagOpen/tagClose to selection in currently focused textarea. - * - * Uses `sampleText` if selection is empty. - * - * @param {string} tagOpen - * @param {string} tagClose - * @param {string} sampleText - */ - insertTags: function ( tagOpen, tagClose, sampleText ) { - if ( $currentFocused && $currentFocused.length ) { - $currentFocused.textSelection( - 'encapsulateSelection', { - pre: tagOpen, - peri: sampleText, - post: tagClose - } - ); - } - } - }; - - // Legacy (for compatibility with the code previously in skins/common.edit.js) - mw.log.deprecate( window, 'addButton', toolbar.addButton, 'Use mw.toolbar.addButton instead.' ); - mw.log.deprecate( window, 'insertTags', toolbar.insertTags, 'Use mw.toolbar.insertTags instead.' ); - - // For backwards compatibility. Used to be called from EditPage.php, maybe other places as well. - toolbar.init = $.noop; - - // Expose API publicly - // @deprecated since MW 1.29 - mw.log.deprecate( mw, 'toolbar', toolbar, null, 'mw.toolbar' ); - - $( function () { - var i, button; - - // Used to determine where to insert tags - $currentFocused = $( '#wpTextbox1' ); - - // Populate the selector cache for $toolbar - $toolbar = $( '#toolbar' ); - - for ( i = 0; i < queue.length; i++ ) { - button = queue[ i ]; - if ( Array.isArray( button ) ) { - // Forwarded arguments array from mw.toolbar.addButton - insertButton.apply( toolbar, button ); - } else { - // Raw object from mw.toolbar.addButtons - insertButton( button ); - } - } - - // Clear queue - queue.length = 0; - - // This causes further calls to addButton to go to insertion directly - // instead of to the queue. - // It is important that this is after the one and only loop through - // the queue - isReady = true; - - // Apply to dynamically created textboxes as well as normal ones - $( document ).on( 'focus', 'textarea, input:text', function () { - $currentFocused = $( this ); - } ); - } ); - -}() ); diff --git a/resources/src/mediawiki.toolbar/toolbar.less b/resources/src/mediawiki.toolbar/toolbar.less deleted file mode 100644 index 93ea294b0e..0000000000 --- a/resources/src/mediawiki.toolbar/toolbar.less +++ /dev/null @@ -1,42 +0,0 @@ -@import 'mediawiki.mixins'; - -#mw-editbutton-bold { - .background-image('images/@{button-bold}'); -} - -#mw-editbutton-italic { - .background-image('images/@{button-italic}'); -} - -#mw-editbutton-link { - .background-image('images/@{button-link}'); -} - -#mw-editbutton-extlink { - .background-image('images/@{button-extlink}'); -} - -#mw-editbutton-headline { - .background-image('images/@{button-headline}'); -} - -#mw-editbutton-image { - .background-image('images/@{button-image}'); -} - -#mw-editbutton-media { - .background-image('images/@{button-media}'); -} - -#mw-editbutton-nowiki { - .background-image('images/@{button-nowiki}'); -} - -// Who decided to make only this single one different than the name of the data item? -#mw-editbutton-signature { - .background-image('images/@{button-sig}'); -} - -#mw-editbutton-hr { - .background-image('images/@{button-hr}'); -}