Gitlab CSE Unil

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

annotation verticalline

parent 15c7df55
define(["jquery","core/notification","core/templates","core/fragment","core/ajax","core/str","assignfeedback_editpdfplus/annotation","assignfeedback_editpdfplus/annotationhighlightplus","assignfeedback_editpdfplus/annotationstampplus","assignfeedback_editpdfplus/annotationframe","assignfeedback_editpdfplus/annotationcommentplus"],function(a,b,c,d,e,f,g,h,i,j,k){var l=null,m=null,n=null,o=null,p=function(a,b){this.init(),l=a,o=JSON.parse(b)};p.annotationcurrent=null,p.prototype.selectTool=null,p.prototype.init=function(){a("#editpdlplus_axes").on("change",function(){a(".toolbar").hide();var b=a("#editpdlplus_axes").val();a("#editpdlplus_toolbar_"+b).show();var c=a("#editpdlplus_axes option:selected").data("delete");c&&parseInt(c)>0?a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").addClass("disabled"):a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").removeClass("disabled")}),a("#editpdlplus_axes").change(),a(".editpdlplus_tool").on("click",t),this.selectTool=a(".editpdlplus_tool").first(),this.initTool(),a("#assignfeedback_editpdfplus_widget_admin_button_addaxis").on("click",this.openDivAddAxis),a("#assignfeedback_editpdfplus_widget_admin_button_editaxis").on("click",this.openDivEditAxis),a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").on("click",this.openDivDelAxis),a("#assignfeedback_editpdfplus_widget_admin_button_addtool").on("click",this.openDivAddTool)},p.prototype.test=function(){alert("test"),t()},p.prototype.initTool=function(){a(this.selectTool).removeClass("btn-default"),a(this.selectTool).addClass("btn-primary")};var q=function(a){for(var b=0;b<o.length;b++)if(o[b].id==a)return o[b]},r=function(){a("#canevas").html(""),this.annotationcurrent=null;var b=parseInt(a("#typetool").val());if(3===b||4===b||7===b?a("#canevas").css("background-image","url("+a("#map01").val()+")"):1===b||6===b?a("#canevas").css("background-image","url("+a("#map02").val()+")"):5===b&&a("#canevas").css("background-image","url("+a("#map03").val()+")"),1===b)this.annotationcurrent=new h,this.annotationcurrent.x=83,this.annotationcurrent.y=84,this.annotationcurrent.endx=239,this.annotationcurrent.endy=100;else if(3===b)this.annotationcurrent=new i,this.annotationcurrent.x=60,this.annotationcurrent.y=100;else if(4===b){this.annotationcurrent=new j,this.annotationcurrent.x=279,this.annotationcurrent.y=113,this.annotationcurrent.endx=435,this.annotationcurrent.endy=129,this.annotationcurrent.parent_annot=0;var c=new j;c.x=144,c.y=216,c.endx=296,c.endy=232}else 7===b&&(this.annotationcurrent=new k,this.annotationcurrent.x=30,this.annotationcurrent.y=90);if(this.annotationcurrent){var d=q(b);this.annotationcurrent.tooltype=m,m.color?this.annotationcurrent.colour=m.color:this.annotationcurrent.colour=d.color,this.annotationcurrent.tooltypefamille=d,this.annotationcurrent.id="previsu_annot",this.annotationcurrent.displaylock=1,this.annotationcurrent.adminDemo=1,this.annotationcurrent.draw(a("#canevas")),c&&(c.tooltype=m,m.color?c.colour=m.color:c.colour=d.color,c.tooltypefamille=d,c.parent_annot=this.annotationcurrent.id,c.id="previsu_annot_child",c.displaylock=1,c.adminDemo=1,c.draw(a("#canevas")))}};p.prototype.openDivAddAxis=function(){a("#axistool").hide(),a("#assignfeedback_editpdfplus_widget_admin_div_addaxis").show(),a("#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body").html("");var e={};d.loadFragment("assignfeedback_editpdfplus","axisadd",l,e).done(function(a,b){c.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body",a,b)}.bind(this)).fail(b.exception)},p.prototype.openDivEditAxis=function(){a("#axistool").hide(),a("#assignfeedback_editpdfplus_widget_admin_div_editaxis").show(),a("#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body").html("");var e=a("#editpdlplus_axes option:selected").val(),f={axeid:e};d.loadFragment("assignfeedback_editpdfplus","axisedit",l,f).done(function(a,b){c.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body",a,b)}.bind(this)).fail(b.exception)},p.prototype.openDivDelAxis=function(){a("#axistool").hide(),a("#assignfeedback_editpdfplus_widget_admin_div_delaxis").show(),a("#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body").html("");var e=a("#editpdlplus_axes option:selected").val(),f={axeid:e};d.loadFragment("assignfeedback_editpdfplus","axisdel",l,f).done(function(a,b){c.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body",a,b)}.bind(this)).fail(b.exception)};var s=function(b,d,e){var f=a.Deferred();return b.fadeOut("fast",function(){c.replaceNodeContents(b,d,e),b.fadeIn("fast",function(){f.resolve()})}),f.promise()},t=function(){var c=f.get_string("admindeltool_messageok","assignfeedback_editpdfplus"),g=a(this).val();a(".editpdlplus_tool").each(function(){a(this).removeClass("btn-primary"),a(this).removeClass("btn-default");var b=a(this).data("enable");1===b&&a(this).val()!==g&&a(this).addClass("btn-default")}),a(this).addClass("btn-primary"),a("#editpdlplus_tool_item").html("");var h={toolid:g};d.loadFragment("assignfeedback_editpdfplus","tooledit",l,h).done(function(d,f){s(a("#editpdlplus_tool_item"),d,f).done(function(){m=new Object,m.typetool=a("#typetool").val(),m.color=a("#color").val(),m.libelle=a("#libelle").val(),m.catridgecolor=a("#cartridgecolor").val(),m.texts=a("#texts").val(),m.button=a("#button").val(),m.enabled=a("#enabled").val(),m.reply=a("#reply").val(),m.order=a("#order").val(),a("#toolFormSubmit").on("click",function(){var c=a("#assignfeedback_editpdfplus_edit_tool"),d=c.serialize();e.call([{methodname:"assignfeedback_editpdfplus_submit_tool_edit_form",args:{jsonformdata:JSON.stringify(d)}}])[0].done(function(b){if(""===b[0].message){a("#message_edit_tool").html("Modifications enregistrées"),a("#message_edit_tool").addClass("alert-success"),a("#message_edit_tool").removeClass("alert-danger"),a("#editpdlplus_toolbar_"+b[0].axeid).html("");for(var c=0;c<b.length;c++){var d="btn-default";1!==b[c].enable&&(d=""),b[c].toolid===b[c].selecttool&&(d="btn-primary");var e="";4!==b[c].typetool&&1!==b[c].typetool||(e="text-decoration: underline;");var f=b[c].button;4!==b[c].typetool&&5!==b[c].typetool||(f="| "+f,4===b[c].typetool&&(f+=" |"));var g="<button class='btn "+d+" editpdlplus_tool' id='editpdlplus_tool_"+b[c].toolid+"' style='"+e+"' value='"+b[c].toolid+"' data-enable='"+b[c].enable+"'>"+f+"</button>";a("#editpdlplus_toolbar_"+b[0].axeid).append(g)}a(".editpdlplus_tool").on("click",t)}else a("#message_edit_tool").html(b[0].message),a("#message_edit_tool").addClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success")}).fail(b.exception)}),a("#toolEnabled").on("click",function(){var b=a("#toolenabled").val();1==b?(a("#toolEnabled > i").addClass("fa-eye-slash"),a("#toolEnabled > i").removeClass("fa-eye"),a("#toolenabled").val(0)):(a("#toolEnabled > i").addClass("fa-eye"),a("#toolEnabled > i").removeClass("fa-eye-slash"),a("#toolenabled").val(1)),a("#toolFormSubmit").click()}),a("#toolClone").on("click",function(){n="clone",a("#assignfeedback_editpdfplus_widget_admin_button_addtool").click()}),a("#toolRemove").on("click",function(){if(!a(this).hasClass("disabled")){var d=a("#assignfeedback_editpdfplus_edit_tool"),f=d.serialize();e.call([{methodname:"assignfeedback_editpdfplus_submit_tool_del_form",args:{jsonformdata:JSON.stringify(f)}}])[0].done(function(b){if(""===b[0].message){a("#message_edit_tool").html(c),a("#message_edit_tool").addClass("alert-success"),a("#message_edit_tool").removeClass("alert-danger"),a("#editpdlplus_toolbar_"+b[0].axeid).html("");for(var d=0;d<b.length;d++){var e="btn-default";1!==b[d].enable&&(e=""),b[d].toolid===b[d].selecttool&&(e="btn-primary");var f="";4!==b[d].typetool&&1!==b[d].typetool||(f="text-decoration: underline;");var g=b[d].button;4!==b[d].typetool&&5!==b[d].typetool||(g="| "+g,4===b[d].typetool&&(g+=" |"));var h="<button class='btn "+e+" editpdlplus_tool' id='editpdlplus_tool_"+b[d].toolid+"' style='"+f+"' value='"+b[d].toolid+"' data-enable='"+b[d].enable+"'>"+g+"</button>";a("#editpdlplus_toolbar_"+b[0].axeid).append(h)}a(".editpdlplus_tool").on("click",t),a("#toolworkspace").html("")}else a("#message_edit_tool").html(b[0].message),a("#message_edit_tool").addClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success")}).fail(b.exception)}}),r()}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)};return p.prototype.openDivAddTool=function(){var c=f.get_string("adminaddtool_messageok","assignfeedback_editpdfplus");a("#editpdlplus_tool_item").html(""),a(".btn-primary").addClass("btn-default"),a(".editpdlplus_tool").removeClass("btn-primary");var g=a("#editpdlplus_axes option:selected").val(),h={axisid:g};d.loadFragment("assignfeedback_editpdfplus","tooladd",l,h).done(function(d,f){s(a("#editpdlplus_tool_item"),d,f).done(function(){"clone"===n&&(a("#typetool").val(m.typetool),a("#color").val(m.color),a("#libelle").val(m.libelle),a("#cartridgecolor").val(m.catridgecolor),a("#texts").val(m.texts),a("#button").val(m.button),a("#enabled").val(m.enabled),a("#reply").val(m.reply),a("#order").val(m.order),m=null,n=null),a("#toolFormSubmit").on("click",function(){var d=a("#assignfeedback_editpdfplus_edit_tool"),f=d.serialize();e.call([{methodname:"assignfeedback_editpdfplus_submit_tool_add_form",args:{jsonformdata:JSON.stringify(f)}}])[0].done(function(b){if(""===b[0].message){a("#message_edit_tool").html(c),a("#message_edit_tool").addClass("alert-success"),a("#message_edit_tool").removeClass("alert-danger"),a("#editpdlplus_toolbar_"+b[0].axeid).html("");for(var d=0;d<b.length;d++){var e="btn-default";1!==b[d].enable&&(e=""),b[d].toolid===b[d].selecttool&&(e="btn-primary");var f="";4!==b[d].typetool&&1!==b[d].typetool||(f="text-decoration: underline;");var g=b[d].button;4!==b[d].typetool&&5!==b[d].typetool||(g="| "+g,4===b[d].typetool&&(g+=" |"));var h="<button class='btn "+e+" editpdlplus_tool' id='editpdlplus_tool_"+b[d].toolid+"' style='"+f+"' value='"+b[d].toolid+"' data-enable='"+b[d].enable+"'>"+g+"</button>";a("#editpdlplus_toolbar_"+b[0].axeid).append(h)}a(".editpdlplus_tool").on("click",t),a("#editpdlplus_tool_item").html("")}else a("#message_edit_tool").html(b[0].message),a("#message_edit_tool").addClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success")}).fail(b.exception)})}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)},p});
\ No newline at end of file
define(["jquery","core/notification","core/templates","core/fragment","core/ajax","core/str","assignfeedback_editpdfplus/annotation","assignfeedback_editpdfplus/annotationhighlightplus","assignfeedback_editpdfplus/annotationstampplus","assignfeedback_editpdfplus/annotationframe","assignfeedback_editpdfplus/annotationcommentplus","assignfeedback_editpdfplus/annotationverticalline"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=null,n=null,o=null,p=null,q=function(a,b){this.init(),m=a,p=JSON.parse(b)};q.annotationcurrent=null,q.prototype.selectTool=null,q.prototype.init=function(){a("#editpdlplus_axes").on("change",function(){a(".toolbar").hide();var b=a("#editpdlplus_axes").val();a("#editpdlplus_toolbar_"+b).show();var c=a("#editpdlplus_axes option:selected").data("delete");c&&parseInt(c)>0?a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").addClass("disabled"):a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").removeClass("disabled")}),a("#editpdlplus_axes").change(),a(".editpdlplus_tool").on("click",u),this.selectTool=a(".editpdlplus_tool").first(),this.initTool(),a("#assignfeedback_editpdfplus_widget_admin_button_addaxis").on("click",this.openDivAddAxis),a("#assignfeedback_editpdfplus_widget_admin_button_editaxis").on("click",this.openDivEditAxis),a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").on("click",this.openDivDelAxis),a("#assignfeedback_editpdfplus_widget_admin_button_addtool").on("click",this.openDivAddTool)},q.prototype.test=function(){alert("test"),u()},q.prototype.initTool=function(){a(this.selectTool).removeClass("btn-default"),a(this.selectTool).addClass("btn-primary")};var r=function(a){for(var b=0;b<p.length;b++)if(p[b].id==a)return p[b]},s=function(){a("#canevas").html(""),this.annotationcurrent=null;var b=parseInt(a("#typetool").val());if(3===b||4===b||7===b?a("#canevas").css("background-image","url("+a("#map01").val()+")"):1===b||6===b?a("#canevas").css("background-image","url("+a("#map02").val()+")"):5===b&&a("#canevas").css("background-image","url("+a("#map03").val()+")"),1===b)this.annotationcurrent=new h,this.annotationcurrent.x=83,this.annotationcurrent.y=84,this.annotationcurrent.endx=239,this.annotationcurrent.endy=100;else if(3===b)this.annotationcurrent=new i,this.annotationcurrent.x=60,this.annotationcurrent.y=100;else if(4===b){this.annotationcurrent=new j,this.annotationcurrent.x=279,this.annotationcurrent.y=113,this.annotationcurrent.endx=435,this.annotationcurrent.endy=129,this.annotationcurrent.parent_annot=0;var c=new j;c.x=144,c.y=216,c.endx=296,c.endy=232}else 5===b?(this.annotationcurrent=new l,this.annotationcurrent.x=285,this.annotationcurrent.y=65,this.annotationcurrent.endy=175):7===b&&(this.annotationcurrent=new k,this.annotationcurrent.x=30,this.annotationcurrent.y=90);if(this.annotationcurrent){var d=r(b);this.annotationcurrent.tooltype=n,n.color?this.annotationcurrent.colour=n.color:this.annotationcurrent.colour=d.color,this.annotationcurrent.tooltypefamille=d,this.annotationcurrent.id="previsu_annot",this.annotationcurrent.displaylock=1,this.annotationcurrent.adminDemo=1,this.annotationcurrent.draw(a("#canevas")),c&&(c.tooltype=n,n.color?c.colour=n.color:c.colour=d.color,c.tooltypefamille=d,c.parent_annot=this.annotationcurrent.id,c.id="previsu_annot_child",c.displaylock=1,c.adminDemo=1,c.draw(a("#canevas")))}};q.prototype.openDivAddAxis=function(){a("#axistool").hide(),a("#assignfeedback_editpdfplus_widget_admin_div_addaxis").show(),a("#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body").html("");var e={};d.loadFragment("assignfeedback_editpdfplus","axisadd",m,e).done(function(a,b){c.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body",a,b)}.bind(this)).fail(b.exception)},q.prototype.openDivEditAxis=function(){a("#axistool").hide(),a("#assignfeedback_editpdfplus_widget_admin_div_editaxis").show(),a("#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body").html("");var e=a("#editpdlplus_axes option:selected").val(),f={axeid:e};d.loadFragment("assignfeedback_editpdfplus","axisedit",m,f).done(function(a,b){c.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body",a,b)}.bind(this)).fail(b.exception)},q.prototype.openDivDelAxis=function(){a("#axistool").hide(),a("#assignfeedback_editpdfplus_widget_admin_div_delaxis").show(),a("#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body").html("");var e=a("#editpdlplus_axes option:selected").val(),f={axeid:e};d.loadFragment("assignfeedback_editpdfplus","axisdel",m,f).done(function(a,b){c.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body",a,b)}.bind(this)).fail(b.exception)};var t=function(b,d,e){var f=a.Deferred();return b.fadeOut("fast",function(){c.replaceNodeContents(b,d,e),b.fadeIn("fast",function(){f.resolve()})}),f.promise()},u=function(){var c=f.get_string("admindeltool_messageok","assignfeedback_editpdfplus"),g=a(this).val();a(".editpdlplus_tool").each(function(){a(this).removeClass("btn-primary"),a(this).removeClass("btn-default");var b=a(this).data("enable");1===b&&a(this).val()!==g&&a(this).addClass("btn-default")}),a(this).addClass("btn-primary"),a("#editpdlplus_tool_item").html("");var h={toolid:g};d.loadFragment("assignfeedback_editpdfplus","tooledit",m,h).done(function(d,f){t(a("#editpdlplus_tool_item"),d,f).done(function(){n=new Object,n.typetool=a("#typetool").val(),n.color=a("#color").val(),n.libelle=a("#libelle").val(),n.catridgecolor=a("#cartridgecolor").val(),n.texts=a("#texts").val(),n.button=a("#button").val(),n.enabled=a("#enabled").val(),n.reply=a("#reply").val(),n.order=a("#order").val(),a("#toolFormSubmit").on("click",function(){var c=a("#assignfeedback_editpdfplus_edit_tool"),d=c.serialize();e.call([{methodname:"assignfeedback_editpdfplus_submit_tool_edit_form",args:{jsonformdata:JSON.stringify(d)}}])[0].done(function(b){if(""===b[0].message){a("#message_edit_tool").html("Modifications enregistrées"),a("#message_edit_tool").addClass("alert-success"),a("#message_edit_tool").removeClass("alert-danger"),a("#editpdlplus_toolbar_"+b[0].axeid).html("");for(var c=0;c<b.length;c++){var d="btn-default";1!==b[c].enable&&(d=""),b[c].toolid===b[c].selecttool&&(d="btn-primary");var e="";4!==b[c].typetool&&1!==b[c].typetool||(e="text-decoration: underline;");var f=b[c].button;4!==b[c].typetool&&5!==b[c].typetool||(f="| "+f,4===b[c].typetool&&(f+=" |"));var g="<button class='btn "+d+" editpdlplus_tool' id='editpdlplus_tool_"+b[c].toolid+"' style='"+e+"' value='"+b[c].toolid+"' data-enable='"+b[c].enable+"'>"+f+"</button>";a("#editpdlplus_toolbar_"+b[0].axeid).append(g)}a(".editpdlplus_tool").on("click",u)}else a("#message_edit_tool").html(b[0].message),a("#message_edit_tool").addClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success")}).fail(b.exception)}),a("#toolEnabled").on("click",function(){var b=a("#toolenabled").val();1==b?(a("#toolEnabled > i").addClass("fa-eye-slash"),a("#toolEnabled > i").removeClass("fa-eye"),a("#toolenabled").val(0)):(a("#toolEnabled > i").addClass("fa-eye"),a("#toolEnabled > i").removeClass("fa-eye-slash"),a("#toolenabled").val(1)),a("#toolFormSubmit").click()}),a("#toolClone").on("click",function(){o="clone",a("#assignfeedback_editpdfplus_widget_admin_button_addtool").click()}),a("#toolRemove").on("click",function(){if(!a(this).hasClass("disabled")){var d=a("#assignfeedback_editpdfplus_edit_tool"),f=d.serialize();e.call([{methodname:"assignfeedback_editpdfplus_submit_tool_del_form",args:{jsonformdata:JSON.stringify(f)}}])[0].done(function(b){if(""===b[0].message){a("#message_edit_tool").html(c),a("#message_edit_tool").addClass("alert-success"),a("#message_edit_tool").removeClass("alert-danger"),a("#editpdlplus_toolbar_"+b[0].axeid).html("");for(var d=0;d<b.length;d++){var e="btn-default";1!==b[d].enable&&(e=""),b[d].toolid===b[d].selecttool&&(e="btn-primary");var f="";4!==b[d].typetool&&1!==b[d].typetool||(f="text-decoration: underline;");var g=b[d].button;4!==b[d].typetool&&5!==b[d].typetool||(g="| "+g,4===b[d].typetool&&(g+=" |"));var h="<button class='btn "+e+" editpdlplus_tool' id='editpdlplus_tool_"+b[d].toolid+"' style='"+f+"' value='"+b[d].toolid+"' data-enable='"+b[d].enable+"'>"+g+"</button>";a("#editpdlplus_toolbar_"+b[0].axeid).append(h)}a(".editpdlplus_tool").on("click",u),a("#toolworkspace").html("")}else a("#message_edit_tool").html(b[0].message),a("#message_edit_tool").addClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success")}).fail(b.exception)}}),s()}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)};return q.prototype.openDivAddTool=function(){var c=f.get_string("adminaddtool_messageok","assignfeedback_editpdfplus");a("#editpdlplus_tool_item").html(""),a(".btn-primary").addClass("btn-default"),a(".editpdlplus_tool").removeClass("btn-primary");var g=a("#editpdlplus_axes option:selected").val(),h={axisid:g};d.loadFragment("assignfeedback_editpdfplus","tooladd",m,h).done(function(d,f){t(a("#editpdlplus_tool_item"),d,f).done(function(){"clone"===o&&(a("#typetool").val(n.typetool),a("#color").val(n.color),a("#libelle").val(n.libelle),a("#cartridgecolor").val(n.catridgecolor),a("#texts").val(n.texts),a("#button").val(n.button),a("#enabled").val(n.enabled),a("#reply").val(n.reply),a("#order").val(n.order),n=null,o=null),a("#toolFormSubmit").on("click",function(){var d=a("#assignfeedback_editpdfplus_edit_tool"),f=d.serialize();e.call([{methodname:"assignfeedback_editpdfplus_submit_tool_add_form",args:{jsonformdata:JSON.stringify(f)}}])[0].done(function(b){if(""===b[0].message){a("#message_edit_tool").html(c),a("#message_edit_tool").addClass("alert-success"),a("#message_edit_tool").removeClass("alert-danger"),a("#editpdlplus_toolbar_"+b[0].axeid).html("");for(var d=0;d<b.length;d++){var e="btn-default";1!==b[d].enable&&(e=""),b[d].toolid===b[d].selecttool&&(e="btn-primary");var f="";4!==b[d].typetool&&1!==b[d].typetool||(f="text-decoration: underline;");var g=b[d].button;4!==b[d].typetool&&5!==b[d].typetool||(g="| "+g,4===b[d].typetool&&(g+=" |"));var h="<button class='btn "+e+" editpdlplus_tool' id='editpdlplus_tool_"+b[d].toolid+"' style='"+f+"' value='"+b[d].toolid+"' data-enable='"+b[d].enable+"'>"+g+"</button>";a("#editpdlplus_toolbar_"+b[0].axeid).append(h)}a(".editpdlplus_tool").on("click",u),a("#editpdlplus_tool_item").html("")}else a("#message_edit_tool").html(b[0].message),a("#message_edit_tool").addClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success")}).fail(b.exception)})}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)},q});
\ No newline at end of file
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