mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-05-16 13:08:25 -04:00
Initial commit
This commit is contained in:
Vendored
+10
File diff suppressed because one or more lines are too long
Vendored
+125
@@ -0,0 +1,125 @@
|
||||
( function ( $ ) {
|
||||
"use strict";
|
||||
|
||||
|
||||
// const brandPrimary = '#20a8d8'
|
||||
const brandSuccess = '#4dbd74'
|
||||
const brandInfo = '#63c2de'
|
||||
const brandDanger = '#f86c6b'
|
||||
|
||||
function convertHex (hex, opacity) {
|
||||
hex = hex.replace('#', '')
|
||||
const r = parseInt(hex.substring(0, 2), 16)
|
||||
const g = parseInt(hex.substring(2, 4), 16)
|
||||
const b = parseInt(hex.substring(4, 6), 16)
|
||||
|
||||
const result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')'
|
||||
return result
|
||||
}
|
||||
|
||||
function random (min, max) {
|
||||
return Math.floor(Math.random() * (max - min + 1) + min)
|
||||
}
|
||||
|
||||
var elements = 27
|
||||
var data1 = []
|
||||
var data2 = []
|
||||
var data3 = []
|
||||
|
||||
for (var i = 0; i <= elements; i++) {
|
||||
data1.push(random(50, 200))
|
||||
data2.push(random(80, 100))
|
||||
data3.push(65)
|
||||
}
|
||||
|
||||
|
||||
//Traffic Chart
|
||||
var ctx = document.getElementById( "trafficChart" );
|
||||
//ctx.height = 200;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S'],
|
||||
datasets: [
|
||||
{
|
||||
label: 'My First dataset',
|
||||
backgroundColor: convertHex(brandInfo, 10),
|
||||
borderColor: brandInfo,
|
||||
pointHoverBackgroundColor: '#fff',
|
||||
borderWidth: 2,
|
||||
data: data1
|
||||
},
|
||||
{
|
||||
label: 'My Second dataset',
|
||||
backgroundColor: 'transparent',
|
||||
borderColor: brandSuccess,
|
||||
pointHoverBackgroundColor: '#fff',
|
||||
borderWidth: 2,
|
||||
data: data2
|
||||
},
|
||||
{
|
||||
label: 'My Third dataset',
|
||||
backgroundColor: 'transparent',
|
||||
borderColor: brandDanger,
|
||||
pointHoverBackgroundColor: '#fff',
|
||||
borderWidth: 1,
|
||||
borderDash: [8, 5],
|
||||
data: data3
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
// maintainAspectRatio: true,
|
||||
// legend: {
|
||||
// display: false
|
||||
// },
|
||||
// scales: {
|
||||
// xAxes: [{
|
||||
// display: false,
|
||||
// categoryPercentage: 1,
|
||||
// barPercentage: 0.5
|
||||
// }],
|
||||
// yAxes: [ {
|
||||
// display: false
|
||||
// } ]
|
||||
// }
|
||||
|
||||
|
||||
maintainAspectRatio: true,
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
responsive: true,
|
||||
scales: {
|
||||
xAxes: [{
|
||||
gridLines: {
|
||||
drawOnChartArea: false
|
||||
}
|
||||
}],
|
||||
yAxes: [ {
|
||||
ticks: {
|
||||
beginAtZero: true,
|
||||
maxTicksLimit: 5,
|
||||
stepSize: Math.ceil(250 / 5),
|
||||
max: 250
|
||||
},
|
||||
gridLines: {
|
||||
display: true
|
||||
}
|
||||
} ]
|
||||
},
|
||||
elements: {
|
||||
point: {
|
||||
radius: 0,
|
||||
hitRadius: 10,
|
||||
hoverRadius: 4,
|
||||
hoverBorderWidth: 3
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
} )( jQuery );
|
||||
Vendored
+18
File diff suppressed because one or more lines are too long
+15855
File diff suppressed because it is too large
Load Diff
+407
@@ -0,0 +1,407 @@
|
||||
( function ( $ ) {
|
||||
"use strict";
|
||||
|
||||
//Team chart
|
||||
var ctx = document.getElementById( "team-chart" );
|
||||
ctx.height = 150;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: [ "2010", "2011", "2012", "2013", "2014", "2015", "2016" ],
|
||||
type: 'line',
|
||||
defaultFontFamily: 'Montserrat',
|
||||
datasets: [ {
|
||||
data: [ 0, 7, 3, 5, 2, 10, 7 ],
|
||||
label: "Expense",
|
||||
backgroundColor: 'rgba(0,103,255,.15)',
|
||||
borderColor: 'rgba(0,103,255,0.5)',
|
||||
borderWidth: 3.5,
|
||||
pointStyle: 'circle',
|
||||
pointRadius: 5,
|
||||
pointBorderColor: 'transparent',
|
||||
pointBackgroundColor: 'rgba(0,103,255,0.5)',
|
||||
}, ]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
tooltips: {
|
||||
mode: 'index',
|
||||
titleFontSize: 12,
|
||||
titleFontColor: '#000',
|
||||
bodyFontColor: '#000',
|
||||
backgroundColor: '#fff',
|
||||
titleFontFamily: 'Montserrat',
|
||||
bodyFontFamily: 'Montserrat',
|
||||
cornerRadius: 3,
|
||||
intersect: false,
|
||||
},
|
||||
legend: {
|
||||
display: false,
|
||||
position: 'top',
|
||||
labels: {
|
||||
usePointStyle: true,
|
||||
fontFamily: 'Montserrat',
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
scales: {
|
||||
xAxes: [ {
|
||||
display: true,
|
||||
gridLines: {
|
||||
display: false,
|
||||
drawBorder: false
|
||||
},
|
||||
scaleLabel: {
|
||||
display: false,
|
||||
labelString: 'Month'
|
||||
}
|
||||
} ],
|
||||
yAxes: [ {
|
||||
display: true,
|
||||
gridLines: {
|
||||
display: false,
|
||||
drawBorder: false
|
||||
},
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
labelString: 'Value'
|
||||
}
|
||||
} ]
|
||||
},
|
||||
title: {
|
||||
display: false,
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
//Sales chart
|
||||
var ctx = document.getElementById( "sales-chart" );
|
||||
ctx.height = 150;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: [ "2010", "2011", "2012", "2013", "2014", "2015", "2016" ],
|
||||
type: 'line',
|
||||
defaultFontFamily: 'Montserrat',
|
||||
datasets: [ {
|
||||
label: "Foods",
|
||||
data: [ 0, 30, 10, 120, 50, 63, 10 ],
|
||||
backgroundColor: 'transparent',
|
||||
borderColor: 'rgba(220,53,69,0.75)',
|
||||
borderWidth: 3,
|
||||
pointStyle: 'circle',
|
||||
pointRadius: 5,
|
||||
pointBorderColor: 'transparent',
|
||||
pointBackgroundColor: 'rgba(220,53,69,0.75)',
|
||||
}, {
|
||||
label: "Electronics",
|
||||
data: [ 0, 50, 40, 80, 40, 79, 120 ],
|
||||
backgroundColor: 'transparent',
|
||||
borderColor: 'rgba(40,167,69,0.75)',
|
||||
borderWidth: 3,
|
||||
pointStyle: 'circle',
|
||||
pointRadius: 5,
|
||||
pointBorderColor: 'transparent',
|
||||
pointBackgroundColor: 'rgba(40,167,69,0.75)',
|
||||
} ]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
|
||||
tooltips: {
|
||||
mode: 'index',
|
||||
titleFontSize: 12,
|
||||
titleFontColor: '#000',
|
||||
bodyFontColor: '#000',
|
||||
backgroundColor: '#fff',
|
||||
titleFontFamily: 'Montserrat',
|
||||
bodyFontFamily: 'Montserrat',
|
||||
cornerRadius: 3,
|
||||
intersect: false,
|
||||
},
|
||||
legend: {
|
||||
display: false,
|
||||
labels: {
|
||||
usePointStyle: true,
|
||||
fontFamily: 'Montserrat',
|
||||
},
|
||||
},
|
||||
scales: {
|
||||
xAxes: [ {
|
||||
display: true,
|
||||
gridLines: {
|
||||
display: false,
|
||||
drawBorder: false
|
||||
},
|
||||
scaleLabel: {
|
||||
display: false,
|
||||
labelString: 'Month'
|
||||
}
|
||||
} ],
|
||||
yAxes: [ {
|
||||
display: true,
|
||||
gridLines: {
|
||||
display: false,
|
||||
drawBorder: false
|
||||
},
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
labelString: 'Value'
|
||||
}
|
||||
} ]
|
||||
},
|
||||
title: {
|
||||
display: false,
|
||||
text: 'Normal Legend'
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//line chart
|
||||
var ctx = document.getElementById( "lineChart" );
|
||||
ctx.height = 150;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: [ "January", "February", "March", "April", "May", "June", "July" ],
|
||||
datasets: [
|
||||
{
|
||||
label: "My First dataset",
|
||||
borderColor: "rgba(0,0,0,.09)",
|
||||
borderWidth: "1",
|
||||
backgroundColor: "rgba(0,0,0,.07)",
|
||||
data: [ 22, 44, 67, 43, 76, 45, 12 ]
|
||||
},
|
||||
{
|
||||
label: "My Second dataset",
|
||||
borderColor: "rgba(0, 123, 255, 0.9)",
|
||||
borderWidth: "1",
|
||||
backgroundColor: "rgba(0, 123, 255, 0.5)",
|
||||
pointHighlightStroke: "rgba(26,179,148,1)",
|
||||
data: [ 16, 32, 18, 26, 42, 33, 44 ]
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
tooltips: {
|
||||
mode: 'index',
|
||||
intersect: false
|
||||
},
|
||||
hover: {
|
||||
mode: 'nearest',
|
||||
intersect: true
|
||||
}
|
||||
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
//bar chart
|
||||
var ctx = document.getElementById( "barChart" );
|
||||
// ctx.height = 200;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: [ "January", "February", "March", "April", "May", "June", "July" ],
|
||||
datasets: [
|
||||
{
|
||||
label: "My First dataset",
|
||||
data: [ 65, 59, 80, 81, 56, 55, 40 ],
|
||||
borderColor: "rgba(0, 123, 255, 0.9)",
|
||||
borderWidth: "0",
|
||||
backgroundColor: "rgba(0, 123, 255, 0.5)"
|
||||
},
|
||||
{
|
||||
label: "My Second dataset",
|
||||
data: [ 28, 48, 40, 19, 86, 27, 90 ],
|
||||
borderColor: "rgba(0,0,0,0.09)",
|
||||
borderWidth: "0",
|
||||
backgroundColor: "rgba(0,0,0,0.07)"
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
yAxes: [ {
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
} ]
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
//radar chart
|
||||
var ctx = document.getElementById( "radarChart" );
|
||||
ctx.height = 160;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'radar',
|
||||
data: {
|
||||
labels: [ [ "Eating", "Dinner" ], [ "Drinking", "Water" ], "Sleeping", [ "Designing", "Graphics" ], "Coding", "Cycling", "Running" ],
|
||||
datasets: [
|
||||
{
|
||||
label: "My First dataset",
|
||||
data: [ 65, 59, 66, 45, 56, 55, 40 ],
|
||||
borderColor: "rgba(0, 123, 255, 0.6)",
|
||||
borderWidth: "1",
|
||||
backgroundColor: "rgba(0, 123, 255, 0.4)"
|
||||
},
|
||||
{
|
||||
label: "My Second dataset",
|
||||
data: [ 28, 12, 40, 19, 63, 27, 87 ],
|
||||
borderColor: "rgba(0, 123, 255, 0.7",
|
||||
borderWidth: "1",
|
||||
backgroundColor: "rgba(0, 123, 255, 0.5)"
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
legend: {
|
||||
position: 'top'
|
||||
},
|
||||
scale: {
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
//pie chart
|
||||
var ctx = document.getElementById( "pieChart" );
|
||||
ctx.height = 300;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'pie',
|
||||
data: {
|
||||
datasets: [ {
|
||||
data: [ 45, 25, 20, 10 ],
|
||||
backgroundColor: [
|
||||
"rgba(0, 123, 255,0.9)",
|
||||
"rgba(0, 123, 255,0.7)",
|
||||
"rgba(0, 123, 255,0.5)",
|
||||
"rgba(0,0,0,0.07)"
|
||||
],
|
||||
hoverBackgroundColor: [
|
||||
"rgba(0, 123, 255,0.9)",
|
||||
"rgba(0, 123, 255,0.7)",
|
||||
"rgba(0, 123, 255,0.5)",
|
||||
"rgba(0,0,0,0.07)"
|
||||
]
|
||||
|
||||
} ],
|
||||
labels: [
|
||||
"green",
|
||||
"green",
|
||||
"green"
|
||||
]
|
||||
},
|
||||
options: {
|
||||
responsive: true
|
||||
}
|
||||
} );
|
||||
|
||||
//doughut chart
|
||||
var ctx = document.getElementById( "doughutChart" );
|
||||
ctx.height = 150;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
datasets: [ {
|
||||
data: [ 45, 25, 20, 10 ],
|
||||
backgroundColor: [
|
||||
"rgba(0, 123, 255,0.9)",
|
||||
"rgba(0, 123, 255,0.7)",
|
||||
"rgba(0, 123, 255,0.5)",
|
||||
"rgba(0,0,0,0.07)"
|
||||
],
|
||||
hoverBackgroundColor: [
|
||||
"rgba(0, 123, 255,0.9)",
|
||||
"rgba(0, 123, 255,0.7)",
|
||||
"rgba(0, 123, 255,0.5)",
|
||||
"rgba(0,0,0,0.07)"
|
||||
]
|
||||
|
||||
} ],
|
||||
labels: [
|
||||
"green",
|
||||
"green",
|
||||
"green",
|
||||
"green"
|
||||
]
|
||||
},
|
||||
options: {
|
||||
responsive: true
|
||||
}
|
||||
} );
|
||||
|
||||
//polar chart
|
||||
var ctx = document.getElementById( "polarChart" );
|
||||
ctx.height = 150;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'polarArea',
|
||||
data: {
|
||||
datasets: [ {
|
||||
data: [ 15, 18, 9, 6, 19 ],
|
||||
backgroundColor: [
|
||||
"rgba(0, 123, 255,0.9)",
|
||||
"rgba(0, 123, 255,0.8)",
|
||||
"rgba(0, 123, 255,0.7)",
|
||||
"rgba(0,0,0,0.2)",
|
||||
"rgba(0, 123, 255,0.5)"
|
||||
]
|
||||
|
||||
} ],
|
||||
labels: [
|
||||
"green",
|
||||
"green",
|
||||
"green",
|
||||
"green"
|
||||
]
|
||||
},
|
||||
options: {
|
||||
responsive: true
|
||||
}
|
||||
} );
|
||||
|
||||
// single bar chart
|
||||
var ctx = document.getElementById( "singelBarChart" );
|
||||
ctx.height = 150;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: [ "Sun", "Mon", "Tu", "Wed", "Th", "Fri", "Sat" ],
|
||||
datasets: [
|
||||
{
|
||||
label: "My First dataset",
|
||||
data: [ 40, 55, 75, 81, 56, 55, 40 ],
|
||||
borderColor: "rgba(0, 123, 255, 0.9)",
|
||||
borderWidth: "0",
|
||||
backgroundColor: "rgba(0, 123, 255, 0.5)"
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
yAxes: [ {
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
} ]
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
|
||||
|
||||
} )( jQuery );
|
||||
+1349
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+1389
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
(function(b,a){b.extend(!0,a.Buttons.defaults,{dom:{container:{className:"dt-buttons btn-group"},button:{className:"btn btn-default"},collection:{tag:"ul",className:"dt-button-collection dropdown-menu",button:{tag:"li",className:"dt-button"},buttonLiner:{tag:"a",className:""}}}});a.ext.buttons.collection.text=function(a){return a.i18n("buttons.collection",'Collection <span class="caret"/>')}})(jQuery,jQuery.fn.dataTable);
|
||||
@@ -0,0 +1,5 @@
|
||||
(function(g){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(d){return g(d,window,document)}):"object"===typeof exports?module.exports=function(d,e){d||(d=window);if(!e||!e.fn.dataTable)e=require("datatables.net")(d,e).$;e.fn.dataTable.Buttons||require("datatables.net-buttons")(d,e);return g(e,d,d.document)}:g(jQuery,window,document)})(function(g,d,e,h){d=g.fn.dataTable;g.extend(d.ext.buttons,{colvis:function(a,b){return{extend:"collection",
|
||||
text:function(a){return a.i18n("buttons.colvis","Column visibility")},className:"buttons-colvis",buttons:[{extend:"columnsToggle",columns:b.columns}]}},columnsToggle:function(a,b){return a.columns(b.columns).indexes().map(function(a){return{extend:"columnToggle",columns:a}}).toArray()},columnToggle:function(a,b){return{extend:"columnVisibility",columns:b.columns}},columnsVisibility:function(a,b){return a.columns(b.columns).indexes().map(function(a){return{extend:"columnVisibility",columns:a,visibility:b.visibility}}).toArray()},
|
||||
columnVisibility:{columns:h,text:function(a,b,c){return c._columnText(a,c.columns)},className:"buttons-columnVisibility",action:function(a,b,c,f){a=b.columns(f.columns);b=a.visible();a.visible(f.visibility!==h?f.visibility:!(b.length&&b[0]))},init:function(a,b,c){var f=this;a.on("column-visibility.dt"+c.namespace,function(b,d){d.bDestroying||f.active(a.column(c.columns).visible())}).on("column-reorder.dt"+c.namespace,function(b,d,e){1===a.columns(c.columns).count()&&("number"===typeof c.columns&&
|
||||
(c.columns=e.mapping[c.columns]),b=a.column(c.columns),f.text(c._columnText(a,c.columns)),f.active(b.visible()))});this.active(a.column(c.columns).visible())},destroy:function(a,b,c){a.off("column-visibility.dt"+c.namespace).off("column-reorder.dt"+c.namespace)},_columnText:function(a,b){var c=a.column(b).index();return a.settings()[0].aoColumns[c].sTitle.replace(/\n/g," ").replace(/<.*?>/g,"").replace(/^\s+|\s+$/g,"")}},colvisRestore:{className:"buttons-colvisRestore",text:function(a){return a.i18n("buttons.colvisRestore",
|
||||
"Restore visibility")},init:function(a,b,c){c._visOriginal=a.columns().indexes().map(function(b){return a.column(b).visible()}).toArray()},action:function(a,b,c,d){b.columns().every(function(a){a=b.colReorder&&b.colReorder.transpose?b.colReorder.transpose(a,"toOriginal"):a;this.visible(d._visOriginal[a])})}},colvisGroup:{className:"buttons-colvisGroup",action:function(a,b,c,d){b.columns(d.show).visible(!0,!1);b.columns(d.hide).visible(!1,!1);b.columns.adjust()},show:[],hide:[]}});return d.Buttons});
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
||||
(function(e){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(f){return e(f,window,document)}):"object"===typeof exports?module.exports=function(f,c){f||(f=window);if(!c||!c.fn.dataTable)c=require("datatables.net")(f,c).$;c.fn.dataTable.Buttons||require("datatables.net-buttons")(f,c);return e(c,f,f.document)}:e(jQuery,window,document)})(function(e,f,c){var i=e.fn.dataTable,h=c.createElement("a");i.ext.buttons.print={className:"buttons-print",
|
||||
text:function(b){return b.i18n("buttons.print","Print")},action:function(b,c,i,d){var a=c.buttons.exportData(d.exportOptions),k=function(b,a){for(var c="<tr>",d=0,e=b.length;d<e;d++)c+="<"+a+">"+b[d]+"</"+a+">";return c+"</tr>"},b='<table class="'+c.table().node().className+'">';d.header&&(b+="<thead>"+k(a.header,"th")+"</thead>");for(var b=b+"<tbody>",l=0,m=a.body.length;l<m;l++)b+=k(a.body[l],"td");b+="</tbody>";d.footer&&a.footer&&(b+="<tfoot>"+k(a.footer,"th")+"</tfoot>");var g=f.open("",""),
|
||||
a=d.title;"function"===typeof a&&(a=a());-1!==a.indexOf("*")&&(a=a.replace("*",e("title").text()));g.document.close();var j="<title>"+a+"</title>";e("style, link").each(function(){var c=j,b=e(this).clone()[0],a;"link"===b.nodeName.toLowerCase()&&(h.href=b.href,a=h.host,-1===a.indexOf("/")&&0!==h.pathname.indexOf("/")&&(a+="/"),b.href=h.protocol+"//"+a+h.pathname+h.search);j=c+b.outerHTML});try{g.document.head.innerHTML=j}catch(n){e(g.document.head).html(j)}g.document.body.innerHTML="<h1>"+a+"</h1><div>"+
|
||||
("function"===typeof d.message?d.message(c,i,d):d.message)+"</div>"+b;e(g.document.body).addClass("dt-print-view");d.customize&&d.customize(g);setTimeout(function(){d.autoPrint&&(g.print(),g.close())},250)},title:"*",message:"",exportOptions:{},header:!0,footer:!1,autoPrint:!0,customize:null};return i.Buttons});
|
||||
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
DataTables Bootstrap 3 integration
|
||||
©2011-2015 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d,m){var f=b.fn.dataTable;b.extend(!0,f.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
|
||||
renderer:"bootstrap"});b.extend(f.ext.classes,{sWrapper:"dataTables_wrapper container-fluid dt-bootstrap4",sFilterInput:"form-control form-control-sm",sLengthSelect:"form-control form-control-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,s,j,n){var o=new f.Api(a),t=a.oClasses,k=a.oLanguage.oPaginate,u=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&
|
||||
o.page()!=a.data.action&&o.page(a.data.action).draw("page")};l=0;for(h=f.length;l<h;l++)if(c=f[l],b.isArray(c))q(d,c);else{g=e="";switch(c){case "ellipsis":e="…";g="disabled";break;case "first":e=k.sFirst;g=c+(0<j?"":" disabled");break;case "previous":e=k.sPrevious;g=c+(0<j?"":" disabled");break;case "next":e=k.sNext;g=c+(j<n-1?"":" disabled");break;case "last":e=k.sLast;g=c+(j<n-1?"":" disabled");break;default:e=c+1,g=j===c?"active":""}e&&(i=b("<li>",{"class":t.sPageButton+" "+g,id:0===r&&
|
||||
"string"===typeof c?a.sTableId+"_"+c:null}).append(b("<a>",{href:"#","aria-controls":a.sTableId,"aria-label":u[c],"data-dt-idx":p,tabindex:a.iTabIndex,"class":"page-link"}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(v){}q(b(h).empty().html('<ul class="pagination"/>').children("ul"),s);i!==m&&b(h).find("[data-dt-idx="+i+"]").focus()};return f});
|
||||
@@ -0,0 +1,35 @@
|
||||
/*!
|
||||
Buttons for DataTables 1.2.4
|
||||
©2016 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(n){return d(n,window,document)}):"object"===typeof exports?module.exports=function(n,o){n||(n=window);if(!o||!o.fn.dataTable)o=require("datatables.net")(n,o).$;return d(o,n,n.document)}:d(jQuery,window,document)})(function(d,n,o,m){var i=d.fn.dataTable,u=0,v=0,j=i.ext.buttons,l=function(a,b){!0===b&&(b={});d.isArray(b)&&(b={buttons:b});this.c=d.extend(!0,{},l.defaults,b);b.buttons&&(this.c.buttons=b.buttons);
|
||||
this.s={dt:new i.Api(a),buttons:[],listenKeys:"",namespace:"dtb"+u++};this.dom={container:d("<"+this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)};this._constructor()};d.extend(l.prototype,{action:function(a,b){var c=this._nodeToButton(a);if(b===m)return c.conf.action;c.conf.action=b;return this},active:function(a,b){var c=this._nodeToButton(a),e=this.c.dom.button.active,c=d(c.node);if(b===m)return c.hasClass(e);c.toggleClass(e,b===m?!0:b);return this},add:function(a,b){var c=
|
||||
this.s.buttons;if("string"===typeof b){for(var e=b.split("-"),c=this.s,d=0,h=e.length-1;d<h;d++)c=c.buttons[1*e[d]];c=c.buttons;b=1*e[e.length-1]}this._expandButton(c,a,!1,b);this._draw();return this},container:function(){return this.dom.container},disable:function(a){a=this._nodeToButton(a);d(a.node).addClass(this.c.dom.button.disabled);return this},destroy:function(){d("body").off("keyup."+this.s.namespace);var a=this.s.buttons.slice(),b,c;b=0;for(c=a.length;b<c;b++)this.remove(a[b].node);this.dom.container.remove();
|
||||
a=this.s.dt.settings()[0];b=0;for(c=a.length;b<c;b++)if(a.inst===this){a.splice(b,1);break}return this},enable:function(a,b){if(!1===b)return this.disable(a);var c=this._nodeToButton(a);d(c.node).removeClass(this.c.dom.button.disabled);return this},name:function(){return this.c.name},node:function(a){a=this._nodeToButton(a);return d(a.node)},remove:function(a){var b=this._nodeToButton(a),c=this._nodeToHost(a),e=this.s.dt;if(b.buttons.length)for(var g=b.buttons.length-1;0<=g;g--)this.remove(b.buttons[g].node);
|
||||
b.conf.destroy&&b.conf.destroy.call(e.button(a),e,d(a),b.conf);this._removeKey(b.conf);d(b.node).remove();a=d.inArray(b,c);c.splice(a,1);return this},text:function(a,b){var c=this._nodeToButton(a),e=this.c.dom.collection.buttonLiner,e=c.inCollection&&e&&e.tag?e.tag:this.c.dom.buttonLiner.tag,g=this.s.dt,h=d(c.node),f=function(a){return"function"===typeof a?a(g,h,c.conf):a};if(b===m)return f(c.conf.text);c.conf.text=b;e?h.children(e).html(f(b)):h.html(f(b));return this},_constructor:function(){var a=
|
||||
this,b=this.s.dt,c=b.settings()[0],e=this.c.buttons;c._buttons||(c._buttons=[]);c._buttons.push({inst:this,name:this.c.name});for(var c=0,g=e.length;c<g;c++)this.add(e[c]);b.on("destroy",function(){a.destroy()});d("body").on("keyup."+this.s.namespace,function(b){if(!o.activeElement||o.activeElement===o.body){var c=String.fromCharCode(b.keyCode).toLowerCase();a.s.listenKeys.toLowerCase().indexOf(c)!==-1&&a._keypress(c,b)}})},_addKey:function(a){a.key&&(this.s.listenKeys+=d.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,e=b.length;c<e;c++)a.append(b[c].inserter),b[c].buttons&&b[c].buttons.length&&this._draw(b[c].collection,b[c].buttons)},_expandButton:function(a,b,c,e){for(var g=this.s.dt,h=0,b=!d.isArray(b)?[b]:b,f=0,r=b.length;f<r;f++){var k=this._resolveExtends(b[f]);if(k)if(d.isArray(k))this._expandButton(a,k,c,e);else{var p=this._buildButton(k,c);if(p){e!==m?(a.splice(e,0,p),e++):a.push(p);if(p.conf.buttons){var s=
|
||||
this.c.dom.collection;p.collection=d("<"+s.tag+"/>").addClass(s.className);p.conf._collection=p.collection;this._expandButton(p.buttons,p.conf.buttons,!0,e)}k.init&&k.init.call(g.button(p.node),g,d(p.node),k);h++}}}},_buildButton:function(a,b){var c=this.c.dom.button,e=this.c.dom.buttonLiner,g=this.c.dom.collection,h=this.s.dt,f=function(b){return"function"===typeof b?b(h,k,a):b};b&&g.button&&(c=g.button);b&&g.buttonLiner&&(e=g.buttonLiner);if(a.available&&!a.available(h,a))return!1;var r=function(a,
|
||||
b,c,e){e.action.call(b.button(c),a,b,c,e);d(b.table().node()).triggerHandler("buttons-action.dt",[b.button(c),b,c,e])},k=d("<"+c.tag+"/>").addClass(c.className).attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",function(b){b.preventDefault();!k.hasClass(c.disabled)&&a.action&&r(b,h,k,a);k.blur()}).on("keyup.dtb",function(b){b.keyCode===13&&!k.hasClass(c.disabled)&&a.action&&r(b,h,k,a)});"a"===c.tag.toLowerCase()&&k.attr("href","#");
|
||||
e.tag?(g=d("<"+e.tag+"/>").html(f(a.text)).addClass(e.className),"a"===e.tag.toLowerCase()&&g.attr("href","#"),k.append(g)):k.html(f(a.text));!1===a.enabled&&k.addClass(c.disabled);a.className&&k.addClass(a.className);a.titleAttr&&k.attr("title",a.titleAttr);a.namespace||(a.namespace=".dt-button-"+v++);e=(e=this.c.dom.buttonContainer)&&e.tag?d("<"+e.tag+"/>").addClass(e.className).append(k):k;this._addKey(a);return{conf:a,node:k.get(0),inserter:e,buttons:[],inCollection:b,collection:null}},_nodeToButton:function(a,
|
||||
b){b||(b=this.s.buttons);for(var c=0,e=b.length;c<e;c++){if(b[c].node===a)return b[c];if(b[c].buttons.length){var d=this._nodeToButton(a,b[c].buttons);if(d)return d}}},_nodeToHost:function(a,b){b||(b=this.s.buttons);for(var c=0,e=b.length;c<e;c++){if(b[c].node===a)return b;if(b[c].buttons.length){var d=this._nodeToHost(a,b[c].buttons);if(d)return d}}},_keypress:function(a,b){var c=function(e){for(var g=0,h=e.length;g<h;g++){var f=e[g].conf,r=e[g].node;if(f.key)if(f.key===a)d(r).click();else if(d.isPlainObject(f.key)&&
|
||||
f.key.key===a&&(!f.key.shiftKey||b.shiftKey))if(!f.key.altKey||b.altKey)if(!f.key.ctrlKey||b.ctrlKey)(!f.key.metaKey||b.metaKey)&&d(r).click();e[g].buttons.length&&c(e[g].buttons)}};c(this.s.buttons)},_removeKey:function(a){if(a.key){var b=d.isPlainObject(a.key)?a.key.key:a.key,a=this.s.listenKeys.split(""),b=d.inArray(b,a);a.splice(b,1);this.s.listenKeys=a.join("")}},_resolveExtends:function(a){for(var b=this.s.dt,c,e,g=function(c){for(var e=0;!d.isPlainObject(c)&&!d.isArray(c);){if(c===m)return;
|
||||
if("function"===typeof c){if(c=c(b,a),!c)return!1}else if("string"===typeof c){if(!j[c])throw"Unknown button type: "+c;c=j[c]}e++;if(30<e)throw"Buttons: Too many iterations";}return d.isArray(c)?c:d.extend({},c)},a=g(a);a&&a.extend;){if(!j[a.extend])throw"Cannot extend unknown button type: "+a.extend;var h=g(j[a.extend]);if(d.isArray(h))return h;if(!h)return!1;c=h.className;a=d.extend({},h,a);c&&a.className!==c&&(a.className=c+" "+a.className);var f=a.postfixButtons;if(f){a.buttons||(a.buttons=[]);
|
||||
c=0;for(e=f.length;c<e;c++)a.buttons.push(f[c]);a.postfixButtons=null}if(f=a.prefixButtons){a.buttons||(a.buttons=[]);c=0;for(e=f.length;c<e;c++)a.buttons.splice(c,0,f[c]);a.prefixButtons=null}a.extend=h.extend}return a}});l.background=function(a,b,c){c===m&&(c=400);a?d("<div/>").addClass(b).css("display","none").appendTo("body").fadeIn(c):d("body > div."+b).fadeOut(c,function(){d(this).removeClass(b).remove()})};l.instanceSelector=function(a,b){if(!a)return d.map(b,function(a){return a.inst});var c=
|
||||
[],e=d.map(b,function(a){return a.name}),g=function(a){if(d.isArray(a))for(var f=0,r=a.length;f<r;f++)g(a[f]);else"string"===typeof a?-1!==a.indexOf(",")?g(a.split(",")):(a=d.inArray(d.trim(a),e),-1!==a&&c.push(b[a].inst)):"number"===typeof a&&c.push(b[a].inst)};g(a);return c};l.buttonSelector=function(a,b){for(var c=[],e=function(a,b,c){for(var d,g,f=0,h=b.length;f<h;f++)if(d=b[f])g=c!==m?c+f:f+"",a.push({node:d.node,name:d.conf.name,idx:g}),d.buttons&&e(a,d.buttons,g+"-")},g=function(a,b){var f,
|
||||
h,i=[];e(i,b.s.buttons);f=d.map(i,function(a){return a.node});if(d.isArray(a)||a instanceof d){f=0;for(h=a.length;f<h;f++)g(a[f],b)}else if(null===a||a===m||"*"===a){f=0;for(h=i.length;f<h;f++)c.push({inst:b,node:i[f].node})}else if("number"===typeof a)c.push({inst:b,node:b.s.buttons[a].node});else if("string"===typeof a)if(-1!==a.indexOf(",")){i=a.split(",");f=0;for(h=i.length;f<h;f++)g(d.trim(i[f]),b)}else if(a.match(/^\d+(\-\d+)*$/))f=d.map(i,function(a){return a.idx}),c.push({inst:b,node:i[d.inArray(a,
|
||||
f)].node});else if(-1!==a.indexOf(":name")){var j=a.replace(":name","");f=0;for(h=i.length;f<h;f++)i[f].name===j&&c.push({inst:b,node:i[f].node})}else d(f).filter(a).each(function(){c.push({inst:b,node:this})});else"object"===typeof a&&a.nodeName&&(i=d.inArray(a,f),-1!==i&&c.push({inst:b,node:f[i]}))},h=0,f=a.length;h<f;h++)g(b,a[h]);return c};l.defaults={buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:"dt-button-collection"},
|
||||
button:{tag:"a",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"span",className:""}}};l.version="1.2.4";d.extend(j,{collection:{text:function(a){return a.i18n("buttons.collection","Collection")},className:"buttons-collection",action:function(a,b,c,e){var a=c.offset(),g=d(b.table().container()),h=!1;d("div.dt-button-background").length&&(h=d(".dt-button-collection").offset(),d("body").trigger("click.dtb-collection"));e._collection.addClass(e.collectionLayout).css("display",
|
||||
"none").appendTo("body").fadeIn(e.fade);var f=e._collection.css("position");h&&"absolute"===f?e._collection.css({top:h.top,left:h.left}):"absolute"===f?(e._collection.css({top:a.top+c.outerHeight(),left:a.left}),c=a.left+e._collection.outerWidth(),g=g.offset().left+g.width(),c>g&&e._collection.css("left",a.left-(c-g))):(a=e._collection.height()/2,a>d(n).height()/2&&(a=d(n).height()/2),e._collection.css("marginTop",-1*a));e.background&&l.background(!0,e.backgroundClassName,e.fade);setTimeout(function(){d("div.dt-button-background").on("click.dtb-collection",
|
||||
function(){});d("body").on("click.dtb-collection",function(a){var c=d.fn.addBack?"addBack":"andSelf";if(!d(a.target).parents()[c]().filter(e._collection).length){e._collection.fadeOut(e.fade,function(){e._collection.detach()});d("div.dt-button-background").off("click.dtb-collection");l.background(false,e.backgroundClassName,e.fade);d("body").off("click.dtb-collection");b.off("buttons-action.b-internal")}})},10);if(e.autoClose)b.on("buttons-action.b-internal",function(){d("div.dt-button-background").click()})},
|
||||
background:!0,collectionLayout:"",backgroundClassName:"dt-button-background",autoClose:!1,fade:400},copy:function(a,b){if(j.copyHtml5)return"copyHtml5";if(j.copyFlash&&j.copyFlash.available(a,b))return"copyFlash"},csv:function(a,b){if(j.csvHtml5&&j.csvHtml5.available(a,b))return"csvHtml5";if(j.csvFlash&&j.csvFlash.available(a,b))return"csvFlash"},excel:function(a,b){if(j.excelHtml5&&j.excelHtml5.available(a,b))return"excelHtml5";if(j.excelFlash&&j.excelFlash.available(a,b))return"excelFlash"},pdf:function(a,
|
||||
b){if(j.pdfHtml5&&j.pdfHtml5.available(a,b))return"pdfHtml5";if(j.pdfFlash&&j.pdfFlash.available(a,b))return"pdfFlash"},pageLength:function(a){var a=a.settings()[0].aLengthMenu,b=d.isArray(a[0])?a[0]:a,c=d.isArray(a[0])?a[1]:a,e=function(a){return a.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},a.page.len())};return{extend:"collection",text:e,className:"buttons-page-length",autoClose:!0,buttons:d.map(b,function(a,b){return{text:c[b],className:"button-page-length",action:function(b,
|
||||
c){c.page.len(a).draw()},init:function(b,c,e){var d=this,c=function(){d.active(b.page.len()===a)};b.on("length.dt"+e.namespace,c);c()},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}),init:function(a,b,c){var d=this;a.on("length.dt"+c.namespace,function(){d.text(e(a))})},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}});i.Api.register("buttons()",function(a,b){b===m&&(b=a,a=m);this.selector.buttonGroup=a;var c=this.iterator(!0,"table",function(c){if(c._buttons)return l.buttonSelector(l.instanceSelector(a,
|
||||
c._buttons),b)},!0);c._groupSelector=a;return c});i.Api.register("button()",function(a,b){var c=this.buttons(a,b);1<c.length&&c.splice(1,c.length);return c});i.Api.registerPlural("buttons().active()","button().active()",function(a){return a===m?this.map(function(a){return a.inst.active(a.node)}):this.each(function(b){b.inst.active(b.node,a)})});i.Api.registerPlural("buttons().action()","button().action()",function(a){return a===m?this.map(function(a){return a.inst.action(a.node)}):this.each(function(b){b.inst.action(b.node,
|
||||
a)})});i.Api.register(["buttons().enable()","button().enable()"],function(a){return this.each(function(b){b.inst.enable(b.node,a)})});i.Api.register(["buttons().disable()","button().disable()"],function(){return this.each(function(a){a.inst.disable(a.node)})});i.Api.registerPlural("buttons().nodes()","button().node()",function(){var a=d();d(this.each(function(b){a=a.add(b.inst.node(b.node))}));return a});i.Api.registerPlural("buttons().text()","button().text()",function(a){return a===m?this.map(function(a){return a.inst.text(a.node)}):
|
||||
this.each(function(b){b.inst.text(b.node,a)})});i.Api.registerPlural("buttons().trigger()","button().trigger()",function(){return this.each(function(a){a.inst.node(a.node).trigger("click")})});i.Api.registerPlural("buttons().containers()","buttons().container()",function(){var a=d(),b=this._groupSelector;this.iterator(!0,"table",function(c){if(c._buttons)for(var c=l.instanceSelector(b,c._buttons),d=0,g=c.length;d<g;d++)a=a.add(c[d].container())});return a});i.Api.register("button().add()",function(a,
|
||||
b){var c=this.context;c.length&&(c=l.instanceSelector(this._groupSelector,c[0]._buttons),c.length&&c[0].add(b,a));return this.button(this._groupSelector,a)});i.Api.register("buttons().destroy()",function(){this.pluck("inst").unique().each(function(a){a.destroy()});return this});i.Api.registerPlural("buttons().remove()","buttons().remove()",function(){this.each(function(a){a.inst.remove(a.node)});return this});var q;i.Api.register("buttons.info()",function(a,b,c){var e=this;if(!1===a)return d("#datatables_buttons_info").fadeOut(function(){d(this).remove()}),
|
||||
clearTimeout(q),q=null,this;q&&clearTimeout(q);d("#datatables_buttons_info").length&&d("#datatables_buttons_info").remove();d('<div id="datatables_buttons_info" class="dt-button-info"/>').html(a?"<h2>"+a+"</h2>":"").append(d("<div/>")["string"===typeof b?"html":"append"](b)).css("display","none").appendTo("body").fadeIn();c!==m&&0!==c&&(q=setTimeout(function(){e.buttons.info(!1)},c));return this});i.Api.register("buttons.exportData()",function(a){if(this.context.length){for(var b=new i.Api(this.context[0]),
|
||||
c=d.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(a){return e(a)},footer:function(a){return e(a)},body:function(a){return e(a)}}},a),e=function(a){if("string"!==typeof a)return a;c.stripHtml&&(a=a.replace(/<[^>]*>/g,""));c.trim&&(a=a.replace(/^\s+|\s+$/g,""));c.stripNewlines&&(a=a.replace(/\n/g," "));c.decodeEntities&&(t.innerHTML=a,a=t.value);return a},a=b.columns(c.columns).indexes().map(function(a){var d=
|
||||
b.column(a).header();return c.format.header(d.innerHTML,a,d)}).toArray(),g=b.table().footer()?b.columns(c.columns).indexes().map(function(a){var d=b.column(a).footer();return c.format.footer(d?d.innerHTML:"",a,d)}).toArray():null,h=b.rows(c.rows,c.modifier).indexes().toArray(),f=b.cells(h,c.columns),h=f.render(c.orthogonal).toArray(),f=f.nodes().toArray(),j=a.length,k=0<j?h.length/j:0,l=Array(k),m=0,n=0;n<k;n++){for(var o=Array(j),q=0;q<j;q++)o[q]=c.format.body(h[m],n,q,f[m]),m++;l[n]=o}return{header:a,
|
||||
footer:g,body:l}}});var t=d("<textarea/>")[0];d.fn.dataTable.Buttons=l;d.fn.DataTable.Buttons=l;d(o).on("init.dt plugin-init.dt",function(a,b){if("dt"===a.namespace){var c=b.oInit.buttons||i.defaults.buttons;c&&!b._buttons&&(new l(b,c)).container()}});i.ext.feature.push({fnInit:function(a){var a=new i.Api(a),b=a.init().buttons||i.defaults.buttons;return(new l(a,b)).container()},cFeature:"B"});return l});
|
||||
@@ -0,0 +1,53 @@
|
||||
(function ($) {
|
||||
// "use strict";
|
||||
|
||||
|
||||
/* Data Table
|
||||
-------------*/
|
||||
|
||||
|
||||
|
||||
|
||||
$('#bootstrap-data-table').DataTable({
|
||||
lengthMenu: [[10, 20, 50, -1], [10, 20, 50, "All"]],
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#bootstrap-data-table-export').DataTable({
|
||||
dom: 'lBfrtip',
|
||||
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
|
||||
$('#row-select').DataTable( {
|
||||
initComplete: function () {
|
||||
this.api().columns().every( function () {
|
||||
var column = this;
|
||||
var select = $('<select class="form-control"><option value=""></option></select>')
|
||||
.appendTo( $(column.footer()).empty() )
|
||||
.on( 'change', function () {
|
||||
var val = $.fn.dataTable.util.escapeRegex(
|
||||
$(this).val()
|
||||
);
|
||||
|
||||
column
|
||||
.search( val ? '^'+val+'$' : '', true, false )
|
||||
.draw();
|
||||
} );
|
||||
|
||||
column.data().unique().sort().each( function ( d, j ) {
|
||||
select.append( '<option value="'+d+'">'+d+'</option>' )
|
||||
} );
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
})(jQuery);
|
||||
+204
File diff suppressed because one or more lines are too long
+11008
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,167 @@
|
||||
/*!
|
||||
DataTables 1.10.13
|
||||
©2008-2016 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(h){"function"===typeof define&&define.amd?define(["jquery"],function(E){return h(E,window,document)}):"object"===typeof exports?module.exports=function(E,H){E||(E=window);H||(H="undefined"!==typeof window?require("jquery"):require("jquery")(E));return h(H,E,E.document)}:h(jQuery,window,document)})(function(h,E,H,k){function Y(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),
|
||||
d[c]=e,"o"===b[1]&&Y(a[e])});a._hungarianMap=d}function J(a,b,c){a._hungarianMap||Y(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),J(a[d],b[d],c)):b[d]=b[e]})}function Fa(a){var b=m.defaults.oLanguage,c=a.sZeroRecords;!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&&F(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&&F(a,a,"sZeroRecords","sLoadingRecords");
|
||||
a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&fb(a)}function gb(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":"");"boolean"===typeof a.scrollX&&(a.scrollX=
|
||||
a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&J(m.models.oSearch,a[b])}function hb(a){A(a,"orderable","bSortable");A(a,"orderData","aDataSort");A(a,"orderSequence","asSorting");A(a,"orderDataType","sortDataType");var b=a.aDataSort;b&&!h.isArray(b)&&(a.aDataSort=[b])}function ib(a){if(!m.__browser){var b={};m.__browser=b;var c=h("<div/>").css({position:"fixed",top:0,left:-1*h(E).scrollLeft(),height:1,width:1,overflow:"hidden"}).append(h("<div/>").css({position:"absolute",
|
||||
top:1,left:1,width:100,overflow:"scroll"}).append(h("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,m.__browser);a.oScroll.iBarWidth=m.__browser.barWidth}function jb(a,b,c,d,e,f){var g,j=!1;c!==k&&(g=c,j=!0);for(;d!==
|
||||
e;)a.hasOwnProperty(d)&&(g=j?b(g,a[d],d,a):a[d],j=!0,d+=f);return g}function Ga(a,b){var c=m.defaults.column,d=a.aoColumns.length,c=h.extend({},m.models.oColumn,c,{nTh:b?b:H.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=h.extend({},m.models.oSearch,c[d]);la(a,d,h(b).data())}function la(a,b,c){var b=a.aoColumns[b],d=a.oClasses,e=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=
|
||||
e.attr("width")||null;var f=(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(hb(c),J(m.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),h.extend(b,c),F(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),F(b,c,"aDataSort"));var g=b.mData,j=R(g),i=b.mRender?R(b.mRender):null,c=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};
|
||||
b._bAttrSrc=h.isPlainObject(g)&&(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(a,b,c){var d=j(a,b,k,c);return i&&b?i(d,b,a,c):d};b.fnSetData=function(a,b,c){return S(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=
|
||||
d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI)}function Z(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Ha(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;(""!==b.sY||""!==b.sX)&&ma(a);s(a,null,"column-sizing",[a])}function $(a,b){var c=na(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function aa(a,b){var c=na(a,"bVisible"),c=h.inArray(b,
|
||||
c);return-1!==c?c:null}function ba(a){var b=0;h.each(a.aoColumns,function(a,d){d.bVisible&&"none"!==h(d.nTh).css("display")&&b++});return b}function na(a,b){var c=[];h.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Ia(a){var b=a.aoColumns,c=a.aoData,d=m.ext.type.detect,e,f,g,j,i,h,l,q,r;e=0;for(f=b.length;e<f;e++)if(l=b[e],r=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){g=0;for(j=d.length;g<j;g++){i=0;for(h=c.length;i<h;i++){r[i]===k&&(r[i]=B(a,i,e,"type"));
|
||||
q=d[g](r[i],a);if(!q&&g!==d.length-1)break;if("html"===q)break}if(q){l.sType=q;break}}l.sType||(l.sType="string")}}function kb(a,b,c,d){var e,f,g,j,i,n,l=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){n=b[e];var q=n.targets!==k?n.targets:n.aTargets;h.isArray(q)||(q=[q]);f=0;for(g=q.length;f<g;f++)if("number"===typeof q[f]&&0<=q[f]){for(;l.length<=q[f];)Ga(a);d(q[f],n)}else if("number"===typeof q[f]&&0>q[f])d(l.length+q[f],n);else if("string"===typeof q[f]){j=0;for(i=l.length;j<i;j++)("_all"==q[f]||h(l[j].nTh).hasClass(q[f]))&&
|
||||
d(j,n)}}if(c){e=0;for(a=c.length;e<a;e++)d(e,c[e])}}function N(a,b,c,d){var e=a.aoData.length,f=h.extend(!0,{},m.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,j=0,i=g.length;j<i;j++)g[j].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==k&&(a.aIds[b]=f);(c||!a.oFeatures.bDeferRender)&&Ja(a,e,c,d);return e}function oa(a,b){var c;b instanceof h||(b=h(b));return b.map(function(b,e){c=Ka(a,e);return N(a,c.data,e,c.cells)})}function B(a,b,c,d){var e=a.iDraw,
|
||||
f=a.aoColumns[c],g=a.aoData[b]._aData,j=f.sDefaultContent,i=f.fnGetData(g,d,{settings:a,row:b,col:c});if(i===k)return a.iDrawError!=e&&null===j&&(K(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=e),j;if((i===g||null===i)&&null!==j&&d!==k)i=j;else if("function"===typeof i)return i.call(g);return null===i&&"display"==d?"":i}function lb(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d,{settings:a,row:b,col:c})}
|
||||
function La(a){return h.map(a.match(/(\\.|[^\.])+/g)||[""],function(a){return a.replace(/\\\./g,".")})}function R(a){if(h.isPlainObject(a)){var b={};h.each(a,function(a,c){c&&(b[a]=R(c))});return function(a,c,f,g){var j=b[c]||b._;return j!==k?j(a,c,f,g):a}}if(null===a)return function(a){return a};if("function"===typeof a)return function(b,c,f,g){return a(b,c,f,g)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var c=function(a,b,f){var g,j;if(""!==f){j=La(f);
|
||||
for(var i=0,n=j.length;i<n;i++){f=j[i].match(ca);g=j[i].match(V);if(f){j[i]=j[i].replace(ca,"");""!==j[i]&&(a=a[j[i]]);g=[];j.splice(0,i+1);j=j.join(".");if(h.isArray(a)){i=0;for(n=a.length;i<n;i++)g.push(c(a[i],b,j))}a=f[0].substring(1,f[0].length-1);a=""===a?g:g.join(a);break}else if(g){j[i]=j[i].replace(V,"");a=a[j[i]]();continue}if(null===a||a[j[i]]===k)return k;a=a[j[i]]}}return a};return function(b,e){return c(b,e,a)}}return function(b){return b[a]}}function S(a){if(h.isPlainObject(a))return S(a._);
|
||||
if(null===a)return function(){};if("function"===typeof a)return function(b,d,e){a(b,"set",d,e)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var b=function(a,d,e){var e=La(e),f;f=e[e.length-1];for(var g,j,i=0,n=e.length-1;i<n;i++){g=e[i].match(ca);j=e[i].match(V);if(g){e[i]=e[i].replace(ca,"");a[e[i]]=[];f=e.slice();f.splice(0,i+1);g=f.join(".");if(h.isArray(d)){j=0;for(n=d.length;j<n;j++)f={},b(f,d[j],g),a[e[i]].push(f)}else a[e[i]]=d;return}j&&(e[i]=e[i].replace(V,
|
||||
""),a=a[e[i]](d));if(null===a[e[i]]||a[e[i]]===k)a[e[i]]={};a=a[e[i]]}if(f.match(V))a[f.replace(V,"")](d);else a[f.replace(ca,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Ma(a){return D(a.aoData,"_aData")}function pa(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0;a.aIds={}}function qa(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===k&&a.splice(d,1)}function da(a,b,c,d){var e=a.aoData[b],f,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild);
|
||||
c.innerHTML=B(a,b,d,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData=Ka(a,e,d,d===k?k:e._aData).data;else{var j=e.anCells;if(j)if(d!==k)g(j[d],d);else{c=0;for(f=j.length;c<f;c++)g(j[c],c)}}e._aSortData=null;e._aFilterData=null;g=a.aoColumns;if(d!==k)g[d].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;Na(a,e)}}function Ka(a,b,c,d){var e=[],f=b.firstChild,g,j,i=0,n,l=a.aoColumns,q=a._rowReadObject,d=d!==k?d:q?{}:[],r=function(a,b){if("string"===typeof a){var c=a.indexOf("@");
|
||||
-1!==c&&(c=a.substring(c+1),S(a)(d,b.getAttribute(c)))}},m=function(a){if(c===k||c===i)j=l[i],n=h.trim(a.innerHTML),j&&j._bAttrSrc?(S(j.mData._)(d,n),r(j.mData.sort,a),r(j.mData.type,a),r(j.mData.filter,a)):q?(j._setter||(j._setter=S(j.mData)),j._setter(d,n)):d[i]=n;i++};if(f)for(;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)m(f),e.push(f);f=f.nextSibling}else{e=b.anCells;f=0;for(g=e.length;f<g;f++)m(e[f])}if(b=b.firstChild?b:b.nTr)(b=b.getAttribute("id"))&&S(a.rowId)(d,b);return{data:d,cells:e}}
|
||||
function Ja(a,b,c,d){var e=a.aoData[b],f=e._aData,g=[],j,i,n,l,q;if(null===e.nTr){j=c||H.createElement("tr");e.nTr=j;e.anCells=g;j._DT_RowIndex=b;Na(a,e);l=0;for(q=a.aoColumns.length;l<q;l++){n=a.aoColumns[l];i=c?d[l]:H.createElement(n.sCellType);i._DT_CellIndex={row:b,column:l};g.push(i);if((!c||n.mRender||n.mData!==l)&&(!h.isPlainObject(n.mData)||n.mData._!==l+".display"))i.innerHTML=B(a,b,l,"display");n.sClass&&(i.className+=" "+n.sClass);n.bVisible&&!c?j.appendChild(i):!n.bVisible&&c&&i.parentNode.removeChild(i);
|
||||
n.fnCreatedCell&&n.fnCreatedCell.call(a.oInstance,i,B(a,b,l),f,b,l)}s(a,"aoRowCreatedCallback",null,[j,f,b])}e.nTr.setAttribute("role","row")}function Na(a,b){var c=b.nTr,d=b._aData;if(c){var e=a.rowIdFn(d);e&&(c.id=e);d.DT_RowClass&&(e=d.DT_RowClass.split(" "),b.__rowc=b.__rowc?sa(b.__rowc.concat(e)):e,h(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));d.DT_RowAttr&&h(c).attr(d.DT_RowAttr);d.DT_RowData&&h(c).data(d.DT_RowData)}}function mb(a){var b,c,d,e,f,g=a.nTHead,j=a.nTFoot,i=0===
|
||||
h("th, td",g).length,n=a.oClasses,l=a.aoColumns;i&&(e=h("<tr/>").appendTo(g));b=0;for(c=l.length;b<c;b++)f=l[b],d=h(f.nTh).addClass(f.sClass),i&&d.appendTo(e),a.oFeatures.bSort&&(d.addClass(f.sSortingClass),!1!==f.bSortable&&(d.attr("tabindex",a.iTabIndex).attr("aria-controls",a.sTableId),Oa(a,f.nTh,b))),f.sTitle!=d[0].innerHTML&&d.html(f.sTitle),Pa(a,"header")(a,d,f,n);i&&ea(a.aoHeader,g);h(g).find(">tr").attr("role","row");h(g).find(">tr>th, >tr>td").addClass(n.sHeaderTH);h(j).find(">tr>th, >tr>td").addClass(n.sFooterTH);
|
||||
if(null!==j){a=a.aoFooter[0];b=0;for(c=a.length;b<c;b++)f=l[b],f.nTf=a[b].cell,f.sClass&&h(f.nTf).addClass(f.sClass)}}function fa(a,b,c){var d,e,f,g=[],j=[],i=a.aoColumns.length,n;if(b){c===k&&(c=!1);d=0;for(e=b.length;d<e;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=i-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);j.push([])}d=0;for(e=g.length;d<e;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(n=i=1,j[d][f]===k){a.appendChild(g[d][f].cell);
|
||||
for(j[d][f]=1;g[d+i]!==k&&g[d][f].cell==g[d+i][f].cell;)j[d+i][f]=1,i++;for(;g[d][f+n]!==k&&g[d][f].cell==g[d][f+n].cell;){for(c=0;c<i;c++)j[d+c][f+n]=1;n++}h(g[d][f].cell).attr("rowspan",i).attr("colspan",n)}}}}function O(a){var b=s(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))C(a,!1);else{var b=[],c=0,d=a.asStripeClasses,e=d.length,f=a.oLanguage,g=a.iInitDisplayStart,j="ssp"==y(a),i=a.aiDisplay;a.bDrawing=!0;g!==k&&-1!==g&&(a._iDisplayStart=j?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=
|
||||
-1);var g=a._iDisplayStart,n=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(j){if(!a.bDestroying&&!nb(a))return}else a.iDraw++;if(0!==i.length){f=j?a.aoData.length:n;for(j=j?0:g;j<f;j++){var l=i[j],q=a.aoData[l];null===q.nTr&&Ja(a,l);l=q.nTr;if(0!==e){var r=d[c%e];q._sRowStripe!=r&&(h(l).removeClass(q._sRowStripe).addClass(r),q._sRowStripe=r)}s(a,"aoRowCallback",null,[l,q._aData,c,j]);b.push(l);c++}}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==y(a)?c=f.sLoadingRecords:
|
||||
f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=h("<tr/>",{"class":e?d[0]:""}).append(h("<td />",{valign:"top",colSpan:ba(a),"class":a.oClasses.sRowEmpty}).html(c))[0];s(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Ma(a),g,n,i]);s(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],Ma(a),g,n,i]);d=h(a.nTBody);d.children().detach();d.append(h(b));s(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function T(a,b){var c=a.oFeatures,d=c.bFilter;
|
||||
c.bSort&&ob(a);d?ga(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;O(a);a._drawHold=!1}function pb(a){var b=a.oClasses,c=h(a.nTable),c=h("<div/>").insertBefore(c),d=a.oFeatures,e=h("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),g,j,i,n,l,q,k=0;k<f.length;k++){g=null;j=f[k];if("<"==j){i=h("<div/>")[0];
|
||||
n=f[k+1];if("'"==n||'"'==n){l="";for(q=2;f[k+q]!=n;)l+=f[k+q],q++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(n=l.split("."),i.id=n[0].substr(1,n[0].length-1),i.className=n[1]):"#"==l.charAt(0)?i.id=l.substr(1,l.length-1):i.className=l;k+=q}e.append(i);e=h(i)}else if(">"==j)e=e.parent();else if("l"==j&&d.bPaginate&&d.bLengthChange)g=qb(a);else if("f"==j&&d.bFilter)g=rb(a);else if("r"==j&&d.bProcessing)g=sb(a);else if("t"==j)g=tb(a);else if("i"==j&&d.bInfo)g=ub(a);else if("p"==
|
||||
j&&d.bPaginate)g=vb(a);else if(0!==m.ext.feature.length){i=m.ext.feature;q=0;for(n=i.length;q<n;q++)if(j==i[q].cFeature){g=i[q].fnInit(a);break}}g&&(i=a.aanFeatures,i[j]||(i[j]=[]),i[j].push(g),e.append(g))}c.replaceWith(e);a.nHolding=null}function ea(a,b){var c=h(b).children("tr"),d,e,f,g,j,i,n,l,q,k;a.splice(0,a.length);f=0;for(i=c.length;f<i;f++)a.push([]);f=0;for(i=c.length;f<i;f++){d=c[f];for(e=d.firstChild;e;){if("TD"==e.nodeName.toUpperCase()||"TH"==e.nodeName.toUpperCase()){l=1*e.getAttribute("colspan");
|
||||
q=1*e.getAttribute("rowspan");l=!l||0===l||1===l?1:l;q=!q||0===q||1===q?1:q;g=0;for(j=a[f];j[g];)g++;n=g;k=1===l?!0:!1;for(j=0;j<l;j++)for(g=0;g<q;g++)a[f+g][n+j]={cell:e,unique:k},a[f+g].nTr=d}e=e.nextSibling}}}function ta(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],ea(c,b)));for(var b=0,e=c.length;b<e;b++)for(var f=0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function ua(a,b,c){s(a,"aoServerParams","serverParams",[b]);if(b&&h.isArray(b)){var d={},
|
||||
e=/(.*?)\[\]$/;h.each(b,function(a,b){var c=b.name.match(e);c?(c=c[0],d[c]||(d[c]=[]),d[c].push(b.value)):d[b.name]=b.value});b=d}var f,g=a.ajax,j=a.oInstance,i=function(b){s(a,null,"xhr",[a,b,a.jqXHR]);c(b)};if(h.isPlainObject(g)&&g.data){f=g.data;var n=h.isFunction(f)?f(b,a):f,b=h.isFunction(f)&&n?n:h.extend(!0,b,n);delete g.data}n={data:b,success:function(b){var c=b.error||b.sError;c&&K(a,0,c);a.json=b;i(b)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(b,c){var d=s(a,null,"xhr",
|
||||
[a,null,a.jqXHR]);-1===h.inArray(!0,d)&&("parsererror"==c?K(a,0,"Invalid JSON response",1):4===b.readyState&&K(a,0,"Ajax error",7));C(a,!1)}};a.oAjaxData=b;s(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(j,a.sAjaxSource,h.map(b,function(a,b){return{name:b,value:a}}),i,a):a.sAjaxSource||"string"===typeof g?a.jqXHR=h.ajax(h.extend(n,{url:g||a.sAjaxSource})):h.isFunction(g)?a.jqXHR=g.call(j,b,i,a):(a.jqXHR=h.ajax(h.extend(n,g)),g.data=f)}function nb(a){return a.bAjaxDataGet?(a.iDraw++,C(a,
|
||||
!0),ua(a,wb(a),function(b){xb(a,b)}),!1):!0}function wb(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g,j=[],i,n,l,k=W(a);g=a._iDisplayStart;i=!1!==d.bPaginate?a._iDisplayLength:-1;var r=function(a,b){j.push({name:a,value:b})};r("sEcho",a.iDraw);r("iColumns",c);r("sColumns",D(b,"sName").join(","));r("iDisplayStart",g);r("iDisplayLength",i);var ra={draw:a.iDraw,columns:[],order:[],start:g,length:i,search:{value:e.sSearch,regex:e.bRegex}};for(g=0;g<c;g++)n=b[g],
|
||||
l=f[g],i="function"==typeof n.mData?"function":n.mData,ra.columns.push({data:i,name:n.sName,searchable:n.bSearchable,orderable:n.bSortable,search:{value:l.sSearch,regex:l.bRegex}}),r("mDataProp_"+g,i),d.bFilter&&(r("sSearch_"+g,l.sSearch),r("bRegex_"+g,l.bRegex),r("bSearchable_"+g,n.bSearchable)),d.bSort&&r("bSortable_"+g,n.bSortable);d.bFilter&&(r("sSearch",e.sSearch),r("bRegex",e.bRegex));d.bSort&&(h.each(k,function(a,b){ra.order.push({column:b.col,dir:b.dir});r("iSortCol_"+a,b.col);r("sSortDir_"+
|
||||
a,b.dir)}),r("iSortingCols",k.length));b=m.ext.legacy.ajax;return null===b?a.sAjaxSource?j:ra:b?j:ra}function xb(a,b){var c=va(a,b),d=b.sEcho!==k?b.sEcho:b.draw,e=b.iTotalRecords!==k?b.iTotalRecords:b.recordsTotal,f=b.iTotalDisplayRecords!==k?b.iTotalDisplayRecords:b.recordsFiltered;if(d){if(1*d<a.iDraw)return;a.iDraw=1*d}pa(a);a._iRecordsTotal=parseInt(e,10);a._iRecordsDisplay=parseInt(f,10);d=0;for(e=c.length;d<e;d++)N(a,c[d]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;O(a);a._bInitComplete||
|
||||
wa(a,b);a.bAjaxDataGet=!0;C(a,!1)}function va(a,b){var c=h.isPlainObject(a.ajax)&&a.ajax.dataSrc!==k?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===c?b.aaData||b[c]:""!==c?R(c)(b):b}function rb(a){var b=a.oClasses,c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,f=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',j=d.sSearch,j=j.match(/_INPUT_/)?j.replace("_INPUT_",g):j+g,b=h("<div/>",{id:!f.f?c+"_filter":null,"class":b.sFilter}).append(h("<label/>").append(j)),f=function(){var b=!this.value?
|
||||
"":this.value;b!=e.sSearch&&(ga(a,{sSearch:b,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,O(a))},g=null!==a.searchDelay?a.searchDelay:"ssp"===y(a)?400:0,i=h("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",g?Qa(f,g):f).on("keypress.DT",function(a){if(13==a.keyCode)return!1}).attr("aria-controls",c);h(a.nTable).on("search.dt.DT",function(b,c){if(a===c)try{i[0]!==H.activeElement&&i.val(e.sSearch)}catch(d){}});
|
||||
return b[0]}function ga(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};Ia(a);if("ssp"!=y(a)){yb(a,b.sSearch,c,b.bEscapeRegex!==k?!b.bEscapeRegex:b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)zb(a,e[b].sSearch,b,e[b].bEscapeRegex!==k?!e[b].bEscapeRegex:e[b].bRegex,e[b].bSmart,e[b].bCaseInsensitive);Ab(a)}else f(b);a.bFiltered=!0;s(a,null,"search",[a])}function Ab(a){for(var b=
|
||||
m.ext.search,c=a.aiDisplay,d,e,f=0,g=b.length;f<g;f++){for(var j=[],i=0,n=c.length;i<n;i++)e=c[i],d=a.aoData[e],b[f](a,d._aFilterData,e,d._aData,i)&&j.push(e);c.length=0;h.merge(c,j)}}function zb(a,b,c,d,e,f){if(""!==b){for(var g=[],j=a.aiDisplay,d=Ra(b,d,e,f),e=0;e<j.length;e++)b=a.aoData[j[e]]._aFilterData[c],d.test(b)&&g.push(j[e]);a.aiDisplay=g}}function yb(a,b,c,d,e,f){var d=Ra(b,d,e,f),f=a.oPreviousSearch.sSearch,g=a.aiDisplayMaster,j,e=[];0!==m.ext.search.length&&(c=!0);j=Bb(a);if(0>=b.length)a.aiDisplay=
|
||||
g.slice();else{if(j||c||f.length>b.length||0!==b.indexOf(f)||a.bSorted)a.aiDisplay=g.slice();b=a.aiDisplay;for(c=0;c<b.length;c++)d.test(a.aoData[b[c]]._sFilterRow)&&e.push(b[c]);a.aiDisplay=e}}function Ra(a,b,c,d){a=b?a:Sa(a);c&&(a="^(?=.*?"+h.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(a){if('"'===a.charAt(0))var b=a.match(/^"(.*)"$/),a=b?b[1]:a;return a.replace('"',"")}).join(")(?=.*?")+").*$");return RegExp(a,d?"i":"")}function Bb(a){var b=a.aoColumns,c,d,e,f,g,j,i,h,l=m.ext.type.search;c=!1;
|
||||
d=0;for(f=a.aoData.length;d<f;d++)if(h=a.aoData[d],!h._aFilterData){j=[];e=0;for(g=b.length;e<g;e++)c=b[e],c.bSearchable?(i=B(a,d,e,"filter"),l[c.sType]&&(i=l[c.sType](i)),null===i&&(i=""),"string"!==typeof i&&i.toString&&(i=i.toString())):i="",i.indexOf&&-1!==i.indexOf("&")&&(xa.innerHTML=i,i=$b?xa.textContent:xa.innerText),i.replace&&(i=i.replace(/[\r\n]/g,"")),j.push(i);h._aFilterData=j;h._sFilterRow=j.join(" ");c=!0}return c}function Cb(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,
|
||||
caseInsensitive:a.bCaseInsensitive}}function Db(a){return{sSearch:a.search,bSmart:a.smart,bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function ub(a){var b=a.sTableId,c=a.aanFeatures.i,d=h("<div/>",{"class":a.oClasses.sInfo,id:!c?b+"_info":null});c||(a.aoDrawCallback.push({fn:Eb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),h(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function Eb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+
|
||||
1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),j=g?c.sInfo:c.sInfoEmpty;g!==f&&(j+=" "+c.sInfoFiltered);j+=c.sInfoPostFix;j=Fb(a,j);c=c.fnInfoCallback;null!==c&&(j=c.call(a.oInstance,a,d,e,f,g,j));h(b).html(j)}}function Fb(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,
|
||||
f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/e)))}function ha(a){var b,c,d=a.iInitDisplayStart,e=a.aoColumns,f;c=a.oFeatures;var g=a.bDeferLoading;if(a.bInitialised){pb(a);mb(a);fa(a,a.aoHeader);fa(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Ha(a);b=0;for(c=e.length;b<c;b++)f=e[b],f.sWidth&&(f.nTh.style.width=v(f.sWidth));s(a,null,"preInit",[a]);T(a);e=y(a);if("ssp"!=e||g)"ajax"==e?ua(a,[],function(c){var f=va(a,c);for(b=0;b<f.length;b++)N(a,f[b]);a.iInitDisplayStart=
|
||||
d;T(a);C(a,!1);wa(a,c)},a):(C(a,!1),wa(a))}else setTimeout(function(){ha(a)},200)}function wa(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&Z(a);s(a,null,"plugin-init",[a,b]);s(a,"aoInitComplete","init",[a,b])}function Ta(a,b){var c=parseInt(b,10);a._iDisplayLength=c;Ua(a);s(a,null,"length",[a,c])}function qb(a){for(var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=h.isArray(d[0]),f=e?d[0]:d,d=e?d[1]:d,e=h("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect}),g=0,j=f.length;g<j;g++)e[0][g]=
|
||||
new Option(d[g],f[g]);var i=h("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(i[0].id=c+"_length");i.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));h("select",i).val(a._iDisplayLength).on("change.DT",function(){Ta(a,h(this).val());O(a)});h(a.nTable).on("length.dt.DT",function(b,c,d){a===c&&h("select",i).val(d)});return i[0]}function vb(a){var b=a.sPaginationType,c=m.ext.pager[b],d="function"===typeof c,e=function(a){O(a)},b=h("<div/>").addClass(a.oClasses.sPaging+
|
||||
b)[0],f=a.aanFeatures;d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,i=a._iDisplayLength,h=a.fnRecordsDisplay(),l=-1===i,b=l?0:Math.ceil(b/i),i=l?1:Math.ceil(h/i),h=c(b,i),k,l=0;for(k=f.p.length;l<k;l++)Pa(a,"pageButton")(a,f.p[l],l,h,b,i)}else c.fnUpdate(a,e)},sName:"pagination"}));return b}function Va(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===e?d=0:"number"===typeof b?(d=b*e,d>f&&
|
||||
(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:K(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(s(a,null,"page",[a]),c&&O(a));return b}function sb(a){return h("<div/>",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css("display",b?"block":"none");
|
||||
s(a,null,"processing",[a,b])}function tb(a){var b=h(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),j=g.length?g[0]._captionSide:null,i=h(b[0].cloneNode(!1)),n=h(b[0].cloneNode(!1)),l=b.children("tfoot");l.length||(l=null);i=h("<div/>",{"class":f.sScrollWrapper}).append(h("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?!d?null:v(d):"100%"}).append(h("<div/>",
|
||||
{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",width:c.sXInner||"100%"}).append(i.removeAttr("id").css("margin-left",0).append("top"===j?g:null).append(b.children("thead"))))).append(h("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:v(d)}).append(b));l&&i.append(h("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:v(d):"100%"}).append(h("<div/>",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",
|
||||
0).append("bottom"===j?g:null).append(b.children("tfoot")))));var b=i.children(),k=b[0],f=b[1],r=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(r.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=r;a.aoDrawCallback.push({fn:ma,sName:"scrolling"});return i[0]}function ma(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,f=h(a.nScrollHead),g=f[0].style,j=f.children("div"),i=j[0].style,n=j.children("table"),
|
||||
j=a.nScrollBody,l=h(j),q=j.style,r=h(a.nScrollFoot).children("div"),m=r.children("table"),p=h(a.nTHead),o=h(a.nTable),u=o[0],s=u.style,t=a.nTFoot?h(a.nTFoot):null,x=a.oBrowser,U=x.bScrollOversize,ac=D(a.aoColumns,"nTh"),P,L,Q,w,Wa=[],y=[],z=[],A=[],B,C=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};L=j.scrollHeight>j.clientHeight;if(a.scrollBarVis!==L&&a.scrollBarVis!==k)a.scrollBarVis=L,Z(a);else{a.scrollBarVis=L;o.children("thead, tfoot").remove();
|
||||
t&&(Q=t.clone().prependTo(o),P=t.find("tr"),Q=Q.find("tr"));w=p.clone().prependTo(o);p=p.find("tr");L=w.find("tr");w.find("th, td").removeAttr("tabindex");c||(q.width="100%",f[0].style.width="100%");h.each(ta(a,w),function(b,c){B=$(a,b);c.style.width=a.aoColumns[B].sWidth});t&&I(function(a){a.style.width=""},Q);f=o.outerWidth();if(""===c){s.width="100%";if(U&&(o.find("tbody").height()>j.offsetHeight||"scroll"==l.css("overflow-y")))s.width=v(o.outerWidth()-b);f=o.outerWidth()}else""!==d&&(s.width=
|
||||
v(d),f=o.outerWidth());I(C,L);I(function(a){z.push(a.innerHTML);Wa.push(v(h(a).css("width")))},L);I(function(a,b){if(h.inArray(a,ac)!==-1)a.style.width=Wa[b]},p);h(L).height(0);t&&(I(C,Q),I(function(a){A.push(a.innerHTML);y.push(v(h(a).css("width")))},Q),I(function(a,b){a.style.width=y[b]},P),h(Q).height(0));I(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+z[b]+"</div>";a.style.width=Wa[b]},L);t&&I(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+
|
||||
A[b]+"</div>";a.style.width=y[b]},Q);if(o.outerWidth()<f){P=j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(U&&(j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")))s.width=v(P-b);(""===c||""!==d)&&K(a,1,"Possible column misalignment",6)}else P="100%";q.width=v(P);g.width=v(P);t&&(a.nScrollFoot.style.width=v(P));!e&&U&&(q.height=v(u.offsetHeight+b));c=o.outerWidth();n[0].style.width=v(c);i.width=v(c);d=o.height()>j.clientHeight||"scroll"==l.css("overflow-y");e="padding"+
|
||||
(x.bScrollbarLeft?"Left":"Right");i[e]=d?b+"px":"0px";t&&(m[0].style.width=v(c),r[0].style.width=v(c),r[0].style[e]=d?b+"px":"0px");o.children("colgroup").insertBefore(o.children("thead"));l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=0}}function I(a,b,c){for(var d=0,e=0,f=b.length,g,j;e<f;){g=b[e].firstChild;for(j=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,j,d):a(g,d),d++),g=g.nextSibling,j=c?j.nextSibling:null;e++}}function Ha(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,
|
||||
e=d.sY,f=d.sX,g=d.sXInner,j=c.length,i=na(a,"bVisible"),n=h("th",a.nTHead),l=b.getAttribute("width"),k=b.parentNode,r=!1,m,p,o=a.oBrowser,d=o.bScrollOversize;(m=b.style.width)&&-1!==m.indexOf("%")&&(l=m);for(m=0;m<i.length;m++)p=c[i[m]],null!==p.sWidth&&(p.sWidth=Gb(p.sWidthOrig,k),r=!0);if(d||!r&&!f&&!e&&j==ba(a)&&j==n.length)for(m=0;m<j;m++)i=$(a,m),null!==i&&(c[i].sWidth=v(n.eq(m).width()));else{j=h(b).clone().css("visibility","hidden").removeAttr("id");j.find("tbody tr").remove();var u=h("<tr/>").appendTo(j.find("tbody"));
|
||||
j.find("thead, tfoot").remove();j.append(h(a.nTHead).clone()).append(h(a.nTFoot).clone());j.find("tfoot th, tfoot td").css("width","");n=ta(a,j.find("thead")[0]);for(m=0;m<i.length;m++)p=c[i[m]],n[m].style.width=null!==p.sWidthOrig&&""!==p.sWidthOrig?v(p.sWidthOrig):"",p.sWidthOrig&&f&&h(n[m]).append(h("<div/>").css({width:p.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(m=0;m<i.length;m++)r=i[m],p=c[r],h(Hb(a,r)).clone(!1).append(p.sContentPadding).appendTo(u);h("[name]",
|
||||
j).removeAttr("name");p=h("<div/>").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(j).appendTo(k);f&&g?j.width(g):f?(j.css("width","auto"),j.removeAttr("width"),j.width()<k.clientWidth&&l&&j.width(k.clientWidth)):e?j.width(k.clientWidth):l&&j.width(l);for(m=e=0;m<i.length;m++)k=h(n[m]),g=k.outerWidth()-k.width(),k=o.bBounding?Math.ceil(n[m].getBoundingClientRect().width):k.outerWidth(),e+=k,c[i[m]].sWidth=v(k-g);b.style.width=v(e);p.remove()}l&&(b.style.width=
|
||||
v(l));if((l||f)&&!a._reszEvt)b=function(){h(E).on("resize.DT-"+a.sInstance,Qa(function(){Z(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0}function Gb(a,b){if(!a)return 0;var c=h("<div/>").css("width",v(a)).appendTo(b||H.body),d=c[0].offsetWidth;c.remove();return d}function Hb(a,b){var c=Ib(a,b);if(0>c)return null;var d=a.aoData[c];return!d.nTr?h("<td/>").html(B(a,c,b,"display"))[0]:d.anCells[b]}function Ib(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;f<g;f++)c=B(a,f,b,"display")+"",c=c.replace(bc,
|
||||
""),c=c.replace(/ /g," "),c.length>d&&(d=c.length,e=f);return e}function v(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function W(a){var b,c,d=[],e=a.aoColumns,f,g,j,i;b=a.aaSortingFixed;c=h.isPlainObject(b);var n=[];f=function(a){a.length&&!h.isArray(a[0])?n.push(a):h.merge(n,a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a<n.length;a++){i=n[a][0];f=e[i].aDataSort;b=0;for(c=f.length;b<c;b++)g=f[b],j=e[g].sType||
|
||||
"string",n[a]._idx===k&&(n[a]._idx=h.inArray(n[a][1],e[g].asSorting)),d.push({src:i,col:g,dir:n[a][1],index:n[a]._idx,type:j,formatter:m.ext.type.order[j+"-pre"]})}return d}function ob(a){var b,c,d=[],e=m.ext.type.order,f=a.aoData,g=0,j,i=a.aiDisplayMaster,h;Ia(a);h=W(a);b=0;for(c=h.length;b<c;b++)j=h[b],j.formatter&&g++,Jb(a,j.col);if("ssp"!=y(a)&&0!==h.length){b=0;for(c=i.length;b<c;b++)d[i[b]]=b;g===h.length?i.sort(function(a,b){var c,e,g,j,i=h.length,k=f[a]._aSortData,m=f[b]._aSortData;for(g=
|
||||
0;g<i;g++)if(j=h[g],c=k[j.col],e=m[j.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===j.dir?c:-c;c=d[a];e=d[b];return c<e?-1:c>e?1:0}):i.sort(function(a,b){var c,g,j,i,k=h.length,m=f[a]._aSortData,p=f[b]._aSortData;for(j=0;j<k;j++)if(i=h[j],c=m[i.col],g=p[i.col],i=e[i.type+"-"+i.dir]||e["string-"+i.dir],c=i(c,g),0!==c)return c;c=d[a];g=d[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Kb(a){for(var b,c,d=a.aoColumns,e=W(a),a=a.oLanguage.oAria,f=0,g=d.length;f<g;f++){c=d[f];var j=c.asSorting;b=c.sTitle.replace(/<.*?>/g,
|
||||
"");var i=c.nTh;i.removeAttribute("aria-sort");c.bSortable&&(0<e.length&&e[0].col==f?(i.setAttribute("aria-sort","asc"==e[0].dir?"ascending":"descending"),c=j[e[0].index+1]||j[0]):c=j[0],b+="asc"===c?a.sSortAscending:a.sSortDescending);i.setAttribute("aria-label",b)}}function Xa(a,b,c,d){var e=a.aaSorting,f=a.aoColumns[b].asSorting,g=function(a,b){var c=a._idx;c===k&&(c=h.inArray(a[1],f));return c+1<f.length?c+1:b?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=h.inArray(b,
|
||||
D(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=f[b],e[c]._idx=b)):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=f[b],e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);T(a);"function"==typeof d&&d(a)}function Oa(a,b,c,d){var e=a.aoColumns[c];Ya(b,{},function(b){!1!==e.bSortable&&(a.oFeatures.bProcessing?(C(a,!0),setTimeout(function(){Xa(a,c,b.shiftKey,d);"ssp"!==y(a)&&C(a,!1)},0)):Xa(a,c,b.shiftKey,d))})}
|
||||
function ya(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=W(a),e=a.oFeatures,f,g;if(e.bSort&&e.bSortClasses){e=0;for(f=b.length;e<f;e++)g=b[e].src,h(D(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3));e=0;for(f=d.length;e<f;e++)g=d[e].src,h(D(a.aoData,"anCells",g)).addClass(c+(2>e?e+1:3))}a.aLastSort=d}function Jb(a,b){var c=a.aoColumns[b],d=m.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,aa(a,b)));for(var f,g=m.ext.type.order[c.sType+"-pre"],j=0,i=a.aoData.length;j<i;j++)if(c=a.aoData[j],
|
||||
c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[j]:B(a,j,b,"sort"),c._aSortData[b]=g?g(f):f}function za(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:h.extend(!0,[],a.aaSorting),search:Cb(a.oPreviousSearch),columns:h.map(a.aoColumns,function(b,d){return{visible:b.bVisible,search:Cb(a.aoPreSearchCols[d])}})};s(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,
|
||||
b)}}function Lb(a,b,c){var d,e,f=a.aoColumns,b=function(b){if(b&&b.time){var i=s(a,"aoStateLoadParams","stateLoadParams",[a,g]);if(-1===h.inArray(!1,i)&&(i=a.iStateDuration,!(0<i&&b.time<+new Date-1E3*i)&&!(b.columns&&f.length!==b.columns.length))){a.oLoadedState=h.extend(!0,{},g);b.start!==k&&(a._iDisplayStart=b.start,a.iInitDisplayStart=b.start);b.length!==k&&(a._iDisplayLength=b.length);b.order!==k&&(a.aaSorting=[],h.each(b.order,function(b,c){a.aaSorting.push(c[0]>=f.length?[0,c[1]]:c)}));b.search!==
|
||||
k&&h.extend(a.oPreviousSearch,Db(b.search));if(b.columns){d=0;for(e=b.columns.length;d<e;d++)i=b.columns[d],i.visible!==k&&(f[d].bVisible=i.visible),i.search!==k&&h.extend(a.aoPreSearchCols[d],Db(i.search))}s(a,"aoStateLoaded","stateLoaded",[a,g])}}c()};if(a.oFeatures.bStateSave){var g=a.fnStateLoadCallback.call(a.oInstance,a,b);g!==k&&b(g)}else c()}function Aa(a){var b=m.settings,a=h.inArray(a,D(b,"nTable"));return-1!==a?b[a]:null}function K(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+
|
||||
" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)E.console&&console.log&&console.log(c);else if(b=m.ext,b=b.sErrMode||b.errMode,a&&s(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&b(a,d,c)}}function F(a,b,c,d){h.isArray(c)?h.each(c,function(c,d){h.isArray(d)?F(a,b,d[0],d[1]):F(a,b,d)}):(d===k&&(d=c),b[c]!==k&&(a[d]=b[c]))}function Mb(a,b,c){var d,e;for(e in b)b.hasOwnProperty(e)&&(d=b[e],
|
||||
h.isPlainObject(d)?(h.isPlainObject(a[e])||(a[e]={}),h.extend(!0,a[e],d)):a[e]=c&&"data"!==e&&"aaData"!==e&&h.isArray(d)?d.slice():d);return a}function Ya(a,b,c){h(a).on("click.DT",b,function(b){a.blur();c(b)}).on("keypress.DT",b,function(a){13===a.which&&(a.preventDefault(),c(a))}).on("selectstart.DT",function(){return!1})}function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function s(a,b,c,d){var e=[];b&&(e=h.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,d)}));null!==c&&(b=h.Event(c+
|
||||
".dt"),h(a.nTable).trigger(b,d),e.push(b.result));return e}function Ua(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Pa(a,b){var c=a.renderer,d=m.ext.renderer[b];return h.isPlainObject(c)&&c[b]?d[c[b]]||d._:"string"===typeof c?d[c]||d._:d._}function y(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function ia(a,b){var c=[],c=Nb.numbers_length,d=Math.floor(c/2);b<=c?c=X(0,b):a<=d?(c=X(0,
|
||||
c-2),c.push("ellipsis"),c.push(b-1)):(a>=b-1-d?c=X(b-(c-2),b):(c=X(a-d+2,a+d-1),c.push("ellipsis"),c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function fb(a){h.each({num:function(b){return Ba(b,a)},"num-fmt":function(b){return Ba(b,a,Za)},"html-num":function(b){return Ba(b,a,Ca)},"html-num-fmt":function(b){return Ba(b,a,Ca,Za)}},function(b,c){x.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(x.type.search[b+a]=x.type.search.html)})}function Ob(a){return function(){var b=
|
||||
[Aa(this[m.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return m.ext.internal[a].apply(this,b)}}var m=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new u(Aa(this[x.iApiIndex])):new u(this)};this.fnAddData=function(a,b){var c=this.api(!0),d=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===k||b)&&c.draw();return d.flatten().toArray()};this.fnAdjustColumnSizing=
|
||||
function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===k||a?b.draw(!1):(""!==d.sX||""!==d.sY)&&ma(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var d=this.api(!0),a=d.rows(a),e=a.settings()[0],h=e.aoData[a[0][0]];a.remove();b&&b.call(this,e,h);(c===k||c)&&d.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};
|
||||
this.fnFilter=function(a,b,c,d,e,h){e=this.api(!0);null===b||b===k?e.search(a,c,d,h):e.column(b).search(a,c,d,h);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==k||"td"==d||"th"==d?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();
|
||||
return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(),[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===k||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return Aa(this[x.iApiIndex])};
|
||||
this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(e===k||e)&&h.columns.adjust();(d===k||d)&&h.draw();return 0};this.fnVersionCheck=x.fnVersionCheck;var b=this,c=a===k,d=this.length;c&&(a={});this.oApi=this.internal=x.internal;for(var e in m.ext.internal)e&&(this[e]=Ob(e));this.each(function(){var e={},g=1<d?Mb(e,a,!0):
|
||||
a,j=0,i,e=this.getAttribute("id"),n=!1,l=m.defaults,q=h(this);if("table"!=this.nodeName.toLowerCase())K(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{gb(l);hb(l.column);J(l,l,!0);J(l.column,l.column,!0);J(l,h.extend(g,q.data()));var r=m.settings,j=0;for(i=r.length;j<i;j++){var p=r[j];if(p.nTable==this||p.nTHead.parentNode==this||p.nTFoot&&p.nTFoot.parentNode==this){var u=g.bRetrieve!==k?g.bRetrieve:l.bRetrieve;if(c||u)return p.oInstance;if(g.bDestroy!==k?g.bDestroy:l.bDestroy){p.oInstance.fnDestroy();
|
||||
break}else{K(p,0,"Cannot reinitialise DataTable",3);return}}if(p.sTableId==this.id){r.splice(j,1);break}}if(null===e||""===e)this.id=e="DataTables_Table_"+m.ext._unique++;var o=h.extend(!0,{},m.models.oSettings,{sDestroyWidth:q[0].style.width,sInstance:e,sTableId:e});o.nTable=this;o.oApi=b.internal;o.oInit=g;r.push(o);o.oInstance=1===b.length?b:q.dataTable();gb(g);g.oLanguage&&Fa(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=h.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);
|
||||
g=Mb(h.extend(!0,{},l),g);F(o.oFeatures,g,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));F(o,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],
|
||||
["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]);F(o.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);F(o.oLanguage,g,"fnInfoCallback");z(o,"aoDrawCallback",g.fnDrawCallback,"user");z(o,"aoServerParams",g.fnServerParams,"user");z(o,"aoStateSaveParams",g.fnStateSaveParams,"user");z(o,"aoStateLoadParams",g.fnStateLoadParams,"user");z(o,"aoStateLoaded",g.fnStateLoaded,
|
||||
"user");z(o,"aoRowCallback",g.fnRowCallback,"user");z(o,"aoRowCreatedCallback",g.fnCreatedRow,"user");z(o,"aoHeaderCallback",g.fnHeaderCallback,"user");z(o,"aoFooterCallback",g.fnFooterCallback,"user");z(o,"aoInitComplete",g.fnInitComplete,"user");z(o,"aoPreDrawCallback",g.fnPreDrawCallback,"user");o.rowIdFn=R(g.rowId);ib(o);var t=o.oClasses;g.bJQueryUI?(h.extend(t,m.ext.oJUIClasses,g.oClasses),g.sDom===l.sDom&&"lfrtip"===l.sDom&&(o.sDom='<"H"lfr>t<"F"ip>'),o.renderer)?h.isPlainObject(o.renderer)&&
|
||||
!o.renderer.header&&(o.renderer.header="jqueryui"):o.renderer="jqueryui":h.extend(t,m.ext.classes,g.oClasses);q.addClass(t.sTable);o.iInitDisplayStart===k&&(o.iInitDisplayStart=g.iDisplayStart,o._iDisplayStart=g.iDisplayStart);null!==g.iDeferLoading&&(o.bDeferLoading=!0,e=h.isArray(g.iDeferLoading),o._iRecordsDisplay=e?g.iDeferLoading[0]:g.iDeferLoading,o._iRecordsTotal=e?g.iDeferLoading[1]:g.iDeferLoading);var v=o.oLanguage;h.extend(!0,v,g.oLanguage);v.sUrl&&(h.ajax({dataType:"json",url:v.sUrl,success:function(a){Fa(a);
|
||||
J(l.oLanguage,a);h.extend(true,v,a);ha(o)},error:function(){ha(o)}}),n=!0);null===g.asStripeClasses&&(o.asStripeClasses=[t.sStripeOdd,t.sStripeEven]);var e=o.asStripeClasses,x=q.children("tbody").find("tr").eq(0);-1!==h.inArray(!0,h.map(e,function(a){return x.hasClass(a)}))&&(h("tbody tr",this).removeClass(e.join(" ")),o.asDestroyStripes=e.slice());e=[];r=this.getElementsByTagName("thead");0!==r.length&&(ea(o.aoHeader,r[0]),e=ta(o));if(null===g.aoColumns){r=[];j=0;for(i=e.length;j<i;j++)r.push(null)}else r=
|
||||
g.aoColumns;j=0;for(i=r.length;j<i;j++)Ga(o,e?e[j]:null);kb(o,g.aoColumnDefs,r,function(a,b){la(o,a,b)});if(x.length){var w=function(a,b){return a.getAttribute("data-"+b)!==null?b:null};h(x[0]).children("th, td").each(function(a,b){var c=o.aoColumns[a];if(c.mData===a){var d=w(b,"sort")||w(b,"order"),e=w(b,"filter")||w(b,"search");if(d!==null||e!==null){c.mData={_:a+".display",sort:d!==null?a+".@data-"+d:k,type:d!==null?a+".@data-"+d:k,filter:e!==null?a+".@data-"+e:k};la(o,a)}}})}var U=o.oFeatures,
|
||||
e=function(){if(g.aaSorting===k){var a=o.aaSorting;j=0;for(i=a.length;j<i;j++)a[j][1]=o.aoColumns[j].asSorting[0]}ya(o);U.bSort&&z(o,"aoDrawCallback",function(){if(o.bSorted){var a=W(o),b={};h.each(a,function(a,c){b[c.src]=c.dir});s(o,null,"order",[o,a,b]);Kb(o)}});z(o,"aoDrawCallback",function(){(o.bSorted||y(o)==="ssp"||U.bDeferRender)&&ya(o)},"sc");var a=q.children("caption").each(function(){this._captionSide=h(this).css("caption-side")}),b=q.children("thead");b.length===0&&(b=h("<thead/>").appendTo(q));
|
||||
o.nTHead=b[0];b=q.children("tbody");b.length===0&&(b=h("<tbody/>").appendTo(q));o.nTBody=b[0];b=q.children("tfoot");if(b.length===0&&a.length>0&&(o.oScroll.sX!==""||o.oScroll.sY!==""))b=h("<tfoot/>").appendTo(q);if(b.length===0||b.children().length===0)q.addClass(t.sNoFooter);else if(b.length>0){o.nTFoot=b[0];ea(o.aoFooter,o.nTFoot)}if(g.aaData)for(j=0;j<g.aaData.length;j++)N(o,g.aaData[j]);else(o.bDeferLoading||y(o)=="dom")&&oa(o,h(o.nTBody).children("tr"));o.aiDisplay=o.aiDisplayMaster.slice();
|
||||
o.bInitialised=true;n===false&&ha(o)};g.bStateSave?(U.bStateSave=!0,z(o,"aoDrawCallback",za,"state_save"),Lb(o,g,e)):e()}});b=null;return this},x,u,p,t,$a={},Pb=/[\r\n]/g,Ca=/<.*?>/g,cc=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,dc=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),Za=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,M=function(a){return!a||!0===a||"-"===a?!0:!1},Qb=function(a){var b=parseInt(a,10);return!isNaN(b)&&
|
||||
isFinite(a)?b:null},Rb=function(a,b){$a[b]||($a[b]=RegExp(Sa(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace($a[b],"."):a},ab=function(a,b,c){var d="string"===typeof a;if(M(a))return!0;b&&d&&(a=Rb(a,b));c&&d&&(a=a.replace(Za,""));return!isNaN(parseFloat(a))&&isFinite(a)},Sb=function(a,b,c){return M(a)?!0:!(M(a)||"string"===typeof a)?null:ab(a.replace(Ca,""),b,c)?!0:null},D=function(a,b,c){var d=[],e=0,f=a.length;if(c!==k)for(;e<f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<
|
||||
f;e++)a[e]&&d.push(a[e][b]);return d},ja=function(a,b,c,d){var e=[],f=0,g=b.length;if(d!==k)for(;f<g;f++)a[b[f]][c]&&e.push(a[b[f]][c][d]);else for(;f<g;f++)e.push(a[b[f]][c]);return e},X=function(a,b){var c=[],d;b===k?(b=0,d=a):(d=b,b=a);for(var e=b;e<d;e++)c.push(e);return c},Tb=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);return b},sa=function(a){var b=[],c,d,e=a.length,f,g=0;d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<g;f++)if(b[f]===c)continue a;b.push(c);g++}return b};m.util=
|
||||
{throttle:function(a,b){var c=b!==k?b:200,d,e;return function(){var b=this,g=+new Date,h=arguments;d&&g<d+c?(clearTimeout(e),e=setTimeout(function(){d=k;a.apply(b,h)},c)):(d=g,a.apply(b,h))}},escapeRegex:function(a){return a.replace(dc,"\\$1")}};var A=function(a,b,c){a[b]!==k&&(a[c]=a[b])},ca=/\[.*?\]$/,V=/\(\)$/,Sa=m.util.escapeRegex,xa=h("<div>")[0],$b=xa.textContent!==k,bc=/<.*?>/g,Qa=m.util.throttle,Ub=[],w=Array.prototype,ec=function(a){var b,c,d=m.settings,e=h.map(d,function(a){return a.nTable});
|
||||
if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase())return b=h.inArray(a,e),-1!==b?[d[b]]:null;if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?c=h(a):a instanceof h&&(c=a)}else return[];if(c)return c.map(function(){b=h.inArray(this,e);return-1!==b?d[b]:null}).toArray()};u=function(a,b){if(!(this instanceof u))return new u(a,b);var c=[],d=function(a){(a=ec(a))&&(c=c.concat(a))};if(h.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);
|
||||
else d(a);this.context=sa(c);b&&h.merge(this,b);this.selector={rows:null,cols:null,opts:null};u.extend(this,this,Ub)};m.Api=u;h.extend(u.prototype,{any:function(){return 0!==this.count()},concat:w.concat,context:[],count:function(){return this.flatten().length},each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new u(b[a],this[a]):null},filter:function(a){var b=[];if(w.filter)b=w.filter.call(this,a,this);
|
||||
else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new u(this.context,b)},flatten:function(){var a=[];return new u(this.context,a.concat.apply(a,this.toArray()))},join:w.join,indexOf:w.indexOf||function(a,b){for(var c=b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},iterator:function(a,b,c,d){var e=[],f,g,h,i,n,l=this.context,m,p,t=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);g=0;for(h=l.length;g<h;g++){var s=new u(l[g]);if("table"===b)f=
|
||||
c.call(s,l[g],g),f!==k&&e.push(f);else if("columns"===b||"rows"===b)f=c.call(s,l[g],this[g],g),f!==k&&e.push(f);else if("column"===b||"column-rows"===b||"row"===b||"cell"===b){p=this[g];"column-rows"===b&&(m=Da(l[g],t.opts));i=0;for(n=p.length;i<n;i++)f=p[i],f="cell"===b?c.call(s,l[g],f.row,f.column,g,i):c.call(s,l[g],f,g,i,m),f!==k&&e.push(f)}}return e.length||d?(a=new u(l,a?e.concat.apply([],e):e),b=a.selector,b.rows=t.rows,b.cols=t.cols,b.opts=t.opts,a):this},lastIndexOf:w.lastIndexOf||function(a,
|
||||
b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(w.map)b=w.map.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new u(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:w.pop,push:w.push,reduce:w.reduce||function(a,b){return jb(this,a,b,0,this.length,1)},reduceRight:w.reduceRight||function(a,b){return jb(this,a,b,this.length-1,-1,-1)},reverse:w.reverse,selector:null,shift:w.shift,
|
||||
sort:w.sort,splice:w.splice,toArray:function(){return w.slice.call(this)},to$:function(){return h(this)},toJQuery:function(){return h(this)},unique:function(){return new u(this.context,sa(this))},unshift:w.unshift});u.extend=function(a,b,c){if(c.length&&b&&(b instanceof u||b.__dt_wrapper)){var d,e,f,g=function(a,b,c){return function(){var d=b.apply(a,arguments);u.extend(d,d,c.methodExt);return d}};d=0;for(e=c.length;d<e;d++)f=c[d],b[f.name]="function"===typeof f.val?g(a,f.val,f):h.isPlainObject(f.val)?
|
||||
{}:f.val,b[f.name].__dt_wrapper=!0,u.extend(a,b[f.name],f.propExt)}};u.register=p=function(a,b){if(h.isArray(a))for(var c=0,d=a.length;c<d;c++)u.register(a[c],b);else for(var e=a.split("."),f=Ub,g,j,c=0,d=e.length;c<d;c++){g=(j=-1!==e[c].indexOf("()"))?e[c].replace("()",""):e[c];var i;a:{i=0;for(var n=f.length;i<n;i++)if(f[i].name===g){i=f[i];break a}i=null}i||(i={name:g,val:{},methodExt:[],propExt:[]},f.push(i));c===d-1?i.val=b:f=j?i.methodExt:i.propExt}};u.registerPlural=t=function(a,b,c){u.register(a,
|
||||
c);u.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof u?a.length?h.isArray(a[0])?new u(a.context,a[0]):a[0]:k:a})};p("tables()",function(a){var b;if(a){b=u;var c=this.context;if("number"===typeof a)a=[c[a]];else var d=h.map(c,function(a){return a.nTable}),a=h(d).filter(a).map(function(){var a=h.inArray(this,d);return c[a]}).toArray();b=new b(a)}else b=this;return b});p("table()",function(a){var a=this.tables(a),b=a.context;return b.length?new u(b[0]):a});t("tables().nodes()",
|
||||
"table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});t("tables().body()","table().body()",function(){return this.iterator("table",function(a){return a.nTBody},1)});t("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});t("tables().footer()","table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot},1)});t("tables().containers()","table().container()",function(){return this.iterator("table",
|
||||
function(a){return a.nTableWrapper},1)});p("draw()",function(a){return this.iterator("table",function(b){"page"===a?O(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),T(b,!1===a))})});p("page()",function(a){return a===k?this.page.info().page:this.iterator("table",function(b){Va(b,a)})});p("page.info()",function(){if(0===this.context.length)return k;var a=this.context[0],b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),
|
||||
pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,serverSide:"ssp"===y(a)}});p("page.len()",function(a){return a===k?0!==this.context.length?this.context[0]._iDisplayLength:k:this.iterator("table",function(b){Ta(b,a)})});var Vb=function(a,b,c){if(c){var d=new u(a);d.one("draw",function(){c(d.ajax.json())})}if("ssp"==y(a))T(a,b);else{C(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();ua(a,[],function(c){pa(a);for(var c=va(a,c),d=0,e=c.length;d<
|
||||
e;d++)N(a,c[d]);T(a,b);C(a,!1)})}};p("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});p("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});p("ajax.reload()",function(a,b){return this.iterator("table",function(c){Vb(c,!1===b,a)})});p("ajax.url()",function(a){var b=this.context;if(a===k){if(0===b.length)return k;b=b[0];return b.ajax?h.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(b){h.isPlainObject(b.ajax)?
|
||||
b.ajax.url=a:b.ajax=a})});p("ajax.url().load()",function(a,b){return this.iterator("table",function(c){Vb(c,!1===b,a)})});var bb=function(a,b,c,d,e){var f=[],g,j,i,n,l,m;i=typeof b;if(!b||"string"===i||"function"===i||b.length===k)b=[b];i=0;for(n=b.length;i<n;i++){j=b[i]&&b[i].split&&!b[i].match(/[\[\(:]/)?b[i].split(","):[b[i]];l=0;for(m=j.length;l<m;l++)(g=c("string"===typeof j[l]?h.trim(j[l]):j[l]))&&g.length&&(f=f.concat(g))}a=x.selector[a];if(a.length){i=0;for(n=a.length;i<n;i++)f=a[i](d,e,f)}return sa(f)},
|
||||
cb=function(a){a||(a={});a.filter&&a.search===k&&(a.search=a.filter);return h.extend({search:"none",order:"current",page:"all"},a)},db=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Da=function(a,b){var c,d,e,f=[],g=a.aiDisplay;c=a.aiDisplayMaster;var j=b.search;d=b.order;e=b.page;if("ssp"==y(a))return"removed"===j?[]:X(0,c.length);if("current"==e){c=a._iDisplayStart;for(d=a.fnDisplayEnd();c<d;c++)f.push(g[c])}else if("current"==
|
||||
d||"applied"==d)f="none"==j?c.slice():"applied"==j?g.slice():h.map(c,function(a){return-1===h.inArray(a,g)?a:null});else if("index"==d||"original"==d){c=0;for(d=a.aoData.length;c<d;c++)"none"==j?f.push(c):(e=h.inArray(c,g),(-1===e&&"removed"==j||0<=e&&"applied"==j)&&f.push(c))}return f};p("rows()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=cb(b),c=this.iterator("table",function(c){var e=b,f;return bb("row",a,function(a){var b=Qb(a);if(b!==null&&!e)return[b];f||(f=Da(c,e));if(b!==
|
||||
null&&h.inArray(b,f)!==-1)return[b];if(a===null||a===k||a==="")return f;if(typeof a==="function")return h.map(f,function(b){var e=c.aoData[b];return a(b,e._aData,e.nTr)?b:null});b=Tb(ja(c.aoData,f,"nTr"));if(a.nodeName){if(a._DT_RowIndex!==k)return[a._DT_RowIndex];if(a._DT_CellIndex)return[a._DT_CellIndex.row];b=h(a).closest("*[data-dt-row]");return b.length?[b.data("dt-row")]:[]}if(typeof a==="string"&&a.charAt(0)==="#"){var i=c.aIds[a.replace(/^#/,"")];if(i!==k)return[i.idx]}return h(b).filter(a).map(function(){return this._DT_RowIndex}).toArray()},
|
||||
c,e)},1);c.selector.rows=a;c.selector.opts=b;return c});p("rows().nodes()",function(){return this.iterator("row",function(a,b){return a.aoData[b].nTr||k},1)});p("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return ja(a.aoData,b,"_aData")},1)});t("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){var d=b.aoData[c];return"search"===a?d._aFilterData:d._aSortData},1)});t("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",
|
||||
function(b,c){da(b,c,a)})});t("rows().indexes()","row().index()",function(){return this.iterator("row",function(a,b){return b},1)});t("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var h=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+h)}return new u(c,b)});t("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c],g,h,i,n,l;e.splice(c,1);
|
||||
g=0;for(h=e.length;g<h;g++)if(i=e[g],l=i.anCells,null!==i.nTr&&(i.nTr._DT_RowIndex=g),null!==l){i=0;for(n=l.length;i<n;i++)l[i]._DT_CellIndex.row=g}qa(b.aiDisplayMaster,c);qa(b.aiDisplay,c);qa(a[d],c,!1);Ua(b);c=b.rowIdFn(f._aData);c!==k&&delete b.aIds[c]});this.iterator("table",function(a){for(var c=0,d=a.aoData.length;c<d;c++)a.aoData[c].idx=c});return this});p("rows.add()",function(a){var b=this.iterator("table",function(b){var c,f,g,h=[];f=0;for(g=a.length;f<g;f++)c=a[f],c.nodeName&&"TR"===c.nodeName.toUpperCase()?
|
||||
h.push(oa(b,c)[0]):h.push(N(b,c));return h},1),c=this.rows(-1);c.pop();h.merge(c,b);return c});p("row()",function(a,b){return db(this.rows(a,b))});p("row().data()",function(a){var b=this.context;if(a===k)return b.length&&this.length?b[0].aoData[this[0]]._aData:k;b[0].aoData[this[0]]._aData=a;da(b[0],this[0],"data");return this});p("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});p("row.add()",function(a){a instanceof h&&a.length&&(a=a[0]);
|
||||
var b=this.iterator("table",function(b){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?oa(b,a)[0]:N(b,a)});return this.row(b[0])});var eb=function(a,b){var c=a.context;if(c.length&&(c=c[0].aoData[b!==k?b:a[0]])&&c._details)c._details.remove(),c._detailsShow=k,c._details=k},Wb=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];if(d._details){(d._detailsShow=b)?d._details.insertAfter(d.nTr):d._details.detach();var e=c[0],f=new u(e),g=e.aoData;f.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");
|
||||
0<D(g,"_details").length&&(f.on("draw.dt.DT_details",function(a,b){e===b&&f.rows({page:"current"}).eq(0).each(function(a){a=g[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),f.on("column-visibility.dt.DT_details",function(a,b){if(e===b)for(var c,d=ba(b),f=0,h=g.length;f<h;f++)c=g[f],c._details&&c._details.children("td[colspan]").attr("colspan",d)}),f.on("destroy.dt.DT_details",function(a,b){if(e===b)for(var c=0,d=g.length;c<d;c++)g[c]._details&&eb(f,c)}))}}};p("row().child()",function(a,b){var c=
|
||||
this.context;if(a===k)return c.length&&this.length?c[0].aoData[this[0]]._details:k;if(!0===a)this.child.show();else if(!1===a)eb(this);else if(c.length&&this.length){var d=c[0],c=c[0].aoData[this[0]],e=[],f=function(a,b){if(h.isArray(a)||a instanceof h)for(var c=0,k=a.length;c<k;c++)f(a[c],b);else a.nodeName&&"tr"===a.nodeName.toLowerCase()?e.push(a):(c=h("<tr><td/></tr>").addClass(b),h("td",c).addClass(b).html(a)[0].colSpan=ba(d),e.push(c[0]))};f(a,b);c._details&&c._details.detach();c._details=h(e);
|
||||
c._detailsShow&&c._details.insertAfter(c.nTr)}return this});p(["row().child.show()","row().child().show()"],function(){Wb(this,!0);return this});p(["row().child.hide()","row().child().hide()"],function(){Wb(this,!1);return this});p(["row().child.remove()","row().child().remove()"],function(){eb(this);return this});p("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var fc=/^([^:]+):(name|visIdx|visible)$/,Xb=function(a,b,
|
||||
c,d,e){for(var c=[],d=0,f=e.length;d<f;d++)c.push(B(a,e[d],b));return c};p("columns()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=cb(b),c=this.iterator("table",function(c){var e=a,f=b,g=c.aoColumns,j=D(g,"sName"),i=D(g,"nTh");return bb("column",e,function(a){var b=Qb(a);if(a==="")return X(g.length);if(b!==null)return[b>=0?b:g.length+b];if(typeof a==="function"){var e=Da(c,f);return h.map(g,function(b,f){return a(f,Xb(c,f,0,0,e),i[f])?f:null})}var k=typeof a==="string"?a.match(fc):
|
||||
"";if(k)switch(k[2]){case "visIdx":case "visible":b=parseInt(k[1],10);if(b<0){var m=h.map(g,function(a,b){return a.bVisible?b:null});return[m[m.length+b]]}return[$(c,b)];case "name":return h.map(j,function(a,b){return a===k[1]?b:null});default:return[]}if(a.nodeName&&a._DT_CellIndex)return[a._DT_CellIndex.column];b=h(i).filter(a).map(function(){return h.inArray(this,i)}).toArray();if(b.length||!a.nodeName)return b;b=h(a).closest("*[data-dt-column]");return b.length?[b.data("dt-column")]:[]},c,f)},
|
||||
1);c.selector.cols=a;c.selector.opts=b;return c});t("columns().header()","column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});t("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});t("columns().data()","column().data()",function(){return this.iterator("column-rows",Xb,1)});t("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},
|
||||
1)});t("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ja(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});t("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ja(a.aoData,e,"anCells",b)},1)});t("columns().visible()","column().visible()",function(a,b){var c=this.iterator("column",function(b,c){if(a===k)return b.aoColumns[c].bVisible;var f=b.aoColumns,g=f[c],j=b.aoData,
|
||||
i,n,l;if(a!==k&&g.bVisible!==a){if(a){var m=h.inArray(!0,D(f,"bVisible"),c+1);i=0;for(n=j.length;i<n;i++)l=j[i].nTr,f=j[i].anCells,l&&l.insertBefore(f[c],f[m]||null)}else h(D(b.aoData,"anCells",c)).detach();g.bVisible=a;fa(b,b.aoHeader);fa(b,b.aoFooter);za(b)}});a!==k&&(this.iterator("column",function(c,e){s(c,null,"column-visibility",[c,e,a,b])}),(b===k||b)&&this.columns.adjust());return c});t("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===
|
||||
a?aa(b,c):c},1)});p("columns.adjust()",function(){return this.iterator("table",function(a){Z(a)},1)});p("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return $(c,b);if("fromData"===a||"toVisible"===a)return aa(c,b)}});p("column()",function(a,b){return db(this.columns(a,b))});p("cells()",function(a,b,c){h.isPlainObject(a)&&(a.row===k?(c=a,a=null):(c=b,b=null));h.isPlainObject(b)&&(c=b,b=null);if(null===b||b===k)return this.iterator("table",
|
||||
function(b){var d=a,e=cb(c),f=b.aoData,g=Da(b,e),i=Tb(ja(f,g,"anCells")),j=h([].concat.apply([],i)),l,n=b.aoColumns.length,m,p,t,u,s,v;return bb("cell",d,function(a){var c=typeof a==="function";if(a===null||a===k||c){m=[];p=0;for(t=g.length;p<t;p++){l=g[p];for(u=0;u<n;u++){s={row:l,column:u};if(c){v=f[l];a(s,B(b,l,u),v.anCells?v.anCells[u]:null)&&m.push(s)}else m.push(s)}}return m}if(h.isPlainObject(a))return[a];c=j.filter(a).map(function(a,b){return{row:b._DT_CellIndex.row,column:b._DT_CellIndex.column}}).toArray();
|
||||
if(c.length||!a.nodeName)return c;v=h(a).closest("*[data-dt-row]");return v.length?[{row:v.data("dt-row"),column:v.data("dt-column")}]:[]},b,e)});var d=this.columns(b,c),e=this.rows(a,c),f,g,j,i,n,l=this.iterator("table",function(a,b){f=[];g=0;for(j=e[b].length;g<j;g++){i=0;for(n=d[b].length;i<n;i++)f.push({row:e[b][g],column:d[b][i]})}return f},1);h.extend(l.selector,{cols:b,rows:a,opts:c});return l});t("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=
|
||||
a.aoData[b])&&a.anCells?a.anCells[c]:k},1)});p("cells().data()",function(){return this.iterator("cell",function(a,b,c){return B(a,b,c)},1)});t("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});t("cells().render()","cell().render()",function(a){return this.iterator("cell",function(b,c,d){return B(b,c,d,a)},1)});t("cells().indexes()","cell().index()",function(){return this.iterator("cell",
|
||||
function(a,b,c){return{row:b,column:c,columnVisible:aa(a,c)}},1)});t("cells().invalidate()","cell().invalidate()",function(a){return this.iterator("cell",function(b,c,d){da(b,c,a,d)})});p("cell()",function(a,b,c){return db(this.cells(a,b,c))});p("cell().data()",function(a){var b=this.context,c=this[0];if(a===k)return b.length&&c.length?B(b[0],c[0].row,c[0].column):k;lb(b[0],c[0].row,c[0].column,a);da(b[0],c[0].row,"data",c[0].column);return this});p("order()",function(a,b){var c=this.context;if(a===
|
||||
k)return 0!==c.length?c[0].aaSorting:k;"number"===typeof a?a=[[a,b]]:a.length&&!h.isArray(a[0])&&(a=Array.prototype.slice.call(arguments));return this.iterator("table",function(b){b.aaSorting=a.slice()})});p("order.listener()",function(a,b,c){return this.iterator("table",function(d){Oa(d,a,b,c)})});p("order.fixed()",function(a){if(!a){var b=this.context,b=b.length?b[0].aaSortingFixed:k;return h.isArray(b)?{pre:b}:b}return this.iterator("table",function(b){b.aaSortingFixed=h.extend(!0,{},a)})});p(["columns().order()",
|
||||
"column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];h.each(b[d],function(b,c){e.push([c,a])});c.aaSorting=e})});p("search()",function(a,b,c,d){var e=this.context;return a===k?0!==e.length?e[0].oPreviousSearch.sSearch:k:this.iterator("table",function(e){e.oFeatures.bFilter&&ga(e,h.extend({},e.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});t("columns().search()","column().search()",function(a,
|
||||
b,c,d){return this.iterator("column",function(e,f){var g=e.aoPreSearchCols;if(a===k)return g[f].sSearch;e.oFeatures.bFilter&&(h.extend(g[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),ga(e,e.oPreviousSearch,1))})});p("state()",function(){return this.context.length?this.context[0].oSavedState:null});p("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});p("state.loaded()",function(){return this.context.length?
|
||||
this.context[0].oLoadedState:null});p("state.save()",function(){return this.iterator("table",function(a){za(a)})});m.versionCheck=m.fnVersionCheck=function(a){for(var b=m.version.split("."),a=a.split("."),c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};m.isDataTable=m.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;if(a instanceof m.Api)return!0;h.each(m.settings,function(a,e){var f=e.nScrollHead?h("table",e.nScrollHead)[0]:null,g=e.nScrollFoot?
|
||||
h("table",e.nScrollFoot)[0]:null;if(e.nTable===b||f===b||g===b)c=!0});return c};m.tables=m.fnTables=function(a){var b=!1;h.isPlainObject(a)&&(b=a.api,a=a.visible);var c=h.map(m.settings,function(b){if(!a||a&&h(b.nTable).is(":visible"))return b.nTable});return b?new u(c):c};m.camelToHungarian=J;p("$()",function(a,b){var c=this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each(["on","one","off"],function(a,b){p(b+"()",function(){var a=Array.prototype.slice.call(arguments);
|
||||
a[0]=h.map(a[0].split(/\s/),function(a){return!a.match(/\.dt\b/)?a+".dt":a}).join(" ");var d=h(this.tables().nodes());d[b].apply(d,a);return this})});p("clear()",function(){return this.iterator("table",function(a){pa(a)})});p("settings()",function(){return new u(this.context,this.context)});p("init()",function(){var a=this.context;return a.length?a[0].oInit:null});p("data()",function(){return this.iterator("table",function(a){return D(a.aoData,"_aData")}).flatten()});p("destroy()",function(a){a=a||
|
||||
!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,j=b.nTFoot,i=h(e),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}),p;b.bDestroying=!0;s(b,"aoDestroyCallback","destroy",[b]);a||(new u(b)).columns().visible(!0);k.off(".DT").find(":not(tbody *)").off(".DT");h(E).off(".DT-"+b.sInstance);e!=g.parentNode&&(i.children("thead").detach(),i.append(g));j&&e!=j.parentNode&&(i.children("tfoot").detach(),i.append(j));
|
||||
b.aaSorting=[];b.aaSortingFixed=[];ya(b);h(l).removeClass(b.asStripeClasses.join(" "));h("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);b.bJUI&&(h("th span."+d.sSortIcon+", td span."+d.sSortIcon,g).detach(),h("th, td",g).each(function(){var a=h("div."+d.sSortJUIWrapper,this);h(this).append(a.contents());a.detach()}));f.children().detach();f.append(l);g=a?"remove":"detach";i[g]();k[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),i.css("width",
|
||||
b.sDestroyWidth).removeClass(d.sTable),(p=b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a%p])}));c=h.inArray(b,m.settings);-1!==c&&m.settings.splice(c,1)})});h.each(["column","row","cell"],function(a,b){p(b+"s().every()",function(a){var d=this.selector.opts,e=this;return this.iterator(b,function(f,g,h,i,m){a.call(e[b](g,"cell"===b?h:d,"cell"===b?d:k),g,h,i,m)})})});p("i18n()",function(a,b,c){var d=this.context[0],a=R(a)(d.oLanguage);a===k&&(a=b);c!==
|
||||
k&&h.isPlainObject(a)&&(a=a[c]!==k?a[c]:a._);return a.replace("%d",c)});m.version="1.10.13";m.settings=[];m.models={};m.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};m.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};m.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,
|
||||
mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};m.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,
|
||||
bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?
|
||||
sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",
|
||||
sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},
|
||||
oSearch:h.extend({},m.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};Y(m.defaults);m.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,
|
||||
sType:null,sWidth:null};Y(m.defaults.column);m.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],
|
||||
aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,
|
||||
searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],
|
||||
fnRecordsTotal:function(){return"ssp"==y(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==y(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,
|
||||
aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};m.ext=x={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:m.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:m.version};h.extend(x,{afnFiltering:x.search,aTypes:x.type.detect,ofnSearch:x.type.search,oSort:x.type.order,afnSortData:x.order,aoFeatures:x.feature,
|
||||
oApi:x.internal,oStdClasses:x.classes,oPagination:x.pager});h.extend(m.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",
|
||||
sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",
|
||||
sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var Ea="",Ea="",G=Ea+"ui-state-default",ka=Ea+"css_right ui-icon ui-icon-",Yb=Ea+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";h.extend(m.ext.oJUIClasses,m.ext.classes,{sPageButton:"fg-button ui-button "+G,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:G+" sorting_asc",
|
||||
sSortDesc:G+" sorting_desc",sSortable:G+" sorting",sSortableAsc:G+" sorting_asc_disabled",sSortableDesc:G+" sorting_desc_disabled",sSortableNone:G+" sorting_disabled",sSortJUIAsc:ka+"triangle-1-n",sSortJUIDesc:ka+"triangle-1-s",sSortJUI:ka+"carat-2-n-s",sSortJUIAscAllowed:ka+"carat-1-n",sSortJUIDescAllowed:ka+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+G,sScrollFoot:"dataTables_scrollFoot "+G,sHeaderTH:G,sFooterTH:G,sJUIHeader:Yb+
|
||||
" ui-corner-tl ui-corner-tr",sJUIFooter:Yb+" ui-corner-bl ui-corner-br"});var Nb=m.ext.pager;h.extend(Nb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(a,b){return[ia(a,b)]},simple_numbers:function(a,b){return["previous",ia(a,b),"next"]},full_numbers:function(a,b){return["first","previous",ia(a,b),"next","last"]},first_last_numbers:function(a,b){return["first",ia(a,b),"last"]},_numbers:ia,numbers_length:7});h.extend(!0,m.ext.renderer,
|
||||
{pageButton:{_:function(a,b,c,d,e,f){var g=a.oClasses,j=a.oLanguage.oPaginate,i=a.oLanguage.oAria.paginate||{},m,l,p=0,r=function(b,d){var k,t,u,s,v=function(b){Va(a,b.data.action,true)};k=0;for(t=d.length;k<t;k++){s=d[k];if(h.isArray(s)){u=h("<"+(s.DT_el||"div")+"/>").appendTo(b);r(u,s)}else{m=null;l="";switch(s){case "ellipsis":b.append('<span class="ellipsis">…</span>');break;case "first":m=j.sFirst;l=s+(e>0?"":" "+g.sPageButtonDisabled);break;case "previous":m=j.sPrevious;l=s+(e>0?"":" "+
|
||||
g.sPageButtonDisabled);break;case "next":m=j.sNext;l=s+(e<f-1?"":" "+g.sPageButtonDisabled);break;case "last":m=j.sLast;l=s+(e<f-1?"":" "+g.sPageButtonDisabled);break;default:m=s+1;l=e===s?g.sPageButtonActive:""}if(m!==null){u=h("<a>",{"class":g.sPageButton+" "+l,"aria-controls":a.sTableId,"aria-label":i[s],"data-dt-idx":p,tabindex:a.iTabIndex,id:c===0&&typeof s==="string"?a.sTableId+"_"+s:null}).html(m).appendTo(b);Ya(u,{action:s},v);p++}}}},t;try{t=h(b).find(H.activeElement).data("dt-idx")}catch(u){}r(h(b).empty(),
|
||||
d);t!==k&&h(b).find("[data-dt-idx="+t+"]").focus()}}});h.extend(m.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return ab(a,c)?"num"+c:null},function(a){if(a&&!(a instanceof Date)&&!cc.test(a))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||M(a)?"date":null},function(a,b){var c=b.oLanguage.sDecimal;return ab(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Sb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Sb(a,c,!0)?"html-num-fmt"+
|
||||
c:null},function(a){return M(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);h.extend(m.ext.type.search,{html:function(a){return M(a)?a:"string"===typeof a?a.replace(Pb," ").replace(Ca,""):""},string:function(a){return M(a)?a:"string"===typeof a?a.replace(Pb," "):a}});var Ba=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Rb(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};h.extend(x.type.order,{"date-pre":function(a){return Date.parse(a)||-Infinity},
|
||||
"html-pre":function(a){return M(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return M(a)?"":"string"===typeof a?a.toLowerCase():!a.toString?"":a.toString()},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a,b){return a<b?1:a>b?-1:0}});fb("");h.extend(!0,m.ext.renderer,{header:{_:function(a,b,c,d){h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass(h[e]==
|
||||
"asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass)}})},jqueryui:function(a,b,c,d){h("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(h("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass);b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+
|
||||
d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass(h[e]=="asc"?d.sSortJUIAsc:h[e]=="desc"?d.sSortJUIDesc:c.sSortingClassJUI)}})}}});var Zb=function(a){return"string"===typeof a?a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):a};m.render={number:function(a,b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return Zb(f);h=h.toFixed(c);f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):
|
||||
"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+f+(e||"")}}},text:function(){return{display:Zb}}};h.extend(m.ext.internal,{_fnExternApiFunc:Ob,_fnBuildAjax:ua,_fnAjaxUpdate:nb,_fnAjaxParameters:wb,_fnAjaxUpdateDraw:xb,_fnAjaxDataSrc:va,_fnAddColumn:Ga,_fnColumnOptions:la,_fnAdjustColumnSizing:Z,_fnVisibleToColumnIndex:$,_fnColumnIndexToVisible:aa,_fnVisbleColumns:ba,_fnGetColumns:na,_fnColumnTypes:Ia,_fnApplyColumnDefs:kb,_fnHungarianMap:Y,_fnCamelToHungarian:J,_fnLanguageCompat:Fa,
|
||||
_fnBrowserDetect:ib,_fnAddData:N,_fnAddTr:oa,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==k?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},_fnGetCellData:B,_fnSetCellData:lb,_fnSplitObjNotation:La,_fnGetObjectDataFn:R,_fnSetObjectDataFn:S,_fnGetDataMaster:Ma,_fnClearTable:pa,_fnDeleteIndex:qa,_fnInvalidate:da,_fnGetRowElements:Ka,_fnCreateTr:Ja,_fnBuildHead:mb,_fnDrawHead:fa,_fnDraw:O,_fnReDraw:T,_fnAddOptionsHtml:pb,_fnDetectHeader:ea,
|
||||
_fnGetUniqueThs:ta,_fnFeatureHtmlFilter:rb,_fnFilterComplete:ga,_fnFilterCustom:Ab,_fnFilterColumn:zb,_fnFilter:yb,_fnFilterCreateSearch:Ra,_fnEscapeRegex:Sa,_fnFilterData:Bb,_fnFeatureHtmlInfo:ub,_fnUpdateInfo:Eb,_fnInfoMacros:Fb,_fnInitialise:ha,_fnInitComplete:wa,_fnLengthChange:Ta,_fnFeatureHtmlLength:qb,_fnFeatureHtmlPaginate:vb,_fnPageChange:Va,_fnFeatureHtmlProcessing:sb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:tb,_fnScrollDraw:ma,_fnApplyToChildren:I,_fnCalculateColumnWidths:Ha,_fnThrottle:Qa,
|
||||
_fnConvertToWidth:Gb,_fnGetWidestNode:Hb,_fnGetMaxLenString:Ib,_fnStringToCss:v,_fnSortFlatten:W,_fnSort:ob,_fnSortAria:Kb,_fnSortListener:Xa,_fnSortAttachListener:Oa,_fnSortingClasses:ya,_fnSortData:Jb,_fnSaveState:za,_fnLoadState:Lb,_fnSettingsFromNode:Aa,_fnLog:K,_fnMap:F,_fnBindAction:Ya,_fnCallbackReg:z,_fnCallbackFire:s,_fnLengthOverflow:Ua,_fnRenderer:Pa,_fnDataSource:y,_fnRowAttributes:Na,_fnCalculateEnd:function(){}});h.fn.dataTable=m;m.$=h;h.fn.dataTableSettings=m.settings;h.fn.dataTableExt=
|
||||
m.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};h.each(m,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable});
|
||||
+14
File diff suppressed because one or more lines are too long
+22
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+483
@@ -0,0 +1,483 @@
|
||||
/* The MIT License
|
||||
|
||||
Copyright (c) 2011 by Michael Zinsmaier and nergal.dev
|
||||
Copyright (c) 2012 by Thomas Ritou
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
____________________________________________________
|
||||
|
||||
what it is:
|
||||
____________________________________________________
|
||||
|
||||
curvedLines is a plugin for flot, that tries to display lines in a smoother way.
|
||||
This is achieved through adding of more data points. The plugin is a data processor and can thus be used
|
||||
in combination with standard line / point rendering options.
|
||||
|
||||
=> 1) with large data sets you may get trouble
|
||||
=> 2) if you want to display the points too, you have to plot them as 2nd data series over the lines
|
||||
=> 3) consecutive x data points are not allowed to have the same value
|
||||
|
||||
Feel free to further improve the code
|
||||
|
||||
____________________________________________________
|
||||
|
||||
how to use it:
|
||||
____________________________________________________
|
||||
|
||||
var d1 = [[5,5],[7,3],[9,12]];
|
||||
|
||||
var options = { series: { curvedLines: { active: true }}};
|
||||
|
||||
$.plot($("#placeholder"), [{data: d1, lines: { show: true}, curvedLines: {apply: true}}], options);
|
||||
|
||||
_____________________________________________________
|
||||
|
||||
options:
|
||||
_____________________________________________________
|
||||
|
||||
active: bool true => plugin can be used
|
||||
apply: bool true => series will be drawn as curved line
|
||||
monotonicFit: bool true => uses monotone cubic interpolation (preserve monotonicity)
|
||||
tension: int defines the tension parameter of the hermite spline interpolation (no effect if monotonicFit is set)
|
||||
nrSplinePoints: int defines the number of sample points (of the spline) in between two consecutive points
|
||||
|
||||
deprecated options from flot prior to 1.0.0:
|
||||
------------------------------------------------
|
||||
legacyOverride bool true => use old default
|
||||
OR
|
||||
legacyOverride optionArray
|
||||
{
|
||||
fit: bool true => forces the max,mins of the curve to be on the datapoints
|
||||
curvePointFactor int defines how many "virtual" points are used per "real" data point to
|
||||
emulate the curvedLines (points total = real points * curvePointFactor)
|
||||
fitPointDist: int defines the x axis distance of the additional two points that are used
|
||||
} to enforce the min max condition.
|
||||
*/
|
||||
|
||||
/*
|
||||
* v0.1 initial commit
|
||||
* v0.15 negative values should work now (outcommented a negative -> 0 hook hope it does no harm)
|
||||
* v0.2 added fill option (thanks to monemihir) and multi axis support (thanks to soewono effendi)
|
||||
* v0.3 improved saddle handling and added basic handling of Dates
|
||||
* v0.4 rewritten fill option (thomas ritou) mostly from original flot code (now fill between points rather than to graph bottom), corrected fill Opacity bug
|
||||
* v0.5 rewritten instead of implementing a own draw function CurvedLines is now based on the processDatapoints flot hook (credits go to thomas ritou).
|
||||
* This change breakes existing code however CurvedLines are now just many tiny straight lines to flot and therefore all flot lines options (like gradient fill,
|
||||
* shadow) are now supported out of the box
|
||||
* v0.6 flot 0.8 compatibility and some bug fixes
|
||||
* v0.6.x changed versioning schema
|
||||
*
|
||||
* v1.0.0 API Break marked existing implementation/options as deprecated
|
||||
* v1.1.0 added the new curved line calculations based on hermite splines
|
||||
* v1.1.1 added a rough parameter check to make sure the new options are used
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var options = {
|
||||
series : {
|
||||
curvedLines : {
|
||||
active : false,
|
||||
apply : false,
|
||||
monotonicFit : false,
|
||||
tension : 0.5,
|
||||
nrSplinePoints : 20,
|
||||
legacyOverride : undefined
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
|
||||
plot.hooks.processOptions.push(processOptions);
|
||||
|
||||
//if the plugin is active register processDatapoints method
|
||||
function processOptions(plot, options) {
|
||||
if (options.series.curvedLines.active) {
|
||||
plot.hooks.processDatapoints.unshift(processDatapoints);
|
||||
}
|
||||
}
|
||||
|
||||
//only if the plugin is active
|
||||
function processDatapoints(plot, series, datapoints) {
|
||||
var nrPoints = datapoints.points.length / datapoints.pointsize;
|
||||
var EPSILON = 0.005;
|
||||
|
||||
//detects missplaced legacy parameters (prior v1.x.x) in the options object
|
||||
//this can happen if somebody upgrades to v1.x.x without adjusting the parameters or uses old examples
|
||||
var invalidLegacyOptions = hasInvalidParameters(series.curvedLines);
|
||||
|
||||
if (!invalidLegacyOptions && series.curvedLines.apply == true && series.originSeries === undefined && nrPoints > (1 + EPSILON)) {
|
||||
if (series.lines.fill) {
|
||||
|
||||
var pointsTop = calculateCurvePoints(datapoints, series.curvedLines, 1);
|
||||
var pointsBottom = calculateCurvePoints(datapoints, series.curvedLines, 2);
|
||||
//flot makes sure for us that we've got a second y point if fill is true !
|
||||
|
||||
//Merge top and bottom curve
|
||||
datapoints.pointsize = 3;
|
||||
datapoints.points = [];
|
||||
var j = 0;
|
||||
var k = 0;
|
||||
var i = 0;
|
||||
var ps = 2;
|
||||
while (i < pointsTop.length || j < pointsBottom.length) {
|
||||
if (pointsTop[i] == pointsBottom[j]) {
|
||||
datapoints.points[k] = pointsTop[i];
|
||||
datapoints.points[k + 1] = pointsTop[i + 1];
|
||||
datapoints.points[k + 2] = pointsBottom[j + 1];
|
||||
j += ps;
|
||||
i += ps;
|
||||
|
||||
} else if (pointsTop[i] < pointsBottom[j]) {
|
||||
datapoints.points[k] = pointsTop[i];
|
||||
datapoints.points[k + 1] = pointsTop[i + 1];
|
||||
datapoints.points[k + 2] = k > 0 ? datapoints.points[k - 1] : null;
|
||||
i += ps;
|
||||
} else {
|
||||
datapoints.points[k] = pointsBottom[j];
|
||||
datapoints.points[k + 1] = k > 1 ? datapoints.points[k - 2] : null;
|
||||
datapoints.points[k + 2] = pointsBottom[j + 1];
|
||||
j += ps;
|
||||
}
|
||||
k += 3;
|
||||
}
|
||||
} else if (series.lines.lineWidth > 0) {
|
||||
datapoints.points = calculateCurvePoints(datapoints, series.curvedLines, 1);
|
||||
datapoints.pointsize = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function calculateCurvePoints(datapoints, curvedLinesOptions, yPos) {
|
||||
if ( typeof curvedLinesOptions.legacyOverride != 'undefined' && curvedLinesOptions.legacyOverride != false) {
|
||||
var defaultOptions = {
|
||||
fit : false,
|
||||
curvePointFactor : 20,
|
||||
fitPointDist : undefined
|
||||
};
|
||||
var legacyOptions = jQuery.extend(defaultOptions, curvedLinesOptions.legacyOverride);
|
||||
return calculateLegacyCurvePoints(datapoints, legacyOptions, yPos);
|
||||
}
|
||||
|
||||
return calculateSplineCurvePoints(datapoints, curvedLinesOptions, yPos);
|
||||
}
|
||||
|
||||
function calculateSplineCurvePoints(datapoints, curvedLinesOptions, yPos) {
|
||||
var points = datapoints.points;
|
||||
var ps = datapoints.pointsize;
|
||||
|
||||
//create interpolant fuction
|
||||
var splines = createHermiteSplines(datapoints, curvedLinesOptions, yPos);
|
||||
var result = [];
|
||||
|
||||
//sample the function
|
||||
// (the result is intependent from the input data =>
|
||||
// it is ok to alter the input after this method)
|
||||
var j = 0;
|
||||
for (var i = 0; i < points.length - ps; i += ps) {
|
||||
var curX = i;
|
||||
var curY = i + yPos;
|
||||
|
||||
var xStart = points[curX];
|
||||
var xEnd = points[curX + ps];
|
||||
var xStep = (xEnd - xStart) / Number(curvedLinesOptions.nrSplinePoints);
|
||||
|
||||
//add point
|
||||
result.push(points[curX]);
|
||||
result.push(points[curY]);
|
||||
|
||||
//add curve point
|
||||
for (var x = (xStart += xStep); x < xEnd; x += xStep) {
|
||||
result.push(x);
|
||||
result.push(splines[j](x));
|
||||
}
|
||||
|
||||
j++;
|
||||
}
|
||||
|
||||
//add last point
|
||||
result.push(points[points.length - ps]);
|
||||
result.push(points[points.length - ps + yPos]);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Creates an array of splines, one for each segment of the original curve. Algorithm based on the wikipedia articles:
|
||||
//
|
||||
// http://de.wikipedia.org/w/index.php?title=Kubisch_Hermitescher_Spline&oldid=130168003 and
|
||||
// http://en.wikipedia.org/w/index.php?title=Monotone_cubic_interpolation&oldid=622341725 and the description of Fritsch-Carlson from
|
||||
// http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation
|
||||
// for a detailed description see https://github.com/MichaelZinsmaier/CurvedLines/docu
|
||||
function createHermiteSplines(datapoints, curvedLinesOptions, yPos) {
|
||||
var points = datapoints.points;
|
||||
var ps = datapoints.pointsize;
|
||||
|
||||
// preparation get length (x_{k+1} - x_k) and slope s=(p_{k+1} - p_k) / (x_{k+1} - x_k) of the segments
|
||||
var segmentLengths = [];
|
||||
var segmentSlopes = [];
|
||||
|
||||
for (var i = 0; i < points.length - ps; i += ps) {
|
||||
var curX = i;
|
||||
var curY = i + yPos;
|
||||
var dx = points[curX + ps] - points[curX];
|
||||
var dy = points[curY + ps] - points[curY];
|
||||
|
||||
segmentLengths.push(dx);
|
||||
segmentSlopes.push(dy / dx);
|
||||
}
|
||||
|
||||
//get the values for the desired gradients m_k for all points k
|
||||
//depending on the used method the formula is different
|
||||
var gradients = [segmentSlopes[0]];
|
||||
if (curvedLinesOptions.monotonicFit) {
|
||||
// Fritsch Carlson
|
||||
for (var i = 1; i < segmentLengths.length; i++) {
|
||||
var slope = segmentSlopes[i];
|
||||
var prev_slope = segmentSlopes[i - 1];
|
||||
if (slope * prev_slope <= 0) { // sign(prev_slope) != sign(slpe)
|
||||
gradients.push(0);
|
||||
} else {
|
||||
var length = segmentLengths[i];
|
||||
var prev_length = segmentLengths[i - 1];
|
||||
var common = length + prev_length;
|
||||
//m = 3 (prev_length + length) / ((2 length + prev_length) / prev_slope + (length + 2 prev_length) / slope)
|
||||
gradients.push(3 * common / ((common + length) / prev_slope + (common + prev_length) / slope));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Cardinal spline with t € [0,1]
|
||||
// Catmull-Rom for t = 0
|
||||
for (var i = ps; i < points.length - ps; i += ps) {
|
||||
var curX = i;
|
||||
var curY = i + yPos;
|
||||
gradients.push(Number(curvedLinesOptions.tension) * (points[curY + ps] - points[curY - ps]) / (points[curX + ps] - points[curX - ps]));
|
||||
}
|
||||
}
|
||||
gradients.push(segmentSlopes[segmentSlopes.length - 1]);
|
||||
|
||||
//get the two major coefficients (c'_{oef1} and c'_{oef2}) for each segment spline
|
||||
var coefs1 = [];
|
||||
var coefs2 = [];
|
||||
for (i = 0; i < segmentLengths.length; i++) {
|
||||
var m_k = gradients[i];
|
||||
var m_k_plus = gradients[i + 1];
|
||||
var slope = segmentSlopes[i];
|
||||
var invLength = 1 / segmentLengths[i];
|
||||
var common = m_k + m_k_plus - slope - slope;
|
||||
|
||||
coefs1.push(common * invLength * invLength);
|
||||
coefs2.push((slope - common - m_k) * invLength);
|
||||
}
|
||||
|
||||
//create functions with from the coefficients and capture the parameters
|
||||
var ret = [];
|
||||
for (var i = 0; i < segmentLengths.length; i ++) {
|
||||
var spline = function (x_k, coef1, coef2, coef3, coef4) {
|
||||
// spline for a segment
|
||||
return function (x) {
|
||||
var diff = x - x_k;
|
||||
var diffSq = diff * diff;
|
||||
return coef1 * diff * diffSq + coef2 * diffSq + coef3 * diff + coef4;
|
||||
};
|
||||
};
|
||||
|
||||
ret.push(spline(points[i * ps], coefs1[i], coefs2[i], gradients[i], points[i * ps + yPos]));
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
//no real idea whats going on here code mainly from https://code.google.com/p/flot/issues/detail?id=226
|
||||
//if fit option is selected additional datapoints get inserted before the curve calculations in nergal.dev s code.
|
||||
function calculateLegacyCurvePoints(datapoints, curvedLinesOptions, yPos) {
|
||||
|
||||
var points = datapoints.points;
|
||||
var ps = datapoints.pointsize;
|
||||
var num = Number(curvedLinesOptions.curvePointFactor) * (points.length / ps);
|
||||
|
||||
var xdata = new Array;
|
||||
var ydata = new Array;
|
||||
|
||||
var curX = -1;
|
||||
var curY = -1;
|
||||
var j = 0;
|
||||
|
||||
if (curvedLinesOptions.fit) {
|
||||
//insert a point before and after the "real" data point to force the line
|
||||
//to have a max,min at the data point.
|
||||
|
||||
var fpDist;
|
||||
if ( typeof curvedLinesOptions.fitPointDist == 'undefined') {
|
||||
//estimate it
|
||||
var minX = points[0];
|
||||
var maxX = points[points.length - ps];
|
||||
fpDist = (maxX - minX) / (500 * 100);
|
||||
//x range / (estimated pixel length of placeholder * factor)
|
||||
} else {
|
||||
//use user defined value
|
||||
fpDist = Number(curvedLinesOptions.fitPointDist);
|
||||
}
|
||||
|
||||
for (var i = 0; i < points.length; i += ps) {
|
||||
|
||||
var frontX;
|
||||
var backX;
|
||||
curX = i;
|
||||
curY = i + yPos;
|
||||
|
||||
//add point X s
|
||||
frontX = points[curX] - fpDist;
|
||||
backX = points[curX] + fpDist;
|
||||
|
||||
var factor = 2;
|
||||
while (frontX == points[curX] || backX == points[curX]) {
|
||||
//inside the ulp
|
||||
frontX = points[curX] - (fpDist * factor);
|
||||
backX = points[curX] + (fpDist * factor);
|
||||
factor++;
|
||||
}
|
||||
|
||||
//add curve points
|
||||
xdata[j] = frontX;
|
||||
ydata[j] = points[curY];
|
||||
j++;
|
||||
|
||||
xdata[j] = points[curX];
|
||||
ydata[j] = points[curY];
|
||||
j++;
|
||||
|
||||
xdata[j] = backX;
|
||||
ydata[j] = points[curY];
|
||||
j++;
|
||||
}
|
||||
} else {
|
||||
//just use the datapoints
|
||||
for (var i = 0; i < points.length; i += ps) {
|
||||
curX = i;
|
||||
curY = i + yPos;
|
||||
|
||||
xdata[j] = points[curX];
|
||||
ydata[j] = points[curY];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
var n = xdata.length;
|
||||
|
||||
var y2 = new Array();
|
||||
var delta = new Array();
|
||||
y2[0] = 0;
|
||||
y2[n - 1] = 0;
|
||||
delta[0] = 0;
|
||||
|
||||
for (var i = 1; i < n - 1; ++i) {
|
||||
var d = (xdata[i + 1] - xdata[i - 1]);
|
||||
if (d == 0) {
|
||||
//point before current point and after current point need some space in between
|
||||
return [];
|
||||
}
|
||||
|
||||
var s = (xdata[i] - xdata[i - 1]) / d;
|
||||
var p = s * y2[i - 1] + 2;
|
||||
y2[i] = (s - 1) / p;
|
||||
delta[i] = (ydata[i + 1] - ydata[i]) / (xdata[i + 1] - xdata[i]) - (ydata[i] - ydata[i - 1]) / (xdata[i] - xdata[i - 1]);
|
||||
delta[i] = (6 * delta[i] / (xdata[i + 1] - xdata[i - 1]) - s * delta[i - 1]) / p;
|
||||
}
|
||||
|
||||
for (var j = n - 2; j >= 0; --j) {
|
||||
y2[j] = y2[j] * y2[j + 1] + delta[j];
|
||||
}
|
||||
|
||||
// xmax - xmin / #points
|
||||
var step = (xdata[n - 1] - xdata[0]) / (num - 1);
|
||||
|
||||
var xnew = new Array;
|
||||
var ynew = new Array;
|
||||
var result = new Array;
|
||||
|
||||
xnew[0] = xdata[0];
|
||||
ynew[0] = ydata[0];
|
||||
|
||||
result.push(xnew[0]);
|
||||
result.push(ynew[0]);
|
||||
|
||||
for ( j = 1; j < num; ++j) {
|
||||
//new x point (sampling point for the created curve)
|
||||
xnew[j] = xnew[0] + j * step;
|
||||
|
||||
var max = n - 1;
|
||||
var min = 0;
|
||||
|
||||
while (max - min > 1) {
|
||||
var k = Math.round((max + min) / 2);
|
||||
if (xdata[k] > xnew[j]) {
|
||||
max = k;
|
||||
} else {
|
||||
min = k;
|
||||
}
|
||||
}
|
||||
|
||||
//found point one to the left and one to the right of generated new point
|
||||
var h = (xdata[max] - xdata[min]);
|
||||
|
||||
if (h == 0) {
|
||||
//similar to above two points from original x data need some space between them
|
||||
return [];
|
||||
}
|
||||
|
||||
var a = (xdata[max] - xnew[j]) / h;
|
||||
var b = (xnew[j] - xdata[min]) / h;
|
||||
|
||||
ynew[j] = a * ydata[min] + b * ydata[max] + ((a * a * a - a) * y2[min] + (b * b * b - b) * y2[max]) * (h * h) / 6;
|
||||
|
||||
result.push(xnew[j]);
|
||||
result.push(ynew[j]);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function hasInvalidParameters(curvedLinesOptions) {
|
||||
if (typeof curvedLinesOptions.fit != 'undefined' ||
|
||||
typeof curvedLinesOptions.curvePointFactor != 'undefined' ||
|
||||
typeof curvedLinesOptions.fitPointDist != 'undefined') {
|
||||
throw new Error("CurvedLines detected illegal parameters. The CurvedLines API changed with version 1.0.0 please check the options object.");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}//end init
|
||||
|
||||
|
||||
$.plot.plugins.push({
|
||||
init : init,
|
||||
options : options,
|
||||
name : 'curvedLines',
|
||||
version : '1.1.1'
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
||||
File diff suppressed because one or more lines are too long
+375
@@ -0,0 +1,375 @@
|
||||
|
||||
(function($){
|
||||
|
||||
"use strict"; // Start of use strict
|
||||
|
||||
var SufeeAdmin = {
|
||||
|
||||
cpuLoad: function(){
|
||||
|
||||
var data = [],
|
||||
totalPoints = 300;
|
||||
|
||||
function getRandomData() {
|
||||
|
||||
if ( data.length > 0 )
|
||||
data = data.slice( 1 );
|
||||
|
||||
// Do a random walk
|
||||
|
||||
while ( data.length < totalPoints ) {
|
||||
|
||||
var prev = data.length > 0 ? data[ data.length - 1 ] : 50,
|
||||
y = prev + Math.random() * 10 - 5;
|
||||
|
||||
if ( y < 0 ) {
|
||||
y = 0;
|
||||
} else if ( y > 100 ) {
|
||||
y = 100;
|
||||
}
|
||||
|
||||
data.push( y );
|
||||
}
|
||||
|
||||
// Zip the generated y values with the x values
|
||||
|
||||
var res = [];
|
||||
for ( var i = 0; i < data.length; ++i ) {
|
||||
res.push( [ i, data[ i ] ] )
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// Set up the control widget
|
||||
|
||||
var updateInterval = 30;
|
||||
$( "#updateInterval" ).val( updateInterval ).change( function () {
|
||||
var v = $( this ).val();
|
||||
if ( v && !isNaN( +v ) ) {
|
||||
updateInterval = +v;
|
||||
if ( updateInterval < 1 ) {
|
||||
updateInterval = 1;
|
||||
} else if ( updateInterval > 3000 ) {
|
||||
updateInterval = 3000;
|
||||
}
|
||||
$( this ).val( "" + updateInterval );
|
||||
}
|
||||
} );
|
||||
|
||||
var plot = $.plot( "#cpu-load", [ getRandomData() ], {
|
||||
series: {
|
||||
shadowSize: 0 // Drawing is faster without shadows
|
||||
},
|
||||
yaxis: {
|
||||
min: 0,
|
||||
max: 100
|
||||
},
|
||||
xaxis: {
|
||||
show: false
|
||||
},
|
||||
colors: [ "#007BFF" ],
|
||||
grid: {
|
||||
color: "transparent",
|
||||
hoverable: true,
|
||||
borderWidth: 0,
|
||||
backgroundColor: 'transparent'
|
||||
},
|
||||
tooltip: true,
|
||||
tooltipOpts: {
|
||||
content: "Y: %y",
|
||||
defaultTheme: false
|
||||
}
|
||||
|
||||
|
||||
} );
|
||||
|
||||
function update() {
|
||||
|
||||
plot.setData( [ getRandomData() ] );
|
||||
|
||||
// Since the axes don't change, we don't need to call plot.setupGrid()
|
||||
|
||||
plot.draw();
|
||||
setTimeout( update, updateInterval );
|
||||
}
|
||||
|
||||
update();
|
||||
|
||||
},
|
||||
|
||||
lineFlot: function(){
|
||||
|
||||
var sin = [],
|
||||
cos = [];
|
||||
|
||||
for ( var i = 0; i < 10; i += 0.1 ) {
|
||||
sin.push( [ i, Math.sin( i ) ] );
|
||||
cos.push( [ i, Math.cos( i ) ] );
|
||||
}
|
||||
|
||||
var plot = $.plot( "#flot-line", [
|
||||
{
|
||||
data: sin,
|
||||
label: "sin(x)"
|
||||
},
|
||||
{
|
||||
data: cos,
|
||||
label: "cos(x)"
|
||||
}
|
||||
], {
|
||||
series: {
|
||||
lines: {
|
||||
show: true
|
||||
},
|
||||
points: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
min: -1.2,
|
||||
max: 1.2
|
||||
},
|
||||
colors: [ "#007BFF", "#DC3545" ],
|
||||
grid: {
|
||||
color: "#fff",
|
||||
hoverable: true,
|
||||
borderWidth: 0,
|
||||
backgroundColor: 'transparent'
|
||||
},
|
||||
tooltip: true,
|
||||
tooltipOpts: {
|
||||
content: "'%s' of %x.1 is %y.4",
|
||||
shifts: {
|
||||
x: -60,
|
||||
y: 25
|
||||
}
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
pieFlot: function(){
|
||||
|
||||
var data = [
|
||||
{
|
||||
label: "Primary",
|
||||
data: 1,
|
||||
color: "#8fc9fb"
|
||||
},
|
||||
{
|
||||
label: "Success",
|
||||
data: 3,
|
||||
color: "#007BFF"
|
||||
},
|
||||
{
|
||||
label: "Danger",
|
||||
data: 9,
|
||||
color: "#19A9D5"
|
||||
},
|
||||
{
|
||||
label: "Warning",
|
||||
data: 20,
|
||||
color: "#DC3545"
|
||||
}
|
||||
];
|
||||
|
||||
var plotObj = $.plot( $( "#flot-pie" ), data, {
|
||||
series: {
|
||||
pie: {
|
||||
show: true,
|
||||
radius: 1,
|
||||
label: {
|
||||
show: false,
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
hoverable: true
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
content: "%p.0%, %s, n=%n", // show percentages, rounding to 2 decimal places
|
||||
shifts: {
|
||||
x: 20,
|
||||
y: 0
|
||||
},
|
||||
defaultTheme: false
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
line2Flot: function(){
|
||||
|
||||
// first chart
|
||||
var chart1Options = {
|
||||
series: {
|
||||
lines: {
|
||||
show: true
|
||||
},
|
||||
points: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
xaxis: {
|
||||
mode: "time",
|
||||
timeformat: "%m/%d",
|
||||
minTickSize: [ 1, "day" ]
|
||||
},
|
||||
grid: {
|
||||
hoverable: true
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
grid: {
|
||||
color: "#fff",
|
||||
hoverable: true,
|
||||
borderWidth: 0,
|
||||
backgroundColor: 'transparent'
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
content: "y: %y"
|
||||
}
|
||||
};
|
||||
var chart1Data = {
|
||||
label: "chart1",
|
||||
color: "#007BFF",
|
||||
data: [
|
||||
[ 1354521600000, 6322 ],
|
||||
[ 1355040000000, 6360 ],
|
||||
[ 1355223600000, 6368 ],
|
||||
[ 1355306400000, 6374 ],
|
||||
[ 1355487300000, 6388 ],
|
||||
[ 1355571900000, 6393 ]
|
||||
]
|
||||
};
|
||||
$.plot( $( "#chart1" ), [ chart1Data ], chart1Options );
|
||||
},
|
||||
|
||||
barFlot: function(){
|
||||
|
||||
// second chart
|
||||
var flotBarOptions = {
|
||||
series: {
|
||||
bars: {
|
||||
show: true,
|
||||
barWidth: 43200000
|
||||
}
|
||||
},
|
||||
xaxis: {
|
||||
mode: "time",
|
||||
timeformat: "%m/%d",
|
||||
minTickSize: [ 1, "day" ]
|
||||
},
|
||||
grid: {
|
||||
hoverable: true
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
grid: {
|
||||
color: "#fff",
|
||||
hoverable: true,
|
||||
borderWidth: 0,
|
||||
backgroundColor: 'transparent'
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
content: "x: %x, y: %y"
|
||||
}
|
||||
};
|
||||
var flotBarData = {
|
||||
label: "flotBar",
|
||||
color: "#007BFF",
|
||||
data: [
|
||||
[ 1354521600000, 1000 ],
|
||||
[ 1355040000000, 2000 ],
|
||||
[ 1355223600000, 3000 ],
|
||||
[ 1355306400000, 4000 ],
|
||||
[ 1355487300000, 5000 ],
|
||||
[ 1355571900000, 6000 ]
|
||||
]
|
||||
};
|
||||
$.plot( $( "#flotBar" ), [ flotBarData ], flotBarOptions );
|
||||
|
||||
},
|
||||
|
||||
plotting: function(){
|
||||
|
||||
var d1 = [ [ 20, 20 ], [ 42, 60 ], [ 54, 20 ], [ 80, 80 ] ];
|
||||
|
||||
//flot options
|
||||
var options = {
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
series: {
|
||||
label: "Curved Lines Test",
|
||||
curvedLines: {
|
||||
active: true,
|
||||
nrSplinePoints: 20
|
||||
}
|
||||
},
|
||||
|
||||
grid: {
|
||||
color: "#fff",
|
||||
hoverable: true,
|
||||
borderWidth: 0,
|
||||
backgroundColor: 'transparent'
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
content: "%s | x: %x; y: %y"
|
||||
},
|
||||
yaxes: [ {
|
||||
min: 10,
|
||||
max: 90
|
||||
}, {
|
||||
position: 'right'
|
||||
} ]
|
||||
};
|
||||
|
||||
//plotting
|
||||
$.plot( $( "#flotCurve" ), [
|
||||
{
|
||||
data: d1,
|
||||
lines: {
|
||||
show: true,
|
||||
fill: true,
|
||||
fillColor: "rgba(0,123,255,.15)",
|
||||
lineWidth: 3
|
||||
},
|
||||
//curve the line (old pre 1.0.0 plotting function)
|
||||
curvedLines: {
|
||||
apply: true,
|
||||
show: true,
|
||||
fill: true,
|
||||
fillColor: "rgba(0,123,255,.15)",
|
||||
|
||||
}
|
||||
}, {
|
||||
data: d1,
|
||||
points: {
|
||||
show: true,
|
||||
fill: true,
|
||||
fillColor: "rgba(0,123,255,.15)",
|
||||
}
|
||||
}
|
||||
], options );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
SufeeAdmin.cpuLoad();
|
||||
SufeeAdmin.lineFlot();
|
||||
SufeeAdmin.pieFlot();
|
||||
SufeeAdmin.line2Flot();
|
||||
SufeeAdmin.barFlot();
|
||||
SufeeAdmin.plotting();
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,190 @@
|
||||
/* Flot plugin for plotting textual data or categories.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin
|
||||
allows you to plot such a dataset directly.
|
||||
|
||||
To enable it, you must specify mode: "categories" on the axis with the textual
|
||||
labels, e.g.
|
||||
|
||||
$.plot("#placeholder", data, { xaxis: { mode: "categories" } });
|
||||
|
||||
By default, the labels are ordered as they are met in the data series. If you
|
||||
need a different ordering, you can specify "categories" on the axis options
|
||||
and list the categories there:
|
||||
|
||||
xaxis: {
|
||||
mode: "categories",
|
||||
categories: ["February", "March", "April"]
|
||||
}
|
||||
|
||||
If you need to customize the distances between the categories, you can specify
|
||||
"categories" as an object mapping labels to values
|
||||
|
||||
xaxis: {
|
||||
mode: "categories",
|
||||
categories: { "February": 1, "March": 3, "April": 4 }
|
||||
}
|
||||
|
||||
If you don't specify all categories, the remaining categories will be numbered
|
||||
from the max value plus 1 (with a spacing of 1 between each).
|
||||
|
||||
Internally, the plugin works by transforming the input data through an auto-
|
||||
generated mapping where the first category becomes 0, the second 1, etc.
|
||||
Hence, a point like ["February", 34] becomes [0, 34] internally in Flot (this
|
||||
is visible in hover and click events that return numbers rather than the
|
||||
category labels). The plugin also overrides the tick generator to spit out the
|
||||
categories as ticks instead of the values.
|
||||
|
||||
If you need to map a value back to its label, the mapping is always accessible
|
||||
as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
xaxis: {
|
||||
categories: null
|
||||
},
|
||||
yaxis: {
|
||||
categories: null
|
||||
}
|
||||
};
|
||||
|
||||
function processRawData(plot, series, data, datapoints) {
|
||||
// if categories are enabled, we need to disable
|
||||
// auto-transformation to numbers so the strings are intact
|
||||
// for later processing
|
||||
|
||||
var xCategories = series.xaxis.options.mode == "categories",
|
||||
yCategories = series.yaxis.options.mode == "categories";
|
||||
|
||||
if (!(xCategories || yCategories))
|
||||
return;
|
||||
|
||||
var format = datapoints.format;
|
||||
|
||||
if (!format) {
|
||||
// FIXME: auto-detection should really not be defined here
|
||||
var s = series;
|
||||
format = [];
|
||||
format.push({ x: true, number: true, required: true });
|
||||
format.push({ y: true, number: true, required: true });
|
||||
|
||||
if (s.bars.show || (s.lines.show && s.lines.fill)) {
|
||||
var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));
|
||||
format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale });
|
||||
if (s.bars.horizontal) {
|
||||
delete format[format.length - 1].y;
|
||||
format[format.length - 1].x = true;
|
||||
}
|
||||
}
|
||||
|
||||
datapoints.format = format;
|
||||
}
|
||||
|
||||
for (var m = 0; m < format.length; ++m) {
|
||||
if (format[m].x && xCategories)
|
||||
format[m].number = false;
|
||||
|
||||
if (format[m].y && yCategories)
|
||||
format[m].number = false;
|
||||
}
|
||||
}
|
||||
|
||||
function getNextIndex(categories) {
|
||||
var index = -1;
|
||||
|
||||
for (var v in categories)
|
||||
if (categories[v] > index)
|
||||
index = categories[v];
|
||||
|
||||
return index + 1;
|
||||
}
|
||||
|
||||
function categoriesTickGenerator(axis) {
|
||||
var res = [];
|
||||
for (var label in axis.categories) {
|
||||
var v = axis.categories[label];
|
||||
if (v >= axis.min && v <= axis.max)
|
||||
res.push([v, label]);
|
||||
}
|
||||
|
||||
res.sort(function (a, b) { return a[0] - b[0]; });
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
function setupCategoriesForAxis(series, axis, datapoints) {
|
||||
if (series[axis].options.mode != "categories")
|
||||
return;
|
||||
|
||||
if (!series[axis].categories) {
|
||||
// parse options
|
||||
var c = {}, o = series[axis].options.categories || {};
|
||||
if ($.isArray(o)) {
|
||||
for (var i = 0; i < o.length; ++i)
|
||||
c[o[i]] = i;
|
||||
}
|
||||
else {
|
||||
for (var v in o)
|
||||
c[v] = o[v];
|
||||
}
|
||||
|
||||
series[axis].categories = c;
|
||||
}
|
||||
|
||||
// fix ticks
|
||||
if (!series[axis].options.ticks)
|
||||
series[axis].options.ticks = categoriesTickGenerator;
|
||||
|
||||
transformPointsOnAxis(datapoints, axis, series[axis].categories);
|
||||
}
|
||||
|
||||
function transformPointsOnAxis(datapoints, axis, categories) {
|
||||
// go through the points, transforming them
|
||||
var points = datapoints.points,
|
||||
ps = datapoints.pointsize,
|
||||
format = datapoints.format,
|
||||
formatColumn = axis.charAt(0),
|
||||
index = getNextIndex(categories);
|
||||
|
||||
for (var i = 0; i < points.length; i += ps) {
|
||||
if (points[i] == null)
|
||||
continue;
|
||||
|
||||
for (var m = 0; m < ps; ++m) {
|
||||
var val = points[i + m];
|
||||
|
||||
if (val == null || !format[m][formatColumn])
|
||||
continue;
|
||||
|
||||
if (!(val in categories)) {
|
||||
categories[val] = index;
|
||||
++index;
|
||||
}
|
||||
|
||||
points[i + m] = categories[val];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function processDatapoints(plot, series, datapoints) {
|
||||
setupCategoriesForAxis(series, "xaxis", datapoints);
|
||||
setupCategoriesForAxis(series, "yaxis", datapoints);
|
||||
}
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processRawData.push(processRawData);
|
||||
plot.hooks.processDatapoints.push(processDatapoints);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'categories',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,176 @@
|
||||
/* Flot plugin for showing crosshairs when the mouse hovers over the plot.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
crosshair: {
|
||||
mode: null or "x" or "y" or "xy"
|
||||
color: color
|
||||
lineWidth: number
|
||||
}
|
||||
|
||||
Set the mode to one of "x", "y" or "xy". The "x" mode enables a vertical
|
||||
crosshair that lets you trace the values on the x axis, "y" enables a
|
||||
horizontal crosshair and "xy" enables them both. "color" is the color of the
|
||||
crosshair (default is "rgba(170, 0, 0, 0.80)"), "lineWidth" is the width of
|
||||
the drawn lines (default is 1).
|
||||
|
||||
The plugin also adds four public methods:
|
||||
|
||||
- setCrosshair( pos )
|
||||
|
||||
Set the position of the crosshair. Note that this is cleared if the user
|
||||
moves the mouse. "pos" is in coordinates of the plot and should be on the
|
||||
form { x: xpos, y: ypos } (you can use x2/x3/... if you're using multiple
|
||||
axes), which is coincidentally the same format as what you get from a
|
||||
"plothover" event. If "pos" is null, the crosshair is cleared.
|
||||
|
||||
- clearCrosshair()
|
||||
|
||||
Clear the crosshair.
|
||||
|
||||
- lockCrosshair(pos)
|
||||
|
||||
Cause the crosshair to lock to the current location, no longer updating if
|
||||
the user moves the mouse. Optionally supply a position (passed on to
|
||||
setCrosshair()) to move it to.
|
||||
|
||||
Example usage:
|
||||
|
||||
var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
|
||||
$("#graph").bind( "plothover", function ( evt, position, item ) {
|
||||
if ( item ) {
|
||||
// Lock the crosshair to the data point being hovered
|
||||
myFlot.lockCrosshair({
|
||||
x: item.datapoint[ 0 ],
|
||||
y: item.datapoint[ 1 ]
|
||||
});
|
||||
} else {
|
||||
// Return normal crosshair operation
|
||||
myFlot.unlockCrosshair();
|
||||
}
|
||||
});
|
||||
|
||||
- unlockCrosshair()
|
||||
|
||||
Free the crosshair to move again after locking it.
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
crosshair: {
|
||||
mode: null, // one of null, "x", "y" or "xy",
|
||||
color: "rgba(170, 0, 0, 0.80)",
|
||||
lineWidth: 1
|
||||
}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
// position of crosshair in pixels
|
||||
var crosshair = { x: -1, y: -1, locked: false };
|
||||
|
||||
plot.setCrosshair = function setCrosshair(pos) {
|
||||
if (!pos)
|
||||
crosshair.x = -1;
|
||||
else {
|
||||
var o = plot.p2c(pos);
|
||||
crosshair.x = Math.max(0, Math.min(o.left, plot.width()));
|
||||
crosshair.y = Math.max(0, Math.min(o.top, plot.height()));
|
||||
}
|
||||
|
||||
plot.triggerRedrawOverlay();
|
||||
};
|
||||
|
||||
plot.clearCrosshair = plot.setCrosshair; // passes null for pos
|
||||
|
||||
plot.lockCrosshair = function lockCrosshair(pos) {
|
||||
if (pos)
|
||||
plot.setCrosshair(pos);
|
||||
crosshair.locked = true;
|
||||
};
|
||||
|
||||
plot.unlockCrosshair = function unlockCrosshair() {
|
||||
crosshair.locked = false;
|
||||
};
|
||||
|
||||
function onMouseOut(e) {
|
||||
if (crosshair.locked)
|
||||
return;
|
||||
|
||||
if (crosshair.x != -1) {
|
||||
crosshair.x = -1;
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
function onMouseMove(e) {
|
||||
if (crosshair.locked)
|
||||
return;
|
||||
|
||||
if (plot.getSelection && plot.getSelection()) {
|
||||
crosshair.x = -1; // hide the crosshair while selecting
|
||||
return;
|
||||
}
|
||||
|
||||
var offset = plot.offset();
|
||||
crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));
|
||||
crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
|
||||
plot.hooks.bindEvents.push(function (plot, eventHolder) {
|
||||
if (!plot.getOptions().crosshair.mode)
|
||||
return;
|
||||
|
||||
eventHolder.mouseout(onMouseOut);
|
||||
eventHolder.mousemove(onMouseMove);
|
||||
});
|
||||
|
||||
plot.hooks.drawOverlay.push(function (plot, ctx) {
|
||||
var c = plot.getOptions().crosshair;
|
||||
if (!c.mode)
|
||||
return;
|
||||
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(plotOffset.left, plotOffset.top);
|
||||
|
||||
if (crosshair.x != -1) {
|
||||
var adj = plot.getOptions().crosshair.lineWidth % 2 ? 0.5 : 0;
|
||||
|
||||
ctx.strokeStyle = c.color;
|
||||
ctx.lineWidth = c.lineWidth;
|
||||
ctx.lineJoin = "round";
|
||||
|
||||
ctx.beginPath();
|
||||
if (c.mode.indexOf("x") != -1) {
|
||||
var drawX = Math.floor(crosshair.x) + adj;
|
||||
ctx.moveTo(drawX, 0);
|
||||
ctx.lineTo(drawX, plot.height());
|
||||
}
|
||||
if (c.mode.indexOf("y") != -1) {
|
||||
var drawY = Math.floor(crosshair.y) + adj;
|
||||
ctx.moveTo(0, drawY);
|
||||
ctx.lineTo(plot.width(), drawY);
|
||||
}
|
||||
ctx.stroke();
|
||||
}
|
||||
ctx.restore();
|
||||
});
|
||||
|
||||
plot.hooks.shutdown.push(function (plot, eventHolder) {
|
||||
eventHolder.unbind("mouseout", onMouseOut);
|
||||
eventHolder.unbind("mousemove", onMouseMove);
|
||||
});
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'crosshair',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
+3168
File diff suppressed because it is too large
Load Diff
+820
@@ -0,0 +1,820 @@
|
||||
/* Flot plugin for rendering pie charts.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The plugin assumes that each series has a single data value, and that each
|
||||
value is a positive integer or zero. Negative numbers don't make sense for a
|
||||
pie chart, and have unpredictable results. The values do NOT need to be
|
||||
passed in as percentages; the plugin will calculate the total and per-slice
|
||||
percentages internally.
|
||||
|
||||
* Created by Brian Medendorp
|
||||
|
||||
* Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
series: {
|
||||
pie: {
|
||||
show: true/false
|
||||
radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'
|
||||
innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect
|
||||
startAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result
|
||||
tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)
|
||||
offset: {
|
||||
top: integer value to move the pie up or down
|
||||
left: integer value to move the pie left or right, or 'auto'
|
||||
},
|
||||
stroke: {
|
||||
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')
|
||||
width: integer pixel width of the stroke
|
||||
},
|
||||
label: {
|
||||
show: true/false, or 'auto'
|
||||
formatter: a user-defined function that modifies the text/style of the label text
|
||||
radius: 0-1 for percentage of fullsize, or a specified pixel length
|
||||
background: {
|
||||
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')
|
||||
opacity: 0-1
|
||||
},
|
||||
threshold: 0-1 for the percentage value at which to hide labels (if they're too small)
|
||||
},
|
||||
combine: {
|
||||
threshold: 0-1 for the percentage value at which to combine slices (if they're too small)
|
||||
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined
|
||||
label: any text value of what the combined slice should be labeled
|
||||
}
|
||||
highlight: {
|
||||
opacity: 0-1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
More detail and specific examples can be found in the included HTML file.
|
||||
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
// Maximum redraw attempts when fitting labels within the plot
|
||||
|
||||
var REDRAW_ATTEMPTS = 10;
|
||||
|
||||
// Factor by which to shrink the pie when fitting labels within the plot
|
||||
|
||||
var REDRAW_SHRINK = 0.95;
|
||||
|
||||
function init(plot) {
|
||||
|
||||
var canvas = null,
|
||||
target = null,
|
||||
options = null,
|
||||
maxRadius = null,
|
||||
centerLeft = null,
|
||||
centerTop = null,
|
||||
processed = false,
|
||||
ctx = null;
|
||||
|
||||
// interactive variables
|
||||
|
||||
var highlights = [];
|
||||
|
||||
// add hook to determine if pie plugin in enabled, and then perform necessary operations
|
||||
|
||||
plot.hooks.processOptions.push(function(plot, options) {
|
||||
if (options.series.pie.show) {
|
||||
|
||||
options.grid.show = false;
|
||||
|
||||
// set labels.show
|
||||
|
||||
if (options.series.pie.label.show == "auto") {
|
||||
if (options.legend.show) {
|
||||
options.series.pie.label.show = false;
|
||||
} else {
|
||||
options.series.pie.label.show = true;
|
||||
}
|
||||
}
|
||||
|
||||
// set radius
|
||||
|
||||
if (options.series.pie.radius == "auto") {
|
||||
if (options.series.pie.label.show) {
|
||||
options.series.pie.radius = 3/4;
|
||||
} else {
|
||||
options.series.pie.radius = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// ensure sane tilt
|
||||
|
||||
if (options.series.pie.tilt > 1) {
|
||||
options.series.pie.tilt = 1;
|
||||
} else if (options.series.pie.tilt < 0) {
|
||||
options.series.pie.tilt = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.bindEvents.push(function(plot, eventHolder) {
|
||||
var options = plot.getOptions();
|
||||
if (options.series.pie.show) {
|
||||
if (options.grid.hoverable) {
|
||||
eventHolder.unbind("mousemove").mousemove(onMouseMove);
|
||||
}
|
||||
if (options.grid.clickable) {
|
||||
eventHolder.unbind("click").click(onClick);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.processDatapoints.push(function(plot, series, data, datapoints) {
|
||||
var options = plot.getOptions();
|
||||
if (options.series.pie.show) {
|
||||
processDatapoints(plot, series, data, datapoints);
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.drawOverlay.push(function(plot, octx) {
|
||||
var options = plot.getOptions();
|
||||
if (options.series.pie.show) {
|
||||
drawOverlay(plot, octx);
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.draw.push(function(plot, newCtx) {
|
||||
var options = plot.getOptions();
|
||||
if (options.series.pie.show) {
|
||||
draw(plot, newCtx);
|
||||
}
|
||||
});
|
||||
|
||||
function processDatapoints(plot, series, datapoints) {
|
||||
if (!processed) {
|
||||
processed = true;
|
||||
canvas = plot.getCanvas();
|
||||
target = $(canvas).parent();
|
||||
options = plot.getOptions();
|
||||
plot.setData(combine(plot.getData()));
|
||||
}
|
||||
}
|
||||
|
||||
function combine(data) {
|
||||
|
||||
var total = 0,
|
||||
combined = 0,
|
||||
numCombined = 0,
|
||||
color = options.series.pie.combine.color,
|
||||
newdata = [];
|
||||
|
||||
// Fix up the raw data from Flot, ensuring the data is numeric
|
||||
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
|
||||
var value = data[i].data;
|
||||
|
||||
// If the data is an array, we'll assume that it's a standard
|
||||
// Flot x-y pair, and are concerned only with the second value.
|
||||
|
||||
// Note how we use the original array, rather than creating a
|
||||
// new one; this is more efficient and preserves any extra data
|
||||
// that the user may have stored in higher indexes.
|
||||
|
||||
if ($.isArray(value) && value.length == 1) {
|
||||
value = value[0];
|
||||
}
|
||||
|
||||
if ($.isArray(value)) {
|
||||
// Equivalent to $.isNumeric() but compatible with jQuery < 1.7
|
||||
if (!isNaN(parseFloat(value[1])) && isFinite(value[1])) {
|
||||
value[1] = +value[1];
|
||||
} else {
|
||||
value[1] = 0;
|
||||
}
|
||||
} else if (!isNaN(parseFloat(value)) && isFinite(value)) {
|
||||
value = [1, +value];
|
||||
} else {
|
||||
value = [1, 0];
|
||||
}
|
||||
|
||||
data[i].data = [value];
|
||||
}
|
||||
|
||||
// Sum up all the slices, so we can calculate percentages for each
|
||||
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
total += data[i].data[0][1];
|
||||
}
|
||||
|
||||
// Count the number of slices with percentages below the combine
|
||||
// threshold; if it turns out to be just one, we won't combine.
|
||||
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
var value = data[i].data[0][1];
|
||||
if (value / total <= options.series.pie.combine.threshold) {
|
||||
combined += value;
|
||||
numCombined++;
|
||||
if (!color) {
|
||||
color = data[i].color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
var value = data[i].data[0][1];
|
||||
if (numCombined < 2 || value / total > options.series.pie.combine.threshold) {
|
||||
newdata.push(
|
||||
$.extend(data[i], { /* extend to allow keeping all other original data values
|
||||
and using them e.g. in labelFormatter. */
|
||||
data: [[1, value]],
|
||||
color: data[i].color,
|
||||
label: data[i].label,
|
||||
angle: value * Math.PI * 2 / total,
|
||||
percent: value / (total / 100)
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (numCombined > 1) {
|
||||
newdata.push({
|
||||
data: [[1, combined]],
|
||||
color: color,
|
||||
label: options.series.pie.combine.label,
|
||||
angle: combined * Math.PI * 2 / total,
|
||||
percent: combined / (total / 100)
|
||||
});
|
||||
}
|
||||
|
||||
return newdata;
|
||||
}
|
||||
|
||||
function draw(plot, newCtx) {
|
||||
|
||||
if (!target) {
|
||||
return; // if no series were passed
|
||||
}
|
||||
|
||||
var canvasWidth = plot.getPlaceholder().width(),
|
||||
canvasHeight = plot.getPlaceholder().height(),
|
||||
legendWidth = target.children().filter(".legend").children().width() || 0;
|
||||
|
||||
ctx = newCtx;
|
||||
|
||||
// WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE!
|
||||
|
||||
// When combining smaller slices into an 'other' slice, we need to
|
||||
// add a new series. Since Flot gives plugins no way to modify the
|
||||
// list of series, the pie plugin uses a hack where the first call
|
||||
// to processDatapoints results in a call to setData with the new
|
||||
// list of series, then subsequent processDatapoints do nothing.
|
||||
|
||||
// The plugin-global 'processed' flag is used to control this hack;
|
||||
// it starts out false, and is set to true after the first call to
|
||||
// processDatapoints.
|
||||
|
||||
// Unfortunately this turns future setData calls into no-ops; they
|
||||
// call processDatapoints, the flag is true, and nothing happens.
|
||||
|
||||
// To fix this we'll set the flag back to false here in draw, when
|
||||
// all series have been processed, so the next sequence of calls to
|
||||
// processDatapoints once again starts out with a slice-combine.
|
||||
// This is really a hack; in 0.9 we need to give plugins a proper
|
||||
// way to modify series before any processing begins.
|
||||
|
||||
processed = false;
|
||||
|
||||
// calculate maximum radius and center point
|
||||
|
||||
maxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2;
|
||||
centerTop = canvasHeight / 2 + options.series.pie.offset.top;
|
||||
centerLeft = canvasWidth / 2;
|
||||
|
||||
if (options.series.pie.offset.left == "auto") {
|
||||
if (options.legend.position.match("w")) {
|
||||
centerLeft += legendWidth / 2;
|
||||
} else {
|
||||
centerLeft -= legendWidth / 2;
|
||||
}
|
||||
if (centerLeft < maxRadius) {
|
||||
centerLeft = maxRadius;
|
||||
} else if (centerLeft > canvasWidth - maxRadius) {
|
||||
centerLeft = canvasWidth - maxRadius;
|
||||
}
|
||||
} else {
|
||||
centerLeft += options.series.pie.offset.left;
|
||||
}
|
||||
|
||||
var slices = plot.getData(),
|
||||
attempts = 0;
|
||||
|
||||
// Keep shrinking the pie's radius until drawPie returns true,
|
||||
// indicating that all the labels fit, or we try too many times.
|
||||
|
||||
do {
|
||||
if (attempts > 0) {
|
||||
maxRadius *= REDRAW_SHRINK;
|
||||
}
|
||||
attempts += 1;
|
||||
clear();
|
||||
if (options.series.pie.tilt <= 0.8) {
|
||||
drawShadow();
|
||||
}
|
||||
} while (!drawPie() && attempts < REDRAW_ATTEMPTS)
|
||||
|
||||
if (attempts >= REDRAW_ATTEMPTS) {
|
||||
clear();
|
||||
target.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>");
|
||||
}
|
||||
|
||||
if (plot.setSeries && plot.insertLegend) {
|
||||
plot.setSeries(slices);
|
||||
plot.insertLegend();
|
||||
}
|
||||
|
||||
// we're actually done at this point, just defining internal functions at this point
|
||||
|
||||
function clear() {
|
||||
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
|
||||
target.children().filter(".pieLabel, .pieLabelBackground").remove();
|
||||
}
|
||||
|
||||
function drawShadow() {
|
||||
|
||||
var shadowLeft = options.series.pie.shadow.left;
|
||||
var shadowTop = options.series.pie.shadow.top;
|
||||
var edge = 10;
|
||||
var alpha = options.series.pie.shadow.alpha;
|
||||
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
|
||||
|
||||
if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) {
|
||||
return; // shadow would be outside canvas, so don't draw it
|
||||
}
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(shadowLeft,shadowTop);
|
||||
ctx.globalAlpha = alpha;
|
||||
ctx.fillStyle = "#000";
|
||||
|
||||
// center and rotate to starting position
|
||||
|
||||
ctx.translate(centerLeft,centerTop);
|
||||
ctx.scale(1, options.series.pie.tilt);
|
||||
|
||||
//radius -= edge;
|
||||
|
||||
for (var i = 1; i <= edge; i++) {
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, radius, 0, Math.PI * 2, false);
|
||||
ctx.fill();
|
||||
radius -= i;
|
||||
}
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
function drawPie() {
|
||||
|
||||
var startAngle = Math.PI * options.series.pie.startAngle;
|
||||
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
|
||||
|
||||
// center and rotate to starting position
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(centerLeft,centerTop);
|
||||
ctx.scale(1, options.series.pie.tilt);
|
||||
//ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera
|
||||
|
||||
// draw slices
|
||||
|
||||
ctx.save();
|
||||
var currentAngle = startAngle;
|
||||
for (var i = 0; i < slices.length; ++i) {
|
||||
slices[i].startAngle = currentAngle;
|
||||
drawSlice(slices[i].angle, slices[i].color, true);
|
||||
}
|
||||
ctx.restore();
|
||||
|
||||
// draw slice outlines
|
||||
|
||||
if (options.series.pie.stroke.width > 0) {
|
||||
ctx.save();
|
||||
ctx.lineWidth = options.series.pie.stroke.width;
|
||||
currentAngle = startAngle;
|
||||
for (var i = 0; i < slices.length; ++i) {
|
||||
drawSlice(slices[i].angle, options.series.pie.stroke.color, false);
|
||||
}
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
// draw donut hole
|
||||
|
||||
drawDonutHole(ctx);
|
||||
|
||||
ctx.restore();
|
||||
|
||||
// Draw the labels, returning true if they fit within the plot
|
||||
|
||||
if (options.series.pie.label.show) {
|
||||
return drawLabels();
|
||||
} else return true;
|
||||
|
||||
function drawSlice(angle, color, fill) {
|
||||
|
||||
if (angle <= 0 || isNaN(angle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (fill) {
|
||||
ctx.fillStyle = color;
|
||||
} else {
|
||||
ctx.strokeStyle = color;
|
||||
ctx.lineJoin = "round";
|
||||
}
|
||||
|
||||
ctx.beginPath();
|
||||
if (Math.abs(angle - Math.PI * 2) > 0.000000001) {
|
||||
ctx.moveTo(0, 0); // Center of the pie
|
||||
}
|
||||
|
||||
//ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera
|
||||
ctx.arc(0, 0, radius,currentAngle, currentAngle + angle / 2, false);
|
||||
ctx.arc(0, 0, radius,currentAngle + angle / 2, currentAngle + angle, false);
|
||||
ctx.closePath();
|
||||
//ctx.rotate(angle); // This doesn't work properly in Opera
|
||||
currentAngle += angle;
|
||||
|
||||
if (fill) {
|
||||
ctx.fill();
|
||||
} else {
|
||||
ctx.stroke();
|
||||
}
|
||||
}
|
||||
|
||||
function drawLabels() {
|
||||
|
||||
var currentAngle = startAngle;
|
||||
var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;
|
||||
|
||||
for (var i = 0; i < slices.length; ++i) {
|
||||
if (slices[i].percent >= options.series.pie.label.threshold * 100) {
|
||||
if (!drawLabel(slices[i], currentAngle, i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
currentAngle += slices[i].angle;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
function drawLabel(slice, startAngle, index) {
|
||||
|
||||
if (slice.data[0][1] == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// format label text
|
||||
|
||||
var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;
|
||||
|
||||
if (lf) {
|
||||
text = lf(slice.label, slice);
|
||||
} else {
|
||||
text = slice.label;
|
||||
}
|
||||
|
||||
if (plf) {
|
||||
text = plf(text, slice);
|
||||
}
|
||||
|
||||
var halfAngle = ((startAngle + slice.angle) + startAngle) / 2;
|
||||
var x = centerLeft + Math.round(Math.cos(halfAngle) * radius);
|
||||
var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;
|
||||
|
||||
var html = "<span class='pieLabel' id='pieLabel" + index + "' style='position:absolute;top:" + y + "px;left:" + x + "px;'>" + text + "</span>";
|
||||
target.append(html);
|
||||
|
||||
var label = target.children("#pieLabel" + index);
|
||||
var labelTop = (y - label.height() / 2);
|
||||
var labelLeft = (x - label.width() / 2);
|
||||
|
||||
label.css("top", labelTop);
|
||||
label.css("left", labelLeft);
|
||||
|
||||
// check to make sure that the label is not outside the canvas
|
||||
|
||||
if (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.height()) < 0 || canvasWidth - (labelLeft + label.width()) < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.series.pie.label.background.opacity != 0) {
|
||||
|
||||
// put in the transparent background separately to avoid blended labels and label boxes
|
||||
|
||||
var c = options.series.pie.label.background.color;
|
||||
|
||||
if (c == null) {
|
||||
c = slice.color;
|
||||
}
|
||||
|
||||
var pos = "top:" + labelTop + "px;left:" + labelLeft + "px;";
|
||||
$("<div class='pieLabelBackground' style='position:absolute;width:" + label.width() + "px;height:" + label.height() + "px;" + pos + "background-color:" + c + ";'></div>")
|
||||
.css("opacity", options.series.pie.label.background.opacity)
|
||||
.insertBefore(label);
|
||||
}
|
||||
|
||||
return true;
|
||||
} // end individual label function
|
||||
} // end drawLabels function
|
||||
} // end drawPie function
|
||||
} // end draw function
|
||||
|
||||
// Placed here because it needs to be accessed from multiple locations
|
||||
|
||||
function drawDonutHole(layer) {
|
||||
if (options.series.pie.innerRadius > 0) {
|
||||
|
||||
// subtract the center
|
||||
|
||||
layer.save();
|
||||
var innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;
|
||||
layer.globalCompositeOperation = "destination-out"; // this does not work with excanvas, but it will fall back to using the stroke color
|
||||
layer.beginPath();
|
||||
layer.fillStyle = options.series.pie.stroke.color;
|
||||
layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
|
||||
layer.fill();
|
||||
layer.closePath();
|
||||
layer.restore();
|
||||
|
||||
// add inner stroke
|
||||
|
||||
layer.save();
|
||||
layer.beginPath();
|
||||
layer.strokeStyle = options.series.pie.stroke.color;
|
||||
layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
|
||||
layer.stroke();
|
||||
layer.closePath();
|
||||
layer.restore();
|
||||
|
||||
// TODO: add extra shadow inside hole (with a mask) if the pie is tilted.
|
||||
}
|
||||
}
|
||||
|
||||
//-- Additional Interactive related functions --
|
||||
|
||||
function isPointInPoly(poly, pt) {
|
||||
for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)
|
||||
((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1]))
|
||||
&& (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0])
|
||||
&& (c = !c);
|
||||
return c;
|
||||
}
|
||||
|
||||
function findNearbySlice(mouseX, mouseY) {
|
||||
|
||||
var slices = plot.getData(),
|
||||
options = plot.getOptions(),
|
||||
radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,
|
||||
x, y;
|
||||
|
||||
for (var i = 0; i < slices.length; ++i) {
|
||||
|
||||
var s = slices[i];
|
||||
|
||||
if (s.pie.show) {
|
||||
|
||||
ctx.save();
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 0); // Center of the pie
|
||||
//ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here.
|
||||
ctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false);
|
||||
ctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false);
|
||||
ctx.closePath();
|
||||
x = mouseX - centerLeft;
|
||||
y = mouseY - centerTop;
|
||||
|
||||
if (ctx.isPointInPath) {
|
||||
if (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) {
|
||||
ctx.restore();
|
||||
return {
|
||||
datapoint: [s.percent, s.data],
|
||||
dataIndex: 0,
|
||||
series: s,
|
||||
seriesIndex: i
|
||||
};
|
||||
}
|
||||
} else {
|
||||
|
||||
// excanvas for IE doesn;t support isPointInPath, this is a workaround.
|
||||
|
||||
var p1X = radius * Math.cos(s.startAngle),
|
||||
p1Y = radius * Math.sin(s.startAngle),
|
||||
p2X = radius * Math.cos(s.startAngle + s.angle / 4),
|
||||
p2Y = radius * Math.sin(s.startAngle + s.angle / 4),
|
||||
p3X = radius * Math.cos(s.startAngle + s.angle / 2),
|
||||
p3Y = radius * Math.sin(s.startAngle + s.angle / 2),
|
||||
p4X = radius * Math.cos(s.startAngle + s.angle / 1.5),
|
||||
p4Y = radius * Math.sin(s.startAngle + s.angle / 1.5),
|
||||
p5X = radius * Math.cos(s.startAngle + s.angle),
|
||||
p5Y = radius * Math.sin(s.startAngle + s.angle),
|
||||
arrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]],
|
||||
arrPoint = [x, y];
|
||||
|
||||
// TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?
|
||||
|
||||
if (isPointInPoly(arrPoly, arrPoint)) {
|
||||
ctx.restore();
|
||||
return {
|
||||
datapoint: [s.percent, s.data],
|
||||
dataIndex: 0,
|
||||
series: s,
|
||||
seriesIndex: i
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function onMouseMove(e) {
|
||||
triggerClickHoverEvent("plothover", e);
|
||||
}
|
||||
|
||||
function onClick(e) {
|
||||
triggerClickHoverEvent("plotclick", e);
|
||||
}
|
||||
|
||||
// trigger click or hover event (they send the same parameters so we share their code)
|
||||
|
||||
function triggerClickHoverEvent(eventname, e) {
|
||||
|
||||
var offset = plot.offset();
|
||||
var canvasX = parseInt(e.pageX - offset.left);
|
||||
var canvasY = parseInt(e.pageY - offset.top);
|
||||
var item = findNearbySlice(canvasX, canvasY);
|
||||
|
||||
if (options.grid.autoHighlight) {
|
||||
|
||||
// clear auto-highlights
|
||||
|
||||
for (var i = 0; i < highlights.length; ++i) {
|
||||
var h = highlights[i];
|
||||
if (h.auto == eventname && !(item && h.series == item.series)) {
|
||||
unhighlight(h.series);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// highlight the slice
|
||||
|
||||
if (item) {
|
||||
highlight(item.series, eventname);
|
||||
}
|
||||
|
||||
// trigger any hover bind events
|
||||
|
||||
var pos = { pageX: e.pageX, pageY: e.pageY };
|
||||
target.trigger(eventname, [pos, item]);
|
||||
}
|
||||
|
||||
function highlight(s, auto) {
|
||||
//if (typeof s == "number") {
|
||||
// s = series[s];
|
||||
//}
|
||||
|
||||
var i = indexOfHighlight(s);
|
||||
|
||||
if (i == -1) {
|
||||
highlights.push({ series: s, auto: auto });
|
||||
plot.triggerRedrawOverlay();
|
||||
} else if (!auto) {
|
||||
highlights[i].auto = false;
|
||||
}
|
||||
}
|
||||
|
||||
function unhighlight(s) {
|
||||
if (s == null) {
|
||||
highlights = [];
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
|
||||
//if (typeof s == "number") {
|
||||
// s = series[s];
|
||||
//}
|
||||
|
||||
var i = indexOfHighlight(s);
|
||||
|
||||
if (i != -1) {
|
||||
highlights.splice(i, 1);
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
function indexOfHighlight(s) {
|
||||
for (var i = 0; i < highlights.length; ++i) {
|
||||
var h = highlights[i];
|
||||
if (h.series == s)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
function drawOverlay(plot, octx) {
|
||||
|
||||
var options = plot.getOptions();
|
||||
|
||||
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
|
||||
|
||||
octx.save();
|
||||
octx.translate(centerLeft, centerTop);
|
||||
octx.scale(1, options.series.pie.tilt);
|
||||
|
||||
for (var i = 0; i < highlights.length; ++i) {
|
||||
drawHighlight(highlights[i].series);
|
||||
}
|
||||
|
||||
drawDonutHole(octx);
|
||||
|
||||
octx.restore();
|
||||
|
||||
function drawHighlight(series) {
|
||||
|
||||
if (series.angle <= 0 || isNaN(series.angle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();
|
||||
octx.fillStyle = "rgba(255, 255, 255, " + options.series.pie.highlight.opacity + ")"; // this is temporary until we have access to parseColor
|
||||
octx.beginPath();
|
||||
if (Math.abs(series.angle - Math.PI * 2) > 0.000000001) {
|
||||
octx.moveTo(0, 0); // Center of the pie
|
||||
}
|
||||
octx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false);
|
||||
octx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false);
|
||||
octx.closePath();
|
||||
octx.fill();
|
||||
}
|
||||
}
|
||||
} // end init (plugin body)
|
||||
|
||||
// define pie specific options and their default values
|
||||
|
||||
var options = {
|
||||
series: {
|
||||
pie: {
|
||||
show: false,
|
||||
radius: "auto", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)
|
||||
innerRadius: 0, /* for donut */
|
||||
startAngle: 3/2,
|
||||
tilt: 1,
|
||||
shadow: {
|
||||
left: 5, // shadow left offset
|
||||
top: 15, // shadow top offset
|
||||
alpha: 0.02 // shadow alpha
|
||||
},
|
||||
offset: {
|
||||
top: 0,
|
||||
left: "auto"
|
||||
},
|
||||
stroke: {
|
||||
color: "#fff",
|
||||
width: 1
|
||||
},
|
||||
label: {
|
||||
show: "auto",
|
||||
formatter: function(label, slice) {
|
||||
return "<div style='font-size:x-small;text-align:center;padding:2px;color:" + slice.color + ";'>" + label + "<br/>" + Math.round(slice.percent) + "%</div>";
|
||||
}, // formatter function
|
||||
radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)
|
||||
background: {
|
||||
color: null,
|
||||
opacity: 0
|
||||
},
|
||||
threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)
|
||||
},
|
||||
combine: {
|
||||
threshold: -1, // percentage at which to combine little slices into one larger slice
|
||||
color: null, // color to give the new slice (auto-generated if null)
|
||||
label: "Other" // label to give the new slice
|
||||
},
|
||||
highlight: {
|
||||
//color: "#fff", // will add this functionality once parseColor is available
|
||||
opacity: 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: "pie",
|
||||
version: "1.1"
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,59 @@
|
||||
/* Flot plugin for automatically redrawing plots as the placeholder resizes.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
It works by listening for changes on the placeholder div (through the jQuery
|
||||
resize event plugin) - if the size changes, it will redraw the plot.
|
||||
|
||||
There are no options. If you need to disable the plugin for some plots, you
|
||||
can just fix the size of their placeholders.
|
||||
|
||||
*/
|
||||
|
||||
/* Inline dependency:
|
||||
* jQuery resize event - v1.1 - 3/14/2010
|
||||
* http://benalman.com/projects/jquery-resize-plugin/
|
||||
*
|
||||
* Copyright (c) 2010 "Cowboy" Ben Alman
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://benalman.com/about/license/
|
||||
*/
|
||||
(function($,e,t){"$:nomunge";var i=[],n=$.resize=$.extend($.resize,{}),a,r=false,s="setTimeout",u="resize",m=u+"-special-event",o="pendingDelay",l="activeDelay",f="throttleWindow";n[o]=200;n[l]=20;n[f]=true;$.event.special[u]={setup:function(){if(!n[f]&&this[s]){return false}var e=$(this);i.push(this);e.data(m,{w:e.width(),h:e.height()});if(i.length===1){a=t;h()}},teardown:function(){if(!n[f]&&this[s]){return false}var e=$(this);for(var t=i.length-1;t>=0;t--){if(i[t]==this){i.splice(t,1);break}}e.removeData(m);if(!i.length){if(r){cancelAnimationFrame(a)}else{clearTimeout(a)}a=null}},add:function(e){if(!n[f]&&this[s]){return false}var i;function a(e,n,a){var r=$(this),s=r.data(m)||{};s.w=n!==t?n:r.width();s.h=a!==t?a:r.height();i.apply(this,arguments)}if($.isFunction(e)){i=e;return a}else{i=e.handler;e.handler=a}}};function h(t){if(r===true){r=t||1}for(var s=i.length-1;s>=0;s--){var l=$(i[s]);if(l[0]==e||l.is(":visible")){var f=l.width(),c=l.height(),d=l.data(m);if(d&&(f!==d.w||c!==d.h)){l.trigger(u,[d.w=f,d.h=c]);r=t||true}}else{d=l.data(m);d.w=0;d.h=0}}if(a!==null){if(r&&(t==null||t-r<1e3)){a=e.requestAnimationFrame(h)}else{a=setTimeout(h,n[o]);r=false}}}if(!e.requestAnimationFrame){e.requestAnimationFrame=function(){return e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t,i){return e.setTimeout(function(){t((new Date).getTime())},n[l])}}()}if(!e.cancelAnimationFrame){e.cancelAnimationFrame=function(){return e.webkitCancelRequestAnimationFrame||e.mozCancelRequestAnimationFrame||e.oCancelRequestAnimationFrame||e.msCancelRequestAnimationFrame||clearTimeout}()}})(jQuery,this);
|
||||
|
||||
(function ($) {
|
||||
var options = { }; // no options
|
||||
|
||||
function init(plot) {
|
||||
function onResize() {
|
||||
var placeholder = plot.getPlaceholder();
|
||||
|
||||
// somebody might have hidden us and we can't plot
|
||||
// when we don't have the dimensions
|
||||
if (placeholder.width() == 0 || placeholder.height() == 0)
|
||||
return;
|
||||
|
||||
plot.resize();
|
||||
plot.setupGrid();
|
||||
plot.draw();
|
||||
}
|
||||
|
||||
function bindEvents(plot, eventHolder) {
|
||||
plot.getPlaceholder().resize(onResize);
|
||||
}
|
||||
|
||||
function shutdown(plot, eventHolder) {
|
||||
plot.getPlaceholder().unbind("resize", onResize);
|
||||
}
|
||||
|
||||
plot.hooks.bindEvents.push(bindEvents);
|
||||
plot.hooks.shutdown.push(shutdown);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'resize',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
Flot plugin for stacking data sets, i.e. putting them on top of each
|
||||
other, for accumulative graphs.
|
||||
|
||||
The plugin assumes the data is sorted on x (or y if stacking
|
||||
horizontally). For line charts, it is assumed that if a line has an
|
||||
undefined gap (from a null point), then the line above it should have
|
||||
the same gap - insert zeros instead of "null" if you want another
|
||||
behaviour. This also holds for the start and end of the chart. Note
|
||||
that stacking a mix of positive and negative values in most instances
|
||||
doesn't make sense (so it looks weird).
|
||||
|
||||
Two or more series are stacked when their "stack" attribute is set to
|
||||
the same key (which can be any number or string or just "true"). To
|
||||
specify the default stack, you can set
|
||||
|
||||
series: {
|
||||
stack: null or true or key (number/string)
|
||||
}
|
||||
|
||||
or specify it for a specific series
|
||||
|
||||
$.plot($("#placeholder"), [{ data: [ ... ], stack: true }])
|
||||
|
||||
The stacking order is determined by the order of the data series in
|
||||
the array (later series end up on top of the previous).
|
||||
|
||||
Internally, the plugin modifies the datapoints in each series, adding
|
||||
an offset to the y value. For line series, extra data points are
|
||||
inserted through interpolation. If there's a second y value, it's also
|
||||
adjusted (e.g for bar charts or filled areas).
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
series: { stack: null } // or number/string
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
function findMatchingSeries(s, allseries) {
|
||||
var res = null
|
||||
for (var i = 0; i < allseries.length; ++i) {
|
||||
if (s == allseries[i])
|
||||
break;
|
||||
|
||||
if (allseries[i].stack == s.stack)
|
||||
res = allseries[i];
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
function stackData(plot, s, datapoints) {
|
||||
if (s.stack == null)
|
||||
return;
|
||||
|
||||
var other = findMatchingSeries(s, plot.getData());
|
||||
if (!other)
|
||||
return;
|
||||
|
||||
var ps = datapoints.pointsize,
|
||||
points = datapoints.points,
|
||||
otherps = other.datapoints.pointsize,
|
||||
otherpoints = other.datapoints.points,
|
||||
newpoints = [],
|
||||
px, py, intery, qx, qy, bottom,
|
||||
withlines = s.lines.show,
|
||||
horizontal = s.bars.horizontal,
|
||||
withbottom = ps > 2 && (horizontal ? datapoints.format[2].x : datapoints.format[2].y),
|
||||
withsteps = withlines && s.lines.steps,
|
||||
fromgap = true,
|
||||
keyOffset = horizontal ? 1 : 0,
|
||||
accumulateOffset = horizontal ? 0 : 1,
|
||||
i = 0, j = 0, l;
|
||||
|
||||
while (true) {
|
||||
if (i >= points.length)
|
||||
break;
|
||||
|
||||
l = newpoints.length;
|
||||
|
||||
if (points[i] == null) {
|
||||
// copy gaps
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
i += ps;
|
||||
}
|
||||
else if (j >= otherpoints.length) {
|
||||
// for lines, we can't use the rest of the points
|
||||
if (!withlines) {
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
}
|
||||
i += ps;
|
||||
}
|
||||
else if (otherpoints[j] == null) {
|
||||
// oops, got a gap
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(null);
|
||||
fromgap = true;
|
||||
j += otherps;
|
||||
}
|
||||
else {
|
||||
// cases where we actually got two points
|
||||
px = points[i + keyOffset];
|
||||
py = points[i + accumulateOffset];
|
||||
qx = otherpoints[j + keyOffset];
|
||||
qy = otherpoints[j + accumulateOffset];
|
||||
bottom = 0;
|
||||
|
||||
if (px == qx) {
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
|
||||
newpoints[l + accumulateOffset] += qy;
|
||||
bottom = qy;
|
||||
|
||||
i += ps;
|
||||
j += otherps;
|
||||
}
|
||||
else if (px > qx) {
|
||||
// we got past point below, might need to
|
||||
// insert interpolated extra point
|
||||
if (withlines && i > 0 && points[i - ps] != null) {
|
||||
intery = py + (points[i - ps + accumulateOffset] - py) * (qx - px) / (points[i - ps + keyOffset] - px);
|
||||
newpoints.push(qx);
|
||||
newpoints.push(intery + qy);
|
||||
for (m = 2; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
bottom = qy;
|
||||
}
|
||||
|
||||
j += otherps;
|
||||
}
|
||||
else { // px < qx
|
||||
if (fromgap && withlines) {
|
||||
// if we come from a gap, we just skip this point
|
||||
i += ps;
|
||||
continue;
|
||||
}
|
||||
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
|
||||
// we might be able to interpolate a point below,
|
||||
// this can give us a better y
|
||||
if (withlines && j > 0 && otherpoints[j - otherps] != null)
|
||||
bottom = qy + (otherpoints[j - otherps + accumulateOffset] - qy) * (px - qx) / (otherpoints[j - otherps + keyOffset] - qx);
|
||||
|
||||
newpoints[l + accumulateOffset] += bottom;
|
||||
|
||||
i += ps;
|
||||
}
|
||||
|
||||
fromgap = false;
|
||||
|
||||
if (l != newpoints.length && withbottom)
|
||||
newpoints[l + 2] += bottom;
|
||||
}
|
||||
|
||||
// maintain the line steps invariant
|
||||
if (withsteps && l != newpoints.length && l > 0
|
||||
&& newpoints[l] != null
|
||||
&& newpoints[l] != newpoints[l - ps]
|
||||
&& newpoints[l + 1] != newpoints[l - ps + 1]) {
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints[l + ps + m] = newpoints[l + m];
|
||||
newpoints[l + 1] = newpoints[l - ps + 1];
|
||||
}
|
||||
}
|
||||
|
||||
datapoints.points = newpoints;
|
||||
}
|
||||
|
||||
plot.hooks.processDatapoints.push(stackData);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'stack',
|
||||
version: '1.2'
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,142 @@
|
||||
/* Flot plugin for thresholding data.
|
||||
|
||||
Copyright (c) 2007-2013 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
series: {
|
||||
threshold: {
|
||||
below: number
|
||||
color: colorspec
|
||||
}
|
||||
}
|
||||
|
||||
It can also be applied to a single series, like this:
|
||||
|
||||
$.plot( $("#placeholder"), [{
|
||||
data: [ ... ],
|
||||
threshold: { ... }
|
||||
}])
|
||||
|
||||
An array can be passed for multiple thresholding, like this:
|
||||
|
||||
threshold: [{
|
||||
below: number1
|
||||
color: color1
|
||||
},{
|
||||
below: number2
|
||||
color: color2
|
||||
}]
|
||||
|
||||
These multiple threshold objects can be passed in any order since they are
|
||||
sorted by the processing function.
|
||||
|
||||
The data points below "below" are drawn with the specified color. This makes
|
||||
it easy to mark points below 0, e.g. for budget data.
|
||||
|
||||
Internally, the plugin works by splitting the data into two series, above and
|
||||
below the threshold. The extra series below the threshold will have its label
|
||||
cleared and the special "originSeries" attribute set to the original series.
|
||||
You may need to check for this in hover events.
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
series: { threshold: null } // or { below: number, color: color spec}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
function thresholdData(plot, s, datapoints, below, color) {
|
||||
var ps = datapoints.pointsize, i, x, y, p, prevp,
|
||||
thresholded = $.extend({}, s); // note: shallow copy
|
||||
|
||||
thresholded.datapoints = { points: [], pointsize: ps, format: datapoints.format };
|
||||
thresholded.label = null;
|
||||
thresholded.color = color;
|
||||
thresholded.threshold = null;
|
||||
thresholded.originSeries = s;
|
||||
thresholded.data = [];
|
||||
|
||||
var origpoints = datapoints.points,
|
||||
addCrossingPoints = s.lines.show;
|
||||
|
||||
var threspoints = [];
|
||||
var newpoints = [];
|
||||
var m;
|
||||
|
||||
for (i = 0; i < origpoints.length; i += ps) {
|
||||
x = origpoints[i];
|
||||
y = origpoints[i + 1];
|
||||
|
||||
prevp = p;
|
||||
if (y < below)
|
||||
p = threspoints;
|
||||
else
|
||||
p = newpoints;
|
||||
|
||||
if (addCrossingPoints && prevp != p && x != null
|
||||
&& i > 0 && origpoints[i - ps] != null) {
|
||||
var interx = x + (below - y) * (x - origpoints[i - ps]) / (y - origpoints[i - ps + 1]);
|
||||
prevp.push(interx);
|
||||
prevp.push(below);
|
||||
for (m = 2; m < ps; ++m)
|
||||
prevp.push(origpoints[i + m]);
|
||||
|
||||
p.push(null); // start new segment
|
||||
p.push(null);
|
||||
for (m = 2; m < ps; ++m)
|
||||
p.push(origpoints[i + m]);
|
||||
p.push(interx);
|
||||
p.push(below);
|
||||
for (m = 2; m < ps; ++m)
|
||||
p.push(origpoints[i + m]);
|
||||
}
|
||||
|
||||
p.push(x);
|
||||
p.push(y);
|
||||
for (m = 2; m < ps; ++m)
|
||||
p.push(origpoints[i + m]);
|
||||
}
|
||||
|
||||
datapoints.points = newpoints;
|
||||
thresholded.datapoints.points = threspoints;
|
||||
|
||||
if (thresholded.datapoints.points.length > 0) {
|
||||
var origIndex = $.inArray(s, plot.getData());
|
||||
// Insert newly-generated series right after original one (to prevent it from becoming top-most)
|
||||
plot.getData().splice(origIndex + 1, 0, thresholded);
|
||||
}
|
||||
|
||||
// FIXME: there are probably some edge cases left in bars
|
||||
}
|
||||
|
||||
function processThresholds(plot, s, datapoints) {
|
||||
if (!s.threshold)
|
||||
return;
|
||||
|
||||
if (s.threshold instanceof Array) {
|
||||
s.threshold.sort(function(a, b) {
|
||||
return a.below - b.below;
|
||||
});
|
||||
|
||||
$(s.threshold).each(function(i, th) {
|
||||
thresholdData(plot, s, datapoints, th.below, th.color);
|
||||
});
|
||||
}
|
||||
else {
|
||||
thresholdData(plot, s, datapoints, s.threshold.below, s.threshold.color);
|
||||
}
|
||||
}
|
||||
|
||||
plot.hooks.processDatapoints.push(processThresholds);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'threshold',
|
||||
version: '1.2'
|
||||
});
|
||||
})(jQuery);
|
||||
+432
@@ -0,0 +1,432 @@
|
||||
/* Pretty handling of time axes.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Set axis.mode to "time" to enable. See the section "Time series data" in
|
||||
API.txt for details.
|
||||
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var options = {
|
||||
xaxis: {
|
||||
timezone: null, // "browser" for local to the client or timezone for timezone-js
|
||||
timeformat: null, // format string to use
|
||||
twelveHourClock: false, // 12 or 24 time in time mode
|
||||
monthNames: null // list of names of months
|
||||
}
|
||||
};
|
||||
|
||||
// round to nearby lower multiple of base
|
||||
|
||||
function floorInBase(n, base) {
|
||||
return base * Math.floor(n / base);
|
||||
}
|
||||
|
||||
// Returns a string with the date d formatted according to fmt.
|
||||
// A subset of the Open Group's strftime format is supported.
|
||||
|
||||
function formatDate(d, fmt, monthNames, dayNames) {
|
||||
|
||||
if (typeof d.strftime == "function") {
|
||||
return d.strftime(fmt);
|
||||
}
|
||||
|
||||
var leftPad = function(n, pad) {
|
||||
n = "" + n;
|
||||
pad = "" + (pad == null ? "0" : pad);
|
||||
return n.length == 1 ? pad + n : n;
|
||||
};
|
||||
|
||||
var r = [];
|
||||
var escape = false;
|
||||
var hours = d.getHours();
|
||||
var isAM = hours < 12;
|
||||
|
||||
if (monthNames == null) {
|
||||
monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
||||
}
|
||||
|
||||
if (dayNames == null) {
|
||||
dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
||||
}
|
||||
|
||||
var hours12;
|
||||
|
||||
if (hours > 12) {
|
||||
hours12 = hours - 12;
|
||||
} else if (hours == 0) {
|
||||
hours12 = 12;
|
||||
} else {
|
||||
hours12 = hours;
|
||||
}
|
||||
|
||||
for (var i = 0; i < fmt.length; ++i) {
|
||||
|
||||
var c = fmt.charAt(i);
|
||||
|
||||
if (escape) {
|
||||
switch (c) {
|
||||
case 'a': c = "" + dayNames[d.getDay()]; break;
|
||||
case 'b': c = "" + monthNames[d.getMonth()]; break;
|
||||
case 'd': c = leftPad(d.getDate()); break;
|
||||
case 'e': c = leftPad(d.getDate(), " "); break;
|
||||
case 'h': // For back-compat with 0.7; remove in 1.0
|
||||
case 'H': c = leftPad(hours); break;
|
||||
case 'I': c = leftPad(hours12); break;
|
||||
case 'l': c = leftPad(hours12, " "); break;
|
||||
case 'm': c = leftPad(d.getMonth() + 1); break;
|
||||
case 'M': c = leftPad(d.getMinutes()); break;
|
||||
// quarters not in Open Group's strftime specification
|
||||
case 'q':
|
||||
c = "" + (Math.floor(d.getMonth() / 3) + 1); break;
|
||||
case 'S': c = leftPad(d.getSeconds()); break;
|
||||
case 'y': c = leftPad(d.getFullYear() % 100); break;
|
||||
case 'Y': c = "" + d.getFullYear(); break;
|
||||
case 'p': c = (isAM) ? ("" + "am") : ("" + "pm"); break;
|
||||
case 'P': c = (isAM) ? ("" + "AM") : ("" + "PM"); break;
|
||||
case 'w': c = "" + d.getDay(); break;
|
||||
}
|
||||
r.push(c);
|
||||
escape = false;
|
||||
} else {
|
||||
if (c == "%") {
|
||||
escape = true;
|
||||
} else {
|
||||
r.push(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return r.join("");
|
||||
}
|
||||
|
||||
// To have a consistent view of time-based data independent of which time
|
||||
// zone the client happens to be in we need a date-like object independent
|
||||
// of time zones. This is done through a wrapper that only calls the UTC
|
||||
// versions of the accessor methods.
|
||||
|
||||
function makeUtcWrapper(d) {
|
||||
|
||||
function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {
|
||||
sourceObj[sourceMethod] = function() {
|
||||
return targetObj[targetMethod].apply(targetObj, arguments);
|
||||
};
|
||||
};
|
||||
|
||||
var utc = {
|
||||
date: d
|
||||
};
|
||||
|
||||
// support strftime, if found
|
||||
|
||||
if (d.strftime != undefined) {
|
||||
addProxyMethod(utc, "strftime", d, "strftime");
|
||||
}
|
||||
|
||||
addProxyMethod(utc, "getTime", d, "getTime");
|
||||
addProxyMethod(utc, "setTime", d, "setTime");
|
||||
|
||||
var props = ["Date", "Day", "FullYear", "Hours", "Milliseconds", "Minutes", "Month", "Seconds"];
|
||||
|
||||
for (var p = 0; p < props.length; p++) {
|
||||
addProxyMethod(utc, "get" + props[p], d, "getUTC" + props[p]);
|
||||
addProxyMethod(utc, "set" + props[p], d, "setUTC" + props[p]);
|
||||
}
|
||||
|
||||
return utc;
|
||||
};
|
||||
|
||||
// select time zone strategy. This returns a date-like object tied to the
|
||||
// desired timezone
|
||||
|
||||
function dateGenerator(ts, opts) {
|
||||
if (opts.timezone == "browser") {
|
||||
return new Date(ts);
|
||||
} else if (!opts.timezone || opts.timezone == "utc") {
|
||||
return makeUtcWrapper(new Date(ts));
|
||||
} else if (typeof timezoneJS != "undefined" && typeof timezoneJS.Date != "undefined") {
|
||||
var d = new timezoneJS.Date();
|
||||
// timezone-js is fickle, so be sure to set the time zone before
|
||||
// setting the time.
|
||||
d.setTimezone(opts.timezone);
|
||||
d.setTime(ts);
|
||||
return d;
|
||||
} else {
|
||||
return makeUtcWrapper(new Date(ts));
|
||||
}
|
||||
}
|
||||
|
||||
// map of app. size of time units in milliseconds
|
||||
|
||||
var timeUnitSize = {
|
||||
"second": 1000,
|
||||
"minute": 60 * 1000,
|
||||
"hour": 60 * 60 * 1000,
|
||||
"day": 24 * 60 * 60 * 1000,
|
||||
"month": 30 * 24 * 60 * 60 * 1000,
|
||||
"quarter": 3 * 30 * 24 * 60 * 60 * 1000,
|
||||
"year": 365.2425 * 24 * 60 * 60 * 1000
|
||||
};
|
||||
|
||||
// the allowed tick sizes, after 1 year we use
|
||||
// an integer algorithm
|
||||
|
||||
var baseSpec = [
|
||||
[1, "second"], [2, "second"], [5, "second"], [10, "second"],
|
||||
[30, "second"],
|
||||
[1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"],
|
||||
[30, "minute"],
|
||||
[1, "hour"], [2, "hour"], [4, "hour"],
|
||||
[8, "hour"], [12, "hour"],
|
||||
[1, "day"], [2, "day"], [3, "day"],
|
||||
[0.25, "month"], [0.5, "month"], [1, "month"],
|
||||
[2, "month"]
|
||||
];
|
||||
|
||||
// we don't know which variant(s) we'll need yet, but generating both is
|
||||
// cheap
|
||||
|
||||
var specMonths = baseSpec.concat([[3, "month"], [6, "month"],
|
||||
[1, "year"]]);
|
||||
var specQuarters = baseSpec.concat([[1, "quarter"], [2, "quarter"],
|
||||
[1, "year"]]);
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processOptions.push(function (plot, options) {
|
||||
$.each(plot.getAxes(), function(axisName, axis) {
|
||||
|
||||
var opts = axis.options;
|
||||
|
||||
if (opts.mode == "time") {
|
||||
axis.tickGenerator = function(axis) {
|
||||
|
||||
var ticks = [];
|
||||
var d = dateGenerator(axis.min, opts);
|
||||
var minSize = 0;
|
||||
|
||||
// make quarter use a possibility if quarters are
|
||||
// mentioned in either of these options
|
||||
|
||||
var spec = (opts.tickSize && opts.tickSize[1] ===
|
||||
"quarter") ||
|
||||
(opts.minTickSize && opts.minTickSize[1] ===
|
||||
"quarter") ? specQuarters : specMonths;
|
||||
|
||||
if (opts.minTickSize != null) {
|
||||
if (typeof opts.tickSize == "number") {
|
||||
minSize = opts.tickSize;
|
||||
} else {
|
||||
minSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]];
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < spec.length - 1; ++i) {
|
||||
if (axis.delta < (spec[i][0] * timeUnitSize[spec[i][1]]
|
||||
+ spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2
|
||||
&& spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var size = spec[i][0];
|
||||
var unit = spec[i][1];
|
||||
|
||||
// special-case the possibility of several years
|
||||
|
||||
if (unit == "year") {
|
||||
|
||||
// if given a minTickSize in years, just use it,
|
||||
// ensuring that it's an integer
|
||||
|
||||
if (opts.minTickSize != null && opts.minTickSize[1] == "year") {
|
||||
size = Math.floor(opts.minTickSize[0]);
|
||||
} else {
|
||||
|
||||
var magn = Math.pow(10, Math.floor(Math.log(axis.delta / timeUnitSize.year) / Math.LN10));
|
||||
var norm = (axis.delta / timeUnitSize.year) / magn;
|
||||
|
||||
if (norm < 1.5) {
|
||||
size = 1;
|
||||
} else if (norm < 3) {
|
||||
size = 2;
|
||||
} else if (norm < 7.5) {
|
||||
size = 5;
|
||||
} else {
|
||||
size = 10;
|
||||
}
|
||||
|
||||
size *= magn;
|
||||
}
|
||||
|
||||
// minimum size for years is 1
|
||||
|
||||
if (size < 1) {
|
||||
size = 1;
|
||||
}
|
||||
}
|
||||
|
||||
axis.tickSize = opts.tickSize || [size, unit];
|
||||
var tickSize = axis.tickSize[0];
|
||||
unit = axis.tickSize[1];
|
||||
|
||||
var step = tickSize * timeUnitSize[unit];
|
||||
|
||||
if (unit == "second") {
|
||||
d.setSeconds(floorInBase(d.getSeconds(), tickSize));
|
||||
} else if (unit == "minute") {
|
||||
d.setMinutes(floorInBase(d.getMinutes(), tickSize));
|
||||
} else if (unit == "hour") {
|
||||
d.setHours(floorInBase(d.getHours(), tickSize));
|
||||
} else if (unit == "month") {
|
||||
d.setMonth(floorInBase(d.getMonth(), tickSize));
|
||||
} else if (unit == "quarter") {
|
||||
d.setMonth(3 * floorInBase(d.getMonth() / 3,
|
||||
tickSize));
|
||||
} else if (unit == "year") {
|
||||
d.setFullYear(floorInBase(d.getFullYear(), tickSize));
|
||||
}
|
||||
|
||||
// reset smaller components
|
||||
|
||||
d.setMilliseconds(0);
|
||||
|
||||
if (step >= timeUnitSize.minute) {
|
||||
d.setSeconds(0);
|
||||
}
|
||||
if (step >= timeUnitSize.hour) {
|
||||
d.setMinutes(0);
|
||||
}
|
||||
if (step >= timeUnitSize.day) {
|
||||
d.setHours(0);
|
||||
}
|
||||
if (step >= timeUnitSize.day * 4) {
|
||||
d.setDate(1);
|
||||
}
|
||||
if (step >= timeUnitSize.month * 2) {
|
||||
d.setMonth(floorInBase(d.getMonth(), 3));
|
||||
}
|
||||
if (step >= timeUnitSize.quarter * 2) {
|
||||
d.setMonth(floorInBase(d.getMonth(), 6));
|
||||
}
|
||||
if (step >= timeUnitSize.year) {
|
||||
d.setMonth(0);
|
||||
}
|
||||
|
||||
var carry = 0;
|
||||
var v = Number.NaN;
|
||||
var prev;
|
||||
|
||||
do {
|
||||
|
||||
prev = v;
|
||||
v = d.getTime();
|
||||
ticks.push(v);
|
||||
|
||||
if (unit == "month" || unit == "quarter") {
|
||||
if (tickSize < 1) {
|
||||
|
||||
// a bit complicated - we'll divide the
|
||||
// month/quarter up but we need to take
|
||||
// care of fractions so we don't end up in
|
||||
// the middle of a day
|
||||
|
||||
d.setDate(1);
|
||||
var start = d.getTime();
|
||||
d.setMonth(d.getMonth() +
|
||||
(unit == "quarter" ? 3 : 1));
|
||||
var end = d.getTime();
|
||||
d.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize);
|
||||
carry = d.getHours();
|
||||
d.setHours(0);
|
||||
} else {
|
||||
d.setMonth(d.getMonth() +
|
||||
tickSize * (unit == "quarter" ? 3 : 1));
|
||||
}
|
||||
} else if (unit == "year") {
|
||||
d.setFullYear(d.getFullYear() + tickSize);
|
||||
} else {
|
||||
d.setTime(v + step);
|
||||
}
|
||||
} while (v < axis.max && v != prev);
|
||||
|
||||
return ticks;
|
||||
};
|
||||
|
||||
axis.tickFormatter = function (v, axis) {
|
||||
|
||||
var d = dateGenerator(v, axis.options);
|
||||
|
||||
// first check global format
|
||||
|
||||
if (opts.timeformat != null) {
|
||||
return formatDate(d, opts.timeformat, opts.monthNames, opts.dayNames);
|
||||
}
|
||||
|
||||
// possibly use quarters if quarters are mentioned in
|
||||
// any of these places
|
||||
|
||||
var useQuarters = (axis.options.tickSize &&
|
||||
axis.options.tickSize[1] == "quarter") ||
|
||||
(axis.options.minTickSize &&
|
||||
axis.options.minTickSize[1] == "quarter");
|
||||
|
||||
var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]];
|
||||
var span = axis.max - axis.min;
|
||||
var suffix = (opts.twelveHourClock) ? " %p" : "";
|
||||
var hourCode = (opts.twelveHourClock) ? "%I" : "%H";
|
||||
var fmt;
|
||||
|
||||
if (t < timeUnitSize.minute) {
|
||||
fmt = hourCode + ":%M:%S" + suffix;
|
||||
} else if (t < timeUnitSize.day) {
|
||||
if (span < 2 * timeUnitSize.day) {
|
||||
fmt = hourCode + ":%M" + suffix;
|
||||
} else {
|
||||
fmt = "%b %d " + hourCode + ":%M" + suffix;
|
||||
}
|
||||
} else if (t < timeUnitSize.month) {
|
||||
fmt = "%b %d";
|
||||
} else if ((useQuarters && t < timeUnitSize.quarter) ||
|
||||
(!useQuarters && t < timeUnitSize.year)) {
|
||||
if (span < timeUnitSize.year) {
|
||||
fmt = "%b";
|
||||
} else {
|
||||
fmt = "%b %Y";
|
||||
}
|
||||
} else if (useQuarters && t < timeUnitSize.year) {
|
||||
if (span < timeUnitSize.year) {
|
||||
fmt = "Q%q";
|
||||
} else {
|
||||
fmt = "Q%q %Y";
|
||||
}
|
||||
} else {
|
||||
fmt = "%Y";
|
||||
}
|
||||
|
||||
var rt = formatDate(d, fmt, opts.monthNames, opts.dayNames);
|
||||
|
||||
return rt;
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'time',
|
||||
version: '1.0'
|
||||
});
|
||||
|
||||
// Time-axis support used to be in Flot core, which exposed the
|
||||
// formatDate function on the plot object. Various plugins depend
|
||||
// on the function, so we need to re-expose it here.
|
||||
|
||||
$.plot.formatDate = formatDate;
|
||||
$.plot.dateGenerator = dateGenerator;
|
||||
|
||||
})(jQuery);
|
||||
Vendored
+774
@@ -0,0 +1,774 @@
|
||||
// Generated by CoffeeScript 1.6.3
|
||||
(function() {
|
||||
var AnimatedText, AnimatedTextFactory, Bar, BaseDonut, BaseGauge, Donut, Gauge, GaugePointer, TextRenderer, ValueUpdater, addCommas, cutHex, formatNumber, mergeObjects, secondsToString, updateObjectValues, _ref, _ref1,
|
||||
__hasProp = {}.hasOwnProperty,
|
||||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
||||
|
||||
(function() {
|
||||
var browserRequestAnimationFrame, isCancelled, lastId, vendor, vendors, _i, _len;
|
||||
vendors = ['ms', 'moz', 'webkit', 'o'];
|
||||
for (_i = 0, _len = vendors.length; _i < _len; _i++) {
|
||||
vendor = vendors[_i];
|
||||
if (window.requestAnimationFrame) {
|
||||
break;
|
||||
}
|
||||
window.requestAnimationFrame = window[vendor + 'RequestAnimationFrame'];
|
||||
window.cancelAnimationFrame = window[vendor + 'CancelAnimationFrame'] || window[vendor + 'CancelRequestAnimationFrame'];
|
||||
}
|
||||
browserRequestAnimationFrame = null;
|
||||
lastId = 0;
|
||||
isCancelled = {};
|
||||
if (!requestAnimationFrame) {
|
||||
window.requestAnimationFrame = function(callback, element) {
|
||||
var currTime, id, lastTime, timeToCall;
|
||||
currTime = new Date().getTime();
|
||||
timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
||||
id = window.setTimeout(function() {
|
||||
return callback(currTime + timeToCall);
|
||||
}, timeToCall);
|
||||
lastTime = currTime + timeToCall;
|
||||
return id;
|
||||
};
|
||||
return window.cancelAnimationFrame = function(id) {
|
||||
return clearTimeout(id);
|
||||
};
|
||||
} else if (!window.cancelAnimationFrame) {
|
||||
browserRequestAnimationFrame = window.requestAnimationFrame;
|
||||
window.requestAnimationFrame = function(callback, element) {
|
||||
var myId;
|
||||
myId = ++lastId;
|
||||
browserRequestAnimationFrame(function() {
|
||||
if (!isCancelled[myId]) {
|
||||
return callback();
|
||||
}
|
||||
}, element);
|
||||
return myId;
|
||||
};
|
||||
return window.cancelAnimationFrame = function(id) {
|
||||
return isCancelled[id] = true;
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
||||
String.prototype.hashCode = function() {
|
||||
var char, hash, i, _i, _ref;
|
||||
hash = 0;
|
||||
if (this.length === 0) {
|
||||
return hash;
|
||||
}
|
||||
for (i = _i = 0, _ref = this.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
|
||||
char = this.charCodeAt(i);
|
||||
hash = ((hash << 5) - hash) + char;
|
||||
hash = hash & hash;
|
||||
}
|
||||
return hash;
|
||||
};
|
||||
|
||||
secondsToString = function(sec) {
|
||||
var hr, min;
|
||||
hr = Math.floor(sec / 3600);
|
||||
min = Math.floor((sec - (hr * 3600)) / 60);
|
||||
sec -= (hr * 3600) + (min * 60);
|
||||
sec += '';
|
||||
min += '';
|
||||
while (min.length < 2) {
|
||||
min = '0' + min;
|
||||
}
|
||||
while (sec.length < 2) {
|
||||
sec = '0' + sec;
|
||||
}
|
||||
hr = hr ? hr + ':' : '';
|
||||
return hr + min + ':' + sec;
|
||||
};
|
||||
|
||||
formatNumber = function(num) {
|
||||
return addCommas(num.toFixed(0));
|
||||
};
|
||||
|
||||
updateObjectValues = function(obj1, obj2) {
|
||||
var key, val;
|
||||
for (key in obj2) {
|
||||
if (!__hasProp.call(obj2, key)) continue;
|
||||
val = obj2[key];
|
||||
obj1[key] = val;
|
||||
}
|
||||
return obj1;
|
||||
};
|
||||
|
||||
mergeObjects = function(obj1, obj2) {
|
||||
var key, out, val;
|
||||
out = {};
|
||||
for (key in obj1) {
|
||||
if (!__hasProp.call(obj1, key)) continue;
|
||||
val = obj1[key];
|
||||
out[key] = val;
|
||||
}
|
||||
for (key in obj2) {
|
||||
if (!__hasProp.call(obj2, key)) continue;
|
||||
val = obj2[key];
|
||||
out[key] = val;
|
||||
}
|
||||
return out;
|
||||
};
|
||||
|
||||
addCommas = function(nStr) {
|
||||
var rgx, x, x1, x2;
|
||||
nStr += '';
|
||||
x = nStr.split('.');
|
||||
x1 = x[0];
|
||||
x2 = '';
|
||||
if (x.length > 1) {
|
||||
x2 = '.' + x[1];
|
||||
}
|
||||
rgx = /(\d+)(\d{3})/;
|
||||
while (rgx.test(x1)) {
|
||||
x1 = x1.replace(rgx, '$1' + ',' + '$2');
|
||||
}
|
||||
return x1 + x2;
|
||||
};
|
||||
|
||||
cutHex = function(nStr) {
|
||||
if (nStr.charAt(0) === "#") {
|
||||
return nStr.substring(1, 7);
|
||||
}
|
||||
return nStr;
|
||||
};
|
||||
|
||||
ValueUpdater = (function() {
|
||||
ValueUpdater.prototype.animationSpeed = 32;
|
||||
|
||||
function ValueUpdater(addToAnimationQueue, clear) {
|
||||
if (addToAnimationQueue == null) {
|
||||
addToAnimationQueue = true;
|
||||
}
|
||||
this.clear = clear != null ? clear : true;
|
||||
if (addToAnimationQueue) {
|
||||
AnimationUpdater.add(this);
|
||||
}
|
||||
}
|
||||
|
||||
ValueUpdater.prototype.update = function(force) {
|
||||
var diff;
|
||||
if (force == null) {
|
||||
force = false;
|
||||
}
|
||||
if (force || this.displayedValue !== this.value) {
|
||||
if (this.ctx && this.clear) {
|
||||
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||
}
|
||||
diff = this.value - this.displayedValue;
|
||||
if (Math.abs(diff / this.animationSpeed) <= 0.001) {
|
||||
this.displayedValue = this.value;
|
||||
} else {
|
||||
this.displayedValue = this.displayedValue + diff / this.animationSpeed;
|
||||
}
|
||||
this.render();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
return ValueUpdater;
|
||||
|
||||
})();
|
||||
|
||||
BaseGauge = (function(_super) {
|
||||
__extends(BaseGauge, _super);
|
||||
|
||||
function BaseGauge() {
|
||||
_ref = BaseGauge.__super__.constructor.apply(this, arguments);
|
||||
return _ref;
|
||||
}
|
||||
|
||||
BaseGauge.prototype.displayScale = 1;
|
||||
|
||||
BaseGauge.prototype.setTextField = function(textField) {
|
||||
return this.textField = textField instanceof TextRenderer ? textField : new TextRenderer(textField);
|
||||
};
|
||||
|
||||
BaseGauge.prototype.setMinValue = function(minValue, updateStartValue) {
|
||||
var gauge, _i, _len, _ref1, _results;
|
||||
this.minValue = minValue;
|
||||
if (updateStartValue == null) {
|
||||
updateStartValue = true;
|
||||
}
|
||||
if (updateStartValue) {
|
||||
this.displayedValue = this.minValue;
|
||||
_ref1 = this.gp || [];
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||
gauge = _ref1[_i];
|
||||
_results.push(gauge.displayedValue = this.minValue);
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
};
|
||||
|
||||
BaseGauge.prototype.setOptions = function(options) {
|
||||
if (options == null) {
|
||||
options = null;
|
||||
}
|
||||
this.options = mergeObjects(this.options, options);
|
||||
if (this.textField) {
|
||||
this.textField.el.style.fontSize = options.fontSize + 'px';
|
||||
}
|
||||
if (this.options.angle > .5) {
|
||||
this.gauge.options.angle = .5;
|
||||
}
|
||||
this.configDisplayScale();
|
||||
return this;
|
||||
};
|
||||
|
||||
BaseGauge.prototype.configDisplayScale = function() {
|
||||
var backingStorePixelRatio, devicePixelRatio, height, prevDisplayScale, width;
|
||||
prevDisplayScale = this.displayScale;
|
||||
if (this.options.highDpiSupport === false) {
|
||||
delete this.displayScale;
|
||||
} else {
|
||||
devicePixelRatio = window.devicePixelRatio || 1;
|
||||
backingStorePixelRatio = this.ctx.webkitBackingStorePixelRatio || this.ctx.mozBackingStorePixelRatio || this.ctx.msBackingStorePixelRatio || this.ctx.oBackingStorePixelRatio || this.ctx.backingStorePixelRatio || 1;
|
||||
this.displayScale = devicePixelRatio / backingStorePixelRatio;
|
||||
}
|
||||
if (this.displayScale !== prevDisplayScale) {
|
||||
width = this.canvas.G__width || this.canvas.width;
|
||||
height = this.canvas.G__height || this.canvas.height;
|
||||
this.canvas.width = width * this.displayScale;
|
||||
this.canvas.height = height * this.displayScale;
|
||||
this.canvas.style.width = "" + width + "px";
|
||||
this.canvas.style.height = "" + height + "px";
|
||||
this.canvas.G__width = width;
|
||||
this.canvas.G__height = height;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
return BaseGauge;
|
||||
|
||||
})(ValueUpdater);
|
||||
|
||||
TextRenderer = (function() {
|
||||
function TextRenderer(el) {
|
||||
this.el = el;
|
||||
}
|
||||
|
||||
TextRenderer.prototype.render = function(gauge) {
|
||||
return this.el.innerHTML = formatNumber(gauge.displayedValue);
|
||||
};
|
||||
|
||||
return TextRenderer;
|
||||
|
||||
})();
|
||||
|
||||
AnimatedText = (function(_super) {
|
||||
__extends(AnimatedText, _super);
|
||||
|
||||
AnimatedText.prototype.displayedValue = 0;
|
||||
|
||||
AnimatedText.prototype.value = 0;
|
||||
|
||||
AnimatedText.prototype.setVal = function(value) {
|
||||
return this.value = 1 * value;
|
||||
};
|
||||
|
||||
function AnimatedText(elem, text) {
|
||||
this.elem = elem;
|
||||
this.text = text != null ? text : false;
|
||||
this.value = 1 * this.elem.innerHTML;
|
||||
if (this.text) {
|
||||
this.value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
AnimatedText.prototype.render = function() {
|
||||
var textVal;
|
||||
if (this.text) {
|
||||
textVal = secondsToString(this.displayedValue.toFixed(0));
|
||||
} else {
|
||||
textVal = addCommas(formatNumber(this.displayedValue));
|
||||
}
|
||||
return this.elem.innerHTML = textVal;
|
||||
};
|
||||
|
||||
return AnimatedText;
|
||||
|
||||
})(ValueUpdater);
|
||||
|
||||
AnimatedTextFactory = {
|
||||
create: function(objList) {
|
||||
var elem, out, _i, _len;
|
||||
out = [];
|
||||
for (_i = 0, _len = objList.length; _i < _len; _i++) {
|
||||
elem = objList[_i];
|
||||
out.push(new AnimatedText(elem));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
};
|
||||
|
||||
GaugePointer = (function(_super) {
|
||||
__extends(GaugePointer, _super);
|
||||
|
||||
GaugePointer.prototype.displayedValue = 0;
|
||||
|
||||
GaugePointer.prototype.value = 0;
|
||||
|
||||
GaugePointer.prototype.options = {
|
||||
strokeWidth: 0.035,
|
||||
length: 0.1,
|
||||
color: "#000000"
|
||||
};
|
||||
|
||||
function GaugePointer(gauge) {
|
||||
this.gauge = gauge;
|
||||
this.ctx = this.gauge.ctx;
|
||||
this.canvas = this.gauge.canvas;
|
||||
GaugePointer.__super__.constructor.call(this, false, false);
|
||||
this.setOptions();
|
||||
}
|
||||
|
||||
GaugePointer.prototype.setOptions = function(options) {
|
||||
if (options == null) {
|
||||
options = null;
|
||||
}
|
||||
updateObjectValues(this.options, options);
|
||||
this.length = this.canvas.height * this.options.length;
|
||||
this.strokeWidth = this.canvas.height * this.options.strokeWidth;
|
||||
this.maxValue = this.gauge.maxValue;
|
||||
this.minValue = this.gauge.minValue;
|
||||
this.animationSpeed = this.gauge.animationSpeed;
|
||||
return this.options.angle = this.gauge.options.angle;
|
||||
};
|
||||
|
||||
GaugePointer.prototype.render = function() {
|
||||
var angle, centerX, centerY, endX, endY, startX, startY, x, y;
|
||||
angle = this.gauge.getAngle.call(this, this.displayedValue);
|
||||
centerX = this.canvas.width / 2;
|
||||
centerY = this.canvas.height * 0.9;
|
||||
x = Math.round(centerX + this.length * Math.cos(angle));
|
||||
y = Math.round(centerY + this.length * Math.sin(angle));
|
||||
startX = Math.round(centerX + this.strokeWidth * Math.cos(angle - Math.PI / 2));
|
||||
startY = Math.round(centerY + this.strokeWidth * Math.sin(angle - Math.PI / 2));
|
||||
endX = Math.round(centerX + this.strokeWidth * Math.cos(angle + Math.PI / 2));
|
||||
endY = Math.round(centerY + this.strokeWidth * Math.sin(angle + Math.PI / 2));
|
||||
this.ctx.fillStyle = this.options.color;
|
||||
this.ctx.beginPath();
|
||||
this.ctx.arc(centerX, centerY, this.strokeWidth, 0, Math.PI * 2, true);
|
||||
this.ctx.fill();
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(startX, startY);
|
||||
this.ctx.lineTo(x, y);
|
||||
this.ctx.lineTo(endX, endY);
|
||||
return this.ctx.fill();
|
||||
};
|
||||
|
||||
return GaugePointer;
|
||||
|
||||
})(ValueUpdater);
|
||||
|
||||
Bar = (function() {
|
||||
function Bar(elem) {
|
||||
this.elem = elem;
|
||||
}
|
||||
|
||||
Bar.prototype.updateValues = function(arrValues) {
|
||||
this.value = arrValues[0];
|
||||
this.maxValue = arrValues[1];
|
||||
this.avgValue = arrValues[2];
|
||||
return this.render();
|
||||
};
|
||||
|
||||
Bar.prototype.render = function() {
|
||||
var avgPercent, valPercent;
|
||||
if (this.textField) {
|
||||
this.textField.text(formatNumber(this.value));
|
||||
}
|
||||
if (this.maxValue === 0) {
|
||||
this.maxValue = this.avgValue * 2;
|
||||
}
|
||||
valPercent = (this.value / this.maxValue) * 100;
|
||||
avgPercent = (this.avgValue / this.maxValue) * 100;
|
||||
$(".bar-value", this.elem).css({
|
||||
"width": valPercent + "%"
|
||||
});
|
||||
return $(".typical-value", this.elem).css({
|
||||
"width": avgPercent + "%"
|
||||
});
|
||||
};
|
||||
|
||||
return Bar;
|
||||
|
||||
})();
|
||||
|
||||
Gauge = (function(_super) {
|
||||
__extends(Gauge, _super);
|
||||
|
||||
Gauge.prototype.elem = null;
|
||||
|
||||
Gauge.prototype.value = [20];
|
||||
|
||||
Gauge.prototype.maxValue = 80;
|
||||
|
||||
Gauge.prototype.minValue = 0;
|
||||
|
||||
Gauge.prototype.displayedAngle = 0;
|
||||
|
||||
Gauge.prototype.displayedValue = 0;
|
||||
|
||||
Gauge.prototype.lineWidth = 40;
|
||||
|
||||
Gauge.prototype.paddingBottom = 0.1;
|
||||
|
||||
Gauge.prototype.percentColors = null;
|
||||
|
||||
Gauge.prototype.options = {
|
||||
colorStart: "#6fadcf",
|
||||
colorStop: void 0,
|
||||
gradientType: 0,
|
||||
strokeColor: "#e0e0e0",
|
||||
pointer: {
|
||||
length: 0.8,
|
||||
strokeWidth: 0.035
|
||||
},
|
||||
angle: 0.15,
|
||||
lineWidth: 0.44,
|
||||
fontSize: 40,
|
||||
limitMax: false,
|
||||
percentColors: [[0.0, "#fa8564"], [0.50, "#fa8564"], [1.0, "#fa8564"]]
|
||||
};
|
||||
|
||||
function Gauge(canvas) {
|
||||
this.canvas = canvas;
|
||||
Gauge.__super__.constructor.call(this);
|
||||
this.percentColors = null;
|
||||
if (typeof G_vmlCanvasManager !== 'undefined') {
|
||||
this.canvas = window.G_vmlCanvasManager.initElement(this.canvas);
|
||||
}
|
||||
this.ctx = this.canvas.getContext('2d');
|
||||
this.gp = [new GaugePointer(this)];
|
||||
this.setOptions();
|
||||
this.render();
|
||||
}
|
||||
|
||||
Gauge.prototype.setOptions = function(options) {
|
||||
var gauge, _i, _len, _ref1;
|
||||
if (options == null) {
|
||||
options = null;
|
||||
}
|
||||
Gauge.__super__.setOptions.call(this, options);
|
||||
this.configPercentColors();
|
||||
this.lineWidth = this.canvas.height * (1 - this.paddingBottom) * this.options.lineWidth;
|
||||
this.radius = this.canvas.height * (1 - this.paddingBottom) - this.lineWidth;
|
||||
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||
this.render();
|
||||
_ref1 = this.gp;
|
||||
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||
gauge = _ref1[_i];
|
||||
gauge.setOptions(this.options.pointer);
|
||||
gauge.render();
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
Gauge.prototype.configPercentColors = function() {
|
||||
var bval, gval, i, rval, _i, _ref1, _results;
|
||||
this.percentColors = null;
|
||||
if (this.options.percentColors !== void 0) {
|
||||
this.percentColors = new Array();
|
||||
_results = [];
|
||||
for (i = _i = 0, _ref1 = this.options.percentColors.length - 1; 0 <= _ref1 ? _i <= _ref1 : _i >= _ref1; i = 0 <= _ref1 ? ++_i : --_i) {
|
||||
rval = parseInt((cutHex(this.options.percentColors[i][1])).substring(0, 2), 16);
|
||||
gval = parseInt((cutHex(this.options.percentColors[i][1])).substring(2, 4), 16);
|
||||
bval = parseInt((cutHex(this.options.percentColors[i][1])).substring(4, 6), 16);
|
||||
_results.push(this.percentColors[i] = {
|
||||
pct: this.options.percentColors[i][0],
|
||||
color: {
|
||||
r: rval,
|
||||
g: gval,
|
||||
b: bval
|
||||
}
|
||||
});
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
};
|
||||
|
||||
Gauge.prototype.set = function(value) {
|
||||
var i, max_hit, val, _i, _j, _len, _ref1;
|
||||
if (!(value instanceof Array)) {
|
||||
value = [value];
|
||||
}
|
||||
if (value.length > this.gp.length) {
|
||||
for (i = _i = 0, _ref1 = value.length - this.gp.length; 0 <= _ref1 ? _i < _ref1 : _i > _ref1; i = 0 <= _ref1 ? ++_i : --_i) {
|
||||
this.gp.push(new GaugePointer(this));
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
max_hit = false;
|
||||
for (_j = 0, _len = value.length; _j < _len; _j++) {
|
||||
val = value[_j];
|
||||
if (val > this.maxValue) {
|
||||
this.maxValue = this.value * 1.1;
|
||||
max_hit = true;
|
||||
}
|
||||
this.gp[i].value = val;
|
||||
this.gp[i++].setOptions({
|
||||
maxValue: this.maxValue,
|
||||
angle: this.options.angle
|
||||
});
|
||||
}
|
||||
this.value = value[value.length - 1];
|
||||
if (max_hit) {
|
||||
if (!this.options.limitMax) {
|
||||
return AnimationUpdater.run();
|
||||
}
|
||||
} else {
|
||||
return AnimationUpdater.run();
|
||||
}
|
||||
};
|
||||
|
||||
Gauge.prototype.getAngle = function(value) {
|
||||
return (1 + this.options.angle) * Math.PI + ((value - this.minValue) / (this.maxValue - this.minValue)) * (1 - this.options.angle * 2) * Math.PI;
|
||||
};
|
||||
|
||||
Gauge.prototype.getColorForPercentage = function(pct, grad) {
|
||||
var color, endColor, i, rangePct, startColor, _i, _ref1;
|
||||
if (pct === 0) {
|
||||
color = this.percentColors[0].color;
|
||||
} else {
|
||||
color = this.percentColors[this.percentColors.length - 1].color;
|
||||
for (i = _i = 0, _ref1 = this.percentColors.length - 1; 0 <= _ref1 ? _i <= _ref1 : _i >= _ref1; i = 0 <= _ref1 ? ++_i : --_i) {
|
||||
if (pct <= this.percentColors[i].pct) {
|
||||
if (grad === true) {
|
||||
startColor = this.percentColors[i - 1];
|
||||
endColor = this.percentColors[i];
|
||||
rangePct = (pct - startColor.pct) / (endColor.pct - startColor.pct);
|
||||
color = {
|
||||
r: Math.floor(startColor.color.r * (1 - rangePct) + endColor.color.r * rangePct),
|
||||
g: Math.floor(startColor.color.g * (1 - rangePct) + endColor.color.g * rangePct),
|
||||
b: Math.floor(startColor.color.b * (1 - rangePct) + endColor.color.b * rangePct)
|
||||
};
|
||||
} else {
|
||||
color = this.percentColors[i].color;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 'rgb(' + [color.r, color.g, color.b].join(',') + ')';
|
||||
};
|
||||
|
||||
Gauge.prototype.getColorForValue = function(val, grad) {
|
||||
var pct;
|
||||
pct = (val - this.minValue) / (this.maxValue - this.minValue);
|
||||
return this.getColorForPercentage(pct, grad);
|
||||
};
|
||||
|
||||
Gauge.prototype.render = function() {
|
||||
var displayedAngle, fillStyle, gauge, h, w, _i, _len, _ref1, _results;
|
||||
w = this.canvas.width / 2;
|
||||
h = this.canvas.height * (1 - this.paddingBottom);
|
||||
displayedAngle = this.getAngle(this.displayedValue);
|
||||
if (this.textField) {
|
||||
this.textField.render(this);
|
||||
}
|
||||
this.ctx.lineCap = "butt";
|
||||
if (this.options.customFillStyle !== void 0) {
|
||||
fillStyle = this.options.customFillStyle(this);
|
||||
} else if (this.percentColors !== null) {
|
||||
fillStyle = this.getColorForValue(this.displayedValue, true);
|
||||
} else if (this.options.colorStop !== void 0) {
|
||||
if (this.options.gradientType === 0) {
|
||||
fillStyle = this.ctx.createRadialGradient(w, h, 9, w, h, 70);
|
||||
} else {
|
||||
fillStyle = this.ctx.createLinearGradient(0, 0, w, 0);
|
||||
}
|
||||
fillStyle.addColorStop(0, this.options.colorStart);
|
||||
fillStyle.addColorStop(1, this.options.colorStop);
|
||||
} else {
|
||||
fillStyle = this.options.colorStart;
|
||||
}
|
||||
this.ctx.strokeStyle = fillStyle;
|
||||
this.ctx.beginPath();
|
||||
this.ctx.arc(w, h, this.radius, (1 + this.options.angle) * Math.PI, displayedAngle, false);
|
||||
this.ctx.lineWidth = this.lineWidth;
|
||||
this.ctx.stroke();
|
||||
this.ctx.strokeStyle = this.options.strokeColor;
|
||||
this.ctx.beginPath();
|
||||
this.ctx.arc(w, h, this.radius, displayedAngle, (2 - this.options.angle) * Math.PI, false);
|
||||
this.ctx.stroke();
|
||||
_ref1 = this.gp;
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||
gauge = _ref1[_i];
|
||||
_results.push(gauge.update(true));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
return Gauge;
|
||||
|
||||
})(BaseGauge);
|
||||
|
||||
BaseDonut = (function(_super) {
|
||||
__extends(BaseDonut, _super);
|
||||
|
||||
BaseDonut.prototype.lineWidth = 15;
|
||||
|
||||
BaseDonut.prototype.displayedValue = 0;
|
||||
|
||||
BaseDonut.prototype.value = 33;
|
||||
|
||||
BaseDonut.prototype.maxValue = 80;
|
||||
|
||||
BaseDonut.prototype.minValue = 0;
|
||||
|
||||
BaseDonut.prototype.options = {
|
||||
lineWidth: 0.10,
|
||||
colorStart: "#6f6ea0",
|
||||
colorStop: "#c0c0db",
|
||||
strokeColor: "#eeeeee",
|
||||
shadowColor: "#d5d5d5",
|
||||
angle: 0.35
|
||||
};
|
||||
|
||||
function BaseDonut(canvas) {
|
||||
this.canvas = canvas;
|
||||
BaseDonut.__super__.constructor.call(this);
|
||||
if (typeof G_vmlCanvasManager !== 'undefined') {
|
||||
this.canvas = window.G_vmlCanvasManager.initElement(this.canvas);
|
||||
}
|
||||
this.ctx = this.canvas.getContext('2d');
|
||||
this.setOptions();
|
||||
this.render();
|
||||
}
|
||||
|
||||
BaseDonut.prototype.getAngle = function(value) {
|
||||
return (1 - this.options.angle) * Math.PI + ((value - this.minValue) / (this.maxValue - this.minValue)) * ((2 + this.options.angle) - (1 - this.options.angle)) * Math.PI;
|
||||
};
|
||||
|
||||
BaseDonut.prototype.setOptions = function(options) {
|
||||
if (options == null) {
|
||||
options = null;
|
||||
}
|
||||
BaseDonut.__super__.setOptions.call(this, options);
|
||||
this.lineWidth = this.canvas.height * this.options.lineWidth;
|
||||
this.radius = this.canvas.height / 2 - this.lineWidth / 2;
|
||||
return this;
|
||||
};
|
||||
|
||||
BaseDonut.prototype.set = function(value) {
|
||||
this.value = value;
|
||||
if (this.value > this.maxValue) {
|
||||
this.maxValue = this.value * 1.1;
|
||||
}
|
||||
return AnimationUpdater.run();
|
||||
};
|
||||
|
||||
BaseDonut.prototype.render = function() {
|
||||
var displayedAngle, grdFill, h, start, stop, w;
|
||||
displayedAngle = this.getAngle(this.displayedValue);
|
||||
w = this.canvas.width / 2;
|
||||
h = this.canvas.height / 2;
|
||||
if (this.textField) {
|
||||
this.textField.render(this);
|
||||
}
|
||||
grdFill = this.ctx.createRadialGradient(w, h, 39, w, h, 70);
|
||||
grdFill.addColorStop(0, this.options.colorStart);
|
||||
grdFill.addColorStop(1, this.options.colorStop);
|
||||
start = this.radius - this.lineWidth / 2;
|
||||
stop = this.radius + this.lineWidth / 2;
|
||||
this.ctx.strokeStyle = this.options.strokeColor;
|
||||
this.ctx.beginPath();
|
||||
this.ctx.arc(w, h, this.radius, (1 - this.options.angle) * Math.PI, (2 + this.options.angle) * Math.PI, false);
|
||||
this.ctx.lineWidth = this.lineWidth;
|
||||
this.ctx.lineCap = "round";
|
||||
this.ctx.stroke();
|
||||
this.ctx.strokeStyle = grdFill;
|
||||
this.ctx.beginPath();
|
||||
this.ctx.arc(w, h, this.radius, (1 - this.options.angle) * Math.PI, displayedAngle, false);
|
||||
return this.ctx.stroke();
|
||||
};
|
||||
|
||||
return BaseDonut;
|
||||
|
||||
})(BaseGauge);
|
||||
|
||||
Donut = (function(_super) {
|
||||
__extends(Donut, _super);
|
||||
|
||||
function Donut() {
|
||||
_ref1 = Donut.__super__.constructor.apply(this, arguments);
|
||||
return _ref1;
|
||||
}
|
||||
|
||||
Donut.prototype.strokeGradient = function(w, h, start, stop) {
|
||||
var grd;
|
||||
grd = this.ctx.createRadialGradient(w, h, start, w, h, stop);
|
||||
grd.addColorStop(0, this.options.shadowColor);
|
||||
grd.addColorStop(0.12, this.options._orgStrokeColor);
|
||||
grd.addColorStop(0.88, this.options._orgStrokeColor);
|
||||
grd.addColorStop(1, this.options.shadowColor);
|
||||
return grd;
|
||||
};
|
||||
|
||||
Donut.prototype.setOptions = function(options) {
|
||||
var h, start, stop, w;
|
||||
if (options == null) {
|
||||
options = null;
|
||||
}
|
||||
Donut.__super__.setOptions.call(this, options);
|
||||
w = this.canvas.width / 2;
|
||||
h = this.canvas.height / 2;
|
||||
start = this.radius - this.lineWidth / 2;
|
||||
stop = this.radius + this.lineWidth / 2;
|
||||
this.options._orgStrokeColor = this.options.strokeColor;
|
||||
this.options.strokeColor = this.strokeGradient(w, h, start, stop);
|
||||
return this;
|
||||
};
|
||||
|
||||
return Donut;
|
||||
|
||||
})(BaseDonut);
|
||||
|
||||
window.AnimationUpdater = {
|
||||
elements: [],
|
||||
animId: null,
|
||||
addAll: function(list) {
|
||||
var elem, _i, _len, _results;
|
||||
_results = [];
|
||||
for (_i = 0, _len = list.length; _i < _len; _i++) {
|
||||
elem = list[_i];
|
||||
_results.push(AnimationUpdater.elements.push(elem));
|
||||
}
|
||||
return _results;
|
||||
},
|
||||
add: function(object) {
|
||||
return AnimationUpdater.elements.push(object);
|
||||
},
|
||||
run: function() {
|
||||
var animationFinished, elem, _i, _len, _ref2;
|
||||
animationFinished = true;
|
||||
_ref2 = AnimationUpdater.elements;
|
||||
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
|
||||
elem = _ref2[_i];
|
||||
if (elem.update()) {
|
||||
animationFinished = false;
|
||||
}
|
||||
}
|
||||
if (!animationFinished) {
|
||||
return AnimationUpdater.animId = requestAnimationFrame(AnimationUpdater.run);
|
||||
} else {
|
||||
return cancelAnimationFrame(AnimationUpdater.animId);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
window.Gauge = Gauge;
|
||||
|
||||
window.Donut = Donut;
|
||||
|
||||
window.BaseDonut = BaseDonut;
|
||||
|
||||
window.TextRenderer = TextRenderer;
|
||||
|
||||
}).call(this);
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
(function($){
|
||||
|
||||
var map;
|
||||
$(document).ready(function(){
|
||||
map = new GMaps({
|
||||
el: '#basic-map',
|
||||
lat: -12.043333,
|
||||
lng: -77.028333,
|
||||
zoomControl : true,
|
||||
zoomControlOpt: {
|
||||
style : 'SMALL',
|
||||
position: 'TOP_LEFT'
|
||||
},
|
||||
panControl : false,
|
||||
streetViewControl : false,
|
||||
mapTypeControl: false,
|
||||
overviewMapControl: false
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
var map, infoWindow;
|
||||
$(document).ready(function(){
|
||||
infoWindow = new google.maps.InfoWindow({});
|
||||
map = new GMaps({
|
||||
el: '#map-2',
|
||||
zoom: 11,
|
||||
lat: 41.850033,
|
||||
lng: -87.6500523
|
||||
});
|
||||
map.loadFromFusionTables({
|
||||
query: {
|
||||
select: '\'Geocodable address\'',
|
||||
from: '1mZ53Z70NsChnBMm-qEYmSDOvLXgrreLTkQUvvg'
|
||||
},
|
||||
suppressInfoWindows: true,
|
||||
events: {
|
||||
click: function(point){
|
||||
infoWindow.setContent('You clicked here!');
|
||||
infoWindow.setPosition(point.latLng);
|
||||
infoWindow.open(map.map);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
var map, rectangle, polygon, circle;
|
||||
$(document).ready(function(){
|
||||
map = new GMaps({
|
||||
el: '#map-3',
|
||||
lat: -12.043333,
|
||||
lng: -77.028333
|
||||
});
|
||||
var bounds = [[-12.030397656836609,-77.02373871559225],[-12.034804866577001,-77.01154422636042]];
|
||||
rectangle = map.drawRectangle({
|
||||
bounds: bounds,
|
||||
strokeColor: '#BBD8E9',
|
||||
strokeOpacity: 1,
|
||||
strokeWeight: 3,
|
||||
fillColor: '#BBD8E9',
|
||||
fillOpacity: 0.6
|
||||
});
|
||||
|
||||
var paths = [[-12.040397656836609,-77.03373871559225],[-12.040248585302038,-77.03993927003302],[-12.050047116528843,-77.02448169303511],[-12.044804866577001,-77.02154422636042]];
|
||||
polygon = map.drawPolygon({
|
||||
paths: paths,
|
||||
strokeColor: '#25D359',
|
||||
strokeOpacity: 1,
|
||||
strokeWeight: 3,
|
||||
fillColor: '#25D359',
|
||||
fillOpacity: 0.6
|
||||
});
|
||||
var lat = -12.040504866577001;
|
||||
var lng = -77.02024422636042;
|
||||
circle = map.drawCircle({
|
||||
lat: lat,
|
||||
lng: lng,
|
||||
radius: 350,
|
||||
strokeColor: '#432070',
|
||||
strokeOpacity: 1,
|
||||
strokeWeight: 3,
|
||||
fillColor: '#432070',
|
||||
fillOpacity: 0.6
|
||||
});
|
||||
for(var i in paths){
|
||||
bounds.push(paths[i]);
|
||||
}
|
||||
var b = [];
|
||||
for(var i in bounds){
|
||||
latlng = new google.maps.LatLng(bounds[i][0], bounds[i][1]);
|
||||
b.push(latlng);
|
||||
}
|
||||
for(var i in paths){
|
||||
latlng = new google.maps.LatLng(paths[i][0], paths[i][1]);
|
||||
b.push(latlng);
|
||||
}
|
||||
map.fitLatLngBounds(b);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var map;
|
||||
$(document).ready(function(){
|
||||
map = new GMaps({
|
||||
el: '#map-4',
|
||||
lat: -12.043333,
|
||||
lng: -77.028333
|
||||
});
|
||||
//locations request
|
||||
map.getElevations({
|
||||
locations : [[-12.040397656836609,-77.03373871559225], [-12.050047116528843,-77.02448169303511], [-12.044804866577001,-77.02154422636042]],
|
||||
callback : function (result, status){
|
||||
if (status == google.maps.ElevationStatus.OK) {
|
||||
for (var i in result){
|
||||
map.addMarker({
|
||||
lat: result[i].location.lat(),
|
||||
lng: result[i].location.lng(),
|
||||
title: 'Marker with InfoWindow',
|
||||
infoWindow: {
|
||||
content: '<p>The elevation is '+result[i].elevation+' in meters</p>'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var map;
|
||||
$(document).ready(function(){
|
||||
var map = new GMaps({
|
||||
el: '#map-5',
|
||||
lat: -12.043333,
|
||||
lng: -77.028333
|
||||
});
|
||||
|
||||
GMaps.geolocate({
|
||||
success: function(position){
|
||||
map.setCenter(position.coords.latitude, position.coords.longitude);
|
||||
},
|
||||
error: function(error){
|
||||
alert('Geolocation failed: '+error.message);
|
||||
},
|
||||
not_supported: function(){
|
||||
alert("Your browser does not support geolocation");
|
||||
},
|
||||
always: function(){
|
||||
alert("Done!");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var map, infoWindow;
|
||||
$(document).ready(function(){
|
||||
infoWindow = new google.maps.InfoWindow({});
|
||||
map = new GMaps({
|
||||
el: '#map-6',
|
||||
zoom: 12,
|
||||
lat: 40.65,
|
||||
lng: -73.95
|
||||
});
|
||||
map.loadFromKML({
|
||||
url: 'https://api.flickr.com/services/feeds/geo/?g=322338@N20&lang=en-us&format=feed-georss',
|
||||
suppressInfoWindows: true,
|
||||
events: {
|
||||
click: function(point){
|
||||
infoWindow.setContent(point.featureData.infoWindowHtml);
|
||||
infoWindow.setPosition(point.latLng);
|
||||
infoWindow.open(map.map);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var map;
|
||||
$(function () {
|
||||
map = new GMaps({
|
||||
el: "#map-7",
|
||||
lat: -12.043333,
|
||||
lng: -77.028333,
|
||||
zoom: 3
|
||||
});
|
||||
|
||||
map.addLayer('weather', {
|
||||
clickable: false
|
||||
});
|
||||
map.addLayer('clouds');
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
map = new GMaps({
|
||||
el: '#map-8',
|
||||
zoom: 16,
|
||||
lat: -12.043333,
|
||||
lng: -77.028333,
|
||||
click: function(e){
|
||||
alert('click');
|
||||
},
|
||||
dragend: function(e){
|
||||
alert('dragend');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
Vendored
+134
@@ -0,0 +1,134 @@
|
||||
|
||||
|
||||
window.google = window.google || {};
|
||||
google.maps = google.maps || {};
|
||||
(function() {
|
||||
|
||||
function getScript(src) {
|
||||
document.write('<' + 'script src="' + src + '"><' + '/script>');
|
||||
}
|
||||
|
||||
var modules = google.maps.modules = {};
|
||||
google.maps.__gjsload__ = function(name, text) {
|
||||
modules[name] = text;
|
||||
};
|
||||
|
||||
google.maps.Load = function(apiLoad) {
|
||||
delete google.maps.Load;
|
||||
apiLoad([0.009999999776482582,[null,[["http://khm0.googleapis.com/kh?v=717\u0026hl=en-US\u0026","http://khm1.googleapis.com/kh?v=717\u0026hl=en-US\u0026"],null,null,null,1,"717",["https://khms0.google.com/kh?v=717\u0026hl=en-US\u0026","https://khms1.google.com/kh?v=717\u0026hl=en-US\u0026"]],null,null,null,null,[["http://cbk0.googleapis.com/cbk?","http://cbk1.googleapis.com/cbk?"]],[["http://khm0.googleapis.com/kh?v=103\u0026hl=en-US\u0026","http://khm1.googleapis.com/kh?v=103\u0026hl=en-US\u0026"],null,null,null,null,"103",["https://khms0.google.com/kh?v=103\u0026hl=en-US\u0026","https://khms1.google.com/kh?v=103\u0026hl=en-US\u0026"]],[["http://mt0.googleapis.com/mapslt?hl=en-US\u0026","http://mt1.googleapis.com/mapslt?hl=en-US\u0026"]],null,null,null,[["https://mts0.googleapis.com/mapslt?hl=en-US\u0026","https://mts1.googleapis.com/mapslt?hl=en-US\u0026"]]],["en-US","US",null,0,null,null,"http://maps.gstatic.com/mapfiles/","http://csi.gstatic.com","https://maps.googleapis.com","http://maps.googleapis.com",null,"https://maps.google.com","https://gg.google.com","http://maps.gstatic.com/maps-api-v3/api/images/","https://www.google.com/maps",0,"https://www.google.com"],["http://maps.google.com/maps-api-v3/api/js/28/3","3.28.3"],[1327120018],1,null,null,null,null,null,"",null,null,0,"http://khm.googleapis.com/mz?v=717\u0026",null,"https://earthbuilder.googleapis.com","https://earthbuilder.googleapis.com",null,"http://mt.googleapis.com/maps/vt/icon",[["http://maps.google.com/maps/vt"],["https://maps.google.com/maps/vt"],null,null,null,null,null,null,null,null,null,null,["https://www.google.com/maps/vt"],"/maps/vt",375000000,375],2,500,[null,null,null,null,"http://www.google.com/maps/preview/log204","","http://static.panoramio.com.storage.googleapis.com/photos/",["http://geo0.ggpht.com/cbk","http://geo1.ggpht.com/cbk","http://geo2.ggpht.com/cbk","http://geo3.ggpht.com/cbk"],"https://maps.googleapis.com/maps/api/js/GeoPhotoService.GetMetadata","https://maps.googleapis.com/maps/api/js/GeoPhotoService.SingleImageSearch",["http://lh3.ggpht.com/","http://lh4.ggpht.com/","http://lh5.ggpht.com/","http://lh6.ggpht.com/"]],["https://www.google.com/maps/api/js/master?pb=!1m2!1u28!2s3!2sen-US!3sUS!4s28/3","https://www.google.com/maps/api/js/widget?pb=!1m2!1u28!2s3!2sen-US"],null,0,null,"/maps/api/js/ApplicationService.GetEntityDetails",0,null,null,[null,null,null,null,null,null,null,null,null,[0,0]],null,[],["28.3"]], loadScriptTime);
|
||||
};
|
||||
var loadScriptTime = (new Date).getTime();
|
||||
})();
|
||||
// inlined
|
||||
(function(_){var Ga,Ha,Ma,Pa,ib,ob,pb,qb,rb,vb,wb,yb,Bb,xb,Cb,Db,Kb,Ob,Qb,Rb,Sb,Vb,Xb,$b,Ub,Wb,bc,dc,gc,rc,xc,Hc,Mc,Lc,Nc,Qc,Vc,Xc,$c,bd,ad,fd,nd,pd,qd,ud,yd,Bd,Fd,Hd,Nd,ae,ce,ne,oe,qe,se,te,we,ye,xe,Ae,Be,Ce,He,Ie,Je,Me,Ne,Pe,Qe,Re,Se,Ye,$e,af,hf,jf,kf,lf,mf,of,pf,qf,uf,vf,Df,Ff,Of,Uf,Wf,dg,fg,gg,hg,ig,jg,lg,mg,ng,og,sg,qg,tg,ug,yg,Ag,Dg,Eg,Kg,Jg,Ng,Og,Sg,Tg,Wg,Xg,Yg,Zg,$g,ah,bh,ch,dh,Da,Ea;_.ba="ERROR";_.ca="INVALID_REQUEST";_.da="MAX_DIMENSIONS_EXCEEDED";_.ea="MAX_ELEMENTS_EXCEEDED";_.fa="MAX_WAYPOINTS_EXCEEDED";
|
||||
_.ga="NOT_FOUND";_.ha="OK";_.ia="OVER_QUERY_LIMIT";_.ja="REQUEST_DENIED";_.ka="UNKNOWN_ERROR";_.la="ZERO_RESULTS";_.ma=function(){return function(a){return a}};_.na=function(){return function(){}};_.oa=function(a){return function(b){this[a]=b}};_.pa=function(a){return function(){return this[a]}};_.qa=function(a){return function(){return a}};_.sa=function(a){return function(){return _.ra[a].apply(this,arguments)}};_.m=function(a){return void 0!==a};_.ta=_.na();
|
||||
_.ua=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
|
||||
else if("function"==b&&"undefined"==typeof a.call)return"object";return b};_.va=function(a){return"array"==_.ua(a)};_.wa=function(a){var b=_.ua(a);return"array"==b||"object"==b&&"number"==typeof a.length};_.ya=function(a){return"string"==typeof a};_.za=function(a){return"number"==typeof a};_.Aa=function(a){return"function"==_.ua(a)};_.Ba=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b};_.Fa=function(a){return a[Da]||(a[Da]=++Ea)};
|
||||
Ga=function(a,b,c){return a.call.apply(a.bind,arguments)};Ha=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}};_.p=function(a,b,c){_.p=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?Ga:Ha;return _.p.apply(null,arguments)};_.Ia=function(){return+new Date};
|
||||
_.t=function(a,b){function c(){}c.prototype=b.prototype;a.Hb=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Ee=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];b.prototype[c].apply(a,d)}};_.Ja=function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};_.La=function(){return-1!=_.Ka.toLowerCase().indexOf("webkit")};
|
||||
_.Na=function(a,b){var c=0;a=_.Ja(String(a)).split(".");b=_.Ja(String(b)).split(".");for(var d=Math.max(a.length,b.length),e=0;0==c&&e<d;e++){var f=a[e]||"",g=b[e]||"";do{f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];if(0==f[0].length&&0==g[0].length)break;c=Ma(0==f[1].length?0:(0,window.parseInt)(f[1],10),0==g[1].length?0:(0,window.parseInt)(g[1],10))||Ma(0==f[2].length,0==g[2].length)||Ma(f[2],g[2]);f=f[3];g=g[3]}while(0==c)}return c};
|
||||
Ma=function(a,b){return a<b?-1:a>b?1:0};_.Oa=function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(_.ya(a))return _.ya(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};_.v=function(a,b,c){for(var d=a.length,e=_.ya(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};Pa=function(a,b){for(var c=a.length,d=_.ya(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return e;return-1};
|
||||
_.Ra=function(a,b){b=_.Oa(a,b);var c;(c=0<=b)&&_.Qa(a,b);return c};_.Qa=function(a,b){Array.prototype.splice.call(a,b,1)};_.Sa=function(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};_.Ta=function(a){return""+(_.Ba(a)?_.Fa(a):a)};_.w=function(a){return a?a.length:0};_.Wa=function(a,b){_.Ua(b,function(c){a[c]=b[c]})};_.Xa=function(a){for(var b in a)return!1;return!0};_.Ya=function(a,b,c){null!=b&&(a=Math.max(a,b));null!=c&&(a=Math.min(a,c));return a};
|
||||
_.Za=function(a,b,c){c-=b;return((a-b)%c+c)%c+b};_.$a=function(a,b,c){return Math.abs(a-b)<=(c||1E-9)};_.ab=function(a,b){for(var c=[],d=_.w(a),e=0;e<d;++e)c.push(b(a[e],e));return c};_.cb=function(a,b){for(var c=_.bb(void 0,_.w(b)),d=_.bb(void 0,0);d<c;++d)a.push(b[d])};_.x=function(a){return"number"==typeof a};_.db=function(a){return"object"==typeof a};_.bb=function(a,b){return null==a?b:a};_.eb=function(a){return"string"==typeof a};_.fb=function(a){return a===!!a};
|
||||
_.Ua=function(a,b){for(var c in a)b(c,a[c])};_.hb=function(a){return function(){var b=this,c=arguments;_.gb(function(){a.apply(b,c)})}};_.gb=function(a){return window.setTimeout(a,0)};ib=function(a,b){if(Object.prototype.hasOwnProperty.call(a,b))return a[b]};_.jb=function(a){window.console&&window.console.error&&window.console.error(a)};_.mb=function(a){a=a||window.event;_.kb(a);_.lb(a)};_.kb=function(a){a.cancelBubble=!0;a.stopPropagation&&a.stopPropagation()};
|
||||
_.lb=function(a){a.preventDefault&&_.m(a.defaultPrevented)?a.preventDefault():a.returnValue=!1};_.nb=function(a){a.handled=!0;_.m(a.bubbles)||(a.returnValue="handled")};ob=function(a,b){a.__e3_||(a.__e3_={});a=a.__e3_;a[b]||(a[b]={});return a[b]};pb=function(a,b){var c=a.__e3_||{};if(b)a=c[b]||{};else for(b in a={},c)_.Wa(a,c[b]);return a};qb=function(a,b){return function(c){return b.call(a,c,this)}};
|
||||
rb=function(a,b,c){return function(d){var e=[b,a];_.cb(e,arguments);_.y.trigger.apply(this,e);c&&_.nb.apply(null,arguments)}};vb=function(a,b,c,d){this.f=a;this.j=b;this.b=c;this.l=null;this.m=d;this.id=++sb;ob(a,b)[this.id]=this;tb&&"tagName"in a&&(ub[this.id]=this)};wb=function(a){return a.l=function(b){b||(b=window.event);if(b&&!b.target)try{b.target=b.srcElement}catch(d){}var c;c=a.b.apply(a.f,[b]);return b&&"click"==b.type&&(b=b.srcElement)&&"A"==b.tagName&&"javascript:void(0)"==b.href?!1:c}};
|
||||
_.C=_.na();yb=function(a,b){var c=b+"_changed";if(a[c])a[c]();else a.changed(b);var c=xb(a,b),d;for(d in c){var e=c[d];yb(e.Ac,e.Ya)}_.y.trigger(a,b.toLowerCase()+"_changed")};_.Ab=function(a){return zb[a]||(zb[a]=a.substr(0,1).toUpperCase()+a.substr(1))};Bb=function(a){a.gm_accessors_||(a.gm_accessors_={});return a.gm_accessors_};xb=function(a,b){a.gm_bindings_||(a.gm_bindings_={});a.gm_bindings_.hasOwnProperty(b)||(a.gm_bindings_[b]={});return a.gm_bindings_[b]};Cb=_.na();
|
||||
Db=function(a,b,c){this.l=c;this.j=a;this.m=b;this.f=0;this.b=null};_.Eb=_.ma();_.Fb=function(a){var b=!1,c;return function(){b||(c=a(),b=!0);return c}};_.Gb=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)};_.Ib=function(a){_.Ib[" "](a);return a};Kb=function(a,b){var c=Jb;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};_.Lb=function(a,b){this.f=a||0;this.j=b||0};_.Mb=function(a,b){if(a)return function(){--a||b()};b();return _.ta};
|
||||
_.Nb=function(a,b,c){var d=a.getElementsByTagName("head")[0];a=a.createElement("script");a.type="text/javascript";a.charset="UTF-8";a.src=b;c&&(a.onerror=c);d.appendChild(a);return a};Ob=function(a){for(var b="",c=0,d=arguments.length;c<d;++c){var e=arguments[c];e.length&&"/"==e[0]?b=e:(b&&"/"!=b[b.length-1]&&(b+="/"),b+=e)}return b};_.Pb=function(a){return-1!=_.Ka.indexOf(a)};Qb=function(a){this.j=window.document;this.b={};this.f=a};Rb=function(){this.f=this.b=null};
|
||||
Sb=function(){this.next=this.b=this.xc=null};_.Tb=function(){return _.Pb("iPhone")&&!_.Pb("iPod")&&!_.Pb("iPad")};Vb=function(){this.l={};this.f={};this.m={};this.b={};this.j=new Ub};Xb=function(a,b){a.l[b]||(a.l[b]=!0,Wb(a.j,function(c){for(var d=c.fh[b],e=d?d.length:0,f=0;f<e;++f){var g=d[f];a.b[g]||Xb(a,g)}c=c.Yl;c.b[b]||_.Nb(c.j,Ob(c.f,b)+".js")}))};
|
||||
$b=function(a,b){var c=Yb;this.Yl=a;this.fh=c;a={};for(var d in c)for(var e=c[d],f=0,g=e.length;f<g;++f){var h=e[f];a[h]||(a[h]=[]);a[h].push(d)}this.gn=a;this.nk=b};Ub=function(){this.b=[]};Wb=function(a,b){a.f?b(a.f):a.b.push(b)};bc=function(a){var b=a;if(a instanceof Array)b=Array(a.length),_.ac(b,a);else if(a instanceof Object){var c=b={},d;for(d in a)a.hasOwnProperty(d)&&(c[d]=bc(a[d]))}return b};_.ac=function(a,b){for(var c=0;c<b.length;++c)b.hasOwnProperty(c)&&(a[c]=bc(b[c]))};
|
||||
_.cc=function(a,b){a[b]||(a[b]=[]);return a[b]};_.ec=function(a,b){if(null==a||null==b)return null==a==(null==b);if(a.constructor!=Array&&a.constructor!=Object)throw Error("Invalid object type passed into jsproto.areObjectsEqual()");if(a===b)return!0;if(a.constructor!=b.constructor)return!1;for(var c in a)if(!(c in b&&dc(a[c],b[c])))return!1;for(var d in b)if(!(d in a))return!1;return!0};
|
||||
dc=function(a,b){if(a===b||!(!0!==a&&1!==a||!0!==b&&1!==b)||!(!1!==a&&0!==a||!1!==b&&0!==b))return!0;if(a instanceof Object&&b instanceof Object){if(!_.ec(a,b))return!1}else return!1;return!0};_.fc=function(a,b,c,d){this.type=a;this.label=b;this.vk=c;this.vc=d};gc=function(a){switch(a){case "d":case "f":case "i":case "j":case "u":case "v":case "x":case "y":case "g":case "h":case "n":case "o":case "e":return 0;case "s":case "z":case "B":return"";case "b":return!1;default:return null}};
|
||||
_.hc=function(a,b,c){return new _.fc(a,1,_.m(b)?b:gc(a),c)};_.ic=function(a,b,c){return new _.fc(a,2,_.m(b)?b:gc(a),c)};_.jc=function(a){return _.hc("i",a)};_.nc=function(a){return _.hc("v",a)};_.oc=function(a){return _.hc("b",a)};_.pc=function(a){return _.hc("e",a)};_.F=function(a,b){return _.hc("m",a,b)};_.qc=function(){return _.Pb("Trident")||_.Pb("MSIE")};_.sc=function(){return _.Pb("Safari")&&!(rc()||_.Pb("Coast")||_.Pb("Opera")||_.Pb("Edge")||_.Pb("Silk")||_.Pb("Android"))};
|
||||
rc=function(){return(_.Pb("Chrome")||_.Pb("CriOS"))&&!_.Pb("Edge")};_.tc=function(a){return a*Math.PI/180};_.uc=function(a){return 180*a/Math.PI};_.vc=_.oa("b");_.G=function(a,b,c){var d=Vb.b();a=""+a;d.b[a]?b(d.b[a]):((d.f[a]=d.f[a]||[]).push(b),c||Xb(d,a))};_.wc=function(a,b){Vb.b().b[""+a]=b};xc=function(a,b,c){var d=[],e=_.Mb(a.length,function(){b.apply(null,d)});_.v(a,function(a,b){_.G(a,function(a){d[b]=a;e()},c)})};_.I=function(a){this.data=a||[]};
|
||||
_.yc=function(a,b,c){a=a.data[b];return null!=a?a:c};_.K=function(a,b,c){return _.yc(a,b,c||0)};_.L=function(a,b,c){return _.yc(a,b,c||"")};_.M=function(a,b){var c=a.data[b];c||(c=a.data[b]=[]);return c};_.zc=function(a,b){return _.cc(a.data,b)};_.Ec=function(a,b,c){return _.zc(a,b)[c]};_.Fc=function(a,b){return a.data[b]?a.data[b].length:0};Hc=function(a){_.Gc.setTimeout(function(){throw a;},0)};
|
||||
Mc=function(){var a=_.Ic.f,a=Jc(a);!_.Aa(_.Gc.setImmediate)||_.Gc.Window&&_.Gc.Window.prototype&&!_.Pb("Edge")&&_.Gc.Window.prototype.setImmediate==_.Gc.setImmediate?(Kc||(Kc=Lc()),Kc(a)):_.Gc.setImmediate(a)};
|
||||
Lc=function(){var a=_.Gc.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!_.Pb("Presto")&&(a=function(){var a=window.document.createElement("IFRAME");a.style.display="none";a.src="";window.document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+"//"+b.location.host,a=(0,_.p)(function(a){if(("*"==
|
||||
d||a.origin==d)&&a.data==c)this.port1.onmessage()},this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&!_.qc()){var b=new a,c={},d=c;b.port1.onmessage=function(){if(_.m(c.next)){c=c.next;var a=c.ng;c.ng=null;a()}};return function(a){d.next={ng:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof window.document&&"onreadystatechange"in window.document.createElement("SCRIPT")?function(a){var b=window.document.createElement("SCRIPT");
|
||||
b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};window.document.documentElement.appendChild(b)}:function(a){_.Gc.setTimeout(a,0)}};Nc=function(){var a=_.Gc.document;return a?a.documentMode:void 0};_.Pc=function(a){return Kb(a,function(){return 0<=_.Na(_.Oc,a)})};Qc=function(a,b){-180==a&&180!=b&&(a=180);-180==b&&180!=a&&(b=180);this.b=a;this.f=b};_.Rc=function(a){return a.b>a.f};
|
||||
_.Tc=function(a,b){return 1E-9>=Math.abs(b.b-a.b)%360+Math.abs(_.Sc(b)-_.Sc(a))};_.Uc=function(a,b){var c=b-a;return 0<=c?c:b+180-(a-180)};_.Sc=function(a){return a.isEmpty()?0:_.Rc(a)?360-(a.b-a.f):a.f-a.b};Vc=function(a,b){this.f=a;this.b=b};_.Wc=function(a){return a.isEmpty()?0:a.b-a.f};Xc=function(a){this.message=a;this.name="InvalidValueError";this.stack=Error().stack};_.Yc=function(a,b){var c="";if(null!=b){if(!(b instanceof Xc))return b;c=": "+b.message}return new Xc(a+c)};
|
||||
_.Zc=function(a){if(!(a instanceof Xc))throw a;_.jb(a.name+": "+a.message)};$c=_.na();bd=function(a,b,c){for(var d=1;d<b.A.length;++d){var e=b.A[d],f=a[d+b.b];if(e&&null!=f)if(3==e.label)for(var g=0;g<f.length;++g)ad(f[g],d,e,c);else ad(f,d,e,c)}};ad=function(a,b,c,d){if("m"==c.type){var e=d.length;bd(a,c.vc,d);d.splice(e,0,[b,"m",d.length-e].join(""))}else"b"==c.type&&(a=a?"1":"0"),d.push([b,c.type,(0,window.encodeURIComponent)(a)].join(""))};
|
||||
_.Ic=function(a,b){_.Ic.b||_.Ic.m();_.Ic.j||(_.Ic.b(),_.Ic.j=!0);_.Ic.l.add(a,b)};_.cd=function(a,b){var c;c=c?c+": ":"";return function(d){if(!d||!_.db(d))throw _.Yc(c+"not an Object");var e={},f;for(f in d)if(e[f]=d[f],!b&&!a[f])throw _.Yc(c+"unknown property "+f);for(f in a)try{var g=a[f](e[f]);if(_.m(g)||Object.prototype.hasOwnProperty.call(d,f))e[f]=a[f](e[f])}catch(h){throw _.Yc(c+"in property "+f,h);}return e}};fd=function(a){try{return!!a.cloneNode}catch(b){return!1}};
|
||||
_.gd=function(a,b,c){return c?function(c){if(c instanceof a)return c;try{return new a(c)}catch(e){throw _.Yc("when calling new "+b,e);}}:function(c){if(c instanceof a)return c;throw _.Yc("not an instance of "+b);}};_.hd=function(a){return function(b){for(var c in a)if(a[c]==b)return b;throw _.Yc(b);}};_.id=function(a){return function(b){if(!_.va(b))throw _.Yc("not an Array");return _.ab(b,function(b,d){try{return a(b)}catch(e){throw _.Yc("at index "+d,e);}})}};
|
||||
_.jd=function(a,b){return function(c){if(a(c))return c;throw _.Yc(b||""+c);}};_.kd=function(a){return function(b){for(var c=[],d=0,e=a.length;d<e;++d){var f=a[d];try{(f.If||f)(b)}catch(g){if(!(g instanceof Xc))throw g;c.push(g.message);continue}return(f.then||f)(b)}throw _.Yc(c.join("; and "));}};_.ld=function(a,b){return function(c){return b(a(c))}};_.md=function(a){return function(b){return null==b?b:a(b)}};
|
||||
nd=function(a){return function(b){if(b&&null!=b[a])return b;throw _.Yc("no "+a+" property");}};_.N=function(a,b){this.x=a;this.y=b};pd=function(a){if(a instanceof _.N)return a;try{_.cd({x:_.od,y:_.od},!0)(a)}catch(b){throw _.Yc("not a Point",b);}return new _.N(a.x,a.y)};_.O=function(a,b,c,d){this.width=a;this.height=b;this.j=c||"px";this.f=d||"px"};qd=function(a){if(a instanceof _.O)return a;try{_.cd({height:_.od,width:_.od},!0)(a)}catch(b){throw _.Yc("not a Size",b);}return new _.O(a.width,a.height)};
|
||||
ud=function(a){var b=rd,c=Vb.b().j;a=c.f=new $b(new Qb(a),b);for(var b=0,d=c.b.length;b<d;++b)c.b[b](a);c.b.length=0};_.vd=function(a){this.j=a||_.Ta;this.f={}};_.wd=function(a,b){var c=a.f,d=a.j(b);c[d]||(c[d]=b,_.y.trigger(a,"insert",b),a.b&&a.b(b))};_.xd=function(a,b,c){this.heading=a;this.pitch=_.Ya(b,-90,90);this.zoom=Math.max(0,c)};yd=function(a){this.P=[];this.b=a&&a.bd||_.ta;this.f=a&&a.cd||_.ta};
|
||||
_.Ad=function(a,b,c,d){function e(){_.v(f,function(a){b.call(c||null,function(b){if(a.once){if(a.once.lg)return;a.once.lg=!0;_.Ra(g.P,a);g.P.length||g.b()}a.xc.call(a.context,b)})})}var f=a.P.slice(0),g=a;d&&d.Gn?e():zd(e)};Bd=function(a,b){return function(c){return c.xc==a&&c.context==(b||null)}};
|
||||
_.Q=function(a,b,c){if(a&&(void 0!==a.lat||void 0!==a.lng))try{Cd(a),b=a.lng,a=a.lat,c=!1}catch(d){_.Zc(d)}a-=0;b-=0;c||(a=_.Ya(a,-90,90),180!=b&&(b=_.Za(b,-180,180)));this.lat=function(){return a};this.lng=function(){return b}};_.Dd=function(a){return _.tc(a.lat())};_.Ed=function(a){return _.tc(a.lng())};Fd=function(a,b){b=Math.pow(10,b);return Math.round(a*b)/b};_.Gd=function(){this.P=new yd({bd:(0,_.p)(this.bd,this),cd:(0,_.p)(this.cd,this)})};Hd=_.na();
|
||||
_.Id=function(a){try{if(a instanceof _.Q)return a;a=Cd(a);return new _.Q(a.lat,a.lng)}catch(b){throw _.Yc("not a LatLng or LatLngLiteral",b);}};_.Jd=function(a){return function(){return this.get(a)}};_.Kd=function(a,b){return b?function(c){try{this.set(a,b(c))}catch(d){_.Zc(_.Yc("set"+_.Ab(a),d))}}:function(b){this.set(a,b)}};_.Ld=function(a,b){_.Ua(b,function(b,d){var c=_.Jd(b);a["get"+_.Ab(b)]=c;d&&(d=_.Kd(b,d),a["set"+_.Ab(b)]=d)})};_.Md=function(){_.Gd.call(this)};_.Od=function(a){return new Nd(a)};
|
||||
Nd=function(a){_.Gd.call(this);this.b=a};_.Td=function(a){this.b=(0,_.Pd)(a)};_.Ud=function(a){this.b=(0,_.Pd)(a)};_.Vd=function(a){this.b=(0,_.Pd)(a)};_.Wd=function(a){this.b=_.Id(a)};_.Xd=function(a,b){a=a&&_.Id(a);b=b&&_.Id(b);if(a){b=b||a;var c=_.Ya(a.lat(),-90,90),d=_.Ya(b.lat(),-90,90);this.f=new Vc(c,d);a=a.lng();b=b.lng();360<=b-a?this.b=new Qc(-180,180):(a=_.Za(a,-180,180),b=_.Za(b,-180,180),this.b=new Qc(a,b))}else this.f=new Vc(1,-1),this.b=new Qc(180,-180)};
|
||||
_.Yd=function(a,b,c,d){return new _.Xd(new _.Q(a,b,!0),new _.Q(c,d,!0))};_.$d=function(a){if(a instanceof _.Xd)return a;try{return a=Zd(a),_.Yd(a.south,a.west,a.north,a.east)}catch(b){throw _.Yc("not a LatLngBounds or LatLngBoundsLiteral",b);}};_.be=function(a){this.b=a||[];ae(this)};ae=function(a){a.set("length",a.b.length)};ce=function(a){if(a instanceof Hd)return a;try{return new _.Wd(_.Id(a))}catch(b){}throw _.Yc("not a Geometry or LatLng or LatLngLiteral object");};_.ee=function(a){this.b=de(a)};
|
||||
_.ge=function(a){this.b=fe(a)};_.he=function(a){a=a||{};this.j=a.id;this.b=null;try{this.b=a.geometry?ce(a.geometry):null}catch(b){_.Zc(b)}this.f=a.properties||{}};_.je=function(a){this.b=[];try{this.b=ie(a)}catch(b){_.Zc(b)}};_.le=function(a){this.b=ke(a)};_.me=function(){this.__gm=new _.C;this.l=null};ne=function(){this.b={}};oe=_.na();qe=function(){this.b={};this.j={};this.f={}};
|
||||
_.re=function(a,b,c){function d(a){if(!a)throw _.Yc("not a Feature");if("Feature"!=a.type)throw _.Yc('type != "Feature"');var b=a.geometry;try{b=null==b?null:e(b)}catch(J){throw _.Yc('in property "geometry"',J);}var d=a.properties||{};if(!_.db(d))throw _.Yc("properties is not an Object");var f=c.idPropertyName;a=f?d[f]:a.id;if(null!=a&&!_.x(a)&&!_.eb(a))throw _.Yc((f||"id")+" is not a string or number");return{id:a,geometry:b,properties:d}}function e(a){if(null==a)throw _.Yc("is null");var b=(a.type+
|
||||
"").toLowerCase(),c=a.coordinates;try{switch(b){case "point":return new _.Wd(h(c));case "multipoint":return new _.Vd(n(c));case "linestring":return g(c);case "multilinestring":return new _.ee(q(c));case "polygon":return f(c);case "multipolygon":return new _.le(u(c))}}catch(D){throw _.Yc('in property "coordinates"',D);}if("geometrycollection"==b)try{return new _.je(A(a.geometries))}catch(D){throw _.Yc('in property "geometries"',D);}throw _.Yc("invalid type");}function f(a){return new _.ge(r(a))}function g(a){return new _.Td(n(a))}
|
||||
function h(a){a=l(a);return _.Id({lat:a[1],lng:a[0]})}if(!b)return[];c=c||{};var l=_.id(_.od),n=_.id(h),q=_.id(g),r=_.id(function(a){a=n(a);if(!a.length)throw _.Yc("contains no elements");if(!a[0].b(a[a.length-1]))throw _.Yc("first and last positions are not equal");return new _.Ud(a.slice(0,-1))}),u=_.id(f),A=_.id(e),B=_.id(d);if("FeatureCollection"==b.type){b=b.features;try{return _.ab(B(b),function(b){return a.add(b)})}catch(E){throw _.Yc('in property "features"',E);}}if("Feature"==b.type)return[a.add(d(b))];
|
||||
throw _.Yc("not a Feature or FeatureCollection");};se=_.na();te=function(a){a=a||{};a.visible=_.bb(a.visible,!0);return a};_.ue=function(a){return a&&a.radius||6378137};we=function(a){return a instanceof _.be?ve(a):new _.be((0,_.Pd)(a))};ye=function(a){var b;_.va(a)||a instanceof _.be?0==_.w(a)?b=!0:(b=a instanceof _.be?a.getAt(0):a[0],b=_.va(b)||b instanceof _.be):b=!1;return b?a instanceof _.be?xe(ve)(a):new _.be(_.id(we)(a)):new _.be([we(a)])};
|
||||
xe=function(a){return function(b){if(!(b instanceof _.be))throw _.Yc("not an MVCArray");b.forEach(function(b,d){try{a(b)}catch(e){throw _.Yc("at index "+d,e);}});return b}};_.ze=_.oa("__gm");Ae=function(a){this.b=new ne;var b=this;_.y.addListenerOnce(a,"addfeature",function(){_.G("data",function(c){c.b(b,a,b.b)})})};Be=function(a){a=a||{};a.clickable=_.bb(a.clickable,!0);a.visible=_.bb(a.visible,!0);this.setValues(a);_.G("marker",_.ta)};
|
||||
Ce=function(a){this.set("latLngs",new _.be([new _.be]));this.setValues(te(a));_.G("poly",_.ta)};_.De=function(a){this.__gm={set:null,Gd:null,Eb:{map:null,Wd:null}};Be.call(this,a)};_.Ee=function(a){Ce.call(this,a)};_.Fe=function(a){Ce.call(this,a)};
|
||||
He=function(a){var b=this;a=a||{};this.setValues(a);this.b=new qe;_.y.forward(this.b,"addfeature",this);_.y.forward(this.b,"removefeature",this);_.y.forward(this.b,"setgeometry",this);_.y.forward(this.b,"setproperty",this);_.y.forward(this.b,"removeproperty",this);this.f=new Ae(this.b);this.f.bindTo("map",this);this.f.bindTo("style",this);_.v(_.Ge,function(a){_.y.forward(b.f,a,b)});this.j=!1};Ie=function(a){a.j||(a.j=!0,_.G("drawing_impl",function(b){b.ql(a)}))};
|
||||
Je=function(a){if(!a)return null;var b;_.ya(a)?(b=window.document.createElement("div"),b.style.overflow="auto",b.innerHTML=a):a.nodeType==window.Node.TEXT_NODE?(b=window.document.createElement("div"),b.appendChild(a)):b=a;return b};_.Le=function(a){_.Ke&&a&&_.Ke.push(a)};
|
||||
Me=function(a,b){this.b=a;this.f=b;a.addListener("map_changed",(0,_.p)(this.qm,this));this.bindTo("map",a);this.bindTo("disableAutoPan",a);this.bindTo("maxWidth",a);this.bindTo("position",a);this.bindTo("zIndex",a);this.bindTo("internalAnchor",a,"anchor");this.bindTo("internalContent",a,"content");this.bindTo("internalPixelOffset",a,"pixelOffset")};Ne=function(a,b,c,d){c?a.bindTo(b,c,d):(a.unbind(b),a.set(b,void 0))};
|
||||
_.Oe=function(a){function b(){e||(e=!0,_.G("infowindow",function(a){a.Tj(d)}))}window.setTimeout(function(){_.G("infowindow",_.ta)},100);a=a||{};var c=!!a.b;delete a.b;var d=new Me(this,c),e=!1;_.y.addListenerOnce(this,"anchor_changed",b);_.y.addListenerOnce(this,"map_changed",b);this.setValues(a)};Pe=function(a){this.setValues(a)};Qe=_.na();Re=_.na();Se=_.na();_.Te=function(){_.G("geocoder",_.ta)};_.Ue=function(a,b,c){this.H=null;this.set("url",a);this.set("bounds",_.md(_.$d)(b));this.setValues(c)};
|
||||
Ye=function(a,b){_.eb(a)?(this.set("url",a),this.setValues(b)):this.setValues(a)};_.Ze=function(){var a=this;_.G("layers",function(b){b.b(a)})};$e=function(a){this.setValues(a);var b=this;_.G("layers",function(a){a.f(b)})};af=function(){var a=this;_.G("layers",function(b){b.j(a)})};_.bf=function(){this.b=""};_.cf=function(a){var b=new _.bf;b.b=a;return b};_.df=_.na();_.ff=function(){this.Ue="";this.kj=_.ef;this.b=null};_.gf=function(a,b){var c=new _.ff;c.Ue=a;c.b=b;return c};
|
||||
hf=function(a){this.data=a||[]};jf=function(a){this.data=a||[]};kf=function(a){this.data=a||[]};lf=function(a){this.data=a||[]};mf=function(a){this.data=a||[]};_.nf=function(a){this.data=a||[]};of=function(a){this.data=a||[]};pf=function(a){this.data=a||[]};qf=function(a){this.data=a||[]};_.rf=function(a){return _.L(a,0)};_.sf=function(a){return _.L(a,1)};_.tf=function(a){return new mf(a.data[2])};uf=function(a){this.data=a||[]};vf=function(a){this.data=a||[]};
|
||||
_.wf=function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b.nextSibling)};_.xf=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)};_.yf=function(a){this.J=this.I=window.Infinity;this.M=this.L=-window.Infinity;_.v(a||[],this.extend,this)};_.zf=function(a,b,c,d){var e=new _.yf;e.I=a;e.J=b;e.L=c;e.M=d;return e};_.Af=function(a,b){a=a.style;a.width=b.width+b.j;a.height=b.height+b.f};_.Bf=function(a){return new _.O(a.offsetWidth,a.offsetHeight)};_.Cf=function(){this.P=new yd};
|
||||
Df=function(a,b,c,d,e){this.b=!!b;this.node=null;this.f=0;this.j=!1;this.l=!c;a&&this.setPosition(a,d);this.depth=void 0!=e?e:this.f||0;this.b&&(this.depth*=-1)};_.Ef=function(a){this.ki=a||0;_.y.bind(this,"forceredraw",this,this.C)};Ff=function(a,b,c,d){Df.call(this,a,b,c,null,d)};
|
||||
Of=function(a,b,c,d,e){var f=_.L(_.tf(_.R),7);this.b=a;this.f=d;this.j=_.m(e)?e:_.Ia();var g=f+"/csi?v=2&s=mapsapi3&v3v="+_.L(new qf(_.R.data[36]),0)+"&action="+a;_.Gb(c,function(a,b){g+="&"+(0,window.encodeURIComponent)(b)+"="+(0,window.encodeURIComponent)(a)});b&&(g+="&e="+b);this.l=g};_.Qf=function(a,b){var c={};c[b]=void 0;_.Pf(a,c)};
|
||||
_.Pf=function(a,b){var c="";_.Gb(b,function(a,b){var d=(null!=a?a:_.Ia())-this.j;c&&(c+=",");c+=b+"."+Math.round(d);null==a&&window.performance&&window.performance.mark&&window.performance.mark("mapsapi:"+this.b+":"+b)},a);b=a.l+"&rt="+c;a.f.createElement("img").src=b;(a=_.Gc.__gm_captureCSI)&&a(b)};
|
||||
_.Rf=function(a,b){b=b||{};var c=b.Km||{},d=_.zc(_.R,12).join(",");d&&(c.libraries=d);var d=_.L(_.R,6),e=new hf(_.R.data[33]),f=[];d&&f.push(d);_.v(e.data,function(a,b){a&&_.v(a,function(a,c){null!=a&&f.push(b+1+"_"+(c+1)+"_"+a)})});b.Jk&&(f=f.concat(b.Jk));return new Of(a,f.join(","),c,b.document||window.document,b.startTime)};_.Sf=function(){this.b=new _.N(128,128);this.j=256/360;this.l=256/(2*Math.PI);this.f=!0};
|
||||
Uf=function(){this.f=_.Rf("apiboot2",{startTime:_.Tf});_.Qf(this.f,"main");this.b=!1};Wf=function(){var a=Vf;a.b||(a.b=!0,_.Qf(a.f,"firstmap"))};_.Xf=function(a,b,c){if(a=a.fromLatLngToPoint(b))c=Math.pow(2,c),a.x*=c,a.y*=c;return a};_.Zf=function(a){for(var b;b=a.firstChild;)_.Yf(b),a.removeChild(b)};_.Yf=function(a){a=new Ff(a);try{for(;;)_.y.clearInstanceListeners(a.next())}catch(b){if(b!==_.$f)throw b;}};
|
||||
_.ag=function(a,b){var c=a.lat()+_.uc(b);90<c&&(c=90);var d=a.lat()-_.uc(b);-90>d&&(d=-90);b=Math.sin(b);var e=Math.cos(_.tc(a.lat()));if(90==c||-90==d||1E-6>e)return new _.Xd(new _.Q(d,-180),new _.Q(c,180));b=_.uc(Math.asin(b/e));return new _.Xd(new _.Q(d,a.lng()-b),new _.Q(c,a.lng()+b))};
|
||||
dg=function(a,b){_.me.call(this);_.Le(a);this.__gm=new _.C;this.f=null;b&&b.client&&(this.f=_.bg[b.client]||null);var c=this.controls=[];_.Ua(_.cg,function(a,b){c[b]=new _.be});this.j=!0;this.b=a;this.m=!1;this.__gm.ca=b&&b.ca||new _.vd;this.set("standAlone",!0);this.setPov(new _.xd(0,0,1));b&&b.gd&&!_.x(b.gd.zoom)&&(b.gd.zoom=_.x(b.zoom)?b.zoom:1);this.setValues(b);void 0==this.getVisible()&&this.setVisible(!0);_.y.addListenerOnce(this,"pano_changed",_.hb(function(){_.G("marker",(0,_.p)(function(a){a.b(this.__gm.ca,
|
||||
this)},this))}))};_.eg=function(){this.l=[];this.j=this.b=this.f=null};fg=function(a,b,c){this.R=b;this.b=_.Od(new _.vc([]));this.B=new _.vd;new _.be;this.D=new _.vd;this.F=new _.vd;this.l=new _.vd;var d=this.ca=new _.vd;d.b=function(){delete d.b;_.G("marker",_.hb(function(b){b.b(d,a)}))};this.j=new dg(c,{visible:!1,enableCloseButton:!0,ca:d});this.j.bindTo("reportErrorControl",a);this.j.j=!1;this.f=new _.eg};gg=function(a){this.data=a||[]};hg=function(a){this.data=a||[]};
|
||||
ig=function(a){this.data=a||[]};jg=function(a,b,c,d){_.Ef.call(this);this.m=b;this.l=new _.Sf;this.B=c+"/maps/api/js/StaticMapService.GetMapImage";this.f=this.b=null;this.j=d;this.set("div",a);this.set("loading",!0)};lg=function(a){var b=a.get("tilt")||_.w(a.get("styles"));a=a.get("mapTypeId");return b?null:kg[a]};mg=function(a){a.parentNode&&a.parentNode.removeChild(a)};
|
||||
ng=function(a,b){var c=a.f;c.onload=null;c.onerror=null;a.get("size")&&(b&&(c.parentNode||a.b.appendChild(c),_.Af(c,a.get("size")),_.y.trigger(a,"staticmaploaded"),a.j.set(_.Ia())),a.set("loading",!1))};og=function(a,b){var c=a.f;b!=c.src?(mg(c),c.onload=function(){ng(a,!0)},c.onerror=function(){ng(a,!1)},c.src=b):!c.parentNode&&b&&a.b.appendChild(c)};
|
||||
sg=function(a,b){var c=_.Ia();Vf&&Wf();var d=new _.Cf,e=b||{};e.noClear||_.Zf(a);var f="undefined"==typeof window.document?null:window.document.createElement("div");f&&a.appendChild&&(a.appendChild(f),f.style.width=f.style.height="100%");_.ze.call(this,new fg(this,a,f));_.m(e.mapTypeId)||(e.mapTypeId="roadmap");this.setValues(e);this.U=_.pg[15]&&e.noControlsOrLogging;this.mapTypes=new se;this.features=new _.C;_.Le(f);this.notify("streetView");a=_.Bf(f);var g=null;_.R&&qg(e.useStaticMap,a)&&(g=new jg(f,
|
||||
_.rg,_.L(_.tf(_.R),9),new Nd(null)),_.y.forward(g,"staticmaploaded",this),g.set("size",a),g.bindTo("center",this),g.bindTo("zoom",this),g.bindTo("mapTypeId",this),g.bindTo("styles",this));this.overlayMapTypes=new _.be;var h=this.controls=[];_.Ua(_.cg,function(a,b){h[b]=new _.be});var l=this,n=!0;_.G("map",function(a){l.getDiv()&&f&&a.f(l,e,f,g,n,c,d)});n=!1;this.data=new He({map:this})};qg=function(a,b){if(_.m(a))return!!a;a=b.width;b=b.height;return 384E3>=a*b&&800>=a&&800>=b};
|
||||
tg=function(){_.G("maxzoom",_.ta)};ug=function(a,b){!a||_.eb(a)||_.x(a)?(this.set("tableId",a),this.setValues(b)):this.setValues(a)};_.vg=_.na();_.wg=function(a){this.setValues(te(a));_.G("poly",_.ta)};_.xg=function(a){this.setValues(te(a));_.G("poly",_.ta)};yg=function(){this.b=null};_.zg=function(){this.b=null};Ag=function(a,b){this.b=a;this.f=b||0};
|
||||
Dg=function(){var a=window.navigator.userAgent;this.l=a;this.b=this.type=0;this.version=new Ag(0);this.m=new Ag(0);for(var a=a.toLowerCase(),b=1;8>b;++b){var c=Bg[b];if(-1!=a.indexOf(c)){this.type=b;var d=(new RegExp(c+"[ /]?([0-9]+).?([0-9]+)?")).exec(a);d&&(this.version=new Ag((0,window.parseInt)(d[1],10),(0,window.parseInt)(d[2]||"0",10)));break}}7==this.type&&(b=/^Mozilla\/.*Gecko\/.*[Minefield|Shiretoko][ /]?([0-9]+).?([0-9]+)?/,d=b.exec(this.l))&&(this.type=5,this.version=new Ag((0,window.parseInt)(d[1],
|
||||
10),(0,window.parseInt)(d[2]||"0",10)));6==this.type&&(b=/rv:([0-9]{2,}.?[0-9]+)/,b=b.exec(this.l))&&(this.type=1,this.version=new Ag((0,window.parseInt)(b[1],10)));for(b=1;7>b;++b)if(c=Cg[b],-1!=a.indexOf(c)){this.b=b;break}if(5==this.b||6==this.b||2==this.b)if(b=/OS (?:X )?(\d+)[_.]?(\d+)/.exec(this.l))this.m=new Ag((0,window.parseInt)(b[1],10),(0,window.parseInt)(b[2]||"0",10));4==this.b&&(b=/Android (\d+)\.?(\d+)?/.exec(this.l))&&(this.m=new Ag((0,window.parseInt)(b[1],10),(0,window.parseInt)(b[2]||
|
||||
"0",10)));this.j=5==this.type||7==this.type;this.f=4==this.type||3==this.type;this.D=0;this.j&&(d=/\brv:\s*(\d+\.\d+)/.exec(a))&&(this.D=(0,window.parseFloat)(d[1]));this.B=window.document.compatMode||"";this.C=1==this.b||2==this.b||3==this.b&&-1==a.toLowerCase().indexOf("mobile")};Eg=_.oa("b");
|
||||
Kg=function(){var a=window.document;this.f=_.S;this.b=Jg(a,["transform","WebkitTransform","MozTransform","msTransform"]);this.C=Jg(a,["WebkitUserSelect","MozUserSelect","msUserSelect"]);this.m=Jg(a,["transition","WebkitTransition","MozTransition","OTransition","msTransition"]);var b;a:{for(var c=["-webkit-linear-gradient","-moz-linear-gradient","-o-linear-gradient","-ms-linear-gradient"],d=a.createElement("div"),e=0,f;f=c[e];++e)try{if(d.style.background=f+"(left, #000, #fff)",-1!=d.style.background.indexOf(f)){b=
|
||||
f;break a}}catch(g){}b=null}this.B=b;this.l="string"==typeof a.documentElement.style.opacity;a=window.document.getElementsByTagName("script")[0];b=a.style.color;a.style.color="";try{a.style.color="rgba(0, 0, 0, 0.5)"}catch(g){}c=a.style.color!=b;a.style.color=b;this.j=c};Jg=function(a,b){for(var c=0,d;d=b[c];++c)if("string"==typeof a.documentElement.style[d])return d;return null};_.Lg=function(a,b){this.size=new Cb;this.b=a;this.heading=b};
|
||||
_.Mg=function(a){this.tileSize=a.tileSize||new _.O(256,256);this.name=a.name;this.alt=a.alt;this.minZoom=a.minZoom;this.maxZoom=a.maxZoom;this.j=(0,_.p)(a.getTileUrl,a);this.b=new _.vd;this.f=null;this.set("opacity",a.opacity);var b=this;_.G("map",function(a){var c=b.f=a.b,e=b.tileSize||new _.O(256,256);b.b.forEach(function(a){var d=a.__gmimt,f=d.Y,l=d.zoom,n=b.j(f,l);d.Ib=c(f,l,e,a,n,function(){_.y.trigger(a,"load")})})})};
|
||||
Ng=function(a,b){null!=a.style.opacity?a.style.opacity=b:a.style.filter=b&&"alpha(opacity="+Math.round(100*b)+")"};Og=function(a){a=a.get("opacity");return"number"==typeof a?a:1};_.Pg=function(){_.Pg.Ee(this,"constructor")};_.Qg=function(a,b){_.Qg.Ee(this,"constructor");this.set("styles",a);a=b||{};this.f=a.baseMapTypeId||"roadmap";this.minZoom=a.minZoom;this.maxZoom=a.maxZoom||20;this.name=a.name;this.alt=a.alt;this.projection=null;this.tileSize=new _.O(256,256)};
|
||||
_.Rg=function(a,b){_.jd(fd,"container is not a Node")(a);this.setValues(b);_.G("controls",(0,_.p)(function(b){b.Fl(this,a)},this))};Sg=_.oa("b");Tg=function(a,b,c){for(var d=Array(b.length),e=0,f=b.length;e<f;++e)d[e]=b.charCodeAt(e);d.unshift(c);a=a.b;c=b=0;for(e=d.length;c<e;++c)b*=1729,b+=d[c],b%=a;return b};
|
||||
Wg=function(){var a=_.K(new of(_.R.data[4]),0),b=new Sg(131071),c=(0,window.unescape)("%26%74%6F%6B%65%6E%3D");return function(d){d=d.replace(Ug,"%27");var e=d+c;Vg||(Vg=/(?:https?:\/\/[^/]+)?(.*)/);d=Vg.exec(d);return e+Tg(b,d&&d[1],a)}};Xg=function(){var a=new Sg(2147483647);return function(b){return Tg(a,b,0)}};Yg=function(a){for(var b=a.split("."),c=window,d=window,e=0;e<b.length;e++)if(d=c,c=c[b[e]],!c)throw _.Yc(a+" is not a function");return function(){c.apply(d)}};
|
||||
Zg=function(){for(var a in Object.prototype)window.console&&window.console.error("This site adds property <"+a+"> to Object.prototype. Extending Object.prototype breaks JavaScript for..in loops, which are used heavily in Google Maps API v3.")};$g=function(a){(a="version"in a)&&window.console&&window.console.error("You have included the Google Maps API multiple times on this page. This may cause unexpected errors.");return a};_.ra=[];
|
||||
ah="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};bh="undefined"!=typeof window&&window===this?this:"undefined"!=typeof window.global&&null!=window.global?window.global:this;ch=["Array","prototype","fill"];dh=0;for(;dh<ch.length-1;dh++){var eh=ch[dh];eh in bh||(bh[eh]={});bh=bh[eh]}
|
||||
var fh=ch[ch.length-1],gh=bh[fh],hh=gh?gh:function(a,b,c){var d=this.length||0;0>b&&(b=Math.max(0,d+b));if(null==c||c>d)c=d;c=Number(c);0>c&&(c=Math.max(0,d+c));for(b=Number(b||0);b<c;b++)this[b]=a;return this};hh!=gh&&null!=hh&&ah(bh,fh,{configurable:!0,writable:!0,value:hh});_.Gc=this;Da="closure_uid_"+(1E9*Math.random()>>>0);Ea=0;var tb,ub;_.y={};tb="undefined"!=typeof window.navigator&&-1!=window.navigator.userAgent.toLowerCase().indexOf("msie");ub={};_.y.addListener=function(a,b,c){return new vb(a,b,c,0)};_.y.hasListeners=function(a,b){b=(a=a.__e3_)&&a[b];return!!b&&!_.Xa(b)};_.y.removeListener=function(a){a&&a.remove()};_.y.clearListeners=function(a,b){_.Ua(pb(a,b),function(a,b){b&&b.remove()})};_.y.clearInstanceListeners=function(a){_.Ua(pb(a),function(a,c){c&&c.remove()})};
|
||||
_.y.trigger=function(a,b,c){if(_.y.hasListeners(a,b)){var d=_.Sa(arguments,2),e=pb(a,b),f;for(f in e){var g=e[f];g&&g.b.apply(g.f,d)}}};_.y.addDomListener=function(a,b,c,d){if(a.addEventListener){var e=d?4:1;a.addEventListener(b,c,d);c=new vb(a,b,c,e)}else a.attachEvent?(c=new vb(a,b,c,2),a.attachEvent("on"+b,wb(c))):(a["on"+b]=c,c=new vb(a,b,c,3));return c};_.y.addDomListenerOnce=function(a,b,c,d){var e=_.y.addDomListener(a,b,function(){e.remove();return c.apply(this,arguments)},d);return e};
|
||||
_.y.T=function(a,b,c,d){return _.y.addDomListener(a,b,qb(c,d))};_.y.bind=function(a,b,c,d){return _.y.addListener(a,b,(0,_.p)(d,c))};_.y.addListenerOnce=function(a,b,c){var d=_.y.addListener(a,b,function(){d.remove();return c.apply(this,arguments)});return d};_.y.forward=function(a,b,c){return _.y.addListener(a,b,rb(b,c))};_.y.Ga=function(a,b,c,d){return _.y.addDomListener(a,b,rb(b,c,!d))};_.y.Xh=function(){var a=ub,b;for(b in a)a[b].remove();ub={};(a=_.Gc.CollectGarbage)&&a()};
|
||||
_.y.Ym=function(){tb&&_.y.addDomListener(window,"unload",_.y.Xh)};var sb=0;vb.prototype.remove=function(){if(this.f){switch(this.m){case 1:this.f.removeEventListener(this.j,this.b,!1);break;case 4:this.f.removeEventListener(this.j,this.b,!0);break;case 2:this.f.detachEvent("on"+this.j,this.l);break;case 3:this.f["on"+this.j]=null}delete ob(this.f,this.j)[this.id];this.l=this.b=this.f=null;delete ub[this.id]}};_.k=_.C.prototype;_.k.get=function(a){var b=Bb(this);a+="";b=ib(b,a);if(_.m(b)){if(b){a=b.Ya;var b=b.Ac,c="get"+_.Ab(a);return b[c]?b[c]():b.get(a)}return this[a]}};_.k.set=function(a,b){var c=Bb(this);a+="";var d=ib(c,a);if(d)if(a=d.Ya,d=d.Ac,c="set"+_.Ab(a),d[c])d[c](b);else d.set(a,b);else this[a]=b,c[a]=null,yb(this,a)};_.k.notify=function(a){var b=Bb(this);a+="";(b=ib(b,a))?b.Ac.notify(b.Ya):yb(this,a)};
|
||||
_.k.setValues=function(a){for(var b in a){var c=a[b],d="set"+_.Ab(b);if(this[d])this[d](c);else this.set(b,c)}};_.k.setOptions=_.C.prototype.setValues;_.k.changed=_.na();var zb={};_.C.prototype.bindTo=function(a,b,c,d){a+="";c=(c||a)+"";this.unbind(a);var e={Ac:this,Ya:a},f={Ac:b,Ya:c,jg:e};Bb(this)[a]=f;xb(b,c)[_.Ta(e)]=e;d||yb(this,a)};_.C.prototype.unbind=function(a){var b=Bb(this),c=b[a];c&&(c.jg&&delete xb(c.Ac,c.Ya)[_.Ta(c.jg)],this[a]=this.get(a),b[a]=null)};
|
||||
_.C.prototype.unbindAll=function(){var a=(0,_.p)(this.unbind,this),b=Bb(this),c;for(c in b)a(c)};_.C.prototype.addListener=function(a,b){return _.y.addListener(this,a,b)};_.ih={ROADMAP:"roadmap",SATELLITE:"satellite",HYBRID:"hybrid",TERRAIN:"terrain"};_.cg={TOP_LEFT:1,TOP_CENTER:2,TOP:2,TOP_RIGHT:3,LEFT_CENTER:4,LEFT_TOP:5,LEFT:5,LEFT_BOTTOM:6,RIGHT_TOP:7,RIGHT:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM:11,BOTTOM_RIGHT:12,CENTER:13};Db.prototype.get=function(){var a;0<this.f?(this.f--,a=this.b,this.b=a.next,a.next=null):a=this.j();return a};var jh=function(a){return function(){return a}}(null);_.Ib[" "]=_.ta;var kh={xo:"Point",vo:"LineString",POLYGON:"Polygon"};_.Lb.prototype.heading=_.pa("f");_.Lb.prototype.b=_.pa("j");_.Lb.prototype.toString=function(){return this.f+","+this.j};_.lh=new _.Lb;var mh={CIRCLE:0,FORWARD_CLOSED_ARROW:1,FORWARD_OPEN_ARROW:2,BACKWARD_CLOSED_ARROW:3,BACKWARD_OPEN_ARROW:4};a:{var nh=_.Gc.navigator;if(nh){var oh=nh.userAgent;if(oh){_.Ka=oh;break a}}_.Ka=""};var ph=new Db(function(){return new Sb},function(a){a.reset()},100);Rb.prototype.add=function(a,b){var c=ph.get();c.set(a,b);this.f?this.f.next=c:this.b=c;this.f=c};Rb.prototype.remove=function(){var a=null;this.b&&(a=this.b,this.b=this.b.next,this.b||(this.f=null),a.next=null);return a};Sb.prototype.set=function(a,b){this.xc=a;this.b=b;this.next=null};Sb.prototype.reset=function(){this.next=this.b=this.xc=null};Vb.f=void 0;Vb.b=function(){return Vb.f?Vb.f:Vb.f=new Vb};Vb.prototype.cb=function(a,b){var c=this,d=c.m;Wb(c.j,function(e){for(var f=e.fh[a]||[],g=e.gn[a]||[],h=d[a]=_.Mb(f.length,function(){delete d[a];b(e.nk);for(var f=c.f[a],h=f?f.length:0,l=0;l<h;++l)f[l](c.b[a]);delete c.f[a];l=0;for(f=g.length;l<f;++l)h=g[l],d[h]&&d[h]()}),l=0,n=f.length;l<n;++l)c.b[f[l]]&&h()})};_.qh=_.hc("d",void 0);_.rh=_.hc("f",void 0);_.T=_.jc();_.sh=_.ic("i",void 0);_.th=new _.fc("i",3,void 0,void 0);_.uh=new _.fc("j",3,"",void 0);_.vh=_.hc("u",void 0);_.wh=_.ic("u",void 0);_.xh=new _.fc("u",3,void 0,void 0);_.yh=_.nc();_.U=_.oc();_.V=_.pc();_.zh=new _.fc("e",3,void 0,void 0);_.W=_.hc("s",void 0);_.Ah=_.ic("s",void 0);_.Bh=new _.fc("s",3,void 0,void 0);_.Ch=_.hc("x",void 0);_.Dh=_.ic("x",void 0);_.Eh=new _.fc("x",3,void 0,void 0);_.Fh=new _.fc("y",3,void 0,void 0);_.vc.prototype.Pa=_.sa(0);_.vc.prototype.forEach=function(a,b){_.v(this.b,function(c,d){a.call(b,c,d)})};_.I.prototype.Uh=_.sa(1);var Kc,Jc=_.Eb;var Sh,Jb;_.Gh=_.Pb("Opera");_.Hh=_.qc();_.Ih=_.Pb("Edge");_.Jh=_.Pb("Gecko")&&!(_.La()&&!_.Pb("Edge"))&&!(_.Pb("Trident")||_.Pb("MSIE"))&&!_.Pb("Edge");_.Kh=_.La()&&!_.Pb("Edge");_.Lh=_.Pb("Macintosh");_.Mh=_.Pb("Windows");_.Nh=_.Pb("Linux")||_.Pb("CrOS");_.Oh=_.Pb("Android");_.Ph=_.Tb();_.Qh=_.Pb("iPad");_.Rh=_.Pb("iPod");
|
||||
a:{var Th="",Uh=function(){var a=_.Ka;if(_.Jh)return/rv\:([^\);]+)(\)|;)/.exec(a);if(_.Ih)return/Edge\/([\d\.]+)/.exec(a);if(_.Hh)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(_.Kh)return/WebKit\/(\S+)/.exec(a);if(_.Gh)return/(?:Version)[ \/]?(\S+)/.exec(a)}();Uh&&(Th=Uh?Uh[1]:"");if(_.Hh){var Vh=Nc();if(null!=Vh&&Vh>(0,window.parseFloat)(Th)){Sh=String(Vh);break a}}Sh=Th}_.Oc=Sh;Jb={};var Xh=_.Gc.document;_.Wh=Xh&&_.Hh?Nc()||("CSS1Compat"==Xh.compatMode?(0,window.parseInt)(_.Oc,10):5):void 0;_.k=Qc.prototype;_.k.isEmpty=function(){return 360==this.b-this.f};_.k.intersects=function(a){var b=this.b,c=this.f;return this.isEmpty()||a.isEmpty()?!1:_.Rc(this)?_.Rc(a)||a.b<=this.f||a.f>=b:_.Rc(a)?a.b<=c||a.f>=b:a.b<=c&&a.f>=b};_.k.contains=function(a){-180==a&&(a=180);var b=this.b,c=this.f;return _.Rc(this)?(a>=b||a<=c)&&!this.isEmpty():a>=b&&a<=c};_.k.extend=function(a){this.contains(a)||(this.isEmpty()?this.b=this.f=a:_.Uc(a,this.b)<_.Uc(this.f,a)?this.b=a:this.f=a)};
|
||||
_.k.ub=function(){var a=(this.b+this.f)/2;_.Rc(this)&&(a=_.Za(a+180,-180,180));return a};_.k=Vc.prototype;_.k.isEmpty=function(){return this.f>this.b};_.k.intersects=function(a){var b=this.f,c=this.b;return b<=a.f?a.f<=c&&a.f<=a.b:b<=a.b&&b<=c};_.k.contains=function(a){return a>=this.f&&a<=this.b};_.k.extend=function(a){this.isEmpty()?this.b=this.f=a:a<this.f?this.f=a:a>this.b&&(this.b=a)};_.k.ub=function(){return(this.b+this.f)/2};_.t(Xc,Error);var Zh;_.Yh=new $c;Zh=/'/g;$c.prototype.b=function(a,b){var c=[];bd(a,b,c);return c.join("&").replace(Zh,"%27")};_.Ic.m=function(){if(-1!=String(_.Gc.Promise).indexOf("[native code]")){var a=_.Gc.Promise.resolve(void 0);_.Ic.b=function(){a.then(_.Ic.f)}}else _.Ic.b=function(){Mc()}};_.Ic.B=function(a){_.Ic.b=function(){Mc();a&&a(_.Ic.f)}};_.Ic.j=!1;_.Ic.l=new Rb;_.Ic.f=function(){for(var a;a=_.Ic.l.remove();){try{a.xc.call(a.b)}catch(c){Hc(c)}var b=ph;b.m(a);b.f<b.l&&(b.f++,a.next=b.b,b.b=a)}_.Ic.j=!1};_.$h=_.Pb("Firefox");_.ai=_.Tb()||_.Pb("iPod");_.bi=_.Pb("iPad");_.ci=_.Pb("Android")&&!(rc()||_.Pb("Firefox")||_.Pb("Opera")||_.Pb("Silk"));_.di=rc();_.ei=_.sc()&&!(_.Tb()||_.Pb("iPad")||_.Pb("iPod"));var Yb={main:[],common:["main"],util:["common"],adsense:["main"],controls:["util"],data:["util"],directions:["util","geometry"],distance_matrix:["util"],drawing:["main"],drawing_impl:["controls"],elevation:["util","geometry"],geocoder:["util"],geojson:["main"],imagery_viewer:["main"],geometry:["main"],infowindow:["util"],kml:["onion","util","map"],layers:["map"],map:["common"],marker:["util"],maxzoom:["util"],onion:["util","map"],overlay:["common"],panoramio:["main"],places:["main"],places_impl:["controls"],
|
||||
poly:["util","map","geometry"],search:["main"],search_impl:["onion"],stats:["util"],streetview:["util","geometry"],usage:["util"],visualization:["main"],visualization_impl:["onion"],weather:["main"],zombie:["main"]};var fi,hi;_.od=_.jd(_.x,"not a number");fi=_.ld(_.od,function(a){if((0,window.isNaN)(a))throw _.Yc("NaN is not an accepted value");return a});_.gi=_.jd(_.eb,"not a string");hi=_.jd(_.fb,"not a boolean");_.ii=_.md(_.od);_.ji=_.md(_.gi);_.ki=_.md(hi);var Cd=_.cd({lat:_.od,lng:_.od},!0);_.li=new _.N(0,0);_.N.prototype.toString=function(){return"("+this.x+", "+this.y+")"};_.N.prototype.b=function(a){return a?a.x==this.x&&a.y==this.y:!1};_.N.prototype.equals=_.N.prototype.b;_.N.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y)};_.N.prototype.Jd=_.sa(2);_.mi=new _.O(0,0);_.O.prototype.toString=function(){return"("+this.width+", "+this.height+")"};_.O.prototype.b=function(a){return a?a.width==this.width&&a.height==this.height:!1};_.O.prototype.equals=_.O.prototype.b;var ni=_.Gc.google.maps,oi=Vb.b(),pi=(0,_.p)(oi.cb,oi);ni.__gjsload__=pi;_.Ua(ni.modules,pi);delete ni.modules;_.vd.prototype.remove=function(a){var b=this.f,c=this.j(a);b[c]&&(delete b[c],_.y.trigger(this,"remove",a),this.onRemove&&this.onRemove(a))};_.vd.prototype.contains=function(a){return!!this.f[this.j(a)]};_.vd.prototype.forEach=function(a){var b=this.f,c;for(c in b)a.call(this,b[c])};var qi=_.cd({zoom:_.md(fi),heading:fi,pitch:fi});var ri=_.cd({source:_.gi,webUrl:_.ji,iosDeepLinkId:_.ji});yd.prototype.addListener=function(a,b,c){c=c?{lg:!1}:null;var d=!this.P.length,e;e=this.P;var f=Pa(e,Bd(a,b));(e=0>f?null:_.ya(e)?e.charAt(f):e[f])?e.once=e.once&&c:this.P.push({xc:a,context:b||null,once:c});d&&this.f();return a};yd.prototype.addListenerOnce=function(a,b){this.addListener(a,b,!0);return a};yd.prototype.removeListener=function(a,b){if(this.P.length){var c=this.P;a=Pa(c,Bd(a,b));0<=a&&_.Qa(c,a);this.P.length||this.b()}};var zd=_.Ic;_.Q.prototype.toString=function(){return"("+this.lat()+", "+this.lng()+")"};_.Q.prototype.toJSON=function(){return{lat:this.lat(),lng:this.lng()}};_.Q.prototype.b=function(a){return a?_.$a(this.lat(),a.lat())&&_.$a(this.lng(),a.lng()):!1};_.Q.prototype.equals=_.Q.prototype.b;_.Q.prototype.toUrlValue=function(a){a=_.m(a)?a:6;return Fd(this.lat(),a)+","+Fd(this.lng(),a)};_.k=_.Gd.prototype;_.k.cd=_.na();_.k.bd=_.na();_.k.addListener=function(a,b){return this.P.addListener(a,b)};_.k.addListenerOnce=function(a,b){return this.P.addListenerOnce(a,b)};_.k.removeListener=function(a,b){return this.P.removeListener(a,b)};_.k.notify=function(a){_.Ad(this.P,function(a){a(this.get())},this,a)};_.Pd=_.id(_.Id);_.t(_.Md,_.Gd);_.Md.prototype.set=function(a){this.Ih(a);this.notify()};_.t(Nd,_.Md);Nd.prototype.get=_.pa("b");Nd.prototype.Ih=_.oa("b");_.t(_.Td,Hd);_.k=_.Td.prototype;_.k.getType=_.qa("LineString");_.k.getLength=function(){return this.b.length};_.k.getAt=function(a){return this.b[a]};_.k.getArray=function(){return this.b.slice()};_.k.forEachLatLng=function(a){this.b.forEach(a)};var de=_.id(_.gd(_.Td,"google.maps.Data.LineString",!0));_.t(_.Ud,Hd);_.k=_.Ud.prototype;_.k.getType=_.qa("LinearRing");_.k.getLength=function(){return this.b.length};_.k.getAt=function(a){return this.b[a]};_.k.getArray=function(){return this.b.slice()};_.k.forEachLatLng=function(a){this.b.forEach(a)};var fe=_.id(_.gd(_.Ud,"google.maps.Data.LinearRing",!0));_.t(_.Vd,Hd);_.k=_.Vd.prototype;_.k.getType=_.qa("MultiPoint");_.k.getLength=function(){return this.b.length};_.k.getAt=function(a){return this.b[a]};_.k.getArray=function(){return this.b.slice()};_.k.forEachLatLng=function(a){this.b.forEach(a)};_.t(_.Wd,Hd);_.Wd.prototype.getType=_.qa("Point");_.Wd.prototype.forEachLatLng=function(a){a(this.b)};_.Wd.prototype.get=_.pa("b");_.k=_.Xd.prototype;_.k.getCenter=function(){return new _.Q(this.f.ub(),this.b.ub())};_.k.toString=function(){return"("+this.getSouthWest()+", "+this.getNorthEast()+")"};_.k.toJSON=function(){return{south:this.f.f,west:this.b.b,north:this.f.b,east:this.b.f}};_.k.toUrlValue=function(a){var b=this.getSouthWest(),c=this.getNorthEast();return[b.toUrlValue(a),c.toUrlValue(a)].join()};
|
||||
_.k.Ei=function(a){if(!a)return!1;a=_.$d(a);var b=this.f,c=a.f;return(b.isEmpty()?c.isEmpty():1E-9>=Math.abs(c.f-b.f)+Math.abs(b.b-c.b))&&_.Tc(this.b,a.b)};_.Xd.prototype.equals=_.Xd.prototype.Ei;_.k=_.Xd.prototype;_.k.contains=function(a){a=_.Id(a);return this.f.contains(a.lat())&&this.b.contains(a.lng())};_.k.intersects=function(a){a=_.$d(a);return this.f.intersects(a.f)&&this.b.intersects(a.b)};_.k.extend=function(a){a=_.Id(a);this.f.extend(a.lat());this.b.extend(a.lng());return this};
|
||||
_.k.union=function(a){a=_.$d(a);if(!a||a.isEmpty())return this;this.extend(a.getSouthWest());this.extend(a.getNorthEast());return this};_.k.getSouthWest=function(){return new _.Q(this.f.f,this.b.b,!0)};_.k.getNorthEast=function(){return new _.Q(this.f.b,this.b.f,!0)};_.k.toSpan=function(){return new _.Q(_.Wc(this.f),_.Sc(this.b),!0)};_.k.isEmpty=function(){return this.f.isEmpty()||this.b.isEmpty()};var Zd=_.cd({south:_.od,west:_.od,north:_.od,east:_.od},!1);_.t(_.be,_.C);_.k=_.be.prototype;_.k.getAt=function(a){return this.b[a]};_.k.indexOf=function(a){for(var b=0,c=this.b.length;b<c;++b)if(a===this.b[b])return b;return-1};_.k.forEach=function(a){for(var b=0,c=this.b.length;b<c;++b)a(this.b[b],b)};_.k.setAt=function(a,b){var c=this.b[a],d=this.b.length;if(a<d)this.b[a]=b,_.y.trigger(this,"set_at",a,c),this.l&&this.l(a,c);else{for(c=d;c<a;++c)this.insertAt(c,void 0);this.insertAt(a,b)}};
|
||||
_.k.insertAt=function(a,b){this.b.splice(a,0,b);ae(this);_.y.trigger(this,"insert_at",a);this.f&&this.f(a)};_.k.removeAt=function(a){var b=this.b[a];this.b.splice(a,1);ae(this);_.y.trigger(this,"remove_at",a,b);this.j&&this.j(a,b);return b};_.k.push=function(a){this.insertAt(this.b.length,a);return this.b.length};_.k.pop=function(){return this.removeAt(this.b.length-1)};_.k.getArray=_.pa("b");_.k.clear=function(){for(;this.get("length");)this.pop()};_.Ld(_.be.prototype,{length:null});var Ci=_.ld(_.cd({placeId:_.ji,query:_.ji,location:_.Id}),function(a){if(a.placeId&&a.query)throw _.Yc("cannot set both placeId and query");if(!a.placeId&&!a.query)throw _.Yc("must set one of placeId or query");return a});var ie=_.id(ce);_.t(_.ee,Hd);_.k=_.ee.prototype;_.k.getType=_.qa("MultiLineString");_.k.getLength=function(){return this.b.length};_.k.getAt=function(a){return this.b[a]};_.k.getArray=function(){return this.b.slice()};_.k.forEachLatLng=function(a){this.b.forEach(function(b){b.forEachLatLng(a)})};_.t(_.ge,Hd);_.k=_.ge.prototype;_.k.getType=_.qa("Polygon");_.k.getLength=function(){return this.b.length};_.k.getAt=function(a){return this.b[a]};_.k.getArray=function(){return this.b.slice()};_.k.forEachLatLng=function(a){this.b.forEach(function(b){b.forEachLatLng(a)})};var ke=_.id(_.gd(_.ge,"google.maps.Data.Polygon",!0));_.k=_.he.prototype;_.k.getId=_.pa("j");_.k.getGeometry=_.pa("b");_.k.setGeometry=function(a){var b=this.b;try{this.b=a?ce(a):null}catch(c){_.Zc(c);return}_.y.trigger(this,"setgeometry",{feature:this,newGeometry:this.b,oldGeometry:b})};_.k.getProperty=function(a){return ib(this.f,a)};_.k.setProperty=function(a,b){if(void 0===b)this.removeProperty(a);else{var c=this.getProperty(a);this.f[a]=b;_.y.trigger(this,"setproperty",{feature:this,name:a,newValue:b,oldValue:c})}};
|
||||
_.k.removeProperty=function(a){var b=this.getProperty(a);delete this.f[a];_.y.trigger(this,"removeproperty",{feature:this,name:a,oldValue:b})};_.k.forEachProperty=function(a){for(var b in this.f)a(this.getProperty(b),b)};_.k.toGeoJson=function(a){var b=this;_.G("data",function(c){c.f(b,a)})};_.t(_.je,Hd);_.k=_.je.prototype;_.k.getType=_.qa("GeometryCollection");_.k.getLength=function(){return this.b.length};_.k.getAt=function(a){return this.b[a]};_.k.getArray=function(){return this.b.slice()};_.k.forEachLatLng=function(a){this.b.forEach(function(b){b.forEachLatLng(a)})};_.t(_.le,Hd);_.k=_.le.prototype;_.k.getType=_.qa("MultiPolygon");_.k.getLength=function(){return this.b.length};_.k.getAt=function(a){return this.b[a]};_.k.getArray=function(){return this.b.slice()};_.k.forEachLatLng=function(a){this.b.forEach(function(b){b.forEachLatLng(a)})};_.t(_.me,_.C);ne.prototype.get=function(a){return this.b[a]};ne.prototype.set=function(a,b){var c=this.b;c[a]||(c[a]={});_.Wa(c[a],b);_.y.trigger(this,"changed",a)};ne.prototype.reset=function(a){delete this.b[a];_.y.trigger(this,"changed",a)};ne.prototype.forEach=function(a){_.Ua(this.b,a)};_.t(oe,_.C);var Di=_.md(_.gd(_.me,"StreetViewPanorama"));_.k=qe.prototype;_.k.contains=function(a){return this.b.hasOwnProperty(_.Ta(a))};_.k.getFeatureById=function(a){return ib(this.f,a)};
|
||||
_.k.add=function(a){a=a||{};a=a instanceof _.he?a:new _.he(a);if(!this.contains(a)){var b=a.getId();if(b){var c=this.getFeatureById(b);c&&this.remove(c)}c=_.Ta(a);this.b[c]=a;b&&(this.f[b]=a);var d=_.y.forward(a,"setgeometry",this),e=_.y.forward(a,"setproperty",this),f=_.y.forward(a,"removeproperty",this);this.j[c]=function(){_.y.removeListener(d);_.y.removeListener(e);_.y.removeListener(f)};_.y.trigger(this,"addfeature",{feature:a})}return a};
|
||||
_.k.remove=function(a){var b=_.Ta(a),c=a.getId();if(this.b[b]){delete this.b[b];c&&delete this.f[c];if(c=this.j[b])delete this.j[b],c();_.y.trigger(this,"removefeature",{feature:a})}};_.k.forEach=function(a){for(var b in this.b)a(this.b[b])};_.t(se,_.C);se.prototype.set=function(a,b){if(null!=b&&!(b&&_.x(b.maxZoom)&&b.tileSize&&b.tileSize.width&&b.tileSize.height&&b.getTile&&b.getTile.apply))throw Error("Expected value implementing google.maps.MapType");return _.C.prototype.set.apply(this,arguments)};var ve=xe(_.gd(_.Q,"LatLng"));_.t(_.ze,_.C);_.t(Ae,_.C);Ae.prototype.overrideStyle=function(a,b){this.b.set(_.Ta(a),b)};Ae.prototype.revertStyle=function(a){a?this.b.reset(_.Ta(a)):this.b.forEach((0,_.p)(this.b.reset,this.b))};_.Ei=_.md(_.gd(_.ze,"Map"));_.t(Be,_.C);
|
||||
_.Ld(Be.prototype,{position:_.md(_.Id),title:_.ji,icon:_.md(_.kd([_.gi,{If:nd("url"),then:_.cd({url:_.gi,scaledSize:_.md(qd),size:_.md(qd),origin:_.md(pd),anchor:_.md(pd),labelOrigin:_.md(pd),path:_.jd(function(a){return null==a})},!0)},{If:nd("path"),then:_.cd({path:_.kd([_.gi,_.hd(mh)]),anchor:_.md(pd),labelOrigin:_.md(pd),fillColor:_.ji,fillOpacity:_.ii,rotation:_.ii,scale:_.ii,strokeColor:_.ji,strokeOpacity:_.ii,strokeWeight:_.ii,url:_.jd(function(a){return null==a})},!0)}])),label:_.md(_.kd([_.gi,{If:nd("text"),
|
||||
then:_.cd({text:_.gi,fontSize:_.ji,fontWeight:_.ji,fontFamily:_.ji},!0)}])),shadow:_.Eb,shape:_.Eb,cursor:_.ji,clickable:_.ki,animation:_.Eb,draggable:_.ki,visible:_.ki,flat:_.Eb,zIndex:_.ii,opacity:_.ii,place:_.md(Ci),attribution:_.md(ri)});_.t(Ce,_.C);Ce.prototype.map_changed=Ce.prototype.visible_changed=function(){var a=this;_.G("poly",function(b){b.f(a)})};Ce.prototype.getPath=function(){return this.get("latLngs").getAt(0)};Ce.prototype.setPath=function(a){try{this.get("latLngs").setAt(0,we(a))}catch(b){_.Zc(b)}};_.Ld(Ce.prototype,{draggable:_.ki,editable:_.ki,map:_.Ei,visible:_.ki});_.t(_.De,Be);_.De.prototype.map_changed=function(){this.__gm.set&&this.__gm.set.remove(this);var a=this.get("map");this.__gm.set=a&&a.__gm.ca;this.__gm.set&&_.wd(this.__gm.set,this)};_.De.MAX_ZINDEX=1E6;_.Ld(_.De.prototype,{map:_.kd([_.Ei,Di])});_.t(_.Ee,Ce);_.Ee.prototype.Aa=!0;_.Ee.prototype.getPaths=function(){return this.get("latLngs")};_.Ee.prototype.setPaths=function(a){this.set("latLngs",ye(a))};_.t(_.Fe,Ce);_.Fe.prototype.Aa=!1;_.Ge="click dblclick mousedown mousemove mouseout mouseover mouseup rightclick".split(" ");_.t(He,_.C);_.k=He.prototype;_.k.contains=function(a){return this.b.contains(a)};_.k.getFeatureById=function(a){return this.b.getFeatureById(a)};_.k.add=function(a){return this.b.add(a)};_.k.remove=function(a){this.b.remove(a)};_.k.forEach=function(a){this.b.forEach(a)};_.k.addGeoJson=function(a,b){return _.re(this.b,a,b)};_.k.loadGeoJson=function(a,b,c){var d=this.b;_.G("data",function(e){e.Mk(d,a,b,c)})};_.k.toGeoJson=function(a){var b=this.b;_.G("data",function(c){c.Ik(b,a)})};
|
||||
_.k.overrideStyle=function(a,b){this.f.overrideStyle(a,b)};_.k.revertStyle=function(a){this.f.revertStyle(a)};_.k.controls_changed=function(){this.get("controls")&&Ie(this)};_.k.drawingMode_changed=function(){this.get("drawingMode")&&Ie(this)};_.Ld(He.prototype,{map:_.Ei,style:_.Eb,controls:_.md(_.id(_.hd(kh))),controlPosition:_.md(_.hd(_.cg)),drawingMode:_.md(_.hd(kh))});_.Fi={METRIC:0,IMPERIAL:1};_.Gi={DRIVING:"DRIVING",WALKING:"WALKING",BICYCLING:"BICYCLING",TRANSIT:"TRANSIT"};_.Hi={BEST_GUESS:"bestguess",OPTIMISTIC:"optimistic",PESSIMISTIC:"pessimistic"};_.Ii={BUS:"BUS",RAIL:"RAIL",SUBWAY:"SUBWAY",TRAIN:"TRAIN",TRAM:"TRAM"};_.Ji={LESS_WALKING:"LESS_WALKING",FEWER_TRANSFERS:"FEWER_TRANSFERS"};var Ki=_.cd({routes:_.id(_.jd(_.db))},!0);_.Ke=[];_.t(Me,_.C);_.k=Me.prototype;_.k.internalAnchor_changed=function(){var a=this.get("internalAnchor");Ne(this,"attribution",a);Ne(this,"place",a);Ne(this,"internalAnchorMap",a,"map");Ne(this,"internalAnchorPoint",a,"anchorPoint");a instanceof _.De?Ne(this,"internalAnchorPosition",a,"internalPosition"):Ne(this,"internalAnchorPosition",a,"position")};
|
||||
_.k.internalAnchorPoint_changed=Me.prototype.internalPixelOffset_changed=function(){var a=this.get("internalAnchorPoint")||_.li,b=this.get("internalPixelOffset")||_.mi;this.set("pixelOffset",new _.O(b.width+Math.round(a.x),b.height+Math.round(a.y)))};_.k.internalAnchorPosition_changed=function(){var a=this.get("internalAnchorPosition");a&&this.set("position",a)};_.k.internalAnchorMap_changed=function(){this.get("internalAnchor")&&this.b.set("map",this.get("internalAnchorMap"))};
|
||||
_.k.qm=function(){var a=this.get("internalAnchor");!this.b.get("map")&&a&&a.get("map")&&this.set("internalAnchor",null)};_.k.internalContent_changed=function(){this.set("content",Je(this.get("internalContent")))};_.k.trigger=function(a){_.y.trigger(this.b,a)};_.k.close=function(){this.b.set("map",null)};_.t(_.Oe,_.C);_.Ld(_.Oe.prototype,{content:_.kd([_.ji,_.jd(fd)]),position:_.md(_.Id),size:_.md(qd),map:_.kd([_.Ei,Di]),anchor:_.md(_.gd(_.C,"MVCObject")),zIndex:_.ii});_.Oe.prototype.open=function(a,b){this.set("anchor",b);b?!this.get("map")&&a&&this.set("map",a):this.set("map",a)};_.Oe.prototype.close=function(){this.set("map",null)};_.t(Pe,_.C);Pe.prototype.changed=function(a){if("map"==a||"panel"==a){var b=this;_.G("directions",function(c){c.rl(b,a)})}"panel"==a&&_.Le(this.getPanel())};_.Ld(Pe.prototype,{directions:Ki,map:_.Ei,panel:_.md(_.jd(fd)),routeIndex:_.ii});Qe.prototype.route=function(a,b){_.G("directions",function(c){c.Gh(a,b,!0)})};Re.prototype.getDistanceMatrix=function(a,b){_.G("distance_matrix",function(c){c.b(a,b)})};Se.prototype.getElevationAlongPath=function(a,b){_.G("elevation",function(c){c.getElevationAlongPath(a,b)})};Se.prototype.getElevationForLocations=function(a,b){_.G("elevation",function(c){c.getElevationForLocations(a,b)})};_.Mi=_.gd(_.Xd,"LatLngBounds");_.Te.prototype.geocode=function(a,b){_.G("geocoder",function(c){c.geocode(a,b)})};_.t(_.Ue,_.C);_.Ue.prototype.map_changed=function(){var a=this;_.G("kml",function(b){b.b(a)})};_.Ld(_.Ue.prototype,{map:_.Ei,url:null,bounds:null,opacity:_.ii});_.Ni={UNKNOWN:"UNKNOWN",OK:_.ha,INVALID_REQUEST:_.ca,DOCUMENT_NOT_FOUND:"DOCUMENT_NOT_FOUND",FETCH_ERROR:"FETCH_ERROR",INVALID_DOCUMENT:"INVALID_DOCUMENT",DOCUMENT_TOO_LARGE:"DOCUMENT_TOO_LARGE",LIMITS_EXCEEDED:"LIMITS_EXECEEDED",TIMED_OUT:"TIMED_OUT"};_.t(Ye,_.C);_.k=Ye.prototype;_.k.rd=function(){var a=this;_.G("kml",function(b){b.f(a)})};_.k.url_changed=Ye.prototype.rd;_.k.driveFileId_changed=Ye.prototype.rd;_.k.map_changed=Ye.prototype.rd;_.k.zIndex_changed=Ye.prototype.rd;_.Ld(Ye.prototype,{map:_.Ei,defaultViewport:null,metadata:null,status:null,url:_.ji,screenOverlays:_.ki,zIndex:_.ii});_.t(_.Ze,_.C);_.Ld(_.Ze.prototype,{map:_.Ei});_.t($e,_.C);_.Ld($e.prototype,{map:_.Ei});_.t(af,_.C);_.Ld(af.prototype,{map:_.Ei});_.Oi={NEAREST:"nearest",BEST:"best"};_.Pi={DEFAULT:"default",OUTDOOR:"outdoor"};_.bg={japan_prequake:20,japan_postquake2010:24};_.bf.prototype.Ye=!0;_.bf.prototype.wb=_.sa(4);_.bf.prototype.Wg=!0;_.bf.prototype.Dd=_.sa(6);_.cf("about:blank");_.$f="StopIteration"in _.Gc?_.Gc.StopIteration:{message:"StopIteration",stack:""};_.df.prototype.next=function(){throw _.$f;};_.df.prototype.Ae=function(){return this};!_.Jh&&!_.Hh||_.Hh&&9<=Number(_.Wh)||_.Jh&&_.Pc("1.9.1");_.Hh&&_.Pc("9");_.ff.prototype.Wg=!0;_.ff.prototype.Dd=_.sa(5);_.ff.prototype.Ye=!0;_.ff.prototype.wb=_.sa(3);_.ef={};_.gf("<!DOCTYPE html>",0);_.gf("",0);_.gf("<br>",0);var Qi;_.t(hf,_.I);var Ri;_.t(jf,_.I);var Si;_.t(kf,_.I);var Ti;_.t(lf,_.I);_.t(mf,_.I);_.t(_.nf,_.I);_.t(of,_.I);_.t(pf,_.I);_.t(qf,_.I);var Ui;_.t(uf,_.I);var Vi;_.t(vf,_.I);_.pg={};_.yf.prototype.isEmpty=function(){return!(this.I<this.L&&this.J<this.M)};_.yf.prototype.extend=function(a){a&&(this.I=Math.min(this.I,a.x),this.L=Math.max(this.L,a.x),this.J=Math.min(this.J,a.y),this.M=Math.max(this.M,a.y))};_.yf.prototype.getCenter=function(){return new _.N((this.I+this.L)/2,(this.J+this.M)/2)};_.Wi=_.zf(-window.Infinity,-window.Infinity,window.Infinity,window.Infinity);_.Xi=_.zf(0,0,0,0);_.Cf.prototype.addListener=function(a,b){this.P.addListener(a,b)};_.Cf.prototype.addListenerOnce=function(a,b){this.P.addListenerOnce(a,b)};_.Cf.prototype.removeListener=function(a,b){this.P.removeListener(a,b)};_.Cf.prototype.b=_.sa(7);_.t(Df,_.df);Df.prototype.setPosition=function(a,b,c){if(this.node=a)this.f=_.za(b)?b:1!=this.node.nodeType?0:this.b?-1:1;_.za(c)&&(this.depth=c)};
|
||||
Df.prototype.next=function(){var a;if(this.j){if(!this.node||this.l&&0==this.depth)throw _.$f;a=this.node;var b=this.b?-1:1;if(this.f==b){var c=this.b?a.lastChild:a.firstChild;c?this.setPosition(c):this.setPosition(a,-1*b)}else(c=this.b?a.previousSibling:a.nextSibling)?this.setPosition(c):this.setPosition(a.parentNode,-1*b);this.depth+=this.f*(this.b?-1:1)}else this.j=!0;a=this.node;if(!this.node)throw _.$f;return a};
|
||||
Df.prototype.splice=function(a){var b=this.node,c=this.b?1:-1;this.f==c&&(this.f=-1*c,this.depth+=this.f*(this.b?-1:1));this.b=!this.b;Df.prototype.next.call(this);this.b=!this.b;for(var c=_.wa(arguments[0])?arguments[0]:arguments,d=c.length-1;0<=d;d--)_.wf(c[d],b);_.xf(b)};_.t(_.Ef,_.C);_.Ef.prototype.K=function(){var a=this;a.D||(a.D=window.setTimeout(function(){a.D=void 0;a.Z()},a.ki))};_.Ef.prototype.C=function(){this.D&&window.clearTimeout(this.D);this.D=void 0;this.Z()};_.t(Ff,Df);Ff.prototype.next=function(){do Ff.Hb.next.call(this);while(-1==this.f);return this.node};_.Sf.prototype.fromLatLngToPoint=function(a,b){b=b||new _.N(0,0);var c=this.b;b.x=c.x+a.lng()*this.j;a=_.Ya(Math.sin(_.tc(a.lat())),-(1-1E-15),1-1E-15);b.y=c.y+.5*Math.log((1+a)/(1-a))*-this.l;return b};_.Sf.prototype.fromPointToLatLng=function(a,b){var c=this.b;return new _.Q(_.uc(2*Math.atan(Math.exp((a.y-c.y)/-this.l))-Math.PI/2),(a.x-c.x)/this.j,b)};var Vf;_.t(dg,_.me);dg.prototype.visible_changed=function(){var a=this;!a.m&&a.getVisible()&&(a.m=!0,_.G("streetview",function(b){var c;a.f&&(c=a.f);b.Im(a,c)}))};_.Ld(dg.prototype,{visible:_.ki,pano:_.ji,position:_.md(_.Id),pov:_.md(qi),motionTracking:hi,photographerPov:null,location:null,links:_.id(_.jd(_.db)),status:null,zoom:_.ii,enableCloseButton:_.ki});dg.prototype.registerPanoProvider=function(a,b){this.set("panoProvider",{yh:a,options:b||{}})};_.k=_.eg.prototype;_.k.vg=_.sa(8);_.k.Mb=_.sa(9);_.k.Nf=_.sa(10);_.k.Mf=_.sa(11);_.k.Lf=_.sa(12);_.t(fg,oe);var Zi;_.t(gg,_.I);var $i;_.t(hg,_.I);var aj;_.t(ig,_.I);ig.prototype.getZoom=function(){return _.K(this,2)};ig.prototype.setZoom=function(a){this.data[2]=a};_.t(jg,_.Ef);var kg={roadmap:0,satellite:2,hybrid:3,terrain:4},bj={0:1,2:2,3:2,4:2};_.k=jg.prototype;_.k.Jg=_.Jd("center");_.k.Zf=_.Jd("zoom");_.k.changed=function(){var a=this.Jg(),b=this.Zf(),c=lg(this);if(a&&!a.b(this.G)||this.F!=b||this.O!=c)mg(this.f),this.K(),this.F=b,this.O=c;this.G=a};
|
||||
_.k.Z=function(){var a="",b=this.Jg(),c=this.Zf(),d=lg(this),e=this.get("size");if(e){if(b&&(0,window.isFinite)(b.lat())&&(0,window.isFinite)(b.lng())&&1<c&&null!=d&&e&&e.width&&e.height&&this.b){_.Af(this.b,e);var f;(b=_.Xf(this.l,b,c))?(f=new _.yf,f.I=Math.round(b.x-e.width/2),f.L=f.I+e.width,f.J=Math.round(b.y-e.height/2),f.M=f.J+e.height):f=null;b=bj[d];if(f){var a=new ig,g=new gg(_.M(a,0));g.data[0]=f.I;g.data[1]=f.J;a.data[1]=b;a.setZoom(c);c=new hg(_.M(a,3));c.data[0]=f.L-f.I;c.data[1]=f.M-
|
||||
f.J;c=new vf(_.M(a,4));c.data[0]=d;c.data[4]=_.rf(_.tf(_.R));c.data[5]=_.sf(_.tf(_.R)).toLowerCase();c.data[9]=!0;c.data[11]=!0;d=this.B+(0,window.unescape)("%3F");if(!aj){c=aj={b:-1,A:[]};b=new gg([]);Zi||(Zi={b:-1,A:[,_.T,_.T]});b=_.F(b,Zi);f=new hg([]);$i||($i={b:-1,A:[]},$i.A=[,_.vh,_.vh,_.pc(1)]);f=_.F(f,$i);g=new vf([]);if(!Vi){var h=[];Vi={b:-1,A:h};h[1]=_.V;h[2]=_.U;h[3]=_.U;h[5]=_.W;h[6]=_.W;var l=new uf([]);Ui||(Ui={b:-1,A:[,_.zh,_.U]});h[9]=_.F(l,Ui);h[10]=_.U;h[11]=_.U;h[12]=_.U;h[13]=
|
||||
_.zh;h[100]=_.U}g=_.F(g,Vi);h=new hf([]);if(!Qi){var l=Qi={b:-1,A:[]},n=new jf([]);Ri||(Ri={b:-1,A:[,_.U]});var n=_.F(n,Ri),q=new lf([]);Ti||(Ti={b:-1,A:[,_.U,_.U]});var q=_.F(q,Ti),r=new kf([]);Si||(Si={b:-1,A:[,_.U]});l.A=[,n,,,,,,,,,q,,_.F(r,Si)]}c.A=[,b,_.V,_.vh,f,g,_.F(h,Qi)]}a=_.Yh.b(a.data,aj);a=this.m(d+a)}}this.f&&(_.Af(this.f,e),og(this,a))}};
|
||||
_.k.div_changed=function(){var a=this.get("div"),b=this.b;if(a)if(b)a.appendChild(b);else{b=this.b=window.document.createElement("div");b.style.overflow="hidden";var c=this.f=window.document.createElement("img");_.y.addDomListener(b,"contextmenu",function(a){_.lb(a);_.nb(a)});c.ontouchstart=c.ontouchmove=c.ontouchend=c.ontouchcancel=function(a){_.mb(a);_.nb(a)};_.Af(c,_.mi);a.appendChild(b);this.Z()}else b&&(mg(b),this.b=null)};_.t(sg,_.ze);_.k=sg.prototype;_.k.streetView_changed=function(){var a=this.get("streetView");a?a.set("standAlone",!1):this.set("streetView",this.__gm.j)};_.k.getDiv=function(){return this.__gm.R};_.k.panBy=function(a,b){var c=this.__gm;_.G("map",function(){_.y.trigger(c,"panby",a,b)})};_.k.panTo=function(a){var b=this.__gm;a=_.Id(a);_.G("map",function(){_.y.trigger(b,"panto",a)})};_.k.panToBounds=function(a){var b=this.__gm,c=_.$d(a);_.G("map",function(){_.y.trigger(b,"pantolatlngbounds",c)})};
|
||||
_.k.fitBounds=function(a){var b=this;a=_.$d(a);_.G("map",function(c){c.fitBounds(b,a)})};_.Ld(sg.prototype,{bounds:null,streetView:Di,center:_.md(_.Id),zoom:_.ii,mapTypeId:_.ji,projection:null,heading:_.ii,tilt:_.ii,clickableIcons:hi});tg.prototype.getMaxZoomAtLatLng=function(a,b){_.G("maxzoom",function(c){c.getMaxZoomAtLatLng(a,b)})};_.t(ug,_.C);ug.prototype.changed=function(a){if("suppressInfoWindows"!=a&&"clickable"!=a){var b=this;_.G("onion",function(a){a.b(b)})}};_.Ld(ug.prototype,{map:_.Ei,tableId:_.ii,query:_.md(_.kd([_.gi,_.jd(_.db,"not an Object")]))});_.t(_.vg,_.C);_.vg.prototype.map_changed=function(){var a=this;_.G("overlay",function(b){b.Vj(a)})};_.Ld(_.vg.prototype,{panes:null,projection:null,map:_.kd([_.Ei,Di])});_.t(_.wg,_.C);_.wg.prototype.map_changed=_.wg.prototype.visible_changed=function(){var a=this;_.G("poly",function(b){b.b(a)})};_.wg.prototype.center_changed=function(){_.y.trigger(this,"bounds_changed")};_.wg.prototype.radius_changed=_.wg.prototype.center_changed;_.wg.prototype.getBounds=function(){var a=this.get("radius"),b=this.get("center");if(b&&_.x(a)){var c=this.get("map"),c=c&&c.__gm.get("baseMapType");return _.ag(b,a/_.ue(c))}return null};
|
||||
_.Ld(_.wg.prototype,{center:_.md(_.Id),draggable:_.ki,editable:_.ki,map:_.Ei,radius:_.ii,visible:_.ki});_.t(_.xg,_.C);_.xg.prototype.map_changed=_.xg.prototype.visible_changed=function(){var a=this;_.G("poly",function(b){b.j(a)})};_.Ld(_.xg.prototype,{draggable:_.ki,editable:_.ki,bounds:_.md(_.$d),map:_.Ei,visible:_.ki});_.t(yg,_.C);yg.prototype.map_changed=function(){var a=this;_.G("streetview",function(b){b.Uj(a)})};_.Ld(yg.prototype,{map:_.Ei});_.zg.prototype.getPanorama=function(a,b){var c=this.b||void 0;_.G("streetview",function(d){_.G("geometry",function(e){d.Sk(a,b,e.computeHeading,e.computeOffset,c)})})};_.zg.prototype.getPanoramaByLocation=function(a,b,c){this.getPanorama({location:a,radius:b,preference:50>(b||0)?"best":"nearest"},c)};_.zg.prototype.getPanoramaById=function(a,b){this.getPanorama({pano:a},b)};var Bg,Cg;Bg={0:"",1:"msie",3:"chrome",4:"applewebkit",5:"firefox",6:"trident",7:"mozilla",2:"edge"};Cg={0:"",1:"x11",2:"macintosh",3:"windows",4:"android",5:"iphone",6:"ipad"};_.S=null;"undefined"!=typeof window.navigator&&(_.S=new Dg);Eg.prototype.j=_.Fb(function(){var a=new window.Image;return _.m(a.crossOrigin)});Eg.prototype.l=_.Fb(function(){return _.m(window.document.createElement("span").draggable)});Eg.prototype.f=_.Fb(function(){try{var a=window.document.createElement("canvas").getContext("2d"),b=a.getImageData(0,0,1,1);b.data[0]=b.data[1]=b.data[2]=100;b.data[3]=64;a.putImageData(b,0,0);b=a.getImageData(0,0,1,1);return 95>b.data[0]||105<b.data[0]}catch(c){return!1}});_.cj=_.S?new Eg(_.S):null;_.dj=_.S?new Kg:null;_.ej=new _.Lg(0,0);_.t(_.Mg,_.C);_.k=_.Mg.prototype;_.k.getTile=function(a,b,c){if(!a||!c)return null;var d=c.createElement("div");c={Y:a,zoom:b,Ib:null};d.__gmimt=c;_.wd(this.b,d);var e=Og(this);1!=e&&Ng(d,e);if(this.f){var e=this.tileSize||new _.O(256,256),f=this.j(a,b);c.Ib=this.f(a,b,e,d,f,function(){_.y.trigger(d,"load")})}return d};_.k.releaseTile=function(a){a&&this.b.contains(a)&&(this.b.remove(a),(a=a.__gmimt.Ib)&&a.release())};_.k.Pe=_.sa(13);
|
||||
_.k.opacity_changed=function(){var a=Og(this);this.b.forEach(function(b){Ng(b,a)})};_.k.md=!0;_.Ld(_.Mg.prototype,{opacity:_.ii});_.t(_.Pg,_.C);_.Pg.prototype.getTile=jh;_.Pg.prototype.tileSize=new _.O(256,256);_.Pg.prototype.md=!0;_.t(_.Qg,_.Pg);_.t(_.Rg,_.C);_.Ld(_.Rg.prototype,{attribution:_.md(ri),place:_.md(Ci)});var fj={Animation:{BOUNCE:1,DROP:2,yo:3,wo:4},Circle:_.wg,ControlPosition:_.cg,Data:He,GroundOverlay:_.Ue,ImageMapType:_.Mg,InfoWindow:_.Oe,LatLng:_.Q,LatLngBounds:_.Xd,MVCArray:_.be,MVCObject:_.C,Map:sg,MapTypeControlStyle:{DEFAULT:0,HORIZONTAL_BAR:1,DROPDOWN_MENU:2,INSET:3,INSET_LARGE:4},MapTypeId:_.ih,MapTypeRegistry:se,Marker:_.De,MarkerImage:function(a,b,c,d,e){this.url=a;this.size=b||e;this.origin=c;this.anchor=d;this.scaledSize=e;this.labelOrigin=null},NavigationControlStyle:{DEFAULT:0,SMALL:1,
|
||||
ANDROID:2,ZOOM_PAN:3,zo:4,Ej:5},OverlayView:_.vg,Point:_.N,Polygon:_.Ee,Polyline:_.Fe,Rectangle:_.xg,ScaleControlStyle:{DEFAULT:0},Size:_.O,StreetViewPreference:_.Oi,StreetViewSource:_.Pi,StrokePosition:{CENTER:0,INSIDE:1,OUTSIDE:2},SymbolPath:mh,ZoomControlStyle:{DEFAULT:0,SMALL:1,LARGE:2,Ej:3},event:_.y};
|
||||
_.Wa(fj,{BicyclingLayer:_.Ze,DirectionsRenderer:Pe,DirectionsService:Qe,DirectionsStatus:{OK:_.ha,UNKNOWN_ERROR:_.ka,OVER_QUERY_LIMIT:_.ia,REQUEST_DENIED:_.ja,INVALID_REQUEST:_.ca,ZERO_RESULTS:_.la,MAX_WAYPOINTS_EXCEEDED:_.fa,NOT_FOUND:_.ga},DirectionsTravelMode:_.Gi,DirectionsUnitSystem:_.Fi,DistanceMatrixService:Re,DistanceMatrixStatus:{OK:_.ha,INVALID_REQUEST:_.ca,OVER_QUERY_LIMIT:_.ia,REQUEST_DENIED:_.ja,UNKNOWN_ERROR:_.ka,MAX_ELEMENTS_EXCEEDED:_.ea,MAX_DIMENSIONS_EXCEEDED:_.da},DistanceMatrixElementStatus:{OK:_.ha,
|
||||
NOT_FOUND:_.ga,ZERO_RESULTS:_.la},ElevationService:Se,ElevationStatus:{OK:_.ha,UNKNOWN_ERROR:_.ka,OVER_QUERY_LIMIT:_.ia,REQUEST_DENIED:_.ja,INVALID_REQUEST:_.ca,ro:"DATA_NOT_AVAILABLE"},FusionTablesLayer:ug,Geocoder:_.Te,GeocoderLocationType:{ROOFTOP:"ROOFTOP",RANGE_INTERPOLATED:"RANGE_INTERPOLATED",GEOMETRIC_CENTER:"GEOMETRIC_CENTER",APPROXIMATE:"APPROXIMATE"},GeocoderStatus:{OK:_.ha,UNKNOWN_ERROR:_.ka,OVER_QUERY_LIMIT:_.ia,REQUEST_DENIED:_.ja,INVALID_REQUEST:_.ca,ZERO_RESULTS:_.la,ERROR:_.ba},KmlLayer:Ye,
|
||||
KmlLayerStatus:_.Ni,MaxZoomService:tg,MaxZoomStatus:{OK:_.ha,ERROR:_.ba},SaveWidget:_.Rg,StreetViewCoverageLayer:yg,StreetViewPanorama:dg,StreetViewService:_.zg,StreetViewStatus:{OK:_.ha,UNKNOWN_ERROR:_.ka,ZERO_RESULTS:_.la},StyledMapType:_.Qg,TrafficLayer:$e,TrafficModel:_.Hi,TransitLayer:af,TransitMode:_.Ii,TransitRoutePreference:_.Ji,TravelMode:_.Gi,UnitSystem:_.Fi});_.Wa(He,{Feature:_.he,Geometry:Hd,GeometryCollection:_.je,LineString:_.Td,LinearRing:_.Ud,MultiLineString:_.ee,MultiPoint:_.Vd,MultiPolygon:_.le,Point:_.Wd,Polygon:_.ge});_.wc("main",{});var Ug=/'/g,Vg;var rd=arguments[0];
|
||||
window.google.maps.Load(function(a,b){var c=window.google.maps;Zg();var d=$g(c);_.R=new pf(a);_.gj=Math.random()<_.K(_.R,0,1);_.hj=Math.round(1E15*Math.random()).toString(36);_.rg=Wg();_.Li=Xg();_.Yi=new _.be;_.Tf=b;for(a=0;a<_.Fc(_.R,8);++a)_.pg[_.Ec(_.R,8,a)]=!0;a=new _.nf(_.R.data[3]);ud(_.L(a,0));_.Ua(fj,function(a,b){c[a]=b});c.version=_.L(a,1);window.setTimeout(function(){xc(["util","stats"],function(a,b){a.f.b();a.j();d&&b.b.b({ev:"api_alreadyloaded",client:_.L(_.R,6),key:_.L(_.R,16)})})},
|
||||
5E3);_.y.Ym();Vf=new Uf;(a=_.L(_.R,11))&&xc(_.zc(_.R,12),Yg(a),!0)});}).call(this,{});
|
||||
Vendored
+2417
File diff suppressed because it is too large
Load Diff
+2
File diff suppressed because one or more lines are too long
@@ -0,0 +1,13 @@
|
||||
// Peity jQuery plugin version 3.2.1
|
||||
// (c) 2016 Ben Pickles
|
||||
//
|
||||
// http://benpickles.github.io/peity
|
||||
//
|
||||
// Released under MIT license.
|
||||
(function(k,w,h,v){var d=k.fn.peity=function(a,b){y&&this.each(function(){var e=k(this),c=e.data("_peity");c?(a&&(c.type=a),k.extend(c.opts,b)):(c=new x(e,a,k.extend({},d.defaults[a],e.data("peity"),b)),e.change(function(){c.draw()}).data("_peity",c));c.draw()});return this},x=function(a,b,e){this.$el=a;this.type=b;this.opts=e},o=x.prototype,q=o.svgElement=function(a,b){return k(w.createElementNS("http://www.w3.org/2000/svg",a)).attr(b)},y="createElementNS"in w&&q("svg",{})[0].createSVGRect;o.draw=
|
||||
function(){var a=this.opts;d.graphers[this.type].call(this,a);a.after&&a.after.call(this,a)};o.fill=function(){var a=this.opts.fill;return k.isFunction(a)?a:function(b,e){return a[e%a.length]}};o.prepare=function(a,b){this.$svg||this.$el.hide().after(this.$svg=q("svg",{"class":"peity"}));return this.$svg.empty().data("peity",this).attr({height:b,width:a})};o.values=function(){return k.map(this.$el.text().split(this.opts.delimiter),function(a){return parseFloat(a)})};d.defaults={};d.graphers={};d.register=
|
||||
function(a,b,e){this.defaults[a]=b;this.graphers[a]=e};d.register("pie",{fill:["#ff9900","#fff4dd","#ffc66e"],radius:8},function(a){if(!a.delimiter){var b=this.$el.text().match(/[^0-9\.]/);a.delimiter=b?b[0]:","}b=k.map(this.values(),function(a){return 0<a?a:0});if("/"==a.delimiter)var e=b[0],b=[e,h.max(0,b[1]-e)];for(var c=0,e=b.length,t=0;c<e;c++)t+=b[c];t||(e=2,t=1,b=[0,1]);var l=2*a.radius,l=this.prepare(a.width||l,a.height||l),c=l.width(),f=l.height(),j=c/2,d=f/2,f=h.min(j,d),a=a.innerRadius;
|
||||
"donut"==this.type&&!a&&(a=0.5*f);for(var r=h.PI,s=this.fill(),g=this.scale=function(a,b){var c=a/t*r*2-r/2;return[b*h.cos(c)+j,b*h.sin(c)+d]},m=0,c=0;c<e;c++){var u=b[c],i=u/t;if(0!=i){if(1==i)if(a)var i=j-0.01,p=d-f,n=d-a,i=q("path",{d:["M",j,p,"A",f,f,0,1,1,i,p,"L",i,n,"A",a,a,0,1,0,j,n].join(" ")});else i=q("circle",{cx:j,cy:d,r:f});else p=m+u,n=["M"].concat(g(m,f),"A",f,f,0,0.5<i?1:0,1,g(p,f),"L"),a?n=n.concat(g(p,a),"A",a,a,0,0.5<i?1:0,0,g(m,a)):n.push(j,d),m+=u,i=q("path",{d:n.join(" ")});
|
||||
i.attr("fill",s.call(this,u,c,b));l.append(i)}}});d.register("donut",k.extend(!0,{},d.defaults.pie),function(a){d.graphers.pie.call(this,a)});d.register("line",{delimiter:",",fill:"#c6d9fd",height:16,min:0,stroke:"#4d89f9",strokeWidth:1,width:32},function(a){var b=this.values();1==b.length&&b.push(b[0]);for(var e=h.max.apply(h,a.max==v?b:b.concat(a.max)),c=h.min.apply(h,a.min==v?b:b.concat(a.min)),d=this.prepare(a.width,a.height),l=a.strokeWidth,f=d.width(),j=d.height()-l,k=e-c,e=this.x=function(a){return a*
|
||||
(f/(b.length-1))},r=this.y=function(a){var b=j;k&&(b-=(a-c)/k*j);return b+l/2},s=r(h.max(c,0)),g=[0,s],m=0;m<b.length;m++)g.push(e(m),r(b[m]));g.push(f,s);a.fill&&d.append(q("polygon",{fill:a.fill,points:g.join(" ")}));l&&d.append(q("polyline",{fill:"none",points:g.slice(2,g.length-2).join(" "),stroke:a.stroke,"stroke-width":l,"stroke-linecap":"square"}))});d.register("bar",{delimiter:",",fill:["#4D89F9"],height:16,min:0,padding:0.1,width:32},function(a){for(var b=this.values(),e=h.max.apply(h,a.max==
|
||||
v?b:b.concat(a.max)),c=h.min.apply(h,a.min==v?b:b.concat(a.min)),d=this.prepare(a.width,a.height),l=d.width(),f=d.height(),j=e-c,a=a.padding,k=this.fill(),r=this.x=function(a){return a*l/b.length},s=this.y=function(a){return f-(j?(a-c)/j*f:1)},g=0;g<b.length;g++){var m=r(g+a),u=r(g+1-a)-m,i=b[g],p=s(i),n=p,o;j?0>i?n=s(h.min(e,0)):p=s(h.max(c,0)):o=1;o=p-n;0==o&&(o=1,0<e&&j&&n--);d.append(q("rect",{fill:k.call(this,i,g,b),x:m,y:n,width:u,height:o}))}})})(jQuery,document,Math);
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
(function($){
|
||||
|
||||
"use strict"; // Start of use strict
|
||||
|
||||
$(function() {
|
||||
"use strict";
|
||||
// Just the defaults.
|
||||
$("span.pie").peity("pie",{
|
||||
width: '50',
|
||||
height: '50'
|
||||
})
|
||||
|
||||
$('span.donut').peity('donut',{
|
||||
width: '50',
|
||||
height: '50'
|
||||
})
|
||||
|
||||
|
||||
$(".peity-line").peity("line",{
|
||||
width: '300',
|
||||
height: '100'
|
||||
})
|
||||
|
||||
$(".bar").peity("bar",{
|
||||
width: '300',
|
||||
height: '100'
|
||||
})
|
||||
|
||||
$(".bar-colours-1").peity("bar", {
|
||||
fill: ["red", "green", "blue"],
|
||||
width: '100',
|
||||
height: '100'
|
||||
})
|
||||
|
||||
$(".bar-colours-2").peity("bar", {
|
||||
fill: function(value) {
|
||||
return value > 0 ? "green" : "red"
|
||||
},
|
||||
width: '100',
|
||||
height: '100'
|
||||
})
|
||||
|
||||
$(".bar-colours-3").peity("bar", {
|
||||
fill: function(_, i, all) {
|
||||
var g = parseInt((i / all.length) * 255)
|
||||
return "rgb(255, " + g + ", 0)"
|
||||
},
|
||||
width: '100',
|
||||
height: '100'
|
||||
})
|
||||
|
||||
$(".pie-colours-1").peity("pie", {
|
||||
fill: ["cyan", "magenta", "yellow", "black"],
|
||||
width: '100',
|
||||
height: '100'
|
||||
})
|
||||
|
||||
$(".pie-colours-2").peity("pie", {
|
||||
fill: function(_, i, all) {
|
||||
var g = parseInt((i / all.length) * 255)
|
||||
return "rgb(255, " + g + ", 0)"
|
||||
},
|
||||
width: '100',
|
||||
height: '100'
|
||||
})
|
||||
|
||||
// Using data attributes
|
||||
$(".data-attributes span").peity("donut")
|
||||
|
||||
// Evented example.
|
||||
$("select").change(function() {
|
||||
var text = $(this).val() + "/" + 5
|
||||
|
||||
$(this)
|
||||
.siblings("span.graph")
|
||||
.text(text)
|
||||
.change()
|
||||
|
||||
$("#notice").text("Chart updated: " + text)
|
||||
}).change()
|
||||
|
||||
$("span.graph").peity("pie")
|
||||
|
||||
// Updating charts.
|
||||
var updatingChart = $(".updating-chart").peity("line", { width: "100%",height:100 })
|
||||
|
||||
setInterval(function() {
|
||||
var random = Math.round(Math.random() * 10)
|
||||
var values = updatingChart.text().split(",")
|
||||
values.shift()
|
||||
values.push(random)
|
||||
|
||||
updatingChart
|
||||
.text(values.join(","))
|
||||
.change()
|
||||
}, 1000)
|
||||
})
|
||||
|
||||
|
||||
})(jQuery);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1288
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
var sample_data = {"af":"16.63","al":"11.58","dz":"158.97","ao":"85.81","ag":"1.1","ar":"351.02","am":"8.83","au":"1219.72","at":"366.26","az":"52.17","bs":"7.54","bh":"21.73","bd":"105.4","bb":"3.96","by":"52.89","be":"461.33","bz":"1.43","bj":"6.49","bt":"1.4","bo":"19.18","ba":"16.2","bw":"12.5","br":"2023.53","bn":"11.96","bg":"44.84","bf":"8.67","bi":"1.47","kh":"11.36","cm":"21.88","ca":"1563.66","cv":"1.57","cf":"2.11","td":"7.59","cl":"199.18","cn":"5745.13","co":"283.11","km":"0.56","cd":"12.6","cg":"11.88","cr":"35.02","ci":"22.38","hr":"59.92","cy":"22.75","cz":"195.23","dk":"304.56","dj":"1.14","dm":"0.38","do":"50.87","ec":"61.49","eg":"216.83","sv":"21.8","gq":"14.55","er":"2.25","ee":"19.22","et":"30.94","fj":"3.15","fi":"231.98","fr":"2555.44","ga":"12.56","gm":"1.04","ge":"11.23","de":"3305.9","gh":"18.06","gr":"305.01","gd":"0.65","gt":"40.77","gn":"4.34","gw":"0.83","gy":"2.2","ht":"6.5","hn":"15.34","hk":"226.49","hu":"132.28","is":"12.77","in":"1430.02","id":"695.06","ir":"337.9","iq":"84.14","ie":"204.14","il":"201.25","it":"2036.69","jm":"13.74","jp":"5390.9","jo":"27.13","kz":"129.76","ke":"32.42","ki":"0.15","kr":"986.26","undefined":"5.73","kw":"117.32","kg":"4.44","la":"6.34","lv":"23.39","lb":"39.15","ls":"1.8","lr":"0.98","ly":"77.91","lt":"35.73","lu":"52.43","mk":"9.58","mg":"8.33","mw":"5.04","my":"218.95","mv":"1.43","ml":"9.08","mt":"7.8","mr":"3.49","mu":"9.43","mx":"1004.04","md":"5.36","mn":"5.81","me":"3.88","ma":"91.7","mz":"10.21","mm":"35.65","na":"11.45","np":"15.11","nl":"770.31","nz":"138","ni":"6.38","ne":"5.6","ng":"206.66","no":"413.51","om":"53.78","pk":"174.79","pa":"27.2","pg":"8.81","py":"17.17","pe":"153.55","ph":"189.06","pl":"438.88","pt":"223.7","qa":"126.52","ro":"158.39","ru":"1476.91","rw":"5.69","ws":"0.55","st":"0.19","sa":"434.44","sn":"12.66","rs":"38.92","sc":"0.92","sl":"1.9","sg":"217.38","sk":"86.26","si":"46.44","sb":"0.67","za":"354.41","es":"1374.78","lk":"48.24","kn":"0.56","lc":"1","vc":"0.58","sd":"65.93","sr":"3.3","sz":"3.17","se":"444.59","ch":"522.44","sy":"59.63","tw":"426.98","tj":"5.58","tz":"22.43","th":"312.61","tl":"0.62","tg":"3.07","to":"0.3","tt":"21.2","tn":"43.86","tr":"729.05","tm":0,"ug":"17.12","ua":"136.56","ae":"239.65","gb":"2258.57","us":"14624.18","uy":"40.71","uz":"37.72","vu":"0.72","ve":"285.21","vn":"101.99","ye":"30.02","zm":"15.69","zw":"5.57"};
|
||||
+223
@@ -0,0 +1,223 @@
|
||||
( function ( $ ) {
|
||||
"use strict";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
jQuery( '#vmap' ).vectorMap( {
|
||||
map: 'world_en',
|
||||
backgroundColor: null,
|
||||
color: '#ffffff',
|
||||
hoverOpacity: 0.7,
|
||||
selectedColor: '#1de9b6',
|
||||
enableZoom: true,
|
||||
showTooltip: true,
|
||||
values: sample_data,
|
||||
scaleColors: [ '#1de9b6', '#03a9f5' ],
|
||||
normalizeFunction: 'polynomial'
|
||||
} );
|
||||
|
||||
jQuery( '#vmap2' ).vectorMap( {
|
||||
map: 'dz_fr',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
borderOpacity: 1,
|
||||
enableZoom: true,
|
||||
showTooltip: true
|
||||
} );
|
||||
|
||||
jQuery( '#vmap3' ).vectorMap( {
|
||||
map: 'argentina_en',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
onRegionClick: function ( element, code, region ) {
|
||||
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
|
||||
|
||||
alert( message );
|
||||
}
|
||||
} );
|
||||
|
||||
jQuery( '#vmap4' ).vectorMap( {
|
||||
map: 'brazil_br',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
onRegionClick: function ( element, code, region ) {
|
||||
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
|
||||
|
||||
alert( message );
|
||||
}
|
||||
} );
|
||||
|
||||
jQuery( '#vmap5' ).vectorMap( {
|
||||
map: 'france_fr',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
enableZoom: true,
|
||||
showTooltip: true
|
||||
} );
|
||||
|
||||
jQuery( '#vmap6' ).vectorMap( {
|
||||
map: 'germany_en',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
onRegionClick: function ( element, code, region ) {
|
||||
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
|
||||
|
||||
alert( message );
|
||||
}
|
||||
} );
|
||||
|
||||
jQuery( '#vmap7' ).vectorMap( {
|
||||
map: 'greece',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
onRegionClick: function ( element, code, region ) {
|
||||
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
|
||||
|
||||
alert( message );
|
||||
}
|
||||
} );
|
||||
|
||||
jQuery( '#vmap8' ).vectorMap( {
|
||||
map: 'iran_ir',
|
||||
onRegionClick: function ( element, code, region ) {
|
||||
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
|
||||
|
||||
alert( message );
|
||||
}
|
||||
} );
|
||||
|
||||
jQuery( '#vmap9' ).vectorMap( {
|
||||
map: 'iraq',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
onRegionClick: function ( element, code, region ) {
|
||||
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
|
||||
|
||||
alert( message );
|
||||
}
|
||||
} );
|
||||
|
||||
jQuery( '#vmap10' ).vectorMap( {
|
||||
map: 'russia_en',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
hoverOpacity: 0.7,
|
||||
selectedColor: '#999999',
|
||||
enableZoom: true,
|
||||
showTooltip: true,
|
||||
scaleColors: [ '#C8EEFF', '#006491' ],
|
||||
normalizeFunction: 'polynomial'
|
||||
} );
|
||||
|
||||
jQuery( '#vmap11' ).vectorMap( {
|
||||
map: 'tunisia',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
onRegionClick: function ( element, code, region ) {
|
||||
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
|
||||
|
||||
alert( message );
|
||||
}
|
||||
} );
|
||||
|
||||
jQuery( '#vmap12' ).vectorMap( {
|
||||
map: 'europe_en',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
enableZoom: true,
|
||||
showTooltip: true
|
||||
} );
|
||||
|
||||
jQuery( '#vmap13' ).vectorMap( {
|
||||
map: 'usa_en',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
enableZoom: true,
|
||||
showTooltip: true,
|
||||
selectedColor: null,
|
||||
hoverColor: null,
|
||||
colors: {
|
||||
mo: '#001BFF',
|
||||
fl: '#001BFF',
|
||||
or: '#001BFF'
|
||||
},
|
||||
onRegionClick: function ( event, code, region ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
} );
|
||||
|
||||
jQuery( '#vmap14' ).vectorMap( {
|
||||
map: 'turkey',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
onRegionClick: function ( element, code, region ) {
|
||||
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
|
||||
alert( message );
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
|
||||
} )( jQuery );
|
||||
|
||||
|
||||
|
||||
var map;
|
||||
|
||||
jQuery( document ).ready( function () {
|
||||
|
||||
// Store currentRegion
|
||||
var currentRegion = 'fl';
|
||||
|
||||
// List of Regions we'll let clicks through for
|
||||
var enabledRegions = [ 'mo', 'fl', 'or' ];
|
||||
|
||||
map = jQuery( '#vmap15' ).vectorMap( {
|
||||
map: 'usa_en',
|
||||
color: '#007BFF',
|
||||
borderColor: '#fff',
|
||||
backgroundColor: '#fff',
|
||||
enableZoom: true,
|
||||
showTooltip: true,
|
||||
selectedColor: '#001BFF',
|
||||
selectedRegions: [ 'fl' ],
|
||||
hoverColor: null,
|
||||
colors: {
|
||||
mo: '#001BFF',
|
||||
fl: '#001BFF',
|
||||
or: '#001BFF'
|
||||
},
|
||||
onRegionClick: function ( event, code, region ) {
|
||||
// Check if this is an Enabled Region, and not the current selected on
|
||||
if ( enabledRegions.indexOf( code ) === -1 || currentRegion === code ) {
|
||||
// Not an Enabled Region
|
||||
event.preventDefault();
|
||||
} else {
|
||||
// Enabled Region. Update Newly Selected Region.
|
||||
currentRegion = code;
|
||||
}
|
||||
},
|
||||
onRegionSelect: function ( event, code, region ) {
|
||||
console.log( map.selectedRegions );
|
||||
},
|
||||
onLabelShow: function ( event, label, code ) {
|
||||
if ( enabledRegions.indexOf( code ) === -1 ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
} );
|
||||
} );
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
$.noConflict();
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
[].slice.call( document.querySelectorAll( 'select.cs-select' ) ).forEach( function(el) {
|
||||
new SelectFx(el);
|
||||
} );
|
||||
|
||||
jQuery('.selectpicker').selectpicker;
|
||||
|
||||
|
||||
$('#menuToggle').on('click', function(event) {
|
||||
$('body').toggleClass('open');
|
||||
});
|
||||
|
||||
$('.search-trigger').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$('.search-trigger').parent('.header-left').addClass('open');
|
||||
});
|
||||
|
||||
$('.search-close').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$('.search-trigger').parent('.header-left').removeClass('open');
|
||||
});
|
||||
|
||||
// $('.user-area> a').on('click', function(event) {
|
||||
// event.preventDefault();
|
||||
// event.stopPropagation();
|
||||
// $('.user-menu').parent().removeClass('open');
|
||||
// $('.user-menu').parent().toggleClass('open');
|
||||
// });
|
||||
|
||||
|
||||
});
|
||||
Vendored
+409
File diff suppressed because one or more lines are too long
Vendored
+5
File diff suppressed because one or more lines are too long
Vendored
+325
@@ -0,0 +1,325 @@
|
||||
/**
|
||||
* selectFx.js v1.0.0
|
||||
* http://www.codrops.com
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Copyright 2014, Codrops
|
||||
* http://www.codrops.com
|
||||
*/
|
||||
;( function( window ) {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* based on from https://github.com/inuyaksa/jquery.nicescroll/blob/master/jquery.nicescroll.js
|
||||
*/
|
||||
function hasParent( e, p ) {
|
||||
if (!e) return false;
|
||||
var el = e.target||e.srcElement||e||false;
|
||||
while (el && el != p) {
|
||||
el = el.parentNode||false;
|
||||
}
|
||||
return (el!==false);
|
||||
};
|
||||
|
||||
/**
|
||||
* extend obj function
|
||||
*/
|
||||
function extend( a, b ) {
|
||||
for( var key in b ) {
|
||||
if( b.hasOwnProperty( key ) ) {
|
||||
a[key] = b[key];
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* SelectFx function
|
||||
*/
|
||||
function SelectFx( el, options ) {
|
||||
this.el = el;
|
||||
this.options = extend( {}, this.options );
|
||||
extend( this.options, options );
|
||||
this._init();
|
||||
}
|
||||
|
||||
/**
|
||||
* SelectFx options
|
||||
*/
|
||||
SelectFx.prototype.options = {
|
||||
// if true all the links will open in a new tab.
|
||||
// if we want to be redirected when we click an option, we need to define a data-link attr on the option of the native select element
|
||||
newTab : true,
|
||||
// when opening the select element, the default placeholder (if any) is shown
|
||||
stickyPlaceholder : true,
|
||||
// callback when changing the value
|
||||
onChange : function( val ) { return false; }
|
||||
}
|
||||
|
||||
/**
|
||||
* init function
|
||||
* initialize and cache some vars
|
||||
*/
|
||||
SelectFx.prototype._init = function() {
|
||||
// check if we are using a placeholder for the native select box
|
||||
// we assume the placeholder is disabled and selected by default
|
||||
var selectedOpt = this.el.querySelector( 'option[selected]' );
|
||||
this.hasDefaultPlaceholder = selectedOpt && selectedOpt.disabled;
|
||||
|
||||
// get selected option (either the first option with attr selected or just the first option)
|
||||
this.selectedOpt = selectedOpt || this.el.querySelector( 'option' );
|
||||
|
||||
// create structure
|
||||
this._createSelectEl();
|
||||
|
||||
// all options
|
||||
this.selOpts = [].slice.call( this.selEl.querySelectorAll( 'li[data-option]' ) );
|
||||
|
||||
// total options
|
||||
this.selOptsCount = this.selOpts.length;
|
||||
|
||||
// current index
|
||||
this.current = this.selOpts.indexOf( this.selEl.querySelector( 'li.cs-selected' ) ) || -1;
|
||||
|
||||
// placeholder elem
|
||||
this.selPlaceholder = this.selEl.querySelector( 'span.cs-placeholder' );
|
||||
|
||||
// init events
|
||||
this._initEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
* creates the structure for the select element
|
||||
*/
|
||||
SelectFx.prototype._createSelectEl = function() {
|
||||
var self = this, options = '', createOptionHTML = function(el) {
|
||||
var optclass = '', classes = '', link = '';
|
||||
|
||||
if( el.selectedOpt && !this.foundSelected && !this.hasDefaultPlaceholder ) {
|
||||
classes += 'cs-selected ';
|
||||
this.foundSelected = true;
|
||||
}
|
||||
// extra classes
|
||||
if( el.getAttribute( 'data-class' ) ) {
|
||||
classes += el.getAttribute( 'data-class' );
|
||||
}
|
||||
// link options
|
||||
if( el.getAttribute( 'data-link' ) ) {
|
||||
link = 'data-link=' + el.getAttribute( 'data-link' );
|
||||
}
|
||||
|
||||
if( classes !== '' ) {
|
||||
optclass = 'class="' + classes + '" ';
|
||||
}
|
||||
|
||||
return '<li ' + optclass + link + ' data-option data-value="' + el.value + '"><span>' + el.textContent + '</span></li>';
|
||||
};
|
||||
|
||||
[].slice.call( this.el.children ).forEach( function(el) {
|
||||
if( el.disabled ) { return; }
|
||||
|
||||
var tag = el.tagName.toLowerCase();
|
||||
|
||||
if( tag === 'option' ) {
|
||||
options += createOptionHTML(el);
|
||||
}
|
||||
else if( tag === 'optgroup' ) {
|
||||
options += '<li class="cs-optgroup"><span>' + el.label + '</span><ul>';
|
||||
[].slice.call( el.children ).forEach( function(opt) {
|
||||
options += createOptionHTML(opt);
|
||||
} );
|
||||
options += '</ul></li>';
|
||||
}
|
||||
} );
|
||||
|
||||
var opts_el = '<div class="cs-options"><ul>' + options + '</ul></div>';
|
||||
this.selEl = document.createElement( 'div' );
|
||||
this.selEl.className = this.el.className;
|
||||
this.selEl.tabIndex = this.el.tabIndex;
|
||||
this.selEl.innerHTML = '<span class="cs-placeholder">' + this.selectedOpt.textContent + '</span>' + opts_el;
|
||||
this.el.parentNode.appendChild( this.selEl );
|
||||
this.selEl.appendChild( this.el );
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize the events
|
||||
*/
|
||||
SelectFx.prototype._initEvents = function() {
|
||||
var self = this;
|
||||
|
||||
// open/close select
|
||||
this.selPlaceholder.addEventListener( 'click', function() {
|
||||
self._toggleSelect();
|
||||
} );
|
||||
|
||||
// clicking the options
|
||||
this.selOpts.forEach( function(opt, idx) {
|
||||
opt.addEventListener( 'click', function() {
|
||||
self.current = idx;
|
||||
self._changeOption();
|
||||
// close select elem
|
||||
self._toggleSelect();
|
||||
} );
|
||||
} );
|
||||
|
||||
// close the select element if the target it´s not the select element or one of its descendants..
|
||||
document.addEventListener( 'click', function(ev) {
|
||||
var target = ev.target;
|
||||
if( self._isOpen() && target !== self.selEl && !hasParent( target, self.selEl ) ) {
|
||||
self._toggleSelect();
|
||||
}
|
||||
} );
|
||||
|
||||
// keyboard navigation events
|
||||
this.selEl.addEventListener( 'keydown', function( ev ) {
|
||||
var keyCode = ev.keyCode || ev.which;
|
||||
|
||||
switch (keyCode) {
|
||||
// up key
|
||||
case 38:
|
||||
ev.preventDefault();
|
||||
self._navigateOpts('prev');
|
||||
break;
|
||||
// down key
|
||||
case 40:
|
||||
ev.preventDefault();
|
||||
self._navigateOpts('next');
|
||||
break;
|
||||
// space key
|
||||
case 32:
|
||||
ev.preventDefault();
|
||||
if( self._isOpen() && typeof self.preSelCurrent != 'undefined' && self.preSelCurrent !== -1 ) {
|
||||
self._changeOption();
|
||||
}
|
||||
self._toggleSelect();
|
||||
break;
|
||||
// enter key
|
||||
case 13:
|
||||
ev.preventDefault();
|
||||
if( self._isOpen() && typeof self.preSelCurrent != 'undefined' && self.preSelCurrent !== -1 ) {
|
||||
self._changeOption();
|
||||
self._toggleSelect();
|
||||
}
|
||||
break;
|
||||
// esc key
|
||||
case 27:
|
||||
ev.preventDefault();
|
||||
if( self._isOpen() ) {
|
||||
self._toggleSelect();
|
||||
}
|
||||
break;
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
/**
|
||||
* navigate with up/dpwn keys
|
||||
*/
|
||||
SelectFx.prototype._navigateOpts = function(dir) {
|
||||
if( !this._isOpen() ) {
|
||||
this._toggleSelect();
|
||||
}
|
||||
|
||||
var tmpcurrent = typeof this.preSelCurrent != 'undefined' && this.preSelCurrent !== -1 ? this.preSelCurrent : this.current;
|
||||
|
||||
if( dir === 'prev' && tmpcurrent > 0 || dir === 'next' && tmpcurrent < this.selOptsCount - 1 ) {
|
||||
// save pre selected current - if we click on option, or press enter, or press space this is going to be the index of the current option
|
||||
this.preSelCurrent = dir === 'next' ? tmpcurrent + 1 : tmpcurrent - 1;
|
||||
// remove focus class if any..
|
||||
this._removeFocus();
|
||||
// add class focus - track which option we are navigating
|
||||
classie.add( this.selOpts[this.preSelCurrent], 'cs-focus' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* open/close select
|
||||
* when opened show the default placeholder if any
|
||||
*/
|
||||
SelectFx.prototype._toggleSelect = function() {
|
||||
// remove focus class if any..
|
||||
this._removeFocus();
|
||||
|
||||
if( this._isOpen() ) {
|
||||
if( this.current !== -1 ) {
|
||||
// update placeholder text
|
||||
this.selPlaceholder.textContent = this.selOpts[ this.current ].textContent;
|
||||
}
|
||||
classie.remove( this.selEl, 'cs-active' );
|
||||
}
|
||||
else {
|
||||
if( this.hasDefaultPlaceholder && this.options.stickyPlaceholder ) {
|
||||
// everytime we open we wanna see the default placeholder text
|
||||
this.selPlaceholder.textContent = this.selectedOpt.textContent;
|
||||
}
|
||||
classie.add( this.selEl, 'cs-active' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* change option - the new value is set
|
||||
*/
|
||||
SelectFx.prototype._changeOption = function() {
|
||||
// if pre selected current (if we navigate with the keyboard)...
|
||||
if( typeof this.preSelCurrent != 'undefined' && this.preSelCurrent !== -1 ) {
|
||||
this.current = this.preSelCurrent;
|
||||
this.preSelCurrent = -1;
|
||||
}
|
||||
|
||||
// current option
|
||||
var opt = this.selOpts[ this.current ];
|
||||
|
||||
// update current selected value
|
||||
this.selPlaceholder.textContent = opt.textContent;
|
||||
|
||||
// change native select element´s value
|
||||
this.el.value = opt.getAttribute( 'data-value' );
|
||||
|
||||
// remove class cs-selected from old selected option and add it to current selected option
|
||||
var oldOpt = this.selEl.querySelector( 'li.cs-selected' );
|
||||
if( oldOpt ) {
|
||||
classie.remove( oldOpt, 'cs-selected' );
|
||||
}
|
||||
classie.add( opt, 'cs-selected' );
|
||||
|
||||
// if there´s a link defined
|
||||
if( opt.getAttribute( 'data-link' ) ) {
|
||||
// open in new tab?
|
||||
if( this.options.newTab ) {
|
||||
window.open( opt.getAttribute( 'data-link' ), '_blank' );
|
||||
}
|
||||
else {
|
||||
window.location = opt.getAttribute( 'data-link' );
|
||||
}
|
||||
}
|
||||
|
||||
// callback
|
||||
this.options.onChange( this.el.value );
|
||||
}
|
||||
|
||||
/**
|
||||
* returns true if select element is opened
|
||||
*/
|
||||
SelectFx.prototype._isOpen = function(opt) {
|
||||
return classie.has( this.selEl, 'cs-active' );
|
||||
}
|
||||
|
||||
/**
|
||||
* removes the focus class from the option
|
||||
*/
|
||||
SelectFx.prototype._removeFocus = function(opt) {
|
||||
var focusEl = this.selEl.querySelector( 'li.cs-focus' )
|
||||
if( focusEl ) {
|
||||
classie.remove( focusEl, 'cs-focus' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* add to global namespace
|
||||
*/
|
||||
window.SelectFx = SelectFx;
|
||||
|
||||
} )( window );
|
||||
File diff suppressed because one or more lines are too long
+4
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+265
@@ -0,0 +1,265 @@
|
||||
( function ( $ ) {
|
||||
"use strict";
|
||||
|
||||
|
||||
// Counter Number
|
||||
$('.count').each(function () {
|
||||
$(this).prop('Counter',0).animate({
|
||||
Counter: $(this).text()
|
||||
}, {
|
||||
duration: 3000,
|
||||
easing: 'swing',
|
||||
step: function (now) {
|
||||
$(this).text(Math.ceil(now));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//WidgetChart 1
|
||||
var ctx = document.getElementById( "widgetChart1" );
|
||||
ctx.height = 150;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
type: 'line',
|
||||
datasets: [ {
|
||||
data: [65, 59, 84, 84, 51, 55, 40],
|
||||
label: 'Dataset',
|
||||
backgroundColor: 'transparent',
|
||||
borderColor: 'rgba(255,255,255,.55)',
|
||||
}, ]
|
||||
},
|
||||
options: {
|
||||
|
||||
maintainAspectRatio: false,
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
responsive: true,
|
||||
tooltips: {
|
||||
mode: 'index',
|
||||
titleFontSize: 12,
|
||||
titleFontColor: '#000',
|
||||
bodyFontColor: '#000',
|
||||
backgroundColor: '#fff',
|
||||
titleFontFamily: 'Montserrat',
|
||||
bodyFontFamily: 'Montserrat',
|
||||
cornerRadius: 3,
|
||||
intersect: false,
|
||||
},
|
||||
scales: {
|
||||
xAxes: [ {
|
||||
gridLines: {
|
||||
color: 'transparent',
|
||||
zeroLineColor: 'transparent'
|
||||
},
|
||||
ticks: {
|
||||
fontSize: 2,
|
||||
fontColor: 'transparent'
|
||||
}
|
||||
} ],
|
||||
yAxes: [ {
|
||||
display:false,
|
||||
ticks: {
|
||||
display: false,
|
||||
}
|
||||
} ]
|
||||
},
|
||||
title: {
|
||||
display: false,
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
borderWidth: 1
|
||||
},
|
||||
point: {
|
||||
radius: 4,
|
||||
hitRadius: 10,
|
||||
hoverRadius: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
//WidgetChart 2
|
||||
var ctx = document.getElementById( "widgetChart2" );
|
||||
ctx.height = 150;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
type: 'line',
|
||||
datasets: [ {
|
||||
data: [1, 18, 9, 17, 34, 22, 11],
|
||||
label: 'Dataset',
|
||||
backgroundColor: '#63c2de',
|
||||
borderColor: 'rgba(255,255,255,.55)',
|
||||
}, ]
|
||||
},
|
||||
options: {
|
||||
|
||||
maintainAspectRatio: false,
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
responsive: true,
|
||||
tooltips: {
|
||||
mode: 'index',
|
||||
titleFontSize: 12,
|
||||
titleFontColor: '#000',
|
||||
bodyFontColor: '#000',
|
||||
backgroundColor: '#fff',
|
||||
titleFontFamily: 'Montserrat',
|
||||
bodyFontFamily: 'Montserrat',
|
||||
cornerRadius: 3,
|
||||
intersect: false,
|
||||
},
|
||||
scales: {
|
||||
xAxes: [ {
|
||||
gridLines: {
|
||||
color: 'transparent',
|
||||
zeroLineColor: 'transparent'
|
||||
},
|
||||
ticks: {
|
||||
fontSize: 2,
|
||||
fontColor: 'transparent'
|
||||
}
|
||||
} ],
|
||||
yAxes: [ {
|
||||
display:false,
|
||||
ticks: {
|
||||
display: false,
|
||||
}
|
||||
} ]
|
||||
},
|
||||
title: {
|
||||
display: false,
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
tension: 0.00001,
|
||||
borderWidth: 1
|
||||
},
|
||||
point: {
|
||||
radius: 4,
|
||||
hitRadius: 10,
|
||||
hoverRadius: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
|
||||
//WidgetChart 3
|
||||
var ctx = document.getElementById( "widgetChart3" );
|
||||
ctx.height = 70;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
type: 'line',
|
||||
datasets: [ {
|
||||
data: [78, 81, 80, 45, 34, 12, 40],
|
||||
label: 'Dataset',
|
||||
backgroundColor: 'rgba(255,255,255,.2)',
|
||||
borderColor: 'rgba(255,255,255,.55)',
|
||||
}, ]
|
||||
},
|
||||
options: {
|
||||
|
||||
maintainAspectRatio: true,
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
responsive: true,
|
||||
// tooltips: {
|
||||
// mode: 'index',
|
||||
// titleFontSize: 12,
|
||||
// titleFontColor: '#000',
|
||||
// bodyFontColor: '#000',
|
||||
// backgroundColor: '#fff',
|
||||
// titleFontFamily: 'Montserrat',
|
||||
// bodyFontFamily: 'Montserrat',
|
||||
// cornerRadius: 3,
|
||||
// intersect: false,
|
||||
// },
|
||||
scales: {
|
||||
xAxes: [ {
|
||||
gridLines: {
|
||||
color: 'transparent',
|
||||
zeroLineColor: 'transparent'
|
||||
},
|
||||
ticks: {
|
||||
fontSize: 2,
|
||||
fontColor: 'transparent'
|
||||
}
|
||||
} ],
|
||||
yAxes: [ {
|
||||
display:false,
|
||||
ticks: {
|
||||
display: false,
|
||||
}
|
||||
} ]
|
||||
},
|
||||
title: {
|
||||
display: false,
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
borderWidth: 2
|
||||
},
|
||||
point: {
|
||||
radius: 0,
|
||||
hitRadius: 10,
|
||||
hoverRadius: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
//WidgetChart 4
|
||||
var ctx = document.getElementById( "widgetChart4" );
|
||||
ctx.height = 70;
|
||||
var myChart = new Chart( ctx, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''],
|
||||
datasets: [
|
||||
{
|
||||
label: "My First dataset",
|
||||
data: [78, 81, 80, 45, 34, 12, 40, 75, 34, 89, 32, 68, 54, 72, 18, 98],
|
||||
borderColor: "rgba(0, 123, 255, 0.9)",
|
||||
//borderWidth: "0",
|
||||
backgroundColor: "rgba(255,255,255,.3)"
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
maintainAspectRatio: true,
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
scales: {
|
||||
xAxes: [{
|
||||
display: false,
|
||||
categoryPercentage: 1,
|
||||
barPercentage: 0.5
|
||||
}],
|
||||
yAxes: [ {
|
||||
display: false
|
||||
} ]
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
|
||||
} )( jQuery );
|
||||
Reference in New Issue
Block a user