https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114251
Revision: 114251
Author: amire80
Date: 2012-03-20 10:59:52 +0000 (Tue, 20 Mar 2012)
Log Message:
-----------
Using the refactored multiselectautocomplete module.
Modified Paths:
--------------
trunk/extensions/TranslationNotifications/SpecialNotifyTranslators.php
trunk/extensions/TranslationNotifications/TranslationNotifications.php
trunk/extensions/TranslationNotifications/resources/ext.translationnotifications.notifytranslators.js
Modified: trunk/extensions/TranslationNotifications/SpecialNotifyTranslators.php
===================================================================
--- trunk/extensions/TranslationNotifications/SpecialNotifyTranslators.php
2012-03-20 10:58:10 UTC (rev 114250)
+++ trunk/extensions/TranslationNotifications/SpecialNotifyTranslators.php
2012-03-20 10:59:52 UTC (rev 114251)
@@ -28,7 +28,7 @@
}
public function execute( $parameters ) {
- global $wgUser, $wgOut;
+ global $wgUser, $wgOut, $wgContLang, $wgLang;
$this->setHeaders();
if ( !$wgUser->isallowed( self::$right ) ) {
@@ -50,6 +50,10 @@
$htmlForm->setSubmitCallback( array( $this,
'submitNotifyTranslatorsForm' ) );
$htmlForm->show();
+ // Dummy dropdown, will be invisible. Used as data source for
language name autocompletion.
+ $languageSelector = Xml::languageSelector(
$wgContLang->getCode(), false, $wgLang->getCode() );
+ $wgOut->addHtml( $languageSelector[1] );
+
$wgOut->addModules(
'ext.translationnotifications.notifytranslators' );
}
Modified: trunk/extensions/TranslationNotifications/TranslationNotifications.php
===================================================================
--- trunk/extensions/TranslationNotifications/TranslationNotifications.php
2012-03-20 10:58:10 UTC (rev 114250)
+++ trunk/extensions/TranslationNotifications/TranslationNotifications.php
2012-03-20 10:59:52 UTC (rev 114251)
@@ -39,20 +39,11 @@
'remoteExtPath' => 'TranslationNotifications'
);
-// For language list autocompletion
-$wgResourceModules['ext.translate.special.pagetranslation'] = array(
- 'scripts' =>
'../Translate/resources/ext.translate.special.pagetranslation.js',
- 'styles' =>
'../Translate/resources/ext.translate.special.pagetranslation.css',
- 'dependencies' => array(
- 'jquery.ui.autocomplete',
- ),
- 'position' => 'top',
-) + $resourcePaths;
-
$wgResourceModules['ext.translationnotifications.notifytranslators'] = array(
'scripts' =>
'resources/ext.translationnotifications.notifytranslators.js',
'dependencies' => array(
- 'jquery.ui.datepicker'
+ 'jquery.ui.datepicker',
+ 'ext.translate.multiselectautocomplete',
),
) + $resourcePaths;
Modified:
trunk/extensions/TranslationNotifications/resources/ext.translationnotifications.notifytranslators.js
===================================================================
---
trunk/extensions/TranslationNotifications/resources/ext.translationnotifications.notifytranslators.js
2012-03-20 10:58:10 UTC (rev 114250)
+++
trunk/extensions/TranslationNotifications/resources/ext.translationnotifications.notifytranslators.js
2012-03-20 10:59:52 UTC (rev 114251)
@@ -29,4 +29,6 @@
}
} );
} );
+
+ $( "#wpUserLanguage" ).multiselectautocomplete( { inputbox :
'#mw-input-wpLanguagesToNotify' } );
} )( jQuery );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs