-
Notifications
You must be signed in to change notification settings - Fork 44
/
dailybread.html
89 lines (73 loc) · 2.65 KB
/
dailybread.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
layout: default
title: The Daily Bread
---
<div class="container">
<div id="dailybread">
<h2 class="page-header">The Daily Bread <small> Costs for the British Taxpayer per Day</small></h2>
<div id="preloader" style="text-align: center; padding: 100px"><img src="/img/ajax-loader.gif" style="vertical-align:top" /> <span class="txt">loading javascript libraries</span></div>
<div id="content-wrap" style="display:none">
<div id="db-topbar" class="layout-row layout-3col-15-70-15">
<div id="db-salary" class="layout-col layout-col-1">
<h2>Salary</h2>
<p>£22,000</p>
</div>
<div id="db-slider" class="layout-col layout-col-2">
<h2>Select your salary</h2>
<div class="wdmmg-slider"></div>
</div>
<div id="db-tax" class="layout-col layout-col-3">
<h2>Your tax</h2>
<p>£8,621</p>
</div>
</div><!-- /#db-topbar -->
</div>
</div><!-- /#dailybread -->
</div><!-- /.container -->
<script>
(function () {
var os_path = '{{site.openspendingjs}}';
var db_load_data = function load_data(db, data) {
$('#content-wrap').show();
$('#preloader').remove();
db.setDataFromAggregator(data, ['unknown']);
db.setIconLookup(function(name) {
var style = OpenSpending.Styles.Cofog[name];
if (style != undefined) {
return style['icon'];
}
return 'img/functions/unknown.svg';
});
db.draw();
}
var db_init = function db_init() {
$('#preloader .txt').html('loading data');
var db = new OpenSpending.DailyBread($('#dailybread'));
new OpenSpending.Aggregator({
apiUrl: 'https://legacy.openspending.org/api',
dataset: 'ukgov-finances-cra',
drilldowns: ['cofog1', 'cofog2', 'cofog3'],
cuts: ['year:2010'],
rootNodeLabel: 'Total',
breakdown: 'region',
callback: function (data) { db_load_data(db, data); }
});
}
yepnope({
load: [
// 'http://wheredoesmymoneygo.org/wp-content/themes/wdmmg/wdmmg.css',
'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/ui-lightness/jquery-ui.css',
'https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js',
'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js',
os_path + '/lib/vendor/base64.js',
os_path + '/lib/vendor/underscore.js',
os_path + '/lib/vendor/raphael-min.js',
os_path + '/lib/aggregator.js',
os_path + '/app/dailybread/css/dailybread.css',
'/img/functions/cofog_dailybread.js',
os_path + '/app/dailybread/js/dailybread.js'
],
complete: function () { jQuery(function ($) { db_init() } ); }
});
}());
</script>