Gitlab CSE Unil

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

annotation verticalline

parent 15c7df55
This diff is collapsed.
define(["jquery","./annotation"],function(a,b){function c(){return b.call(this),this}return c.prototype=Object.create(b.prototype),c.prototype.draw=function(b){if(b){var c="<div id='"+this.id+"'></div>";b.append(c),a("#"+this.id).css("background-color",this.get_color()),a("#"+this.id).css("width",3),this.endy-this.y<=30&&(this.endy=this.y+30),a("#"+this.id).css("height",this.endy-this.y),a("#"+this.id).css("position","relative"),a("#"+this.id).css("display","inline-block"),a("#"+this.id).css("left",this.x),a("#"+this.id).css("top",this.y)}this.draw_catridge(b)},c.prototype.draw_catridge=function(a){var b;if(!this.divcartridge||""===this.divcartridge){this.init_div_cartridge_id();var c=this.get_color_cartridge();b=this.get_div_cartridge(c,a),b.addClass("assignfeedback_editpdfplus_verticalline"),this.get_div_cartridge_label(c,b);var d=this.get_div_container(c,b);this.get_div_edition(d),this.cartridgex&&0!==this.cartridgex||(this.cartridgex=parseInt(this.tooltypefamille.cartridge_x,10)),this.cartridgey&&0!==this.cartridgey||(this.cartridgey=parseInt(this.tooltypefamille.cartridge_y,10)),b.css("left",this.x+this.cartridgex),b.css("top",this.y+this.cartridgey),this.apply_visibility_annot()}return!0},c});
\ No newline at end of file
......@@ -24,10 +24,10 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
'core/ajax', 'core/str', /*'mod_assign/grading_form_change_checker'*/
'assignfeedback_editpdfplus/annotation', 'assignfeedback_editpdfplus/annotationhighlightplus',
'assignfeedback_editpdfplus/annotationstampplus', 'assignfeedback_editpdfplus/annotationframe',
'assignfeedback_editpdfplus/annotationcommentplus'],
'assignfeedback_editpdfplus/annotationcommentplus', 'assignfeedback_editpdfplus/annotationverticalline'],
function ($/*, Y*/, notification, templates, fragment, ajax, str,
Annotation, AnnotationHighlightplus, AnnotationStampplus, AnnotationFrame,
AnnotationCommentplus /*, checker*/) {
AnnotationCommentplus, AnnotationVerticalline /*, checker*/) {
var contextid = null;
var currentTool = null;
......@@ -124,6 +124,11 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
annotChild.y = 216;
annotChild.endx = 296;
annotChild.endy = 232;
} else if (typetool === 5) {
this.annotationcurrent = new AnnotationVerticalline();
this.annotationcurrent.x = 285;
this.annotationcurrent.y = 65;
this.annotationcurrent.endy = 175;
} else if (typetool === 7) {
this.annotationcurrent = new AnnotationCommentplus();
this.annotationcurrent.x = 30;
......
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/*
* @package assignfeedback_editpdfplus
* @copyright 2017 Université de Lausanne
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/annotationhighlightplus
*/
define(['jquery', './annotation'],
function ($, Annotation) {
// I return an initialized object.
function AnnotationVerticalline() {
// Call the super constructor.
Annotation.call(this);
// Return this object reference.
return(this);
}
// The Friend class extends the base Model class.
AnnotationVerticalline.prototype = Object.create(Annotation.prototype);
/**
* Draw a highlight annotation
* @protected
* @method draw
* @return M.assignfeedback_editpdfplus.drawable
*/
AnnotationVerticalline.prototype.draw = function (canevas) {
if (canevas) {
var divVerticalline = "<div id='" + this.id + "'></div>";
canevas.append(divVerticalline);
$("#" + this.id).css('background-color', this.get_color());
$("#" + this.id).css('width', 3);
if (this.endy - this.y <= 30) {
this.endy = this.y + 30;
}
$("#" + this.id).css('height', this.endy - this.y);
$("#" + this.id).css('position', 'relative');
$("#" + this.id).css('display', 'inline-block');
$("#" + this.id).css('left', this.x);
$("#" + this.id).css('top', this.y);
}
this.draw_catridge(canevas);
return;
};
/**
* Display cartridge and toolbox for the annotation
* @returns {Boolean} res
*/
AnnotationVerticalline.prototype.draw_catridge = function (canevas) {
var divdisplay;
if (!this.divcartridge || this.divcartridge === '') {
this.init_div_cartridge_id();
//init cartridge
var colorcartridge = this.get_color_cartridge();
divdisplay = this.get_div_cartridge(colorcartridge, canevas);
divdisplay.addClass('assignfeedback_editpdfplus_verticalline');
//divdisplay.css('display', 'inline-block');
// inscription entete
/*var divcartridge = */this.get_div_cartridge_label(colorcartridge, divdisplay);
//creation input
var divconteneurdisplay = this.get_div_container(colorcartridge, divdisplay);
//creation de la div d'edition
//if (!this.editor.get('readonly')) {
this.get_div_edition(divconteneurdisplay);
//} else {
//var divvisudisplay = this.get_div_visu(colorcartridge);
//divconteneurdisplay.append(divvisudisplay);
//}
//positionnement de la div par rapport a l'annotation
if (!this.cartridgex || this.cartridgex === 0) {
this.cartridgex = parseInt(this.tooltypefamille.cartridge_x, 10);
}
if (!this.cartridgey || this.cartridgey === 0) {
this.cartridgey = parseInt(this.tooltypefamille.cartridge_y, 10);
}
divdisplay.css('left', this.x + this.cartridgex + 17);
divdisplay.css('top', this.y + this.cartridgey);
this.apply_visibility_annot();
} else {
//divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge);
//divdisplay.setX(offsetcanvas[0] + this.x + this.cartridgex);
//divdisplay.setY(offsetcanvas[1] + this.y + this.cartridgey);
}
return true;
};
return AnnotationVerticalline;
});
\ No newline at end of file
Markdown is supported
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