Gitlab CSE Unil

Commit 15a2401d authored by M. Chardon's avatar M. Chardon
Browse files

3 positions d'affichage pour le cartouche

parent 2beb21e4
......@@ -70,7 +70,7 @@ class annotation {
public $colour = 'yellow';
/** @var bool displaylock for displaying this annotation */
public $displaylock = 0;
public $displaylock = 1;
/** @var bool displayrotation for displaying the sign of the annotation */
public $displayrotation = 0;
......
......@@ -40,7 +40,7 @@
<FIELD NAME="answerrequested" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="studentanswer" TYPE="char" LENGTH="500" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="studentstatus" TYPE="char" LENGTH="50" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="displaylock" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="displaylock" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="displayrotation" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="borderstyle" TYPE="char" LENGTH="20" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="parent_annot" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="true"/>
......
......@@ -656,7 +656,7 @@ Y.extend(ANNOTATION, Y.Base, {
tooltypefamille: null,
divcartridge: '',
textannot: '',
displaylock: 0,
displaylock: 1,
displayrotation: 0,
borderstyle: '',
parent_annot: 0,
......@@ -688,7 +688,7 @@ Y.extend(ANNOTATION, Y.Base, {
this.drawable = false;
this.tooltype = config.tooltype;
this.textannot = config.parent_annot_element.textannot;
this.displaylock = config.parent_annot_element.displaylock;
this.displaylock = parseInt(config.parent_annot_element.displaylock);
this.displayrotation = config.parent_annot_element.displayrotation;
this.borderstyle = config.parent_annot_element.borderstyle || 'solid';
this.parent_annot = config.parent_annot_element.id;
......@@ -710,7 +710,7 @@ Y.extend(ANNOTATION, Y.Base, {
this.drawable = false;
this.tooltype = config.tooltype;
this.textannot = config.textannot;
this.displaylock = config.displaylock;
this.displaylock = parseInt(config.displaylock);
this.displayrotation = config.displayrotation;
this.borderstyle = config.borderstyle || 'solid';
this.parent_annot = config.parent_annot;
......@@ -844,7 +844,6 @@ Y.extend(ANNOTATION, Y.Base, {
divedition += "class='assignfeedback_editpdfplus_" + this.tooltypefamille.label + "_edition' ";
divedition += "style='display:none;'> ";
divedition += "<textarea id='" + this.divcartridge + "_editinput' type='text' value=\"" + this.get_valref() + "\" >" + this.get_valref() + "</textarea>";
//divedition += "<input id='" + this.divcartridge + "_editinput' type='text' value=\"" + this.get_valref() + "\" />";
divedition += "</div>";
var diveditiondisplay = Y.Node.create(divedition);
var propositions = this.tooltype.texts;
......@@ -870,9 +869,9 @@ Y.extend(ANNOTATION, Y.Base, {
var divinputdisplay = this.get_div_input(colorcartridge);
divinputdisplay.addClass('assignfeedback_editpdfplus_' + this.tooltypefamille.label + '_input');
var inputvalref = this.get_input_valref();
var onof = 0;
if (this.displaylock === '1') {
onof = 1;
var onof = 1;
if (this.displaylock) {
onof = this.displaylock;
}
var inputonof = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_onof' value=" + onof + " />");
var readonly = this.editor.get('readonly');
......@@ -885,26 +884,45 @@ Y.extend(ANNOTATION, Y.Base, {
var readonly = this.editor.get('readonly');
if (!readonly) {
divconteneurdisplay.append(this.get_button_visibility());
divconteneurdisplay.append(this.get_button_visibility_left());
divconteneurdisplay.append(this.get_button_visibility_right());
divconteneurdisplay.append(this.get_button_save());
divconteneurdisplay.append(this.get_button_cancel());
}
return divconteneurdisplay;
},
get_button_visibility: function () {
var buttonvisibility = "<button id='" + this.divcartridge + "_buttonedit' ";
get_button_visibility_right: function () {
var buttonvisibility = "<button id='" + this.divcartridge + "_buttonedit_right' ";
buttonvisibility += "><img src='";
if (this.displaylock === 1) {
buttonvisibility += M.util.image_url('t/left', 'core');
} else {
buttonvisibility += M.util.image_url('t/right', 'core');
}
buttonvisibility += M.util.image_url('t/right', 'core');
buttonvisibility += "' /></button>";
var buttonvisibilitydisplay = Y.Node.create(buttonvisibility);
buttonvisibilitydisplay.on('click', this.change_visibility_annot, this, 'r');
return buttonvisibilitydisplay;
},
get_button_visibility_left: function () {
var buttonvisibility = "<button id='" + this.divcartridge + "_buttonedit_left' ";
buttonvisibility += "><img src='";
buttonvisibility += M.util.image_url('t/left', 'core');
buttonvisibility += "' /></button>";
var buttonvisibilitydisplay = Y.Node.create(buttonvisibility);
buttonvisibilitydisplay.on('click', this.change_visibility_annot, this);
buttonvisibilitydisplay.on('click', this.change_visibility_annot, this, 'l');
return buttonvisibilitydisplay;
},
/*get_button_visibility: function () {
var buttonvisibility = "<button id='" + this.divcartridge + "_buttonedit' ";
buttonvisibility += "><img src='";
if (this.displaylock === 1) {
buttonvisibility += M.util.image_url('t/left', 'core');
} else {
buttonvisibility += M.util.image_url('t/right', 'core');
}
buttonvisibility += "' /></button>";
var buttonvisibilitydisplay = Y.Node.create(buttonvisibility);
buttonvisibilitydisplay.on('click', this.change_visibility_annot, this);
return buttonvisibilitydisplay;
},*/
get_button_save: function () {
var buttonsave = "<button id='" + this.divcartridge + "_buttonsave' style='display:none;margin-left:110px;'><img src='" + M.util.image_url('t/check', 'core') + "' /></button>";
var buttonsavedisplay = Y.Node.create(buttonsave);
......@@ -936,7 +954,8 @@ Y.extend(ANNOTATION, Y.Base, {
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var interrupt = this.editor.get_dialogue_element('#' + this.divcartridge + "_onof");
var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref").get('value');
var buttonplus = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit");
var buttonplusr = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_right");
var buttonplusl = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_left");
if (valref === '') {
if (this.editor.get('readonly')) {
divdisplay.setContent('');
......@@ -944,37 +963,52 @@ Y.extend(ANNOTATION, Y.Base, {
divdisplay.setContent('&nbsp;&nbsp;&nbsp;&nbsp');
}
}
if (interrupt.get('value') === '0') {
if (interrupt.get('value') === '1') {
if (valref !== '') {
divdisplay.setContent(valref.substr(0, 20));
}
if (buttonplus) {
buttonplus.one('img').setAttribute('src', M.util.image_url('t/right', 'core'));
if (buttonplusr) {
buttonplusr.show();
}
if (buttonplusl) {
buttonplusl.show();
}
} else if (interrupt.get('value') === '0') {
if (valref !== '') {
divdisplay.setContent('...');
}
if (buttonplusr) {
buttonplusr.show();
}
if (buttonplusl) {
buttonplusl.hide();
}
} else {
if (valref !== '') {
divdisplay.setContent(valref);
}
if (buttonplus) {
buttonplus.one('img').setAttribute('src', M.util.image_url('t/left', 'core'));
if (buttonplusr) {
buttonplusr.hide();
}
if (buttonplusl) {
buttonplusl.show();
}
}
if (this.tooltypefamille.label === 'frame') {
buttonplusr.hide();
buttonplusl.hide();
}
},
change_visibility_annot: function () {
//var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
change_visibility_annot: function (e, sens) {
var interrupt = this.editor.get_dialogue_element('#' + this.divcartridge + "_onof");
// var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref").get('value');
//var buttonplus = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit");
// if (valref === '') {
// divdisplay.setContent('&nbsp;&nbsp;&nbsp;&nbsp');
// }
if (interrupt.get('value') === '0') {
interrupt.set('value', 1);
this.displaylock = 1;
var finalvalue = parseInt(interrupt.get('value'));
if (sens === 'r') {
finalvalue += 1;
} else {
interrupt.set('value', 0);
this.displaylock = 2;
finalvalue -= 1;
}
interrupt.set('value', finalvalue);
this.displaylock = finalvalue;
this.apply_visibility_annot();
this.editor.save_current_page();
},
......@@ -1078,13 +1112,17 @@ Y.extend(ANNOTATION, Y.Base, {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit");
var buttonplus = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit");
var buttonplusr = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_right");
var buttonplusl = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_left");
var buttonsave = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonsave");
var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel");
var input = this.editor.get_dialogue_element('#' + this.divcartridge + "_editinput");
divdisplay.hide();
if (buttonplus) {
buttonplus.hide();
if (buttonplusr) {
buttonplusr.hide();
}
if (buttonplusl) {
buttonplusl.hide();
}
divedit.show();
buttonsave.show();
......@@ -1127,6 +1165,7 @@ Y.extend(ANNOTATION, Y.Base, {
input.set('value', result);
}
this.hide_edit();
this.apply_visibility_annot();
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
divprincipale.detach();
}
......@@ -1136,16 +1175,12 @@ Y.extend(ANNOTATION, Y.Base, {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit");
var buttonplus = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit");
var buttonsave = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonsave");
var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel");
if (divdisplay) {
divdisplay.show();
divdisplay.set('style', 'display:inline;color:' + this.get_color_cartridge() + ';');
}
if (buttonplus) {
buttonplus.show();
}
divedit.hide();
buttonsave.hide();
buttoncancel.hide();
......@@ -2080,42 +2115,6 @@ Y.extend(ANNOTATIONHIGHLIGHTPLUS, M.assignfeedback_editpdfplus.annotation, {
divdisplay.append(divcartridge);
//creation input
/*var divconteneur = "<div ";
divconteneur += "class='assignfeedback_editpdfplus_hightlightplus_conteneur' >";
divconteneur += "</div>";
var divconteneurdisplay = Y.Node.create(divconteneur);*/
//divconteneurdisplay.on('click', this.edit_annot, this);
/*var divinputdisplay = this.get_div_input(colorcartridge);
divinputdisplay.addClass('assignfeedback_editpdfplus_hightlightplus_input');
var inputvalref = this.get_input_valref();
var onof = 0;
if (this.displaylock === '1') {
onof = 1;
}
var inputonof = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_onof' value=" + onof + " />");
divinputdisplay.on('click', this.edit_annot, this);
var buttonvisibility = "<button id='" + this.divcartridge + "_buttonedit' ";
buttonvisibility += "><img src='";
if (this.displaylock === 1) {
buttonvisibility += M.util.image_url('t/left', 'core');
} else {
buttonvisibility += M.util.image_url('t/right', 'core');
}
buttonvisibility += "' /></button>";
var buttonvisibilitydisplay = Y.Node.create(buttonvisibility);
buttonvisibilitydisplay.on('click', this.change_visibility_annot, this);
var buttonsave = "<button id='" + this.divcartridge + "_buttonsave' style='display:none;margin-left:110px;'><img src='" + M.util.image_url('t/check', 'core') + "' /></button>";
var buttonsavedisplay = Y.Node.create(buttonsave);
buttonsavedisplay.on('click', this.save_annot, this, null);
var buttoncancel = "<button id='" + this.divcartridge + "_buttoncancel' style='display:none;'><img src='" + M.util.image_url('t/reset', 'core') + "' /></button>";
var buttoncanceldisplay = Y.Node.create(buttoncancel);
buttoncanceldisplay.on('click', this.cancel_edit, this);
divconteneurdisplay.append(divinputdisplay);
divconteneurdisplay.append(inputvalref);
divconteneurdisplay.append(inputonof);
divconteneurdisplay.append(buttonvisibilitydisplay);
divconteneurdisplay.append(buttonsavedisplay);
divconteneurdisplay.append(buttoncanceldisplay);*/
var divconteneurdisplay = this.get_div_container(colorcartridge);
divdisplay.append(divconteneurdisplay);
if (this.tooltype.reply===1) {
......@@ -2125,7 +2124,6 @@ Y.extend(ANNOTATIONHIGHLIGHTPLUS, M.assignfeedback_editpdfplus.annotation, {
//creation de la div d'edition
if (!this.editor.get('readonly')) {
var diveditiondisplay = this.get_div_edition();
//diveditiondisplay.addClass('assignfeedback_editpdfplus_hightlightplus_edition');
divconteneurdisplay.append(diveditiondisplay);
}
......@@ -2668,44 +2666,6 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
//creation input
var divconteneurdisplay = this.get_div_container(colorcartridge);
divdisplay.append(divconteneurdisplay);
/*var divconteneur = "<div ";
divconteneur += "class='assignfeedback_editpdfplus_stampcomment_conteneur' >";
divconteneur += "</div>";
var divconteneurdisplay = Y.Node.create(divconteneur);
var divinputdisplay = this.get_div_input(colorcartridge);
divinputdisplay.addClass('assignfeedback_editpdfplus_stampcomment_input');
var inputvalref = this.get_input_valref();
var onof = 0;
if (this.displaylock === '1') {
onof = 1;
}
var inputonof = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_onof' value=" + onof + " />");
divinputdisplay.on('click', this.edit_annot, this);
var buttonvisibility = "<button id='" + this.divcartridge + "_buttonedit' ";
buttonvisibility += "><img src='";
if (this.displaylock === 1) {
buttonvisibility += M.util.image_url('t/left', 'core');
} else {
buttonvisibility += M.util.image_url('t/right', 'core');
}
buttonvisibility += "' /></button>";
var buttonvisibilitydisplay = Y.Node.create(buttonvisibility);
buttonvisibilitydisplay.on('click', this.change_visibility_annot, this);
var buttonsave = "<button id='" + this.divcartridge + "_buttonsave' style='display:none;margin-left:110px;'><img src='" + M.util.image_url('t/check', 'core') + "' /></button>";
var buttonsavedisplay = Y.Node.create(buttonsave);
buttonsavedisplay.on('click', this.save_annot, this, null);
var buttoncancel = "<button id='" + this.divcartridge + "_buttoncancel' style='display:none;'><img src='" + M.util.image_url('t/reset', 'core') + "' /></button>";
var buttoncanceldisplay = Y.Node.create(buttoncancel);
buttoncanceldisplay.on('click', this.cancel_edit, this);
divconteneurdisplay.append(divinputdisplay);
divconteneurdisplay.append(inputvalref);
divconteneurdisplay.append(inputonof);
divconteneurdisplay.append(inputrotationdisplay);
divconteneurdisplay.append(buttonvisibilitydisplay);
divconteneurdisplay.append(buttonsavedisplay);
divconteneurdisplay.append(buttoncanceldisplay);
divconteneurdisplay.append(buttonrotationdisplay);
divdisplay.append(divconteneurdisplay);*/
if (!this.editor.get('readonly')) {
var rotationvalue = 0;
if (this.displayrotation > 0) {
......@@ -2722,7 +2682,6 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
//creation de la div d'edition
if (!this.editor.get('readonly')) {
var diveditiondisplay = this.get_div_edition();
//diveditiondisplay.addClass('assignfeedback_editpdfplus_stampcomment_edition');
divconteneurdisplay.append(diveditiondisplay);
}
......@@ -3109,8 +3068,10 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
this.apply_visibility_annot();
if (!this.editor.get('readonly')) {
var buttonplus = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit");
buttonplus.hide();
var buttonplusr = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_right");
var buttonplusl = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_left");
buttonplusr.hide();
buttonplusl.hide();
}
} else {
......@@ -3289,13 +3250,15 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var buttonrender = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonpencil");
var buttonadd = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonadd");
var buttonplus = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit");
var buttonplusr = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_right");
var buttonplusl = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_left");
divdisplay.set('style', 'display:inline;color:' + this.get_color() + ';');
buttonrender.show();
buttonadd.show();
if (buttonplus) {
buttonplus.hide();
if (buttonplusr) {
buttonplusr.hide();
}
buttonplusl.hide();
},
/**
* Delete an annotation
......@@ -3518,47 +3481,10 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
//creation input
var divconteneurdisplay = this.get_div_container(colorcartridge);
divdisplay.append(divconteneurdisplay);
/*var divconteneur = "<div ";
divconteneur += "class='assignfeedback_editpdfplus_verticalline_conteneur' >";
divconteneur += "</div>";
var divconteneurdisplay = Y.Node.create(divconteneur);
var divinputdisplay = this.get_div_input(colorcartridge);
divinputdisplay.addClass('assignfeedback_editpdfplus_verticalline_input');
var inputvalref = this.get_input_valref();
var onof = 0;
if (this.displaylock === '1') {
onof = 1;
}
var inputonof = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_onof' value=" + onof + " />");
divinputdisplay.on('click', this.edit_annot, this);
var buttonvisibility = "<button id='" + this.divcartridge + "_buttonedit' ";
buttonvisibility += "><img src='";
if (this.displaylock === 1) {
buttonvisibility += M.util.image_url('t/left', 'core');
} else {
buttonvisibility += M.util.image_url('t/right', 'core');
}
buttonvisibility += "' /></button>";
var buttonvisibilitydisplay = Y.Node.create(buttonvisibility);
buttonvisibilitydisplay.on('click', this.change_visibility_annot, this);
var buttonsave = "<button id='" + this.divcartridge + "_buttonsave' style='display:none;margin-left:110px;'><img src='" + M.util.image_url('t/check', 'core') + "' /></button>";
var buttonsavedisplay = Y.Node.create(buttonsave);
buttonsavedisplay.on('click', this.save_annot, this, null);
var buttoncancel = "<button id='" + this.divcartridge + "_buttoncancel' style='display:none;'><img src='" + M.util.image_url('t/reset', 'core') + "' /></button>";
var buttoncanceldisplay = Y.Node.create(buttoncancel);
buttoncanceldisplay.on('click', this.cancel_edit, this);
divconteneurdisplay.append(divinputdisplay);
divconteneurdisplay.append(inputvalref);
divconteneurdisplay.append(inputonof);
divconteneurdisplay.append(buttonvisibilitydisplay);
divconteneurdisplay.append(buttonsavedisplay);
divconteneurdisplay.append(buttoncanceldisplay);
divdisplay.append(divconteneurdisplay);*/
//creation de la div d'edition
if (!this.editor.get('readonly')) {
var diveditiondisplay = this.get_div_edition();
//diveditiondisplay.addClass('assignfeedback_editpdfplus_verticalline_edition');
divconteneurdisplay.append(diveditiondisplay);
}
......@@ -3809,48 +3735,10 @@ Y.extend(ANNOTATIONCOMMENTPLUS, M.assignfeedback_editpdfplus.annotation, {
//creation input
var divconteneurdisplay = this.get_div_container(colorcartridge);
divdisplay.append(divconteneurdisplay);
/*var divconteneur = "<div ";
divconteneur += "class='assignfeedback_editpdfplus_commentplus_conteneur' >";
divconteneur += "</div>";
var divconteneurdisplay = Y.Node.create(divconteneur);
var divinputdisplay = this.get_div_input(colorcartridge);
divinputdisplay.addClass('assignfeedback_editpdfplus_commentplus_input');
divinputdisplay.setStyles({'width': '200px'});
var inputvalref = this.get_input_valref();
var onof = 0;
if (this.displaylock === '1') {
onof = 1;
}
var inputonof = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_onof' value=" + onof + " />");
divinputdisplay.on('click', this.edit_annot, this);
var buttonvisibility = "<button id='" + this.divcartridge + "_buttonedit' ";
buttonvisibility += "><img src='";
if (this.displaylock === 1) {
buttonvisibility += M.util.image_url('t/up', 'core');
} else {
buttonvisibility += M.util.image_url('t/down', 'core');
}
buttonvisibility += "' /></button>";
var buttonvisibilitydisplay = Y.Node.create(buttonvisibility);
buttonvisibilitydisplay.on('click', this.change_visibility_annot, this);
var buttonsave = "<button id='" + this.divcartridge + "_buttonsave' style='display:none;margin-left:110px;'><img src='" + M.util.image_url('t/check', 'core') + "' /></button>";
var buttonsavedisplay = Y.Node.create(buttonsave);
buttonsavedisplay.on('click', this.save_annot, this, null);
var buttoncancel = "<button id='" + this.divcartridge + "_buttoncancel' style='display:none;'><img src='" + M.util.image_url('t/reset', 'core') + "' /></button>";
var buttoncanceldisplay = Y.Node.create(buttoncancel);
buttoncanceldisplay.on('click', this.cancel_edit, this);
divconteneurdisplay.append(divinputdisplay);
divconteneurdisplay.append(inputvalref);
divconteneurdisplay.append(inputonof);
divconteneurdisplay.append(buttonvisibilitydisplay);
divconteneurdisplay.append(buttonsavedisplay);
divconteneurdisplay.append(buttoncanceldisplay);
divdisplay.append(divconteneurdisplay);*/
//creation de la div d'edition
if (!this.editor.get('readonly')) {
var diveditiondisplay = this.get_div_edition();
//diveditiondisplay.addClass('assignfeedback_editpdfplus_commentplus_edition');
divconteneurdisplay.append(diveditiondisplay);
}
......@@ -3870,7 +3758,8 @@ Y.extend(ANNOTATIONCOMMENTPLUS, M.assignfeedback_editpdfplus.annotation, {
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var interrupt = this.editor.get_dialogue_element('#' + this.divcartridge + "_onof");
var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref").get('value');
var buttonplus = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit");
var buttonplusr = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_right");
var buttonplusl = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonedit_left");
if (valref === '') {
if (this.editor.get('readonly')) {
divdisplay.setContent('');
......@@ -3882,16 +3771,20 @@ Y.extend(ANNOTATIONCOMMENTPLUS, M.assignfeedback_editpdfplus.annotation, {
if (valref !== '') {
divdisplay.setContent(valref.substr(0, 20));
}
if (buttonplus) {
buttonplus.one('img').setAttribute('src', M.util.image_url('t/down', 'core'));
if (buttonplusr) {
buttonplusr.one('img').setAttribute('src', M.util.image_url('t/down', 'core'));
buttonplusr.show();
}
buttonplusl.hide();
} else {
if (valref !== '') {
divdisplay.setContent('<table><tr><td>' + valref.replace(/\n/g, "<br/>") + '</td></tr></table><br/>');
}
if (buttonplus) {
buttonplus.one('img').setAttribute('src', M.util.image_url('t/up', 'core'));
if (buttonplusl) {
buttonplusl.one('img').setAttribute('src', M.util.image_url('t/up', 'core'));
buttonplusl.show();
}
buttonplusr.hide();
}
},
save_annot: function () {
......
YUI.add("moodle-assignfeedback_editpdfplus-editor",function(e,t){var n=M.cfg.wwwroot+"/mod/assign/feedback/editpdfplus/ajax.php",r=M.cfg.wwwroot+"/mod/assign/feedback/editpdfplus/ajax_progress.php",s={DIALOGUE:"assignfeedback_editpdfplus_widget"},o={PREVIOUSBUTTON:".navigate-previous-button",NEXTBUTTON:" .navigate-next-button",SEARCHCOMMENTSBUTTON:".searchcommentsbutton",SEARCHFILTER:".assignfeedback_editpdfplus_commentsearch input",SEARCHCOMMENTSLIST:".assignfeedback_editpdfplus_commentsearch ul",PAGESELECT:".navigate-page-select",LOADINGICON:".loading",PROGRESSBARCONTAINER:".progress-info.progress-striped",DRAWINGREGION:".drawingregion",DRAWINGCANVAS:".drawingcanvas",SAVE:".savebutton",COMMENTCOLOURBUTTON:".commentcolourbutton",COMMENTMENU:".commentdrawable a",ANNOTATIONCOLOURBUTTON:".annotationcolourbutton",DELETEANNOTATIONBUTTON:".deleteannotationbutton",UNSAVEDCHANGESDIV:".assignfeedback_editpdfplus_unsavedchanges",UNSAVEDCHANGESINPUT:'input[name="assignfeedback_editpdfplus_haschanges"]',STAMPSBUTTON:".currentstampbutton",DIALOGUE:"."+s.DIALOGUE,CUSTOMTOOLBARID:"#toolbaraxis",CUSTOMTOOLBARS:".customtoolbar",AXISCUSTOMTOOLBAR:".menuaxisselection",CUSTOMTOOLBARBUTTONS:".costumtoolbarbutton"},u="rgba(200, 200, 255, 0.9)",a="rgba(200, 200, 255, 0.5)",f="rgb(51, 51, 51)",l={white:"rgb(255,255,255)",yellow:"rgb(255,236,174)",red:"rgb(249,181,179)",green:"rgb(214,234,178)",blue:"rgb(203,217,237)",clear:"rgba(255,255,255, 0)"},c={white:"rgb(255,255,255)",yellow:"rgb(255,207,53)",red:"rgb(239,69,64)",green:"rgb(152,202,62)",blue:"rgb(125,159,211)",black:"rgb(51,51,51)"},h=300,p={pen:".penbutton",line:".linebutton",rectangle:".rectanglebutton",oval:".ovalbutton",select:".selectbutton",drag:".dragbutton",highlight:".highlightbutton"},d={HIGHLIGHTPLUS:1,LINEPLUS:2,STAMPPLUS:3,FRAME:4,VERTICALLINE:5,STAMPCOMMENT:6,COMMENTPLUS:7,PEN:8,LINE:9,RECTANGLE:10,OVAL:11,HIGHLIGHT:12},v={HIGHLIGHTPLUS:"highlightplus",LINEPLUS:"lineplus",STAMPPLUS:"stampplus",FRAME:"frame",VERTICALLINE:"verticalline",STAMPCOMMENT:"stampcomment",COMMENTPLUS:"commentplus",PEN:"pen",LINE:"line",RECTANGLE:"rectangle",OVAL:"oval",HIGHLIGHT:"highlight"},m=4,g=function(e,t){this.x=parseInt(e,10),this.y=parseInt(t,10),this.clip=function(e){return this.x<e.x&&(this.x=e.x),this.x>e.x+e.width&&(this.x=e.x+e.width),this.y<e.y&&(this.y=e.y),this.y>e.y+e.height&&(this.y=e.y+e.height),this}};M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.point=g;var y=function(e,t,n,r){this.x=e,this.y=t,this.width=n,this.height=r,this.bound=function(e){var t=0,n=0,r=0,i=0,s=0,o;for(s=0;s<e.length;s++){o=e[s];if(o.x<t||s===0)t=o.x;if(o.x>n||s===0)n=o.x;if(o.y<r||s===0)r=o.y;if(o.y>i||s===0)i=o.y}return this.x=t,this.y=r,this.width=n-t,this.height=i-r,this},this.has_min_width=function(){return this.width>=5},this.has_min_height=function(){return this.height>=5},this.set_min_width=function(){this.width=5},this.set_min_height=function(){this.height=5}};M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.rect=y;var b=function(){this.start=!1,this.end=!1,this.starttime=0,this.annotationstart=!1,this.tool="drag",this.commentcolour="yellow",this.annotationcolour="red",this.stamp="",this.path=[]};M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.edit=b;var w=function(e){this.editor=e,this.shapes=[],this.nodes=[],this.erase=function(){if(this.shapes)while(this.shapes.length>0)this.editor.graphic.removeShape(this.shapes.pop());if(this.nodes)while(this.nodes.length>0)this.nodes.pop().remove()},this.scroll_update=function(e,t){var n,r,i;for(n=0;n<this.nodes.length;n++)r=this.nodes[n].getData("x"),i=this.nodes[n].getData("y"),r!==undefined&&i!==undefined&&(this.nodes[n].setX(parseInt(r,10)-e),this.nodes[n].setY(parseInt(i,10)-t))},this.store_position=function(e,t,n){var r,i,s;r=this.editor.get_dialogue_element(o.DRAWINGREGION),i=parseInt(r.get("scrollLeft"),10),s=parseInt(r.get("scrollTop"),10),e.setData("x",t+i),e.setData("y",n+s)}};M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.drawable=w;var E=function(e){E.superclass.constructor.apply(this,[e])};E.NAME="annotation",E.ATTRS={},e.extend(E,e.Base,{editor:null,gradeid:0,pageno:0,x:0,y:0,endx:0,endy:0,path:"",toolid:0,colour:"red",drawable:!1,tooltype:null,tooltypefamille:null,divcartridge:"",textannot:"",displaylock:0,displayrotation:0,borderstyle:"",parent_annot:0,parent_annot_element:null,id:0,shape_id:"",cartridgex:0,cartridgey:0,initializer:function(e){e.parent_annot_element?(this.editor=e.parent_annot_element.editor||null,this.gradeid=parseInt(e.parent_annot_element.gradeid,10)||0,this.pageno=parseInt(e.parent_annot_element.pageno,10)||0,this.x=parseInt(e.x,10)||0,this.y=parseInt(e.y,10)||0,this.endx=parseInt(e.endx,10)||0,this.endy=parseInt(e.endy,10)||0,this.cartridgex=parseInt(e.parent_annot_element.cartridgex,10)||0,this.cartridgey=parseInt(e.parent_annot_element.cartridgey,10)||0,this.path=e.path||"",this.toolid=e.toolid||this.editor.get_dialogue_element(d.RECTANGLE),this.colour=e.parent_annot_element.colour||"red",this.drawable=!1,this.tooltype=e.tooltype,this.textannot=e.parent_annot_element.textannot,this.displaylock=e.parent_annot_element.displaylock,this.displayrotation=e.parent_annot_element.displayrotation,this.borderstyle=e.parent_annot_element.borderstyle||"solid",this.parent_annot=e.parent_annot_element.id,this.parent_annot_element=e.parent_annot_element):(this.editor=e.editor||null,this.gradeid=parseInt(e.gradeid,10)||0,this.pageno=parseInt(e.pageno,10)||0,this.x=parseInt(e.x,10)||0,this.y=parseInt(e.y,10)||0,this.endx=parseInt(e.endx,10)||0,this.endy=parseInt(e.endy,10)||0,this.cartridgex=parseInt(e.cartridgex,10)||0,this.cartridgey=parseInt(e.cartridgey,10)||0,this.path=e.path||"",this.toolid=e.toolid||this.editor.get_dialogue_element(d.RECTANGLE),this.colour=e.colour||"red",this.drawable=!1,this.tooltype=e.tooltype,this.textannot=
e.textannot,this.displaylock=e.displaylock,this.displayrotation=e.displayrotation,this.borderstyle=e.borderstyle||"solid",this.parent_annot=e.parent_annot,this.id=e.id),this.tooltypefamille=this.editor.typetools[this.tooltype.type]},clean:function(){return this.parent_annot_element?{gradeid:this.gradeid,x:parseInt(this.x,10),y:parseInt(this.y,10),endx:parseInt(this.endx,10),endy:parseInt(this.endy,10),cartridgex:parseInt(this.cartridgex,10),cartridgey:parseInt(this.cartridgey,10),toolid:this.toolid,path:this.path,pageno:this.pageno,colour:this.colour,textannot:this.textannot,displaylock:parseInt(this.displaylock,10),displayrotation:parseInt(this.displayrotation,10),borderstyle:this.borderstyle,parent_annot:this.parent_annot,divcartridge:this.divcartridge,parent_annot_div:this.parent_annot_element.divcartridge}:{gradeid:this.gradeid,x:parseInt(this.x,10),y:parseInt(this.y,10),endx:parseInt(this.endx,10),endy:parseInt(this.endy,10),cartridgex:parseInt(this.cartridgex,10),cartridgey:parseInt(this.cartridgey,10),toolid:this.toolid,path:this.path,pageno:this.pageno,colour:this.colour,textannot:this.textannot,displaylock:parseInt(this.displaylock,10),displayrotation:parseInt(this.displayrotation,10),borderstyle:this.borderstyle,parent_annot:this.parent_annot,divcartridge:this.divcartridge,parent_annot