【地图配置】初始化三个不同的交互式世界地图
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
||||
function getTimeRemaining(endtime) {
|
||||
const total = Date.parse(endtime) - Date.parse(new Date());
|
||||
const seconds = Math.floor((total / 1000) % 60);
|
||||
const minutes = Math.floor((total / 1000 / 60) % 60);
|
||||
const hours = Math.floor((total / (1000 * 60 * 60)) % 24);
|
||||
const days = Math.floor(total / (1000 * 60 * 60 * 24));
|
||||
|
||||
return {
|
||||
total,
|
||||
days,
|
||||
hours,
|
||||
minutes,
|
||||
seconds
|
||||
};
|
||||
}
|
||||
|
||||
function initializeClock(elem, endtime) {
|
||||
const clock = document.querySelector(elem)
|
||||
const daysSpan = clock.querySelector('[data-days]')
|
||||
const hoursSpan = clock.querySelector('[data-hours]')
|
||||
const minutesSpan = clock.querySelector('[data-minutes]')
|
||||
const secondsSpan = clock.querySelector('[data-seconds]')
|
||||
|
||||
function updateClock() {
|
||||
const t = getTimeRemaining(endtime)
|
||||
|
||||
daysSpan.innerHTML = t.days
|
||||
hoursSpan.innerHTML = ('0' + t.hours).slice(-2)
|
||||
minutesSpan.innerHTML = ('0' + t.minutes).slice(-2)
|
||||
secondsSpan.innerHTML = ('0' + t.seconds).slice(-2)
|
||||
|
||||
if (t.total <= 0) {
|
||||
clearInterval(timeinterval)
|
||||
}
|
||||
}
|
||||
|
||||
updateClock()
|
||||
const timeinterval = setInterval(updateClock, 1000)
|
||||
}
|
||||
|
||||
let time = document.querySelector('.countdown').getAttribute('data-date')
|
||||
if (time == undefined) {
|
||||
time = Date.parse(new Date()) + 15 * 24 * 60 * 60 * 1000
|
||||
}
|
||||
const deadline = new Date(time)
|
||||
initializeClock('.countdown', deadline)
|
||||
@@ -0,0 +1,51 @@
|
||||
(function (jQuery) {
|
||||
"use strict";
|
||||
// data-mode="click" for using event
|
||||
// data-dark="false" for property
|
||||
// icon class // la-sun // la-moon
|
||||
const storageDark = localStorage.getItem('dark')
|
||||
if($('body').hasClass('dark')){
|
||||
changeMode('true');
|
||||
} else {
|
||||
changeMode('false');
|
||||
}
|
||||
if (storageDark !== 'null') {
|
||||
changeMode(storageDark)
|
||||
}
|
||||
jQuery(document).on("change", '.change-mode input[type="checkbox"]' ,function (e) {
|
||||
const dark = $(this).attr('data-active');
|
||||
if (dark === 'true') {
|
||||
$(this).attr('data-active','false')
|
||||
} else {
|
||||
$(this).attr('data-active','true')
|
||||
}
|
||||
changeMode(dark)
|
||||
})
|
||||
function changeMode (dark) {
|
||||
const body = jQuery('body')
|
||||
if (dark === 'true') {
|
||||
// $('[data-mode="toggle"]').find('i.a-right').removeClass('ri-sun-line');
|
||||
// $('[data-mode="toggle"]').find('i.a-left').addClass('ri-moon-clear-line');
|
||||
$('#dark-mode').prop('checked', true).attr('data-active', 'false')
|
||||
$('.darkmode-logo').removeClass('d-none')
|
||||
$('.light-logo').addClass('d-none')
|
||||
body.addClass('dark')
|
||||
dark = true
|
||||
} else {
|
||||
// $('[data-mode="toggle"]').find('i.a-left').removeClass('ri-moon-clear-line');
|
||||
// $('[data-mode="toggle"]').find('i.a-right').addClass('ri-sun-line');
|
||||
$('#dark-mode').prop('checked', false).attr('data-active', 'true');
|
||||
$('.light-logo').removeClass('d-none')
|
||||
$('.darkmode-logo').addClass('d-none')
|
||||
body.removeClass('dark')
|
||||
dark = false
|
||||
}
|
||||
updateLocalStorage(dark)
|
||||
const event = new CustomEvent("ChangeColorMode", {detail: {dark: dark} });
|
||||
document.dispatchEvent(event);
|
||||
}
|
||||
function updateLocalStorage(dark) {
|
||||
localStorage.setItem('dark', dark)
|
||||
}
|
||||
|
||||
})(jQuery)
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
/*! jQuery Flex Tree 1.2.0 2020-08-19 */
|
||||
!function(a){var b="flexTree",c={};a.fn[b]=function(b){b=a.extend(!0,{id:void 0,targetElement:a(this),type:void 0,debug:!1,name:"flex_tree",items:{},className:"flex-tree",buildTree:!0,collapsed:!1,collapsable:!0,addControlOnParent:!0,threeState:!0},c,b),!1===b.collapsable&&(b.collapsed=!1),!1===b.addControlOnParent&&(b.threeState=!1);var d;if(b.buildTree){d=a("<ul/>").attr("class",b.className).attr("id",b.id);var e=function(b){b=a.extend(!0,{items:{},ul:d,collapsed:!1,collapsable:!0,addControlOnParent:!0,threeState:!0},b),a.each(b.items,function(c,d){if("object"==typeof d.childrens&&d.childrens.length){var f=a("<li/>");!b.addControlOnParent||"checkbox"!==b.type&&"radio"!==b.type||f.append(a("<input/>").attr("type",b.type).attr("name","radio"===b.type||!1===b.threeState?d.name||b.name:d.name).attr("name",d.name).attr("value",d.value).attr("class","node").attr("id",d.id).prop("checked",d.checked)),f.append(a('<span class="node"/> ').addClass(b.collapsable?b.collapsed?"open":"closed":"").append(a("<label/>").append(d.label).attr("class","node")));var g=a("<ul/>");b.ul.append(f),f.append(g),!0===b.collapsed&&g.hide(),e({items:d.childrens,name:b.name,ul:g,collapsed:b.collapsed,collapsable:b.collapsable,type:b.type,addControlOnParent:b.addControlOnParent,threeState:b.threeState})}else b.ul.append(a("<li/>").append(a("<label/>").append("undefined"!=typeof b.type?a("<input/>").attr("type",b.type).attr("name","checkbox"===b.type?d.name||b.name:b.name).attr("value",d.value).attr("class","leaf").attr("id",d.id).prop("checked",d.checked):void 0).append(d.label)))})};e(b),a(b.targetElement).append(d)}else d=b.targetElement,d.addClass(b.className);if(b.collapsable&&a("li span.node",d).on("click",function(b){a(this).toggleClass("closed").toggleClass("open").next().toggle(200)}),b.threeState&&"checkbox"===b.type){a('input[type="checkbox"].node',d).on("click",function(b){a(this).removeClass("indeterminate").prop("indeterminate",!1);var c=a(this);c.parent().find('ul input[type="checkbox"]').each(function(){a(this).prop("checked",c.prop("checked")).prop("indeterminate",!1).removeClass("indeterminate")})});var f=function(){var b=a(this).closest("ul").prevAll('input[type="checkbox"].node');if(b.length){a(this).prop("checked")||b.prop("checked",!1);var c=a(this).prop("checked"),d=a(this).prop("checked");a(this).closest("li").siblings("li").find("input:first").each(function(){a(this).prop("checked")&&!0!==a(this).prop("indeterminate")||(c=!1),(a(this).prop("checked")||!0===a(this).prop("indeterminate"))&&(d=!0)}),d||!0===a(this).prop("indeterminate")?b.addClass("indeterminate").prop("indeterminate",!0):b.removeClass("indeterminate").prop("indeterminate",!1),c&&b.prop("checked",!0).prop("indeterminate",!1).removeClass("indeterminate"),f.apply(b)}};a('input[type="checkbox"]',d).on("click",f),a('input[type="checkbox"].leaf',d).each(function(){f.apply(this)})}}}(jQuery);
|
||||
@@ -0,0 +1,528 @@
|
||||
|
||||
$(function () {
|
||||
var
|
||||
$table = $('#tree-table-1'),
|
||||
rows = $table.find('tr');
|
||||
|
||||
rows.each(function (index, row) {
|
||||
var
|
||||
$row = $(row),
|
||||
level = $row.data('level'),
|
||||
id = $row.data('id'),
|
||||
$columnName = $row.find('td[data-column="name"]'),
|
||||
children = $table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
var expander = $columnName.prepend('' +
|
||||
'<span class="treegrid-expander glyphicon glyphicon-chevron-right"></span>' +
|
||||
'');
|
||||
|
||||
children.hide();
|
||||
|
||||
expander.on('click', function (e) {
|
||||
var $target = $(e.target);
|
||||
if ($target.hasClass('glyphicon-chevron-right')) {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-right')
|
||||
.addClass('glyphicon-chevron-down');
|
||||
|
||||
children.show();
|
||||
} else {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
reverseHide($table, $row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$columnName.prepend('' +
|
||||
'<span class="treegrid-indent" style="width:' + 15 * level + 'px"></span>' +
|
||||
'');
|
||||
});
|
||||
|
||||
// Reverse hide all elements
|
||||
reverseHide = function (table, element) {
|
||||
var
|
||||
$element = $(element),
|
||||
id = $element.data('id'),
|
||||
children = table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
children.each(function (i, e) {
|
||||
reverseHide(table, e);
|
||||
});
|
||||
|
||||
$element
|
||||
.find('.glyphicon-chevron-down')
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
children.hide();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// table 2
|
||||
$(function () {
|
||||
var
|
||||
$table = $('#tree-table-2'),
|
||||
rows = $table.find('tr');
|
||||
|
||||
rows.each(function (index, row) {
|
||||
var
|
||||
$row = $(row),
|
||||
level = $row.data('level'),
|
||||
id = $row.data('id'),
|
||||
$columnName = $row.find('td[data-column="name"]'),
|
||||
children = $table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
var expander = $columnName.prepend('' +
|
||||
'<span class="treegrid-expander glyphicon glyphicon-plus"></span>' +
|
||||
'');
|
||||
|
||||
children.hide();
|
||||
|
||||
expander.on('click', function (e) {
|
||||
var $target = $(e.target);
|
||||
if ($target.hasClass('glyphicon-plus')) {
|
||||
$target
|
||||
.removeClass('glyphicon-plus')
|
||||
.addClass('glyphicon-minus');
|
||||
|
||||
children.show();
|
||||
} else {
|
||||
$target
|
||||
.removeClass('glyphicon-minus')
|
||||
.addClass('glyphicon-plus');
|
||||
|
||||
reverseHide($table, $row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$columnName.prepend('' +
|
||||
'<span class="treegrid-indent" style="width:' + 15 * level + 'px"></span>' +
|
||||
'');
|
||||
});
|
||||
|
||||
// Reverse hide all elements
|
||||
reverseHide = function (table, element) {
|
||||
var
|
||||
$element = $(element),
|
||||
id = $element.data('id'),
|
||||
children = table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
children.each(function (i, e) {
|
||||
reverseHide(table, e);
|
||||
});
|
||||
|
||||
$element
|
||||
.find('.glyphicon-chevron-down')
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
children.hide();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// table 3
|
||||
$(function () {
|
||||
var
|
||||
$table = $('#tree-table-3'),
|
||||
rows = $table.find('tr');
|
||||
|
||||
rows.each(function (index, row) {
|
||||
var
|
||||
$row = $(row),
|
||||
level = $row.data('level'),
|
||||
id = $row.data('id'),
|
||||
$columnName = $row.find('td[data-column="name"]'),
|
||||
children = $table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
var expander = $columnName.prepend('' +
|
||||
'<span class="treegrid-expander glyphicon glyphicon-chevron-right"></span>' +
|
||||
'');
|
||||
|
||||
children.hide();
|
||||
|
||||
expander.on('click', function (e) {
|
||||
var $target = $(e.target);
|
||||
if ($target.hasClass('glyphicon-chevron-right')) {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-right')
|
||||
.addClass('glyphicon-chevron-down');
|
||||
|
||||
children.show();
|
||||
} else {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
reverseHide($table, $row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$columnName.prepend('' +
|
||||
'<span class="treegrid-indent" style="width:' + 15 * level + 'px"></span>' +
|
||||
'');
|
||||
});
|
||||
|
||||
// Reverse hide all elements
|
||||
reverseHide = function (table, element) {
|
||||
var
|
||||
$element = $(element),
|
||||
id = $element.data('id'),
|
||||
children = table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
children.each(function (i, e) {
|
||||
reverseHide(table, e);
|
||||
});
|
||||
|
||||
$element
|
||||
.find('.glyphicon-chevron-down')
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
children.hide();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// table 4
|
||||
$(function () {
|
||||
var
|
||||
$table = $('#tree-table-4'),
|
||||
rows = $table.find('tr');
|
||||
|
||||
rows.each(function (index, row) {
|
||||
var
|
||||
$row = $(row),
|
||||
level = $row.data('level'),
|
||||
id = $row.data('id'),
|
||||
$columnName = $row.find('td[data-column="name"]'),
|
||||
children = $table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
var expander = $columnName.prepend('' +
|
||||
'<span class="treegrid-expander glyphicon glyphicon-chevron-right"></span>' +
|
||||
'');
|
||||
|
||||
children.hide();
|
||||
|
||||
expander.on('click', function (e) {
|
||||
var $target = $(e.target);
|
||||
if ($target.hasClass('glyphicon-chevron-right')) {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-right')
|
||||
.addClass('glyphicon-chevron-down');
|
||||
|
||||
children.show();
|
||||
} else {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
reverseHide($table, $row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$columnName.prepend('' +
|
||||
'<span class="treegrid-indent" style="width:' + 15 * level + 'px"></span>' +
|
||||
'');
|
||||
});
|
||||
|
||||
// Reverse hide all elements
|
||||
reverseHide = function (table, element) {
|
||||
var
|
||||
$element = $(element),
|
||||
id = $element.data('id'),
|
||||
children = table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
children.each(function (i, e) {
|
||||
reverseHide(table, e);
|
||||
});
|
||||
|
||||
$element
|
||||
.find('.glyphicon-chevron-down')
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
children.hide();
|
||||
}
|
||||
};
|
||||
});
|
||||
// table 5
|
||||
$(function () {
|
||||
var
|
||||
$table = $('#tree-table-5'),
|
||||
rows = $table.find('tr');
|
||||
|
||||
rows.each(function (index, row) {
|
||||
var
|
||||
$row = $(row),
|
||||
level = $row.data('level'),
|
||||
id = $row.data('id'),
|
||||
$columnName = $row.find('td[data-column="name"]'),
|
||||
children = $table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
var expander = $columnName.prepend('' +
|
||||
'<span class="treegrid-expander glyphicon glyphicon-chevron-right"></span>' +
|
||||
'');
|
||||
|
||||
children.hide();
|
||||
|
||||
expander.on('click', function (e) {
|
||||
var $target = $(e.target);
|
||||
if ($target.hasClass('glyphicon-chevron-right')) {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-right')
|
||||
.addClass('glyphicon-chevron-down');
|
||||
|
||||
children.show();
|
||||
} else {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
reverseHide($table, $row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$columnName.prepend('' +
|
||||
'<span class="treegrid-indent" style="width:' + 15 * level + 'px"></span>' +
|
||||
'');
|
||||
});
|
||||
|
||||
// Reverse hide all elements
|
||||
reverseHide = function (table, element) {
|
||||
var
|
||||
$element = $(element),
|
||||
id = $element.data('id'),
|
||||
children = table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
children.each(function (i, e) {
|
||||
reverseHide(table, e);
|
||||
});
|
||||
|
||||
$element
|
||||
.find('.glyphicon-chevron-down')
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
children.hide();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// table 6
|
||||
$(function () {
|
||||
var
|
||||
$table = $('#tree-table-6'),
|
||||
rows = $table.find('tr');
|
||||
|
||||
rows.each(function (index, row) {
|
||||
var
|
||||
$row = $(row),
|
||||
level = $row.data('level'),
|
||||
id = $row.data('id'),
|
||||
$columnName = $row.find('td[data-column="name"]'),
|
||||
children = $table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
var expander = $columnName.prepend('' +
|
||||
'<span class="treegrid-expander glyphicon glyphicon-chevron-right"></span>' +
|
||||
'');
|
||||
|
||||
children.hide();
|
||||
|
||||
expander.on('click', function (e) {
|
||||
var $target = $(e.target);
|
||||
if ($target.hasClass('glyphicon-chevron-right')) {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-right')
|
||||
.addClass('glyphicon-chevron-down');
|
||||
|
||||
children.show();
|
||||
} else {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
reverseHide($table, $row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$columnName.prepend('' +
|
||||
'<span class="treegrid-indent" style="width:' + 15 * level + 'px"></span>' +
|
||||
'');
|
||||
});
|
||||
|
||||
// Reverse hide all elements
|
||||
reverseHide = function (table, element) {
|
||||
var
|
||||
$element = $(element),
|
||||
id = $element.data('id'),
|
||||
children = table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
children.each(function (i, e) {
|
||||
reverseHide(table, e);
|
||||
});
|
||||
|
||||
$element
|
||||
.find('.glyphicon-chevron-down')
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
children.hide();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// table 7
|
||||
$(function () {
|
||||
var
|
||||
$table = $('#tree-table-7'),
|
||||
rows = $table.find('tr');
|
||||
|
||||
rows.each(function (index, row) {
|
||||
var
|
||||
$row = $(row),
|
||||
level = $row.data('level'),
|
||||
id = $row.data('id'),
|
||||
$columnName = $row.find('td[data-column="name"]'),
|
||||
children = $table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
var expander = $columnName.prepend('' +
|
||||
'<span class="treegrid-expander glyphicon glyphicon-chevron-right"></span>' +
|
||||
'');
|
||||
|
||||
children.hide();
|
||||
|
||||
expander.on('click', function (e) {
|
||||
var $target = $(e.target);
|
||||
if ($target.hasClass('glyphicon-chevron-right')) {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-right')
|
||||
.addClass('glyphicon-chevron-down');
|
||||
|
||||
children.show();
|
||||
} else {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
reverseHide($table, $row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$columnName.prepend('' +
|
||||
'<span class="treegrid-indent" style="width:' + 15 * level + 'px"></span>' +
|
||||
'');
|
||||
});
|
||||
|
||||
// Reverse hide all elements
|
||||
reverseHide = function (table, element) {
|
||||
var
|
||||
$element = $(element),
|
||||
id = $element.data('id'),
|
||||
children = table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
children.each(function (i, e) {
|
||||
reverseHide(table, e);
|
||||
});
|
||||
|
||||
$element
|
||||
.find('.glyphicon-chevron-down')
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
children.hide();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// table 8
|
||||
$(function () {
|
||||
var
|
||||
$table = $('#tree-table-8'),
|
||||
rows = $table.find('tr');
|
||||
|
||||
rows.each(function (index, row) {
|
||||
var
|
||||
$row = $(row),
|
||||
level = $row.data('level'),
|
||||
id = $row.data('id'),
|
||||
$columnName = $row.find('td[data-column="name"]'),
|
||||
children = $table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
var expander = $columnName.prepend('' +
|
||||
'<span class="treegrid-expander glyphicon glyphicon-chevron-right"></span>' +
|
||||
'');
|
||||
|
||||
children.hide();
|
||||
|
||||
expander.on('click', function (e) {
|
||||
var $target = $(e.target);
|
||||
if ($target.hasClass('glyphicon-chevron-right')) {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-right')
|
||||
.addClass('glyphicon-chevron-down');
|
||||
|
||||
children.show();
|
||||
} else {
|
||||
$target
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
reverseHide($table, $row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$columnName.prepend('' +
|
||||
'<span class="treegrid-indent" style="width:' + 15 * level + 'px"></span>' +
|
||||
'');
|
||||
});
|
||||
|
||||
// Reverse hide all elements
|
||||
reverseHide = function (table, element) {
|
||||
var
|
||||
$element = $(element),
|
||||
id = $element.data('id'),
|
||||
children = table.find('tr[data-parent="' + id + '"]');
|
||||
|
||||
if (children.length) {
|
||||
children.each(function (i, e) {
|
||||
reverseHide(table, e);
|
||||
});
|
||||
|
||||
$element
|
||||
.find('.glyphicon-chevron-down')
|
||||
.removeClass('glyphicon-chevron-down')
|
||||
.addClass('glyphicon-chevron-right');
|
||||
|
||||
children.hide();
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,488 @@
|
||||
var gdpData = {
|
||||
"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
|
||||
};
|
||||
$(function () {
|
||||
if(typeof $.fn.vectorMap !== typeof undefined && $('#world-map-gdp1').length > 0){
|
||||
$('#world-map-gdp1').vectorMap({
|
||||
map: 'world_mill',
|
||||
series: {
|
||||
regions: [{
|
||||
normalizeFunction: 'polynomial'
|
||||
}]
|
||||
},
|
||||
onRegionTipShow: function (e, el, code) {
|
||||
el.html(el.html() + ' (GDP - ' + gdpData[code] + ')');
|
||||
}
|
||||
});
|
||||
}
|
||||
if(typeof $.fn.vectorMap !== typeof undefined && $('#world-map-gdp').length > 0){
|
||||
$('#world-map-gdp').vectorMap({
|
||||
map: 'world_mill',
|
||||
series: {
|
||||
regions: [{
|
||||
values: gdpData,
|
||||
scale: ['#C8EEFF', '#0071A4'],
|
||||
normalizeFunction: 'polynomial'
|
||||
}]
|
||||
},
|
||||
onRegionTipShow: function (e, el, code) {
|
||||
el.html(el.html() + ' (GDP - ' + gdpData[code] + ')');
|
||||
}
|
||||
});
|
||||
}
|
||||
if(typeof $.fn.vectorMap !== typeof undefined && $('#world-map-markers') > 0){
|
||||
$('#world-map-markers').vectorMap({
|
||||
map: 'world_mill',
|
||||
scaleColors: ['#C8EEFF', '#0071A4'],
|
||||
normalizeFunction: 'polynomial',
|
||||
hoverOpacity: 0.7,
|
||||
hoverColor: false,
|
||||
markerStyle: {
|
||||
initial: {
|
||||
fill: '#F8E23B',
|
||||
stroke: '#383f47'
|
||||
}
|
||||
},
|
||||
backgroundColor: '#383f47',
|
||||
lines: [
|
||||
{ points: [[41.90, 12.45], [43.73, 7.41], [-0.52, 166.93]], text: "first road" },
|
||||
{ points: [[31.52, -87.37], [21.18, -157.49]], text: "second path" }
|
||||
],
|
||||
markers: [
|
||||
{ latLng: [41.90, 12.45], name: 'Vatican City' },
|
||||
{ latLng: [43.73, 7.41], name: 'Monaco' },
|
||||
{ latLng: [-0.52, 166.93], name: 'Nauru' },
|
||||
{ latLng: [-8.51, 179.21], name: 'Tuvalu' },
|
||||
{ latLng: [43.93, 12.46], name: 'San Marino' },
|
||||
{ latLng: [47.14, 9.52], name: 'Liechtenstein' },
|
||||
{ latLng: [7.11, 171.06], name: 'Marshall Islands' },
|
||||
{ latLng: [17.3, -62.73], name: 'Saint Kitts and Nevis' },
|
||||
{ latLng: [3.2, 73.22], name: 'Maldives' },
|
||||
{ latLng: [35.88, 14.5], name: 'Malta' },
|
||||
{ latLng: [12.05, -61.75], name: 'Grenada' },
|
||||
{ latLng: [13.16, -61.23], name: 'Saint Vincent and the Grenadines' },
|
||||
{ latLng: [13.16, -59.55], name: 'Barbados' },
|
||||
{ latLng: [17.11, -61.85], name: 'Antigua and Barbuda' },
|
||||
{ latLng: [-4.61, 55.45], name: 'Seychelles' },
|
||||
{ latLng: [7.35, 134.46], name: 'Palau' },
|
||||
{ latLng: [42.5, 1.51], name: 'Andorra' },
|
||||
{ latLng: [14.01, -60.98], name: 'Saint Lucia' },
|
||||
{ latLng: [6.91, 158.18], name: 'Federated States of Micronesia' },
|
||||
{ latLng: [1.3, 103.8], name: 'Singapore' },
|
||||
{ latLng: [1.46, 173.03], name: 'Kiribati' },
|
||||
{ latLng: [-21.13, -175.2], name: 'Tonga' },
|
||||
{ latLng: [15.3, -61.38], name: 'Dominica' },
|
||||
{ latLng: [-20.2, 57.5], name: 'Mauritius' },
|
||||
{ latLng: [26.02, 50.55], name: 'Bahrain' },
|
||||
{ latLng: [0.33, 6.73], name: 'São Tomé and Príncipe' }
|
||||
]
|
||||
});
|
||||
}
|
||||
})
|
||||
$(function () {
|
||||
var map,
|
||||
markers = [
|
||||
{ latLng: [52.50, 13.39], name: 'Berlin' },
|
||||
{ latLng: [53.56, 10.00], name: 'Hamburg' },
|
||||
{ latLng: [48.13, 11.56], name: 'Munich' },
|
||||
{ latLng: [50.95, 6.96], name: 'Cologne' },
|
||||
{ latLng: [50.11, 8.68], name: 'Frankfurt am Main' },
|
||||
{ latLng: [48.77, 9.17], name: 'Stuttgart' },
|
||||
{ latLng: [51.23, 6.78], name: 'Düsseldorf' },
|
||||
{ latLng: [51.51, 7.46], name: 'Dortmund' },
|
||||
{ latLng: [51.45, 7.01], name: 'Essen' },
|
||||
{ latLng: [53.07, 8.80], name: 'Bremen' }
|
||||
],
|
||||
cityAreaData = [
|
||||
887.70,
|
||||
755.16,
|
||||
310.69,
|
||||
405.17,
|
||||
248.31,
|
||||
207.35,
|
||||
217.22,
|
||||
280.71,
|
||||
210.32,
|
||||
325.42
|
||||
]
|
||||
if ($.fn.vectorMap !== undefined && $('#rusia-map').length > 0) {
|
||||
$('#rusia-map').vectorMap({
|
||||
map: 'de_merc',
|
||||
regionsSelectable: true,
|
||||
markersSelectable: true,
|
||||
markers: markers,
|
||||
markerStyle: {
|
||||
initial: {
|
||||
fill: '#4DAC26'
|
||||
},
|
||||
selected: {
|
||||
fill: '#CA0020'
|
||||
}
|
||||
},
|
||||
regionStyle: {
|
||||
initial: {
|
||||
fill: '#B8E186'
|
||||
},
|
||||
selected: {
|
||||
fill: '#F4A582'
|
||||
}
|
||||
},
|
||||
series: {
|
||||
markers: [{
|
||||
attribute: 'r',
|
||||
scale: [5, 15],
|
||||
values: cityAreaData
|
||||
}]
|
||||
},
|
||||
onRegionSelected: function () {
|
||||
if (window.localStorage) {
|
||||
window.localStorage.setItem(
|
||||
'jvectormap-selected-regions',
|
||||
JSON.stringify(map.getSelectedRegions())
|
||||
);
|
||||
}
|
||||
},
|
||||
onMarkerSelected: function () {
|
||||
if (window.localStorage) {
|
||||
window.localStorage.setItem(
|
||||
'jvectormap-selected-markers',
|
||||
JSON.stringify(map.getSelectedMarkers())
|
||||
);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
if ($.fn.vectorMap !== undefined && $('#legend-map').length > 0) {
|
||||
$('#legend-map').vectorMap({
|
||||
map: 'us_aea',
|
||||
markers: [
|
||||
[61.18, -149.53],
|
||||
[21.18, -157.49],
|
||||
[40.66, -73.56],
|
||||
[41.52, -87.37],
|
||||
[35.22, -80.84],
|
||||
[31.52, -87.37]
|
||||
],
|
||||
series: {
|
||||
markers: [{
|
||||
attribute: 'fill',
|
||||
scale: ['#C8EEFF', '#0071A4'],
|
||||
normalizeFunction: 'polynomial',
|
||||
values: [408, 512, 550, 781],
|
||||
legend: {
|
||||
vertical: true
|
||||
}
|
||||
}, {
|
||||
attribute: 'image',
|
||||
scale: {
|
||||
bank: '../assets/images/vectormap/icon-bank.png',
|
||||
factory: '../assets/images/vectormap/icon-factory.png'
|
||||
},
|
||||
values: {
|
||||
'4': 'bank',
|
||||
'5': 'factory'
|
||||
},
|
||||
legend: {
|
||||
horizontal: true,
|
||||
cssClass: 'jvectormap-legend-icons',
|
||||
title: 'Business type'
|
||||
}
|
||||
}],
|
||||
regions: [{
|
||||
scale: {
|
||||
red: '#ff0000',
|
||||
green: '#00ff00'
|
||||
},
|
||||
attribute: 'fill',
|
||||
values: {
|
||||
"US-KS": 'red',
|
||||
"US-MO": 'red',
|
||||
"US-IA": 'green',
|
||||
"US-NE": 'green'
|
||||
},
|
||||
legend: {
|
||||
horizontal: true,
|
||||
title: 'Color'
|
||||
}
|
||||
}, {
|
||||
scale: {
|
||||
redGreen: '../assets/images/vectormap/bg-red-green.png',
|
||||
yellowBlue: '../assets/images/vectormap/bg-yellow-blue.png'
|
||||
},
|
||||
values: {
|
||||
"US-TX": 'redGreen',
|
||||
"US-CA": 'yellowBlue'
|
||||
},
|
||||
attribute: 'fill',
|
||||
legend: {
|
||||
horizontal: true,
|
||||
cssClass: 'jvectormap-legend-bg',
|
||||
title: 'Pattern',
|
||||
labelRender: function (v) {
|
||||
return {
|
||||
redGreen: 'low',
|
||||
yellowBlue: 'high'
|
||||
}[v];
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
var plants = [
|
||||
{ name: 'VAK', coords: [50.0091294, 9.0371812], status: 'closed', offsets: [0, 2] },
|
||||
{ name: 'MZFR', coords: [49.0543102, 8.4825862], status: 'closed', offsets: [0, 2] },
|
||||
{ name: 'AVR', coords: [50.9030599, 6.4213693], status: 'closed' },
|
||||
{ name: 'KKR', coords: [53.1472465, 12.9903674], status: 'closed' },
|
||||
{ name: 'KRB', coords: [48.513264, 10.4020357], status: 'activeUntil2018' },
|
||||
{ name: 'KWO', coords: [49.364503, 9.076252], status: 'closed' },
|
||||
{ name: 'KWL', coords: [52.5331853, 7.2505223], status: 'closed', offsets: [0, -2] },
|
||||
{ name: 'HDR', coords: [50.1051446, 8.9348691], status: 'closed', offsets: [0, -2] },
|
||||
{ name: 'KKS', coords: [53.6200685, 9.5306289], status: 'closed' },
|
||||
{ name: 'KKN', coords: [48.6558015, 12.2500848], status: 'closed', offsets: [0, -2] },
|
||||
{ name: 'KGR', coords: [54.1417497, 13.6583877], status: 'closed' },
|
||||
{ name: 'KWB', coords: [49.709331, 8.415865], status: 'closed' },
|
||||
{ name: 'KWW', coords: [51.6396481, 9.3915617], status: 'closed' },
|
||||
{ name: 'GKN', coords: [49.0401151, 9.1721088], status: 'activeUntil2022' },
|
||||
{ name: 'KKB', coords: [53.8913533, 9.2005777], status: 'closed', offsets: [0, -5] },
|
||||
{ name: 'KKI', coords: [48.5544748, 12.3472095], status: 'activeUntil2022', offsets: [0, 2] },
|
||||
{ name: 'KKU', coords: [53.4293465, 8.4774649], status: 'closed' },
|
||||
{ name: 'KNK', coords: [49.1473279, 8.3827739], status: 'closed' },
|
||||
{ name: 'KKP', coords: [49.2513078, 8.4356761], status: 'activeUntil2022', offsets: [0, -2] },
|
||||
{ name: 'KKG', coords: [49.9841308, 10.1846373], status: 'activeUntil2018' },
|
||||
{ name: 'KKK', coords: [53.4104656, 10.4091597], status: 'closed' },
|
||||
{ name: 'KWG', coords: [52.0348748, 9.4097793], status: 'activeUntil2022' },
|
||||
{ name: 'KBR', coords: [53.850666, 9.3457603], status: 'closed', offsets: [0, 5] },
|
||||
{ name: 'KMK', coords: [50.408791, 7.4861956], status: 'closed' },
|
||||
{ name: 'THTR', coords: [51.6786228, 7.9700232], status: 'closed' },
|
||||
{ name: 'KKE', coords: [52.4216974, 7.3706389], status: 'activeUntil2022', offsets: [0, 2] }
|
||||
];
|
||||
if ($.fn.vectorMap !== undefined && $('#icon-map').length > 0) {
|
||||
$('#icon-map').vectorMap({
|
||||
map: 'de_merc',
|
||||
markers: plants.map(function (h) { return { name: h.name, latLng: h.coords } }),
|
||||
labels: {
|
||||
markers: {
|
||||
render: function (index) {
|
||||
return plants[index].name;
|
||||
},
|
||||
offsets: function (index) {
|
||||
var offset = plants[index]['offsets'] || [0, 0];
|
||||
|
||||
return [offset[0] - 7, offset[1] + 3];
|
||||
}
|
||||
}
|
||||
},
|
||||
series: {
|
||||
markers: [{
|
||||
attribute: 'image',
|
||||
scale: {
|
||||
'closed': '../assets/images/vectormap/icon-np-3.png',
|
||||
'activeUntil2018': '../assets/images/vectormap/icon-np-2.png',
|
||||
'activeUntil2022': '../assets/images/vectormap/icon-np-1.png'
|
||||
},
|
||||
values: plants.reduce(function (p, c, i) { p[i] = c.status; return p }, {}),
|
||||
legend: {
|
||||
horizontal: true,
|
||||
title: 'Nuclear power station status',
|
||||
labelRender: function (v) {
|
||||
return {
|
||||
closed: 'Closed',
|
||||
activeUntil2018: 'Scheduled for shut down<br> before 2018',
|
||||
activeUntil2022: 'Scheduled for shut down<br> before 2022'
|
||||
}[v];
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user