Commit 97e76b3787d9178ca5b9aa879a438d2cd2867d49
Exists in
master
and in
4 other branches
Enhance FrontEnd
Showing
12 changed files
with
137 additions
and
19 deletions
Show diff stats
CHANGELOG.md
@@ -24,6 +24,11 @@ or major refactoring improvments. | @@ -24,6 +24,11 @@ or major refactoring improvments. | ||
24 | 24 | ||
25 | ## Unreleased | 25 | ## Unreleased |
26 | 26 | ||
27 | +## [0.3.pre-12] - 2021-05-19 - Enhance Front end | ||
28 | +### Changed | ||
29 | +Speed up loading | ||
30 | +Chart responsive | ||
31 | + | ||
27 | ## [0.3.pre-11] - 2021-05-17 - SVG to CSV | 32 | ## [0.3.pre-11] - 2021-05-17 - SVG to CSV |
28 | ### New | 33 | ### New |
29 | Export chart to csv | 34 | Export chart to csv |
VERSION.txt
app/main/static/css/charges.css
@@ -67,7 +67,7 @@ rect.bar { | @@ -67,7 +67,7 @@ rect.bar { | ||
67 | stroke-width: 0.5pt; | 67 | stroke-width: 0.5pt; |
68 | } | 68 | } |
69 | 69 | ||
70 | -rect.bar:hover { | 70 | +.brillance, rect.bar:hover { |
71 | -webkit-filter: brightness(0.5); | 71 | -webkit-filter: brightness(0.5); |
72 | -moz-filter: brightness(0.5); | 72 | -moz-filter: brightness(0.5); |
73 | filter: brightness(0.8); | 73 | filter: brightness(0.8); |
app/main/static/js/charges.js
@@ -101,11 +101,14 @@ function build_chart(div_selector, data_url, entity_name, category_type) { | @@ -101,11 +101,14 @@ function build_chart(div_selector, data_url, entity_name, category_type) { | ||
101 | .attr('class', 'fas fa-bars fa-lg export') | 101 | .attr('class', 'fas fa-bars fa-lg export') |
102 | .on("click", update_export_menu); | 102 | .on("click", update_export_menu); |
103 | 103 | ||
104 | + const real_width = width + margin.left + margin.right; | ||
105 | + const real_height = height + margin.top + margin.bottom; | ||
104 | 106 | ||
105 | const svg = d3.select(div_selector).append("svg") | 107 | const svg = d3.select(div_selector).append("svg") |
108 | + .attr("viewBox", [0, 0, real_width, real_height]) | ||
106 | .attr("class", "svg_chart") | 109 | .attr("class", "svg_chart") |
107 | - .attr("width", width + margin.left + margin.right) | ||
108 | - .attr("height", height + margin.top + margin.bottom) | 110 | + .attr("width", real_width) |
111 | + .attr("height", real_height) | ||
109 | .append("g") | 112 | .append("g") |
110 | .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); | 113 | .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); |
111 | 114 | ||
@@ -170,6 +173,39 @@ function build_chart(div_selector, data_url, entity_name, category_type) { | @@ -170,6 +173,39 @@ function build_chart(div_selector, data_url, entity_name, category_type) { | ||
170 | .style("top", (e.pageY - tooltip_offset_dot.dy) + "px") | 173 | .style("top", (e.pageY - tooltip_offset_dot.dy) + "px") |
171 | } | 174 | } |
172 | 175 | ||
176 | + function mouseoverlegend() { | ||
177 | + var legend_category = $(this).attr("class"); | ||
178 | + var bar_category = document.getElementsByClassName(legend_category); | ||
179 | + if (bar_category[0].tagName === "g") { | ||
180 | + var rect_to_hover = bar_category[0].children; | ||
181 | + (bar_category[1].children[0]).classList.add("brillance"); | ||
182 | + for (var i=0;i<rect_to_hover.length;i++) { | ||
183 | + rect_to_hover[i].classList.add("brillance"); | ||
184 | + } | ||
185 | + } else { | ||
186 | + for (var i=0;i<bar_category.length;i++) { | ||
187 | + bar_category[i].classList.add("brillance"); | ||
188 | + } | ||
189 | + } | ||
190 | + } | ||
191 | + | ||
192 | + function mouseleavelegend() { | ||
193 | + var legend_category = $(this).attr("class"); | ||
194 | + var bar_category = document.getElementsByClassName(legend_category); | ||
195 | + if (bar_category[0].tagName === "g") { | ||
196 | + var rect_to_hover = bar_category[0].children; | ||
197 | + (bar_category[1].children[0]).classList.remove("brillance"); | ||
198 | + for (var i=0;i<rect_to_hover.length;i++) { | ||
199 | + rect_to_hover[i].classList.remove("brillance"); | ||
200 | + } | ||
201 | + } else { | ||
202 | + var lenght_i = bar_category.length - 1; | ||
203 | + for (var i=lenght_i;i>=0;i--) { | ||
204 | + bar_category[i].classList.remove("brillance"); | ||
205 | + } | ||
206 | + } | ||
207 | + } | ||
208 | + | ||
173 | var addlegend = function (color_scale) { | 209 | var addlegend = function (color_scale) { |
174 | 210 | ||
175 | // add horizontal legend | 211 | // add horizontal legend |
@@ -184,7 +220,9 @@ function build_chart(div_selector, data_url, entity_name, category_type) { | @@ -184,7 +220,9 @@ function build_chart(div_selector, data_url, entity_name, category_type) { | ||
184 | .data(legend_keys) | 220 | .data(legend_keys) |
185 | .enter() | 221 | .enter() |
186 | .append('g') | 222 | .append('g') |
187 | - .attr('class', 'legend'); | 223 | + .attr('class', function (d) { return d}) |
224 | + .on("mouseover", mouseoverlegend) | ||
225 | + .on("mouseleave", mouseleavelegend); | ||
188 | 226 | ||
189 | legend.append('rect') | 227 | legend.append('rect') |
190 | .attr('width', legendRectSize) | 228 | .attr('width', legendRectSize) |
@@ -280,7 +318,7 @@ function build_chart(div_selector, data_url, entity_name, category_type) { | @@ -280,7 +318,7 @@ function build_chart(div_selector, data_url, entity_name, category_type) { | ||
280 | .attr("y", d => yScale(d.value)) | 318 | .attr("y", d => yScale(d.value)) |
281 | .attr("height", d => height - yScale(d.value)) | 319 | .attr("height", d => height - yScale(d.value)) |
282 | .attr("fill", d => colorScale(d.key)) | 320 | .attr("fill", d => colorScale(d.key)) |
283 | - .attr("class", "bar"); | 321 | + .attr("class", d => d.key); |
284 | 322 | ||
285 | svg.selectAll("rect") | 323 | svg.selectAll("rect") |
286 | .on("mouseover", mouseovergrouped) | 324 | .on("mouseover", mouseovergrouped) |
@@ -321,6 +359,7 @@ function build_chart(div_selector, data_url, entity_name, category_type) { | @@ -321,6 +359,7 @@ function build_chart(div_selector, data_url, entity_name, category_type) { | ||
321 | .data(stacked_data) | 359 | .data(stacked_data) |
322 | .enter() | 360 | .enter() |
323 | .append("g") | 361 | .append("g") |
362 | + .attr("class", d => d.key) | ||
324 | .style("fill", (d) => colorScale(d.key)); | 363 | .style("fill", (d) => colorScale(d.key)); |
325 | 364 | ||
326 | // then draw each period/category bar | 365 | // then draw each period/category bar |
app/main/templates/agent.html
1 | {% extends "base_page.html" %} | 1 | {% extends "base_page.html" %} |
2 | 2 | ||
3 | {% block more_heads %} | 3 | {% block more_heads %} |
4 | - <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css"/> | ||
5 | - <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.7.0/css/buttons.dataTables.min.css"/> | 4 | + <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/datatables-1.10.24/css/buttons.dataTables.min.css') }}"/> |
6 | <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/datatables-1.10.24/css/datatables.min.css') }}"/> | 5 | <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/datatables-1.10.24/css/datatables.min.css') }}"/> |
7 | <link href="{{ url_for('main.static', filename='css/charges.css', version=config.VERSION) }}" rel="stylesheet" | 6 | <link href="{{ url_for('main.static', filename='css/charges.css', version=config.VERSION) }}" rel="stylesheet" |
8 | type="text/css"/> | 7 | type="text/css"/> |
app/main/templates/agents.html
@@ -2,8 +2,7 @@ | @@ -2,8 +2,7 @@ | ||
2 | 2 | ||
3 | 3 | ||
4 | {% block more_heads %} | 4 | {% block more_heads %} |
5 | - <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css"/> | ||
6 | - <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.7.0/css/buttons.dataTables.min.css"/> | 5 | + <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/datatables-1.10.24/css/buttons.dataTables.min.css') }}"/> |
7 | <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/datatables-1.10.24/css/datatables.min.css') }}"/> | 6 | <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/datatables-1.10.24/css/datatables.min.css') }}"/> |
8 | {% endblock %} | 7 | {% endblock %} |
9 | 8 |
app/main/templates/project.html
1 | {% extends "base_page.html" %} | 1 | {% extends "base_page.html" %} |
2 | 2 | ||
3 | {% block more_heads %} | 3 | {% block more_heads %} |
4 | - <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css"/> | ||
5 | - <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.7.0/css/buttons.dataTables.min.css"/> | 4 | + <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/datatables-1.10.24/css/buttons.dataTables.min.css') }}"/> |
6 | <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/datatables-1.10.24/css/datatables.min.css') }}"/> | 5 | <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/datatables-1.10.24/css/datatables.min.css') }}"/> |
7 | <link href="{{ url_for('main.static', filename='css/charges.css', version=config.VERSION) }}" rel="stylesheet" type="text/css"/> | 6 | <link href="{{ url_for('main.static', filename='css/charges.css', version=config.VERSION) }}" rel="stylesheet" type="text/css"/> |
8 | {% endblock %} | 7 | {% endblock %} |
app/main/templates/projects.html
1 | {% extends "base_page.html" %} | 1 | {% extends "base_page.html" %} |
2 | 2 | ||
3 | {% block more_heads %} | 3 | {% block more_heads %} |
4 | - <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css"/> | ||
5 | - <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.7.0/css/buttons.dataTables.min.css"/> | 4 | + <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/datatables-1.10.24/css/buttons.dataTables.min.css') }}"/> |
6 | <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/datatables-1.10.24/css/datatables.min.css') }}"/> | 5 | <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='lib/datatables-1.10.24/css/datatables.min.css') }}"/> |
7 | {% endblock %} | 6 | {% endblock %} |
8 | 7 |
app/static/lib/datatables-1.10.24/css/buttons.dataTables.min.css
0 โ 100644
@@ -0,0 +1 @@ | @@ -0,0 +1 @@ | ||
1 | +@keyframes dtb-spinner{100%{transform:rotate(360deg)}}@-o-keyframes dtb-spinner{100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes dtb-spinner{100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dtb-spinner{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes dtb-spinner{100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}div.dt-button-info{position:fixed;top:50%;left:50%;width:400px;margin-top:-100px;margin-left:-200px;background-color:white;border:2px solid #111;box-shadow:3px 3px 8px rgba(0, 0, 0, 0.3);border-radius:3px;text-align:center;z-index:21}div.dt-button-info h2{padding:.5em;margin:0;font-weight:normal;border-bottom:1px solid #ddd;background-color:#f3f3f3}div.dt-button-info>div{padding:1em}div.dt-button-collection-title{text-align:center;padding:.3em 0 .5em;font-size:.9em}div.dt-button-collection-title:empty{display:none}button.dt-button,div.dt-button,a.dt-button,input.dt-button{position:relative;display:inline-block;box-sizing:border-box;margin-right:.333em;margin-bottom:.333em;padding:.5em 1em;border:1px solid rgba(0, 0, 0, 0.3);border-radius:2px;cursor:pointer;font-size:.88em;line-height:1.6em;color:black;white-space:nowrap;overflow:hidden;background-color:rgba(0, 0, 0, 0.1);background:-webkit-linear-gradient(top, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-moz-linear-gradient(top, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-ms-linear-gradient(top, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-o-linear-gradient(top, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:linear-gradient(to bottom, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="rgba(230, 230, 230, 0.1)", EndColorStr="rgba(0, 0, 0, 0.1)");-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;outline:none;text-overflow:ellipsis}button.dt-button.disabled,div.dt-button.disabled,a.dt-button.disabled,input.dt-button.disabled{cursor:default;opacity:.4}button.dt-button:active:not(.disabled),button.dt-button.active:not(.disabled),div.dt-button:active:not(.disabled),div.dt-button.active:not(.disabled),a.dt-button:active:not(.disabled),a.dt-button.active:not(.disabled),input.dt-button:active:not(.disabled),input.dt-button.active:not(.disabled){background-color:rgba(0, 0, 0, 0.1);background:-webkit-linear-gradient(top, rgba(179, 179, 179, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-moz-linear-gradient(top, rgba(179, 179, 179, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-ms-linear-gradient(top, rgba(179, 179, 179, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-o-linear-gradient(top, rgba(179, 179, 179, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:linear-gradient(to bottom, rgba(179, 179, 179, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="rgba(179, 179, 179, 0.1)", EndColorStr="rgba(0, 0, 0, 0.1)");box-shadow:inset 1px 1px 3px #999}button.dt-button:active:not(.disabled):hover:not(.disabled),button.dt-button.active:not(.disabled):hover:not(.disabled),div.dt-button:active:not(.disabled):hover:not(.disabled),div.dt-button.active:not(.disabled):hover:not(.disabled),a.dt-button:active:not(.disabled):hover:not(.disabled),a.dt-button.active:not(.disabled):hover:not(.disabled),input.dt-button:active:not(.disabled):hover:not(.disabled),input.dt-button.active:not(.disabled):hover:not(.disabled){box-shadow:inset 1px 1px 3px #999;background-color:rgba(0, 0, 0, 0.1);background:-webkit-linear-gradient(top, rgba(128, 128, 128, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-moz-linear-gradient(top, rgba(128, 128, 128, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-ms-linear-gradient(top, rgba(128, 128, 128, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-o-linear-gradient(top, rgba(128, 128, 128, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:linear-gradient(to bottom, rgba(128, 128, 128, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="rgba(128, 128, 128, 0.1)", EndColorStr="rgba(0, 0, 0, 0.1)")}button.dt-button:hover,div.dt-button:hover,a.dt-button:hover,input.dt-button:hover{text-decoration:none}button.dt-button:hover:not(.disabled),div.dt-button:hover:not(.disabled),a.dt-button:hover:not(.disabled),input.dt-button:hover:not(.disabled){border:1px solid #666;background-color:rgba(0, 0, 0, 0.1);background:-webkit-linear-gradient(top, rgba(153, 153, 153, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-moz-linear-gradient(top, rgba(153, 153, 153, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-ms-linear-gradient(top, rgba(153, 153, 153, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-o-linear-gradient(top, rgba(153, 153, 153, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:linear-gradient(to bottom, rgba(153, 153, 153, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="rgba(153, 153, 153, 0.1)", EndColorStr="rgba(0, 0, 0, 0.1)")}button.dt-button:focus:not(.disabled),div.dt-button:focus:not(.disabled),a.dt-button:focus:not(.disabled),input.dt-button:focus:not(.disabled){border:1px solid #426c9e;text-shadow:0 1px 0 #c4def1;outline:none;background-color:#79ace9;background:-webkit-linear-gradient(top, #d1e2f7 0%, #79ace9 100%);background:-moz-linear-gradient(top, #d1e2f7 0%, #79ace9 100%);background:-ms-linear-gradient(top, #d1e2f7 0%, #79ace9 100%);background:-o-linear-gradient(top, #d1e2f7 0%, #79ace9 100%);background:linear-gradient(to bottom, #d1e2f7 0%, #79ace9 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="#d1e2f7", EndColorStr="#79ace9")}.dt-button embed{outline:none}div.dt-buttons{position:relative;float:left}div.dt-buttons.buttons-right{float:right}div.dataTables_layout_cell div.dt-buttons{float:none}div.dataTables_layout_cell div.dt-buttons.buttons-right{float:none}div.dt-button-collection{position:absolute;top:0;left:0;width:150px;margin-top:3px;padding:8px 8px 4px 8px;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.4);background-color:white;overflow:hidden;z-index:2002;border-radius:5px;box-shadow:3px 3px 5px rgba(0, 0, 0, 0.3);box-sizing:border-box}div.dt-button-collection button.dt-button,div.dt-button-collection div.dt-button,div.dt-button-collection a.dt-button{position:relative;left:0;right:0;width:100%;display:block;float:none;margin-bottom:4px;margin-right:0}div.dt-button-collection button.dt-button:active:not(.disabled),div.dt-button-collection button.dt-button.active:not(.disabled),div.dt-button-collection div.dt-button:active:not(.disabled),div.dt-button-collection div.dt-button.active:not(.disabled),div.dt-button-collection a.dt-button:active:not(.disabled),div.dt-button-collection a.dt-button.active:not(.disabled){background-color:#dadada;background:-webkit-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background:-moz-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background:-ms-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background:-o-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background:linear-gradient(to bottom, #f0f0f0 0%, #dadada 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="#f0f0f0", EndColorStr="#dadada");box-shadow:inset 1px 1px 3px #666}div.dt-button-collection.fixed{position:fixed;top:50%;left:50%;margin-left:-75px;border-radius:0}div.dt-button-collection.fixed.two-column{margin-left:-200px}div.dt-button-collection.fixed.three-column{margin-left:-225px}div.dt-button-collection.fixed.four-column{margin-left:-300px}div.dt-button-collection>:last-child{display:block !important;-webkit-column-gap:8px;-moz-column-gap:8px;-ms-column-gap:8px;-o-column-gap:8px;column-gap:8px}div.dt-button-collection>:last-child>*{-webkit-column-break-inside:avoid;break-inside:avoid}div.dt-button-collection.two-column{width:400px}div.dt-button-collection.two-column>:last-child{padding-bottom:1px;-webkit-column-count:2;-moz-column-count:2;-ms-column-count:2;-o-column-count:2;column-count:2}div.dt-button-collection.three-column{width:450px}div.dt-button-collection.three-column>:last-child{padding-bottom:1px;-webkit-column-count:3;-moz-column-count:3;-ms-column-count:3;-o-column-count:3;column-count:3}div.dt-button-collection.four-column{width:600px}div.dt-button-collection.four-column>:last-child{padding-bottom:1px;-webkit-column-count:4;-moz-column-count:4;-ms-column-count:4;-o-column-count:4;column-count:4}div.dt-button-collection .dt-button{border-radius:0}div.dt-button-background{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);background:-ms-radial-gradient(center, ellipse farthest-corner, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);background:-moz-radial-gradient(center, ellipse farthest-corner, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);background:-o-radial-gradient(center, ellipse farthest-corner, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);background:-webkit-gradient(radial, center center, 0, center center, 497, color-stop(0, rgba(0, 0, 0, 0.3)), color-stop(1, rgba(0, 0, 0, 0.7)));background:-webkit-radial-gradient(center, ellipse farthest-corner, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);background:radial-gradient(ellipse farthest-corner at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);z-index:2001}@media screen and (max-width: 640px){div.dt-buttons{float:none !important;text-align:center}}button.dt-button.processing,div.dt-button.processing,a.dt-button.processing{color:rgba(0, 0, 0, 0.2)}button.dt-button.processing:after,div.dt-button.processing:after,a.dt-button.processing:after{position:absolute;top:50%;left:50%;width:16px;height:16px;margin:-8px 0 0 -8px;box-sizing:border-box;display:block;content:" ";border:2px solid #282828;border-radius:50%;border-left-color:transparent;border-right-color:transparent;animation:dtb-spinner 1500ms infinite linear;-o-animation:dtb-spinner 1500ms infinite linear;-ms-animation:dtb-spinner 1500ms infinite linear;-webkit-animation:dtb-spinner 1500ms infinite linear;-moz-animation:dtb-spinner 1500ms infinite linear} |
app/static/lib/datatables-1.10.24/js/buttons.html5.min.js
0 โ 100644
@@ -0,0 +1,36 @@ | @@ -0,0 +1,36 @@ | ||
1 | +/*! | ||
2 | + HTML5 export buttons for Buttons and DataTables. | ||
3 | + 2016 SpryMedia Ltd - datatables.net/license | ||
4 | + | ||
5 | + FileSaver.js (1.3.3) - MIT license | ||
6 | + Copyright ยฉ 2016 Eli Grey - http://eligrey.com | ||
7 | +*/ | ||
8 | +(function(n){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(u){return n(u,window,document)}):"object"===typeof exports?module.exports=function(u,x,E,F){u||(u=window);x&&x.fn.dataTable||(x=require("datatables.net")(u,x).$);x.fn.dataTable.Buttons||require("datatables.net-buttons")(u,x);return n(x,u,u.document,E,F)}:n(jQuery,window,document)})(function(n,u,x,E,F,B){function I(a){for(var c="";0<=a;)c=String.fromCharCode(a%26+65)+c,a=Math.floor(a/ | ||
9 | +26)-1;return c}function O(a,c){J===B&&(J=-1===M.serializeToString((new u.DOMParser).parseFromString(P["xl/worksheets/sheet1.xml"],"text/xml")).indexOf("xmlns:r"));n.each(c,function(d,b){if(n.isPlainObject(b))d=a.folder(d),O(d,b);else{if(J){var m=b.childNodes[0],e,f=[];for(e=m.attributes.length-1;0<=e;e--){var g=m.attributes[e].nodeName;var p=m.attributes[e].nodeValue;-1!==g.indexOf(":")&&(f.push({name:g,value:p}),m.removeAttribute(g))}e=0;for(g=f.length;e<g;e++)p=b.createAttribute(f[e].name.replace(":", | ||
10 | +"_dt_b_namespace_token_")),p.value=f[e].value,m.setAttributeNode(p)}b=M.serializeToString(b);J&&(-1===b.indexOf("<?xml")&&(b='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+b),b=b.replace(/_dt_b_namespace_token_/g,":"),b=b.replace(/xmlns:NS[\d]+="" NS[\d]+:/g,""));b=b.replace(/<([^<>]*?) xmlns=""([^<>]*?)>/g,"<$1 $2>");a.file(d,b)}})}function y(a,c,d){var b=a.createElement(c);d&&(d.attr&&n(b).attr(d.attr),d.children&&n.each(d.children,function(m,e){b.appendChild(e)}),null!==d.text&&d.text!== | ||
11 | +B&&b.appendChild(a.createTextNode(d.text)));return b}function V(a,c){var d=a.header[c].length;a.footer&&a.footer[c].length>d&&(d=a.footer[c].length);for(var b=0,m=a.body.length;b<m;b++){var e=a.body[b][c];e=null!==e&&e!==B?e.toString():"";-1!==e.indexOf("\n")?(e=e.split("\n"),e.sort(function(f,g){return g.length-f.length}),e=e[0].length):e=e.length;e>d&&(d=e);if(40<d)return 54}d*=1.35;return 6<d?d:6}var D=n.fn.dataTable;D.Buttons.pdfMake=function(a){if(!a)return F||u.pdfMake;F=a};D.Buttons.jszip= | ||
12 | +function(a){if(!a)return E||u.JSZip;E=a};var K=function(a){if(!("undefined"===typeof a||"undefined"!==typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var c=a.document.createElementNS("http://www.w3.org/1999/xhtml","a"),d="download"in c,b=/constructor/i.test(a.HTMLElement)||a.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent),e=function(h){(a.setImmediate||a.setTimeout)(function(){throw h;},0)},f=function(h){setTimeout(function(){"string"===typeof h?(a.URL||a.webkitURL||a).revokeObjectURL(h): | ||
13 | +h.remove()},4E4)},g=function(h){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(h.type)?new Blob([String.fromCharCode(65279),h],{type:h.type}):h},p=function(h,q,v){v||(h=g(h));var r=this,w="application/octet-stream"===h.type,C=function(){var l=["writestart","progress","write","writeend"];l=[].concat(l);for(var z=l.length;z--;){var G=r["on"+l[z]];if("function"===typeof G)try{G.call(r,r)}catch(A){e(A)}}};r.readyState=r.INIT;if(d){var k=(a.URL||a.webkitURL||a).createObjectURL(h); | ||
14 | +setTimeout(function(){c.href=k;c.download=q;var l=new MouseEvent("click");c.dispatchEvent(l);C();f(k);r.readyState=r.DONE})}else(function(){if((m||w&&b)&&a.FileReader){var l=new FileReader;l.onloadend=function(){var z=m?l.result:l.result.replace(/^data:[^;]*;/,"data:attachment/file;");a.open(z,"_blank")||(a.location.href=z);r.readyState=r.DONE;C()};l.readAsDataURL(h);r.readyState=r.INIT}else k||(k=(a.URL||a.webkitURL||a).createObjectURL(h)),w?a.location.href=k:a.open(k,"_blank")||(a.location.href= | ||
15 | +k),r.readyState=r.DONE,C(),f(k)})()},t=p.prototype;if("undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob)return function(h,q,v){q=q||h.name||"download";v||(h=g(h));return navigator.msSaveOrOpenBlob(h,q)};t.abort=function(){};t.readyState=t.INIT=0;t.WRITING=1;t.DONE=2;t.error=t.onwritestart=t.onprogress=t.onwrite=t.onabort=t.onerror=t.onwriteend=null;return function(h,q,v){return new p(h,q||h.name||"download",v)}}}("undefined"!==typeof self&&self||"undefined"!==typeof u&&u||this.content);D.fileSave= | ||
16 | +K;var Q=function(a){var c="Sheet1";a.sheetName&&(c=a.sheetName.replace(/[\[\]\*\/\\\?:]/g,""));return c},R=function(a){return a.newline?a.newline:navigator.userAgent.match(/Windows/)?"\r\n":"\n"},S=function(a,c){var d=R(c);a=a.buttons.exportData(c.exportOptions);var b=c.fieldBoundary,m=c.fieldSeparator,e=new RegExp(b,"g"),f=c.escapeChar!==B?c.escapeChar:"\\",g=function(v){for(var r="",w=0,C=v.length;w<C;w++)0<w&&(r+=m),r+=b?b+(""+v[w]).replace(e,f+b)+b:v[w];return r},p=c.header?g(a.header)+d:"";c= | ||
17 | +c.footer&&a.footer?d+g(a.footer):"";for(var t=[],h=0,q=a.body.length;h<q;h++)t.push(g(a.body[h]));return{str:p+t.join(d)+c,rows:t.length}},T=function(){if(-1===navigator.userAgent.indexOf("Safari")||-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Opera"))return!1;var a=navigator.userAgent.match(/AppleWebKit\/(\d+\.\d+)/);return a&&1<a.length&&603.1>1*a[1]?!0:!1};try{var M=new XMLSerializer,J}catch(a){}var P={"_rels/.rels":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>', | ||
18 | +"xl/_rels/workbook.xml.rels":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>',"[Content_Types].xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml" /><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="jpeg" ContentType="image/jpeg" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /></Types>', | ||
19 | +"xl/workbook.xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="24816"/><workbookPr showInkAnnotation="0" autoCompressPictures="0"/><bookViews><workbookView xWindow="0" yWindow="0" windowWidth="25600" windowHeight="19020" tabRatio="500"/></bookViews><sheets><sheet name="Sheet1" sheetId="1" r:id="rId1"/></sheets><definedNames/></workbook>', | ||
20 | +"xl/worksheets/sheet1.xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><sheetData/><mergeCells count="0"/></worksheet>',"xl/styles.xml":'<?xml version="1.0" encoding="UTF-8"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><numFmts count="6"><numFmt numFmtId="164" formatCode="#,##0.00_- [$$-45C]"/><numFmt numFmtId="165" formatCode=""ยฃ"#,##0.00"/><numFmt numFmtId="166" formatCode="[$โฌ-2] #,##0.00"/><numFmt numFmtId="167" formatCode="0.0%"/><numFmt numFmtId="168" formatCode="#,##0;(#,##0)"/><numFmt numFmtId="169" formatCode="#,##0.00;(#,##0.00)"/></numFmts><fonts count="5" x14ac:knownFonts="1"><font><sz val="11" /><name val="Calibri" /></font><font><sz val="11" /><name val="Calibri" /><color rgb="FFFFFFFF" /></font><font><sz val="11" /><name val="Calibri" /><b /></font><font><sz val="11" /><name val="Calibri" /><i /></font><font><sz val="11" /><name val="Calibri" /><u /></font></fonts><fills count="6"><fill><patternFill patternType="none" /></fill><fill><patternFill patternType="none" /></fill><fill><patternFill patternType="solid"><fgColor rgb="FFD9D9D9" /><bgColor indexed="64" /></patternFill></fill><fill><patternFill patternType="solid"><fgColor rgb="FFD99795" /><bgColor indexed="64" /></patternFill></fill><fill><patternFill patternType="solid"><fgColor rgb="ffc6efce" /><bgColor indexed="64" /></patternFill></fill><fill><patternFill patternType="solid"><fgColor rgb="ffc6cfef" /><bgColor indexed="64" /></patternFill></fill></fills><borders count="2"><border><left /><right /><top /><bottom /><diagonal /></border><border diagonalUp="false" diagonalDown="false"><left style="thin"><color auto="1" /></left><right style="thin"><color auto="1" /></right><top style="thin"><color auto="1" /></top><bottom style="thin"><color auto="1" /></bottom><diagonal /></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" /></cellStyleXfs><cellXfs count="68"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="left"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="center"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="right"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="fill"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment textRotation="90"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment wrapText="1"/></xf><xf numFmtId="9" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="164" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="165" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="166" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="167" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="168" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="169" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="3" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="4" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="1" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="2" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="14" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0" /></cellStyles><dxfs count="0" /><tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4" /></styleSheet>'}, | ||
21 | +U=[{match:/^\-?\d+\.\d%$/,style:60,fmt:function(a){return a/100}},{match:/^\-?\d+\.?\d*%$/,style:56,fmt:function(a){return a/100}},{match:/^\-?\$[\d,]+.?\d*$/,style:57},{match:/^\-?ยฃ[\d,]+.?\d*$/,style:58},{match:/^\-?โฌ[\d,]+.?\d*$/,style:59},{match:/^\-?\d+$/,style:65},{match:/^\-?\d+\.\d{2}$/,style:66},{match:/^\([\d,]+\)$/,style:61,fmt:function(a){return-1*a.replace(/[\(\)]/g,"")}},{match:/^\([\d,]+\.\d{2}\)$/,style:62,fmt:function(a){return-1*a.replace(/[\(\)]/g,"")}},{match:/^\-?[\d,]+$/,style:63}, | ||
22 | +{match:/^\-?[\d,]+\.\d{2}$/,style:64},{match:/^[\d]{4}\-[\d]{2}\-[\d]{2}$/,style:67,fmt:function(a){return Math.round(25569+Date.parse(a)/864E5)}}];D.ext.buttons.copyHtml5={className:"buttons-copy buttons-html5",text:function(a){return a.i18n("buttons.copy","Copy")},action:function(a,c,d,b){this.processing(!0);var m=this;a=S(c,b);var e=c.buttons.exportInfo(b),f=R(b),g=a.str;d=n("<div/>").css({height:1,width:1,overflow:"hidden",position:"fixed",top:0,left:0});e.title&&(g=e.title+f+f+g);e.messageTop&& | ||
23 | +(g=e.messageTop+f+f+g);e.messageBottom&&(g=g+f+f+e.messageBottom);b.customize&&(g=b.customize(g,b,c));b=n("<textarea readonly/>").val(g).appendTo(d);if(x.queryCommandSupported("copy")){d.appendTo(c.table().container());b[0].focus();b[0].select();try{var p=x.execCommand("copy");d.remove();if(p){c.buttons.info(c.i18n("buttons.copyTitle","Copy to clipboard"),c.i18n("buttons.copySuccess",{1:"Copied one row to clipboard",_:"Copied %d rows to clipboard"},a.rows),2E3);this.processing(!1);return}}catch(q){}}p= | ||
24 | +n("<span>"+c.i18n("buttons.copyKeys","Press <i>ctrl</i> or <i>โ</i> + <i>C</i> to copy the table data<br>to your system clipboard.<br><br>To cancel, click this message or press escape.")+"</span>").append(d);c.buttons.info(c.i18n("buttons.copyTitle","Copy to clipboard"),p,0);b[0].focus();b[0].select();var t=n(p).closest(".dt-button-info"),h=function(){t.off("click.buttons-copy");n(x).off(".buttons-copy");c.buttons.info(!1)};t.on("click.buttons-copy",h);n(x).on("keydown.buttons-copy",function(q){27=== | ||
25 | +q.keyCode&&(h(),m.processing(!1))}).on("copy.buttons-copy cut.buttons-copy",function(){h();m.processing(!1)})},exportOptions:{},fieldSeparator:"\t",fieldBoundary:"",header:!0,footer:!1,title:"*",messageTop:"*",messageBottom:"*"};D.ext.buttons.csvHtml5={bom:!1,className:"buttons-csv buttons-html5",available:function(){return u.FileReader!==B&&u.Blob},text:function(a){return a.i18n("buttons.csv","CSV")},action:function(a,c,d,b){this.processing(!0);a=S(c,b).str;d=c.buttons.exportInfo(b);var m=b.charset; | ||
26 | +b.customize&&(a=b.customize(a,b,c));!1!==m?(m||(m=x.characterSet||x.charset),m&&(m=";charset="+m)):m="";b.bom&&(a="๏ปฟ"+a);K(new Blob([a],{type:"text/csv"+m}),d.filename,!0);this.processing(!1)},filename:"*",extension:".csv",exportOptions:{},fieldSeparator:",",fieldBoundary:'"',escapeChar:'"',charset:null,header:!0,footer:!1};D.ext.buttons.excelHtml5={className:"buttons-excel buttons-html5",available:function(){return u.FileReader!==B&&(E||u.JSZip)!==B&&!T()&&M},text:function(a){return a.i18n("buttons.excel", | ||
27 | +"Excel")},action:function(a,c,d,b){this.processing(!0);var m=this,e=0;a=function(k){return n.parseXML(P[k])};var f=a("xl/worksheets/sheet1.xml"),g=f.getElementsByTagName("sheetData")[0];a={_rels:{".rels":a("_rels/.rels")},xl:{_rels:{"workbook.xml.rels":a("xl/_rels/workbook.xml.rels")},"workbook.xml":a("xl/workbook.xml"),"styles.xml":a("xl/styles.xml"),worksheets:{"sheet1.xml":f}},"[Content_Types].xml":a("[Content_Types].xml")};var p=c.buttons.exportData(b.exportOptions),t,h,q=function(k){t=e+1;h= | ||
28 | +y(f,"row",{attr:{r:t}});for(var l=0,z=k.length;l<z;l++){var G=I(l)+""+t,A=null;if(null===k[l]||k[l]===B||""===k[l])if(!0===b.createEmptyCells)k[l]="";else continue;var H=k[l];k[l]="function"===typeof k[l].trim?k[l].trim():k[l];for(var N=0,W=U.length;N<W;N++){var L=U[N];if(k[l].match&&!k[l].match(/^0\d+/)&&k[l].match(L.match)){A=k[l].replace(/[^\d\.\-]/g,"");L.fmt&&(A=L.fmt(A));A=y(f,"c",{attr:{r:G,s:L.style},children:[y(f,"v",{text:A})]});break}}A||("number"===typeof k[l]||k[l].match&&k[l].match(/^-?\d+(\.\d+)?$/)&& | ||
29 | +!k[l].match(/^0\d+/)?A=y(f,"c",{attr:{t:"n",r:G},children:[y(f,"v",{text:k[l]})]}):(H=H.replace?H.replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]/g,""):H,A=y(f,"c",{attr:{t:"inlineStr",r:G},children:{row:y(f,"is",{children:{row:y(f,"t",{text:H,attr:{"xml:space":"preserve"}})}})}})));h.appendChild(A)}g.appendChild(h);e++};b.customizeData&&b.customizeData(p);var v=function(k,l){var z=n("mergeCells",f);z[0].appendChild(y(f,"mergeCell",{attr:{ref:"A"+k+":"+I(l)+k}}));z.attr("count",parseFloat(z.attr("count"))+ | ||
30 | +1);n("row:eq("+(k-1)+") c",f).attr("s","51")},r=c.buttons.exportInfo(b);r.title&&(q([r.title],e),v(e,p.header.length-1));r.messageTop&&(q([r.messageTop],e),v(e,p.header.length-1));b.header&&(q(p.header,e),n("row:last c",f).attr("s","2"));d=e;var w=0;for(var C=p.body.length;w<C;w++)q(p.body[w],e);w=e;b.footer&&p.footer&&(q(p.footer,e),n("row:last c",f).attr("s","2"));r.messageBottom&&(q([r.messageBottom],e),v(e,p.header.length-1));q=y(f,"cols");n("worksheet",f).prepend(q);v=0;for(C=p.header.length;v< | ||
31 | +C;v++)q.appendChild(y(f,"col",{attr:{min:v+1,max:v+1,width:V(p,v),customWidth:1}}));q=a.xl["workbook.xml"];n("sheets sheet",q).attr("name",Q(b));b.autoFilter&&(n("mergeCells",f).before(y(f,"autoFilter",{attr:{ref:"A"+d+":"+I(p.header.length-1)+w}})),n("definedNames",q).append(y(q,"definedName",{attr:{name:"_xlnm._FilterDatabase",localSheetId:"0",hidden:1},text:Q(b)+"!$A$"+d+":"+I(p.header.length-1)+w})));b.customize&&b.customize(a,b,c);0===n("mergeCells",f).children().length&&n("mergeCells",f).remove(); | ||
32 | +c=new (E||u.JSZip);d={type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};O(c,a);c.generateAsync?c.generateAsync(d).then(function(k){K(k,r.filename);m.processing(!1)}):(K(c.generate(d),r.filename),this.processing(!1))},filename:"*",extension:".xlsx",exportOptions:{},header:!0,footer:!1,title:"*",messageTop:"*",messageBottom:"*",createEmptyCells:!1,autoFilter:!1,sheetName:""};D.ext.buttons.pdfHtml5={className:"buttons-pdf buttons-html5",available:function(){return u.FileReader!== | ||
33 | +B&&(F||u.pdfMake)},text:function(a){return a.i18n("buttons.pdf","PDF")},action:function(a,c,d,b){this.processing(!0);d=c.buttons.exportData(b.exportOptions);a=c.buttons.exportInfo(b);var m=[];b.header&&m.push(n.map(d.header,function(g){return{text:"string"===typeof g?g:g+"",style:"tableHeader"}}));for(var e=0,f=d.body.length;e<f;e++)m.push(n.map(d.body[e],function(g){if(null===g||g===B)g="";return{text:"string"===typeof g?g:g+"",style:e%2?"tableBodyEven":"tableBodyOdd"}}));b.footer&&d.footer&&m.push(n.map(d.footer, | ||
34 | +function(g){return{text:"string"===typeof g?g:g+"",style:"tableFooter"}}));d={pageSize:b.pageSize,pageOrientation:b.orientation,content:[{table:{headerRows:1,body:m},layout:"noBorders"}],styles:{tableHeader:{bold:!0,fontSize:11,color:"white",fillColor:"#2d4154",alignment:"center"},tableBodyEven:{},tableBodyOdd:{fillColor:"#f3f3f3"},tableFooter:{bold:!0,fontSize:11,color:"white",fillColor:"#2d4154"},title:{alignment:"center",fontSize:15},message:{}},defaultStyle:{fontSize:10}};a.messageTop&&d.content.unshift({text:a.messageTop, | ||
35 | +style:"message",margin:[0,0,0,12]});a.messageBottom&&d.content.push({text:a.messageBottom,style:"message",margin:[0,0,0,12]});a.title&&d.content.unshift({text:a.title,style:"title",margin:[0,0,0,12]});b.customize&&b.customize(d,b,c);c=(F||u.pdfMake).createPdf(d);"open"!==b.download||T()?c.download(a.filename):c.open();this.processing(!1)},title:"*",filename:"*",extension:".pdf",exportOptions:{},orientation:"portrait",pageSize:"A4",header:!0,footer:!1,messageTop:"*",messageBottom:"*",customize:null, | ||
36 | +download:"download"};return D.Buttons}); |
app/static/lib/datatables-1.10.24/js/dataTables.buttons.min.js
0 โ 100644
@@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
1 | +/*! | ||
2 | + Buttons for DataTables 1.7.0 | ||
3 | + ยฉ2016-2021 SpryMedia Ltd - datatables.net/license | ||
4 | +*/ | ||
5 | +(function(f){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(A){return f(A,window,document)}):"object"===typeof exports?module.exports=function(A,y){A||(A=window);y&&y.fn.dataTable||(y=require("datatables.net")(A,y).$);return f(y,A,A.document)}:f(jQuery,window,document)})(function(f,A,y,t){function E(a,b,c){f.fn.animate?a.stop().fadeIn(b,c):(a.css("display","block"),c&&c.call(a))}function F(a,b,c){f.fn.animate?a.stop().fadeOut(b,c):(a.css("display","none"),c&&c.call(a))} | ||
6 | +function H(a,b){a=new q.Api(a);b=b?b:a.init().buttons||q.defaults.buttons;return(new u(a,b)).container()}var q=f.fn.dataTable,M=0,N=0,z=q.ext.buttons,u=function(a,b){if(!(this instanceof u))return function(c){return(new u(c,a)).container()};"undefined"===typeof b&&(b={});!0===b&&(b={});Array.isArray(b)&&(b={buttons:b});this.c=f.extend(!0,{},u.defaults,b);b.buttons&&(this.c.buttons=b.buttons);this.s={dt:new q.Api(a),buttons:[],listenKeys:"",namespace:"dtb"+M++};this.dom={container:f("<"+this.c.dom.container.tag+ | ||
7 | +"/>").addClass(this.c.dom.container.className)};this._constructor()};f.extend(u.prototype,{action:function(a,b){a=this._nodeToButton(a);if(b===t)return a.conf.action;a.conf.action=b;return this},active:function(a,b){var c=this._nodeToButton(a);a=this.c.dom.button.active;c=f(c.node);if(b===t)return c.hasClass(a);c.toggleClass(a,b===t?!0:b);return this},add:function(a,b){var c=this.s.buttons;if("string"===typeof b){b=b.split("-");var d=this.s;c=0;for(var e=b.length-1;c<e;c++)d=d.buttons[1*b[c]];c=d.buttons; | ||
8 | +b=1*b[b.length-1]}this._expandButton(c,a,d!==t,b);this._draw();return this},container:function(){return this.dom.container},disable:function(a){a=this._nodeToButton(a);f(a.node).addClass(this.c.dom.button.disabled).attr("disabled",!0);return this},destroy:function(){f("body").off("keyup."+this.s.namespace);var a=this.s.buttons.slice(),b;var c=0;for(b=a.length;c<b;c++)this.remove(a[c].node);this.dom.container.remove();a=this.s.dt.settings()[0];c=0;for(b=a.length;c<b;c++)if(a.inst===this){a.splice(c, | ||
9 | +1);break}return this},enable:function(a,b){if(!1===b)return this.disable(a);a=this._nodeToButton(a);f(a.node).removeClass(this.c.dom.button.disabled).removeAttr("disabled");return this},name:function(){return this.c.name},node:function(a){if(!a)return this.dom.container;a=this._nodeToButton(a);return f(a.node)},processing:function(a,b){var c=this.s.dt,d=this._nodeToButton(a);if(b===t)return f(d.node).hasClass("processing");f(d.node).toggleClass("processing",b);f(c.table().node()).triggerHandler("buttons-processing.dt", | ||
10 | +[b,c.button(a),c,f(a),d.conf]);return this},remove:function(a){var b=this._nodeToButton(a),c=this._nodeToHost(a),d=this.s.dt;if(b.buttons.length)for(var e=b.buttons.length-1;0<=e;e--)this.remove(b.buttons[e].node);b.conf.destroy&&b.conf.destroy.call(d.button(a),d,f(a),b.conf);this._removeKey(b.conf);f(b.node).remove();a=f.inArray(b,c);c.splice(a,1);return this},text:function(a,b){var c=this._nodeToButton(a);a=this.c.dom.collection.buttonLiner;a=c.inCollection&&a&&a.tag?a.tag:this.c.dom.buttonLiner.tag; | ||
11 | +var d=this.s.dt,e=f(c.node),h=function(m){return"function"===typeof m?m(d,e,c.conf):m};if(b===t)return h(c.conf.text);c.conf.text=b;a?e.children(a).html(h(b)):e.html(h(b));return this},_constructor:function(){var a=this,b=this.s.dt,c=b.settings()[0],d=this.c.buttons;c._buttons||(c._buttons=[]);c._buttons.push({inst:this,name:this.c.name});for(var e=0,h=d.length;e<h;e++)this.add(d[e]);b.on("destroy",function(m,g){g===c&&a.destroy()});f("body").on("keyup."+this.s.namespace,function(m){if(!y.activeElement|| | ||
12 | +y.activeElement===y.body){var g=String.fromCharCode(m.keyCode).toLowerCase();-1!==a.s.listenKeys.toLowerCase().indexOf(g)&&a._keypress(g,m)}})},_addKey:function(a){a.key&&(this.s.listenKeys+=f.isPlainObject(a.key)?a.key.key:a.key)},_draw:function(a,b){a||(a=this.dom.container,b=this.s.buttons);a.children().detach();for(var c=0,d=b.length;c<d;c++)a.append(b[c].inserter),a.append(" "),b[c].buttons&&b[c].buttons.length&&this._draw(b[c].collection,b[c].buttons)},_expandButton:function(a,b,c,d){var e= | ||
13 | +this.s.dt,h=0;b=Array.isArray(b)?b:[b];for(var m=0,g=b.length;m<g;m++){var l=this._resolveExtends(b[m]);if(l)if(Array.isArray(l))this._expandButton(a,l,c,d);else{var k=this._buildButton(l,c);k&&(d!==t&&null!==d?(a.splice(d,0,k),d++):a.push(k),k.conf.buttons&&(k.collection=f("<"+this.c.dom.collection.tag+"/>"),k.conf._collection=k.collection,this._expandButton(k.buttons,k.conf.buttons,!0,d)),l.init&&l.init.call(e.button(k.node),e,f(k.node),l),h++)}}},_buildButton:function(a,b){var c=this.c.dom.button, | ||
14 | +d=this.c.dom.buttonLiner,e=this.c.dom.collection,h=this.s.dt,m=function(n){return"function"===typeof n?n(h,k,a):n};b&&e.button&&(c=e.button);b&&e.buttonLiner&&(d=e.buttonLiner);if(a.available&&!a.available(h,a))return!1;var g=function(n,p,r,v){v.action.call(p.button(r),n,p,r,v);f(p.table().node()).triggerHandler("buttons-action.dt",[p.button(r),p,r,v])};e=a.tag||c.tag;var l=a.clickBlurs===t?!0:a.clickBlurs,k=f("<"+e+"/>").addClass(c.className).attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls", | ||
15 | +this.s.dt.table().node().id).on("click.dtb",function(n){n.preventDefault();!k.hasClass(c.disabled)&&a.action&&g(n,h,k,a);l&&k.trigger("blur")}).on("keyup.dtb",function(n){13===n.keyCode&&!k.hasClass(c.disabled)&&a.action&&g(n,h,k,a)});"a"===e.toLowerCase()&&k.attr("href","#");"button"===e.toLowerCase()&&k.attr("type","button");d.tag?(e=f("<"+d.tag+"/>").html(m(a.text)).addClass(d.className),"a"===d.tag.toLowerCase()&&e.attr("href","#"),k.append(e)):k.html(m(a.text));!1===a.enabled&&k.addClass(c.disabled); | ||
16 | +a.className&&k.addClass(a.className);a.titleAttr&&k.attr("title",m(a.titleAttr));a.attr&&k.attr(a.attr);a.namespace||(a.namespace=".dt-button-"+N++);d=(d=this.c.dom.buttonContainer)&&d.tag?f("<"+d.tag+"/>").addClass(d.className).append(k):k;this._addKey(a);this.c.buttonCreated&&(d=this.c.buttonCreated(a,d));return{conf:a,node:k.get(0),inserter:d,buttons:[],inCollection:b,collection:null}},_nodeToButton:function(a,b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b[c]; | ||
17 | +if(b[c].buttons.length){var e=this._nodeToButton(a,b[c].buttons);if(e)return e}}},_nodeToHost:function(a,b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b;if(b[c].buttons.length){var e=this._nodeToHost(a,b[c].buttons);if(e)return e}}},_keypress:function(a,b){if(!b._buttonsHandled){var c=function(d){for(var e=0,h=d.length;e<h;e++){var m=d[e].conf,g=d[e].node;m.key&&(m.key===a?(b._buttonsHandled=!0,f(g).click()):!f.isPlainObject(m.key)||m.key.key!==a||m.key.shiftKey&& | ||
18 | +!b.shiftKey||m.key.altKey&&!b.altKey||m.key.ctrlKey&&!b.ctrlKey||m.key.metaKey&&!b.metaKey||(b._buttonsHandled=!0,f(g).click()));d[e].buttons.length&&c(d[e].buttons)}};c(this.s.buttons)}},_removeKey:function(a){if(a.key){var b=f.isPlainObject(a.key)?a.key.key:a.key;a=this.s.listenKeys.split("");b=f.inArray(b,a);a.splice(b,1);this.s.listenKeys=a.join("")}},_resolveExtends:function(a){var b=this.s.dt,c,d=function(g){for(var l=0;!f.isPlainObject(g)&&!Array.isArray(g);){if(g===t)return;if("function"=== | ||
19 | +typeof g){if(g=g(b,a),!g)return!1}else if("string"===typeof g){if(!z[g])throw"Unknown button type: "+g;g=z[g]}l++;if(30<l)throw"Buttons: Too many iterations";}return Array.isArray(g)?g:f.extend({},g)};for(a=d(a);a&&a.extend;){if(!z[a.extend])throw"Cannot extend unknown button type: "+a.extend;var e=d(z[a.extend]);if(Array.isArray(e))return e;if(!e)return!1;var h=e.className;a=f.extend({},e,a);h&&a.className!==h&&(a.className=h+" "+a.className);var m=a.postfixButtons;if(m){a.buttons||(a.buttons=[]); | ||
20 | +h=0;for(c=m.length;h<c;h++)a.buttons.push(m[h]);a.postfixButtons=null}if(m=a.prefixButtons){a.buttons||(a.buttons=[]);h=0;for(c=m.length;h<c;h++)a.buttons.splice(h,0,m[h]);a.prefixButtons=null}a.extend=e.extend}return a},_popover:function(a,b,c){var d=this.c,e=f.extend({align:"button-left",autoClose:!1,background:!0,backgroundClassName:"dt-button-background",contentClassName:d.dom.collection.className,collectionLayout:"",collectionTitle:"",dropup:!1,fade:400,rightAlignClassName:"dt-button-right", | ||
21 | +tag:d.dom.collection.tag},c),h=b.node(),m=function(){F(f(".dt-button-collection"),e.fade,function(){f(this).detach()});f(b.buttons('[aria-haspopup="true"][aria-expanded="true"]').nodes()).attr("aria-expanded","false");f("div.dt-button-background").off("click.dtb-collection");u.background(!1,e.backgroundClassName,e.fade,h);f("body").off(".dtb-collection");b.off("buttons-action.b-internal")};!1===a&&m();c=f(b.buttons('[aria-haspopup="true"][aria-expanded="true"]').nodes());c.length&&(h=c.eq(0),m()); | ||
22 | +c=f("<div/>").addClass("dt-button-collection").addClass(e.collectionLayout).css("display","none");a=f(a).addClass(e.contentClassName).attr("role","menu").appendTo(c);h.attr("aria-expanded","true");h.parents("body")[0]!==y.body&&(h=y.body.lastChild);e.collectionTitle&&c.prepend('<div class="dt-button-collection-title">'+e.collectionTitle+"</div>");E(c.insertAfter(h),e.fade);d=f(b.table().container());var g=c.css("position");"dt-container"===e.align&&(h=h.parent(),c.css("width",d.width()));if("absolute"=== | ||
23 | +g&&(c.hasClass(e.rightAlignClassName)||c.hasClass(e.leftAlignClassName)||"dt-container"===e.align)){var l=h.position();c.css({top:l.top+h.outerHeight(),left:l.left});var k=c.outerHeight(),n=d.offset().top+d.height(),p=l.top+h.outerHeight()+k;n=p-n;p=l.top-k;var r=d.offset().top,v=l.top-k-5;(n>r-p||e.dropup)&&-v<r&&c.css("top",v);l=d.offset().left;d=d.width();d=l+d;g=c.offset().left;var x=c.width();x=g+x;var w=h.offset().left,B=h.outerWidth();B=w+B;w=0;c.hasClass(e.rightAlignClassName)?(w=B-x,l>g+ | ||
24 | +w&&(g=l-(g+w),d-=x+w,w=g>d?w+d:w+g)):(w=l-g,d<x+w&&(g=l-(g+w),d-=x+w,w=g>d?w+d:w+g));c.css("left",c.position().left+w)}else"absolute"===g?(l=h.position(),c.css({top:l.top+h.outerHeight(),left:l.left}),k=c.outerHeight(),g=h.offset().top,w=0,w=h.offset().left,B=h.outerWidth(),B=w+B,g=c.offset().left,x=a.width(),x=g+x,v=l.top-k-5,n=d.offset().top+d.height(),p=l.top+h.outerHeight()+k,n=p-n,p=l.top-k,r=d.offset().top,(n>r-p||e.dropup)&&-v<r&&c.css("top",v),w="button-right"===e.align?B-x:w-g,c.css("left", | ||
25 | +c.position().left+w)):(g=c.height()/2,g>f(A).height()/2&&(g=f(A).height()/2),c.css("marginTop",-1*g));e.background&&u.background(!0,e.backgroundClassName,e.fade,h);f("div.dt-button-background").on("click.dtb-collection",function(){});f("body").on("click.dtb-collection",function(C){var I=f.fn.addBack?"addBack":"andSelf",J=f(C.target).parent()[0];(!f(C.target).parents()[I]().filter(a).length&&!f(J).hasClass("dt-buttons")||f(C.target).hasClass("dt-button-background"))&&m()}).on("keyup.dtb-collection", | ||
26 | +function(C){27===C.keyCode&&m()});e.autoClose&&setTimeout(function(){b.on("buttons-action.b-internal",function(C,I,J,O){O[0]!==h[0]&&m()})},0);f(c).trigger("buttons-popover.dt")}});u.background=function(a,b,c,d){c===t&&(c=400);d||(d=y.body);a?E(f("<div/>").addClass(b).css("display","none").insertAfter(d),c):F(f("div."+b),c,function(){f(this).removeClass(b).remove()})};u.instanceSelector=function(a,b){if(a===t||null===a)return f.map(b,function(h){return h.inst});var c=[],d=f.map(b,function(h){return h.name}), | ||
27 | +e=function(h){if(Array.isArray(h))for(var m=0,g=h.length;m<g;m++)e(h[m]);else"string"===typeof h?-1!==h.indexOf(",")?e(h.split(",")):(h=f.inArray(h.trim(),d),-1!==h&&c.push(b[h].inst)):"number"===typeof h&&c.push(b[h].inst)};e(a);return c};u.buttonSelector=function(a,b){for(var c=[],d=function(g,l,k){for(var n,p,r=0,v=l.length;r<v;r++)if(n=l[r])p=k!==t?k+r:r+"",g.push({node:n.node,name:n.conf.name,idx:p}),n.buttons&&d(g,n.buttons,p+"-")},e=function(g,l){var k,n=[];d(n,l.s.buttons);var p=f.map(n,function(r){return r.node}); | ||
28 | +if(Array.isArray(g)||g instanceof f)for(p=0,k=g.length;p<k;p++)e(g[p],l);else if(null===g||g===t||"*"===g)for(p=0,k=n.length;p<k;p++)c.push({inst:l,node:n[p].node});else if("number"===typeof g)c.push({inst:l,node:l.s.buttons[g].node});else if("string"===typeof g)if(-1!==g.indexOf(","))for(n=g.split(","),p=0,k=n.length;p<k;p++)e(n[p].trim(),l);else if(g.match(/^\d+(\-\d+)*$/))p=f.map(n,function(r){return r.idx}),c.push({inst:l,node:n[f.inArray(g,p)].node});else if(-1!==g.indexOf(":name"))for(g=g.replace(":name", | ||
29 | +""),p=0,k=n.length;p<k;p++)n[p].name===g&&c.push({inst:l,node:n[p].node});else f(p).filter(g).each(function(){c.push({inst:l,node:this})});else"object"===typeof g&&g.nodeName&&(n=f.inArray(g,p),-1!==n&&c.push({inst:l,node:p[n]}))},h=0,m=a.length;h<m;h++)e(b,a[h]);return c};u.stripData=function(a,b){if("string"!==typeof a)return a;a=a.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");a=a.replace(/<!\-\-.*?\-\->/g,"");b.stripHtml&&(a=a.replace(/<[^>]*>/g,""));b.trim&&(a=a.replace(/^\s+|\s+$/g, | ||
30 | +""));b.stripNewlines&&(a=a.replace(/\n/g," "));b.decodeEntities&&(K.innerHTML=a,a=K.value);return a};u.defaults={buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:""},button:{tag:"button",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"span",className:""}}};u.version="1.7.0";f.extend(z,{collection:{text:function(a){return a.i18n("buttons.collection","Collection")},className:"buttons-collection", | ||
31 | +init:function(a,b,c){b.attr("aria-expanded",!1)},action:function(a,b,c,d){a.stopPropagation();d._collection.parents("body").length?this.popover(!1,d):this.popover(d._collection,d)},attr:{"aria-haspopup":!0}},copy:function(a,b){if(z.copyHtml5)return"copyHtml5"},csv:function(a,b){if(z.csvHtml5&&z.csvHtml5.available(a,b))return"csvHtml5"},excel:function(a,b){if(z.excelHtml5&&z.excelHtml5.available(a,b))return"excelHtml5"},pdf:function(a,b){if(z.pdfHtml5&&z.pdfHtml5.available(a,b))return"pdfHtml5"},pageLength:function(a){a= | ||
32 | +a.settings()[0].aLengthMenu;var b=[],c=[];if(Array.isArray(a[0]))b=a[0],c=a[1];else for(var d=0;d<a.length;d++){var e=a[d];f.isPlainObject(e)?(b.push(e.value),c.push(e.label)):(b.push(e),c.push(e))}return{extend:"collection",text:function(h){return h.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},h.page.len())},className:"buttons-page-length",autoClose:!0,buttons:f.map(b,function(h,m){return{text:c[m],className:"button-page-length",action:function(g,l){l.page.len(h).draw()},init:function(g, | ||
33 | +l,k){var n=this;l=function(){n.active(g.page.len()===h)};g.on("length.dt"+k.namespace,l);l()},destroy:function(g,l,k){g.off("length.dt"+k.namespace)}}}),init:function(h,m,g){var l=this;h.on("length.dt"+g.namespace,function(){l.text(g.text)})},destroy:function(h,m,g){h.off("length.dt"+g.namespace)}}}});q.Api.register("buttons()",function(a,b){b===t&&(b=a,a=t);this.selector.buttonGroup=a;var c=this.iterator(!0,"table",function(d){if(d._buttons)return u.buttonSelector(u.instanceSelector(a,d._buttons), | ||
34 | +b)},!0);c._groupSelector=a;return c});q.Api.register("button()",function(a,b){a=this.buttons(a,b);1<a.length&&a.splice(1,a.length);return a});q.Api.registerPlural("buttons().active()","button().active()",function(a){return a===t?this.map(function(b){return b.inst.active(b.node)}):this.each(function(b){b.inst.active(b.node,a)})});q.Api.registerPlural("buttons().action()","button().action()",function(a){return a===t?this.map(function(b){return b.inst.action(b.node)}):this.each(function(b){b.inst.action(b.node, | ||
35 | +a)})});q.Api.register(["buttons().enable()","button().enable()"],function(a){return this.each(function(b){b.inst.enable(b.node,a)})});q.Api.register(["buttons().disable()","button().disable()"],function(){return this.each(function(a){a.inst.disable(a.node)})});q.Api.registerPlural("buttons().nodes()","button().node()",function(){var a=f();f(this.each(function(b){a=a.add(b.inst.node(b.node))}));return a});q.Api.registerPlural("buttons().processing()","button().processing()",function(a){return a=== | ||
36 | +t?this.map(function(b){return b.inst.processing(b.node)}):this.each(function(b){b.inst.processing(b.node,a)})});q.Api.registerPlural("buttons().text()","button().text()",function(a){return a===t?this.map(function(b){return b.inst.text(b.node)}):this.each(function(b){b.inst.text(b.node,a)})});q.Api.registerPlural("buttons().trigger()","button().trigger()",function(){return this.each(function(a){a.inst.node(a.node).trigger("click")})});q.Api.register("button().popover()",function(a,b){return this.map(function(c){return c.inst._popover(a, | ||
37 | +this.button(this[0].node),b)})});q.Api.register("buttons().containers()",function(){var a=f(),b=this._groupSelector;this.iterator(!0,"table",function(c){if(c._buttons){c=u.instanceSelector(b,c._buttons);for(var d=0,e=c.length;d<e;d++)a=a.add(c[d].container())}});return a});q.Api.register("buttons().container()",function(){return this.containers().eq(0)});q.Api.register("button().add()",function(a,b){var c=this.context;c.length&&(c=u.instanceSelector(this._groupSelector,c[0]._buttons),c.length&&c[0].add(b, | ||
38 | +a));return this.button(this._groupSelector,a)});q.Api.register("buttons().destroy()",function(){this.pluck("inst").unique().each(function(a){a.destroy()});return this});q.Api.registerPlural("buttons().remove()","buttons().remove()",function(){this.each(function(a){a.inst.remove(a.node)});return this});var D;q.Api.register("buttons.info()",function(a,b,c){var d=this;if(!1===a)return this.off("destroy.btn-info"),F(f("#datatables_buttons_info"),400,function(){f(this).remove()}),clearTimeout(D),D=null, | ||
39 | +this;D&&clearTimeout(D);f("#datatables_buttons_info").length&&f("#datatables_buttons_info").remove();a=a?"<h2>"+a+"</h2>":"";E(f('<div id="datatables_buttons_info" class="dt-button-info"/>').html(a).append(f("<div/>")["string"===typeof b?"html":"append"](b)).css("display","none").appendTo("body"));c!==t&&0!==c&&(D=setTimeout(function(){d.buttons.info(!1)},c));this.on("destroy.btn-info",function(){d.buttons.info(!1)});return this});q.Api.register("buttons.exportData()",function(a){if(this.context.length)return P(new q.Api(this.context[0]), | ||
40 | +a)});q.Api.register("buttons.exportInfo()",function(a){a||(a={});var b=a;var c="*"===b.filename&&"*"!==b.title&&b.title!==t&&null!==b.title&&""!==b.title?b.title:b.filename;"function"===typeof c&&(c=c());c===t||null===c?c=null:(-1!==c.indexOf("*")&&(c=c.replace("*",f("head > title").text()).trim()),c=c.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""),(b=G(b.extension))||(b=""),c+=b);b=G(a.title);b=null===b?null:-1!==b.indexOf("*")?b.replace("*",f("head > title").text()||"Exported data"):b;return{filename:c, | ||
41 | +title:b,messageTop:L(this,a.message||a.messageTop,"top"),messageBottom:L(this,a.messageBottom,"bottom")}});var G=function(a){return null===a||a===t?null:"function"===typeof a?a():a},L=function(a,b,c){b=G(b);if(null===b)return null;a=f("caption",a.table().container()).eq(0);return"*"===b?a.css("caption-side")!==c?null:a.length?a.text():"":b},K=f("<textarea/>")[0],P=function(a,b){var c=f.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0, | ||
42 | +stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(v){return u.stripData(v,c)},footer:function(v){return u.stripData(v,c)},body:function(v){return u.stripData(v,c)}},customizeData:null},b);b=a.columns(c.columns).indexes().map(function(v){var x=a.column(v).header();return c.format.header(x.innerHTML,v,x)}).toArray();var d=a.table().footer()?a.columns(c.columns).indexes().map(function(v){var x=a.column(v).footer();return c.format.footer(x?x.innerHTML:"",v,x)}).toArray():null,e=f.extend({}, | ||
43 | +c.modifier);a.select&&"function"===typeof a.select.info&&e.selected===t&&a.rows(c.rows,f.extend({selected:!0},e)).any()&&f.extend(e,{selected:!0});e=a.rows(c.rows,e).indexes().toArray();var h=a.cells(e,c.columns);e=h.render(c.orthogonal).toArray();h=h.nodes().toArray();for(var m=b.length,g=[],l=0,k=0,n=0<m?e.length/m:0;k<n;k++){for(var p=[m],r=0;r<m;r++)p[r]=c.format.body(e[l],k,r,h[l]),l++;g[k]=p}b={header:b,footer:d,body:g};c.customizeData&&c.customizeData(b);return b};f.fn.dataTable.Buttons=u; | ||
44 | +f.fn.DataTable.Buttons=u;f(y).on("init.dt plugin-init.dt",function(a,b){"dt"===a.namespace&&(a=b.oInit.buttons||q.defaults.buttons)&&!b._buttons&&(new u(b,a)).container()});q.ext.feature.push({fnInit:H,cFeature:"B"});q.ext.features&&q.ext.features.register("buttons",H);return u}); |
app/templates/datatables-includes.html
1 | <script src="{{ url_for('static', filename='lib/datatables-1.10.24/js/datatables.min.js') }}" type="text/javascript"></script> | 1 | <script src="{{ url_for('static', filename='lib/datatables-1.10.24/js/datatables.min.js') }}" type="text/javascript"></script> |
2 | 2 | ||
3 | -<script type="text/javascript" src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script> | ||
4 | -<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.7.0/js/dataTables.buttons.min.js"></script> | 3 | +<script type="text/javascript" src="{{ url_for('static', filename='lib/datatables-1.10.24/js/dataTables.buttons.min.js') }}"></script> |
4 | +<script type="text/javascript" src="{{ url_for('static', filename='lib/datatables-1.10.24/js/buttons.html5.min.js') }}"></script> | ||
5 | <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script> | 5 | <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script> |
6 | -<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script> | ||
7 | -<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script> | ||
8 | -<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.7.0/js/buttons.html5.min.js"></script> | ||
9 | 6 | ||
10 | <script src="{{ url_for('main.static', filename='js/style_tables.js', version=config.VERSION) }}" type="text/javascript"></script> | 7 | <script src="{{ url_for('main.static', filename='js/style_tables.js', version=config.VERSION) }}" type="text/javascript"></script> |