Gitlab CSE Unil

Commit 52014ab8 authored by M. Chardon's avatar M. Chardon
Browse files

Merge remote-tracking branch 'origin/master' into dev

parents de1b24d0 c7286d1f
......@@ -17915,6 +17915,7 @@ define('adim/category',["underscore", "paper", "signals"], function (_, paper, S
_categories['default'] = _categories[id];
}
});
_categories['default'] = _categories['cat_2'];
}
 
/**
......@@ -17971,7 +17972,7 @@ define('tools/marker',[
var defaultProperties = {
//comment: "",
labelComment: "",
category: ""
category: "cat_2"
};
 
// Markers management related
......@@ -17999,12 +18000,17 @@ define('tools/marker',[
var curLayer = paper.project.activeLayer;
layer.activate();
 
// Keep copy of current category
var curCat = defaultProperties.category;
var marker = createMarker(itemData.origin, itemData, listening);
if (itemData.prop.category) {
_setCategory.call(marker, itemData.prop.category);
}
 
// Restore states
curLayer.activate();
defaultProperties.category = curCat;
 
return marker;
}
......@@ -18258,6 +18264,7 @@ define('tools/marker',[
var category = Category.getCategory(catId),
color = (category && category.color) || "#000000";
_setColor.call(this, color);
defaultProperties.category = catId;
}
 
 
......@@ -18431,6 +18438,7 @@ define('tools/marker',[
 
var marker = hitOnMarkerTest(event.point);
if (marker) {
debugger;
if (!marker.selected) {
paper.project.deselectAll();
marker.selected = true;
......@@ -18452,6 +18460,7 @@ define('tools/marker',[
itemMouseDown.call(marker, event);
_selectedMarker = marker;
_events.annotationSelected.dispatch(marker);
}
},
 
......@@ -27534,7 +27543,7 @@ function($){
!function(a){function b(b){if("string"==typeof b.data&&(b.data={keys:b.data}),b.data&&b.data.keys&&"string"==typeof b.data.keys){var c=b.handler,d=b.data.keys.toLowerCase().split(" ");b.handler=function(b){if(this===b.target||!(/textarea|select/i.test(b.target.nodeName)||a.hotkeys.options.filterTextInputs&&a.inArray(b.target.type,a.hotkeys.textAcceptingInputTypes)>-1)){var e="keypress"!==b.type&&a.hotkeys.specialKeys[b.which],f=String.fromCharCode(b.which).toLowerCase(),g="",h={};a.each(["alt","ctrl","shift"],function(a,c){b[c+"Key"]&&e!==c&&(g+=c+"+")}),b.metaKey&&!b.ctrlKey&&"meta"!==e&&(g+="meta+"),b.metaKey&&"meta"!==e&&g.indexOf("alt+ctrl+shift+")>-1&&(g=g.replace("alt+ctrl+shift+","hyper+")),e?h[g+e]=!0:(h[g+f]=!0,h[g+a.hotkeys.shiftNums[f]]=!0,"shift+"===g&&(h[a.hotkeys.shiftNums[f]]=!0));for(var i=0,j=d.length;j>i;i++)if(h[d[i]])return c.apply(this,arguments)}}}}a.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],options:{filterTextInputs:!0}},a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})}(jQuery||this.jQuery||window.jQuery);
define("jquery.hotkeys", ["jquery"], function(){});
 
/*! AdIm - v0.0.0 - 2016-01-05 - Copyright (C) 2016 Université de Lausanne - see licence */
/*! AdIm - v0.0.0 - 2016-03-14 - Copyright (C) 2016 Université de Lausanne - see licence */
define('env/shortcuts',["jquery","paper","signals","adim/config","adim/view","adim/tools","adim/ui","jquery.hotkeys"],function(a,b,c,d,e,f){var g,h=function(){return function(){return!1}};return{"backspace del":[{event:"keydown",ctxt:"edit",fn:function(){return e.removeSelectedItems(),!1}},{event:"keydown",ctxt:"review",fn:h()}],space:[{event:"keydown",fn:function(){return g||(g=f.getActiveTool(),f.activateTool("pan")),!1}},{event:"keyup",fn:function(){return g&&(f.activateTool(g),g=null),!1}}],a:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("select"),!1}}],"ctrl+a meta+a":[{event:"keydown",ctxt:"edit",fn:function(){return b.project.activeLayer.children.map(function(a){a.selected=!0}),!1}},{event:"keydown",ctxt:"review",fn:h()}],d:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("drawing"),!1}}],f:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("arrow"),!1}}],l:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("lines"),!1}}],c:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("ellipse"),!1}}],r:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("rectangle"),!1}}],t:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("text"),!1}}]}});
/*! Sortable 1.2.0 - MIT | git://github.com/rubaxa/Sortable.git */
!function(a){"function"==typeof define&&define.amd?define('sortable',a):"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=a():"undefined"!=typeof Package?Sortable=a():window.Sortable=a()}(function(){function a(a,b){this.el=a,this.options=b=q({},b),a[H]=this;var d={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(a.nodeName)?"li":">*",ghostClass:"sortable-ghost",ignore:"a, img",filter:null,animation:0,setData:function(a,b){a.setData("Text",b.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0};for(var e in d)!(e in b)&&(b[e]=d[e]);var g=b.group;g&&"object"==typeof g||(g=b.group={name:g}),["pull","put"].forEach(function(a){a in g||(g[a]=!0)}),b.groups=" "+g.name+(g.put.join?" "+g.put.join(" "):"")+" ";for(var h in this)"_"===h.charAt(0)&&(this[h]=c(this,this[h]));f(a,"mousedown",this._onTapStart),f(a,"touchstart",this._onTapStart),f(a,"dragover",this),f(a,"dragenter",this),Q.push(this._onDragOver),b.store&&this.sort(b.store.get(this))}function b(a){t&&t.state!==a&&(i(t,"display",a?"none":""),!a&&t.state&&u.insertBefore(t,r),t.state=a)}function c(a,b){var c=P.call(arguments,2);return b.bind?b.bind.apply(b,[a].concat(c)):function(){return b.apply(a,c.concat(P.call(arguments)))}}function d(a,b,c){if(a){c=c||J,b=b.split(".");var d=b.shift().toUpperCase(),e=new RegExp("\\s("+b.join("|")+")\\s","g");do if(">*"===d&&a.parentNode===c||(""===d||a.nodeName.toUpperCase()==d)&&(!b.length||((" "+a.className+" ").match(e)||[]).length==b.length))return a;while(a!==c&&(a=a.parentNode))}return null}function e(a){a.dataTransfer.dropEffect="move",a.preventDefault()}function f(a,b,c){a.addEventListener(b,c,!1)}function g(a,b,c){a.removeEventListener(b,c,!1)}function h(a,b,c){if(a)if(a.classList)a.classList[c?"add":"remove"](b);else{var d=(" "+a.className+" ").replace(G," ").replace(" "+b+" "," ");a.className=(d+(c?" "+b:"")).replace(G," ")}}function i(a,b,c){var d=a&&a.style;if(d){if(void 0===c)return J.defaultView&&J.defaultView.getComputedStyle?c=J.defaultView.getComputedStyle(a,""):a.currentStyle&&(c=a.currentStyle),void 0===b?c:c[b];b in d||(b="-webkit-"+b),d[b]=c+("string"==typeof c?"":"px")}}function j(a,b,c){if(a){var d=a.getElementsByTagName(b),e=0,f=d.length;if(c)for(;f>e;e++)c(d[e],e);return d}return[]}function k(a){a.draggable=!1}function l(){M=!1}function m(a,b){var c=a.lastElementChild,d=c.getBoundingClientRect();return b.clientY-(d.top+d.height)>5&&c}function n(a){for(var b=a.tagName+a.className+a.src+a.href+a.textContent,c=b.length,d=0;c--;)d+=b.charCodeAt(c);return d.toString(36)}function o(a){for(var b=0;a&&(a=a.previousElementSibling);)"TEMPLATE"!==a.nodeName.toUpperCase()&&b++;return b}function p(a,b){var c,d;return function(){void 0===c&&(c=arguments,d=this,setTimeout(function(){1===c.length?a.call(d,c[0]):a.apply(d,c),c=void 0},b))}}function q(a,b){if(a&&b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}var r,s,t,u,v,w,x,y,z,A,B,C,D,E,F={},G=/\s+/g,H="Sortable"+(new Date).getTime(),I=window,J=I.document,K=I.parseInt,L=!!("draggable"in J.createElement("div")),M=!1,N=function(a,b,c,d,e,f,g){var h=J.createEvent("Event"),i=(a||b[H]).options,j="on"+c.charAt(0).toUpperCase()+c.substr(1);h.initEvent(c,!0,!0),h.item=d||b,h.from=e||b,h.clone=t,h.oldIndex=f,h.newIndex=g,i[j]&&i[j].call(a,h),b.dispatchEvent(h)},O=Math.abs,P=[].slice,Q=[],R=p(function(a,b,c){if(c&&b.scroll){var d,e,f,g,h=b.scrollSensitivity,i=b.scrollSpeed,j=a.clientX,k=a.clientY,l=window.innerWidth,m=window.innerHeight;if(x!==c&&(w=b.scroll,x=c,w===!0)){w=c;do if(w.offsetWidth<w.scrollWidth||w.offsetHeight<w.scrollHeight)break;while(w=w.parentNode)}w&&(d=w,e=w.getBoundingClientRect(),f=(O(e.right-j)<=h)-(O(e.left-j)<=h),g=(O(e.bottom-k)<=h)-(O(e.top-k)<=h)),f||g||(f=(h>=l-j)-(h>=j),g=(h>=m-k)-(h>=k),(f||g)&&(d=I)),(F.vx!==f||F.vy!==g||F.el!==d)&&(F.el=d,F.vx=f,F.vy=g,clearInterval(F.pid),d&&(F.pid=setInterval(function(){d===I?I.scrollTo(I.pageXOffset+f*i,I.pageYOffset+g*i):(g&&(d.scrollTop+=g*i),f&&(d.scrollLeft+=f*i))},24)))}},30);return a.prototype={constructor:a,_onTapStart:function(a){var b=this,c=this.el,e=this.options,f=a.type,g=a.touches&&a.touches[0],h=(g||a).target,i=h,j=e.filter;if(!("mousedown"===f&&0!==a.button||e.disabled)&&(h=d(h,e.draggable,c))){if(A=o(h),"function"==typeof j){if(j.call(this,a,h,this))return N(b,i,"filter",h,c,A),void a.preventDefault()}else if(j&&(j=j.split(",").some(function(a){return a=d(i,a.trim(),c),a?(N(b,a,"filter",h,c,A),!0):void 0})))return;(!e.handle||d(i,e.handle,c))&&this._prepareDragStart(a,g,h)}},_prepareDragStart:function(a,b,c){var d,e=this,g=e.el,h=e.options,i=g.ownerDocument;c&&!r&&c.parentNode===g&&(D=a,u=g,r=c,v=r.nextSibling,C=h.group,d=function(){e._disableDelayedDrag(),r.draggable=!0,h.ignore.split(",").forEach(function(a){j(r,a.trim(),k)}),e._triggerDragStart(b)},f(i,"mouseup",e._onDrop),f(i,"touchend",e._onDrop),f(i,"touchcancel",e._onDrop),h.delay?(f(i,"mousemove",e._disableDelayedDrag),f(i,"touchmove",e._disableDelayedDrag),e._dragStartTimer=setTimeout(d,h.delay)):d())},_disableDelayedDrag:function(){var a=this.el.ownerDocument;clearTimeout(this._dragStartTimer),g(a,"mousemove",this._disableDelayedDrag),g(a,"touchmove",this._disableDelayedDrag)},_triggerDragStart:function(a){a?(D={target:r,clientX:a.clientX,clientY:a.clientY},this._onDragStart(D,"touch")):L?(f(r,"dragend",this),f(u,"dragstart",this._onDragStart)):this._onDragStart(D,!0);try{J.selection?J.selection.empty():window.getSelection().removeAllRanges()}catch(b){}},_dragStarted:function(){u&&r&&(h(r,this.options.ghostClass,!0),a.active=this,N(this,u,"start",r,u,A))},_emulateDragOver:function(){if(E){i(s,"display","none");var a=J.elementFromPoint(E.clientX,E.clientY),b=a,c=" "+this.options.group.name,d=Q.length;if(b)do{if(b[H]&&b[H].options.groups.indexOf(c)>-1){for(;d--;)Q[d]({clientX:E.clientX,clientY:E.clientY,target:a,rootEl:b});break}a=b}while(b=b.parentNode);i(s,"display","")}},_onTouchMove:function(a){if(D){var b=a.touches?a.touches[0]:a,c=b.clientX-D.clientX,d=b.clientY-D.clientY,e=a.touches?"translate3d("+c+"px,"+d+"px,0)":"translate("+c+"px,"+d+"px)";E=b,i(s,"webkitTransform",e),i(s,"mozTransform",e),i(s,"msTransform",e),i(s,"transform",e),a.preventDefault()}},_onDragStart:function(a,b){var c=a.dataTransfer,d=this.options;if(this._offUpEvents(),"clone"==C.pull&&(t=r.cloneNode(!0),i(t,"display","none"),u.insertBefore(t,r)),b){var e,g=r.getBoundingClientRect(),h=i(r);s=r.cloneNode(!0),i(s,"top",g.top-K(h.marginTop,10)),i(s,"left",g.left-K(h.marginLeft,10)),i(s,"width",g.width),i(s,"height",g.height),i(s,"opacity","0.8"),i(s,"position","fixed"),i(s,"zIndex","100000"),u.appendChild(s),e=s.getBoundingClientRect(),i(s,"width",2*g.width-e.width),i(s,"height",2*g.height-e.height),"touch"===b?(f(J,"touchmove",this._onTouchMove),f(J,"touchend",this._onDrop),f(J,"touchcancel",this._onDrop)):(f(J,"mousemove",this._onTouchMove),f(J,"mouseup",this._onDrop)),this._loopId=setInterval(this._emulateDragOver,150)}else c&&(c.effectAllowed="move",d.setData&&d.setData.call(this,c,r)),f(J,"drop",this);setTimeout(this._dragStarted,0)},_onDragOver:function(a){var c,e,f,g=this.el,h=this.options,j=h.group,k=j.put,n=C===j,o=h.sort;if(void 0!==a.preventDefault&&(a.preventDefault(),!h.dragoverBubble&&a.stopPropagation()),C&&!h.disabled&&(n?o||(f=!u.contains(r)):C.pull&&k&&(C.name===j.name||k.indexOf&&~k.indexOf(C.name)))&&(void 0===a.rootEl||a.rootEl===this.el)){if(R(a,h,this.el),M)return;if(c=d(a.target,h.draggable,g),e=r.getBoundingClientRect(),f)return b(!0),void(t||v?u.insertBefore(r,t||v):o||u.appendChild(r));if(0===g.children.length||g.children[0]===s||g===a.target&&(c=m(g,a))){if(c){if(c.animated)return;q=c.getBoundingClientRect()}b(n),g.appendChild(r),this._animate(e,r),c&&this._animate(q,c)}else if(c&&!c.animated&&c!==r&&void 0!==c.parentNode[H]){y!==c&&(y=c,z=i(c));var p,q=c.getBoundingClientRect(),w=q.right-q.left,x=q.bottom-q.top,A=/left|right|inline/.test(z.cssFloat+z.display),B=c.offsetWidth>r.offsetWidth,D=c.offsetHeight>r.offsetHeight,E=(A?(a.clientX-q.left)/w:(a.clientY-q.top)/x)>.5,F=c.nextElementSibling;M=!0,setTimeout(l,30),b(n),p=A?c.previousElementSibling===r&&!B||E&&B:F!==r&&!D||E&&D,p&&!F?g.appendChild(r):c.parentNode.insertBefore(r,p?F:c),this._animate(e,r),this._animate(q,c)}}},_animate:function(a,b){var c=this.options.animation;if(c){var d=b.getBoundingClientRect();i(b,"transition","none"),i(b,"transform","translate3d("+(a.left-d.left)+"px,"+(a.top-d.top)+"px,0)"),b.offsetWidth,i(b,"transition","all "+c+"ms"),i(b,"transform","translate3d(0,0,0)"),clearTimeout(b.animated),b.animated=setTimeout(function(){i(b,"transition",""),i(b,"transform",""),b.animated=!1},c)}},_offUpEvents:function(){var a=this.el.ownerDocument;g(J,"touchmove",this._onTouchMove),g(a,"mouseup",this._onDrop),g(a,"touchend",this._onDrop),g(a,"touchcancel",this._onDrop)},_onDrop:function(b){var c=this.el,d=this.options;clearInterval(this._loopId),clearInterval(F.pid),clearTimeout(this.dragStartTimer),g(J,"drop",this),g(J,"mousemove",this._onTouchMove),g(c,"dragstart",this._onDragStart),this._offUpEvents(),b&&(b.preventDefault(),!d.dropBubble&&b.stopPropagation(),s&&s.parentNode.removeChild(s),r&&(g(r,"dragend",this),k(r),h(r,this.options.ghostClass,!1),u!==r.parentNode?(B=o(r),N(null,r.parentNode,"sort",r,u,A,B),N(this,u,"sort",r,u,A,B),N(null,r.parentNode,"add",r,u,A,B),N(this,u,"remove",r,u,A,B)):(t&&t.parentNode.removeChild(t),r.nextSibling!==v&&(B=o(r),N(this,u,"update",r,u,A,B),N(this,u,"sort",r,u,A,B))),a.active&&N(this,u,"end",r,u,A,B)),u=r=s=v=t=w=x=D=E=y=z=C=a.active=null,this.save())},handleEvent:function(a){var b=a.type;"dragover"===b||"dragenter"===b?r&&(this._onDragOver(a),e(a)):("drop"===b||"dragend"===b)&&this._onDrop(a)},toArray:function(){for(var a,b=[],c=this.el.children,e=0,f=c.length,g=this.options;f>e;e++)a=c[e],d(a,g.draggable,this.el)&&b.push(a.getAttribute(g.dataIdAttr)||n(a));return b},sort:function(a){var b={},c=this.el;this.toArray().forEach(function(a,e){var f=c.children[e];d(f,this.options.draggable,c)&&(b[a]=f)},this),a.forEach(function(a){b[a]&&(c.removeChild(b[a]),c.appendChild(b[a]))})},save:function(){var a=this.options.store;a&&a.set(this)},closest:function(a,b){return d(a,b||this.options.draggable,this.el)},option:function(a,b){var c=this.options;return void 0===b?c[a]:void(c[a]=b)},destroy:function(){var a=this.el;a[H]=null,g(a,"mousedown",this._onTapStart),g(a,"touchstart",this._onTapStart),g(a,"dragover",this),g(a,"dragenter",this),Array.prototype.forEach.call(a.querySelectorAll("[draggable]"),function(a){a.removeAttribute("draggable")}),Q.splice(Q.indexOf(this._onDragOver),1),this._onDrop(),this.el=a=null}},a.utils={on:f,off:g,css:i,find:j,bind:c,is:function(a,b){return!!d(a,b,a)},extend:q,throttle:p,closest:d,toggleClass:h,index:o},a.version="1.2.0",a.create=function(b,c){return new a(b,c)},a});
......@@ -27873,7 +27882,7 @@ define('tools/marker-ui',[
}
}
);
/*! AdIm - v0.0.0 - 2016-01-05 - Copyright (C) 2016 Université de Lausanne - see licence */
/*! AdIm - v0.0.0 - 2016-03-14 - Copyright (C) 2016 Université de Lausanne - see licence */
define('env/env',["jquery","underscore","paper","signals","adim/config","adim/view","adim/attributes","adim/io","adim/tools","adim/ui","adim/category","env/shortcuts","tools/marker-ui"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){console.info("_initSignalRouting from env/anodate"),h.events.annotableLoaded.add(function(){f.events.annotationRemoved.add(function(a){"marker"===a.data.type&&i.tools.marker.listeners.updateNumbering()}),f.events.imageLoaded.add(function(){})},100),f.events.annotationsLoaded.add(function(){i.tools.marker.listeners.updateNumbering()},-100),j.events.modeChanged.add(function(b){var c=b.mode;"edit"===c?(a("#annotation-display-panel").hide(),a("#annotation-property-panel").show()):"review"===c&&(a("#annotation-display-panel").show(),a("#annotation-property-panel").hide())})}function o(b){function c(a){e.toggleClass("col-sm-1",!a).toggleClass("col-sm-2",a),l.toggleClass("hidden",!a),i.toggleClass("col-xs-12",!a).toggleClass("col-xs-6",a)}function d(a){c(a&&n.find(".panel-collapse").hasClass("in")),n.toggleClass("hidden",!a)}k.init(),m.init(b),a("#tool-colorselect").find(".color-menu").addClass("no-picker"),a(".adim-display-type-selector").find("button").on("click",function(b){var c=a(this),d=!c.hasClass("active"),e=c.data("category");b.metaKey||(c.toggleClass("active",d),"image"===e?g.setImageOpacity(d?100:0,!0):f.toggleItemsByProp({prop:"category",val:e,undef:!0},d))});var e=a("#side-col"),h=a(".canvas-container"),i=a("#side-col-panel-group"),l=a("#alt-side-col-panel-group"),n=a("#shared-annotation-markers-panel");d("review"===b.mode),j.events.modeChanged.add(function(a){var b=a.mode;d("review"===b),j.updateReservedSpace(),j.adjustCanvasToImage()}),n.find(".panel-collapse").on("hidden.bs.collapse",function(){h.css("transition","width 0.2s cubic-bezier(0.25, 0.1, 0.25, 1) 0s"),n.prependTo(i),c(!1),j.updateReservedSpace(),j.adjustCanvasToImage(),h.css("transition","")}).on("show.bs.collapse",function(){c(!0),n.appendTo(l),j.updateReservedSpace(),j.adjustCanvasToImage()})}function p(){var b,d=a("#tool-colorselect").find(".color-menu .c4").css("backgroundColor");if(0===d.indexOf("rgb")){var e=d.split(/[(),]/).map(function(a){return parseFloat(a.trim())}).filter(function(a){return!isNaN(a)});b=new c.Color(e[0]/255,e[1]/255,e[2]/255)}else b=new c.Color(d);return{strokeColor:b}}var q={name:"anodate",shortcuts:l,initSignalRouting:n,initUI:o};return Object.defineProperty(q,"style",{get:p}),q});
/**
* Copyright (C) 2014 Université de Lausanne, RISET,
......@@ -17915,6 +17915,7 @@ define('adim/category',["underscore", "paper", "signals"], function (_, paper, S
_categories['default'] = _categories[id];
}
});
_categories['default'] = _categories['cat_2'];
}
 
/**
......@@ -17971,7 +17972,7 @@ define('tools/marker',[
var defaultProperties = {
//comment: "",
labelComment: "",
category: ""
category: "cat_2"
};
 
// Markers management related
......@@ -17999,12 +18000,17 @@ define('tools/marker',[
var curLayer = paper.project.activeLayer;
layer.activate();
 
// Keep copy of current category
var curCat = defaultProperties.category;
var marker = createMarker(itemData.origin, itemData, listening);
if (itemData.prop.category) {
_setCategory.call(marker, itemData.prop.category);
}
 
// Restore states
curLayer.activate();
defaultProperties.category = curCat;
 
return marker;
}
......@@ -18258,6 +18264,7 @@ define('tools/marker',[
var category = Category.getCategory(catId),
color = (category && category.color) || "#000000";
_setColor.call(this, color);
defaultProperties.category = catId;
}
 
 
......@@ -18431,6 +18438,7 @@ define('tools/marker',[
 
var marker = hitOnMarkerTest(event.point);
if (marker) {
debugger;
if (!marker.selected) {
paper.project.deselectAll();
marker.selected = true;
......@@ -18452,6 +18460,7 @@ define('tools/marker',[
itemMouseDown.call(marker, event);
_selectedMarker = marker;
_events.annotationSelected.dispatch(marker);
}
},
 
......@@ -27534,9 +27543,9 @@ function($){
!function(a){function b(b){if("string"==typeof b.data&&(b.data={keys:b.data}),b.data&&b.data.keys&&"string"==typeof b.data.keys){var c=b.handler,d=b.data.keys.toLowerCase().split(" ");b.handler=function(b){if(this===b.target||!(/textarea|select/i.test(b.target.nodeName)||a.hotkeys.options.filterTextInputs&&a.inArray(b.target.type,a.hotkeys.textAcceptingInputTypes)>-1)){var e="keypress"!==b.type&&a.hotkeys.specialKeys[b.which],f=String.fromCharCode(b.which).toLowerCase(),g="",h={};a.each(["alt","ctrl","shift"],function(a,c){b[c+"Key"]&&e!==c&&(g+=c+"+")}),b.metaKey&&!b.ctrlKey&&"meta"!==e&&(g+="meta+"),b.metaKey&&"meta"!==e&&g.indexOf("alt+ctrl+shift+")>-1&&(g=g.replace("alt+ctrl+shift+","hyper+")),e?h[g+e]=!0:(h[g+f]=!0,h[g+a.hotkeys.shiftNums[f]]=!0,"shift+"===g&&(h[a.hotkeys.shiftNums[f]]=!0));for(var i=0,j=d.length;j>i;i++)if(h[d[i]])return c.apply(this,arguments)}}}}a.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],options:{filterTextInputs:!0}},a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})}(jQuery||this.jQuery||window.jQuery);
define("jquery.hotkeys", ["jquery"], function(){});
 
/*! AdIm - v0.0.0 - 2016-01-05 - Copyright (C) 2016 Université de Lausanne - see licence */
/*! AdIm - v0.0.0 - 2016-03-14 - Copyright (C) 2016 Université de Lausanne - see licence */
define('env/shortcuts',["jquery","paper","signals","adim/config","adim/view","adim/tools","adim/ui","jquery.hotkeys"],function(a,b,c,d,e,f){function g(b){var c=a("#inputGroupSize");return function(){var a=parseInt(c.val(),10)+b;return a>0&&c.val(a).change(),!1}}var h,i=function(){return function(){return!1}},j={"backspace del":[{event:"keydown",ctxt:"edit",fn:function(){return e.removeSelectedItems(),!1}},{event:"keydown",ctxt:"review",fn:i()}],space:[{event:"keydown",ctxt:"edit review",fn:function(){return h||(h=f.getActiveTool(),f.activateTool("pan")),!1}},{event:"keyup",ctxt:"edit review",fn:function(){return h&&(f.activateTool(h),h=null),!1}}],"1 2 3":{ctxt:"edit",fn:function(c){return b.project.selectedItems.length>0&&a("#confidence-input").val([c.key]).change().siblings("[data-value]").trigger("mouseleave"),!1}},a:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("select"),!1}}],"ctrl+a meta+a":[{event:"keydown",ctxt:"edit",fn:function(){return b.project.activeLayer.children.map(function(a){a.selected=!0}),!1}},{event:"keydown",ctxt:"review",fn:i()}],c:[{event:"keydown",ctxt:"edit",fn:function(){return a("#tool-concordantstr").is(":disabled")?!1:(f.activateTool("concordantstr"),!1)}},{event:"keydown",ctxt:"analysis",fn:function(){var b=a("#checkShowConcordance");return b.val([b.is(":checked")?"off":"on"]).change(),!1}}],d:[{event:"keydown",ctxt:"edit",fn:function(){return a("#tool-discordantstr").is(":disabled")?!1:(f.activateTool("discordantstr"),!1)}},{event:"keydown",ctxt:"analysis",fn:function(){var b=a("#checkShowDiscordance");return b.val([b.is(":checked")?"off":"on"]).change(),!1}}],"shift+d shift+c":{ctxt:"edit review",fn:function(){a("#annotation-display-container").find("[data-type-name='concordantstr,discordantstr']").click()}},"e b":[{event:"keydown",ctxt:"edit",fn:function(){return a("#tool-fieldedges").is(":disabled")?!1:(f.activateTool("fieldedges"),!1)}}],"shift+e":{ctxt:"edit review",fn:function(){a("#annotation-display-container").find("[data-type-name='fieldedges']").click()}},f:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("arrow"),!1}}],"shift+i":{ctxt:"edit review",fn:function(){a("#annotation-display-container").find("[data-type-name='image']").click()}},n:[{event:"keydown",ctxt:"analysis",fn:function(){var b=a("#checkShowConfidence");return b.val([b.is(":checked")?"off":"on"]).change(),!1}}],t:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("text"),!1}}],z:[{event:"keydown",ctxt:"edit",fn:function(){return a("#tool-cmsarea").is(":disabled")?!1:(f.activateTool("cmsarea"),!1)}}],"shift+z":{ctxt:"edit review",fn:function(){a("#annotation-display-container").find("[data-type-name='cmsarea']").click()}},up:[{event:"keydown",ctxt:"analysis",fn:g(1)}],down:[{event:"keydown",ctxt:"analysis",fn:g(-1)}]};return j});
/*! AdIm - v0.0.0 - 2016-01-05 - Copyright (C) 2016 Université de Lausanne - see licence */
/*! AdIm - v0.0.0 - 2016-03-14 - Copyright (C) 2016 Université de Lausanne - see licence */
define('env/env',["jquery","underscore","paper","signals","adim/config","adim/view","adim/attributes","adim/io","adim/tools","adim/ui","env/shortcuts"],function(a,b,c,d,e,f,g,h,i,j,k){function l(){function a(a){if(!(a&&["cmsarea","concordantstr"].indexOf(a.data.type)<0)&&(b||(b=f.getOrCreateUserLayer(e.user.id,e.user.full_name)),b)){var d,g,h,i,k=b.children.filter(function(a){return a.data.type&&"cmsarea"===a.data.type}),l=b.children.filter(function(a){return a.data.type&&"concordantstr"===a.data.type}),m=c.project.getSelectedItems(),n=1===m.length&&"cmsarea"===m[0].data.type?m[0]:null,o=n?n.data.prop.nbConcordances:null,p=l.length;for(h=0;d=k[h];h++){for(g=0,i=0;p>i;i++)g+=Math.round(d.getIntersections(l[i]).length/2);d.data.prop.nbConcordances=g}null!==o&&n.data.prop.nbConcordances!==o&&j.displayProperties(n)}}console.info("_initSignalRouting from env/cimaf");var b;i.events.annotationAdded.add(function(b){a(b)},this,100),i.events.annotationChanged.add(function(b){a(1===b.length?b[0]:void 0)},this,100),h.events.annotableLoaded.add(function(a){var b=i.tools.concordantstr,c=i.tools.discordantstr,d=i.tools.cmsarea,e=a.envparam&&a.envparam.cimaf_cut_pos,g=a.envparam&&a.envparam.cimaf_cut_margin;f.events.imageLoaded.add(function(a){e=e||a.raster.scaling.x*a.raster.width/2,g=g||25,b.listeners.onCutPositionChanged(e),b.listeners.onCutMarginChanged(g),c.listeners.onCutPositionChanged(e),d.listeners.onCutPositionChanged(e),d.listeners.onSetAreaWidth(2*g)})},100)}function m(){a(".adim-display-type-selector").find("button").on("click",function(b){var c=a(this),d=!c.hasClass("active"),e=c.data("typeName");b.metaKey?"image"!==e&&f.selectItemsByType(e):(c.toggleClass("active",d),"image"===e?g.setImageOpacity(d?100:0,!0):(f.toggleItemsByType(c.data("typeName"),d),j.enableTool(e,d)))})}return{name:"cimaf",shortcuts:k,initSignalRouting:l,initUI:m}});
/**
* Copyright (C) 2014 Université de Lausanne, RISET,
......@@ -26,8 +26,8 @@
# ----------
# Media path
# ----------
Alias /adim/media/ "/var/django/projects/adim.django/adim_project/media/"
<Directory "/var/django/projects/adim.django/adim_project/media">
Alias /adim/media/ "/nas/data/adim/media/"
<Directory "/nas/data/adim/media">
<IfVersion >= 2.4>
Require all granted
</IfVersion>
......@@ -41,21 +41,15 @@
# ---------------
# Protected Media
# ---------------
<Directory "/var/django/projects/adim.django/adim_project/media/ao_images/">
<IfVersion >= 2.4>
Require all denied
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Deny from all
</IfVersion>
<Directory "/nas/data/adim/media/ao_images/">
Require all denied
# --------------
# XsendFile Conf
# --------------
<IfModule xsendfile_module>
XSendFile On
XSendFilePath "/var/django/projects/adim.django/adim_project/media"
XSendFilePath "/nas/data/adim/media/"
</IfModule>
</Directory>
......@@ -66,7 +60,7 @@
<IfModule mod_shib>
<Location /adim/shibauth/>
AuthType shibboleth
ShibCompatWith24 On
#ShibCompatWith24 On
ShibRequestSetting requireSession true
Require shibboleth
</Location>
......@@ -79,10 +73,10 @@
WSGIDaemonProcess adim.django user=www-data group=www-data
WSGIScriptAlias /adim "/var/django/projects/adim.django/adim_project/adim_project/wsgi/production.py"
<Directory "/var/django/projects/adim.django/adim_project/adim_project">
<Directory "/var/django/projects/adim.django/adim_project/adim_project/wsgi">
WSGIProcessGroup adim.django
WSGIPassAuthorization On
<Files wsgi.py>
# <Files wsgi.py>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
......@@ -90,7 +84,7 @@
Order deny,allow
Allow from all
</IfVersion>
</Files>
# </Files>
</Directory>
RedirectMatch ^/adim$ /adim/
......@@ -106,6 +100,7 @@
RewriteEngine On
## Retourne une 404 au lien d'une 403
RewriteCond %{REMOTE_ADDR} !^130.223.72.159$
RewriteCond %{REMOTE_ADDR} !^130.223.\d+\.\d+.$
RewriteRule ^.*$ - [R=404,L,NS]
</IfModule>
<IfModule !rewrite_module>
......
......@@ -38,6 +38,7 @@ DEBUG = False
ALLOWED_HOSTS = []
ADMINS = (
("Julien Furrer", 'julien.furrer@unil.ch'),
("Marion Chardon", 'marion.chardon@unil.ch'),
)
MANAGERS = ADMINS
......@@ -371,7 +372,7 @@ DJANGO_APPS = (
INSTALLED_APPS = DJANGO_APPS + LOCAL_APPS
# ---------- END APPS CONFIGURATION
SERVER_EMAIL = 'julien.furrer@unil.ch'
SERVER_EMAIL = 'marion.chardon@unil.ch'
EMAIL_HOST = "smtp.unil.ch"
......
......@@ -3,6 +3,7 @@ Settings for production server
"""
from .base import *
MEDIA_ROOT = '/nas/data/adim/media'
update_urls('/adim/', __name__)
......
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