Gitlab CSE Unil

Commit 824165fd authored by M. Chardon's avatar M. Chardon
Browse files

manipulation axes

parent 1daa79c5
This diff is collapsed.
...@@ -57,11 +57,17 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f ...@@ -57,11 +57,17 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
var selectAxis = $("#editpdlplus_axes").val(); var selectAxis = $("#editpdlplus_axes").val();
$("#editpdlplus_toolbar_" + selectAxis).show(); $("#editpdlplus_toolbar_" + selectAxis).show();
var canBeDelete = $("#editpdlplus_axes option:selected").data('delete'); var canBeDelete = $("#editpdlplus_axes option:selected").data('delete');
if (canBeDelete && parseInt(canBeDelete) > 0) { if (canBeDelete) {
$("#assignfeedback_editpdfplus_widget_admin_button_delaxis").addClass("disabled"); if (parseInt(canBeDelete) > 0) {
$("#assignfeedback_editpdfplus_widget_admin_button_delaxis").addClass("disabled");
} else {
$("#assignfeedback_editpdfplus_widget_admin_button_delaxis").removeClass("disabled");
}
} else { } else {
$("#editpdlplus_axes option[value='" + selectAxis + "']").data('delete', 0);
$("#assignfeedback_editpdfplus_widget_admin_button_delaxis").removeClass("disabled"); $("#assignfeedback_editpdfplus_widget_admin_button_delaxis").removeClass("disabled");
} }
$('#toolworkspace').html("");
}); });
$("#editpdlplus_axes").change(); $("#editpdlplus_axes").change();
// //
...@@ -87,20 +93,20 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f ...@@ -87,20 +93,20 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
}; };
// //
/*AdminPanel.prototype.refreshPrevisu = function () { /*AdminPanel.prototype.refreshPrevisu = function () {
currentTool.typetool = $("#typetool").val(); currentTool.typetool = $("#typetool").val();
currentTool.color = $("#color").val(); currentTool.color = $("#color").val();
currentTool.libelle = $("#libelle").val(); currentTool.libelle = $("#libelle").val();
currentTool.catridgecolor = $("#cartridgecolor").val(); currentTool.catridgecolor = $("#cartridgecolor").val();
currentTool.texts = $("#texts").val(); currentTool.texts = $("#texts").val();
currentTool.button = $("#button").val(); currentTool.button = $("#button").val();
currentTool.enabled = $("#enabled").val(); currentTool.enabled = $("#enabled").val();
currentTool.reply = 0; currentTool.reply = 0;
if ($("#reply").is(':checked')) { if ($("#reply").is(':checked')) {
currentTool.reply = 1; currentTool.reply = 1;
} }
currentTool.order = $("#order").val(); currentTool.order = $("#order").val();
initCanevas(); initCanevas();
};*/ };*/
// //
var getTypeTool = function (toolid) { var getTypeTool = function (toolid) {
for (var i = 0; i < typetools.length; i++) { for (var i = 0; i < typetools.length; i++) {
...@@ -154,6 +160,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f ...@@ -154,6 +160,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$("#axistool").hide(); $("#axistool").hide();
$('#assignfeedback_editpdfplus_widget_admin_div_addaxis').show(); $('#assignfeedback_editpdfplus_widget_admin_div_addaxis').show();
$('#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body').html(""); $('#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body').html("");
$('#assignfeedback_editpdfplus_widget_admin_toolheader').hide();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').hide();
var params = {}; var params = {};
fragment.loadFragment('assignfeedback_editpdfplus', 'axisadd', contextid, params) fragment.loadFragment('assignfeedback_editpdfplus', 'axisadd', contextid, params)
.done(function (html, js) { .done(function (html, js) {
...@@ -166,6 +174,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f ...@@ -166,6 +174,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$("#axistool").hide(); $("#axistool").hide();
$('#assignfeedback_editpdfplus_widget_admin_div_editaxis').show(); $('#assignfeedback_editpdfplus_widget_admin_div_editaxis').show();
$('#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body').html(""); $('#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body').html("");
$('#assignfeedback_editpdfplus_widget_admin_toolheader').hide();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').hide();
/*var context = {name: 'Tweety bird', intelligence: 2}; /*var context = {name: 'Tweety bird', intelligence: 2};
templates.render('assignfeedback_editpdfplus/admin_axis_add', context) templates.render('assignfeedback_editpdfplus/admin_axis_add', context)
// It returns a promise that needs to be resoved. // It returns a promise that needs to be resoved.
...@@ -188,6 +198,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f ...@@ -188,6 +198,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$("#axistool").hide(); $("#axistool").hide();
$('#assignfeedback_editpdfplus_widget_admin_div_delaxis').show(); $('#assignfeedback_editpdfplus_widget_admin_div_delaxis').show();
$('#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body').html(""); $('#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body').html("");
$('#assignfeedback_editpdfplus_widget_admin_toolheader').hide();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').hide();
var axeid = $("#editpdlplus_axes option:selected").val(); var axeid = $("#editpdlplus_axes option:selected").val();
var params = {axeid: axeid}; var params = {axeid: axeid};
fragment.loadFragment('assignfeedback_editpdfplus', 'axisdel', contextid, params) fragment.loadFragment('assignfeedback_editpdfplus', 'axisdel', contextid, params)
...@@ -497,7 +509,7 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f ...@@ -497,7 +509,7 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$("#editpdlplus_toolbar_" + toolbar[0].axeid).append(buttonTmp); $("#editpdlplus_toolbar_" + toolbar[0].axeid).append(buttonTmp);
} }
$(".editpdlplus_tool").on("click", refreshToolView); $(".editpdlplus_tool").on("click", refreshToolView);
$('#editpdlplus_tool_item').html(""); $('#toolworkspace').html("");
} 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");
......
// Standard license block omitted.
/*
* @package assignfeedback_editpdfplus
* @copyright 2015 Someone cool
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/editplus
*/
define(['jquery'], function ($) {
/**
* @constructor
* @alias module:mod_assignfeedback_editpdfplus/editplus
*/
var greeting = function () {
/** @access private */
//var privateThoughts = 'I like the colour blue';
$("#id").val();
/** @access public */
this.publicThoughts = 'I like the colour orange';
};
/**
* A formal greeting.
* @access public
* @return {string}
*/
greeting.prototype.formal = function () {
return 'How do you do?';
};
/**
* An informal greeting.
* @access public
* @return {string}
*/
greeting.prototype.informal = function () {
return 'Wassup!';
};
return {
init: function () {
alert("hello");
}
};
});
\ No newline at end of file
...@@ -55,16 +55,18 @@ ...@@ -55,16 +55,18 @@
<div class="panel-body"></div> <div class="panel-body"></div>
</div> </div>
</div> </div>
<div class='col-sm-10'> <div class='col-sm-10' id='assignfeedback_editpdfplus_widget_admin_toolworkspace'>
{{# toolbars }} <div id='editpdlplus_toolbars'>
<div id="editpdlplus_toolbar_{{axis.id}}" class="btn-group toolbar" style="display: none;"> {{# toolbars }}
{{# tools }} <div id="editpdlplus_toolbar_{{axis.id}}" class="btn-group toolbar" style="display: none;">
<button class="btn {{button}} editpdlplus_tool" id="editpdlplus_tool_{{id}}" value="{{id}}" style="{{style}}" data-enable="{{enabled}}"> {{# tools }}
{{label}} <button class="btn {{button}} editpdlplus_tool" id="editpdlplus_tool_{{id}}" value="{{id}}" style="{{style}}" data-enable="{{enabled}}">
</button> {{label}}
{{/ tools }} </button>
{{/ tools }}
</div>
{{/ toolbars }}
</div> </div>
{{/ toolbars }}
<div id="editpdlplus_tool_item" style="margin-top: 10px;"></div> <div id="editpdlplus_tool_item" style="margin-top: 10px;"></div>
......
...@@ -33,11 +33,16 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification ...@@ -33,11 +33,16 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification
}else{ }else{
$('#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body > .panel > .panel-body').append("<div class='alert alert-danger' style='margin-top: 5px;'>"+message[0].message+"</div>"); $('#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body > .panel > .panel-body').append("<div class='alert alert-danger' style='margin-top: 5px;'>"+message[0].message+"</div>");
} }
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
}).fail(notification.exception); }).fail(notification.exception);
}); });
$("#axisDelCancel").on("click", function () { $("#axisDelCancel").on("click", function () {
$('#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body').html(""); $('#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body').html("");
$("#axistool").show(); $("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
}); });
}); });
{{/ js }} {{/ js }}
\ No newline at end of file
...@@ -25,14 +25,20 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification ...@@ -25,14 +25,20 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification
} }
])[0].done(function(axe) { ])[0].done(function(axe) {
if ('{{action}}' === 'add'){ if ('{{action}}' === 'add'){
var divAxis = "<div id='editpdlplus_toolbar_"+axe[0].axeid+"' class='btn-group toolbar' style='display: none;'></div>";
$('#editpdlplus_toolbars').append(divAxis);
$('#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body').html(""); $('#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body').html("");
$("#editpdlplus_axes").append(new Option(axe[0].axelabel, axe[0].axeid, true, true)); var option=new Option(axe[0].axelabel, axe[0].axeid, true, true);
$("#editpdlplus_axes").append(option);
$("#editpdlplus_axes").change(); $("#editpdlplus_axes").change();
$('#editpdlplus_tool_item').html("");
} else { } else {
$('#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body').html(""); $('#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body').html("");
$("#editpdlplus_axes option:selected").html(axe[0].axelabel); $("#editpdlplus_axes option:selected").html(axe[0].axelabel);
} }
$("#axistool").show(); $("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
}).fail(notification.exception); }).fail(notification.exception);
}); });
$("#axisFormCancel").on("click", function () { $("#axisFormCancel").on("click", function () {
...@@ -42,6 +48,8 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification ...@@ -42,6 +48,8 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification
$('#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body').html(""); $('#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body').html("");
} }
$("#axistool").show(); $("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
}); });
}); });
{{/ js }} {{/ js }}
\ No newline at end of file
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