Skip to content

Commit

Permalink
Implement svg
Browse files Browse the repository at this point in the history
  • Loading branch information
sashadev-sky committed Jun 18, 2019
1 parent c7755dd commit 16241dd
Show file tree
Hide file tree
Showing 21 changed files with 1,987 additions and 285 deletions.
227 changes: 141 additions & 86 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,112 +3,167 @@ module.exports = function(grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

jshint: {
options: {
node: true,
browser: true,
esnext: true,
bitwise: true,
curly: true,
eqeqeq: true,
immed: true,
indent: 4,
latedef: true,
newcap: true,
noarg: true,
regexp: true,
undef: true,
unused: 'strict',
trailing: true,
smarttabs: true,
globals: {
L: false,
$: false,
LeafletToolbar: false,
warpWebGl: false,
EXIF: false,
alert: false,

// Mocha

describe: false,
it: false,
before: false,
after: false,
beforeEach: false,
afterEach: false,
chai: false,
expect: false,
sinon: false
}
},
source: {
src: [ 'src/**/*.js', 'package.json' ]
},
grunt: {
src: [ 'Gruntfile.js' ]
}
pkg: grunt.file.readJSON("package.json"),

jshint: {
options: {
node: true,
browser: true,
esnext: true,
bitwise: true,
curly: true,
eqeqeq: true,
immed: true,
indent: 4,
latedef: true,
newcap: true,
noarg: true,
regexp: true,
undef: true,
unused: "strict",
trailing: true,
smarttabs: true,
globals: {
L: false,
$: false,
LeafletToolbar: false,
warpWebGl: false,
EXIF: false,
alert: false,

// Mocha

describe: false,
it: false,
before: false,
after: false,
beforeEach: false,
afterEach: false,
chai: false,
expect: false,
sinon: false
}
},
source: {
src: ["src/**/*.js", "package.json"]
},
grunt: {
src: ["Gruntfile.js"]
}
},

karma: {
development: {
configFile: 'test/karma.conf.js',
},
test: {
configFile: 'test/karma.conf.js',
}
karma: {
development: {
configFile: "test/karma.conf.js"
},
test: {
configFile: "test/karma.conf.js"
}
},

watch: {
options : {
livereload: true
svg_sprite: {
options: {
// Task-specific options go here.
},
dist: {
expand: true,
cwd: "assets/",
src: ["icons/*.svg"],
dest: "assets/icons/",
options: {
dest: "assets/icons/",
log: "debug",
svg: {
dimensionAttributes: false
},
source: {
files: [
'src/**/*.js',
'test/**/*.js',
'Gruntfile.js'
],
tasks: [ 'build:js' ]
shape: {
dimension: {
maxWidth: 18,
maxHeight: 18,
attributes: true
},
// viewBox: "0 0 18 18",
// dest: "svg-sprite"
},
mode: {
render: {
css: true
},
symbol: {
sprite: "sprite.symbol.svg",
// viewBox: "0 0 18 18",
// inline: true,
example: true
}
}
}
}
},

// svgstore: {
// options: {
// prefix: "icon-", // This will prefix each ID
// svg: {
// // will add and overide the the default xmlns="http://www.w3.org/2000/svg" attribute to the resulting SVG
// viewBox: "0 0 18 18",
// xmlns: "http://www.w3.org/2000/svg"
// }
// },
// your_target: {
// symbol: true,
// inline: true,
// formatting: {
// indent_size: 2
// }
// // Target-specific file lists and/or options go here.
// }
// },

watch: {
options: {
livereload: true
},
source: {
files: ["src/**/*.js", "test/**/*.js", "Gruntfile.js"],
tasks: ["build:js"]
}
},

concat: {
dist: {
src: [
'src/util/*.js',
'src/DistortableImageOverlay.js',
'src/DistortableCollection.js',
'src/edit/getEXIFdata.js',
'src/edit/EditHandle.js',
'src/edit/LockHandle.js',
'src/edit/DistortHandle.js',
'src/edit/RotateScaleHandle.js',
'src/edit/RotateHandle.js',
'src/edit/ScaleHandle.js',
'src/edit/DistortableImage.EditToolbar.js',
'src/edit/DistortableImage.Edit.js',
'src/edit/tools/DistortableImage.Keymapper.js',
'src/edit/BoxSelectHandle.js'
],
dest: 'dist/leaflet.distortableimage.js',
}
concat: {
dist: {
src: [
"src/util/*.js",
"src/DistortableImageOverlay.js",
"src/DistortableCollection.js",
"src/edit/getEXIFdata.js",
"src/edit/EditHandle.js",
"src/edit/LockHandle.js",
"src/edit/DistortHandle.js",
"src/edit/RotateScaleHandle.js",
"src/edit/RotateHandle.js",
"src/edit/ScaleHandle.js",
"src/edit/DistortableImage.EditToolbar.js",
"src/edit/DistortableImage.Edit.js",
"src/edit/tools/DistortableImage.Keymapper.js",
"src/edit/BoxSelectHandle.js"
],
dest: "dist/leaflet.distortableimage.js"
}
}
});

/* Run tests once. */
grunt.registerTask('test', [ 'jshint', 'karma:test' ]);

/* Default (development): Watch files and lint, test, and build on change. */
grunt.registerTask('default', ['karma:development:start', 'watch']);
grunt.registerTask('default', ['svg_sprite', 'karma:development:start', 'watch',]);

grunt.registerTask('build', [
'jshint',
'karma:development:start',
'svg_sprite',
'coverage',
'concat:dist'
'concat:dist',
]);

grunt.registerTask('coverage', 'Custom commmand-line reporter for karma-coverage', function() {
Expand Down
6 changes: 6 additions & 0 deletions assets/icons/border_clear.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/border_outer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/crop_rotate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/icons/delete_forever.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/explore.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/flip_to_back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/flip_to_front.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/get_app.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/icons/lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/opacity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/restore.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 16241dd

Please sign in to comment.