Skip to content

Commit

Permalink
Load chartjs from CDN
Browse files Browse the repository at this point in the history
  • Loading branch information
vboctor committed Jul 9, 2016
1 parent 60d67ec commit 572823b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugins/MantisGraph/MantisGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static function autoload( $p_class ) {
*/
function hooks() {
$t_hooks = array(
'EVENT_LAYOUT_RESOURCES' => 'resources',
'EVENT_MENU_SUMMARY' => 'summary_menu',
'EVENT_SUBMENU_SUMMARY' => 'summary_submenu',
'EVENT_MENU_FILTER' => 'graph_filter_menu'
Expand Down Expand Up @@ -112,6 +113,15 @@ function graph_filter_menu() {
}
}

/**
* Include javascript files for chart.js
* @return void
*/
function resources() {
echo '<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.6/Chart.min.js"></script>';
echo '<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.6/Chart.bundle.min.js"></script>';
}

/**
* generate summary submenu
* @return array
Expand Down

0 comments on commit 572823b

Please sign in to comment.