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
ec23e337
Commit
ec23e337
authored
Jul 24, 2017
by
M. Chardon
Browse files
architecture des annotations avec extend
parent
3376e82d
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
amd/build/admin_panel.min.js
View file @
ec23e337
define
([
"
jquery
"
,
"
core/notification
"
,
"
core/templates
"
,
"
core/fragment
"
,
"
core/ajax
"
,
"
core/str
"
],
function
(
a
,
b
,
c
,
d
,
e
,
f
){
var
g
=
null
,
h
=
null
,
i
=
null
,
j
=
function
(
a
){
this
.
init
(),
g
=
a
};
j
.
prototype
.
selectTool
=
null
,
j
.
prototype
.
init
=
function
(){
a
(
"
#editpdlplus_axes
"
).
on
(
"
change
"
,
function
(){
a
(
"
.toolbar
"
).
hide
();
var
b
=
a
(
"
#editpdlplus_axes
"
).
val
();
a
(
"
#editpdlplus_toolbar_
"
+
b
).
show
();
var
c
=
a
(
"
#editpdlplus_axes option:selected
"
).
data
(
"
delete
"
);
c
&&
parseInt
(
c
)
>
0
?
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
addClass
(
"
disabled
"
):
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
removeClass
(
"
disabled
"
)}),
a
(
"
#editpdlplus_axes
"
).
change
(),
a
(
"
.editpdlplus_tool
"
).
on
(
"
click
"
,
l
),
this
.
selectTool
=
a
(
"
.editpdlplus_tool
"
).
first
(),
this
.
initTool
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_addaxis
"
).
on
(
"
click
"
,
this
.
openDivAddAxis
),
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_editaxis
"
).
on
(
"
click
"
,
this
.
openDivEditAxis
),
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
on
(
"
click
"
,
this
.
openDivDelAxis
),
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_addtool
"
).
on
(
"
click
"
,
this
.
openDivAddTool
)},
j
.
prototype
.
test
=
function
(){
alert
(
"
test
"
),
l
()},
j
.
prototype
.
initTool
=
function
(){
a
(
this
.
selectTool
).
removeClass
(
"
btn-default
"
),
a
(
this
.
selectTool
).
addClass
(
"
btn-primary
"
)},
j
.
prototype
.
initCanevas
=
function
(){
var
b
=
parseInt
(
a
(
"
#typetool
"
).
val
());
3
===
b
||
4
===
b
||
7
===
b
?
a
(
"
#canevas
"
).
css
(
"
background-image
"
,
"
url(
"
+
a
(
"
#map01
"
).
val
()
+
"
)
"
):
1
===
b
||
6
===
b
?
a
(
"
#canevas
"
).
css
(
"
background-image
"
,
"
url(
"
+
a
(
"
#map02
"
).
val
()
+
"
)
"
):
5
===
b
&&
a
(
"
#canevas
"
).
css
(
"
background-image
"
,
"
url(
"
+
a
(
"
#map03
"
).
val
()
+
"
)
"
)},
j
.
prototype
.
openDivAddAxis
=
function
(){
a
(
"
#axistool
"
).
hide
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_addaxis
"
).
show
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body
"
).
html
(
""
);
var
e
=
{};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
axisadd
"
,
g
,
e
).
done
(
function
(
a
,
b
){
c
.
appendNodeContents
(
"
#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body
"
,
a
,
b
)}.
bind
(
this
)).
fail
(
b
.
exception
)},
j
.
prototype
.
openDivEditAxis
=
function
(){
a
(
"
#axistool
"
).
hide
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_editaxis
"
).
show
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body
"
).
html
(
""
);
var
e
=
a
(
"
#editpdlplus_axes option:selected
"
).
val
(),
f
=
{
axeid
:
e
};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
axisedit
"
,
g
,
f
).
done
(
function
(
a
,
b
){
c
.
appendNodeContents
(
"
#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body
"
,
a
,
b
)}.
bind
(
this
)).
fail
(
b
.
exception
)},
j
.
prototype
.
openDivDelAxis
=
function
(){
a
(
"
#axistool
"
).
hide
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_delaxis
"
).
show
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body
"
).
html
(
""
);
var
e
=
a
(
"
#editpdlplus_axes option:selected
"
).
val
(),
f
=
{
axeid
:
e
};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
axisdel
"
,
g
,
f
).
done
(
function
(
a
,
b
){
c
.
appendNodeContents
(
"
#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body
"
,
a
,
b
)}.
bind
(
this
)).
fail
(
b
.
exception
)};
var
k
=
function
(
b
,
d
,
e
){
var
f
=
a
.
Deferred
();
return
b
.
fadeOut
(
"
fast
"
,
function
(){
c
.
replaceNodeContents
(
b
,
d
,
e
),
b
.
fadeIn
(
"
fast
"
,
function
(){
f
.
resolve
()})}),
f
.
promise
()},
l
=
function
(){
var
c
=
f
.
get_string
(
"
admindeltool_messageok
"
,
"
assignfeedback_editpdfplus
"
),
j
=
a
(
this
).
val
();
a
(
"
.editpdlplus_tool
"
).
each
(
function
(){
a
(
this
).
removeClass
(
"
btn-primary
"
),
a
(
this
).
removeClass
(
"
btn-default
"
);
var
b
=
a
(
this
).
data
(
"
enable
"
);
1
===
b
&&
a
(
this
).
val
()
!==
j
&&
a
(
this
).
addClass
(
"
btn-default
"
)}),
a
(
this
).
addClass
(
"
btn-primary
"
),
a
(
"
#editpdlplus_tool_item
"
).
html
(
""
);
var
m
=
{
toolid
:
j
};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
tooledit
"
,
g
,
m
).
done
(
function
(
d
,
f
){
k
(
a
(
"
#editpdlplus_tool_item
"
),
d
,
f
).
done
(
function
(){
a
(
"
#toolFormSubmit
"
).
on
(
"
click
"
,
function
(){
var
c
=
a
(
"
#assignfeedback_editpdfplus_edit_tool
"
),
d
=
c
.
serialize
();
e
.
call
([{
methodname
:
"
assignfeedback_editpdfplus_submit_tool_edit_form
"
,
args
:{
jsonformdata
:
JSON
.
stringify
(
d
)}}])[
0
].
done
(
function
(
b
){
if
(
""
===
b
[
0
].
message
){
a
(
"
#message_edit_tool
"
).
html
(
"
Modifications enregistrées
"
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-success
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-danger
"
),
a
(
"
#editpdlplus_toolbar_
"
+
b
[
0
].
axeid
).
html
(
""
);
for
(
var
c
=
0
;
c
<
b
.
length
;
c
++
){
var
d
=
"
btn-default
"
;
1
!==
b
[
c
].
enable
&&
(
d
=
""
),
b
[
c
].
toolid
===
b
[
c
].
selecttool
&&
(
d
=
"
btn-primary
"
);
var
e
=
""
;
4
!==
b
[
c
].
typetool
&&
1
!==
b
[
c
].
typetool
||
(
e
=
"
text-decoration: underline;
"
);
var
f
=
b
[
c
].
button
;
4
!==
b
[
c
].
typetool
&&
5
!==
b
[
c
].
typetool
||
(
f
=
"
|
"
+
f
,
4
===
b
[
c
].
typetool
&&
(
f
+=
"
|
"
));
var
g
=
"
<button class='btn
"
+
d
+
"
editpdlplus_tool' id='editpdlplus_tool_
"
+
b
[
c
].
toolid
+
"
' style='
"
+
e
+
"
' value='
"
+
b
[
c
].
toolid
+
"
' data-enable='
"
+
b
[
c
].
enable
+
"
'>
"
+
f
+
"
</button>
"
;
a
(
"
#editpdlplus_toolbar_
"
+
b
[
0
].
axeid
).
append
(
g
)}
a
(
"
.editpdlplus_tool
"
).
on
(
"
click
"
,
l
)}
else
a
(
"
#message_edit_tool
"
).
html
(
b
[
0
].
message
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-danger
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-success
"
)}).
fail
(
b
.
exception
)}),
a
(
"
#toolEnabled
"
).
on
(
"
click
"
,
function
(){
var
b
=
a
(
"
#toolenabled
"
).
val
();
1
==
b
?(
a
(
"
#toolEnabled > i
"
).
addClass
(
"
fa-eye-slash
"
),
a
(
"
#toolEnabled > i
"
).
removeClass
(
"
fa-eye
"
),
a
(
"
#toolenabled
"
).
val
(
0
)):(
a
(
"
#toolEnabled > i
"
).
addClass
(
"
fa-eye
"
),
a
(
"
#toolEnabled > i
"
).
removeClass
(
"
fa-eye-slash
"
),
a
(
"
#toolenabled
"
).
val
(
1
)),
a
(
"
#toolFormSubmit
"
).
click
()}),
a
(
"
#toolClone
"
).
on
(
"
click
"
,
function
(){
i
=
"
clone
"
,
h
=
new
Object
,
h
.
typetool
=
a
(
"
#typetool
"
).
val
(),
h
.
color
=
a
(
"
#color
"
).
val
(),
h
.
libelle
=
a
(
"
#libelle
"
).
val
(),
h
.
catridgecolor
=
a
(
"
#catridgecolor
"
).
val
(),
h
.
texts
=
a
(
"
#texts
"
).
val
(),
h
.
button
=
a
(
"
#button
"
).
val
(),
h
.
enabled
=
a
(
"
#enabled
"
).
val
(),
h
.
reply
=
a
(
"
#reply
"
).
val
(),
h
.
order
=
a
(
"
#order
"
).
val
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_addtool
"
).
click
()}),
a
(
"
#toolRemove
"
).
on
(
"
click
"
,
function
(){
if
(
!
a
(
this
).
hasClass
(
"
disabled
"
)){
var
d
=
a
(
"
#assignfeedback_editpdfplus_edit_tool
"
),
f
=
d
.
serialize
();
e
.
call
([{
methodname
:
"
assignfeedback_editpdfplus_submit_tool_del_form
"
,
args
:{
jsonformdata
:
JSON
.
stringify
(
f
)}}])[
0
].
done
(
function
(
b
){
if
(
""
===
b
[
0
].
message
){
a
(
"
#message_edit_tool
"
).
html
(
c
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-success
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-danger
"
),
a
(
"
#editpdlplus_toolbar_
"
+
b
[
0
].
axeid
).
html
(
""
);
for
(
var
d
=
0
;
d
<
b
.
length
;
d
++
){
var
e
=
"
btn-default
"
;
1
!==
b
[
d
].
enable
&&
(
e
=
""
),
b
[
d
].
toolid
===
b
[
d
].
selecttool
&&
(
e
=
"
btn-primary
"
);
var
f
=
""
;
4
!==
b
[
d
].
typetool
&&
1
!==
b
[
d
].
typetool
||
(
f
=
"
text-decoration: underline;
"
);
var
g
=
b
[
d
].
button
;
4
!==
b
[
d
].
typetool
&&
5
!==
b
[
d
].
typetool
||
(
g
=
"
|
"
+
g
,
4
===
b
[
d
].
typetool
&&
(
g
+=
"
|
"
));
var
h
=
"
<button class='btn
"
+
e
+
"
editpdlplus_tool' id='editpdlplus_tool_
"
+
b
[
d
].
toolid
+
"
' style='
"
+
f
+
"
' value='
"
+
b
[
d
].
toolid
+
"
' data-enable='
"
+
b
[
d
].
enable
+
"
'>
"
+
g
+
"
</button>
"
;
a
(
"
#editpdlplus_toolbar_
"
+
b
[
0
].
axeid
).
append
(
h
)}
a
(
"
.editpdlplus_tool
"
).
on
(
"
click
"
,
l
),
a
(
"
#toolworkspace
"
).
html
(
""
)}
else
a
(
"
#message_edit_tool
"
).
html
(
b
[
0
].
message
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-danger
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-success
"
)}).
fail
(
b
.
exception
)}});
var
d
=
parseInt
(
a
(
"
#typetool
"
).
val
());
3
===
d
||
4
===
d
||
7
===
d
?
a
(
"
#canevas
"
).
css
(
"
background-image
"
,
"
url(
"
+
a
(
"
#map01
"
).
val
()
+
"
)
"
):
1
===
d
||
6
===
d
?
a
(
"
#canevas
"
).
css
(
"
background-image
"
,
"
url(
"
+
a
(
"
#map02
"
).
val
()
+
"
)
"
):
5
===
d
&&
a
(
"
#canevas
"
).
css
(
"
background-image
"
,
"
url(
"
+
a
(
"
#map03
"
).
val
()
+
"
)
"
)}.
bind
(
this
)).
fail
(
b
.
exception
)}.
bind
(
this
)).
fail
(
b
.
exception
)};
return
j
.
prototype
.
openDivAddTool
=
function
(){
var
c
=
f
.
get_string
(
"
adminaddtool_messageok
"
,
"
assignfeedback_editpdfplus
"
);
a
(
"
#editpdlplus_tool_item
"
).
html
(
""
),
a
(
"
.btn-primary
"
).
addClass
(
"
btn-default
"
),
a
(
"
.editpdlplus_tool
"
).
removeClass
(
"
btn-primary
"
);
var
j
=
a
(
"
#editpdlplus_axes option:selected
"
).
val
(),
m
=
{
axisid
:
j
};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
tooladd
"
,
g
,
m
).
done
(
function
(
d
,
f
){
k
(
a
(
"
#editpdlplus_tool_item
"
),
d
,
f
).
done
(
function
(){
"
clone
"
===
i
&&
(
a
(
"
#typetool
"
).
val
(
h
.
typetool
),
a
(
"
#color
"
).
val
(
h
.
color
),
a
(
"
#libelle
"
).
val
(
h
.
libelle
),
a
(
"
#catridgecolor
"
).
val
(
h
.
catridgecolor
),
a
(
"
#texts
"
).
val
(
h
.
texts
),
a
(
"
#button
"
).
val
(
h
.
button
),
a
(
"
#enabled
"
).
val
(
h
.
enabled
),
a
(
"
#reply
"
).
val
(
h
.
reply
),
a
(
"
#order
"
).
val
(
h
.
order
),
h
=
null
,
i
=
null
),
a
(
"
#toolFormSubmit
"
).
on
(
"
click
"
,
function
(){
var
d
=
a
(
"
#assignfeedback_editpdfplus_edit_tool
"
),
f
=
d
.
serialize
();
e
.
call
([{
methodname
:
"
assignfeedback_editpdfplus_submit_tool_add_form
"
,
args
:{
jsonformdata
:
JSON
.
stringify
(
f
)}}])[
0
].
done
(
function
(
b
){
if
(
""
===
b
[
0
].
message
){
a
(
"
#message_edit_tool
"
).
html
(
c
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-success
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-danger
"
),
a
(
"
#editpdlplus_toolbar_
"
+
b
[
0
].
axeid
).
html
(
""
);
for
(
var
d
=
0
;
d
<
b
.
length
;
d
++
){
var
e
=
"
btn-default
"
;
1
!==
b
[
d
].
enable
&&
(
e
=
""
),
b
[
d
].
toolid
===
b
[
d
].
selecttool
&&
(
e
=
"
btn-primary
"
);
var
f
=
""
;
4
!==
b
[
d
].
typetool
&&
1
!==
b
[
d
].
typetool
||
(
f
=
"
text-decoration: underline;
"
);
var
g
=
b
[
d
].
button
;
4
!==
b
[
d
].
typetool
&&
5
!==
b
[
d
].
typetool
||
(
g
=
"
|
"
+
g
,
4
===
b
[
d
].
typetool
&&
(
g
+=
"
|
"
));
var
h
=
"
<button class='btn
"
+
e
+
"
editpdlplus_tool' id='editpdlplus_tool_
"
+
b
[
d
].
toolid
+
"
' style='
"
+
f
+
"
' value='
"
+
b
[
d
].
toolid
+
"
' data-enable='
"
+
b
[
d
].
enable
+
"
'>
"
+
g
+
"
</button>
"
;
a
(
"
#editpdlplus_toolbar_
"
+
b
[
0
].
axeid
).
append
(
h
)}
a
(
"
.editpdlplus_tool
"
).
on
(
"
click
"
,
l
),
a
(
"
#editpdlplus_tool_item
"
).
html
(
""
)}
else
a
(
"
#message_edit_tool
"
).
html
(
b
[
0
].
message
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-danger
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-success
"
)}).
fail
(
b
.
exception
)})}.
bind
(
this
)).
fail
(
b
.
exception
)}.
bind
(
this
)).
fail
(
b
.
exception
)},
j
});
\ No newline at end of file
define
([
"
jquery
"
,
"
core/notification
"
,
"
core/templates
"
,
"
core/fragment
"
,
"
core/ajax
"
,
"
core/str
"
,
"
assignfeedback_editpdfplus/annotation
"
,
"
assignfeedback_editpdfplus/annotationhighlightplus
"
,
"
assignfeedback_editpdfplus/annotationstampplus
"
],
function
(
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
){
var
j
=
null
,
k
=
null
,
l
=
null
,
m
=
null
,
n
=
function
(
a
,
b
){
this
.
init
(),
j
=
a
,
m
=
JSON
.
parse
(
b
)};
n
.
annotationcurrent
=
null
,
n
.
prototype
.
selectTool
=
null
,
n
.
prototype
.
init
=
function
(){
a
(
"
#editpdlplus_axes
"
).
on
(
"
change
"
,
function
(){
a
(
"
.toolbar
"
).
hide
();
var
b
=
a
(
"
#editpdlplus_axes
"
).
val
();
a
(
"
#editpdlplus_toolbar_
"
+
b
).
show
();
var
c
=
a
(
"
#editpdlplus_axes option:selected
"
).
data
(
"
delete
"
);
c
&&
parseInt
(
c
)
>
0
?
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
addClass
(
"
disabled
"
):
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
removeClass
(
"
disabled
"
)}),
a
(
"
#editpdlplus_axes
"
).
change
(),
a
(
"
.editpdlplus_tool
"
).
on
(
"
click
"
,
r
),
this
.
selectTool
=
a
(
"
.editpdlplus_tool
"
).
first
(),
this
.
initTool
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_addaxis
"
).
on
(
"
click
"
,
this
.
openDivAddAxis
),
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_editaxis
"
).
on
(
"
click
"
,
this
.
openDivEditAxis
),
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
on
(
"
click
"
,
this
.
openDivDelAxis
),
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_addtool
"
).
on
(
"
click
"
,
this
.
openDivAddTool
)},
n
.
prototype
.
test
=
function
(){
alert
(
"
test
"
),
r
()},
n
.
prototype
.
initTool
=
function
(){
a
(
this
.
selectTool
).
removeClass
(
"
btn-default
"
),
a
(
this
.
selectTool
).
addClass
(
"
btn-primary
"
)};
var
o
=
function
(
a
){
for
(
var
b
=
0
;
b
<
m
.
length
;
b
++
)
if
(
m
[
b
].
id
==
a
)
return
m
[
b
]},
p
=
function
(){
a
(
"
#canevas
"
).
html
(
""
),
this
.
annotationcurrent
=
null
;
var
b
=
parseInt
(
a
(
"
#typetool
"
).
val
());
if
(
3
===
b
||
4
===
b
||
7
===
b
?
a
(
"
#canevas
"
).
css
(
"
background-image
"
,
"
url(
"
+
a
(
"
#map01
"
).
val
()
+
"
)
"
):
1
===
b
||
6
===
b
?
a
(
"
#canevas
"
).
css
(
"
background-image
"
,
"
url(
"
+
a
(
"
#map02
"
).
val
()
+
"
)
"
):
5
===
b
&&
a
(
"
#canevas
"
).
css
(
"
background-image
"
,
"
url(
"
+
a
(
"
#map03
"
).
val
()
+
"
)
"
),
1
===
b
?(
this
.
annotationcurrent
=
new
h
,
this
.
annotationcurrent
.
x
=
83
,
this
.
annotationcurrent
.
y
=
82
,
this
.
annotationcurrent
.
endx
=
239
,
this
.
annotationcurrent
.
endy
=
98
):
3
===
b
&&
(
this
.
annotationcurrent
=
new
i
,
this
.
annotationcurrent
.
x
=
108
,
this
.
annotationcurrent
.
y
=
50
),
this
.
annotationcurrent
){
var
c
=
o
(
b
);
this
.
annotationcurrent
.
tooltype
=
k
,
k
.
color
?
this
.
annotationcurrent
.
colour
=
k
.
color
:
this
.
annotationcurrent
.
colour
=
c
.
color
,
this
.
annotationcurrent
.
tooltypefamille
=
c
,
this
.
annotationcurrent
.
id
=
"
previsu_annot
"
,
this
.
annotationcurrent
.
draw
(
a
(
"
#canevas
"
))}};
n
.
prototype
.
openDivAddAxis
=
function
(){
a
(
"
#axistool
"
).
hide
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_addaxis
"
).
show
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body
"
).
html
(
""
);
var
e
=
{};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
axisadd
"
,
j
,
e
).
done
(
function
(
a
,
b
){
c
.
appendNodeContents
(
"
#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body
"
,
a
,
b
)}.
bind
(
this
)).
fail
(
b
.
exception
)},
n
.
prototype
.
openDivEditAxis
=
function
(){
a
(
"
#axistool
"
).
hide
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_editaxis
"
).
show
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body
"
).
html
(
""
);
var
e
=
a
(
"
#editpdlplus_axes option:selected
"
).
val
(),
f
=
{
axeid
:
e
};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
axisedit
"
,
j
,
f
).
done
(
function
(
a
,
b
){
c
.
appendNodeContents
(
"
#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body
"
,
a
,
b
)}.
bind
(
this
)).
fail
(
b
.
exception
)},
n
.
prototype
.
openDivDelAxis
=
function
(){
a
(
"
#axistool
"
).
hide
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_delaxis
"
).
show
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body
"
).
html
(
""
);
var
e
=
a
(
"
#editpdlplus_axes option:selected
"
).
val
(),
f
=
{
axeid
:
e
};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
axisdel
"
,
j
,
f
).
done
(
function
(
a
,
b
){
c
.
appendNodeContents
(
"
#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body
"
,
a
,
b
)}.
bind
(
this
)).
fail
(
b
.
exception
)};
var
q
=
function
(
b
,
d
,
e
){
var
f
=
a
.
Deferred
();
return
b
.
fadeOut
(
"
fast
"
,
function
(){
c
.
replaceNodeContents
(
b
,
d
,
e
),
b
.
fadeIn
(
"
fast
"
,
function
(){
f
.
resolve
()})}),
f
.
promise
()},
r
=
function
(){
var
c
=
f
.
get_string
(
"
admindeltool_messageok
"
,
"
assignfeedback_editpdfplus
"
),
g
=
a
(
this
).
val
();
a
(
"
.editpdlplus_tool
"
).
each
(
function
(){
a
(
this
).
removeClass
(
"
btn-primary
"
),
a
(
this
).
removeClass
(
"
btn-default
"
);
var
b
=
a
(
this
).
data
(
"
enable
"
);
1
===
b
&&
a
(
this
).
val
()
!==
g
&&
a
(
this
).
addClass
(
"
btn-default
"
)}),
a
(
this
).
addClass
(
"
btn-primary
"
),
a
(
"
#editpdlplus_tool_item
"
).
html
(
""
);
var
h
=
{
toolid
:
g
};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
tooledit
"
,
j
,
h
).
done
(
function
(
d
,
f
){
q
(
a
(
"
#editpdlplus_tool_item
"
),
d
,
f
).
done
(
function
(){
k
=
new
Object
,
k
.
typetool
=
a
(
"
#typetool
"
).
val
(),
k
.
color
=
a
(
"
#color
"
).
val
(),
k
.
libelle
=
a
(
"
#libelle
"
).
val
(),
k
.
catridgecolor
=
a
(
"
#catridgecolor
"
).
val
(),
k
.
texts
=
a
(
"
#texts
"
).
val
(),
k
.
button
=
a
(
"
#button
"
).
val
(),
k
.
enabled
=
a
(
"
#enabled
"
).
val
(),
k
.
reply
=
a
(
"
#reply
"
).
val
(),
k
.
order
=
a
(
"
#order
"
).
val
(),
a
(
"
#toolFormSubmit
"
).
on
(
"
click
"
,
function
(){
var
c
=
a
(
"
#assignfeedback_editpdfplus_edit_tool
"
),
d
=
c
.
serialize
();
e
.
call
([{
methodname
:
"
assignfeedback_editpdfplus_submit_tool_edit_form
"
,
args
:{
jsonformdata
:
JSON
.
stringify
(
d
)}}])[
0
].
done
(
function
(
b
){
if
(
""
===
b
[
0
].
message
){
a
(
"
#message_edit_tool
"
).
html
(
"
Modifications enregistrées
"
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-success
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-danger
"
),
a
(
"
#editpdlplus_toolbar_
"
+
b
[
0
].
axeid
).
html
(
""
);
for
(
var
c
=
0
;
c
<
b
.
length
;
c
++
){
var
d
=
"
btn-default
"
;
1
!==
b
[
c
].
enable
&&
(
d
=
""
),
b
[
c
].
toolid
===
b
[
c
].
selecttool
&&
(
d
=
"
btn-primary
"
);
var
e
=
""
;
4
!==
b
[
c
].
typetool
&&
1
!==
b
[
c
].
typetool
||
(
e
=
"
text-decoration: underline;
"
);
var
f
=
b
[
c
].
button
;
4
!==
b
[
c
].
typetool
&&
5
!==
b
[
c
].
typetool
||
(
f
=
"
|
"
+
f
,
4
===
b
[
c
].
typetool
&&
(
f
+=
"
|
"
));
var
g
=
"
<button class='btn
"
+
d
+
"
editpdlplus_tool' id='editpdlplus_tool_
"
+
b
[
c
].
toolid
+
"
' style='
"
+
e
+
"
' value='
"
+
b
[
c
].
toolid
+
"
' data-enable='
"
+
b
[
c
].
enable
+
"
'>
"
+
f
+
"
</button>
"
;
a
(
"
#editpdlplus_toolbar_
"
+
b
[
0
].
axeid
).
append
(
g
)}
a
(
"
.editpdlplus_tool
"
).
on
(
"
click
"
,
r
)}
else
a
(
"
#message_edit_tool
"
).
html
(
b
[
0
].
message
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-danger
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-success
"
)}).
fail
(
b
.
exception
)}),
a
(
"
#toolEnabled
"
).
on
(
"
click
"
,
function
(){
var
b
=
a
(
"
#toolenabled
"
).
val
();
1
==
b
?(
a
(
"
#toolEnabled > i
"
).
addClass
(
"
fa-eye-slash
"
),
a
(
"
#toolEnabled > i
"
).
removeClass
(
"
fa-eye
"
),
a
(
"
#toolenabled
"
).
val
(
0
)):(
a
(
"
#toolEnabled > i
"
).
addClass
(
"
fa-eye
"
),
a
(
"
#toolEnabled > i
"
).
removeClass
(
"
fa-eye-slash
"
),
a
(
"
#toolenabled
"
).
val
(
1
)),
a
(
"
#toolFormSubmit
"
).
click
()}),
a
(
"
#toolClone
"
).
on
(
"
click
"
,
function
(){
l
=
"
clone
"
,
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_addtool
"
).
click
()}),
a
(
"
#toolRemove
"
).
on
(
"
click
"
,
function
(){
if
(
!
a
(
this
).
hasClass
(
"
disabled
"
)){
var
d
=
a
(
"
#assignfeedback_editpdfplus_edit_tool
"
),
f
=
d
.
serialize
();
e
.
call
([{
methodname
:
"
assignfeedback_editpdfplus_submit_tool_del_form
"
,
args
:{
jsonformdata
:
JSON
.
stringify
(
f
)}}])[
0
].
done
(
function
(
b
){
if
(
""
===
b
[
0
].
message
){
a
(
"
#message_edit_tool
"
).
html
(
c
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-success
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-danger
"
),
a
(
"
#editpdlplus_toolbar_
"
+
b
[
0
].
axeid
).
html
(
""
);
for
(
var
d
=
0
;
d
<
b
.
length
;
d
++
){
var
e
=
"
btn-default
"
;
1
!==
b
[
d
].
enable
&&
(
e
=
""
),
b
[
d
].
toolid
===
b
[
d
].
selecttool
&&
(
e
=
"
btn-primary
"
);
var
f
=
""
;
4
!==
b
[
d
].
typetool
&&
1
!==
b
[
d
].
typetool
||
(
f
=
"
text-decoration: underline;
"
);
var
g
=
b
[
d
].
button
;
4
!==
b
[
d
].
typetool
&&
5
!==
b
[
d
].
typetool
||
(
g
=
"
|
"
+
g
,
4
===
b
[
d
].
typetool
&&
(
g
+=
"
|
"
));
var
h
=
"
<button class='btn
"
+
e
+
"
editpdlplus_tool' id='editpdlplus_tool_
"
+
b
[
d
].
toolid
+
"
' style='
"
+
f
+
"
' value='
"
+
b
[
d
].
toolid
+
"
' data-enable='
"
+
b
[
d
].
enable
+
"
'>
"
+
g
+
"
</button>
"
;
a
(
"
#editpdlplus_toolbar_
"
+
b
[
0
].
axeid
).
append
(
h
)}
a
(
"
.editpdlplus_tool
"
).
on
(
"
click
"
,
r
),
a
(
"
#toolworkspace
"
).
html
(
""
)}
else
a
(
"
#message_edit_tool
"
).
html
(
b
[
0
].
message
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-danger
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-success
"
)}).
fail
(
b
.
exception
)}}),
p
()}.
bind
(
this
)).
fail
(
b
.
exception
)}.
bind
(
this
)).
fail
(
b
.
exception
)};
return
n
.
prototype
.
openDivAddTool
=
function
(){
var
c
=
f
.
get_string
(
"
adminaddtool_messageok
"
,
"
assignfeedback_editpdfplus
"
);
a
(
"
#editpdlplus_tool_item
"
).
html
(
""
),
a
(
"
.btn-primary
"
).
addClass
(
"
btn-default
"
),
a
(
"
.editpdlplus_tool
"
).
removeClass
(
"
btn-primary
"
);
var
g
=
a
(
"
#editpdlplus_axes option:selected
"
).
val
(),
h
=
{
axisid
:
g
};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
tooladd
"
,
j
,
h
).
done
(
function
(
d
,
f
){
q
(
a
(
"
#editpdlplus_tool_item
"
),
d
,
f
).
done
(
function
(){
"
clone
"
===
l
&&
(
a
(
"
#typetool
"
).
val
(
k
.
typetool
),
a
(
"
#color
"
).
val
(
k
.
color
),
a
(
"
#libelle
"
).
val
(
k
.
libelle
),
a
(
"
#catridgecolor
"
).
val
(
k
.
catridgecolor
),
a
(
"
#texts
"
).
val
(
k
.
texts
),
a
(
"
#button
"
).
val
(
k
.
button
),
a
(
"
#enabled
"
).
val
(
k
.
enabled
),
a
(
"
#reply
"
).
val
(
k
.
reply
),
a
(
"
#order
"
).
val
(
k
.
order
),
k
=
null
,
l
=
null
),
a
(
"
#toolFormSubmit
"
).
on
(
"
click
"
,
function
(){
var
d
=
a
(
"
#assignfeedback_editpdfplus_edit_tool
"
),
f
=
d
.
serialize
();
e
.
call
([{
methodname
:
"
assignfeedback_editpdfplus_submit_tool_add_form
"
,
args
:{
jsonformdata
:
JSON
.
stringify
(
f
)}}])[
0
].
done
(
function
(
b
){
if
(
""
===
b
[
0
].
message
){
a
(
"
#message_edit_tool
"
).
html
(
c
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-success
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-danger
"
),
a
(
"
#editpdlplus_toolbar_
"
+
b
[
0
].
axeid
).
html
(
""
);
for
(
var
d
=
0
;
d
<
b
.
length
;
d
++
){
var
e
=
"
btn-default
"
;
1
!==
b
[
d
].
enable
&&
(
e
=
""
),
b
[
d
].
toolid
===
b
[
d
].
selecttool
&&
(
e
=
"
btn-primary
"
);
var
f
=
""
;
4
!==
b
[
d
].
typetool
&&
1
!==
b
[
d
].
typetool
||
(
f
=
"
text-decoration: underline;
"
);
var
g
=
b
[
d
].
button
;
4
!==
b
[
d
].
typetool
&&
5
!==
b
[
d
].
typetool
||
(
g
=
"
|
"
+
g
,
4
===
b
[
d
].
typetool
&&
(
g
+=
"
|
"
));
var
h
=
"
<button class='btn
"
+
e
+
"
editpdlplus_tool' id='editpdlplus_tool_
"
+
b
[
d
].
toolid
+
"
' style='
"
+
f
+
"
' value='
"
+
b
[
d
].
toolid
+
"
' data-enable='
"
+
b
[
d
].
enable
+
"
'>
"
+
g
+
"
</button>
"
;
a
(
"
#editpdlplus_toolbar_
"
+
b
[
0
].
axeid
).
append
(
h
)}
a
(
"
.editpdlplus_tool
"
).
on
(
"
click
"
,
r
),
a
(
"
#editpdlplus_tool_item
"
).
html
(
""
)}
else
a
(
"
#message_edit_tool
"
).
html
(
b
[
0
].
message
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-danger
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-success
"
)}).
fail
(
b
.
exception
)})}.
bind
(
this
)).
fail
(
b
.
exception
)}.
bind
(
this
)).
fail
(
b
.
exception
)},
n
});
\ No newline at end of file
amd/build/annotation.min.js
0 → 100644
View file @
ec23e337
define
([
"
jquery
"
],
function
(
a
){
function
b
(){
return
this
.
_instanceID
=
d
(),
a
(
"
#tutu
"
).
val
(),
this
}
var
c
=
0
,
d
=
function
(){
return
++
c
};
return
b
.
getInstanceCount
=
function
(){
return
c
},
b
.
prototype
.
getInstanceID
=
function
(){
return
this
.
_instanceID
},
b
.
x
=
0
,
b
.
y
=
0
,
b
.
endx
=
0
,
b
.
endy
=
0
,
b
.
path
=
""
,
b
.
toolid
=
0
,
b
.
colour
=
"
red
"
,
b
.
tooltype
=
null
,
b
.
tooltypefamille
=
null
,
b
.
id
=
0
,
b
.
cartridgex
=
0
,
b
.
cartridgey
=
0
,
b
.
prototype
.
init
=
function
(
a
){
this
.
cartridgex
=
parseInt
(
a
.
cartridgex
,
10
)
||
0
,
this
.
cartridgey
=
parseInt
(
a
.
cartridgey
,
10
)
||
0
,
this
.
colour
=
a
.
colour
||
"
red
"
,
this
.
tooltype
=
a
.
tooltype
,
this
.
id
=
a
.
id
,
this
.
x
=
parseInt
(
a
.
x
,
10
)
||
0
,
this
.
y
=
parseInt
(
a
.
y
,
10
)
||
0
,
this
.
endx
=
parseInt
(
a
.
endx
,
10
)
||
0
,
this
.
endy
=
parseInt
(
a
.
endy
,
10
)
||
0
,
this
.
path
=
a
.
path
||
""
,
this
.
toolid
=
a
.
toolid
,
this
.
tooltypefamille
=
this
.
editor
.
typetools
[
this
.
tooltype
.
type
]},
b
.
prototype
.
draw
=
function
(){},
b
.
prototype
.
get_color
=
function
(){
var
a
=
"
black
"
;
return
a
?(
a
=
a
.
replace
(
"
rgb
"
,
"
rgba
"
),
a
=
a
.
replace
(
"
)
"
,
"
,0.5)
"
)):
a
=
this
.
colour
,
a
},
b
.
prototype
.
get_color_cartridge
=
function
(){
var
a
=
"
black
"
;
return
a
?(
a
=
a
.
replace
(
"
rgb
"
,
"
rgba
"
),
a
=
a
.
replace
(
"
)
"
,
"
,0.5)
"
)):
a
=
this
.
tooltype
.
cartridge_color
,
""
===
a
?
this
.
tooltypefamille
.
cartridge_color
:
a
},
b
.
prototype
.
init_div_cartridge_id
=
function
(){
var
a
=
(
new
Date
).
toJSON
().
replace
(
/:/g
,
""
).
replace
(
/
\.
/g
,
""
);
this
.
divcartridge
=
"
ct_
"
+
this
.
tooltype
.
id
+
"
_
"
+
a
},
b
.
prototype
.
get_div_cartridge
=
function
(
a
){
var
b
=
"
<div
"
;
b
+=
"
id='
"
+
this
.
divcartridge
+
"
'
"
,
b
+=
"
class='assignfeedback_editpdfplus_cartridge'
"
,
b
+=
"
style='border-color:
"
+
a
+
"
;'>
"
,
b
+=
"
</div>
"
;
var
c
=
Y
.
Node
.
create
(
b
);
return
this
.
editor
.
get
(
"
readonly
"
)
&&
c
.
on
(
"
click
"
,
this
.
view_annot
,
this
),
c
},
b
.
prototype
.
get_div_cartridge_label
=
function
(
a
){
var
b
=
"
<div
"
;
b
+=
"
id='
"
+
this
.
divcartridge
+
"
_cartridge'
"
,
b
+=
"
class='assignfeedback_editpdfplus_
"
+
this
.
tooltypefamille
.
label
+
"
_cartridge'
"
,
b
+=
this
.
editor
.
get
(
"
readonly
"
)
&&
""
===
this
.
get_valref
()?
"
style='border-right:none;padding-right:0px;color:
"
+
a
+
"
;'
"
:
"
style='border-right-color:
"
+
a
+
"
;color:
"
+
a
+
"
;'
"
,
b
+=
"
>
"
,
b
+=
this
.
tooltype
.
cartridge
,
b
+=
"
</div>
"
;
var
c
=
Y
.
Node
.
create
(
b
);
return
c
},
b
.
prototype
.
get_div_input
=
function
(
a
){
var
b
=
"
<div
"
;
b
+=
"
id='
"
+
this
.
divcartridge
+
"
_display'
"
,
b
+=
"
style='color:
"
+
a
+
"
;
"
,
this
.
editor
.
get
(
"
readonly
"
)
&&
""
===
this
.
get_valref
()
&&
(
b
+=
"
padding:0px;
"
),
b
+=
"
'></div>
"
;
var
c
=
Y
.
Node
.
create
(
b
);
return
this
.
editor
.
get
(
"
readonly
"
)
||
c
.
on
(
"
click
"
,
this
.
edit_annot
,
this
),
c
},
b
.
prototype
.
get_div_edition
=
function
(){
var
a
=
"
<div
"
;
a
+=
"
id='
"
+
this
.
divcartridge
+
"
_edit'
"
,
a
+=
"
class='assignfeedback_editpdfplus_
"
+
this
.
tooltypefamille
.
label
+
"
_edition'
"
,
a
+=
"
style='display:none;'>
"
,
a
+=
"
<textarea id='
"
+
this
.
divcartridge
+
"
_editinput' type='text' value=
\"
"
+
this
.
get_valref
()
+
"
\"
class='form-control' style='margin-bottom:5px;' >
"
+
this
.
get_valref
()
+
"
</textarea>
"
,
a
+=
"
</div>
"
;
var
b
=
Y
.
Node
.
create
(
a
),
c
=
this
.
tooltype
.
texts
;
if
(
c
&&
c
.
length
>
0
){
for
(
var
d
=
"
<div></div>
"
,
e
=
Y
.
Node
.
create
(
d
),
f
=
c
.
split
(
'
","
'
),
g
=
0
;
g
<
f
.
length
;
g
++
){
var
h
=
"
<button class='btn btn-default' type='button' style='width:100%;font-size: x-small;'>
"
+
f
[
g
].
replace
(
'
"
'
,
""
)
+
"
</button>
"
,
i
=
Y
.
Node
.
create
(
h
);
i
.
on
(
"
click
"
,
this
.
fill_input_edition
,
this
,
f
[
g
].
replace
(
'
"
'
,
""
)),
e
.
append
(
i
),
e
.
append
(
"
<br/>
"
)}
b
.
append
(
e
)}
return
b
},
b
.
prototype
.
get_div_container
=
function
(
a
){
var
b
=
"
<div
"
;
b
+=
"
class='assignfeedback_editpdfplus_
"
+
this
.
tooltypefamille
.
label
+
"
_conteneur' >
"
,
b
+=
"
</div>
"
;
var
c
=
Y
.
Node
.
create
(
b
),
d
=
this
.
get_div_input
(
a
);
d
.
addClass
(
"
assignfeedback_editpdfplus_
"
+
this
.
tooltypefamille
.
label
+
"
_input
"
);
var
e
=
1
;(
this
.
displaylock
||
this
.
displaylock
>=
0
)
&&
(
e
=
this
.
displaylock
);
var
f
=
Y
.
Node
.
create
(
"
<input type='hidden' id='
"
+
this
.
divcartridge
+
"
_onof' value=
"
+
e
+
"
/>
"
),
g
=
this
.
editor
.
get
(
"
readonly
"
);
return
g
||
d
.
on
(
"
click
"
,
this
.
edit_annot
,
this
),
c
.
append
(
d
),
c
.
append
(
f
),
c
.
append
(
this
.
get_input_question
()),
g
=
this
.
editor
.
get
(
"
readonly
"
),
g
?
c
.
append
(
this
.
get_button_student_status
()):(
c
.
append
(
this
.
get_button_visibility_left
()),
c
.
append
(
this
.
get_button_visibility_right
()),
c
.
append
(
this
.
get_button_save
()),
c
.
append
(
this
.
get_button_cancel
()),
1
===
this
.
tooltype
.
reply
&&
c
.
append
(
this
.
get_button_question
()),
c
.
append
(
this
.
get_button_remove
())),
c
},
b
.
prototype
.
get_button_visibility_right
=
function
(){
var
a
=
"
<button id='
"
+
this
.
divcartridge
+
"
_buttonedit_right' class='btn btn-default' type='button'>
"
;
a
+=
"
<i class='fa fa-arrow-right' aria-hidden='true'></i>
"
,
a
+=
"
</button>
"
;
var
b
=
Y
.
Node
.
create
(
a
);
return
b
.
on
(
"
click
"
,
this
.
change_visibility_annot
,
this
,
"
r
"
),
b
},
b
.
prototype
.
get_button_visibility_left
=
function
(){
var
a
=
"
<button id='
"
+
this
.
divcartridge
+
"
_buttonedit_left' class='btn btn-default' type='button'>
"
;
a
+=
"
<i class='fa fa-arrow-left' aria-hidden='true'></i>
"
,
a
+=
"
</button>
"
;
var
b
=
Y
.
Node
.
create
(
a
);
return
b
.
on
(
"
click
"
,
this
.
change_visibility_annot
,
this
,
"
l
"
),
b
},
b
.
prototype
.
get_button_cancel
=
function
(){
var
a
=
"
<button id='
"
+
this
.
divcartridge
+
"
_buttoncancel' style='display:none;' class='btn btn-default' type='button'><i class='fa fa-undo' aria-hidden='true'></i></button>
"
,
b
=
Y
.
Node
.
create
(
a
);
return
b
.
on
(
"
click
"
,
this
.
cancel_edit
,
this
),
b
},
b
.
prototype
.
get_button_question
=
function
(){
var
a
=
"
<button id='
"
+
this
.
divcartridge
+
'
_buttonquestion
\'
style=
\'
display:none;margin-left:10px;
\'
class=
\'
btn btn-default
\'
type=
\'
button
\'
><span class="fa-stack fa-lg" style="line-height: 1em;width: 1em;"><i class="fa fa-question-circle-o fa-stack-1x"></i><i class="fa fa-ban fa-stack-1x text-danger"></i></span></button>
'
,
b
=
Y
.
Node
.
create
(
a
);
return
b
.
on
(
"
click
"
,
this
.
change_question_status
,
this
),
b
},
b
.
prototype
.
get_button_remove
=
function
(){
var
a
=
"
<button id='
"
+
this
.
divcartridge
+
"
_buttonremove' style='display:none;margin-left:10px;' class='btn btn-default' type='button'><i class='fa fa-trash' aria-hidden='true'></i></button>
"
,
b
=
Y
.
Node
.
create
(
a
);
return
b
.
on
(
"
click
"
,
this
.
remove_by_trash
,
this
),
b
},
b
.
prototype
.
apply_visibility_annot
=
function
(){
var
a
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_display
"
),
b
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_onof
"
),
c
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonedit_right
"
),
d
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonedit_left
"
),
e
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_radioContainer
"
);
b
&&
(
"
1
"
===
b
.
get
(
"
value
"
)?(
c
&&
c
.
show
(),
d
&&
d
.
show
()):
"
0
"
===
b
.
get
(
"
value
"
)?(
c
&&
c
.
show
(),
d
&&
d
.
hide
()):(
c
&&
c
.
hide
(),
d
&&
d
.
show
())),
a
&&
a
.
setContent
(
this
.
get_text_to_diplay_in_cartridge
()),
"
frame
"
===
this
.
tooltypefamille
.
label
&&
c
&&
(
c
.
hide
(),
d
.
hide
()),
e
&&
e
.
hide
(),
this
.
apply_question_status
()},
b
.
prototype
.
get_text_to_diplay_in_cartridge
=
function
(){
var
a
=
this
.
get_valref
(),
b
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_onof
"
),
c
=
""
;
return
""
!==
a
||
this
.
editor
.
get
(
"
readonly
"
)
||
(
c
=
"
 
"
),
"
1
"
===
b
.
get
(
"
value
"
)
&&
""
!==
a
?
c
=
a
.
substr
(
0
,
20
):
"
0
"
===
b
.
get
(
"
value
"
)
&&
""
!==
a
?
c
=
"
...
"
:
""
!==
a
&&
(
c
=
a
),
1
===
this
.
answerrequested
&&
(
c
+=
'
<span style="color:red;">[?]</span>
'
),
c
},
b
.
prototype
.
apply_question_status
=
function
(){
var
a
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonquestion
"
),
b
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_question
"
),
c
=
0
;
b
&&
(
c
=
parseInt
(
b
.
get
(
"
value
"
),
10
)),
a
&&
(
1
===
c
?
a
.
setHTML
(
'
<i class="fa fa-question-circle-o"></i>
'
):
a
.
setHTML
(
'
<span class="fa-stack fa-lg" style="line-height: 1em;width: 1em;"><i class="fa fa-question-circle-o fa-stack-1x"></i><i class="fa fa-ban fa-stack-1x text-danger"></i></span>
'
))},
b
.
prototype
.
draw_catridge
=
function
(){
return
!
0
},
b
.
prototype
.
edit_annot
=
function
(){
if
(
!
this
.
parent_annot_element
){
var
a
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
),
b
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_display
"
),
c
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_edit
"
),
d
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonedit_right
"
),
e
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonedit_left
"
),
f
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonsave
"
),
g
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttoncancel
"
),
h
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonquestion
"
),
i
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonrotation
"
),
j
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonremove
"
),
k
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_editinput
"
);
b
.
hide
(),
d
&&
d
.
hide
(),
e
&&
e
.
hide
(),
i
&&
i
.
hide
(),
c
.
show
(),
f
.
show
(),
g
.
show
(),
h
&&
h
.
show
(),
j
.
show
(),
a
.
setStyle
(
"
z-index
"
,
1
e3
),
k
&&
k
.
set
(
"
focus
"
,
"
on
"
),
this
.
disabled_canvas_event
(),
a
.
on
(
"
clickoutside
"
,
this
.
save_annot_clickout
,
this
,
"
clickoutside
"
)}},
b
.
prototype
.
fill_input_edition
=
function
(
a
,
b
){
var
c
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_editinput
"
);
c
&&
c
.
set
(
"
value
"
,
b
),
this
.
save_annot
(
b
)},
b
.
prototype
.
save_annot_clickout
=
function
(
a
,
b
){
"
clickoutside
"
===
b
&&
this
.
editor
.
currentannotation
===
this
||
this
.
save_annot
(
null
)},
b
.
prototype
.
save_annot
=
function
(
a
){
if
(
"
string
"
!=
typeof
a
){
var
b
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_editinput
"
);
b
&&
(
a
=
b
.
get
(
"
value
"
))}
this
.
textannot
=
a
,
this
.
editor
.
save_current_page
(),
0
===
a
.
length
&&
(
a
=
"
"
),
this
.
hide_edit
(),
this
.
apply_visibility_annot
()},
b
.
prototype
.
cancel_edit
=
function
(
a
,
b
){
if
(
"
clickoutside
"
!==
b
||
this
.
editor
.
currentannotation
!==
this
){
var
c
=
this
.
get_valref
(),
d
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_editinput
"
);
c
&&
d
&&
d
.
set
(
"
value
"
,
c
),
this
.
hide_edit
(),
this
.
apply_visibility_annot
();
var
e
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
);
e
&&
e
.
detach
()}},
b
.
prototype
.
hide_edit
=
function
(
a
,
b
){
if
(
!
b
||
"
clickoutside
"
!==
b
||
this
.
editor
.
currentannotation
!==
this
){
var
c
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
),
d
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_display
"
),
e
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_edit
"
),
f
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_visu
"
),
g
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonsave
"
),
h
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttoncancel
"
),
i
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonquestion
"
),
j
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonrotation
"
),
k
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_buttonremove
"
),
l
=
this
.
editor
.
get_dialogue_element
(
"
#
"
+
this
.
divcartridge
+
"
_radioContainer
"
);
d
&&
(
d
.
show
(),
d
.
set
(
"
style
"
,
"
display:inline;color:
"
+
this
.
get_color_cartridge
()
+
"
;
"
)),
j
&&
j
.
show
(),
e
&&
(
e
.
hide
(),
g
.
hide
(),
h
.
hide
()),
f
&&
f
.
hide
(),
i
&&
i
.
hide
(),
k
&&
k
.
hide
(),
c
&&
(
c
.
setStyle
(
"
z-index
"
,
1
),
c
.
detach
(),
this
.
editor
.
get
(
"
readonly
"
)
&&
c
.
on
(
"
click
"
,
this
.
view_annot
,
this
,
"
click
"
)),
e
&&
this
.
enabled_canvas_event
(),
l
&&
l
.
hide
()}},
b
});
\ No newline at end of file
amd/build/annotationhighlightplus.min.js
0 → 100644
View file @
ec23e337
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
.
colour
),
a
(
"
#
"
+
this
.
id
).
css
(
"
width
"
,
this
.
endx
-
this
.
x
),
a
(
"
#
"
+
this
.
id
).
css
(
"
height
"
,
this
.
endy
-
this
.
y
),
a
(
"
#
"
+
this
.
id
).
css
(
"
opacity
"
,.
5
),
a
(
"
#
"
+
this
.
id
).
css
(
"
float
"
,
"
left
"
),
a
(
"
#
"
+
this
.
id
).
css
(
"
margin-top
"
,
this
.
x
),
a
(
"
#
"
+
this
.
id
).
css
(
"
margin-left
"
,
this
.
y
)}},
c
});
\ No newline at end of file
amd/build/annotationstampplus.min.js
0 → 100644
View file @
ec23e337
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
(
"
position
"
,
"
absolue
"
),
a
(
"
#
"
+
this
.
id
).
css
(
"
margin-top
"
,
this
.
x
),
a
(
"
#
"
+
this
.
id
).
css
(
"
margin-left
"
,
this
.
y
),
a
(
"
#
"
+
this
.
id
).
css
(
"
color
"
,
this
.
colour
),
a
(
"
#
"
+
this
.
id
).
css
(
"
border
"
,
"
2px solid
"
+
this
.
colour
),
a
(
"
#
"
+
this
.
id
).
css
(
"
padding
"
,
"
0 2px
"
),
a
(
"
#
"
+
this
.
id
).
css
(
"
display
"
,
"
inline-block
"
),
a
(
"
#
"
+
this
.
id
).
append
(
this
.
tooltype
.
button
)}},
c
});
\ No newline at end of file
amd/src/admin_panel.js
View file @
ec23e337
...
...
@@ -21,22 +21,28 @@
* @module mod_assignfeedback_editpdfplus/admin_panel
*/
define
([
'
jquery
'
/*, 'core/yui'*/
,
'
core/notification
'
,
'
core/templates
'
,
'
core/fragment
'
,
'
core/ajax
'
,
'
core/str
'
/*, 'mod_assign/grading_form_change_checker'*/
],
function
(
$
/*, Y*/
,
notification
,
templates
,
fragment
,
ajax
,
str
/*, checker*/
)
{
'
core/ajax
'
,
'
core/str
'
,
/*'mod_assign/grading_form_change_checker'*/
'
assignfeedback_editpdfplus/annotation
'
,
'
assignfeedback_editpdfplus/annotationhighlightplus
'
,
'
assignfeedback_editpdfplus/annotationstampplus
'
],
function
(
$
/*, Y*/
,
notification
,
templates
,
fragment
,
ajax
,
str
,
Annotation
,
AnnotationHighlightplus
,
AnnotationStampplus
/*, checker*/
)
{
var
contextid
=
null
;
var
currentTool
=
null
;
var
action
=
null
;
var
typetools
=
null
;
/**
* AdminPanel class.
*
* @class AdminPanel
*/
var
AdminPanel
=
function
(
contextidP
)
{
var
AdminPanel
=
function
(
contextidP
,
typetoolsP
)
{
//this.registerEventListeners();
this
.
init
();
contextid
=
contextidP
;
typetools
=
JSON
.
parse
(
typetoolsP
);
};
AdminPanel
.
annotationcurrent
=
null
;
//
//AdminPanel.prototype.contextid;
//
...
...
@@ -75,7 +81,17 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$
(
this
.
selectTool
).
addClass
(
"
btn-primary
"
);
};
//
AdminPanel
.
prototype
.
initCanevas
=
function
()
{
var
getTypeTool
=
function
(
toolid
)
{
for
(
var
i
=
0
;
i
<
typetools
.
length
;
i
++
)
{
if
(
typetools
[
i
].
id
==
toolid
)
{
return
typetools
[
i
];
}
}
};
//
var
initCanevas
=
function
()
{
$
(
'
#canevas
'
).
html
(
""
);
this
.
annotationcurrent
=
null
;
var
typetool
=
parseInt
(
$
(
"
#typetool
"
).
val
());
if
(
typetool
===
3
||
typetool
===
4
||
typetool
===
7
)
{
$
(
'
#canevas
'
).
css
(
"
background-image
"
,
"
url(
"
+
$
(
"
#map01
"
).
val
()
+
"
)
"
);
...
...
@@ -84,6 +100,29 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
}
else
if
(
typetool
===
5
)
{
$
(
'
#canevas
'
).
css
(
"
background-image
"
,
"
url(
"
+
$
(
"
#map03
"
).
val
()
+
"
)
"
);
}
if
(
typetool
===
1
)
{
this
.
annotationcurrent
=
new
AnnotationHighlightplus
();
this
.
annotationcurrent
.
x
=
83
;
this
.
annotationcurrent
.
y
=
82
;
this
.
annotationcurrent
.
endx
=
239
;
this
.
annotationcurrent
.
endy
=
98
;
}
else
if
(
typetool
===
3
)
{
this
.
annotationcurrent
=
new
AnnotationStampplus
();
this
.
annotationcurrent
.
x
=
108
;
this
.
annotationcurrent
.
y
=
50
;
}
if
(
this
.
annotationcurrent
)
{
var
typetoolEntity
=
getTypeTool
(
typetool
);
this
.
annotationcurrent
.
tooltype
=
currentTool
;
if
(
currentTool
.
color
)
{
this
.
annotationcurrent
.
colour
=
currentTool
.
color
;
}
else
{
this
.
annotationcurrent
.
colour
=
typetoolEntity
.
color
;
}
this
.
annotationcurrent
.
tooltypefamille
=
typetoolEntity
;
this
.
annotationcurrent
.
id
=
'
previsu_annot
'
;
this
.
annotationcurrent
.
draw
(
$
(
'
#canevas
'
));
}
};
//
AdminPanel
.
prototype
.
openDivAddAxis
=
function
()
{
...
...
@@ -176,6 +215,16 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
.
done
(
function
(
html
,
js
)
{
fillResultAjax
(
$
(
'
#editpdlplus_tool_item
'
),
html
,
js
)
.
done
(
function
()
{
currentTool
=
new
Object
();
currentTool
.
typetool
=
$
(
"
#typetool
"
).
val
();
currentTool
.
color
=
$
(
"
#color
"
).
val
();
currentTool
.
libelle
=
$
(
"
#libelle
"
).
val
();
currentTool
.
catridgecolor
=
$
(
"
#catridgecolor
"
).
val
();
currentTool
.
texts
=
$
(
"
#texts
"
).
val
();
currentTool
.
button
=
$
(
"
#button
"
).
val
();
currentTool
.
enabled
=
$
(
"
#enabled
"
).
val
();
currentTool
.
reply
=
$
(
"
#reply
"
).
val
();
currentTool
.
order
=
$
(
"
#order
"
).
val
();
$
(
"
#toolFormSubmit
"
).
on
(
"
click
"
,
function
()
{
var
form
=
$
(
'
#assignfeedback_editpdfplus_edit_tool
'
);
var
data
=
form
.
serialize
();
...
...
@@ -247,16 +296,6 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
});
$
(
"
#toolClone
"
).
on
(
"
click
"
,
function
()
{
action
=
"
clone
"
;
currentTool
=
new
Object
();
currentTool
.
typetool
=
$
(
"
#typetool
"
).
val
();
currentTool
.
color
=
$
(
"
#color
"
).
val
();
currentTool
.
libelle
=
$
(
"
#libelle
"
).
val
();
currentTool
.
catridgecolor
=
$
(
"
#catridgecolor
"
).
val
();
currentTool
.
texts
=
$
(
"
#texts
"
).
val
();
currentTool
.
button
=
$
(
"
#button
"
).
val
();
currentTool
.
enabled
=
$
(
"
#enabled
"
).
val
();
currentTool
.
reply
=
$
(
"
#reply
"
).
val
();
currentTool
.
order
=
$
(
"
#order
"
).
val
();
$
(
"
#assignfeedback_editpdfplus_widget_admin_button_addtool
"
).
click
();
});
$
(
"
#toolRemove
"
).
on
(
"
click
"
,
function
()
{
...
...
@@ -319,15 +358,7 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
}
});
//maj affichage previsu
//this.initCanevas();
var
typetool
=
parseInt
(
$
(
"
#typetool
"
).
val
());
if
(
typetool
===
3
||
typetool
===
4
||
typetool
===
7
)
{
$
(
'
#canevas
'
).
css
(
"
background-image
"
,
"
url(
"
+
$
(
"
#map01
"
).
val
()
+
"
)
"
);
}
else
if
(
typetool
===
1
||
typetool
===
6
)
{
$
(
'
#canevas
'
).
css
(
"
background-image
"
,
"
url(
"
+
$
(
"
#map02
"
).
val
()
+
"
)
"
);
}
else
if
(
typetool
===
5
)
{
$
(
'
#canevas
'
).
css
(
"
background-image
"
,
"
url(
"
+
$
(
"
#map03
"
).
val
()
+
"
)
"
);
}
initCanevas
();
}.
bind
(
this
)).
fail
(
notification
.
exception
);
//templates.appendNodeContents('#editpdlplus_tool_item', html, js).done(function () {
//alert("jdikdi");
...
...
amd/src/annotation.js
0 → 100644
View file @
ec23e337
This diff is collapsed.
Click to expand it.
amd/src/annotationhighlightplus.js
0 → 100644
View file @
ec23e337
// 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
AnnotationHighlightplus
()
{
// Call the super constructor.
Annotation
.
call
(
this
);
// Return this object reference.
return
(
this
);
}
// The Friend class extends the base Model class.
AnnotationHighlightplus
.
prototype
=
Object
.
create
(
Annotation
.
prototype
);
/**
* Draw a highlight annotation
* @protected
* @method draw
* @return M.assignfeedback_editpdfplus.drawable
*/
AnnotationHighlightplus
.
prototype
.
draw
=
function
(
canevas
)
{
if
(
canevas
)
{
var
divHighlight
=
"
<div id='
"
+
this
.
id
+
"
'></div>
"
;
canevas
.
append
(
divHighlight
);
$
(
"
#
"
+
this
.
id
).
css
(
'
background-color
'
,
this
.
colour
);
$
(
"
#
"
+
this
.
id
).
css
(
'
width
'
,
this
.
endx
-
this
.
x
);
$
(
"
#
"
+
this
.
id
).
css
(
'
height
'
,
this
.
endy
-
this
.
y
);
$
(
"
#
"
+
this
.
id
).
css
(
'
opacity
'
,
.
5
);
$
(
"
#
"
+
this
.
id
).
css
(
'
float
'
,
'
left
'
);
$
(
"
#
"
+
this
.
id
).
css
(
'
margin-top
'
,
this
.
x
);
$
(
"
#
"
+
this
.
id
).
css
(
'
margin-left
'
,
this
.
y
);
}
/* shape = this.editor.graphic.addShape({
type: Y.Rect,
width: bounds.width,
height: bounds.height,
stroke: false,
fill: {
color: highlightcolour,
opacity: 0.5
},
x: bounds.x,
y: bounds.y
});*/
/*drawable.shapes.push(shape);
this.drawable = drawable;*/
//this.draw_catridge();
return
;
};
return
AnnotationHighlightplus
;
});
\ No newline at end of file
amd/src/annotationstampplus.js
0 → 100644
View file @
ec23e337
// 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
AnnotationStampplus
()
{
// Call the super constructor.
Annotation
.
call
(
this
);
// Return this object reference.
return
(
this
);
}
// The Friend class extends the base Model class.
AnnotationStampplus
.
prototype
=
Object
.
create
(
Annotation
.
prototype
);
/**
* Draw a highlight annotation
* @protected
* @method draw
* @return M.assignfeedback_editpdfplus.drawable
*/
AnnotationStampplus
.
prototype
.
draw
=
function
(
canevas
)
{
if
(
canevas
)
{
var
divStamp
=
"
<div id='
"
+
this
.
id
+
"
'></div>
"
;
canevas
.
append
(
divStamp
);
$
(
"
#
"
+
this
.
id
).
css
(
'
position
'
,
'
absolue
'
);
$
(
"
#
"
+
this
.
id
).
css
(
'
margin-top
'
,
this
.
x
);
$
(
"
#
"
+
this
.
id
).
css
(
'
margin-left
'
,
this
.
y
);
$
(
"
#
"
+
this
.
id
).
css
(
'
color
'
,
this
.
colour
);
$
(
"
#
"
+
this
.
id
).
css
(
'
border
'
,
'
2px solid
'
+
this
.
colour
);
$
(
"
#
"
+
this
.
id
).
css
(
'
padding
'
,
'
0 2px
'
);
$
(
"
#
"
+
this
.
id
).
css
(
'
display
'
,
'
inline-block
'
);
$
(
"
#
"
+
this
.
id
).
append
(
this
.
tooltype
.
button
);
}
return
this
;
};
return
AnnotationStampplus
;
});
\ No newline at end of file
classes/widget_admin.php
View file @
ec23e337
...
...
@@ -59,12 +59,13 @@ class widget_admin implements renderable, templatable {
* @param tool[] $toolbars - the different tool to display
* @param axis[] $axis - the different axis to display
*/
public
function
__construct
(
$context
,
$course
,
$userid
,
$toolbars
,
$axis
)
{
public
function
__construct
(
$context
,
$course
,
$userid
,
$toolbars
,
$axis
,
$typetools
)
{
$this
->
context
=
$context
;
$this
->
course
=
$course
;
$this
->
userid
=
$userid
;
$this
->
toolbars
=
$toolbars
;
$this
->
axis
=
$axis
;
$this
->
toollibs
=
json_encode
(
$typetools
);
}
public
function
export_for_template
(
\
renderer_base
$output
)
{
...
...
locallib_admin.php
View file @
ec23e337
...
...
@@ -152,7 +152,7 @@ class assign_feedback_editpdfplus_admin {
}
$data
->
tools
=
admin_editor
::
get_typetools
();
foreach
(
$data
->
tools
as
$toolRef
)
{
$toolRef
->
libelle
=
get_string
(
'typetool_'
.
$toolRef
->
label
,
'assignfeedback_editpdfplus'
);
$toolRef
->
libelle
=
get_string
(
'typetool_'
.
$toolRef
->
label
,
'assignfeedback_editpdfplus'
);
}
$renderer
=
$PAGE
->
get_renderer
(
'assignfeedback_editpdfplus'
);
//$formTool->courseid = $this->course->id;
...
...
@@ -168,6 +168,7 @@ class assign_feedback_editpdfplus_admin {
$coursecontext
=
context
::
instance_by_id
(
$this
->
context
->
id
);
$coursecontexts
=
array_filter
(
explode
(
'/'
,
$coursecontext
->
path
),
'strlen'
);
$tools
=
page_editor
::
get_tools
(
$coursecontexts
);
$typetools
=
page_editor
::
get_typetools
(
null
);
$axis
=
page_editor
::
get_axis
(
array
(
$this
->
context
->
id
));
foreach
(
$axis
as
$ax
)
{
$ax
->
children
=
0
;
...
...
@@ -196,7 +197,7 @@ class assign_feedback_editpdfplus_admin {
}
$toolbars
[]
=
$toolbar
;
}
$widget
=
new
widget_admin
(
$this
->
context
,
$this
->
course
,
$USER
,
$toolbars
,
$axis
);
$widget
=
new
widget_admin
(
$this
->
context
,
$this
->
course
,
$USER
,
$toolbars
,
$axis
,
$typetools
);
return
$widget
;
}
...
...
templates/admin.mustache
View file @
ec23e337
...
...
@@ -76,6 +76,6 @@
{{#
js
}}
require(['assignfeedback_editpdfplus/admin_panel'], function(AdminPanel) {
var adminpanel = new AdminPanel(
{{
context
.
id
}}
);
var adminpanel = new AdminPanel(
{{
context
.
id
}}
,'
{{{
toollibs
}}}
'
);
});
{{/
js
}}
\ No newline at end of file
templates/tool_form.mustache
View file @
ec23e337
...
...
@@ -99,20 +99,20 @@
<div
id=
"collapse4"
class=
"panel-collapse collapse"
>
<div
class=
"panel-body"
style=
"margin-bottom: 80px;"
>
<div
class=
"form-group"
>
<label
class=
"control-label col-sm-3"
for=
"color"
>
{{#
str
}}
admintoolboxannotation_color, assignfeedback_editpdfplus
{{/
str
}}
Couleur
</label>
<label
class=
"control-label col-sm-3"
for=
"color"
>
{{#
str
}}
admintoolboxannotation_color, assignfeedback_editpdfplus
{{/
str
}}
</label>
<div
class=
"col-sm-9"
>
<input
type=
"text"
class=
"form-control"
id=
"color"
placeholder=
"
{{^
tool
.
colors
}}
-
{{/
tool
.
colors
}}
"
value=
"
{{#
tool
.
colors
}}{{
tool
.
colors
}}{{/
tool
.
colors
}}
"
name=
"color"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-sm-3"
for=
"texts"
>
{{#
str
}}
admintoolboxannotation_texts, assignfeedback_editpdfplus
{{/
str
}}
Texte prédéfinis
</label>
<label
class=
"control-label col-sm-3"
for=
"texts"
>
{{#
str
}}
admintoolboxannotation_texts, assignfeedback_editpdfplus
{{/
str
}}
</label>
<div
class=
"col-sm-9"
>
<input
type=
"text"
class=
"form-control"
id=
"texts"
value=
"
{{
tool
.
texts
}}
"
name=
"texts"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-sm-3"
for=
"reply"
>
{{#
str
}}
admintoolboxannotation_reply, assignfeedback_editpdfplus
{{/
str
}}
Question/réponse
</label>
<label
class=
"control-label col-sm-3"
for=
"reply"
>
{{#
str
}}
admintoolboxannotation_reply, assignfeedback_editpdfplus
{{/
str
}}
</label>
<div
class=
"col-sm-9"
>
<input
type=
"checkbox"
class=
"form-control"
id=
"reply"
{{#
tool
.
reply
}}
checked
{{/
tool
.
reply
}}
name=
"reply"
/>
</div>
...
...
@@ -135,7 +135,7 @@
<input
id=
'map01'
type=
'hidden'
value=
'
{{
map01
}}
'
/>
<input
id=
'map02'
type=
'hidden'
value=
'
{{
map02
}}
'
/>
<input
id=
'map03'
type=
'hidden'
value=
'
{{
map03
}}
'
/>
<!--
{{#
pix
}}
cross, assignfeedback_editpdfplus, previsu
{{/
pix
}}
-->
<!--
{{#
pix
}}
cross, assignfeedback_editpdfplus, previsu
{{/
pix
}}
-->
<div
id=
"canevas"
style=
"background-image: url('
{{
map01
}}
');background-repeat: no-repeat; border-width: 1px; border-style: solid; height: 330px;"
>
</div>
</div>
...
...
Write
Preview
Supports
Markdown
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