Gitlab CSE Unil

Commit 2554939c authored by M. Chardon's avatar M. Chardon
Browse files

optimisation + déplacement des cartouches actif

parent 9192b9f0
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......@@ -53,13 +54,15 @@ class annotation {
/** @var int ending location in pixels. Image resolution is 100 pixels per inch */
public $endy = 0;
public $cartridgex = 0;
public $cartridgey = 0;
/** @var string path information for drawing the annotation. */
public $path = '';
/** @var int toolid for this annotation. */
public $toolid = 0;
/** @var string textannot, contains the text of this annotation */
public $textannot = '';
......@@ -71,13 +74,13 @@ class annotation {
/** @var bool displayrotation for displaying the sign of the annotation */
public $displayrotation = 0;
/** @var string borderstyle */
public $borderstyle = '';
/** @var int $parent_annot */
public $parent_annot = 0;
/**
* Convert a compatible stdClass into an instance of this class.
* @param stdClass $record
......@@ -96,4 +99,5 @@ class annotation {
}
}
}
}
......@@ -14,7 +14,7 @@ namespace assignfeedback_editpdfplus;
* @author kury
*/
class tool {
/** @var int unique id for this annotation */
public $id = 0;
......@@ -32,22 +32,22 @@ class tool {
/** @var string cartridge for drawing the annotation. */
public $cartridge = '';
/** @var string colors used */
public $cartridge_color = '';
/** @var string texts for this annotation. */
public $texts = '';
/** @var string label of this annotation */
public $label = '';
/** @var boolean, allow reply or not */
public $reply = 0;
public $enabled = 1;
public $order = 1000;
public $cartridge_positionx = 0;
public $cartridge_positiony = 0;
/**
* Convert a compatible stdClass into an instance of this class.
......@@ -67,5 +67,5 @@ class tool {
}
}
}
}
......@@ -90,7 +90,8 @@
<FIELD NAME="thumbnail" TYPE="binary" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="cartridge" TYPE="char" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="texts" TYPE="char" LENGTH="500" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="position" TYPE="int" LENGTH="18" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="cartridge_positionx" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="cartridge_positiony" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="label" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="reply" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="enabled" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
......
......@@ -121,6 +121,8 @@ Y.extend(ANNOTATION, Y.Base, {
parent_annot_element: null,
id: 0,
shape_id: '',
cartridgex: 0,
cartridgey: 0,
/**
* Initialise the annotation.
*
......@@ -136,6 +138,8 @@ Y.extend(ANNOTATION, Y.Base, {
this.y = parseInt(config.y, 10) || 0;
this.endx = parseInt(config.endx, 10) || 0;
this.endy = parseInt(config.endy, 10) || 0;
this.cartridgex = parseInt(config.parent_annot_element.cartridgex, 10) || 0;
this.cartridgey = parseInt(config.parent_annot_element.cartridgey, 10) || 0;
this.path = config.path || '';
this.toolid = config.toolid || this.editor.get_dialogue_element(TOOLTYPEID.RECTANGLE);
this.colour = config.parent_annot_element.colour || 'red';
......@@ -156,6 +160,8 @@ Y.extend(ANNOTATION, Y.Base, {
this.y = parseInt(config.y, 10) || 0;
this.endx = parseInt(config.endx, 10) || 0;
this.endy = parseInt(config.endy, 10) || 0;
this.cartridgex = parseInt(config.cartridgex, 10) || 0;
this.cartridgey = parseInt(config.cartridgey, 10) || 0;
this.path = config.path || '';
this.toolid = config.toolid || this.editor.get_dialogue_element(TOOLTYPEID.RECTANGLE);
this.colour = config.colour || 'red';
......@@ -183,6 +189,8 @@ Y.extend(ANNOTATION, Y.Base, {
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,
......@@ -202,6 +210,8 @@ Y.extend(ANNOTATION, Y.Base, {
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,
......@@ -250,11 +260,32 @@ Y.extend(ANNOTATION, Y.Base, {
},
get_div_cartridge_label: function (colorcartridge) {
var divcartridge = "<div ";
divcartridge += "id='" + this.divcartridge + "_cartridge' ";
divcartridge += "style='border-right-color: " + colorcartridge + ";color:" + colorcartridge + ";'> ";
divcartridge += this.tooltype.cartridge;
divcartridge += "</div>";
return Y.Node.create(divcartridge);
},
get_div_input: function (colorcartridge) {
var divinput = "<div ";
divinput += "id='" + this.divcartridge + "_display' ";
divinput += "style='color:" + colorcartridge + ";'> ";
divinput += "</div>";
var divinputdisplay = Y.Node.create(divinput);
divinputdisplay.on('click', this.edit_annot, this);
return divinputdisplay;
},
get_valref: function () {
if (this.textannot && this.textannot.length > 0 && typeof this.textannot === 'string') {
return this.textannot;
}
return '';
},
get_input_valref: function () {
return Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_valref' value=\"" + this.get_valref() + "\"/>");
},
apply_visibility_annot: function () {
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var interrupt = this.editor.get_dialogue_element('#' + this.divcartridge + "_onof");
......@@ -275,6 +306,21 @@ Y.extend(ANNOTATION, Y.Base, {
buttonplus.one('img').setAttribute('src', M.util.image_url('t/left', 'core'));
}
},
move_cartridge_begin: function (e) {
e.preventDefault();
var canvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
clientpoint = new M.assignfeedback_editpdfplus.point(e.clientX + canvas.get('docScrollX'),
e.clientY + canvas.get('docScrollY')),
point = this.editor.get_canvas_coordinates(clientpoint);
this.oldx = point.x;
this.oldy = point.y;
var divcartridge = this.editor.get_dialogue_element('#' + this.divcartridge + "_cartridge");
divcartridge.on('mousemove', this.move_cartridge_continue, this);
divcartridge.on('mouseup', this.move_cartridge_stop, this);
},
/**
* Draw a selection around this annotation if it is selected.
* @public
......
......@@ -36,6 +36,8 @@ ANNOTATIONFRAME.ATTRS = {};
Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
children: [],
oldx: 0,
oldy: 0,
/**
* Draw a highlight annotation
* @protected
......@@ -203,10 +205,12 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
var divdisplay = this.get_div_cartridge(colorcartridge);
divdisplay.addClass('assignfeedback_editpdfplus_frame');
divdisplay.setStyles({'border-style': this.borderstyle});
divdisplay.set('draggable', 'true');
// inscription entete
var divcartridge = this.get_div_cartridge_label(colorcartridge);
divcartridge.addClass('assignfeedback_editpdfplus_frame_cartridge');
divcartridge.on('mousedown', this.move_cartridge_begin, this);
divdisplay.append(divcartridge);
//creation input
......@@ -214,18 +218,9 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
divconteneur += "class='assignfeedback_editpdfplus_frame_conteneur' >";
divconteneur += "</div>";
var divconteneurdisplay = Y.Node.create(divconteneur);
var divinput = "<div ";
divinput += "id='" + this.divcartridge + "_display' ";
divinput += "class='assignfeedback_editpdfplus_frame_input' ";
divinput += "style='color:" + colorcartridge + ";'> ";
if (this.textannot && this.textannot.length > 0) {
divinput += this.textannot.substr(0, 20);
} else {
divinput += '&nbsp;&nbsp;';
}
divinput += "</div>";
var divinputdisplay = Y.Node.create(divinput);
divinputdisplay.on('click', this.edit_annot, this);
var divinputdisplay = this.get_div_input(colorcartridge);
divinputdisplay.addClass('assignfeedback_editpdfplus_frame_input');
var inputvalref = this.get_input_valref();
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);
......@@ -243,6 +238,7 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
var buttonadddisplay = Y.Node.create(buttonadd);
buttonadddisplay.on('click', this.add_annot, this);
divconteneurdisplay.append(divinputdisplay);
divconteneurdisplay.append(inputvalref);
divconteneurdisplay.append(buttonsavedisplay);
divconteneurdisplay.append(buttoncanceldisplay);
divconteneurdisplay.append(buttonrenderdisplay);
......@@ -254,7 +250,7 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
divedition += "id='" + this.divcartridge + "_edit' ";
divedition += "class='assignfeedback_editpdfplus_frame_edition' ";
divedition += "style='display:none;'> ";
divedition += "<input id='" + this.divcartridge + "_editinput' type='text' value=\"" + this.textannot + "\" />";
divedition += "<input id='" + this.divcartridge + "_editinput' type='text' value=\"" + this.get_valref() + "\" />";
divedition += "</div>";
var diveditiondisplay = Y.Node.create(divedition);
divconteneurdisplay.append(diveditiondisplay);
......@@ -315,35 +311,84 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
diveditionframedisplay.append(diveditiondasheddisplay);
//positionnement de la div par rapport a l'annotation
divdisplay.setX(offsetcanvas[0] + 5);
divdisplay.setY(this.y - 8);
if (!this.cartridgex || this.cartridgex === 0) {
this.cartridgex = parseInt(this.tooltype.cartridge_positionx);
}
if (!this.cartridgey || this.cartridgey === 0) {
this.cartridgey = parseInt(this.tooltype.cartridge_positiony);
}
divdisplay.setX(offsetcanvas[0] + this.cartridgex);
divdisplay.setY(this.y + this.cartridgey);
drawingregion.append(divdisplay);
this.apply_visibility_annot();
} else {
var divid = '#' + this.divcartridge;
//Y.log('draw_catridge : ' + divid);
var divdisplay = this.editor.get_dialogue_element(divid);
divdisplay.setX(offsetcanvas[0] + 5);
divdisplay.setY(offsetcanvas[1] + this.y - 8);
divdisplay.setX(offsetcanvas[0] + this.cartridgex);
divdisplay.setY(offsetcanvas[1] + this.y + this.cartridgey);
}
}
return true;
},
move_cartridge_continue: function (e) {
e.preventDefault();
var canvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
clientpoint = new M.assignfeedback_editpdfplus.point(e.clientX + canvas.get('docScrollX'),
e.clientY + canvas.get('docScrollY')),
point = this.editor.get_canvas_coordinates(clientpoint);
var offsetcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS).getXY();
var diffx = point.x - this.oldx;
var diffy = point.y - this.oldy;
//Y.log('move_cartridge : drag diff ' + diffx + ' - ' + diffy);
//Y.log('move_cartridge : drag deplacement ' + (offsetcanvas[0] + this.cartridgex) + ' - ' + (offsetcanvas[0] + this.cartridgex + diffx));
var divcartridge = this.editor.get_dialogue_element('#' + this.divcartridge);
divcartridge.setX(offsetcanvas[0] + this.cartridgex + diffx);
divcartridge.setY(offsetcanvas[1] + this.y + this.cartridgey + diffy);
},
move_cartridge_stop: function (e) {
e.preventDefault();
var divcartridge = this.editor.get_dialogue_element('#' + this.divcartridge + "_cartridge");
divcartridge.detach('mousemove', this.move_cartridge_continue, this);
divcartridge.detach('mouseup', this.move_cartridge_stop, this);
var canvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
clientpoint = new M.assignfeedback_editpdfplus.point(e.clientX + canvas.get('docScrollX'),
e.clientY + canvas.get('docScrollY')),
point = this.editor.get_canvas_coordinates(clientpoint);
var offsetcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS).getXY();
var diffx = point.x - this.oldx;
var diffy = point.y - this.oldy;
//Y.log('move_cartridge : drag end ' + diffx + ' - ' + diffy);
//Y.log('move_cartridge : drag end ' + (offsetcanvas[0] + this.cartridgex) + ' - ' + (offsetcanvas[0] + this.cartridgex + diffx));
this.cartridgex += diffx;
this.cartridgey += diffy;
var divcartridge = this.editor.get_dialogue_element('#' + this.divcartridge);
divcartridge.setX(offsetcanvas[0] + this.cartridgex);
divcartridge.setY(offsetcanvas[1] + this.y + this.cartridgey);
this.editor.save_current_page();
},
apply_visibility_annot: function () {
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref").get('value');
if (valref === '') {
divdisplay.setContent('&nbsp;&nbsp;&nbsp;&nbsp');
} else if (valref !== '') {
divdisplay.setContent(valref);
}
},
add_annot: function (e) {
//var new_frame = this.clone();
this.editor.currentedit.parent_annot_element = this;
this.editor.handle_tool_button(e, TOOLTYPELIB.FRAME, 'ctbutton' + this.toolid, 1);
/*var annotation = new M.assignfeedback_editpdfplus.annotationframe(new_frame);
if (annotation) {
if (annotation.init_from_edit(this.editor.currentedit)) {
if (this.editor.currentdrawable) {
this.editor.currentdrawable.erase();
}
annotation.draw_catridge(this.editor.currentedit);
this.editor.pages[this.editor.currentpage].annotations.push(annotation);
this.editor.drawables.push(annotation.draw());
}
}*/
},
display_picker: function () {
Y.log('display_picker : ' + this.children.length);
......
......@@ -166,22 +166,13 @@ Y.extend(ANNOTATIONHIGHLIGHTPLUS, M.assignfeedback_editpdfplus.annotation, {
divconteneur += "class='assignfeedback_editpdfplus_hightlightplus_conteneur' >";
divconteneur += "</div>";
var divconteneurdisplay = Y.Node.create(divconteneur);
var divinput = "<div ";
divinput += "id='" + this.divcartridge + "_display' ";
divinput += "class='assignfeedback_editpdfplus_hightlightplus_input' ";
divinput += "style='color:" + colorcartridge + ";'> ";
if (this.textannot && this.textannot.length > 0) {
divinput += this.textannot.substr(0, 20);
} else {
divinput += '&nbsp;&nbsp;';
}
divinput += "</div>";
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 divinputdisplay = Y.Node.create(divinput);
var inputvalref = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_valref' value=\"" + this.textannot + "\"/>");
var inputonof = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_onof' value=" + onof + " />");
var lockvalue = 0;
if (this.displaylock > 0) {
......@@ -232,7 +223,7 @@ Y.extend(ANNOTATIONHIGHLIGHTPLUS, M.assignfeedback_editpdfplus.annotation, {
divedition += "id='" + this.divcartridge + "_edit' ";
divedition += "class='assignfeedback_editpdfplus_hightlightplus_edition' ";
divedition += "style='display:none;'> ";
divedition += "<input id='" + this.divcartridge + "_editinput' type='text' value=\"" + this.textannot + "\" />";
divedition += "<input id='" + this.divcartridge + "_editinput' type='text' value=\"" + this.get_valref() + "\" />";
divedition += "</div>";
var diveditiondisplay = Y.Node.create(divedition);
divconteneurdisplay.append(diveditiondisplay);
......@@ -253,8 +244,14 @@ Y.extend(ANNOTATIONHIGHLIGHTPLUS, M.assignfeedback_editpdfplus.annotation, {
diveditiondisplay.append(divpropositiondisplay);
//positionnement de la div par rapport a l'annotation
divdisplay.setX(offsetcanvas[0] + this.x);
divdisplay.setY(this.y - 16 - 8);
if (!this.cartridgex || this.cartridgex === 0) {
this.cartridgex = parseInt(this.tooltype.cartridge_positionx);
}
if (!this.cartridgey || this.cartridgey === 0) {
this.cartridgey = parseInt(this.tooltype.cartridge_positiony);
}
divdisplay.setX(offsetcanvas[0] + this.x + this.cartridgex);
divdisplay.setY(this.y + this.cartridgey);
drawingregion.append(divdisplay);
this.apply_visibility_annot();
......@@ -262,8 +259,8 @@ Y.extend(ANNOTATIONHIGHLIGHTPLUS, M.assignfeedback_editpdfplus.annotation, {
var divid = '#' + this.divcartridge;
//Y.log('draw_catridge : ' + divid);
var divdisplay = this.editor.get_dialogue_element(divid);
divdisplay.setX(offsetcanvas[0] + this.x);
divdisplay.setY(offsetcanvas[1] + this.y - 16 - 8);
divdisplay.setX(offsetcanvas[0] + this.x + this.cartridgex);
divdisplay.setY(offsetcanvas[1] + this.y + this.cartridgey);
}
return true;
},
......
......@@ -170,27 +170,14 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
divconteneur += "class='assignfeedback_editpdfplus_stampcomment_conteneur' >";
divconteneur += "</div>";
var divconteneurdisplay = Y.Node.create(divconteneur);
var divinput = "<div ";
divinput += "id='" + this.divcartridge + "_display' ";
divinput += "class='assignfeedback_editpdfplus_stampcomment_input' ";
divinput += "style='color:" + colorcartridge + ";'> ";
var valref = '';
if (this.textannot && this.textannot.length > 0 && typeof this.textannot === 'string') {
valref = this.textannot;
}
divinput += "</div>";
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 divinputdisplay = Y.Node.create(divinput);
var inputvalref = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_valref' value=\"" + valref + "\"/>");
var inputonof = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_onof' value=" + onof + " />");
var lockvalue = 0;
if (this.displaylock > 0) {
lockvalue = 1;
}
var inputlockdisplay = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_lockdisplay' value=" + lockvalue + " />");
divinputdisplay.on('click', this.edit_annot, this);
var rotationvalue = 0;
if (this.displayrotation > 0) {
......@@ -198,9 +185,6 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
}
var inputrotationdisplay = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_rotation' value=" + rotationvalue + " />");
var buttonvisibility = "<button id='" + this.divcartridge + "_buttonedit' ";
if (lockvalue > 0) {
buttonvisibility += "style='display:none;' ";
}
buttonvisibility += "><img src='";
if (this.displaylock === 1) {
buttonvisibility += M.util.image_url('t/left', 'core');
......@@ -222,7 +206,6 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
divconteneurdisplay.append(divinputdisplay);
divconteneurdisplay.append(inputvalref);
divconteneurdisplay.append(inputonof);
divconteneurdisplay.append(inputlockdisplay);
divconteneurdisplay.append(inputrotationdisplay);
divconteneurdisplay.append(buttonvisibilitydisplay);
divconteneurdisplay.append(buttonsavedisplay);
......@@ -235,7 +218,7 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
divedition += "id='" + this.divcartridge + "_edit' ";
divedition += "class='assignfeedback_editpdfplus_stampcomment_edition' ";
divedition += "style='display:none;'> ";
divedition += "<input id='" + this.divcartridge + "_editinput' type='text' value=\"" + valref + "\" />";
divedition += "<input id='" + this.divcartridge + "_editinput' type='text' value=\"" + this.get_valref() + "\" />";
divedition += "</div>";
var diveditiondisplay = Y.Node.create(divedition);
divconteneurdisplay.append(diveditiondisplay);
......@@ -255,8 +238,14 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
diveditiondisplay.append(divpropositiondisplay);
//positionnement de la div par rapport a l'annotation
divdisplay.setX(offsetcanvas[0] + this.x + 35);
divdisplay.setY(this.y + 6);
if (!this.cartridgex || this.cartridgex === 0) {
this.cartridgex = parseInt(this.tooltype.cartridge_positionx);
}
if (!this.cartridgey || this.cartridgey === 0) {
this.cartridgey = parseInt(this.tooltype.cartridge_positiony);
}
divdisplay.setX(offsetcanvas[0] + this.x + this.cartridgex);
divdisplay.setY(this.y + this.cartridgey);
drawingregion.append(divdisplay);
this.apply_visibility_annot();
......@@ -264,8 +253,8 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
var divid = '#' + this.divcartridge;
//Y.log('draw_catridge : ' + divid);
var divdisplay = this.editor.get_dialogue_element(divid);
divdisplay.setX(offsetcanvas[0] + this.x + 35);
divdisplay.setY(offsetcanvas[1] + this.y + 6);
divdisplay.setX(offsetcanvas[0] + this.x + this.cartridgex);
divdisplay.setY(offsetcanvas[1] + this.y + this.cartridgey);
}
return true;
},
......
......@@ -146,7 +146,7 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
if (this.divcartridge === '') {
this.init_div_cartridge_id();
var drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION);
//init cartridge
var colorcartridge = this.get_color_cartridge();
var divdisplay = this.get_div_cartridge(colorcartridge);
......@@ -155,6 +155,7 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
// inscription entete
var divcartridge = this.get_div_cartridge_label(colorcartridge);
divcartridge.addClass('assignfeedback_editpdfplus_verticalline_cartridge');
divcartridge.on('mousedown', this.move_cartridge_begin, this);
divdisplay.append(divcartridge);
//creation input
......@@ -162,22 +163,13 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
divconteneur += "class='assignfeedback_editpdfplus_verticalline_conteneur' >";
divconteneur += "</div>";
var divconteneurdisplay = Y.Node.create(divconteneur);
var divinput = "<div ";
divinput += "id='" + this.divcartridge + "_display' ";
divinput += "class='assignfeedback_editpdfplus_verticalline_input' ";
divinput += "style='color:" + colorcartridge + ";'> ";
if (this.textannot && this.textannot.length > 0) {
divinput += this.textannot.substr(0, 20);
} else {
divinput += '&nbsp;&nbsp;';
}
divinput += "</div>";
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 divinputdisplay = Y.Node.create(divinput);
var inputvalref = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_valref' value=\"" + this.textannot + "\"/>");
var inputonof = Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_onof' value=" + onof + " />");
var lockvalue = 0;
if (this.displaylock > 0) {
......@@ -211,8 +203,6 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
buttonlock += M.util.image_url('t/lock', 'core');
}
buttonlock += "' /></button>";
//var buttonlockdisplay = Y.Node.create(buttonlock);
//buttonlockdisplay.on('click', this.lock_display, this);
divconteneurdisplay.append(divinputdisplay);
divconteneurdisplay.append(inputvalref);
divconteneurdisplay.append(inputonof);
......@@ -220,7 +210,6 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
divconteneurdisplay.append(buttonvisibilitydisplay);
divconteneurdisplay.append(buttonsavedisplay);
divconteneurdisplay.append(buttoncanceldisplay);
//divconteneurdisplay.append(buttonlockdisplay);
divdisplay.append(divconteneurdisplay);
//creation de la div d'edition
......@@ -228,7 +217,7 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
divedition += "id='" + this.divcartridge + "_edit' ";
divedition += "class='assignfeedback_editpdfplus_verticalline_edition' ";
divedition += "style='display:none;'> ";
divedition += "<input id='" + this.divcartridge + "_editinput' type='text' value=\"" + this.textannot + "\" />";
divedition += "<input id='" + this.divcartridge + "_editinput' type='text' value=\"" + this.get_valref() + "\" />";
divedition += "</div>";
var diveditiondisplay = Y.Node.create(divedition);
divconteneurdisplay.append(diveditiondisplay);
......@@ -249,8 +238,14 @@ Y.extend(ANNOTATIONVERTICALLINE, M.assignfeedback_editpdfplus.annotation, {
diveditiondisplay.append(divpropositiondisplay);
//positionnement de la div par rapport a l'annotation