Gitlab CSE Unil

Commit b15b9750 authored by Julien Furrer's avatar Julien Furrer
Browse files

Built apps

parent 204f7a1d
......@@ -138,7 +138,7 @@ define('tools/rectangle',["paper","tools/Shape.class"],function(a,b){var c="rect
/*! AdIm - v0.0.0 - 2014-09-29 - Copyright (C) 2014 Université de Lausanne - see licence */
define('tools/text',["paper","jquery"],function(a,b){function c(a){a.oGetSelected=function(){return this.children[1].selected},a.oSetSelected=function(a){this.children[1].selected=a}}function d(c){j&&e(!1),j=!0,l||(l=b("<input>",{type:"text","class":"text-tool-input",placeholder:"Votre texte",maxlength:128,size:128,style:"display:none;position:absolute;top:0;left:0;padding:10px;border:0;border-radius:5px;background:rgba(255,255,255,0.75);"}).appendTo(a.project.view.element.parentNode).on("blur",function(){j&&e()}).on("keydown",function(a){(27===a.which||13==a.which)&&e()}).autoGrowInput(),m=m||b("<div>").css({zIndex:999,position:"fixed",display:"none",top:"-10px",left:"-10px",width:"5000px",height:"5000px"}).click(function(){e()}),l.before(m)),c.selected=!1,c.visible=!1;var d=c.children[1].point;d=d.subtract(a.view.bounds.point).multiply(a.view.zoom);var f=c.fontSize*a.view.zoom;l.val(c.data.content).css({fontSize:f+"px",fontFamily:c.font,color:c.data.color,top:d.y-f+1-10,left:d.x-1-10,zIndex:1e3}).show(),m.show();var g=l.nextAll("tester");g.css({fontSize:l.css("fontSize"),fontFamily:l.css("fontFamily"),fontWeight:l.css("fontWeight"),letterSpacing:l.css("letterSpacing")}),g.text(""===c.data.content?l.attr("placeholder"):c.data.content),l.width(g.width()+30),k=c,setTimeout(function(){l.focus()},100)}function e(b){if(b=!(b===!1),j=!1,k){var d=l.val();if(d&&""!==d){var e=""===k.data.content;k.data.content=d,k.children[0].content=d,k.children[1].content=d,k.visible=!0,b&&n.annotationSelected&&"function"==typeof n.annotationSelected.dispatch&&n.annotationSelected.dispatch(k),e?(c(k),n.annotationAdded&&"function"==typeof n.annotationAdded.dispatch&&n.annotationAdded.dispatch(k)):n.annotationChanged&&"function"==typeof n.annotationChanged.dispatch&&n.annotationChanged.dispatch(k),k.oSetSelected(b),a.project.view.draw()}else k.remove(),k=null}m.hide(),l.val("").blur().hide()}function f(a){var b=this,c=b.children[1].fillColor!==a;return b.children[1].fillColor=a,b.data.color=a,c}function g(a){var b=this,c=a/6;3>c&&(c=3),b.children[0].fontSize=a,b.children[0].strokeWidth=c,b.children[1].fontSize=a}function h(a,e,h){var i=e.importJSON(a);return b.extend(i.data,{setColor:f,setFill:p,setStrokeWidth:p,setFontSize:g}),c(i),h&&i.children[1].on("doubleclick",function(){d(this.parent)}),i}var i="text",j=!1,k=null,l=null,m=null,n={annotationAdded:null,annotationChanged:null,annotationSelected:null},o={type:"point-text",tolerance:5,fill:!0},p=function(){},q={onMouseDown:function(b){var c=a.project.activeLayer.hitTest(b.point,o);if(c){var h=c.item.parent;d(h)}else{var l=a.project.currentStyle.fontSize;if(j)e();else{a.project.deselectAll();var m=b.point,n=new a.PointText({point:m,fillColor:"white",strokeColor:"white",strokeWidth:l/6,strokeJoin:"round",shadowColor:"black",shadowBlur:10,shadowOffset:new a.Point([5,3]),content:""}),q=a.project.currentStyle.strokeColor||a.project.currentStyle.fillColor;q=q.toCSS();var r=new a.PointText({point:m,fillColor:q,strokeColor:q,strokeWidth:0,content:""});r.on("doubleclick",function(){d(this.parent)}),k=new a.Group({children:[n,r],fontSize:l,data:{type:i,setColor:f,setFill:p,setStrokeWidth:p,setFontSize:g,content:"",color:q}}),k.data.tId="a"+k._id,k.data.content="",d(k)}}}};return{name:i,tool:new a.Tool(q),importJSON:h,registerEvent:function(a,b){n[a]=b}}});
/*! AdIm - v0.0.0 - 2014-09-29 - Copyright (C) 2014 Université de Lausanne - see licence */
define('tools/arrow',["paper"],function(a){function b(a){var b=(this.data.from,this.data.to,this.exportJSON({asString:!1}));try{b[1][1].data.from=[this.data.from.x,this.data.from.y],b[1][1].data.to=[this.data.to.x,this.data.to.y]}catch(c){console.error(c)}return a&&a.asString?JSON.stringify(b):b}function c(b,c,d){var e=b[1][1],f=b[0][1][e.symbol][1][1],h=f.fillColor&&(f.fillColor.length<3||0!==f.fillColor[3]),i=parseFloat(e.opacity)||1,k=a.project.activeLayer;c.activate(),e.data.from.length>2&&(e.data.from=e.data.from.splice(1)),e.data.to.length>2&&(e.data.to=e.data.to.splice(1));var m=g({from:new a.Point(e.data.from),prop:e.data.prop,scale:e.data.scale||{h:1,v:1}},d);return m.opacity=i,j.call(m,f.strokeColor),l.call(m,h),n.call(m,f.strokeWidth),u(m,{from:m.data.from,to:new a.Point(e.data.to)}),k.activate(),m}function d(){if(!x){var b=new a.Path({segments:[[0,-10],[0,10],new a.Segment([20,5]),[10,30],new a.Segment([50,0]),[10,-30],new a.Segment([20,-5])],strokeJoin:"round",strokeScaling:!1,closed:!0});x=new a.Symbol(b),b.remove()}}function e(a,b){b=b||this;var c=b.symbol.definition.segments[2].point.x,d=b.symbol.definition.segments[4].point.x,e=b.globalToLocal(a).x;return(e-c)/(d-c)>.3}function f(a,b){b=b||this,a=a||b.symbol.definition.segments[4].point.x-b.symbol.definition.segments[1].point.x;var c=b.symbol.definition.segments[4].point.x-b.symbol.definition.segments[3].point.x;return 10>a-c}function g(b,c){var e,f,g,h,v;d(),e=new a.PlacedSymbol(x.clone()),f=e.symbol.definition.bounds.width,g=new a.Point(b.from),h=new a.Point([g.x+f,g.y]),v=b.scale||{h:1,v:1},e.pivot=[-f/2,0],u(e,{from:g,to:h}),i.call(e,v),l.call(e,a.project.currentStyle.fillColor),b.prop="object"==typeof b.prop?b.prop:{};for(var w in A)b.prop.hasOwnProperty(w)||(b.prop[w]=A[w]);return e.data={tId:"a"+e._id,type:y,prop:b.prop,from:g,to:h,scale:v,setColor:j,getColor:k,setFill:l,getFill:m,setStrokeWidth:n,getStrokeWidth:o,setDragMode:p,itemMouseDrag:r},c!==!1&&(e.onMouseDown=q,e.onMouseUp=s,e.onPropertyChange=t),e}function h(){this.data.from=this.position,this.data.to=this.data.from.add(new a.Point({length:this.symbol.definition.bounds.width,angle:this.rotation}))}function i(a){var b=x.definition.bounds.width;this.symbol.definition.scale(a.h,a.v,[-b/2,0]),this.data.scale||(this.data.scale={h:1,v:1}),this.data.scale.h*=a.h,this.data.scale.v*=a.v,h.call(this)}function j(a){this.symbol.definition.strokeColor=a,this.symbol.definition.fillColor.alpha>0&&(this.symbol.definition.fillColor=a)}function k(){return this.symbol.definition.strokeColor}function l(a){this.symbol.definition.fillColor=a?this.symbol.definition.strokeColor:B}function m(){return this.symbol.definition.fillColor.alpha>0}function n(a){this.symbol.definition.strokeWidth=a}function o(){return this.symbol.definition.strokeWidth}function p(a,b){!a in C?(D=null,E={},F=!1):(D=C[a],E=b)}function q(a){if(this.selected){D=C.FULL_DRAG;var b=this.data.to,c=this.data.from;e.call(this,a.point)?p("DRAG_TO",{delta:b.subtract(a.point)}):c.getDistance(a.point)<30&&p("DRAG_FROM",{delta:c.subtract(a.point)}),this.attach("mousedrag",r)}}function r(a){F=!0;var b={from:this.data.from,to:this.data.to};switch(D){case C.FULL_DRAG:this.translate(a.delta),h.call(this);break;case C.DRAG_TO:b.to=E.delta?a.point.add(E.delta):a.point,delete b.from,u(this,b);break;case C.DRAG_FROM:b.from=E.delta?a.point.add(E.delta):a.point,delete b.to,u(this,b);break;case C.DRAG_HANDLE:if("right"!==E.nameParts[1])F=!1;else{var c=a.point.subtract(b.from).project(b.to.subtract(b.from)),d=c.length/this.symbol.definition.bounds.width,e=a.point.subtract(c.add(b.from)).length/this.symbol.definition.bounds.height*2;i.call(this,{h:d,v:e})}break;default:F=!1}}function s(){this.detach("mousedrag",r),h.call(this),D=null,F&&z.annotationChanged.dispatch(this),F=!1}function t(){}function u(b,c){var d,e,g,h,i="";if(c.from||(c.from=b.data.from,i="to"),c.to||(c.to=b.data.to,i="from"),d=c.to.subtract(c.from),e=d.angle,g=b.symbol.definition.bounds.width,h=d.length-g,f.call(b,g+h)&&(h=0,"from"===i&&(c.from=c.to.subtract(new a.Point({length:g,angle:e})))),b.rotation=e,b.position=c.from,0!==h)for(var j,k=2;j=b.symbol.definition.segments[k];k++)j.point.x+=h;b.data.from=c.from,b.data.to=c.to}function v(a){return a.data&&a.data.type===y?a:a.parent?v(a.parent):null}function w(b){var c,d;if(c=a.project.activeLayer.hitTest(b,{tolerance:7,fill:!0,stroke:!0,segments:!0,handles:!0,ends:!0,bounds:!0,selected:!0}),c||(c=a.project.activeLayer.hitTest(b,{fill:!0,stroke:!0})),!c||!c.item)return!1;if(d=v(c.item),!d)return!1;if(d.selected=!0,"bounds"===c.type){var e=c.name.split("-");"right"===e[1]&&p("DRAG_HANDLE",{nameStr:c.name,nameParts:c.name.split("-"),item:d})}return!0}var x,y="arrow",z={annotationAdded:null,annotationSelected:null,annotationChanged:null},A={comment:"",fill:!0},B=new a.Color([0,0,0,0]),C={FULL_DRAG:1,DRAG_TO:2,DRAG_FROM:3,DRAG_HANDLE:4},D=null,E={},F=!1,G=!1,H=null,I=null,J={onMouseDown:function(b){G=!1,I=null,w(b.point)||(a.project.deselectAll(),z.annotationSelected.dispatch(null),G=!0,H=b.point,I=g({from:H},!0),I.visible=!1)},onMouseDrag:function(a){G&&I?(u(I,{from:H,to:a.point}),I.visible=!0):D===C.DRAG_HANDLE&&E.item&&r.call(E.item,a)},onMouseUp:function(){p(null),G&&I&&(z.annotationAdded.dispatch(I),G=!1,I.selected=!0,I.visible=!0,I=null)}};return{name:y,tool:new a.Tool(J),registerEvent:function(a,b){z[a]=b},exportJSON:b,importJSON:c,listeners:{}}});
define('tools/arrow',["paper"],function(a){function b(a){var b=(this.data.from,this.data.to,this.exportJSON({asString:!1}));try{b[1][1].data.from=[this.data.from.x,this.data.from.y],b[1][1].data.to=[this.data.to.x,this.data.to.y]}catch(c){console.error(c)}return a&&a.asString?JSON.stringify(b):b}function c(b,c,d){var e=b[1][1],f=b[0][1][e.symbol][1][1],h=f.fillColor&&(f.fillColor.length<3||0!==f.fillColor[3]),i=parseFloat(e.opacity)||1,k=a.project.activeLayer;c.activate(),e.data.from.length>2&&(e.data.from=e.data.from.splice(1)),e.data.to.length>2&&(e.data.to=e.data.to.splice(1));var m=g({from:new a.Point(e.data.from),prop:e.data.prop,scale:e.data.scale||{h:1,v:1}},d);return m.opacity=i,j.call(m,f.strokeColor),l.call(m,h),n.call(m,f.strokeWidth),u(m,{from:m.data.from,to:new a.Point(e.data.to)}),k.activate(),m}function d(){if(!x){var b=new a.Path({segments:[[0,-10],[0,10],new a.Segment([20,5]),[10,30],new a.Segment([50,0]),[10,-30],new a.Segment([20,-5])],strokeJoin:"round",strokeScaling:!1,closed:!0});x=new a.Symbol(b),b.remove()}}function e(a,b){b=b||this;var c=b.symbol.definition.segments[2].point.x,d=b.symbol.definition.segments[4].point.x,e=b.globalToLocal(a).x;return(e-c)/(d-c)>.3}function f(a,b){b=b||this,a=a||b.symbol.definition.segments[4].point.x-b.symbol.definition.segments[1].point.x;var c=b.symbol.definition.segments[4].point.x-b.symbol.definition.segments[3].point.x;return 10>a-c}function g(b,c){var e,f,g,h,v;d(),e=new a.PlacedSymbol(x.clone()),f=e.symbol.definition.bounds.width,g=new a.Point(b.from),h=new a.Point([g.x+f,g.y]),v=b.scale||{h:1,v:1},e.pivot=[-f/2,0],u(e,{from:g,to:h}),i.call(e,v),l.call(e,a.project.currentStyle.fillColor),j.call(e,a.project.currentStyle.strokeColor),b.prop="object"==typeof b.prop?b.prop:{};for(var w in A)b.prop.hasOwnProperty(w)||(b.prop[w]=A[w]);return e.data={tId:"a"+e._id,type:y,prop:b.prop,from:g,to:h,scale:v,setColor:j,getColor:k,setFill:l,getFill:m,setStrokeWidth:n,getStrokeWidth:o,setDragMode:p,itemMouseDrag:r},c!==!1&&(e.onMouseDown=q,e.onMouseUp=s,e.onPropertyChange=t),e}function h(){this.data.from=this.position,this.data.to=this.data.from.add(new a.Point({length:this.symbol.definition.bounds.width,angle:this.rotation}))}function i(a){var b=x.definition.bounds.width;this.symbol.definition.scale(a.h,a.v,[-b/2,0]),this.data.scale||(this.data.scale={h:1,v:1}),this.data.scale.h*=a.h,this.data.scale.v*=a.v,h.call(this)}function j(a){this.symbol.definition.strokeColor=a,this.symbol.definition.fillColor.alpha>0&&(this.symbol.definition.fillColor=a)}function k(){return this.symbol.definition.strokeColor}function l(a){this.symbol.definition.fillColor=a?this.symbol.definition.strokeColor:B}function m(){return this.symbol.definition.fillColor.alpha>0}function n(a){this.symbol.definition.strokeWidth=a}function o(){return this.symbol.definition.strokeWidth}function p(a,b){!a in C?(D=null,E={},F=!1):(D=C[a],E=b)}function q(a){if(this.selected){D=C.FULL_DRAG;var b=this.data.to,c=this.data.from;e.call(this,a.point)?p("DRAG_TO",{delta:b.subtract(a.point)}):c.getDistance(a.point)<30&&p("DRAG_FROM",{delta:c.subtract(a.point)}),this.attach("mousedrag",r)}}function r(a){F=!0;var b={from:this.data.from,to:this.data.to};switch(D){case C.FULL_DRAG:this.translate(a.delta),h.call(this);break;case C.DRAG_TO:b.to=E.delta?a.point.add(E.delta):a.point,delete b.from,u(this,b);break;case C.DRAG_FROM:b.from=E.delta?a.point.add(E.delta):a.point,delete b.to,u(this,b);break;case C.DRAG_HANDLE:if("right"!==E.nameParts[1])F=!1;else{var c=a.point.subtract(b.from).project(b.to.subtract(b.from)),d=c.length/this.symbol.definition.bounds.width,e=a.point.subtract(c.add(b.from)).length/this.symbol.definition.bounds.height*2;i.call(this,{h:d,v:e})}break;default:F=!1}}function s(){this.detach("mousedrag",r),h.call(this),D=null,F&&z.annotationChanged.dispatch(this),F=!1}function t(){}function u(b,c){var d,e,g,h,i="";if(c.from||(c.from=b.data.from,i="to"),c.to||(c.to=b.data.to,i="from"),d=c.to.subtract(c.from),e=d.angle,g=b.symbol.definition.bounds.width,h=d.length-g,f.call(b,g+h)&&(h=0,"from"===i&&(c.from=c.to.subtract(new a.Point({length:g,angle:e})))),b.rotation=e,b.position=c.from,0!==h)for(var j,k=2;j=b.symbol.definition.segments[k];k++)j.point.x+=h;b.data.from=c.from,b.data.to=c.to}function v(a){return a.data&&a.data.type===y?a:a.parent?v(a.parent):null}function w(b){var c,d;if(c=a.project.activeLayer.hitTest(b,{tolerance:7,fill:!0,stroke:!0,segments:!0,handles:!0,ends:!0,bounds:!0,selected:!0}),c||(c=a.project.activeLayer.hitTest(b,{fill:!0,stroke:!0})),!c||!c.item)return!1;if(d=v(c.item),!d)return!1;if(d.selected=!0,"bounds"===c.type){var e=c.name.split("-");"right"===e[1]&&p("DRAG_HANDLE",{nameStr:c.name,nameParts:c.name.split("-"),item:d})}return!0}var x,y="arrow",z={annotationAdded:null,annotationSelected:null,annotationChanged:null},A={comment:"",fill:!0},B=new a.Color([0,0,0,0]),C={FULL_DRAG:1,DRAG_TO:2,DRAG_FROM:3,DRAG_HANDLE:4},D=null,E={},F=!1,G=!1,H=null,I=null,J={onMouseDown:function(b){G=!1,I=null,w(b.point)||(a.project.deselectAll(),z.annotationSelected.dispatch(null),G=!0,H=b.point,I=g({from:H},!0),I.visible=!1)},onMouseDrag:function(a){G&&I?(u(I,{from:H,to:a.point}),I.visible=!0):D===C.DRAG_HANDLE&&E.item&&r.call(E.item,a)},onMouseUp:function(){p(null),G&&I&&(z.annotationAdded.dispatch(I),G=!1,I.selected=!0,I.visible=!0,I=null)}};return{name:y,tool:new a.Tool(J),registerEvent:function(a,b){z[a]=b},exportJSON:b,importJSON:c,listeners:{}}});
/*! AdIm - v0.0.0 - 2014-09-29 - Copyright (C) 2014 Université de Lausanne - see licence */
define('tools/arrow1',["paper"],function(a){function b(a){var b=this.segments[7].point,c=this.segments[3].point;this.data.from=[b.x,b.y],this.data.to=[c.x,c.y];var d=this.exportJSON({asString:!1});return delete d[1].fontFamily,delete d[1].font,delete d[1].fontSize,delete d[1].leading,a&&a.asString?JSON.stringify(d):d}function c(b,c,e){var f=b[1],g=a.project.activeLayer;c.activate();var h=d({from:new a.Point(f.data.from),to:f.data.to,arrow:f.data.arrow,prop:f.data.prop},e);return h.setStyle({strokeColor:f.strokeColor,strokeWidth:f.strokeWidth,fillColor:f.fillColor}),g.activate(),h}function d(b,c){var d=new a.Path({strokeJoin:"round"});b.arrow=b.arrow||q,j(d,{from:b.from,to:b.to,arrow:b.arrow}),b.prop="object"==typeof b.prop?b.prop:{};for(var f in o)b.prop.hasOwnProperty(f)||(b.prop[f]=o[f]);return d.data={tId:"a"+d._id,type:m,prop:b.prop,from:[b.from.x,b.from.y],to:[b.to.x,b.to.y],arrow:b.arrow},b.prop.confidence&&(d.style=p[b.prop.confidence]),c!==!1&&(d.onMouseDown=e,d.onMouseUp=g,d.onPropertyChange=h),n.annotationAdded.dispatch(d),d}function e(a){if(this.selected){s=r.FULL_DRAG;var b=this.segments[3].point,c=this.segments[7].point,d=this.segments[2].point,e=this.segments[4].point,g=this.segments[1].point,h=this.segments[5].point;t=null,a.modifiers.option||a.modifiers.control||a.modifiers.command?d.getDistance(a.point)<10||e.getDistance(a.point)<10?s=r.AR_WIDTH:(g.getDistance(a.point)<10||h.getDistance(a.point)<10)&&(s=r.STRK_WIDTH):d.getDistance(a.point)<10||e.getDistance(a.point)<10?s=r.AR_WIDTH:g.getDistance(a.point)<10||h.getDistance(a.point)<10?s=r.STRK_WIDTH:b.getDistance(a.point)<this.data.arrow.h-20?(s=r.DRAG_TO,t=b.subtract(a.point)):c.getDistance(a.point)<30&&(s=r.DRAG_FROM,t=c.subtract(a.point)),this.attach("mousedrag",f)}}function f(a){function b(a,b){var c=b.to.subtract(a).angle,d=b.to.subtract(b.from).angle,e=(c-d)/360*2*Math.PI,f=a.getDistance(b.to);return{l:Math.sin(e)*f,h:Math.cos(e)*f}}u=!0;var c={from:this.segments[7].point,to:this.segments[3].point,arrow:this.data.arrow};switch(s){case r.FULL_DRAG:this.translate(a.delta);break;case r.DRAG_TO:c.to=t?a.point.add(t):a.point,j(this,c);break;case r.DRAG_FROM:c.from=t?a.point.add(t):a.point,j(this,c);break;case r.AR_WIDTH:var d=b(a.point,c);d.l>c.arrow.l1&&(c.arrow.l2=d.l),d.h>5&&(c.arrow.h=d.h),j(this,c);break;case r.STRK_WIDTH:var d=b(a.point,c);d.l>2&&d.l<c.arrow.l2&&(c.arrow.l1=d.l),d.h>5&&(c.arrow.h=d.h),j(this,c);break;default:u=!1}}function g(){this.detach("mousedrag",f),s=null,u&&n.annotationChanged.dispatch(this),u=!1}function h(b,c){"confidence"===b&&(this.style=p[c],a.view.draw())}function i(b,c){var d={v0:new a.Point(b.l1,0),v2:new a.Point(b.l2-b.l1,0),v3:new a.Point(-b.l2,b.h),v4:new a.Point(-b.l2,-b.h),v5:new a.Point(b.l2-b.l1,0)};if(void 0!==c){var e=c-b.h;d.v1=new a.Point(0,e>0?e:0)}return d}function j(a,b){var c=b.arrow||q,d=b.from.getDistance(b.to),e=i(c,d);a.removeSegments(),a.pivot=b.from,a.rotation=0,a.add(b.from.add(e.v0)),a.lineBy(e.v1),a.lineBy(e.v2),a.lineBy(e.v3),a.lineBy(e.v4),a.lineBy(e.v5),a.lineBy(0,-e.v1.y),a.lineBy(e.v0),a.closed=!0,a.rotation=b.from.subtract(b.to).angle+90}function k(a){return a.data&&a.data.type===m?a:a.parent?k(a.parent):null}function l(b){var c=a.project.activeLayer.hitTest(b,{fill:!0,stroke:!0});return c&&c.item?k(c.item):!1}var m="arrow1",n={annotationAdded:null,annotationSelected:null,annotationChanged:null},o={comment:"",confidence:3,fill:!0},p={1:{dashArray:[10,10]},2:{dashArray:[30,10]},3:{dashArray:null}},q={l1:10,l2:30,h:40},r={FULL_DRAG:0,DRAG_TO:1,DRAG_FROM:2,AR_WIDTH:3,STRK_WIDTH:4},s="",t=null,u=!1,v=!1,w=null,x=null,y={onMouseDown:function(b){var c;v=!1,x=null,a.project.deselectAll(),n.annotationSelected.dispatch(null),(c=l(b.point))?c.selected=!0:(v=!0,w=b.point,x=new a.Path({strokeJoin:"round"}),j(x,{from:w,to:b.point}))},onMouseDrag:function(a){v&&x&&j(x,{from:w,to:a.point})},onMouseUp:function(a){if(v&&x&&(x.remove(),w.subtract(a.point).length>1)){var b=d({from:w,to:a.point,arrow:q},!0);b.selected=!0}}};return{name:m,tool:new a.Tool(y),registerEvent:function(a,b){n[a]=b},exportJSON:b,importJSON:c,listeners:{}}});
/*! AdIm - v0.0.0 - 2014-09-29 - Copyright (C) 2014 Université de Lausanne - see licence */
......@@ -630,7 +630,7 @@ function($, _, Backbone){
wait: true,
success:function(model){
if (model._editedAnObj) {
document.location.assign('/annotate/');
document.location.assign('../');
}
me.$el.fadeOut($.fn.remove);
}
......
......@@ -138,7 +138,7 @@ define('tools/rectangle',["paper","tools/Shape.class"],function(a,b){var c="rect
/*! AdIm - v0.0.0 - 2014-09-29 - Copyright (C) 2014 Université de Lausanne - see licence */
define('tools/text',["paper","jquery"],function(a,b){function c(a){a.oGetSelected=function(){return this.children[1].selected},a.oSetSelected=function(a){this.children[1].selected=a}}function d(c){j&&e(!1),j=!0,l||(l=b("<input>",{type:"text","class":"text-tool-input",placeholder:"Votre texte",maxlength:128,size:128,style:"display:none;position:absolute;top:0;left:0;padding:10px;border:0;border-radius:5px;background:rgba(255,255,255,0.75);"}).appendTo(a.project.view.element.parentNode).on("blur",function(){j&&e()}).on("keydown",function(a){(27===a.which||13==a.which)&&e()}).autoGrowInput(),m=m||b("<div>").css({zIndex:999,position:"fixed",display:"none",top:"-10px",left:"-10px",width:"5000px",height:"5000px"}).click(function(){e()}),l.before(m)),c.selected=!1,c.visible=!1;var d=c.children[1].point;d=d.subtract(a.view.bounds.point).multiply(a.view.zoom);var f=c.fontSize*a.view.zoom;l.val(c.data.content).css({fontSize:f+"px",fontFamily:c.font,color:c.data.color,top:d.y-f+1-10,left:d.x-1-10,zIndex:1e3}).show(),m.show();var g=l.nextAll("tester");g.css({fontSize:l.css("fontSize"),fontFamily:l.css("fontFamily"),fontWeight:l.css("fontWeight"),letterSpacing:l.css("letterSpacing")}),g.text(""===c.data.content?l.attr("placeholder"):c.data.content),l.width(g.width()+30),k=c,setTimeout(function(){l.focus()},100)}function e(b){if(b=!(b===!1),j=!1,k){var d=l.val();if(d&&""!==d){var e=""===k.data.content;k.data.content=d,k.children[0].content=d,k.children[1].content=d,k.visible=!0,b&&n.annotationSelected&&"function"==typeof n.annotationSelected.dispatch&&n.annotationSelected.dispatch(k),e?(c(k),n.annotationAdded&&"function"==typeof n.annotationAdded.dispatch&&n.annotationAdded.dispatch(k)):n.annotationChanged&&"function"==typeof n.annotationChanged.dispatch&&n.annotationChanged.dispatch(k),k.oSetSelected(b),a.project.view.draw()}else k.remove(),k=null}m.hide(),l.val("").blur().hide()}function f(a){var b=this,c=b.children[1].fillColor!==a;return b.children[1].fillColor=a,b.data.color=a,c}function g(a){var b=this,c=a/6;3>c&&(c=3),b.children[0].fontSize=a,b.children[0].strokeWidth=c,b.children[1].fontSize=a}function h(a,e,h){var i=e.importJSON(a);return b.extend(i.data,{setColor:f,setFill:p,setStrokeWidth:p,setFontSize:g}),c(i),h&&i.children[1].on("doubleclick",function(){d(this.parent)}),i}var i="text",j=!1,k=null,l=null,m=null,n={annotationAdded:null,annotationChanged:null,annotationSelected:null},o={type:"point-text",tolerance:5,fill:!0},p=function(){},q={onMouseDown:function(b){var c=a.project.activeLayer.hitTest(b.point,o);if(c){var h=c.item.parent;d(h)}else{var l=a.project.currentStyle.fontSize;if(j)e();else{a.project.deselectAll();var m=b.point,n=new a.PointText({point:m,fillColor:"white",strokeColor:"white",strokeWidth:l/6,strokeJoin:"round",shadowColor:"black",shadowBlur:10,shadowOffset:new a.Point([5,3]),content:""}),q=a.project.currentStyle.strokeColor||a.project.currentStyle.fillColor;q=q.toCSS();var r=new a.PointText({point:m,fillColor:q,strokeColor:q,strokeWidth:0,content:""});r.on("doubleclick",function(){d(this.parent)}),k=new a.Group({children:[n,r],fontSize:l,data:{type:i,setColor:f,setFill:p,setStrokeWidth:p,setFontSize:g,content:"",color:q}}),k.data.tId="a"+k._id,k.data.content="",d(k)}}}};return{name:i,tool:new a.Tool(q),importJSON:h,registerEvent:function(a,b){n[a]=b}}});
/*! AdIm - v0.0.0 - 2014-09-29 - Copyright (C) 2014 Université de Lausanne - see licence */
define('tools/arrow',["paper"],function(a){function b(a){var b=(this.data.from,this.data.to,this.exportJSON({asString:!1}));try{b[1][1].data.from=[this.data.from.x,this.data.from.y],b[1][1].data.to=[this.data.to.x,this.data.to.y]}catch(c){console.error(c)}return a&&a.asString?JSON.stringify(b):b}function c(b,c,d){var e=b[1][1],f=b[0][1][e.symbol][1][1],h=f.fillColor&&(f.fillColor.length<3||0!==f.fillColor[3]),i=parseFloat(e.opacity)||1,k=a.project.activeLayer;c.activate(),e.data.from.length>2&&(e.data.from=e.data.from.splice(1)),e.data.to.length>2&&(e.data.to=e.data.to.splice(1));var m=g({from:new a.Point(e.data.from),prop:e.data.prop,scale:e.data.scale||{h:1,v:1}},d);return m.opacity=i,j.call(m,f.strokeColor),l.call(m,h),n.call(m,f.strokeWidth),u(m,{from:m.data.from,to:new a.Point(e.data.to)}),k.activate(),m}function d(){if(!x){var b=new a.Path({segments:[[0,-10],[0,10],new a.Segment([20,5]),[10,30],new a.Segment([50,0]),[10,-30],new a.Segment([20,-5])],strokeJoin:"round",strokeScaling:!1,closed:!0});x=new a.Symbol(b),b.remove()}}function e(a,b){b=b||this;var c=b.symbol.definition.segments[2].point.x,d=b.symbol.definition.segments[4].point.x,e=b.globalToLocal(a).x;return(e-c)/(d-c)>.3}function f(a,b){b=b||this,a=a||b.symbol.definition.segments[4].point.x-b.symbol.definition.segments[1].point.x;var c=b.symbol.definition.segments[4].point.x-b.symbol.definition.segments[3].point.x;return 10>a-c}function g(b,c){var e,f,g,h,v;d(),e=new a.PlacedSymbol(x.clone()),f=e.symbol.definition.bounds.width,g=new a.Point(b.from),h=new a.Point([g.x+f,g.y]),v=b.scale||{h:1,v:1},e.pivot=[-f/2,0],u(e,{from:g,to:h}),i.call(e,v),l.call(e,a.project.currentStyle.fillColor),b.prop="object"==typeof b.prop?b.prop:{};for(var w in A)b.prop.hasOwnProperty(w)||(b.prop[w]=A[w]);return e.data={tId:"a"+e._id,type:y,prop:b.prop,from:g,to:h,scale:v,setColor:j,getColor:k,setFill:l,getFill:m,setStrokeWidth:n,getStrokeWidth:o,setDragMode:p,itemMouseDrag:r},c!==!1&&(e.onMouseDown=q,e.onMouseUp=s,e.onPropertyChange=t),e}function h(){this.data.from=this.position,this.data.to=this.data.from.add(new a.Point({length:this.symbol.definition.bounds.width,angle:this.rotation}))}function i(a){var b=x.definition.bounds.width;this.symbol.definition.scale(a.h,a.v,[-b/2,0]),this.data.scale||(this.data.scale={h:1,v:1}),this.data.scale.h*=a.h,this.data.scale.v*=a.v,h.call(this)}function j(a){this.symbol.definition.strokeColor=a,this.symbol.definition.fillColor.alpha>0&&(this.symbol.definition.fillColor=a)}function k(){return this.symbol.definition.strokeColor}function l(a){this.symbol.definition.fillColor=a?this.symbol.definition.strokeColor:B}function m(){return this.symbol.definition.fillColor.alpha>0}function n(a){this.symbol.definition.strokeWidth=a}function o(){return this.symbol.definition.strokeWidth}function p(a,b){!a in C?(D=null,E={},F=!1):(D=C[a],E=b)}function q(a){if(this.selected){D=C.FULL_DRAG;var b=this.data.to,c=this.data.from;e.call(this,a.point)?p("DRAG_TO",{delta:b.subtract(a.point)}):c.getDistance(a.point)<30&&p("DRAG_FROM",{delta:c.subtract(a.point)}),this.attach("mousedrag",r)}}function r(a){F=!0;var b={from:this.data.from,to:this.data.to};switch(D){case C.FULL_DRAG:this.translate(a.delta),h.call(this);break;case C.DRAG_TO:b.to=E.delta?a.point.add(E.delta):a.point,delete b.from,u(this,b);break;case C.DRAG_FROM:b.from=E.delta?a.point.add(E.delta):a.point,delete b.to,u(this,b);break;case C.DRAG_HANDLE:if("right"!==E.nameParts[1])F=!1;else{var c=a.point.subtract(b.from).project(b.to.subtract(b.from)),d=c.length/this.symbol.definition.bounds.width,e=a.point.subtract(c.add(b.from)).length/this.symbol.definition.bounds.height*2;i.call(this,{h:d,v:e})}break;default:F=!1}}function s(){this.detach("mousedrag",r),h.call(this),D=null,F&&z.annotationChanged.dispatch(this),F=!1}function t(){}function u(b,c){var d,e,g,h,i="";if(c.from||(c.from=b.data.from,i="to"),c.to||(c.to=b.data.to,i="from"),d=c.to.subtract(c.from),e=d.angle,g=b.symbol.definition.bounds.width,h=d.length-g,f.call(b,g+h)&&(h=0,"from"===i&&(c.from=c.to.subtract(new a.Point({length:g,angle:e})))),b.rotation=e,b.position=c.from,0!==h)for(var j,k=2;j=b.symbol.definition.segments[k];k++)j.point.x+=h;b.data.from=c.from,b.data.to=c.to}function v(a){return a.data&&a.data.type===y?a:a.parent?v(a.parent):null}function w(b){var c,d;if(c=a.project.activeLayer.hitTest(b,{tolerance:7,fill:!0,stroke:!0,segments:!0,handles:!0,ends:!0,bounds:!0,selected:!0}),c||(c=a.project.activeLayer.hitTest(b,{fill:!0,stroke:!0})),!c||!c.item)return!1;if(d=v(c.item),!d)return!1;if(d.selected=!0,"bounds"===c.type){var e=c.name.split("-");"right"===e[1]&&p("DRAG_HANDLE",{nameStr:c.name,nameParts:c.name.split("-"),item:d})}return!0}var x,y="arrow",z={annotationAdded:null,annotationSelected:null,annotationChanged:null},A={comment:"",fill:!0},B=new a.Color([0,0,0,0]),C={FULL_DRAG:1,DRAG_TO:2,DRAG_FROM:3,DRAG_HANDLE:4},D=null,E={},F=!1,G=!1,H=null,I=null,J={onMouseDown:function(b){G=!1,I=null,w(b.point)||(a.project.deselectAll(),z.annotationSelected.dispatch(null),G=!0,H=b.point,I=g({from:H},!0),I.visible=!1)},onMouseDrag:function(a){G&&I?(u(I,{from:H,to:a.point}),I.visible=!0):D===C.DRAG_HANDLE&&E.item&&r.call(E.item,a)},onMouseUp:function(){p(null),G&&I&&(z.annotationAdded.dispatch(I),G=!1,I.selected=!0,I.visible=!0,I=null)}};return{name:y,tool:new a.Tool(J),registerEvent:function(a,b){z[a]=b},exportJSON:b,importJSON:c,listeners:{}}});
define('tools/arrow',["paper"],function(a){function b(a){var b=(this.data.from,this.data.to,this.exportJSON({asString:!1}));try{b[1][1].data.from=[this.data.from.x,this.data.from.y],b[1][1].data.to=[this.data.to.x,this.data.to.y]}catch(c){console.error(c)}return a&&a.asString?JSON.stringify(b):b}function c(b,c,d){var e=b[1][1],f=b[0][1][e.symbol][1][1],h=f.fillColor&&(f.fillColor.length<3||0!==f.fillColor[3]),i=parseFloat(e.opacity)||1,k=a.project.activeLayer;c.activate(),e.data.from.length>2&&(e.data.from=e.data.from.splice(1)),e.data.to.length>2&&(e.data.to=e.data.to.splice(1));var m=g({from:new a.Point(e.data.from),prop:e.data.prop,scale:e.data.scale||{h:1,v:1}},d);return m.opacity=i,j.call(m,f.strokeColor),l.call(m,h),n.call(m,f.strokeWidth),u(m,{from:m.data.from,to:new a.Point(e.data.to)}),k.activate(),m}function d(){if(!x){var b=new a.Path({segments:[[0,-10],[0,10],new a.Segment([20,5]),[10,30],new a.Segment([50,0]),[10,-30],new a.Segment([20,-5])],strokeJoin:"round",strokeScaling:!1,closed:!0});x=new a.Symbol(b),b.remove()}}function e(a,b){b=b||this;var c=b.symbol.definition.segments[2].point.x,d=b.symbol.definition.segments[4].point.x,e=b.globalToLocal(a).x;return(e-c)/(d-c)>.3}function f(a,b){b=b||this,a=a||b.symbol.definition.segments[4].point.x-b.symbol.definition.segments[1].point.x;var c=b.symbol.definition.segments[4].point.x-b.symbol.definition.segments[3].point.x;return 10>a-c}function g(b,c){var e,f,g,h,v;d(),e=new a.PlacedSymbol(x.clone()),f=e.symbol.definition.bounds.width,g=new a.Point(b.from),h=new a.Point([g.x+f,g.y]),v=b.scale||{h:1,v:1},e.pivot=[-f/2,0],u(e,{from:g,to:h}),i.call(e,v),l.call(e,a.project.currentStyle.fillColor),j.call(e,a.project.currentStyle.strokeColor),b.prop="object"==typeof b.prop?b.prop:{};for(var w in A)b.prop.hasOwnProperty(w)||(b.prop[w]=A[w]);return e.data={tId:"a"+e._id,type:y,prop:b.prop,from:g,to:h,scale:v,setColor:j,getColor:k,setFill:l,getFill:m,setStrokeWidth:n,getStrokeWidth:o,setDragMode:p,itemMouseDrag:r},c!==!1&&(e.onMouseDown=q,e.onMouseUp=s,e.onPropertyChange=t),e}function h(){this.data.from=this.position,this.data.to=this.data.from.add(new a.Point({length:this.symbol.definition.bounds.width,angle:this.rotation}))}function i(a){var b=x.definition.bounds.width;this.symbol.definition.scale(a.h,a.v,[-b/2,0]),this.data.scale||(this.data.scale={h:1,v:1}),this.data.scale.h*=a.h,this.data.scale.v*=a.v,h.call(this)}function j(a){this.symbol.definition.strokeColor=a,this.symbol.definition.fillColor.alpha>0&&(this.symbol.definition.fillColor=a)}function k(){return this.symbol.definition.strokeColor}function l(a){this.symbol.definition.fillColor=a?this.symbol.definition.strokeColor:B}function m(){return this.symbol.definition.fillColor.alpha>0}function n(a){this.symbol.definition.strokeWidth=a}function o(){return this.symbol.definition.strokeWidth}function p(a,b){!a in C?(D=null,E={},F=!1):(D=C[a],E=b)}function q(a){if(this.selected){D=C.FULL_DRAG;var b=this.data.to,c=this.data.from;e.call(this,a.point)?p("DRAG_TO",{delta:b.subtract(a.point)}):c.getDistance(a.point)<30&&p("DRAG_FROM",{delta:c.subtract(a.point)}),this.attach("mousedrag",r)}}function r(a){F=!0;var b={from:this.data.from,to:this.data.to};switch(D){case C.FULL_DRAG:this.translate(a.delta),h.call(this);break;case C.DRAG_TO:b.to=E.delta?a.point.add(E.delta):a.point,delete b.from,u(this,b);break;case C.DRAG_FROM:b.from=E.delta?a.point.add(E.delta):a.point,delete b.to,u(this,b);break;case C.DRAG_HANDLE:if("right"!==E.nameParts[1])F=!1;else{var c=a.point.subtract(b.from).project(b.to.subtract(b.from)),d=c.length/this.symbol.definition.bounds.width,e=a.point.subtract(c.add(b.from)).length/this.symbol.definition.bounds.height*2;i.call(this,{h:d,v:e})}break;default:F=!1}}function s(){this.detach("mousedrag",r),h.call(this),D=null,F&&z.annotationChanged.dispatch(this),F=!1}function t(){}function u(b,c){var d,e,g,h,i="";if(c.from||(c.from=b.data.from,i="to"),c.to||(c.to=b.data.to,i="from"),d=c.to.subtract(c.from),e=d.angle,g=b.symbol.definition.bounds.width,h=d.length-g,f.call(b,g+h)&&(h=0,"from"===i&&(c.from=c.to.subtract(new a.Point({length:g,angle:e})))),b.rotation=e,b.position=c.from,0!==h)for(var j,k=2;j=b.symbol.definition.segments[k];k++)j.point.x+=h;b.data.from=c.from,b.data.to=c.to}function v(a){return a.data&&a.data.type===y?a:a.parent?v(a.parent):null}function w(b){var c,d;if(c=a.project.activeLayer.hitTest(b,{tolerance:7,fill:!0,stroke:!0,segments:!0,handles:!0,ends:!0,bounds:!0,selected:!0}),c||(c=a.project.activeLayer.hitTest(b,{fill:!0,stroke:!0})),!c||!c.item)return!1;if(d=v(c.item),!d)return!1;if(d.selected=!0,"bounds"===c.type){var e=c.name.split("-");"right"===e[1]&&p("DRAG_HANDLE",{nameStr:c.name,nameParts:c.name.split("-"),item:d})}return!0}var x,y="arrow",z={annotationAdded:null,annotationSelected:null,annotationChanged:null},A={comment:"",fill:!0},B=new a.Color([0,0,0,0]),C={FULL_DRAG:1,DRAG_TO:2,DRAG_FROM:3,DRAG_HANDLE:4},D=null,E={},F=!1,G=!1,H=null,I=null,J={onMouseDown:function(b){G=!1,I=null,w(b.point)||(a.project.deselectAll(),z.annotationSelected.dispatch(null),G=!0,H=b.point,I=g({from:H},!0),I.visible=!1)},onMouseDrag:function(a){G&&I?(u(I,{from:H,to:a.point}),I.visible=!0):D===C.DRAG_HANDLE&&E.item&&r.call(E.item,a)},onMouseUp:function(){p(null),G&&I&&(z.annotationAdded.dispatch(I),G=!1,I.selected=!0,I.visible=!0,I=null)}};return{name:y,tool:new a.Tool(J),registerEvent:function(a,b){z[a]=b},exportJSON:b,importJSON:c,listeners:{}}});
/*! AdIm - v0.0.0 - 2014-09-29 - Copyright (C) 2014 Université de Lausanne - see licence */
define('tools/arrow1',["paper"],function(a){function b(a){var b=this.segments[7].point,c=this.segments[3].point;this.data.from=[b.x,b.y],this.data.to=[c.x,c.y];var d=this.exportJSON({asString:!1});return delete d[1].fontFamily,delete d[1].font,delete d[1].fontSize,delete d[1].leading,a&&a.asString?JSON.stringify(d):d}function c(b,c,e){var f=b[1],g=a.project.activeLayer;c.activate();var h=d({from:new a.Point(f.data.from),to:f.data.to,arrow:f.data.arrow,prop:f.data.prop},e);return h.setStyle({strokeColor:f.strokeColor,strokeWidth:f.strokeWidth,fillColor:f.fillColor}),g.activate(),h}function d(b,c){var d=new a.Path({strokeJoin:"round"});b.arrow=b.arrow||q,j(d,{from:b.from,to:b.to,arrow:b.arrow}),b.prop="object"==typeof b.prop?b.prop:{};for(var f in o)b.prop.hasOwnProperty(f)||(b.prop[f]=o[f]);return d.data={tId:"a"+d._id,type:m,prop:b.prop,from:[b.from.x,b.from.y],to:[b.to.x,b.to.y],arrow:b.arrow},b.prop.confidence&&(d.style=p[b.prop.confidence]),c!==!1&&(d.onMouseDown=e,d.onMouseUp=g,d.onPropertyChange=h),n.annotationAdded.dispatch(d),d}function e(a){if(this.selected){s=r.FULL_DRAG;var b=this.segments[3].point,c=this.segments[7].point,d=this.segments[2].point,e=this.segments[4].point,g=this.segments[1].point,h=this.segments[5].point;t=null,a.modifiers.option||a.modifiers.control||a.modifiers.command?d.getDistance(a.point)<10||e.getDistance(a.point)<10?s=r.AR_WIDTH:(g.getDistance(a.point)<10||h.getDistance(a.point)<10)&&(s=r.STRK_WIDTH):d.getDistance(a.point)<10||e.getDistance(a.point)<10?s=r.AR_WIDTH:g.getDistance(a.point)<10||h.getDistance(a.point)<10?s=r.STRK_WIDTH:b.getDistance(a.point)<this.data.arrow.h-20?(s=r.DRAG_TO,t=b.subtract(a.point)):c.getDistance(a.point)<30&&(s=r.DRAG_FROM,t=c.subtract(a.point)),this.attach("mousedrag",f)}}function f(a){function b(a,b){var c=b.to.subtract(a).angle,d=b.to.subtract(b.from).angle,e=(c-d)/360*2*Math.PI,f=a.getDistance(b.to);return{l:Math.sin(e)*f,h:Math.cos(e)*f}}u=!0;var c={from:this.segments[7].point,to:this.segments[3].point,arrow:this.data.arrow};switch(s){case r.FULL_DRAG:this.translate(a.delta);break;case r.DRAG_TO:c.to=t?a.point.add(t):a.point,j(this,c);break;case r.DRAG_FROM:c.from=t?a.point.add(t):a.point,j(this,c);break;case r.AR_WIDTH:var d=b(a.point,c);d.l>c.arrow.l1&&(c.arrow.l2=d.l),d.h>5&&(c.arrow.h=d.h),j(this,c);break;case r.STRK_WIDTH:var d=b(a.point,c);d.l>2&&d.l<c.arrow.l2&&(c.arrow.l1=d.l),d.h>5&&(c.arrow.h=d.h),j(this,c);break;default:u=!1}}function g(){this.detach("mousedrag",f),s=null,u&&n.annotationChanged.dispatch(this),u=!1}function h(b,c){"confidence"===b&&(this.style=p[c],a.view.draw())}function i(b,c){var d={v0:new a.Point(b.l1,0),v2:new a.Point(b.l2-b.l1,0),v3:new a.Point(-b.l2,b.h),v4:new a.Point(-b.l2,-b.h),v5:new a.Point(b.l2-b.l1,0)};if(void 0!==c){var e=c-b.h;d.v1=new a.Point(0,e>0?e:0)}return d}function j(a,b){var c=b.arrow||q,d=b.from.getDistance(b.to),e=i(c,d);a.removeSegments(),a.pivot=b.from,a.rotation=0,a.add(b.from.add(e.v0)),a.lineBy(e.v1),a.lineBy(e.v2),a.lineBy(e.v3),a.lineBy(e.v4),a.lineBy(e.v5),a.lineBy(0,-e.v1.y),a.lineBy(e.v0),a.closed=!0,a.rotation=b.from.subtract(b.to).angle+90}function k(a){return a.data&&a.data.type===m?a:a.parent?k(a.parent):null}function l(b){var c=a.project.activeLayer.hitTest(b,{fill:!0,stroke:!0});return c&&c.item?k(c.item):!1}var m="arrow1",n={annotationAdded:null,annotationSelected:null,annotationChanged:null},o={comment:"",confidence:3,fill:!0},p={1:{dashArray:[10,10]},2:{dashArray:[30,10]},3:{dashArray:null}},q={l1:10,l2:30,h:40},r={FULL_DRAG:0,DRAG_TO:1,DRAG_FROM:2,AR_WIDTH:3,STRK_WIDTH:4},s="",t=null,u=!1,v=!1,w=null,x=null,y={onMouseDown:function(b){var c;v=!1,x=null,a.project.deselectAll(),n.annotationSelected.dispatch(null),(c=l(b.point))?c.selected=!0:(v=!0,w=b.point,x=new a.Path({strokeJoin:"round"}),j(x,{from:w,to:b.point}))},onMouseDrag:function(a){v&&x&&j(x,{from:w,to:a.point})},onMouseUp:function(a){if(v&&x&&(x.remove(),w.subtract(a.point).length>1)){var b=d({from:w,to:a.point,arrow:q},!0);b.selected=!0}}};return{name:m,tool:new a.Tool(y),registerEvent:function(a,b){n[a]=b},exportJSON:b,importJSON:c,listeners:{}}});
/*! AdIm - v0.0.0 - 2014-09-29 - Copyright (C) 2014 Université de Lausanne - see licence */
......@@ -630,7 +630,7 @@ function($, _, Backbone){
wait: true,
success:function(model){
if (model._editedAnObj) {
document.location.assign('/annotate/');
document.location.assign('../');
}
me.$el.fadeOut($.fn.remove);
}
......
Supports Markdown
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