Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel ANTELME
digilib-pivaj
Commits
d7642990
Commit
d7642990
authored
Jun 04, 2015
by
robcast
Browse files
added support for legacy 'areas' annotation format.
parent
10948952
Changes
1
Hide whitespace changes
Inline
Side-by-side
webapp/src/main/webapp/jquery/jquery.digilib.annotator.js
View file @
d7642990
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
*/
*/
(
function
(
$
)
{
(
function
(
$
)
{
// version of this plugin
// version of this plugin
var
version
=
'
jquery.digilib.annotator.js 1.3.
4
'
;
var
version
=
'
jquery.digilib.annotator.js 1.3.
5
'
;
// affine geometry
// affine geometry
var
geom
=
null
;
var
geom
=
null
;
...
@@ -384,6 +384,24 @@
...
@@ -384,6 +384,24 @@
var
area
=
null
;
var
area
=
null
;
var
type
=
null
;
var
type
=
null
;
var
shape
=
null
;
var
shape
=
null
;
if
(
annotation
.
areas
!=
null
&&
annotation
.
shapes
==
null
)
{
console
.
warn
(
"
Annotation uses legacy 'areas' format! Converting...
"
);
/*
* convert legacy annotation areas into shapes
*/
area
=
geom
.
rectangle
(
annotation
.
areas
[
0
]);
annoShape
=
{
'
geometry
'
:
area
,
'
units
'
:
'
fraction
'
};
if
(
area
.
isRectangle
())
{
annoShape
[
'
type
'
]
=
'
rectangle
'
;
}
else
{
annoShape
[
'
type
'
]
=
'
point
'
;
}
delete
annotation
.
areas
;
annotation
.
shapes
=
[
annoShape
];
}
if
(
annotation
.
shapes
!=
null
)
{
if
(
annotation
.
shapes
!=
null
)
{
// annotation shape
// annotation shape
annoShape
=
annotation
.
shapes
[
0
];
annoShape
=
annotation
.
shapes
[
0
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment