}
if ( expandFrom === 'start' ) {
- expandFrom = docDir === 'rtl' ? 'right': 'left';
+ expandFrom = docDir === 'rtl' ? 'right' : 'left';
} else if ( expandFrom === 'end' ) {
- expandFrom = docDir === 'rtl' ? 'left': 'right';
+ expandFrom = docDir === 'rtl' ? 'left' : 'right';
}
return expandFrom;
} else {
// Expand from right
newCSS.left = 'auto';
- newCSS.right = $( document ).width() - ( context.config.$region.offset().left + context.config.$region.outerWidth() );
+ newCSS.right = $( 'body' ).width() - ( context.config.$region.offset().left + context.config.$region.outerWidth() );
}
context.data.$container.css( newCSS );
/**
* Encode page titles for use in a URL
+ *
* We want / and : to be included as literal characters in our title URLs
- * as they otherwise fatally break the title
+ * as they otherwise fatally break the title.
+ *
+ * The others are decoded because we can, it's prettier and matches behaviour
+ * of `wfUrlencode` in PHP.
*
* @param {string} str String to be encoded.
*/
wikiUrlencode: function ( str ) {
return util.rawurlencode( str )
- .replace( /%20/g, '_' ).replace( /%3A/g, ':' ).replace( /%2F/g, '/' );
+ .replace( /%20/g, '_' )
+ // wfUrlencode replacements
+ .replace( /%3B/g, ';' )
+ .replace( /%40/g, '@' )
+ .replace( /%24/g, '$' )
+ .replace( /%21/g, '!' )
+ .replace( /%2A/g, '*' )
+ .replace( /%28/g, '(' )
+ .replace( /%29/g, ')' )
+ .replace( /%2C/g, ',' )
+ .replace( /%2F/g, '/' )
+ .replace( /%3A/g, ':' );
},
/**
// RegExp is case insensitive
'i'
);
- return ( null !== mailtxt.match( html5EmailRegexp ) );
+ return ( mailtxt.match( html5EmailRegexp ) !== null );
},
/**