Gitlab CSE Unil

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

annotation frame

parent 0890c503
define(["jquery","core/notification","core/templates","core/fragment","core/ajax","core/str","assignfeedback_editpdfplus/annotation","assignfeedback_editpdfplus/annotationhighlightplus","assignfeedback_editpdfplus/annotationstampplus","assignfeedback_editpdfplus/annotationframe"],function(a,b,c,d,e,f,g,h,i,j){var k=null,l=null,m=null,n=null,o=function(a,b){this.init(),k=a,n=JSON.parse(b)};o.annotationcurrent=null,o.prototype.selectTool=null,o.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",s),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)},o.prototype.test=function(){alert("test"),s()},o.prototype.initTool=function(){a(this.selectTool).removeClass("btn-default"),a(this.selectTool).addClass("btn-primary")};var p=function(a){for(var b=0;b<n.length;b++)if(n[b].id==a)return n[b]},q=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):3===b?(this.annotationcurrent=new i,this.annotationcurrent.x=60,this.annotationcurrent.y=100):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),this.annotationcurrent){var c=p(b);this.annotationcurrent.tooltype=l,l.color?this.annotationcurrent.colour=l.color:this.annotationcurrent.colour=c.color,this.annotationcurrent.tooltypefamille=c,this.annotationcurrent.id="previsu_annot",this.annotationcurrent.displaylock=1,this.annotationcurrent.adminDemo=1,this.annotationcurrent.draw(a("#canevas"))}};o.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",k,e).done(function(a,b){c.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body",a,b)}.bind(this)).fail(b.exception)},o.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",k,f).done(function(a,b){c.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body",a,b)}.bind(this)).fail(b.exception)},o.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",k,f).done(function(a,b){c.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body",a,b)}.bind(this)).fail(b.exception)};var r=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()},s=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",k,h).done(function(d,f){r(a("#editpdlplus_tool_item"),d,f).done(function(){l=new Object,l.typetool=a("#typetool").val(),l.color=a("#color").val(),l.libelle=a("#libelle").val(),l.catridgecolor=a("#cartridgecolor").val(),l.texts=a("#texts").val(),l.button=a("#button").val(),l.enabled=a("#enabled").val(),l.reply=a("#reply").val(),l.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",s)}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(){m="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",s),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)}}),q()}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)};return o.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",k,h).done(function(d,f){r(a("#editpdlplus_tool_item"),d,f).done(function(){"clone"===m&&(a("#typetool").val(l.typetool),a("#color").val(l.color),a("#libelle").val(l.libelle),a("#cartridgecolor").val(l.catridgecolor),a("#texts").val(l.texts),a("#button").val(l.button),a("#enabled").val(l.enabled),a("#reply").val(l.reply),a("#order").val(l.order),l=null,m=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",s),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)},o});
\ 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"],function(a,b,c,d,e,f,g,h,i,j){var k=null,l=null,m=null,n=null,o=function(a,b){this.init(),k=a,n=JSON.parse(b)};o.annotationcurrent=null,o.prototype.selectTool=null,o.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",s),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)},o.prototype.test=function(){alert("test"),s()},o.prototype.initTool=function(){a(this.selectTool).removeClass("btn-default"),a(this.selectTool).addClass("btn-primary")};var p=function(a){for(var b=0;b<n.length;b++)if(n[b].id==a)return n[b]},q=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}if(this.annotationcurrent){var d=p(b);this.annotationcurrent.tooltype=l,l.color?this.annotationcurrent.colour=l.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=l,l.color?c.colour=l.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")))}};o.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",k,e).done(function(a,b){c.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body",a,b)}.bind(this)).fail(b.exception)},o.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",k,f).done(function(a,b){c.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body",a,b)}.bind(this)).fail(b.exception)},o.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",k,f).done(function(a,b){c.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body",a,b)}.bind(this)).fail(b.exception)};var r=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()},s=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",k,h).done(function(d,f){r(a("#editpdlplus_tool_item"),d,f).done(function(){l=new Object,l.typetool=a("#typetool").val(),l.color=a("#color").val(),l.libelle=a("#libelle").val(),l.catridgecolor=a("#cartridgecolor").val(),l.texts=a("#texts").val(),l.button=a("#button").val(),l.enabled=a("#enabled").val(),l.reply=a("#reply").val(),l.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",s)}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(){m="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",s),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)}}),q()}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)};return o.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",k,h).done(function(d,f){r(a("#editpdlplus_tool_item"),d,f).done(function(){"clone"===m&&(a("#typetool").val(l.typetool),a("#color").val(l.color),a("#libelle").val(l.libelle),a("#cartridgecolor").val(l.catridgecolor),a("#texts").val(l.texts),a("#button").val(l.button),a("#enabled").val(l.enabled),a("#reply").val(l.reply),a("#order").val(l.order),l=null,m=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",s),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)},o});
\ 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("width",this.endx-this.x),a("#"+this.id).css("height",this.endy-this.y),a("#"+this.id).css("border","solid 2px red"),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)}return this.draw_catridge(b),this},c.prototype.draw_catridge=function(b){if(!this.parent_annot_element&&0===this.parent_annot){var c;if(!this.divcartridge||""===this.divcartridge){this.init_div_cartridge_id();var d=a("#"+this.id);d&&d.addClass("class_"+this.divcartridge);var e=this.get_color();c=this.get_div_cartridge(e,b),c.addClass("assignfeedback_editpdfplus_frame"),this.get_div_cartridge_label(e,c,!0);var f=this.get_div_container(e,c),g="<button id='"+this.divcartridge+"_buttonpencil' class='btn btn-default' type='button'>";g+='<i class="fa fa-eyedropper" aria-hidden="true"></i>',g+="</button>";var h="<button id='"+this.divcartridge+"_buttonadd' class='btn btn-default' type='button'>";h+='<i class="fa fa-plus" aria-hidden="true"></i>',h+="</button>",f.append(g),f.append(h),this.get_div_edition(f),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)),c.css("left",this.cartridgex+15),c.css("top",this.y+this.cartridgey),this.apply_visibility_annot()}}return!0},c});
\ 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("width",this.endx-this.x),a("#"+this.id).css("height",this.endy-this.y),a("#"+this.id).css("border","solid 2px red"),a("#"+this.id).css("position","relative"),a("#"+this.id).css("left",this.x),a("#"+this.id).css("top",this.y)}return this.draw_catridge(b),this},c.prototype.draw_catridge=function(b){if(!this.parent_annot_element&&0===this.parent_annot){var c;if(!this.divcartridge||""===this.divcartridge){this.init_div_cartridge_id();var d=a("#"+this.id);d&&d.addClass("class_"+this.divcartridge);var e=this.get_color();c=this.get_div_cartridge(e,b),c.addClass("assignfeedback_editpdfplus_frame"),this.get_div_cartridge_label(e,c,!0);var f=this.get_div_container(e,c),g="<button id='"+this.divcartridge+"_buttonpencil' class='btn btn-default";this.adminDemo&&(g+=" disabled"),g+="' type='button'>",g+='<i class="fa fa-eyedropper" aria-hidden="true"></i>',g+="</button>";var h="<button id='"+this.divcartridge+"_buttonadd' class='btn btn-default";this.adminDemo&&(h+=" disabled"),h+="' type='button'>",h+='<i class="fa fa-plus" aria-hidden="true"></i>',h+="</button>",f.append(g),f.append(h),this.get_div_edition(f),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)),c.css("left",this.cartridgex+15),c.css("top",this.y+this.cartridgey),this.apply_visibility_annot()}}return!0},c});
\ No newline at end of file
......@@ -117,6 +117,11 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
this.annotationcurrent.endx = 435;
this.annotationcurrent.endy = 129;
this.annotationcurrent.parent_annot = 0;
var annotChild = new AnnotationFrame();
annotChild.x = 144;
annotChild.y = 216;
annotChild.endx = 296;
annotChild.endy = 232;
}
if (this.annotationcurrent) {
var typetoolEntity = getTypeTool(typetool);
......@@ -131,6 +136,20 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
this.annotationcurrent.displaylock = 1;
this.annotationcurrent.adminDemo = 1;
this.annotationcurrent.draw($('#canevas'));
if (annotChild) {
annotChild.tooltype = currentTool;
if (currentTool.color) {
annotChild.colour = currentTool.color;
} else {
annotChild.colour = typetoolEntity.color;
}
annotChild.tooltypefamille = typetoolEntity;
annotChild.parent_annot = this.annotationcurrent.id;
annotChild.id = 'previsu_annot_child';
annotChild.displaylock = 1;
annotChild.adminDemo = 1;
annotChild.draw($('#canevas'));
}
}
};
//
......
......@@ -46,7 +46,7 @@ define(['jquery', './annotation'],
$("#" + this.id).css('height', this.endy - this.y);
$("#" + this.id).css('border', 'solid 2px red');
$("#" + this.id).css('position', 'relative');
$("#" + this.id).css('display', 'inline-block');
//$("#" + this.id).css('display', 'inline-block');
$("#" + this.id).css('left', this.x);
$("#" + this.id).css('top', this.y);
}
......@@ -82,14 +82,22 @@ define(['jquery', './annotation'],
//if (!this.editor.get('readonly')) {
var buttonrender = "<button id='"
+ this.divcartridge
+ "_buttonpencil' class='btn btn-default' type='button'>";
+ "_buttonpencil' class='btn btn-default";
if (this.adminDemo) {
buttonrender += " disabled";
}
buttonrender += "' type='button'>";
buttonrender += '<i class="fa fa-eyedropper" aria-hidden="true"></i>';
buttonrender += "</button>";
//var buttonrenderdisplay = Y.Node.create(buttonrender);
//buttonrenderdisplay.on('click', this.display_picker, this);
var buttonadd = "<button id='"
+ this.divcartridge
+ "_buttonadd' class='btn btn-default' type='button'>";
+ "_buttonadd' class='btn btn-default";
if (this.adminDemo) {
buttonadd += " disabled";
}
buttonadd += "' type='button'>";
buttonadd += '<i class="fa fa-plus" aria-hidden="true"></i>';
buttonadd += "</button>";
//var buttonadddisplay = Y.Node.create(buttonadd);
......
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