Reduce debugging overhead a bit, and provide default internal image size

Change-Id: I345af8c5905a5fa747f9ed342ba2ba8c1026d044
This commit is contained in:
Gabriel Wicke 2012-05-03 14:49:55 +02:00
parent 6e21f6bb27
commit 6139398494
2 changed files with 6 additions and 7 deletions

View file

@ -184,9 +184,8 @@ WikiLinkHandler.prototype.renderFile = function ( token, frame, cb, title ) {
a.dataAttribs = token.dataAttribs;
var width, height;
if ( ! height in oHash && ! width in oHash ) {
width = '120px';
height = '120px';
if ( ! oHash.height && ! oHash.width ) {
width = '200px';
} else {
width = oHash.width;
height = oHash.height;
@ -349,6 +348,7 @@ ExternalLinkHandler.prototype.onUrlLink = function ( token, frame, cb ) {
[
new KV( 'src', href ),
new KV( 'alt', href.split('/').last() )
]
)
} );

View file

@ -269,8 +269,7 @@ MWParserEnvironment.prototype.tokensToString = function ( tokens, strict ) {
if ( token === undefined ) {
if ( this.debug ) { console.trace(); }
this.tp( 'MWParserEnvironment.tokensToString, invalid token: ' +
JSON.stringify( token ) +
' tokens:' + JSON.stringify( tokens, null, 2 ));
token, ' tokens:', tokens);
continue;
}
if ( token.constructor === String ) {
@ -282,8 +281,8 @@ MWParserEnvironment.prototype.tokensToString = function ( tokens, strict ) {
return [out.join(''), tokens.slice( i )];
}
var tstring = JSON.stringify( token );
this.dp ( 'MWParserEnvironment.tokensToString, non-text token: ' +
tstring + JSON.stringify( tokens, null, 2 ) );
this.dp ( 'MWParserEnvironment.tokensToString, non-text token: ',
tstring, tokens);
if ( this.debug ) { console.trace(); }
//out.push( tstring );
}