Skip to content

Commit

Permalink
Update to work with imgViewer 0.7
Browse files Browse the repository at this point in the history
Add zoomable option to disable zooming
Updated Grunfile.js to include tests against latest version (2.1.0) of jQuery.
  • Loading branch information
waynegm committed Jun 19, 2014
1 parent 59d9e8c commit 1ed269c
Show file tree
Hide file tree
Showing 18 changed files with 271 additions and 68 deletions.
6 changes: 6 additions & 0 deletions .directory
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Dolphin]
Timestamp=2013,6,9,21,16,48
Version=3

[Settings]
HiddenFilesShown=true
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ module.exports = function(grunt) {
options: {
urls: (function() {
var res = [];
['2.0.1', '1.10.0', '1.9.1', '1.8.3' ].forEach( function(jqversion) {
['1.10.3', '1.9.2', '1.8.24'].forEach( function(uiversion) {
['2.1.0', '2.0.3', '1.10.2', '1.9.1', '1.8.3' ].forEach( function(jqversion) {
['1.10.4', '1.9.2', '1.8.24'].forEach( function(uiversion) {
this.push('http://localhost:<%= connect.server.options.port %>/test/imgNotes.html?jquery=' + jqversion + '&jquery-ui=' + uiversion);
}, this);
}, res);
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ The plugin is known to work with the configuration described below:
* [jQuery](http://jquery.com/) (>=1.8)
* [jQuery UI](http://jqueryui.com/) (>=1.8)
* [Widget Factory](http://api.jqueryui.com/jQuery.widget/)
* [jQuery Mousewheel](http://brandonaaron.net/code/mousewheel/docs) (>=3.0)
* [jQuery imgViewer](https://github.com/waynegm/imgViewer) (>=0.6.0)
* [toe.js](https://github.com/visiongeist/toe.js) (>=3.0)
* [Zoetrope](https://github.com/benplum/Zoetrope) (>=3.0)
* [jQuery imgViewer](https://github.com/waynegm/imgViewer) (>=0.7.0)

## Usage

Expand All @@ -34,7 +35,8 @@ Include either the development version or minified production version of the JS
...
<script src="jquery.js"></script>
<script src="jquery-ui.js"></script>
<script src="jquery.mousewheel.js"></script>
<script src="jquery.fs.zoetrope.min.js"></script>
<script src="toe.min.js"></script>
<script src="imgViewer.min.js"></script>
<script src="imgNotes.min.js"></script>
...
Expand Down Expand Up @@ -107,6 +109,15 @@ $("#image1").imgNotes("option", "zoomStep", 0.05);
$("#image1").imgNotes("option", "zoom", 3);
```

###zoomable
* Controls if image will be zoomable
* Default: true
* Example - to disble image zooming:

```javascript
$("#image1").imgNotes("option", "zoomable", false);
```

###onAdd
* Callback triggered when a marker/note is added to the widget to allow developers to define their own markers
This will happen when notes are imported using the "import" method and when the user clicks on the widget in edit mode
Expand Down Expand Up @@ -193,3 +204,7 @@ Copyright (c) 2013 Wayne Mogg.
## Release History
### 0.6
First release
### 0.7
Update to work with imgViewer 0.7
Add zoomable option to disable zooming
Updated Grunfile.js to include tests against latest version (2.1.0) of jQuery.
13 changes: 10 additions & 3 deletions dist/imgNotes.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*! jQuery imgNotes - v0.6.0 - 2013-06-09
/*! jQuery imgNotes - v0.7.0 - 2014-06-19
* https://github.com/waynegm/imgNotes
* Copyright (c) 2013 Wayne Mogg; Licensed MIT */
* Copyright (c) 2014 Wayne Mogg; Licensed MIT */
;(function($) {
$.widget("wgm.imgNotes", {
options: {
zoom: 1,
zoomStep: 0.1,
zoomable: true,
canEdit: false,
vAll: "middle",
hAll: "middle",
Expand Down Expand Up @@ -120,7 +121,10 @@
$.each(self.notes, function() {
self._updateMarkerPos(this);
});
}
},
zoom: self.options.zoom,
zoomStep: self.options.zoomStep,
zoomable: self.options.zoomable
});
},
/*
Expand Down Expand Up @@ -162,6 +166,9 @@
case 'zoomStep':
$(this.img).imgViewer("option", "zoomStep", value);
break;
case 'zoomable':
$(this.img).imgViewer("option", "zoomable", value);
break;
}
},

Expand Down
6 changes: 3 additions & 3 deletions dist/imgNotes.min.js

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

3 changes: 2 additions & 1 deletion examples/basic_interactive.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" media="screen">
<script type="text/javascript" src="../libs/jquery/jquery.js"></script>
<script type="text/javascript" src="../libs/jquery/jquery-ui.js"></script>
<script type="text/javascript" src="../libs/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="../libs/jquery.fs.zoetrope.min.js"></script>
<script type="text/javascript" src="../libs/toe.min.js"></script>
<script type="text/javascript" src="../libs/imgViewer.js"></script>
<script type="text/javascript" src="../src/imgNotes.js"></script>

Expand Down
3 changes: 2 additions & 1 deletion examples/custom_editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

<script type="text/javascript" src="../libs/jquery/jquery.js"></script>
<script type="text/javascript" src="../libs/jquery/jquery-ui.js"></script>
<script type="text/javascript" src="../libs/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="../libs/jquery.fs.zoetrope.min.js"></script>
<script type="text/javascript" src="../libs/toe.min.js"></script>
<script type="text/javascript" src="custom_editor_files/jquery.sceditor.min.js"></script>
<script type="text/javascript" src="../libs/imgViewer.js"></script>
<script type="text/javascript" src="../src/imgNotes.js"></script>
Expand Down
4 changes: 4 additions & 0 deletions examples/custom_editor_files/.directory
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Dolphin]
Timestamp=2013,6,24,21,28,9
Version=3
ViewMode=1
3 changes: 2 additions & 1 deletion examples/custom_marker.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" media="screen">
<script type="text/javascript" src="../libs/jquery/jquery.js"></script>
<script type="text/javascript" src="../libs/jquery/jquery-ui.js"></script>
<script type="text/javascript" src="../libs/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="../libs/jquery.fs.zoetrope.min.js"></script>
<script type="text/javascript" src="../libs/toe.min.js"></script>
<script type="text/javascript" src="../libs/imgViewer.js"></script>
<script type="text/javascript" src="../src/imgNotes.js"></script>

Expand Down
3 changes: 2 additions & 1 deletion examples/custom_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

<script type="text/javascript" src="../libs/jquery/jquery.js"></script>
<script type="text/javascript" src="../libs/jquery/jquery-ui.js"></script>
<script type="text/javascript" src="../libs/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="../libs/jquery.fs.zoetrope.min.js"></script>
<script type="text/javascript" src="../libs/toe.min.js"></script>
<script type="text/javascript" src="../libs/imgViewer.js"></script>
<script type="text/javascript" src="../src/imgNotes.js"></script>

Expand Down
5 changes: 3 additions & 2 deletions imgNotes.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "imgNotes",
"title": "jQuery imgNotes",
"description": "Extension of the jQuery imgViewer plugin to add markers and notes to the image.",
"version": "0.6.0",
"version": "0.7.0",
"homepage": "",
"author": {
"name": "Wayne Mogg"
Expand All @@ -22,7 +22,8 @@
"dependencies": {
"jquery": ">=1.8",
"jquery-ui": ">=1.8",
"jQuery Mousewheel": ">=3.0",
"toe.js": ">=3.0",
"zoetrope": ">=3.0",
"jQuery imgViewer": ">=0.6"
},
"keywords": [
Expand Down
Loading

0 comments on commit 1ed269c

Please sign in to comment.