Skip to content

Commit

Permalink
Merge pull request #34 from fupduck/enhancement/gh-pages-grunt
Browse files Browse the repository at this point in the history
use grunt to update gh-pages
  • Loading branch information
dwilhelm89 authored Sep 14, 2017
2 parents 35a3278 + 474fde2 commit e44a25b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 162 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules/
.idea/
package-lock.json
.grunt
18 changes: 17 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,26 @@ module.exports = function(grunt) {
'dist/css/Leaflet.StyleEditor.min.css': ['src/css/Leaflet.StyleEditor.css']
}
}
}
},

'gh-pages': {
options: {
base: 'dist',
only: [
'javascript/Leaflet.StyleEditor.min.js',
'css/Leaflet.StyleEditor.min.css'
]
},
src: [
'javascript/Leaflet.StyleEditor.min.js',
'css/Leaflet.StyleEditor.min.css'
]
},
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-gh-pages');

grunt.registerTask('default', ['concat', 'uglify', 'cssmin']);
};
85 changes: 0 additions & 85 deletions dist/index.html

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"grunt": "~1.x",
"grunt-contrib-concat": "~1.x",
"grunt-contrib-uglify": "git://github.com/gruntjs/grunt-contrib-uglify.git#harmony",
"grunt-contrib-cssmin": "~2.x"
"grunt-contrib-cssmin": "~2.x",
"grunt-gh-pages": "~2.x"
},
"repository": {
"type": "git",
Expand Down
75 changes: 0 additions & 75 deletions src/index_min.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.1.0/leaflet.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.1.0/leaflet.css" />

<!-- bootstrap - optional - needed for glyphicon markers -->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />

<!-- L.StyleEditor source files -->
<script src="../dist/javascript/Leaflet.StyleEditor.min.js"></script>
<link rel="stylesheet" href="../dist/css/Leaflet.StyleEditor.min.css" />
Expand Down Expand Up @@ -112,74 +105,6 @@
console.log(element);
});
</script>
<div id="map2"></div>
<script>
var map = L.map('map2').setView([20, -40], 3);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

// initialize the StyleEditor
map.addControl(L.control.styleEditor({
position: "topleft",
markerType: L.StyleEditor.marker.GlyphiconMarker
}));

// some random geometries to test (marker, polygon, polyline, geoJSON)
L.marker([51.5, -0.09]).addTo(map);

L.polyline([
[0, 0],
[30, 30],
[0, 20]
]).addTo(map);

L.polygon([
[49, -100],
[60, -120],
[70, -90]
]).addTo(map);

L.polygon([
[-45, 64.92354174306496],
[-45, 70.61261423801925],
[-22.148437499999996, 70.61261423801925],
[-22.148437499999996, 64.92354174306496],
[-45, 64.92354174306496]
]).addTo(map);

L.geoJson([{
"type": "Feature",
"properties": {"party": "Republican"},
"geometry": {
"type": "Polygon",
"coordinates": [[
[-104.05, 48.99],
[-97.22, 48.98],
[-96.58, 45.94],
[-104.03, 45.94],
[-104.05, 48.99]
]]
}
}], {
style: function(feature) {
switch (feature.properties.party) {
case 'Republican': return {color: "#ff0000"};
}
}
}).addTo(map);

var littleton = L.marker([39.61, -105.02]).bindPopup('This is Littleton, CO.'),
denver = L.marker([39.74, -104.99]).bindPopup('This is Denver, CO.'),
aurora = L.marker([39.73, -104.8]).bindPopup('This is Aurora, CO.'),
golden = L.marker([39.77, -105.23]).bindPopup('This is Golden, CO.');

var cities = L.layerGroup([littleton, denver, aurora, golden]).addTo(map);

map.on('styleeditor:changed', function(element){
console.log(element);
});
</script>
</body>

</html>

0 comments on commit e44a25b

Please sign in to comment.