提交 a20750bf 编写于 作者: C codecalm 提交者: Alex Safian

jqvmap plugin, ui fixes

上级 d3299d42
......@@ -2,7 +2,9 @@ const libs = require('../pages/_data/libs'),
path = require('path'),
{ exec } = require('child_process');
libs.forEach(function (lib) {
const all_libs = libs.js.concat(libs.css);
all_libs.forEach(function (lib) {
let dirname = path.dirname(lib);
let cmd = `mkdir -p "dist/libs/${dirname}" && cp -r node_modules/${lib} dist/libs/${lib}`;
exec(cmd)
......
......@@ -134,7 +134,6 @@ $(document).ready(function() {
(function() {
const elements = document.querySelectorAll('[data-toggle="autosize"]');
console.log('elements.length', elements.length);
if (elements.length) {
elements.forEach(function(element) {
console.log('1', element);
......
[
"jquery/dist/jquery.min.js",
"bootstrap/dist/js/bootstrap.bundle.min.js",
"autosize/dist/autosize.min.js",
"imask/dist/imask.min.js",
"selectize/dist/js/standalone/selectize.min.js",
"apexcharts/dist/apexcharts.min.js",
"peity/jquery.peity.min.js"
]
{
"js": [
"jquery/dist/jquery.min.js",
"bootstrap/dist/js/bootstrap.bundle.min.js",
"autosize/dist/autosize.min.js",
"imask/dist/imask.min.js",
"selectize/dist/js/standalone/selectize.min.js",
"apexcharts/dist/apexcharts.min.js",
"jqvmap/dist/jquery.vmap.min.js",
"jqvmap/dist/maps/jquery.vmap.world.js",
"jqvmap/dist/maps/jquery.vmap.usa.js",
"jqvmap/dist/maps/continents/jquery.vmap.europe.js",
"peity/jquery.peity.min.js"
],
"css": [
"jqvmap/dist/jqvmap.min.css"
]
}
world:
map: "world_en"
backgroundColor: 'transparent'
borderColor: '#ffffff'
borderWidth: 0.25
borderOpacity: 0.25
color: 'rgba(120,130,140, 0.1)'
enableZoom: false
showTooltip: true
selectedColor: null
hoverColor: 'red'
title: World map
map: world_en
france:
map: 'france_fr'
backgroundColor: 'transparent'
borderColor: '#ffffff'
borderWidth: 0.25
borderOpacity: 0.25
color: 'rgba(120,130,140, 0.1)'
enableZoom: false
showTooltip: true
selectedColor: null
hoverColor: null
\ No newline at end of file
europe:
title: Map of Europe
map: europe_en
zoom: true
usa:
title: Map of USA
map: usa_en
<script>
$(document).ready(function () {
$(`#{{ include.id }}`).each(function () {
$(this).vectorMap(
{
map: `{{ include.data[1].map }}`,
backgroundColor: `{{ include.data[1].backgroundColor }}`,
borderColor: `{{ include.data[1].borderColor }}`,
borderWidth: `{{ include.data[1].borderWidth }}`,
borderOpacity: `{{ include.data[1].borderOpacity }}`,
color: `{{ include.data[1].color}}`,
enableZoom: `{{ include.data[1].enableZoom}}`,
showTooltip: `{{ include.data[1].showTooltip}}`,
selectedColor: `{{ include.data[1].selectedColor}}`,
hoverColor: `{{ include.data[1].hoverColor}}`
}
);
$('#{{ include.id }}').each(function () {
$(this).vectorMap({
map: '{{ include.data[1].map }}'
});
});
})
</script>
\ No newline at end of file
</script>
{% if site.data.libs %}
<!-- Libs CSS -->
{% for lib in site.data.libs.css %}
<link href="{{ site.base }}/{% if jekyll.environment == 'production' %}dist/libs{% else %}node_modules{% endif %}/{{ lib }}?{{ site.time | date: '%s' }}" rel="stylesheet" />
{% endfor %}
{% endif %}
<!-- Tabler Core -->
<link href="{{ site.base }}/dist/css/tabler.css?{{ site.time | date: '%s' }}" rel="stylesheet" />
<!-- Tabler Plugins -->
<link href="{{ site.base }}/dist/css/tabler-flags.css?{{ site.time | date: '%s' }}" rel="stylesheet" />
<link href="{{ site.base }}/dist/css/tabler-charts.css?{{ site.time | date: '%s' }}" rel="stylesheet" />
......@@ -4,15 +4,15 @@
};
</script>
<!-- Libs JS -->
{% for lib in site.data.libs %}
<script src="{{ site.base }}/{% if jekyll.environment == 'production' %}dist/libs{% else %}node_modules{% endif %}/{{ lib }}?{{ site.time | date: '%s' }}"></script>
{% endfor %}
{% if site.data.libs %}
<!-- Libs JS -->
{% for lib in site.data.libs.js %}
<script src="{{ site.base }}/{% if jekyll.environment == 'production' %}dist/libs{% else %}node_modules{% endif %}/{{ lib }}?{{ site.time | date: '%s' }}"></script>
{% endfor %}
{% endif %}
<!-- Tabler Core -->
<script src="{{ site.base }}/dist/js/tabler{% if jekyll.environment == 'production' %}.min{% endif %}.js?{{ site.time | date: '%s' }}"></script>
<!-- Tabler Plugins -->
<script src="{{ site.base }}/dist/js/tabler-charts{% if jekyll.environment == 'production' %}.min{% endif %}.js?{{ site.time | date: '%s' }}"></script>
{% assign id = include.map %}
{% assign height = include.height | default: 20 %}
{% assign data = site.data.maps[id] %}
{% if data %}
<div id="map-{{ id }}" style="height: {{ height }}rem"></div>
<script>
$(document).ready(function () {
$('#map-{{ id }}').vectorMap({
map: '{{ data.map }}',
backgroundColor: 'transparent',
color: 'rgba(120, 130, 140, .1)',
borderColor: 'transparent'
{% if data.zoom %}enableZoom: true,{% endif %}
});
});
</script>
{% endif %}
......@@ -26,9 +26,11 @@
<meta name="description" content="{{ page.description | escape }}"/>
{% endif %}
{% include layout/css.html %}
{% include layout/og.html %}
{% include layout/css.html %}
{% include layout/js.html %}
<style>body { display: none; }</style>
</head>
<body
......@@ -42,7 +44,6 @@
{% endif %}
{% endif %}
{% include layout/js.html %}
<script>document.body.style.display = 'block';</script>
</body>
</html>
......@@ -3,13 +3,16 @@ title: Maps
page-title: Maps
---
<div class="row">
{% for map in site.data.maps %}
<div class="col-lg-6">
{% for map in site.data.maps %}
{% assign title = map[0] %}
{% assign key = 'map-' | append: title %}
<div id="{{ key }}" style="height: 600px;"></div>
{% include js/maps.html id=key data=map %}
{% endfor %}
<div class="card">
<div class="card-body">
{% assign id = map[0] %}
{% include ui/map.html map=id %}
</div>
</div>
</div>
{% endfor %}
</div>
......@@ -50,6 +50,7 @@
@import "vendor/pace";
@import "vendor/selectize";
@import "vendor/jqvmap";
@import "utils/border";
@import "utils/background";
......
.jqvmap-zoomin,
.jqvmap-zoomout {
@extend .btn;
@extend .btn-sm;
@extend .btn-secondary;
height: auto;
width: auto;
left: .5rem;
}
.jqvmap-zoomin {
top: .5rem;
}
.jqvmap-zoomout {
top: 2rem;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册