Handle upright option properly

Change-Id: I831fcccf874f9a0505e88eb76d269b1d2f68e3e0
This commit is contained in:
Gabriel Wicke 2012-05-03 16:15:34 +02:00
parent c4fc7508a7
commit 57dfd89383

View file

@ -90,9 +90,7 @@ WikiLinkHandler.prototype._simpleImageOptions = {
'frameless': 'format',
'frame': 'format',
'thumbnail': 'format',
'thumb': 'format',
// orientation,
'upright': 'orientation'
'thumb': 'format'
};
WikiLinkHandler.prototype._prefixImageOptions = {
@ -100,7 +98,8 @@ WikiLinkHandler.prototype._prefixImageOptions = {
'alt': 'alt',
'page': 'page',
'thumbnail': 'thumb',
'thumb': 'thumb'
'thumb': 'thumb',
'upright': 'aspect'
};
WikiLinkHandler.prototype.renderFile = function ( token, frame, cb, title ) {
@ -152,7 +151,7 @@ WikiLinkHandler.prototype.renderFile = function ( token, frame, cb, title ) {
} else {
var bits = oText.split( '=', 2 ),
key = this._prefixImageOptions[ bits[0].trim().toLowerCase() ];
if ( bits.length > 1 && key) {
if ( bits[0] && key) {
oHash[key] = bits[1];
options.push( new KV( key, bits[1] ) );
//console.warn('handle prefix ' + bits );