Gitlab CSE Unil
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
M. Chardon
moodle-assignfeedback_editpdfplus
Commits
cc9cf2f9
Commit
cc9cf2f9
authored
Aug 07, 2017
by
M. Chardon
Browse files
annotation verticalline
parent
15c7df55
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
amd/build/admin_panel.min.js
View file @
cc9cf2f9
This diff is collapsed.
Click to expand it.
amd/build/annotationverticalline.min.js
0 → 100644
View file @
cc9cf2f9
define
([
"
jquery
"
,
"
./annotation
"
],
function
(
a
,
b
){
function
c
(){
return
b
.
call
(
this
),
this
}
return
c
.
prototype
=
Object
.
create
(
b
.
prototype
),
c
.
prototype
.
draw
=
function
(
b
){
if
(
b
){
var
c
=
"
<div id='
"
+
this
.
id
+
"
'></div>
"
;
b
.
append
(
c
),
a
(
"
#
"
+
this
.
id
).
css
(
"
background-color
"
,
this
.
get_color
()),
a
(
"
#
"
+
this
.
id
).
css
(
"
width
"
,
3
),
this
.
endy
-
this
.
y
<=
30
&&
(
this
.
endy
=
this
.
y
+
30
),
a
(
"
#
"
+
this
.
id
).
css
(
"
height
"
,
this
.
endy
-
this
.
y
),
a
(
"
#
"
+
this
.
id
).
css
(
"
position
"
,
"
relative
"
),
a
(
"
#
"
+
this
.
id
).
css
(
"
display
"
,
"
inline-block
"
),
a
(
"
#
"
+
this
.
id
).
css
(
"
left
"
,
this
.
x
),
a
(
"
#
"
+
this
.
id
).
css
(
"
top
"
,
this
.
y
)}
this
.
draw_catridge
(
b
)},
c
.
prototype
.
draw_catridge
=
function
(
a
){
var
b
;
if
(
!
this
.
divcartridge
||
""
===
this
.
divcartridge
){
this
.
init_div_cartridge_id
();
var
c
=
this
.
get_color_cartridge
();
b
=
this
.
get_div_cartridge
(
c
,
a
),
b
.
addClass
(
"
assignfeedback_editpdfplus_verticalline
"
),
this
.
get_div_cartridge_label
(
c
,
b
);
var
d
=
this
.
get_div_container
(
c
,
b
);
this
.
get_div_edition
(
d
),
this
.
cartridgex
&&
0
!==
this
.
cartridgex
||
(
this
.
cartridgex
=
parseInt
(
this
.
tooltypefamille
.
cartridge_x
,
10
)),
this
.
cartridgey
&&
0
!==
this
.
cartridgey
||
(
this
.
cartridgey
=
parseInt
(
this
.
tooltypefamille
.
cartridge_y
,
10
)),
b
.
css
(
"
left
"
,
this
.
x
+
this
.
cartridgex
),
b
.
css
(
"
top
"
,
this
.
y
+
this
.
cartridgey
),
this
.
apply_visibility_annot
()}
return
!
0
},
c
});
\ No newline at end of file
amd/src/admin_panel.js
View file @
cc9cf2f9
...
...
@@ -24,10 +24,10 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
'
core/ajax
'
,
'
core/str
'
,
/*'mod_assign/grading_form_change_checker'*/
'
assignfeedback_editpdfplus/annotation
'
,
'
assignfeedback_editpdfplus/annotationhighlightplus
'
,
'
assignfeedback_editpdfplus/annotationstampplus
'
,
'
assignfeedback_editpdfplus/annotationframe
'
,
'
assignfeedback_editpdfplus/annotationcommentplus
'
],
'
assignfeedback_editpdfplus/annotationcommentplus
'
,
'
assignfeedback_editpdfplus/annotationverticalline
'
],
function
(
$
/*, Y*/
,
notification
,
templates
,
fragment
,
ajax
,
str
,
Annotation
,
AnnotationHighlightplus
,
AnnotationStampplus
,
AnnotationFrame
,
AnnotationCommentplus
/*, checker*/
)
{
AnnotationCommentplus
,
AnnotationVerticalline
/*, checker*/
)
{
var
contextid
=
null
;
var
currentTool
=
null
;
...
...
@@ -124,6 +124,11 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
annotChild
.
y
=
216
;
annotChild
.
endx
=
296
;
annotChild
.
endy
=
232
;
}
else
if
(
typetool
===
5
)
{
this
.
annotationcurrent
=
new
AnnotationVerticalline
();
this
.
annotationcurrent
.
x
=
285
;
this
.
annotationcurrent
.
y
=
65
;
this
.
annotationcurrent
.
endy
=
175
;
}
else
if
(
typetool
===
7
)
{
this
.
annotationcurrent
=
new
AnnotationCommentplus
();
this
.
annotationcurrent
.
x
=
30
;
...
...
amd/src/annotationverticalline.js
0 → 100644
View file @
cc9cf2f9
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/*
* @package assignfeedback_editpdfplus
* @copyright 2017 Université de Lausanne
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/annotationhighlightplus
*/
define
([
'
jquery
'
,
'
./annotation
'
],
function
(
$
,
Annotation
)
{
// I return an initialized object.
function
AnnotationVerticalline
()
{
// Call the super constructor.
Annotation
.
call
(
this
);
// Return this object reference.
return
(
this
);
}
// The Friend class extends the base Model class.
AnnotationVerticalline
.
prototype
=
Object
.
create
(
Annotation
.
prototype
);
/**
* Draw a highlight annotation
* @protected
* @method draw
* @return M.assignfeedback_editpdfplus.drawable
*/
AnnotationVerticalline
.
prototype
.
draw
=
function
(
canevas
)
{
if
(
canevas
)
{
var
divVerticalline
=
"
<div id='
"
+
this
.
id
+
"
'></div>
"
;
canevas
.
append
(
divVerticalline
);
$
(
"
#
"
+
this
.
id
).
css
(
'
background-color
'
,
this
.
get_color
());
$
(
"
#
"
+
this
.
id
).
css
(
'
width
'
,
3
);
if
(
this
.
endy
-
this
.
y
<=
30
)
{
this
.
endy
=
this
.
y
+
30
;
}
$
(
"
#
"
+
this
.
id
).
css
(
'
height
'
,
this
.
endy
-
this
.
y
);
$
(
"
#
"
+
this
.
id
).
css
(
'
position
'
,
'
relative
'
);
$
(
"
#
"
+
this
.
id
).
css
(
'
display
'
,
'
inline-block
'
);
$
(
"
#
"
+
this
.
id
).
css
(
'
left
'
,
this
.
x
);
$
(
"
#
"
+
this
.
id
).
css
(
'
top
'
,
this
.
y
);
}
this
.
draw_catridge
(
canevas
);
return
;
};
/**
* Display cartridge and toolbox for the annotation
* @returns {Boolean} res
*/
AnnotationVerticalline
.
prototype
.
draw_catridge
=
function
(
canevas
)
{
var
divdisplay
;
if
(
!
this
.
divcartridge
||
this
.
divcartridge
===
''
)
{
this
.
init_div_cartridge_id
();
//init cartridge
var
colorcartridge
=
this
.
get_color_cartridge
();
divdisplay
=
this
.
get_div_cartridge
(
colorcartridge
,
canevas
);
divdisplay
.
addClass
(
'
assignfeedback_editpdfplus_verticalline
'
);
//divdisplay.css('display', 'inline-block');
// inscription entete
/*var divcartridge = */
this
.
get_div_cartridge_label
(
colorcartridge
,
divdisplay
);
//creation input
var
divconteneurdisplay
=
this
.
get_div_container
(
colorcartridge
,
divdisplay
);
//creation de la div d'edition
//if (!this.editor.get('readonly')) {
this
.
get_div_edition
(
divconteneurdisplay
);
//} else {
//var divvisudisplay = this.get_div_visu(colorcartridge);
//divconteneurdisplay.append(divvisudisplay);
//}
//positionnement de la div par rapport a l'annotation
if
(
!
this
.
cartridgex
||
this
.
cartridgex
===
0
)
{
this
.
cartridgex
=
parseInt
(
this
.
tooltypefamille
.
cartridge_x
,
10
);
}
if
(
!
this
.
cartridgey
||
this
.
cartridgey
===
0
)
{
this
.
cartridgey
=
parseInt
(
this
.
tooltypefamille
.
cartridge_y
,
10
);
}
divdisplay
.
css
(
'
left
'
,
this
.
x
+
this
.
cartridgex
+
17
);
divdisplay
.
css
(
'
top
'
,
this
.
y
+
this
.
cartridgey
);
this
.
apply_visibility_annot
();
}
else
{
//divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge);
//divdisplay.setX(offsetcanvas[0] + this.x + this.cartridgex);
//divdisplay.setY(offsetcanvas[1] + this.y + this.cartridgey);
}
return
true
;
};
return
AnnotationVerticalline
;
});
\ No newline at end of file
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