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
var selectAxis = $("#editpdlplus_axes").val();
$("#editpdlplus_toolbar_" + selectAxis).show();
var canBeDelete = $("#editpdlplus_axes option:selected").data('delete');
if (canBeDelete && parseInt(canBeDelete) > 0) {
if (canBeDelete) {
if (parseInt(canBeDelete) > 0) {
$("#assignfeedback_editpdfplus_widget_admin_button_delaxis").addClass("disabled");
} else {
$("#assignfeedback_editpdfplus_widget_admin_button_delaxis").removeClass("disabled");
}
} else {
$("#editpdlplus_axes option[value='" + selectAxis + "']").data('delete', 0);
$("#assignfeedback_editpdfplus_widget_admin_button_delaxis").removeClass("disabled");
}
$('#toolworkspace').html("");
});
$("#editpdlplus_axes").change();
//
......@@ -154,6 +160,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$("#axistool").hide();
$('#assignfeedback_editpdfplus_widget_admin_div_addaxis').show();
$('#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body').html("");
$('#assignfeedback_editpdfplus_widget_admin_toolheader').hide();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').hide();
var params = {};
fragment.loadFragment('assignfeedback_editpdfplus', 'axisadd', contextid, params)
.done(function (html, js) {
......@@ -166,6 +174,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$("#axistool").hide();
$('#assignfeedback_editpdfplus_widget_admin_div_editaxis').show();
$('#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};
templates.render('assignfeedback_editpdfplus/admin_axis_add', context)
// It returns a promise that needs to be resoved.
......@@ -188,6 +198,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$("#axistool").hide();
$('#assignfeedback_editpdfplus_widget_admin_div_delaxis').show();
$('#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 params = {axeid: axeid};
fragment.loadFragment('assignfeedback_editpdfplus', 'axisdel', contextid, params)
......@@ -497,7 +509,7 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$("#editpdlplus_toolbar_" + toolbar[0].axeid).append(buttonTmp);
}
$(".editpdlplus_tool").on("click", refreshToolView);
$('#editpdlplus_tool_item').html("");
$('#toolworkspace').html("");
} else {
$("#message_edit_tool").html(toolbar[0].message);
$("#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,7 +55,8 @@
<div class="panel-body"></div>
</div>
</div>
<div class='col-sm-10'>
<div class='col-sm-10' id='assignfeedback_editpdfplus_widget_admin_toolworkspace'>
<div id='editpdlplus_toolbars'>
{{# toolbars }}
<div id="editpdlplus_toolbar_{{axis.id}}" class="btn-group toolbar" style="display: none;">
{{# tools }}
......@@ -65,6 +66,7 @@
{{/ tools }}
</div>
{{/ toolbars }}
</div>
<div id="editpdlplus_tool_item" style="margin-top: 10px;"></div>
......
......@@ -33,11 +33,16 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification
}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>");
}
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
}).fail(notification.exception);
});
$("#axisDelCancel").on("click", function () {
$('#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body').html("");
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
});
});
{{/ js }}
\ No newline at end of file
......@@ -25,14 +25,20 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification
}
])[0].done(function(axe) {
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("");
$("#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_tool_item').html("");
} else {
$('#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body').html("");
$("#editpdlplus_axes option:selected").html(axe[0].axelabel);
}
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
}).fail(notification.exception);
});
$("#axisFormCancel").on("click", function () {
......@@ -42,6 +48,8 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification
$('#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body').html("");
}
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
});
});
{{/ 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