Skip to content

Commit

Permalink
Restore original proportions tool and bug fixes (#274)
Browse files Browse the repository at this point in the history
* sdf

* implement restore function

* Fix coordinates bug

* Update README demos

* create ImageUtil file

* sfd

* cleanup

* Cleanup 2

* Cleanup 3

* test cleanup

* sdgh

* Implement svg

* Accessibility

* add opacity full

* Optimize svgs

* refactor

* Stop creating new toolbar instances

* refactor

* Refactor pt.2

* Refactoring 3

* Refactor 3

* commit

* readme

* Add xlink for safari 7 support

* correct polyfill usage confirmed

* update restore icon to filled icon

* Icon normalization

* Readme

* remove useless css

* Toolbar documentation updates

* doc updates

* docs

* refactor

* README icon ref

* version bump

* README format

* update polyfill comment

* Update Gruntfile compile command

* add svgo minifier

* update wikis

* remove commented lines

* Remove trailing commas

* undo version bump

* Fix capitalization
  • Loading branch information
sashadev-sky authored Jun 27, 2019
1 parent c2bf3de commit 83e3371
Show file tree
Hide file tree
Showing 56 changed files with 4,020 additions and 2,325 deletions.
214 changes: 131 additions & 83 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,99 +3,145 @@ 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"
}
},

// Minify SVGs from svg directory, output to svg-min
svgmin: {
dist: {
files: [
{
attrs: "fill",
expand: true,
cwd: "assets/icons/svg",
src: ["*.svg"],
dest: "assets/icons/svg-min/",
ext: ".svg"
}
]
},
options: {
plugins: [
{ removeViewBox: false },
{ removeEmptyAttrs: false },
{ removeTitle: true } // addtitle will add it back in later
]
}
},

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

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. */
Expand All @@ -107,6 +153,8 @@ module.exports = function(grunt) {
grunt.registerTask('build', [
'jshint',
'karma:development:start',
'svgmin',
'svg_sprite',
'coverage',
'concat:dist'
]);
Expand Down
Loading

0 comments on commit 83e3371

Please sign in to comment.