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
824165fd
Commit
824165fd
authored
Aug 11, 2017
by
M. Chardon
Browse files
manipulation axes
parent
1daa79c5
Changes
6
Hide whitespace changes
Inline
Side-by-side
amd/build/admin_panel.min.js
View file @
824165fd
define
([
"
jquery
"
,
"
core/notification
"
,
"
core/templates
"
,
"
core/fragment
"
,
"
core/ajax
"
,
"
core/str
"
,
"
assignfeedback_editpdfplus/annotation
"
,
"
assignfeedback_editpdfplus/annotationhighlightplus
"
,
"
assignfeedback_editpdfplus/annotationstampplus
"
,
"
assignfeedback_editpdfplus/annotationframe
"
,
"
assignfeedback_editpdfplus/annotationcommentplus
"
,
"
assignfeedback_editpdfplus/annotationverticalline
"
,
"
assignfeedback_editpdfplus/annotationstampcomment
"
],
function
(
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
,
k
,
l
,
m
){
var
n
=
null
,
o
=
null
,
p
=
null
,
q
=
null
,
r
=
function
(
a
,
b
){
n
=
a
,
q
=
JSON
.
parse
(
b
),
this
.
init
()},
s
=
null
;
r
.
prototype
.
selectTool
=
null
,
r
.
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
"
,
w
),
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
),
a
(
"
.btn-primary
"
).
click
()},
r
.
prototype
.
test
=
function
(){
alert
(
"
test
"
),
w
()},
r
.
prototype
.
initTool
=
function
(){
a
(
this
.
selectTool
).
removeClass
(
"
btn-default
"
),
a
(
this
.
selectTool
).
addClass
(
"
btn-primary
"
)},
r
.
prototype
.
refreshPrevisu
=
function
(){
o
.
typetool
=
a
(
"
#typetool
"
).
val
(),
o
.
color
=
a
(
"
#color
"
).
val
(),
o
.
libelle
=
a
(
"
#libelle
"
).
val
(),
o
.
catridgecolor
=
a
(
"
#cartridgecolor
"
).
val
(),
o
.
texts
=
a
(
"
#texts
"
).
val
(),
o
.
button
=
a
(
"
#button
"
).
val
(),
o
.
enabled
=
a
(
"
#enabled
"
).
val
(),
o
.
reply
=
0
,
a
(
"
#reply
"
).
is
(
"
:checked
"
)
&&
(
o
.
reply
=
1
),
o
.
order
=
a
(
"
#order
"
).
val
(),
u
()};
var
t
=
function
(
a
){
for
(
var
b
=
0
;
b
<
q
.
length
;
b
++
)
if
(
q
[
b
].
id
==
a
)
return
q
[
b
]},
u
=
function
(){
a
(
"
#canevas
"
).
html
(
""
),
s
=
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
)
s
=
new
h
;
else
if
(
3
===
b
)
s
=
new
i
;
else
if
(
4
===
b
){
s
=
new
j
;
var
c
=
new
j
}
else
5
===
b
?
s
=
new
l
:
6
===
b
?
s
=
new
m
:
7
===
b
&&
(
s
=
new
k
);
if
(
s
){
var
d
=
t
(
b
);
o
.
reply
=
0
,
a
(
"
#reply
"
).
is
(
"
:checked
"
)
&&
(
o
.
reply
=
1
),
s
.
initAdminDemo
(
o
,
d
),
s
.
draw
(
a
(
"
#canevas
"
)),
c
&&
(
c
.
initChildAdminDemo
(
s
),
c
.
draw
(
a
(
"
#canevas
"
)))}};
r
.
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
"
,
n
,
e
).
done
(
function
(
a
,
b
){
c
.
appendNodeContents
(
"
#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body
"
,
a
,
b
)}.
bind
(
this
)).
fail
(
b
.
exception
)},
r
.
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
"
,
n
,
f
).
done
(
function
(
a
,
b
){
c
.
appendNodeContents
(
"
#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body
"
,
a
,
b
)}.
bind
(
this
)).
fail
(
b
.
exception
)},
r
.
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
"
,
n
,
f
).
done
(
function
(
a
,
b
){
c
.
appendNodeContents
(
"
#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body
"
,
a
,
b
)}.
bind
(
this
)).
fail
(
b
.
exception
)};
var
v
=
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
()},
w
=
function
(){
var
c
=
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
()
!==
c
&&
a
(
this
).
addClass
(
"
btn-default
"
)}),
a
(
this
).
addClass
(
"
btn-primary
"
),
a
(
"
#editpdlplus_tool_item
"
).
html
(
""
);
var
f
=
{
toolid
:
c
};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
tooledit
"
,
n
,
f
).
done
(
function
(
c
,
d
){
v
(
a
(
"
#editpdlplus_tool_item
"
),
c
,
d
).
done
(
function
(){
o
=
new
Object
,
o
.
typetool
=
a
(
"
#typetool
"
).
val
(),
o
.
color
=
a
(
"
#color
"
).
val
(),
o
.
libelle
=
a
(
"
#libelle
"
).
val
(),
o
.
catridgecolor
=
a
(
"
#cartridgecolor
"
).
val
(),
o
.
texts
=
a
(
"
#texts
"
).
val
(),
o
.
button
=
a
(
"
#button
"
).
val
(),
o
.
enabled
=
a
(
"
#enabled
"
).
val
(),
o
.
reply
=
a
(
"
#reply
"
).
val
(),
o
.
order
=
a
(
"
#order
"
).
val
(),
a
(
"
#toolFormSubmit
"
).
on
(
"
click
"
,
function
(){
var
c
=
""
;
a
(
"
input[name^='text[']
"
).
each
(
function
(){
a
(
this
).
val
()
&&
a
(
this
).
val
().
length
>
0
&&
(
c
+=
'
"
'
+
a
(
this
).
val
().
replace
(
/"/g
,
""
)
+
'
",
'
)}),
c
.
length
>
0
&&
a
(
"
#texts
"
).
val
(
c
.
substring
(
0
,
c
.
length
-
1
));
var
d
=
a
(
"
#assignfeedback_editpdfplus_edit_tool
"
),
f
=
d
.
serialize
();
e
.
call
([{
methodname
:
"
assignfeedback_editpdfplus_submit_tool_edit_form
"
,
args
:{
jsonformdata
:
JSON
.
stringify
(
f
)}}])[
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
"
,
w
),
w
()}
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
(){
p
=
"
clone
"
,
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_addtool
"
).
click
()}),
a
(
"
#toolRemove
"
).
on
(
"
click
"
,
function
(){
if
(
!
a
(
this
).
hasClass
(
"
disabled
"
)){
var
c
=
a
(
"
#assignfeedback_editpdfplus_edit_tool
"
),
d
=
c
.
serialize
();
e
.
call
([{
methodname
:
"
assignfeedback_editpdfplus_submit_tool_del_form
"
,
args
:{
jsonformdata
:
JSON
.
stringify
(
d
)}}])[
0
].
done
(
function
(
b
){
if
(
""
===
b
[
0
].
message
){
a
(
"
#message_edit_tool
"
).
html
(
b
[
0
].
messageok
),
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
"
,
w
),
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
)}}),
u
()}.
bind
(
this
)).
fail
(
b
.
exception
)}.
bind
(
this
)).
fail
(
b
.
exception
)};
return
r
.
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
"
,
n
,
h
).
done
(
function
(
d
,
f
){
v
(
a
(
"
#editpdlplus_tool_item
"
),
d
,
f
).
done
(
function
(){
"
clone
"
===
p
&&
(
a
(
"
#typetool
"
).
val
(
o
.
typetool
),
a
(
"
#color
"
).
val
(
o
.
color
),
a
(
"
#libelle
"
).
val
(
o
.
libelle
),
a
(
"
#cartridgecolor
"
).
val
(
o
.
catridgecolor
),
a
(
"
#texts
"
).
val
(
o
.
texts
),
a
(
"
#button
"
).
val
(
o
.
button
),
a
(
"
#enabled
"
).
val
(
o
.
enabled
),
a
(
"
#reply
"
).
val
(
o
.
reply
),
a
(
"
#order
"
).
val
(
o
.
order
),
o
=
null
,
p
=
null
),
a
(
"
#toolFormSubmit
"
).
on
(
"
click
"
,
function
(){
if
(
""
===
a
(
"
#button
"
).
val
()){
var
d
=
"
<strong>Attention!</strong>Le libellé du bouton n'est pas renseigné
"
;
a
(
"
#message_edit_tool
"
).
html
(
d
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-warning
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-danger
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-success
"
)}
else
{
var
f
=
""
;
a
(
"
input[name^='text[']
"
).
each
(
function
(){
a
(
this
).
val
()
&&
a
(
this
).
val
().
length
>
0
&&
(
f
+=
'
"
'
+
a
(
this
).
val
().
replace
(
/"/g
,
""
)
+
'
",
'
)}),
f
.
length
>
0
&&
a
(
"
#texts
"
).
val
(
f
.
substring
(
0
,
f
.
length
-
1
));
var
g
=
a
(
"
#assignfeedback_editpdfplus_edit_tool
"
),
h
=
g
.
serialize
();
e
.
call
([{
methodname
:
"
assignfeedback_editpdfplus_submit_tool_add_form
"
,
args
:{
jsonformdata
:
JSON
.
stringify
(
h
)}}])[
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
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-warning
"
),
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
"
,
w
),
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
)},
r
});
\ 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
"
,
"
assignfeedback_editpdfplus/annotationframe
"
,
"
assignfeedback_editpdfplus/annotationcommentplus
"
,
"
assignfeedback_editpdfplus/annotationverticalline
"
,
"
assignfeedback_editpdfplus/annotationstampcomment
"
],
function
(
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
,
k
,
l
,
m
){
var
n
=
null
,
o
=
null
,
p
=
null
,
q
=
null
,
r
=
function
(
a
,
b
){
n
=
a
,
q
=
JSON
.
parse
(
b
),
this
.
init
()},
s
=
null
;
r
.
prototype
.
selectTool
=
null
,
r
.
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 option[value='
"
+
b
+
"
']
"
).
data
(
"
delete
"
,
0
),
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
removeClass
(
"
disabled
"
)),
a
(
"
#toolworkspace
"
).
html
(
""
)}),
a
(
"
#editpdlplus_axes
"
).
change
(),
a
(
"
.editpdlplus_tool
"
).
on
(
"
click
"
,
w
),
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
),
a
(
"
.btn-primary
"
).
click
()},
r
.
prototype
.
test
=
function
(){
alert
(
"
test
"
),
w
()},
r
.
prototype
.
initTool
=
function
(){
a
(
this
.
selectTool
).
removeClass
(
"
btn-default
"
),
a
(
this
.
selectTool
).
addClass
(
"
btn-primary
"
)};
var
t
=
function
(
a
){
for
(
var
b
=
0
;
b
<
q
.
length
;
b
++
)
if
(
q
[
b
].
id
==
a
)
return
q
[
b
]},
u
=
function
(){
a
(
"
#canevas
"
).
html
(
""
),
s
=
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
)
s
=
new
h
;
else
if
(
3
===
b
)
s
=
new
i
;
else
if
(
4
===
b
){
s
=
new
j
;
var
c
=
new
j
}
else
5
===
b
?
s
=
new
l
:
6
===
b
?
s
=
new
m
:
7
===
b
&&
(
s
=
new
k
);
if
(
s
){
var
d
=
t
(
b
);
o
.
reply
=
0
,
a
(
"
#reply
"
).
is
(
"
:checked
"
)
&&
(
o
.
reply
=
1
),
s
.
initAdminDemo
(
o
,
d
),
s
.
draw
(
a
(
"
#canevas
"
)),
c
&&
(
c
.
initChildAdminDemo
(
s
),
c
.
draw
(
a
(
"
#canevas
"
)))}};
r
.
prototype
.
openDivAddAxis
=
function
(){
a
(
"
#axistool
"
).
hide
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_addaxis
"
).
show
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body
"
).
html
(
""
),
a
(
"
#assignfeedback_editpdfplus_widget_admin_toolheader
"
).
hide
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_toolworkspace
"
).
hide
();
var
e
=
{};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
axisadd
"
,
n
,
e
).
done
(
function
(
a
,
b
){
c
.
appendNodeContents
(
"
#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body
"
,
a
,
b
)}.
bind
(
this
)).
fail
(
b
.
exception
)},
r
.
prototype
.
openDivEditAxis
=
function
(){
a
(
"
#axistool
"
).
hide
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_editaxis
"
).
show
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body
"
).
html
(
""
),
a
(
"
#assignfeedback_editpdfplus_widget_admin_toolheader
"
).
hide
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_toolworkspace
"
).
hide
();
var
e
=
a
(
"
#editpdlplus_axes option:selected
"
).
val
(),
f
=
{
axeid
:
e
};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
axisedit
"
,
n
,
f
).
done
(
function
(
a
,
b
){
c
.
appendNodeContents
(
"
#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body
"
,
a
,
b
)}.
bind
(
this
)).
fail
(
b
.
exception
)},
r
.
prototype
.
openDivDelAxis
=
function
(){
a
(
"
#axistool
"
).
hide
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_delaxis
"
).
show
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body
"
).
html
(
""
),
a
(
"
#assignfeedback_editpdfplus_widget_admin_toolheader
"
).
hide
(),
a
(
"
#assignfeedback_editpdfplus_widget_admin_toolworkspace
"
).
hide
();
var
e
=
a
(
"
#editpdlplus_axes option:selected
"
).
val
(),
f
=
{
axeid
:
e
};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
axisdel
"
,
n
,
f
).
done
(
function
(
a
,
b
){
c
.
appendNodeContents
(
"
#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body
"
,
a
,
b
)}.
bind
(
this
)).
fail
(
b
.
exception
)};
var
v
=
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
()},
w
=
function
(){
var
c
=
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
()
!==
c
&&
a
(
this
).
addClass
(
"
btn-default
"
)}),
a
(
this
).
addClass
(
"
btn-primary
"
),
a
(
"
#editpdlplus_tool_item
"
).
html
(
""
);
var
f
=
{
toolid
:
c
};
d
.
loadFragment
(
"
assignfeedback_editpdfplus
"
,
"
tooledit
"
,
n
,
f
).
done
(
function
(
c
,
d
){
v
(
a
(
"
#editpdlplus_tool_item
"
),
c
,
d
).
done
(
function
(){
o
=
new
Object
,
o
.
typetool
=
a
(
"
#typetool
"
).
val
(),
o
.
color
=
a
(
"
#color
"
).
val
(),
o
.
libelle
=
a
(
"
#libelle
"
).
val
(),
o
.
catridgecolor
=
a
(
"
#cartridgecolor
"
).
val
(),
o
.
texts
=
a
(
"
#texts
"
).
val
(),
o
.
button
=
a
(
"
#button
"
).
val
(),
o
.
enabled
=
a
(
"
#enabled
"
).
val
(),
o
.
reply
=
a
(
"
#reply
"
).
val
(),
o
.
order
=
a
(
"
#order
"
).
val
(),
a
(
"
#toolFormSubmit
"
).
on
(
"
click
"
,
function
(){
var
c
=
""
;
a
(
"
input[name^='text[']
"
).
each
(
function
(){
a
(
this
).
val
()
&&
a
(
this
).
val
().
length
>
0
&&
(
c
+=
'
"
'
+
a
(
this
).
val
().
replace
(
/"/g
,
""
)
+
'
",
'
)}),
c
.
length
>
0
&&
a
(
"
#texts
"
).
val
(
c
.
substring
(
0
,
c
.
length
-
1
));
var
d
=
a
(
"
#assignfeedback_editpdfplus_edit_tool
"
),
f
=
d
.
serialize
();
e
.
call
([{
methodname
:
"
assignfeedback_editpdfplus_submit_tool_edit_form
"
,
args
:{
jsonformdata
:
JSON
.
stringify
(
f
)}}])[
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
"
,
w
),
w
()}
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
(){
p
=
"
clone
"
,
a
(
"
#assignfeedback_editpdfplus_widget_admin_button_addtool
"
).
click
()}),
a
(
"
#toolRemove
"
).
on
(
"
click
"
,
function
(){
if
(
!
a
(
this
).
hasClass
(
"
disabled
"
)){
var
c
=
a
(
"
#assignfeedback_editpdfplus_edit_tool
"
),
d
=
c
.
serialize
();
e
.
call
([{
methodname
:
"
assignfeedback_editpdfplus_submit_tool_del_form
"
,
args
:{
jsonformdata
:
JSON
.
stringify
(
d
)}}])[
0
].
done
(
function
(
b
){
if
(
""
===
b
[
0
].
message
){
a
(
"
#message_edit_tool
"
).
html
(
b
[
0
].
messageok
),
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
"
,
w
),
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
)}}),
u
()}.
bind
(
this
)).
fail
(
b
.
exception
)}.
bind
(
this
)).
fail
(
b
.
exception
)};
return
r
.
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
"
,
n
,
h
).
done
(
function
(
d
,
f
){
v
(
a
(
"
#editpdlplus_tool_item
"
),
d
,
f
).
done
(
function
(){
"
clone
"
===
p
&&
(
a
(
"
#typetool
"
).
val
(
o
.
typetool
),
a
(
"
#color
"
).
val
(
o
.
color
),
a
(
"
#libelle
"
).
val
(
o
.
libelle
),
a
(
"
#cartridgecolor
"
).
val
(
o
.
catridgecolor
),
a
(
"
#texts
"
).
val
(
o
.
texts
),
a
(
"
#button
"
).
val
(
o
.
button
),
a
(
"
#enabled
"
).
val
(
o
.
enabled
),
a
(
"
#reply
"
).
val
(
o
.
reply
),
a
(
"
#order
"
).
val
(
o
.
order
),
o
=
null
,
p
=
null
),
a
(
"
#toolFormSubmit
"
).
on
(
"
click
"
,
function
(){
if
(
""
===
a
(
"
#button
"
).
val
()){
var
d
=
"
<strong>Attention!</strong>Le libellé du bouton n'est pas renseigné
"
;
a
(
"
#message_edit_tool
"
).
html
(
d
),
a
(
"
#message_edit_tool
"
).
addClass
(
"
alert-warning
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-danger
"
),
a
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-success
"
)}
else
{
var
f
=
""
;
a
(
"
input[name^='text[']
"
).
each
(
function
(){
a
(
this
).
val
()
&&
a
(
this
).
val
().
length
>
0
&&
(
f
+=
'
"
'
+
a
(
this
).
val
().
replace
(
/"/g
,
""
)
+
'
",
'
)}),
f
.
length
>
0
&&
a
(
"
#texts
"
).
val
(
f
.
substring
(
0
,
f
.
length
-
1
));
var
g
=
a
(
"
#assignfeedback_editpdfplus_edit_tool
"
),
h
=
g
.
serialize
();
e
.
call
([{
methodname
:
"
assignfeedback_editpdfplus_submit_tool_add_form
"
,
args
:{
jsonformdata
:
JSON
.
stringify
(
h
)}}])[
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
(
"
#message_edit_tool
"
).
removeClass
(
"
alert-warning
"
),
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
"
,
w
),
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
)}})}.
bind
(
this
)).
fail
(
b
.
exception
)}.
bind
(
this
)).
fail
(
b
.
exception
)},
r
});
\ No newline at end of file
amd/src/admin_panel.js
View file @
824165fd
...
...
@@ -57,11 +57,17 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
var
selectAxis
=
$
(
"
#editpdlplus_axes
"
).
val
();
$
(
"
#editpdlplus_toolbar_
"
+
selectAxis
).
show
();
var
canBeDelete
=
$
(
"
#editpdlplus_axes option:selected
"
).
data
(
'
delete
'
);
if
(
canBeDelete
&&
parseInt
(
canBeDelete
)
>
0
)
{
$
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
addClass
(
"
disabled
"
);
if
(
canBeDelete
)
{
if
(
parseInt
(
canBeDelete
)
>
0
)
{
$
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
addClass
(
"
disabled
"
);
}
else
{
$
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
removeClass
(
"
disabled
"
);
}
}
else
{
$
(
"
#editpdlplus_axes option[value='
"
+
selectAxis
+
"
']
"
).
data
(
'
delete
'
,
0
);
$
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
removeClass
(
"
disabled
"
);
}
$
(
'
#toolworkspace
'
).
html
(
""
);
});
$
(
"
#editpdlplus_axes
"
).
change
();
//
...
...
@@ -87,20 +93,20 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
};
//
/*AdminPanel.prototype.refreshPrevisu = function () {
currentTool.typetool = $("#typetool").val();
currentTool.color = $("#color").val();
currentTool.libelle = $("#libelle").val();
currentTool.catridgecolor = $("#cartridgecolor").val();
currentTool.texts = $("#texts").val();
currentTool.button = $("#button").val();
currentTool.enabled = $("#enabled").val();
currentTool.reply = 0;
if ($("#reply").is(':checked')) {
currentTool.reply = 1;
}
currentTool.order = $("#order").val();
initCanevas();
};*/
currentTool.typetool = $("#typetool").val();
currentTool.color = $("#color").val();
currentTool.libelle = $("#libelle").val();
currentTool.catridgecolor = $("#cartridgecolor").val();
currentTool.texts = $("#texts").val();
currentTool.button = $("#button").val();
currentTool.enabled = $("#enabled").val();
currentTool.reply = 0;
if ($("#reply").is(':checked')) {
currentTool.reply = 1;
}
currentTool.order = $("#order").val();
initCanevas();
};*/
//
var
getTypeTool
=
function
(
toolid
)
{
for
(
var
i
=
0
;
i
<
typetools
.
length
;
i
++
)
{
...
...
@@ -154,6 +160,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$
(
"
#axistool
"
).
hide
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_div_addaxis
'
).
show
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body
'
).
html
(
""
);
$
(
'
#assignfeedback_editpdfplus_widget_admin_toolheader
'
).
hide
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_toolworkspace
'
).
hide
();
var
params
=
{};
fragment
.
loadFragment
(
'
assignfeedback_editpdfplus
'
,
'
axisadd
'
,
contextid
,
params
)
.
done
(
function
(
html
,
js
)
{
...
...
@@ -166,6 +174,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$
(
"
#axistool
"
).
hide
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_div_editaxis
'
).
show
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body
'
).
html
(
""
);
$
(
'
#assignfeedback_editpdfplus_widget_admin_toolheader
'
).
hide
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_toolworkspace
'
).
hide
();
/*var context = {name: 'Tweety bird', intelligence: 2};
templates.render('assignfeedback_editpdfplus/admin_axis_add', context)
// It returns a promise that needs to be resoved.
...
...
@@ -188,6 +198,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$
(
"
#axistool
"
).
hide
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_div_delaxis
'
).
show
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body
'
).
html
(
""
);
$
(
'
#assignfeedback_editpdfplus_widget_admin_toolheader
'
).
hide
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_toolworkspace
'
).
hide
();
var
axeid
=
$
(
"
#editpdlplus_axes option:selected
"
).
val
();
var
params
=
{
axeid
:
axeid
};
fragment
.
loadFragment
(
'
assignfeedback_editpdfplus
'
,
'
axisdel
'
,
contextid
,
params
)
...
...
@@ -497,7 +509,7 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$
(
"
#editpdlplus_toolbar_
"
+
toolbar
[
0
].
axeid
).
append
(
buttonTmp
);
}
$
(
"
.editpdlplus_tool
"
).
on
(
"
click
"
,
refreshToolView
);
$
(
'
#
editpdlplus_tool_item
'
).
html
(
""
);
$
(
'
#
toolworkspace
'
).
html
(
""
);
}
else
{
$
(
"
#message_edit_tool
"
).
html
(
toolbar
[
0
].
message
);
$
(
"
#message_edit_tool
"
).
addClass
(
"
alert-danger
"
);
...
...
amd/src/editplus.js
deleted
100644 → 0
View file @
1daa79c5
// Standard license block omitted.
/*
* @package assignfeedback_editpdfplus
* @copyright 2015 Someone cool
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/editplus
*/
define
([
'
jquery
'
],
function
(
$
)
{
/**
* @constructor
* @alias module:mod_assignfeedback_editpdfplus/editplus
*/
var
greeting
=
function
()
{
/** @access private */
//var privateThoughts = 'I like the colour blue';
$
(
"
#id
"
).
val
();
/** @access public */
this
.
publicThoughts
=
'
I like the colour orange
'
;
};
/**
* A formal greeting.
* @access public
* @return {string}
*/
greeting
.
prototype
.
formal
=
function
()
{
return
'
How do you do?
'
;
};
/**
* An informal greeting.
* @access public
* @return {string}
*/
greeting
.
prototype
.
informal
=
function
()
{
return
'
Wassup!
'
;
};
return
{
init
:
function
()
{
alert
(
"
hello
"
);
}
};
});
\ No newline at end of file
templates/admin.mustache
View file @
824165fd
...
...
@@ -55,16 +55,18 @@
<div
class=
"panel-body"
></div>
</div>
</div>
<div
class=
'col-sm-10'
>
{{#
toolbars
}}
<div
id=
"editpdlplus_toolbar_
{{
axis
.
id
}}
"
class=
"btn-group toolbar"
style=
"display: none;"
>
{{#
tools
}}
<button
class=
"btn
{{
button
}}
editpdlplus_tool"
id=
"editpdlplus_tool_
{{
id
}}
"
value=
"
{{
id
}}
"
style=
"
{{
style
}}
"
data-enable=
"
{{
enabled
}}
"
>
{{
label
}}
</button>
{{/
tools
}}
<div
class=
'col-sm-10'
id=
'assignfeedback_editpdfplus_widget_admin_toolworkspace'
>
<div
id=
'editpdlplus_toolbars'
>
{{#
toolbars
}}
<div
id=
"editpdlplus_toolbar_
{{
axis
.
id
}}
"
class=
"btn-group toolbar"
style=
"display: none;"
>
{{#
tools
}}
<button
class=
"btn
{{
button
}}
editpdlplus_tool"
id=
"editpdlplus_tool_
{{
id
}}
"
value=
"
{{
id
}}
"
style=
"
{{
style
}}
"
data-enable=
"
{{
enabled
}}
"
>
{{
label
}}
</button>
{{/
tools
}}
</div>
{{/
toolbars
}}
</div>
{{/
toolbars
}}
<div
id=
"editpdlplus_tool_item"
style=
"margin-top: 10px;"
></div>
...
...
templates/axis_del_form.mustache
View file @
824165fd
...
...
@@ -33,11 +33,16 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification
}else{
$('#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body > .panel > .panel-body').append("
<div
class=
'alert alert-danger'
style=
'margin-top: 5px;'
>
"+message[0].message+"
</div>
");
}
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
}).fail(notification.exception);
});
$("#axisDelCancel").on("click", function () {
$('#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body').html("");
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
});
});
{{/
js
}}
\ No newline at end of file
templates/axis_form.mustache
View file @
824165fd
...
...
@@ -25,14 +25,20 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification
}
])[0].done(function(axe) {
if ('
{{
action
}}
' === 'add'){
var divAxis = "
<div
id=
'editpdlplus_toolbar_"+axe[0].axeid+"'
class=
'btn-group toolbar'
style=
'display: none;'
></div>
";
$('#editpdlplus_toolbars').append(divAxis);
$('#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body').html("");
$("#editpdlplus_axes").append(new Option(axe[0].axelabel, axe[0].axeid, true, true));
var option=new Option(axe[0].axelabel, axe[0].axeid, true, true);
$("#editpdlplus_axes").append(option);
$("#editpdlplus_axes").change();
$('#editpdlplus_tool_item').html("");
} else {
$('#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body').html("");
$("#editpdlplus_axes option:selected").html(axe[0].axelabel);
}
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
}).fail(notification.exception);
});
$("#axisFormCancel").on("click", function () {
...
...
@@ -42,6 +48,8 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification
$('#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body').html("");
}
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
});
});
{{/
js
}}
\ 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