[MediaWiki-CVS] SVN: [83572] branches/Maps0.8/includes
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83572 Revision: 83572 Author: jeroendedauw Date: 2011-03-09 09:02:26 + (Wed, 09 Mar 2011) Log Message: --- some changes for sm Modified Paths: -- branches/Maps0.8/includes/Maps_MappingService.php branches/Maps0.8/includes/features/Maps_BasePointMap.php branches/Maps0.8/includes/iMappingFeature.php branches/Maps0.8/includes/iMappingService.php branches/Maps0.8/includes/services/YahooMaps/Maps_YahooMaps.php Modified: branches/Maps0.8/includes/Maps_MappingService.php === --- branches/Maps0.8/includes/Maps_MappingService.php 2011-03-09 07:53:08 UTC (rev 83571) +++ branches/Maps0.8/includes/Maps_MappingService.php 2011-03-09 09:02:26 UTC (rev 83572) @@ -236,6 +236,15 @@ */ public final function addDependency( $dependencyHtml ) { $this-dependencies[] = $dependencyHtml; - } + } + /** +* @see iMappingService::getEarthZoom +* +* @since 0.8 +*/ + public function getEarthZoom() { + return 1; + } + } \ No newline at end of file Modified: branches/Maps0.8/includes/features/Maps_BasePointMap.php === --- branches/Maps0.8/includes/features/Maps_BasePointMap.php2011-03-09 07:53:08 UTC (rev 83571) +++ branches/Maps0.8/includes/features/Maps_BasePointMap.php2011-03-09 09:02:26 UTC (rev 83572) @@ -24,30 +24,6 @@ } /** -* Returns the specific parameters by first checking if they have been initialized yet, -* doing to work if this is not the case, and then returning them. -* -* @return array -*/ - public final function getSpecificParameterInfo() { - if ( $this-specificParameters === false ) { - $this-specificParameters = array(); - $this-initSpecificParamInfo( $this-specificParameters ); - } - - return $this-specificParameters; - } - - /** -* Initializes the specific parameters. -* -* Override this method to set parameters specific to a feature service comibination in -* the inheriting class. -*/ - protected function initSpecificParamInfo( array $parameters ) { - } - - /** * Handles the request from the parser hook by doing the work that's common for all * mapping services, calling the specific methods and finally returning the resulting output. * Modified: branches/Maps0.8/includes/iMappingFeature.php === --- branches/Maps0.8/includes/iMappingFeature.php 2011-03-09 07:53:08 UTC (rev 83571) +++ branches/Maps0.8/includes/iMappingFeature.php 2011-03-09 09:02:26 UTC (rev 83572) @@ -14,23 +14,5 @@ */ interface iMappingFeature { - /** -* Adds the HTML specific to the mapping service to the output. -* -* @since 0.6.5 -* -* @return string -*/ - function addSpecificMapHTML(); - /** -* Returns the specific parameters by first checking if they have been initialized yet, -* doing to work if this is not the case, and then returning them. -* -* @since 0.6.5 -* -* @return array -*/ - function getSpecificParameterInfo(); - } \ No newline at end of file Modified: branches/Maps0.8/includes/iMappingService.php === --- branches/Maps0.8/includes/iMappingService.php 2011-03-09 07:53:08 UTC (rev 83571) +++ branches/Maps0.8/includes/iMappingService.php 2011-03-09 09:02:26 UTC (rev 83572) @@ -101,6 +101,15 @@ function getDefaultZoom(); /** +* Returns the zoomlevel that shows the whole earth for the mapping service. +* +* @since 0.8 +* +* @return integer +*/ + public function getEarthZoom(); + + /** * Returns a string that can be used as an unique ID for the map html element. * Increments the number by default, providing false for $increment will get * you the same ID as on the last request. Modified: branches/Maps0.8/includes/services/YahooMaps/Maps_YahooMaps.php === --- branches/Maps0.8/includes/services/YahooMaps/Maps_YahooMaps.php 2011-03-09 07:53:08 UTC (rev 83571) +++ branches/Maps0.8/includes/services/YahooMaps/Maps_YahooMaps.php 2011-03-09 09:02:26 UTC (rev 83572) @@ -93,6 +93,15 @@ global $egMapsYahooMapsZoom; return
[MediaWiki-CVS] SVN: [83573] branches/Maps0.8
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83573 Revision: 83573 Author: jeroendedauw Date: 2011-03-09 09:04:15 + (Wed, 09 Mar 2011) Log Message: --- rem obsolete stuff Modified Paths: -- branches/Maps0.8/Maps.php branches/Maps0.8/includes/iMappingService.php Removed Paths: - branches/Maps0.8/includes/iMappingFeature.php Modified: branches/Maps0.8/Maps.php === --- branches/Maps0.8/Maps.php 2011-03-09 09:02:26 UTC (rev 83572) +++ branches/Maps0.8/Maps.php 2011-03-09 09:04:15 UTC (rev 83573) @@ -69,7 +69,6 @@ $wgAutoloadClasses['MapsLayerPage']= $incDir . 'Maps_LayerPage.php'; $wgAutoloadClasses['MapsLayers'] = $incDir . 'Maps_Layers.php'; $wgAutoloadClasses['MapsLocation'] = $incDir . 'Maps_Location.php'; -$wgAutoloadClasses['iMappingFeature'] = $incDir . 'iMappingFeature.php'; $wgAutoloadClasses['iMappingService'] = $incDir . 'iMappingService.php'; $wgAutoloadClasses['MapsMappingServices'] = $incDir . 'Maps_MappingServices.php'; $wgAutoloadClasses['MapsMappingService'] = $incDir . 'Maps_MappingService.php'; Deleted: branches/Maps0.8/includes/iMappingFeature.php === --- branches/Maps0.8/includes/iMappingFeature.php 2011-03-09 09:02:26 UTC (rev 83572) +++ branches/Maps0.8/includes/iMappingFeature.php 2011-03-09 09:04:15 UTC (rev 83573) @@ -1,18 +0,0 @@ -?php - -/** - * Interface that should be implemented by all mapping features that want to use the. - * - * @since 0.6.5 - * - * @file iMappingFeature.php - * @ingroup Maps - * - * @author Jeroen De Dauw - * - * TODO: update to 0.7 architecture - */ -interface iMappingFeature { - - -} \ No newline at end of file Modified: branches/Maps0.8/includes/iMappingService.php === --- branches/Maps0.8/includes/iMappingService.php 2011-03-09 09:02:26 UTC (rev 83572) +++ branches/Maps0.8/includes/iMappingService.php 2011-03-09 09:04:15 UTC (rev 83573) @@ -67,7 +67,7 @@ * * @param string $featureName. * -* @return iMappingFeature or false +* @return object or false */ function getFeatureInstance( $featureName ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83574] branches/SemanticMaps0.8/includes
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83574 Revision: 83574 Author: jeroendedauw Date: 2011-03-09 09:05:13 + (Wed, 09 Mar 2011) Log Message: --- works on QPs and FIs Modified Paths: -- branches/SemanticMaps0.8/includes/forminputs/SM_FormInput.php branches/SemanticMaps0.8/includes/forminputs/SM_FormInputs.php branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php branches/SemanticMaps0.8/includes/queryprinters/SM_QueryPrinters.php branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMapsFormInput.php branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMapsQP.php branches/SemanticMaps0.8/includes/services/OpenLayers/SM_OpenLayersFormInput.php branches/SemanticMaps0.8/includes/services/YahooMaps/SM_YahooMapsFormInput.php Modified: branches/SemanticMaps0.8/includes/forminputs/SM_FormInput.php === --- branches/SemanticMaps0.8/includes/forminputs/SM_FormInput.php 2011-03-09 09:04:15 UTC (rev 83573) +++ branches/SemanticMaps0.8/includes/forminputs/SM_FormInput.php 2011-03-09 09:05:13 UTC (rev 83574) @@ -1,392 +1,25 @@ ?php -/** - * Abstract class that provides the common functionality for all map form inputs - * - * @file SM_FormInput.php - * @ingroup SemanticMaps - * - * @author Jeroen De Dauw - */ -abstract class SMFormInput implements iMappingFeature { +class SMFormInput { + /** -* Ensures all dependencies for the used map are loaded, and increases that map service's count -*/ - protected abstract function addFormDependencies(); - - /** -* Returns the zoom level at which the whole earth is visible. -*/ - protected abstract function getEarthZoom(); - - /** -* List of parameter definitions for forms. +* @since 0.8 * -* @var array or false -*/ - protected static $formParameters = false; - - /** * @var iMappingService */ - protected $service; + protected $service; /** -* @var array -*/ - protected $markerCoords; - - /** -* Parameters specific to this feature. -* -* @var mixed -*/ - protected $specificParameters = false; - - protected $coordsFieldName; - - private $coordinates; - - /** * Constructor. * +* @since 0.8 +* * @param iMappingService $service */ public function __construct( iMappingService $service ) { $this-service = $service; } - /** -* Returns the specific parameters by first checking if they have been initialized yet, -* doing to work if this is not the case, and then returning them. -* -* @since 0.6.5 -* -* @return array -*/ - public final function getSpecificParameterInfo() { - if ( $this-specificParameters === false ) { - $this-specificParameters = array(); - $this-initSpecificParamInfo( $this-specificParameters ); - } - - return $this-specificParameters; - } - /** -* Initializes the specific parameters. -* -* Override this method to set parameters specific to a feature service comibination in -* the inheriting class. -* -* @since 0.6.5 -* -* @param array $parameters -*/ - protected function initSpecificParamInfo( array $parameters ) { - } - - /** -* Validates and corrects the provided map properties, and the sets them as class fields. -* -* @param array $mapProperties -* -* @return mixed ValidationError object if there is a fatal error, false othewise -*/ - protected final function setMapProperties( array $mapProperties ) { - /* -* Assembliy of the allowed parameters and their information. -* The main parameters (the ones that are shared by everything) are overidden -* by the feature parameters (the ones specific to a feature). The result is then -* again overidden by the service parameters (the ones specific to the service), -* and finally by the specific parameters (the ones specific to a service-feature combination). -*/ - $parameterInfo = $this-getFormParameterInfo(); - $this-service-addParameterInfo( $parameterInfo ); - - // TODO - $parameterInfo = array_merge_recursive( $parameterInfo,
[MediaWiki-CVS] SVN: [83575] branches/SemanticMaps0.8/includes
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83575 Revision: 83575 Author: jeroendedauw Date: 2011-03-09 09:13:23 + (Wed, 09 Mar 2011) Log Message: --- throwing out stupid one-method classes Modified Paths: -- branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMaps.php branches/SemanticMaps0.8/includes/services/GoogleMaps3/SM_GoogleMaps3.php branches/SemanticMaps0.8/includes/services/OpenLayers/SM_OpenLayers.php Removed Paths: - branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMapsQP.php branches/SemanticMaps0.8/includes/services/GoogleMaps3/SM_GoogleMaps3QP.php branches/SemanticMaps0.8/includes/services/OpenLayers/SM_OpenLayersQP.php branches/SemanticMaps0.8/includes/services/YahooMaps/SM_YahooMapsQP.php Modified: branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php === --- branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php 2011-03-09 09:05:13 UTC (rev 83574) +++ branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php 2011-03-09 09:13:23 UTC (rev 83575) @@ -8,18 +8,9 @@ * * @author Jeroen De Dauw */ -abstract class SMMapPrinter extends SMWResultPrinter { +class SMMapPrinter extends SMWResultPrinter { /** -* Returns the name of the service to get the correct mapping service object. -* -* @since 0.6.3 -* -* @return string -*/ - protected abstract function getServiceName(); - - /** * @since 0.6 * * @var iMappingService @@ -47,12 +38,7 @@ * @param $inline * @param $service iMappingService */ - public function __construct( $format, $inline, /* iMappingService */ $service = null ) { - // TODO: this is a hack since I can't find a way to pass along the service object here when the QP is created in SMW. - if ( $service == null ) { - $service = MapsMappingServices::getServiceInstance( $this-getServiceName() ); - } - + public function __construct( $format, $inline, iMappingService $service ) { $this-service = $service; } Modified: branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMaps.php === --- branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMaps.php 2011-03-09 09:05:13 UTC (rev 83574) +++ branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMaps.php 2011-03-09 09:13:23 UTC (rev 83575) @@ -30,7 +30,7 @@ // TODO: the if should not be needed, but when omitted, a fatal error occurs cause the class that's extended by this one is not found. if ( defined( 'SF_VERSION' ) ) $wgAutoloadClasses['SMGoogleMapsFormInput'] = dirname( __FILE__ ) . '/SM_GoogleMapsFormInput.php'; - MapsMappingServices::registerServiceFeature( 'googlemaps2', 'qp', 'SMGoogleMapsQP' ); + MapsMappingServices::registerServiceFeature( 'googlemaps2', 'qp', 'SMMapPrinter' ); MapsMappingServices::registerServiceFeature( 'googlemaps2', 'fi', 'SMGoogleMapsFormInput' ); return true; Deleted: branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMapsQP.php === --- branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMapsQP.php 2011-03-09 09:05:13 UTC (rev 83574) +++ branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMapsQP.php 2011-03-09 09:13:23 UTC (rev 83575) @@ -1,21 +0,0 @@ -?php -/** - * A query printer for maps using the Google Maps API. - * - * @file SM_GoogleMapsQP.php - * @ingroup SMGoogleMaps - * - * @author Robert Buzink - * @author Yaron Koren - * @author Jeroen De Dauw - */ -class SMGoogleMapsQP extends SMMapPrinter { - - /** -* @see SMMapPrinter::getServiceName -*/ - protected function getServiceName() { - return 'googlemaps2'; - } - -} Modified: branches/SemanticMaps0.8/includes/services/GoogleMaps3/SM_GoogleMaps3.php === --- branches/SemanticMaps0.8/includes/services/GoogleMaps3/SM_GoogleMaps3.php 2011-03-09 09:05:13 UTC (rev 83574) +++ branches/SemanticMaps0.8/includes/services/GoogleMaps3/SM_GoogleMaps3.php 2011-03-09 09:13:23 UTC (rev 83575) @@ -27,7 +27,7 @@ $wgAutoloadClasses['SMGoogleMaps3QP'] = dirname( __FILE__ ) . '/SM_GoogleMaps3QP.php'; - MapsMappingServices::registerServiceFeature( 'googlemaps3', 'qp', 'SMGoogleMaps3QP' ); + MapsMappingServices::registerServiceFeature( 'googlemaps3', 'qp', 'SMMapPrinter' );
[MediaWiki-CVS] SVN: [83576] branches/SemanticMaps0.8/includes
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83576 Revision: 83576 Author: jeroendedauw Date: 2011-03-09 09:32:46 + (Wed, 09 Mar 2011) Log Message: --- follow up to r83575 Modified Paths: -- branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php branches/SemanticMaps0.8/includes/services/YahooMaps/SM_YahooMaps.php Modified: branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php === --- branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php 2011-03-09 09:13:23 UTC (rev 83575) +++ branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php 2011-03-09 09:32:46 UTC (rev 83576) @@ -311,8 +311,6 @@ * @return array */ public function getParameters() { - global $egMapsMapWidth, $egMapsMapHeight; - $params = parent::getParameters(); // Now go through the descriptions, and convert them from Validator- to SMW-style. Modified: branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php === --- branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php 2011-03-09 09:13:23 UTC (rev 83575) +++ branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php 2011-03-09 09:32:46 UTC (rev 83576) @@ -44,37 +44,29 @@ $QPClass = $service-getFeature( 'qp' ); $this-queryPrinter = new $QPClass( $format, $inline, $service ); } - - public static function getAliases() { - return $this-queryPrinter-getAliases(); - } - public static function setAliases() { - return $this-queryPrinter-setAliases(); - } - + /** +* Intercept calls to getName, so special behaviour for the map format can be implemented. +* +* @since 0.8 +* +* @return string +*/ public function getName() { return $this-isMapFormat ? wfMsg( 'maps_map' ) : $this-queryPrinter-getName(); } - public function getQueryMode( $context ) { - return $this-queryPrinter-getQueryMode( $context ); + /** +* SMW thinks this class is a SMWResultPrinter, and calls methods that should +* be forewarded to $this-queryPrinter on it. +* +* @since 0.8 +* +* @param string $name +* @param array $arguments +*/ + public function __call( $name, array $arguments ) { + return call_user_func_array( array( $this-queryPrinter, $name ), $arguments ); } - public function getResult( $results, $params, $outputmode ) { - return $this-queryPrinter-getResult( $results, $params, $outputmode ); - } - - protected function getResultText( $res, $outputmode ) { - return $this-queryPrinter-getResultText( $res, $outputmode ); - } - - public function getParameters() { - return $this-queryPrinter-getParameters(); - } - - public function getMimeType( $res ) { - return $this-queryPrinter-getMimeType( $res ); - } - -} \ No newline at end of file +} Modified: branches/SemanticMaps0.8/includes/services/YahooMaps/SM_YahooMaps.php === --- branches/SemanticMaps0.8/includes/services/YahooMaps/SM_YahooMaps.php 2011-03-09 09:13:23 UTC (rev 83575) +++ branches/SemanticMaps0.8/includes/services/YahooMaps/SM_YahooMaps.php 2011-03-09 09:32:46 UTC (rev 83576) @@ -30,7 +30,7 @@ // TODO: the if should not be needed, but when omitted, a fatal error occurs cause the class that's extended by this one is not found. if ( defined( 'SF_VERSION' ) ) $wgAutoloadClasses['SMYahooMapsFormInput'] = dirname( __FILE__ ) . '/SM_YahooMapsFormInput.php'; - MapsMappingServices::registerServiceFeature( 'yahoomaps', 'qp', 'SMYahooMapsQP' ); + MapsMappingServices::registerServiceFeature( 'yahoomaps', 'qp', 'SMMapPrinter' ); MapsMappingServices::registerServiceFeature( 'yahoomaps', 'fi', 'SMYahooMapsFormInput' ); return true; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83577] branches/SemanticMaps0.8/includes/queryprinters
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83577 Revision: 83577 Author: jeroendedauw Date: 2011-03-09 09:45:47 + (Wed, 09 Mar 2011) Log Message: --- doc updates Modified Paths: -- branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php branches/SemanticMaps0.8/includes/queryprinters/SM_QueryPrinters.php Modified: branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php === --- branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php 2011-03-09 09:32:46 UTC (rev 83576) +++ branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php 2011-03-09 09:45:47 UTC (rev 83577) @@ -1,12 +1,14 @@ ?php /** - * Abstract class that provides the common functionality for all map query printers. + * Query printer for maps. Is invoked via SMMapper. + * Can be overriden per service to have custom output. * * @file SM_MapPrinter.php * @ingroup SemanticMaps * - * @author Jeroen De Dauw + * @licence GNU GPL v3 + * @author Jeroen De Dauw jeroended...@gmail.com */ class SMMapPrinter extends SMWResultPrinter { Modified: branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php === --- branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php 2011-03-09 09:32:46 UTC (rev 83576) +++ branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php 2011-03-09 09:45:47 UTC (rev 83577) @@ -1,12 +1,16 @@ ?php /** - * General map query printer class. + * Default class to assign as handler for map result formats. + * The reason SMMapPrinter is not used for this directly is that + * this would not allow having a deriving class of SMMapPrinter + * for a particular mapping service. * * @file SM_Mapper.php * @ingroup SemanticMaps * - * @author Jeroen De Dauw + * @licence GNU GPL v3 + * @author Jeroen De Dauw jeroended...@gmail.com */ final class SMMapper { Modified: branches/SemanticMaps0.8/includes/queryprinters/SM_QueryPrinters.php === --- branches/SemanticMaps0.8/includes/queryprinters/SM_QueryPrinters.php 2011-03-09 09:32:46 UTC (rev 83576) +++ branches/SemanticMaps0.8/includes/queryprinters/SM_QueryPrinters.php 2011-03-09 09:45:47 UTC (rev 83577) @@ -92,9 +92,9 @@ if ( isset( $smwgResultFormats ) ) { $smwgResultFormats[$format] = $class; } - else { + else { // BC with some old SMW version SMWQueryProcessor::$formats[$format] = $class; } } -} \ No newline at end of file +} ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83578] branches/ariel/xmldumps-backup/recombine-history.sh
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83578 Revision: 83578 Author: ariel Date: 2011-03-09 09:52:20 + (Wed, 09 Mar 2011) Log Message: --- vaguely useful shell script for recombining pieces of history dumps in parallel Added Paths: --- branches/ariel/xmldumps-backup/recombine-history.sh Added: branches/ariel/xmldumps-backup/recombine-history.sh === --- branches/ariel/xmldumps-backup/recombine-history.sh (rev 0) +++ branches/ariel/xmldumps-backup/recombine-history.sh 2011-03-09 09:52:20 UTC (rev 83578) @@ -0,0 +1,96 @@ +#!/bin/bash + +if [ -z $4 ]; then + echo This script recombines one piece of a history dump for a given piece number, date and project. + echo Usage: $0 date part subpieces projectname '[configfile]' + echo Example: $0 20110223 1 pre,a,b,c,d,e,f,g enwiki + echo + echo Expects names to have the form blah-pages-meta-history-n.xml.bz2 + exit 1 +fi + +date=$1 +number=$2 +subpiecenums=$3 +project=$4 + +if [ ! -z $5 ]; then +configfile=$5 +else +configfile=wikidump.conf +fi + +if [ ! -f $configfile ]; then +echo Can't open configuration file $configfile, exiting... +exit 1 +fi + +subpieces=`echo $subpiecenums | sed -e 's/,/ /g;'` + +phase3=`egrep ^dir= $configfile | awk -Fdir= '{ print $2 }'` +publicdumps=`egrep ^public= $configfile | awk -Fpublic= '{ print $2 }'` +head=`egrep ^head= $configfile | awk -Fhead= '{ print $2 }'` +if [ -z $head ]; then +head=/usr/bin/head +fi +tail=`egrep ^tail= $configfile | awk -Ftail= '{ print $2 }'` +if [ -z $tail ]; then +tail=/usr/bin/tail +fi +bzip=`egrep ^bzip2= $configfile | awk -Fbzip2= '{ print $2 }'` +basefilename=${publicdumps}/${project}/${date}/${project}-${date}-pages-meta-history${number} +outfile=${basefilename}.xml.bz2 +if [ -f $outfile ]; then + echo output file $outfile + echo already exists, please remove before running this script + errors=TRUE +fi + +for i in $subpieces; do +histfilepiece=${basefilename}-${i}.xml.bz2 +if [ ! -f $histfilepiece ]; then + echo no history file found: $histfilepiece + errors=TRUE +fi +done + +# string the command together now +command= +last=`echo $subpieces | awk '{ print $NF }'` +first=`echo $subpieces | awk '{ print $1 }'` +for i in $subpieces; do +histfilepiece=${basefilename}-${i}.xml.bz2 +if [ $i == $first ]; then + # first part of command, put header but not footer + command=$bzip -dc $histfilepiece | $head -n -1; +elif [ $i == $last ]; then + # last part of command, put footer but not header + headerEndNum=`$bzip -dc $histfilepiece | $head -n 2000 | grep -n '/siteinfo' | awk -F: '{ print $1 }'` + headerEndNum=$(( $headerEndNum+1 )) + headerEndNum=+$headerEndNum + command=$command $bzip -dc $histfilepiece | $tail -n $headerEndNum +else + # the rest, we strip both header and footer from all the intermediate files + headerEndNum=`$bzip -dc $histfilepiece | $head -n 2000 | grep -n '/siteinfo' | awk -F: '{ print $1 }'` + headerEndNum=$(( $headerEndNum+1 )) + headerEndNum=+$headerEndNum + command=$command $bzip -dc $histfilepiece | $tail -n $headerEndNum | $head -n -1; +fi +done + +if [ -z $errors ]; then +echo about to run: +echo ( $command ) | $bzip $outfile +read -p Is this OK? (N/y) yesorno +case $yesorno in +[Yy]* ) +eval ( $command ) | $bzip $outfile +;; +[Nn]*|* ) +echo OK, exiting at user request; +exit 1; +esac +else +echo exiting... +exit 1 +fi Property changes on: branches/ariel/xmldumps-backup/recombine-history.sh ___ Added: svn:executable + * Added: svn:eol-style + native ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83579] branches/wmf/1.17wmf1/extensions/WikimediaMobile
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83579 Revision: 83579 Author: catrope Date: 2011-03-09 11:54:37 + (Wed, 09 Mar 2011) Log Message: --- 1.17wmf1: Live hack for mobile redirect script: wg* variables aren't available when running in the head, so use other hackery to obtain the same information Modified Paths: -- branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php Modified: branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js === --- branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js 2011-03-09 09:52:20 UTC (rev 83578) +++ branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js 2011-03-09 11:54:37 UTC (rev 83579) @@ -10,8 +10,11 @@ { if ((document.cookie.indexOf(irect=t) 0) // Don't redirect if we have the stop cookie ... only testing a subportion of the cookie. Should be REALLY unique! -(wgNamespaceNumber = 0) // Don't redirect special pages + /* (wgNamespaceNumber = 0) // Don't redirect special pages (wgAction == view))// Don't redirect URLs that aren't simple page views + */ +(!document.getElementsByClassName || document.getElementsByClassName( 'ns--1' ).length == 0) +(document.location.href.indexOf( 'action=' ) == -1 || document.location.href.indexOf( 'action=view' ) != -1 ) { // If we've made it here, then we are going ahead with the redirect Modified: branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php === --- branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php 2011-03-09 09:52:20 UTC (rev 83578) +++ branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php 2011-03-09 11:54:37 UTC (rev 83579) @@ -19,7 +19,7 @@ /** * Increment this when the JS file changes */ -$wgWikimediaMobileVersion = '4'; +$wgWikimediaMobileVersion = '5'; /** * The base URL of the mobile gateway ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83580] branches/ariel/xmldumps-backup/worker.py
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83580 Revision: 83580 Author: ariel Date: 2011-03-09 12:03:23 + (Wed, 09 Mar 2011) Log Message: --- dump iwlinks table for 1.17 Modified Paths: -- branches/ariel/xmldumps-backup/worker.py Modified: branches/ariel/xmldumps-backup/worker.py === --- branches/ariel/xmldumps-backup/worker.py2011-03-09 11:54:37 UTC (rev 83579) +++ branches/ariel/xmldumps-backup/worker.py2011-03-09 12:03:23 UTC (rev 83580) @@ -290,6 +290,7 @@ #PublicTable(revision, #revisiontable, Base per-revision data (does not include text).), // safe? #PrivateTable(text, texttable, Text blob storage. May be compressed, etc.), // ? PublicTable(redirect, redirecttable, Redirect list), + PublicTable(iwlinks, iwlinkstable, Interwiki link tracking records), TitleDump(pagetitlesdump, List of page titles), ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83581] trunk/backup/worker.py
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83581 Revision: 83581 Author: ariel Date: 2011-03-09 12:08:04 + (Wed, 09 Mar 2011) Log Message: --- dump iwlinks table Modified Paths: -- trunk/backup/worker.py Modified: trunk/backup/worker.py === --- trunk/backup/worker.py 2011-03-09 12:03:23 UTC (rev 83580) +++ trunk/backup/worker.py 2011-03-09 12:08:04 UTC (rev 83581) @@ -242,6 +242,7 @@ #PublicTable(revision, Base per-revision data (does not include text).), // safe? #PrivateTable(text, Text blob storage. May be compressed, etc.), // ? PublicTable(redirect, Redirect list), + PublicTable(iwlinks, Interwiki link tracking records), TitleDump(List of page titles), ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83582] branches/SemanticMaps0.8/includes
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83582 Revision: 83582 Author: jeroendedauw Date: 2011-03-09 12:15:06 + (Wed, 09 Mar 2011) Log Message: --- adding js files and copy of old file Added Paths: --- branches/SemanticMaps0.8/includes/forminputs/SM_FormInput.old.php branches/SemanticMaps0.8/includes/services/GoogleMaps/jquery.googlemaps2input.js branches/SemanticMaps0.8/includes/services/GoogleMaps3/jquery.googlemapsinput.js branches/SemanticMaps0.8/includes/services/OpenLayers/jquery.openlayersinput.js branches/SemanticMaps0.8/includes/services/YahooMaps/jquery.yahoomapsinput.js Added: branches/SemanticMaps0.8/includes/forminputs/SM_FormInput.old.php === --- branches/SemanticMaps0.8/includes/forminputs/SM_FormInput.old.php (rev 0) +++ branches/SemanticMaps0.8/includes/forminputs/SM_FormInput.old.php 2011-03-09 12:15:06 UTC (rev 83582) @@ -0,0 +1,392 @@ +?php + +/** + * Abstract class that provides the common functionality for all map form inputs + * + * @file SM_FormInput.php + * @ingroup SemanticMaps + * + * @author Jeroen De Dauw + */ +abstract class SMFormInput implements iMappingFeature { + + /** +* Ensures all dependencies for the used map are loaded, and increases that map service's count +*/ + protected abstract function addFormDependencies(); + + /** +* Returns the zoom level at which the whole earth is visible. +*/ + protected abstract function getEarthZoom(); + + /** +* List of parameter definitions for forms. +* +* @var array or false +*/ + protected static $formParameters = false; + + /** +* @var iMappingService +*/ + protected $service; + + /** +* @var array +*/ + protected $markerCoords; + + /** +* Parameters specific to this feature. +* +* @var mixed +*/ + protected $specificParameters = false; + + protected $coordsFieldName; + + private $coordinates; + + /** +* Constructor. +* +* @param iMappingService $service +*/ + public function __construct( iMappingService $service ) { + $this-service = $service; + } + + /** +* Returns the specific parameters by first checking if they have been initialized yet, +* doing to work if this is not the case, and then returning them. +* +* @since 0.6.5 +* +* @return array +*/ + public final function getSpecificParameterInfo() { + if ( $this-specificParameters === false ) { + $this-specificParameters = array(); + $this-initSpecificParamInfo( $this-specificParameters ); + } + + return $this-specificParameters; + } + + /** +* Initializes the specific parameters. +* +* Override this method to set parameters specific to a feature service comibination in +* the inheriting class. +* +* @since 0.6.5 +* +* @param array $parameters +*/ + protected function initSpecificParamInfo( array $parameters ) { + } + + /** +* Validates and corrects the provided map properties, and the sets them as class fields. +* +* @param array $mapProperties +* +* @return mixed ValidationError object if there is a fatal error, false othewise +*/ + protected final function setMapProperties( array $mapProperties ) { + /* +* Assembliy of the allowed parameters and their information. +* The main parameters (the ones that are shared by everything) are overidden +* by the feature parameters (the ones specific to a feature). The result is then +* again overidden by the service parameters (the ones specific to the service), +* and finally by the specific parameters (the ones specific to a service-feature combination). +*/ + $parameterInfo = $this-getFormParameterInfo(); + $this-service-addParameterInfo( $parameterInfo ); + + // TODO + $parameterInfo = array_merge_recursive( $parameterInfo, $this-getSpecificParameterInfo() ); + + $validator = new Validator( 'form', false ); // TODO + + $validator-setParameters( $mapProperties, $parameterInfo ); + + $validator-validateParameters(); + + $fatalError = $validator-hasFatalError(); + + if (
[MediaWiki-CVS] SVN: [83583] trunk/phase3/skins/common/search.css
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83583 Revision: 83583 Author: catrope Date: 2011-03-09 12:30:08 + (Wed, 09 Mar 2011) Log Message: --- Fix r74388: CSS for IE7 and below was put in a selector that only applies it for IE7 and *above*, causing bug 27547 (Text excerpt doesn't start on a new line in file search results) in other browsers. Fixed this by replacing the selector hack with !ie , a hack that we use to target IE7 and below with our data URL embedding fallback as well Modified Paths: -- trunk/phase3/skins/common/search.css Modified: trunk/phase3/skins/common/search.css === --- trunk/phase3/skins/common/search.css2011-03-09 12:15:06 UTC (rev 83582) +++ trunk/phase3/skins/common/search.css2011-03-09 12:30:08 UTC (rev 83583) @@ -9,6 +9,6 @@ * * This will only affect IE 7 and lower */ -html body .searchresult { - display: inline; +.searchresult { + display: inline !ie; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83584] branches/wmf/1.17wmf1/extensions/WikimediaMobile
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83584 Revision: 83584 Author: catrope Date: 2011-03-09 12:42:56 + (Wed, 09 Mar 2011) Log Message: --- Fix syntax error in r83579 Modified Paths: -- branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php Modified: branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js === --- branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js 2011-03-09 12:30:08 UTC (rev 83583) +++ branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js 2011-03-09 12:42:56 UTC (rev 83584) @@ -14,7 +14,7 @@ (wgAction == view))// Don't redirect URLs that aren't simple page views */ (!document.getElementsByClassName || document.getElementsByClassName( 'ns--1' ).length == 0) -(document.location.href.indexOf( 'action=' ) == -1 || document.location.href.indexOf( 'action=view' ) != -1 ) +(document.location.href.indexOf( 'action=' ) == -1 || document.location.href.indexOf( 'action=view' ) != -1 )) { // If we've made it here, then we are going ahead with the redirect Modified: branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php === --- branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php 2011-03-09 12:30:08 UTC (rev 83583) +++ branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php 2011-03-09 12:42:56 UTC (rev 83584) @@ -19,7 +19,7 @@ /** * Increment this when the JS file changes */ -$wgWikimediaMobileVersion = '5'; +$wgWikimediaMobileVersion = '6'; /** * The base URL of the mobile gateway ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83585] trunk/extensions/Narayam
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83585 Revision: 83585 Author: junaidpv Date: 2011-03-09 12:55:51 + (Wed, 09 Mar 2011) Log Message: --- Naryam: Add escaping for English characters on Sinhala Singlish. Correct errors occured in Oriya scheme due to copy pasting, reported in r83209 by Catrope (Roan Kattouw. Fix a bug: Selected scheme was not rembered in cookie, reported by vssun Modified Paths: -- trunk/extensions/Narayam/ext.narayam.core.js trunk/extensions/Narayam/ext.narayam.rules.or.js trunk/extensions/Narayam/ext.narayam.rules.si-singlish.js Modified: trunk/extensions/Narayam/ext.narayam.core.js === --- trunk/extensions/Narayam/ext.narayam.core.js2011-03-09 12:42:56 UTC (rev 83584) +++ trunk/extensions/Narayam/ext.narayam.core.js2011-03-09 12:55:51 UTC (rev 83585) @@ -342,7 +342,7 @@ this.setScheme = function( name ) { if ( name in schemes ) { currentScheme = schemes[name]; - $.cookie( 'narayam-scheme', scheme, { 'path': '/', 'expires': 30 } ); + $.cookie( 'narayam-scheme', name, { 'path': '/', 'expires': 30 } ); $select.val( name ); } }; Modified: trunk/extensions/Narayam/ext.narayam.rules.or.js === --- trunk/extensions/Narayam/ext.narayam.rules.or.js2011-03-09 12:42:56 UTC (rev 83584) +++ trunk/extensions/Narayam/ext.narayam.rules.or.js2011-03-09 12:55:51 UTC (rev 83585) @@ -7,26 +7,26 @@ */ // Normal rules var rules = [ -['([A-Za-z\\_~\\.0-9])', '','$2'], +['([A-Za-z\\_~\\.0-9])', '','$1'], ['ଞ୍ଜ୍h', '', 'ଞ୍ଝ୍'], // njh ['ଙ୍ଗ୍h', '', 'ଙ୍ଘ୍'], // ngh -['([କ-ହ])୍a', '','$2'], -['([କ-ହ])(a|୍A)', '','$2ା'], -['([କ-ହ])୍i', '','$2\u0b3f'], -['([କ-ହ])(୍I|\u0b3fe)', '','$2ୀ'], -['([କ-ହ])୍u', '','$2\u0b41'], -['([କ-ହ])(୍U|\u0b41u)', '','$2\u0b42'], -['([କ-ହ])୍R', '','$2\u0b43'], -['([କ-ହ])\u0b43R', '','$2\u0b44'], -['([କ-ହ])୍ଳ୍l', '','$2ୢ'], -['([କ-ହ])ୢl', '','$2ୣ'], -['([କ-ହ])୍e', '','$2େ'], -['([କ-ହ])i', '','$2ୈ'], -['([କ-ହ])୍o', '','$2ୋ'], -['([କ-ହ])ୋu', '','$2ୌ'], -['([କ-ହ])୍E', '','$2\u0B48'], +['([କ-ହ])୍a', '','$1'], +['([କ-ହ])(a|୍A)', '','$1ା'], +['([କ-ହ])୍i', '','$1\u0b3f'], +['([କ-ହ])(୍I|\u0b3fe)', '','$1ୀ'], +['([କ-ହ])୍u', '','$1\u0b41'], +['([କ-ହ])(୍U|\u0b41u)', '','$1\u0b42'], +['([କ-ହ])୍R', '','$1\u0b43'], +['([କ-ହ])\u0b43R', '','$1\u0b44'], +['([କ-ହ])୍ଳ୍l', '','$1ୢ'], +['([କ-ହ])ୢl', '','$1ୣ'], +['([କ-ହ])୍e', '','$1େ'], +['([କ-ହ])i', '','$1ୈ'], +['([କ-ହ])୍o', '','$1ୋ'], +['([କ-ହ])ୋu', '','$1ୌ'], +['([କ-ହ])୍E', '','$1\u0B48'], ['ଅa', '','ଆ'], ['(ଅi|ଏe)', '','ଐ'], @@ -119,7 +119,7 @@ jQuery.narayam.addScheme( 'or', { 'namemsg': 'narayam-or', 'extended_keyboard': true, - 'lookbackLength': 0, - 'keyBufferLength': 0, + 'lookbackLength': 4, + 'keyBufferLength': 2, 'rules': rules } ); Modified: trunk/extensions/Narayam/ext.narayam.rules.si-singlish.js === --- trunk/extensions/Narayam/ext.narayam.rules.si-singlish.js 2011-03-09 12:42:56 UTC (rev 83584) +++ trunk/extensions/Narayam/ext.narayam.rules.si-singlish.js 2011-03-09 12:55:51 UTC (rev 83585) @@ -8,6 +8,8 @@ // Normal rules var rules = [ +['([A-Za-z\\_~\\.0-9])', '','$1'], + ['ඬ්හ්a', '', 'ඳ'],// nndha ['න්න්d', '', 'ඬ්'], // nnd ['න්න්g', '', 'ඟ්'], // nng @@ -100,6 +102,6 @@ 'namemsg': 'narayam-si-singlish', 'extended_keyboard': false, 'lookbackLength': 5, - 'keyBufferLength': 0, + 'keyBufferLength': 2, 'rules': rules } ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83586] trunk
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83586 Revision: 83586 Author: catrope Date: 2011-03-09 13:54:02 + (Wed, 09 Mar 2011) Log Message: --- (bug 27944) Search placeholder was inserted even when the search box was already focused, leading to the placeholder being added to the search string. This revision doesn't fix the initial insertion of the placeholder if the search box is focused but empty, but it does remove it upon keydown (and paste), which fixes the search string munging. (bug 26135) Support drag and drop in the search box in Firefox. Done by adding 'drop' to the list of events to update search suggestions for and to remove the placeholder for. Removing the placeholder is trickier in this case because 'drop' fires after the text has already been inserted, and because it could have been inserted at any offset in the placeholder string. Used dataTransfer magic to obtain the text being dropped and just overwrote the search box text with that. Modified Paths: -- trunk/extensions/Vector/modules/ext.vector.simpleSearch.js trunk/phase3/resources/jquery/jquery.placeholder.js Modified: trunk/extensions/Vector/modules/ext.vector.simpleSearch.js === --- trunk/extensions/Vector/modules/ext.vector.simpleSearch.js 2011-03-09 12:55:51 UTC (rev 83585) +++ trunk/extensions/Vector/modules/ext.vector.simpleSearch.js 2011-03-09 13:54:02 UTC (rev 83586) @@ -78,8 +78,9 @@ positionFromLeft: $( 'body' ).is( '.rtl' ), highlightInput: true } ) - .bind( 'paste cut', function( e ) { - // make sure paste and cut events from the mouse trigger the keypress handler and cause the suggestions to update + .bind( 'paste cut drop', function( e ) { + // make sure paste and cut events from the mouse and dragdrop events + // trigger the keypress handler and cause the suggestions to update $( this ).trigger( 'keypress' ); } ); // Special suggestions functionality for skin-provided search box Modified: trunk/phase3/resources/jquery/jquery.placeholder.js === --- trunk/phase3/resources/jquery/jquery.placeholder.js 2011-03-09 12:55:51 UTC (rev 83585) +++ trunk/phase3/resources/jquery/jquery.placeholder.js 2011-03-09 13:54:02 UTC (rev 83586) @@ -37,9 +37,16 @@ } ) // Hide on focus - .focus( function() { + // Also listen for other events in case $input was + // already focused when the events were bound + .bind( 'focus drop keydown paste', function( e ) { if ( $input.hasClass( 'placeholder' ) ) { - this.value = ''; + // Support for dragdrop in Firefox + if ( e.type == 'drop' e.originalEvent.dataTransfer ) { + this.value = e.originalEvent.dataTransfer.getData( 'text/plain' ); + } else { + this.value = ''; + } $input.removeClass( 'placeholder' ); } } ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83587] trunk/phase3/resources/jquery/jquery.placeholder.js
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83587 Revision: 83587 Author: catrope Date: 2011-03-09 14:27:13 + (Wed, 09 Mar 2011) Log Message: --- Fix r83586 (drag and drop support for placeholder plugin) to work in IE, whose dragdrop API is surprisingly similar to Firefox's but with slight differences Modified Paths: -- trunk/phase3/resources/jquery/jquery.placeholder.js Modified: trunk/phase3/resources/jquery/jquery.placeholder.js === --- trunk/phase3/resources/jquery/jquery.placeholder.js 2011-03-09 13:54:02 UTC (rev 83586) +++ trunk/phase3/resources/jquery/jquery.placeholder.js 2011-03-09 14:27:13 UTC (rev 83587) @@ -41,9 +41,26 @@ // already focused when the events were bound .bind( 'focus drop keydown paste', function( e ) { if ( $input.hasClass( 'placeholder' ) ) { - // Support for dragdrop in Firefox if ( e.type == 'drop' e.originalEvent.dataTransfer ) { - this.value = e.originalEvent.dataTransfer.getData( 'text/plain' ); + // Support for dragdrop. Instead of inserting the dropped + // text somewhere in the middle of the placeholder string, + // we want to set the contents of the search box to the + // dropped text. + + // IE wants getData( 'text' ) but Firefox wants getData( 'text/plain' ) + // Firefox fails gracefully with an empty string, IE barfs with an error + try { + // Try the Firefox way + this.value = e.originalEvent.dataTransfer.getData( 'text/plain' ); + } catch ( exception ) { + // Got an exception, so use the IE way + this.value = e.originalEvent.dataTransfer.getData( 'text' ); + } + + // On Firefox, drop fires after the dropped text has been inserted, + // but on IE it fires before. If we don't prevent the default action, + // IE will insert the dropped text twice. + e.preventDefault(); } else { this.value = ''; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83588] trunk/extensions/SemanticForms/includes/SF_FormInputs.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83588 Revision: 83588 Author: yaron Date: 2011-03-09 15:33:24 + (Wed, 09 Mar 2011) Log Message: --- Fixed autocompletion in regular text inputs, for both old and new syntax Modified Paths: -- trunk/extensions/SemanticForms/includes/SF_FormInputs.php Modified: trunk/extensions/SemanticForms/includes/SF_FormInputs.php === --- trunk/extensions/SemanticForms/includes/SF_FormInputs.php 2011-03-09 14:27:13 UTC (rev 83587) +++ trunk/extensions/SemanticForms/includes/SF_FormInputs.php 2011-03-09 15:33:24 UTC (rev 83588) @@ -186,6 +186,11 @@ public static function getHTML( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) { global $sfgTabIndex, $sfgFieldNum; + // For backward compatibility with pre-SF-2.1 forms + if ( array_key_exists( 'autocomplete field type', $other_args ) ) { + return SFTextWithAutocompleteInput::getHTML( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ); + } + $className = createboxInput; if ( $is_mandatory ) { $className .= mandatoryField; @@ -772,7 +777,10 @@ } public static function getAutocompletionTypeAndSource( $field_args ) { - if ( array_key_exists( 'values from property', $field_args ) || + if ( array_key_exists( 'autocomplete field type', $field_args ) ) { + $autocompleteFieldType = $field_args['autocomplete field type']; + $autocompletionSource = $field_args['autocompletion source']; + } elseif ( array_key_exists( 'values from property', $field_args ) || array_key_exists( 'semantic_property', $field_args ) ) { if ( array_key_exists( 'values from property', $field_args ) ) { $autocompletionSource = $field_args['values from property']; @@ -804,9 +812,6 @@ global $sfgFieldNum; $autocompleteFieldType = 'values'; $autocompletionSource = values-$sfgFieldNum; - } elseif ( array_key_exists( 'autocomplete field type', $field_args ) ) { - $autocompleteFieldType = $field_args['autocomplete field type']; - $autocompletionSource = $field_args['autocompletion source']; } else { $autocompleteFieldType = null; $autocompletionSource = null; @@ -846,7 +851,10 @@ $field_args['remote autocompletion'] == true ) { $remoteDataType = $autocompleteFieldType; } elseif ( $autocompletionSource != '' ) { - if ( $autocompleteFieldType == 'values' ) { + if ( array_key_exists( 'possible_values', $field_args ) + count( $field_args['possible_values'] ) 0 ) { + $autocompleteValues = $field_args['possible_values']; + } elseif ( $autocompleteFieldType == 'values' ) { $autocompleteValues = explode( ',', $field_args['values'] ); } else { $autocompleteValues = SFUtils::getAutocompleteValues( $autocompletionSource, $autocompleteFieldType ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83589] trunk/extensions/Translate/utils/TranslationHelpers.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83589 Revision: 83589 Author: nikerabbit Date: 2011-03-09 16:24:54 + (Wed, 09 Mar 2011) Log Message: --- Protect some common untranslatable string from being mangled in translation engines Modified Paths: -- trunk/extensions/Translate/utils/TranslationHelpers.php Modified: trunk/extensions/Translate/utils/TranslationHelpers.php === --- trunk/extensions/Translate/utils/TranslationHelpers.php 2011-03-09 15:33:24 UTC (rev 83588) +++ trunk/extensions/Translate/utils/TranslationHelpers.php 2011-03-09 16:24:54 UTC (rev 83589) @@ -345,7 +345,7 @@ $code = $this-targetLanguage; $definition = trim( strval( $this-getDefinition() ) ); - $definition = str_replace( \n, newline/, $definition ); + $definition = self::wrapUntranslatable( $definition ); $memckey = wfMemckey( 'translate-tmsug-badcodes-' . $serviceName ); $unsupported = $wgMemc-get( $memckey ); @@ -376,7 +376,7 @@ if ( $response-responseStatus === 200 ) { $text = Sanitizer::decodeCharReferences( $response-responseData-translatedText ); - $text = str_replace( newline/, \n, $text ); + $text = self::unwrapUntranslatable( $text ); $text = $this-suggestionField( $text ); return Html::rawElement( 'div', null, self::legend( $serviceName ) . $text . self::clear() ); } elseif ( $response-responseDetails === 'invalid translation language pair' ) { @@ -421,7 +421,7 @@ $code = $this-targetLanguage; $definition = trim( strval( $this-getDefinition() ) ); - $definition = str_replace( \n, newline/, $definition ); + $definition = self::wrapUntranslatable( $definition ); $memckey = wfMemckey( 'translate-tmsug-badcodes-' . $serviceName ); $unsupported = $wgMemc-get( $memckey ); @@ -478,11 +478,24 @@ $ret = $req-getContent(); $text = preg_replace( '~string.*(.*)/string~', '\\1', $ret ); $text = Sanitizer::decodeCharReferences( $text ); - $text = trim( preg_replace( ~\s*newline/newline\s*~, \n, $text ) ); + $text = self::unwrapUntranslatable( $text ); $text = $this-suggestionField( $text ); return Html::rawElement( 'div', null, self::legend( $serviceName ) . $text . self::clear() ); } + protected static function wrapUntranslatable( $text ) { + $text = str_replace( \n, !N!, $text ); + $wrap = 'span class=notranslate\0/span'; + $text = preg_replace( '~%[^% ]+%|\$\d|{VAR:[^}]+}|{?{(PLURAL|GRAMMAR|GENDER):[^|]+\||%(\d\$)?[sd]~', $wrap, $text ); + return $text; + } + + protected static function unwrapUntranslatable( $text ) { + $text = str_replace( '!N!', \n, $text ); + $text = preg_replace( '~span class=notranslate(.*?)/span~', '\1', $text ); + return $text; + } + protected function getApertiumSuggestion( $serviceName, $config ) { global $wgMemc; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83590] trunk/phase3/includes/db/LoadBalancer.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83590 Revision: 83590 Author: reedy Date: 2011-03-09 16:37:39 + (Wed, 09 Mar 2011) Log Message: --- Followup r83558, r83555 Set default of false to $open parameter Modified Paths: -- trunk/phase3/includes/db/LoadBalancer.php Modified: trunk/phase3/includes/db/LoadBalancer.php === --- trunk/phase3/includes/db/LoadBalancer.php 2011-03-09 16:24:54 UTC (rev 83589) +++ trunk/phase3/includes/db/LoadBalancer.php 2011-03-09 16:37:39 UTC (rev 83590) @@ -367,7 +367,7 @@ /** * Wait for a given slave to catch up to the master pos stored in $this */ - function doWait( $index, $open ) { + function doWait( $index, $open = false ) { # Find a connection to wait on $conn = $this-getAnyOpenConnection( $index ); if ( !$conn ) { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83591] branches/wmf/1.17wmf1
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83591 Revision: 83591 Author: reedy Date: 2011-03-09 16:39:59 + (Wed, 09 Mar 2011) Log Message: --- MFT r83590, fixing r83555 Modified Paths: -- branches/wmf/1.17wmf1/includes/db/LoadBalancer.php Property Changed: branches/wmf/1.17wmf1/ branches/wmf/1.17wmf1/includes/ Property changes on: branches/wmf/1.17wmf1 ___ Modified: svn:mergeinfo - /branches/REL1_15/phase3:51646 /branches/new-installer/phase3:43664-66004 /branches/sqlite:58211-58321 /branches/wmf/1.16wmf4:67177,69199,76243,77266 /branches/wmf-deployment:60970 /trunk/phase3:79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,81833,83212 + /branches/REL1_15/phase3:51646 /branches/new-installer/phase3:43664-66004 /branches/sqlite:58211-58321 /branches/wmf/1.16wmf4:67177,69199,76243,77266 /branches/wmf-deployment:60970 /trunk/phase3:79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,81833,83212,83590 Property changes on: branches/wmf/1.17wmf1/includes ___ Modified: svn:mergeinfo - /branches/REL1_15/phase3/includes:51646 /branches/new-installer/phase3/includes:43664-66004 /branches/sqlite/includes:58211-58321 /branches/wmf/1.16wmf4/includes:67177,69199,76243,77266 /branches/wmf-deployment/includes:53381,60970 + /branches/REL1_15/phase3/includes:51646 /branches/new-installer/phase3/includes:43664-66004 /branches/sqlite/includes:58211-58321 /branches/wmf/1.16wmf4/includes:67177,69199,76243,77266 /branches/wmf-deployment/includes:53381,60970 /trunk/phase3/includes:83590 Modified: branches/wmf/1.17wmf1/includes/db/LoadBalancer.php === --- branches/wmf/1.17wmf1/includes/db/LoadBalancer.php 2011-03-09 16:37:39 UTC (rev 83590) +++ branches/wmf/1.17wmf1/includes/db/LoadBalancer.php 2011-03-09 16:39:59 UTC (rev 83591) @@ -367,7 +367,7 @@ /** * Wait for a given slave to catch up to the master pos stored in $this */ - function doWait( $index, $open ) { + function doWait( $index, $open = false ) { # Find a connection to wait on $conn = $this-getAnyOpenConnection( $index ); if ( !$conn ) { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83592] trunk/extensions/SemanticMaps/includes/forminputs/SM_FormInput .php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83592 Revision: 83592 Author: jeroendedauw Date: 2011-03-09 16:43:46 + (Wed, 09 Mar 2011) Log Message: --- fix Modified Paths: -- trunk/extensions/SemanticMaps/includes/forminputs/SM_FormInput.php Modified: trunk/extensions/SemanticMaps/includes/forminputs/SM_FormInput.php === --- trunk/extensions/SemanticMaps/includes/forminputs/SM_FormInput.php 2011-03-09 16:39:59 UTC (rev 83591) +++ trunk/extensions/SemanticMaps/includes/forminputs/SM_FormInput.php 2011-03-09 16:43:46 UTC (rev 83592) @@ -110,12 +110,11 @@ $validator = new Validator( 'form', false ); // TODO - $parameters = array(); - foreach ( $mapProperties as $param ) { - if ( !is_array( $param ) !is_object( $param ) ) { - $parameters[] = $param; + foreach ( $params as $key = $value ) { + if ( !is_array( $value ) !is_object( $value ) ) { + $parameters[$key] = $value; } - } + } $validator-setParameters( $parameters, $parameterInfo ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83593] trunk/phase3/includes/db
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83593 Revision: 83593 Author: reedy Date: 2011-03-09 17:09:10 + (Wed, 09 Mar 2011) Log Message: --- More function/member variable documentation Modified Paths: -- trunk/phase3/includes/db/LBFactory.php trunk/phase3/includes/db/LoadBalancer.php trunk/phase3/includes/db/LoadMonitor.php Modified: trunk/phase3/includes/db/LBFactory.php === --- trunk/phase3/includes/db/LBFactory.php 2011-03-09 16:43:46 UTC (rev 83592) +++ trunk/phase3/includes/db/LBFactory.php 2011-03-09 17:09:10 UTC (rev 83593) @@ -11,6 +11,10 @@ * @ingroup Database */ abstract class LBFactory { + + /** +* @var LBFactory +*/ static $instance; /** @@ -133,6 +137,10 @@ * A simple single-master LBFactory that gets its configuration from the b/c globals */ class LBFactory_Simple extends LBFactory { + + /** +* @var LoadBalancer +*/ var $mainLB; var $extLBs = array(); Modified: trunk/phase3/includes/db/LoadBalancer.php === --- trunk/phase3/includes/db/LoadBalancer.php 2011-03-09 16:43:46 UTC (rev 83592) +++ trunk/phase3/includes/db/LoadBalancer.php 2011-03-09 17:09:10 UTC (rev 83593) @@ -69,6 +69,8 @@ /** * Get a LoadMonitor instance +* +* @return LoadMonitor */ function getLoadMonitor() { if ( !isset( $this-mLoadMonitor ) ) { @@ -354,6 +356,8 @@ /** * Get any open connection to a given server index, local or foreign * Returns false if there is no connection open +* +* @return DatabaseBase */ function getAnyOpenConnection( $i ) { foreach ( $this-mConns as $conns ) { @@ -467,6 +471,8 @@ * Mark a foreign connection as being available for reuse under a different * DB name or prefix. This mechanism is reference-counted, and must be called * the same number of times as getConnection() to work. +* +* @param DatabaseBase $conn */ public function reuseConnection( $conn ) { $serverIndex = $conn-getLBInfo('serverIndex'); Modified: trunk/phase3/includes/db/LoadMonitor.php === --- trunk/phase3/includes/db/LoadMonitor.php2011-03-09 16:43:46 UTC (rev 83592) +++ trunk/phase3/includes/db/LoadMonitor.php2011-03-09 17:09:10 UTC (rev 83593) @@ -14,6 +14,8 @@ interface LoadMonitor { /** * Construct a new LoadMonitor with a given LoadBalancer parent +* +* @param LoadBalancer $parent */ function __construct( $parent ); @@ -57,8 +59,15 @@ * @ingroup Database */ class LoadMonitor_MySQL implements LoadMonitor { - var $parent; // LoadBalancer + /** +* @var LoadBalancer +*/ + var $parent; + + /** +* @param LoadBalancer $parent +*/ function __construct( $parent ) { $this-parent = $parent; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83594] trunk/extensions/GoogleNewsSitemap
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83594 Revision: 83594 Author: reedy Date: 2011-03-09 17:15:57 + (Wed, 09 Mar 2011) Log Message: --- Fixup a few unused variables, debugging comments Add some type hints Modified Paths: -- trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php trunk/extensions/GoogleNewsSitemap/SitemapFeed.php Modified: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php === --- trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php 2011-03-09 17:09:10 UTC (rev 83593) +++ trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php 2011-03-09 17:15:57 UTC (rev 83594) @@ -82,10 +82,10 @@ $this-unload_params(); // populates this-params as a side effect // if there's an error parsing the params, bail out and return - if ( isset( $this-param['error'] ) ) { + if ( isset( $this-params['error'] ) ) { if ( false == $this-params['suppressErrors'] ) { $wgOut-disable(); - echo $this-param['error']; + echo $this-params['error']; } return; } @@ -102,8 +102,6 @@ ); $res = $this-doQuery(); - // Debug line - // echo \np$sql/p\n; // FIXME: figure out how to fail with no results gracefully if ( $res-numRows( $res ) == 0 ) { @@ -126,8 +124,6 @@ return; } - $titleText = ( true == $this-params['nameSpace'] ) ? $title-getPrefixedText() : $title-getText(); - if ( 'sitemap' == $this-params['feed'] ) { $this-pubDate = isset( $row-cl_timestamp ) ? $row-cl_timestamp : date( DATE_ATOM ); @@ -176,6 +172,7 @@ //this is a little hacky, c1 is dynamically defined as the first category //so this can't ever work with uncategorized articles $fields = array('page_namespace', 'page_title', 'page_id', 'c1.cl_timestamp'); + $conditions = array(); if ( $this-params['nameSpace'] ) { $conditions['page_namespace'] = $this-params['nameSpace']; @@ -184,87 +181,88 @@ // If flagged revisions is in use, check which options selected. // FIXME: double check the default options; what should it default to? if ( function_exists( 'efLoadFlaggedRevs' ) ) { - $flaggedPages = $dbr-tableName( 'flaggedpages' ); $filterSet = array( 'only', 'exclude' ); # Either involves the same JOIN here... if ( in_array( $this-params['stable'], $filterSet ) || in_array( $this-params['quality'], $filterSet ) ) { $joins['flaggedpages'] = array( 'LEFT JOIN', 'page_id = fp_page_id' ); - } - switch( $this-params['stable'] ) { + } + + switch( $this-params['stable'] ) { case 'only': $conditions[]='fp_stable IS NOT NULL '; break; case 'exclude': $conditions['fp_stable'] = null; break; - } - switch( $this-params['quality'] ) { + } + switch( $this-params['quality'] ) { case 'only': $conditions[]='fp_quality = 1'; break; case 'exclude': $conditions['fp_quality'] = 0; break; - } } + } - switch ( $this-params['redirects'] ) { - case 'only': - $conditions['page_is_redirect'] = 1; - break; - case 'exclude': - $conditions['page_is_redirect'] = 0; - break; - } + switch ( $this-params['redirects'] ) { + case 'only': + $conditions['page_is_redirect'] = 1; + break; + case 'exclude': +
[MediaWiki-CVS] SVN: [83595] trunk/phase3/languages/messages
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83595 Revision: 83595 Author: rotem Date: 2011-03-09 17:30:22 + (Wed, 09 Mar 2011) Log Message: --- Localization update for he, and whitespace fixes in en. Modified Paths: -- trunk/phase3/languages/messages/MessagesEn.php trunk/phase3/languages/messages/MessagesHe.php Modified: trunk/phase3/languages/messages/MessagesEn.php === --- trunk/phase3/languages/messages/MessagesEn.php 2011-03-09 17:15:57 UTC (rev 83594) +++ trunk/phase3/languages/messages/MessagesEn.php 2011-03-09 17:30:22 UTC (rev 83595) @@ -2963,10 +2963,10 @@ 'undelete-show-file-submit'= 'Yes', # Namespace form on various pages -'namespace' = 'Namespace:', -'invert' = 'Invert selection', +'namespace' = 'Namespace:', +'invert'= 'Invert selection', 'namespace_association' = 'Associated namespace', -'blanknamespace' = '(Main)', +'blanknamespace'= '(Main)', # Contributions 'contributions' = 'User contributions', Modified: trunk/phase3/languages/messages/MessagesHe.php === --- trunk/phase3/languages/messages/MessagesHe.php 2011-03-09 17:15:57 UTC (rev 83594) +++ trunk/phase3/languages/messages/MessagesHe.php 2011-03-09 17:30:22 UTC (rev 83595) @@ -829,6 +829,7 @@ 'usernamehasherror' = 'שם משתמש אינו יכול לכלול תווי סולמית', 'login-throttled'= 'ביצעתם לאחרונה ניסיונות רבים מדי להיכנס לחשבון זה. אנא המתינו לפני שתנסו שוב.', +'login-abort-generic'= 'הכניסה לחשבון לא הצליחה - היא הופסקה', 'loginlanguagelabel' = 'שפה: $1', 'suspicious-userlogout' = 'בקשתכם לצאת מהחשבון נדחתה כיוון שנראה שהיא נשלחה על ידי דפדפן שבור או שרת פרוקסי עם זיכרון מטמון.', @@ -1779,7 +1780,10 @@ 'uploaddisabledtext' = 'אפשרות העלאת הקבצים מבוטלת.', 'php-uploaddisabledtext' = 'אפשרות העלאת הקבצים מבוטלת ברמת PHP. אנא בדקו את ההגדרה file_uploads.', 'uploadscripted' = 'הקובץ כולל קוד סקריפט או HTML שעשוי להתפרש או להתבצע בטעות על ידי הדפדפן.', -'uploadvirus' = 'הקובץ מכיל וירוס! פרטים: div style=direction: ltr;$1/div', +'uploadvirus' = 'הקובץ מכיל וירוס! +פרטים: div style=direction: ltr;$1/div', +'uploadjava' = 'קובץ זה הוא קובץ ZIP שמכיל קובץ .class של Java. +העלאת קובצי Java אסורה, כיוון שהם יכולים לגרום לעקיפת מגבלות האבטחה.', 'upload-source' = 'קובץ המקור', 'sourcefilename' = 'שם הקובץ:', 'sourceurl' = 'כתובת URL של המקור:', @@ -1830,6 +1834,14 @@ 'upload-unknown-size' = 'גודל בלתי ידוע', 'upload-http-error' = 'התרחשה שגיאת HTTP: $1', +# ZipDirectoryReader +'zip-file-open-error' = 'ארעה שגיאה במהלך פתיחת הקובץ לבדיקות ZIP.', +'zip-wrong-format'= 'הקובץ שצוין אינו קובץ ZIP.', +'zip-bad' = 'הקובץ הוא קובץ ZIP פגום או בלתי קריא מסיבה אחרת. +לא ניתן לבצע עליו בדיקת אבטחה כנדרש.', +'zip-unsupported' = 'קובץ זה הוא קובץ ZIP המשתמש בתכונות ZIP שאינן נתמכות על ידי מדיה־ויקי. +לא ניתן לבצע עליו בדיקת אבטחה כנדרש.', + # Special:UploadStash 'uploadstash' = 'מאגר העלאות', 'uploadstash-summary' = 'דף זה מאפשר גישה לקבצים שהועלו (או נמצאים בתהליך העלאה), אך טרם פורסמו באתר הוויקי. קבצים אלה אינם גלויים לאיש מלבד המשתמש שהעלה אותם.', @@ -2471,9 +2483,10 @@ 'undelete-show-file-submit'= 'כן', # Namespace form on various pages -'namespace' = 'מרחב שם:', -'invert' = 'ללא מרחב זה', -'blanknamespace' = '(ראשי)', +'namespace' = 'מרחב שם:', +'invert'= 'ללא מרחב זה', +'namespace_association' = 'מרחב שם צמוד', +'blanknamespace'= '(ראשי)', # Contributions 'contributions' = 'תרומות המשתמש', @@ -2929,6 +2942,7 @@ 'vector.css'= '/* הסגנונות הנכתבים כאן ישפיעו על העיצוב Vector בלבד */', 'print.css' = '/* הסגנונות הנכתבים כאן ישפיעו על הפלט בהדפסה בלבד */', 'handheld.css' = '/* הסגנונות הנכתבים כאן ישפיעו על מכשירים ניידים המבוססים על העיצוב שבהגדרה $wgHandheldStyle בלבד */', +'noscript.css' = '/* הסגנונות הנכתבים כאן ישפיעו על משתמשים עם JavaScript מבוטל */', 'autoconfirmed.css' = '/* הסגנונות הנכתבים כאן ישפיעו על משתמשים ותיקים בלבד */', 'bot.css' = '/* הסגנונות הנכתבים כאן ישפיעו על בוטים בלבד */', 'sysop.css' = '/* הסגנונות הנכתבים כאן ישפיעו על מפעילי מערכת בלבד */', @@ -3643,7 +3657,8 @@ 'specialpages' = 'דפים מיוחדים', 'specialpages-note' = ' * דפים מיוחדים רגילים. -* strong class=mw-specialpagerestrictedדפים מיוחדים מוגבלים./strong', +* strong class=mw-specialpagerestrictedדפים מיוחדים מוגבלים./strong +* span class=mw-specialpagecachedדפים מיוחדים המתקבלים מזיכרון המטמון./span', 'specialpages-group-maintenance' = 'דיווחי תחזוקה', 'specialpages-group-other' = 'דפים מיוחדים אחרים',
[MediaWiki-CVS] SVN: [83596] branches/SemanticMaps0.8/includes
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83596 Revision: 83596 Author: jeroendedauw Date: 2011-03-09 17:48:06 + (Wed, 09 Mar 2011) Log Message: --- some work on the form inputs Modified Paths: -- branches/SemanticMaps0.8/includes/forminputs/SM_FormInput.php branches/SemanticMaps0.8/includes/forminputs/SM_FormInputs.php branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php branches/SemanticMaps0.8/includes/services/GoogleMaps3/SM_GoogleMaps3.php branches/SemanticMaps0.8/includes/services/GoogleMaps3/jquery.googlemapsinput.js Added Paths: --- branches/SemanticMaps0.8/includes/services/GoogleMaps3/SM_GoogleMaps3FormInput.php branches/SemanticMaps0.8/includes/services/GoogleMaps3/ext.sm.googlemapsinput.js Modified: branches/SemanticMaps0.8/includes/forminputs/SM_FormInput.php === --- branches/SemanticMaps0.8/includes/forminputs/SM_FormInput.php 2011-03-09 17:30:22 UTC (rev 83595) +++ branches/SemanticMaps0.8/includes/forminputs/SM_FormInput.php 2011-03-09 17:48:06 UTC (rev 83596) @@ -1,6 +1,14 @@ ?php - +/** + * Base form input class. + * + * @file SM_FormInput.php + * @ingroup SemanticMaps + * + * @licence GNU GPL v3 + * @author Jeroen De Dauw jeroended...@gmail.com + */ class SMFormInput { /** @@ -21,5 +29,157 @@ $this-service = $service; } + /** +* Returns an array containing the parameter info. +* +* @since 0.8 +* +* @return array +*/ + protected function getParameterInfo() { + $params = MapsMapper::getCommonParameters(); + $this-service-addParameterInfo( $params ); + + $params['zoom']-setDefault( false ); + $params['zoom']-setDoManipulationOfDefault( false ); + + $params['centre'] = new Parameter( 'centre' ); + $params['centre']-setDefault( false ); + $params['centre']-addAliases( 'center' ); + $params['centre']-addCriteria( new CriterionIsLocation() ); + $params['centre']-setDoManipulationOfDefault( false ); + $manipulation = new MapsParamLocation(); + $manipulation-toJSONObj = true; + $params['centre']-addManipulations( $manipulation ); + + $params['icon'] = new Parameter( 'icon' ); + $params['icon']-setDefault( '' ); + $params['icon']-addCriteria( New CriterionNotEmpty() ); + + return $params; + } -} \ No newline at end of file + /** +* +* +* @since 0.8 +* +* @param string $coordinates +* @param string $input_name +* @param boolean $is_mandatory +* @param boolean $is_disabled +* @param array $field_args +* +* @return string +*/ + public function getInputOutput( $coordinates, $input_name, $is_mandatory, $is_disabled, array $params ) { + $parameters = array(); + foreach ( $params as $key = $value ) { + if ( !is_array( $value ) !is_object( $value ) ) { + $parameters[$key] = $value; + } + } + + $validator = new Validator( wfMsg( 'maps_' . $this-service-getName() ), false ); + $validator-setParameters( $parameters, $this-getParameterInfo() ); + $validator-validateParameters(); + + $fatalError = $validator-hasFatalError(); + + if ( $fatalError === false ) { + global $wgParser, $wgTitle; + + $params = $validator-getParameterValues(); + $mapName = $this-service-getMapId(); + + $output = $this-getInputHTML( $params, $wgParser, $mapName ) . $this-getJSON( $params, $wgParser, $mapName ); + + $this-service-addResourceModules( $this-getResourceModules() ); + + if ( $wgTitle-isSpecialPage() ) { + global $wgOut; + $this-service-addDependencies( $wgOut ); + } + else { + $this-service-addDependencies( $wgParser ); + } + + return $output; + } + else { + return + 'span class=errorbox' . +
[MediaWiki-CVS] SVN: [83597] trunk/phase3/CREDITS
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83597 Revision: 83597 Author: reedy Date: 2011-03-09 17:57:32 + (Wed, 09 Mar 2011) Log Message: --- Per CR, swap Jarry1250 to Harry Burt Modified Paths: -- trunk/phase3/CREDITS Modified: trunk/phase3/CREDITS === --- trunk/phase3/CREDITS2011-03-09 17:48:06 UTC (rev 83596) +++ trunk/phase3/CREDITS2011-03-09 17:57:32 UTC (rev 83597) @@ -88,8 +88,8 @@ * Derk-Jan Hartman * DieBuche * FunPika +* Harry Burt * Ireas -* Jarry1250 * Jaska Zedlik * Jeremy Baron * Jidanni ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83599] trunk/phase3/resources
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83599 Revision: 83599 Author: maxsem Date: 2011-03-09 18:28:09 + (Wed, 09 Mar 2011) Log Message: --- Fix mime type for all PNG's Property Changed: trunk/phase3/resources/jquery.tipsy/images/tipsy.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_0_aa_40x100.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_55_fbf9ee_40x100.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_65_ff_40x100.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_75_cc_40x100.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_75_dadada_40x100.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_75_e6e6e6_40x100.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_75_ff_40x100.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_95_fef1ec_40x100.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-icons_22_256x240.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-icons_2e83ff_256x240.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-icons_454545_256x240.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-icons_88_256x240.png trunk/phase3/resources/jquery.ui/themes/default/images/ui-icons_cd0a0a_256x240.png Property changes on: trunk/phase3/resources/jquery.tipsy/images/tipsy.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_0_aa_40x100.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_55_fbf9ee_40x100.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_65_ff_40x100.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_75_cc_40x100.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_75_dadada_40x100.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_75_e6e6e6_40x100.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_75_ff_40x100.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-bg_flat_95_fef1ec_40x100.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-icons_22_256x240.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-icons_2e83ff_256x240.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-icons_454545_256x240.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-icons_88_256x240.png ___ Modified: svn:mime-type - application/octet-stream + image/png Property changes on: trunk/phase3/resources/jquery.ui/themes/default/images/ui-icons_cd0a0a_256x240.png ___ Modified: svn:mime-type - application/octet-stream + image/png ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org
[MediaWiki-CVS] SVN: [83600] branches/wmf/1.17wmf1/extensions
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83600 Revision: 83600 Author: catrope Date: 2011-03-09 18:55:54 + (Wed, 09 Mar 2011) Log Message: --- 1.17wmf1: Merge Vector edit section links module plus required ClickTracking changes: r83056, r83057, r83226, r83546, r83547, r83548, r83560 Modified Paths: -- branches/wmf/1.17wmf1/extensions/ClickTracking/ClickTracking.hooks.php branches/wmf/1.17wmf1/extensions/ClickTracking/ClickTracking.php branches/wmf/1.17wmf1/extensions/Vector/Vector.hooks.php branches/wmf/1.17wmf1/extensions/Vector/Vector.i18n.php branches/wmf/1.17wmf1/extensions/Vector/Vector.php Added Paths: --- branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.css branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js branches/wmf/1.17wmf1/extensions/Vector/modules/images/edit-faded.png branches/wmf/1.17wmf1/extensions/Vector/modules/images/edit.png Modified: branches/wmf/1.17wmf1/extensions/ClickTracking/ClickTracking.hooks.php === --- branches/wmf/1.17wmf1/extensions/ClickTracking/ClickTracking.hooks.php 2011-03-09 18:28:09 UTC (rev 83599) +++ branches/wmf/1.17wmf1/extensions/ClickTracking/ClickTracking.hooks.php 2011-03-09 18:55:54 UTC (rev 83600) @@ -152,4 +152,48 @@ $dbw-commit(); return $db_status; } + + public static function editPageShowEditFormFields( $editPage, $output ) { + global $wgRequest; + + // Add clicktracking fields to form, if given + $session = $wgRequest-getVal( 'clicktrackingsession' ); + $event = $wgRequest-getVal( 'clicktrackingevent' ); + if ( $session !== null $event !== null ) { + $editPage-editFormTextAfterContent .= Html::hidden( 'clicktrackingsession', $session ); + $editPage-editFormTextAfterContent .= Html::hidden( 'clicktrackingevent', $event ); + } + + return true; + } + + public static function articleSave( $editpage ) { + self::trackRequest( 'save-attempt' ); + return true; + } + + public static function articleSaveComplete( $article, $user, $text, $summary, $minoredit, + $watchthis, $sectionanchor, $flags, $revision, $status, $baseRevId, $redirect ) { + self::trackRequest( 'save-complete' ); + return true; + } + + protected static function trackRequest( $info ) { + global $wgRequest; + + $session = $wgRequest-getVal( 'clicktrackingsession' ); + $event = $wgRequest-getVal( 'clicktrackingevent' ); + if ( $session !== null $event !== null ) { + $params = new FauxRequest( array( + 'action' = 'clicktracking', + 'eventid' = $event, + 'token' = $session, + 'additional' = $info, + ) ); + $api = new ApiMain( $params, true ); + $api-execute(); + } + + return true; + } } Modified: branches/wmf/1.17wmf1/extensions/ClickTracking/ClickTracking.php === --- branches/wmf/1.17wmf1/extensions/ClickTracking/ClickTracking.php 2011-03-09 18:28:09 UTC (rev 83599) +++ branches/wmf/1.17wmf1/extensions/ClickTracking/ClickTracking.php 2011-03-09 18:55:54 UTC (rev 83600) @@ -50,6 +50,10 @@ $wgHooks['MakeGlobalVariablesScript'][] = 'ClickTrackingHooks::makeGlobalVariablesScript'; $wgHooks['ParserTestTables'][] = 'ClickTrackingHooks::parserTestTables'; +$wgHooks['EditPage::showEditForm:fields'][] = 'ClickTrackingHooks::editPageShowEditFormFields'; +$wgHooks['ArticleSave'][] = 'ClickTrackingHooks::articleSave'; +$wgHooks['ArticleSaveComplete'][] = 'ClickTrackingHooks::articleSaveComplete'; + // API modules $wgAPIModules['clicktracking'] = 'ApiClickTracking'; $wgAPIModules['specialclicktracking'] = 'ApiSpecialClickTracking'; Modified: branches/wmf/1.17wmf1/extensions/Vector/Vector.hooks.php === --- branches/wmf/1.17wmf1/extensions/Vector/Vector.hooks.php2011-03-09 18:28:09 UTC (rev 83599) +++ branches/wmf/1.17wmf1/extensions/Vector/Vector.hooks.php2011-03-09 18:55:54 UTC (rev 83600) @@ -52,10 +52,29 @@ 'footercleanup' = array( 'modules' = array( 'ext.vector.footerCleanup' ), ), + 'sectioneditlinks' = array( + 'modules' = array( 'ext.vector.sectionEditLinks'
[MediaWiki-CVS] SVN: [83601] trunk/extensions/InlineEditor
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83601 Revision: 83601 Author: janpaul123 Date: 2011-03-09 19:01:37 + (Wed, 09 Mar 2011) Log Message: --- AFAIK, this completely fixes bug 27853 Modified Paths: -- trunk/extensions/InlineEditor/jquery.inlineEditor.css trunk/extensions/InlineEditor/jquery.inlineEditor.editors.basic.css Modified: trunk/extensions/InlineEditor/jquery.inlineEditor.css === --- trunk/extensions/InlineEditor/jquery.inlineEditor.css 2011-03-09 18:55:54 UTC (rev 83600) +++ trunk/extensions/InlineEditor/jquery.inlineEditor.css 2011-03-09 19:01:37 UTC (rev 83601) @@ -26,6 +26,17 @@ padding: 0px; } +/* more skin-specific fixes */ +.skin-chick #inlineEditorBox, +.skin-standard #inlineEditorBox, +.skin-cologneblue #inlineEditorBox, +.skin-myskin #inlineEditorBox, +.skin-nostalgia #inlineEditorBox, +.skin-simple #inlineEditorBox { + line-height: 1.5em; + font-size: 0.9em; +} + #introbox { /* basic grey box */ background-color: #f3f3f3; Modified: trunk/extensions/InlineEditor/jquery.inlineEditor.editors.basic.css === --- trunk/extensions/InlineEditor/jquery.inlineEditor.editors.basic.css 2011-03-09 18:55:54 UTC (rev 83600) +++ trunk/extensions/InlineEditor/jquery.inlineEditor.editors.basic.css 2011-03-09 19:01:37 UTC (rev 83601) @@ -98,6 +98,15 @@ resize: none; } +/* some skin-specific fixes */ +.skin-chick #editContent .editbar textarea, +.skin-standard #editContent .editbar textarea, +.skin-myskin #editContent .editbar textarea, +.skin-nostalgia #editContent .editbar textarea, +.skin-simple #editContent .editbar textarea { + font-size: 0.8em; +} + #editContent .saving { /* have a cross-browser alpha overlay, see http://www.quirksmode.org/css/opacity.html */ opacity: 0.95; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83602] trunk/extensions/Vector/modules/ext.vector.sectionEditLinks.js
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83602 Revision: 83602 Author: tparscal Date: 2011-03-09 19:11:03 + (Wed, 09 Mar 2011) Log Message: --- Added more explicit logic, javascript was evaluating '0' to true, causing people in bucket 0 to get tracked, a waste of resources. Modified Paths: -- trunk/extensions/Vector/modules/ext.vector.sectionEditLinks.js Modified: trunk/extensions/Vector/modules/ext.vector.sectionEditLinks.js === --- trunk/extensions/Vector/modules/ext.vector.sectionEditLinks.js 2011-03-09 19:01:37 UTC (rev 83601) +++ trunk/extensions/Vector/modules/ext.vector.sectionEditLinks.js 2011-03-09 19:11:03 UTC (rev 83602) @@ -20,7 +20,7 @@ } } } -if ( bucket ) { +if ( bucket 0 ) { // Transform the targets of section edit links to route through the click tracking API $( 'span.editsection a' ).each( function() { var session = $.cookie( 'clicktracking-session' ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83603] trunk/extensions
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83603 Revision: 83603 Author: raymond Date: 2011-03-09 19:15:17 + (Wed, 09 Mar 2011) Log Message: --- Tweak extension credits Add extension to Translatewiki Modified Paths: -- trunk/extensions/ArrayExtension/ArrayExtension.i18n.php trunk/extensions/ArrayExtension/ArrayExtension.php trunk/extensions/Translate/groups/mediawiki-defines.txt Modified: trunk/extensions/ArrayExtension/ArrayExtension.i18n.php === --- trunk/extensions/ArrayExtension/ArrayExtension.i18n.php 2011-03-09 19:11:03 UTC (rev 83602) +++ trunk/extensions/ArrayExtension/ArrayExtension.i18n.php 2011-03-09 19:15:17 UTC (rev 83603) @@ -20,3 +20,4 @@ $messages['en'] = array( 'arrayext-desc' = 'Store and compute named arrays', ); + Modified: trunk/extensions/ArrayExtension/ArrayExtension.php === --- trunk/extensions/ArrayExtension/ArrayExtension.php 2011-03-09 19:11:03 UTC (rev 83602) +++ trunk/extensions/ArrayExtension/ArrayExtension.php 2011-03-09 19:15:17 UTC (rev 83603) @@ -45,13 +45,14 @@ $wgExtensionFunctions[] = 'efSetupArrayExtension'; $wgExtensionCredits['parserhook'][] = array( -'name' = 'ArrayExtension', -'url' = 'http://www.mediawiki.org/wiki/Extension:ArrayExtension', -'author' = array ( 'Li Ding', 'Jie Bao', 'Daniel Werner' ), - 'descriptionmsg' = 'arrayext-desc', + 'path' = __FILE__ + 'name' = 'ArrayExtension', + 'url' = 'http://www.mediawiki.org/wiki/Extension:ArrayExtension', + 'author' = array ( 'Li Ding', 'Jie Bao', 'Daniel Werner' ), + 'descriptionmsg' = 'arrayext-desc', 'version' = ArrayExtension::VERSION, - 'path' = __FILE__ ); + $wgExtensionMessagesFiles['ArrayExtension'] = dirname( __FILE__ ) . '/ArrayExtension.i18n.php'; $wgHooks['LanguageGetMagic'][] = 'efArrayExtensionLanguageGetMagic'; Modified: trunk/extensions/Translate/groups/mediawiki-defines.txt === --- trunk/extensions/Translate/groups/mediawiki-defines.txt 2011-03-09 19:11:03 UTC (rev 83602) +++ trunk/extensions/Translate/groups/mediawiki-defines.txt 2011-03-09 19:15:17 UTC (rev 83603) @@ -51,6 +51,8 @@ Approved Revs aliasfile = ApprovedRevs/ApprovedRevs.alias.php +Array Extension + Article Comments descmsg = article-comments-desc ignored = article-comments-prefilled-comment-text, article-comments-new-comment-heading ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83604] branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector. sectionEditLinks.js
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83604 Revision: 83604 Author: catrope Date: 2011-03-09 19:15:37 + (Wed, 09 Mar 2011) Log Message: --- 1.17wmf1: MFT r83602 Modified Paths: -- branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js Property Changed: branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js Modified: branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js === --- branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js 2011-03-09 19:15:17 UTC (rev 83603) +++ branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js 2011-03-09 19:15:37 UTC (rev 83604) @@ -20,7 +20,7 @@ } } } -if ( bucket ) { +if ( bucket 0 ) { // Transform the targets of section edit links to route through the click tracking API $( 'span.editsection a' ).each( function() { var session = $.cookie( 'clicktracking-session' ); Property changes on: branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js ___ Added: svn:mergeinfo + /branches/REL1_15/phase3/extensions/Vector/modules/ext.vector.sectionEditLinks.js:51646 /branches/new-installer/phase3/extensions/Vector/modules/ext.vector.sectionEditLinks.js:43664-66004 /branches/sqlite/extensions/Vector/modules/ext.vector.sectionEditLinks.js:58211-58321 /branches/wmf/1.16wmf4/extensions/Vector/modules/ext.vector.sectionEditLinks.js:67177,69199,76243,77266 /branches/wmf-deployment/extensions/Vector/modules/ext.vector.sectionEditLinks.js:60970 /trunk/extensions/Vector/modules/ext.vector.sectionEditLinks.js:83602 /trunk/phase3/extensions/Vector/modules/ext.vector.sectionEditLinks.js:79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,81833,83212,83590 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83605] trunk/extensions/Vector/modules/ext.vector.simpleSearch.js
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83605 Revision: 83605 Author: krinkle Date: 2011-03-09 19:32:25 + (Wed, 09 Mar 2011) Log Message: --- JavaScript clean-up (Code conventions, 1.17 migration, cross-browser fixes and JSHint validation) : Vector SimpleSearch * Using the mw-alias global * Optimizing selector (Sizzle starts at the right, about 3x faster now ) *-- see also http://jsperf.com/jquery-selector-perf-select-right-to-left ) * Using mw.config instead of legacy globals * Before checking foo in bar making sure it's an array as it'll throw an exception * typeof is not reliable for functions cross-browser, using $.isFunction * $.fn.is() is fairly slow as it parses the string and then calls filter which will then do it's thing and eventually call hasClass(). Calling it directly now * Except for elements that can't have children (input) or can't be close (img /), the html string should be valid and have a closing tag.(input /- input, div / - div/div). See also http://api.jquery.com/jQuery/ * Using jQuery 1.4's new ability to set element properties in the initial function call by passing an object as second argument instead of chain().of().calls() afterwards (see docs for what properties can and can't be set this way) * Using strict === comparison to compare to zero (faster and safer) Modified Paths: -- trunk/extensions/Vector/modules/ext.vector.simpleSearch.js Modified: trunk/extensions/Vector/modules/ext.vector.simpleSearch.js === --- trunk/extensions/Vector/modules/ext.vector.simpleSearch.js 2011-03-09 19:15:37 UTC (rev 83604) +++ trunk/extensions/Vector/modules/ext.vector.simpleSearch.js 2011-03-09 19:32:25 UTC (rev 83605) @@ -1,7 +1,7 @@ /* JavaScript for SimpleSearch extension */ $( document ).ready( function() { - + // Compatibility map var map = { 'browsers': { @@ -27,33 +27,33 @@ if ( !$.client.test( map ) ) { return true; } - + // Disable MWSuggest if loaded if ( window.os_MWSuggestDisable ) { window.os_MWSuggestDisable(); } - + // Placeholder text for SimpleSearch box - $( 'div#simpleSearch input#searchInput' ) - .attr( 'placeholder', mediaWiki.msg( 'vector-simplesearch-search' ) ) + $( '#simpleSearch input#searchInput' ) + .attr( 'placeholder', mw.msg( 'vector-simplesearch-search' ) ) .placeholder(); - + // General suggestions functionality for all search boxes $( '#searchInput, #searchInput2, #powerSearchText, #searchText' ) .suggestions( { fetch: function( query ) { var $this = $(this); var request = $.ajax( { - url: wgScriptPath + '/api.php', + url: mw.config.get( 'wgScriptPath' ) + '/api.php', data: { - 'action': 'opensearch', - 'search': query, - 'namespace': 0, - 'suggest': '' + action: 'opensearch', + search: query, + namespace: 0, + suggest: '' }, dataType: 'json', success: function( data ) { - if ( data 1 in data ) { + if ( $.isArray( data ) 1 in data ) { $this.suggestions( 'suggestions', data[1] ); } } @@ -64,7 +64,7 @@ var request = $(this).data( 'request' ); // If the delay setting has caused the fetch to have not even happend yet, the request object will // have never been set - if ( request typeof request.abort == 'function' ) { + if ( request $.isFunction( request.abort ) ) { request.abort(); $(this).removeData( 'request' ); } @@ -75,7 +75,7 @@ } }, delay: 120, - positionFromLeft: $( 'body' ).is( '.rtl' ), +
[MediaWiki-CVS] SVN: [83606] branches/wmf/1.17wmf1/extensions/Vector/modules
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83606 Revision: 83606 Author: catrope Date: 2011-03-09 19:37:54 + (Wed, 09 Mar 2011) Log Message: --- 1.17wmf1: MFT r83471 Modified Paths: -- branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.css branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js Property Changed: branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js Modified: branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.css === --- branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.css 2011-03-09 19:32:25 UTC (rev 83605) +++ branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.css 2011-03-09 19:37:54 UTC (rev 83606) @@ -4,10 +4,12 @@ } span.vector-editLink a { padding-left: 18px; + /* @embed */ background-image: url(images/edit-faded.png); background-position: left top; background-repeat: no-repeat; } span.vector-editLink a:hover { + /* @embed */ background-image: url(images/edit.png); } Modified: branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js === --- branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js 2011-03-09 19:32:25 UTC (rev 83605) +++ branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js 2011-03-09 19:37:54 UTC (rev 83606) @@ -12,7 +12,7 @@ ) ); // 0 = not tracked, 1 = tracked with old version, 2 = tracked with new version bucket = ( Math.random() * 100 ) odds ? Number( Math.random() 0.5 ) + 1 : 0; - $.cookie( 'ext.vector.sectionEditLinks-bucket', bucket ); + $.cookie( 'ext.vector.sectionEditLinks-bucket', bucket, { 'path': '/', 'expires': 30 } ); // If we are going to track this person from now on, let's also track which bucket we put // them into and when if ( bucket 0 'trackActionWithInfo' in $ ) { Property changes on: branches/wmf/1.17wmf1/extensions/Vector/modules/ext.vector.sectionEditLinks.js ___ Modified: svn:mergeinfo - /branches/REL1_15/phase3/extensions/Vector/modules/ext.vector.sectionEditLinks.js:51646 /branches/new-installer/phase3/extensions/Vector/modules/ext.vector.sectionEditLinks.js:43664-66004 /branches/sqlite/extensions/Vector/modules/ext.vector.sectionEditLinks.js:58211-58321 /branches/wmf/1.16wmf4/extensions/Vector/modules/ext.vector.sectionEditLinks.js:67177,69199,76243,77266 /branches/wmf-deployment/extensions/Vector/modules/ext.vector.sectionEditLinks.js:60970 /trunk/extensions/Vector/modules/ext.vector.sectionEditLinks.js:83602 /trunk/phase3/extensions/Vector/modules/ext.vector.sectionEditLinks.js:79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,81833,83212,83590 + /branches/REL1_15/phase3/extensions/Vector/modules/ext.vector.sectionEditLinks.js:51646 /branches/new-installer/phase3/extensions/Vector/modules/ext.vector.sectionEditLinks.js:43664-66004 /branches/sqlite/extensions/Vector/modules/ext.vector.sectionEditLinks.js:58211-58321 /branches/wmf/1.16wmf4/extensions/Vector/modules/ext.vector.sectionEditLinks.js:67177,69199,76243,77266 /branches/wmf-deployment/extensions/Vector/modules/ext.vector.sectionEditLinks.js:60970 /trunk/extensions/Vector/modules/ext.vector.sectionEditLinks.js:83471,83602 /trunk/phase3/extensions/Vector/modules/ext.vector.sectionEditLinks.js:79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,81833,83212,83590 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83607] trunk/extensions/Vector/Vector.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83607 Revision: 83607 Author: tparscal Date: 2011-03-09 19:53:49 + (Wed, 09 Mar 2011) Log Message: --- Added clickTracking as a dependency Modified Paths: -- trunk/extensions/Vector/Vector.php Modified: trunk/extensions/Vector/Vector.php === --- trunk/extensions/Vector/Vector.php 2011-03-09 19:37:54 UTC (rev 83606) +++ trunk/extensions/Vector/Vector.php 2011-03-09 19:53:49 UTC (rev 83607) @@ -105,6 +105,7 @@ 'styles' = 'ext.vector.sectionEditLinks.css', 'dependencies' = array( 'jquery.cookie', + 'jquery.clickTracking', ), ), 'ext.vector.simpleSearch' = $vectorResourceTemplate + array( ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83608] branches/wmf/1.17wmf1/extensions/Vector/Vector.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83608 Revision: 83608 Author: catrope Date: 2011-03-09 20:00:33 + (Wed, 09 Mar 2011) Log Message: --- 1.17wmf1: MFT r83607 Modified Paths: -- branches/wmf/1.17wmf1/extensions/Vector/Vector.php Property Changed: branches/wmf/1.17wmf1/extensions/Vector/Vector.php Modified: branches/wmf/1.17wmf1/extensions/Vector/Vector.php === --- branches/wmf/1.17wmf1/extensions/Vector/Vector.php 2011-03-09 19:53:49 UTC (rev 83607) +++ branches/wmf/1.17wmf1/extensions/Vector/Vector.php 2011-03-09 20:00:33 UTC (rev 83608) @@ -105,6 +105,7 @@ 'styles' = 'ext.vector.sectionEditLinks.css', 'dependencies' = array( 'jquery.cookie', + 'jquery.clickTracking', ), ), 'ext.vector.simpleSearch' = $vectorResourceTemplate + array( Property changes on: branches/wmf/1.17wmf1/extensions/Vector/Vector.php ___ Added: svn:mergeinfo + /branches/REL1_15/phase3/extensions/Vector/Vector.php:51646 /branches/new-installer/phase3/extensions/Vector/Vector.php:43664-66004 /branches/sqlite/extensions/Vector/Vector.php:58211-58321 /branches/wmf/1.16wmf4/extensions/Vector/Vector.php:67177,69199,76243,77266 /branches/wmf-deployment/extensions/Vector/Vector.php:60970 /trunk/extensions/Vector/Vector.php:83607 /trunk/phase3/extensions/Vector/Vector.php:79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,81833,83212,83590 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83609] trunk/extensions/WikimediaMessages/WikimediaMessages.i18n.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83609 Revision: 83609 Author: reedy Date: 2011-03-09 21:15:18 + (Wed, 09 Mar 2011) Log Message: --- Staffs isn't valid english Modified Paths: -- trunk/extensions/WikimediaMessages/WikimediaMessages.i18n.php Modified: trunk/extensions/WikimediaMessages/WikimediaMessages.i18n.php === --- trunk/extensions/WikimediaMessages/WikimediaMessages.i18n.php 2011-03-09 20:00:33 UTC (rev 83608) +++ trunk/extensions/WikimediaMessages/WikimediaMessages.i18n.php 2011-03-09 21:15:18 UTC (rev 83609) @@ -116,7 +116,7 @@ 'group-Global_rollback' = 'Global rollbackers', 'group-Global_sysops' = 'Global sysops', 'group-Ombudsmen' = 'Ombudsmen', - 'group-Staff' = 'Staffs', + 'group-Staff' = 'Staff', 'group-steward-member' = 'steward', 'group-sysadmin-member'= 'system administrator', ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83611] trunk/extensions/intersection/DynamicPageList.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83611 Revision: 83611 Author: ashley Date: 2011-03-09 22:00:28 + (Wed, 09 Mar 2011) Log Message: --- Intersection/DynamicPageList: rename variables; we don't use Hungarian notation Modified Paths: -- trunk/extensions/intersection/DynamicPageList.php Modified: trunk/extensions/intersection/DynamicPageList.php === --- trunk/extensions/intersection/DynamicPageList.php 2011-03-09 21:50:00 UTC (rev 83610) +++ trunk/extensions/intersection/DynamicPageList.php 2011-03-09 22:00:28 UTC (rev 83611) @@ -51,6 +51,7 @@ $dir = dirname( __FILE__ ) . '/'; $wgExtensionMessagesFiles['DynamicPageList'] = $dir . 'DynamicPageList.i18n.php'; +// Parser tests $wgParserTestFiles[] = $dir . 'DynamicPageList.tests.txt'; # Configuration variables @@ -78,85 +79,85 @@ global $wgDLPmaxCategories, $wgDLPMaxResultCount; global $wgDLPAllowUnlimitedResults, $wgDLPAllowUnlimitedCategories; - $bCountSet = false; + $countSet = false; - $sStartList = 'ul'; - $sEndList = '/ul'; - $sStartItem = 'li'; - $sEndItem = '/li'; - $bInlineMode = false; + $startList = 'ul'; + $endList = '/ul'; + $startItem = 'li'; + $endItem = '/li'; + $inlineMode = false; - $bUseGallery = false; - $bGalleryFileSize = false; - $bGalleryFileName = true; - $iGalleryImageHeight = 0; - $iGalleryImageWidth = 0; - $iGalleryNumbRows = 0; - $sGalleryCaption = ''; + $useGallery = false; + $galleryFileSize = false; + $galleryFileName = true; + $galleryImageHeight = 0; + $galleryImageWidth = 0; + $galleryNumbRows = 0; + $galleryCaption = ''; $gallery = null; - $sOrderMethod = 'categoryadd'; - $sOrder = 'descending'; - $sRedirects = 'exclude'; - $sStable = $sQuality = 'include'; - $bFlaggedRevs = false; + $orderMethod = 'categoryadd'; + $order = 'descending'; + $redirects = 'exclude'; + $stable = $quality = 'include'; + $flaggedRevs = false; $bNamespace = false; - $iNamespace = 0; + $namespaceIndex = 0; - $iOffset = 0; + $offset = 0; - $bGoogleHack = false; + $googleHack = false; - $bSuppressErrors = false; - $bShowNamespace = true; - $bAddFirstCategoryDate = false; - $sDateFormat = ''; - $bStripYear = false; + $suppressErrors = false; + $showNamespace = true; + $addFirstCategoryDate = false; + $dateFormat = ''; + $stripYear = false; - $aLinkOptions = array(); - $aCategories = array(); - $aExcludeCategories = array(); + $linkOptions = array(); + $categories = array(); + $excludeCategories = array(); - $aParams = explode( \n, $input ); + $parameters = explode( \n, $input ); $parser = new Parser; $poptions = new ParserOptions; - foreach ( $aParams as $sParam ) { - $aParam = explode( '=', $sParam, 2 ); + foreach ( $parameters as $parameter ) { + $aParam = explode( '=', $parameter, 2 ); if( count( $aParam ) 2 ) { continue; } - $sType = trim( $aParam[0] ); - $sArg = trim( $aParam[1] ); - switch ( $sType ) { + $type = trim( $aParam[0] ); + $arg = trim( $aParam[1] ); + switch ( $type ) { case 'category': $title = Title::newFromText( - $parser-transformMsg( $sArg, $poptions ) + $parser-transformMsg( $arg, $poptions ) ); if( is_null( $title ) ) { continue; } - $aCategories[] = $title; + $categories[] = $title; break; case 'notcategory': $title = Title::newFromText( - $parser-transformMsg( $sArg, $poptions ) + $parser-transformMsg( $arg, $poptions ) ); if( is_null( $title ) ) { continue; } - $aExcludeCategories[] = $title; + $excludeCategories[] = $title; break; case 'namespace': - $ns = $wgContLang-getNsIndex( $sArg ); + $ns =
[MediaWiki-CVS] SVN: [83613] trunk/extensions/SemanticForms/includes/SF_FormInputs.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83613 Revision: 83613 Author: yaron Date: 2011-03-09 22:46:15 + (Wed, 09 Mar 2011) Log Message: --- Another attempted fix for autocompletion Modified Paths: -- trunk/extensions/SemanticForms/includes/SF_FormInputs.php Modified: trunk/extensions/SemanticForms/includes/SF_FormInputs.php === --- trunk/extensions/SemanticForms/includes/SF_FormInputs.php 2011-03-09 22:15:15 UTC (rev 83612) +++ trunk/extensions/SemanticForms/includes/SF_FormInputs.php 2011-03-09 22:46:15 UTC (rev 83613) @@ -777,23 +777,14 @@ } public static function getAutocompletionTypeAndSource( $field_args ) { - if ( array_key_exists( 'autocomplete field type', $field_args ) ) { - $autocompleteFieldType = $field_args['autocomplete field type']; - $autocompletionSource = $field_args['autocompletion source']; - } elseif ( array_key_exists( 'values from property', $field_args ) || - array_key_exists( 'semantic_property', $field_args ) ) { - if ( array_key_exists( 'values from property', $field_args ) ) { - $autocompletionSource = $field_args['values from property']; - } else { // if ( array_key_exists( 'semantic_property', $field_args ) ) { - $autocompletionSource = $field_args['semantic_property']; - } + if ( array_key_exists( 'values from property', $field_args ) ) { + $autocompletionSource = $field_args['values from property']; $propValue = SMWPropertyValue::makeUserProperty( $autocompletionSource ); if ( $propValue-getPropertyTypeID() == '_wpg' ) { $autocompleteFieldType = 'relation'; } else { $autocompleteFieldType = 'attribute'; } - } elseif ( array_key_exists( 'values from category', $field_args ) ) { $autocompleteFieldType = 'category'; $autocompletionSource = $field_args['values from category']; @@ -812,6 +803,17 @@ global $sfgFieldNum; $autocompleteFieldType = 'values'; $autocompletionSource = values-$sfgFieldNum; + } elseif ( array_key_exists( 'autocomplete field type', $field_args ) ) { + $autocompleteFieldType = $field_args['autocomplete field type']; + $autocompletionSource = $field_args['autocompletion source']; + } elseif ( array_key_exists( 'semantic_property', $field_args ) ) { + $autocompletionSource = $field_args['semantic_property']; + $propValue = SMWPropertyValue::makeUserProperty( $autocompletionSource ); + if ( $propValue-getPropertyTypeID() == '_wpg' ) { + $autocompleteFieldType = 'relation'; + } else { + $autocompleteFieldType = 'attribute'; + } } else { $autocompleteFieldType = null; $autocompletionSource = null; @@ -851,6 +853,7 @@ $field_args['remote autocompletion'] == true ) { $remoteDataType = $autocompleteFieldType; } elseif ( $autocompletionSource != '' ) { + // @TODO - that count() check shouldn't be necessary if ( array_key_exists( 'possible_values', $field_args ) count( $field_args['possible_values'] ) 0 ) { $autocompleteValues = $field_args['possible_values']; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83615] trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83615 Revision: 83615 Author: yaron Date: 2011-03-09 23:24:37 + (Wed, 09 Mar 2011) Log Message: --- Fixed handling so that manually setting input type to 'text' or 'textarea' disables autocompletion Modified Paths: -- trunk/extensions/SemanticForms/includes/SF_FormPrinter.php Modified: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php === --- trunk/extensions/SemanticForms/includes/SF_FormPrinter.php 2011-03-09 22:56:06 UTC (rev 83614) +++ trunk/extensions/SemanticForms/includes/SF_FormPrinter.php 2011-03-09 23:24:37 UTC (rev 83615) @@ -764,6 +764,12 @@ if ( $input_type == 'datetime with timezone' ) { $input_type = 'datetime'; $field_args['include timezone'] = true; + } elseif ( $input_type == 'text' || $input_type == 'textarea' ) { + // Also for backwards compatibility, + // in that once b/c goes away, + // this will no longer be + // necessary. + $field_args['no autocomplete'] = true; } if ( $allow_multiple ) $field_args['part_of_multiple'] = $allow_multiple; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83616] trunk/extensions/UploadWizard/resources/mediawiki.language. parser.js
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83616 Revision: 83616 Author: neilk Date: 2011-03-09 23:34:07 + (Wed, 09 Mar 2011) Log Message: --- factored better Modified Paths: -- trunk/extensions/UploadWizard/resources/mediawiki.language.parser.js Modified: trunk/extensions/UploadWizard/resources/mediawiki.language.parser.js === --- trunk/extensions/UploadWizard/resources/mediawiki.language.parser.js 2011-03-09 23:24:37 UTC (rev 83615) +++ trunk/extensions/UploadWizard/resources/mediawiki.language.parser.js 2011-03-09 23:34:07 UTC (rev 83616) @@ -17,30 +17,7 @@ return $j.isArray( args[offset] ) ? args[offset] : $j.makeArray( args ).slice( offset ); } - /** -* The parser itself. -* Describes an object, whose primary duty is to .parse() message keys. -* TODO encapsulate language rather than picking it up from globals -* @param {Array} options -*/ - mw.language.parser = function( options ) { - var defaults = { - 'magic' : {}, - 'messages' : mw.messages - }; - - this.settings = $j.extend( {}, defaults, options ); - - var _this = this; - $j.each( this.settings.magic, function( key, val ) { - _this.op[ key.toLowerCase() ] = function() { return val; }; - } ); - - }; - - - /** * Class method. * Returns a function suitable for use as a global, to construct strings from the message key (and optional replacements). * e.g. @@ -97,121 +74,45 @@ }; - mw.language.parser.prototype = { - // Parser functions -- for everything in input that follows double-open-curly braces, there should be an equivalent parser - // function. For instance {{PLURAL ... }} will be processed by 'plural'. - // If you have 'magic words' then configure the parser to have them upon creation. - // - // A parse function takes the parent node, the array of subnodes and the array of replacements (the values that $1, $2... should translate to). - // Note: all such functions must be totally pure. Their output depends entirely on input and on no other thing, not even 'this'. - op: { + var parserDefaults = { + 'magic' : {}, + 'messages' : mw.messages, + 'language' : mw.language + }; - /** -* Parsing has been applied depth-first we can assume that all nodes here are single nodes -* Must return a single node to parents -- a jQuery with synthetic span -* However, unwrap any other synthetic spans in our children and pass them upwards -* @param {Array} nodes - mixed, some single nodes, some arrays of nodes -* @return {jQuery} -*/ - concat: function( nodes ) { - var span = $j( 'span' ).addClass( 'mediaWiki_parser' ); - $j.each( nodes, function( i, node ) { - if ( node instanceof jQuery node.hasClass( 'mediaWiki_parser' ) ) { - $j.each( node.contents(), function( j, childNode ) { - span.append( childNode ); - } ); - } else { - // strings, integers, anything else - span.append( node ); - } - } ); - return span; - }, + /** +* The parser itself. +* Describes an object, whose primary duty is to .parse() message keys. +* @param {Array} options +*/ + mw.language.parser = function( options ) { + this.settings = $j.extend( {}, parserDefaults, options ); + this.emitter = new mw.language.parser.htmlEmitter( settings.language, settings.magic ); + }; - /** -* Return replacement of correct index, or string if unavailable. -* Note that we expect the parsed parameter to be zero-based. i.e. $1 should have become [ 0 ]. -* if the specified parameter is not found return the same string -* (e.g. $99 - parameter 98 - not found - return $99 ) -* TODO throw error
[MediaWiki-CVS] SVN: [83617] trunk/phase3
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83617 Revision: 83617 Author: tstarling Date: 2011-03-10 00:00:34 + (Thu, 10 Mar 2011) Log Message: --- * Add a $count argument to wfIncrStats(), to allow it to increase the count by more than one at a time. * Added stats to job insert and pop. * Formalised live patch for UDP stats aggregation, adding $wgAggregateStatsID. Modified Paths: -- trunk/phase3/RELEASE-NOTES trunk/phase3/includes/DefaultSettings.php trunk/phase3/includes/GlobalFunctions.php trunk/phase3/includes/job/JobQueue.php Modified: trunk/phase3/RELEASE-NOTES === --- trunk/phase3/RELEASE-NOTES 2011-03-09 23:34:07 UTC (rev 83616) +++ trunk/phase3/RELEASE-NOTES 2011-03-10 00:00:34 UTC (rev 83617) @@ -94,6 +94,8 @@ * Added UserGetLanguageObject hook to change the language used in $wgLang * (bug 14645) When $wgMiserMode is on, expensive special pages are styled differently (italicized by default) on Special:SpecialPages +* Added $wgAggregateStatsID, which allows UDP stats to be aggregated over + several wikis. === Bug fixes in 1.18 === * (bug 23119) WikiError class and subclasses are now marked as deprecated Modified: trunk/phase3/includes/DefaultSettings.php === --- trunk/phase3/includes/DefaultSettings.php 2011-03-09 23:34:07 UTC (rev 83616) +++ trunk/phase3/includes/DefaultSettings.php 2011-03-10 00:00:34 UTC (rev 83617) @@ -3940,6 +3940,14 @@ */ $wgStatsMethod = 'cache'; +/** + * When $wgStatsMethod is 'udp', setting this to a string allows statistics to + * be aggregated over more than one wiki. The string will be used in place of + * the DB name in outgoing UDP packets. If this is set to false, the DB name + * will be used. + */ +$wgAggregateStatsID = false; + /** Whereas to count the number of time an article is viewed. * Does not work if pages are cached (for example with squid). */ Modified: trunk/phase3/includes/GlobalFunctions.php === --- trunk/phase3/includes/GlobalFunctions.php 2011-03-09 23:34:07 UTC (rev 83616) +++ trunk/phase3/includes/GlobalFunctions.php 2011-03-10 00:00:34 UTC (rev 83617) @@ -2071,15 +2071,20 @@ /** * Increment a statistics counter */ -function wfIncrStats( $key ) { +function wfIncrStats( $key, $count = 1 ) { global $wgStatsMethod; + $count = intval( $count ); + if( $wgStatsMethod == 'udp' ) { - global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgDBname; + global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgDBname, $wgAggregateStatsID; static $socket; + + $id = $wgAggregateStatsID !== false ? $wgAggregateStatsID : $wgDBname; + if ( !$socket ) { $socket = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); - $statline = stats/{$wgDBname} - 1 1 1 1 1 -total\n; + $statline = stats/{$id} - {$count} 1 1 1 1 -total\n; socket_sendto( $socket, $statline, @@ -2089,7 +2094,7 @@ $wgUDPProfilerPort ); } - $statline = stats/{$wgDBname} - 1 1 1 1 1 {$key}\n; + $statline = stats/{$id} - {$count} 1 1 1 1 {$key}\n; wfSuppressWarnings(); socket_sendto( $socket, @@ -2103,8 +2108,8 @@ } elseif( $wgStatsMethod == 'cache' ) { global $wgMemc; $key = wfMemcKey( 'stats', $key ); - if ( is_null( $wgMemc-incr( $key ) ) ) { - $wgMemc-add( $key, 1 ); + if ( is_null( $wgMemc-incr( $key, $count ) ) ) { + $wgMemc-add( $key, $count ); } } else { // Disabled Modified: trunk/phase3/includes/job/JobQueue.php === --- trunk/phase3/includes/job/JobQueue.php 2011-03-09 23:34:07 UTC (rev 83616) +++ trunk/phase3/includes/job/JobQueue.php 2011-03-10 00:00:34 UTC (rev 83617) @@ -74,6 +74,7 @@ return false; } + wfIncrStats( 'job-pop' ); $namespace = $row-job_namespace; $dbkey = $row-job_title; $title = Title::makeTitleSafe( $namespace, $dbkey ); @@ -163,6 +164,7 @@ // If execution got to here, there's a row in $row that has been deleted from the database // by this thread. Hence the concurrent pop was successful. + wfIncrStats( 'job-pop' ); $namespace = $row-job_namespace; $dbkey = $row-job_title; $title =
[MediaWiki-CVS] SVN: [83618] trunk/extensions/SemanticForms/specials/SF_CreateForm.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83618 Revision: 83618 Author: yaron Date: 2011-03-10 00:05:12 + (Thu, 10 Mar 2011) Log Message: --- Fixed initialization of $editButtonsText variable Modified Paths: -- trunk/extensions/SemanticForms/specials/SF_CreateForm.php Modified: trunk/extensions/SemanticForms/specials/SF_CreateForm.php === --- trunk/extensions/SemanticForms/specials/SF_CreateForm.php 2011-03-10 00:00:34 UTC (rev 83617) +++ trunk/extensions/SemanticForms/specials/SF_CreateForm.php 2011-03-10 00:05:12 UTC (rev 83618) @@ -246,7 +246,7 @@ END; $saveAttrs = array( 'type' = 'submit', 'id' = 'wpSave', 'name' = 'wpSave', 'value' = wfMsg( 'savearticle' ) ); if ( count( $form_templates ) == 0 ) { $saveAttrs['disabled'] = 'disabled'; } - $editButtonsText .= \t . Xml::element( 'input', $saveAttrs ) . \n; + $editButtonsText = \t . Xml::element( 'input', $saveAttrs ) . \n; $previewAttrs = array( 'type' = 'submit', 'id' = 'wpPreview', 'name' = 'wpPreview', 'value' = wfMsg( 'preview' ) ); if ( count( $form_templates ) == 0 ) { $previewAttrs['disabled'] = 'disabled'; } $editButtonsText .= \t . Xml::element( 'input', $previewAttrs ) . \n; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83620] trunk/phase3/skins
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83620 Revision: 83620 Author: kaldari Date: 2011-03-10 00:25:33 + (Thu, 10 Mar 2011) Log Message: --- fix for Bug 27669 Modified Paths: -- trunk/phase3/skins/Vector.php trunk/phase3/skins/monobook/main.css Modified: trunk/phase3/skins/Vector.php === --- trunk/phase3/skins/Vector.php 2011-03-10 00:14:36 UTC (rev 83619) +++ trunk/phase3/skins/Vector.php 2011-03-10 00:25:33 UTC (rev 83620) @@ -146,9 +146,11 @@ !-- /firstHeading -- !-- bodyContent -- div id=bodyContent + ?php if ( $this-data['isarticle'] ): ? !-- tagline -- div id=siteSub?php $this-msg( 'tagline' ) ?/div !-- /tagline -- + ?php endif; ? !-- subtitle -- div id=contentSub?php $this-html('userlangattributes') ??php $this-html( 'subtitle' ) ?/div !-- /subtitle -- Modified: trunk/phase3/skins/monobook/main.css === --- trunk/phase3/skins/monobook/main.css2011-03-10 00:14:36 UTC (rev 83619) +++ trunk/phase3/skins/monobook/main.css2011-03-10 00:25:33 UTC (rev 83620) @@ -274,6 +274,7 @@ vertical-align: middle; } #siteNotice { + position: relative; text-align: center; font-size: 95%; padding: 0 0.9em; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83621] trunk/extensions/intersection
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83621 Revision: 83621 Author: bawolff Date: 2011-03-10 00:29:56 + (Thu, 10 Mar 2011) Log Message: --- (follow-up r83433) Fix (or workaround) bug discovered with mode=none having pre's inserted (root cause is bug 1319) Fix up the tests I added. Some of them were testing stuff thats not going to work (such as the addfirstcategorydate, since the date is going to change from day to day. d'oh). Remove the one whitespace before the li on all these tests (for the pre issue). And add one more test. Modified Paths: -- trunk/extensions/intersection/DynamicPageList.php trunk/extensions/intersection/DynamicPageList.tests.txt Modified: trunk/extensions/intersection/DynamicPageList.php === --- trunk/extensions/intersection/DynamicPageList.php 2011-03-10 00:25:33 UTC (rev 83620) +++ trunk/extensions/intersection/DynamicPageList.php 2011-03-10 00:29:56 UTC (rev 83621) @@ -642,7 +642,7 @@ if ( $inlineMode ) { $output .= $wgContLang-commaList( $articleList ); } else { - $output .= implode( $endItem \n $startItem, $articleList ); + $output .= implode( $endItem \n$startItem, $articleList ); } $output .= $endItem; $output .= $endList . \n; Modified: trunk/extensions/intersection/DynamicPageList.tests.txt === --- trunk/extensions/intersection/DynamicPageList.tests.txt 2011-03-10 00:25:33 UTC (rev 83620) +++ trunk/extensions/intersection/DynamicPageList.tests.txt 2011-03-10 00:29:56 UTC (rev 83621) @@ -15,6 +15,7 @@ ## varries depending on today's date. ## *gallery stuff (lack of images) ## *some order methods, due to lack of flexibity in page creation +## googlehack (dpl_id) stuff because page_id changes depending on other tests. !! article DPLTest1 @@ -68,8 +69,8 @@ !!result ul lia href=/wiki/Yet_another_DPL_test_page!Yet another DPL test page!/a/li - lia href=/wiki/Talk:DPLTest2Talk:DPLTest2/a/li - lia href=/wiki/DPLTest1DPLTest1/a/li/ul +lia href=/wiki/Talk:DPLTest2Talk:DPLTest2/a/li +lia href=/wiki/DPLTest1DPLTest1/a/li/ul !!end @@ -84,30 +85,32 @@ !!result ul lia href=/wiki/DPLTest1DPLTest1/a/li - lia href=/wiki/Talk:DPLTest2Talk:DPLTest2/a/li - lia href=/wiki/Yet_another_DPL_test_page!Yet another DPL test page!/a/li/ul +lia href=/wiki/Talk:DPLTest2Talk:DPLTest2/a/li +lia href=/wiki/Yet_another_DPL_test_page!Yet another DPL test page!/a/li/ul !!end # Depnds on page id of other pages # so could break depending on other tests # if they get different page id -!!test -dpl_id -!!input -DynamicPageList -category=DPLtest -googlehack=true -/DynamicPageList -!!result -ul -lia href=/wiki/Yet_another_DPL_test_page!?dpl_id=53Yet another DPL test page!/a/li - lia href=/wiki/Talk:DPLTest2?dpl_id=51Talk:DPLTest2/a/li - lia href=/wiki/DPLTest1?dpl_id=50DPLTest1/a/li/ul +# +# Low and behold that actually does happen. Commenting out. +#!!test +#dpl_id +#!!input +#DynamicPageList +#category=DPLtest +#googlehack=true +#/DynamicPageList +#!!result +#ul +#lia href=/wiki/Yet_another_DPL_test_page!?dpl_id=53Yet another DPL test page!/a/li +#lia href=/wiki/Talk:DPLTest2?dpl_id=51Talk:DPLTest2/a/li +#lia href=/wiki/DPLTest1?dpl_id=50DPLTest1/a/li/ul +# +#!!end -!!end - !!test nofollow !!input @@ -118,8 +121,8 @@ !!result ul lia href=/wiki/Yet_another_DPL_test_page! rel=nofollowYet another DPL test page!/a/li - lia href=/wiki/Talk:DPLTest2 rel=nofollowTalk:DPLTest2/a/li - lia href=/wiki/DPLTest1 rel=nofollowDPLTest1/a/li/ul +lia href=/wiki/Talk:DPLTest2 rel=nofollowTalk:DPLTest2/a/li +lia href=/wiki/DPLTest1 rel=nofollowDPLTest1/a/li/ul !!end @@ -237,7 +240,7 @@ !!result ul lia href=/wiki/Yet_another_DPL_test_page!Yet another DPL test page!/a/li - lia href=/wiki/DPLTest1DPLTest1/a/li/ul +lia href=/wiki/DPLTest1DPLTest1/a/li/ul !!end @@ -265,9 +268,9 @@ !!result ul lia href=/wiki/DPLRedir class=mw-redirectDPLRedir/a/li - lia href=/wiki/Yet_another_DPL_test_page!Yet another DPL test page!/a/li - lia href=/wiki/Talk:DPLTest2Talk:DPLTest2/a/li - lia href=/wiki/DPLTest1DPLTest1/a/li/ul +lia href=/wiki/Yet_another_DPL_test_page!Yet another DPL test page!/a/li +lia href=/wiki/Talk:DPLTest2Talk:DPLTest2/a/li +lia href=/wiki/DPLTest1DPLTest1/a/li/ul !!end @@ -297,8 +300,8 @@ !!result ul lia href=/wiki/Yet_another_DPL_test_page!Yet another DPL test page!/a/li - lia href=/wiki/Talk:DPLTest2Talk:DPLTest2/a/li - lia href=/wiki/DPLTest1DPLTest1/a/li/ul +lia href=/wiki/Talk:DPLTest2Talk:DPLTest2/a/li +lia href=/wiki/DPLTest1DPLTest1/a/li/ul !!end @@ -312,8 +315,8 @@ !!result ul lia href=/wiki/Yet_another_DPL_test_page!Yet another DPL test page!/a/li - lia
[MediaWiki-CVS] SVN: [83624] trunk/extensions/UploadWizard/resources/mediawiki.language. parser.js
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83624 Revision: 83624 Author: neilk Date: 2011-03-10 01:31:54 + (Thu, 10 Mar 2011) Log Message: --- clobber parser namespace less Modified Paths: -- trunk/extensions/UploadWizard/resources/mediawiki.language.parser.js Modified: trunk/extensions/UploadWizard/resources/mediawiki.language.parser.js === --- trunk/extensions/UploadWizard/resources/mediawiki.language.parser.js 2011-03-10 01:30:52 UTC (rev 83623) +++ trunk/extensions/UploadWizard/resources/mediawiki.language.parser.js 2011-03-10 01:31:54 UTC (rev 83624) @@ -1,3 +1,7 @@ +/** + * n.b. if this is ever moved to be mediawiki.language.parser, then mediawiki.language.procPLURAL will be obsolete + */ + ( function( mw, $j ) { /** @@ -30,7 +34,7 @@ * @param {Array} parser options * @return {Function} function suitable for assigning to window.gM */ - mw.language.parser.getMessageFunction = function( options ) { + mw.language.getMessageFunction = function( options ) { var parser = new mw.language.parser( options ); /** * Note replacements are gleaned from 2nd parameter, or variadic args starting with 2nd parameter. @@ -55,7 +59,7 @@ * @param {Array} parser options * @return {Function} function suitable for assigning to jQuery plugin, such as $j.fn.msg */ - mw.language.parser.getJqueryPlugin = function( options ) { + mw.language.getJqueryMessagePlugin = function( options ) { var parser = new mw.language.parser( options ); /** * Note replacements are gleaned from 2nd parameter, or variadic args starting with 2nd parameter. @@ -88,7 +92,7 @@ */ mw.language.parser = function( options ) { this.settings = $j.extend( {}, parserDefaults, options ); - this.emitter = new mw.language.parser.htmlEmitter( settings.language, settings.magic ); + this.emitter = new mw.language.htmlEmitter( this.settings.language, this.settings.magic ); }; mw.language.parser.prototype = { @@ -498,7 +502,7 @@ /** * htmlEmitter - object which primarily exists to emit HTML from parser ASTs */ - mw.language.parser.htmlEmitter = function( language, magic ) { + mw.language.htmlEmitter = function( language, magic ) { this.language = language; var _this = this; @@ -548,7 +552,7 @@ // // An emitter method takes the parent node, the array of subnodes and the array of replacements (the values that $1, $2... should translate to). // Note: all such functions must be pure, with the exception of referring to other pure functions via this.language (convertPlural and so on) - mw.language.parser.htmlEmitter.prototype = { + mw.language.htmlEmitter.prototype = { /** * Parsing has been applied depth-first we can assume that all nodes here are single nodes ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83625] trunk/extensions/UploadWizard/resources/mediawiki.language. parser.peg
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83625 Revision: 83625 Author: neilk Date: 2011-03-10 01:34:39 + (Thu, 10 Mar 2011) Log Message: --- PEG grammar that mediawiki.language.parser is based on Added Paths: --- trunk/extensions/UploadWizard/resources/mediawiki.language.parser.peg Added: trunk/extensions/UploadWizard/resources/mediawiki.language.parser.peg === --- trunk/extensions/UploadWizard/resources/mediawiki.language.parser.peg (rev 0) +++ trunk/extensions/UploadWizard/resources/mediawiki.language.parser.peg 2011-03-10 01:34:39 UTC (rev 83625) @@ -0,0 +1,76 @@ +/* PEG grammar for a subset of wikitext, useful in the MediaWiki frontend */ + +start + = e:expression* { return e.length 1 ? [ CONCAT ].concat(e) : e[0]; } + +expression + = template + / link + / extlink + / replacement + / literal + +paramExpression + = template + / link + / extlink + / replacement + / literalWithoutBar + +template + = {{ t:templateContents }} { return t; } + +templateContents + = twr:templateWithReplacement p:templateParam* { return twr.concat(p) } + / t:templateName p:templateParam* { return p.length ? [ t, p ] : [ t ] } + +templateWithReplacement + = t:templateName : r:replacement { return [ t, r ] } + +templateParam + = | e:paramExpression* { return e.length 1 ? [ CONCAT ].concat(e) : e[0]; } + +templateName + = tn:[A-Za-z_]+ { return tn.join('').toUpperCase() } + +link + = [[ w:expression ]] { return [ 'WLINK', w ]; } + +extlink + = [ url:url whitespace text:expression ] { return [ 'LINK', url, text ] } + +url + = url:[^ ]+ { return url.join(''); } + +whitespace + = [ ]+ + +replacement + = '$' digits:digits { return [ 'REPLACE', parseInt( digits, 10 ) - 1 ] } + +digits + = [0-9]+ + +literal + = lit:escapedOrRegularLiteral+ { return lit.join(''); } + +literalWithoutBar + = lit:escapedOrLiteralWithoutBar+ { return lit.join(''); } + +escapedOrRegularLiteral + = escapedLiteral + / regularLiteral + +escapedOrLiteralWithoutBar + = escapedLiteral + / regularLiteralWithoutBar + +escapedLiteral + = \\ escaped:. { return escaped; } + +regularLiteral + = [^{}\[\]$\\] + +regularLiteralWithoutBar + = [^{}\[\]$\\|] + ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83626] trunk/extensions/UploadWizard/test/jasmine/spec/mediawiki. language.parser.spec.js
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83626 Revision: 83626 Author: neilk Date: 2011-03-10 01:36:15 + (Thu, 10 Mar 2011) Log Message: --- removed need to load languages on the fly; made namespaces agree with newer simpler scheme Modified Paths: -- trunk/extensions/UploadWizard/test/jasmine/spec/mediawiki.language.parser.spec.js Modified: trunk/extensions/UploadWizard/test/jasmine/spec/mediawiki.language.parser.spec.js === --- trunk/extensions/UploadWizard/test/jasmine/spec/mediawiki.language.parser.spec.js 2011-03-10 01:34:39 UTC (rev 83625) +++ trunk/extensions/UploadWizard/test/jasmine/spec/mediawiki.language.parser.spec.js 2011-03-10 01:36:15 UTC (rev 83626) @@ -185,12 +185,12 @@ expect( parser.parse( 'en_undelete_empty_param', [ 1 ] ).html() ).toEqual( 'Undelete' ); expect( parser.parse( 'en_undelete_empty_param', [ 3 ] ).html() ).toEqual( 'Undelete multiple edits' ); - } ) - } ) + } ); + } ); describe( easy message interface functions, function() { it( should allow a global that returns strings, function() { - var gM = mediaWiki.language.parser.getMessageFunction(); + var gM = mediaWiki.language.getMessageFunction(); // passing this through jQuery and back to string, because browsers may have subtle differences, like the case of tag names. // a surrounding SPAN is needed for html() to work right var expectedHtml = $j( 'spanComplex a href=http://example.com/foo;linking/a behaviour./span' ).html(); @@ -200,7 +200,7 @@ } ); it( should allow a jQuery plugin that appends to nodes, function() { - $j.fn.msg = mediaWiki.language.parser.getJqueryPlugin(); + $j.fn.msg = mediaWiki.language.getJqueryMessagePlugin(); var $div = $j( 'div' ).append( $j( 'p' ).addClass( 'foo' ) ); var clicked = false; var $button = $j( 'button' ).click( function() { clicked = true; } ); @@ -221,239 +221,83 @@ delete $j.fn.msg; } ); - } ); describe( test plurals and other language-specific functions, function() { + /* copying some language definitions in here -- it's hard to make this test fast and reliable + otherwise, and we don't want to have to know the mediawiki URL from this kind of test either. + We also can't preload the langs for the test since they clobber the same namespace. + In principle Roan said it was okay to change how languages worked so that didn't happen... maybe + someday. We'd have to the same kind of importing of the default rules for most rules, or maybe + come up with some kind of subclassing scheme for languages */ + var languageClasses = { + ar: { + /** +* Arabic (العربية) language functions +*/ - /** - * Get a language transform key - * returns default en fallback if none found - * @FIXME the resource loader should do this anyway, should not be necessary to know this client side - * @param String langKey The language key to be checked - */ - mediaWiki.language.getLangTransformKey = function( langKey ) { - if( mediaWiki.language.fallbackTransformMap[ langKey ] ) { - langKey = mediaWiki.language.fallbackTransformMap[ langKey ]; - } - // Make sure the langKey has a transformClass: - for( var i = 0; i mediaWiki.language.transformClass.length ; i++ ) { - if( langKey == mediaWiki.language.transformClass[i] ){ - return langKey; + convertPlural: function( count, forms ) { + forms = mediaWiki.language.preConvertPlural( forms, 6 ); + if ( count === 0 ) { + return forms[0]; + } + if ( count == 1 ) { + return forms[1]; + } + if ( count == 2 ) { + return forms[2]; + } +
[MediaWiki-CVS] SVN: [83627] trunk/extensions/UploadWizard/resources/jquery/jquery. mwCoolCats.js
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83627 Revision: 83627 Author: kaldari Date: 2011-03-10 01:58:25 + (Thu, 10 Mar 2011) Log Message: --- making category buttons jQuery buttons Modified Paths: -- trunk/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js Modified: trunk/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js === --- trunk/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js 2011-03-10 01:36:15 UTC (rev 83626) +++ trunk/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js 2011-03-10 01:58:25 UTC (rev 83627) @@ -35,13 +35,16 @@ _this.wrap('div class=cat-widget/div'); $container = _this.parent(); // set to the cat-widget class we just wrapped - $container.append( $j( 'button type=button name=catbutton'+settings.buttontext+'/button' ) - .click( function(e) { + $container.append( $j( 'button type=button name=catbutton'+settings.buttontext+'/button' ) + .button() + .click( function(e) { e.stopPropagation(); e.preventDefault(); _processInput(); return false; - }) ); + }) + ); + $container.prepend('ul class=cat-list pkg/ul'); //XXX ensure this isn't blocking other stuff needed. ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83628] branches/wmf/1.17wmf1/includes
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83628 Revision: 83628 Author: tstarling Date: 2011-03-10 02:18:55 + (Thu, 10 Mar 2011) Log Message: --- MFT r83617: job queue stats Modified Paths: -- branches/wmf/1.17wmf1/includes/DefaultSettings.php branches/wmf/1.17wmf1/includes/GlobalFunctions.php branches/wmf/1.17wmf1/includes/job/JobQueue.php Property Changed: branches/wmf/1.17wmf1/includes/DefaultSettings.php branches/wmf/1.17wmf1/includes/GlobalFunctions.php branches/wmf/1.17wmf1/includes/job/JobQueue.php Modified: branches/wmf/1.17wmf1/includes/DefaultSettings.php === --- branches/wmf/1.17wmf1/includes/DefaultSettings.php 2011-03-10 01:58:25 UTC (rev 83627) +++ branches/wmf/1.17wmf1/includes/DefaultSettings.php 2011-03-10 02:18:55 UTC (rev 83628) @@ -3871,6 +3871,14 @@ */ $wgStatsMethod = 'cache'; +/** + * When $wgStatsMethod is 'udp', setting this to a string allows statistics to + * be aggregated over more than one wiki. The string will be used in place of + * the DB name in outgoing UDP packets. If this is set to false, the DB name + * will be used. + */ +$wgAggregateStatsID = false; + /** Whereas to count the number of time an article is viewed. * Does not work if pages are cached (for example with squid). */ Property changes on: branches/wmf/1.17wmf1/includes/DefaultSettings.php ___ Modified: svn:mergeinfo - /branches/REL1_15/phase3/includes/DefaultSettings.php:51646 /branches/REL1_17/phase3/includes/DefaultSettings.php:81654 /branches/new-installer/phase3/includes/DefaultSettings.php:43664-66004 /branches/sqlite/includes/DefaultSettings.php:58211-58321 /branches/wmf/1.16wmf4/includes/DefaultSettings.php:67177,69199,76243,77266 /branches/wmf-deployment/includes/DefaultSettings.php:53381,60970 /trunk/phase3/includes/DefaultSettings.php:78395,79166,79324,79746,79860,79968,80109,80113,80137-80138,80205,80210,80222-80223,80231,80272,80381,80432-80433,80436,80443,80475,80554,80575,80590,80614-80616,80620,80656,80666,80837,80841,81311,81313,81349,81352,81376,81389,81397,81399,81412,81430,81488,81496,81554,81561,81589,81600,81611-81612,81615,81620,81622,81640,81648,81650-81652,81657,81674,81689,82696,82836,82853,82858,83114,83270,83284,83374,83390,83392,83402-83403,83410-83411,83420,83461,83463,83512 + /branches/REL1_15/phase3/includes/DefaultSettings.php:51646 /branches/REL1_17/phase3/includes/DefaultSettings.php:81654 /branches/new-installer/phase3/includes/DefaultSettings.php:43664-66004 /branches/sqlite/includes/DefaultSettings.php:58211-58321 /branches/wmf/1.16wmf4/includes/DefaultSettings.php:67177,69199,76243,77266 /branches/wmf-deployment/includes/DefaultSettings.php:53381,60970 /trunk/phase3/includes/DefaultSettings.php:78395,79166,79324,79746,79860,79968,80109,80113,80137-80138,80205,80210,80222-80223,80231,80272,80381,80432-80433,80436,80443,80475,80554,80575,80590,80614-80616,80620,80656,80666,80837,80841,81311,81313,81349,81352,81376,81389,81397,81399,81412,81430,81488,81496,81554,81561,81589,81600,81611-81612,81615,81620,81622,81640,81648,81650-81652,81657,81674,81689,82696,82836,82853,82858,83114,83270,83284,83374,83390,83392,83402-83403,83410-83411,83420,83461,83463,83512,83617 Modified: branches/wmf/1.17wmf1/includes/GlobalFunctions.php === --- branches/wmf/1.17wmf1/includes/GlobalFunctions.php 2011-03-10 01:58:25 UTC (rev 83627) +++ branches/wmf/1.17wmf1/includes/GlobalFunctions.php 2011-03-10 02:18:55 UTC (rev 83628) @@ -2322,15 +2322,20 @@ /** * Increment a statistics counter */ -function wfIncrStats( $key ) { +function wfIncrStats( $key, $count = 1 ) { global $wgStatsMethod; + $count = intval( $count ); + if( $wgStatsMethod == 'udp' ) { - global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgDBname; + global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgDBname, $wgAggregateStatsID; static $socket; + + $id = $wgAggregateStatsID !== false ? $wgAggregateStatsID : $wgDBname; + if ( !$socket ) { $socket = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); - $statline = stats/{$wgDBname} - 1 1 1 1 1 -total\n; + $statline = stats/{$id} - {$count} 1 1 1 1 -total\n; socket_sendto( $socket, $statline, @@ -2340,7 +2345,7 @@ $wgUDPProfilerPort ); } - $statline = stats/{$wgDBname} - 1 1 1 1 1 {$key}\n; + $statline = stats/{$id} - {$count} 1 1 1 1 {$key}\n; wfSuppressWarnings(); socket_sendto(
[MediaWiki-CVS] SVN: [83629] trunk/phase3/includes/job/JobQueue.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83629 Revision: 83629 Author: tstarling Date: 2011-03-10 02:27:15 + (Thu, 10 Mar 2011) Log Message: --- Stats for duplicate removal Modified Paths: -- trunk/phase3/includes/job/JobQueue.php Modified: trunk/phase3/includes/job/JobQueue.php === --- trunk/phase3/includes/job/JobQueue.php 2011-03-10 02:18:55 UTC (rev 83628) +++ trunk/phase3/includes/job/JobQueue.php 2011-03-10 02:27:15 UTC (rev 83629) @@ -82,8 +82,13 @@ $row-job_id ); $dbw-delete( 'job', $job-insertFields(), __METHOD__ ); + $affected = $dbw-affectedRows(); $dbw-commit(); + if ( $affected ) { + wfIncrStats( 'job-dup-delete', $affected ); + } + wfProfileOut( __METHOD__ ); return $job; } @@ -174,8 +179,13 @@ // Deadlock prone section $dbw-begin(); $dbw-delete( 'job', $job-insertFields(), __METHOD__ ); + $affected = $dbw-affectedRows(); $dbw-commit(); + if ( $affected ) { + wfIncrStats( 'job-dup-delete', $affected ); + } + wfProfileOut( __METHOD__ ); return $job; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83630] branches/wmf/1.17wmf1/includes/job/JobQueue.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83630 Revision: 83630 Author: tstarling Date: 2011-03-10 02:28:09 + (Thu, 10 Mar 2011) Log Message: --- MFT 83629: stats for duplicate removal Modified Paths: -- branches/wmf/1.17wmf1/includes/job/JobQueue.php Property Changed: branches/wmf/1.17wmf1/includes/job/JobQueue.php Modified: branches/wmf/1.17wmf1/includes/job/JobQueue.php === --- branches/wmf/1.17wmf1/includes/job/JobQueue.php 2011-03-10 02:27:15 UTC (rev 83629) +++ branches/wmf/1.17wmf1/includes/job/JobQueue.php 2011-03-10 02:28:09 UTC (rev 83630) @@ -77,8 +77,13 @@ $row-job_id ); $dbw-delete( 'job', $job-insertFields(), __METHOD__ ); + $affected = $dbw-affectedRows(); $dbw-commit(); + if ( $affected ) { + wfIncrStats( 'job-dup-delete', $affected ); + } + wfProfileOut( __METHOD__ ); return $job; } @@ -169,8 +174,13 @@ // Deadlock prone section $dbw-begin(); $dbw-delete( 'job', $job-insertFields(), __METHOD__ ); + $affected = $dbw-affectedRows(); $dbw-commit(); + if ( $affected ) { + wfIncrStats( 'job-dup-delete', $affected ); + } + wfProfileOut( __METHOD__ ); return $job; } Property changes on: branches/wmf/1.17wmf1/includes/job/JobQueue.php ___ Modified: svn:mergeinfo - /branches/REL1_15/phase3/includes/job/JobQueue.php:51646 /branches/new-installer/phase3/includes/job/JobQueue.php:43664-66004 /branches/sqlite/includes/job/JobQueue.php:58211-58321 /branches/wmf/1.16wmf4/includes/job/JobQueue.php:67177,69199,76243,77266 /branches/wmf-deployment/includes/job/JobQueue.php:53381,60970 /trunk/phase3/includes/job/JobQueue.php:83590,83617 + /branches/REL1_15/phase3/includes/job/JobQueue.php:51646 /branches/new-installer/phase3/includes/job/JobQueue.php:43664-66004 /branches/sqlite/includes/job/JobQueue.php:58211-58321 /branches/wmf/1.16wmf4/includes/job/JobQueue.php:67177,69199,76243,77266 /branches/wmf-deployment/includes/job/JobQueue.php:53381,60970 /trunk/phase3/includes/job/JobQueue.php:83590,83617,83629 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83631] trunk/extensions/UploadWizard/resources
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83631 Revision: 83631 Author: kaldari Date: 2011-03-10 02:50:19 + (Thu, 10 Mar 2011) Log Message: --- icons Added Paths: --- trunk/extensions/UploadWizard/resources/question-hover.png trunk/extensions/UploadWizard/resources/question.png Added: trunk/extensions/UploadWizard/resources/question-hover.png === (Binary files differ) Property changes on: trunk/extensions/UploadWizard/resources/question-hover.png ___ Added: svn:mime-type + application/octet-stream Added: trunk/extensions/UploadWizard/resources/question.png === (Binary files differ) Property changes on: trunk/extensions/UploadWizard/resources/question.png ___ Added: svn:mime-type + application/octet-stream ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83633] trunk/extensions/UploadWizard/resources/mw.UploadWizardDeed.js
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83633 Revision: 83633 Author: kaldari Date: 2011-03-10 03:46:58 + (Thu, 10 Mar 2011) Log Message: --- remove tipsyPlus from deeds page Modified Paths: -- trunk/extensions/UploadWizard/resources/mw.UploadWizardDeed.js Modified: trunk/extensions/UploadWizard/resources/mw.UploadWizardDeed.js === --- trunk/extensions/UploadWizard/resources/mw.UploadWizardDeed.js 2011-03-10 02:58:04 UTC (rev 83632) +++ trunk/extensions/UploadWizard/resources/mw.UploadWizardDeed.js 2011-03-10 03:46:58 UTC (rev 83633) @@ -152,14 +152,11 @@ // synchronize both username signatures // set initial value to configured username // if one changes all the others change (keyup event) - // - // also set tooltips ( the title, tipsy() ) $formFields.find( '.mwe-upwiz-sign' ) .attr( { title: gM( 'mwe-upwiz-tooltip-sign' ), value: mw.UploadWizard.config[ 'userName' ] } ) - .tipsyPlus() .keyup( function() { var thisInput = this; var thisVal = $j( thisInput ).val(); @@ -222,12 +219,10 @@ _this.uploadCount = uploadCount ? uploadCount : 1; _this.sourceInput = $j('textarea class=mwe-source mwe-long-textarea name=source rows=1 cols=40/textarea' ) .growTextArea() - .attr( 'title', gM( 'mwe-upwiz-tooltip-source' ) ) - .tipsyPlus(); + .attr( 'title', gM( 'mwe-upwiz-tooltip-source' ) ); _this.authorInput = $j('textarea class=mwe-author mwe-long-textarea name=author rows=1 cols=40/textarea' ) .growTextArea() - .attr( 'title', gM( 'mwe-upwiz-tooltip-author' ) ) - .tipsyPlus(); + .attr( 'title', gM( 'mwe-upwiz-tooltip-author' ) ); licenseInputDiv = $j( 'div class=mwe-upwiz-deed-license/div' ); _this.licenseInput = new mw.UploadWizardLicenseInput( licenseInputDiv ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83634] trunk/phase3/maintenance/nextJobDB.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83634 Revision: 83634 Author: tstarling Date: 2011-03-10 04:10:27 + (Thu, 10 Mar 2011) Log Message: --- Rewrite the caching code in nextJobDB.php so that jobs-loop.sh has a chance of being able to exit from the high-priority loop. The current syndrome is that when the cache expires, a small number of high-priority jobs are added. These jobs are quickly cleared, but the job runners do not continue on to other things, because the cache keeps returning the same small list of wikis for 5 minutes. After 5 minutes, there are a few more jobs in the high-priority list, so the cycle continues. Modified Paths: -- trunk/phase3/maintenance/nextJobDB.php Modified: trunk/phase3/maintenance/nextJobDB.php === --- trunk/phase3/maintenance/nextJobDB.php 2011-03-10 03:46:58 UTC (rev 83633) +++ trunk/phase3/maintenance/nextJobDB.php 2011-03-10 04:10:27 UTC (rev 83634) @@ -33,20 +33,71 @@ public function execute() { global $wgMemc; $type = $this-getOption( 'type', false ); - $mckey = $type === false - ? jobqueue:dbs - : jobqueue:dbs:$type; - $pendingDBs = $wgMemc-get( $mckey ); - # If we didn't get it from the cache + $memcKey = 'jobqueue:dbs:v2'; + $pendingDBs = $wgMemc-get( $memcKey ); + + // If the cache entry wasn't present, or in 1% of cases otherwise, + // regenerate the cache. + if ( !$pendingDBs || mt_rand( 0, 100 ) == 0 ) { + $pendingDBs = $this-getPendingDbs(); + $wgMemc-set( $memcKey, $pendingDBs, 300 ); + } + if ( !$pendingDBs ) { - $pendingDBs = $this-getPendingDbs( $type ); - $wgMemc-set( $mckey, $pendingDBs, 300 ); + return; } - # If we've got a pending job in a db, display it. - if ( $pendingDBs ) { - $this-output( $pendingDBs[mt_rand( 0, count( $pendingDBs ) - 1 )] ); + + do { + $again = false; + + if ( $type === false ) { + $candidates = call_user_func_array( 'array_merge', $pendingDBs ); + } elseif ( isset( $pendingDBs[$type] ) ) { + $candidates = $pendingDBs[$type]; + } else { + $candidates = array(); + } + if ( !$candidates ) { + return; + } + + $db = $candidates[ mt_rand( 0, count( $candidates ) - 1 ) ]; + if ( !$this-checkJob( $type, $db ) ) { + // This job is not available in the current database. Remove it from + // the cache. + if ( $type === false ) { + foreach ( $pendingDBs as $type2 = $dbs ) { + $pendingDBs[$type2] = array_diff( $pendingDBs[$type2], array( $db ) ); + } + } else { + $pendingDBs[$type] = array_diff( $pendingDBs[$type], array( $db ) ); + } + + $wgMemc-set( $memcKey, $pendingDBs, 300 ); + $again = true; + } + } while ( $again ); + + $this-output( $db . \n ); + } + + /** +* Check if the specified database has a job of the specified type in it. +* The type may be false to indicate all. +*/ + function checkJob( $type, $db ) { + $lb = wfGetLB( $db ); + $db = $lb-getConnection( DB_MASTER ); + if ( $type === false ) { + $conds = array(); + } else { + $conds = array( 'job_cmd' = $type ); } + + $exists = (bool) $db-selectField( 'job', '1', $conds, __METHOD__ ); + $lb-reuseConnection( $db ); + return $exists; } /** @@ -54,7 +105,7 @@ * @param $type String Job type * @return array */ - private function getPendingDbs( $type ) { + private function getPendingDbs() { global $wgLocalDatabases; $pendingDBs = array(); # Cross-reference DBs by master DB server @@ -66,10 +117,10 @@ foreach ( $dbsByMaster as $dbs ) {
[MediaWiki-CVS] SVN: [83635] branches/wmf/1.17wmf1/maintenance/nextJobDB.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83635 Revision: 83635 Author: tstarling Date: 2011-03-10 04:12:33 + (Thu, 10 Mar 2011) Log Message: --- MFT r83634: nextJobDB.php caching fix. Modified Paths: -- branches/wmf/1.17wmf1/maintenance/nextJobDB.php Property Changed: branches/wmf/1.17wmf1/maintenance/nextJobDB.php Modified: branches/wmf/1.17wmf1/maintenance/nextJobDB.php === --- branches/wmf/1.17wmf1/maintenance/nextJobDB.php 2011-03-10 04:10:27 UTC (rev 83634) +++ branches/wmf/1.17wmf1/maintenance/nextJobDB.php 2011-03-10 04:12:33 UTC (rev 83635) @@ -33,20 +33,71 @@ public function execute() { global $wgMemc; $type = $this-getOption( 'type', false ); - $mckey = $type === false - ? jobqueue:dbs - : jobqueue:dbs:$type; - $pendingDBs = $wgMemc-get( $mckey ); - # If we didn't get it from the cache + $memcKey = 'jobqueue:dbs:v2'; + $pendingDBs = $wgMemc-get( $memcKey ); + + // If the cache entry wasn't present, or in 1% of cases otherwise, + // regenerate the cache. + if ( !$pendingDBs || mt_rand( 0, 100 ) == 0 ) { + $pendingDBs = $this-getPendingDbs(); + $wgMemc-set( $memcKey, $pendingDBs, 300 ); + } + if ( !$pendingDBs ) { - $pendingDBs = $this-getPendingDbs( $type ); - $wgMemc-set( $mckey, $pendingDBs, 300 ); + return; } - # If we've got a pending job in a db, display it. - if ( $pendingDBs ) { - $this-output( $pendingDBs[mt_rand( 0, count( $pendingDBs ) - 1 )] ); + + do { + $again = false; + + if ( $type === false ) { + $candidates = call_user_func_array( 'array_merge', $pendingDBs ); + } elseif ( isset( $pendingDBs[$type] ) ) { + $candidates = $pendingDBs[$type]; + } else { + $candidates = array(); + } + if ( !$candidates ) { + return; + } + + $db = $candidates[ mt_rand( 0, count( $candidates ) - 1 ) ]; + if ( !$this-checkJob( $type, $db ) ) { + // This job is not available in the current database. Remove it from + // the cache. + if ( $type === false ) { + foreach ( $pendingDBs as $type2 = $dbs ) { + $pendingDBs[$type2] = array_diff( $pendingDBs[$type2], array( $db ) ); + } + } else { + $pendingDBs[$type] = array_diff( $pendingDBs[$type], array( $db ) ); + } + + $wgMemc-set( $memcKey, $pendingDBs, 300 ); + $again = true; + } + } while ( $again ); + + $this-output( $db . \n ); + } + + /** +* Check if the specified database has a job of the specified type in it. +* The type may be false to indicate all. +*/ + function checkJob( $type, $db ) { + $lb = wfGetLB( $db ); + $db = $lb-getConnection( DB_MASTER ); + if ( $type === false ) { + $conds = array(); + } else { + $conds = array( 'job_cmd' = $type ); } + + $exists = (bool) $db-selectField( 'job', '1', $conds, __METHOD__ ); + $lb-reuseConnection( $db ); + return $exists; } /** @@ -54,7 +105,7 @@ * @param $type String Job type * @return array */ - private function getPendingDbs( $type ) { + private function getPendingDbs() { global $wgLocalDatabases; $pendingDBs = array(); # Cross-reference DBs by master DB server @@ -66,10 +117,10 @@ foreach ( $dbsByMaster as $dbs ) { $dbConn = wfGetDB( DB_MASTER, array(), $dbs[0] ); - $stype = $dbConn-addQuotes( $type ); # Padding row for MySQL bug - $sql = (SELECT '---' as db); + $pad = str_repeat( '-', 40 ); +
[MediaWiki-CVS] SVN: [83636] trunk/phase3/maintenance/nextJobDB.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83636 Revision: 83636 Author: tstarling Date: 2011-03-10 04:47:21 + (Thu, 10 Mar 2011) Log Message: --- Some bug fixes for r83634. Modified Paths: -- trunk/phase3/maintenance/nextJobDB.php Modified: trunk/phase3/maintenance/nextJobDB.php === --- trunk/phase3/maintenance/nextJobDB.php 2011-03-10 04:12:33 UTC (rev 83635) +++ trunk/phase3/maintenance/nextJobDB.php 2011-03-10 04:47:21 UTC (rev 83636) @@ -62,6 +62,7 @@ return; } + $candidates = array_values( $candidates ); $db = $candidates[ mt_rand( 0, count( $candidates ) - 1 ) ]; if ( !$this-checkJob( $type, $db ) ) { // This job is not available in the current database. Remove it from @@ -86,9 +87,9 @@ * Check if the specified database has a job of the specified type in it. * The type may be false to indicate all. */ - function checkJob( $type, $db ) { - $lb = wfGetLB( $db ); - $db = $lb-getConnection( DB_MASTER ); + function checkJob( $type, $dbName ) { + $lb = wfGetLB( $dbName ); + $db = $lb-getConnection( DB_MASTER, array(), $dbName ); if ( $type === false ) { $conds = array(); } else { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83637] branches/wmf/1.17wmf1/maintenance/nextJobDB.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83637 Revision: 83637 Author: tstarling Date: 2011-03-10 04:48:09 + (Thu, 10 Mar 2011) Log Message: --- MFT r83636: some bug fixes (already live) Modified Paths: -- branches/wmf/1.17wmf1/maintenance/nextJobDB.php Property Changed: branches/wmf/1.17wmf1/maintenance/nextJobDB.php Modified: branches/wmf/1.17wmf1/maintenance/nextJobDB.php === --- branches/wmf/1.17wmf1/maintenance/nextJobDB.php 2011-03-10 04:47:21 UTC (rev 83636) +++ branches/wmf/1.17wmf1/maintenance/nextJobDB.php 2011-03-10 04:48:09 UTC (rev 83637) @@ -62,6 +62,7 @@ return; } + $candidates = array_values( $candidates ); $db = $candidates[ mt_rand( 0, count( $candidates ) - 1 ) ]; if ( !$this-checkJob( $type, $db ) ) { // This job is not available in the current database. Remove it from @@ -86,9 +87,9 @@ * Check if the specified database has a job of the specified type in it. * The type may be false to indicate all. */ - function checkJob( $type, $db ) { - $lb = wfGetLB( $db ); - $db = $lb-getConnection( DB_MASTER ); + function checkJob( $type, $dbName ) { + $lb = wfGetLB( $dbName ); + $db = $lb-getConnection( DB_MASTER, array(), $dbName ); if ( $type === false ) { $conds = array(); } else { Property changes on: branches/wmf/1.17wmf1/maintenance/nextJobDB.php ___ Modified: svn:mergeinfo - /branches/REL1_15/phase3/maintenance/nextJobDB.php:51646 /branches/new-installer/phase3/maintenance/nextJobDB.php:43664-66004 /branches/sqlite/maintenance/nextJobDB.php:58211-58321 /branches/wmf/1.16wmf4/maintenance/nextJobDB.php:67177,69199,76243,77266 /branches/wmf/1.17wmf1/maintenance/nextJobDB.php:83634 /branches/wmf-deployment/maintenance/nextJobDB.php:60970 /trunk/phase3/maintenance/nextJobDB.php:79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,81833,83212,83590,83634 + /branches/REL1_15/phase3/maintenance/nextJobDB.php:51646 /branches/new-installer/phase3/maintenance/nextJobDB.php:43664-66004 /branches/sqlite/maintenance/nextJobDB.php:58211-58321 /branches/wmf/1.16wmf4/maintenance/nextJobDB.php:67177,69199,76243,77266 /branches/wmf/1.17wmf1/maintenance/nextJobDB.php:83634 /branches/wmf-deployment/maintenance/nextJobDB.php:60970 /trunk/phase3/maintenance/nextJobDB.php:79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,81833,83212,83590,83634,83636 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83638] branches/wmf/1.17wmf1/maintenance/nextJobDB.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83638 Revision: 83638 Author: tstarling Date: 2011-03-10 04:50:01 + (Thu, 10 Mar 2011) Log Message: --- patch to skip testwiki when running jobs, because the job runners try to use /home and error out, stalling the whole process. Modified Paths: -- branches/wmf/1.17wmf1/maintenance/nextJobDB.php Modified: branches/wmf/1.17wmf1/maintenance/nextJobDB.php === --- branches/wmf/1.17wmf1/maintenance/nextJobDB.php 2011-03-10 04:48:09 UTC (rev 83637) +++ branches/wmf/1.17wmf1/maintenance/nextJobDB.php 2011-03-10 04:50:01 UTC (rev 83638) @@ -112,6 +112,12 @@ # Cross-reference DBs by master DB server $dbsByMaster = array(); foreach ( $wgLocalDatabases as $db ) { + // WMF patch to fix job runners with NFS not mounted -- TS + if ( $db === 'testwiki' ) { + continue; + } + // end patch + $lb = wfGetLB( $db ); $dbsByMaster[$lb-getServerName( 0 )][] = $db; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83639] trunk/extensions/ArrayExtension/ArrayExtension.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83639 Revision: 83639 Author: jeroendedauw Date: 2011-03-10 05:00:19 + (Thu, 10 Mar 2011) Log Message: --- follow up to r83603, fixed fatal error Modified Paths: -- trunk/extensions/ArrayExtension/ArrayExtension.php Modified: trunk/extensions/ArrayExtension/ArrayExtension.php === --- trunk/extensions/ArrayExtension/ArrayExtension.php 2011-03-10 04:50:01 UTC (rev 83638) +++ trunk/extensions/ArrayExtension/ArrayExtension.php 2011-03-10 05:00:19 UTC (rev 83639) @@ -45,12 +45,12 @@ $wgExtensionFunctions[] = 'efSetupArrayExtension'; $wgExtensionCredits['parserhook'][] = array( - 'path' = __FILE__ + 'path' = __FILE__, 'name' = 'ArrayExtension', 'url' = 'http://www.mediawiki.org/wiki/Extension:ArrayExtension', 'author' = array ( 'Li Ding', 'Jie Bao', 'Daniel Werner' ), 'descriptionmsg' = 'arrayext-desc', -'version' = ArrayExtension::VERSION, + 'version' = ArrayExtension::VERSION ); $wgExtensionMessagesFiles['ArrayExtension'] = dirname( __FILE__ ) . '/ArrayExtension.i18n.php'; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83640] trunk/phase3/maintenance/runJobs.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83640 Revision: 83640 Author: tstarling Date: 2011-03-10 05:26:34 + (Thu, 10 Mar 2011) Log Message: --- Add --maxtime parameter to allow job runners to be limited by time instead of job count. This makes more sense when --procs is used. Using it on Wikimedia will reduce the effect of laggy slaves. Modified Paths: -- trunk/phase3/maintenance/runJobs.php Modified: trunk/phase3/maintenance/runJobs.php === --- trunk/phase3/maintenance/runJobs.php2011-03-10 05:00:19 UTC (rev 83639) +++ trunk/phase3/maintenance/runJobs.php2011-03-10 05:26:34 UTC (rev 83640) @@ -31,6 +31,7 @@ parent::__construct(); $this-mDescription = Run pending jobs; $this-addOption( 'maxjobs', 'Maximum number of jobs to run', false, true ); + $this-addOption( 'maxtime', 'Maximum amount of wall-clock time', false, true ); $this-addOption( 'type', 'Type of job to run', false, true ); $this-addOption( 'procs', 'Number of processes to use', false, true ); } @@ -52,7 +53,9 @@ exit( 0 ); } } - $maxJobs = $this-getOption( 'maxjobs', 1 ); + $maxJobs = $this-getOption( 'maxjobs', false ); + $maxTime = $this-getOption( 'maxtime', false ); + $startTime = time(); $type = $this-getOption( 'type', false ); $wgTitle = Title::newFromText( 'RunJobs.php' ); $dbw = wfGetDB( DB_MASTER ); @@ -80,9 +83,13 @@ } else { $this-runJobsLog( $job-toString() . t=$timeMs good ); } + if ( $maxJobs ++$n $maxJobs ) { break 2; } + if ( $maxTime time() - $startTime $maxTime ) { + break 2; + } } } } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83641] branches/wmf/1.17wmf1/maintenance
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83641 Revision: 83641 Author: tstarling Date: 2011-03-10 05:29:09 + (Thu, 10 Mar 2011) Log Message: --- * MFT r83640: --maxtime parameter * In jobs-loop.sh, limit job time to 5 minutes Modified Paths: -- branches/wmf/1.17wmf1/maintenance/jobs-loop.sh branches/wmf/1.17wmf1/maintenance/runJobs.php Property Changed: branches/wmf/1.17wmf1/maintenance/runJobs.php Modified: branches/wmf/1.17wmf1/maintenance/jobs-loop.sh === --- branches/wmf/1.17wmf1/maintenance/jobs-loop.sh 2011-03-10 05:26:34 UTC (rev 83640) +++ branches/wmf/1.17wmf1/maintenance/jobs-loop.sh 2011-03-10 05:29:09 UTC (rev 83641) @@ -18,7 +18,7 @@ db=`php -n nextJobDB.php --type=$type` if [ -n $db ]; then echo $db $type - nice -n 20 php runJobs.php --wiki=$db --procs=4 --type=$type + nice -n 20 php runJobs.php --wiki=$db --procs=4 --type=$type --maxtime=300 wait moreprio=y fi @@ -34,7 +34,7 @@ sleep 5 else echo $db - nice -n 20 php runJobs.php --wiki=$db --procs=4 + nice -n 20 php runJobs.php --wiki=$db --procs=4 --maxtime=300 wait fi done Modified: branches/wmf/1.17wmf1/maintenance/runJobs.php === --- branches/wmf/1.17wmf1/maintenance/runJobs.php 2011-03-10 05:26:34 UTC (rev 83640) +++ branches/wmf/1.17wmf1/maintenance/runJobs.php 2011-03-10 05:29:09 UTC (rev 83641) @@ -31,6 +31,7 @@ parent::__construct(); $this-mDescription = Run pending jobs; $this-addOption( 'maxjobs', 'Maximum number of jobs to run', false, true ); + $this-addOption( 'maxtime', 'Maximum amount of wall-clock time', false, true ); $this-addOption( 'type', 'Type of job to run', false, true ); $this-addOption( 'procs', 'Number of processes to use', false, true ); } @@ -52,7 +53,9 @@ exit( 0 ); } } - $maxJobs = $this-getOption( 'maxjobs', 1 ); + $maxJobs = $this-getOption( 'maxjobs', false ); + $maxTime = $this-getOption( 'maxtime', false ); + $startTime = time(); $type = $this-getOption( 'type', false ); $wgTitle = Title::newFromText( 'RunJobs.php' ); $dbw = wfGetDB( DB_MASTER ); @@ -80,9 +83,13 @@ } else { $this-runJobsLog( $job-toString() . t=$timeMs good ); } + if ( $maxJobs ++$n $maxJobs ) { break 2; } + if ( $maxTime time() - $startTime $maxTime ) { + break 2; + } } } } Property changes on: branches/wmf/1.17wmf1/maintenance/runJobs.php ___ Added: svn:mergeinfo + /branches/REL1_15/phase3/maintenance/runJobs.php:51646 /branches/new-installer/phase3/maintenance/runJobs.php:43664-66004 /branches/sqlite/maintenance/runJobs.php:58211-58321 /branches/wmf/1.16wmf4/maintenance/runJobs.php:67177,69199,76243,77266 /branches/wmf-deployment/maintenance/runJobs.php:60970 /trunk/phase3/maintenance/runJobs.php:79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,81833,83212,83590,83640 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [83643] trunk/extensions/DumpHTML/SkinOffline.php
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83643 Revision: 83643 Author: tbleher Date: 2011-03-10 07:45:49 + (Thu, 10 Mar 2011) Log Message: --- Followup r82577: Only generate talk page links on content pages As suggested in http://www.mediawiki.org/wiki/Special:Code/MediaWiki/82577#c14726. DumpHTML is still broken in many ways, but at least it runs through now. Modified Paths: -- trunk/extensions/DumpHTML/SkinOffline.php Modified: trunk/extensions/DumpHTML/SkinOffline.php === --- trunk/extensions/DumpHTML/SkinOffline.php 2011-03-10 05:38:11 UTC (rev 83642) +++ trunk/extensions/DumpHTML/SkinOffline.php 2011-03-10 07:45:49 UTC (rev 83643) @@ -57,12 +57,14 @@ $nskey, !$this-mTitle-isTalkPage() ); - $content_actions['talk'] = $this-tabAction( - $this-mTitle-getTalkPage(), - 'talk', - $this-mTitle-isTalkPage(), - '', - true); + if( $this-mTitle-canTalk() ) { + $content_actions['talk'] = $this-tabAction( + $this-mTitle-getTalkPage(), + 'talk', + $this-mTitle-isTalkPage(), + '', + true); + } if ( isset( $wgHTMLDump ) ) { $content_actions['current'] = array( ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs