Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions Bugzilla.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
'descriptionmsg' => 'bugzilla-desc',
);

$wgResourceModules['ext.Bugzilla'] = array(
'scripts' => array( 'web/js/jquery.dataTables.js' ),
'styles' => array( 'web/css/demo_page.css', 'web/css/demo_table.css', 'web/css/bugzilla.css' ),
'messages' => array( 'bugzilla-hello-world', 'bugzilla-goodbye-world' ),
'dependencies' => array( 'jquery.ui.core' ),
'position' => 'top', // jquery.dataTables.js errors otherwise :(
'localBasePath' => __DIR__,
'remoteExtPath' => 'Bugzilla'
);

/**
* Classes to be autoloaded by mediawiki. Should you add any cache options, you
Expand Down Expand Up @@ -86,15 +95,19 @@ function BugzillaIncludeHTML( &$out, &$sk ) {

// Add a local jquery UI theme css file
$out->addStyle("$wgScriptPath/extensions/Bugzilla/web/jqueryui/1.8.14/themes/smoothness/jquery-ui.css");
}

// Add a local script file for the datatable
$out->addScriptFile("$wgScriptPath/extensions/Bugzilla/web/js/jquery.dataTables.js");
// Add a local script file for the datatable
$out->addScriptFile("$wgScriptPath/extensions/Bugzilla/web/js/jquery.dataTables.js");

// Add local datatable styles
$out->addStyle("$wgScriptPath/extensions/Bugzilla/web/css/demo_page.css");
$out->addStyle("$wgScriptPath/extensions/Bugzilla/web/css/demo_table.css");

// Add local bugzilla extension styles
$out->addStyle("$wgScriptPath/extensions/Bugzilla/web/css/bugzilla.css");

}

// Add local datatable styles
$out->addStyle("$wgScriptPath/extensions/Bugzilla/web/css/demo_page.css");
$out->addStyle("$wgScriptPath/extensions/Bugzilla/web/css/demo_table.css");
// Add the script to do table magic
$out->addInlineScript('$(document).ready(function() {
$("table.bugzilla").dataTable({
Expand All @@ -105,14 +118,13 @@ function BugzillaIncludeHTML( &$out, &$sk ) {
);
}

// Add local bugzilla extension styles
$out->addStyle("$wgScriptPath/extensions/Bugzilla/web/css/bugzilla.css");

// Let the user optionally override bugzilla extension styles
if( file_exists("$wgScriptPath/extensions/Bugzilla/web/css/custom.css") ) {
$out->addStyle("$wgScriptPath/extensions/Bugzilla/web/css/custom.css");
}

$out->addModules('ext.Bugzilla');

// Let the other hooks keep processing
return TRUE;
}
Expand Down