[mod] simple theme: leaflet becomes a packages.json dependency

the build of the themes updates:
* js/leaflet.js ( was leaflet/leaflet.js )
* css/leaflet.css ( was leaflet/leaflet.css )
* css/images ( was leaflet/images )
This commit is contained in:
Alexandre Flament 2021-06-16 10:31:11 +02:00
parent 6288b549e2
commit b4a47cacd8
15 changed files with 39 additions and 3 deletions

View File

@ -23,6 +23,41 @@ module.exports = function(grunt) {
} }
} }
}, },
copy: {
js: {
expand: true,
cwd: './node_modules',
dest: './js/',
flatten: true,
filter: 'isFile',
timestamp: true,
src: [
'./leaflet/dist/leaflet.js',
]
},
css: {
expand: true,
cwd: './node_modules',
dest: './css/',
flatten: true,
filter: 'isFile',
timestamp: true,
src: [
'./leaflet/dist/leaflet.css',
]
},
leaflet_images: {
expand: true,
cwd: './node_modules',
dest: './css/images/',
flatten: true,
filter: 'isFile',
timestamp: true,
src: [
'./leaflet/dist/images/*.png',
]
},
},
concat: { concat: {
head_and_body: { head_and_body: {
options: { options: {
@ -149,6 +184,7 @@ module.exports = function(grunt) {
}); });
grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-concat');
@ -158,5 +194,5 @@ module.exports = function(grunt) {
grunt.registerTask('test', ['jshint']); grunt.registerTask('test', ['jshint']);
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'less:development', 'less:production']); grunt.registerTask('default', ['jshint', 'copy', 'concat', 'uglify', 'less:development', 'less:production']);
}; };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

View File

@ -31,8 +31,8 @@
var map_boundingbox = JSON.parse(this.dataset.mapBoundingbox); var map_boundingbox = JSON.parse(this.dataset.mapBoundingbox);
var map_geojson = JSON.parse(this.dataset.mapGeojson); var map_geojson = JSON.parse(this.dataset.mapGeojson);
searx.loadStyle('leaflet/leaflet.css'); searx.loadStyle('css/leaflet.css');
searx.loadScript('leaflet/leaflet.js', function() { searx.loadScript('js/leaflet.js', function() {
var map_bounds = null; var map_bounds = null;
if(map_boundingbox) { if(map_boundingbox) {
var southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]); var southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]);