Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjbradshaw committed Jun 11, 2015
2 parents 393fb81 + 6c7868c commit 71d7e2a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 18 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Image Map Resize
[![Bower version](https://badge.fury.io/bo/image-map-resizer.svg)](http://badge.fury.io/bo/image-map-resizer)
[![npm version](https://badge.fury.io/js/image-map-resizer.svg)](http://badge.fury.io/js/image-map-resizer)
[![Code Climate](https://codeclimate.com/github/davidjbradshaw/image-map-resizer/badges/gpa.svg)](https://codeclimate.com/github/davidjbradshaw/image-map-resizer)
![license](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)


Expand All @@ -10,7 +11,7 @@

### Native JS Usage

Inclue the [imageMapResizer.min.js](https://raw.github.com/davidjbradshaw/imagemap-resizer/master/js/imageMapResizer.min.js) srcipt then add the following call to the bottom of your page:
Inclued the [imageMapResizer.min.js](https://raw.github.com/davidjbradshaw/imagemap-resizer/master/js/imageMapResizer.min.js) script then add the following call to the bottom of your page:

```js
imageMapResize([selector || map object]);
Expand Down
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "imageMap-resizer",
"version": "0.5.3",
"homepage": "https://github.com/davidjbradshaw/imagemap-resizer",
"name": "image-map-resizer",
"version": "0.5.4",
"homepage": "https://github.com/davidjbradshaw/image-map-resizer",
"authors": [
"David J. Bradshaw <[email protected]>"
],
Expand Down
2 changes: 1 addition & 1 deletion gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ module.exports = function(grunt) {
grunt.registerTask('notest', ['jshint','uglify']);
grunt.registerTask('test', ['jshint','qunit']);

grunt.registerTask('postBump',['git bump-commit','shell']);
grunt.registerTask('postBump',['bump-commit','shell']);
grunt.registerTask('patch', ['default','bump-only:patch','postBump']);
grunt.registerTask('minor', ['default','bump-only:minor','postBump']);
grunt.registerTask('major', ['default','bump-only:major','postBump']);
Expand Down
8 changes: 4 additions & 4 deletions imageMapResizer.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"resize",
"design"
],
"version": "0.5.3",
"version": "0.5.4",
"author": {
"name": "David J. Bradshaw",
"email": "[email protected]"
Expand All @@ -28,9 +28,9 @@
"url": "https://github.com/jquery/jquery-color/blob/2.1.2/MIT-LICENSE.txt"
}
],
"bugs": "https://github.com/davidjbradshaw/imagemap-resizer/issues",
"homepage": "http://davidjbradshaw.github.io/imagemap-resizer/",
"docs": "https://github.com/davidjbradshaw/imagemap-resizer",
"bugs": "https://github.com/davidjbradshaw/image-map-resizer/issues",
"homepage": "http://davidjbradshaw.github.io/image-map-resizer/",
"docs": "https://github.com/davidjbradshaw/image-map-resizer",
"dependencies": {
"jquery": ">=1.0"
}
Expand Down
17 changes: 16 additions & 1 deletion js/imageMapResizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,27 @@
}

function start(){
var
displayedWidth = null,
displayedHeight = null;

//WebKit asyncs image loading, so we have to catch the load event.
sourceImage.onload = function sourceImageOnLoadF(){
if ((displayedImage.width !== sourceImage.width) || (displayedImage.height !== sourceImage.height)) {
displayedWidth = displayedImage.width;
displayedHeight = displayedImage.height;

if ((displayedWidth !== sourceImage.width) || (displayedHeight !== sourceImage.height)) {
resizeMap();
}
};

//IE11 can late load this image, so make sure we have the correct sizes (#10)
displayedImage.onload = function() {
if (null !== displayedWidth && displayedImage.width !== displayedWidth) {
resizeMap();
}
};

//Make copy of image, so we can get the actual size measurements
sourceImage.src = displayedImage.src;
}
Expand Down
2 changes: 1 addition & 1 deletion js/imageMapResizer.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions js/imageMapResizer.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "imageMap_Resizer",
"version": "0.5.3",
"name": "image-map-resizer",
"version": "0.5.4",
"repository": {
"type": "git",
"url": "https://github.com/davidjbradshaw/imagemap-resizer.git"
"url": "https://github.com/davidjbradshaw/image-map-resizer.git"
},
"maintainers": [
{
Expand All @@ -14,9 +14,9 @@
"description": "Make the HTML image map responsive, so the map scales with the image",
"repository": {
"type": "git",
"url": "https://github.com/davidjbradshaw/imagemap-resizer.git"
"url": "https://github.com/davidjbradshaw/image-map-resizer.git"
},
"github": "https://github.com/davidjbradshaw/imagemap-resizer",
"github": "https://github.com/davidjbradshaw/image-map-resizer",
"dependencies": {},
"devDependencies": {
"grunt": "0.4.1",
Expand Down

0 comments on commit 71d7e2a

Please sign in to comment.