[MediaWiki-CodeReview] [MediaWiki r113775]: New comment added, and revision status changed

2012-03-19 Thread MediaWiki Mail
Krinkle changed the status of MediaWiki.r113775 to fixme and commented it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113775#c32304

Old Status: ok
New Status: fixme

Commit summary for MediaWiki.r113775:

* (bug 35201) Edit buttons no longer cause jump in IE 9

Changed order of feature-detection checks so we prefer the IE method over the 
Mozilla method in encapsulateSelection. Fixes a problem where IE9 triggered the 
Mozilla mode, then mysteriously scrolled to the top of the page.

(IE9 and IE10 add a lot of standard and semi-standard HTML APIs, so this sort 
of thing happens from time to time. :)

Krinkle's comment:

This broke the unit tests for IE9:
* before: http://integration.mediawiki.org/testswarm/job/1798/
* after: http://integration.mediawiki.org/testswarm/job/1799/ 
([http://integration.mediawiki.org/testswarm/?state=runresultsrun_id=35546client_id=14207
 test results for job 1799/IE9])

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r113775]: New comment added

2012-03-19 Thread MediaWiki Mail
Krinkle posted a comment on MediaWiki.r113775.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113775#c32305

Commit summary for MediaWiki.r113775:

* (bug 35201) Edit buttons no longer cause jump in IE 9

Changed order of feature-detection checks so we prefer the IE method over the 
Mozilla method in encapsulateSelection. Fixes a problem where IE9 triggered the 
Mozilla mode, then mysteriously scrolled to the top of the page.

(IE9 and IE10 add a lot of standard and semi-standard HTML APIs, so this sort 
of thing happens from time to time. :)

Krinkle's comment:

Still broken as of [//integration.mediawiki.org/testswarm/job/1856/ r114117] 
([//integration.mediawiki.org/testswarm/?state=runresultsrun_id=36686client_id=14212
 test results for job 1799/IE9])

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r113775]: New comment added

2012-03-19 Thread MediaWiki Mail
Krinkle posted a comment on MediaWiki.r113775.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113775#c32306

Commit summary for MediaWiki.r113775:

* (bug 35201) Edit buttons no longer cause jump in IE 9

Changed order of feature-detection checks so we prefer the IE method over the 
Mozilla method in encapsulateSelection. Fixes a problem where IE9 triggered the 
Mozilla mode, then mysteriously scrolled to the top of the page.

(IE9 and IE10 add a lot of standard and semi-standard HTML APIs, so this sort 
of thing happens from time to time. :)

Krinkle's comment:

Still broken as of [//integration.mediawiki.org/testswarm/job/1856/ rev 114117] 
([//integration.mediawiki.org/testswarm/?state=runresultsrun_id=36686client_id=14212
 test results for job 1856/IE9])

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114024]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114024 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114024

Old status:  deferred
New status: ok

Commit summary for MediaWiki.r114024:

Crush images from r114023

Drops from 165KB to 58.5KB (200KB to 116KB as size on disk)

Also fix svn:mime-type

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114026]: New comment added, and revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114026 to fixme and commented 
it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114026#c32307

Old Status: deferred
New Status: fixme

Commit summary for MediaWiki.r114026:

follow up r114023 add missing plural

Nikerabbit's comment:

Typo ''where''. And shouldn't that - who?

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114028]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114028 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114028

Old status:  deferred
New status: ok

Commit summary for MediaWiki.r114028:

adding abstract page to not have to duplicate caching code to much

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114122]: Revision status changed

2012-03-19 Thread MediaWiki Mail
MaxSem changed the status of MediaWiki.r114122 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114122

Old status:  new
New status: ok

Commit summary for MediaWiki.r114122:

Follow-up to r114004 - Use tabs instead of spaces

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114121]: Revision status changed

2012-03-19 Thread MediaWiki Mail
MaxSem changed the status of MediaWiki.r114121 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114121

Old status:  new
New status: ok

Commit summary for MediaWiki.r114121:

follow-up r114116: move release-notes

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114046]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114046 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114046

Old status:  new
New status: ok

Commit summary for MediaWiki.r114046:

Follow up to r114045; cleanup + docs

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114113]: Revision status changed

2012-03-19 Thread MediaWiki Mail
MaxSem changed the status of MediaWiki.r114113 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114113

Old status:  new
New status: ok

Commit summary for MediaWiki.r114113:

Cleanup extra ; and break statements

Remove a wrong comment

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114057]: New comment added, and revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114057 to fixme and commented 
it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114057#c32308

Old Status: new
New Status: fixme

Commit summary for MediaWiki.r114057:

Use more normal $dir code, remove duplicate loading of same file as it's going 
to give errors

Nikerabbit's comment:

The path should be parent path, not classes.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114058]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114058 to fixme
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114058

Old status:  new
New status: fixme

Commit summary for MediaWiki.r114058:

MFT x2 r114057

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114021]: Revision status changed

2012-03-19 Thread MediaWiki Mail
MaxSem changed the status of MediaWiki.r114021 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114021

Old status:  new
New status: ok

Commit summary for MediaWiki.r114021:

MFT r114020

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114059]: New comment added

2012-03-19 Thread MediaWiki Mail
Nikerabbit posted a comment on MediaWiki.r114059.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114059#c32309

Commit summary for MediaWiki.r114059:

work on special:studentactivity

Nikerabbit's comment:

Cannot review without message documentation.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r113989]: Revision status changed

2012-03-19 Thread MediaWiki Mail
MaxSem changed the status of MediaWiki.r113989 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113989

Old status:  new
New status: ok

Commit summary for MediaWiki.r113989:

MFT r113988 x3

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114060]: New comment added

2012-03-19 Thread MediaWiki Mail
Nikerabbit posted a comment on MediaWiki.r114060.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114060#c32310

Commit summary for MediaWiki.r114060:

work on special:studentactivity

Nikerabbit's comment:

Cannot review without message documentation.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114061]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114061 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114061

Old status:  new
New status: ok

Commit summary for MediaWiki.r114061:

Removed a stray comma causing maintenance/update.php to break

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114062]: New comment added

2012-03-19 Thread MediaWiki Mail
Nikerabbit posted a comment on MediaWiki.r114062.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114062#c32311

Commit summary for MediaWiki.r114062:

Bug: Sometimes $text is not a string but an object of message class, it causes 
an exception. Fixed.

Nikerabbit's comment:

What does version 0.0.1+ mean?

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114052]: Revision status changed

2012-03-19 Thread MediaWiki Mail
MaxSem changed the status of MediaWiki.r114052 to deferred
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114052

Old status:  new
New status: deferred

Commit summary for MediaWiki.r114052:

save up some old hacks. Need to be redone properly though

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114048]: Revision status changed

2012-03-19 Thread MediaWiki Mail
MaxSem changed the status of MediaWiki.r114048 to deferred
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114048

Old status:  new
New status: deferred

Commit summary for MediaWiki.r114048:

Sync with trunk

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114068]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114068 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114068

Old status:  deferred
New status: ok

Commit summary for MediaWiki.r114068:

SemanticTitle: README updated.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r113862]: Revision status changed

2012-03-19 Thread MediaWiki Mail
MaxSem changed the status of MediaWiki.r113862 to resolved
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113862

Old status:  fixme
New status: resolved

Commit summary for MediaWiki.r113862:

follow up r113836 added public function extensionTableExists.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114050]: Revision status changed

2012-03-19 Thread MediaWiki Mail
MaxSem changed the status of MediaWiki.r114050 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114050

Old status:  new
New status: ok

Commit summary for MediaWiki.r114050:

follow up r113862 . changed public function name extensionTableExists to 
tableExists

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


Re: [Wikitech-l] Using prototypical inheritance in dynamically loaded ResourceLoader modules

2012-03-19 Thread Dmitriy Sintsov

Hi!
I've tweaked my code few times, trying to make it simpler: got rid of 
some closure calls and left only one dynamic module load at client-side.


http://pastebin.com/UxyifLmx
http://pastebin.com/q3Tm6Ajd
http://pastebin.com/4emMDBS6

Still, it gives me headaches, because mw.loader.using( 'ext.jqgmap.edit' 
,function(...)) does not actually execute the loaded module's code even 
when the callback function is fired. This means that additional 
mw.jqgmap prototypes defined in 'ext.jqgmap.edit' are not available when 
actual object instances are created in function createMapControllers(), 
thus throws an error. When I add explicit call to dummy function 
loadEditPrototypes() defined in 'ext.jqgmap.edit', the module is 
executed, but the further scipts execution abruptly ends without any 
error in Chrome console.


To me it seems that ResourceLoader tries to be too smart not actually 
executing the code just before .using() callback. How does it figure out 
that I defined function loadEditPrototypes() in 'ext.jqgmap.edit' 
module? That kind of 'automagic' is tricky. Why not to have something 
like $wgAutoloadClasses but for ResourceLoader? Or, even to be able to 
really execute module on load. And why does it stop execution path is a 
puzzle to me..


Dmitriy

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[MediaWiki-CodeReview] [MediaWiki r114106]: Revision status changed

2012-03-19 Thread MediaWiki Mail
MaxSem changed the status of MediaWiki.r114106 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114106

Old status:  new
New status: ok

Commit summary for MediaWiki.r114106:

Disable callgraphs for the time being

Per Yuvi, most people don't need them, and are a PITA on a slow connection

I'd be happy to re-enable them if we can get them on hyperlinks or subpages or 
some such

{{BeBold}}

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114071]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114071 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114071

Old status:  new
New status: ok

Commit summary for MediaWiki.r114071:

Follow up to r114067;

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114079]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114079 to resolved
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114079

Old status:  ok
New status: resolved

Commit summary for MediaWiki.r114079:

Followup r114067

Add centuries because the messages were already there but not used

Add decade and millennia for the luls/completeness

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114085]: New comment added, and revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114085 to fixme and commented 
it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114085#c32312

Old Status: new
New Status: fixme

Commit summary for MediaWiki.r114085:

Add a temporary disclaimer text making it clear that this is a prototype. 
Requested by Fabrice

Nikerabbit's comment:

{{messagedocumentation}}

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


Re: [Wikitech-l] Using prototypical inheritance in dynamically loaded ResourceLoader modules

2012-03-19 Thread Daniel Friesen
On Mon, 19 Mar 2012 00:40:54 -0700, Dmitriy Sintsov ques...@rambler.ru  
wrote:



Hi!
I've tweaked my code few times, trying to make it simpler: got rid of  
some closure calls and left only one dynamic module load at client-side.


http://pastebin.com/UxyifLmx
http://pastebin.com/q3Tm6Ajd
http://pastebin.com/4emMDBS6

Still, it gives me headaches, because mw.loader.using( 'ext.jqgmap.edit'  
,function(...)) does not actually execute the loaded module's code even  
when the callback function is fired. This means that additional  
mw.jqgmap prototypes defined in 'ext.jqgmap.edit' are not available when  
actual object instances are created in function createMapControllers(),  
thus throws an error. When I add explicit call to dummy function  
loadEditPrototypes() defined in 'ext.jqgmap.edit', the module is  
executed, but the further scipts execution abruptly ends without any  
error in Chrome console.


To me it seems that ResourceLoader tries to be too smart not actually  
executing the code just before .using() callback. How does it figure out  
that I defined function loadEditPrototypes() in 'ext.jqgmap.edit'  
module? That kind of 'automagic' is tricky. Why not to have something  
like $wgAutoloadClasses but for ResourceLoader? Or, even to be able to  
really execute module on load. And why does it stop execution path is a  
puzzle to me..


Autoloading classes is not possible. Even if every browser supported  
getters and we could use them to dynamically load classes, this would  
require synchronous http calls. Which are absolutely HORRIBLE because they  
block the entire JS thread and in addition typically even block the  
browser's UI.



Dmitriy


You shouldn't be dropping the closure, you don't want local things in the  
global scope. You also shouldn't be using the global $ and mw directly.  
Everything should be using a pattern like:

( function( $, mw ) {

} )( jQuery, mediaWiki );


var jqgmap = [];
for ( var mapIndex in jqgmap ) {


This is VERY bad JavaScript coding practice. Please use $.each().


$('div class=jqgmap_code id=jqgmap_code' + this.Idx + ''+
'input type=checkbox/input' + mw.msg( 'jqgmap-show-code' )  
+
'input type=checkbox/input' + mw.msg( 'jqgmap-show-code' )  
+

'div class=jqgmap_preview/div' +
'div class=jqgmap_preview/div' +
'/div')


I should really start poking people about this one. `div . wfMsg(  
'foo' ) . /div` is bad in PHP code, and it's just as bad inside JS.  
You should be creating your html with NO + concatenation, and then using a  
.find() and .text() to insert things where they belong. That, or use  
multiple $() calls with .append() to create the full structure.
Likewise you shouldn;t be inserting this.Idx that way into the attribute.  
It should be added with something like .attr( jqgmap_code + this.Idx );



--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[MediaWiki-CodeReview] [MediaWiki r114069]: New comment added

2012-03-19 Thread MediaWiki Mail
Nikerabbit posted a comment on MediaWiki.r114069.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114069#c32313

Commit summary for MediaWiki.r114069:

SemanticTitle: New hook implemented to eliminate need in DEFAULTSORT, but not 
enabled due to issue (unknown parser).

Nikerabbit's comment:

Spaces on line 148.

And there is no need to use ; after if-block.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114087]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114087 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114087

Old status:  new
New status: ok

Commit summary for MediaWiki.r114087:

1.19wmf1: MFT r114085

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114077]: New comment added

2012-03-19 Thread MediaWiki Mail
Nikerabbit posted a comment on MediaWiki.r114077.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114077#c32314

Commit summary for MediaWiki.r114077:

identify students by user name rather then id

Nikerabbit's comment:

Cannot review without message documentation.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114081]: New comment added

2012-03-19 Thread MediaWiki Mail
Nikerabbit posted a comment on MediaWiki.r114081.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114081#c32315

Commit summary for MediaWiki.r114081:

adding special page with scaffolding for caching chunks of HTML

Nikerabbit's comment:

$_GET ? Use WebRequest.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114096]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114096 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114096

Old status:  new
New status: ok

Commit summary for MediaWiki.r114096:

Removed redundant , moved up $wgExtensionCredits and gave descriptions for 
classes, internationlization and default values

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview



Re: [Wikitech-l] Using prototypical inheritance in dynamically loaded ResourceLoader modules

2012-03-19 Thread Dmitriy Sintsov
* Daniel Friesen li...@nadir-seen-fire.com [Mon, 19 Mar 2012 01:35:21 
-0700]:

Autoloading classes is not possible. Even if every browser supported
getters and we could use them to dynamically load classes, this would
require synchronous http calls. Which are absolutely HORRIBLE because
they
block the entire JS thread and in addition typically even block the
browser's UI.

How does ResourceLoader figures that function loadEditPrototypes() was 
defined in 'ext.jqgmap.edit' when I call this function from 
'ext.jqgmap'? And if there was no extra http call, then why the list of 
scripts in Chrome debugger does not include 'JQGmap.edit.js' among the 
scripts before mw.loader.using() and loadEditPrototypes() call was 
performed?



You shouldn't be dropping the closure, you don't want local things in
the
global scope. You also shouldn't be using the global $ and mw 

directly.
Prototypes are not local things. They are carried out with function they 
belong to. I define few prototypes in 'ext.jqgmap.view' then I want to 
add more prototypes in 'ext.jqgmap.edit'. But not always, only when the 
edit mode is active. However you are right about minor local variables.



Everything should be using a pattern like:
( function( $, mw ) {

} )( jQuery, mediaWiki );

Ok, I'll try the closure call with two arguments in every module, didn't 
think about that. I'll report if that will fix the abrupt termination of 
module chain execution.



 var jqgmap = [];
 for ( var mapIndex in jqgmap ) {

This is VERY bad JavaScript coding practice. Please use $.each().

I know that I can use $.each() here. I don't do that for few reasons: 
for..in is easier to debug (step by step key) and also because for..in 
was problematic only for objects {}, not for arrays [] AFAIK. However I 
might be wrong. Maybe I'll switch to $.each() however the code was 
working with for..in perfectly well before I refactored it into multiple 
modules. There was only one module. However it was growing so I had to 
split it into view and edit submodules.



 $('div class=jqgmap_code id=jqgmap_code' + this.Idx + ''+
 'input type=checkbox/input' + mw.msg( 

'jqgmap-show-code'

)
 +
 'input type=checkbox/input' + mw.msg( 

'jqgmap-show-code'

)
 +
 'div class=jqgmap_preview/div' +
 'div class=jqgmap_preview/div' +
 '/div')

I should really start poking people about this one. `div . wfMsg(
'foo' ) . /div` is bad in PHP code, and it's just as bad inside 

JS.
You should be creating your html with NO + concatenation, and then 

using

a
.find() and .text() to insert things where they belong. That, or use
multiple $() calls with .append() to create the full structure.
Likewise you shouldn;t be inserting this.Idx that way into the
attribute.
It should be added with something like .attr( jqgmap_code + this.Idx
);

I might consider refactoring of jQuery DOM nodes creation, however the 
loading  of 'ext.jqgmap.edit' module does not work now so I cannot 
continue until I'll figure out why. This code is not ideal however it's 
not the reason of the fault. This code was working perfectly well before 
splitting into multiple modules and introducing 
mw.loader.using('ext.jqgmap.edit',function(){...});

Dmitriy

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[MediaWiki-CodeReview] [MediaWiki r114103]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114103 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114103

Old status:  new
New status: ok

Commit summary for MediaWiki.r114103:

kill flag images as well be using commons anyway

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114105]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114105 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114105

Old status:  new
New status: ok

Commit summary for MediaWiki.r114105:

Specific message to be able to customise the link target

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114106]: New comment added

2012-03-19 Thread MediaWiki Mail
Nikerabbit posted a comment on MediaWiki.r114106.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114106#c32316

Commit summary for MediaWiki.r114106:

Disable callgraphs for the time being

Per Yuvi, most people don't need them, and are a PITA on a slow connection

I'd be happy to re-enable them if we can get them on hyperlinks or subpages or 
some such

{{BeBold}}

Nikerabbit's comment:

I have to wonder if there really isn't any prettier alternative to Doxygen for 
PHP?

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114110]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114110 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114110

Old status:  new
New status: ok

Commit summary for MediaWiki.r114110:

Foolow-up to r114108: https protocol is used instead of http.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114114]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114114 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114114

Old status:  new
New status: ok

Commit summary for MediaWiki.r114114:

[jquery.byteLimit.test] clean up
* js conventions
* whitespace indention

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114117]: New comment added

2012-03-19 Thread MediaWiki Mail
Nikerabbit posted a comment on MediaWiki.r114117.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114117#c32317

Commit summary for MediaWiki.r114117:

* (bug 35303) Make proxy and DNS blacklist blocking work again

Nikerabbit's comment:

It's not immediately obvious why this fixes the bug.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114123]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114123 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114123

Old status:  new
New status: ok

Commit summary for MediaWiki.r114123:

Update tags.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114124]: Revision status changed

2012-03-19 Thread MediaWiki Mail
MaxSem changed the status of MediaWiki.r114124 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114124

Old status:  new
New status: ok

Commit summary for MediaWiki.r114124:

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.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r47919]: New comment added

2012-03-19 Thread MediaWiki Mail
Tim Starling posted a comment on MediaWiki.r47919.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/47919#c32318

Commit summary for MediaWiki.r47919:

Partial redesign with refactoring of CentralAuth admin interface. Merged 
lock/hide/unlock/unhide/lockandhide forms into a single 'change status' form, 
refactored submission code out from the main form body, etc

Tim Starling's comment:

pre
- 'centralauth-admin-unhide-nonexistent' = 'Error: the global account 
nowiki$1/nowiki does not exist.',
/pre

This message is still in use.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r47919]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Tim Starling changed the status of MediaWiki.r47919 to fixme
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/47919

Old status:  ok
New status: fixme

Commit summary for MediaWiki.r47919:

Partial redesign with refactoring of CentralAuth admin interface. Merged 
lock/hide/unlock/unhide/lockandhide forms into a single 'change status' form, 
refactored submission code out from the main form body, etc

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


Re: [Wikitech-l] Using prototypical inheritance in dynamically loaded ResourceLoader modules

2012-03-19 Thread Dmitriy Sintsov
* Daniel Friesen li...@nadir-seen-fire.com [Mon, 19 Mar 2012 01:35:21 
-0700]:

( function( $, mw ) {

} )( jQuery, mediaWiki );

I modified all of three modules: main, view and edit module to the 
recommended pattern.

http://pastebin.com/1kS6EyUu
http://pastebin.com/WQzBTw6W
http://pastebin.com/UqpTAvZ8

However, the execution still stops after the following call:
mw.jqgmap.loadEdit();
performed in main module. When I comment out that call, execution of 
further scripts does not terminate: however extra prototypes defined in 
'ext.jqgmap.edit' become unavailable; thus MapController and 
MarkerController instances do not work correctly in edit mode.


Still cannot dynamically load 'ext.jqgmap.edit' successfully..

Maybe I'll temporary re-unite the modules into monolithic one, otherwise 
I risk to ruin the timeline of project. Too bad I wasn't able to defeat 
the trouble.

Dmitriy

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] Using PHP's assert in MediaWiki code

2012-03-19 Thread Christian Aistleitner
Hi Tim,

on Mon, Mar 19, 2012 at 09:09:58AM +1100, Tim Starling wrote:
 On 18/03/12 20:37, Christian Aistleitner wrote:
  Dear all,
  
  should we allow using PHP's assert [1] in MediaWiki code?
  
  It would allow us to formulate and automatically verify conditions
  about code, while at the same time providing readable documentation of
  code for free.
  
  Possible, exemplary use cases would be:
  - automatically verifyable documentation of code's intent
  - guarding against logic pitfalls like forgetting to set a variable in
all branches of switches, if/else cascades
  - guarding against using uninitialized variables
  
  What do you think?
 
 We use exceptions for that.

Yes, this was the motivation for my email.

'If'-guards are fine. Just as exceptions are. They are excellent tools
for conditions that /typically/ hold at run-time--but eventually they
might fail. In such a case, we want to do classical error handling.
It's the right tool for the job.

We can of course decide to keep using if-guards/exceptions when
modelling conditions that /unconditionally and always/ hold.
However, PHP introduced asserts some 12 years back for just this and
only this use case. It's a proven tool.
assert is tailored for conditions that /unconditionally and
always/ hold. So why not allow this standard tool in our toolbox?

Due to this narrower use case, assert comes with some benefit over
if-guards/exceptions in terms of code readability and quality:
- We can turn off checking the conditions on production machines, to
  lower the impact.
- assert's syntax shows the condition that holds. [1]
- asserts produce good error messages without condition duplication. [2]
- asserts clearly stand out in code. [3]
- asserts just add the bare necessities to the code and do not clutter
  up code so much
- asserts are less code to write.



  P.S.: For typical MediaWiki use cases, PHP's assert is even faster
  than throwing exceptions behind 'if'-guards.
 
 That's funny, for me if is about 10 times faster than assert() in
 the non-throwing case.

Have you tried real world examples?

Consider for example

  $this-isOpen()  $this-mConn

This is a typical condition one could add in many places of
DatabaseMysql.php. For this condition asserts are ~16% faster [4].

For this real-world example, the fact that assert takes the condition
as string (hence unevaluated) outperforms the penalty due to the
function call.

But speed is just in the P.S.. assert's real benefit would be
improved readability, as pointed out above.


Kind regards,
Christian



[1] If guards show the negated condition. Hence, when reading the
code, you have to mentally negate the condition again before actually
knowing what has to hold.


[2] An 

  assert( 'condA  condB' );

would relate to

  if ( ! condA || ! condB ) {
throw new MWException( 'condA  condB was violated' )
  }

Hence, if e.g.: condA changes, asserts just changes condA and we are
done.
For if-guards/exceptions, we have to adapt both occurrences of
condA. This is somewhat error prone and it's easier for the conditions
to run apart.


[3] if-guards/exceptions look like normal code. Hence, you have to
mentally reparse it again and again and detect them. Typically IDEs
cannot help or highlight only those guards that document code.

IDEs can easily detect and understand asserts. Even REs can find them ;)


[4] Please verify the number yourself. It was obtained by the attached
assert_test.php. The output for me was:

RUNS: 10, ITERATIONS: 100
assert: 1.818
   ifGuard: 2.148
assert: 1.798
   ifGuard: 2.151
assert: 1.795
   ifGuard: 2.162
assert: 1.798
   ifGuard: 2.148
assert: 1.801
   ifGuard: 2.154
assert: 1.800
   ifGuard: 2.134
assert: 1.788
   ifGuard: 2.140
assert: 1.790
   ifGuard: 2.141
assert: 1.791
   ifGuard: 2.146
assert: 1.797
   ifGuard: 2.141
total: assert: 17.976
total:ifGuard: 21.464
assert is ~16% faster than ifGuard




-- 
 quelltextlich e.U.  \\  Christian Aistleitner 
   Companies' registry: 360296y in Linz
Christian Aistleitner
Gruendbergstrasze 65aEmail:  christ...@quelltextlich.at
4040 Linz, Austria   Phone:  +43 732 / 26 95 63
 Fax:+43 732 / 26 95 63
 Homepage: http://quelltextlich.at/
---
?php
define( ITERATIONS, 100 );
define( RUNS, 10 );
printf( RUNS: %d, ITERATIONS: %d\n, RUNS, ITERATIONS );

class ClassA {

public $mConn;
public $mOpened;

function isOpen() {
return $this-mOpened;
}

function funcAssert() {
assert( '$this-isOpen()  $this-mConn' );
$this-mConn++; 
}

function funcIfGuard() {
if ( ! ( $this-isOpen()  $this-mConn ) ) {
throw new ErrorException( '($this-isOpen() 

Re: [Wikitech-l] Using PHP's assert in MediaWiki code

2012-03-19 Thread Christian Aistleitner
Hi Chad,

on Sun, Mar 18, 2012 at 07:18:01PM -0400, Chad wrote:
 I'd also add that the behavior of assertions vary based on configuration,
 which is confusing at best.

Being able to vary based on configuration actually is a feature. An
essential one. It lowers assert's impact on performance.
But there is no need to mess with configuration. asserts work out of
the box.
You are only given the possibility to turn them off.

The same holds true for the very software MediaWiki is built on. The
software uses and relies on asserts, but gives you the possibility to
turn assertion checking off.
* MySQL uses asserts [1].
* PHP uses asserts [2].

asserts and the possibility to turn them on and off is not confusing
there.

But MySQL and PHP are not the only adopters of asserts.
Just take about any quality software.
The source code takes advantage of asserts (e.g.: Libreoffice [3])

But it's not only practical software engineering. Literature is also
strongly in favor of using asserts as well:
In books: E.g.: S. McConnell. Code Complete [4]
In papers: E.g.: G. Kudrjavets, N. Nagappan, T. Ball. Assessing the
  Relationship between Software Assertions and Code Quality: An
  Empirical Investigation [5]
In talks: E.g.: T. Hoare. Assert early, assert often [6]

Kind regards,
Christian




[1] E.g.: ./mysql-5.1.59/regex/engine.c:199--206 in the MySQL 5.1.59
tarball:

-8-BEGIN-8-
assert(dp == NULL || dp == endp);
if (dp != NULL) /* found a shorter one */
break;

/* despite initial appearances, there is no match here */
NOTE(false alarm);
start = m-coldp + 1;   /* recycle starting later */
assert(start = stop);
-8-END-8-

And here you clearly see what asserts buy you. With just this
snippet of code, the first assert tells you what to expect from
“dp” at this point.  At development time, this contract is
automatically checked and a breach thereof is signalled.
On production systems, the asserts are deactivated and are
ignored.

[2] E.g.: main/streams/memory.c:86--97 in the PHP 5.3.9 tarball:

-8-BEGIN-8-
static size_t php_stream_memory_read(php_stream *stream, char *buf, size_t 
count TSRMLS_DC)
{
php_stream_memory_data *ms = (php_stream_memory_data*)stream-abstract;
assert(ms != NULL);

if (ms-fpos + count = ms-fsize) {
count = ms-fsize - ms-fpos;
stream-eof = 1;
}
if (count) {
assert(ms-data!= NULL);
assert(buf!= NULL);
-8-END-8-

Again, the asserts tell you what to expect from “ms” etc.

[3] E.g.: sc/source/core/data/markdata.cxx:241--243 in the
libreoffice-calc 3.4.4.2 tarball:

-8-BEGIN-8-
if ( bMultiMarked )
{
DBG_ASSERT(pMultiSel, bMultiMarked, aber pMultiSel == 0);
-8-END-8-

(At this point, you see the German StarOffice roots of
LibreOffice/OpenOffice.org. The German “aber” means “but” in
English. So the assertion message would be
  bMultiMarked, but pMultiSel == 0
in English)

[4] isbn:9780735619678

[5] http://research.microsoft.com/pubs/70290/tr-2006-54.pdf

[6] http://research.microsoft.com/en-us/people/thoare/assertearlyassertoften.ppt
Be sure to read the notes within the ppt.

  

-- 
 quelltextlich e.U.  \\  Christian Aistleitner 
   Companies' registry: 360296y in Linz
Christian Aistleitner
Gruendbergstrasze 65aEmail:  christ...@quelltextlich.at
4040 Linz, Austria   Phone:  +43 732 / 26 95 63
 Fax:+43 732 / 26 95 63
 Homepage: http://quelltextlich.at/
---


signature.asc
Description: Digital signature
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Using prototypical inheritance in dynamically loaded ResourceLoader modules

2012-03-19 Thread Daniel Friesen
On Mon, 19 Mar 2012 02:07:54 -0700, Dmitriy Sintsov ques...@rambler.ru  
wrote:


* Daniel Friesen li...@nadir-seen-fire.com [Mon, 19 Mar 2012 01:35:21  
-0700]:

Autoloading classes is not possible. Even if every browser supported
getters and we could use them to dynamically load classes, this would
require synchronous http calls. Which are absolutely HORRIBLE because
they
block the entire JS thread and in addition typically even block the
browser's UI.

How does ResourceLoader figures that function loadEditPrototypes() was  
defined in 'ext.jqgmap.edit' when I call this function from  
'ext.jqgmap'? And if there was no extra http call, then why the list of  
scripts in Chrome debugger does not include 'JQGmap.edit.js' among the  
scripts before mw.loader.using() and loadEditPrototypes() call was  
performed?


RL doesn't know anything about loadEditPrototypes, I don't know what would  
make you think that it does.


I can't really debug and say what's wrong without your code actually  
running somewhere.



You shouldn't be dropping the closure, you don't want local things in
the
global scope. You also shouldn't be using the global $ and mw

directly.
Prototypes are not local things. They are carried out with function they  
belong to. I define few prototypes in 'ext.jqgmap.view' then I want to  
add more prototypes in 'ext.jqgmap.edit'. But not always, only when the  
edit mode is active. However you are right about minor local variables.



Everything should be using a pattern like:
( function( $, mw ) {

} )( jQuery, mediaWiki );

Ok, I'll try the closure call with two arguments in every module, didn't  
think about that. I'll report if that will fix the abrupt termination of  
module chain execution.



 var jqgmap = [];
 for ( var mapIndex in jqgmap ) {

This is VERY bad JavaScript coding practice. Please use $.each().

I know that I can use $.each() here. I don't do that for few reasons:  
for..in is easier to debug (step by step key) and also because for..in  
was problematic only for objects {}, not for arrays [] AFAIK. However I  
might be wrong. Maybe I'll switch to $.each() however the code was  
working with for..in perfectly well before I refactored it into multiple  
modules. There was only one module. However it was growing so I had to  
split it into view and edit submodules.


Completely wrong.
for..in is object iteration. It is not to be used for array iteration.
When you use for..in to iterate over an array you're actually iterating  
over object keys. Unset things may be left out, if there are any  
properties set you'll iterate over those when you shouldn't, if someone  
sets something on Array.prototype. (eg: Someone implements .forEach in an  
older browser) you'll iterate over that as well, and it's perfectly valid  
for a browser to iterate over the keys in an order that's different from  
the actual order of items in the array.




 $('div class=jqgmap_code id=jqgmap_code' + this.Idx + ''+
 'input type=checkbox/input' + mw.msg(

'jqgmap-show-code'

)
 +
 'input type=checkbox/input' + mw.msg(

'jqgmap-show-code'

)
 +
 'div class=jqgmap_preview/div' +
 'div class=jqgmap_preview/div' +
 '/div')

I should really start poking people about this one. `div . wfMsg(
'foo' ) . /div` is bad in PHP code, and it's just as bad inside

JS.

You should be creating your html with NO + concatenation, and then

using

a
.find() and .text() to insert things where they belong. That, or use
multiple $() calls with .append() to create the full structure.
Likewise you shouldn;t be inserting this.Idx that way into the
attribute.
It should be added with something like .attr( jqgmap_code + this.Idx
);

I might consider refactoring of jQuery DOM nodes creation, however the  
loading  of 'ext.jqgmap.edit' module does not work now so I cannot  
continue until I'll figure out why. This code is not ideal however it's  
not the reason of the fault. This code was working perfectly well before  
splitting into multiple modules and introducing  
mw.loader.using('ext.jqgmap.edit',function(){...});

Dmitriy



--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[MediaWiki-CodeReview] [MediaWiki r114125]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Santhosh.thottingal changed the status of MediaWiki.r114125 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114125

Old status:  new
New status: ok

Commit summary for MediaWiki.r114125:

This line was supposed to be removed in r109030
/me bangs head

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r113908]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r113908 to resolved
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113908

Old status:  new
New status: resolved

Commit summary for MediaWiki.r113908:

Better message documentation

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114002]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r114002 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114002

Old status:  new
New status: ok

Commit summary for MediaWiki.r114002:

Minor white space fix
prefix ag- for aggregrate group Ids.
If the name contains comma, make it underscore.
Ping r113709  and r113715

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r113715]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r113715 to resolved
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113715

Old status:  new
New status: resolved

Commit summary for MediaWiki.r113715:

Fix the broken 'add new aggregate group' in r113631
Get the list of groups that can be added to the newly created aggregate group 
as response from add action,
populate the groups drop down from that.
Some more js cleanup.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r113225]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Nikerabbit changed the status of MediaWiki.r113225 to resolved
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113225

Old status:  new
New status: resolved

Commit summary for MediaWiki.r113225:

Clear the associated metadata when a translatable page is deleted.
Move the associated metadata when a translatable page is moved.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r113141]: New comment added

2012-03-19 Thread MediaWiki Mail
Nikerabbit posted a comment on MediaWiki.r113141.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113141#c32319

Commit summary for MediaWiki.r113141:

Correct the filtering of languages for MessageGroup stats. It should only list 
prioriy langs and languages with more than 0% translatations.
Follow up r113124

Nikerabbit's comment:

The link is still not working?

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114126]: New comment added

2012-03-19 Thread MediaWiki Mail
Nikerabbit posted a comment on MediaWiki.r114126.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114126#c32320

Commit summary for MediaWiki.r114126:

Sanitizing already existing use of PHP's assert

Nikerabbit's comment:

BTW, does HipHop support assert?

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114096]: New comment added, and revision status changed

2012-03-19 Thread MediaWiki Mail
Van de Bugger changed the status of MediaWiki.r114096 to fixme and 
commented it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114096#c32321

Old Status: ok
New Status: fixme

Commit summary for MediaWiki.r114096:

Removed redundant , moved up $wgExtensionCredits and gave descriptions for 
classes, internationlization and default values

Van de Bugger's comment:

@cervidae: Please return global decralators back. Your change breaks my 
extension loding system.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114062]: New comment added

2012-03-19 Thread MediaWiki Mail
Van de Bugger posted a comment on MediaWiki.r114062.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114062#c32322

Commit summary for MediaWiki.r114062:

Bug: Sometimes $text is not a string but an object of message class, it causes 
an exception. Fixed.

Van de Bugger's comment:

It means the version is not 0.0.1 any more. I guess it is non-standard notion, 
but I do not like 0.0.2 alpha, because I have no decision about exact number 
of future version.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114096]: New comment added

2012-03-19 Thread MediaWiki Mail
MaxSem posted a comment on MediaWiki.r114096.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114096#c32323

Commit summary for MediaWiki.r114096:

Removed redundant , moved up $wgExtensionCredits and gave descriptions for 
classes, internationlization and default values

MaxSem's comment:

Would you care to elaborate? This change looks good. If you need a weird 
initialisation system, it must be thoroughly documented.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114128]: New comment added

2012-03-19 Thread MediaWiki Mail
Nikerabbit posted a comment on MediaWiki.r114128.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114128#c32324

Commit summary for MediaWiki.r114128:

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.

Nikerabbit's comment:

Why static variables?

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114108]: New comment added

2012-03-19 Thread MediaWiki Mail
Van de Bugger posted a comment on MediaWiki.r114108.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114108#c32325

Commit summary for MediaWiki.r114108:

WhiteSpace: Initial revision.

Van de Bugger's comment:

But how? this wasn't really something that anyone wanted. See 
https://bugzilla.wikimedia.org/show_bug.cgi?id=31865

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r112924]: New comment added

2012-03-19 Thread MediaWiki Mail
Van de Bugger posted a comment on MediaWiki.r112924.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/112924#c32326

Commit summary for MediaWiki.r112924:

Initial revision of Genderize extension.

Van de Bugger's comment:

 Reading global variables before they are set opens doors to register globals 
 vulnerability.

Fixed.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


Re: [Wikitech-l] Using PHP's assert in MediaWiki code

2012-03-19 Thread Tim Starling
On 19/03/12 21:43, Christian Aistleitner wrote:
 Being able to vary based on configuration actually is a feature.
 An essential one. It lowers assert's impact on performance. But
 there is no need to mess with configuration. asserts work out of 
 the box. You are only given the possibility to turn them off.

The ability to turn off asserts in C is damaging to system security
and stability, and is part of C's toxic culture of trading off program
correctness for negligible performance improvements.

There are cases where it does make sense to optimise for every last
clock cycle, but such cases are very rare in modern programming.

In another post:
 Have you tried real world examples?

[...]

 function funcAssert() { assert( '$this-isOpen()  $this-mConn'
 ); $this-mConn++; }

[...]

 assert_options( ASSERT_ACTIVE, 0 );

Yeah, very clever. Look, I have a test case where assert() is faster
as well:

?php
function foo() {
   sleep(100);
   return true;
}

assert_options( ASSERT_ACTIVE, 0 );
$t = microtime(true);
assert('foo()');
print (microtime(true) - $t) . \n;
$t = microtime(true);
if (!foo()) { throw Exception('assert!'); }
print (microtime(true) - $t) . \n;
?

Wow, assert() is 17 million times faster that if() in this case! We
should really use assert()!

My previous test of assert() involved a case where the assert() and
the if() were doing roughly the same thing. In such cases, if() is
faster, because it is not a function call.

 The same holds true for the very software MediaWiki is built on.
 The software uses and relies on asserts, but gives you the
 possibility to turn assertion checking off. * MySQL uses asserts
 [1]. * PHP uses asserts [2].
 
 asserts and the possibility to turn them on and off is not
 confusing there.
 
 But MySQL and PHP are not the only adopters of asserts. Just take
 about any quality software. The source code takes advantage of
 asserts (e.g.: Libreoffice [3])
 
 But it's not only practical software engineering. Literature is
 also strongly in favor of using asserts as well: In books: E.g.:
 S. McConnell. Code Complete [4] In papers: E.g.: G. Kudrjavets,
 N. Nagappan, T. Ball. Assessing the Relationship between Software
 Assertions and Code Quality: An Empirical Investigation [5] In
 talks: E.g.: T. Hoare. Assert early, assert often [6]

assert() is better than nothing. It's not better than exceptions and
unit tests, especially not in PHP.

assert() in PHP shares very little in common with assert() in C. In
C, assert() is an empty macro by default. In PHP, by default it
raises a warning. PHP doesn't have macros, so to simulate the C
performance feature, you have to put the source code inside a
string, hiding it from automated source analysis and maintenance
tools, and breaking syntax highlighting. I don't think you can
defend the PHP feature with references that talk about the C feature.

-- Tim Starling


___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[MediaWiki-CodeReview] [MediaWiki r114128]: New comment added, and revision status changed

2012-03-19 Thread MediaWiki Mail
Santhosh.thottingal changed the status of MediaWiki.r114128 to fixme and 
commented it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114128#c32327

Old Status: new
New Status: fixme

Commit summary for MediaWiki.r114128:

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.

Santhosh.thottingal's comment:

Commit missed ext.translate.special.pagetranslation.js and 
ext.translate.special.pagetranslation.css

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r113825]: New comment added

2012-03-19 Thread MediaWiki Mail
IAlex posted a comment on MediaWiki.r113825.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113825#c32328

Commit summary for MediaWiki.r113825:

Reverted r113803: makes already messy class messier (a bit to much)

IAlex's comment:

I'm sorry but I don't see what was more messy there. 

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


Re: [Wikitech-l] Using PHP's assert in MediaWiki code

2012-03-19 Thread Christian Aistleitner
Hi Tim,

On Mon, Mar 19, 2012 at 11:20:53PM +1100, Tim Starling wrote:
  assert_options( ASSERT_ACTIVE, 0 );

 [ unmotivated ranting ]

I was talking about performance on production servers.
Obviously.
Where else would performance matter?

And yes. On production servers, one typically turns checking
assertions off.

assert's are used to catch situations that catch logic errors. You
want to do that during /development/. They are a tool for development
and documentation.

Asserts are not just another nice way to burn cycles on production
systems :D

I doubt that the PHP and MySQL binaries used in production were built
with assertion checking enabled, were left unstripped, ...

 My previous test of assert() involved a case where the assert() and
 the if() were doing roughly the same thing.

'assert' and 'if' are not designed to do the same thing ... So why
should we care to cripple one to simulate the other?

I'd much rather compare how the available tools get required job done.
And for conditions that /always/ hold, assert would be the right tool.

 assert() is better than nothing. It's not better than exceptions and
 unit tests, especially not in PHP.

PHP's assert and unit tests have nothing to do with each other. They
are orthogonal tools.

Either way MediaWiki's stance on the issue is clear now:
To MediaWiki, PHP's assert is evil.

Fair enough!

Kind regards,
Christian



-- 
 quelltextlich e.U.  \\  Christian Aistleitner 
   Companies' registry: 360296y in Linz
Christian Aistleitner
Gruendbergstrasze 65aEmail:  christ...@quelltextlich.at
4040 Linz, Austria   Phone:  +43 732 / 26 95 63
 Fax:+43 732 / 26 95 63
 Homepage: http://quelltextlich.at/
---


signature.asc
Description: Digital signature
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Using prototypical inheritance in dynamically loaded ResourceLoader modules

2012-03-19 Thread Krinkle
offtopic

On Mon, Mar 19, 2012 at 9:35 AM, Daniel Friesen
li...@nadir-seen-fire.comwrote:

 On Mon, 19 Mar 2012 00:40:54 -0700, Dmitriy Sintsov ques...@rambler.ru
 wrote:
 var jqgmap = [];

 for ( var mapIndex in jqgmap ) {


 This is VERY bad JavaScript coding practice. Please use $.each().


This is rather exaggerated. Even more when looking at that suggestion.

Arrays should, indeed, not be enumerated with a for-in loop. Arrays in JS
can only contain numeral indices, so they should simply be iterated with a
simple for-loop like this `for (i = 0; i  myArr.length; i += 1) { .. }`
(maybe cache length for slight performance gain by reducing property
lookups).

Using $.each has overhead (+1+n function invocations). When given an array
it will do a simple for-loop with a counter. It has overhead of 1+n
additional function invocations and context creations. In most cases there
is no use for it. There is one case where it is handy and that's when you
specifically need a local context for the loop (being careful not to create
later-called functions inside the loop, risking all variables being in the
post-loop state). If you don't need a local scope for your loop, then using
$.each (or the native [].forEach in later browsers) is pointless as it only
has overhead of additional function invocations and lowering the position
in the scope chain.

When iterating over objects, however, (not arrays) then $.each is no better
than a for-in loop because (contrary to what some people think) it is not a
shortcut for for-in + if-hasOwn wrapper. When an object is passed, it
literally just does a plain for-in loop invoking the callback with the
value. jQuery does not support environments where someone extends the
native Object.prototype because it is considered harmful (an therefore
MediaWiki inherently does not support that either), so a plain for-in loop
over an object (excluding array objects) is perfectly fine according to our
conventions.

See also http://stackoverflow.com/a/1198447/319266

 but so much for the good (and bad, evil) parts of javascript :D

-- Krinkle
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] Using prototypical inheritance in dynamically loaded ResourceLoader modules

2012-03-19 Thread Krinkle
offtopic

On Mon, Mar 19, 2012 at 2:23 PM, Krinkle krinklem...@gmail.com wrote:

 On Mon, Mar 19, 2012 at 9:35 AM, Daniel Friesen li...@nadir-seen-fire.com
  wrote:

 On Mon, 19 Mar 2012 00:40:54 -0700, Dmitriy Sintsov ques...@rambler.ru
 wrote:
 var jqgmap = [];

 for ( var mapIndex in jqgmap ) {


 This is VERY bad JavaScript coding practice. Please use $.each().


 This is rather exaggerated. Even more when looking at that suggestion.

 Arrays should, indeed, not be enumerated with a for-in loop. Arrays in JS
 can only contain numeral indices, so they should simply be iterated with a


s/can/should only contain numeral indices. Arrays as just objects so they
can indeed
contain anything, and inherit functions. Also note that a for-in loop on
arrays will return
the keys as strings, not numbers:
`var a = ['foo', 'bar']; for (var b in a) {}; console.log(typeof b, b /*
string, 1 */);`


-- Krinkle
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[MediaWiki-CodeReview] [MediaWiki r114081]: New comment added

2012-03-19 Thread MediaWiki Mail
Jeroen De Dauw posted a comment on MediaWiki.r114081.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114081#c32329

Commit summary for MediaWiki.r114081:

adding special page with scaffolding for caching chunks of HTML

Jeroen De Dauw's comment:

r114137 :)

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114026]: New comment added

2012-03-19 Thread MediaWiki Mail
Jeroen De Dauw posted a comment on MediaWiki.r114026.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114026#c32330

Commit summary for MediaWiki.r114026:

follow up r114023 add missing plural

Jeroen De Dauw's comment:

Sorry, I don't know how to correct this - can you do it?

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


Re: [Wikitech-l] Using prototypical inheritance in dynamically loaded ResourceLoader modules

2012-03-19 Thread Dmitriy Sintsov

On 19.03.2012 17:23, Krinkle wrote:

offtopic

On Mon, Mar 19, 2012 at 9:35 AM, Daniel Friesen
li...@nadir-seen-fire.comwrote:


On Mon, 19 Mar 2012 00:40:54 -0700, Dmitriy Sintsovques...@rambler.ru
wrote:
var jqgmap = [];


for ( var mapIndex in jqgmap ) {


This is VERY bad JavaScript coding practice. Please use $.each().


This is rather exaggerated. Even more when looking at that suggestion.

Arrays should, indeed, not be enumerated with a for-in loop. Arrays in JS
can only contain numeral indices, so they should simply be iterated with a
simple for-loop like this `for (i = 0; i  myArr.length; i += 1) { .. }`
(maybe cache length for slight performance gain by reducing property
lookups).


My array is numeric but sparse,
myArr = [];
myArr[0] = a;
myArr[1] = b;
So I cannot just use incremental key iteration, at least existence of 
element should be checked.




Using $.each has overhead (+1+n function invocations). When given an array
it will do a simple for-loop with a counter. It has overhead of 1+n
additional function invocations and context creations. In most cases there
is no use for it. There is one case where it is handy and that's when you
specifically need a local context for the loop (being careful not to create
later-called functions inside the loop, risking all variables being in the
post-loop state). If you don't need a local scope for your loop, then using
$.each (or the native [].forEach in later browsers) is pointless as it only
has overhead of additional function invocations and lowering the position
in the scope chain.

When iterating over objects, however, (not arrays) then $.each is no better
than a for-in loop because (contrary to what some people think) it is not a
shortcut for for-in + if-hasOwn wrapper. When an object is passed, it
literally just does a plain for-in loop invoking the callback with the
value. jQuery does not support environments where someone extends the
native Object.prototype because it is considered harmful (an therefore
MediaWiki inherently does not support that either), so a plain for-in loop
over an object (excluding array objects) is perfectly fine according to our
conventions.

See also http://stackoverflow.com/a/1198447/319266

 but so much for the good (and bad, evil) parts of javascript :D


I was thinking about Daniel warnings on Array prototyping and thought 
that proper iteration would check whether the prototype has the same 
member, then do not include it (skip from) callback.

Dmitriy

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[MediaWiki-CodeReview] [MediaWiki r114058]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Reedy changed the status of MediaWiki.r114058 to new
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114058

Old status:  fixme
New status: new

Commit summary for MediaWiki.r114058:

MFT x2 r114057

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114081]: New comment added, and revision status changed

2012-03-19 Thread MediaWiki Mail
Krinkle changed the status of MediaWiki.r114081 to fixme and commented it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114081#c32331

Old Status: new
New Status: fixme

Commit summary for MediaWiki.r114081:

adding special page with scaffolding for caching chunks of HTML

Krinkle's comment:

pre
+   if ( $this-cacheExpiry  10 ) {
..
+   wfGetCache( CACHE_ANYTHING )-set( 
$this-getCacheKey(), $this-cachedChunks, $this-cacheExpiry );
/pre
The codeBagOStuff/code class (of which an instance is returned via 
ObjectCache via wfGetCache) uses 86400 * 3650 (10 years) which doesn't match 
10 (32 years).

This should match the codeBagOStuff::convertExpiry/code 
([https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/objectcache/BagOStuff.php?revision=02view=markuppathrev=114081#l155
 source code]) of 86400 * 3650,  else weird edge cases will occur.

Marking FIXME for the above.


pre
+'cachedspecial-viewing-cached-ttl' = 'You are viewing a cached version of 
this page, which can be up to $1 old.',
+'cachedspecial-viewing-cached-ts' = 'You are viewing a cached version of this 
page, which might not be completely actual.',
 ...
+   if ( $this-cacheExpiry  10 ) {
+   $message = $this-msg(
+   'cachedspecial-viewing-cached-ttl',
+   $this-getLanguage()-duration( 
$this-cacheExpiry )
+   )-escaped();
+   }
+   else {
+   $message = $this-msg(
+   'cachedspecial-viewing-cached-ts'
+   )-escaped();
+   }
/pre

The UI can do than this. I think the user wants to know in both cases:
* how old it is (store last modified, should be simple)
And maybe: 
* how long until the next refresh (computable in both cases I think)
* or: how often it will be refreshed
So that it says something like cached on date X, refreshed every 30 days and 
not cache can be up to 30 days old. Basically matching the QueryPage type 
special pages.


Right now it is showing how it it could be (in ttl case), and nothing useful at 
all (in the ts case).

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114057]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Reedy changed the status of MediaWiki.r114057 to new
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114057

Old status:  fixme
New status: new

Commit summary for MediaWiki.r114057:

Use more normal $dir code, remove duplicate loading of same file as it's going 
to give errors

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114131]: New comment added, and revision status changed

2012-03-19 Thread MediaWiki Mail
Krinkle changed the status of MediaWiki.r114131 to fixme and commented it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114131#c32332

Old Status: new
New Status: fixme

Commit summary for MediaWiki.r114131:

Change calls from Xml::namespaceSelector() to Html::namespaceSelector() since 
the former now throws deprecation warnings...

Krinkle's comment:

pre
--
Index: trunk/phase3/includes/specials/SpecialProtectedpages.php
--
@@ -187,8 +187,19 @@
return span style='white-space: nowrap' .
-   Xml::label( wfMsg( 'namespace' ), 'namespace' ) . 
'#160;'
-   . Xml::namespaceSelector( $namespace, '' ) . /span;
+   Html::rawElement( 'span', array( 'style' = 
'white-space:nowrap' ),
+   Html::namespaceSelector(
/pre

The original opening tag is still there, that doesn't look right:

pre
span style='white-space: nowrap'span style=white-space:nowraplabel  .. 
/label#160;select  .../select/span#160;

span style='white-space: nowrap'label ../label#160;select  .. 
/select/span
/pre

Rest looks OK. Marking FIXME for the above.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114131]: New comment added, and revision status changed

2012-03-19 Thread MediaWiki Mail
Krinkle changed the status of MediaWiki.r114131 to resolved and commented 
it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114131#c32333

Old Status: fixme
New Status: resolved

Commit summary for MediaWiki.r114131:

Change calls from Xml::namespaceSelector() to Html::namespaceSelector() since 
the former now throws deprecation warnings...

Krinkle's comment:

Fixed in r114140

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114117]: New comment added

2012-03-19 Thread MediaWiki Mail
Krinkle posted a comment on MediaWiki.r114117.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114117#c32334

Commit summary for MediaWiki.r114117:

* (bug 35303) Make proxy and DNS blacklist blocking work again

Krinkle's comment:

Could you please stop committing to trunk and REL1_19 at the same time?

I noticed it a few times now. It makes it harder to filter things for 
mediawiki-core (since common-rootpath is no longer /trunk/phase3) and puts 
unreviewed code in a release branch. Everybody gets reviewed, no exceptions 
please.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114116]: New comment added

2012-03-19 Thread MediaWiki Mail
Krinkle posted a comment on MediaWiki.r114116.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114116#c32335

Commit summary for MediaWiki.r114116:

[jquery.byteLimit] Set vars in return this.each loop
* Set vars in return this.each loop. This is the defacto standard plugin 
structure
  but somehow it slipped through this one (it's a 2 line wrapper, easy to miss).
* Added unit test (which failed before this commit)
* Fixes:
-- (bug 35294) jquery.byteLimit shouldn't set element specific variables 
outside the return this.each loop.

Krinkle's comment:

Done in r114121.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114117]: New comment added

2012-03-19 Thread MediaWiki Mail
Krinkle posted a comment on MediaWiki.r114117.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114117#c32336

Commit summary for MediaWiki.r114117:

* (bug 35303) Make proxy and DNS blacklist blocking work again

Krinkle's comment:

It also makes it less obvious to merge to 1.19wmf1.

btw: should this be backported to REL1_18 (for a potential 1.18.x release) or 
is this a 1.19 regression?

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114106]: New comment added

2012-03-19 Thread MediaWiki Mail
Krinkle posted a comment on MediaWiki.r114106.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114106#c32337

Commit summary for MediaWiki.r114106:

Disable callgraphs for the time being

Per Yuvi, most people don't need them, and are a PITA on a slow connection

I'd be happy to re-enable them if we can get them on hyperlinks or subpages or 
some such

{{BeBold}}

Krinkle's comment:

Is there a way to override this from CLI or LocalSettings? I think the WMF 
instance should at least include them, I find them useful from time to time to 
visually get to know certain areas of MediaWiki that I don't know very well yet 
(saves me ack'ing from file to file to file..)

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114101]: New comment added

2012-03-19 Thread MediaWiki Mail
Krinkle posted a comment on MediaWiki.r114101.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114101#c32338

Commit summary for MediaWiki.r114101:

follow up to r114081: qqq, and to r114082: match rename

Krinkle's comment:

pre
+'cachedspecial-viewing-cached-ts' = 'Message notifying they are watching a 
cached page.',
 /pre
Just FYI: Better use viewing instead of watching to stick with the general 
terminology used in MediaWiki, as well as to avoid confusion with WatchAction 
(after adding a page to your watchlist it may also say You are now watching 
...). Especially for non-native speakers of English.

(fixed at translatewiki.net)

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r113886]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Krinkle changed the status of MediaWiki.r113886 to resolved
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113886

Old status:  new
New status: resolved

Commit summary for MediaWiki.r113886:

Add error css to errors like the other file operation pages and actions

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114051]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Krinkle changed the status of MediaWiki.r114051 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114051

Old status:  new
New status: ok

Commit summary for MediaWiki.r114051:

making corresponding change as a follow up r114050

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114106]: New comment added

2012-03-19 Thread MediaWiki Mail
Reedy posted a comment on MediaWiki.r114106.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114106#c32339

Commit summary for MediaWiki.r114106:

Disable callgraphs for the time being

Per Yuvi, most people don't need them, and are a PITA on a slow connection

I'd be happy to re-enable them if we can get them on hyperlinks or subpages or 
some such

{{BeBold}}

Reedy's comment:

We could run a second copy and call it doclite or something

It seems a bit daft making people build a copy themselves to save the huge 
image overhead, though, locally would be a lot faster anyway

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


Re: [Wikitech-l] JS Iteration (was: Using prototypical inheritance in dynamically loaded ResourceLoader modules)

2012-03-19 Thread Krinkle
ontopic :) 
On Mon, Mar 19, 2012 at 3:03 PM, Dmitriy Sintsov ques...@rambler.ru wrote:

 On 19.03.2012 17:23, Krinkle wrote:


 On Mon, Mar 19, 2012 at 9:35 AM, Daniel Friesen
 li...@nadir-seen-fire.com**wrote:

  On Mon, 19 Mar 2012 00:40:54 -0700, Dmitriy Sintsovques...@rambler.ru
 wrote:
 var jqgmap = [];

  for ( var mapIndex in jqgmap ) {

  This is VERY bad JavaScript coding practice. Please use $.each().

  This is rather exaggerated. Even more when looking at that suggestion.

 Arrays should, indeed, not be enumerated with a for-in loop. Arrays in JS
 can only contain numeral indices, so they should simply be iterated with a
 simple for-loop like this `for (i = 0; i  myArr.length; i += 1) { .. }`
 (maybe cache length for slight performance gain by reducing property
 lookups).

  My array is numeric but sparse,
 myArr = [];
 myArr[0] = a;
 myArr[1] = b;
 So I cannot just use incremental key iteration, at least existence of
 element should be checked.


If you use an array, use `myArr[myArr.length] = value;` or
`myArr.push(value);` to add something to it. And `.slice(..)` or
`.splice(..)` to remove something from it. Never set a key directly or
remove a key directly.

If you want a non-linear array, create an object instead. JavaScript allows
to do this (because Array is just an extension of Object in javascript),
but that doesn't mean you should.

If you need non-linear keys, don't create an array!

code
var myObj = {}; // not []
myObj.property = value;

var customProp = getPropName();
myObj[customProp] = value;

for ( var key in myObj ) {
  // myObj[key]
}
/code

-- Krinkle
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[Wikitech-l] QA/testing project page exists

2012-03-19 Thread Chris McMahon
After doing a lot of research and visiting WMF for a week, I created a
QA/testing project page here: http://www.mediawiki.org/wiki/QA/testing

tl;dr: it is early days yet and lots of details to be worked out, but I
have a picture in place of an integrated, valuable QA/testing structure and
process that revolves around Jenkins and the labs cluster wikis.  In the
long run this should provide a reliable way to involve the global software
testing community in WMF features testing, as well as involve WMF tech
people in valuable testing activities.

Comments and criticism most welcome!

-Chris
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[Wikitech-l] What is the procedure to change the owner of a WM mailing list?

2012-03-19 Thread Strainu
Hi,

The Romanian mailing lists are managed by a wikipedian that has left
the project some years ago and now he doesn't have time to moderate
the lists. What is the normal procedure to be followed to have
somebody else take over the lists?

Thanks,
  Strainu

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] What is the procedure to change the owner of a WM mailing list?

2012-03-19 Thread Petr Bena
Hi

It's just about transfering the password from him to someone else, or
in case he doesn't remember it, you can request a new password.

On Mon, Mar 19, 2012 at 4:33 PM, Strainu strain...@gmail.com wrote:
 Hi,

 The Romanian mailing lists are managed by a wikipedian that has left
 the project some years ago and now he doesn't have time to moderate
 the lists. What is the normal procedure to be followed to have
 somebody else take over the lists?

 Thanks,
  Strainu

 ___
 Wikitech-l mailing list
 Wikitech-l@lists.wikimedia.org
 https://lists.wikimedia.org/mailman/listinfo/wikitech-l

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] QA/testing project page exists

2012-03-19 Thread Bergi

Chris McMahon schrieb:

After doing a lot of research and visiting WMF for a week, I created a
QA/testing project page here: http://www.mediawiki.org/wiki/QA/testing


Ah, QA means quality assurance.

Other meanings were:
* qualtity articles
* question  answer
* ...
[http://en.wikipedia.org/wiki/QA]

 Bergi


___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] What is the procedure to change the owner of a WM mailing list?

2012-03-19 Thread Jeremy Baron
On Mon, Mar 19, 2012 at 11:41, Petr Bena benap...@gmail.com wrote:
 It's just about transfering the password from him to someone else, or
 in case he doesn't remember it, you can request a new password.

Also, once you have the password you should update the email addresses
for owner and moderator. And maybe change the password. (who knows
when the last change was, or what other past owners/moderators before
the current one had it; also it's good practice to change them
periodically)

-Jeremy

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] What is the procedure to change the owner of a WM mailing list?

2012-03-19 Thread Casey Brown
On Mon, Mar 19, 2012 at 11:41 AM, Petr Bena benap...@gmail.com wrote:
 It's just about transfering the password from him to someone else, or
 in case he doesn't remember it, you can request a new password.

Yes. Create a bug in the Mailing lists component requesting that the
list administrator be changed because he is no longer active on-wiki.
If you can contact him and ask him to give you the password, though,
that's better. You should only request sysadmin intervention if
necessary.

-- 
Casey Brown
Cbrown1023

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[Wikitech-l] New Plugin for Extension:ConfirmEdit - RFC

2012-03-19 Thread nischay nahata
Hi,
I have made a Captcha plugin for ConfirmEdit called MCQ (Multiple Choice
Questions)
Below is the usage of it

sample Captcha:
Pick the correct Option Number
We pray to 1.Time 1.God 3.Lion 4.Tomato ?
 Answer 2

Why Beneficial ?
* Bots don't have common sense
* No Images so loads faster
* Most Important - Good support for i18n
* Further plans to let the user just select the right option rather
than typing text


It is currently hosted on github at https://github.com/nischayn22/MCQCaptcha
.

This is my first Extension/Plugin so it may have many faults, my apologies
for that.
Please leave your comments
-- 
With Regards

Nischay Nahata
B.tech 3rd year
Department of Information Technology
NITK,Surathkal
IRC nick- nischayn22
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] API - Edit by IP not by user

2012-03-19 Thread nischay nahata

  I'm not sure what version the dutch one has.


You can check version using Special:Version

-- 
With Regards

Nischay Nahata
B.tech 3rd year
Department of Information Technology
NITK,Surathkal
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[MediaWiki-CodeReview] [MediaWiki r114005]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Preilly changed the status of MediaWiki.r114005 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114005

Old status:  new
New status: ok

Commit summary for MediaWiki.r114005:

make form rule more specific

this will break rendering of forms outside the
header e.g. feedback form

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114025]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Preilly changed the status of MediaWiki.r114025 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114025

Old status:  new
New status: ok

Commit summary for MediaWiki.r114025:

use top for absolute positioning not bottom

using bottom doesn't work on certain mobile devices
crucially on iphone. Instead use top

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114129]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Preilly changed the status of MediaWiki.r114129 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114129

Old status:  new
New status: ok

Commit summary for MediaWiki.r114129:

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.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114130]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Preilly changed the status of MediaWiki.r114130 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114130

Old status:  new
New status: ok

Commit summary for MediaWiki.r114130:

Follow-up r114129: rename file

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114134]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Preilly changed the status of MediaWiki.r114134 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114134

Old status:  new
New status: ok

Commit summary for MediaWiki.r114134:

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.)

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114136]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Preilly changed the status of MediaWiki.r114136 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114136

Old status:  new
New status: ok

Commit summary for MediaWiki.r114136:

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§ revealing of references 200ms
allowing us to experiment with correct values

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r114145]: Revision status changed

2012-03-19 Thread MediaWiki Mail
Preilly changed the status of MediaWiki.r114145 to ok
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114145

Old status:  new
New status: ok

Commit summary for MediaWiki.r114145:

remove languageselection div

there are currently 2 elements with id
languageselection. This one appears to be
redundant

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


  1   2   3   >