Skip to content

Commit

Permalink
Merge pull request #276 from freezingsaddles/modernize-google-charts
Browse files Browse the repository at this point in the history
Modernize loading of Google Charts. Tested, works fine.
  • Loading branch information
obscurerichard authored Nov 24, 2024
2 parents 465a48b + 1652ebc commit 9b1d82a
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 52 deletions.
8 changes: 0 additions & 8 deletions freezing/web/static/js/html5shiv-3.7.0.js

This file was deleted.

6 changes: 0 additions & 6 deletions freezing/web/static/js/respond-1.3.0.min.js

This file was deleted.

11 changes: 1 addition & 10 deletions freezing/web/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>{% block title %}{{ competition_title }}{% endblock %}</title>

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script src="https://www.gstatic.com/charts/loader.js"></script>

<!-- generated favicon stuff -->
<link rel="apple-touch-icon" sizes="57x57" href="/ico/apple-icon-57x57.png">
Expand Down Expand Up @@ -219,15 +219,6 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="/js/ekko-lightbox-min.js"></script>

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="/js/html5shiv-3.7.0.js"></script>
<script src="/js/respond-1.3.0.min.js"></script>
<![endif]-->



<script type="text/javascript">
$(document).ready(function ($) {

Expand Down
4 changes: 2 additions & 2 deletions freezing/web/templates/explore/indiv_elev_dist.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{% block head %}
<script type="text/javascript">

google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
google.charts.load("visualization", "1", {packages:["corechart"]});
google.charts.setOnLoadCallback(drawChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
Expand Down
8 changes: 4 additions & 4 deletions freezing/web/templates/explore/riders_by_lowtemp.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
{% block head %}
<script type="text/javascript">

// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Load the Visualization API and the corechart package.
google.charts.load('visualization', '1.0', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawPointsChart);
//google.setOnLoadCallback(drawMileageChart);
google.charts.setOnLoadCallback(drawPointsChart);
//google.charts.setOnLoadCallback(drawMileageChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
Expand Down
8 changes: 4 additions & 4 deletions freezing/web/templates/explore/team_cumul.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
{% block head %}
<script type="text/javascript">

// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Load the Visualization API and the corechart package.
google.charts.load('visualization', '1.0', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawPointsChart);
google.setOnLoadCallback(drawMileageChart);
google.charts.setOnLoadCallback(drawPointsChart);
google.charts.setOnLoadCallback(drawMileageChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
Expand Down
8 changes: 4 additions & 4 deletions freezing/web/templates/explore/team_weekly_points.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
{% block head %}
<script type="text/javascript">

// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Load the Visualization API and the corechart package.
google.charts.load('visualization', '1.0', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawPointsChart);
//google.setOnLoadCallback(drawMileageChart);
google.charts.setOnLoadCallback(drawPointsChart);
//google.charts.setOnLoadCallback(drawMileageChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
Expand Down
6 changes: 3 additions & 3 deletions freezing/web/templates/leaderboard/indiv.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{% block head %}
<script type="text/javascript">

// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Load the Visualization API and the corechart package.
google.charts.load('visualization', '1.0', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawIndivChart);
google.charts.setOnLoadCallback(drawIndivChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
Expand Down
6 changes: 3 additions & 3 deletions freezing/web/templates/leaderboard/indiv_various.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{% block head %}
<script type="text/javascript">

// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Load the Visualization API and the corechart package.
google.charts.load('visualization', '1.0', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
// google.setOnLoadCallback(drawIndivChart);
// google.charts.setOnLoadCallback(drawIndivChart);


function drawIndivChart(api_method, label) {
Expand Down
8 changes: 4 additions & 4 deletions freezing/web/templates/leaderboard/team.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
{% block head %}
<script type="text/javascript">

// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Load the Visualization API and the corechart package.
google.charts.load('visualization', '1.0', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawTeamChart);
google.setOnLoadCallback(drawIndivChart);
google.charts.setOnLoadCallback(drawTeamChart);
google.charts.setOnLoadCallback(drawIndivChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
Expand Down
6 changes: 3 additions & 3 deletions freezing/web/templates/leaderboard/team_various.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{% block head %}
<script type="text/javascript">

// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Load the Visualization API and the corechart package.
google.charts.load('visualization', '1.0', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
//google.setOnLoadCallback(drawIndivChart);
//google.charts.setOnLoadCallback(drawIndivChart);


function drawChart(api_method, label) {
Expand Down
2 changes: 1 addition & 1 deletion freezing/web/templates/user/rides.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<script type="text/javascript">

// Load the Visualization API and the piechart package.
// Load the Visualization API and the corechart package.
google.load('visualization', '1.0', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
Expand Down

0 comments on commit 9b1d82a

Please sign in to comment.