-
Notifications
You must be signed in to change notification settings - Fork 10
/
dailybread.html
157 lines (129 loc) · 5.53 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
---
layout: default
title: 일일 지출 내역
---
<div class="container">
<div role="tabpanel">
<p style="padding-top: 30px; text-align: center;">중앙 정부에서 사용한 소득세 내역과 지방 정부에서 사용한 지방소득세 내역을 선택하세요.</p>
<div id="myTab" class="row" role="tablist">
<div class="centralTab col-md-6" role="presentation">
<a href="#central" aria-controls="central" role="tab" data-toggle="tab">
<img id="btn-central" src="/img/btn-central-active.png" alt="">
</a>
</div>
<div class="localTab col-md-6" role="presentation">
<a href="#local" aria-controls="local" role="tab" data-toggle="tab">
<img id="btn-local" src="/img/btn-local.png"></img>
</a>
</div>
</div>
<div id="myTabContent" class="tab-content">
<div id="central" class="tab-pane active" aria-labelledby="central-tab" role="tabpanel">
<div id="dailybread-central">
<h2 class="page-header">일일 지출 내역 <small> 하루동안 대한민국 납세자가 지불하는 비용</small></h2>
<div id="preloader-central" style="text-align: center; padding: 100px"><img src="/img/ajax-loader.gif" style="vertical-align:top" /> <span class="txt">자바스크립트 라이브러리를 불러오는 중입니다.</span></div>
<div id="content-wrap-central" style="display:none">
<div id="db-topbar-central" class="layout-row layout-3col-15-70-15">
<div id="db-salary-central" class="layout-col layout-col-1">
<h2>연봉</h2>
<p>₩30,000,000</p>
</div>
<div id="db-slider-central" class="layout-col layout-col-2">
<h2>연 소득을 선택하세요 (세전 기준)</h2>
<div class="wdmmg-slider"></div>
</div>
<div id="db-tax-central" class="layout-col layout-col-3">
<h2>종합소득세</h2>
<p>₩800,000</p>
</div>
</div><!-- /#db-topbar -->
</div>
</div><!-- /#dailybread -->
</div>
<div id="local" class="tab-pane" aria-labelledby="local-tab" role="tabpanel">
<div id="dailybread-local">
<h2 class="page-header">일일 지출 내역 <small> 하루동안 대한민국 납세자가 지불하는 비용</small></h2>
<div id="preloader-local" style="text-align: center; padding: 100px"><img src="/img/ajax-loader.gif" style="vertical-align:top" /> <span class="txt">자바스크립트 라이브러리를 불러오는 중입니다.</span></div>
<div id="content-wrap-local" style="display:none">
<div id="db-topbar-local" class="layout-row layout-3col-15-70-15">
<div id="db-salary-local" class="layout-col layout-col-1">
<h2>연봉</h2>
<p>₩30,000,000</p>
</div>
<div id="db-slider-local" class="layout-col layout-col-2">
<h2>연 소득을 선택하세요 (세전 기준)</h2>
<div class="wdmmg-slider"></div>
</div>
<div id="db-tax-local" class="layout-col layout-col-3">
<h2>지방소득세<span>(종합소득세액/10)</span></h2>
<p>₩800,000</p>
</div>
</div><!-- /#db-topbar -->
</div>
</div><!-- /#dailybread -->
</div>
</div>
</div>
</div><!-- /.container -->
<script src="/js/lib/jquery-ui.min.js"></script>
<script src="/img/functions/cofog_dailybread.js"></script>
<script src="/js/lib/aggregator.js"></script>
<script src="/js/lib/underscore.js"></script>
<script src="/js/dailybread/dailybread.js"></script>
<script src="/js/lib/bootstrap_tab.js"></script>
<script src="/js/lib/setting.js"></script>
<script>
var initSpendingData = function (region) {
var os_path = '{{site.openspendingjs}}';
var db_load_data = function (db, data) {
$('#content-wrap-' + region.title).show();
$('#preloader-' + region.title).remove();
db.setDataFromAggregator(data, ['unknown']);
db.setIconLookup(function(name) {
var style = OpenSpending.Styles.Cofog[name.slice(0, 3)];
if (style != undefined) {
return style['icon'];
}
return 'img/functions/unknown.svg';
});
db.draw();
}
var db_init = function () {
$('#preloader-' + region.title + ' .txt').html('데이터를 불러오는 중입니다.');
var db = new OpenSpending.DailyBread($('#dailybread-' + region.title), {'region': region.title});
new OpenSpending.Aggregator({
apiUrl: 'https://openspending.org/api',
dataset: region.data,
drilldowns: ['cat1', 'cat2'],
cuts: ['year:' + OpenSpending.year],
rootNodeLabel: '총액',
breakdown: 'region',
callback: function (data) { db_load_data(db, data); }
});
}
yepnope({
load: [
'/js/lib/base64.js',
'/js/lib/raphael-min.js'
],
complete: function () { jQuery(function ($) { db_init() } );}
});
};
$(document).ready(function () {
initSpendingData(OpenSpending.centralData);
initSpendingData(OpenSpending.localData);
$('#myTab a').click(function (e) {
e.preventDefault();
$(this).tab('show');
console.log($(this));
});
});
$('.centralTab').click(function () {
$('#btn-central').attr('src', '/img/btn-central-active.png');
$('#btn-local').attr('src', '/img/btn-local.png');
});
$('.localTab').click(function () {
$('#btn-central').attr('src', '/img/btn-central.png');
$('#btn-local').attr('src', '/img/btn-local-active.png');
});
</script>