Gitlab CSE Unil
Skip to content
GitLab
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
60445694
Commit
60445694
authored
Aug 13, 2017
by
M. Chardon
Browse files
gestion des palettes de couleurs pour la sélection
parent
ce289c6c
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
amd/build/admin_panel.min.js
View file @
60445694
This diff is collapsed.
Click to expand it.
amd/src/admin_panel.js
View file @
60445694
...
...
@@ -269,9 +269,21 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
.
done
(
function
()
{
currentTool
=
new
Object
();
currentTool
.
typetool
=
$
(
"
#typetool
"
).
val
();
currentTool
.
color
=
$
(
"
#color
"
).
val
();
var
typetoolEntity
=
getTypeTool
(
currentTool
.
typetool
);
var
realcolor
=
$
(
"
#realcolor
"
).
val
();
if
(
realcolor
.
length
>
0
)
{
currentTool
.
color
=
$
(
"
#color
"
).
val
();
}
else
{
$
(
"
#color
"
).
val
(
typetoolEntity
.
color
);
currentTool
.
color
=
null
;
}
currentTool
.
libelle
=
$
(
"
#libelle
"
).
val
();
currentTool
.
catridgecolor
=
$
(
"
#cartridgecolor
"
).
val
();
if
(
$
(
"
#realcartridgecolor
"
).
val
().
length
>
0
)
{
currentTool
.
catridgecolor
=
$
(
"
#cartridgecolor
"
).
val
();
}
else
{
$
(
"
#cartridgecolor
"
).
val
(
typetoolEntity
.
cartridge_color
);
currentTool
.
catridgecolor
=
null
;
}
currentTool
.
texts
=
$
(
"
#texts
"
).
val
();
currentTool
.
button
=
$
(
"
#button
"
).
val
();
currentTool
.
enabled
=
$
(
"
#enabled
"
).
val
();
...
...
@@ -338,7 +350,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
}
$
(
"
.editpdlplus_tool
"
).
on
(
"
click
"
,
refreshToolView
);
//AdminPanel.prototype.refreshPrevisu();
refreshToolView
();
$
(
"
#editpdlplus_tool_
"
+
toolbar
[
0
].
selecttool
).
click
();
//refreshToolView();
}
else
{
$
(
"
#message_edit_tool
"
).
html
(
toolbar
[
0
].
message
);
$
(
"
#message_edit_tool
"
).
addClass
(
"
alert-danger
"
);
...
...
db/upgrade.php
View file @
60445694
...
...
@@ -108,6 +108,49 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
// Editpdf savepoint reached.
upgrade_plugin_savepoint
(
true
,
2017071202
,
'assignfeedback'
,
'editpdfplus'
);
}
if
(
$oldversion
<
2017081306
)
{
$sql
=
"UPDATE
{
assignfeedback_editpp_typet
}
SET color = :htmlcolor
WHERE color = :textcolor"
;
// Update query params.
$params
=
[
'htmlcolor'
=>
'#FF0000'
,
'textcolor'
=>
'red'
];
// Execute DB update for assign instances.
$DB
->
execute
(
$sql
,
$params
);
$sql
=
"UPDATE
{
assignfeedback_editpp_tool
}
SET colors = :htmlcolor
WHERE colors = :textcolor"
;
// Update query params.
$params
=
[
'htmlcolor'
=>
'#FFA500'
,
'textcolor'
=>
'orange'
];
// Execute DB update for assign instances.
$DB
->
execute
(
$sql
,
$params
);
$sql
=
"UPDATE
{
assignfeedback_editpp_tool
}
SET colors = :htmlcolor
WHERE colors = :textcolor"
;
// Update query params.
$params
=
[
'htmlcolor'
=>
'#008000'
,
'textcolor'
=>
'green'
];
// Execute DB update for assign instances.
$DB
->
execute
(
$sql
,
$params
);
$sql
=
"UPDATE
{
assignfeedback_editpp_tool
}
SET colors = :htmlcolor
WHERE colors = :textcolor"
;
// Update query params.
$params
=
[
'htmlcolor'
=>
'#0000FF'
,
'textcolor'
=>
'blue'
];
// Execute DB update for assign instances.
$DB
->
execute
(
$sql
,
$params
);
}
return
true
;
}
templates/tool_form.mustache
View file @
60445694
...
...
@@ -92,8 +92,9 @@
<div
class=
"form-group"
>
<label
class=
"control-label col-sm-3"
for=
"cartridgecolor"
>
{{#
str
}}
admintoolboxcartridge_color, assignfeedback_editpdfplus
{{/
str
}}
</label>
<div
class=
"col-sm-9"
>
<input
type=
"
text
"
class=
"form-control"
id=
"cartridgecolor"
placeholder=
"
{{^
tool
.
cartridge_color
}}
-
{{/
tool
.
cartridge_color
}}
"
<input
type=
"
color
"
class=
"form-control"
id=
"cartridgecolor"
placeholder=
"
{{^
tool
.
cartridge_color
}}
-
{{/
tool
.
cartridge_color
}}
"
value=
"
{{#
tool
.
cartridge_color
}}{{
tool
.
cartridge_color
}}{{/
tool
.
cartridge_color
}}
"
name=
"catridgecolor"
/>
<input
type=
"hidden"
id=
"realcartridgecolor"
value=
"
{{#
tool
.
cartridge_color
}}{{
tool
.
cartridge_color
}}{{/
tool
.
cartridge_color
}}
"
/>
</div>
</div>
</div>
...
...
@@ -107,14 +108,15 @@
</div>
<div
id=
"collapse4"
class=
"panel-collapse collapse"
>
<div
class=
"panel-body"
style=
"margin-bottom: 80px;overflow: auto;"
>
<div
class=
"form-group"
>
<label
class=
"control-label col-sm-3"
for=
"color"
>
{{#
str
}}
admintoolboxannotation_color, assignfeedback_editpdfplus
{{/
str
}}
</label>
<div
class=
"col-sm-9"
>
<input
type=
"text"
class=
"form-control"
id=
"color"
placeholder=
"
{{^
tool
.
colors
}}
-
{{/
tool
.
colors
}}
"
value=
"
{{#
tool
.
colors
}}{{
tool
.
colors
}}{{/
tool
.
colors
}}
"
name=
"color"
/>
<div
class=
"row form-group"
>
<label
class=
"control-label col-sm-3"
for=
"color"
>
{{#
str
}}
admintoolboxannotation_color, assignfeedback_editpdfplus
{{/
str
}}
</label>
<div
class=
"col-sm-9"
>
<input
type=
"color"
class=
"form-control"
id=
"color"
placeholder=
"
{{^
tool
.
colors
}}
-
{{/
tool
.
colors
}}
"
value=
"
{{#
tool
.
colors
}}{{
tool
.
colors
}}{{/
tool
.
colors
}}
"
name=
"color"
/>
<input
type=
"hidden"
id=
"realcolor"
value=
"
{{#
tool
.
colors
}}{{
tool
.
colors
}}{{/
tool
.
colors
}}
"
/>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"row form-group"
>
<label
class=
"control-label col-sm-3"
for=
"texts"
>
{{#
str
}}
admintoolboxannotation_texts, assignfeedback_editpdfplus
{{/
str
}}
</label>
<div
class=
"col-sm-9"
>
<input
type=
"hidden"
class=
"form-control"
id=
"texts"
value=
"
{{
tool
.
texts
}}
"
name=
"texts"
/>
...
...
@@ -127,7 +129,7 @@
</ul>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"
row
form-group"
>
<label
class=
"control-label col-sm-3"
for=
"reply"
>
{{#
str
}}
admintoolboxannotation_reply, assignfeedback_editpdfplus
{{/
str
}}
</label>
<div
class=
"col-sm-9"
>
<input
type=
"checkbox"
id=
"reply"
{{#
tool
.
reply
}}
checked
{{/
tool
.
reply
}}
name=
"reply"
/>
...
...
version.php
View file @
60445694
...
...
@@ -24,7 +24,7 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$plugin
->
version
=
201708
0910
;
$plugin
->
version
=
201708
1306
;
$plugin
->
requires
=
2017050500
;
// Requires this Moodle version.
$plugin
->
dependencies
=
array
(
'assignfeedback_editpdf'
=>
2017050500
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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