https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114002

Revision: 114002
Author:   santhosh
Date:     2012-03-16 07:18:24 +0000 (Fri, 16 Mar 2012)
Log Message:
-----------
Minor white space fix
prefix ag- for aggregrate group Ids. 
If the name contains comma, make it underscore.
Ping r113709  and r113715

Modified Paths:
--------------
    trunk/extensions/Translate/api/ApiAggregateGroups.php
    
trunk/extensions/Translate/resources/ext.translate.special.aggregategroups.js

Modified: trunk/extensions/Translate/api/ApiAggregateGroups.php
===================================================================
--- trunk/extensions/Translate/api/ApiAggregateGroups.php       2012-03-16 
07:09:40 UTC (rev 114001)
+++ trunk/extensions/Translate/api/ApiAggregateGroups.php       2012-03-16 
07:18:24 UTC (rev 114002)
@@ -173,7 +173,7 @@
        public static function getAllPages() {
                $groups = MessageGroups::getAllGroups();
                $pages = array();
-               foreach ( $groups as  $group ) {
+               foreach ( $groups as $group ) {
                        if ( $group instanceof WikiPageMessageGroup ) {
                                $pages[$group->getId()] = 
$group->getTitle()->getPrefixedText();
                        }

Modified: 
trunk/extensions/Translate/resources/ext.translate.special.aggregategroups.js
===================================================================
--- 
trunk/extensions/Translate/resources/ext.translate.special.aggregategroups.js   
    2012-03-16 07:09:40 UTC (rev 114001)
+++ 
trunk/extensions/Translate/resources/ext.translate.special.aggregategroups.js   
    2012-03-16 07:18:24 UTC (rev 114002)
@@ -93,11 +93,11 @@
        }
        
        /*
-        * Replace some special characters like space, comma, brackets etc to _ 
in a string. Also convert it to lowercase.
+        * Replace some special characters like space, dots, comma, brackets 
etc to _ in a string. Also convert it to lowercase.
         */
        function createId( s ){
                if ( s !== undefined ) {
-                       return s.toLowerCase().replace( 
/[\x00-\x1f\x23\x2c\x3c\x3e\x5b\x5d\x7b\x7c\x7d\x7f\s]+/g, '_' );
+                       return 'ag-' + s.toLowerCase().replace( 
/[\x00-\x1f\x23\x2c\x2e\x3c\x3e\x5b\x5d\x7b\x7c\x7d\x7f\s]+/g, '_' );
                }
        }
 
@@ -129,7 +129,7 @@
                                $div.data( 'id', aggregateGroupId );
                                if ( $select.length > 0 ){
                                        var $groupSelector = $( '<select>' 
).attr('id', 'mw-tpa-groupselect-' + aggregateGroupId );
-                                       $.each(data.aggregategroups.groups, 
function( key, value) {
+                                       $.each( data.aggregategroups.groups, 
function( key, value ) {
                                                $groupSelector.append( $( 
'<option>', { value : key } ).text( value ) ); 
                                        } );
                                        var $addButton =  $( $( 
'input.tp-aggregate-add-button' )[0]).clone();


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to