@cogic/annotorious 2.7.20 → 2.7.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/annotorious.min.css +4 -1
- package/dist/annotorious.min.css.map +1 -0
- package/dist/annotorious.min.js +3 -25
- package/dist/annotorious.min.js.LICENSE.txt +14 -0
- package/dist/annotorious.min.js.map +1 -0
- package/dist/index.html +3 -31
- package/package.json +1 -1
- package/src/tools/rectangle/RubberbandRectTool.js +7 -4
- package/src/util/Touch.js +3 -3
package/dist/index.html
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<title>Annotorious | Basic Example</title>
|
|
6
|
-
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
|
|
7
|
-
<style>
|
|
8
|
-
html, body {
|
|
1
|
+
<!doctype html><html><head><meta charset="utf-8"/><title>Annotorious | Basic Example</title><link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet"><style>html, body {
|
|
9
2
|
padding:20px;
|
|
10
3
|
margin:0px;
|
|
11
4
|
font-family:'Lato', sans-serif;
|
|
@@ -37,25 +30,7 @@
|
|
|
37
30
|
|
|
38
31
|
p.caption a {
|
|
39
32
|
color:#3f3f3f;
|
|
40
|
-
}
|
|
41
|
-
</style>
|
|
42
|
-
</head>
|
|
43
|
-
<body>
|
|
44
|
-
<div id="content">
|
|
45
|
-
<h1>Annotorious: Basic Example</h1>
|
|
46
|
-
<p class="instructions">
|
|
47
|
-
Click the annotation to edit. Click and drag the mouse to create a new annotation.
|
|
48
|
-
</p>
|
|
49
|
-
<p>
|
|
50
|
-
<button id="current-tool">RECTANGLE</button>
|
|
51
|
-
</p>
|
|
52
|
-
<div>
|
|
53
|
-
<img id="hallstatt" src="640px-Hallstatt.jpg">
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
<script>
|
|
58
|
-
window.onload = function() {
|
|
33
|
+
}</style><link href="annotorious.min.css" rel="stylesheet"><script src="annotorious.min.js"></script></head><body><div id="content"><h1>Annotorious: Basic Example</h1><p class="instructions">Click the annotation to edit. Click and drag the mouse to create a new annotation.</p><p><button id="current-tool">RECTANGLE</button></p><div><img id="hallstatt" src="640px-Hallstatt.jpg"></div></div><script>window.onload = function() {
|
|
59
34
|
anno = Annotorious.init({
|
|
60
35
|
image: 'hallstatt',
|
|
61
36
|
locale: 'auto',
|
|
@@ -134,7 +109,4 @@
|
|
|
134
109
|
anno.setDrawingTool('rect');
|
|
135
110
|
}
|
|
136
111
|
});
|
|
137
|
-
}
|
|
138
|
-
</script>
|
|
139
|
-
</body>
|
|
140
|
-
</html>
|
|
112
|
+
}</script></body></html>
|
package/package.json
CHANGED
|
@@ -12,9 +12,12 @@ export default class RubberbandRectTool extends Tool {
|
|
|
12
12
|
super(g, config, env);
|
|
13
13
|
|
|
14
14
|
this.rubberband = null;
|
|
15
|
+
this._startOnSingleClick = false;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
startDrawing = (x, y) => {
|
|
18
|
+
startDrawing = (x, y, startOnSingleClick) => {
|
|
19
|
+
this._startOnSingleClick = startOnSingleClick;
|
|
20
|
+
|
|
18
21
|
this.attachListeners({
|
|
19
22
|
mouseMove: this.onMouseMove,
|
|
20
23
|
mouseUp: this.onMouseUp
|
|
@@ -56,11 +59,11 @@ export default class RubberbandRectTool extends Tool {
|
|
|
56
59
|
|
|
57
60
|
// Emit the completed shape...
|
|
58
61
|
this.emit('complete', element);
|
|
59
|
-
|
|
62
|
+
this.stop();
|
|
63
|
+
} else if (!this._startOnSingleClick) {
|
|
60
64
|
this.emit('cancel');
|
|
65
|
+
this.stop();
|
|
61
66
|
}
|
|
62
|
-
|
|
63
|
-
this.stop();
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
get isDrawing() {
|
package/src/util/Touch.js
CHANGED
|
@@ -4,10 +4,10 @@ const SIM_EVENTS = {
|
|
|
4
4
|
touchend: 'mouseup'
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
const SUPPORT_TOUCH_DEVICE = false;
|
|
8
|
+
|
|
7
9
|
export const isTouchDevice = () =>
|
|
8
|
-
'ontouchstart' in window ||
|
|
9
|
-
navigator.maxTouchPoints > 0 ||
|
|
10
|
-
navigator.msMaxTouchPoints > 0;
|
|
10
|
+
SUPPORT_TOUCH_DEVICE && ('ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
|
11
11
|
|
|
12
12
|
export const enableTouchTranslation = el => {
|
|
13
13
|
|