Skip to content

Commit

Permalink
Switch to resource-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
vonloxley committed Dec 6, 2015
1 parent 6f954d8 commit 9be7c03
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Shariff.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
'description' => 'Insert 2-click "Like" buttons.',
);

$wgResourceModules['ext.Shariff'] = array(
'scripts' => 'shariff.min.js',
'styles' => 'shariff.min.css',
'position' => 'bottom',

'localBasePath' => __DIR__,
'remoteExtPath' => 'Shariff',
);

$wgHooks['ParserFirstCallInit'][] = 'shariffLikeParserFunction_Setup';
$wgHooks['LanguageGetMagic'][] = 'shariffLikeParserFunction_Magic';
$wgHooks['BeforePageDisplay'][] = 'shariffLikeParserFeedHead';
Expand All @@ -36,9 +45,8 @@ function shariffLikeParserFunction_Magic( &$magicWords, $langCode ) {
}

function shariffLikeParserFeedHead(&$out, &$sk) {
global $wgScriptPath;
$out->addHeadItem('shariff.min.css','<link rel="stylesheet" type="text/css" href="'.$wgScriptPath.'/extensions/Shariff/shariff.min.css" />');
$out->addScript('<script type="text/javascript" src="'.$wgScriptPath.'/extensions/Shariff/shariff.min.js"></script>');
$out->addModules( 'ext.Shariff' );

return $out;
}

Expand Down

0 comments on commit 9be7c03

Please sign in to comment.