diff options
author | Brian Evans <grknight@gentoo.org> | 2018-11-20 10:51:06 -0500 |
---|---|---|
committer | Brian Evans <grknight@gentoo.org> | 2018-11-20 10:51:06 -0500 |
commit | 1ea74fa59d8d1c6c12d20be6c8e7d5ac7f370fdb (patch) | |
tree | ad113bd05db878a61b503938c05fe046eca25ee0 /MLEB/CleanChanges | |
parent | LinkAttributes: Update to v0.2 (diff) | |
download | extensions-1ea74fa59d8d1c6c12d20be6c8e7d5ac7f370fdb.tar.gz extensions-1ea74fa59d8d1c6c12d20be6c8e7d5ac7f370fdb.tar.bz2 extensions-1ea74fa59d8d1c6c12d20be6c8e7d5ac7f370fdb.zip |
Update to MediaWikiLanguageExtensionBundle-2018.10
Signed-off-by: Brian Evans <grknight@gentoo.org>
Diffstat (limited to 'MLEB/CleanChanges')
52 files changed, 422 insertions, 527 deletions
diff --git a/MLEB/CleanChanges/.idea/.name b/MLEB/CleanChanges/.idea/.name deleted file mode 100644 index 9de73e2d..00000000 --- a/MLEB/CleanChanges/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -CleanChanges
\ No newline at end of file diff --git a/MLEB/CleanChanges/.idea/CleanChanges.iml b/MLEB/CleanChanges/.idea/CleanChanges.iml deleted file mode 100644 index 6b8184f8..00000000 --- a/MLEB/CleanChanges/.idea/CleanChanges.iml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module type="WEB_MODULE" version="4"> - <component name="NewModuleRootManager"> - <content url="file://$MODULE_DIR$" /> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - </component> -</module> - diff --git a/MLEB/CleanChanges/.idea/encodings.xml b/MLEB/CleanChanges/.idea/encodings.xml deleted file mode 100644 index e206d70d..00000000 --- a/MLEB/CleanChanges/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> -</project> - diff --git a/MLEB/CleanChanges/.idea/misc.xml b/MLEB/CleanChanges/.idea/misc.xml deleted file mode 100644 index 1162f438..00000000 --- a/MLEB/CleanChanges/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="ProjectRootManager" version="2" /> -</project> - diff --git a/MLEB/CleanChanges/.idea/modules.xml b/MLEB/CleanChanges/.idea/modules.xml deleted file mode 100644 index 7f086057..00000000 --- a/MLEB/CleanChanges/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="ProjectModuleManager"> - <modules> - <module fileurl="file://$PROJECT_DIR$/.idea/CleanChanges.iml" filepath="$PROJECT_DIR$/.idea/CleanChanges.iml" /> - </modules> - </component> -</project> - diff --git a/MLEB/CleanChanges/.idea/scopes/scope_settings.xml b/MLEB/CleanChanges/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b8..00000000 --- a/MLEB/CleanChanges/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ -<component name="DependencyValidationManager"> - <state> - <option name="SKIP_IMPORT_STATEMENTS" value="false" /> - </state> -</component>
\ No newline at end of file diff --git a/MLEB/CleanChanges/.idea/vcs.xml b/MLEB/CleanChanges/.idea/vcs.xml deleted file mode 100644 index c80f2198..00000000 --- a/MLEB/CleanChanges/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="VcsDirectoryMappings"> - <mapping directory="$PROJECT_DIR$" vcs="Git" /> - </component> -</project> - diff --git a/MLEB/CleanChanges/.idea/workspace.xml b/MLEB/CleanChanges/.idea/workspace.xml deleted file mode 100644 index bb21c3f6..00000000 --- a/MLEB/CleanChanges/.idea/workspace.xml +++ /dev/null @@ -1,172 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="ChangeListManager"> - <list default="true" id="476fbbcd-ad4f-42c2-9dc7-904fc7d5c9b9" name="Default" comment="" /> - <ignored path="CleanChanges.iws" /> - <ignored path=".idea/workspace.xml" /> - <option name="TRACKING_ENABLED" value="true" /> - <option name="SHOW_DIALOG" value="false" /> - <option name="HIGHLIGHT_CONFLICTS" value="true" /> - <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> - <option name="LAST_RESOLUTION" value="IGNORE" /> - </component> - <component name="ChangesViewManager" flattened_view="true" show_ignored="false" /> - <component name="CreatePatchCommitExecutor"> - <option name="PATCH_PATH" value="" /> - </component> - <component name="DaemonCodeAnalyzer"> - <disable_hints /> - </component> - <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> - <component name="FavoritesManager"> - <favorites_list name="CleanChanges" /> - </component> - <component name="FileEditorManager"> - <leaf /> - </component> - <component name="FindManager"> - <FindUsagesManager> - <setting name="OPEN_NEW_TAB" value="false" /> - </FindUsagesManager> - </component> - <component name="Git.Settings"> - <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> - </component> - <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> - <component name="ProjectFrameBounds"> - <option name="y" value="14" /> - <option name="width" value="1278" /> - <option name="height" value="770" /> - </component> - <component name="ProjectLevelVcsManager" settingsEditedManually="false"> - <OptionsSetting value="true" id="Add" /> - <OptionsSetting value="true" id="Remove" /> - <OptionsSetting value="true" id="Checkout" /> - <OptionsSetting value="true" id="Update" /> - <OptionsSetting value="true" id="Status" /> - <OptionsSetting value="true" id="Edit" /> - <ConfirmationsSetting value="0" id="Add" /> - <ConfirmationsSetting value="0" id="Remove" /> - </component> - <component name="ProjectReloadState"> - <option name="STATE" value="0" /> - </component> - <component name="ProjectView"> - <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5"> - <flattenPackages /> - <showMembers /> - <showModules /> - <showLibraryContents /> - <hideEmptyPackages /> - <abbreviatePackageNames /> - <autoscrollToSource /> - <autoscrollFromSource /> - <sortByType /> - </navigator> - <panes> - <pane id="Scope" /> - <pane id="ProjectPane"> - <subPane> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="CleanChanges" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="CleanChanges" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="CleanChanges" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - </subPane> - </pane> - </panes> - </component> - <component name="PropertiesComponent"> - <property name="options.lastSelected" value="web-ide.project.structure" /> - <property name="options.splitter.main.proportions" value="0.3" /> - <property name="options.splitter.details.proportions" value="0.2" /> - <property name="options.searchVisible" value="true" /> - <property name="WebServerToolWindowFactoryState" value="false" /> - </component> - <component name="RunManager"> - <configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit"> - <TestRunner /> - <method /> - </configuration> - <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console"> - <method /> - </configuration> - <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug" singleton="true"> - <method /> - </configuration> - <configuration default="true" type="PhpUnitRemoteRunConfigurationType" factoryName="PHPUnit on Server"> - <method /> - </configuration> - <list size="0" /> - </component> - <component name="ShelveChangesManager" show_recycled="false" /> - <component name="TaskManager"> - <task active="true" id="Default" summary="Default task"> - <changelist id="476fbbcd-ad4f-42c2-9dc7-904fc7d5c9b9" name="Default" comment="" /> - <created>1387983990054</created> - <updated>1387983990054</updated> - </task> - <servers /> - </component> - <component name="ToolWindowManager"> - <frame x="0" y="14" width="1278" height="770" extended-state="0" /> - <editor active="false" /> - <layout> - <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> - <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> - <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> - <window_info id="Find" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32892805" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> - <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> - <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> - <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" /> - <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" /> - <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> - <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> - <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> - <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> - <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> - <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> - <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> - </layout> - </component> - <component name="Vcs.Log.UiProperties"> - <option name="RECENTLY_FILTERED_USERS"> - <collection /> - </option> - </component> - <component name="VcsContentAnnotationSettings"> - <option name="myLimit" value="2678400000" /> - </component> - <component name="VcsManagerConfiguration"> - <option name="myTodoPanelSettings"> - <TodoPanelSettings /> - </option> - </component> - <component name="XDebuggerManager"> - <breakpoint-manager /> - </component> - <component name="editorHistoryManager"> - <entry file="file://$PROJECT_DIR$/CleanChanges_body.php"> - <provider selected="true" editor-type-id="text-editor"> - <state line="85" column="23" selection-start="1859" selection-end="1859" vertical-scroll-proportion="0.33333334" vertical-offset="1153" max-vertical-offset="9990"> - <folding /> - </state> - </provider> - </entry> - </component> -</project> - diff --git a/MLEB/CleanChanges/.jshintrc b/MLEB/CleanChanges/.jshintrc index 0967ef42..31ce9424 100644 --- a/MLEB/CleanChanges/.jshintrc +++ b/MLEB/CleanChanges/.jshintrc @@ -1 +1,20 @@ -{} +{ + "bitwise": true, + "curly": true, + "eqeqeq": true, + "forin": false, + "freeze": true, + "latedef": true, + "noarg": true, + "nonew": true, + "onevar": true, + "strict": true, + "undef": true, + "unused": true, + "browser": true, + "predef": [ + "mediaWiki", + "jQuery", + "QUnit" + ] +} diff --git a/MLEB/CleanChanges/CleanChanges.i18n.php b/MLEB/CleanChanges/CleanChanges.i18n.php deleted file mode 100644 index 17bcda67..00000000 --- a/MLEB/CleanChanges/CleanChanges.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * This is a backwards-compatibility shim, generated by: - * https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShimd87671d4445e53f6' ) ) { - function wfJsonI18nShimd87671d4445e53f6( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShimd87671d4445e53f6'; -} diff --git a/MLEB/CleanChanges/CleanChanges.php b/MLEB/CleanChanges/CleanChanges.php index 7a9d5c5c..fe520cd8 100644 --- a/MLEB/CleanChanges/CleanChanges.php +++ b/MLEB/CleanChanges/CleanChanges.php @@ -1,55 +1,14 @@ <?php -if ( !defined( 'MEDIAWIKI' ) ) die(); -/** - * An extension to show a nice compact changes list and few extra filters for - * Special:RecentChanges.php - * - * @file - * @ingroup Extensions - * - * @author Niklas Laxström - * @copyright Copyright © 2008-2012, Niklas Laxström - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later - */ - -/* Set up messages and includes */ -$dir = __DIR__; -$wgMessagesDirs['CleanChanges'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['CleanChanges'] = "$dir/CleanChanges.i18n.php"; -$wgAutoloadClasses['NCL'] = "$dir/CleanChanges_body.php"; - -require_once __DIR__ . '/Resources.php'; - -/* Hook into code */ -$wgHooks['FetchChangesList'][] = 'NCL::hook'; -$wgHooks['MakeGlobalVariablesScript'][] = 'NCL::addScriptVariables'; - -/* Extension information */ -$wgExtensionCredits['other'][] = array( - 'path' => __FILE__, - 'name' => 'Clean Changes', - 'version' => '[https://www.mediawiki.org/wiki/MLEB MLEB 2015.04]', - 'author' => 'Niklas Laxström', - 'descriptionmsg' => 'cleanchanges-desc', - 'url' => 'https://www.mediawiki.org/wiki/Extension:CleanChanges', - 'license-name' => 'GPL-2.0+', -); - -$wgCCUserFilter = true; -$wgCCTrailerFilter = false; - -$wgExtensionFunctions[] = 'ccSetupFilters'; -$wgAutoloadClasses['CCFilters'] = "$dir/Filters.php"; - -function ccSetupFilters() { - global $wgCCUserFilter, $wgCCTrailerFilter, $wgHooks; - - if ( $wgCCUserFilter ) { - $wgHooks['SpecialRecentChangesQuery'][] = 'CCFilters::user'; - $wgHooks['SpecialRecentChangesPanel'][] = 'CCFilters::userForm'; - } - if ( $wgCCTrailerFilter ) { - $wgHooks['SpecialRecentChangesQuery'][] = 'CCFilters::trailer'; - $wgHooks['SpecialRecentChangesPanel'][] = 'CCFilters::trailerForm'; - } +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'CleanChanges' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['CleanChanges'] = __DIR__ . '/i18n'; + /* wfWarn( + 'Deprecated PHP entry point used for CleanChanges extension. ' . + 'Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + ); */ + return; +} else { + die( 'This version of the CleanChanges extension requires MediaWiki 1.25+' ); } diff --git a/MLEB/CleanChanges/CleanChanges_body.php b/MLEB/CleanChanges/CleanChanges_body.php index 05806614..a9e6a967 100644 --- a/MLEB/CleanChanges/CleanChanges_body.php +++ b/MLEB/CleanChanges/CleanChanges_body.php @@ -6,14 +6,24 @@ class NCL extends EnhancedChangesList { /** * Determines which version of changes list to provide, or none. + * @param User $user + * @param Skin $skin + * @param array &$list + * @return bool */ - public static function hook( User $user, Skin &$skin, &$list ) { + public static function hook( User $user, Skin $skin, &$list ) { + global $wgCCTrailerFilter, $wgCCFiltersOnly; + $list = null; - if ( defined( 'ULS_VERSION' ) ) { + if ( $wgCCTrailerFilter && defined( 'ULS_VERSION' ) ) { $skin->getOutput()->addModules( 'ext.cleanchanges.uls' ); } + if ( $wgCCFiltersOnly ) { + return; + } + /* allow override */ $request = $skin->getRequest(); if ( $request->getBool( 'cleanrc' ) ) { @@ -38,10 +48,10 @@ class NCL extends EnhancedChangesList { return $list === null; } - protected static $userinfo = array(); + protected static $userinfo = []; /** - * @param $vars array + * @param array &$vars * @return bool */ public static function addScriptVariables( &$vars ) { @@ -76,10 +86,9 @@ class NCL extends EnhancedChangesList { public function beginRecentChangesList() { parent::beginRecentChangesList(); $dir = $this->direction ? 'ltr' : 'rtl'; - return - Xml::openElement( + return Xml::openElement( 'div', - array( 'style' => "direction: $dir" ) + [ 'style' => "direction: $dir" ] ); } @@ -91,7 +100,7 @@ class NCL extends EnhancedChangesList { } /** - * @param RCCacheEntry $rc + * @param RCCacheEntry|null $rc * @return int */ protected function isLog( RCCacheEntry $rc = null ) { @@ -116,11 +125,12 @@ class NCL extends EnhancedChangesList { /** * Format a line for enhanced recentchange (aka with JavaScript and block of lines). - * @param RecentChange $baseRC + * @param RecentChange &$baseRC * @param bool $watched + * @param int|null $linenumber * @return string */ - public function recentChangesLine( &$baseRC, $watched = false ) { + public function recentChangesLine( &$baseRC, $watched = false, $linenumber = null ) { # Create a specialised object $rc = RCCacheEntry::newFromParent( $baseRC ); @@ -144,8 +154,8 @@ class NCL extends EnhancedChangesList { $clink = linker::linkKnown( $titleObj, null, - array(), - array( 'rcid' => $rc_id ) + [], + [ 'rcid' => $rc_id ] ); } else { $clink = Linker::linkKnown( $titleObj ); @@ -156,15 +166,17 @@ class NCL extends EnhancedChangesList { $rc->timestamp = $time; $rc->numberofWatchingusers = $baseRC->numberofWatchingusers; - $rc->_reqCurId = array( 'curid' => $rc->getAttribute( 'rc_cur_id' ) ); - $rc->_reqOldId = array( 'oldid' => $rc->getAttribute( 'rc_this_oldid' ) ); + $rc->_reqCurId = [ 'curid' => $rc->getAttribute( 'rc_cur_id' ) ]; + $rc->_reqOldId = [ 'oldid' => $rc->getAttribute( 'rc_this_oldid' ) ]; $this->makeLinks( $rc ); // Make user links - if ( $this->isDeleted( $rc, Revision::DELETED_USER ) ) { - $rc->_user = ' <span class="history-deleted">' . $this->msg( 'rev-deleted-user' )->escaped() . '</span>'; + if ( self::isDeleted( $rc, Revision::DELETED_USER ) ) { + $rc->_user = ' <span class="history-deleted">' . + $this->msg( 'rev-deleted-user' )->escaped() . + '</span>'; $rc->_userInfo = ''; - self::$userinfo += array(); + self::$userinfo += []; } else { $rc->_user = Linker::userLink( $rc->getAttribute( 'rc_user' ), @@ -190,7 +202,7 @@ class NCL extends EnhancedChangesList { if ( $date !== $this->lastdate ) { # Process current cache $ret = $this->recentChangesBlock(); - $this->rc_cache = array(); + $this->rc_cache = []; $ret .= Xml::element( 'h4', null, $date ) . "\n"; $this->lastdate = $date; } @@ -219,30 +231,30 @@ class NCL extends EnhancedChangesList { if ( !$this->isLog( $rc ) ) { # Make cur, diff and last links - $querycur = array( 'diff' => 0 ) + $rc->_reqCurId + $rc->_reqOldId; - $querydiff = array( + $querycur = [ 'diff' => 0 ] + $rc->_reqCurId + $rc->_reqOldId; + $querydiff = [ 'diff' => $rc->getAttribute( 'rc_this_oldid' ), 'oldid' => $rc->getAttribute( 'rc_last_oldid' ), 'rcid' => $rc->unpatrolled ? $rc->getAttribute( 'rc_id' ) : '', - ) + $rc->_reqCurId; + ] + $rc->_reqCurId; $rc->_curLink = Linker::linkKnown( $rc->getTitle(), - $this->message['cur'], array(), $querycur ); + $this->message['cur'], [], $querycur ); if ( $rc->getAttribute( 'rc_type' ) != RC_NEW ) { $rc->_diffLink = Linker::linkKnown( $rc->getTitle(), - $this->message['diff'], array(), $querydiff ); + $this->message['diff'], [], $querydiff ); } if ( $rc->getAttribute( 'rc_last_oldid' ) != 0 ) { // This is not the first revision $rc->_lastLink = Linker::linkKnown( $rc->getTitle(), - $this->message['last'], array(), $querydiff ); + $this->message['last'], [], $querydiff ); } $rc->_histLink = Linker::link( $rc->getTitle(), - $this->message['hist'], array(), - $rc->_reqCurId + array( 'action' => 'history' ) + $this->message['hist'], [], + $rc->_reqCurId + [ 'action' => 'history' ] ); } } @@ -255,8 +267,8 @@ class NCL extends EnhancedChangesList { protected function recentChangesBlockGroup( $block ) { # Collate list of users $isnew = false; - $userlinks = array(); - $overrides = array( 'minor' => false, 'bot' => false ); + $userlinks = []; + $overrides = [ 'minor' => false, 'bot' => false ]; $oldid = 0; foreach ( $block as $rcObj ) { $oldid = $rcObj->mAttribs['rc_last_oldid']; @@ -281,12 +293,20 @@ class NCL extends EnhancedChangesList { $rci = 'RCI' . $this->rcCacheIndex; $rcl = 'RCL' . $this->rcCacheIndex; $rcm = 'RCM' . $this->rcCacheIndex; - $toggleLink = "javascript:toggleVisibilityE('$rci', '$rcm', '$rcl', 'block')"; + $linkAttribs = [ + 'data-mw-cleanchanges-level' => $rci, + 'data-mw-cleanchanges-other' => $rcm, + 'data-mw-cleanchanges-link' => $rcl, + 'tabindex' => '0', + 'role' => 'button', + 'class' => 'mw-cleanchanges-showblock' + ]; $tl = - Xml::tags( 'span', array( 'id' => $rcm ), - Xml::tags( 'a', array( 'href' => $toggleLink ), $this->arrow( $this->direction ? 'r' : 'l' ) ) ) . - Xml::tags( 'span', array( 'id' => $rcl, 'style' => 'display: none;' ), - Xml::tags( 'a', array( 'href' => $toggleLink ), $this->downArrow() ) ); + Xml::tags( 'span', [ 'id' => $rcm ], + Xml::tags( 'a', $linkAttribs, + $this->arrow( $this->direction ? 'r' : 'l' ) ) ) . + Xml::tags( 'span', [ 'id' => $rcl, 'style' => 'display: none;' ], + Xml::tags( 'a', $linkAttribs, $this->downArrow() ) ); $items[] = $tl . $info; @@ -297,7 +317,7 @@ class NCL extends EnhancedChangesList { if ( !$log ) { # Changes $n = count( $block ); - static $nchanges = array(); + static $nchanges = []; if ( !isset( $nchanges[$n] ) ) { $nchanges[$n] = $this->msg( 'nchanges' )->numParams( $n )->escaped(); } @@ -306,18 +326,18 @@ class NCL extends EnhancedChangesList { $changes = Linker::linkKnown( $block[0]->getTitle(), $nchanges[$n], - array(), - array( + [], + [ 'curid' => $block[0]->mAttribs['rc_cur_id'], 'diff' => $block[0]->mAttribs['rc_this_oldid'], 'oldid' => $oldid - ) + ] ); } else { $changes = $nchanges[$n]; } - $size = $this->getCharacterDifference( $block[0], $block[count( $block ) -1] ); + $size = $this->getCharacterDifference( $block[0], $block[count( $block ) - 1] ); $items[] = $this->changeInfo( $changes, $block[0]->_histLink, $size ); } @@ -327,11 +347,11 @@ class NCL extends EnhancedChangesList { $items[] = $this->makeUserlinks( $userlinks ); $items[] = $block[0]->_watching; - $lines = Xml::tags( 'div', null, implode( " {$this->dir}", $items ) ) . "\n" ; + $lines = Xml::tags( 'div', null, implode( " {$this->dir}", $items ) ) . "\n"; # Sub-entries $lines .= Xml::tags( 'div', - array( 'id' => $rci, 'style' => 'display: none;' ), + [ 'id' => $rci, 'style' => 'display: none;' ], $this->subEntries( $block ) ) . "\n"; @@ -348,11 +368,17 @@ class NCL extends EnhancedChangesList { */ protected function arrow( $dir, $alt = '', $title = '' ) { global $wgExtensionAssetsPath; - $encUrl = htmlspecialchars( $wgExtensionAssetsPath . '/CleanChanges/images/Arr_' . $dir . '.png' ); - $encAlt = htmlspecialchars( $alt ); - $encTitle = htmlspecialchars( $title ); - return "<img src=\"$encUrl\" width=\"12\" height=\"12\" alt=\"$encAlt\" title=\"$encTitle\" />"; + return Html::element( + 'img', + [ + 'src' => "$wgExtensionAssetsPath/CleanChanges/images/Arr_$dir.png", + 'width' => 12, + 'height' => 12, + 'alt' => $alt, + 'title' => $title, + ] + ); } /** @@ -380,7 +406,7 @@ class NCL extends EnhancedChangesList { * @return string HTML "<img>" tag */ protected function spacerArrow() { - return $this->arrow( '', codepointToUtf8( 0xa0 ) ); // non-breaking space + return $this->arrow( '', UtfNormal\Utils::codepointToUtf8( 0xa0 ) ); // non-breaking space } /** @@ -390,7 +416,7 @@ class NCL extends EnhancedChangesList { protected function subEntries( array $block ) { $lines = ''; foreach ( $block as $rcObj ) { - $items = array(); + $items = []; $log = $this->isLog( $rcObj ); $time = $rcObj->timestamp; @@ -398,7 +424,7 @@ class NCL extends EnhancedChangesList { $time = Linker::linkKnown( $rcObj->getTitle(), $rcObj->timestamp, - array(), + [], $rcObj->_reqOldId + $rcObj->_reqCurId ); } @@ -443,7 +469,7 @@ class NCL extends EnhancedChangesList { if ( is_int( $size ) ) { $size = $this->wrapCharacterDifference( $size ); // FIXME: i18n: Hard coded parentheses and spaces. - return $this->msg( 'cleanchanges-rcinfo-3' )->rawParams( $diff, $hist, $size)->escaped(); + return $this->msg( 'cleanchanges-rcinfo-3' )->rawParams( $diff, $hist, $size )->escaped(); } else { return $this->msg( 'cleanchanges-rcinfo-2' )->rawParams( $diff, $hist )->escaped(); } @@ -491,12 +517,16 @@ class NCL extends EnhancedChangesList { $action = ''; if ( $comment === '' ) { return $action; - } elseif ( $this->isDeleted( $rc, LogPage::DELETED_COMMENT ) ) { + } elseif ( self::isDeleted( $rc, LogPage::DELETED_COMMENT ) ) { $priviledged = $this->getUser()->isAllowed( 'deleterevision' ); if ( $priviledged ) { - return $action . ' <span class="history-deleted">' . Linker::formatComment( $comment ) . '</span>'; + return $action . ' <span class="history-deleted">' . + Linker::formatComment( $comment ) . + '</span>'; } - return $action . ' <span class="history-deleted">' . $this->msg( 'rev-deleted-comment' )->escaped() . '</span>'; + return $action . ' <span class="history-deleted">' . + $this->msg( 'rev-deleted-comment' )->escaped() . + '</span>'; } return $action . Linker::commentBlock( $comment, $rc->getTitle() ); } @@ -506,7 +536,7 @@ class NCL extends EnhancedChangesList { * @param int $userId user id, 0 for anons * @param string $userText username * @return array|string Either an array of html and array of messages, or '' - * [0]: html span and links to user tools + * [0]: html span and links to user tools * [1]: array of escaped message strings */ public function userToolLinks( $userId, $userText ) { @@ -525,32 +555,39 @@ class NCL extends EnhancedChangesList { static $linkindex = 0; $linkindex++; - static $users = array(); + static $users = []; $userindex = array_search( $userText, $users, true ); if ( $userindex === false ) { $users[] = $userText; - $userindex = count( $users ) -1; + $userindex = count( $users ) - 1; } global $wgExtensionAssetsPath; - $image = Xml::element( 'img', array( + $image = Xml::element( 'img', [ 'src' => $wgExtensionAssetsPath . '/CleanChanges/images/showuserlinks.png', 'alt' => $this->msg( 'cleanchanges-showuserlinks' )->text(), 'title' => $this->msg( 'cleanchanges-showuserlinks' )->text(), 'width' => '15', 'height' => '11', - ) + ] ); $rci = 'RCUI' . $userindex; $rcl = 'RCUL' . $linkindex; $rcm = 'RCUM' . $linkindex; - $toggleLink = "javascript:showUserInfo('wgUserInfo$rci', '$rcl' )"; - $tl = Xml::tags( 'span', array( 'id' => $rcm ), - Xml::tags( 'a', array( 'href' => $toggleLink ), $image ) ); - $tl .= Xml::element( 'span', array( 'id' => $rcl ), ' ' ); + $linkAttribs = [ + 'tabindex' => '0', + 'role' => 'button', + 'class' => 'mw-cleanchanges-showuserinfo', + 'data-mw-userinfo-id' => $rci, + 'data-mw-userinfo-target' => $rcl + ]; + $tl = Xml::tags( 'span', [ 'id' => $rcm ], + Xml::tags( 'a', $linkAttribs, $image ) + ); + $tl .= Xml::element( 'span', [ 'id' => $rcl ], ' ' ); - $items = array(); + $items = []; if ( $talkable ) { $items[] = Linker::userTalkLink( $userId, $userText ); } @@ -575,9 +612,9 @@ class NCL extends EnhancedChangesList { $msg = $this->msg( 'parentheses' ) ->rawParams( $this->getLanguage()->pipeList( $items ) ) ->escaped(); - $data = array( "wgUserInfo$rci" => $msg ); + $data = [ "wgUserInfo$rci" => $msg ]; - return array( $tl, $data ); + return [ $tl, $data ]; } else { return ''; } @@ -586,6 +623,8 @@ class NCL extends EnhancedChangesList { /** * Makes aggregated list of contributors for a changes group. * Example: [Usera; AnotherUser; ActiveUser (2×); Userabc (6×)] + * @param array $userlinks + * @return string */ protected function makeUserlinks( $userlinks ) { /* @@ -595,7 +634,7 @@ class NCL extends EnhancedChangesList { krsort( $userlinks ); asort( $userlinks ); - $users = array(); + $users = []; foreach ( $userlinks as $userlink => $count ) { $text = $userlink; if ( $count > 1 ) { @@ -611,21 +650,21 @@ class NCL extends EnhancedChangesList { /** * @param RCCacheEntry $rc - * @param array $overrides + * @param array|null $overrides * @return string */ protected function getFlags( $rc, array $overrides = null ) { // @todo We assume all characters are of equal width, which they may be not - $map = array( + $map = [ # item => field letter-or-something - 'new' => array( 'rc_new', self::flag( 'newpage' ) ), - 'minor' => array( 'rc_minor', self::flag( 'minor' ) ), - 'bot' => array( 'rc_bot', self::flag( 'bot' ) ), - ); + 'new' => [ 'rc_new', self::flag( 'newpage' ) ], + 'minor' => [ 'rc_minor', self::flag( 'minor' ) ], + 'bot' => [ 'rc_bot', self::flag( 'bot' ) ], + ]; static $nothing = "\xc2\xa0"; - $items = array(); + $items = []; foreach ( $map as $item => $data ) { list( $field, $flag ) = $data; $bool = isset( $overrides[$item] ) ? $overrides[$item] : $rc->getAttribute( $field ); @@ -671,7 +710,7 @@ class NCL extends EnhancedChangesList { */ public function wrapCharacterDifference( $szdiff ) { global $wgRCChangedSizeThreshold; - static $cache = array(); + static $cache = []; if ( !isset( $cache[$szdiff] ) ) { // @todo FIXME: Hard coded text (+). $prefix = $szdiff > 0 ? '+' : ''; @@ -694,16 +733,16 @@ class NCL extends EnhancedChangesList { } /** - * @param $class - * @param $content + * @param string $class + * @param string $content * @param string $tag * @param bool $escape * @return string */ protected function XMLwrapper( $class, $content, $tag = 'span', $escape = true ) { if ( $escape ) { - return Xml::element( $tag, array( 'class' => $class ), $content ); + return Xml::element( $tag, [ 'class' => $class ], $content ); } - return Xml::tags( $tag, array( 'class' => $class ), $content ); + return Xml::tags( $tag, [ 'class' => $class ], $content ); } } diff --git a/MLEB/CleanChanges/Filters.php b/MLEB/CleanChanges/Filters.php index d6e9939e..477c6d91 100644 --- a/MLEB/CleanChanges/Filters.php +++ b/MLEB/CleanChanges/Filters.php @@ -3,93 +3,139 @@ class CCFilters { /** - * @param array $conds - * @param array $tables - * @param array $join_conds + * Hook: ChangesListSpecialPageQuery + * @param string $name + * @param array &$tables + * @param array &$fields + * @param array &$conds + * @param array &$query_options + * @param array &$join_conds * @param FormOptions $opts - * @return bool */ - public static function user( &$conds, &$tables, &$join_conds, FormOptions $opts ) { - global $wgRequest; + public static function user( + $name, + &$tables, + &$fields, + &$conds, + &$query_options, + &$join_conds, + FormOptions $opts + ) { + global $wgRequest, $wgCCUserFilter; + + if ( !$wgCCUserFilter ) { + return; + } + $opts->add( 'users', '' ); $users = $wgRequest->getVal( 'users' ); if ( $users === null ) { - return true; + return; } - $idfilters = array(); - $userArr = explode( '|', $users ); - foreach ( $userArr as $u ) { - $id = User::idFromName( $u ); - if ( $id !== null ) { - $idfilters[] = $id; + $userArr = UserArray::newFromNames( explode( '|', $users ) ); + if ( $userArr->count() ) { + $dbr = wfGetDB( DB_REPLICA ); + if ( class_exists( 'ActorMigration' ) ) { + $conds[] = ActorMigration::newMigration() + ->getWhere( $dbr, 'rc_user', iterator_to_array( $userArr ) )['conds']; + } else { + $ids = []; + foreach ( $userArr as $user ) { + $ids[] = $user->getId(); + } + $conds['rc_user'] = $ids; } - } - if ( count( $idfilters ) ) { - $dbr = wfGetDB( DB_SLAVE ); - $conds[] = 'rc_user IN (' . $dbr->makeList( $idfilters ) . ')'; $opts->setValue( 'users', $users ); } - - return true; } /** - * @param $items array - * @param $opts FormOptions - * @return bool + * Hook: SpecialRecentChangesPanel + * @param array &$items + * @param FormOptions $opts */ public static function userForm( &$items, FormOptions $opts ) { + global $wgRequest, $wgCCUserFilter; + + if ( !$wgCCUserFilter ) { + return; + } + $opts->consumeValue( 'users' ); - global $wgRequest; $default = $wgRequest->getVal( 'users', '' ); - $items['users'] = Xml::inputLabelSep( wfMessage( 'cleanchanges-users' )->text(), 'users', - 'mw-users', 40, $default ); - return true; + $items['users'] = Xml::inputLabelSep( + wfMessage( 'cleanchanges-users' )->text(), + 'users', + 'mw-users', + 40, + $default + ); } /** - * @param array $conds - * @param array $tables - * @param array $join_conds + * Hook: ChangesListSpecialPageQuery + * @param string $name + * @param array &$tables + * @param array &$fields + * @param array &$conds + * @param array &$query_options + * @param array &$join_conds * @param FormOptions $opts - * @return bool */ - public static function trailer( &$conds, &$tables, &$join_conds, FormOptions $opts ) { - global $wgRequest; + public static function trailer( + $name, + &$tables, + &$fields, + &$conds, + &$query_options, + &$join_conds, + FormOptions $opts + ) { + global $wgRequest, $wgCCTrailerFilter; + + if ( !$wgCCTrailerFilter ) { + return; + } + $opts->add( 'trailer', '' ); $trailer = $wgRequest->getVal( 'trailer' ); - if ( $trailer === null ) return true; + if ( $trailer === null ) { + return; + } - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $conds[] = 'rc_title ' . $dbr->buildLike( $dbr->anyString(), $trailer ); $opts->setValue( 'trailer', $trailer ); - - return true; } /** - * @param array $items + * Hook: SpecialRecentChangesPanel + * @param array &$items * @param FormOptions $opts - * @return bool */ public static function trailerForm( &$items, FormOptions $opts ) { - $opts->consumeValue( 'trailer' ); - - global $wgRequest; - $default = $wgRequest->getVal( 'trailer', '' ); /** * @var Language $wgLang */ - global $wgLang; - if ( is_callable( array( 'LanguageNames', 'getNames' ) ) ) { + global $wgLang, $wgRequest, $wgCCTrailerFilter; + + if ( !$wgCCTrailerFilter ) { + return; + } + + $opts->consumeValue( 'trailer' ); + + $default = $wgRequest->getVal( 'trailer', '' ); + + if ( is_callable( [ 'LanguageNames', 'getNames' ] ) ) { $languages = LanguageNames::getNames( $wgLang->getCode(), LanguageNames::FALLBACK_NORMAL, LanguageNames::LIST_MW ); } else { - $languages = Language::getLanguageNames( false ); + $languages = Language::fetchLanguageNames( null, 'mw' ); } ksort( $languages ); $options = Xml::option( wfMessage( 'cleanchanges-language-na' )->text(), '', $default === '' ); @@ -98,15 +144,14 @@ class CCFilters { $options .= Xml::option( "$code - $name", "/$code", $selected ) . "\n"; } $str = - Xml::openElement( 'select', array( + Xml::openElement( 'select', [ 'name' => 'trailer', 'class' => 'mw-language-selector', 'id' => 'sp-rc-language', - ) ) . + ] ) . $options . Xml::closeElement( 'select' ); - $items['tailer'] = array( wfMessage( 'cleanchanges-language' )->escaped(), $str ); - return true; + $items['tailer'] = [ wfMessage( 'cleanchanges-language' )->escaped(), $str ]; } } diff --git a/MLEB/CleanChanges/RELEASE-NOTES b/MLEB/CleanChanges/RELEASE-NOTES index deca1487..0778ac1d 100644 --- a/MLEB/CleanChanges/RELEASE-NOTES +++ b/MLEB/CleanChanges/RELEASE-NOTES @@ -1,5 +1,5 @@ -== CleanChanges 2015.04 == -Released at 2015-04-30. +== CleanChanges 2018.10 == +Released at 2018-10-29. -=== Highlights === -* Localisation updates only. +=== Noteworthy changes === +* Maintainance updates only. diff --git a/MLEB/CleanChanges/Resources.php b/MLEB/CleanChanges/Resources.php deleted file mode 100644 index 2a8b36c5..00000000 --- a/MLEB/CleanChanges/Resources.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -global $wgResourceModules; - -$resourcePaths = array( - 'localBasePath' => __DIR__, - 'remoteExtPath' => 'CleanChanges' -); - -$wgResourceModules['ext.cleanchanges'] = array( - 'scripts' => 'resources/cleanchanges.js', -) + $resourcePaths; - -$wgResourceModules['ext.cleanchanges.uls'] = array( - 'scripts' => 'resources/cleanchanges.uls.js', - 'styles' => 'resources/cleanchanges.uls.css', -) + $resourcePaths; diff --git a/MLEB/CleanChanges/composer.json b/MLEB/CleanChanges/composer.json index beb266f8..330098d2 100644 --- a/MLEB/CleanChanges/composer.json +++ b/MLEB/CleanChanges/composer.json @@ -1,11 +1,28 @@ { - "name": "mediawiki/cleanchanges", + "name": "mediawiki/clean-changes", "type": "mediawiki-extension", "description": "More compact display of recent changes lists", "homepage": "https://www.mediawiki.org/wiki/Extension:CleanChanges", - "license": "GPL-2.0+", - + "license": "GPL-2.0-or-later", "require": { - "composer/installers": "*" + "php": ">=5.5.9", + "composer/installers": ">=1.0.1" + }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "1.0.0", + "mediawiki/mediawiki-codesniffer": "19.1.0", + "jakub-onderka/php-console-highlighter": "0.3.2", + "mediawiki/minus-x": "0.3.1" + }, + "scripts": { + "fix": [ + "phpcbf", + "minus-x fix ." + ], + "test": [ + "parallel-lint . --exclude vendor --exclude node_modules", + "phpcs -p -s", + "minus-x check ." + ] } } diff --git a/MLEB/CleanChanges/i18n/ar.json b/MLEB/CleanChanges/i18n/ar.json index ab6e677e..d384829a 100644 --- a/MLEB/CleanChanges/i18n/ar.json +++ b/MLEB/CleanChanges/i18n/ar.json @@ -2,11 +2,12 @@ "@metadata": { "authors": [ "Meno25", - "OsamaK" + "OsamaK", + "ديفيد" ] }, "cleanchanges-changerightslink": "تغيير المجموعات", - "cleanchanges-desc": "عرض أكثر ضغطا ل [[Special:RecentChanges|قائمة أحدث التغييرات]]", + "cleanchanges-desc": "عرض أكثر ضغطا [[Special:RecentChanges|لقائمة أحدث التغييرات]]", "cleanchanges-language": "اللغة:", "cleanchanges-language-na": "الكل", "cleanchanges-users": "المستخدمون (للفصل: |):", diff --git a/MLEB/CleanChanges/i18n/azb.json b/MLEB/CleanChanges/i18n/azb.json index 6588f322..be51f28e 100644 --- a/MLEB/CleanChanges/i18n/azb.json +++ b/MLEB/CleanChanges/i18n/azb.json @@ -2,10 +2,11 @@ "@metadata": { "authors": [ "Ebrahimi-amir", - "පසිඳු කාවින්ද" + "පසිඳු කාවින්ද", + "Koroğlu" ] }, "cleanchanges-language": "دیل:", "cleanchanges-language-na": "بوتون", - "cleanchanges-users": "ایستیفادهچیلر (آییرماق: |):" + "cleanchanges-users": "ایشلدنلر (آییرماق: |):" } diff --git a/MLEB/CleanChanges/i18n/ce.json b/MLEB/CleanChanges/i18n/ce.json index ba3f844b..5523689f 100644 --- a/MLEB/CleanChanges/i18n/ce.json +++ b/MLEB/CleanChanges/i18n/ce.json @@ -9,6 +9,6 @@ "cleanchanges-desc": "Алсамо тIеIовдан гайтар [[Special:RecentChanges|керла нисдарийн могӀам]]", "cleanchanges-language": "Мотт:", "cleanchanges-language-na": "Массо", - "cleanchanges-users": "Декъашхой (буькъарг: |):", + "cleanchanges-users": "Декъашхой (дӀасакъасторг: |):", "cleanchanges-showuserlinks": "Декъашхойн хьажоргаш гойту" } diff --git a/MLEB/CleanChanges/i18n/diq.json b/MLEB/CleanChanges/i18n/diq.json index 08648f02..44269051 100644 --- a/MLEB/CleanChanges/i18n/diq.json +++ b/MLEB/CleanChanges/i18n/diq.json @@ -2,10 +2,14 @@ "@metadata": { "authors": [ "Erdemaslancan", - "Mirzali" + "Mirzali", + "Kumkumuk" ] }, + "cleanchanges-changerightslink": "Gruban bıvurnê", + "cleanchanges-desc": "Dehena asayışa kompakta [[Special:RecentChanges|Listey vurriyayışanê peyênan ]]", "cleanchanges-language": "Zıwan:", "cleanchanges-language-na": "Pêro", - "cleanchanges-users": "Karberi (Ciya: |):" + "cleanchanges-users": "Karberi (Ciya: |):", + "cleanchanges-showuserlinks": "Linkanê Karberan bıasne" } diff --git a/MLEB/CleanChanges/i18n/en.json b/MLEB/CleanChanges/i18n/en.json index 8eab9667..dbb3572e 100644 --- a/MLEB/CleanChanges/i18n/en.json +++ b/MLEB/CleanChanges/i18n/en.json @@ -1,13 +1,13 @@ { - "@metadata": { - "authors": [] - }, - "cleanchanges-changerightslink": "change groups", - "cleanchanges-desc": "More compact display of the [[Special:RecentChanges|recent changes list]]", - "cleanchanges-language": "Language:", - "cleanchanges-language-na": "All", - "cleanchanges-users": "Users (Sep: |):", - "cleanchanges-showuserlinks": "Show user links", - "cleanchanges-rcinfo-2": "($1; $2)", - "cleanchanges-rcinfo-3": "($1; $2; $3)" + "@metadata": { + "authors": [] + }, + "cleanchanges-changerightslink": "change groups", + "cleanchanges-desc": "More compact display of the [[Special:RecentChanges|recent changes list]]", + "cleanchanges-language": "Language:", + "cleanchanges-language-na": "All", + "cleanchanges-users": "Users (Sep: |):", + "cleanchanges-showuserlinks": "Show user links", + "cleanchanges-rcinfo-2": "($1; $2)", + "cleanchanges-rcinfo-3": "($1; $2; $3)" }
\ No newline at end of file diff --git a/MLEB/CleanChanges/i18n/es.json b/MLEB/CleanChanges/i18n/es.json index 5fedd987..3a194e40 100644 --- a/MLEB/CleanChanges/i18n/es.json +++ b/MLEB/CleanChanges/i18n/es.json @@ -1,13 +1,14 @@ { "@metadata": { "authors": [ - "Sanbec" + "Sanbec", + "Fitoschido" ] }, "cleanchanges-changerightslink": "cambiar grupos", "cleanchanges-desc": "Visualización más compacta de la [[Special:RecentChanges|lista de cambios recientes]]", "cleanchanges-language": "Idioma:", "cleanchanges-language-na": "Todos", - "cleanchanges-users": "Usuarios (Sep: |):", + "cleanchanges-users": "Usuarios (sep.: |):", "cleanchanges-showuserlinks": "Mostrar enlaces de usuario" } diff --git a/MLEB/CleanChanges/i18n/gl.json b/MLEB/CleanChanges/i18n/gl.json index c26b043e..2b84982c 100644 --- a/MLEB/CleanChanges/i18n/gl.json +++ b/MLEB/CleanChanges/i18n/gl.json @@ -2,13 +2,14 @@ "@metadata": { "authors": [ "Alma", - "Toliño" + "Toliño", + "Elisardojm" ] }, "cleanchanges-changerightslink": "mudar grupos", - "cleanchanges-desc": "Unha mostra máis compacta da [[Special:RecentChanges|lista de cambios recentes]]", + "cleanchanges-desc": "Unha presentación máis compacta da [[Special:RecentChanges|lista de cambios recentes]]", "cleanchanges-language": "Lingua:", "cleanchanges-language-na": "Todas", "cleanchanges-users": "Usuarios (separados por |):", - "cleanchanges-showuserlinks": "Mostrar as ligazóns de usuario" + "cleanchanges-showuserlinks": "Amosar as ligazóns de usuario" } diff --git a/MLEB/CleanChanges/i18n/hi.json b/MLEB/CleanChanges/i18n/hi.json index 3ebdb2fc..4228c788 100644 --- a/MLEB/CleanChanges/i18n/hi.json +++ b/MLEB/CleanChanges/i18n/hi.json @@ -2,11 +2,14 @@ "@metadata": { "authors": [ "Ansumang", - "Kaustubh" + "Kaustubh", + "Innocentbunny" ] }, "cleanchanges-changerightslink": "ग्रुप बदलें", "cleanchanges-desc": "[[Special:RecentChanges|हाल में हुए बदलाव]] संक्षिप्त रूपमें दर्शायें", "cleanchanges-language": "भाषा:", - "cleanchanges-language-na": "सभी" + "cleanchanges-language-na": "सभी", + "cleanchanges-users": "उपयोक्तागण (\"|\" से विभक्त)", + "cleanchanges-showuserlinks": "उपयोक्ता कड़ियाँ दिखाएँ" } diff --git a/MLEB/CleanChanges/i18n/hr.json b/MLEB/CleanChanges/i18n/hr.json index bf44b03d..bd12157a 100644 --- a/MLEB/CleanChanges/i18n/hr.json +++ b/MLEB/CleanChanges/i18n/hr.json @@ -1,13 +1,14 @@ { "@metadata": { "authors": [ - "Ex13" + "Ex13", + "Bugoslav" ] }, - "cleanchanges-changerightslink": "promijeni grupe", + "cleanchanges-changerightslink": "promijeni skupine", "cleanchanges-desc": "Kompaktniji prikaz [[Special:RecentChanges|nedavnih promjena]]", "cleanchanges-language": "Jezik:", "cleanchanges-language-na": "Svi", - "cleanchanges-users": "Suradnici (Raz: |):", + "cleanchanges-users": "Suradnici (razdjeljivač: |):", "cleanchanges-showuserlinks": "Prikaži poveznice suradnika" } diff --git a/MLEB/CleanChanges/i18n/kk-cyrl.json b/MLEB/CleanChanges/i18n/kk-cyrl.json index a6f98b32..70a12a02 100644 --- a/MLEB/CleanChanges/i18n/kk-cyrl.json +++ b/MLEB/CleanChanges/i18n/kk-cyrl.json @@ -7,5 +7,6 @@ "cleanchanges-changerightslink": "Топтарды өзгерту", "cleanchanges-language": "Тіл:", "cleanchanges-language-na": "Барлығы", + "cleanchanges-users": "Қатысушылар (Бөл: |):", "cleanchanges-showuserlinks": "Қатысушы сілтемелерін көрсету" } diff --git a/MLEB/CleanChanges/i18n/km.json b/MLEB/CleanChanges/i18n/km.json index 0955eb4f..19f6d3c5 100644 --- a/MLEB/CleanChanges/i18n/km.json +++ b/MLEB/CleanChanges/i18n/km.json @@ -3,10 +3,12 @@ "authors": [ "Chhorran", "Lovekhmer", - "Thearith" + "Thearith", + "គីមស៊្រុន" ] }, "cleanchanges-changerightslink": "ផ្លាស់ប្តូរក្រុម", + "cleanchanges-desc": "[[Special:RecentChanges|បញ្ជីបន្លាស់ប្ដូរថ្មីៗ]]ខ្នាតខ្លី", "cleanchanges-language": "ភាសា៖", "cleanchanges-language-na": "ទាំងអស់", "cleanchanges-users": "អ្នកប្រើប្រាស់(ខណ្ឌដោយ |)៖", diff --git a/MLEB/CleanChanges/i18n/ko.json b/MLEB/CleanChanges/i18n/ko.json index 52213937..07d7d81d 100644 --- a/MLEB/CleanChanges/i18n/ko.json +++ b/MLEB/CleanChanges/i18n/ko.json @@ -6,7 +6,7 @@ ] }, "cleanchanges-changerightslink": "그룹 바꾸기", - "cleanchanges-desc": "[[Special:RecentChanges|최근 바뀜 목록]]을 더 조밀하게 보이기", + "cleanchanges-desc": "[[Special:RecentChanges|최근 바뀜 목록]]을 더 조밀하게 표시합니다", "cleanchanges-language": "언어:", "cleanchanges-language-na": "모두", "cleanchanges-users": "사용자 (구분선: |):", diff --git a/MLEB/CleanChanges/i18n/krc.json b/MLEB/CleanChanges/i18n/krc.json index f50ab82b..f4e189d3 100644 --- a/MLEB/CleanChanges/i18n/krc.json +++ b/MLEB/CleanChanges/i18n/krc.json @@ -1,7 +1,8 @@ { "@metadata": { "authors": [ - "Iltever" + "Iltever", + "Ernác" ] }, "cleanchanges-language": "Тил:" diff --git a/MLEB/CleanChanges/i18n/ksh.json b/MLEB/CleanChanges/i18n/ksh.json index 2d2d2fde..292aadd3 100644 --- a/MLEB/CleanChanges/i18n/ksh.json +++ b/MLEB/CleanChanges/i18n/ksh.json @@ -4,10 +4,10 @@ "Purodha" ] }, - "cleanchanges-changerightslink": "Jruppe aanpasse", + "cleanchanges-changerightslink": "Jroppe aanpasse", "cleanchanges-desc": "Määt en köötere [[Special:RecentChanges|Leß met de {{lcfirst:{{int:Recentchanges}}}}]].", "cleanchanges-language": "Schprohch:", - "cleanchanges-language-na": "all", - "cleanchanges-users": "Metmaacher (donn | dozwesche, wann et zwei udder mieh sen):", + "cleanchanges-language-na": "jehde", + "cleanchanges-users": "Metmaacher (donn | dozwesche, wann et zwei udder mih sen):", "cleanchanges-showuserlinks": "Links op Metmaacher zeije" } diff --git a/MLEB/CleanChanges/i18n/lt.json b/MLEB/CleanChanges/i18n/lt.json index a8537044..91106818 100644 --- a/MLEB/CleanChanges/i18n/lt.json +++ b/MLEB/CleanChanges/i18n/lt.json @@ -5,7 +5,9 @@ ] }, "cleanchanges-changerightslink": "pakeisti grupes", + "cleanchanges-desc": "Labiau kompaktiškas [[Special:RecentChanges|naujausių pakeitimų sąrašo]] rodinys", "cleanchanges-language": "Kalba:", "cleanchanges-language-na": "Visi", + "cleanchanges-users": "Vartotojai (Atskirti: |):", "cleanchanges-showuserlinks": "Rodyti vartotojo nuorodas" } diff --git a/MLEB/CleanChanges/i18n/nah.json b/MLEB/CleanChanges/i18n/nah.json index f41a49cb..8780b5aa 100644 --- a/MLEB/CleanChanges/i18n/nah.json +++ b/MLEB/CleanChanges/i18n/nah.json @@ -2,13 +2,14 @@ "@metadata": { "authors": [ "Fluence", - "Teòtlalili" + "Teòtlalili", + "Akapochtli" ] }, - "cleanchanges-changerightslink": "tlátlasèntlàlìlpátlalòs", - "cleanchanges-desc": "Monèxtìs okachi tepitòn in [[Special:RecentChanges|welok tlapátlalli pàmitl]]", - "cleanchanges-language": "Tlâtòlli:", - "cleanchanges-language-na": "Mochtìn", - "cleanchanges-users": "Motekìuhtiànimë (Sep: |):", - "cleanchanges-showuserlinks": "Mà monèxti ìnetzòwìlwàn in motekìuhtiàni" + "cleanchanges-changerightslink": "ticpatlaz tlatlacentlaliliztli", + "cleanchanges-desc": "Monextiz ocachi tepiton in [[Special:RecentChanges|yancuic tlapatlaliztli ipan tlahtoltecpanaliztli]]", + "cleanchanges-language": "Tlahtolli:", + "cleanchanges-language-na": "Mochtin", + "cleanchanges-users": "Tequitiuhqueh (Sep: |):", + "cleanchanges-showuserlinks": "Monextia inetzohuilhuan in tequitiuhqui" } diff --git a/MLEB/CleanChanges/i18n/nb.json b/MLEB/CleanChanges/i18n/nb.json index 705ae2eb..21246324 100644 --- a/MLEB/CleanChanges/i18n/nb.json +++ b/MLEB/CleanChanges/i18n/nb.json @@ -1,7 +1,8 @@ { "@metadata": { "authors": [ - "Nghtwlkr" + "Nghtwlkr", + "Jon Harald Søby" ] }, "cleanchanges-changerightslink": "endre grupper", diff --git a/MLEB/CleanChanges/i18n/pa.json b/MLEB/CleanChanges/i18n/pa.json index 938a30bf..cb6f2556 100644 --- a/MLEB/CleanChanges/i18n/pa.json +++ b/MLEB/CleanChanges/i18n/pa.json @@ -1,8 +1,10 @@ { "@metadata": { "authors": [ - "Gman124" + "Gman124", + "Tow" ] }, + "cleanchanges-language": "ਭਾਸ਼ਾ:", "cleanchanges-language-na": "ਸਭ" } diff --git a/MLEB/CleanChanges/i18n/pl.json b/MLEB/CleanChanges/i18n/pl.json index 15409248..6c13e6b0 100644 --- a/MLEB/CleanChanges/i18n/pl.json +++ b/MLEB/CleanChanges/i18n/pl.json @@ -6,11 +6,12 @@ "Masti", "McMonster", "Sp5uhe", - "Wpedzich" + "Wpedzich", + "Railfail536" ] }, "cleanchanges-changerightslink": "zmień grupy", - "cleanchanges-desc": "Bardziej zwarta wersja „[[Special:RecentChanges|Ostatnich zmian]]”", + "cleanchanges-desc": "Bardziej zwarta wersja [[Special:RecentChanges|ostatnich zmian]]", "cleanchanges-language": "Język:", "cleanchanges-language-na": "Wszystkie", "cleanchanges-users": "Użytkownicy (rozdziel znakiem „|”):", diff --git a/MLEB/CleanChanges/i18n/ps.json b/MLEB/CleanChanges/i18n/ps.json index 13e06305..f1c5ee3a 100644 --- a/MLEB/CleanChanges/i18n/ps.json +++ b/MLEB/CleanChanges/i18n/ps.json @@ -1,7 +1,8 @@ { "@metadata": { "authors": [ - "Ahmed-Najib-Biabani-Ibrahimkhel" + "Ahmed-Najib-Biabani-Ibrahimkhel", + "Baloch Khan" ] }, "cleanchanges-changerightslink": "ډلې بدلول", @@ -9,5 +10,6 @@ "cleanchanges-language": "ژبه:", "cleanchanges-language-na": "ټول", "cleanchanges-users": "کارن (بېلول: |):", - "cleanchanges-showuserlinks": "د کارن تړنې ښکاره کول" + "cleanchanges-showuserlinks": "د کارن تړنې ښکاره کول", + "cleanchanges-rcinfo-3": "($1؛ $2؛ $3)" } diff --git a/MLEB/CleanChanges/i18n/pt.json b/MLEB/CleanChanges/i18n/pt.json index 0a5b286f..60201a5f 100644 --- a/MLEB/CleanChanges/i18n/pt.json +++ b/MLEB/CleanChanges/i18n/pt.json @@ -10,5 +10,5 @@ "cleanchanges-language": "Língua:", "cleanchanges-language-na": "Todas", "cleanchanges-users": "Utilizadores (Sep: |):", - "cleanchanges-showuserlinks": "Mostrar links de utilizador" + "cleanchanges-showuserlinks": "Mostrar hiperligações de utilizador" } diff --git a/MLEB/CleanChanges/i18n/qqq.json b/MLEB/CleanChanges/i18n/qqq.json index 4eb2d860..e39f1d9a 100644 --- a/MLEB/CleanChanges/i18n/qqq.json +++ b/MLEB/CleanChanges/i18n/qqq.json @@ -5,11 +5,12 @@ "Jon Harald Søby", "Meno25", "Purodha", - "Shirayuki" + "Shirayuki", + "Umherirrender" ] }, "cleanchanges-changerightslink": "Link text for a link in the recent changes page to manage user rights for a user.\nIt is shown after clicking on the \"Show user links\"-picture if you are allowed to manage user rights.", - "cleanchanges-desc": "Shown in [[Special:Version]]", + "cleanchanges-desc": "{{desc|name=CleanChanges|url=https://www.mediawiki.org/wiki/Extension:CleanChanges}}", "cleanchanges-language": "{{Identical|Language}}", "cleanchanges-language-na": "Used in the trailer selection of [[Special:RecentChanges]] to not filter on any trailer.\n\n{{Identical|All}}", "cleanchanges-users": "Used as label for \"Users\" input box.\n\n\"Sep: |\" stands for \"Separate with |\" or \"|-separated\".", diff --git a/MLEB/CleanChanges/i18n/rif.json b/MLEB/CleanChanges/i18n/rif.json index 89d8cf5d..0ce0c51c 100644 --- a/MLEB/CleanChanges/i18n/rif.json +++ b/MLEB/CleanChanges/i18n/rif.json @@ -2,9 +2,10 @@ "@metadata": { "authors": [ "Aryaz", - "Jose77" + "Jose77", + "Amara-Amaziɣ" ] }, - "cleanchanges-language": "Tutlayt:", - "cleanchanges-language-na": "Marra" + "cleanchanges-language": "ⵜⵓⵜⵍⴰⵢⵜ:", + "cleanchanges-language-na": "ⵎⴰⵔⵔⴰ" } diff --git a/MLEB/CleanChanges/i18n/ru.json b/MLEB/CleanChanges/i18n/ru.json index 91d5515e..d62d35c2 100644 --- a/MLEB/CleanChanges/i18n/ru.json +++ b/MLEB/CleanChanges/i18n/ru.json @@ -3,7 +3,8 @@ "authors": [ "Ferrer", "Innv", - "Александр Сигачёв" + "Александр Сигачёв", + "RDmitriyS" ] }, "cleanchanges-changerightslink": "изменить группы", @@ -11,5 +12,5 @@ "cleanchanges-language": "Язык:", "cleanchanges-language-na": "Все", "cleanchanges-users": "Участники (разделитель: |):", - "cleanchanges-showuserlinks": "Показывать ссылки участников" + "cleanchanges-showuserlinks": "Показать ссылки участника" } diff --git a/MLEB/CleanChanges/i18n/su.json b/MLEB/CleanChanges/i18n/su.json index 2d39b581..5b5a0672 100644 --- a/MLEB/CleanChanges/i18n/su.json +++ b/MLEB/CleanChanges/i18n/su.json @@ -10,5 +10,5 @@ "cleanchanges-language": "Basa:", "cleanchanges-language-na": "Kabéh", "cleanchanges-users": "Pamaké (Pisah: |):", - "cleanchanges-showuserlinks": "Témbongkeun tumbu pamaké" + "cleanchanges-showuserlinks": "Témbongkeun tutumbu pamaké" } diff --git a/MLEB/CleanChanges/i18n/zh-hans.json b/MLEB/CleanChanges/i18n/zh-hans.json index 69275d09..a6b1dd6a 100644 --- a/MLEB/CleanChanges/i18n/zh-hans.json +++ b/MLEB/CleanChanges/i18n/zh-hans.json @@ -4,13 +4,14 @@ "Chenxiaoqino", "Chenzw", "Liangent", - "Xiaomingyan" + "Xiaomingyan", + "Liuxinyu970226" ] }, "cleanchanges-changerightslink": "更改群组", "cleanchanges-desc": "更简洁的显示[[Special:RecentChanges|最近更改清单]]", "cleanchanges-language": "语言:", "cleanchanges-language-na": "所有", - "cleanchanges-users": "用户 (Sep: |):", + "cleanchanges-users": "用户(分隔符:|):", "cleanchanges-showuserlinks": "显示用户链接" } diff --git a/MLEB/CleanChanges/i18n/zh-hant.json b/MLEB/CleanChanges/i18n/zh-hant.json index 6097c238..3d55b40b 100644 --- a/MLEB/CleanChanges/i18n/zh-hant.json +++ b/MLEB/CleanChanges/i18n/zh-hant.json @@ -4,10 +4,13 @@ "Alexsh", "Liangent", "Mark85296341", - "Cwlin0416" + "Cwlin0416", + "LNDDYL", + "Sanmosa", + "A2093064" ] }, - "cleanchanges-changerightslink": "更改群組", + "cleanchanges-changerightslink": "變更群組", "cleanchanges-desc": "更精簡的顯示 [[Special:RecentChanges|最近變更清單]]", "cleanchanges-language": "語言:", "cleanchanges-language-na": "全部", diff --git a/MLEB/CleanChanges/images/Arr_.png b/MLEB/CleanChanges/images/Arr_.png Binary files differindex bc67a4b6..c0384e4e 100644 --- a/MLEB/CleanChanges/images/Arr_.png +++ b/MLEB/CleanChanges/images/Arr_.png diff --git a/MLEB/CleanChanges/images/Arr_d.png b/MLEB/CleanChanges/images/Arr_d.png Binary files differindex 58a9fc66..d476a168 100644 --- a/MLEB/CleanChanges/images/Arr_d.png +++ b/MLEB/CleanChanges/images/Arr_d.png diff --git a/MLEB/CleanChanges/images/Arr_l.png b/MLEB/CleanChanges/images/Arr_l.png Binary files differindex 2246254f..970c0e55 100644 --- a/MLEB/CleanChanges/images/Arr_l.png +++ b/MLEB/CleanChanges/images/Arr_l.png diff --git a/MLEB/CleanChanges/images/Arr_r.png b/MLEB/CleanChanges/images/Arr_r.png Binary files differindex 467a555a..82f5369a 100644 --- a/MLEB/CleanChanges/images/Arr_r.png +++ b/MLEB/CleanChanges/images/Arr_r.png diff --git a/MLEB/CleanChanges/images/Arr_u.png b/MLEB/CleanChanges/images/Arr_u.png Binary files differindex 1aa543af..8566f6b7 100644 --- a/MLEB/CleanChanges/images/Arr_u.png +++ b/MLEB/CleanChanges/images/Arr_u.png diff --git a/MLEB/CleanChanges/images/showuserlinks.png b/MLEB/CleanChanges/images/showuserlinks.png Binary files differindex 00a9cee1..872a40f5 100644 --- a/MLEB/CleanChanges/images/showuserlinks.png +++ b/MLEB/CleanChanges/images/showuserlinks.png diff --git a/MLEB/CleanChanges/resources/cleanchanges.js b/MLEB/CleanChanges/resources/cleanchanges.js index c11ec80b..6775572c 100644 --- a/MLEB/CleanChanges/resources/cleanchanges.js +++ b/MLEB/CleanChanges/resources/cleanchanges.js @@ -1,4 +1,4 @@ -(function ( mw, $ ) { +( function ( mw, $ ) { 'use strict'; window.toggleVisibilityE = function ( levelId, otherId, linkId, type ) { @@ -20,4 +20,43 @@ window.showUserInfo = function ( sourceVar, targetId ) { $( '#' + targetId ).html( mw.config.get( sourceVar ) ); }; + + $( function () { + $( '.mw-cleanchanges-showuserinfo' ).each( function () { + var $this, id, target; + + $this = $( this ); + id = $this.data( 'mw-userinfo-id' ); + target = $this.data( 'mw-userinfo-target' ); + if ( id !== undefined ) { + $this.on( 'click keypress', function ( e ) { + if ( + e.type === 'click' || + e.type === 'keypress' && e.which === 13 + ) { + window.showUserInfo( 'wgUserInfo' + id, target ); + } + } ); + } + } ); + $( '.mw-cleanchanges-showblock' ).each( function () { + var $this, level, other, link; + + $this = $( this ); + level = $this.data( 'mw-cleanchanges-level' ); + other = $this.data( 'mw-cleanchanges-other' ); + link = $this.data( 'mw-cleanchanges-link' ); + if ( level !== undefined ) { + $this.on( 'click keypress', function ( e ) { + if ( + e.type === 'click' || + e.type === 'keypress' && e.which === 13 + ) { + window.toggleVisibilityE( level, other, link, 'block' ); + } + } ); + } + } ); + + } ); }( mediaWiki, jQuery ) ); diff --git a/MLEB/CleanChanges/resources/cleanchanges.uls.css b/MLEB/CleanChanges/resources/cleanchanges.uls.css index 3e902cc4..f188c855 100644 --- a/MLEB/CleanChanges/resources/cleanchanges.uls.css +++ b/MLEB/CleanChanges/resources/cleanchanges.uls.css @@ -1,21 +1,27 @@ .ext-cc-language-selector__trigger { - color: #0645AD; cursor: pointer; + + color: #0645ad; } .ext-cc-language-selector__trigger:after { - margin-left: 4px; - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid #0645AD; - content: ""; display: inline-block; + + margin-left: 4px; + + content: ''; vertical-align: middle; + + border-top: 4px solid #0645ad; + border-right: 4px solid transparent; + border-left: 4px solid transparent; } .ext-cc-language-selector__clear { - padding-left: 10px; font-weight: bold; + + padding-left: 10px; + cursor: pointer; } diff --git a/MLEB/CleanChanges/resources/cleanchanges.uls.js b/MLEB/CleanChanges/resources/cleanchanges.uls.js index 45673416..88631cf9 100644 --- a/MLEB/CleanChanges/resources/cleanchanges.uls.js +++ b/MLEB/CleanChanges/resources/cleanchanges.uls.js @@ -1,7 +1,7 @@ -/** +/*! * * @author Niklas Laxström - * @license GPL-2.0+ + * @license GPL-2.0-or-later */ ( function ( $, mw ) { 'use strict'; @@ -16,7 +16,6 @@ .text( 'X' ) .addClass( 'ext-cc-language-selector__clear' ); - $trigger.hide().after( $( '<span>' ) .addClass( 'ext-cc-language-selector' ) @@ -47,13 +46,18 @@ $trigger.val( '/' + language ); update( language ); }, + ulsPurpose: 'clean-changes', quickList: mw.uls.getFrequentLanguageList } ); } - $( document ).ready( function () { - mw.loader.using( 'ext.uls.mediawiki', function () { - useULS( $( '#sp-rc-language' ) ); - } ); + $( function () { + var $trigger = $( '#sp-rc-language' ); + + if ( $trigger.length ) { + mw.loader.using( 'ext.uls.mediawiki', function () { + useULS( $trigger ); + } ); + } } ); }( jQuery, mediaWiki ) ); |