mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-14 19:31:55 +00:00
Allow data URLs for toolbar icons
The autoIcon function now immediately returns the icon URL if it begins with "data:". Bug: T27223 Change-Id: Ib62f1f50f612ddae9b5f8fb4a6b59863a6da3c98
This commit is contained in:
parent
2075d6d2dc
commit
05a6e4e6a6
|
@ -193,6 +193,12 @@
|
|||
key = fallbackChain[ i ];
|
||||
if ( icon && hasOwn.call( icon, key ) ) {
|
||||
src = icon[ key ];
|
||||
|
||||
// Return a data URL immediately
|
||||
if ( src.substr( 0, 5 ) === 'data:' ) {
|
||||
return src;
|
||||
}
|
||||
|
||||
// Prepend path if src is not absolute
|
||||
if ( src.substr( 0, 7 ) !== 'http://' && src.substr( 0, 8 ) !== 'https://' && src[ 0 ] !== '/' ) {
|
||||
src = path + src;
|
||||
|
|
Loading…
Reference in a new issue