Gitlab CSE Unil

Commit 60445694 authored by M. Chardon's avatar M. Chardon
Browse files

gestion des palettes de couleurs pour la sélection

parent ce289c6c
This diff is collapsed.
...@@ -269,9 +269,21 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f ...@@ -269,9 +269,21 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
.done(function () { .done(function () {
currentTool = new Object(); currentTool = new Object();
currentTool.typetool = $("#typetool").val(); currentTool.typetool = $("#typetool").val();
var typetoolEntity = getTypeTool(currentTool.typetool);
var realcolor = $("#realcolor").val();
if (realcolor.length > 0) {
currentTool.color = $("#color").val(); currentTool.color = $("#color").val();
} else {
$("#color").val(typetoolEntity.color);
currentTool.color = null;
}
currentTool.libelle = $("#libelle").val(); currentTool.libelle = $("#libelle").val();
if ($("#realcartridgecolor").val().length > 0) {
currentTool.catridgecolor = $("#cartridgecolor").val(); currentTool.catridgecolor = $("#cartridgecolor").val();
} else {
$("#cartridgecolor").val(typetoolEntity.cartridge_color);
currentTool.catridgecolor = null;
}
currentTool.texts = $("#texts").val(); currentTool.texts = $("#texts").val();
currentTool.button = $("#button").val(); currentTool.button = $("#button").val();
currentTool.enabled = $("#enabled").val(); currentTool.enabled = $("#enabled").val();
...@@ -338,7 +350,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f ...@@ -338,7 +350,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
} }
$(".editpdlplus_tool").on("click", refreshToolView); $(".editpdlplus_tool").on("click", refreshToolView);
//AdminPanel.prototype.refreshPrevisu(); //AdminPanel.prototype.refreshPrevisu();
refreshToolView(); $("#editpdlplus_tool_" + toolbar[0].selecttool).click();
//refreshToolView();
} else { } else {
$("#message_edit_tool").html(toolbar[0].message); $("#message_edit_tool").html(toolbar[0].message);
$("#message_edit_tool").addClass("alert-danger"); $("#message_edit_tool").addClass("alert-danger");
......
...@@ -109,5 +109,48 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) { ...@@ -109,5 +109,48 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2017071202, 'assignfeedback', 'editpdfplus'); 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; return true;
} }
...@@ -92,8 +92,9 @@ ...@@ -92,8 +92,9 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3" for="cartridgecolor">{{# str }} admintoolboxcartridge_color, assignfeedback_editpdfplus {{/ str }}</label> <label class="control-label col-sm-3" for="cartridgecolor">{{# str }} admintoolboxcartridge_color, assignfeedback_editpdfplus {{/ str }}</label>
<div class="col-sm-9"> <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" /> 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> </div>
</div> </div>
...@@ -107,14 +108,15 @@ ...@@ -107,14 +108,15 @@
</div> </div>
<div id="collapse4" class="panel-collapse collapse"> <div id="collapse4" class="panel-collapse collapse">
<div class="panel-body" style="margin-bottom: 80px;overflow: auto;"> <div class="panel-body" style="margin-bottom: 80px;overflow: auto;">
<div class="form-group"> <div class="row form-group">
<label class="control-label col-sm-3" for="color">{{# str }} admintoolboxannotation_color, assignfeedback_editpdfplus {{/ str }}</label> <label class="control-label col-sm-3" for="color">{{# str }} admintoolboxannotation_color, assignfeedback_editpdfplus {{/ str }}</label>
<div class="col-sm-9"> <div class="col-sm-9">
<input type="text" class="form-control" id="color" placeholder="{{^tool.colors}}-{{/tool.colors}}" <input type="color" class="form-control" id="color" placeholder="{{^tool.colors}}-{{/tool.colors}}"
value="{{#tool.colors}}{{tool.colors}}{{/tool.colors}}" name="color" /> 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>
<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> <label class="control-label col-sm-3" for="texts">{{# str }} admintoolboxannotation_texts, assignfeedback_editpdfplus {{/ str }}</label>
<div class="col-sm-9"> <div class="col-sm-9">
<input type="hidden" class="form-control" id="texts" value="{{tool.texts}}" name="texts" /> <input type="hidden" class="form-control" id="texts" value="{{tool.texts}}" name="texts" />
...@@ -127,7 +129,7 @@ ...@@ -127,7 +129,7 @@
</ul> </ul>
</div> </div>
</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> <label class="control-label col-sm-3" for="reply">{{# str }} admintoolboxannotation_reply, assignfeedback_editpdfplus {{/ str }}</label>
<div class="col-sm-9"> <div class="col-sm-9">
<input type="checkbox" id="reply" {{#tool.reply}}checked {{/tool.reply}}name="reply" /> <input type="checkbox" id="reply" {{#tool.reply}}checked {{/tool.reply}}name="reply" />
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->version = 2017080910; $plugin->version = 2017081306;
$plugin->requires = 2017050500; // Requires this Moodle version. $plugin->requires = 2017050500; // Requires this Moodle version.
$plugin->dependencies = array( $plugin->dependencies = array(
'assignfeedback_editpdf' => 2017050500 'assignfeedback_editpdf' => 2017050500
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment