FontAwesome: Difference between revisions
No edit summary |
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight" Tags: Mobile edit Mobile web edit |
||
| Line 68: | Line 68: | ||
The best way I've found is to modify [[MediaWiki:Common.js]], but I ran into [[#Problems]] with that too. | The best way I've found is to modify [[MediaWiki:Common.js]], but I ran into [[#Problems]] with that too. | ||
< | <syntaxhighlight lang=javascript> | ||
/*To add script tags to the page we use load instead of the deprecated importScriptURI */ | /*To add script tags to the page we use load instead of the deprecated importScriptURI */ | ||
/* You'll need to visit the fontawesome site to get a KEY to use */ | /* You'll need to visit the fontawesome site to get a KEY to use */ | ||
mw.loader.load('//use.fontawesome.com/aldfjsdlkfjdlskf0.js'); | mw.loader.load('//use.fontawesome.com/aldfjsdlkfjdlskf0.js'); | ||
</ | </syntaxhighlight> | ||
I'll check into all the recent details of the '[https://www.mediawiki.org/wiki/ResourceLoader ResourceLoader]' mechanism, and write a new extension or update comments here. | I'll check into all the recent details of the '[https://www.mediawiki.org/wiki/ResourceLoader ResourceLoader]' mechanism, and write a new extension or update comments here. | ||
| Line 78: | Line 78: | ||
Some would say that you can shim into [https://doc.wikimedia.org/mediawiki-core/master/php/classOutputPage.html OutputPage] by calling a hook in your LocalSettings.php | Some would say that you can shim into [https://doc.wikimedia.org/mediawiki-core/master/php/classOutputPage.html OutputPage] by calling a hook in your LocalSettings.php | ||
< | <syntaxhighlight lang=php> | ||
$wgHooks['BeforePageDisplay'][] ='onBeforePageDisplay'; | $wgHooks['BeforePageDisplay'][] ='onBeforePageDisplay'; | ||
| Line 87: | Line 87: | ||
return true; | return true; | ||
}; | }; | ||
</ | </syntaxhighlight> | ||
But that did not seem effective. | But that did not seem effective. | ||