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
c6428b86
Commit
c6428b86
authored
Sep 01, 2017
by
M. Chardon
Browse files
documentation javascript
parent
4eb21967
Changes
11
Hide whitespace changes
Inline
Side-by-side
amd/build/annotationverticalline.min.js
View file @
c6428b86
define
([
"
jquery
"
,
"
./annotation
"
],
function
(
a
,
b
){
function
c
(){
return
b
.
call
(
this
),
this
}
return
c
.
prototype
=
Object
.
create
(
b
.
prototype
),
c
.
prototype
.
initAdminDemo
=
function
(
a
){
b
.
prototype
.
initAdminDemo
.
call
(
this
,
a
),
this
.
x
=
285
,
this
.
y
=
65
,
this
.
endy
=
175
},
c
.
prototype
.
draw
=
function
(
b
){
if
(
b
){
var
c
=
"
<div id='
"
+
this
.
id
+
"
'></div>
"
;
b
.
append
(
c
),
a
(
"
#
"
+
this
.
id
).
css
(
"
background-color
"
,
this
.
get_color
()),
a
(
"
#
"
+
this
.
id
).
css
(
"
width
"
,
3
),
this
.
endy
-
this
.
y
<=
30
&&
(
this
.
endy
=
this
.
y
+
30
),
a
(
"
#
"
+
this
.
id
).
css
(
"
height
"
,
this
.
endy
-
this
.
y
),
a
(
"
#
"
+
this
.
id
).
css
(
"
position
"
,
"
relative
"
),
a
(
"
#
"
+
this
.
id
).
css
(
"
left
"
,
this
.
x
),
a
(
"
#
"
+
this
.
id
).
css
(
"
top
"
,
this
.
y
)}
this
.
draw_catridge
(
b
)},
c
.
prototype
.
draw_catridge
=
function
(
a
){
var
b
;
if
(
!
this
.
divcartridge
||
""
===
this
.
divcartridge
){
this
.
init_div_cartridge_id
();
var
c
=
this
.
get_color_cartridge
();
b
=
this
.
get_div_cartridge
(
c
,
a
),
b
.
addClass
(
"
assignfeedback_editpdfplus_verticalline
"
),
this
.
get_div_cartridge_label
(
c
,
b
);
var
d
=
this
.
get_div_container
(
c
,
b
);
this
.
get_div_edition
(
d
),
this
.
cartridgex
&&
0
!==
this
.
cartridgex
||
(
this
.
cartridgex
=
parseInt
(
this
.
tooltype
.
getToolTypeCartX
(),
10
)),
this
.
cartridgey
&&
0
!==
this
.
cartridgey
||
(
this
.
cartridgey
=
parseInt
(
this
.
tooltype
.
getToolTypeCartY
(),
10
)),
b
.
css
(
"
left
"
,
this
.
x
+
this
.
cartridgex
),
b
.
css
(
"
top
"
,
this
.
y
+
this
.
cartridgey
-
109
),
this
.
apply_visibility_annot
()}
return
!
0
},
c
});
\ No newline at end of file
define
([
"
jquery
"
,
"
./annotation
"
],
function
(
a
,
b
){
function
c
(){
return
b
.
call
(
this
),
this
}
return
c
.
prototype
=
Object
.
create
(
b
.
prototype
),
c
.
prototype
.
initAdminDemo
=
function
(
a
){
b
.
prototype
.
initAdminDemo
.
call
(
this
,
a
),
this
.
x
=
285
,
this
.
y
=
65
,
this
.
endy
=
175
},
c
.
prototype
.
draw
=
function
(
b
){
if
(
b
){
var
c
=
"
<div id='
"
+
this
.
id
+
"
'></div>
"
;
b
.
append
(
c
),
a
(
"
#
"
+
this
.
id
).
css
(
"
background-color
"
,
this
.
get_color
()),
a
(
"
#
"
+
this
.
id
).
css
(
"
width
"
,
3
),
this
.
endy
-
this
.
y
<=
30
&&
(
this
.
endy
=
this
.
y
+
30
),
a
(
"
#
"
+
this
.
id
).
css
(
"
height
"
,
this
.
endy
-
this
.
y
),
a
(
"
#
"
+
this
.
id
).
css
(
"
position
"
,
"
relative
"
),
a
(
"
#
"
+
this
.
id
).
css
(
"
left
"
,
this
.
x
),
a
(
"
#
"
+
this
.
id
).
css
(
"
top
"
,
this
.
y
),
this
.
draw_catridge
(
b
)}},
c
.
prototype
.
draw_catridge
=
function
(
a
){
var
b
;
if
(
!
this
.
divcartridge
||
""
===
this
.
divcartridge
){
this
.
init_div_cartridge_id
();
var
c
=
this
.
get_color_cartridge
();
b
=
this
.
get_div_cartridge
(
c
,
a
),
b
.
addClass
(
"
assignfeedback_editpdfplus_verticalline
"
),
this
.
get_div_cartridge_label
(
c
,
b
);
var
d
=
this
.
get_div_container
(
c
,
b
);
this
.
get_div_edition
(
d
),
this
.
cartridgex
&&
0
!==
this
.
cartridgex
||
(
this
.
cartridgex
=
parseInt
(
this
.
tooltype
.
getToolTypeCartX
(),
10
)),
this
.
cartridgey
&&
0
!==
this
.
cartridgey
||
(
this
.
cartridgey
=
parseInt
(
this
.
tooltype
.
getToolTypeCartY
(),
10
)),
b
.
css
(
"
left
"
,
this
.
x
+
this
.
cartridgex
),
b
.
css
(
"
top
"
,
this
.
y
+
this
.
cartridgey
-
109
),
this
.
apply_visibility_annot
()}
return
!
0
},
c
});
\ No newline at end of file
amd/build/tool.min.js
View file @
c6428b86
define
([
"
jquery
"
,
"
./global
"
],
function
(
a
,
b
){
function
c
(){
return
this
.
_instanceID
=
e
(),
this
}
var
d
=
0
,
e
=
function
(){
return
++
d
};
return
c
.
getInstanceCount
=
function
(){
return
d
},
c
.
prototype
.
getInstanceID
=
function
(){
return
this
.
_instanceID
},
c
.
id
=-
1
,
c
.
axis
=-
1
,
c
.
typetool
=-
1
,
c
.
type
=
null
,
c
.
colors
=
""
,
c
.
cartridge
=
""
,
c
.
cartridgeColor
=
""
,
c
.
texts
=
""
,
c
.
label
=
""
,
c
.
reply
=!
0
,
c
.
enabled
=!
0
,
c
.
orderTool
=
1
e3
,
c
.
prototype
.
init
=
function
(
a
){
this
.
id
=
parseInt
(
a
.
id
,
10
)
||
0
,
this
.
axis
=
parseInt
(
a
.
axis
,
10
)
||
0
,
this
.
type
=
a
.
type
,
this
.
colors
=
a
.
colors
,
this
.
cartridge
=
a
.
cartridge
,
this
.
cartridgeColor
=
a
.
cartridgeColor
,
this
.
texts
=
a
.
texts
,
this
.
label
=
a
.
label
,
this
.
reply
=
a
.
reply
,
this
.
enabled
=
a
.
enabled
,
this
.
orderTool
=
a
.
orderTool
},
c
.
prototype
.
initAdmin
=
function
(
a
){
this
.
id
=
parseInt
(
a
.
toolid
,
10
)
||
0
,
this
.
typetool
=
a
.
typetool
,
this
.
label
=
a
.
button
,
this
.
enabled
=
a
.
enable
,
this
.
orderTool
=
a
.
orderTool
},
c
.
prototype
.
getToolTypeLabel
=
function
(){
return
this
.
type
.
label
},
c
.
prototype
.
getToolTypeCartX
=
function
(){
return
this
.
type
.
cartridgeX
},
c
.
prototype
.
getToolTypeCartY
=
function
(){
return
this
.
type
.
cartridgeY
},
c
.
prototype
.
get_color
=
function
(){
var
a
=
b
.
ANNOTATIONCOLOUR
[
this
.
colors
];
return
a
?(
a
=
a
.
replace
(
"
rgb
"
,
"
rgba
"
),
a
=
a
.
replace
(
"
)
"
,
"
,0.5)
"
)):
a
=
this
.
colors
,
a
&&
""
!==
a
?
a
:
this
.
type
.
get_color
()},
c
.
prototype
.
get_color_cartridge
=
function
(){
var
a
=
b
.
ANNOTATIONCOLOUR
[
this
.
cartridgeColor
];
return
a
?(
a
=
a
.
replace
(
"
rgb
"
,
"
rgba
"
),
a
=
a
.
replace
(
"
)
"
,
"
,0.5)
"
)):
a
=
this
.
cartridgeColor
,
a
&&
""
!==
a
?
a
:
this
.
type
.
get_color_cartridge
()},
c
.
prototype
.
getButton
=
function
(
a
){
var
b
=
"
btn-default
"
,
c
=
""
;
1
!==
this
.
enabled
&&
(
b
=
""
,
c
=
"
background-image:none;background-color:#CCCCCC;
"
),
this
.
id
===
a
&&
(
b
=
"
btn-primary
"
),
4
!==
this
.
typetool
&&
1
!==
this
.
typetool
||
(
c
+=
"
text-decoration: underline;
"
);
var
d
=
this
.
label
;
4
!==
this
.
typetool
&&
5
!==
this
.
typetool
||
(
d
=
"
|
"
+
d
,
4
===
this
.
typetool
&&
(
d
+=
"
|
"
));
var
e
=
"
<button class='btn
"
+
b
+
"
editpdlplus_tool' id='editpdlplus_tool_
"
+
this
.
id
+
"
' style='
"
+
c
+
"
' value='
"
+
this
.
id
+
"
' data-enable='
"
+
this
.
enabled
+
"
'>
"
+
d
+
"
</button>
"
;
return
e
},
c
});
\ No newline at end of file
define
([
"
./global
"
],
function
(
a
){
function
b
(){
return
this
.
_instanceID
=
d
(),
this
}
var
c
=
0
,
d
=
function
(){
return
++
c
};
return
b
.
getInstanceCount
=
function
(){
return
c
},
b
.
prototype
.
getInstanceID
=
function
(){
return
this
.
_instanceID
},
b
.
id
=-
1
,
b
.
axis
=-
1
,
b
.
typetool
=-
1
,
b
.
type
=
null
,
b
.
colors
=
""
,
b
.
cartridge
=
""
,
b
.
cartridgeColor
=
""
,
b
.
texts
=
""
,
b
.
label
=
""
,
b
.
reply
=!
0
,
b
.
enabled
=!
0
,
b
.
orderTool
=
1
e3
,
b
.
prototype
.
init
=
function
(
a
){
this
.
id
=
parseInt
(
a
.
id
,
10
)
||
0
,
this
.
axis
=
parseInt
(
a
.
axis
,
10
)
||
0
,
this
.
type
=
a
.
type
,
this
.
colors
=
a
.
colors
,
this
.
cartridge
=
a
.
cartridge
,
this
.
cartridgeColor
=
a
.
cartridgeColor
,
this
.
texts
=
a
.
texts
,
this
.
label
=
a
.
label
,
this
.
reply
=
a
.
reply
,
this
.
enabled
=
a
.
enabled
,
this
.
orderTool
=
a
.
orderTool
},
b
.
prototype
.
initAdmin
=
function
(
a
){
this
.
id
=
parseInt
(
a
.
toolid
,
10
)
||
0
,
this
.
typetool
=
a
.
typetool
,
this
.
label
=
a
.
button
,
this
.
enabled
=
a
.
enable
,
this
.
orderTool
=
a
.
orderTool
},
b
.
prototype
.
getToolTypeLabel
=
function
(){
return
this
.
type
.
label
},
b
.
prototype
.
getToolTypeCartX
=
function
(){
return
this
.
type
.
cartridgeX
},
b
.
prototype
.
getToolTypeCartY
=
function
(){
return
this
.
type
.
cartridgeY
},
b
.
prototype
.
get_color
=
function
(){
var
b
=
a
.
ANNOTATIONCOLOUR
[
this
.
colors
];
return
b
?(
b
=
b
.
replace
(
"
rgb
"
,
"
rgba
"
),
b
=
b
.
replace
(
"
)
"
,
"
,0.5)
"
)):
b
=
this
.
colors
,
b
&&
""
!==
b
?
b
:
this
.
type
.
get_color
()},
b
.
prototype
.
get_color_cartridge
=
function
(){
var
b
=
a
.
ANNOTATIONCOLOUR
[
this
.
cartridgeColor
];
return
b
?(
b
=
b
.
replace
(
"
rgb
"
,
"
rgba
"
),
b
=
b
.
replace
(
"
)
"
,
"
,0.5)
"
)):
b
=
this
.
cartridgeColor
,
b
&&
""
!==
b
?
b
:
this
.
type
.
get_color_cartridge
()},
b
.
prototype
.
getButton
=
function
(
a
){
var
b
=
"
btn-default
"
,
c
=
""
;
1
!==
this
.
enabled
&&
(
b
=
""
,
c
=
"
background-image:none;background-color:#CCCCCC;
"
),
this
.
id
===
a
&&
(
b
=
"
btn-primary
"
),
4
!==
this
.
typetool
&&
1
!==
this
.
typetool
||
(
c
+=
"
text-decoration: underline;
"
);
var
d
=
this
.
label
;
4
!==
this
.
typetool
&&
5
!==
this
.
typetool
||
(
d
=
"
|
"
+
d
,
4
===
this
.
typetool
&&
(
d
+=
"
|
"
));
var
e
=
"
<button class='btn
"
+
b
+
"
editpdlplus_tool' id='editpdlplus_tool_
"
+
this
.
id
+
"
' style='
"
+
c
+
"
' value='
"
+
this
.
id
+
"
' data-enable='
"
+
this
.
enabled
+
"
'>
"
+
d
+
"
</button>
"
;
return
e
},
b
});
\ No newline at end of file
amd/build/tooltype.min.js
View file @
c6428b86
define
([
"
jquery
"
,
"
./global
"
],
function
(
a
,
b
){
function
c
(){
return
this
.
_instanceID
=
e
(),
this
}
var
d
=
0
,
e
=
function
(){
return
++
d
};
return
c
.
getInstanceCount
=
function
(){
return
d
},
c
.
prototype
.
getInstanceID
=
function
(){
return
this
.
_instanceID
},
c
.
id
=-
1
,
c
.
label
=
""
,
c
.
color
=
""
,
c
.
cartridgeColor
=
""
,
c
.
cartridgeX
=
0
,
c
.
cartridgeY
=
0
,
c
.
configurableCartridge
=
1
,
c
.
configurableCartridgeColor
=
1
,
c
.
configurableColor
=
1
,
c
.
configurableTexts
=
1
,
c
.
configurableQuestion
=
1
,
c
.
prototype
.
init
=
function
(
a
){
this
.
id
=
parseInt
(
a
.
id
,
10
)
||
0
},
c
.
prototype
.
initAdmin
=
function
(
a
){
this
.
id
=
parseInt
(
a
.
id
,
10
)
||
0
,
this
.
label
=
a
.
label
,
this
.
color
=
a
.
color
,
this
.
cartridgeColor
=
a
.
cartridge_color
,
this
.
cartridgeX
=
a
.
cartridge_x
,
this
.
cartridgeY
=
a
.
cartridge_y
,
this
.
configurableCartridge
=
a
.
configurable_cartridge
,
this
.
configurableCartridgeColor
=
a
.
configurable_cartridge_color
,
this
.
configurableColor
=
a
.
configurable_color
,
this
.
configurableTexts
=
a
.
configurable_texts
,
this
.
configurableQuestion
=
a
.
configurable_question
},
c
.
prototype
.
get_color
=
function
(){
var
a
=
b
.
ANNOTATIONCOLOUR
[
this
.
color
];
return
a
?(
a
=
a
.
replace
(
"
rgb
"
,
"
rgba
"
),
a
=
a
.
replace
(
"
)
"
,
"
,0.5)
"
)):
a
=
this
.
color
,
a
},
c
.
prototype
.
get_color_cartridge
=
function
(){
var
a
=
b
.
ANNOTATIONCOLOUR
[
this
.
cartridgeColor
];
return
a
?(
a
=
a
.
replace
(
"
rgb
"
,
"
rgba
"
),
a
=
a
.
replace
(
"
)
"
,
"
,0.5)
"
)):
a
=
this
.
cartridgeColor
,
a
},
c
});
\ No newline at end of file
define
([
"
./global
"
],
function
(
a
){
function
b
(){
return
this
.
_instanceID
=
d
(),
this
}
var
c
=
0
,
d
=
function
(){
return
++
c
};
return
b
.
getInstanceCount
=
function
(){
return
c
},
b
.
prototype
.
getInstanceID
=
function
(){
return
this
.
_instanceID
},
b
.
id
=-
1
,
b
.
label
=
""
,
b
.
color
=
""
,
b
.
cartridgeColor
=
""
,
b
.
cartridgeX
=
0
,
b
.
cartridgeY
=
0
,
b
.
configurableCartridge
=
1
,
b
.
configurableCartridgeColor
=
1
,
b
.
configurableColor
=
1
,
b
.
configurableTexts
=
1
,
b
.
configurableQuestion
=
1
,
b
.
prototype
.
init
=
function
(
a
){
this
.
id
=
parseInt
(
a
.
id
,
10
)
||
0
},
b
.
prototype
.
initAdmin
=
function
(
a
){
this
.
id
=
parseInt
(
a
.
id
,
10
)
||
0
,
this
.
label
=
a
.
label
,
this
.
color
=
a
.
color
,
this
.
cartridgeColor
=
a
.
cartridge_color
,
this
.
cartridgeX
=
a
.
cartridge_x
,
this
.
cartridgeY
=
a
.
cartridge_y
,
this
.
configurableCartridge
=
a
.
configurable_cartridge
,
this
.
configurableCartridgeColor
=
a
.
configurable_cartridge_color
,
this
.
configurableColor
=
a
.
configurable_color
,
this
.
configurableTexts
=
a
.
configurable_texts
,
this
.
configurableQuestion
=
a
.
configurable_question
},
b
.
prototype
.
get_color
=
function
(){
var
b
=
a
.
ANNOTATIONCOLOUR
[
this
.
color
];
return
b
?(
b
=
b
.
replace
(
"
rgb
"
,
"
rgba
"
),
b
=
b
.
replace
(
"
)
"
,
"
,0.5)
"
)):
b
=
this
.
color
,
b
},
b
.
prototype
.
get_color_cartridge
=
function
(){
var
b
=
a
.
ANNOTATIONCOLOUR
[
this
.
cartridgeColor
];
return
b
?(
b
=
b
.
replace
(
"
rgb
"
,
"
rgba
"
),
b
=
b
.
replace
(
"
)
"
,
"
,0.5)
"
)):
b
=
this
.
cartridgeColor
,
b
},
b
});
\ No newline at end of file
amd/src/annotationcommentplus.js
View file @
c6428b86
...
...
@@ -18,7 +18,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/annotation
highlightplus
* @module mod_assignfeedback_editpdfplus/annotation
comment
*/
define
([
'
jquery
'
,
'
./annotation
'
],
function
(
$
,
Annotation
)
{
...
...
amd/src/annotationframe.js
View file @
c6428b86
...
...
@@ -18,7 +18,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/annotation
highlightplus
* @module mod_assignfeedback_editpdfplus/annotation
frame
*/
define
([
'
jquery
'
,
'
./annotation
'
],
function
(
$
,
Annotation
)
{
...
...
amd/src/annotationstampcomment.js
View file @
c6428b86
...
...
@@ -18,7 +18,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/annotation
highlightplus
* @module mod_assignfeedback_editpdfplus/annotation
stampcomment
*/
define
([
'
jquery
'
,
'
./annotation
'
],
function
(
$
,
Annotation
)
{
...
...
amd/src/annotationstampplus.js
View file @
c6428b86
...
...
@@ -18,7 +18,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/annotation
highlight
plus
* @module mod_assignfeedback_editpdfplus/annotation
stamp
plus
*/
define
([
'
jquery
'
,
'
./annotation
'
],
function
(
$
,
Annotation
)
{
...
...
amd/src/annotationverticalline.js
View file @
c6428b86
...
...
@@ -18,10 +18,15 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/annotation
highlightplus
* @module mod_assignfeedback_editpdfplus/annotation
verticalline
*/
define
([
'
jquery
'
,
'
./annotation
'
],
function
(
$
,
Annotation
)
{
/********************************
* CONSTRUCTOR and EXTEND-CLASS *
********************************/
// I return an initialized object.
function
AnnotationVerticalline
()
{
// Call the super constructor.
...
...
@@ -32,6 +37,14 @@ define(['jquery', './annotation'],
// The Friend class extends the base Model class.
AnnotationVerticalline
.
prototype
=
Object
.
create
(
Annotation
.
prototype
);
/*************
* FUNCTIONS *
*************/
/**
* Init the annotation with demo parameters
* @param {Tool} currentTool
*/
AnnotationVerticalline
.
prototype
.
initAdminDemo
=
function
(
currentTool
)
{
Annotation
.
prototype
.
initAdminDemo
.
call
(
this
,
currentTool
);
this
.
x
=
285
;
...
...
@@ -40,9 +53,7 @@ define(['jquery', './annotation'],
};
/**
* Draw a highlight annotation
* @protected
* @method draw
* @return M.assignfeedback_editpdfplus.drawable
* @param {JQuery Entity} canevas
*/
AnnotationVerticalline
.
prototype
.
draw
=
function
(
canevas
)
{
if
(
canevas
)
{
...
...
@@ -55,17 +66,14 @@ define(['jquery', './annotation'],
}
$
(
"
#
"
+
this
.
id
).
css
(
'
height
'
,
this
.
endy
-
this
.
y
);
$
(
"
#
"
+
this
.
id
).
css
(
'
position
'
,
'
relative
'
);
//$("#" + this.id).css('display', 'inline-block');
$
(
"
#
"
+
this
.
id
).
css
(
'
left
'
,
this
.
x
);
$
(
"
#
"
+
this
.
id
).
css
(
'
top
'
,
this
.
y
);
this
.
draw_catridge
(
canevas
);
}
this
.
draw_catridge
(
canevas
);
return
;
};
/**
* Display cartridge and toolbox for the annotation
* @param {JQuery Entity} canevas
* @returns {Boolean} res
*/
AnnotationVerticalline
.
prototype
.
draw_catridge
=
function
(
canevas
)
{
...
...
@@ -77,10 +85,9 @@ define(['jquery', './annotation'],
var
colorcartridge
=
this
.
get_color_cartridge
();
divdisplay
=
this
.
get_div_cartridge
(
colorcartridge
,
canevas
);
divdisplay
.
addClass
(
'
assignfeedback_editpdfplus_verticalline
'
);
//divdisplay.css('display', 'inline-block');
// inscription entete
/*var divcartridge = */
this
.
get_div_cartridge_label
(
colorcartridge
,
divdisplay
);
this
.
get_div_cartridge_label
(
colorcartridge
,
divdisplay
);
//creation input
var
divconteneurdisplay
=
this
.
get_div_container
(
colorcartridge
,
divdisplay
);
...
...
amd/src/global.js
View file @
c6428b86
...
...
@@ -19,11 +19,13 @@
*/
/**
* @module mod_assignfeedback_editpdfplus/global
* @returns {Global} global object
*/
define
([],
function
()
{
/**
* Global class.
* Define constantes
*
* @class Global
*/
...
...
@@ -32,6 +34,7 @@ define([],
return
(
this
);
}
Global
.
ANNOTATIONCOLOUR
=
{
'
white
'
:
'
rgb(255,255,255)
'
,
'
yellowlemon
'
:
'
rgb(255,255,0)
'
,
...
...
@@ -41,6 +44,7 @@ define([],
'
blue
'
:
'
rgb(0,0,255)
'
,
'
black
'
:
'
rgb(51,51,51)
'
};
Global
.
TOOLTYPE
=
{
'
HIGHLIGHTPLUS
'
:
1
,
'
LINEPLUS
'
:
2
,
...
...
@@ -55,11 +59,14 @@ define([],
'
OVAL
'
:
11
,
'
HIGHLIGHT
'
:
12
};
Global
.
SELECTOR
=
{
DRAWINGCANVAS
:
'
.drawingcanvas
'
};
Global
.
CSS
=
{
DIALOGUE
:
'
assignfeedback_editpdfplus_widget
'
};
return
Global
;
});
\ No newline at end of file
amd/src/tool.js
View file @
c6428b86
...
...
@@ -18,15 +18,21 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/annotation
* @module mod_assignfeedback_editpdfplus/tool
* @param {Global} global constantes
* @returns {Tool} tool object
*/
define
([
'
jquery
'
,
'
./global
'
],
function
(
$
,
global
)
{
define
([
'
./global
'
],
function
(
global
)
{
/*******************************
* CONSTRUCTOR and SUPER-CLASS *
*******************************/
// I am the internal, static counter for the number of models
// that have been created in the system. This is used to
// power the unique identifier of each instance.
var
instanceCount
=
0
;
// I get the next instance ID.
var
getNewInstanceID
=
function
()
{
// Precrement the instance count in order to generate the
...
...
@@ -35,16 +41,15 @@ define(['jquery', './global'],
};
// I return an initialized object.
/**
*
Annotation
class.
*
Tool
class.
*
* @class
Annotation
* @class
Tool
*/
function
Tool
()
{
// Store the private instance id.
this
.
_instanceID
=
getNewInstanceID
();
// Return this object reference.
return
(
this
);
}
// I return the current instance count. I am a static method
// on the Model class.
...
...
@@ -54,18 +59,93 @@ define(['jquery', './global'],
Tool
.
prototype
.
getInstanceID
=
function
()
{
return
(
this
.
_instanceID
);
};
/**************
* Parameters *
**************/
/**
* Base identifiant
* @property id
* @type Int
*/
Tool
.
id
=
-
1
;
/**
* Axis id
* @property axis
* @type Int
*/
Tool
.
axis
=
-
1
;
/**
* Family's tool id
* @property typetool
* @type Int
* @deprecated since 2017-08
*/
Tool
.
typetool
=
-
1
;
/**
* Family's tool
* @property typetool
* @type ToolType
*/
Tool
.
type
=
null
;
/**
* Default HTML color
* @property colors
* @type String
*/
Tool
.
colors
=
""
;
/**
* Label of cartridge
* @property cartridge
* @type String
*/
Tool
.
cartridge
=
""
;
/**
* HTML color of cartridge
* @property cartridgeColor
* @type String
*/
Tool
.
cartridgeColor
=
""
;
/**
* Proposed default texts
* @property texts
* @type String
*/
Tool
.
texts
=
""
;
/**
* Label of button in toolbar
* @property label
* @type String
*/
Tool
.
label
=
""
;
/**
* If the annotation can be used as question/answer or not
* @property reply
* @type Boolean
*/
Tool
.
reply
=
true
;
/**
* If the tool can be used in annotation workspace
* @property enabled
* @type Bollean
*/
Tool
.
enabled
=
true
;
/**
* Order tool inside the toolbar
* @property orderTool
* @type Int
*/
Tool
.
orderTool
=
1000
;
/*************
* FUNCTIONS *
*************/
/**
* Initialize tooltype object from an object from database
* @param {object} config
*/
Tool
.
prototype
.
init
=
function
(
config
)
{
this
.
id
=
parseInt
(
config
.
id
,
10
)
||
0
;
this
.
axis
=
parseInt
(
config
.
axis
,
10
)
||
0
;
...
...
@@ -79,6 +159,11 @@ define(['jquery', './global'],
this
.
enabled
=
config
.
enabled
;
this
.
orderTool
=
config
.
orderTool
;
};
/**
* Initialize tooltype object from an object from database
* Special light init
* @param {object} config
*/
Tool
.
prototype
.
initAdmin
=
function
(
config
)
{
this
.
id
=
parseInt
(
config
.
toolid
,
10
)
||
0
;
this
.
typetool
=
config
.
typetool
;
...
...
@@ -86,19 +171,30 @@ define(['jquery', './global'],
this
.
enabled
=
config
.
enable
;
this
.
orderTool
=
config
.
orderTool
;
};
/**
* Get name of type's tool
* @returns {string} label
*/
Tool
.
prototype
.
getToolTypeLabel
=
function
()
{
return
this
.
type
.
label
;
};
/**
* Get the X position of the cartridge giving by type tool
* @returns {string} cartridgeX
*/
Tool
.
prototype
.
getToolTypeCartX
=
function
()
{
return
this
.
type
.
cartridgeX
;
};
/**
* Get the Y position of the cartridge giving by type tool
* @returns {string} cartridgeY
*/
Tool
.
prototype
.
getToolTypeCartY
=
function
()
{
return
this
.
type
.
cartridgeY
;
};
/**
* Get the final color for the annotation
* @return string
* @protected
* @return {string} html color
*/
Tool
.
prototype
.
get_color
=
function
()
{
var
color
=
global
.
ANNOTATIONCOLOUR
[
this
.
colors
];
...
...
@@ -116,8 +212,7 @@ define(['jquery', './global'],
};
/**
* Get the final color for the cartridge
* @return string
* @protected
* @return {string} html color
*/
Tool
.
prototype
.
get_color_cartridge
=
function
()
{
var
color
=
global
.
ANNOTATIONCOLOUR
[
this
.
cartridgeColor
];
...
...
@@ -133,6 +228,11 @@ define(['jquery', './global'],
}
return
color
;
};
/**
* Get the html code for design the tool's button into the toolbar
* @param {int} selectToolId
* @return {string} HTML code
*/
Tool
.
prototype
.
getButton
=
function
(
selectToolId
)
{
var
classButton
=
"
btn-default
"
;
var
style
=
""
;
...
...
amd/src/tooltype.js
View file @
c6428b86
...
...
@@ -18,15 +18,21 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/annotation
* @module mod_assignfeedback_editpdfplus/tooltype
* @param {Global} global constantes
* @returns {ToolType} tooltype object
*/
define
([
'
jquery
'
,
'
./global
'
],
function
(
$
,
global
)
{
define
([
'
./global
'
],
function
(
global
)
{
/*******************************
* CONSTRUCTOR and SUPER-CLASS *
*******************************/
// I am the internal, static counter for the number of models
// that have been created in the system. This is used to
// power the unique identifier of each instance.
var
instanceCount
=
0
;
// I get the next instance ID.
var
getNewInstanceID
=
function
()
{
// Precrement the instance count in order to generate the
...
...
@@ -35,16 +41,15 @@ define(['jquery', './global'],
};
// I return an initialized object.
/**
*
Annotation
class.
*
ToolType
class.
*
* @class
Annotation
* @class
ToolType
*/
function
ToolType
()
{
// Store the private instance id.
this
.
_instanceID
=
getNewInstanceID
();
// Return this object reference.
return
(
this
);
}
// I return the current instance count. I am a static method
// on the Model class.
...
...
@@ -54,20 +59,93 @@ define(['jquery', './global'],
ToolType
.
prototype
.
getInstanceID
=
function
()
{
return
(
this
.
_instanceID
);
};
/**************
* Parameters *
**************/
/**
* Base identifiant
* @property id
* @type Int
*/
ToolType
.
id
=
-
1
;
/**
* Code name
* @property label
* @type String
*/
ToolType
.
label
=
""
;
/**
* Default HTML color
* @property color
* @type String
*/
ToolType
.
color
=
""
;
/**
* Default HTML cartridge color
* @property cartridgeColor
* @type String
*/
ToolType
.
cartridgeColor
=
""
;
/**
* Default X position for cartridge
* @property cartridgeX
* @type Int
*/
ToolType
.
cartridgeX
=
0
;
/**
* Default Y position for cartridge
* @property cartridgeX
* @type Int
*/
ToolType
.
cartridgeY
=
0
;
/**
* Is the content's cartridge allowed to be configurable
* @property configurableCartridge
* @type Boolean
*/
ToolType
.
configurableCartridge
=
1
;
/**
* Is the color's cartridge allowed to be configurable
* @property configurableCartridgeColor
* @type Boolean
*/
ToolType
.
configurableCartridgeColor
=
1
;
/**
* Is the tool's color allowed to be configurable
* @property configurableColor
* @type Boolean
*/
ToolType
.
configurableColor
=
1
;
/**
* Are the tool's texts allowed to be configurable
* @property configurableTexts
* @type Boolean
*/
ToolType
.
configurableTexts
=
1
;
/**
* Is the tool's question/qnswer allowed to be configurable
* @property configurableQuestion
* @type Boolean
*/
ToolType
.
configurableQuestion
=
1
;
/*************
* FUNCTIONS *
*************/
/**
* Initialize tooltype object from an object from database with its base's id
* @param {object} config
*/
ToolType
.
prototype
.
init
=
function
(
config
)
{
this
.
id
=
parseInt
(
config
.
id
,
10
)
||
0
;
};
/**
* Initialize tooltype object from an object from database
* @param {object} config
*/
ToolType
.
prototype
.
initAdmin
=
function
(
config
)
{
this
.
id
=
parseInt
(
config
.
id
,
10
)
||
0
;
this
.
label
=
config
.
label
;
...
...
@@ -82,9 +160,8 @@ define(['jquery', './global'],
this
.
configurableQuestion
=
config
.
configurable_question
;
};
/**
* Get the final color for the annotation
* @return string
* @protected
* Get the default color of an annotation
* @return {string} color
*/
ToolType
.
prototype
.
get_color
=
function
()
{
var
color
=
global
.
ANNOTATIONCOLOUR
[
this
.
color
];
...
...
@@ -98,9 +175,8 @@ define(['jquery', './global'],
return
color
;
};
/**
* Get the final color for the cartridge
* @return string
* @protected
* Get the color for the cartridge
* @return {string} color
*/
ToolType
.
prototype
.
get_color_cartridge
=
function
()
{
var
color
=
global
.
ANNOTATIONCOLOUR
[
this
.
cartridgeColor
];
...
...
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