[MediaWiki-CVS] SVN: [114123] trunk/translatewiki/OpenStreetMap/OpenStreetMap.yaml
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114123 Revision: 114123 Author: siebrand Date: 2012-03-19 07:59:14 + (Mon, 19 Mar 2012) Log Message: --- Update tags. Modified Paths: -- trunk/translatewiki/OpenStreetMap/OpenStreetMap.yaml Modified: trunk/translatewiki/OpenStreetMap/OpenStreetMap.yaml === --- trunk/translatewiki/OpenStreetMap/OpenStreetMap.yaml2012-03-19 02:30:41 UTC (rev 114122) +++ trunk/translatewiki/OpenStreetMap/OpenStreetMap.yaml2012-03-19 07:59:14 UTC (rev 114123) @@ -84,6 +84,8 @@ - layouts.help_url - layouts.wiki_url - javascripts.map.base.mapquest +- layouts.partners_url +- layouts.intro_2_use_url ignored: - geocoder.search_osm_namefinder.prefix - printable_name.with_id ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114124] trunk/extensions/AbuseFilter/AbuseFilter.hooks.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114124 Revision: 114124 Author: tstarling Date: 2012-03-19 09:50:48 + (Mon, 19 Mar 2012) Log Message: --- During update, defer creation of the AbuseFilter user until after the core updates have run, so that you don't get Table 'user_properties' doesn't exist etc. Modified Paths: -- trunk/extensions/AbuseFilter/AbuseFilter.hooks.php Modified: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php === --- trunk/extensions/AbuseFilter/AbuseFilter.hooks.php 2012-03-19 07:59:14 UTC (rev 114123) +++ trunk/extensions/AbuseFilter/AbuseFilter.hooks.php 2012-03-19 09:50:48 UTC (rev 114124) @@ -321,11 +321,17 @@ $updater-addExtensionUpdate( array( 'addPgField', 'abuse_filter_log', 'afl_deleted', 'SMALLINT' ) ); $updater-addExtensionUpdate( array( 'changeField', 'abuse_filter_log', 'afl_filter', 'TEXT' ) ); $updater-addExtensionUpdate( array( 'addPgExtIndex', 'abuse_filter_log', 'abuse_filter_log_ip', (afl_ip) ) ); - } else { - throw new MWException(No known Schema updates.); } - // Create the Abuse Filter user. + $updater-addExtensionUpdate( array( array( __CLASS__, 'createAbuseFilterUser' ) ) ); + + return true; + } + + /** +* Updater callback to create the AbuseFilter user after the user tables have been updated. +*/ + public static function createAbuseFilterUser( $updater ) { $user = User::newFromName( wfMsgForContent( 'abusefilter-blocker' ) ); if ( $user !$updater-updateRowExists( 'create abusefilter-blocker-user' ) ) { @@ -345,8 +351,6 @@ # Promote user so it doesn't look too crazy. $user-addGroup( 'sysop' ); } - - return true; } /** ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114125] trunk/extensions/Translate/tag/PageTranslationHooks.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114125 Revision: 114125 Author: nikerabbit Date: 2012-03-19 10:50:13 + (Mon, 19 Mar 2012) Log Message: --- This line was supposed to be removed in r109030 /me bangs head Modified Paths: -- trunk/extensions/Translate/tag/PageTranslationHooks.php Modified: trunk/extensions/Translate/tag/PageTranslationHooks.php === --- trunk/extensions/Translate/tag/PageTranslationHooks.php 2012-03-19 09:50:48 UTC (rev 114124) +++ trunk/extensions/Translate/tag/PageTranslationHooks.php 2012-03-19 10:50:13 UTC (rev 114125) @@ -53,7 +53,6 @@ $newParser = new Parser(); $name = $newParser-preprocess( $name, $parser-getTitle(), $parser-getOptions() ); } - $name = $parser-recursivePreprocess( $name ); $parser-getOutput()-setDisplayTitle( $name ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114126] trunk/phase3/includes
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114126 Revision: 114126 Author: qchris Date: 2012-03-19 11:14:43 + (Mon, 19 Mar 2012) Log Message: --- Sanitizing already existing use of PHP's assert Modified Paths: -- trunk/phase3/includes/diff/DairikiDiff.php trunk/phase3/includes/parser/Preprocessor_DOM.php trunk/phase3/includes/parser/Preprocessor_Hash.php trunk/phase3/includes/parser/Preprocessor_HipHop.hphp Modified: trunk/phase3/includes/diff/DairikiDiff.php === --- trunk/phase3/includes/diff/DairikiDiff.php 2012-03-19 10:50:13 UTC (rev 114125) +++ trunk/phase3/includes/diff/DairikiDiff.php 2012-03-19 11:14:43 UTC (rev 114126) @@ -185,8 +185,8 @@ $edits = array(); $xi = $yi = 0; while ( $xi $n_from || $yi $n_to ) { - assert( $yi $n_to || $this-xchanged[$xi] ); - assert( $xi $n_from || $this-ychanged[$yi] ); + assert( '$yi $n_to || $this-xchanged[$xi]' ); + assert( '$xi $n_from || $this-ychanged[$yi]' ); // Skip matching snake. $copy = array(); @@ -374,14 +374,14 @@ while ( list( , $y ) = each( $matches ) ) { if ( empty( $this-in_seq[$y] ) ) { $k = $this-_lcs_pos( $y ); - assert( $k 0 ); + assert( '$k 0' ); $ymids[$k] = $ymids[$k -1]; break; } } while ( list ( , $y ) = each( $matches ) ) { if ( $y $this-seq[$k -1] ) { - assert( $y $this-seq[$k] ); + assert( '$y $this-seq[$k]' ); // Optimization: this is a common case: // next match is just replacing previous match. $this-in_seq[$this-seq[$k]] = false; @@ -389,7 +389,7 @@ $this-in_seq[$y] = 1; } elseif ( empty( $this-in_seq[$y] ) ) { $k = $this-_lcs_pos( $y ); - assert( $k 0 ); + assert( '$k 0' ); $ymids[$k] = $ymids[$k -1]; } } @@ -430,7 +430,7 @@ } } - assert( $ypos != $this-seq[$end] ); + assert( '$ypos != $this-seq[$end]' ); $this-in_seq[$this-seq[$end]] = false; $this-seq[$end] = $ypos; @@ -814,8 +814,8 @@ $mapped_from_lines, $mapped_to_lines ) { wfProfileIn( __METHOD__ ); - assert( sizeof( $from_lines ) == sizeof( $mapped_from_lines ) ); - assert( sizeof( $to_lines ) == sizeof( $mapped_to_lines ) ); + assert( 'sizeof( $from_lines ) == sizeof( $mapped_from_lines )' ); + assert( 'sizeof( $to_lines ) == sizeof( $mapped_to_lines )' ); parent::__construct( $mapped_from_lines, $mapped_to_lines ); @@ -1205,7 +1205,7 @@ $this-_flushLine( $tag ); $word = substr( $word, 1 ); } - assert( !strstr( $word, \n ) ); + assert( '!strstr( $word, \n )' ); $this-_group .= $word; } } Modified: trunk/phase3/includes/parser/Preprocessor_DOM.php === --- trunk/phase3/includes/parser/Preprocessor_DOM.php 2012-03-19 10:50:13 UTC (rev 114125) +++ trunk/phase3/includes/parser/Preprocessor_DOM.php 2012-03-19 11:14:43 UTC (rev 114126) @@ -479,7 +479,7 @@ } elseif ( $found == 'line-end' ) { $piece = $stack-top; // A heading must be open, otherwise \n wouldn't have been in the search list - assert( $piece-open == \n ); + assert( '$piece-open == \n' ); $part = $piece-getCurrentPart(); // Search back through the input to see if it has a proper close
[MediaWiki-CVS] SVN: [114127] trunk/extensions/Translate/resources/ext.translate.special. aggregategroups.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114127 Revision: 114127 Author: nikerabbit Date: 2012-03-19 11:17:27 + (Mon, 19 Mar 2012) Log Message: --- Use agg- instead of ag- (bikeshedding), ping r114002 Modified Paths: -- trunk/extensions/Translate/resources/ext.translate.special.aggregategroups.js Modified: trunk/extensions/Translate/resources/ext.translate.special.aggregategroups.js === --- trunk/extensions/Translate/resources/ext.translate.special.aggregategroups.js 2012-03-19 11:14:43 UTC (rev 114126) +++ trunk/extensions/Translate/resources/ext.translate.special.aggregategroups.js 2012-03-19 11:17:27 UTC (rev 114127) @@ -97,7 +97,7 @@ */ function createId( s ){ if ( s !== undefined ) { - return 'ag-' + s.toLowerCase().replace( /[\x00-\x1f\x23\x2c\x2e\x3c\x3e\x5b\x5d\x7b\x7c\x7d\x7f\s]+/g, '_' ); + return 'agg-' + s.toLowerCase().replace( /[\x00-\x1f\x23\x2c\x2e\x3c\x3e\x5b\x5d\x7b\x7c\x7d\x7f\s]+/g, '_' ); } } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114128] trunk/extensions/TranslationNotifications
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114128 Revision: 114128 Author: amire80 Date: 2012-03-19 11:30:08 + (Mon, 19 Mar 2012) Log Message: --- Added TranslationNotificationsHooks and a callback for logging. Added very basic logging. Renamed form fields variables and function name to something more meaningful. Added loading of autocomplete module. Modified Paths: -- trunk/extensions/TranslationNotifications/SpecialNotifyTranslators.php trunk/extensions/TranslationNotifications/TranslationNotifications.i18n.php trunk/extensions/TranslationNotifications/TranslationNotifications.php Added Paths: --- trunk/extensions/TranslationNotifications/TranslationNotificationsHooks.php Modified: trunk/extensions/TranslationNotifications/SpecialNotifyTranslators.php === --- trunk/extensions/TranslationNotifications/SpecialNotifyTranslators.php 2012-03-19 11:17:27 UTC (rev 114127) +++ trunk/extensions/TranslationNotifications/SpecialNotifyTranslators.php 2012-03-19 11:30:08 UTC (rev 114128) @@ -17,11 +17,11 @@ */ class SpecialNotifyTranslators extends SpecialPage { - private static $right = 'translate-manage'; - private static $notificationText = ''; - private static $translatablePageTitle = ''; - private static $deadlineDate = ''; - private static $priority = ''; + public static $right = 'translate-manage'; + public static $notificationText = ''; + public static $translatablePageTitle = ''; + public static $deadlineDate = ''; + public static $priority = ''; public function __construct() { parent::__construct( 'NotifyTranslators' ); @@ -35,7 +35,7 @@ throw new PermissionsError( self::$right ); } - $htmlFormDataModel = $this-getDataModel(); + $htmlFormDataModel = $this-getFormFields(); if ( !is_array( $htmlFormDataModel ) ) { $wgOut-addWikiMsg( $htmlFormDataModel ); @@ -43,7 +43,7 @@ } $context = $this-getContext(); - $htmlForm = new HtmlForm( $this-getDataModel(), $context, 'translationnotifications' ); + $htmlForm = new HtmlForm( $this-getFormFields(), $context, 'translationnotifications' ); $htmlForm-setId( 'notifytranslators-form' ); $htmlForm-setSubmitText( $context-msg( 'translationnotifications-send-notification-button' )-text() ); $htmlForm-setSubmitID( 'translationnotifications-send-notification-button' ); @@ -58,7 +58,7 @@ * * @return array or string with an error message key in case of error */ - private function getDataModel() { + private function getFormFields() { // Translatable pages dropdown $translatablePagesIDs = TranslatablePage::getTranslatablePages(); @@ -71,7 +71,9 @@ $translatablePagesOptions[Title::newFromID( $translatablePagesID )-getText()] = $translatablePagesID; } - $m['TranslatablePage'] = array( + $formFields = array(); + + $formFields['TranslatablePage'] = array( 'type' = 'select', 'label-message' = array( 'translationnotifications-translatablepage-title' ), 'options' = $translatablePagesOptions, @@ -79,7 +81,7 @@ ); // Languages to notify input box - $m['LanguagesToNotify'] = array( + $formFields['LanguagesToNotify'] = array( 'type' = 'text', 'rows' = 20, 'cols' = 80, @@ -96,7 +98,7 @@ $priorityOptions[$priorityMessage] = $priority; } - $m['Priority'] = array( + $formFields['Priority'] = array( 'type' = 'select', 'label-message' = array( 'translationnotifications-priority' ), 'options' = $priorityOptions, @@ -104,21 +106,21 @@ ); // Deadline date input box with datepicker - $m['DeadlineDate'] = array( + $formFields['DeadlineDate'] = array( 'type' = 'text', 'size' = 20, 'label-message' = 'translationnotifications-deadline-label', ); // Custom text - $m['NotificationText'] = array( + $formFields['NotificationText'] = array( 'type' = 'textarea', 'rows' = 20, 'cols' = 80, 'label-message' = 'emailmessage', ); - return $m;
[MediaWiki-CVS] SVN: [114129] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114129 Revision: 114129 Author: maxsem Date: 2012-03-19 12:19:58 + (Mon, 19 Mar 2012) Log Message: --- Text extraction rewrite: * Renamed prop=excerpts -- prop=extracts * Made it optionally return whole page extracts * More reasonably structured output: no more dummy 1-element arrays just because of API's awkward past. Looks good both in XML and sane formats. Will rename the file in the next commit. Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.php trunk/extensions/MobileFrontend/api/ApiQueryExcerpts.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.php === --- trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 11:30:08 UTC (rev 114128) +++ trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 12:19:58 UTC (rev 114129) @@ -52,7 +52,7 @@ 'ApiMobileView' = 'api/ApiMobileView', 'ApiParseExtender' = 'api/ApiParseExtender', - 'ApiQueryExcerpts' = 'api/ApiQueryExcerpts', + 'ApiQueryExtracts' = 'api/ApiQueryExcerpts', 'MobileFrontendTemplate' = 'templates/MobileFrontendTemplate', 'ApplicationTemplate' = 'templates/ApplicationTemplate', @@ -125,7 +125,7 @@ $wgExtensionFunctions[] = 'efMobileFrontend_Setup'; -$wgAPIPropModules['excerpts'] = 'ApiQueryExcerpts'; +$wgAPIPropModules['extracts'] = 'ApiQueryExtracts'; $wgAPIModules['mobileview'] = 'ApiMobileView'; $wgHooks['APIGetAllowedParams'][] = 'ApiParseExtender::onAPIGetAllowedParams'; Modified: trunk/extensions/MobileFrontend/api/ApiQueryExcerpts.php === --- trunk/extensions/MobileFrontend/api/ApiQueryExcerpts.php2012-03-19 11:30:08 UTC (rev 114128) +++ trunk/extensions/MobileFrontend/api/ApiQueryExcerpts.php2012-03-19 12:19:58 UTC (rev 114129) @@ -1,10 +1,14 @@ ?php -class ApiQueryExcerpts extends ApiQueryBase { +class ApiQueryExtracts extends ApiQueryBase { + const SECTION_MARKER_START = \1\2; + const SECTION_MARKER_END = \2\1; + /** * @var ParserOptions */ private $parserOptions; + private $params; public function __construct( $query, $moduleName ) { parent::__construct( $query, $moduleName, 'ex' ); @@ -17,8 +21,16 @@ wfProfileOut( __METHOD__ ); return; } - $params = $this-extractRequestParams(); + $isXml = $this-getMain()-getPrinter()-getFormat() == 'XML'; + $result = $this-getResult(); + $params = $this-params = $this-extractRequestParams(); $continue = 0; + $limit = intval( $params['limit'] ); + if ( $limit 1 !$params['intro'] ) { + $limit = 1; + ///@todo: + //$result-setWarning( Provided limit was too large for requests for whole article extracts, lowered to $limit ); + } if ( isset( $params['continue'] ) ) { $continue = intval( $params['continue'] ); if ( $continue 0 || $continue count( $titles ) ) { @@ -28,15 +40,19 @@ } $count = 0; foreach ( $titles as $id = $t ) { - if ( ++$count $params['limit'] ) { + if ( ++$count $limit ) { $this-setContinueEnumParameter( 'continue', $continue + $count - 1 ); break; } - $text = $this-getExcerpt( $t, $params['plaintext'] ); + $text = $this-getExtract( $t ); if ( isset( $params['length'] ) ) { - $text = $this-trimText( $text, $params['length'], $params['plaintext'] ); + $text = $this-trimText( $text ); } - $fit = $this-addPageSubItem( $id, $text ); + if ( $isXml ) { + $fit = $result-addValue( array( 'query', 'pages', $id ), 'extract', array( '*' = $text ) ); + } else { + $fit = $result-addValue( array( 'query', 'pages', $id ), 'extract', $text ); + } if ( !$fit ) { $this-setContinueEnumParameter( 'continue', $continue + $count - 1 ); break; @@ -68,7 +84,7 @@ $data = $api-getResultData(); foreach ( $pageIds as $id ) { if ( isset( $data['query']['pages'][$id]['excerpts'][0] ) ) { - $results[$id]['extract'] =
[MediaWiki-CVS] SVN: [114130] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114130 Revision: 114130 Author: maxsem Date: 2012-03-19 12:24:12 + (Mon, 19 Mar 2012) Log Message: --- Follow-up r114129: rename file Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.php Added Paths: --- trunk/extensions/MobileFrontend/api/ApiQueryExtracts.php Removed Paths: - trunk/extensions/MobileFrontend/api/ApiQueryExcerpts.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.php === --- trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 12:19:58 UTC (rev 114129) +++ trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 12:24:12 UTC (rev 114130) @@ -52,7 +52,7 @@ 'ApiMobileView' = 'api/ApiMobileView', 'ApiParseExtender' = 'api/ApiParseExtender', - 'ApiQueryExtracts' = 'api/ApiQueryExcerpts', + 'ApiQueryExtracts' = 'api/ApiQueryExtracts', 'MobileFrontendTemplate' = 'templates/MobileFrontendTemplate', 'ApplicationTemplate' = 'templates/ApplicationTemplate', Deleted: trunk/extensions/MobileFrontend/api/ApiQueryExcerpts.php === --- trunk/extensions/MobileFrontend/api/ApiQueryExcerpts.php2012-03-19 12:19:58 UTC (rev 114129) +++ trunk/extensions/MobileFrontend/api/ApiQueryExcerpts.php2012-03-19 12:24:12 UTC (rev 114130) @@ -1,369 +0,0 @@ -?php - -class ApiQueryExtracts extends ApiQueryBase { - const SECTION_MARKER_START = \1\2; - const SECTION_MARKER_END = \2\1; - - /** -* @var ParserOptions -*/ - private $parserOptions; - private $params; - - public function __construct( $query, $moduleName ) { - parent::__construct( $query, $moduleName, 'ex' ); - } - - public function execute() { - wfProfileIn( __METHOD__ ); - $titles = $this-getPageSet()-getGoodTitles(); - if ( count( $titles ) == 0 ) { - wfProfileOut( __METHOD__ ); - return; - } - $isXml = $this-getMain()-getPrinter()-getFormat() == 'XML'; - $result = $this-getResult(); - $params = $this-params = $this-extractRequestParams(); - $continue = 0; - $limit = intval( $params['limit'] ); - if ( $limit 1 !$params['intro'] ) { - $limit = 1; - ///@todo: - //$result-setWarning( Provided limit was too large for requests for whole article extracts, lowered to $limit ); - } - if ( isset( $params['continue'] ) ) { - $continue = intval( $params['continue'] ); - if ( $continue 0 || $continue count( $titles ) ) { - $this-dieUsageMsg( '_badcontinue' ); - } - $titles = array_slice( $titles, $continue, null, true ); - } - $count = 0; - foreach ( $titles as $id = $t ) { - if ( ++$count $limit ) { - $this-setContinueEnumParameter( 'continue', $continue + $count - 1 ); - break; - } - $text = $this-getExtract( $t ); - if ( isset( $params['length'] ) ) { - $text = $this-trimText( $text ); - } - if ( $isXml ) { - $fit = $result-addValue( array( 'query', 'pages', $id ), 'extract', array( '*' = $text ) ); - } else { - $fit = $result-addValue( array( 'query', 'pages', $id ), 'extract', $text ); - } - if ( !$fit ) { - $this-setContinueEnumParameter( 'continue', $continue + $count - 1 ); - break; - } - } - wfProfileOut( __METHOD__ ); - } - - /** -* OpenSearchXml hook handler -* @param array $results -*/ - public static function onOpenSearchXml( $results ) { - global $wgMFExtendOpenSearchXml; - if ( !$wgMFExtendOpenSearchXml || !count( $results ) ) { - return true; - } - $pageIds = array_keys( $results ); - $api = new ApiMain( new FauxRequest( - array( - 'action' = 'query', - 'prop' = 'excerpts', - 'explaintext' = true, - 'exlimit' = count( $results ), - 'pageids' =
[MediaWiki-CVS] SVN: [114131] trunk/phase3/includes/specials
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114131 Revision: 114131 Author: ialex Date: 2012-03-19 12:30:52 + (Mon, 19 Mar 2012) Log Message: --- Change calls from Xml::namespaceSelector() to Html::namespaceSelector() since the former now throws deprecation warnings... Modified Paths: -- trunk/phase3/includes/specials/SpecialDeletedContributions.php trunk/phase3/includes/specials/SpecialExport.php trunk/phase3/includes/specials/SpecialImport.php trunk/phase3/includes/specials/SpecialLinkSearch.php trunk/phase3/includes/specials/SpecialNewpages.php trunk/phase3/includes/specials/SpecialProtectedpages.php trunk/phase3/includes/specials/SpecialProtectedtitles.php trunk/phase3/includes/specials/SpecialWatchlist.php trunk/phase3/includes/specials/SpecialWhatlinkshere.php Modified: trunk/phase3/includes/specials/SpecialDeletedContributions.php === --- trunk/phase3/includes/specials/SpecialDeletedContributions.php 2012-03-19 12:24:12 UTC (rev 114130) +++ trunk/phase3/includes/specials/SpecialDeletedContributions.php 2012-03-19 12:30:52 UTC (rev 114131) @@ -492,8 +492,17 @@ 'size' = '20', 'required' = '' ) + ( $options['target'] ? array() : array( 'autofocus' ) ) ) . ' '. - Xml::label( $this-msg( 'namespace' )-text(), 'namespace' ) . ' ' . - Xml::namespaceSelector( $options['namespace'], '' ) . ' ' . + Html::namespaceSelector( + array( + 'selected' = $options['namespace'], + 'all' = '', + 'label' = $this-msg( 'namespace' )-text() + ), array( + 'name' = 'namespace', + 'id'= 'namespace', + 'class' = 'namespaceselector', + ) + ) . ' ' . Xml::submitButton( $this-msg( 'sp-contributions-submit' )-text() ) . Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' ); Modified: trunk/phase3/includes/specials/SpecialExport.php === --- trunk/phase3/includes/specials/SpecialExport.php2012-03-19 12:24:12 UTC (rev 114130) +++ trunk/phase3/includes/specials/SpecialExport.php2012-03-19 12:30:52 UTC (rev 114131) @@ -185,7 +185,16 @@ $form .= Xml::submitButton( $this-msg( 'export-addcat' )-text(), array( 'name' = 'addcat' ) ) . 'br /'; if ( $wgExportFromNamespaces ) { - $form .= Xml::namespaceSelector( $nsindex, null, 'nsindex', $this-msg( 'export-addnstext' )-text() ) . '#160;'; + $form .= Html::namespaceSelector( + array( + 'selected' = $nsindex, + 'label' = $this-msg( 'export-addnstext' )-text() + ), array( + 'name' = 'nsindex', + 'id'= 'namespace', + 'class' = 'namespaceselector', + ) + ) . '#160;'; $form .= Xml::submitButton( $this-msg( 'export-addns' )-text(), array( 'name' = 'addns' ) ) . 'br /'; } Modified: trunk/phase3/includes/specials/SpecialImport.php === --- trunk/phase3/includes/specials/SpecialImport.php2012-03-19 12:24:12 UTC (rev 114130) +++ trunk/phase3/includes/specials/SpecialImport.php2012-03-19 12:30:52 UTC (rev 114131) @@ -279,7 +279,16 @@ Xml::label( $this-msg( 'import-interwiki-namespace' )-text(), 'namespace' ) . /td td class='mw-input' . - Xml::namespaceSelector( $this-namespace, '' ) . + Html::namespaceSelector( + array( + 'selected' = $this-namespace, + 'all' = '', + ), array( + 'name' = 'namespace', + 'id'= 'namespace', +
[MediaWiki-CVS] SVN: [114132] trunk/phase3/tests/phpunit/includes/XmlTest.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114132 Revision: 114132 Author: ialex Date: 2012-03-19 12:44:36 + (Mon, 19 Mar 2012) Log Message: --- Removed XmlTest::testNamespaceSelector(); it just breaks when $wgDevelopmentWarnings is set to true due to the fact that Xml::namespaceSelector() calls wfDeprecated(). Modified Paths: -- trunk/phase3/tests/phpunit/includes/XmlTest.php Modified: trunk/phase3/tests/phpunit/includes/XmlTest.php === --- trunk/phase3/tests/phpunit/includes/XmlTest.php 2012-03-19 12:30:52 UTC (rev 114131) +++ trunk/phase3/tests/phpunit/includes/XmlTest.php 2012-03-19 12:44:36 UTC (rev 114132) @@ -193,52 +193,6 @@ ); } - function testNamespaceSelector() { - $this-assertEquals( - 'select class=namespaceselector id=namespace name=namespace' . \n . -'option value=0(Main)/option' . \n . -'option value=1Talk/option' . \n . -'option value=2User/option' . \n . -'option value=3User talk/option' . \n . -'option value=4MyWiki/option' . \n . -'option value=5MyWiki Talk/option' . \n . -'option value=6File/option' . \n . -'option value=7File talk/option' . \n . -'option value=8MediaWiki/option' . \n . -'option value=9MediaWiki talk/option' . \n . -'option value=10Template/option' . \n . -'option value=11Template talk/option' . \n . -'option value=100Custom/option' . \n . -'option value=101Custom talk/option' . \n . -'/select', - Xml::namespaceSelector(), - 'Basic namespace selector without custom options' - ); - $this-assertEquals( - 'label for=namespaceSelect a namespace:/label' . -'#160;select class=namespaceselector id=namespace name=myname' . \n . -'option value=allall/option' . \n . -'option value=0(Main)/option' . \n . -'option value=1Talk/option' . \n . -'option value=2 selected=User/option' . \n . -'option value=3User talk/option' . \n . -'option value=4MyWiki/option' . \n . -'option value=5MyWiki Talk/option' . \n . -'option value=6File/option' . \n . -'option value=7File talk/option' . \n . -'option value=8MediaWiki/option' . \n . -'option value=9MediaWiki talk/option' . \n . -'option value=10Template/option' . \n . -'option value=11Template talk/option' . \n . -'option value=100Custom/option' . \n . -'option value=101Custom talk/option' . \n . -'/select', - Xml::namespaceSelector( $selected = '2', $all = 'all', $element_name = 'myname', $label = 'Select a namespace:' ), - 'Basic namespace selector with custom values' - ); - } - - # # textarea # ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114133] trunk/extensions/ArticleFeedbackv5/modules/jquery. articleFeedbackv5/jquery.articleFeedbackv5.special.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114133 Revision: 114133 Author: emsmith Date: 2012-03-19 12:57:12 + (Mon, 19 Mar 2012) Log Message: --- Return correct mask information line so red lines with username/timestamp work again Modified Paths: -- trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js Modified: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js === --- trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js 2012-03-19 12:44:36 UTC (rev 114132) +++ trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js 2012-03-19 12:57:12 UTC (rev 114133) @@ -505,7 +505,7 @@ if( 0 == $screen.length ) { $screen = $( $.articleFeedbackv5special.maskHtmlTemplate ); $screen.find( '.articleFeedbackv5-mask-text' ) - .text( mw.msg( 'articlefeedbackv5-mask-text' ) ); + .text( mw.msg( 'articlefeedbackv5-mask-text-' + $type ) ); $screen.find( '.articleFeedbackv5-mask-postid' ) .text( mw.msg( 'articlefeedbackv5-mask-postnumber', $row.attr( 'rel' ) ) ); $row.prepend( $screen ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114134] trunk/extensions/MobileFrontend/javascripts/references.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114134 Revision: 114134 Author: jdlrobson Date: 2012-03-19 13:03:41 + (Mon, 19 Mar 2012) Log Message: --- make references close on a second click following erik's suggestion clicking on a reference a second time now turns it off (Reduces need for finger movement when checking multiple refs or accidentally opening refs.) Modified Paths: -- trunk/extensions/MobileFrontend/javascripts/references.js Modified: trunk/extensions/MobileFrontend/javascripts/references.js === --- trunk/extensions/MobileFrontend/javascripts/references.js 2012-03-19 12:57:12 UTC (rev 114133) +++ trunk/extensions/MobileFrontend/javascripts/references.js 2012-03-19 13:03:41 UTC (rev 114134) @@ -28,7 +28,7 @@ function init() { $( 'div id=mf-referencesdiv/div/div' ).hide().appendTo( document.body ); - var close = function( ev ) { + var close = function() { $( '#mf-references' ).fadeOut( 500 ); }; $( 'buttonclose/button' ).click( close ).appendTo( '#mf-references' ); @@ -40,14 +40,18 @@ data = href href.charAt(0) === '#' ? references[ href.substr( 1, href.length ) ] : null; - if( data ) { - html = 'h3[' + data.label + ']/h3' + data.html; + if( !$(#mf-references).is(:visible) ) { + if( data ) { + html = 'h3[' + data.label + ']/h3' + data.html; + } else { + html = $( 'a /' ).text( $(this).text() ). + attr( 'href', href ).appendTo('div /').parent().html(); + } + $( '#mf-references div' ).html( html ); + $( '#mf-references' ).fadeIn( 1000 ); } else { - html = $( 'a /' ).text( $(this).text() ). - attr( 'href', href ).appendTo('div /').parent().html(); + close(); } - $( '#mf-references div' ).html( html ); - $( '#mf-references' ).fadeIn( 1000 ); calculatePosition(); ev.preventDefault(); }); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114135] trunk/extensions/ArticleFeedbackv5/modules/jquery. articleFeedbackv5/jquery.articleFeedbackv5.special.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114135 Revision: 114135 Author: emsmith Date: 2012-03-19 13:06:19 + (Mon, 19 Mar 2012) Log Message: --- bug 35035 - hide/show decline oversight link on oversight/unoversight and make sure the hide link toggles on oversight Modified Paths: -- trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js Modified: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js === --- trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js 2012-03-19 13:03:41 UTC (rev 114134) +++ trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js 2012-03-19 13:06:19 UTC (rev 114135) @@ -1138,8 +1138,17 @@ 'apiFlagType': 'delete', 'apiFlagDir': 1, 'onSuccess': function( id, data ) { + // if there is a decline oversight just hide it + var $link = $( '#articleFeedbackv5-declineoversight-link-' + id ).hide(); - // First we must possibly show + // Oversight is going to hide this as well, do the unhide/hide toggle + var $link = $( '#articleFeedbackv5-hide-link-' + id ) + .attr( 'action', 'show' ) + .attr( 'id', 'articleFeedbackv5-show-link-' + id ) + .text( mw.msg( 'articlefeedbackv5-form-unhide' ) ) + .removeClass( 'articleFeedbackv5-hide-link' ) + .addClass( 'articleFeedbackv5-show-link' ); + var $link = $( '#articleFeedbackv5-oversight-link-' + id ) .attr( 'action', 'unoversight' ) .attr( 'id', 'articleFeedbackv5-unoversight-link-' + id ) @@ -1162,6 +1171,9 @@ 'apiFlagType': 'delete', 'apiFlagDir': -1, 'onSuccess': function( id, data ) { + // if there is a decline oversight just show it + var $link = $( '#articleFeedbackv5-declineoversight-link-' + id ).show(); + var $link = $( '#articleFeedbackv5-unoversight-link-' + id ) .attr( 'action', 'oversight' ) .attr( 'id', 'articleFeedbackv5-oversight-link-' + id ) ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114136] trunk/extensions/MobileFrontend/javascripts/references.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114136 Revision: 114136 Author: jdlrobson Date: 2012-03-19 13:19:55 + (Mon, 19 Mar 2012) Log Message: --- allow experimentation with animation speed as requested by tfinc we can now pass speed values via the hash e.g. #refspeed:200 makes the speed of the?\194?\167 revealing of references 200ms allowing us to experiment with correct values Modified Paths: -- trunk/extensions/MobileFrontend/javascripts/references.js Modified: trunk/extensions/MobileFrontend/javascripts/references.js === --- trunk/extensions/MobileFrontend/javascripts/references.js 2012-03-19 13:06:19 UTC (rev 114135) +++ trunk/extensions/MobileFrontend/javascripts/references.js 2012-03-19 13:19:55 UTC (rev 114136) @@ -1,7 +1,10 @@ if( typeof jQuery !== 'undefined' ) { MobileFrontend.references = (function($) { - var calculatePosition; + var calculatePosition, hashtest, options = {}; + hashtest = window.location.hash.substr(1).match(/refspeed:([0-9]*)/); + options.animationSpeed = hashtest ? parseInt( hashtest[1], 10 ) : 500; + function collect() { var references = {}; $( 'ol.references li' ).each(function(i, el) { @@ -29,7 +32,7 @@ function init() { $( 'div id=mf-referencesdiv/div/div' ).hide().appendTo( document.body ); var close = function() { - $( '#mf-references' ).fadeOut( 500 ); + $( '#mf-references' ).fadeOut( options.animationSpeed ); }; $( 'buttonclose/button' ).click( close ).appendTo( '#mf-references' ); $( '.mw-cite-backlink a' ).click( close ); @@ -48,7 +51,7 @@ attr( 'href', href ).appendTo('div /').parent().html(); } $( '#mf-references div' ).html( html ); - $( '#mf-references' ).fadeIn( 1000 ); + $( '#mf-references' ).fadeIn( options.animationSpeed ); } else { close(); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114137] trunk/phase3/includes/specials/SpecialCachedPage.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114137 Revision: 114137 Author: jeroendedauw Date: 2012-03-19 13:47:58 + (Mon, 19 Mar 2012) Log Message: --- Follow up to r114081; Modified Paths: -- trunk/phase3/includes/specials/SpecialCachedPage.php Modified: trunk/phase3/includes/specials/SpecialCachedPage.php === --- trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 13:19:55 UTC (rev 114136) +++ trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 13:47:58 UTC (rev 114137) @@ -80,7 +80,7 @@ * @return string */ protected function getCachedNotice( $subPage ) { - $refreshArgs = $_GET; + $refreshArgs = $this-getRequest()-getQueryValues(); unset( $refreshArgs['title'] ); $refreshArgs['action'] = 'purge'; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114138] trunk/extensions/LiquidThreads/classes/Hooks.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114138 Revision: 114138 Author: reedy Date: 2012-03-19 14:14:05 + (Mon, 19 Mar 2012) Log Message: --- Partial revert r114058 Modified Paths: -- trunk/extensions/LiquidThreads/classes/Hooks.php Modified: trunk/extensions/LiquidThreads/classes/Hooks.php === --- trunk/extensions/LiquidThreads/classes/Hooks.php2012-03-19 13:47:58 UTC (rev 114137) +++ trunk/extensions/LiquidThreads/classes/Hooks.php2012-03-19 14:14:05 UTC (rev 114138) @@ -338,7 +338,7 @@ * @return bool */ public static function onLoadExtensionSchemaUpdates( $updater = null ) { - $dir = dirname( __FILE__ ); + $dir = realpath( dirname( __FILE__ ) . '/..' ); $updater-addExtensionUpdate( array( 'addTable', 'thread', $dir/lqt.sql, true ) ); $updater-addExtensionUpdate( array( 'addTable', 'thread_history', $dir/schema-changes/thread_history_table.sql, true ) ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114139] branches
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114139 Revision: 114139 Author: reedy Date: 2012-03-19 14:19:16 + (Mon, 19 Mar 2012) Log Message: --- MFT r114138 r114058 Modified Paths: -- branches/REL1_18/extensions/LiquidThreads/classes/Hooks.php branches/REL1_19/extensions/LiquidThreads/classes/Hooks.php Property Changed: branches/REL1_18/extensions/LiquidThreads/ branches/REL1_19/extensions/LiquidThreads/ Property changes on: branches/REL1_18/extensions/LiquidThreads ___ Modified: svn:mergeinfo - /trunk/extensions/LiquidThreads:57390,92706,97811,98773,98801,98960,98982,99022,99059,99097,99164,99167,103675,104049,104162,114057 + /trunk/extensions/LiquidThreads:57390,92706,97811,98773,98801,98960,98982,99022,99059,99097,99164,99167,103675,104049,104162,114057,114138 Modified: branches/REL1_18/extensions/LiquidThreads/classes/Hooks.php === --- branches/REL1_18/extensions/LiquidThreads/classes/Hooks.php 2012-03-19 14:14:05 UTC (rev 114138) +++ branches/REL1_18/extensions/LiquidThreads/classes/Hooks.php 2012-03-19 14:19:16 UTC (rev 114139) @@ -309,7 +309,7 @@ } public static function onLoadExtensionSchemaUpdates( $updater = null ) { - $dir = dirname( __FILE__ ); + $dir = realpath( dirname( __FILE__ ) . '/..' ); if ( $updater === null ) { // DB updates Property changes on: branches/REL1_19/extensions/LiquidThreads ___ Modified: svn:mergeinfo - /trunk/extensions/LiquidThreads:57390,112660,112687,112751,112770-112771,112775,112849,112851,112856,112859,112903,112925,112993,114057 + /trunk/extensions/LiquidThreads:57390,112660,112687,112751,112770-112771,112775,112849,112851,112856,112859,112903,112925,112993,114057,114138 Modified: branches/REL1_19/extensions/LiquidThreads/classes/Hooks.php === --- branches/REL1_19/extensions/LiquidThreads/classes/Hooks.php 2012-03-19 14:14:05 UTC (rev 114138) +++ branches/REL1_19/extensions/LiquidThreads/classes/Hooks.php 2012-03-19 14:19:16 UTC (rev 114139) @@ -338,7 +338,7 @@ * @return bool */ public static function onLoadExtensionSchemaUpdates( $updater = null ) { - $dir = dirname( __FILE__ ); + $dir = realpath( dirname( __FILE__ ) . '/..' ); $updater-addExtensionUpdate( array( 'addTable', 'thread', $dir/lqt.sql, true ) ); $updater-addExtensionUpdate( array( 'addTable', 'thread_history', $dir/schema-changes/thread_history_table.sql, true ) ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114140] trunk/phase3/includes/specials/SpecialProtectedpages.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114140 Revision: 114140 Author: krinkle Date: 2012-03-19 14:34:27 + (Mon, 19 Mar 2012) Log Message: --- [Html::namespaceSelector clean up] fix broken html from r114131 Modified Paths: -- trunk/phase3/includes/specials/SpecialProtectedpages.php Modified: trunk/phase3/includes/specials/SpecialProtectedpages.php === --- trunk/phase3/includes/specials/SpecialProtectedpages.php2012-03-19 14:19:16 UTC (rev 114139) +++ trunk/phase3/includes/specials/SpecialProtectedpages.php2012-03-19 14:34:27 UTC (rev 114140) @@ -186,8 +186,7 @@ * @return String */ protected function getNamespaceMenu( $namespace = null ) { - return span style='white-space: nowrap' . - Html::rawElement( 'span', array( 'style' = 'white-space:nowrap' ), + return Html::rawElement( 'span', array( 'style' = 'white-space: nowrap;' ), Html::namespaceSelector( array( 'selected' = $namespace, ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114141] trunk/extensions
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114141 Revision: 114141 Author: reedy Date: 2012-03-19 14:50:53 + (Mon, 19 Mar 2012) Log Message: --- Bug 35319 - typo: occured in articlefeedback-error string Modified Paths: -- trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php Modified: trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php === --- trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php 2012-03-19 14:34:27 UTC (rev 114140) +++ trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php 2012-03-19 14:50:53 UTC (rev 114141) @@ -29,7 +29,7 @@ 'articlefeedback-survey-disclaimer' = 'By submitting, you agree to transparency under these $1.', 'articlefeedback-survey-disclaimerlink' = 'terms', /* ext.articleFeedback and jquery.articleFeedback */ - 'articlefeedback-error' = 'An error has occured. Please try again later.', + 'articlefeedback-error' = 'An error has occurred. Please try again later.', 'articlefeedback-form-switch-label' = 'Rate this page', 'articlefeedback-form-panel-title' = 'Rate this page', 'articlefeedback-form-panel-explanation' = 'What\'s this?', Modified: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php === --- trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php 2012-03-19 14:34:27 UTC (rev 114140) +++ trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php 2012-03-19 14:50:53 UTC (rev 114141) @@ -34,7 +34,7 @@ 'articlefeedbackv5-cta3-button-text' = 'Start the survey', /* Error Messages */ - 'articlefeedbackv5-error' = 'An error has occured. Please try again later.', + 'articlefeedbackv5-error' = 'An error has occurred. Please try again later.', 'articlefeedbackv5-page-disabled' = 'Article Feedback page not enabled for this article.', 'articlefeedbackv5-error-email' = 'That e-mail address is not valid.', 'articlefeedbackv5-error-blocked' = 'Blocked users may not submit feedback.', @@ -493,10 +493,10 @@ * $1 is the title of the article for which we show the feedback', 'articlefeedbackv5-hidden' = 'The marker that appears on a comment if it has been hidden by a monitor. * $1 is the name of the monitor who performed the hide -* $2 is the timestamp for when the hide occured', +* $2 is the timestamp for when the hide occurred', 'articlefeedbackv5-deleted' = 'The marker that appears on a comment if it has been deleted by an oversighter. * $1 is the name of the oversighter who performed the delete -* $2 is the timestamp for when the deletion occured', +* $2 is the timestamp for when the deletion occurred', 'articlefeedbackv5-form-abuse' = 'Link text allowing the user to flag feedback as abuse. $1 is the number of times the feedback has been flagged previously.', 'articlefeedbackv5-form-abuse-masked' = 'Link text allowing the user to flag feedback as abuse, without the count included in {{msg-mw|articlefeedbackv5-form-abuse}}', 'articlefeedbackv5-form-delete' = '{{Identical|Delete}}', ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114143] trunk/extensions/DonationInterface/gateway_common/countries. i18n.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114143 Revision: 114143 Author: jhsoby Date: 2012-03-19 14:55:12 + (Mon, 19 Mar 2012) Log Message: --- Adding Arabic translation of 'Mauritania' to countries.i18n.php Modified Paths: -- trunk/extensions/DonationInterface/gateway_common/countries.i18n.php Modified: trunk/extensions/DonationInterface/gateway_common/countries.i18n.php === --- trunk/extensions/DonationInterface/gateway_common/countries.i18n.php 2012-03-19 14:54:43 UTC (rev 114142) +++ trunk/extensions/DonationInterface/gateway_common/countries.i18n.php 2012-03-19 14:55:12 UTC (rev 114143) @@ -256,6 +256,7 @@ /** Arabic (العربية) */ $messages['ar'] = array( 'donate_interface-country-dropdown-SA' = 'السعودية', + 'donate_interface-country-dropdown-MR' = 'موريتانيا', ); /** Bulgarian (Български) */ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114144] trunk/extensions
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114144 Revision: 114144 Author: reedy Date: 2012-03-19 14:59:29 + (Mon, 19 Mar 2012) Log Message: --- Many other occurance/occurence typos Modified Paths: -- trunk/extensions/AbuseFilter/AbuseFilter.i18n.php trunk/extensions/Arrays/Arrays.php trunk/extensions/Arrays/RELEASE-NOTES trunk/extensions/Chemistry/SpecialChemicalsources.php trunk/extensions/Chemistry/SpecialChemicalsources_body.php trunk/extensions/Cite/Cite_body.php trunk/extensions/DSMW/files/utils.php trunk/extensions/DSMW/includes/SemanticFunctions.php trunk/extensions/DSMW/logootComponent/logootEngine.php trunk/extensions/DynamicPageList/DPL.php trunk/extensions/DynamicPageList/DynamicPageListInclude.php trunk/extensions/FreqPatternTagCloud/includes/computation/FrequentPatternAlgorithm.php trunk/extensions/Gnuplot/Gnuplot.php trunk/extensions/InlineEditor/SentenceEditor/SentenceEditor.class.php trunk/extensions/LiveTranslate/includes/jquery.liveTranslate.js trunk/extensions/MetaKeywords/MetaKeywords.i18n.php trunk/extensions/MobileFrontend/library/WURFL/Handlers/Utils.php trunk/extensions/QPoll/Excel/PEAR.php trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Aggregatable.php trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php trunk/extensions/SemanticResultFormats/ValueRank/SRF_ValueRank.php trunk/extensions/SimpleSecurity/SimpleSecurity_body.php trunk/extensions/Sternograph/Sternograph.body.php trunk/extensions/StringFunctions/StringFunctions.php trunk/extensions/StringFunctionsEscaped/README trunk/extensions/StringFunctionsEscaped/StringFunctionsEscaped.php trunk/extensions/Translate/TranslateUtils.php trunk/extensions/TreeAndMenu/TreeAndMenu.php trunk/extensions/WikiForum/WikiForum.i18n.php trunk/extensions/Wikidata/OmegaWiki/Test.skeleton.php Modified: trunk/extensions/AbuseFilter/AbuseFilter.i18n.php === --- trunk/extensions/AbuseFilter/AbuseFilter.i18n.php 2012-03-19 14:55:12 UTC (rev 114143) +++ trunk/extensions/AbuseFilter/AbuseFilter.i18n.php 2012-03-19 14:59:29 UTC (rev 114144) @@ -690,7 +690,7 @@ 'abusefilter-edit-throttle-period' = 'Field label for entering a time period.', 'abusefilter-edit-throttle-seconds' = 'Throttle period in seconds. Parameters: * $1 is a number of seconds.', - 'abusefilter-edit-throttle-groups' = 'Field label for properties to group throttle counts by (for example IP address and username). Throttling is the concept of limiting occurances of a certain action in a given time frame.', + 'abusefilter-edit-throttle-groups' = 'Field label for properties to group throttle counts by (for example IP address and username). Throttling is the concept of limiting occurrences of a certain action in a given time frame.', 'abusefilter-edit-warn-message' = 'Field label for dropdown list with system messages.', 'abusefilter-edit-warn-other' = 'Option in dropdown menu to specify no item from the list should be used.', 'abusefilter-edit-warn-other-label' = 'Field label for entering a system message key to use as warning text.', Modified: trunk/extensions/Arrays/Arrays.php === --- trunk/extensions/Arrays/Arrays.php 2012-03-19 14:55:12 UTC (rev 114143) +++ trunk/extensions/Arrays/Arrays.php 2012-03-19 14:59:29 UTC (rev 114144) @@ -446,8 +446,8 @@ /** - * locate the index of the first occurence of an element starting from the 'index' - *- print -1 (not found) or index (found) to show the index of the first occurence of 'value' in the array identified by arrayid + * locate the index of the first occurrence of an element starting from the 'index' + *- print -1 (not found) or index (found) to show the index of the first occurrence of 'value' in the array identified by arrayid *- if 'yes' and 'no' are set, print value of them when found or not-found *- index is 0-based , it must be non-negative and less than lenth * usage: Modified: trunk/extensions/Arrays/RELEASE-NOTES === --- trunk/extensions/Arrays/RELEASE-NOTES 2012-03-19 14:55:12 UTC (rev 114143) +++ trunk/extensions/Arrays/RELEASE-NOTES 2012-03-19 14:59:29 UTC (rev 114144) @@ -149,7 +149,7 @@ - update '#arraysort:' adding random option to make the array of values in random order - add '#arrayreset' to free all defined arrays for memory saving - add '#arrayslice' to return an array bounded by start_index and length. -- add '#arraysearch.' now we can return the index of the first occurence of an element, return -1 if +- add '#arraysearch.' now we can return the index of
[MediaWiki-CVS] SVN: [114145] trunk/extensions/MobileFrontend/templates/SearchTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114145 Revision: 114145 Author: jdlrobson Date: 2012-03-19 15:12:10 + (Mon, 19 Mar 2012) Log Message: --- remove languageselection div there are currently 2 elements with id languageselection. This one appears to be redundant Modified Paths: -- trunk/extensions/MobileFrontend/templates/SearchTemplate.php Modified: trunk/extensions/MobileFrontend/templates/SearchTemplate.php === --- trunk/extensions/MobileFrontend/templates/SearchTemplate.php 2012-03-19 14:59:29 UTC (rev 114144) +++ trunk/extensions/MobileFrontend/templates/SearchTemplate.php 2012-03-19 15:12:10 UTC (rev 114145) @@ -26,7 +26,7 @@ $languageSelection = $this-data['buildLanguageSelection'] . 'br/'; $languageSelectionText = 'b' . $this-data['messages']['mobile-frontend-language'] . ':/bbr/'; - $languageSelectionDiv = 'div id=languageselection' . $languageSelectionText . $languageSelection . '/div'; + $languageSelectionDiv = $languageSelectionText . $languageSelection; $searchWebkitHtml = HTML div id='header' ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114146] trunk/phase3/maintenance/mwdocgen.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114146 Revision: 114146 Author: reedy Date: 2012-03-19 15:25:22 + (Mon, 19 Mar 2012) Log Message: --- Fix switch fall through Remove code for getting svn rev from SVN less than 1.4 - Ubuntu 8.04 LTS has 1.4.6 so should be pretty safe Modified Paths: -- trunk/phase3/maintenance/mwdocgen.php Modified: trunk/phase3/maintenance/mwdocgen.php === --- trunk/phase3/maintenance/mwdocgen.php 2012-03-19 15:12:10 UTC (rev 114145) +++ trunk/phase3/maintenance/mwdocgen.php 2012-03-19 15:25:22 UTC (rev 114146) @@ -116,31 +116,7 @@ $content = file( $entries ); - // check if file is xml (subversion release = 1.3) or not (subversion release = 1.4) - if ( preg_match( '/^\?xml/', $content[0] ) ) { - // subversion is release = 1.3 - if ( !function_exists( 'simplexml_load_file' ) ) { - // We could fall back to expat... YUCK - return false; - } - - $xml = simplexml_load_file( $entries ); - - if ( $xml ) { - foreach ( $xml-entry as $entry ) { - if ( $xml-entry[0]['name'] == '' ) { - // The directory entry should always have a revision marker. - if ( $entry['revision'] ) { - return intval( $entry['revision'] ); - } - } - } - } - return false; - } else { - // subversion is release 1.4 - return intval( $content[3] ); - } + return intval( $content[3] ); } /** @@ -273,6 +249,7 @@ $file = readaline( Enter file name $mwPath ); } $input = $mwPath . $file; + break; case 6: $input = $mwPath; $exclude_patterns = 'extensions'; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114147] trunk/phase3/includes/specials/SpecialCachedPage.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114147 Revision: 114147 Author: jeroendedauw Date: 2012-03-19 16:14:05 + (Mon, 19 Mar 2012) Log Message: --- Follow up to r114081; address krinkles comment Modified Paths: -- trunk/phase3/includes/specials/SpecialCachedPage.php Modified: trunk/phase3/includes/specials/SpecialCachedPage.php === --- trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 15:25:22 UTC (rev 114146) +++ trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 16:14:05 UTC (rev 114147) @@ -91,7 +91,7 @@ $refreshArgs ); - if ( $this-cacheExpiry 10 ) { + if ( $this-cacheExpiry 86400 * 3650 ) { $message = $this-msg( 'cachedspecial-viewing-cached-ttl', $this-getLanguage()-formatDuration( $this-cacheExpiry ) ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114148] trunk/extensions/EducationProgram
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114148 Revision: 114148 Author: jeroendedauw Date: 2012-03-19 16:25:51 + (Mon, 19 Mar 2012) Log Message: --- allow setting default course descriptions via wiki pages Modified Paths: -- trunk/extensions/EducationProgram/EducationProgram.settings.php trunk/extensions/EducationProgram/actions/EditCourseAction.php trunk/extensions/EducationProgram/compat/SpecialCachedPage.php trunk/extensions/EducationProgram/includes/EPUtils.php Modified: trunk/extensions/EducationProgram/EducationProgram.settings.php === --- trunk/extensions/EducationProgram/EducationProgram.settings.php 2012-03-19 16:14:05 UTC (rev 114147) +++ trunk/extensions/EducationProgram/EducationProgram.settings.php 2012-03-19 16:25:51 UTC (rev 114148) @@ -50,6 +50,8 @@ 'US' = 'Flag_of_the_United_States.svg', ), 'fallbackFlag' = 'Nuvola unknown flag.svg', + 'courseDescPage' = 'Course description', + 'courseOrgDescPage' = '$2/$1', // $1 = org name, $2 = courseDescPage setting ); } Modified: trunk/extensions/EducationProgram/actions/EditCourseAction.php === --- trunk/extensions/EducationProgram/actions/EditCourseAction.php 2012-03-19 16:14:05 UTC (rev 114147) +++ trunk/extensions/EducationProgram/actions/EditCourseAction.php 2012-03-19 16:25:51 UTC (rev 114148) @@ -252,6 +252,13 @@ ); $data['term'] = $this-getRequest()-getVal( 'newterm' ); + + $data['description'] = $this-getDefaultDescription( array( + 'institutionid' = $data['org_id'], + 'name' = $data['mc'], + 'title' = $data['name'], + 'term' = $data['term'], + ) ); } return $data; @@ -268,5 +275,57 @@ return $value; } + + /** +* Returns the description to use as default, based +* on the courseDescPage and courseOrgDescPage settings. +* +* @since 0.1 +* +* @param array $data +* +* @return string +*/ + protected function getDefaultDescription( array $data ) { + $primaryPage = EPSettings::get( 'courseDescPage' ); + $orgPage = EPSettings::get( 'courseOrgDescPage' ); + + $orgTitle = EPOrgs::singleton()-selectFieldsRow( 'name', array( 'id' = $data['institutionid'] ) ); + + $content = false; + + if ( $orgTitle !== false ) { + $orgPage = str_replace( + array( '$1', '$2' ), + array( $orgTitle, $primaryPage ), + $orgPage + ); + + $content = EPUtils::getArticleContent( $orgPage ); + } + + if ( $content === false ) { + $content = EPUtils::getArticleContent( $primaryPage ); + } + + if ( $content === false ) { + $content = ''; + } + else { + if ( $orgTitle !== false ) { + $data['institution'] = $orgTitle; + } + + $content = str_replace( + array_map( function( $name ) { + return '{{{' . $name . '}}}'; + }, array_keys( $data ) ), + $data, + $content + ); + } + + return $content; + } } \ No newline at end of file Modified: trunk/extensions/EducationProgram/compat/SpecialCachedPage.php === --- trunk/extensions/EducationProgram/compat/SpecialCachedPage.php 2012-03-19 16:14:05 UTC (rev 114147) +++ trunk/extensions/EducationProgram/compat/SpecialCachedPage.php 2012-03-19 16:25:51 UTC (rev 114148) @@ -80,7 +80,7 @@ * @return string */ protected function getCachedNotice( $subPage ) { - $refreshArgs = $_GET; + $refreshArgs = $this-getRequest()-getQueryValues(); unset( $refreshArgs['title'] ); $refreshArgs['action'] = 'purge'; @@ -91,7 +91,7 @@ $refreshArgs ); - if ( $this-cacheExpiry 10 ) { + if ( $this-cacheExpiry 86400 * 3650 ) {
[MediaWiki-CVS] SVN: [114149] trunk/extensions/EducationProgram/EducationProgram.settings. php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114149 Revision: 114149 Author: jeroendedauw Date: 2012-03-19 16:29:13 + (Mon, 19 Mar 2012) Log Message: --- added in flag names Modified Paths: -- trunk/extensions/EducationProgram/EducationProgram.settings.php Modified: trunk/extensions/EducationProgram/EducationProgram.settings.php === --- trunk/extensions/EducationProgram/EducationProgram.settings.php 2012-03-19 16:25:51 UTC (rev 114148) +++ trunk/extensions/EducationProgram/EducationProgram.settings.php 2012-03-19 16:29:13 UTC (rev 114149) @@ -47,7 +47,17 @@ 'flagWidth' = 25, 'flagHeight' = 25, 'countryFlags' = array( - 'US' = 'Flag_of_the_United_States.svg', + 'US' = 'Flag of the United States.svg', + 'BR' = 'Flag of Brazil.svg', + 'CA' = 'Flag of Canada.svg', + 'IN' = 'Flag of India.svg', + 'EG' = 'Flag of Egypt.svg', + 'IT' = 'Flag of Italy.svg', + 'MK' = 'Flag of Macedonia.svg', + 'MX' = 'Flag of Mexico.svg', + 'RU' = 'Flag of Russia.svg', + 'UK' = 'Flag of the United Kingdom.svg', + 'DE' = 'Flag of Germany.svg', ), 'fallbackFlag' = 'Nuvola unknown flag.svg', 'courseDescPage' = 'Course description', ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114150] trunk/extensions/MobileFrontend/stylesheets/beta_common.css
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114150 Revision: 114150 Author: jdlrobson Date: 2012-03-19 16:32:12 + (Mon, 19 Mar 2012) Log Message: --- make references line up with content_wrapper thanks heatherw for pointing this out Modified Paths: -- trunk/extensions/MobileFrontend/stylesheets/beta_common.css Modified: trunk/extensions/MobileFrontend/stylesheets/beta_common.css === --- trunk/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-19 16:29:13 UTC (rev 114149) +++ trunk/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-19 16:32:12 UTC (rev 114150) @@ -854,7 +854,7 @@ left: 0; right: 0; background-color: #E4E4E4; - padding: 22px 34px; + padding: 22px; -webkit-box-shadow: 0px -20px 10px -16px #aaa; -moz-box-shadow: 0px -20px 10px -16px #aaa; -o-box-shadow: 0px -20px 10px -16px #aaa; @@ -866,8 +866,8 @@ #mf-references button { top: 22px; - right: 16px; /* padding of mf-references - width 18 */ - width: 18px; + right: 22px; /* padding of #content_wrapper */ + width: 16px; height: 12px; background: url(images/close-button-beta.png) no-repeat scroll 0 0 transparent; margin: 0; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114151] trunk/extensions/CentralAuth/CentralAuth.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114151 Revision: 114151 Author: ialex Date: 2012-03-19 16:40:00 + (Mon, 19 Mar 2012) Log Message: --- * (bug 34980) [Regression] IRC action text should never contain HTML for title Regression from r106782: extensions using $wgLogActionsHandlers need to check $skin and not make a HTML link if that parameter is not an object Modified Paths: -- trunk/extensions/CentralAuth/CentralAuth.php Modified: trunk/extensions/CentralAuth/CentralAuth.php === --- trunk/extensions/CentralAuth/CentralAuth.php2012-03-19 16:32:12 UTC (rev 114150) +++ trunk/extensions/CentralAuth/CentralAuth.php2012-03-19 16:40:00 UTC (rev 114151) @@ -311,7 +311,11 @@ * @return String */ function efHandleWikiSetLogEntry( $type, $action, $title, $skin, $params, $filterWikilinks = false ) { - $link = Linker::makeLinkObj( $title, htmlspecialchars( $params[0] ) ); + if ( $skin ) { + $link = Linker::makeLinkObj( $title, htmlspecialchars( $params[0] ) ); + } else { + $link = $params[0]; + } switch( $action ) { case 'newset': ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114152] trunk/extensions/MobileFrontend/javascripts/references.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114152 Revision: 114152 Author: jdlrobson Date: 2012-03-19 16:40:54 + (Mon, 19 Mar 2012) Log Message: --- track last link if I click [1] to open reference [1] and then click [2] to open up reference [2] this shouldn't create a toggle follow up to r114134 Modified Paths: -- trunk/extensions/MobileFrontend/javascripts/references.js Modified: trunk/extensions/MobileFrontend/javascripts/references.js === --- trunk/extensions/MobileFrontend/javascripts/references.js 2012-03-19 16:40:00 UTC (rev 114151) +++ trunk/extensions/MobileFrontend/javascripts/references.js 2012-03-19 16:40:54 UTC (rev 114152) @@ -33,7 +33,7 @@ $( 'div id=mf-referencesdiv/div/div' ).hide().appendTo( document.body ); var close = function() { $( '#mf-references' ).fadeOut( options.animationSpeed ); - }; + }, lastLink; $( 'buttonclose/button' ).click( close ).appendTo( '#mf-references' ); $( '.mw-cite-backlink a' ).click( close ); @@ -43,7 +43,8 @@ data = href href.charAt(0) === '#' ? references[ href.substr( 1, href.length ) ] : null; - if( !$(#mf-references).is(:visible) ) { + if( !$(#mf-references).is(:visible) || lastLink !== href) { + lastLink = href; if( data ) { html = 'h3[' + data.label + ']/h3' + data.html; } else { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114153] trunk/extensions/SemanticTitle/SemanticTitle.class.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114153 Revision: 114153 Author: van-de-bugger Date: 2012-03-19 16:50:33 + (Mon, 19 Mar 2012) Log Message: --- Follow-up to r114069: spce indentation fixed to tab. Modified Paths: -- trunk/extensions/SemanticTitle/SemanticTitle.class.php Modified: trunk/extensions/SemanticTitle/SemanticTitle.class.php === --- trunk/extensions/SemanticTitle/SemanticTitle.class.php 2012-03-19 16:40:54 UTC (rev 114152) +++ trunk/extensions/SemanticTitle/SemanticTitle.class.php 2012-03-19 16:50:33 UTC (rev 114153) @@ -144,7 +144,7 @@ if ( ! isset( $egSemanticTitle[ $ns ] ) ) { return true; }; // if -$name = $egSemanticTitle[ $ns ]; + $name = $egSemanticTitle[ $ns ]; $props = $data-getProperties(); if ( ! isset( $props[ $name ] ) ) { return true; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114154] trunk/phase3/includes/specials/SpecialPreferences.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114154 Revision: 114154 Author: ialex Date: 2012-03-19 17:09:23 + (Mon, 19 Mar 2012) Log Message: --- * Use local context to get message * Use $this-getTitle() instead of SpecialPage::getTitleFor( 'Preferences' ) Modified Paths: -- trunk/phase3/includes/specials/SpecialPreferences.php Modified: trunk/phase3/includes/specials/SpecialPreferences.php === --- trunk/phase3/includes/specials/SpecialPreferences.php 2012-03-19 16:50:33 UTC (rev 114153) +++ trunk/phase3/includes/specials/SpecialPreferences.php 2012-03-19 17:09:23 UTC (rev 114154) @@ -69,7 +69,7 @@ $htmlForm = new HTMLForm( array(), $this-getContext(), 'prefs-restore' ); - $htmlForm-setSubmitText( wfMsg( 'restoreprefs' ) ); + $htmlForm-setSubmitTextMsg( 'restoreprefs' ); $htmlForm-setTitle( $this-getTitle( 'reset' ) ); $htmlForm-setSubmitCallback( array( $this, 'submitReset' ) ); $htmlForm-suppressReset(); @@ -82,7 +82,7 @@ $user-resetOptions(); $user-saveSettings(); - $url = SpecialPage::getTitleFor( 'Preferences' )-getFullURL( 'success' ); + $url = $this-getTitle()-getFullURL( 'success' ); $this-getOutput()-redirect( $url ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114155] branches/Wikidata/phase3/includes
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114155 Revision: 114155 Author: daniel Date: 2012-03-19 17:10:15 + (Mon, 19 Mar 2012) Log Message: --- messing with replaceSection() Modified Paths: -- branches/Wikidata/phase3/includes/Content.php branches/Wikidata/phase3/includes/ContentHandler.php branches/Wikidata/phase3/includes/EditPage.php branches/Wikidata/phase3/includes/WikiPage.php Modified: branches/Wikidata/phase3/includes/Content.php === --- branches/Wikidata/phase3/includes/Content.php 2012-03-19 17:09:23 UTC (rev 114154) +++ branches/Wikidata/phase3/includes/Content.php 2012-03-19 17:10:15 UTC (rev 114155) @@ -2,47 +2,33 @@ /** * A content object represents page content, e.g. the text to show on a page. + * Content objects have no knowledge about how they relate to Wiki pages. + * Content objects are imutable. * */ abstract class Content { -public function __construct( Title $title = null, $revId = null, $modelName = null ) { #FIXME: really need revId? annoying! #FIXME: really $title? or just when parsing, every time? +public function __construct( $modelName = null ) { #FIXME: really need revId? annoying! #FIXME: really $title? or just when parsing, every time? $this-mModelName = $modelName; -$this-mTitle = $title; -$this-mRevId = $revId; } public function getModelName() { return $this-mModelName; } -public function getTitle() { -return $this-mTitle; -} +public abstract function getSearchText( ); -public function getRevId() { -return $this-mRevId; -} +public abstract function getWikitextForTransclusion( ); -public abstract function getSearchText( $obj ); - -public abstract function getWikitextForTransclusion( $obj ); - -public abstract function getParserOutput( ParserOptions $options = NULL ); - +/** + * Returns native represenation of the data. Interpretation depends on the data model used, + * as given by getDataModel(). + * + */ public abstract function getRawData( ); -public function getHtml( ParserOptions $options ) { -$po = $this-getParserOutput( $options ); -return $po-getText(); -} +public abstract function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = NULL ); -public function getIndexUpdateJobs( ParserOptions $options , $recursive = true ) { -$po = $this-getParserOutput( $options ); -$update = new LinksUpdate( $this-mTitle, $po, $recursive ); -return $update; -} - public function getRedirectChain() { return null; } @@ -60,20 +46,20 @@ } /** - * Replaces the section with the given id. + * Replaces a section of the content. * - * The default implementation returns $this. - * - * @param String $sectionId the section's id - * @param Content $with the section's new content - * @return Content a new content object with the section replaced, or this content object if the section couldn't be replaced. + * @param $section empty/null/false or a section number (0, 1, 2, T1, T2...), or new + * @param $with Content: new content of the section + * @param $sectionTitle String: new section's subject, only if $section is 'new' + * @return string Complete article text, or null if error */ -public function replaceSection( $sectionId ) { +public function replaceSection( $section, Content $with, $sectionTitle = '' ) { +return $this; } -#XXX: is the native model for wikitext a string or the parser output? parse early or parse late? +#TODO: implement specialized ParserOutput for Wikidata model +#TODO: provide addToParserOutput fule Multipart... somehow. - # TODO: EditPage::mergeChanges( Content $a, Content $b ) # TODO: Wikipage::isCountable(Content $a) # TODO: Title::newFromRedirectRecurse( $this-getRawText() ); @@ -82,7 +68,6 @@ # TODO: getSize( ) # TODO: WikiPage::getUndoText( Revision $undo, Revision $undoafter = null ) -# TODO: WikiPage::replaceSection( $section, $text, $sectionTitle = '', $edittime = null ) # TODO: WikiPage::getAutosummary( $oldtext, $text, $flags ) # TODO: EditPage::getPreloadedText( $preload ) // $wgParser-getPreloadText @@ -94,23 +79,50 @@ } -class TextContent extends Content { -public function __construct( $text, Title $title = null, $revId = null, $modelName = null ) { -parent::__construct($title, $revId, $modelName); +/** + * Content object implementation for representing flat text. The + */ +abstract class TextContent extends Content { +public function __construct( $text, $modelName = null ) { +parent::__construct($modelName); $this-mText = $text; } -public function
[MediaWiki-CVS] SVN: [114156] trunk/extensions/AntiSpoof
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114156 Revision: 114156 Author: van-de-bugger Date: 2012-03-19 17:15:33 + (Mon, 19 Mar 2012) Log Message: --- Fix for bug 12500, almost reviewed there. Modified Paths: -- trunk/extensions/AntiSpoof/AntiSpoof.i18n.php trunk/extensions/AntiSpoof/AntiSpoof_body.php Modified: trunk/extensions/AntiSpoof/AntiSpoof.i18n.php === --- trunk/extensions/AntiSpoof/AntiSpoof.i18n.php 2012-03-19 17:10:15 UTC (rev 114155) +++ trunk/extensions/AntiSpoof/AntiSpoof.i18n.php 2012-03-19 17:15:33 UTC (rev 114156) @@ -15,11 +15,14 @@ 'antispoof-conflict-bottom' = 'Please choose another name.', 'antispoof-name-illegal' = 'The name $1 is not allowed to prevent confusing or spoofed usernames: $2. Please choose another name.', + 'antispoof-bad-char' = '$1 ($2)', + 'antispoof-bad-char-non-printable' = '$1', 'antispoof-badtype' = 'Bad data type', 'antispoof-empty' = 'Empty string', - 'antispoof-blacklisted' = 'Contains blacklisted character', - 'antispoof-combining' = 'Begins with combining mark', - 'antispoof-unassigned'= 'Contains unassigned or deprecated character', + 'antispoof-blacklisted' = 'Contains blacklisted character $1', + 'antispoof-combining' = 'Begins with combining mark $1', + 'antispoof-unassigned'= 'Contains unassigned character $1', + 'antispoof-deprecated'= 'Contains deprecated character $1', 'antispoof-noletters' = 'Does not contain any letters', 'antispoof-mixedscripts' = 'Contains incompatible mixed scripts', 'antispoof-tooshort' = 'Canonicalized name too short', @@ -43,11 +46,21 @@ 'antispoof-name-illegal' = 'Account creation error message because a user account creation rule was violated. Parameters: * $1 is the username that someone wanted to create * $2 is the error message. One of {{msg-mw|antispoof-badtype}}, {{msg-mw|antispoof-empty}}, {{msg-mw|antispoof-blacklisted}} and others.', + 'antispoof-bad-char' = 'It is not a complete message but a template for designator of a bad character, so localization can format it properly. Parameters: +* $1 is the bad character itself. +* $2 is the Unicode code point of bad character (U+ followed by hex number).', + 'antispoof-bad-char-non-printable' = 'The same as antispooof-bad-char, but for non-printable characters. Since non-printable characters do not have visual representation, template has only one parameter: +* $1 is the Unicode code point of bad character (U+ followed by hex number).', 'antispoof-badtype' = 'Reason for failed account creation.', 'antispoof-empty' = 'Reason for failed account creation.', - 'antispoof-blacklisted' = 'Reason for failed account creation.', - 'antispoof-combining' = 'Reason for failed account creation.', - 'antispoof-unassigned' = 'Reason for failed account creation.', + 'antispoof-blacklisted' = 'Reason for failed account creation. Parameters: +* $1 — bad character designator (built with either antispoof-bad-char or …-non-printable).', + 'antispoof-combining' = 'Reason for failed account creation. Parameters: +* $1 — bad character designator (built with either antispoof-bad-char or …-non-printable).', + 'antispoof-unassigned' = 'Reason for failed account creation. Parameters: +* $1 — bad character designator (built with either antispoof-bad-char or …-non-printable).', + 'antispoof-deprecated' = 'Reason for failed account creation. Parameters: +* $1 — bad character designator (built with either antispoof-bad-char or …-non-printable).', 'antispoof-noletters' = 'Reason for failed account creation.', 'antispoof-mixedscripts' = 'Reason for failed account creation.', 'antispoof-tooshort' = 'Reason for failed account creation.', Modified: trunk/extensions/AntiSpoof/AntiSpoof_body.php === --- trunk/extensions/AntiSpoof/AntiSpoof_body.php 2012-03-19 17:10:15 UTC (rev 114155) +++ trunk/extensions/AntiSpoof/AntiSpoof_body.php 2012-03-19 17:15:33 UTC (rev 114156) @@ -306,6 +306,29 @@ return $out; } + /* +* Helper function for checkUnicodeString: Return an error on a bad character. +* TODO: I would like to show Unicode character name, but it is not clear how to get it. +* @param $msgId -- string, message identifier. +* @param $point -- number, codepoint of the bad character. +* @return Formatted error message. +*/ + private static function badCharErr( $msgId, $point ) { + $symbol = codepointToUtf8( $point ); + // Combining marks are combined with the previous character. If abusing character is a
[MediaWiki-CVS] SVN: [114157] trunk/extensions/MobileFrontend/javascripts/references.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114157 Revision: 114157 Author: jdlrobson Date: 2012-03-19 17:17:17 + (Mon, 19 Mar 2012) Log Message: --- provide different animations for references provide a slide animation as well as one with no animation also clear the lastLink as otherwise a 3rd click on a link will not re-reveal it Modified Paths: -- trunk/extensions/MobileFrontend/javascripts/references.js Modified: trunk/extensions/MobileFrontend/javascripts/references.js === --- trunk/extensions/MobileFrontend/javascripts/references.js 2012-03-19 17:15:33 UTC (rev 114156) +++ trunk/extensions/MobileFrontend/javascripts/references.js 2012-03-19 17:17:17 UTC (rev 114157) @@ -4,6 +4,8 @@ hashtest = window.location.hash.substr(1).match(/refspeed:([0-9]*)/); options.animationSpeed = hashtest ? parseInt( hashtest[1], 10 ) : 500; + hashtest = window.location.hash.substr(1).match(/refanimation:([a-z]*)/); + options.animation = hashtest ? hashtest[1] : null; function collect() { var references = {}; @@ -32,13 +34,23 @@ function init() { $( 'div id=mf-referencesdiv/div/div' ).hide().appendTo( document.body ); var close = function() { - $( '#mf-references' ).fadeOut( options.animationSpeed ); + var top; + lastLink = null; + if( options.animation === 'none' ) { + $( '#mf-references' ).hide(); + } else if( options.animation === 'slide' ){ + top = window.innerHeight + window.pageYOffset; + $( '#mf-references' ).show().animate( { top: top }, options.animationSpeed ); + } else { + $( '#mf-references' ).fadeOut( options.animationSpeed ); + } }, lastLink; $( 'buttonclose/button' ).click( close ).appendTo( '#mf-references' ); $( '.mw-cite-backlink a' ).click( close ); var data, html, href, references = collect(); $( 'sup a' ).click( function(ev) { + var top, oh; href = $(this).attr( 'href' ); data = href href.charAt(0) === '#' ? references[ href.substr( 1, href.length ) ] : null; @@ -52,11 +64,20 @@ attr( 'href', href ).appendTo('div /').parent().html(); } $( '#mf-references div' ).html( html ); - $( '#mf-references' ).fadeIn( options.animationSpeed ); + calculatePosition(); + if( options.animation === 'none' ) { + $( '#mf-references' ).show(); + } else if( options.animation === 'slide' ){ + top = window.innerHeight + window.pageYOffset; + oh = $( '#mf-references' ).outerHeight(); + $( '#mf-references' ).show().css( { 'top': top } ). + animate( { top: top - oh }, options.animationSpeed ); + } else { + $( '#mf-references' ).fadeIn( options.animationSpeed ); + } } else { close(); } - calculatePosition(); ev.preventDefault(); }); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114158] trunk/extensions/EducationProgram
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114158 Revision: 114158 Author: jeroendedauw Date: 2012-03-19 17:27:46 + (Mon, 19 Mar 2012) Log Message: --- added schema docs Added Paths: --- trunk/extensions/EducationProgram/docs/ trunk/extensions/EducationProgram/docs/schema.txt Added: trunk/extensions/EducationProgram/docs/schema.txt === --- trunk/extensions/EducationProgram/docs/schema.txt (rev 0) +++ trunk/extensions/EducationProgram/docs/schema.txt 2012-03-19 17:27:46 UTC (rev 114158) @@ -0,0 +1,72 @@ +This page describes the database schema used by the Education Program extension +from a high level perspective. Documentation on individual fields can be found +in the schema file at sql/EducationProgram.sql. + +An online version of this document can be found at +https://www.mediawiki.org/wiki/Extension:Education_Program/schema + +== Relational, denormalized and revision storage == + +The extension keeps up to 3 copies of the same data, each optimized +for a particular purpose. + +* Relational storage is the data in it's canonical form. All other copies of the + data are computed from this. This data can be found in some of the fields of + the main tables. + +* Denormalized storage is the data in a format optimized for doing queries against. + It is always computed from the relational storage data. This data can be found + in some of the fields of the main tables. + +* Revision storage is the ep_revisions table which contains blobs with the + relational data for one particular object. + +The extension uses the DBDataObject and DBTable classes for virtually all +it's database interaction. These have mechanisms for distinguishing between +relational and denormalized data (referred to as summary data in their docs). +All revisioning work is done through EPRevision and EPRevisions using EPRevisionedObject. + +== Where to find the stuff == + +=== Institutions === + +Institutions are stored in the ep_orgs table. You can get the linked courses +via the org_courses field, which is an array with course IDs and is a denormalized field. + +=== Courses === + +Courses are stored in ep_courses. They are linked to their institution via +the course_org_id field, which is a foreign key on ep_orgs.org_id. + +You can find linked users (students, instructors, ambassadors) via the +ep_users_per_course table. This table contains the users id, the course id +and an integer indicating the role the user has. + +=== Articles === + +Students can associate themselves with articles they are working on. +These are stored in the ep_articles table. It contains a course id, +a user id and a page id (foreign key on page.page_id), which can be +used to get all articles worked on by a course, a student, or a +combination of both. + +=== Students === + +Students are stored in the ep_students table. The students table +can be through of as an extension to the user table. It has +a user_id field, which is a foreign id on user.user_id and +several other fields with student data. This is mostly denormalized +data though, so this tables primary use is getting lists of +students (or linked data) in a computational sane fashion. + +=== Ambassadors and instructors === + +Like students, each of these roles have their own tables, +which can be thought of as extensions to the user table: + +* ep_instructors +* ep_oas (Online Ambassdaors) +* ep_cas (Campus Ambassdaors) + +The ambassador tables contain ambassador profile info. +The instructor table is currently not used. ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114159] branches/Wikidata/phase3/includes
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114159 Revision: 114159 Author: daniel Date: 2012-03-19 17:49:00 + (Mon, 19 Mar 2012) Log Message: --- messing with wfMerge Modified Paths: -- branches/Wikidata/phase3/includes/ContentHandler.php branches/Wikidata/phase3/includes/EditPage.php Modified: branches/Wikidata/phase3/includes/ContentHandler.php === --- branches/Wikidata/phase3/includes/ContentHandler.php2012-03-19 17:27:46 UTC (rev 114158) +++ branches/Wikidata/phase3/includes/ContentHandler.php2012-03-19 17:49:00 UTC (rev 114159) @@ -201,8 +201,23 @@ return $de; } -#XXX: is the native model for wikitext a string or the parser output? parse early or parse late? +/** + * attempts to merge differences between three versions. + * Returns a new Content object for a clean merge and false for failure or a conflict. + * + * This default implementation always returns false. + * + * @param $oldContent String + * @param $myContent String + * @param $yourContent String + * @return Content|Bool + */ +public function merge3( Content $oldContent, Content $myContent, Content $yourContent ) { +return false; +} +#TODO: cover patch/undo just like merge3. + #TODO: how to handle extra message for JS/CSS previews?? #TODO: Article::showCssOrJsPage --- specialized classes! @@ -221,6 +236,34 @@ return $content-getRawData(); } +/** + * attempts to merge differences between three versions. + * Returns a new Content object for a clean merge and false for failure or a conflict. + * + * This text-based implementation uses wfMerge(). + * + * @param $oldContent String + * @param $myContent String + * @param $yourContent String + * @return Content|Bool + */ +public function merge3( Content $oldContent, Content $myContent, Content $yourContent ) { +$format = $this-getDefaultFormat(); + +$old = $this-serialize( $oldContent, $format ); +$mine = $this-serialize( $myContent, $format ); +$yours = $this-serialize( $yourContent, $format ); + +$ok = wfMerge( $old, $mine, $yours, $result ); + +if ( !$ok ) return false; +if ( !$result ) return $this-emptyContent(); + +$mergedContent = $this-unserialize( $result, $format ); +return $mergedContent; +} + + } class WikitextContentHandler extends TextContentHandler { Modified: branches/Wikidata/phase3/includes/EditPage.php === --- branches/Wikidata/phase3/includes/EditPage.php 2012-03-19 17:27:46 UTC (rev 114158) +++ branches/Wikidata/phase3/includes/EditPage.php 2012-03-19 17:49:00 UTC (rev 114159) @@ -1312,7 +1312,7 @@ $text = $this-textbox1; // do not try to merge here! } elseif ( $this-isConflict ) { # Attempt merge - if ( $this-mergeChangesInto( $text ) ) { #FIXME: use ContentHandler + if ( $this-mergeChangesInto( $text ) ) { #FIXME: passe/receive Content object // Successful merge! Maybe we should tell the user the good news? $this-isConflict = false; wfDebug( __METHOD__ . : Suppressing edit conflict, successful merge.\n ); @@ -1515,7 +1515,7 @@ wfProfileOut( __METHOD__ ); return false; } - $baseText = $baseRevision-getText(); + $baseContent = $baseRevision-getContent(); // The current state, we want to merge updates into it $currentRevision = Revision::loadFromTitle( $db, $this-mTitle ); @@ -1523,11 +1523,14 @@ wfProfileOut( __METHOD__ ); return false; } - $currentText = $currentRevision-getText(); + $currentContent = $currentRevision-getContent(); - $result = ''; - if ( wfMerge( $baseText, $editText, $currentText, $result ) ) { - $editText = $result; +$handler = ContentHandler::getForModelName( $baseContent-getModelName() ); +$editContent = $handler-unserialize( $editText ); #FIXME: supply serialization fomrat from edit form! + + $result = $handler-merge3( $baseContent, $editContent, $currentContent ); + if ( $result ) { + $editText = ContentHandler::getContentText($result); #FIXME: supply serialization fomrat from edit form! wfProfileOut( __METHOD__ ); return true; } else {
[MediaWiki-CVS] SVN: [114160] branches/wmf/1.19wmf1
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114160 Revision: 114160 Author: nikerabbit Date: 2012-03-19 18:09:40 + (Mon, 19 Mar 2012) Log Message: --- 1.19wmf1 MFT r113910 r113782 Modified Paths: -- branches/wmf/1.19wmf1/extensions/WebFonts/resources/ext.webfonts.fontlist.js branches/wmf/1.19wmf1/includes/Linker.php branches/wmf/1.19wmf1/tests/parser/parserTests.txt Property Changed: branches/wmf/1.19wmf1/includes/Linker.php Modified: branches/wmf/1.19wmf1/extensions/WebFonts/resources/ext.webfonts.fontlist.js === --- branches/wmf/1.19wmf1/extensions/WebFonts/resources/ext.webfonts.fontlist.js 2012-03-19 17:49:00 UTC (rev 114159) +++ branches/wmf/1.19wmf1/extensions/WebFonts/resources/ext.webfonts.fontlist.js 2012-03-19 18:09:40 UTC (rev 114160) @@ -388,7 +388,7 @@ ttf: Xsux/Akkadian.ttf, woff: Xsux/Akkadian.woff, version: 2.56 - }, + } /* Hapax Berbère: { eot: Tfng/hapaxber.eot, @@ -442,7 +442,7 @@ ta: [ Lohit Tamil, Thendral, Thenee ], tcy: [ Lohit Kannada, Kedage ], te: [ Lohit Telugu, Pothana2000, Vemana2000 ], - ti: [ AbyssinicaSIL ], + ti: [ AbyssinicaSIL ] // tmh: [ Hapax Berbère ], // tzm: [ Hapax Berbère ] } Modified: branches/wmf/1.19wmf1/includes/Linker.php === --- branches/wmf/1.19wmf1/includes/Linker.php 2012-03-19 17:49:00 UTC (rev 114159) +++ branches/wmf/1.19wmf1/includes/Linker.php 2012-03-19 18:09:40 UTC (rev 114160) @@ -1182,7 +1182,7 @@ } if ( $pre ) { # written summary $presep autocomment (summary /* section */) - $auto = wfMsgExt( 'autocomment-prefix', array( 'escapenoentities', 'content' ) ) . $auto; + $pre .= wfMsgExt( 'autocomment-prefix', array( 'escapenoentities', 'content' ) ); } if ( $post ) { # autocomment $postsep written summary (/* section */ summary) Property changes on: branches/wmf/1.19wmf1/includes/Linker.php ___ Modified: svn:mergeinfo - /branches/JSTesting/includes/Linker.php:100352-107913 /branches/REL1_15/phase3/includes/Linker.php:51646 /branches/new-installer/phase3/includes/Linker.php:43664-66004 /branches/sqlite/includes/Linker.php:58211-58321 /branches/wmf/1.18wmf1/includes/Linker.php:97508,111667 /branches/wmf-deployment/includes/Linker.php:53381 /trunk/phase3/includes/Linker.php:111029,111034,111067,111085,28,44,111251,111397,111571,111574,111597,111673,111695,111697,111750,111798 + /branches/JSTesting/includes/Linker.php:100352-107913 /branches/REL1_15/phase3/includes/Linker.php:51646 /branches/new-installer/phase3/includes/Linker.php:43664-66004 /branches/sqlite/includes/Linker.php:58211-58321 /branches/wmf/1.18wmf1/includes/Linker.php:97508,111667 /branches/wmf-deployment/includes/Linker.php:53381 /trunk/phase3/includes/Linker.php:111029,111034,111067,111085,28,44,111251,111397,111571,111574,111597,111673,111695,111697,111750,111798,113782 Modified: branches/wmf/1.19wmf1/tests/parser/parserTests.txt === --- branches/wmf/1.19wmf1/tests/parser/parserTests.txt 2012-03-19 17:49:00 UTC (rev 114159) +++ branches/wmf/1.19wmf1/tests/parser/parserTests.txt 2012-03-19 18:09:40 UTC (rev 114160) @@ -8483,6 +8483,16 @@ !!end !! test +Edit comment with section link and text before it (non-local, eg in history list) +!! options +comment title=[[Main Page]] +!! input +pre-comment text /* External links */ removed bogus entries +!! result +pre-comment text - a href=/wiki/Main_Page#External_links title=Main Page→/aspan dir=autospan class=autocommentExternal links: /span removed bogus entries/span +!!end + +!! test Edit comment with section link (local, eg in diff view) !! options comment local title=[[Main Page]] ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114161] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114161 Revision: 114161 Author: maxsem Date: 2012-03-19 18:17:29 + (Mon, 19 Mar 2012) Log Message: --- Follow-up r114129: * Fixed leftoffs from excerpts -- extracts rename * ...including broken OpenSearchXml hook handler * Split exlength to exchars and exsentences for better control over stuff being returned Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.php trunk/extensions/MobileFrontend/api/ApiQueryExtracts.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.php === --- trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 18:09:40 UTC (rev 114160) +++ trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 18:17:29 UTC (rev 114161) @@ -132,7 +132,7 @@ $wgHooks['APIAfterExecute'][] = 'ApiParseExtender::onAPIAfterExecute'; $wgHooks['APIGetParamDescription'][] = 'ApiParseExtender::onAPIGetParamDescription'; $wgHooks['APIGetDescription'][] = 'ApiParseExtender::onAPIGetDescription'; -$wgHooks['OpenSearchXml'][] = 'ApiQueryExcerpts::onOpenSearchXml'; +$wgHooks['OpenSearchXml'][] = 'ApiQueryExtracts::onOpenSearchXml'; function efMobileFrontend_Setup() { global $wgExtMobileFrontend, $wgHooks; @@ -174,6 +174,6 @@ } /** - * Whether this extension should provide its excerpts to OpenSearchXml extension + * Whether this extension should provide its extracts to OpenSearchXml extension */ $wgMFExtendOpenSearchXml = false; Modified: trunk/extensions/MobileFrontend/api/ApiQueryExtracts.php === --- trunk/extensions/MobileFrontend/api/ApiQueryExtracts.php2012-03-19 18:09:40 UTC (rev 114160) +++ trunk/extensions/MobileFrontend/api/ApiQueryExtracts.php2012-03-19 18:17:29 UTC (rev 114161) @@ -21,9 +21,10 @@ wfProfileOut( __METHOD__ ); return; } - $isXml = $this-getMain()-getPrinter()-getFormat() == 'XML'; + $isXml = $this-getMain()-isInternalMode() || $this-getMain()-getPrinter()-getFormat() == 'XML'; $result = $this-getResult(); $params = $this-params = $this-extractRequestParams(); + $this-requireMaxOneParameter( $params, 'chars', 'sentences' ); $continue = 0; $limit = intval( $params['limit'] ); if ( $limit 1 !$params['intro'] ) { @@ -45,9 +46,8 @@ break; } $text = $this-getExtract( $t ); - if ( isset( $params['length'] ) ) { - $text = $this-trimText( $text ); - } + $text = $this-truncate( $text ); + if ( $isXml ) { $fit = $result-addValue( array( 'query', 'pages', $id ), 'extract', array( '*' = $text ) ); } else { @@ -74,7 +74,7 @@ $api = new ApiMain( new FauxRequest( array( 'action' = 'query', - 'prop' = 'excerpts', + 'prop' = 'extracts', 'explaintext' = true, 'exlimit' = count( $results ), 'pageids' = implode( '|', $pageIds ), @@ -83,8 +83,8 @@ $api-execute(); $data = $api-getResultData(); foreach ( $pageIds as $id ) { - if ( isset( $data['query']['pages'][$id]['excerpts'][0] ) ) { - $results[$id]['extract'] = $data['query']['pages'][$id]['extract'][0]; + if ( isset( $data['query']['pages'][$id]['extract']['*'] ) ) { + $results[$id]['extract'] = $data['query']['pages'][$id]['extract']['*']; $results[$id]['extract trimmed'] = false; } } @@ -92,7 +92,7 @@ } /** -* Returns a processed, but not trimmed excerpt +* Returns a processed, but not trimmed extract * @param Title $title * @return string */ @@ -188,10 +188,8 @@ } /** -* Converts page HTML into an excerpt +* Converts page HTML into an extract * @param string $text -* @param Title $title -* @param bool $plainText * @return string */ private function convertText( $text ) { @@ -203,16 +201,22 @@ return trim( $text ); } + private function truncate( $text ) { + if ( $this-params['chars'] ) { + return $this-getFirstChars( $text, $this-params['chars'] ); + }
[MediaWiki-CVS] SVN: [114162] trunk/phase3
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114162 Revision: 114162 Author: aaron Date: 2012-03-19 18:28:47 + (Mon, 19 Mar 2012) Log Message: --- Reverted r113688, r113691 per CR and filed #61440 upstream. Modified Paths: -- trunk/phase3/includes/GlobalFunctions.php trunk/phase3/tests/phpunit/includes/GlobalFunctions/GlobalTest.php Modified: trunk/phase3/includes/GlobalFunctions.php === --- trunk/phase3/includes/GlobalFunctions.php 2012-03-19 18:17:29 UTC (rev 114161) +++ trunk/phase3/includes/GlobalFunctions.php 2012-03-19 18:28:47 UTC (rev 114162) @@ -2929,8 +2929,8 @@ $cmd[] = $options['wrapper']; } $cmd[] = $script; - // Build up the full command, shell escaping each parameter - return implode( ' ', array_merge( $cmd, array_map( 'wfEscapeShellArg', $parameters ) ) ); + // Escape each parameter for shell + return implode( , array_map( 'wfEscapeShellArg', array_merge( $cmd, $parameters ) ) ); } /** Modified: trunk/phase3/tests/phpunit/includes/GlobalFunctions/GlobalTest.php === --- trunk/phase3/tests/phpunit/includes/GlobalFunctions/GlobalTest.php 2012-03-19 18:17:29 UTC (rev 114161) +++ trunk/phase3/tests/phpunit/includes/GlobalFunctions/GlobalTest.php 2012-03-19 18:28:47 UTC (rev 114162) @@ -600,16 +600,16 @@ global $wgPhpCli; return array( array( 'eval.php', array( '--help', '--test' ), array(), - $wgPhpCli eval.php '--help' '--test', + '$wgPhpCli' 'eval.php' '--help' '--test', Called eval.php --help --test ), array( 'eval.php', array( '--help', '--test space' ), array('php' = 'php5'), - php5 eval.php '--help' '--test space', + 'php5' 'eval.php' '--help' '--test space', Called eval.php --help --test with php option ), array( 'eval.php', array( '--help', '--test', 'X' ), array('wrapper' = 'MWScript.php'), - $wgPhpCli MWScript.php eval.php '--help' '--test' 'X', + '$wgPhpCli' 'MWScript.php' 'eval.php' '--help' '--test' 'X', Called eval.php --help --test with wrapper option ), array( 'eval.php', array( '--help', '--test', 'y' ), array('php' = 'php5', 'wrapper' = 'MWScript.php'), - php5 MWScript.php eval.php '--help' '--test' 'y', + 'php5' 'MWScript.php' 'eval.php' '--help' '--test' 'y', Called eval.php --help --test with wrapper and php option ), ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114163] trunk/extensions/EducationProgram
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114163 Revision: 114163 Author: jeroendedauw Date: 2012-03-19 18:40:22 + (Mon, 19 Mar 2012) Log Message: --- work on caching of special:institutions Modified Paths: -- trunk/extensions/EducationProgram/compat/SpecialCachedPage.php trunk/extensions/EducationProgram/includes/EPOrg.php trunk/extensions/EducationProgram/specials/SpecialEPPage.php trunk/extensions/EducationProgram/specials/SpecialEducationProgram.php trunk/extensions/EducationProgram/specials/SpecialInstitutions.php trunk/extensions/EducationProgram/specials/SpecialStudentActivity.php Modified: trunk/extensions/EducationProgram/compat/SpecialCachedPage.php === --- trunk/extensions/EducationProgram/compat/SpecialCachedPage.php 2012-03-19 18:28:47 UTC (rev 114162) +++ trunk/extensions/EducationProgram/compat/SpecialCachedPage.php 2012-03-19 18:40:22 UTC (rev 114163) @@ -2,15 +2,11 @@ /** * Abstract special page class with scaffolding for caching the HTML output. + * This copy is kept for compatibility with MW 1.20. + * As of 1.20, this class can be found at includes/specials/SpecialCachedPage.php * - * To enable the caching functionality, the cacheExpiry field should be set - * in the constructor. + * TODO: uncomment when done w/ dev (double declaration makes PhpStorm mad :) * - * To add HTML that should be cached, use addCachedHTML like this: - * $this-addCachedHTML( array( $this, 'displayCachedContent' ) ); - * - * After adding the last HTML that should be cached, call $this-saveCache(); - * * @since 0.1 * * @file SpecialCachedPage.php @@ -19,241 +15,241 @@ * @licence GNU GPL v3 or later * @author Jeroen De Dauw jeroended...@gmail.com */ -abstract class SpecialCachedPage extends SpecialPage { - - /** -* The time to live for the cache, in seconds or a unix timestamp indicating the point of expiry. -* -* @since 0.1 -* @var integer|null -*/ - protected $cacheExpiry = null; - - /** -* List of HTML chunks to be cached (if !hasCached) or that where cashed (of hasCached). -* If no cached already, then the newly computed chunks are added here, -* if it as cached already, chunks are removed from this list as they are needed. -* -* @since 0.1 -* @var array -*/ - protected $cachedChunks; - - /** -* Indicates if the to be cached content was already cached. -* Null if this information is not available yet. -* -* @since 0.1 -* @var boolean|null -*/ - protected $hasCached = null; - - /** -* Main method. -* -* @since 0.1 -* -* @param string|null $subPage -*/ - public function execute( $subPage ) { - if ( $this-getRequest()-getText( 'action' ) === 'purge' ) { - $this-hasCached = false; - } - - if ( !is_null( $this-cacheExpiry ) ) { - $this-initCaching(); - - if ( $this-hasCached === true ) { - $this-getOutput()-setSubtitle( $this-getCachedNotice( $subPage ) ); - } - } - } - - /** -* Returns a message that notifies the user he/she is looking at -* a cached version of the page, including a refresh link. -* -* @since 0.1 -* -* @param string|null $subPage -* -* @return string -*/ - protected function getCachedNotice( $subPage ) { - $refreshArgs = $this-getRequest()-getQueryValues(); - unset( $refreshArgs['title'] ); - $refreshArgs['action'] = 'purge'; - - $refreshLink = Linker::link( - $this-getTitle( $subPage ), - $this-msg( 'cachedspecial-refresh-now' )-escaped(), - array(), - $refreshArgs - ); - - if ( $this-cacheExpiry 86400 * 3650 ) { - $message = $this-msg( - 'cachedspecial-viewing-cached-ttl', - $this-getDurationText( $this-cacheExpiry ) - )-escaped(); - } - else { - $message = $this-msg( - 'cachedspecial-viewing-cached-ts' - )-escaped(); - } - - return $message . ' ' . $refreshLink; - } - - /** -* Returns a message with the time to live of the cache. -* Takes care of compatibility with MW 1.20, in which Language::formatDuration was introduced. -* -* @since 0.1 -* -* @param integer $seconds
[MediaWiki-CVS] SVN: [114164] trunk/phase3/includes/specials/SpecialCachedPage.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114164 Revision: 114164 Author: jeroendedauw Date: 2012-03-19 18:40:54 + (Mon, 19 Mar 2012) Log Message: --- some refactoring to allow for nicer usage in deriving classes Modified Paths: -- trunk/phase3/includes/specials/SpecialCachedPage.php Modified: trunk/phase3/includes/specials/SpecialCachedPage.php === --- trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 18:40:22 UTC (rev 114163) +++ trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 18:40:54 UTC (rev 114164) @@ -4,11 +4,12 @@ * Abstract special page class with scaffolding for caching the HTML output. * * To enable the caching functionality, the cacheExpiry field should be set - * in the constructor. + * before parent::execute is called (and it should be called from execute). * * To add HTML that should be cached, use addCachedHTML like this: * $this-addCachedHTML( array( $this, 'displayCachedContent' ) ); * + * Before the first addCachedHTML call, you should call $this-startCache(); * After adding the last HTML that should be cached, call $this-saveCache(); * * @since 1.20 @@ -25,9 +26,9 @@ * The time to live for the cache, in seconds or a unix timestamp indicating the point of expiry. * * @since 1.20 -* @var integer|null +* @var integer */ - protected $cacheExpiry = null; + protected $cacheExpiry = 3600; /** * List of HTML chunks to be cached (if !hasCached) or that where cashed (of hasCached). @@ -49,24 +50,46 @@ protected $hasCached = null; /** -* Main method. +* If the cache is enabled or not. * * @since 1.20 +* @var boolean +*/ + protected $cacheEnabled = true; + + /** +* Sets if the cache should be enabled or not. * -* @param string|null $subPage +* @since 1.20 +* @param boolean $cacheEnabled */ - public function execute( $subPage ) { + public function setCacheEnabled( $cacheEnabled ) { + $this-cacheEnabled = $cacheEnabled; + } + + /** +* Initializes the caching. +* Should be called before the first time anything is added via addCachedHTML. +* +* @since 1.20 +* +* @param integer|null $cacheExpiry Sets the cache expirty, either ttl in seconds or unix timestamp. +* @param boolean|null $cacheEnabled Sets if the cache should be enabled or not. +*/ + public function startCache( $cacheExpiry = null, $cacheEnabled = null ) { + if ( !is_null( $cacheExpiry ) ) { + $this-cacheExpiry = $cacheExpiry; + } + + if ( !is_null( $cacheEnabled ) ) { + $this-setCacheEnabled( $cacheEnabled ); + } + if ( $this-getRequest()-getText( 'action' ) === 'purge' ) { $this-hasCached = false; } - if ( !is_null( $this-cacheExpiry ) ) { - $this-initCaching(); - - if ( $this-hasCached === true ) { - $this-getOutput()-setSubtitle( $this-getCachedNotice( $subPage ) ); - } - } + $this-initCaching(); } /** @@ -75,17 +98,15 @@ * * @since 1.20 * -* @param string|null $subPage -* * @return string */ - protected function getCachedNotice( $subPage ) { + protected function getCachedNotice() { $refreshArgs = $this-getRequest()-getQueryValues(); unset( $refreshArgs['title'] ); $refreshArgs['action'] = 'purge'; $refreshLink = Linker::link( - $this-getTitle( $subPage ), + $this-getTitle( $this-getTitle()-getSubpageText() ), $this-msg( 'cachedspecial-refresh-now' )-escaped(), array(), $refreshArgs @@ -114,13 +135,21 @@ */ protected function initCaching() { if ( is_null( $this-hasCached ) ) { - $cachedChunks = wfGetCache( CACHE_ANYTHING )-get( $this-getCacheKey() ); + $cachedChunks = wfGetCache( CACHE_ANYTHING )-get( $this-getCacheKeyString() ); $this-hasCached = is_array( $cachedChunks ); $this-cachedChunks = $this-hasCached ? $cachedChunks : array(); + + $this-onCacheInitialized(); } } + protected function onCacheInitialized() { + if ( $this-hasCached ) { +
[MediaWiki-CVS] SVN: [114165] trunk/extensions/ArticleFeedbackv5
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114165 Revision: 114165 Author: rsterbin Date: 2012-03-19 18:41:29 + (Mon, 19 Mar 2012) Log Message: --- Name the no-link option X rather than -, and keep track of the link ID optionally added to the page (floatingLinkId) Modified Paths: -- trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js Modified: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php === --- trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php 2012-03-19 18:40:54 UTC (rev 114164) +++ trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php 2012-03-19 18:41:29 UTC (rev 114165) @@ -597,7 +597,7 @@ $revId = $title-getLatestRevID(); } - // Find the link ID using the order of the link buckets ('-' = 0, 'A' = 1, + // Find the link ID using the order of the link buckets ('X' = 0, 'A' = 1, // 'B' = 2, etc.) $links = array_flip( array_keys( $wgArticleFeedbackv5LinkBuckets['buckets'] ) ); $linkId = isset( $links[$linkName] ) ? $links[$linkName] : 0; Modified: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js === --- trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js 2012-03-19 18:40:54 UTC (rev 114164) +++ trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js 2012-03-19 18:41:29 UTC (rev 114165) @@ -131,15 +131,24 @@ $.articleFeedbackv5.selectedLinks = []; /** -* The link ID indicates where the user clicked (or not) to get to the -* feedback form. Options are - or A-H +* The floating link ID indicates the trigger link chosen to be added to the +* page, in addition to the toolbox link. Options are X or A-H. * * @see $wgArticleFeedbackv5LinkBuckets * @see http://www.mediawiki.org/wiki/Article_feedback/Version_5/Feature_Requirements#Feedback_links_on_article_pages */ - $.articleFeedbackv5.linkId = '-'; + $.articleFeedbackv5.floatingLinkId = 'X'; /** +* The submitted link ID indicates where the user clicked (or not) to get to +* the feedback form. Options are X or A-H +* +* @see $wgArticleFeedbackv5LinkBuckets +* @see http://www.mediawiki.org/wiki/Article_feedback/Version_5/Feature_Requirements#Feedback_links_on_article_pages +*/ + $.articleFeedbackv5.submittedLinkId = 'X'; + + /** * Use the mediawiki util resource's config method to find the correct url to * call for all ajax requests. */ @@ -2823,13 +2832,13 @@ // 1. Display buckets 0 or 5? Always no link. // 2. Requested in query string (debug only) // 3. Random bucketing - var bucketedLink = '-'; + var bucketedLink = 'X'; if ( '5' != $.articleFeedbackv5.bucketId '0' != $.articleFeedbackv5.bucketId ) { var cfg = mw.config.get( 'wgArticleFeedbackv5LinkBuckets' ); if ( 'buckets' in cfg ) { var knownBuckets = cfg.buckets; var requested = mw.util.getParamValue( 'aftv5_link' ); - if ( $.articleFeedbackv5.inDebug() requested in knownBuckets ) { + if ( $.articleFeedbackv5.inDebug() ( requested in knownBuckets || requested == 'X' ) ) { bucketedLink = requested; } else { bucketedLink = mw.user.bucket( 'ext.articleFeedbackv5-links', cfg ); @@ -2839,7 +2848,8 @@ if ( $.articleFeedbackv5.inDebug() ) { aft5_debug( 'Using link option ' + bucketedLink ); } - if ('-' != bucketedLink) { + $.articleFeedbackv5.floatingLinkId = bucketedLink; + if ('X' != bucketedLink) { $.articleFeedbackv5.selectedLinks.push(bucketedLink); } // Always add the toolbox link @@ -3056,7 +3066,7 @@ params.articleFeedbackv5_ct_token = $.cookie( 'clicktracking-session' ); params.articleFeedbackv5_bucket_id = $.articleFeedbackv5.bucketId; params.articleFeedbackv5_cta_id= $.articleFeedbackv5.ctaId; - params.articleFeedbackv5_link_id = $.articleFeedbackv5.linkId; +
[MediaWiki-CVS] SVN: [114166] trunk/extensions/AJAXPoll
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114166 Revision: 114166 Author: wikinaut Date: 2012-03-19 18:45:57 + (Mon, 19 Mar 2012) Log Message: --- removed the redundant code for handling tracking categories. By using '-' for the message text ajaxpoll-tracking-category , this can be disabled easily. Modified Paths: -- trunk/extensions/AJAXPoll/AJAXPoll.php trunk/extensions/AJAXPoll/AJAXPoll_body.php Modified: trunk/extensions/AJAXPoll/AJAXPoll.php === --- trunk/extensions/AJAXPoll/AJAXPoll.php 2012-03-19 18:41:29 UTC (rev 114165) +++ trunk/extensions/AJAXPoll/AJAXPoll.php 2012-03-19 18:45:57 UTC (rev 114166) @@ -19,7 +19,7 @@ * @author Jack Phoenix j...@countervandalism.net * @author Thomas Gries * @maintainer Thomas Gries - * @version 1.77 + * @version 1.78 * @link http://www.mediawiki.org/wiki/Extension:AJAX_Poll Documentation */ @@ -31,7 +31,7 @@ $wgExtensionCredits['parserhook'][] = array( 'path' = __FILE__, 'name' = 'AJAX Poll', - 'version' = '1.77 20120318', + 'version' = '1.78 20120319', 'author' = array( 'Dariusz Siedlecki', 'Jack Phoenix', 'Thomas Gries' ), 'descriptionmsg' = 'ajaxpoll-desc', 'url' = 'https://www.mediawiki.org/wiki/Extension:AJAX_Poll', @@ -70,16 +70,3 @@ # in your LocalSettings.php after calling the AJAXPoll extension: # $wgGroupPermissions['*']['ajaxpoll-vote'] = false; # $wgGroupPermissions['user']['ajaxpoll-vote'] = true; - -// Parameter to enable the automatic tracking category -// for all pages using this parser extension -// -// Category name [[MediaWiki:Ajaxpoll-tracking-category]] (default) -// $wgAJAXPollTrackingCategory = true; -// -// you can assign a specific category name [[MediaWiki:Ajaxpoll-mycategory]] -// $wgAJAXPollTrackingCategory = 'ajaxpoll-mycategory'; -// -// you can disable the use of a tracking category -// $wgAJAXPollTrackingCategory = false; -$wgAJAXPollTrackingCategory = true; Modified: trunk/extensions/AJAXPoll/AJAXPoll_body.php === --- trunk/extensions/AJAXPoll/AJAXPoll_body.php 2012-03-19 18:41:29 UTC (rev 114165) +++ trunk/extensions/AJAXPoll/AJAXPoll_body.php 2012-03-19 18:45:57 UTC (rev 114166) @@ -30,17 +30,11 @@ # The callback function for converting the input text to HTML output static function AJAXPollRender( $input, $params = array(), Parser $parser ) { - global $wgUser, $wgOut, $wgTitle, $wgScriptPath, $wgUseAjax, - $wgAJAXPollTrackingCategory; + global $wgUser, $wgOut, $wgTitle, $wgScriptPath, $wgUseAjax; $parser-disableCache(); + $parser-addTrackingCategory( 'ajaxpoll-tracking-category' ); - if ( $wgAJAXPollTrackingCategory === true ) { - $parser-addTrackingCategory( 'ajaxpoll-tracking-category' ); - } elseif ( is_string( $wgAJAXPollTrackingCategory ) ) { - $parser-addTrackingCategory( $wgAJAXPollTrackingCategory ); - } - if ( $wgUser-getName() == '' ) { $user = wfGetIP(); } else { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114167] branches
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114167 Revision: 114167 Author: awjrichards Date: 2012-03-19 18:50:32 + (Mon, 19 Mar 2012) Log Message: --- Creating a branch for myself for experimental dev pending git migration Added Paths: --- branches/awjrichards/ branches/awjrichards/extensions/ branches/awjrichards/extensions/MobileFrontend/ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114168] trunk/extensions/RSS
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114168 Revision: 114168 Author: wikinaut Date: 2012-03-19 18:56:58 + (Mon, 19 Mar 2012) Log Message: --- removed the redundant code for handling tracking categories. By using '-' for the message text rss-tracking-category , this can be disabled easily. Modified Paths: -- trunk/extensions/RSS/RSS.php trunk/extensions/RSS/RSSParser.php Modified: trunk/extensions/RSS/RSS.php === --- trunk/extensions/RSS/RSS.php2012-03-19 18:50:32 UTC (rev 114167) +++ trunk/extensions/RSS/RSS.php2012-03-19 18:56:58 UTC (rev 114168) @@ -4,7 +4,7 @@ * * @file * @ingroup Extensions - * @version 2.14 + * @version 2.15 * @author mutante, Daniel Kinzler, Rdb, Mafs, Thomas Gries, Alxndr, Chris Reigrut, K001 * @author Kellan Elliott-McCrea kel...@protest.net -- author of MagpieRSS * @author Jeroen De Dauw @@ -14,7 +14,7 @@ * @link http://www.mediawiki.org/wiki/Extension:RSS Documentation */ -define( EXTENSION_RSS_VERSION, 2.14 20120309 ); +define( EXTENSION_RSS_VERSION, 2.15 20120319 ); if ( !defined( 'MEDIAWIKI' ) ) { die( This is not a valid entry point.\n ); @@ -98,20 +98,3 @@ // You can choose to allow active links in feed items; default: false $wgRSSAllowLinkTag = false; - -// If you want to see images in feed items, then you need to globally allow -// image tags in your wiki by using the MediaWiki parameter; default: false -// $wgAllowImageTag = true; - -// Parameter to enable the automatic tracking category -// for all pages using this parser extension -// -// Category name [[MediaWiki:Rss-tracking-category]] (default) -// $wgRSSTrackingCategory = true; -// -// you can assign a specific category name [[MediaWiki:Rss-mycategory]] -// $wgRSSTrackingCategory = 'rss-mycategory'; -// -// you can disable the use of a tracking category -// $wgRSSTrackingCategory = false; -$wgRSSTrackingCategory = true; Modified: trunk/extensions/RSS/RSSParser.php === --- trunk/extensions/RSS/RSSParser.php 2012-03-19 18:50:32 UTC (rev 114167) +++ trunk/extensions/RSS/RSSParser.php 2012-03-19 18:56:58 UTC (rev 114168) @@ -328,7 +328,6 @@ * @param $frame the frame param to pass to recursiveTagParse() */ function renderFeed( $parser, $frame ) { - global $wgRSSTrackingCategory; $renderedFeed = ''; @@ -353,12 +352,8 @@ $renderedFeed = $this-sandboxParse( $renderedFeed ); } - if ( $wgRSSTrackingCategory === true ) { - $parser-addTrackingCategory( 'rss-tracking-category' ); - } elseif ( is_string( $wgRSSTrackingCategory ) ) { - $parser-addTrackingCategory( $wgRSSTrackingCategory ); - } + $parser-addTrackingCategory( 'rss-tracking-category' ); return $renderedFeed; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114169] branches/awjrichards/extensions/MobileFrontend/
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114169 Revision: 114169 Author: awjrichards Date: 2012-03-19 18:57:30 + (Mon, 19 Mar 2012) Log Message: --- Removing empty created dir Removed Paths: - branches/awjrichards/extensions/MobileFrontend/ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114170] trunk/extensions/WikiArticleFeeds
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114170 Revision: 114170 Author: wikinaut Date: 2012-03-19 19:02:42 + (Mon, 19 Mar 2012) Log Message: --- removed the redundant code for handling tracking categories. By using '-' for the message text wikiarticlefeeds-tracking-category , this can be disabled easily. Modified Paths: -- trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php trunk/extensions/WikiArticleFeeds/WikiArticleFeeds_body.php Modified: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php === --- trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php 2012-03-19 18:57:30 UTC (rev 114169) +++ trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php 2012-03-19 19:02:42 UTC (rev 114170) @@ -4,7 +4,7 @@ * @author Jim R. Wilson, Thomas Gries * @maintainer Thomas Gries * - * @version 0.703 + * @version 0.71 * @copyright Copyright (C) 2007 Jim R. Wilson * @copyright Copyright (C) 2012 Thomas Gries * @license The MIT License - http://www.opensource.org/licenses/mit-license.php @@ -56,6 +56,7 @@ * * Versions * + * 0.71removed $wgWikiArticleFeedsTrackingCategory parameter for tracking category * 0.703 adds the feed icon to the bottom of the toolbox in Monobook or like-minded skins. * 0.701 version string constant renamed to make it wiki-unique * 0.700 rewritten into a four-file version with class @@ -124,7 +125,7 @@ die( This is not a valid entry point.\n ); } -define( 'EXTENSION_WIKIARTICLEFEEDS_VERSION', '0.703 20120312' ); +define( 'EXTENSION_WIKIARTICLEFEEDS_VERSION', '0.71 20120319' ); # Bring in supporting classes require_once( $IP/includes/Feed.php ); @@ -158,16 +159,3 @@ $wgWikiArticleFeeds = new WikiArticleFeeds(); $wgHooks['ParserBeforeTidy'][] = array( $wgWikiArticleFeeds, 'WikiArticleFeeds::itemTagsPlaceholderCorrections' ); - -// Parameter to enable the automatic tracking category -// for all pages using this parser extension -// -// Category name [[MediaWiki:Wikiarticlefeeds-tracking-category]] (default) -// $wgWikiArticleFeedsTrackingCategory = true; -// -// you can assign a specific category name [[MediaWiki:Wikiarticlefeeds-mycategory]] -// $wgWikiArticleFeedsTrackingCategory = 'wikiarticlefeeds-mycategory'; -// -// you can disable the use of a tracking category -// $wgWikiArticleFeedsTrackingCategory = false; -$wgWikiArticleFeedsTrackingCategory = true; Modified: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds_body.php === --- trunk/extensions/WikiArticleFeeds/WikiArticleFeeds_body.php 2012-03-19 18:57:30 UTC (rev 114169) +++ trunk/extensions/WikiArticleFeeds/WikiArticleFeeds_body.php 2012-03-19 19:02:42 UTC (rev 114170) @@ -3,13 +3,7 @@ class WikiArticleFeeds{ function feedStart( $text, $params = array(), Parser $parser ) { - global $wgWikiArticleFeedsTrackingCategory; - - if ( $wgWikiArticleFeedsTrackingCategory === true ) { - $parser-addTrackingCategory( 'wikiarticlefeeds-tracking-category' ); - } elseif ( is_string( $wgWikiArticleFeedsTrackingCategory ) ) { - $parser-addTrackingCategory( $wgWikiArticleFeedsTrackingCategory ); - } + $parser-addTrackingCategory( 'wikiarticlefeeds-tracking-category' ); return '!-- FEED_START --'; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114171] trunk/extensions/EtherpadLite
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114171 Revision: 114171 Author: wikinaut Date: 2012-03-19 19:05:40 + (Mon, 19 Mar 2012) Log Message: --- removed the redundant code for handling tracking categories. By using '-' for the message text etherpadlite-tracking-category , this can be disabled easily. Modified Paths: -- trunk/extensions/EtherpadLite/EtherpadLite.php trunk/extensions/EtherpadLite/EtherpadLite_body.php Modified: trunk/extensions/EtherpadLite/EtherpadLite.php === --- trunk/extensions/EtherpadLite/EtherpadLite.php 2012-03-19 19:02:42 UTC (rev 114170) +++ trunk/extensions/EtherpadLite/EtherpadLite.php 2012-03-19 19:05:40 UTC (rev 114171) @@ -64,7 +64,7 @@ 'path' = __FILE__, 'name' = 'EtherpadLite', 'author' = array( 'Thomas Gries' ), - 'version' = '1.12 20120309', + 'version' = '1.13 20120319', 'url' = 'https://www.mediawiki.org/wiki/Extension:EtherpadLite', 'descriptionmsg' = 'etherpadlite-desc', ); @@ -104,20 +104,3 @@ # include * if you expressly want to allow all urls (you should not do this) # $wgEtherpadLiteUrlWhitelist = array( * ); - -// If you want to see images in feed items, then you need to globally allow -// image tags in your wiki by using the MediaWiki parameter; default: false -// $wgAllowImageTag = true; - -// Parameter to enable the automatic tracking category -// for all pages using this parser extension -// -// Category name [[MediaWiki:etherpadlite-tracking-category]] (default) -// $wgEtherpadLiteTrackingCategory = true; -// -// you can assign a specific category name [[MediaWiki:Etherpadlite-mycategory]] -// $wgEtherpadLiteTrackingCategory = 'etherpadlite-mycategory'; -// -// you can disable the use of a tracking category -// $wgEtherpadLiteTrackingCategory = false; -$wgEtherpadLiteTrackingCategory = true; Modified: trunk/extensions/EtherpadLite/EtherpadLite_body.php === --- trunk/extensions/EtherpadLite/EtherpadLite_body.php 2012-03-19 19:02:42 UTC (rev 114170) +++ trunk/extensions/EtherpadLite/EtherpadLite_body.php 2012-03-19 19:05:40 UTC (rev 114171) @@ -39,7 +39,7 @@ global $wgEtherpadLiteDefaultPadUrl, $wgEtherpadLiteDefaultWidth, $wgEtherpadLiteDefaultHeight, $wgEtherpadLiteMonospacedFont, $wgEtherpadLiteShowControls, $wgEtherpadLiteShowLineNumbers, $wgEtherpadLiteShowChat, $wgEtherpadLiteShowAuthorColors, $wgEtherpadLiteUrlWhitelist, - $wgEtherpadLitePadsOnThisPage, $wgEtherpadLiteTrackingCategory; + $wgEtherpadLitePadsOnThisPage; # check the user input @@ -166,16 +166,8 @@ $sanitizedAttributes ); - wfDebug( EtherpadLite::EtherpadLiteRender $output\n ); - - if ( $wgEtherpadLiteTrackingCategory === true ) { - $parser-addTrackingCategory( 'etherpadlite-tracking-category' ); - } elseif ( is_string( $wgEtherpadLiteTrackingCategory ) ) { - $parser-addTrackingCategory( $wgEtherpadLiteTrackingCategory ); - } - + $parser-addTrackingCategory( 'etherpadlite-tracking-category' ); return $output; - } /** ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114172] trunk/phase3/includes/specials/SpecialCachedPage.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114172 Revision: 114172 Author: jeroendedauw Date: 2012-03-19 19:24:04 + (Mon, 19 Mar 2012) Log Message: --- update docs Modified Paths: -- trunk/phase3/includes/specials/SpecialCachedPage.php Modified: trunk/phase3/includes/specials/SpecialCachedPage.php === --- trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 19:05:40 UTC (rev 114171) +++ trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 19:24:04 UTC (rev 114172) @@ -3,12 +3,13 @@ /** * Abstract special page class with scaffolding for caching the HTML output. * - * To enable the caching functionality, the cacheExpiry field should be set - * before parent::execute is called (and it should be called from execute). - * * To add HTML that should be cached, use addCachedHTML like this: - * $this-addCachedHTML( array( $this, 'displayCachedContent' ) ); + * $this-addCachedHTML( $callback ); * + * The callback function is only called when needed, so do all your expensive + * computations here. This function should returns the HTML to be cached. + * It should not add anything to the PageOutput object! + * * Before the first addCachedHTML call, you should call $this-startCache(); * After adding the last HTML that should be cached, call $this-saveCache(); * @@ -144,6 +145,11 @@ } } + /** +* Gets called after the cache got initialized. +* +* @since 1.20 +*/ protected function onCacheInitialized() { if ( $this-hasCached ) { $this-getOutput()-setSubtitle( $this-getCachedNotice() ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114173] trunk/extensions/EducationProgram/EducationProgram.settings. php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114173 Revision: 114173 Author: jeroendedauw Date: 2012-03-19 20:00:49 + (Mon, 19 Mar 2012) Log Message: --- flags++ Modified Paths: -- trunk/extensions/EducationProgram/EducationProgram.settings.php Modified: trunk/extensions/EducationProgram/EducationProgram.settings.php === --- trunk/extensions/EducationProgram/EducationProgram.settings.php 2012-03-19 19:24:04 UTC (rev 114172) +++ trunk/extensions/EducationProgram/EducationProgram.settings.php 2012-03-19 20:00:49 UTC (rev 114173) @@ -58,6 +58,8 @@ 'RU' = 'Flag of Russia.svg', 'UK' = 'Flag of the United Kingdom.svg', 'DE' = 'Flag of Germany.svg', + 'NZ' = 'Flag of New Zealand.svg', + 'CZ' = 'Flag of the Czech Republic.svg', ), 'fallbackFlag' = 'Nuvola unknown flag.svg', 'courseDescPage' = 'Course description', ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114174] trunk/extensions/ArticleFeedback/modules/jquery. articleFeedback/jquery.articleFeedback.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114174 Revision: 114174 Author: catrope Date: 2012-03-19 20:04:55 + (Mon, 19 Mar 2012) Log Message: --- Fix typo in r113968 that broke the weighting code so no CTA ever appeared Modified Paths: -- trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js Modified: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js === --- trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js 2012-03-19 20:00:49 UTC (rev 114173) +++ trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js 2012-03-19 20:04:55 UTC (rev 114174) @@ -671,7 +671,7 @@ // the user has rejected this within 3 days of right now var display = $.cookie( prefix( 'pitch-' + key ) ); if ( display !== 'hide' context.options.pitches[key].condition() ) { - var weight = 'weight' in context.options.pitches[key] ? pitches.weight : 1; + var weight = 'weight' in context.options.pitches[key] ? context.options.pitches[key].weight : 1; for ( var i = 0; i weight; i++ ) { pitches.push( key ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114175] trunk/phase3/includes/specials/SpecialCachedPage.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114175 Revision: 114175 Author: jeroendedauw Date: 2012-03-19 20:05:11 + (Mon, 19 Mar 2012) Log Message: --- fix for r114164 Modified Paths: -- trunk/phase3/includes/specials/SpecialCachedPage.php Modified: trunk/phase3/includes/specials/SpecialCachedPage.php === --- trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 20:04:55 UTC (rev 114174) +++ trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 20:05:11 UTC (rev 114175) @@ -135,7 +135,7 @@ * @since 1.20 */ protected function initCaching() { - if ( is_null( $this-hasCached ) ) { + if ( $this-cacheEnabled is_null( $this-hasCached ) ) { $cachedChunks = wfGetCache( CACHE_ANYTHING )-get( $this-getCacheKeyString() ); $this-hasCached = is_array( $cachedChunks ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114176] branches/wmf/1.19wmf1/extensions/ArticleFeedback/modules/ jquery.articleFeedback/jquery.articleFeedback.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114176 Revision: 114176 Author: catrope Date: 2012-03-19 20:06:17 + (Mon, 19 Mar 2012) Log Message: --- 1.19wmf1: MFT r114174 Modified Paths: -- branches/wmf/1.19wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js Modified: branches/wmf/1.19wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js === --- branches/wmf/1.19wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js 2012-03-19 20:05:11 UTC (rev 114175) +++ branches/wmf/1.19wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js 2012-03-19 20:06:17 UTC (rev 114176) @@ -671,7 +671,7 @@ // the user has rejected this within 3 days of right now var display = $.cookie( prefix( 'pitch-' + key ) ); if ( display !== 'hide' context.options.pitches[key].condition() ) { - var weight = 'weight' in context.options.pitches[key] ? pitches.weight : 1; + var weight = 'weight' in context.options.pitches[key] ? context.options.pitches[key].weight : 1; for ( var i = 0; i weight; i++ ) { pitches.push( key ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114177] trunk/extensions/MobileFrontend/javascripts/references.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114177 Revision: 114177 Author: jdlrobson Date: 2012-03-19 20:19:01 + (Mon, 19 Mar 2012) Log Message: --- unbind any existing click events on a references link this prevents things like toggle.js interfering with the behaviour Modified Paths: -- trunk/extensions/MobileFrontend/javascripts/references.js Modified: trunk/extensions/MobileFrontend/javascripts/references.js === --- trunk/extensions/MobileFrontend/javascripts/references.js 2012-03-19 20:06:17 UTC (rev 114176) +++ trunk/extensions/MobileFrontend/javascripts/references.js 2012-03-19 20:19:01 UTC (rev 114177) @@ -49,7 +49,7 @@ $( '.mw-cite-backlink a' ).click( close ); var data, html, href, references = collect(); - $( 'sup a' ).click( function(ev) { + $( 'sup a' ).unbind('click').click( function(ev) { var top, oh; href = $(this).attr( 'href' ); data = href href.charAt(0) === '#' ? ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114178] branches/Wikidata/phase3/includes
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114178 Revision: 114178 Author: daniel Date: 2012-03-19 20:25:48 + (Mon, 19 Mar 2012) Log Message: --- getNativeData() Modified Paths: -- branches/Wikidata/phase3/includes/Content.php branches/Wikidata/phase3/includes/ContentHandler.php branches/Wikidata/phase3/includes/EditPage.php branches/Wikidata/phase3/includes/WikiPage.php branches/Wikidata/phase3/includes/api/ApiEditPage.php branches/Wikidata/phase3/includes/api/ApiParse.php Modified: branches/Wikidata/phase3/includes/Content.php === --- branches/Wikidata/phase3/includes/Content.php 2012-03-19 20:19:01 UTC (rev 114177) +++ branches/Wikidata/phase3/includes/Content.php 2012-03-19 20:25:48 UTC (rev 114178) @@ -25,8 +25,10 @@ * as given by getDataModel(). * */ -public abstract function getRawData( ); +public abstract function getNativeData( ); +public abstract function getSize( ); + public abstract function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = NULL ); public function getRedirectChain() { @@ -58,11 +60,9 @@ } #TODO: implement specialized ParserOutput for Wikidata model -#TODO: provide addToParserOutput fule Multipart... somehow. +#TODO: provide combined ParserOutput for Multipart... somehow. -# TODO: EditPage::mergeChanges( Content $a, Content $b ) # TODO: Wikipage::isCountable(Content $a) -# TODO: Title::newFromRedirectRecurse( $this-getRawText() ); # TODO: isCacheable( ) # TODO: getSize( ) @@ -71,7 +71,11 @@ # TODO: WikiPage::getAutosummary( $oldtext, $text, $flags ) # TODO: EditPage::getPreloadedText( $preload ) // $wgParser-getPreloadText +# TODO: tie into EditPage, make it use Content-objects throughout, make edit form aware of content model and format +# TODO: make model-aware diff view! +# TODO: handle ImagePage and CategoryPage +# TODO: Title::newFromRedirectRecurse( $this-getRawText() ); # TODO: tie into API to provide contentModel for Revisions # TODO: tie into API to provide serialized version and contentFormat for Revisions @@ -94,7 +98,7 @@ * * @return String the raw text */ -public function getRawData( ) { +public function getNativeData( ) { $text = $this-mText; return $text; } @@ -105,7 +109,7 @@ * @return String the raw text */ public function getSearchText( ) { #FIXME: use! -return $this-getRawData(); +return $this-getNativeData(); } /** @@ -114,7 +118,7 @@ * @return String the raw text */ public function getWikitextForTransclusion( ) { #FIXME: use! -return $this-getRawData(); +return $this-getNativeData(); } /** @@ -186,7 +190,7 @@ public function getSection( $section ) { global $wgParser; -$text = $this-getRawData(); +$text = $this-getNativeData(); $sect = $wgParser-getSection( $text, $section, false ); return new WikitextContent( $sect ); @@ -212,8 +216,8 @@ throw new MWException( Incompatible content model for section: document uses $myModelName, section uses $sectionModelName. ); } -$oldtext = $this-getRawData(); -$text = $with-getRawData(); +$oldtext = $this-getNativeData(); +$text = $with-getNativeData(); if ( $section == 'new' ) { # Inserting a new section @@ -237,7 +241,7 @@ } public function getRedirectChain() { -$text = $this-getRawData(); +$text = $this-getNativeData(); return Title::newFromRedirectArray( $text ); } @@ -270,7 +274,7 @@ /** * Returns the message as raw text, using the options supplied to the constructor minus parse and parseinline. */ -public function getRawData( ) { +public function getNativeData( ) { $opt = array_diff( $this-mOptions, array('parse', 'parseinline') ); return wfMsgExt( $this-mMessageKey, $this-mParameters, $opt ); @@ -287,7 +291,7 @@ protected function getHtml( ) { $html = ; $html .= pre class=\mw-code mw-js\ dir=\ltr\\n; -$html .= htmlspecialchars( $this-getRawData() ); +$html .= htmlspecialchars( $this-getNativeData() ); $html .= \n/pre\n; return $html; @@ -303,7 +307,7 @@ protected function getHtml( ) { $html = ; $html .= pre class=\mw-code mw-css\ dir=\ltr\\n; -$html .= htmlspecialchars( $this-getRawData() ); +$html .= htmlspecialchars( $this-getNativeData() ); $html .= \n/pre\n; return $html; Modified: branches/Wikidata/phase3/includes/ContentHandler.php === ---
[MediaWiki-CVS] SVN: [114179] branches/Wikidata/phase3/includes
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114179 Revision: 114179 Author: daniel Date: 2012-03-19 20:34:30 + (Mon, 19 Mar 2012) Log Message: --- avoid getNativeData() Modified Paths: -- branches/Wikidata/phase3/includes/EditPage.php branches/Wikidata/phase3/includes/WikiPage.php branches/Wikidata/phase3/includes/api/ApiEditPage.php branches/Wikidata/phase3/includes/api/ApiParse.php Modified: branches/Wikidata/phase3/includes/EditPage.php === --- branches/Wikidata/phase3/includes/EditPage.php 2012-03-19 20:25:48 UTC (rev 114178) +++ branches/Wikidata/phase3/includes/EditPage.php 2012-03-19 20:34:30 UTC (rev 114179) @@ -866,7 +866,7 @@ } $content = $this-mArticle-getContentObject(); - return $content-getNativeData(); # this editor is for editing the raw text. so use the raw text. + return ContentHandler::getContentText( $content ); # this editor is for editing the raw text. so use the raw text. } /** Modified: branches/Wikidata/phase3/includes/WikiPage.php === --- branches/Wikidata/phase3/includes/WikiPage.php 2012-03-19 20:25:48 UTC (rev 114178) +++ branches/Wikidata/phase3/includes/WikiPage.php 2012-03-19 20:34:30 UTC (rev 114179) @@ -911,7 +911,7 @@ if ( $this-mTitle-getNamespace() == NS_MEDIAWIKI ) { if ( $this-mTitle-exists() ) { - $text = $this-getNativeData(); + $text = $this-getNativeData(); #FIXME: may not be a string. check Content model! } else { $text = false; } @@ -1265,7 +1265,7 @@ $isminor = ( $flags EDIT_MINOR ) $user-isAllowed( 'minoredit' ); $bot = $flags EDIT_FORCE_BOT; - $oldtext = $this-getNativeData(); // current revision + $oldtext = $this-getNativeData(); // current revision #FIXME: may not be a string. check Content model! $oldsize = strlen( $oldtext ); $oldid = $this-getLatest(); $oldIsRedirect = $this-isRedirect(); Modified: branches/Wikidata/phase3/includes/api/ApiEditPage.php === --- branches/Wikidata/phase3/includes/api/ApiEditPage.php 2012-03-19 20:25:48 UTC (rev 114178) +++ branches/Wikidata/phase3/includes/api/ApiEditPage.php 2012-03-19 20:34:30 UTC (rev 114179) @@ -112,13 +112,14 @@ $text = ''; } else { $content = $articleObj-getContentObject(); -$text = $content-getNativeData(); +$text = ContentHandler::getContentText( $content ); #FIXME: serialize?! get format from params?... } if ( !is_null( $params['section'] ) ) { // Process the content for section edits $section = intval( $params['section'] ); -$text = $content-getSection( $section, false ); +$sectionContent = $content-getSection( $section ); +$text = ContentHandler::getContentText( $sectionContent ); #FIXME: serialize?! get format from params?... if ( $text === false || $text === null ) { $this-dieUsage( There is no section {$section}., 'nosuchsection' ); } Modified: branches/Wikidata/phase3/includes/api/ApiParse.php === --- branches/Wikidata/phase3/includes/api/ApiParse.php 2012-03-19 20:25:48 UTC (rev 114178) +++ branches/Wikidata/phase3/includes/api/ApiParse.php 2012-03-19 20:34:30 UTC (rev 114179) @@ -318,7 +318,7 @@ $page = WikiPage::factory( $titleObj ); - if ( $this-section !== false ) { + if ( $this-section !== false ) { #FIXME: get section Content, get parser output, ... $this-text = $this-getSectionText( $page-getRawText(), !is_null( $pageId ) ? 'page id ' . $pageId : $titleObj-getText() ); #FIXME: get section... @@ -330,13 +330,13 @@ $pout = $page-getParserOutput( $popts ); if ( $getWikitext ) { $this-content = $page-getContent( Revision::RAW ); #FIXME: use $this-content everywhere - $this-text = $this-content-getNativeData(); #FIXME: change $this-text to $this-data?! + $this-text = ContentHandler::getContentText( $this-content ); #FIXME: serialize, get format from params; or use object
[MediaWiki-CVS] SVN: [114180] trunk/phase3/includes/specials/SpecialCachedPage.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114180 Revision: 114180 Author: jeroendedauw Date: 2012-03-19 20:51:36 + (Mon, 19 Mar 2012) Log Message: --- make more generic: do not assume we want to add html to the output. Also get rid of action=purge from key args Modified Paths: -- trunk/phase3/includes/specials/SpecialCachedPage.php Modified: trunk/phase3/includes/specials/SpecialCachedPage.php === --- trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 20:34:30 UTC (rev 114179) +++ trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 20:51:36 UTC (rev 114180) @@ -164,15 +164,33 @@ * * @since 1.20 * -* @param {function} $callback +* @param {function} $computeFunction * @param array $args * @param string|null $key */ - public function addCachedHTML( $callback, $args = array(), $key = null ) { + public function addCachedHTML( $computeFunction, $args = array(), $key = null ) { + $this-getOutput()-addHTML( $this-getCachedValue( $computeFunction, $args, $key ) ); + } + + /** +* Get a cached value if available or compute it if not and then cache it if possible. +* The provided $computeFunction is only called when the computation needs to happen +* and should return a result value. $args are arguments that will be passed to the +* compute function when called. +* +* @since 1.20 +* +* @param {function} $computeFunction +* @param array|mixed $args +* @param string|null $key +* +* @return mixed +*/ + protected function getCachedValue( $computeFunction, $args = array(), $key = null ) { $this-initCaching(); if ( $this-cacheEnabled $this-hasCached ) { - $html = ''; + $value = null; if ( is_null( $key ) ) { $itemKey = array_keys( array_slice( $this-cachedChunks, 0, 1 ) ); @@ -185,12 +203,12 @@ wfWarn( Attempted to get an item while the queue is empty in . __METHOD__ ); } else { - $html = array_shift( $this-cachedChunks ); + $value = array_shift( $this-cachedChunks ); } } else { if ( array_key_exists( $key, $this-cachedChunks ) ) { - $html = $this-cachedChunks[$key]; + $value = $this-cachedChunks[$key]; unset( $this-cachedChunks[$key] ); } else { @@ -199,19 +217,23 @@ } } else { - $html = call_user_func_array( $callback, $args ); + if ( !is_array( $args ) ) { + $args = array( $args ); + } + $value = call_user_func_array( $computeFunction, $args ); + if ( $this-cacheEnabled ) { if ( is_null( $key ) ) { - $this-cachedChunks[] = $html; + $this-cachedChunks[] = $value; } else { - $this-cachedChunks[$key] = $html; + $this-cachedChunks[$key] = $value; } } } - $this-getOutput()-addHTML( $html ); + return $value; } /** @@ -246,7 +268,13 @@ * @return string */ protected function getCacheKeyString() { - return call_user_func_array( 'wfMemcKey', $this-getCacheKey() ); + $keyArgs = $this-getCacheKey(); + + if ( array_key_exists( 'action', $keyArgs ) $keyArgs['action'] === 'purge' ) { + unset( $keyArgs['action'] ); + } + + return call_user_func_array( 'wfMemcKey', $keyArgs ); } /** ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114181] trunk/extensions/EducationProgram/specials
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114181 Revision: 114181 Author: jeroendedauw Date: 2012-03-19 20:51:55 + (Mon, 19 Mar 2012) Log Message: --- work on caching of special:student Modified Paths: -- trunk/extensions/EducationProgram/specials/SpecialEPPage.php trunk/extensions/EducationProgram/specials/SpecialInstitutions.php trunk/extensions/EducationProgram/specials/SpecialStudent.php Modified: trunk/extensions/EducationProgram/specials/SpecialEPPage.php === --- trunk/extensions/EducationProgram/specials/SpecialEPPage.php 2012-03-19 20:51:36 UTC (rev 114180) +++ trunk/extensions/EducationProgram/specials/SpecialEPPage.php 2012-03-19 20:51:55 UTC (rev 114181) @@ -150,39 +150,56 @@ * @param array $summaryData */ protected function displaySummary( DBDataObject $item, $collapsed = false, array $summaryData = null ) { - $out = $this-getOutput(); + $this-getOutput()-addHTML( $item, $collapsed, $summaryData ); + } + /** +* Display the summary data. +* +* @since 0.1 +* +* @param DBDataObject $item +* @param boolean $collapsed +* @param array $summaryData +* +* @return string +*/ + protected function getSummary( DBDataObject $item, $collapsed = false, array $summaryData = null ) { + $html = ''; + $class = 'wikitable ep-summary mw-collapsible'; if ( $collapsed ) { $class .= ' mw-collapsed'; } - $out-addHTML( Html::openElement( 'table', array( 'class' = $class ) ) ); + $html .= Html::openElement( 'table', array( 'class' = $class ) ); - $out-addHTML( 'tr' . Html::element( 'th', array( 'colspan' = 2 ), wfMsg( 'ep-item-summary' ) ) . '/tr' ); + $html .= 'tr' . Html::element( 'th', array( 'colspan' = 2 ), wfMsg( 'ep-item-summary' ) ) . '/tr'; $summaryData = is_null( $summaryData ) ? $this-getSummaryData( $item ) : $summaryData; foreach ( $summaryData as $stat = $value ) { - $out-addHTML( 'tr' ); + $html .= 'tr'; - $out-addElement( + $html .= Html::element( 'th', array( 'class' = 'ep-summary-name' ), wfMsg( strtolower( get_called_class() ) . '-summary-' . $stat ) ); - $out-addHTML( Html::rawElement( + $html .= Html::rawElement( 'td', array( 'class' = 'ep-summary-value' ), $value - ) ); + ); - $out-addHTML( '/tr' ); + $html .= '/tr'; } - $out-addHTML( Html::closeElement( 'table' ) ); + $html .= Html::closeElement( 'table' ); + + return $html; } /** Modified: trunk/extensions/EducationProgram/specials/SpecialInstitutions.php === --- trunk/extensions/EducationProgram/specials/SpecialInstitutions.php 2012-03-19 20:51:36 UTC (rev 114180) +++ trunk/extensions/EducationProgram/specials/SpecialInstitutions.php 2012-03-19 20:51:55 UTC (rev 114181) @@ -35,7 +35,7 @@ parent::execute( $subPage ); if ( $this-subPage === '' ) { - $this-startCache( 3600, $this-getUser()-isAnon() ); + $this-startCache( 3600 ); $this-displayNavigation(); @@ -60,9 +60,7 @@ protected function getCacheKey() { $values = $this-getRequest()-getValues(); - if ( array_key_exists( 'action', $values ) $values['action'] === 'purge' ) { - unset( $values['action'] ); - } + $values[] = $this-getUser()-getId(); return array_merge( $values, parent::getCacheKey() ); } Modified: trunk/extensions/EducationProgram/specials/SpecialStudent.php === --- trunk/extensions/EducationProgram/specials/SpecialStudent.php 2012-03-19 20:51:36 UTC (rev 114180) +++ trunk/extensions/EducationProgram/specials/SpecialStudent.php 2012-03-19 20:51:55 UTC (rev 114181) @@ -38,13 +38,20 @@ $this-getOutput()-redirect( SpecialPage::getTitleFor( 'Students' )-getLocalURL() ); } else { + $this-startCache( 3600 ); + $this-displayNavigation();
[MediaWiki-CVS] SVN: [114182] trunk/phase3/includes/Setup.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114182 Revision: 114182 Author: ialex Date: 2012-03-19 20:52:59 + (Mon, 19 Mar 2012) Log Message: --- Make the first line of debug log more consitent between CLI and web call by putting the method and the URL directly on the first line Modified Paths: -- trunk/phase3/includes/Setup.php Modified: trunk/phase3/includes/Setup.php === --- trunk/phase3/includes/Setup.php 2012-03-19 20:51:55 UTC (rev 114181) +++ trunk/phase3/includes/Setup.php 2012-03-19 20:52:59 UTC (rev 114182) @@ -421,7 +421,7 @@ # Can't stub this one, it sets up $_GET and $_REQUEST in its constructor $wgRequest = new WebRequest; - $debug = \n\nStart request\n{$_SERVER['REQUEST_METHOD']} {$wgRequest-getRequestURL()}\n; + $debug = \n\nStart request {$_SERVER['REQUEST_METHOD']} {$wgRequest-getRequestURL()}\n; if ( $wgDebugPrintHttpHeaders ) { $debug .= HTTP HEADERS:\n; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114183] trunk/translatewiki/MediaWiki/mediawiki-defines.txt
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114183 Revision: 114183 Author: raymond Date: 2012-03-19 20:55:38 + (Mon, 19 Mar 2012) Log Message: --- r114156: Update keys. 1 to ignore, 1 optional Modified Paths: -- trunk/translatewiki/MediaWiki/mediawiki-defines.txt Modified: trunk/translatewiki/MediaWiki/mediawiki-defines.txt === --- trunk/translatewiki/MediaWiki/mediawiki-defines.txt 2012-03-19 20:52:59 UTC (rev 114182) +++ trunk/translatewiki/MediaWiki/mediawiki-defines.txt 2012-03-19 20:55:38 UTC (rev 114183) @@ -55,7 +55,8 @@ Anti Bot Anti Spoof -ignored = antispoof-conflict-item +ignored = antispoof-conflict-item, antispoof-bad-char-non-printable +optional = antispoof-bad-char APC aliasfile = APC/APC.alias.php ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114184] trunk/extensions/MobileFrontend/javascripts
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114184 Revision: 114184 Author: jdlrobson Date: 2012-03-19 21:04:09 + (Mon, 19 Mar 2012) Log Message: --- commit latest versions of minified in preparation for deployment Modified Paths: -- trunk/extensions/MobileFrontend/javascripts/beta_opensearch.min.js trunk/extensions/MobileFrontend/javascripts/toggle.min.js Added Paths: --- trunk/extensions/MobileFrontend/javascripts/references.min.js Modified: trunk/extensions/MobileFrontend/javascripts/beta_opensearch.min.js === --- trunk/extensions/MobileFrontend/javascripts/beta_opensearch.min.js 2012-03-19 20:55:38 UTC (rev 114183) +++ trunk/extensions/MobileFrontend/javascripts/beta_opensearch.min.js 2012-03-19 21:04:09 UTC (rev 114184) @@ -1 +1 @@ -MobileFrontend.opensearch=(function(){var c=/api.php,m=-1,d=500,z=15,q,l=document.getElementById(search),t=document.getElementById(sq),a=document.getElementById(searchbox),r=document.getElementById(content),o=document.getElementById(footer),x=document.getElementById(clearsearch),k=false,n=MobileFrontend.utils;c=MobileFrontend.setting(scriptPath)+c;function s(){results.style.display=none}function h(){if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)){var u=n('meta[name=viewport]');if(u){u=u[0];u.content=width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0;n(document.body).bind(gesturestart,function(){u.content=width=device-width, initial-scale=1.0})}}}h();l.onfocus=function(){var u,A;a=document.getElementById(searchbox);t=document.getElementById(sq);r=document.getElementById(content);o=document.getElementById(footer);h();if(!k){MobileFrontend.utils(document.body).addClass(full-screen-search);u=document.getElementById(remove-results);if(!u){u=document.createElement(a);u.setAttribute(href,#);u.setAttribute(id,remove-results);n(u).bind(click,y);A=document.createElement(div);A.setAttribute(id,left-arrow);u.appendChild(A);t.insertBefore(u,t.firstChild)}k=true}};function y(){MobileFrontend.utils(document.body).removeClass(full-screen-search);if(k){k=false}if(x){x.style.display=none}}function b(A){var u;if(!A){A=window.event}if(A.target){u=A.target}else{if(A.srcElement){u=A.srcElement}}if(u.nodeType===3){u=u.parentNode}A.cancelBubble=true;A.stopPropagation();if(u.className===suggestion-result||u.className===search-result-item||u.className===suggestions-result||u.className===sq-val-update||u.id===results||u.id===search||u.id===searchbox||u.id===sq||u.id===placeholder||u.id===clearsearch||u.tagName===BODY){if(u.id===clearsearchresults){results.innerHTML=}}else{s()}}window.onload=function(){n(l).bind(keyup,function(){clearTimeout(m);q=this.value;if(q.length1){results.innerHTML=}else{q=encodeURIComponent(q);m=setTimeout(function(){j(q)},d)}})};function j(u){url=c+?action=opensearchlimit=+z+namespace=0format=xmlsearch=+u;n.ajax({url:url,success:function(A){p(g(A))}})}function g(D){var E=[],A,B,C,u=D.getElementsByTagName(Item);for(A=0;Au.length;A++){B=u[A];C={label:B.getElementsByTagName(Text)[0].textContent,value:B.getElementsByTagName(Url)[0].textContent};E.push(C)}return E}function i(A){var u=document.getElementById(search);if(u){u.value=A+ ;u.focus();j(u.value)}}function e(B){var A=document.createTextNode(B),u=document.createElement(div);u.appendChild(A);return u.innerHTML}function w(u){return u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,\\$)}function p(J){var D=document.getElementById(results),F,E,C=e(document.getElementById(search).value),B,I,A,u,G,H;D.style.display=block;if(l){l.focus()}if(!J||J.length1){D.innerHTML='ul class=suggestions-results title=No Resultsli class=suggestions-resultNo Results/li/div'}else{if(D.firstChild){D.removeChild(D.firstChild)}F=document.createElement(ul);F.className=suggestions-results;D.appendChild(F);B=function(){var K=this.parentNode.getAttribute(title);i(K)};for(E=0;EJ.length;E++){I=J[E];u=document.createElement(li);G=document.createElement(a);u.setAttribute(title,I.label);u.className=suggestions-result;H=document.createTextNode(+);G.appendChild(H);G.className=sq-val-update;n(G).bind(click,B);u.appendChild(G);G=document.createElement(a);G.setAttribute(href,I.value.replace(/^(?:\/\/|[^\/]+)*\//,/));G.className=search-result-item;H=document.createTextNode(I.label);G.appendChild(H);u.appendChild(G);F.appendChild(u);A=w(C);G.innerHTML=G.innerHTML.replace(new RegExp((+A+),ig),strong$1/strong)}}}function f(){var D=document.getElementById(clearsearch),u=document.getElementById(search);function B(){if(D){if(u.value.length0){D.style.display=block}else{D.style.display=none}}}function A(E){u.value=;D.style.display=none;if(E){E.preventDefault()}}function C(){u.select()}n(D).bind(mousedown,A);n(u).bind(keyup,B);n(u).bind(click,C)}function v(){var
[MediaWiki-CVS] SVN: [114185] branches/Wikidata/phase3/includes
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114185 Revision: 114185 Author: daniel Date: 2012-03-19 21:09:37 + (Mon, 19 Mar 2012) Log Message: --- isCountable() Modified Paths: -- branches/Wikidata/phase3/includes/Content.php branches/Wikidata/phase3/includes/Revision.php branches/Wikidata/phase3/includes/WikiPage.php Modified: branches/Wikidata/phase3/includes/Content.php === --- branches/Wikidata/phase3/includes/Content.php 2012-03-19 21:04:09 UTC (rev 114184) +++ branches/Wikidata/phase3/includes/Content.php 2012-03-19 21:09:37 UTC (rev 114185) @@ -27,14 +27,30 @@ */ public abstract function getNativeData( ); -public abstract function getSize( ); +/** + * returns the content's nominal size in bogo-bytes. + */ +public abstract function getSize( ); #XXX: do we really need/want this here? we could just use the byte syse of the serialized form... +/** + * Returns true if this content is countable as a real wiki page, provided + * that it's also in a countable location (e.g. a current revision in the main namespace). + * + * @param $hasLinks Bool: if it is known whether this content contains links, provide this information here, + *to avoid redundant parsing to find out. + */ +public abstract function isCountable( $hasLinks = null ) ; + public abstract function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = NULL ); public function getRedirectChain() { return null; } +public function isRedirect() { +return false; +} + /** * Returns the section with the given id. * @@ -62,11 +78,8 @@ #TODO: implement specialized ParserOutput for Wikidata model #TODO: provide combined ParserOutput for Multipart... somehow. -# TODO: Wikipage::isCountable(Content $a) +# XXX: isCacheable( ) # can/should we do this here? -# TODO: isCacheable( ) -# TODO: getSize( ) - # TODO: WikiPage::getUndoText( Revision $undo, Revision $undoafter = null ) # TODO: WikiPage::getAutosummary( $oldtext, $text, $flags ) @@ -94,6 +107,34 @@ } /** + * returns the content's nominal size in bogo-bytes. + */ +public function getSize( ) { #FIXME: use! replace strlen in WikiPage. +$text = $this-getNativeData( ); +return strlen( $text ); +} + +/** + * Returns true if this content is not a redirect, and $wgArticleCountMethod is any. + * + * @param $hasLinks Bool: if it is known whether this content contains links, provide this information here, + *to avoid redundant parsing to find out. + */ +public function isCountable( $hasLinks = null ) { +global $wgArticleCountMethod; + +if ( $this-isRedirect( ) ) { +return false; +} + +if ( $wgArticleCountMethod === 'any' ) { +return true; +} + +return false; +} + +/** * Returns the text represented by this Content object, as a string. * * @return String the raw text @@ -245,6 +286,46 @@ return Title::newFromRedirectArray( $text ); } +public function isRedirect() { +$text = $this-getNativeData(); +return Title::newFromRedirect( $text ) !== null; +} + +/** + * Returns true if this content is not a redirect, and this content's text is countable according to + * the criteria defiend by $wgArticleCountMethod. + * + * @param $hasLinks Bool: if it is known whether this content contains links, provide this information here, + *to avoid redundant parsing to find out. + */ +public function isCountable( $hasLinks = null ) { +global $wgArticleCountMethod; + +if ( $this-isRedirect( ) ) { +return false; +} + +$text = $this-getNativeData(); + +switch ( $wgArticleCountMethod ) { +case 'any': +return true; +case 'comma': +if ( $text === false ) { +$text = $this-getRawText(); +} +return strpos( $text, ',' ) !== false; +case 'link': +if ( $hasLinks === null ) { # not know, find out +$po = $this-getParserOutput(); +$links = $po-getLinks(); +$hasLinks = !empty( $links ); +} + +return $hasLinks; +} +} + } class MessageContent extends TextContent { Modified: branches/Wikidata/phase3/includes/Revision.php === --- branches/Wikidata/phase3/includes/Revision.php 2012-03-19 21:04:09 UTC (rev 114184) +++
[MediaWiki-CVS] SVN: [114186] trunk/extensions/EducationProgram
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114186 Revision: 114186 Author: jeroendedauw Date: 2012-03-19 21:16:19 + (Mon, 19 Mar 2012) Log Message: --- work on special:student Modified Paths: -- trunk/extensions/EducationProgram/EducationProgram.i18n.php trunk/extensions/EducationProgram/actions/ViewOrgAction.php trunk/extensions/EducationProgram/includes/EPCourse.php trunk/extensions/EducationProgram/includes/EPOrg.php trunk/extensions/EducationProgram/specials/SpecialCourses.php trunk/extensions/EducationProgram/specials/SpecialStudent.php Modified: trunk/extensions/EducationProgram/EducationProgram.i18n.php === --- trunk/extensions/EducationProgram/EducationProgram.i18n.php 2012-03-19 21:09:37 UTC (rev 114185) +++ trunk/extensions/EducationProgram/EducationProgram.i18n.php 2012-03-19 21:16:19 UTC (rev 114186) @@ -589,6 +589,7 @@ 'specialstudent-summary-first-enroll' = 'First enrollment', 'specialstudent-summary-user' = 'User', 'ep-student-courses' = 'Courses this student has enrolled in', + 'ep-student-articles' = 'Articles this student is working on', // Special:Enroll 'ep-enroll-title' = 'Enroll for $1 at $2', Modified: trunk/extensions/EducationProgram/actions/ViewOrgAction.php === --- trunk/extensions/EducationProgram/actions/ViewOrgAction.php 2012-03-19 21:09:37 UTC (rev 114185) +++ trunk/extensions/EducationProgram/actions/ViewOrgAction.php 2012-03-19 21:16:19 UTC (rev 114186) @@ -45,7 +45,7 @@ $out-addElement( 'h2', array(), wfMsg( 'ep-institution-courses' ) ); - EPCourse::displayPager( $this-getContext(), array( 'org_id' = $org-getId() ) ); + $out-addHTML( EPCourse::displayPager( $this-getContext(), array( 'org_id' = $org-getId() ) ) ); if ( $this-getUser()-isAllowed( 'ep-course' ) ) { $out-addElement( 'h2', array(), wfMsg( 'ep-institution-add-course' ) ); Modified: trunk/extensions/EducationProgram/includes/EPCourse.php === --- trunk/extensions/EducationProgram/includes/EPCourse.php 2012-03-19 21:09:37 UTC (rev 114185) +++ trunk/extensions/EducationProgram/includes/EPCourse.php 2012-03-19 21:16:19 UTC (rev 114186) @@ -45,7 +45,7 @@ */ protected $oas = false; - /** + /** * Field for caching the campus ambassaords. * * @since 0.1 @@ -259,26 +259,29 @@ * @param boolean $readOnlyMode * @param string|false $filterPrefix */ - public static function displayPager( IContextSource $context, array $conditions = array(), $readOnlyMode = false, $filterPrefix = false ) { + public static function getPager( IContextSource $context, array $conditions = array(), $readOnlyMode = false, $filterPrefix = false ) { $pager = new EPCoursePager( $context, $conditions, $readOnlyMode ); if ( $filterPrefix !== false ) { $pager-setFilterPrefix( $filterPrefix ); } + + $html = ''; if ( $pager-getNumRows() ) { - $context-getOutput()-addHTML( + $html .= $pager-getFilterControl() . $pager-getNavigationBar() . $pager-getBody() . $pager-getNavigationBar() . - $pager-getMultipleItemControl() - ); + $pager-getMultipleItemControl(); } else { - $context-getOutput()-addHTML( $pager-getFilterControl( true ) ); - $context-getOutput()-addWikiMsg( 'ep-courses-noresults' ); + $html .= $pager-getFilterControl( true ); + $html .= $context-msg( 'ep-courses-noresults' )-escaped(); } + + return $html; } /** Modified: trunk/extensions/EducationProgram/includes/EPOrg.php === --- trunk/extensions/EducationProgram/includes/EPOrg.php2012-03-19 21:09:37 UTC (rev 114185) +++ trunk/extensions/EducationProgram/includes/EPOrg.php2012-03-19 21:16:19 UTC (rev 114186) @@ -210,7 +210,7 @@ } else { return $pager-getFilterControl( true ) . - $context-msg( 'ep-institutions-noresults' ); + $context-msg( 'ep-institutions-noresults' )-escaped(); } } Modified:
[MediaWiki-CVS] SVN: [114187] trunk/extensions/ArticleFeedbackv5/modules/jquery. articleFeedbackv5/jquery.articleFeedbackv5.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114187 Revision: 114187 Author: rsterbin Date: 2012-03-19 21:21:24 + (Mon, 19 Mar 2012) Log Message: --- Bug fix: non-url click tracking events were not getting the rev id Modified Paths: -- trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js Modified: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js === --- trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js 2012-03-19 21:16:19 UTC (rev 114186) +++ trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js 2012-03-19 21:21:24 UTC (rev 114187) @@ -3876,7 +3876,7 @@ if ( $.articleFeedbackv5.clickTracking $.isFunction( $.trackActionWithInfo ) ) { $.trackActionWithInfo( $.articleFeedbackv5.prefix( trackingId ), - mw.config.get( 'wgTitle' ) + mw.config.get( 'wgTitle' ) + '|' + $.articleFeedbackv5.revisionId ); } }; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114189] trunk/extensions/ArticleFeedbackv5/modules/jquery. articleFeedbackv5/jquery.articleFeedbackv5.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114189 Revision: 114189 Author: rsterbin Date: 2012-03-19 21:22:51 + (Mon, 19 Mar 2012) Log Message: --- Updated clicktracking events to Phase 2 names Modified Paths: -- trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js Modified: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js === --- trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js 2012-03-19 21:21:48 UTC (rev 114188) +++ trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js 2012-03-19 21:22:51 UTC (rev 114189) @@ -247,7 +247,7 @@ div class=articleFeedbackv5-form-flyover\ div class=articleFeedbackv5-disable-flyover-help \ p class=articleFeedbackv5-disable-flyover-help-goto/p\ - a class=articleFeedbackv5-disable-flyover-goto-link target=_blankhtml:msg key=disable-flyover-help-location //a\ + pquot;html:msg key=disable-flyover-help-location /quot;/p\ phtml:msg key=disable-flyover-help-direction //p\ pquot;html:msg key=disable-preference /quot;/p\ /div\ @@ -457,7 +457,7 @@ $block.find( '.articleFeedbackv5-submit' ) .click( function ( e ) { e.preventDefault(); - $.articleFeedbackv5.trackClick( 'option1-submit-' + + $.articleFeedbackv5.trackClick( $.articleFeedbackv5.bucketName() + '-submit-' + ( $.articleFeedbackv5.inDialog ? 'overlay' : 'bottom' ) ); $.articleFeedbackv5.submitForm(); } ); @@ -714,7 +714,7 @@ $block.find( '.articleFeedbackv5-submit' ) .click( function ( e ) { e.preventDefault(); - $.articleFeedbackv5.trackClick( 'option2-submit-' + + $.articleFeedbackv5.trackClick( $.articleFeedbackv5.bucketName() + '-submit-' + ( $.articleFeedbackv5.inDialog ? 'overlay' : 'bottom' ) ); $.articleFeedbackv5.submitForm(); } ); @@ -1042,7 +1042,7 @@ $block.find( '.articleFeedbackv5-submit' ) .click( function ( e ) { e.preventDefault(); - $.articleFeedbackv5.trackClick( 'option3-submit-' + + $.articleFeedbackv5.trackClick( $.articleFeedbackv5.bucketName() + 'submit-' + ( $.articleFeedbackv5.inDialog ? 'overlay' : 'bottom' ) ); $.articleFeedbackv5.submitForm(); } ); @@ -3006,7 +3006,7 @@ * @return string the bucket name */ $.articleFeedbackv5.bucketName = function () { - return 'option' + $.articleFeedbackv5.bucketId; + return 'option' + $.articleFeedbackv5.bucketId + $.articleFeedbackv5.floatingLinkId; }; // }}} @@ -3546,24 +3546,28 @@ $flyover.localize( { 'prefix': 'articlefeedbackv5-' } ); $flyover.find( '.articleFeedbackv5-disable-flyover' ) .addClass( 'articleFeedbackv5-disable-flyover-' + linkId ); - var prefLink = mw.config.get( 'wgScript' ) + '?' + - $.param( { title: 'Special:Preferences' } ) + - '#mw-prefsection-rendering'; + $flyover.find( '.articleFeedbackv5-disable-flyover-help-goto' ) .html( $.articleFeedbackv5.buildLink(
[MediaWiki-CVS] SVN: [114190] trunk/extensions/MobileFrontend/stylesheets/common.css
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114190 Revision: 114190 Author: jdlrobson Date: 2012-03-19 21:24:48 + (Mon, 19 Mar 2012) Log Message: --- alter right property for results for rtl make same as ltr flipped Modified Paths: -- trunk/extensions/MobileFrontend/stylesheets/common.css Modified: trunk/extensions/MobileFrontend/stylesheets/common.css === --- trunk/extensions/MobileFrontend/stylesheets/common.css 2012-03-19 21:22:51 UTC (rev 114189) +++ trunk/extensions/MobileFrontend/stylesheets/common.css 2012-03-19 21:24:48 UTC (rev 114190) @@ -182,6 +182,7 @@ html[dir=rtl] #results { left: 41px; + right: 53px; } .search_bar .search { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114191] trunk/extensions/MobileFrontend/templates/SearchTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114191 Revision: 114191 Author: awjrichards Date: 2012-03-19 21:37:02 + (Mon, 19 Mar 2012) Log Message: --- htmlspecialchars - Xml::escapeJsString Modified Paths: -- trunk/extensions/MobileFrontend/templates/SearchTemplate.php Modified: trunk/extensions/MobileFrontend/templates/SearchTemplate.php === --- trunk/extensions/MobileFrontend/templates/SearchTemplate.php 2012-03-19 21:24:48 UTC (rev 114190) +++ trunk/extensions/MobileFrontend/templates/SearchTemplate.php 2012-03-19 21:37:02 UTC (rev 114191) @@ -8,14 +8,14 @@ public function getHTML() { - $searchField = htmlspecialchars( $this-data['searchField'] ); + $searchField = Xml::escapeJsString( $this-data['searchField'] ); $mainPageUrl = $this-data['mainPageUrl']; $randomPageUrl = $this-data['randomPageUrl']; $homeButton = $this-data['messages']['mobile-frontend-home-button']; $randomButton = $this-data['messages']['mobile-frontend-random-button']; - $clearText = htmlentities( $this-data['messages']['mobile-frontend-clear-search'], ENT_QUOTES ); + $clearText = Xml::escapeJsString( $this-data['messages']['mobile-frontend-clear-search'] ); $searchValue = $this-data['messages']['mobile-frontend-search-submit']; - $placeholder = htmlentities( $this-data['messages']['mobile-frontend-placeholder'], ENT_QUOTES ); + $placeholder = Xml::escapeJsString( $this-data['messages']['mobile-frontend-placeholder'] ); $scriptUrl = wfScript(); $searchBoxDisplayNone = ( $this-data['hideSearchBox'] ) ? ' style=display: none; ' : ''; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114192] trunk/phase3
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114192 Revision: 114192 Author: reedy Date: 2012-03-19 21:40:39 + (Mon, 19 Mar 2012) Log Message: --- More occurrence typos Modified Paths: -- trunk/phase3/includes/parser/Parser.php trunk/phase3/resources/jquery/jquery.highlightText.js trunk/phase3/tests/phpunit/includes/IPTest.php Modified: trunk/phase3/includes/parser/Parser.php === --- trunk/phase3/includes/parser/Parser.php 2012-03-19 21:37:02 UTC (rev 114191) +++ trunk/phase3/includes/parser/Parser.php 2012-03-19 21:40:39 UTC (rev 114192) @@ -1700,7 +1700,7 @@ $holders = new LinkHolderArray( $this ); - # split the entire text string on occurences of [[ + # split the entire text string on occurrences of [[ $a = StringUtils::explode( '[[', ' ' . $s ); # get the first element (all text up to first [[), and remove the space we added $s = $a-current(); @@ -2384,7 +2384,7 @@ } /** -* Split up a string on ':', ignoring any occurences inside tags +* Split up a string on ':', ignoring any occurrences inside tags * to prevent illegal overlapping. * * @param $str String the string to split Modified: trunk/phase3/resources/jquery/jquery.highlightText.js === --- trunk/phase3/resources/jquery/jquery.highlightText.js 2012-03-19 21:37:02 UTC (rev 114191) +++ trunk/phase3/resources/jquery/jquery.highlightText.js 2012-03-19 21:40:39 UTC (rev 114192) @@ -23,7 +23,7 @@ // TODO - need to be smarter about the character matching here. // non latin characters can make regex think a new word has begun: do not use \b // http://stackoverflow.com/questions/3787072/regex-wordwrap-with-utf8-characters-in-js - // look for an occurence of our pattern and store the starting position + // look for an occurrence of our pattern and store the starting position var match = node.data.match( new RegExp( (^|\\s) + $.escapeRE( pat ), i ) ); if ( match ) { var pos = match.index + match[1].length; // include length of any matched spaces Modified: trunk/phase3/tests/phpunit/includes/IPTest.php === --- trunk/phase3/tests/phpunit/includes/IPTest.php 2012-03-19 21:37:02 UTC (rev 114191) +++ trunk/phase3/tests/phpunit/includes/IPTest.php 2012-03-19 21:40:39 UTC (rev 114192) @@ -14,9 +14,9 @@ $this-assertFalse( IP::isIPAddress( ), 'Empty string is not an IP' ); $this-assertFalse( IP::isIPAddress( 'abc' ), 'Garbage IP string' ); $this-assertFalse( IP::isIPAddress( ':' ), 'Single : is not an IP' ); - $this-assertFalse( IP::isIPAddress( '2001:0DB8::A:1::1'), 'IPv6 with a double :: occurence' ); - $this-assertFalse( IP::isIPAddress( '2001:0DB8::A:1::'), 'IPv6 with a double :: occurence, last at end' ); - $this-assertFalse( IP::isIPAddress( '::2001:0DB8::5:1'), 'IPv6 with a double :: occurence, firt at beginning' ); + $this-assertFalse( IP::isIPAddress( '2001:0DB8::A:1::1'), 'IPv6 with a double :: occurrence' ); + $this-assertFalse( IP::isIPAddress( '2001:0DB8::A:1::'), 'IPv6 with a double :: occurrence, last at end' ); + $this-assertFalse( IP::isIPAddress( '::2001:0DB8::5:1'), 'IPv6 with a double :: occurrence, firt at beginning' ); $this-assertFalse( IP::isIPAddress( '124.24.52' ), 'IPv4 not enough quads' ); $this-assertFalse( IP::isIPAddress( '24.324.52.13' ), 'IPv4 out of range' ); $this-assertFalse( IP::isIPAddress( '.24.52.13' ), 'IPv4 starts with period' ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114193] trunk/extensions/MobileFrontend/templates/ApplicationTemplate .php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114193 Revision: 114193 Author: awjrichards Date: 2012-03-19 21:41:49 + (Mon, 19 Mar 2012) Log Message: --- Bumping css/js version #s Modified Paths: -- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 21:40:39 UTC (rev 114192) +++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 21:41:49 UTC (rev 114193) @@ -36,7 +36,7 @@ $jQuerySupport = $this-data['device']['supports_jquery']; $jQueryScript = $jQuerySupport ? $startScriptTag . $javaScriptPath . 'jquery-1.7.1.min.js' . $endScriptTag : ''; - $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=122920111241' . $endScriptTag : ''; + $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=1332193250' . $endScriptTag : ''; $startLinkTag = link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/; $endLinkTag = ' media='all' rel='Stylesheet' type='text/css' /; @@ -59,7 +59,7 @@ if( $this-data['isBetaGroupMember'] $jQuerySupport ) { $betajs = HTML - {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version=1331257310{$endScriptTag} + {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version=1332193250{$endScriptTag} HTML; } else { $betajs = ; @@ -71,8 +71,8 @@ head title{$this-data['htmlTitle']}/title meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331678715' media='all' rel='Stylesheet' type='text/css' / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331678715' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1332193250' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1332193250' media='all' rel='Stylesheet' type='text/css' / {$filePageStyle} meta name=viewport content=initial-scale=1.0 {$appleTouchIconTag} @@ -90,10 +90,10 @@ /div {$this-data['footerHtml']} !--[if gt IE 9]!-- - {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js?version=1331257310{$endScriptTag} - {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js?version=1331257310{$endScriptTag} - {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1331257310{$endScriptTag} - {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1331250599{$endScriptTag} + {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js?version=1332193250{$endScriptTag} + {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js?version=1332193250{$endScriptTag} + {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1332193250{$endScriptTag} + {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1332193250{$endScriptTag} {$betajs} {$filePageScript} !--[endif]-- ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114194] trunk/extensions/ArticleFeedbackv5
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114194 Revision: 114194 Author: emsmith Date: 2012-03-19 21:42:01 + (Mon, 19 Mar 2012) Log Message: --- bug 35254 - oversight items (request and unrequest oversight, decline oversight, oversight and unoversight) now go directly to the suppressionlog instead of into the afv5 activity log Modified Paths: -- trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.php trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php Modified: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.php === --- trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.php2012-03-19 21:41:49 UTC (rev 114193) +++ trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.php2012-03-19 21:42:01 UTC (rev 114194) @@ -312,12 +312,12 @@ $wgLogTypes[] = 'articlefeedbackv5'; $wgLogNames['articlefeedbackv5'] = 'articlefeedbackv5-log-name'; $wgLogHeaders['articlefeedbackv5'] = 'articlefeedbackv5-log-header'; -$wgLogActions['articlefeedbackv5/oversight'] = 'articlefeedbackv5-log-oversight'; -$wgLogActions['articlefeedbackv5/unoversight'] = 'articlefeedbackv5-log-unoversight'; +$wgLogActions['suppress/oversight'] = 'articlefeedbackv5-log-oversight'; +$wgLogActions['suppress/unoversight'] = 'articlefeedbackv5-log-unoversight'; $wgLogActions['articlefeedbackv5/hidden'] = 'articlefeedbackv5-log-hidden'; $wgLogActions['articlefeedbackv5/unhidden'] = 'articlefeedbackv5-log-unhidden'; -$wgLogActions['articlefeedbackv5/decline'] = 'articlefeedbackv5-log-decline'; -$wgLogActions['articlefeedbackv5/request'] = 'articlefeedbackv5-log-request'; -$wgLogActions['articlefeedbackv5/unrequest'] = 'articlefeedbackv5-log-unrequest'; +$wgLogActions['suppress/decline'] = 'articlefeedbackv5-log-decline'; +$wgLogActions['suppress/request'] = 'articlefeedbackv5-log-request'; +$wgLogActions['suppress/unrequest'] = 'articlefeedbackv5-log-unrequest'; $wgLogActions['articlefeedbackv5/flag'] = 'articlefeedbackv5-log-flag'; $wgLogActions['articlefeedbackv5/unflag'] = 'articlefeedbackv5-log-unflag'; Modified: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php === --- trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php 2012-03-19 21:41:49 UTC (rev 114193) +++ trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php 2012-03-19 21:42:01 UTC (rev 114194) @@ -215,11 +215,21 @@ $valid = array( 'oversight', 'unoversight', 'hidden', 'unhidden', 'decline', 'request', 'unrequest', 'flag', 'unflag' ); + // suppress + $suppress = array( 'oversight', 'unoversight', 'decline', 'request', 'unrequest'); + // if we do not have a valid action, return immediately if ( !in_array( $type, $valid ) ) { return; } + // log type might be afv5 or suppress + $logtype = 'articlefeedbackv5'; + + if ( in_array( $type, $suppress ) ) { + $logtype = 'suppress'; + } + // we only have the page id, we need the string page name for the permalink $title_object = Title::newFromID( $pageId ); @@ -251,7 +261,7 @@ $doer = null; } - $log = new LogPage( 'articlefeedbackv5' ); + $log = new LogPage( $logtype, false ); // comments become the notes section from the feedback $log-addEntry( $type, $permalink, $notes, array(), $doer ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114195] trunk/extensions/EducationProgram
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114195 Revision: 114195 Author: jeroendedauw Date: 2012-03-19 21:49:18 + (Mon, 19 Mar 2012) Log Message: --- more work on caching of special:institutions and special:courses Modified Paths: -- trunk/extensions/EducationProgram/actions/ViewOrgAction.php trunk/extensions/EducationProgram/includes/EPCourse.php trunk/extensions/EducationProgram/includes/EPOrg.php trunk/extensions/EducationProgram/specials/SpecialCourses.php trunk/extensions/EducationProgram/specials/SpecialInstitutions.php Modified: trunk/extensions/EducationProgram/actions/ViewOrgAction.php === --- trunk/extensions/EducationProgram/actions/ViewOrgAction.php 2012-03-19 21:42:01 UTC (rev 114194) +++ trunk/extensions/EducationProgram/actions/ViewOrgAction.php 2012-03-19 21:49:18 UTC (rev 114195) @@ -45,12 +45,13 @@ $out-addElement( 'h2', array(), wfMsg( 'ep-institution-courses' ) ); - $out-addHTML( EPCourse::displayPager( $this-getContext(), array( 'org_id' = $org-getId() ) ) ); + $out-addHTML( EPCourse::getPager( $this-getContext(), array( 'org_id' = $org-getId() ) ) ); if ( $this-getUser()-isAllowed( 'ep-course' ) ) { $out-addElement( 'h2', array(), wfMsg( 'ep-institution-add-course' ) ); - EPCourse::displayAddNewControl( $this-getContext(), array( 'org' = $org-getId() ) ); + $out-addModules( 'ep.addcourse' ); + $out-addHTML( EPCourse::getAddNewControl( $this-getContext(), array( 'org' = $org-getId() ) ) ); } } Modified: trunk/extensions/EducationProgram/includes/EPCourse.php === --- trunk/extensions/EducationProgram/includes/EPCourse.php 2012-03-19 21:42:01 UTC (rev 114194) +++ trunk/extensions/EducationProgram/includes/EPCourse.php 2012-03-19 21:49:18 UTC (rev 114195) @@ -293,32 +293,30 @@ * @param IContextSource $context * @param array $args * -* @return boolean +* @return string */ - public static function displayAddNewControl( IContextSource $context, array $args ) { + public static function getAddNewControl( IContextSource $context, array $args ) { if ( !$context-getUser()-isAllowed( 'ep-course' ) ) { - return false; + return ''; } - $out = $context-getOutput(); - - $out-addModules( 'ep.addcourse' ); + $html = ''; - $out-addHTML( Html::openElement( + $html .= Html::openElement( 'form', array( 'method' = 'post', 'action' = EPCourses::singleton()-getTitleFor( 'NAME_PLACEHOLDER' )-getLocalURL( array( 'action' = 'edit' ) ), ) - ) ); + ); - $out-addHTML( 'fieldset' ); + $html .= 'fieldset'; - $out-addHTML( 'legend' . wfMsgHtml( 'ep-courses-addnew' ) . '/legend' ); + $html .= 'legend' . $context-msg( 'ep-courses-addnew' )-escaped() . '/legend'; - $out-addElement( 'p', array(), wfMsg( 'ep-courses-namedoc' ) ); + $html .= 'p' . $context-msg( 'ep-courses-namedoc' )-escaped() . '/p'; - $out-addElement( 'label', array( 'for' = 'neworg' ), wfMsg( 'ep-courses-neworg' ) ); + $html .= Html::element( 'label', array( 'for' = 'neworg' ), $context-msg( 'ep-courses-neworg' ) ); $select = new XmlSelect( 'neworg', @@ -327,39 +325,39 @@ ); $select-addOptions( EPOrgs::singleton()-getOrgOptions() ); - $out-addHTML( $select-getHTML() ); + $html .= $select-getHTML(); - $out-addHTML( '#160;' . Xml::inputLabel( - wfMsg( 'ep-courses-newname' ), + $html .= '#160;' . Xml::inputLabel( + $context-msg( 'ep-courses-newname' )-escaped(), 'newname', 'newname', 20, array_key_exists( 'name', $args ) ? $args['name'] : false - ) ); + ); - $out-addHTML( '#160;' . Xml::inputLabel( - wfMsg( 'ep-courses-newterm' ), + $html .= '#160;' . Xml::inputLabel( + $context-msg( 'ep-courses-newterm' )-escaped(), 'newterm', 'newterm', 10, array_key_exists( 'term', $args ) ? $args['term']
[MediaWiki-CVS] SVN: [114196] trunk/extensions/EducationProgram
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114196 Revision: 114196 Author: jeroendedauw Date: 2012-03-19 21:59:14 + (Mon, 19 Mar 2012) Log Message: --- fix up a bunch of messages Modified Paths: -- trunk/extensions/EducationProgram/includes/EPCourse.php trunk/extensions/EducationProgram/includes/EPOrg.php trunk/extensions/EducationProgram/specials/SpecialInstitutions.php Modified: trunk/extensions/EducationProgram/includes/EPCourse.php === --- trunk/extensions/EducationProgram/includes/EPCourse.php 2012-03-19 21:49:18 UTC (rev 114195) +++ trunk/extensions/EducationProgram/includes/EPCourse.php 2012-03-19 21:59:14 UTC (rev 114196) @@ -316,7 +316,7 @@ $html .= 'p' . $context-msg( 'ep-courses-namedoc' )-escaped() . '/p'; - $html .= Html::element( 'label', array( 'for' = 'neworg' ), $context-msg( 'ep-courses-neworg' ) ); + $html .= Html::element( 'label', array( 'for' = 'neworg' ), $context-msg( 'ep-courses-neworg' )-plain() ); $select = new XmlSelect( 'neworg', @@ -328,7 +328,7 @@ $html .= $select-getHTML(); $html .= '#160;' . Xml::inputLabel( - $context-msg( 'ep-courses-newname' )-escaped(), + $context-msg( 'ep-courses-newname' )-plain(), 'newname', 'newname', 20, @@ -336,7 +336,7 @@ ); $html .= '#160;' . Xml::inputLabel( - $context-msg( 'ep-courses-newterm' )-escaped(), + $context-msg( 'ep-courses-newterm' )-plain(), 'newterm', 'newterm', 10, @@ -345,7 +345,7 @@ $html .= '#160;' . Html::input( 'addnewcourse', - $context-msg( 'ep-courses-add' )-escaped(), + $context-msg( 'ep-courses-add' )-plain(), 'submit', array( 'disabled' = 'disabled', Modified: trunk/extensions/EducationProgram/includes/EPOrg.php === --- trunk/extensions/EducationProgram/includes/EPOrg.php2012-03-19 21:49:18 UTC (rev 114195) +++ trunk/extensions/EducationProgram/includes/EPOrg.php2012-03-19 21:59:14 UTC (rev 114196) @@ -140,11 +140,12 @@ * * @since 0.1 * +* @param IContextSource $context * @param array $args * * @return string */ - public static function getAddNewControl( array $args = array() ) { + public static function getAddNewControl( IContextSource $context, array $args = array() ) { $html = ''; $html .= Html::openElement( @@ -157,12 +158,12 @@ $html .= 'fieldset'; - $html .= 'legend' . wfMsgHtml( 'ep-institutions-addnew' ) . '/legend'; + $html .= 'legend' . $context-msg( 'ep-institutions-addnew' )-escaped() . '/legend'; - $html .= Html::element( 'p', array(), wfMsg( 'ep-institutions-namedoc' ) ); + $html .= Html::element( 'p', array(), $context-msg( 'ep-institutions-namedoc' )-plain() ); $html .= Xml::inputLabel( - wfMsg( 'ep-institutions-newname' ), + $context-msg( 'ep-institutions-newname' )-plain(), 'newname', 'newname', false, @@ -171,7 +172,7 @@ $html .= '#160;' . Html::input( 'addneworg', - wfMsg( 'ep-institutions-add' ), + $context-msg( 'ep-institutions-add' )-plain(), 'submit', array( 'disabled' = 'disabled', Modified: trunk/extensions/EducationProgram/specials/SpecialInstitutions.php === --- trunk/extensions/EducationProgram/specials/SpecialInstitutions.php 2012-03-19 21:49:18 UTC (rev 114195) +++ trunk/extensions/EducationProgram/specials/SpecialInstitutions.php 2012-03-19 21:59:14 UTC (rev 114196) @@ -40,7 +40,7 @@ if ( $this-getUser()-isAllowed( 'ep-org' ) ) { $this-getOutput()-addModules( 'ep.addorg' ); - $this-addCachedHTML( 'EPOrg::getAddNewControl' ); + $this-addCachedHTML( 'EPOrg::getAddNewControl', $this-getContext() ); } $this-addCachedHTML( 'EPOrg::getPager', $this-getContext() );
[MediaWiki-CVS] SVN: [114197] branches/wmf/1.19wmf1/extensions/MobileFrontend/
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114197 Revision: 114197 Author: awjrichards Date: 2012-03-19 22:00:45 + (Mon, 19 Mar 2012) Log Message: --- Removing MobileFrontend in prep for svn cp from turnk Removed Paths: - branches/wmf/1.19wmf1/extensions/MobileFrontend/ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114198] branches/wmf/1.19wmf1/extensions/MobileFrontend/
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114198 Revision: 114198 Author: awjrichards Date: 2012-03-19 22:00:50 + (Mon, 19 Mar 2012) Log Message: --- Copy MobileFrontend from trunk at r113447 Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Added: svn:mergeinfo + /trunk/extensions/MobileFrontend:99727 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114199] trunk/extensions/SignupAPI/includes/verification.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114199 Revision: 114199 Author: akshay Date: 2012-03-19 22:10:05 + (Mon, 19 Mar 2012) Log Message: --- Fixing bug 31663 Modified Paths: -- trunk/extensions/SignupAPI/includes/verification.js Modified: trunk/extensions/SignupAPI/includes/verification.js === --- trunk/extensions/SignupAPI/includes/verification.js 2012-03-19 22:00:50 UTC (rev 114198) +++ trunk/extensions/SignupAPI/includes/verification.js 2012-03-19 22:10:05 UTC (rev 114199) @@ -19,6 +19,8 @@ } function passwordStrength() { + $(#progress).progressbar(); + $('div.ui-progressbar').css( 'background', '#F2F5F7' ); var strength = document.getElementById( 'wpPassword2val' ); var strongRegex = new RegExp( ^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$, g ); var mediumRegex = new RegExp( ^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$, g ); @@ -26,14 +28,16 @@ var pwd = document.getElementById( wpPassword2 ); if (pwd.value.length==0) { - strength.innerHTML = mw.message( 'signupapi-enterpassword' ); + var image = img src='+ imagePath + MW-Icon-AlertMark.png'; + var message = mw.message( 'signupapi-enterpassword' ) + strength.innerHTML = image + message; } else if ( pwd.value.lengthminlength ) { strength.innerHTML = mw.message( 'signupapi-passwordtooshort', minlength ); $(#progress).progressbar({value: 10}); $(div.ui-progressbar-value).css( background, red ); } else if ( strongRegex.test(pwd.value) ) { strength.innerHTML = 'span style=color:green'+mw.message( 'signupapi-strong' )+'/span'; - $(#progress).progressbar({value: 100}); + $(#progress).progressbar({value: 100}); $(div.ui-progressbar-value).css( background, green ); } else if ( mediumRegex.test(pwd.value) ) { strength.innerHTML = 'span style=color:orange'+mw.message( 'signupapi-medium' )+'/span'; @@ -81,9 +85,6 @@ $('#wpRetype').after( 'span id=wpRetypeval class=wpRetypeval/span' ); $('#wpEmail').after( 'span id=wpEmailval class=wpEmailval/span' ); - $(#progress).progressbar(); - $('div.ui-progressbar').css( 'background', '#F2F5F7' ); - var imagePath = window.wgServer+window.wgExtensionAssetsPath + /SignupAPI/includes/images/; var minlength = window.wgMinimalPasswordLength; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114200] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114200 Revision: 114200 Author: awjrichards Date: 2012-03-19 22:16:13 + (Mon, 19 Mar 2012) Log Message: --- r113463, r113465, r113466, r113469, r113470, r113471, r113472 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/fixtures.js Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js 2012-03-19 22:10:05 UTC (rev 114199) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js 2012-03-19 22:16:13 UTC (rev 114200) @@ -3,18 +3,13 @@ MobileFrontend.opensearch = (function() { var apiUrl = '/api.php', timer = -1, typingDelay = 500, numResults = 15, term, - results = document.getElementById( 'results' ), search = document.getElementById( 'search' ), sq = document.getElementById( 'sq' ), sb = document.getElementById( 'searchbox' ), - logo = document.getElementById( 'logo' ), - goButton = document.getElementById( 'goButton' ), content = document.getElementById( 'content' ), footer = document.getElementById( 'footer' ), - zeroRatedBanner = document.getElementById( 'zero-rated-banner' ) || - document.getElementById( 'zero-rated-banner-red' ), clearSearch = document.getElementById( 'clearsearch' ), - focused = false, ol = {}, + focused = false, u = MobileFrontend.utils; if ( scriptPath ) { @@ -40,8 +35,7 @@ resetViewPort(); search.onfocus = function() { - var pE, pT, pTT, rrd, rrdD, - removeResultsEl; + var rrd, rrdD; sb = document.getElementById( 'searchbox' ); sq = document.getElementById( 'sq' ); content = document.getElementById( 'content' ); @@ -51,25 +45,8 @@ if ( !focused ) { MobileFrontend.utils( document.body ).addClass( 'full-screen-search' ); - pE = document.getElementById( 'placeholder' ); - if ( !pE ) { - pT = document.createElement( 'span' ); - pTT = document.createTextNode(placeholder); - pT.setAttribute( 'id', 'placeholder' ); - pT.appendChild(pTT); - sb.insertBefore( pT, sb.firstChild ); - } - pE = document.getElementById( 'placeholder' ); - if ( pE ) { - pE.style.display = 'block'; - } - - if ( pE search.value !== '' ) { - pE.style.display = 'none'; - } - - removeResultsEl = document.getElementById( 'remove-results' ); - if ( !removeResultsEl ) { + rrd = document.getElementById( 'remove-results' ); + if ( !rrd ) { rrd = document.createElement( 'a' ); rrd.setAttribute( 'href', '#' ); rrd.setAttribute( 'id', 'remove-results' ); @@ -85,12 +62,7 @@ function removeResults() { MobileFrontend.utils( document.body ).removeClass( 'full-screen-search' ); - var removeResultsEl, pE = document.getElementById( 'placeholder' ); - if ( pE ) { - pE.style.display = 'none'; - } - if ( focused ) { focused = false; } @@ -182,8 +154,8 @@ } function htmlEntities( str ) { - var text = document.createTextNode( str ); - var el = document.createElement( 'div' ); + var text = document.createTextNode( str ), +
[MediaWiki-CVS] SVN: [114201] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114201 Revision: 114201 Author: awjrichards Date: 2012-03-19 22:18:07 + (Mon, 19 Mar 2012) Log Message: --- MFT r113486, r113488, r113512, r113553, r113640, r113642, r113644, r113645, r113685, r113693, r113695, r113714, r113720, r113721, r113726, r113730, r113769, r113770, r113771, r113778 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/fixtures.js branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_application.js Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_toggle.js Removed Paths: - branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_application.js Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile2012-03-19 22:16:13 UTC (rev 114200) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile2012-03-19 22:18:07 UTC (rev 114201) @@ -2,5 +2,5 @@ java -jar yuicompressor-2.4.6.jar javascripts/application.js -o javascripts/application.min.js java -jar yuicompressor-2.4.6.jar javascripts/banner.js -o javascripts/banner.min.js java -jar yuicompressor-2.4.6.jar javascripts/opensearch.js -o javascripts/opensearch.min.js - java -jar yuicompressor-2.4.6.jar javascripts/beta_application.js -o javascripts/beta_application.min.js + java -jar yuicompressor-2.4.6.jar javascripts/toggle.js -o javascripts/toggle.min.js java -jar yuicompressor-2.4.6.jar javascripts/beta_opensearch.js -o javascripts/beta_opensearch.min.js Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 22:16:13 UTC (rev 114200) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 22:18:07 UTC (rev 114201) @@ -1276,6 +1276,7 @@ $testModules['qunit']['ext.mobilefrontend.tests'] = array( 'scripts' = array( 'tests/js/fixtures.js', 'javascripts/application.js', 'javascripts/opensearch.js', 'javascripts/banner.js', + 'javascripts/toggle.js', 'tests/js/test_toggle.js', 'tests/js/test_application.js', 'tests/js/test_opensearch.js', 'tests/js/test_banner.js' ), 'dependencies' = array( ), 'localBasePath' = dirname( __FILE__ ), Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php 2012-03-19 22:16:13 UTC (rev 114200) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php 2012-03-19 22:18:07 UTC (rev 114201) @@ -197,7 +197,7 @@ public function getExamples() { return array( - 'api.php?action=queryprop=excerptlength=175titles=Therion' = 'Get a 175-character
[MediaWiki-CVS] SVN: [114202] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114202 Revision: 114202 Author: awjrichards Date: 2012-03-19 22:23:33 + (Mon, 19 Mar 2012) Log Message: --- MFT r113807, r113831, r113832, r113865, r113866, r113870, r113871, r113872, r113876, r113880, r113881, r113882, r113883, r113885, r113887, r113897, r113898, r113899, r113900, r113901 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.i18n.php branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.js branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/operamini.css branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/FooterTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/MobileFrontendTest.php branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_application.js branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_toggle.js Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/arrow-left-beta.png branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/close-button-beta.png Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 22:18:07 UTC (rev 114201) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 22:23:33 UTC (rev 114202) @@ -26,7 +26,6 @@ public static $searchField; public static $disableImagesURL; public static $enableImagesURL; - public static $disableMobileSiteURL; public static $viewNormalSiteURL; public static $currentURL; public static $displayNoticeId; @@ -72,7 +71,6 @@ 'mobile-frontend-hide-button', 'mobile-frontend-back-to-top-of-section', 'mobile-frontend-regular-site', - 'mobile-frontend-perm-stop-redirect', 'mobile-frontend-home-button', 'mobile-frontend-random-button', 'mobile-frontend-are-you-sure', @@ -231,8 +229,7 @@ self::$disableImagesURL = $wgRequest-escapeAppendQuery( 'disableImages=1' ); self::$enableImagesURL = $wgRequest-escapeAppendQuery( 'enableImages=1' ); - self::$disableMobileSiteURL = $wgRequest-escapeAppendQuery( 'mobileaction=disable_mobile_site' ); - self::$viewNormalSiteURL = $wgRequest-escapeAppendQuery( 'mobileaction=view_normal_site' ); + self::$viewNormalSiteURL = $wgRequest-escapeAppendQuery( 'useformat=desktop' ); self::$currentURL = $wgRequest-getFullRequestURL(); self::$leaveFeedbackURL = $wgRequest-escapeAppendQuery( 'mobileaction=leave_feedback' ); @@ -477,12 +474,6 @@ exit(); } - if ( $mobileAction == 'disable_mobile_site' $this-contentFormat == 'XHTML' ) { - echo $this-renderDisableMobileSiteXHTML(); - wfProfileOut( __METHOD__ ); - exit(); - } - if ( $mobileAction == 'opt_in_mobile_site' $this-contentFormat == 'XHTML' ) { echo $this-renderOptInMobileSiteXHTML(); wfProfileOut( __METHOD__ ); @@ -716,6 +707,7 @@ } $wgOut-addVaryHeader( 'Cookie' ); $wgOut-addVaryHeader( 'X-Carrier' ); + $wgOut-addVaryHeader( 'X-Images' ); wfProfileOut( __METHOD__ ); return true; } @@
[MediaWiki-CVS] SVN: [114203] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114203 Revision: 114203 Author: awjrichards Date: 2012-03-19 22:24:16 + (Mon, 19 Mar 2012) Log Message: --- MFT r113930 Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_toggle.js Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930 Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.js ___ Added: svn:eol-style + native Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.min.js ___ Added: svn:eol-style + native Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_toggle.js ___ 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: [114204] trunk/extensions/EducationProgram
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114204 Revision: 114204 Author: jeroendedauw Date: 2012-03-19 22:25:17 + (Mon, 19 Mar 2012) Log Message: --- caching of special:students, cas, oas Modified Paths: -- trunk/extensions/EducationProgram/includes/EPCA.php trunk/extensions/EducationProgram/includes/EPOA.php trunk/extensions/EducationProgram/includes/EPStudent.php trunk/extensions/EducationProgram/specials/SpecialCAs.php trunk/extensions/EducationProgram/specials/SpecialOAs.php trunk/extensions/EducationProgram/specials/SpecialStudents.php Modified: trunk/extensions/EducationProgram/includes/EPCA.php === --- trunk/extensions/EducationProgram/includes/EPCA.php 2012-03-19 22:24:16 UTC (rev 114203) +++ trunk/extensions/EducationProgram/includes/EPCA.php 2012-03-19 22:25:17 UTC (rev 114204) @@ -20,22 +20,23 @@ * * @param IContextSource $context * @param array $conditions +* +* @return string */ - public static function displayPager( IContextSource $context, array $conditions = array() ) { + public static function getPager( IContextSource $context, array $conditions = array() ) { $pager = new EPCAPager( $context, $conditions ); if ( $pager-getNumRows() ) { - $context-getOutput()-addHTML( + return $pager-getFilterControl() . - $pager-getNavigationBar() . - $pager-getBody() . - $pager-getNavigationBar() . - $pager-getMultipleItemControl() - ); + $pager-getNavigationBar() . + $pager-getBody() . + $pager-getNavigationBar() . + $pager-getMultipleItemControl(); } else { - $context-getOutput()-addHTML( $pager-getFilterControl( true ) ); - $context-getOutput()-addWikiMsg( 'ep-ca-noresults' ); + return $pager-getFilterControl( true ) . + $context-msg( 'ep-ca-noresults' )-escaped(); } } Modified: trunk/extensions/EducationProgram/includes/EPOA.php === --- trunk/extensions/EducationProgram/includes/EPOA.php 2012-03-19 22:24:16 UTC (rev 114203) +++ trunk/extensions/EducationProgram/includes/EPOA.php 2012-03-19 22:25:17 UTC (rev 114204) @@ -20,22 +20,23 @@ * * @param IContextSource $context * @param array $conditions +* +* @return string */ - public static function displayPager( IContextSource $context, array $conditions = array() ) { + public static function getPager( IContextSource $context, array $conditions = array() ) { $pager = new EPOAPager( $context, $conditions ); if ( $pager-getNumRows() ) { - $context-getOutput()-addHTML( + return $pager-getFilterControl() . - $pager-getNavigationBar() . - $pager-getBody() . - $pager-getNavigationBar() . - $pager-getMultipleItemControl() - ); + $pager-getNavigationBar() . + $pager-getBody() . + $pager-getNavigationBar() . + $pager-getMultipleItemControl(); } else { - $context-getOutput()-addHTML( $pager-getFilterControl( true ) ); - $context-getOutput()-addWikiMsg( 'ep-oa-noresults' ); + return $pager-getFilterControl( true ) . + $context-msg( 'ep-oa-noresults' )-escaped(); } } Modified: trunk/extensions/EducationProgram/includes/EPStudent.php === --- trunk/extensions/EducationProgram/includes/EPStudent.php2012-03-19 22:24:16 UTC (rev 114203) +++ trunk/extensions/EducationProgram/includes/EPStudent.php2012-03-19 22:25:17 UTC (rev 114204) @@ -20,22 +20,23 @@ * * @param IContextSource $context * @param array $conditions +* +* @return string */ - public static function displayPager( IContextSource $context, array $conditions = array() ) { + public static function getPager( IContextSource $context, array
[MediaWiki-CVS] SVN: [114205] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114205 Revision: 114205 Author: awjrichards Date: 2012-03-19 22:25:24 + (Mon, 19 Mar 2012) Log Message: --- MFT r113942, r113971, r113987, r114005, r114025, r114100 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/DisableTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/FooterTemplate.php Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile2012-03-19 22:25:17 UTC (rev 114204) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile2012-03-19 22:25:24 UTC (rev 114205) @@ -3,4 +3,5 @@ java -jar yuicompressor-2.4.6.jar javascripts/banner.js -o javascripts/banner.min.js java -jar yuicompressor-2.4.6.jar javascripts/opensearch.js -o javascripts/opensearch.min.js java -jar yuicompressor-2.4.6.jar javascripts/toggle.js -o javascripts/toggle.min.js + java -jar yuicompressor-2.4.6.jar javascripts/references.js -o javascripts/references.min.js java -jar yuicompressor-2.4.6.jar javascripts/beta_opensearch.js -o javascripts/beta_opensearch.min.js Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 22:25:17 UTC (rev 114204) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 22:25:24 UTC (rev 114205) @@ -43,6 +43,7 @@ public static $logoutHtml; public static $loginHtml; public static $zeroRatedBanner; + public static $useFormatCookieName; protected $useFormat; @@ -190,7 +191,7 @@ * @return bool */ public function addMobileFooter( $obj, $tpl ) { - global $wgRequest; + global $wgRequest, $wgServer; wfProfileIn( __METHOD__ ); $title = $obj-getTitle(); @@ -202,6 +203,7 @@ $this-removeQueryStringParameter( $wgRequest-appendQuery( 'useformat=mobile' ), 'mobileaction' ) ); + $mobileViewUrl = $this-getMobileUrl( $wgServer . $mobileViewUrl ); $tpl-set( 'mobileview', a href='{$mobileViewUrl}' class='noprint' . wfMsg( 'mobile-frontend-view' ) . /a ); $footerlinks['places'][] = 'mobileview'; $tpl-set( 'footerlinks', $footerlinks ); @@ -1163,6 +1165,8 @@ 'zeroRatedBanner' = self::$zeroRatedBanner, 'showText' = self::$messages[ 'mobile-frontend-show-button' ], 'hideText' = self::$messages[ 'mobile-frontend-hide-button' ], + 'useFormatCookieName' = self::$useFormatCookieName, + 'useFormatCookieDuration' = $this-getUseFormatCookieDuration(), ); $applicationTemplate-setByArray( $options ); wfProfileOut( __METHOD__ ); @@ -1445,8 +1449,12 @@ }
[MediaWiki-CVS] SVN: [114206] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114206 Revision: 114206 Author: awjrichards Date: 2012-03-19 22:26:47 + (Mon, 19 Mar 2012) Log Message: --- MFT r114134, r114136, r114144, r114145, r114150, r114152, r114157 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js branches/wmf/1.19wmf1/extensions/MobileFrontend/library/WURFL/Handlers/Utils.php branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js 2012-03-19 22:25:24 UTC (rev 114205) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js 2012-03-19 22:26:47 UTC (rev 114206) @@ -1,7 +1,12 @@ if( typeof jQuery !== 'undefined' ) { MobileFrontend.references = (function($) { - var calculatePosition; + var calculatePosition, hashtest, options = {}; + hashtest = window.location.hash.substr(1).match(/refspeed:([0-9]*)/); + options.animationSpeed = hashtest ? parseInt( hashtest[1], 10 ) : 500; + hashtest = window.location.hash.substr(1).match(/refanimation:([a-z]*)/); + options.animation = hashtest ? hashtest[1] : null; + function collect() { var references = {}; $( 'ol.references li' ).each(function(i, el) { @@ -28,27 +33,51 @@ function init() { $( 'div id=mf-referencesdiv/div/div' ).hide().appendTo( document.body ); - var close = function( ev ) { - $( '#mf-references' ).fadeOut( 500 ); - }; + var close = function() { + var top; + lastLink = null; + if( options.animation === 'none' ) { + $( '#mf-references' ).hide(); + } else if( options.animation === 'slide' ){ + top = window.innerHeight + window.pageYOffset; + $( '#mf-references' ).show().animate( { top: top }, options.animationSpeed ); + } else { + $( '#mf-references' ).fadeOut( options.animationSpeed ); + } + }, lastLink; $( 'buttonclose/button' ).click( close ).appendTo( '#mf-references' ); $( '.mw-cite-backlink a' ).click( close ); var data, html, href, references = collect(); $( 'sup a' ).click( function(ev) { + var top, oh; href = $(this).attr( 'href' ); data = href href.charAt(0) === '#' ? references[ href.substr( 1, href.length ) ] : null; - if( data ) { - html = 'h3[' + data.label + ']/h3' + data.html; + if( !$(#mf-references).is(:visible) || lastLink !== href) { + lastLink = href; + if( data ) { + html = 'h3[' + data.label + ']/h3' + data.html; + } else { + html = $( 'a /' ).text( $(this).text() ). +
[MediaWiki-CVS] SVN: [114207] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114207 Revision: 114207 Author: awjrichards Date: 2012-03-19 22:28:20 + (Mon, 19 Mar 2012) Log Message: --- MFT r114177, r114184, r114190, r114191, r114193 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.min.js Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js 2012-03-19 22:26:47 UTC (rev 114206) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js 2012-03-19 22:28:20 UTC (rev 114207) @@ -1 +1 @@ -MobileFrontend.opensearch=(function(){var c=/api.php,m=-1,d=500,z=15,q,l=document.getElementById(search),t=document.getElementById(sq),a=document.getElementById(searchbox),r=document.getElementById(content),o=document.getElementById(footer),x=document.getElementById(clearsearch),k=false,n=MobileFrontend.utils;c=MobileFrontend.setting(scriptPath)+c;function s(){results.style.display=none}function h(){if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)){var u=n('meta[name=viewport]');if(u){u=u[0];u.content=width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0;n(document.body).bind(gesturestart,function(){u.content=width=device-width, initial-scale=1.0})}}}h();l.onfocus=function(){var u,A;a=document.getElementById(searchbox);t=document.getElementById(sq);r=document.getElementById(content);o=document.getElementById(footer);h();if(!k){MobileFrontend.utils(document.body).addClass(full-screen-search);u=document.getElementById(remove-results);if(!u){u=document.createElement(a);u.setAttribute(href,#);u.setAttribute(id,remove-results);n(u).bind(click,y);A=document.createElement(div);A.setAttribute(id,left-arrow);u.appendChild(A);t.insertBefore(u,t.firstChild)}k=true}};function y(){MobileFrontend.utils(document.body).removeClass(full-screen-search);if(k){k=false}if(x){x.style.display=none}}function b(A){var u;if(!A){A=window.event}if(A.target){u=A.target}else{if(A.srcElement){u=A.srcElement}}if(u.nodeType===3){u=u.parentNode}A.cancelBubble=true;A.stopPropagation();if(u.className===suggestion-result||u.className===search-result-item||u.className===suggestions-result||u.className===sq-val-update||u.id===results||u.id===search||u.id===searchbox||u.id===sq||u.id===placeholder||u.id===clearsearch||u.tagName===BODY){if(u.id===clearsearchresults){results.innerHTML=}}else{s()}}window.onload=function(){n(l).bind(keyup,function(){clearTimeout(m);q=this.value;if(q.length1){results.innerHTML=}else{q=encodeURIComponent(q);m=setTimeout(function(){j(q)},d)}})};function j(u){url=c+?action=opensearchlimit=+z+namespace=0format=xmlsearch=+u;n.ajax({url:url,success:function(A){p(g(A))}})}function g(D){var E=[],A,B,C,u=D.getElementsByTagName(Item);for(A=0;Au.length;A++){B=u[A];C={label:B.getElementsByTagName(Text)[0].textContent,value:B.getElementsByTagName(Url)[0].textContent};E.push(C)}return E}function i(A){var u=document.getElementById(search);if(u){u.value=A+ ;u.focus();j(u.value)}}function e(B){var A=document.createTextNode(B),u=document.createElement(div);u.appendChild(A);return u.innerHTML}function w(u){return
[MediaWiki-CVS] SVN: [114208] trunk/phase3/includes/specials/SpecialCachedPage.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114208 Revision: 114208 Author: jeroendedauw Date: 2012-03-19 22:37:05 + (Mon, 19 Mar 2012) Log Message: --- only init if not already done so Modified Paths: -- trunk/phase3/includes/specials/SpecialCachedPage.php Modified: trunk/phase3/includes/specials/SpecialCachedPage.php === --- trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 22:28:20 UTC (rev 114207) +++ trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 22:37:05 UTC (rev 114208) @@ -78,19 +78,21 @@ * @param boolean|null $cacheEnabled Sets if the cache should be enabled or not. */ public function startCache( $cacheExpiry = null, $cacheEnabled = null ) { - if ( !is_null( $cacheExpiry ) ) { - $this-cacheExpiry = $cacheExpiry; - } + if ( is_null( $this-hasCached ) ) { + if ( !is_null( $cacheExpiry ) ) { + $this-cacheExpiry = $cacheExpiry; + } - if ( !is_null( $cacheEnabled ) ) { - $this-setCacheEnabled( $cacheEnabled ); - } + if ( !is_null( $cacheEnabled ) ) { + $this-setCacheEnabled( $cacheEnabled ); + } - if ( $this-getRequest()-getText( 'action' ) === 'purge' ) { - $this-hasCached = false; + if ( $this-getRequest()-getText( 'action' ) === 'purge' ) { + $this-hasCached = false; + } + + $this-initCaching(); } - - $this-initCaching(); } /** ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114209] trunk/phase3/includes/specials/SpecialCachedPage.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114209 Revision: 114209 Author: jeroendedauw Date: 2012-03-19 22:49:00 + (Mon, 19 Mar 2012) Log Message: --- fix subpage linking Modified Paths: -- trunk/phase3/includes/specials/SpecialCachedPage.php Modified: trunk/phase3/includes/specials/SpecialCachedPage.php === --- trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 22:37:05 UTC (rev 114208) +++ trunk/phase3/includes/specials/SpecialCachedPage.php2012-03-19 22:49:00 UTC (rev 114209) @@ -108,8 +108,12 @@ unset( $refreshArgs['title'] ); $refreshArgs['action'] = 'purge'; + $subPage = $this-getTitle()-getFullText(); + $subPage = explode( '/', $subPage, 2 ); + $subPage = count( $subPage ) 1 ? $subPage[1] : false; + $refreshLink = Linker::link( - $this-getTitle( $this-getTitle()-getSubpageText() ), + $this-getTitle( $subPage ), $this-msg( 'cachedspecial-refresh-now' )-escaped(), array(), $refreshArgs ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114210] trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114210 Revision: 114210 Author: catrope Date: 2012-03-19 23:14:49 + (Mon, 19 Mar 2012) Log Message: --- Followup r114085: add message documentation Modified Paths: -- trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php Modified: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php === --- trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php 2012-03-19 22:49:00 UTC (rev 114209) +++ trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php 2012-03-19 23:14:49 UTC (rev 114210) @@ -552,6 +552,7 @@ 'articlefeedbackv5-mask-text-hidden' = 'Text to be displayed on the hidden post mask', 'articlefeedbackv5-mask-text-oversight' = 'Text to be displayed on the oversighted post mask', 'articlefeedbackv5-mask-postnumber' = 'Template for post number, to be displayed on the hidden post mask', + 'articlefeedbackv5-special-disclaimer' = 'Cautionary text that is displayed in red at the top of the feedback dashboard. This will be removed when the requirements and design of this feature are more final.', 'articlefeedbackv5-noteflyover-hide-caption' = 'Hide post note flyover panel - panel caption', 'articlefeedbackv5-noteflyover-hide-label' = 'Hide post note flyover panel - text area label', 'articlefeedbackv5-noteflyover-hide-placeholder' = 'Hide post note flyover panel - text area placeholder text', ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114211] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114211 Revision: 114211 Author: awjrichards Date: 2012-03-19 23:19:35 + (Mon, 19 Mar 2012) Log Message: --- Added invocation of GetCacheVaryCookies hook to ad 'mf_useformat' cookie to x-vary-options Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php trunk/extensions/MobileFrontend/MobileFrontend.php trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:14:49 UTC (rev 114210) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:19:35 UTC (rev 114211) @@ -1503,6 +1503,11 @@ return $expiry; } + public function getCacheVaryCookies( $out, $cookies ) { + global $wgCookiePrefix; + $cookies[] = $wgCookiePrefix . 'mf_useformat'; + } + /** * Determine the duration the cookie should last. * Modified: trunk/extensions/MobileFrontend/MobileFrontend.php === --- trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 23:14:49 UTC (rev 114210) +++ trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 23:19:35 UTC (rev 114211) @@ -121,6 +121,8 @@ */ $wgMobileRedirectFormAction = false; +$wgMobileResourceVersion; + $wgExtMobileFrontend = null; $wgExtensionFunctions[] = 'efMobileFrontend_Setup'; @@ -134,6 +136,7 @@ $wgHooks['APIGetDescription'][] = 'ApiParseExtender::onAPIGetDescription'; $wgHooks['OpenSearchXml'][] = 'ApiQueryExtracts::onOpenSearchXml'; + function efMobileFrontend_Setup() { global $wgExtMobileFrontend, $wgHooks; $wgExtMobileFrontend = new ExtMobileFrontend(); @@ -142,6 +145,7 @@ $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( $wgExtMobileFrontend, 'addMobileFooter' ); $wgHooks['TestCanonicalRedirect'][] = array( $wgExtMobileFrontend, 'testCanonicalRedirect' ); $wgHooks['ResourceLoaderTestModules'][] = array( $wgExtMobileFrontend, 'addTestModules' ); + $wgHooks['GetCacheVaryCookies'][] = array( $wgExtMobileFrontend, 'getCacheVaryCookies' ); } /** Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 23:14:49 UTC (rev 114210) +++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 23:19:35 UTC (rev 114211) @@ -7,7 +7,7 @@ class ApplicationTemplate extends MobileFrontendTemplate { public function getHTML() { - + global $wgMobileResourceVersion; if ( $this-data['wgAppleTouchIcon'] !== false ) { $appleTouchIconTag = Html::element( 'link', array( 'rel' = 'apple-touch-icon', 'href' = $this-data['wgAppleTouchIcon'] ) ); } else { @@ -36,7 +36,7 @@ $jQuerySupport = $this-data['device']['supports_jquery']; $jQueryScript = $jQuerySupport ? $startScriptTag . $javaScriptPath . 'jquery-1.7.1.min.js' . $endScriptTag : ''; - $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=1332193250' . $endScriptTag : ''; + $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=' . $wgMobileResourceVersion . $endScriptTag : ''; $startLinkTag = link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/; $endLinkTag = ' media='all' rel='Stylesheet' type='text/css' /; @@ -59,7 +59,7 @@ if( $this-data['isBetaGroupMember'] $jQuerySupport ) { $betajs = HTML - {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version=1332193250{$endScriptTag} + {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} HTML; } else { $betajs = ; @@ -71,8 +71,8 @@ head title{$this-data['htmlTitle']}/title meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1332193250' media='all' rel='Stylesheet' type='text/css' / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1332193250' media='all' rel='Stylesheet' type='text/css' / +
[MediaWiki-CVS] SVN: [114212] trunk/extensions/MobileFrontend/templates/ApplicationTemplate .php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114212 Revision: 114212 Author: awjrichards Date: 2012-03-19 23:21:58 + (Mon, 19 Mar 2012) Log Message: --- Finishing implementation of accidentally checked in in previous commit Modified Paths: -- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 23:19:35 UTC (rev 114211) +++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 23:21:58 UTC (rev 114212) @@ -90,10 +90,10 @@ /div {$this-data['footerHtml']} !--[if gt IE 9]!-- - {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js?version=1332193250{$endScriptTag} - {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js?version=1332193250{$endScriptTag} - {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1332193250{$endScriptTag} - {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1332193250{$endScriptTag} + {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} + {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} + {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} + {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} {$betajs} {$filePageScript} !--[endif]-- ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114213] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114213 Revision: 114213 Author: awjrichards Date: 2012-03-19 23:25:18 + (Mon, 19 Mar 2012) Log Message: --- MFT r114211, r114212 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193,114211-114212 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:21:58 UTC (rev 114212) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:25:18 UTC (rev 114213) @@ -1502,6 +1502,11 @@ return $expiry; } + public function getCacheVaryCookies( $out, $cookies ) { + global $wgCookiePrefix; + $cookies[] = $wgCookiePrefix . 'mf_useformat'; + } + /** * Determine the duration the cookie should last. * Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 23:21:58 UTC (rev 114212) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 23:25:18 UTC (rev 114213) @@ -120,6 +120,8 @@ */ $wgMobileRedirectFormAction = false; +$wgMobileResourceVersion; + $wgExtMobileFrontend = null; $wgExtensionFunctions[] = 'efMobileFrontend_Setup'; @@ -132,6 +134,7 @@ $wgHooks['APIGetParamDescription'][] = 'ApiParseExtender::onAPIGetParamDescription'; $wgHooks['APIGetDescription'][] = 'ApiParseExtender::onAPIGetDescription'; + function efMobileFrontend_Setup() { global $wgExtMobileFrontend, $wgHooks; $wgExtMobileFrontend = new ExtMobileFrontend(); @@ -140,6 +143,7 @@ $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( $wgExtMobileFrontend, 'addMobileFooter' ); $wgHooks['TestCanonicalRedirect'][] = array( $wgExtMobileFrontend, 'testCanonicalRedirect' ); $wgHooks['ResourceLoaderTestModules'][] = array( $wgExtMobileFrontend, 'addTestModules' ); + $wgHooks['GetCacheVaryCookies'][] = array( $wgExtMobileFrontend, 'getCacheVaryCookies' ); } /** Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 23:21:58 UTC (rev 114212) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 23:25:18 UTC (rev 114213) @@ -7,7 +7,7 @@ class ApplicationTemplate extends MobileFrontendTemplate { public function getHTML() { - + global $wgMobileResourceVersion; if ( $this-data['wgAppleTouchIcon'] !== false ) { $appleTouchIconTag = Html::element( 'link', array( 'rel' = 'apple-touch-icon', 'href' = $this-data['wgAppleTouchIcon'] ) ); } else { @@ -36,7 +36,7 @@ $jQuerySupport = $this-data['device']['supports_jquery']; $jQueryScript = $jQuerySupport ? $startScriptTag . $javaScriptPath . 'jquery-1.7.1.min.js' . $endScriptTag : ''; - $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=1332193250' . $endScriptTag : ''; + $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=' .
[MediaWiki-CVS] SVN: [114214] trunk/extensions/MobileFrontend/MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114214 Revision: 114214 Author: awjrichards Date: 2012-03-19 23:32:55 + (Mon, 19 Mar 2012) Log Message: --- Followup r114211, adding return true to hook invocation Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:25:18 UTC (rev 114213) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:32:55 UTC (rev 114214) @@ -1506,6 +1506,7 @@ public function getCacheVaryCookies( $out, $cookies ) { global $wgCookiePrefix; $cookies[] = $wgCookiePrefix . 'mf_useformat'; + return true; } /** ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114215] trunk/phase3/includes
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114215 Revision: 114215 Author: jeroendedauw Date: 2012-03-19 23:33:25 + (Mon, 19 Mar 2012) Log Message: --- split general cache helper functionality to its own class, so we can also easily use it in stuff that does not derive from SpecialPage, such as Action Modified Paths: -- trunk/phase3/includes/AutoLoader.php trunk/phase3/includes/specials/SpecialCachedPage.php Added Paths: --- trunk/phase3/includes/CacheHelper.php Modified: trunk/phase3/includes/AutoLoader.php === --- trunk/phase3/includes/AutoLoader.php2012-03-19 23:32:55 UTC (rev 114214) +++ trunk/phase3/includes/AutoLoader.php2012-03-19 23:33:25 UTC (rev 114215) @@ -27,6 +27,7 @@ 'BadTitleError' = 'includes/Exception.php', 'BaseTemplate' = 'includes/SkinTemplate.php', 'Block' = 'includes/Block.php', + 'CacheHelper' = 'includes/CacheHelper.php', 'Category' = 'includes/Category.php', 'Categoryfinder' = 'includes/Categoryfinder.php', 'CategoryPage' = 'includes/CategoryPage.php', @@ -119,6 +120,7 @@ 'Http' = 'includes/HttpFunctions.php', 'HttpError' = 'includes/Exception.php', 'HttpRequest' = 'includes/HttpFunctions.old.php', + 'ICacheHelper' = 'includes/CacheHelper.php', 'IcuCollation' = 'includes/Collation.php', 'IdentityCollation' = 'includes/Collation.php', 'ImageGallery' = 'includes/ImageGallery.php', Added: trunk/phase3/includes/CacheHelper.php === --- trunk/phase3/includes/CacheHelper.php (rev 0) +++ trunk/phase3/includes/CacheHelper.php 2012-03-19 23:33:25 UTC (rev 114215) @@ -0,0 +1,348 @@ +?php + +interface ICacheHelper { + + /** +* Sets if the cache should be enabled or not. +* +* @since 1.20 +* @param boolean $cacheEnabled +*/ + function setCacheEnabled( $cacheEnabled ); + + /** +* Initializes the caching. +* Should be called before the first time anything is added via addCachedHTML. +* +* @since 1.20 +* +* @param integer|null $cacheExpiry Sets the cache expirty, either ttl in seconds or unix timestamp. +* @param boolean|null $cacheEnabled Sets if the cache should be enabled or not. +*/ + function startCache( $cacheExpiry = null, $cacheEnabled = null ); + + /** +* Add some HTML to be cached. +* This is done by providing a callback function that should +* return the HTML to be added. It will only be called if the +* item is not in the cache yet or when the cache has been invalidated. +* +* @since 1.20 +* +* @param {function} $computeFunction +* @param array $args +* @param string|null $key +*/ + function addCachedHTML( $computeFunction, $args = array(), $key = null ); + + /** +* Saves the HTML to the cache in case it got recomputed. +* Should be called after the last time anything is added via addCachedHTML. +* +* @since 1.20 +*/ + function saveCache(); + + /** +* Sets the time to live for the cache, in seconds or a unix timestamp indicating the point of expiry.. +* +* @since 1.20 +* +* @param integer $cacheExpiry +*/ + function setExpirey( $cacheExpiry ); + +} + +/** + * Helper class for caching various elements in a single cache entry. + * + * To get a cached value or compute it, use getCachedValue like this: + * $this-getCachedValue( $callback ); + * + * To add HTML that should be cached, use addCachedHTML like this: + * $this-addCachedHTML( $callback ); + * + * The callback function is only called when needed, so do all your expensive + * computations here. This function should returns the HTML to be cached. + * It should not add anything to the PageOutput object! + * + * Before the first addCachedHTML call, you should call $this-startCache(); + * After adding the last HTML that should be cached, call $this-saveCache(); + * + * @since 1.20 + * + * @file CacheHelper.php + * @ingroup SpecialPage + * + * @licence GNU GPL v2 or later + * @author Jeroen De Dauw jeroended...@gmail.com + */ +class CacheHelper implements ICacheHelper { + + /** +* The time to live for the cache, in seconds or a unix timestamp indicating the point of expiry. +* +* @since 1.20 +* @var integer +*/ + protected $cacheExpiry = 3600; + + /** +* List of HTML chunks to be cached (if !hasCached) or that where cashed (of hasCached). +* If no cached already, then the newly computed chunks are added here, +* if it as cached already, chunks are removed from
[MediaWiki-CVS] SVN: [114216] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114216 Revision: 114216 Author: awjrichards Date: 2012-03-19 23:33:57 + (Mon, 19 Mar 2012) Log Message: --- MFT r114214 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193,114211-114212 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193,114211-114212,114214 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:33:25 UTC (rev 114215) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:33:57 UTC (rev 114216) @@ -1505,6 +1505,7 @@ public function getCacheVaryCookies( $out, $cookies ) { global $wgCookiePrefix; $cookies[] = $wgCookiePrefix . 'mf_useformat'; + return true; } /** ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114217] trunk/phase3/includes/parser/Preprocessor_HipHop.hphp
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114217 Revision: 114217 Author: qchris Date: 2012-03-19 23:36:48 + (Mon, 19 Mar 2012) Log Message: --- Follow up to r114126: Being more conservative for HipHop compiler Modified Paths: -- trunk/phase3/includes/parser/Preprocessor_HipHop.hphp Modified: trunk/phase3/includes/parser/Preprocessor_HipHop.hphp === --- trunk/phase3/includes/parser/Preprocessor_HipHop.hphp 2012-03-19 23:33:57 UTC (rev 114216) +++ trunk/phase3/includes/parser/Preprocessor_HipHop.hphp 2012-03-19 23:36:48 UTC (rev 114217) @@ -444,7 +444,8 @@ } elseif ( $found === 'line-end' ) { $piece = $stack-getTop(); // A heading must be open, otherwise \n wouldn't have been in the search list - assert( '$piece-open === \n' ); + assert( $piece-open === \n ); // Passing the assert condition directly instead of string, as +// HPHP /compiler/ chokes on strings when ASSERT_ACTIVE != 0. $part = $piece-getCurrentPart(); // Search back through the input to see if it has a proper close // Do this using the reversed string since the other solutions (end anchor, etc.) are inefficient ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114218] trunk/extensions/EducationProgram/specials/SpecialStudent.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114218 Revision: 114218 Author: jeroendedauw Date: 2012-03-19 23:39:57 + (Mon, 19 Mar 2012) Log Message: --- fix access level of method Modified Paths: -- trunk/extensions/EducationProgram/specials/SpecialStudent.php Modified: trunk/extensions/EducationProgram/specials/SpecialStudent.php === --- trunk/extensions/EducationProgram/specials/SpecialStudent.php 2012-03-19 23:36:48 UTC (rev 114217) +++ trunk/extensions/EducationProgram/specials/SpecialStudent.php 2012-03-19 23:39:57 UTC (rev 114218) @@ -75,7 +75,7 @@ * * @return string */ - protected function getPageHTML( EPStudent $student ) { + public function getPageHTML( EPStudent $student ) { $courseIds = array_map( function( EPCourse $course ) { return $course-getId(); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114219] trunk/phase3/includes
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114219 Revision: 114219 Author: jeroendedauw Date: 2012-03-20 00:04:36 + (Tue, 20 Mar 2012) Log Message: --- follow up to r114215, fix some fails and added CachedAction implementing the same stuff as SpecialCachedPage Modified Paths: -- trunk/phase3/includes/AutoLoader.php trunk/phase3/includes/CacheHelper.php trunk/phase3/includes/specials/SpecialCachedPage.php Added Paths: --- trunk/phase3/includes/actions/CachedAction.php Modified: trunk/phase3/includes/AutoLoader.php === --- trunk/phase3/includes/AutoLoader.php2012-03-19 23:39:57 UTC (rev 114218) +++ trunk/phase3/includes/AutoLoader.php2012-03-20 00:04:36 UTC (rev 114219) @@ -259,6 +259,7 @@ 'ZipDirectoryReader' = 'includes/ZipDirectoryReader.php', # includes/actions + 'CachedAction' = 'includes/actions/CachedAction.php', 'CreditsAction' = 'includes/actions/CreditsAction.php', 'DeleteAction' = 'includes/actions/DeleteAction.php', 'EditAction' = 'includes/actions/EditAction.php', Modified: trunk/phase3/includes/CacheHelper.php === --- trunk/phase3/includes/CacheHelper.php 2012-03-19 23:39:57 UTC (rev 114218) +++ trunk/phase3/includes/CacheHelper.php 2012-03-20 00:04:36 UTC (rev 114219) @@ -1,5 +1,13 @@ ?php +/** + * Interface for all classes implementing CacheHelper functionality. + * + * @since 1.20 + * + * @licence GNU GPL v2 or later + * @author Jeroen De Dauw jeroended...@gmail.com + */ interface ICacheHelper { /** @@ -22,18 +30,20 @@ function startCache( $cacheExpiry = null, $cacheEnabled = null ); /** -* Add some HTML to be cached. -* This is done by providing a callback function that should -* return the HTML to be added. It will only be called if the -* item is not in the cache yet or when the cache has been invalidated. +* Get a cached value if available or compute it if not and then cache it if possible. +* The provided $computeFunction is only called when the computation needs to happen +* and should return a result value. $args are arguments that will be passed to the +* compute function when called. * * @since 1.20 * * @param {function} $computeFunction -* @param array $args +* @param array|mixed $args * @param string|null $key +* +* @return mixed */ - function addCachedHTML( $computeFunction, $args = array(), $key = null ); + function getCachedValue( $computeFunction, $args = array(), $key = null ); /** * Saves the HTML to the cache in case it got recomputed. @@ -73,7 +83,6 @@ * @since 1.20 * * @file CacheHelper.php - * @ingroup SpecialPage * * @licence GNU GPL v2 or later * @author Jeroen De Dauw jeroended...@gmail.com @@ -216,25 +225,7 @@ } } - - /** -* Add some HTML to be cached. -* This is done by providing a callback function that should -* return the HTML to be added. It will only be called if the -* item is not in the cache yet or when the cache has been invalidated. -* -* @since 1.20 -* -* @param {function} $computeFunction -* @param array $args -* @param string|null $key -*/ - public function addCachedHTML( $computeFunction, $args = array(), $key = null ) { - $this-getOutput()-addHTML( $this-getCachedValue( $computeFunction, $args, $key ) ); - } - - /** * Get a cached value if available or compute it if not and then cache it if possible. * The provided $computeFunction is only called when the computation needs to happen * and should return a result value. $args are arguments that will be passed to the Added: trunk/phase3/includes/actions/CachedAction.php === --- trunk/phase3/includes/actions/CachedAction.php (rev 0) +++ trunk/phase3/includes/actions/CachedAction.php 2012-03-20 00:04:36 UTC (rev 114219) @@ -0,0 +1,161 @@ +?php + +/** + * Abstract action class with scaffolding for caching HTML and other values + * in a single blob. + * + * Before using any of the cahing functionality, call startCache. + * After the last call to either getCachedValue or addCachedHTML, call saveCache. + * + * To get a cached value or compute it, use getCachedValue like this: + * $this-getCachedValue( $callback ); + * + * To add HTML that should be cached, use addCachedHTML like this: + * $this-addCachedHTML( $callback ); + * + * The callback function is only called when needed, so do all your expensive + * computations
[MediaWiki-CVS] SVN: [114220] trunk/extensions/MobileFrontend/MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114220 Revision: 114220 Author: awjrichards Date: 2012-03-20 00:13:47 + (Tue, 20 Mar 2012) Log Message: --- Changing mf_useformat cookie name to not use cookie prefix Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 00:04:36 UTC (rev 114219) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 00:13:47 UTC (rev 114220) @@ -1453,7 +1453,7 @@ global $wgRequest, $wgCookiePrefix; if ( !isset( self::$useFormatCookieName )) { - self::$useFormatCookieName = $wgCookiePrefix . 'mf_useformat'; + self::$useFormatCookieName = 'mf_useformat'; } $useFormat = $this-getUseFormat(); @@ -1505,7 +1505,7 @@ public function getCacheVaryCookies( $out, $cookies ) { global $wgCookiePrefix; - $cookies[] = $wgCookiePrefix . 'mf_useformat'; + $cookies[] = 'mf_useformat'; return true; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114221] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114221 Revision: 114221 Author: awjrichards Date: 2012-03-20 00:14:56 + (Tue, 20 Mar 2012) Log Message: --- MFT r114220 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193,114211-114212,114214 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193,114211-114212,114214,114220 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 00:13:47 UTC (rev 114220) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 00:14:56 UTC (rev 114221) @@ -1452,7 +1452,7 @@ global $wgRequest, $wgCookiePrefix; if ( !isset( self::$useFormatCookieName )) { - self::$useFormatCookieName = $wgCookiePrefix . 'mf_useformat'; + self::$useFormatCookieName = 'mf_useformat'; } $useFormat = $this-getUseFormat(); @@ -1504,7 +1504,7 @@ public function getCacheVaryCookies( $out, $cookies ) { global $wgCookiePrefix; - $cookies[] = $wgCookiePrefix . 'mf_useformat'; + $cookies[] = 'mf_useformat'; return true; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114222] trunk/extensions/PageTriage
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114222 Revision: 114222 Author: bsitu Date: 2012-03-20 00:20:12 + (Tue, 20 Mar 2012) Log Message: --- Add method to generate PageTriage dashboard data and table for logging pagetriage activity Modified Paths: -- trunk/extensions/PageTriage/PageTriage.php Added Paths: --- trunk/extensions/PageTriage/includes/PageTriageUtil.php trunk/extensions/PageTriage/sql/PageTriageLog.sql Modified: trunk/extensions/PageTriage/PageTriage.php === --- trunk/extensions/PageTriage/PageTriage.php 2012-03-20 00:14:56 UTC (rev 114221) +++ trunk/extensions/PageTriage/PageTriage.php 2012-03-20 00:20:12 UTC (rev 114222) @@ -52,6 +52,7 @@ $wgSpecialPages['PageTriage'] = 'SpecialPageTriage'; $wgSpecialPageGroups['PageTriage'] = 'changes'; $wgAutoloadClasses['ArticleMetadata'] = $dir . 'includes/ArticleMetadata.php'; +$wgAutoloadClasses['PageTriageUtil'] = $dir . 'includes/PageTriageUtil.php'; $wgAutoloadClasses['PageTriageHooks'] = $dir . 'PageTriage.hooks.php'; $wgAutoloadClasses['ApiQueryPageTriage'] = $dir . 'api/ApiQueryPageTriage.php'; @@ -60,6 +61,7 @@ // custom exceptions $wgAutoloadClasses['MWArticleMetadataMissingPageIdException'] = $dir . 'includes/ArticleMetadata.php'; $wgAutoloadClasses['MWArticleMetadataMetaDataOutofBoundException'] = $dir . 'includes/ArticleMetadata.php'; +$wgAutoloadClasses['MWPageTriageUtilInvalidNumberException'] = $dir . 'includes/PageTriageUtil.php'; // api modules $wgAPIModules['pagetriage'] = 'ApiQueryPageTriage'; @@ -91,6 +93,7 @@ $updater-addExtensionTable( 'pagetriage_tags', $base . '/PageTriageTags.sql' ); $updater-addExtensionTable( 'pagetriage_page_tags', $base . '/PageTriagePageTags.sql' ); $updater-addExtensionTable( 'pagetriage_page', $base . '/PageTriagePage.sql' ); + $updater-addExtensionTable( 'pagetriage_log', $base . '/PageTriageLog.sql' ); return true; } Added: trunk/extensions/PageTriage/includes/PageTriageUtil.php === --- trunk/extensions/PageTriage/includes/PageTriageUtil.php (rev 0) +++ trunk/extensions/PageTriage/includes/PageTriageUtil.php 2012-03-20 00:20:12 UTC (rev 114222) @@ -0,0 +1,138 @@ +?php + +/** + * Utility class for PageTriage + */ +class PageTriageUtil { + + /** +* Get a list of stat for untriaged articles +* @return array +* +* @Todo - Limit the number of records by a timestamp filter, maybe 30 days etc, +* depends on the time the triage queue should look back for listview +*/ + public static function getUntriageArticleStat() { + global $wgMemc; + + $key = wfMemcKey( 'pagetriage', 'untriaged-article', 'stat' ); + + $data = $wgMemc-get( $key ); + if ( $data !== false ) { + return $data; + } + + $dbr = wfGetDB( DB_SLAVE ); + + $res = $dbr-selectRow( + array( 'pagetriage_page' ), + array( 'COUNT(ptrp_id) AS total' ), + array( 'ptrp_triaged' = 0 ) + ); + + $percentile = array( 25, 50, 75, 90, 100 ); + + $data = array( 'count' = 0 ); + + foreach ( $percentile as $val ) { + $data['age-' . $val . 'th-percentile'] = false; + } + + if ( $res ) { + $data['count'] = intval( $res-total ); + + // show percentile stat only if there is a certain number of untriaged articles + if ( $data['count'] 10 ) { + foreach ( $percentile as $val ) { + $data['age-' . $val . 'th-percentile'] = self::estimateArticleAgePercentile( $val, $data['count'] ); + } + } + } + + // make it expire in an hour + $wgMemc-set( $key, $data, 3600 ); + return $data; + } + + /** +* Get top page triagers in the past week +* @param $num int - number of records to retrieve +* @return array +*/ + public static function getTopTriager( $num = 5 ) { + global $wgMemc; + + $dbr = wfGetDB( DB_SLAVE ); + $key = wfMemcKey( 'pagetriage', 'top-triager', 'past-week' ); + + $topTriager = $wgMemc-get( $key ); + if ( $topTriager === false ) { + $timestamp = wfTimestamp( TS_UNIX ) - 7 * 24 * 60 * 60; // 1 week ago + + $res = $dbr-select( +
[MediaWiki-CVS] SVN: [114224] trunk/phase3
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114224 Revision: 114224 Author: tstarling Date: 2012-03-20 00:28:30 + (Tue, 20 Mar 2012) Log Message: --- Fixed attempt to write to the wiki's upload directory during parser tests instead of /tmp, this is not allowed. I'm not sure what setupGlobals() is meant to do nowadays, that part is untested. It seems to be duplicated in ParserTest::__construct(). Modified Paths: -- trunk/phase3/includes/filerepo/backend/lockmanager/LockManagerGroup.php trunk/phase3/tests/parser/parserTest.inc Modified: trunk/phase3/includes/filerepo/backend/lockmanager/LockManagerGroup.php === --- trunk/phase3/includes/filerepo/backend/lockmanager/LockManagerGroup.php 2012-03-20 00:26:08 UTC (rev 114223) +++ trunk/phase3/includes/filerepo/backend/lockmanager/LockManagerGroup.php 2012-03-20 00:28:30 UTC (rev 114224) @@ -31,6 +31,14 @@ } /** +* Destroy the singleton instance, so that a new one will be created next +* time singleton() is called. +*/ + public static function destroySingleton() { + self::$instance = null; + } + + /** * Register lock managers from the global variables * * @return void Modified: trunk/phase3/tests/parser/parserTest.inc === --- trunk/phase3/tests/parser/parserTest.inc2012-03-20 00:26:08 UTC (rev 114223) +++ trunk/phase3/tests/parser/parserTest.inc2012-03-20 00:28:30 UTC (rev 114224) @@ -140,7 +140,7 @@ $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo, $parserMemc, $wgThumbnailScriptPath, $wgScriptPath, $wgArticlePath, $wgStyleSheetPath, $wgScript, $wgStylePath, $wgExtensionAssetsPath, - $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType; + $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgLockManagers; $wgScript = '/index.php'; $wgScriptPath = '/'; @@ -149,6 +149,11 @@ $wgStylePath = '/skins'; $wgExtensionAssetsPath = '/extensions'; $wgThumbnailScriptPath = false; + $wgLockManagers = array( array( + 'name' = 'fsLockManager', + 'class' = 'FSLockManager', + 'lockDirectory' = wfTempDir() . '/test-repo/lockdir', + ) ); $wgLocalFileRepo = array( 'class' = 'LocalRepo', 'name'= 'local', @@ -627,6 +632,11 @@ 'wgScriptPath' = '/', 'wgArticlePath' = '/wiki/$1', 'wgActionPaths' = array(), + 'wgLockManagers' = array( + 'name' = 'fsLockManager', + 'class' = 'FSLockManager', + 'lockDirectory' = $this-uploadDir . '/lockdir', + ), 'wgLocalFileRepo' = array( 'class' = 'LocalRepo', 'name' = 'local', @@ -951,6 +961,8 @@ */ private function teardownGlobals() { RepoGroup::destroySingleton(); + FileBackendGroup::destroySingleton(); + LockManagerGroup::destroySingleton(); LinkCache::singleton()-clear(); foreach ( $this-savedGlobals as $var = $val ) { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114225] trunk/extensions/MobileFrontend/MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114225 Revision: 114225 Author: awjrichards Date: 2012-03-20 00:30:39 + (Tue, 20 Mar 2012) Log Message: --- Revert r114220 Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 00:28:30 UTC (rev 114224) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 00:30:39 UTC (rev 114225) @@ -1453,7 +1453,7 @@ global $wgRequest, $wgCookiePrefix; if ( !isset( self::$useFormatCookieName )) { - self::$useFormatCookieName = 'mf_useformat'; + self::$useFormatCookieName = $wgCookiePrefix . 'mf_useformat'; } $useFormat = $this-getUseFormat(); @@ -1505,7 +1505,7 @@ public function getCacheVaryCookies( $out, $cookies ) { global $wgCookiePrefix; - $cookies[] = 'mf_useformat'; + $cookies[] = $wgCookiePrefix . 'mf_useformat'; return true; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs