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
38250c50
Commit
38250c50
authored
Jun 12, 2019
by
M. Chardon
Browse files
correctif taille resize area verticalline annotation
parent
e1bbcad8
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
yui/build/moodle-assignfeedback_editpdfplus-editor/moodle-assignfeedback_editpdfplus-editor-debug.js
View file @
38250c50
...
...
@@ -1642,7 +1642,7 @@ Y.extend(ANNOTATION, Y.Base, {
* @param {string} colorcartridge
* @return node
*/
get_div_resizearea
:
function
(
direction
)
{
get_div_resizearea
:
function
(
direction
,
minwidth
,
minheight
)
{
var
plane
=
"
horizontal
"
;
if
(
direction
===
"
up
"
||
direction
===
"
down
"
)
{
plane
=
"
vertical
"
;
...
...
@@ -1652,9 +1652,15 @@ Y.extend(ANNOTATION, Y.Base, {
+
"
class='assignfeedback_editpdfplus_resize assignfeedback_editpdfplus_resize_
"
+
plane
+
"
'
"
;
if
(
plane
===
"
horizontal
"
)
{
var
intery
=
Math
.
max
(
this
.
endy
-
this
.
y
,
7
);
if
(
minheight
)
{
intery
=
minheight
;
}
div
+=
"
style='min-width:7px;min-height:
"
+
intery
+
"
px;'
"
;
}
else
{
var
interx
=
Math
.
max
(
this
.
endx
-
this
.
x
,
7
);
if
(
minwidth
)
{
interx
=
minwidth
;
}
div
+=
"
style='min-height:7px;min-width:
"
+
interx
+
"
px;'
"
;
}
div
+=
"
data-direction='
"
+
direction
+
"
'
"
...
...
@@ -1675,13 +1681,13 @@ Y.extend(ANNOTATION, Y.Base, {
* @param {int} x left position of the resize area
* @param {int} y top position of the resize area
*/
push_div_resizearea
:
function
(
direction
,
x
,
y
)
{
push_div_resizearea
:
function
(
direction
,
x
,
y
,
minwidth
,
minheight
)
{
var
drawingregion
=
this
.
editor
.
get_dialogue_element
(
SELECTOR
.
DRAWINGCANVAS
);
var
div
=
this
.
editor
.
get_dialogue_element
(
'
#
'
+
this
.
divcartridge
+
"
_resize_
"
+
direction
);
if
(
div
)
{
return
;
}
var
divresize
=
this
.
get_div_resizearea
(
direction
);
var
divresize
=
this
.
get_div_resizearea
(
direction
,
minwidth
,
minheight
);
if
(
!
divresize
)
{
return
;
}
...
...
@@ -3873,8 +3879,8 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
* Draw empty resize area on left and right
*/
draw_resizeAreas
:
function
()
{
this
.
push_div_resizearea
(
'
left
'
,
this
.
x
-
2
,
this
.
y
);
this
.
push_div_resizearea
(
'
right
'
,
this
.
endx
-
2
,
this
.
y
);
this
.
push_div_resizearea
(
'
left
'
,
this
.
x
-
this
.
marginDivResize
,
this
.
y
);
this
.
push_div_resizearea
(
'
right
'
,
this
.
endx
-
this
.
marginDivResize
,
this
.
y
);
},
/**
* Actions when resizing a shape:
...
...
@@ -4228,11 +4234,23 @@ ANNOTATIONVERTICALLINE.ATTRS = {};
Y
.
extend
(
ANNOTATIONVERTICALLINE
,
M
.
assignfeedback_editpdfplus
.
annotation
,
{
/**
* Margin to let for resize area
* Margin to let for resize area on top and down
* @type Number
* @protected
*/
marginyDivResize
:
2
,
/**
* Margin to let for resize area on left and right
* @type Number
* @protected
*/
marginxDivResize
:
7
,
/**
* Min width for resize area
* @type Number
* @protected
*/
m
argin
DivResize
:
2
,
m
inWidth
DivResize
:
15
,
/**
* Draw a verticalline annotation
* @protected
...
...
@@ -4412,8 +4430,8 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
* Draw empty resize area on top and down
*/
draw_resizeAreas
:
function
()
{
this
.
push_div_resizearea
(
'
up
'
,
this
.
x
-
7
,
this
.
y
-
this
.
marginDivResize
);
this
.
push_div_resizearea
(
'
down
'
,
this
.
x
-
7
,
this
.
endy
-
this
.
marginDivResize
);
this
.
push_div_resizearea
(
'
up
'
,
this
.
x
-
this
.
marginxDivResize
,
this
.
y
-
this
.
margin
yDivResize
,
this
.
minWidth
DivResize
);
this
.
push_div_resizearea
(
'
down
'
,
this
.
x
-
this
.
marginxDivResize
,
this
.
endy
-
this
.
margin
yDivResize
,
this
.
minWidth
DivResize
);
},
/**
* Actions when resizing a shape:
...
...
@@ -4449,14 +4467,14 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
shape
.
moveTo
(
this
.
x
,
Math
.
min
(
newpointy
,
this
.
endy
-
this
.
minresizewidth
));
shape
.
lineTo
(
this
.
x
,
this
.
endy
);
shape
.
end
();
divresize
.
setY
(
this
.
endy
-
height
+
decalage
-
this
.
marginDivResize
);
divresize
.
setY
(
this
.
endy
-
height
+
decalage
-
this
.
margin
y
DivResize
);
}
else
if
(
direction
===
'
down
'
)
{
height
=
Math
.
max
(
newpointy
-
this
.
y
,
this
.
minresizewidth
);
shape
.
clear
();
shape
.
moveTo
(
this
.
x
,
this
.
y
);
shape
.
lineTo
(
this
.
x
,
this
.
y
+
height
);
shape
.
end
();
divresize
.
setY
(
this
.
y
+
height
+
decalage
-
this
.
marginDivResize
);
divresize
.
setY
(
this
.
y
+
height
+
decalage
-
this
.
margin
y
DivResize
);
}
},
/**
...
...
yui/build/moodle-assignfeedback_editpdfplus-editor/moodle-assignfeedback_editpdfplus-editor-min.js
View file @
38250c50
This diff is collapsed.
Click to expand it.
yui/build/moodle-assignfeedback_editpdfplus-editor/moodle-assignfeedback_editpdfplus-editor.js
View file @
38250c50
...
...
@@ -1642,7 +1642,7 @@ Y.extend(ANNOTATION, Y.Base, {
* @param {string} colorcartridge
* @return node
*/
get_div_resizearea
:
function
(
direction
)
{
get_div_resizearea
:
function
(
direction
,
minwidth
,
minheight
)
{
var
plane
=
"
horizontal
"
;
if
(
direction
===
"
up
"
||
direction
===
"
down
"
)
{
plane
=
"
vertical
"
;
...
...
@@ -1652,9 +1652,15 @@ Y.extend(ANNOTATION, Y.Base, {
+
"
class='assignfeedback_editpdfplus_resize assignfeedback_editpdfplus_resize_
"
+
plane
+
"
'
"
;
if
(
plane
===
"
horizontal
"
)
{
var
intery
=
Math
.
max
(
this
.
endy
-
this
.
y
,
7
);
if
(
minheight
)
{
intery
=
minheight
;
}
div
+=
"
style='min-width:7px;min-height:
"
+
intery
+
"
px;'
"
;
}
else
{
var
interx
=
Math
.
max
(
this
.
endx
-
this
.
x
,
7
);
if
(
minwidth
)
{
interx
=
minwidth
;
}
div
+=
"
style='min-height:7px;min-width:
"
+
interx
+
"
px;'
"
;
}
div
+=
"
data-direction='
"
+
direction
+
"
'
"
...
...
@@ -1675,13 +1681,13 @@ Y.extend(ANNOTATION, Y.Base, {
* @param {int} x left position of the resize area
* @param {int} y top position of the resize area
*/
push_div_resizearea
:
function
(
direction
,
x
,
y
)
{
push_div_resizearea
:
function
(
direction
,
x
,
y
,
minwidth
,
minheight
)
{
var
drawingregion
=
this
.
editor
.
get_dialogue_element
(
SELECTOR
.
DRAWINGCANVAS
);
var
div
=
this
.
editor
.
get_dialogue_element
(
'
#
'
+
this
.
divcartridge
+
"
_resize_
"
+
direction
);
if
(
div
)
{
return
;
}
var
divresize
=
this
.
get_div_resizearea
(
direction
);
var
divresize
=
this
.
get_div_resizearea
(
direction
,
minwidth
,
minheight
);
if
(
!
divresize
)
{
return
;
}
...
...
@@ -3873,8 +3879,8 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
* Draw empty resize area on left and right
*/
draw_resizeAreas
:
function
()
{
this
.
push_div_resizearea
(
'
left
'
,
this
.
x
-
2
,
this
.
y
);
this
.
push_div_resizearea
(
'
right
'
,
this
.
endx
-
2
,
this
.
y
);
this
.
push_div_resizearea
(
'
left
'
,
this
.
x
-
this
.
marginDivResize
,
this
.
y
);
this
.
push_div_resizearea
(
'
right
'
,
this
.
endx
-
this
.
marginDivResize
,
this
.
y
);
},
/**
* Actions when resizing a shape:
...
...
@@ -4228,11 +4234,23 @@ ANNOTATIONVERTICALLINE.ATTRS = {};
Y
.
extend
(
ANNOTATIONVERTICALLINE
,
M
.
assignfeedback_editpdfplus
.
annotation
,
{
/**
* Margin to let for resize area
* Margin to let for resize area on top and down
* @type Number
* @protected
*/
marginyDivResize
:
2
,
/**
* Margin to let for resize area on left and right
* @type Number
* @protected
*/
marginxDivResize
:
7
,
/**
* Min width for resize area
* @type Number
* @protected
*/
m
argin
DivResize
:
2
,
m
inWidth
DivResize
:
15
,
/**
* Draw a verticalline annotation
* @protected
...
...
@@ -4412,8 +4430,8 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
* Draw empty resize area on top and down
*/
draw_resizeAreas
:
function
()
{
this
.
push_div_resizearea
(
'
up
'
,
this
.
x
-
7
,
this
.
y
-
this
.
marginDivResize
);
this
.
push_div_resizearea
(
'
down
'
,
this
.
x
-
7
,
this
.
endy
-
this
.
marginDivResize
);
this
.
push_div_resizearea
(
'
up
'
,
this
.
x
-
this
.
marginxDivResize
,
this
.
y
-
this
.
margin
yDivResize
,
this
.
minWidth
DivResize
);
this
.
push_div_resizearea
(
'
down
'
,
this
.
x
-
this
.
marginxDivResize
,
this
.
endy
-
this
.
margin
yDivResize
,
this
.
minWidth
DivResize
);
},
/**
* Actions when resizing a shape:
...
...
@@ -4449,14 +4467,14 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
shape
.
moveTo
(
this
.
x
,
Math
.
min
(
newpointy
,
this
.
endy
-
this
.
minresizewidth
));
shape
.
lineTo
(
this
.
x
,
this
.
endy
);
shape
.
end
();
divresize
.
setY
(
this
.
endy
-
height
+
decalage
-
this
.
marginDivResize
);
divresize
.
setY
(
this
.
endy
-
height
+
decalage
-
this
.
margin
y
DivResize
);
}
else
if
(
direction
===
'
down
'
)
{
height
=
Math
.
max
(
newpointy
-
this
.
y
,
this
.
minresizewidth
);
shape
.
clear
();
shape
.
moveTo
(
this
.
x
,
this
.
y
);
shape
.
lineTo
(
this
.
x
,
this
.
y
+
height
);
shape
.
end
();
divresize
.
setY
(
this
.
y
+
height
+
decalage
-
this
.
marginDivResize
);
divresize
.
setY
(
this
.
y
+
height
+
decalage
-
this
.
margin
y
DivResize
);
}
},
/**
...
...
yui/src/editor/js/annotation.js
View file @
38250c50
...
...
@@ -1110,7 +1110,7 @@ Y.extend(ANNOTATION, Y.Base, {
* @param {string} colorcartridge
* @return node
*/
get_div_resizearea
:
function
(
direction
)
{
get_div_resizearea
:
function
(
direction
,
minwidth
,
minheight
)
{
var
plane
=
"
horizontal
"
;
if
(
direction
===
"
up
"
||
direction
===
"
down
"
)
{
plane
=
"
vertical
"
;
...
...
@@ -1120,9 +1120,15 @@ Y.extend(ANNOTATION, Y.Base, {
+
"
class='assignfeedback_editpdfplus_resize assignfeedback_editpdfplus_resize_
"
+
plane
+
"
'
"
;
if
(
plane
===
"
horizontal
"
)
{
var
intery
=
Math
.
max
(
this
.
endy
-
this
.
y
,
7
);
if
(
minheight
)
{
intery
=
minheight
;
}
div
+=
"
style='min-width:7px;min-height:
"
+
intery
+
"
px;'
"
;
}
else
{
var
interx
=
Math
.
max
(
this
.
endx
-
this
.
x
,
7
);
if
(
minwidth
)
{
interx
=
minwidth
;
}
div
+=
"
style='min-height:7px;min-width:
"
+
interx
+
"
px;'
"
;
}
div
+=
"
data-direction='
"
+
direction
+
"
'
"
...
...
@@ -1143,13 +1149,13 @@ Y.extend(ANNOTATION, Y.Base, {
* @param {int} x left position of the resize area
* @param {int} y top position of the resize area
*/
push_div_resizearea
:
function
(
direction
,
x
,
y
)
{
push_div_resizearea
:
function
(
direction
,
x
,
y
,
minwidth
,
minheight
)
{
var
drawingregion
=
this
.
editor
.
get_dialogue_element
(
SELECTOR
.
DRAWINGCANVAS
);
var
div
=
this
.
editor
.
get_dialogue_element
(
'
#
'
+
this
.
divcartridge
+
"
_resize_
"
+
direction
);
if
(
div
)
{
return
;
}
var
divresize
=
this
.
get_div_resizearea
(
direction
);
var
divresize
=
this
.
get_div_resizearea
(
direction
,
minwidth
,
minheight
);
if
(
!
divresize
)
{
return
;
}
...
...
yui/src/editor/js/annotationframe.js
View file @
38250c50
...
...
@@ -391,8 +391,8 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
* Draw empty resize area on left and right
*/
draw_resizeAreas
:
function
()
{
this
.
push_div_resizearea
(
'
left
'
,
this
.
x
-
2
,
this
.
y
);
this
.
push_div_resizearea
(
'
right
'
,
this
.
endx
-
2
,
this
.
y
);
this
.
push_div_resizearea
(
'
left
'
,
this
.
x
-
this
.
marginDivResize
,
this
.
y
);
this
.
push_div_resizearea
(
'
right
'
,
this
.
endx
-
this
.
marginDivResize
,
this
.
y
);
},
/**
* Actions when resizing a shape:
...
...
yui/src/editor/js/annotationverticalline.js
View file @
38250c50
...
...
@@ -39,11 +39,23 @@ ANNOTATIONVERTICALLINE.ATTRS = {};
Y
.
extend
(
ANNOTATIONVERTICALLINE
,
M
.
assignfeedback_editpdfplus
.
annotation
,
{
/**
* Margin to let for resize area
* Margin to let for resize area
on top and down
* @type Number
* @protected
*/
marginDivResize
:
2
,
marginyDivResize
:
2
,
/**
* Margin to let for resize area on left and right
* @type Number
* @protected
*/
marginxDivResize
:
7
,
/**
* Min width for resize area
* @type Number
* @protected
*/
minWidthDivResize
:
15
,
/**
* Draw a verticalline annotation
* @protected
...
...
@@ -223,8 +235,8 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
* Draw empty resize area on top and down
*/
draw_resizeAreas
:
function
()
{
this
.
push_div_resizearea
(
'
up
'
,
this
.
x
-
7
,
this
.
y
-
this
.
marginDivResize
);
this
.
push_div_resizearea
(
'
down
'
,
this
.
x
-
7
,
this
.
endy
-
this
.
marginDivResize
);
this
.
push_div_resizearea
(
'
up
'
,
this
.
x
-
this
.
marginxDivResize
,
this
.
y
-
this
.
margin
yDivResize
,
this
.
minWidth
DivResize
);
this
.
push_div_resizearea
(
'
down
'
,
this
.
x
-
this
.
marginxDivResize
,
this
.
endy
-
this
.
margin
yDivResize
,
this
.
minWidth
DivResize
);
},
/**
* Actions when resizing a shape:
...
...
@@ -260,14 +272,14 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
shape
.
moveTo
(
this
.
x
,
Math
.
min
(
newpointy
,
this
.
endy
-
this
.
minresizewidth
));
shape
.
lineTo
(
this
.
x
,
this
.
endy
);
shape
.
end
();
divresize
.
setY
(
this
.
endy
-
height
+
decalage
-
this
.
marginDivResize
);
divresize
.
setY
(
this
.
endy
-
height
+
decalage
-
this
.
margin
y
DivResize
);
}
else
if
(
direction
===
'
down
'
)
{
height
=
Math
.
max
(
newpointy
-
this
.
y
,
this
.
minresizewidth
);
shape
.
clear
();
shape
.
moveTo
(
this
.
x
,
this
.
y
);
shape
.
lineTo
(
this
.
x
,
this
.
y
+
height
);
shape
.
end
();
divresize
.
setY
(
this
.
y
+
height
+
decalage
-
this
.
marginDivResize
);
divresize
.
setY
(
this
.
y
+
height
+
decalage
-
this
.
margin
y
DivResize
);
}
},
/**
...
...
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