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
6976b668
Commit
6976b668
authored
Jun 03, 2019
by
M. Chardon
Browse files
améliorations visu barre d'outil / taille fenêtre
parent
03bd1445
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
classes/bdd/tool.php
View file @
6976b668
...
...
@@ -201,7 +201,7 @@ class tool {
}
$datatool
=
$this
->
typeObject
->
label
;
$iconparams
=
array
(
'data-tool'
=>
$datatool
,
'class'
=>
$this
->
typeObject
->
label
.
' costumtoolbarbutton btn btn-
secondary
'
,
'class'
=>
$this
->
typeObject
->
label
.
' costumtoolbarbutton btn btn-
light
'
,
'id'
=>
'ctbutton'
.
$this
->
id
,
'type'
=>
'button'
,
'style'
=>
$this
->
getStyleButton
());
...
...
classes/bdd/tool_generic.php
View file @
6976b668
...
...
@@ -54,7 +54,7 @@ class tool_generic extends tool {
$iconhtml
=
\
html_writer
::
tag
(
"i"
,
""
,
array
(
'class'
=>
self
::
DISPLAY_CLASS_BUTTON
[
$this
->
label
],
'aria-hidden'
=>
'true'
));
$iconparams
=
array
(
'data-tool'
=>
$this
->
label
,
'class'
=>
$this
->
label
.
'button generictoolbarbutton btn btn-
secondary
'
,
'class'
=>
$this
->
label
.
'button generictoolbarbutton btn btn-
light
'
,
'type'
=>
'button'
);
if
(
$this
->
id
)
{
...
...
classes/renderer.php
View file @
6976b668
...
...
@@ -114,7 +114,7 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
//Random id for plugin identification
$linkid
=
html_writer
::
random_id
();
$labelLaunchedEditor
=
(
$widget
->
readonly
)
?
get_string
(
'viewfeedbackonline'
,
self
::
PLUGIN_NAME
)
:
get_string
(
'launcheditor'
,
self
::
PLUGIN_NAME
);
$links
=
html_writer
::
tag
(
'a'
,
$labelLaunchedEditor
,
array
(
'id'
=>
$linkid
,
self
::
HTMLCLASS
=>
'btn btn-
secondary
'
,
'href'
=>
'#'
));
$links
=
html_writer
::
tag
(
'a'
,
$labelLaunchedEditor
,
array
(
'id'
=>
$linkid
,
self
::
HTMLCLASS
=>
'btn btn-
light
'
,
'href'
=>
'#'
));
$html
.
=
'<input type="hidden" name="assignfeedback_editpdfplus_haschanges" value="false"/>'
;
$html
.
=
html_writer
::
div
(
$links
,
'visibleifjs'
);
...
...
@@ -133,7 +133,7 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
$nav_prev
=
'nav_prev'
;
$nav_next
=
'nav_next'
;
}
$classNav
=
"btn btn-
secondary
"
;
$classNav
=
"btn btn-
light
"
;
$iconhtmlP
=
$this
->
render_toolbar_button_icon
(
"fa-caret-left fa-2x"
);
$navigation
.
=
$this
->
render_toolbar_button_html
(
$iconhtmlP
,
array
(
self
::
HTMLDISABLED
=>
'true'
,
self
::
HTMLCLASS
=>
$classNav
.
'navigate-previous-button'
));
...
...
@@ -143,7 +143,7 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
$navigation
.
=
$this
->
render_toolbar_button_html
(
$iconhtmlN
,
array
(
self
::
HTMLDISABLED
=>
'true'
,
self
::
HTMLCLASS
=>
$classNav
.
"navigate-next-button"
));
$navigationBlock
=
$this
->
render_toolbar
(
$navigation
,
"mr-
auto
"
);
$navigationBlock
=
$this
->
render_toolbar
(
$navigation
,
"mr-
3
"
);
$toolbarRotationBlock
=
''
;
$toolbarBaseBlock
=
''
;
...
...
@@ -219,20 +219,26 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
[
get_string
(
'question_select'
,
self
::
PLUGIN_NAME
),
get_string
(
'question_select_without'
,
self
::
PLUGIN_NAME
),
get_string
(
'question_select_with'
,
self
::
PLUGIN_NAME
)],
'questionselection'
,
0
,
FALSE
,
array
(
self
::
HTMLCLASS
=>
'form-control'
));
$statuschoice
=
html_writer
::
select
(
[
get_string
(
'statut_select'
,
self
::
PLUGIN_NAME
),
get_string
(
'statut_select_nc'
,
self
::
PLUGIN_NAME
),
get_string
(
'statut_select_ok'
,
self
::
PLUGIN_NAME
),
get_string
(
'statut_select_ko'
,
self
::
PLUGIN_NAME
)],
'statutselection'
,
0
,
FALSE
,
array
(
self
::
HTMLCLASS
=>
'form-control'
));
$validatebutton
=
$this
->
render_toolbar_button_html
(
get_string
(
'send_pdf_update'
,
self
::
PLUGIN_NAME
),
array
(
self
::
HTMLCLASS
=>
'btn btn-
secondary
'
,
'id'
=>
'student_valide_button'
));
$validatebutton
=
$this
->
render_toolbar_button_html
(
get_string
(
'send_pdf_update'
,
self
::
PLUGIN_NAME
),
array
(
self
::
HTMLCLASS
=>
'btn btn-
light
'
,
'id'
=>
'student_valide_button'
));
$toolbarAxis
.
=
$this
->
render_toolbar
(
$statuschoice
);
$toolbarAxis
.
=
$this
->
render_toolbar
(
$questionchoice
,
'mr-3'
);
$toolbarAxis
.
=
$this
->
render_toolbar
(
$validatebutton
,
'mr-0'
);
}
$pageheadercontent
=
$navigationBlock
$pageheadercontent
=
"<div class='d-flex align-content-center flex-nowrap align-items-center'>"
.
$navigationBlock
.
$toolbarAdminBlock
.
"<div class='d-fex flex-wrap align-content-center align-items-center'>"
.
$toolbarRotationBlock
.
$toolbarBaseBlock
.
"<div class='btn-group btn-group-sm p-1'>"
.
$toolbarAxis
.
$toolbarCostumdiv
.
$toolbarDrawBlock
;
$mainnavigation
=
html_writer
::
div
(
$pageheadercontent
,
"btn-toolbar btn-group-sm bg-light p-1"
,
array
(
'role'
=>
'toolbar'
));
.
'</div>'
.
$toolbarDrawBlock
.
'</div>'
.
'</div>'
;
$mainnavigation
=
html_writer
::
div
(
$pageheadercontent
,
"drawingtoolbar btn-toolbar btn-group-sm bg-light p-1"
,
array
(
'role'
=>
'toolbar'
));
$body
.
=
$mainnavigation
;
...
...
styles.css
View file @
6976b668
...
...
@@ -42,18 +42,10 @@
.assignfeedback_editpdfplus_widget
.drawingregion
{
border
:
1px
solid
#ccc
;
left
:
0.1em
;
right
:
1em
;
/*top: 52px;*/
bottom
:
0
;
position
:
absolute
;
overflow
:
auto
;
overflow
:
scroll
;
background-color
:
#ccc
;
touch-action
:
none
;
}
.assignfeedback_editpdfplus_widget
[
data-region
=
"review-panel-content"
]
.drawingregion
{
top
:
52px
;
max-height
:
600px
;
}
.assignfeedback_editpdfplus_widget
{
...
...
@@ -87,9 +79,7 @@
top
:
60px
;
}
.yui3-colourpicker-hidden
,
.yui3-commentsearch-hidden
,
.yui3-commentmenu-hidden
{
.yui3-colourpicker-hidden
{
display
:
none
;
}
...
...
@@ -247,7 +237,6 @@
}
ul
.assignfeedback_editpdfplus_menu
{
margin
:
0
;
min-width
:
200px
;
max-height
:
40vh
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
...
...
yui/build/moodle-assignfeedback_editpdfplus-editor/moodle-assignfeedback_editpdfplus-editor-debug.js
View file @
6976b668
...
...
@@ -32,7 +32,9 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdfplus/ajax.php',
LOADINGICON
:
'
.loading
'
,
PROGRESSBARCONTAINER
:
'
.progress-info.progress-striped
'
,
DRAWINGREGION
:
'
.drawingregion
'
,
DRAWINGREGIONCLASS
:
'
drawingregion
'
,
DRAWINGCANVAS
:
'
.drawingcanvas
'
,
DRAWINGTOOLBAR
:
'
drawingtoolbar
'
,
SAVE
:
'
.savebutton
'
,
ANNOTATIONCOLOURBUTTON
:
'
.annotationcolourbutton
'
,
DELETEANNOTATIONBUTTON
:
'
.deleteannotationbutton
'
,
...
...
@@ -5064,6 +5066,11 @@ EDITOR.prototype = {
drawingcanvas
.
on
(
'
gesturemoveend
'
,
this
.
edit_end
,
null
,
this
);
this
.
refresh_button_state
();
//trigger when window is resized
drawingcanvas
.
on
(
'
windowresize
'
,
this
.
resize
,
this
);
var
buttonChooseView
=
Y
.
one
(
'
.collapse-buttons
'
);
buttonChooseView
.
on
(
'
click
'
,
this
.
temporise
,
this
,
this
.
resize
,
500
);
}
this
.
start_generation
();
...
...
@@ -5971,14 +5978,23 @@ EDITOR.prototype = {
}
},
/**
* Temporise a function.
* @public
* @method resize
*/
temporise
:
function
(
e
,
fct
,
timeout
)
{
e
.
preventDefault
();
setTimeout
(
fct
,
timeout
);
},
/**
* Resize the dialogue window when the browser is resized.
* @public
* @method resize
*/
resize
:
function
()
{
var
drawingregion
,
drawregionheight
;
var
drawingregion
,
drawregionheight
,
drawregiontop
;
if
(
this
.
dialogue
)
{
if
(
!
this
.
dialogue
.
get
(
'
visible
'
))
{
return
;
...
...
@@ -5986,16 +6002,35 @@ EDITOR.prototype = {
this
.
dialogue
.
centerDialogue
();
}
//calculate top div
var
drawingregionheaderSelector
=
document
.
getElementsByClassName
(
SELECTOR
.
DRAWINGTOOLBAR
);
if
(
drawingregionheaderSelector
.
length
>
0
)
{
var
drawingregionheader
=
drawingregionheaderSelector
[
0
];
drawregiontop
=
drawingregionheader
.
getBoundingClientRect
().
height
;
}
else
{
drawregiontop
=
'
52
'
;
}
// Make sure the dialogue box is not bigger than the max height of the viewport.
drawregionheight
=
Y
.
one
(
'
body
'
).
get
(
'
winHeight
'
)
-
120
;
// Space for toolbar + titlebar.
if
(
drawregionheight
<
100
)
{
drawregionheight
=
100
;
}
var
drawingregionSelector
=
document
.
getElementsByClassName
(
SELECTOR
.
DRAWINGREGIONCLASS
);
if
(
drawingregionSelector
.
length
>
0
)
{
drawingregion
=
drawingregionSelector
[
0
];
drawingregion
.
style
.
top
=
drawregiontop
+
'
px
'
;
drawingregion
.
style
.
maxHeight
=
drawregionheight
+
'
px
'
;
}
else
{
drawingregion
=
this
.
get_dialogue_element
(
SELECTOR
.
DRAWINGREGION
);
if
(
this
.
dialogue
)
{
drawingregion
.
setStyle
(
'
maxHeight
'
,
drawregionheight
+
'
px
'
);
}
}
try
{
this
.
redraw
();
}
catch
(
exception
)
{
}
return
true
;
},
...
...
yui/build/moodle-assignfeedback_editpdfplus-editor/moodle-assignfeedback_editpdfplus-editor-min.js
View file @
6976b668
This diff is collapsed.
Click to expand it.
yui/build/moodle-assignfeedback_editpdfplus-editor/moodle-assignfeedback_editpdfplus-editor.js
View file @
6976b668
...
...
@@ -32,7 +32,9 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdfplus/ajax.php',
LOADINGICON
:
'
.loading
'
,
PROGRESSBARCONTAINER
:
'
.progress-info.progress-striped
'
,
DRAWINGREGION
:
'
.drawingregion
'
,
DRAWINGREGIONCLASS
:
'
drawingregion
'
,
DRAWINGCANVAS
:
'
.drawingcanvas
'
,
DRAWINGTOOLBAR
:
'
drawingtoolbar
'
,
SAVE
:
'
.savebutton
'
,
ANNOTATIONCOLOURBUTTON
:
'
.annotationcolourbutton
'
,
DELETEANNOTATIONBUTTON
:
'
.deleteannotationbutton
'
,
...
...
@@ -5064,6 +5066,11 @@ EDITOR.prototype = {
drawingcanvas
.
on
(
'
gesturemoveend
'
,
this
.
edit_end
,
null
,
this
);
this
.
refresh_button_state
();
//trigger when window is resized
drawingcanvas
.
on
(
'
windowresize
'
,
this
.
resize
,
this
);
var
buttonChooseView
=
Y
.
one
(
'
.collapse-buttons
'
);
buttonChooseView
.
on
(
'
click
'
,
this
.
temporise
,
this
,
this
.
resize
,
500
);
}
this
.
start_generation
();
...
...
@@ -5971,14 +5978,23 @@ EDITOR.prototype = {
}
},
/**
* Temporise a function.
* @public
* @method resize
*/
temporise
:
function
(
e
,
fct
,
timeout
)
{
e
.
preventDefault
();
setTimeout
(
fct
,
timeout
);
},
/**
* Resize the dialogue window when the browser is resized.
* @public
* @method resize
*/
resize
:
function
()
{
var
drawingregion
,
drawregionheight
;
var
drawingregion
,
drawregionheight
,
drawregiontop
;
if
(
this
.
dialogue
)
{
if
(
!
this
.
dialogue
.
get
(
'
visible
'
))
{
return
;
...
...
@@ -5986,16 +6002,35 @@ EDITOR.prototype = {
this
.
dialogue
.
centerDialogue
();
}
//calculate top div
var
drawingregionheaderSelector
=
document
.
getElementsByClassName
(
SELECTOR
.
DRAWINGTOOLBAR
);
if
(
drawingregionheaderSelector
.
length
>
0
)
{
var
drawingregionheader
=
drawingregionheaderSelector
[
0
];
drawregiontop
=
drawingregionheader
.
getBoundingClientRect
().
height
;
}
else
{
drawregiontop
=
'
52
'
;
}
// Make sure the dialogue box is not bigger than the max height of the viewport.
drawregionheight
=
Y
.
one
(
'
body
'
).
get
(
'
winHeight
'
)
-
120
;
// Space for toolbar + titlebar.
if
(
drawregionheight
<
100
)
{
drawregionheight
=
100
;
}
var
drawingregionSelector
=
document
.
getElementsByClassName
(
SELECTOR
.
DRAWINGREGIONCLASS
);
if
(
drawingregionSelector
.
length
>
0
)
{
drawingregion
=
drawingregionSelector
[
0
];
drawingregion
.
style
.
top
=
drawregiontop
+
'
px
'
;
drawingregion
.
style
.
maxHeight
=
drawregionheight
+
'
px
'
;
}
else
{
drawingregion
=
this
.
get_dialogue_element
(
SELECTOR
.
DRAWINGREGION
);
if
(
this
.
dialogue
)
{
drawingregion
.
setStyle
(
'
maxHeight
'
,
drawregionheight
+
'
px
'
);
}
}
try
{
this
.
redraw
();
}
catch
(
exception
)
{
}
return
true
;
},
...
...
yui/src/editor/js/editor.js
View file @
6976b668
...
...
@@ -367,6 +367,11 @@ EDITOR.prototype = {
drawingcanvas
.
on
(
'
gesturemoveend
'
,
this
.
edit_end
,
null
,
this
);
this
.
refresh_button_state
();
//trigger when window is resized
drawingcanvas
.
on
(
'
windowresize
'
,
this
.
resize
,
this
);
var
buttonChooseView
=
Y
.
one
(
'
.collapse-buttons
'
);
buttonChooseView
.
on
(
'
click
'
,
this
.
temporise
,
this
,
this
.
resize
,
500
);
}
this
.
start_generation
();
...
...
@@ -1274,14 +1279,23 @@ EDITOR.prototype = {
}
},
/**
* Temporise a function.
* @public
* @method resize
*/
temporise
:
function
(
e
,
fct
,
timeout
)
{
e
.
preventDefault
();
setTimeout
(
fct
,
timeout
);
},
/**
* Resize the dialogue window when the browser is resized.
* @public
* @method resize
*/
resize
:
function
()
{
var
drawingregion
,
drawregionheight
;
var
drawingregion
,
drawregionheight
,
drawregiontop
;
if
(
this
.
dialogue
)
{
if
(
!
this
.
dialogue
.
get
(
'
visible
'
))
{
return
;
...
...
@@ -1289,16 +1303,35 @@ EDITOR.prototype = {
this
.
dialogue
.
centerDialogue
();
}
//calculate top div
var
drawingregionheaderSelector
=
document
.
getElementsByClassName
(
SELECTOR
.
DRAWINGTOOLBAR
);
if
(
drawingregionheaderSelector
.
length
>
0
)
{
var
drawingregionheader
=
drawingregionheaderSelector
[
0
];
drawregiontop
=
drawingregionheader
.
getBoundingClientRect
().
height
;
}
else
{
drawregiontop
=
'
52
'
;
}
// Make sure the dialogue box is not bigger than the max height of the viewport.
drawregionheight
=
Y
.
one
(
'
body
'
).
get
(
'
winHeight
'
)
-
120
;
// Space for toolbar + titlebar.
if
(
drawregionheight
<
100
)
{
drawregionheight
=
100
;
}
var
drawingregionSelector
=
document
.
getElementsByClassName
(
SELECTOR
.
DRAWINGREGIONCLASS
);
if
(
drawingregionSelector
.
length
>
0
)
{
drawingregion
=
drawingregionSelector
[
0
];
drawingregion
.
style
.
top
=
drawregiontop
+
'
px
'
;
drawingregion
.
style
.
maxHeight
=
drawregionheight
+
'
px
'
;
}
else
{
drawingregion
=
this
.
get_dialogue_element
(
SELECTOR
.
DRAWINGREGION
);
if
(
this
.
dialogue
)
{
drawingregion
.
setStyle
(
'
maxHeight
'
,
drawregionheight
+
'
px
'
);
}
}
try
{
this
.
redraw
();
}
catch
(
exception
)
{
}
return
true
;
},
...
...
yui/src/editor/js/globals.js
View file @
6976b668
...
...
@@ -30,7 +30,9 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdfplus/ajax.php',
LOADINGICON
:
'
.loading
'
,
PROGRESSBARCONTAINER
:
'
.progress-info.progress-striped
'
,
DRAWINGREGION
:
'
.drawingregion
'
,
DRAWINGREGIONCLASS
:
'
drawingregion
'
,
DRAWINGCANVAS
:
'
.drawingcanvas
'
,
DRAWINGTOOLBAR
:
'
drawingtoolbar
'
,
SAVE
:
'
.savebutton
'
,
ANNOTATIONCOLOURBUTTON
:
'
.annotationcolourbutton
'
,
DELETEANNOTATIONBUTTON
:
'
.deleteannotationbutton
'
,
...
...
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