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
6c8d5da7
Commit
6c8d5da7
authored
May 25, 2018
by
M. Chardon
Browse files
repercution des couleurs des tampons dans l'édition et dans le PDF généré
parent
b3d5baea
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
classes/pdf.php
View file @
6c8d5da7
...
...
@@ -383,13 +383,13 @@ class pdf extends \FPDI {
break
;
case
'stampcomment'
:
if
(
$annotation
->
displayrotation
==
1
)
{
$imgFileFromFA
=
utils_stamp
::
getPngFromFont
(
"arrows-v"
);
$imgFileFromFA
=
utils_stamp
::
getPngFromFont
(
"arrows-v"
,
$colourcartridge
);
//$imgfile = $CFG->dirroot . '/mod/assign/feedback/editpdfplus/pix/twoway_v_pdf.png';
//$h = 20; //abs($sy - $ey);
//$w = $h * 37 / 96;
$sx
=
min
(
$sx
,
$ex
)
-
6
;
}
else
{
$imgFileFromFA
=
utils_stamp
::
getPngFromFont
(
"arrows-h"
);
$imgFileFromFA
=
utils_stamp
::
getPngFromFont
(
"arrows-h"
,
$colourcartridge
);
//$imgfile = $CFG->dirroot . '/mod/assign/feedback/editpdfplus/pix/twoway_h_pdf.png';
//$w = 20; //abs($sx - $ex);
//$h = $w * 37 / 96;
...
...
@@ -407,7 +407,7 @@ class pdf extends \FPDI {
$this
->
SetXY
(
$scartx
,
$scarty
);
break
;
case
'commentplus'
:
$imgFileFromFA
=
utils_stamp
::
getPngFromFont
(
"commenting"
);
$imgFileFromFA
=
utils_stamp
::
getPngFromFont
(
"commenting"
,
$colourcartridge
);
//$imgfile = $CFG->dirroot . '/mod/assign/feedback/editpdfplus/pix/comment.png';
$w
=
16
*
$this
->
scale
;
$h
=
16
*
$this
->
scale
;
...
...
classes/utils_stamp.php
View file @
6c8d5da7
...
...
@@ -99,7 +99,7 @@ class utils_stamp {
imagealphablending
(
$imageTmp
,
false
);
// Create font colors
$fontColor
=
imagecolorallocate
(
$imageTmp
,
$colorRGB
[
'r'
],
$colorRGB
[
'g'
],
$colorRGB
[
'b'
]);
$fontColor
=
imagecolorallocate
(
$imageTmp
,
$colorRGB
[
'r
ed
'
],
$colorRGB
[
'g
reen
'
],
$colorRGB
[
'b
lue
'
]);
$background
=
imagecolorallocatealpha
(
$imageTmp
,
255
,
0
,
255
,
127
);
// Draw rectangle
...
...
yui/build/moodle-assignfeedback_editpdfplus-editor/moodle-assignfeedback_editpdfplus-editor-debug.js
View file @
6c8d5da7
...
...
@@ -3154,13 +3154,18 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
this
.
shape_id
=
'
ct_stampcomment_
'
+
(
new
Date
().
toJSON
()).
replace
(
/:/g
,
''
).
replace
(
/
\.
/g
,
''
);
position
=
this
.
editor
.
get_window_coordinates
(
new
M
.
assignfeedback_editpdfplus
.
point
(
this
.
x
,
this
.
y
));
var
colorcartridge
=
this
.
get_color_cartridge
();
var
fleche
=
'
<i id="
'
+
this
.
shape_id
+
'
_img"
'
+
'
class="fa fa-arrows-h fa-2x" aria-hidden="true"></i>
'
;
+
'
class="fa fa-arrows-h fa-2x" aria-hidden="true" style="color:
'
+
colorcartridge
+
'
;"></i>
'
;
if
(
this
.
displayrotation
>
0
)
{
fleche
=
'
<i id="
'
+
this
.
shape_id
+
'
_img"
'
+
'
class="fa fa-arrows-v fa-2x" aria-hidden="true"></i>
'
;
+
'
class="fa fa-arrows-v fa-2x" aria-hidden="true" style="color:
'
+
colorcartridge
+
'
;"></i>
'
;
}
node
=
Y
.
Node
.
create
(
'
<div id="
'
+
this
.
shape_id
+
'
">
'
+
fleche
+
'
</div>
'
);
node
.
setStyles
({
...
...
@@ -3196,7 +3201,11 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
bounds
.
bound
([
edit
.
start
,
edit
.
end
]);
position
=
this
.
editor
.
get_window_coordinates
(
new
M
.
assignfeedback_editpdfplus
.
point
(
bounds
.
x
,
bounds
.
y
));
node
=
Y
.
Node
.
create
(
'
<div><i class="fa fa-arrows-v fa-2x" aria-hidden="true"></i>></div>
'
);
var
colorcartridge
=
this
.
get_color_cartridge
();
var
nodeContent
=
'
<div><i class="fa fa-arrows-v fa-2x" aria-hidden="true" style="color:
'
+
colorcartridge
+
'
"></i></div>
'
;
node
=
Y
.
Node
.
create
(
nodeContent
);
node
.
setStyles
({
'
position
'
:
'
absolute
'
,
'
display
'
:
'
inline-block
'
...
...
@@ -4303,7 +4312,10 @@ Y.extend(ANNOTATIONCOMMENTPLUS, M.assignfeedback_editpdfplus.annotation, {
position
;
position
=
this
.
editor
.
get_window_coordinates
(
new
M
.
assignfeedback_editpdfplus
.
point
(
this
.
x
,
this
.
y
));
node
=
Y
.
Node
.
create
(
'
<div><i class="fa fa-commenting" aria-hidden="true" style="color:black;"></i></div>
'
);
var
colorcartridge
=
this
.
get_color_cartridge
();
node
=
Y
.
Node
.
create
(
'
<div><i class="fa fa-commenting" aria-hidden="true" style="color:
'
+
colorcartridge
+
'
;"></i></div>
'
);
node
.
setStyles
({
'
position
'
:
'
absolute
'
,
'
display
'
:
'
inline-block
'
,
...
...
yui/build/moodle-assignfeedback_editpdfplus-editor/moodle-assignfeedback_editpdfplus-editor-min.js
View file @
6c8d5da7
This diff is collapsed.
Click to expand it.
yui/build/moodle-assignfeedback_editpdfplus-editor/moodle-assignfeedback_editpdfplus-editor.js
View file @
6c8d5da7
...
...
@@ -3154,13 +3154,18 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
this
.
shape_id
=
'
ct_stampcomment_
'
+
(
new
Date
().
toJSON
()).
replace
(
/:/g
,
''
).
replace
(
/
\.
/g
,
''
);
position
=
this
.
editor
.
get_window_coordinates
(
new
M
.
assignfeedback_editpdfplus
.
point
(
this
.
x
,
this
.
y
));
var
colorcartridge
=
this
.
get_color_cartridge
();
var
fleche
=
'
<i id="
'
+
this
.
shape_id
+
'
_img"
'
+
'
class="fa fa-arrows-h fa-2x" aria-hidden="true"></i>
'
;
+
'
class="fa fa-arrows-h fa-2x" aria-hidden="true" style="color:
'
+
colorcartridge
+
'
;"></i>
'
;
if
(
this
.
displayrotation
>
0
)
{
fleche
=
'
<i id="
'
+
this
.
shape_id
+
'
_img"
'
+
'
class="fa fa-arrows-v fa-2x" aria-hidden="true"></i>
'
;
+
'
class="fa fa-arrows-v fa-2x" aria-hidden="true" style="color:
'
+
colorcartridge
+
'
;"></i>
'
;
}
node
=
Y
.
Node
.
create
(
'
<div id="
'
+
this
.
shape_id
+
'
">
'
+
fleche
+
'
</div>
'
);
node
.
setStyles
({
...
...
@@ -3196,7 +3201,11 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
bounds
.
bound
([
edit
.
start
,
edit
.
end
]);
position
=
this
.
editor
.
get_window_coordinates
(
new
M
.
assignfeedback_editpdfplus
.
point
(
bounds
.
x
,
bounds
.
y
));
node
=
Y
.
Node
.
create
(
'
<div><i class="fa fa-arrows-v fa-2x" aria-hidden="true"></i>></div>
'
);
var
colorcartridge
=
this
.
get_color_cartridge
();
var
nodeContent
=
'
<div><i class="fa fa-arrows-v fa-2x" aria-hidden="true" style="color:
'
+
colorcartridge
+
'
"></i></div>
'
;
node
=
Y
.
Node
.
create
(
nodeContent
);
node
.
setStyles
({
'
position
'
:
'
absolute
'
,
'
display
'
:
'
inline-block
'
...
...
@@ -4303,7 +4312,10 @@ Y.extend(ANNOTATIONCOMMENTPLUS, M.assignfeedback_editpdfplus.annotation, {
position
;
position
=
this
.
editor
.
get_window_coordinates
(
new
M
.
assignfeedback_editpdfplus
.
point
(
this
.
x
,
this
.
y
));
node
=
Y
.
Node
.
create
(
'
<div><i class="fa fa-commenting" aria-hidden="true" style="color:black;"></i></div>
'
);
var
colorcartridge
=
this
.
get_color_cartridge
();
node
=
Y
.
Node
.
create
(
'
<div><i class="fa fa-commenting" aria-hidden="true" style="color:
'
+
colorcartridge
+
'
;"></i></div>
'
);
node
.
setStyles
({
'
position
'
:
'
absolute
'
,
'
display
'
:
'
inline-block
'
,
...
...
yui/src/editor/js/annotationcommentplus.js
View file @
6c8d5da7
...
...
@@ -49,7 +49,10 @@ Y.extend(ANNOTATIONCOMMENTPLUS, M.assignfeedback_editpdfplus.annotation, {
position
;
position
=
this
.
editor
.
get_window_coordinates
(
new
M
.
assignfeedback_editpdfplus
.
point
(
this
.
x
,
this
.
y
));
node
=
Y
.
Node
.
create
(
'
<div><i class="fa fa-commenting" aria-hidden="true" style="color:black;"></i></div>
'
);
var
colorcartridge
=
this
.
get_color_cartridge
();
node
=
Y
.
Node
.
create
(
'
<div><i class="fa fa-commenting" aria-hidden="true" style="color:
'
+
colorcartridge
+
'
;"></i></div>
'
);
node
.
setStyles
({
'
position
'
:
'
absolute
'
,
'
display
'
:
'
inline-block
'
,
...
...
yui/src/editor/js/annotationstampcomment.js
View file @
6c8d5da7
...
...
@@ -50,13 +50,18 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
this
.
shape_id
=
'
ct_stampcomment_
'
+
(
new
Date
().
toJSON
()).
replace
(
/:/g
,
''
).
replace
(
/
\.
/g
,
''
);
position
=
this
.
editor
.
get_window_coordinates
(
new
M
.
assignfeedback_editpdfplus
.
point
(
this
.
x
,
this
.
y
));
var
colorcartridge
=
this
.
get_color_cartridge
();
var
fleche
=
'
<i id="
'
+
this
.
shape_id
+
'
_img"
'
+
'
class="fa fa-arrows-h fa-2x" aria-hidden="true"></i>
'
;
+
'
class="fa fa-arrows-h fa-2x" aria-hidden="true" style="color:
'
+
colorcartridge
+
'
;"></i>
'
;
if
(
this
.
displayrotation
>
0
)
{
fleche
=
'
<i id="
'
+
this
.
shape_id
+
'
_img"
'
+
'
class="fa fa-arrows-v fa-2x" aria-hidden="true"></i>
'
;
+
'
class="fa fa-arrows-v fa-2x" aria-hidden="true" style="color:
'
+
colorcartridge
+
'
;"></i>
'
;
}
node
=
Y
.
Node
.
create
(
'
<div id="
'
+
this
.
shape_id
+
'
">
'
+
fleche
+
'
</div>
'
);
node
.
setStyles
({
...
...
@@ -92,7 +97,11 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
bounds
.
bound
([
edit
.
start
,
edit
.
end
]);
position
=
this
.
editor
.
get_window_coordinates
(
new
M
.
assignfeedback_editpdfplus
.
point
(
bounds
.
x
,
bounds
.
y
));
node
=
Y
.
Node
.
create
(
'
<div><i class="fa fa-arrows-v fa-2x" aria-hidden="true"></i>></div>
'
);
var
colorcartridge
=
this
.
get_color_cartridge
();
var
nodeContent
=
'
<div><i class="fa fa-arrows-v fa-2x" aria-hidden="true" style="color:
'
+
colorcartridge
+
'
"></i></div>
'
;
node
=
Y
.
Node
.
create
(
nodeContent
);
node
.
setStyles
({
'
position
'
:
'
absolute
'
,
'
display
'
:
'
inline-block
'
...
...
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