diff -r 3d19cbe56fcb -r 3f20f286d43e src/js/libs/renkan.min.js --- a/src/js/libs/renkan.min.js Fri Sep 18 15:08:36 2015 +0200 +++ b/src/js/libs/renkan.min.js Fri Sep 18 17:42:42 2015 +0200 @@ -1,191 +1,35 @@ -/* - * _____ _ - * | __ \ | | - * | |__) |___ _ __ | | ____ _ _ __ - * | _ // _ \ '_ \| |/ / _` | '_ \ +/*! + * _____ _ + * | __ \ | | + * | |__) |___ _ __ | | ____ _ _ __ + * | _ // _ \ '_ \| |/ / _` | '_ \ * | | \ \ __/ | | | < (_| | | | | * |_| \_\___|_| |_|_|\_\__,_|_| |_| * - * Copyright 2012-2013 Institut de recherche et d'innovation - * contributor(s) : Yves-Marie Haussonne, Raphael Velt, Samuel Huron - * + * Copyright 2012-2015 Institut de recherche et d'innovation + * contributor(s) : Yves-Marie Haussonne, Raphael Velt, Samuel Huron, + * Thibaut CavaliƩ, Julien Rougeron. + * * contact@iri.centrepompidou.fr - * http://www.iri.centrepompidou.fr - * + * http://www.iri.centrepompidou.fr + * * This software is a computer program whose purpose is to show and add annotations on a video . * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, + * abiding by the rules of distribution of free software. You can use, * modify and/ or redistribute the software under the terms of the CeCILL-C * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * + * "http://www.cecill.info". + * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. -*/(function(o){if(typeof o.Rkns!=="object")o.Rkns={};var e=o.Rkns,h=e.$=o.jQuery,r=e._=o._;e.VERSION="0.2.2";e.pickerColors=["#8f1919","#a80000","#d82626","#ff0000","#e87c7c","#ff6565","#f7d3d3","#fecccc","#8f5419","#a85400","#d87f26","#ff7f00","#e8b27c","#ffb265","#f7e5d3","#fee5cc","#8f8f19","#a8a800","#d8d826","#feff00","#e8e87c","#feff65","#f7f7d3","#fefecc","#198f19","#00a800","#26d826","#00ff00","#7ce87c","#65ff65","#d3f7d3","#ccfecc","#198f8f","#00a8a8","#26d8d8","#00feff","#7ce8e8","#65feff", -"#d3f7f7","#ccfefe","#19198f","#0000a8","#2626d8","#0000ff","#7c7ce8","#6565ff","#d3d3f7","#ccccfe","#8f198f","#a800a8","#d826d8","#ff00fe","#e87ce8","#ff65fe","#f7d3f7","#feccfe","#000000","#242424","#484848","#6d6d6d","#919191","#b6b6b6","#dadada","#ffffff"];e.__renkans=[];var y=e._BaseBin=function(m,d){if(typeof m!=="undefined"){this.renkan=m;this.renkan.$.find(".Rk-Bin-Main").hide();this.$=e.$("
  • ").addClass("Rk-Bin").appendTo(m.$.find(".Rk-Bin-List"));this.title_icon_$=e.$("").addClass("Rk-Bin-Title-Icon").appendTo(this.$); -var n=this;e.$("").attr({href:"#",title:m.translate("Close bin")}).addClass("Rk-Bin-Close").html("×").appendTo(this.$).click(function(){n.destroy();m.$.find(".Rk-Bin-Main:visible").length||m.$.find(".Rk-Bin-Main:last").slideDown();m.resizeBins();return false});e.$("").attr({href:"#",title:m.translate("Refresh bin")}).addClass("Rk-Bin-Refresh").appendTo(this.$).click(function(){n.refresh();return false});this.count_$=e.$("
    ").addClass("Rk-Bin-Count").appendTo(this.$);this.title_$=e.$("

    ").addClass("Rk-Bin-Title").appendTo(this.$); -this.main_$=e.$("
    ").addClass("Rk-Bin-Main").appendTo(this.$).html('

    '+m.translate("Loading, please wait")+"

    ");this.title_$.html(d.title||"(new bin)");this.renkan.resizeBins();d.auto_refresh&&window.setInterval(function(){n.refresh()},d.auto_refresh)}};y.prototype.destroy=function(){this.$.detach();this.renkan.resizeBins()};o=e.Renkan=function(m){var d=this;e.__renkans.push(this);this.options=r.defaults(m,e.defaults);r(this.options.property_files).each(function(i){e.$.getJSON(i, -function(s){d.options.properties=d.options.properties.concat(s)})});this.read_only=this.options.read_only||!this.options.editor_mode;this.project=new e.Models.Project;if(typeof this.options.user_id!=="undefined")this.current_user=this.options.user_id;this.$=e.$("#"+this.options.container);this.$.addClass("Rk-Main").html(this.template(this));this.tabs=[];this.search_engines=[];this.current_user_list=new e.Models.UsersList;this.current_user_list.on("add remove",function(){this.renderer&&this.renderer.redrawUsers()}); -this.colorPicker=function(){var i=r.template('
  • ');return'
      '+e.pickerColors.map(function(s){return i({c:s})}).join("")+"
    "}();if(this.options.show_editor)this.renderer=new e.Renderer.Scene(this);if(this.options.search.length){var n=r.template('
  • <%= title %>
  • '),q=this.$.find(".Rk-Search-List"),C=this.$.find(".Rk-Web-Search-Input"),G=this.$.find(".Rk-Web-Search-Form"); -r(this.options.search).each(function(i){e[i.type]&&e[i.type].Search&&d.search_engines.push(new e[i.type].Search(d,i))});q.html(r(this.search_engines).map(function(i,s){return n({key:s,title:i.getSearchTitle(),className:i.getBgClass()})}).join(""));q.find("li").click(function(){var i=e.$(this);d.setSearchEngine(i.attr("data-key"));G.submit()});G.submit(function(){if(C.val()){var i=d.search_engine;i.search(C.val())}return false});this.$.find(".Rk-Search-Current").mouseenter(function(){q.slideDown()}); -this.$.find(".Rk-Search-Select").mouseleave(function(){q.hide()});this.setSearchEngine(0)}else this.$.find(".Rk-Web-Search-Form").detach();r(this.options.bins).each(function(i){e[i.type]&&e[i.type].Bin&&d.tabs.push(new e[i.type].Bin(d,i))});var z=false;this.$.find(".Rk-Bins").on("click",".Rk-Bin-Title,.Rk-Bin-Title-Icon",function(){var i=e.$(this).siblings(".Rk-Bin-Main");if(i.is(":hidden")){d.$.find(".Rk-Bin-Main").slideUp();i.slideDown()}});this.options.show_editor&&this.$.find(".Rk-Bins").on("mouseover", -".Rk-Bin-Item",function(){var i=e.$(this);if(i&&h(i).attr("data-uri")){var s=d.project.get("nodes").where({uri:h(i).attr("data-uri")});r(s).each(function(D){d.renderer.highlightModel(D)})}}).mouseout(function(){d.renderer.unhighlightAll()}).on("mousemove",".Rk-Bin-Item",function(){try{this.dragDrop()}catch(i){}}).on("touchstart",".Rk-Bin-Item",function(){z=false}).on("touchmove",".Rk-Bin-Item",function(i){i.preventDefault();i=i.originalEvent.changedTouches[0];var s=d.renderer.canvas_$.offset(),D= -d.renderer.canvas_$.width(),I=d.renderer.canvas_$.height();if(i.pageX>=s.left&&i.pageX=s.top&&i.pageY1?i:null);if(s.source!==F){F=s.source;r(d.tabs).each(function(D){D.render(s)})}}});this.$.find(".Rk-Bins-Search-Form").submit(function(){return false})}; -o.prototype.template=r.template('<% if (options.show_bins) { %>

    <%- translate("Select contents:")%>

    " />
      " />
      " />" />
        <% } %><% if (options.show_editor) { %>
        <% } %>'); -o.prototype.translate=function(m){if(e.i18n[this.options.language]&&e.i18n[this.options.language][m])return e.i18n[this.options.language][m];if(this.options.language.length>2&&e.i18n[this.options.language.substr(0,2)]&&e.i18n[this.options.language.substr(0,2)][m])return e.i18n[this.options.language.substr(0,2)][m];return m};o.prototype.onStatusChange=function(){this.renderer.onStatusChange()};o.prototype.setSearchEngine=function(m){this.search_engine=this.search_engines[m];this.$.find(".Rk-Search-Current").attr("class", -"Rk-Search-Current "+this.search_engine.getBgClass())};o.prototype.resizeBins=function(){var m=+this.$.find(".Rk-Bins-Head").outerHeight();this.$.find(".Rk-Bin-Title:visible").each(function(){m+=e.$(this).outerHeight()});this.$.find(".Rk-Bin-Main").css({height:this.$.find(".Rk-Bins").height()-m})};e.Utils={getUID:function(){function m(q){return q<10?"0"+q:q}var d=new Date,n=0;d.getUTCFullYear();m(d.getUTCMonth()+1);m(d.getUTCDate());(function(q){for(var C="",G=0;G"+ -a.translate("Drag items from this website, drop them in Renkan").replace(/ /g,"_")+"

        '.replace(/_/g,String.fromCharCode(32));b.appendChild(d);e=[{r:/https?:\\/\\/[^\\/]*twitter\\.com\\//,s:'.tweet',n:'twitter'},{r:/https?:\\/\\/[^\\/]*google\\.[^\\/]+\\//,s:'.g',n:'google'},{r:/https?:\\/\\/[^\\/]*lemonde\\.fr\\//,s:'[data-vr-contentbox]',n:'lemonde'}];f=false;e.forEach(function(g){if(g.r.test(c)){f=g;}});if(f){h=function(){Array.prototype.forEach.call(a.querySelectorAll(f.s),function(i){i[j]=true;k=i.style;k.borderWidth='2px';k.borderColor='#909';k.borderStyle='solid';k.backgroundColor='rgba(200,0,180,.1)';})};window.setInterval(h,500);h();};a.addEventListener('dragstart',function(k){l=k.dataTransfer;l.setData(m+'source-uri',c);l.setData(m+'source-title',a.title);n=k.target;if(f){o=n;while(!o.attributes[j]){o=o.parentNode;if(o==b){break;}}}if(f&&o.attributes[j]){p=o.cloneNode(true);l.setData(m+'specific-site',f.n)}else{q=a.getSelection();if(q.type==='Range'||!q.type){p=q.getRangeAt(0).cloneContents();}else{p=n.cloneNode();}}r=a.createElement('div');r.appendChild(p);l.setData('text/x-iri-selected-text',r.textContent.trim());l.setData('text/x-iri-selected-html',r.innerHTML);},false);})();"}, -R=function(a,b){return a.length>b?a.substr(0,b)+"\u2026":a},M=function(a,b,c,j,g){g.css({width:a.tooltip_width-2*a.tooltip_padding});var f=g.outerHeight()+2*a.tooltip_padding,u=b.xpaper.view.size.height-a.tooltip_margin)p=Math.max(paper.view.size.height-a.tooltip_margin,b.y+a.tooltip_arrow_width/2)-f;if(p').appendTo(this.renderer.labels_$);if(this.options.editor_mode){this.normal_buttons=[new fa(this.renderer,null),new ga(this.renderer,null),new ha(this.renderer,null),new ia(this.renderer,null),new ja(this.renderer,null)];this.pending_delete_buttons=[new ka(this.renderer,null)];this.all_buttons=this.normal_buttons.concat(this.pending_delete_buttons);for(var a=0;a$1')):this.title.text(f);this.title.css({left:this.paper_coords.x,top:this.paper_coords.y+this.circle_radius*this.h_ratio+this.options.node_label_distance,opacity:g});var u=this.model.get("color")||(this.model.get("created_by")||J(this.renkan)).get("color");this.circle.strokeColor=u;var A=this.paper_coords;this.all_buttons.forEach(function(p){p.moveTo(A)});j=this.img;(this.img=this.model.get("image"))&&this.img!==j&&this.showImage();if(this.node_image&&!this.img){this.node_image.remove(); -delete this.node_image}if(this.renderer.minimap){this.minimap_circle.fillColor=u;j=this.renderer.toMinimapCoords(b);g=this.renderer.minimap.scale*c;g=new paper.Size([g,g]);this.minimap_circle.fitBounds(j.subtract(g),g.multiply(2))}if(!a){var v=this;h.each(this.project.get("edges").filter(function(p){return p.get("to")===v.model||p.get("from")===v.model}),function(p){(p=v.renderer.getRepresentationByModel(p))&&typeof p.from_representation!=="undefined"&&typeof p.from_representation.paper_coords!== -"undefined"&&typeof p.to_representation!=="undefined"&&typeof p.to_representation.paper_coords!=="undefined"&&p.redraw()})}},showImage:function(){if(typeof this.renderer.image_cache[this.img]==="undefined"){var a=new Image;this.renderer.image_cache[this.img]=a;a.src=this.img}else a=this.renderer.image_cache[this.img];if(a.width){this.node_image&&this.node_image.remove();this.renderer.node_layer.activate();var b=a.width,c=a.height,j=this.model.get("clip-path"),g=typeof j!=="undefined"&&j;if(g){var f= -new paper.Path;j=j.match(/[a-z][^a-z]+/gi)||[];var u=[0,0],A=Infinity,v=Infinity,p=-Infinity,B=-Infinity,x=function(w,T){var V=w.slice(1).map(function(K,Z){var O=parseFloat(K),$=Z%2;O=$?(O-0.5)*c:(O-0.5)*b;if(T)O+=u[$];if($){v=Math.min(v,O);B=Math.max(B,O)}else{A=Math.min(A,O);p=Math.max(p,O)}return O});u=V.slice(-2);return V};j.forEach(function(w){w=w.match(/([a-z]|[0-9.-]+)/ig)||[""];switch(w[0]){case "M":f.moveTo(x(w));break;case "m":f.moveTo(x(w,true));break;case "L":f.lineTo(x(w));break;case "l":f.lineTo(x(w, -true));break;case "C":f.cubicCurveTo(x(w));break;case "c":f.cubicCurveTo(x(w,true));break;case "Q":f.quadraticCurveTo(x(w));break;case "q":f.quadraticCurveTo(x(w,true));break}});j=Math[this.options.node_images_fill_mode?"min":"max"](p-A,B-v)/2;var E=new paper.Point((p+A)/2,(B+v)/2);if(!this.options.show_node_circles)this.h_ratio=(B-v)/(2*j)}else{j=Math[this.options.node_images_fill_mode?"min":"max"](b,c)/2;E=new paper.Point(0,0);if(!this.options.show_node_circles)this.h_ratio=c/(2*j)}var H=new paper.Raster(a); -if(g){H=new paper.Group(f,H);H.opacity=0.99;H.clipped=true;f.__representation=this}if(this.options.clip_node_images){var l=new paper.Path.Circle(E,j);H=new paper.Group(l,H);H.opacity=0.99;H.clipped=true;l.__representation=this}this.image_delta=E.divide(j);this.node_image=H;this.node_image.__representation=t;this.node_image.scale(this.circle_radius/j);this.node_image.position=this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius));this.redraw();this.renderer.throttledPaperDraw()}else{var t= -this;r(a).on("load",function(){t.showImage()})}},paperShift:function(a){if(this.options.editor_mode){if(!this.renkan.read_only){this.is_dragging=true;this.paper_coords=this.paper_coords.add(a);this.redraw()}}else this.renderer.paperShift(a)},openEditor:function(){this.renderer.removeRepresentationsOfType("editor");var a=this.renderer.addRepresentation("NodeEditor",null);a.source_representation=this;a.draw()},select:function(){this.selected=true;this.circle.strokeWidth=this.options.selected_node_stroke_width; -this.renderer.isEditable()&&this.active_buttons.forEach(function(b){b.show()});var a=this.model.get("uri");a&&r(".Rk-Bin-Item").each(function(){var b=r(this);b.attr("data-uri")==a&&b.addClass("selected")});this.options.editor_mode||this.openEditor();if(this.renderer.minimap){this.minimap_circle.strokeWidth=this.options.minimap_highlight_weight;this.minimap_circle.strokeColor=this.options.minimap_highlight_color}this._super("select")},unselect:function(a){if(!a||a.source_representation!==this){this.selected= -false;this.all_buttons.forEach(function(b){b.hide()});this.circle.strokeWidth=this.options.node_stroke_width;r(".Rk-Bin-Item").removeClass("selected");if(this.renderer.minimap)this.minimap_circle.strokeColor=undefined;this._super("unselect")}},highlight:function(a){a=a||true;if(this.highlighted!==a){this.highlighted=a;this.redraw();this.renderer.throttledPaperDraw()}},unhighlight:function(){if(this.highlighted){this.highlighted=false;this.redraw();this.renderer.throttledPaperDraw()}},saveCoords:function(){var a= -this.renderer.toModelCoords(this.paper_coords),b={position:{x:a.x,y:a.y}};this.renderer.isEditable()&&this.model.set(b)},mousedown:function(a,b){if(b){this.renderer.unselectAll();this.select()}},mouseup:function(a,b){if(this.renderer.is_dragging&&this.renderer.isEditable())this.saveCoords();else{!b&&!this.model.get("delete_scheduled")&&this.openEditor();this.model.trigger("clicked")}this.renderer.click_target=null;this.is_dragging=this.renderer.is_dragging=false},destroy:function(){this._super("destroy"); -this.all_buttons.forEach(function(a){a.destroy()});this.circle.remove();this.title.remove();this.renderer.minimap&&this.minimap_circle.remove();this.node_image&&this.node_image.remove()}});o=y.Edge=e.Utils.inherit(S);h(o.prototype).extend({_init:function(){this.renderer.edge_layer.activate();this.type="Edge";this.from_representation=this.renderer.getRepresentationByModel(this.model.get("from"));this.to_representation=this.renderer.getRepresentationByModel(this.model.get("to"));this.bundle=this.renderer.addToBundles(this); -this.line=new paper.Path;this.line.add([0,0],[0,0],[0,0]);this.line.__representation=this;this.line.strokeWidth=this.options.edge_stroke_width;this.arrow=new paper.Path;this.arrow.add([0,0],[this.options.edge_arrow_length,this.options.edge_arrow_width/2],[0,this.options.edge_arrow_width]);this.arrow.__representation=this;this.text=r('
        ').appendTo(this.renderer.labels_$);this.arrow_angle=0;if(this.options.editor_mode){this.normal_buttons=[new la(this.renderer,null), -new ma(this.renderer,null)];this.pending_delete_buttons=[new na(this.renderer,null)];this.all_buttons=this.normal_buttons.concat(this.pending_delete_buttons);for(var a=0;a90){E-=180;H=H.multiply(-1)}if(E<-90){E+=180;H=H.multiply(-1)}var w=this.model.get("title")||this.renkan.translate(this.options.label_untitled_edges)||"";w=R(w,this.options.node_label_max_length);this.text.text(w);var T=this.paper_coords.add(H);this.text.css({left:T.x,top:T.y,transform:"rotate("+E+"deg)","-moz-transform":"rotate("+E+"deg)","-webkit-transform":"rotate("+ -E+"deg)",opacity:a});this.text_angle=E;var V=this.paper_coords;this.all_buttons.forEach(function(K){K.moveTo(V)});if(this.renderer.minimap){this.minimap_line.strokeColor=t;this.minimap_line.segments[0].point=this.renderer.toMinimapCoords(new paper.Point(this.from_representation.model.get("position")));this.minimap_line.segments[1].point=this.renderer.toMinimapCoords(new paper.Point(this.to_representation.model.get("position")))}}}},openEditor:function(){this.renderer.removeRepresentationsOfType("editor"); -var a=this.renderer.addRepresentation("EdgeEditor",null);a.source_representation=this;a.draw()},select:function(){this.selected=true;this.line.strokeWidth=this.options.selected_edge_stroke_width;this.renderer.isEditable()&&this.active_buttons.forEach(function(a){a.show()});this.options.editor_mode||this.openEditor();this._super("select")},unselect:function(a){if(!a||a.source_representation!==this){this.selected=false;this.options.editor_mode&&this.all_buttons.forEach(function(b){b.hide()});this.line.strokeWidth= -this.options.edge_stroke_width;this._super("unselect")}},mousedown:function(a,b){if(b){this.renderer.unselectAll();this.select()}},mouseup:function(a,b){if(!this.renkan.read_only&&this.renderer.is_dragging){this.from_representation.saveCoords();this.to_representation.saveCoords();this.from_representation.is_dragging=false;this.to_representation.is_dragging=false}else{b||this.openEditor();this.model.trigger("clicked")}this.renderer.click_target=null;this.renderer.is_dragging=false},paperShift:function(a){if(this.options.editor_mode){if(!this.options.read_only){this.from_representation.paperShift(a); -this.to_representation.paperShift(a)}}else this.renderer.paperShift(a)},destroy:function(){this._super("destroy");this.line.remove();this.arrow.remove();this.text.remove();this.renderer.minimap&&this.minimap_line.remove();this.all_buttons.forEach(function(b){b.destroy()});var a=this;this.bundle.edges=h(this.bundle.edges).reject(function(b){return b===a})}});o=y.TempEdge=e.Utils.inherit(S);h(o.prototype).extend({_init:function(){this.renderer.edge_layer.activate();this.type="Temp-edge";var a=(this.project.get("users").get(this.renkan.current_user)|| -J(this.renkan)).get("color");this.line=new paper.Path;this.line.strokeColor=a;this.line.dashArray=[4,2];this.line.strokeWidth=this.options.selected_edge_stroke_width;this.line.add([0,0],[0,0]);this.line.__representation=this;this.arrow=new paper.Path;this.arrow.fillColor=a;this.arrow.add([0,0],[this.options.edge_arrow_length,this.options.edge_arrow_width/2],[0,this.options.edge_arrow_width]);this.arrow.__representation=this;this.arrow_angle=0},redraw:function(){var a=this.from_representation.paper_coords, -b=this.end_pos,c=b.subtract(a).angle,j=a.add(b).divide(2);this.line.segments[0].point=a;this.line.segments[1].point=b;this.arrow.rotate(c-this.arrow_angle);this.arrow.position=j;this.arrow_angle=c},paperShift:function(a){if(this.renderer.isEditable()){this.end_pos=this.end_pos.add(a);var b=paper.project.hitTest(this.end_pos);this.renderer.findTarget(b);this.redraw()}else{this.renderer.removeRepresentation(_this);paper.view.draw()}},mouseup:function(a){var b=paper.project.hitTest(a.point),c=this.from_representation.model, -j=true;if(b&&typeof b.item.__representation!=="undefined"){var g=b.item.__representation;if(g.type.substr(0,4)==="Node"){var f=g.model||g.source_representation.model;if(c!==f){var u={id:e.Utils.getUID("edge"),created_by:this.renkan.current_user,from:c,to:f};this.renderer.isEditable()&&this.project.addEdge(u)}}if(c===g.model||g.source_representation&&g.source_representation.model===c){j=false;this.renderer.is_dragging=true}}if(j){this.renderer.click_target=null;this.renderer.is_dragging=false;this.renderer.removeRepresentation(this); -paper.view.draw()}},destroy:function(){this.arrow.remove();this.line.remove()}});var ba=y._BaseEditor=e.Utils.inherit(S);h(ba.prototype).extend({_init:function(){this.renderer.buttons_layer.activate();this.type="editor";this.editor_block=new paper.Path;var a=h(h.range(8)).map(function(){return[0,0]});this.editor_block.add.apply(this.editor_block,a);this.editor_block.strokeWidth=this.options.tooltip_border_width;this.editor_block.strokeColor=this.options.tooltip_border_color;this.editor_block.opacity= -0.8;this.editor_$=r("
        ").appendTo(this.renderer.editor_$).css({position:"absolute",opacity:0.8}).hide()},destroy:function(){this.editor_block.remove();this.editor_$.remove()}});o=y.NodeEditor=e.Utils.inherit(ba);h(o.prototype).extend({template:h.template('

        ×<%-renkan.translate("Edit Node")%>

        <% if (options.show_node_editor_uri) { %>

        <% } %><% if (options.show_node_editor_description) { %>

        <% } %><% if (options.show_node_editor_size) { %>

        <%-renkan.translate("Size:")%>-<%-node.size%>+

        <% } %><% if (options.show_node_editor_color) { %>
        <%-renkan.translate("Node color:")%>
        <%= renkan.colorPicker %><%- renkan.translate("Choose color") %>
        <% } %><% if (options.show_node_editor_image) { %>
        <% if (node.clip_path) { %><% }%>

        <% } %><% if (options.show_node_editor_creator && node.has_creator) { %>

        <%-renkan.translate("Created by:")%> <%- shortenText(node.created_by_title, 25) %>

        <% } %>'), -readOnlyTemplate:h.template('

        ×<% if (options.show_node_tooltip_color) { %><% } %><% if (node.uri) { %><% } %><%-node.title%><% if (node.uri) { %><% } %>

        <% if (node.uri && options.show_node_tooltip_uri) { %>

        <%-node.short_uri%>

        <% } %><% if (options.show_node_tooltip_description) { %>

        <%-node.description%>

        <% } %><% if (node.image && options.show_node_tooltip_image) { %><% } %><% if (node.has_creator && options.show_node_tooltip_creator) { %>

        <%-renkan.translate("Created by:")%><%- shortenText(node.created_by_title, 25) %>

        <% } %>'), -draw:function(){var a=this.source_representation.model,b=a.get("created_by")||J(this.renkan),c=this.renderer.isEditable()?this.template:this.readOnlyTemplate,j=this.options.static_url+"img/image-placeholder.png",g=a.get("size")||0;this.editor_$.html(c({node:{has_creator:!!a.get("created_by"),title:a.get("title"),uri:a.get("uri"),short_uri:R((a.get("uri")||"").replace(/^(https?:\/\/)?(www\.)?/,"").replace(/\/$/,""),40),description:a.get("description"),image:a.get("image")||"",image_placeholder:j,color:a.get("color")|| -b.get("color"),clip_path:a.get("clip-path")||false,created_by_color:b.get("color"),created_by_title:b.get("title"),size:(g>0?"+":"")+g},renkan:this.renkan,options:this.options,shortenText:R}));this.redraw();var f=this,u=function(){f.renderer.removeRepresentation(f);paper.view.draw()};this.editor_$.find(".Rk-CloseX").click(u);this.editor_$.find(".Rk-Edit-Goto").click(function(){if(!a.get("uri"))return false});if(this.renderer.isEditable()){var A=h(function(){h(function(){if(f.renderer.isEditable()){var x= -{title:f.editor_$.find(".Rk-Edit-Title").val()};if(f.options.show_node_editor_uri){x.uri=f.editor_$.find(".Rk-Edit-URI").val();f.editor_$.find(".Rk-Edit-Goto").attr("href",x.uri||"#")}if(f.options.show_node_editor_image){x.image=f.editor_$.find(".Rk-Edit-Image").val();f.editor_$.find(".Rk-Edit-ImgPreview").attr("src",x.image||j)}if(f.options.show_node_editor_description)x.description=f.editor_$.find(".Rk-Edit-Description").val();a.set(x);f.redraw()}else u()}).defer()}).throttle(500);this.editor_$.on("keyup", -function(x){x.keyCode===27&&u()});this.editor_$.find("input, textarea").on("change keyup paste",A);this.editor_$.find(".Rk-Edit-Image-File").change(function(){if(this.files.length){var x=this.files[0],E=new FileReader;if(x.type.substr(0,5)!=="image")alert(f.renkan.translate("This file is not an image"));else if(x.size>f.options.uploaded_image_max_kb*1024)alert(f.renkan.translate("Image size must be under ")+f.options.uploaded_image_max_kb+f.renkan.translate("KB"));else{E.onload=function(H){f.editor_$.find(".Rk-Edit-Image").val(H.target.result); -A()};E.readAsDataURL(x)}}});this.editor_$.find(".Rk-Edit-Title")[0].focus();var v=f.editor_$.find(".Rk-Edit-ColorPicker");this.editor_$.find(".Rk-Edit-ColorPicker-Wrapper").hover(function(x){x.preventDefault();v.show()},function(x){x.preventDefault();v.hide()});v.find("li").hover(function(x){x.preventDefault();f.editor_$.find(".Rk-Edit-Color").css("background",r(this).attr("data-color"))},function(x){x.preventDefault();f.editor_$.find(".Rk-Edit-Color").css("background",a.get("color")||(a.get("created_by")|| -J(f.renkan)).get("color"))}).click(function(x){x.preventDefault();if(f.renderer.isEditable()){a.set("color",r(this).attr("data-color"));v.hide();paper.view.draw()}else u()});var p=function(x){if(f.renderer.isEditable()){var E=x+(a.get("size")||0);f.editor_$.find(".Rk-Edit-Size-Value").text((E>0?"+":"")+E);a.set("size",E);paper.view.draw()}else u()};this.editor_$.find(".Rk-Edit-Size-Down").click(function(){p(-1);return false});this.editor_$.find(".Rk-Edit-Size-Up").click(function(){p(1);return false})}else if(typeof this.source_representation.highlighted=== -"object"){var B=this.source_representation.highlighted.replace(h(a.get("title")).escape(),'$1');this.editor_$.find(".Rk-Display-Title"+(a.get("uri")?" a":"")).html(B);this.options.show_node_tooltip_description&&this.editor_$.find(".Rk-Display-Description").html(this.source_representation.highlighted.replace(h(a.get("description")).escape(),'$1'))}this.editor_$.find("img").load(function(){f.redraw()})},redraw:function(){var a= -this.source_representation.paper_coords;M(this.options,a,this.editor_block,this.source_representation.circle_radius*0.75,this.editor_$);this.editor_$.show();paper.view.draw()}});o=y.EdgeEditor=e.Utils.inherit(ba);h(o.prototype).extend({template:h.template('

        ×<%-renkan.translate("Edit Edge")%>

        <% if (options.show_edge_editor_uri) { %>

        <% if (options.properties.length) { %>

        <% } } %><% if (options.show_edge_editor_color) { %>
        <%-renkan.translate("Edge color:")%>
        <%= renkan.colorPicker %><%- renkan.translate("Choose color") %>
        <% } %><% if (options.show_edge_editor_direction) { %>

        <%- renkan.translate("Change edge direction") %>

        <% } %><% if (options.show_edge_editor_nodes) { %>

        <%-renkan.translate("From:")%><%- shortenText(edge.from_title, 25) %>

        <%-renkan.translate("To:")%><%- shortenText(edge.to_title, 25) %>

        <% } %><% if (options.show_edge_editor_creator && edge.has_creator) { %>

        <%-renkan.translate("Created by:")%><%- shortenText(edge.created_by_title, 25) %>

        <% } %>'), -readOnlyTemplate:h.template('

        ×<% if (options.show_edge_tooltip_color) { %><% } %><% if (edge.uri) { %><% } %><%-edge.title%><% if (edge.uri) { %><% } %>

        <% if (options.show_edge_tooltip_uri && edge.uri) { %>

        <%-edge.short_uri%>

        <% } %>

        <%-edge.description%>

        <% if (options.show_edge_tooltip_nodes) { %>

        <%-renkan.translate("From:")%><%- shortenText(edge.from_title, 25) %>

        <%-renkan.translate("To:")%><%- shortenText(edge.to_title, 25) %>

        <% } %><% if (options.show_edge_tooltip_creator && edge.has_creator) { %>

        <%-renkan.translate("Created by:")%><%- shortenText(edge.created_by_title, 25) %>

        <% } %>'), -draw:function(){var a=this.source_representation.model,b=a.get("from"),c=a.get("to"),j=a.get("created_by")||J(this.renkan),g=this.renderer.isEditable()?this.template:this.readOnlyTemplate;this.editor_$.html(g({edge:{has_creator:!!a.get("created_by"),title:a.get("title"),uri:a.get("uri"),short_uri:R((a.get("uri")||"").replace(/^(https?:\/\/)?(www\.)?/,"").replace(/\/$/,""),40),description:a.get("description"),color:a.get("color")||j.get("color"),from_title:b.get("title"),to_title:c.get("title"),from_color:b.get("color")|| -(b.get("created_by")||J(this.renkan)).get("color"),to_color:c.get("color")||(c.get("created_by")||J(this.renkan)).get("color"),created_by_color:j.get("color"),created_by_title:j.get("title")},renkan:this.renkan,shortenText:R,options:this.options}));this.redraw();var f=this,u=function(){f.renderer.removeRepresentation(f);paper.view.draw()};this.editor_$.find(".Rk-CloseX").click(u);this.editor_$.find(".Rk-Edit-Goto").click(function(){if(!a.get("uri"))return false});if(this.renderer.isEditable()){var A= -h(function(){h(function(){if(f.renderer.isEditable()){var p={title:f.editor_$.find(".Rk-Edit-Title").val()};if(f.options.show_edge_editor_uri)p.uri=f.editor_$.find(".Rk-Edit-URI").val();f.editor_$.find(".Rk-Edit-Goto").attr("href",p.uri||"#");a.set(p);paper.view.draw()}else u()}).defer()}).throttle(500);this.editor_$.on("keyup",function(p){p.keyCode===27&&u()});this.editor_$.find("input").on("keyup change paste",A);this.editor_$.find(".Rk-Edit-Vocabulary").change(function(){var p=r(this),B=p.val(); -if(B){f.editor_$.find(".Rk-Edit-Title").val(p.find(":selected").text());f.editor_$.find(".Rk-Edit-URI").val(B);A()}});this.editor_$.find(".Rk-Edit-Direction").click(function(){if(f.renderer.isEditable()){a.set({from:a.get("to"),to:a.get("from")});f.draw()}else u()});var v=f.editor_$.find(".Rk-Edit-ColorPicker");this.editor_$.find(".Rk-Edit-ColorPicker-Wrapper").hover(function(p){p.preventDefault();v.show()},function(p){p.preventDefault();v.hide()});v.find("li").hover(function(p){p.preventDefault(); -f.editor_$.find(".Rk-Edit-Color").css("background",r(this).attr("data-color"))},function(p){p.preventDefault();f.editor_$.find(".Rk-Edit-Color").css("background",a.get("color")||(a.get("created_by")||J(f.renkan)).get("color"))}).click(function(p){p.preventDefault();if(f.renderer.isEditable()){a.set("color",r(this).attr("data-color"));v.hide();paper.view.draw()}else u()})}},redraw:function(){var a=this.source_representation.paper_coords;M(this.options,a,this.editor_block,5,this.editor_$);this.editor_$.show(); -paper.view.draw()}});var W=y._NodeButton=e.Utils.inherit(Y);h(W.prototype).extend({setSectorSize:function(){var a=this.source_representation.circle_radius;if(a!==this.lastSectorInner){this.sector&&this.sector.destroy();this.sector=this.renderer.drawSector(this,1+a,d+a,this.startAngle,this.endAngle,1,this.imageName,this.renkan.translate(this.text));this.lastSectorInner=a}}});var fa=y.NodeEditButton=e.Utils.inherit(W);h(fa.prototype).extend({_init:function(){this.type="Node-edit-button";this.lastSectorInner= -0;this.startAngle=-135;this.endAngle=-45;this.imageName="edit";this.text="Edit"},mouseup:function(){this.renderer.is_dragging||this.source_representation.openEditor()}});var ga=y.NodeRemoveButton=e.Utils.inherit(W);h(ga.prototype).extend({_init:function(){this.type="Node-remove-button";this.startAngle=this.lastSectorInner=0;this.endAngle=90;this.imageName="remove";this.text="Remove"},mouseup:function(){this.renderer.click_target=null;this.renderer.is_dragging=false;this.renderer.removeRepresentationsOfType("editor"); -if(this.renderer.isEditable())if(this.options.element_delete_delay){var a=e.Utils.getUID("delete");this.renderer.delete_list.push({id:a,time:(new Date).valueOf()+this.options.element_delete_delay});this.source_representation.model.set("delete_scheduled",a)}else confirm(this.renkan.translate("Do you really wish to remove node ")+'"'+this.source_representation.model.get("title")+'"?')&&this.project.removeNode(this.source_representation.model)}});var ka=y.NodeRevertButton=e.Utils.inherit(W);h(ka.prototype).extend({_init:function(){this.type= -"Node-revert-button";this.lastSectorInner=0;this.startAngle=-135;this.endAngle=135;this.imageName="revert";this.text="Cancel deletion"},mouseup:function(){this.renderer.click_target=null;this.renderer.is_dragging=false;this.renderer.isEditable()&&this.source_representation.model.unset("delete_scheduled")}});var ha=y.NodeLinkButton=e.Utils.inherit(W);h(ha.prototype).extend({_init:function(){this.type="Node-link-button";this.lastSectorInner=0;this.startAngle=90;this.endAngle=180;this.imageName="link"; -this.text="Link to another node"},mousedown:function(a){if(this.renderer.isEditable()){var b=this.renderer.canvas_$.offset(),c=new paper.Point([a.pageX-b.left,a.pageY-b.top]);this.renderer.click_target=null;this.renderer.removeRepresentationsOfType("editor");this.renderer.addTempEdge(this.source_representation,c)}}});var ia=y.NodeEnlargeButton=e.Utils.inherit(W);h(ia.prototype).extend({_init:function(){this.type="Node-enlarge-button";this.lastSectorInner=0;this.startAngle=-45;this.endAngle=0;this.imageName= -"enlarge";this.text="Enlarge"},mouseup:function(){var a=1+(this.source_representation.model.get("size")||0);this.source_representation.model.set("size",a);this.source_representation.select();this.select();paper.view.draw()}});var ja=y.NodeShrinkButton=e.Utils.inherit(W);h(ja.prototype).extend({_init:function(){this.type="Node-shrink-button";this.lastSectorInner=0;this.startAngle=-180;this.endAngle=-135;this.imageName="shrink";this.text="Shrink"},mouseup:function(){var a=-1+(this.source_representation.model.get("size")|| -0);this.source_representation.model.set("size",a);this.source_representation.select();this.select();paper.view.draw()}});var la=y.EdgeEditButton=e.Utils.inherit(Y);h(la.prototype).extend({_init:function(){this.type="Edge-edit-button";this.sector=this.renderer.drawSector(this,n,q,-270,-90,1,"edit",this.renkan.translate("Edit"))},mouseup:function(){this.renderer.is_dragging||this.source_representation.openEditor()}});var ma=y.EdgeRemoveButton=e.Utils.inherit(Y);h(ma.prototype).extend({_init:function(){this.type= -"Edge-remove-button";this.sector=this.renderer.drawSector(this,n,q,-90,90,1,"remove",this.renkan.translate("Remove"))},mouseup:function(){this.renderer.click_target=null;this.renderer.is_dragging=false;this.renderer.removeRepresentationsOfType("editor");if(this.renderer.isEditable())if(this.options.element_delete_delay){var a=e.Utils.getUID("delete");this.renderer.delete_list.push({id:a,time:(new Date).valueOf()+this.options.element_delete_delay});this.source_representation.model.set("delete_scheduled", -a)}else confirm(this.renkan.translate("Do you really wish to remove edge ")+'"'+this.source_representation.model.get("title")+'"?')&&this.project.removeEdge(this.source_representation.model)}});var na=y.EdgeRevertButton=e.Utils.inherit(Y);h(na.prototype).extend({_init:function(){this.type="Edge-revert-button";this.sector=this.renderer.drawSector(this,n,q,-135,135,1,"revert",this.renkan.translate("Cancel deletion"))},mouseup:function(){this.renderer.click_target=null;this.renderer.is_dragging=false; -this.renderer.isEditable()&&this.source_representation.model.unset("delete_scheduled")}});var oa=y.MiniFrame=e.Utils.inherit(S);h(oa.prototype).extend({paperShift:function(a){this.renderer.offset=this.renderer.offset.subtract(a.divide(this.renderer.minimap.scale).multiply(this.renderer.scale));this.renderer.redraw()},mouseup:function(){this.renderer.click_target=null;this.renderer.is_dragging=false}});o=y.Scene=function(a){this.renkan=a;this.$=r(".Rk-Render");this.representations=[];this.$.html(this.template(a)); -this.onStatusChange();this.canvas_$=this.$.find(".Rk-Canvas");this.labels_$=this.$.find(".Rk-Labels");this.editor_$=this.$.find(".Rk-Editor");this.notif_$=this.$.find(".Rk-Notifications");paper.setup(this.canvas_$[0]);this.initialScale=this.scale=1;this.offset=paper.view.center;this.totalScroll=0;this.mouse_down=false;this.selected_target=this.click_target=null;this.edge_layer=new paper.Layer;this.node_layer=new paper.Layer;this.buttons_layer=new paper.Layer;this.delete_list=[];if(a.options.show_minimap){this.minimap= -{background_layer:new paper.Layer,edge_layer:new paper.Layer,node_layer:new paper.Layer,node_group:new paper.Group,size:new paper.Size(a.options.minimap_width,a.options.minimap_height)};this.minimap.background_layer.activate();this.minimap.topleft=paper.view.bounds.bottomRight.subtract(this.minimap.size);this.minimap.rectangle=new paper.Path.Rectangle(this.minimap.topleft.subtract([2,2]),this.minimap.size.add([4,4]));this.minimap.rectangle.fillColor=a.options.minimap_background_color;this.minimap.rectangle.strokeColor= -a.options.minimap_border_color;this.minimap.rectangle.strokeWidth=4;this.minimap.offset=new paper.Point(this.minimap.size.divide(2));this.minimap.scale=0.1;this.minimap.node_layer.activate();this.minimap.cliprectangle=new paper.Path.Rectangle(this.minimap.topleft,this.minimap.size);this.minimap.node_group.addChild(this.minimap.cliprectangle);this.minimap.node_group.clipped=true;this.minimap.miniframe=new paper.Path.Rectangle(this.minimap.topleft,this.minimap.size);this.minimap.node_group.addChild(this.minimap.miniframe); -this.minimap.miniframe.fillColor="#c0c0ff";this.minimap.miniframe.opacity=0.3;this.minimap.miniframe.strokeColor="#000080";this.minimap.miniframe.strokeWidth=3;this.minimap.miniframe.__representation=new oa(this,null)}this.throttledPaperDraw=h(function(){paper.view.draw()}).throttle(100);this.bundles=[];this.click_mode=false;var b=this,c=true,j,g=false,f,u;this.image_cache={};this.icon_cache={};["edit","remove","link","enlarge","shrink","revert"].forEach(function(l){var t=new Image;t.src=a.options.static_url+ -"img/"+l+".png";b.icon_cache[l]=t});var A=h.throttle(function(l,t){b.onMouseMove(l,t)},D);this.canvas_$.on({mousedown:function(l){l.preventDefault();b.onMouseDown(l,false)},mousemove:function(l){l.preventDefault();A(l,false)},mouseup:function(l){l.preventDefault();b.onMouseUp(l,false)},mousewheel:function(l,t){if(a.options.zoom_on_scroll){l.preventDefault();c&&b.onScroll(l,t)}},touchstart:function(l){l.preventDefault();var t=l.originalEvent.touches[0];if(a.options.allow_double_click&&new Date-_lastTap< -I&&Math.pow(f-t.pageX,2)+Math.pow(u-t.pageY,2)=t.time){var w=a.project.get("nodes").findWhere({delete_scheduled:t.id});w&&project.removeNode(w);(w=a.project.get("edges").findWhere({delete_scheduled:t.id}))&&project.removeEdge(w)}});b.delete_list=b.delete_list.filter(function(t){return a.project.get("nodes").findWhere({delete_scheduled:t.id})|| -a.project.get("edges").findWhere({delete_scheduled:t.id})})},500);this.minimap&&window.setInterval(function(){b.rescaleMinimap()},2E3)};h(o.prototype).extend({template:h.template('<% if (options.show_top_bar) { %>
        <% if (!options.editor_mode) { %>

        <%- project.get("title") || translate("Untitled project")%>

        <% } else { %>" placeholder="<%-translate("Untitled project")%>" /><% } %><% if (options.show_user_list) { %>
        <% if (options.user_color_editable) { %><% } %><% if (options.user_color_editable) { print(colorPicker) } %>
        <unknown user>
          <% } %><% if (options.home_button_url) {%>
          <%- translate(options.home_button_title) %>
          <% } %><% if (options.show_fullscreen_button) { %>
          <%-translate("Full Screen")%>
          <% } %><% if (options.editor_mode) { %><% if (options.show_addnode_button) { %>
          <%-translate("Add Node")%>
          <% } %><% if (options.show_addedge_button) { %>
          <%-translate("Add Edge")%>
          <% } %><% if (options.show_save_button) { %>
          <% } %><% if (options.show_open_button) { %>
          <%-translate("Open Project")%>
          <% } %><% if (options.show_bookmarklet) { %>
          <%-translate("Renkan \'Drag-to-Add\' bookmarklet")%>
          <% } %>
          <% }; if (options.show_search_field) { %>
          " />
          <% } %>
          <% } %>
          <% if (options.show_bins) { %>
          «
          <% } %>
          ">
          ">
          '), -fixSize:function(a){var b=this.$.width(),c=this.$.height();if(this.renkan.options.show_top_bar)c-=this.$.find(".Rk-TopBar").height();this.canvas_$.attr({width:b,height:c});paper.view.viewSize=new paper.Size([b,c]);a&&this.autoScale()},drawSector:function(a,b,c,j,g,f,u,A){function v(){var aa=new paper.Raster(E);aa.position=sa.add(P.position).subtract(ca);P.addChild(aa)}var p=this.renkan.options,B=j*Math.PI/180,x=g*Math.PI/180,E=this.icon_cache[u],H=-Math.sin(B),l=Math.cos(B),t=Math.cos(B)*b+f*H,w= -Math.sin(B)*b+f*l,T=Math.cos(B)*c+f*H,V=Math.sin(B)*c+f*l,K=-Math.sin(x),Z=Math.cos(x),O=Math.cos(x)*b-f*K,$=Math.sin(x)*b-f*Z,ta=Math.cos(x)*c-f*K,ua=Math.sin(x)*c-f*Z,pa=(b+c)/2,U=(B+x)/2,va=Math.cos(U)*pa,wa=Math.sin(U)*pa,xa=Math.cos(U)*b,ya=Math.cos(U)*c,za=Math.sin(U)*b,Aa=Math.sin(U)*c,da=Math.cos(U)*(c+3),Ba=Math.sin(U)*(c+p.buttons_label_font_size)+p.buttons_label_font_size/2;this.buttons_layer.activate();var Q=new paper.Path;Q.add([t,w]);Q.arcTo([xa,za],[O,$]);Q.lineTo([ta,ua]);Q.arcTo([ya, -Aa],[T,V]);Q.fillColor=p.buttons_background;Q.opacity=0.5;Q.closed=true;Q.__representation=a;var X=new paper.PointText(da,Ba);X.characterStyle={fontSize:p.buttons_label_font_size,fillColor:p.buttons_label_color};X.paragraphStyle.justification=da>2?"left":da<-2?"right":"center";var ea=X.visible=false,qa=new paper.Point(-200,-200),P=new paper.Group([Q,X]),ca=P.position,sa=new paper.Point([va,wa]),ra=new paper.Point(0,0);X.content=A;P.visible=false;P.position=qa;var Ca={show:function(){ea=true;P.position= -ra.add(ca);P.visible=true},moveTo:function(aa){ra=aa;if(ea)P.position=aa.add(ca)},hide:function(){ea=false;P.visible=false;P.position=qa},select:function(){Q.opacity=0.8;X.visible=true},unselect:function(){Q.opacity=0.5;X.visible=false},destroy:function(){P.remove()}};E.width?v():r(E).on("load",v);return Ca},addToBundles:function(a){var b=h(this.bundles).find(function(c){return c.from===a.from_representation&&c.to===a.to_representation||c.from===a.to_representation&&c.to===a.from_representation}); -if(typeof b!=="undefined")b.edges.push(a);else{b={from:a.from_representation,to:a.to_representation,edges:[a],getPosition:function(c){var j=c.from_representation===this.from?1:-1;return j*(h(this.edges).indexOf(c)-(this.edges.length-1)/2)}};this.bundles.push(b)}return b},isEditable:function(){return this.renkan.options.editor_mode&&!this.renkan.read_only},onStatusChange:function(){var a=this.$.find(".Rk-Save-Button"),b=a.find(".Rk-TopBar-Tooltip-Contents");if(this.renkan.read_only){a.removeClass("disabled Rk-Save-Online").addClass("Rk-Save-ReadOnly"); -b.text(this.renkan.translate("Connection lost"))}else if(this.renkan.options.snapshot_mode){a.removeClass("Rk-Save-ReadOnly Rk-Save-Online");b.text(this.renkan.translate("Save Project"))}else{a.removeClass("disabled Rk-Save-ReadOnly").addClass("Rk-Save-Online");b.text(this.renkan.translate("Auto-save enabled"))}this.redrawUsers()},setScale:function(a,b){if(a/this.initialScale>i&&a/this.initialScale1){var b=a.map(function(v){return v.get("position").x}),c=a.map(function(v){return v.get("position").y}),j=Math.min.apply(Math,b),g=Math.min.apply(Math,c),f=Math.max.apply(Math,b),u=Math.max.apply(Math,c),A=Math.min((paper.view.size.width-2*this.renkan.options.autoscale_padding)/(f-j),(paper.view.size.height-2*this.renkan.options.autoscale_padding)/(u-g));this.initialScale=A;this.setScale(A,paper.view.center.subtract((new paper.Point([(f+j)/2,(u+g)/2])).multiply(A)))}a.length===1&&this.setScale(1, -paper.view.center.subtract(new paper.Point([a.at(0).get("position").x,a.at(0).get("position").y])))},redrawMiniframe:function(){var a=this.toMinimapCoords(this.toModelCoords(new paper.Point([0,0]))),b=this.toMinimapCoords(this.toModelCoords(paper.view.bounds.bottomRight));this.minimap.miniframe.fitBounds(a,b)},rescaleMinimap:function(){var a=this.renkan.project.get("nodes");if(a.length>1){var b=a.map(function(v){return v.get("position").x}),c=a.map(function(v){return v.get("position").y}),j=Math.min.apply(Math, -b),g=Math.min.apply(Math,c),f=Math.max.apply(Math,b),u=Math.max.apply(Math,c),A=Math.min(this.scale*0.8*this.renkan.options.minimap_width/paper.view.bounds.width,this.scale*0.8*this.renkan.options.minimap_height/paper.view.bounds.height,(this.renkan.options.minimap_width-2*this.renkan.options.minimap_padding)/(f-j),(this.renkan.options.minimap_height-2*this.renkan.options.minimap_padding)/(u-g));this.minimap.offset=this.minimap.size.divide(2).subtract((new paper.Point([(f+j)/2,(u+g)/2])).multiply(A)); -this.minimap.scale=A}if(a.length===1){this.minimap.scale=0.1;this.minimap.offset=this.minimap.size.divide(2).subtract((new paper.Point([a.at(0).get("position").x,a.at(0).get("position").y])).multiply(this.minimap.scale))}this.redraw()},toPaperCoords:function(a){return a.multiply(this.scale).add(this.offset)},toMinimapCoords:function(a){return a.multiply(this.minimap.scale).add(this.minimap.offset).add(this.minimap.topleft)},toModelCoords:function(a){return a.subtract(this.offset).divide(this.scale)}, -addRepresentation:function(a,b){var c=new y[a](this,b);this.representations.push(c);return c},addRepresentations:function(a,b){var c=this;b.forEach(function(j){c.addRepresentation(a,j)})},userTemplate:h.template('
        • <%=name%>
        • '),redrawUsers:function(){if(this.renkan.options.show_user_list){var a=[].concat((this.renkan.project.current_user_list||{}).models||[],(this.renkan.project.get("users")||{}).models||[]), -b="",c=this.$.find(".Rk-Users"),j=c.find(".Rk-CurrentUser-Name");c.find(".Rk-Edit-ColorPicker-Wrapper");var g=c.find(".Rk-Edit-ColorPicker li"),f=c.find(".Rk-CurrentUser-Color"),u=this;j.off("click").text(this.renkan.translate(""));g.off("mouseleave click");a.forEach(function(A){if(A.get("_id")===u.renkan.current_user){j.text(A.get("title"));f.css("background",A.get("color"));if(u.isEditable()){u.renkan.options.user_name_editable&&j.click(function(){var v=r(this),p=r("").val(A.get("title")).blur(function(){A.set("title", -r(this).val());u.redrawUsers();u.redraw()});v.empty().html(p);p.select()});u.renkan.options.user_color_editable&&g.click(function(v){v.preventDefault();u.isEditable()&&A.set("color",r(this).attr("data-color"));r(this).parent().hide()}).mouseleave(function(){f.css("background",A.get("color"))})}}else b+=u.userTemplate({name:A.get("title"),background:A.get("color")})});c.find(".Rk-UserList").html(b)}},removeRepresentation:function(a){a.destroy();this.representations=h(this.representations).reject(function(b){return b== -a})},getRepresentationByModel:function(a){if(a)return h(this.representations).find(function(b){return b.model===a})},removeRepresentationsOfType:function(a){var b=h(this.representations).filter(function(j){return j.type==a}),c=this;h(b).each(function(j){c.removeRepresentation(j)})},highlightModel:function(a){var b=this.getRepresentationByModel(a);b&&b.highlight()},unhighlightAll:function(){h(this.representations).each(function(a){a.unhighlight()})},unselectAll:function(){h(this.representations).each(function(a){a.unselect()})}, -redraw:function(){h(this.representations).each(function(a){a.redraw(true)});this.minimap&&this.redrawMiniframe();paper.view.draw()},addTempEdge:function(a,b){var c=this.addRepresentation("TempEdge",null);c.end_pos=b;c.from_representation=a;c.redraw();this.click_target=c},findTarget:function(a){if(a&&typeof a.item.__representation!=="undefined"){var b=a.item.__representation;if(this.selected_target!==a.item.__representation){this.selected_target&&this.selected_target.unselect(b);b.select(this.selected_target); -this.selected_target=b}}else{this.selected_target&&this.selected_target.unselect();this.selected_target=null}},paperShift:function(a){this.offset=this.offset.add(a);this.redraw()},onMouseMove:function(a){var b=this.canvas_$.offset(),c=new paper.Point([a.pageX-b.left,a.pageY-b.top]),j=c.subtract(this.last_point);this.last_point=c;if(!this.is_dragging&&this.mouse_down&&j.length>m)this.is_dragging=true;var g=paper.project.hitTest(c);if(this.is_dragging)this.click_target&&typeof this.click_target.paperShift=== -"function"?this.click_target.paperShift(j):this.paperShift(j);else this.findTarget(g);paper.view.draw()},onMouseDown:function(a,b){var c=this.canvas_$.offset(),j=new paper.Point([a.pageX-c.left,a.pageY-c.top]);this.last_point=j;this.mouse_down=true;if(!this.click_target||this.click_target.type!=="Temp-edge"){this.removeRepresentationsOfType("editor");this.is_dragging=false;var g=paper.project.hitTest(j);if(g&&typeof g.item.__representation!=="undefined"){this.click_target=g.item.__representation; -this.click_target.mousedown(a,b)}else{this.click_target=null;if(this.isEditable()&&this.click_mode===C){var f=this.toModelCoords(j),u={id:e.Utils.getUID("node"),created_by:this.renkan.current_user,position:{x:f.x,y:f.y}};_node=this.renkan.project.addNode(u);this.getRepresentationByModel(_node).openEditor()}}}if(this.click_mode)if(this.isEditable()&&this.click_mode===G&&this.click_target&&this.click_target.type==="Node"){this.removeRepresentationsOfType("editor");this.addTempEdge(this.click_target, -j);this.click_mode=z;this.notif_$.fadeOut(function(){r(this).html(_renkan.translate("Click on a second node to complete the edge")).fadeIn()})}else{this.notif_$.hide();this.click_mode=false}paper.view.draw()},onMouseUp:function(a,b){this.mouse_down=false;if(this.click_target){var c=this.canvas_$.offset();this.click_target.mouseup({point:new paper.Point([a.pageX-c.left,a.pageY-c.top])},b)}else{this.click_target=null;this.is_dragging=false;b&&this.unselectAll()}paper.view.draw()},onScroll:function(a, -b){this.totalScroll+=b;if(Math.abs(this.totalScroll)>=1){var c=this.canvas_$.offset(),j=(new paper.Point([a.pageX-c.left,a.pageY-c.top])).subtract(this.offset).multiply(Math.SQRT2-1);this.totalScroll>0?this.setScale(this.scale*Math.SQRT2,this.offset.subtract(j)):this.setScale(this.scale*Math.SQRT1_2,this.offset.add(j.divide(Math.SQRT2)));this.totalScroll=0}},onDoubleClick:function(a){if(this.isEditable()){var b=this.canvas_$.offset(),c=new paper.Point([a.pageX-b.left,a.pageY-b.top]),j=paper.project.hitTest(c); -if(this.isEditable()&&(!j||typeof j.item.__representation==="undefined")){var g=this.toModelCoords(c),f={id:e.Utils.getUID("node"),created_by:this.renkan.current_user,position:{x:g.x,y:g.y}},u=this.renkan.project.addNode(f);this.getRepresentationByModel(u).openEditor()}paper.view.draw()}},dropData:function(a,b){if(this.isEditable()){if(a["text/json"]||a["application/json"])try{var c=JSON.parse(a["text/json"]||a["application/json"]);h(a).extend(c)}catch(j){}c={};switch(a["text/x-iri-specific-site"]){case "twitter":var g= -r("
          ").html(a["text/x-iri-selected-html"]);g=g.find(".tweet");c.title=_renkan.translate("Tweet by ")+g.attr("data-name");c.uri="http://twitter.com/"+g.attr("data-screen-name")+"/status/"+g.attr("data-tweet-id");c.image=g.find(".avatar").attr("src");c.description=g.find(".js-tweet-text:first").text();break;case "google":g=r("
          ").html(a["text/x-iri-selected-html"]);c.title=g.find("h3:first").text().trim();c.uri=g.find("h3 a").attr("href");c.description=g.find(".st:first").text().trim();break; -case undefined:default:if(a["text/x-iri-source-uri"])c.uri=a["text/x-iri-source-uri"];if(a["text/plain"]||a["text/x-iri-selected-text"])c.description=(a["text/plain"]||a["text/x-iri-selected-text"]).replace(/[\s\n]+/gm," ").trim();if(a["text/html"]||a["text/x-iri-selected-html"]){g=r("
          ").html(a["text/html"]||a["text/x-iri-selected-html"]);var f=g.find("image");if(f.length)c.image=f.attr("xlink:href");var u=g.find("path");if(u.length)c.clipPath=u.attr("d");var A=g.find("img");if(A.length)c.image= -A[0].src;var v=g.find("a");if(v.length)c.uri=v[0].href;c.title=g.find("[title]").attr("title")||c.title;c.description=g.text().replace(/[\s\n]+/gm," ").trim()}if(a["text/uri-list"])c.uri=a["text/uri-list"];if(a["text/x-moz-url"]&&!c.title){c.title=(a["text/x-moz-url"].split("\n")[1]||"").trim();if(c.title===c.uri)c.title=false}if(a["text/x-iri-source-title"]&&!c.title)c.title=a["text/x-iri-source-title"];if(a["text/html"]||a["text/x-iri-selected-html"]){c.image=g.find("[data-image]").attr("data-image")|| -c.image;c.uri=g.find("[data-uri]").attr("data-uri")||c.uri;c.title=g.find("[data-title]").attr("data-title")||c.title;c.description=g.find("[data-description]").attr("data-description")||c.description;c.description=g.find("[data-clip-path]").attr("data-clip-path")||c.description}}if(!c.title)c.title=this.renkan.translate("Dragged resource");g=["title","description","uri","image"];for(var p=0;p

          <%=htitle%>

        • ');r.prototype.annotationTemplate= -e.template('
        • <%=htitle%>

          <%=hdescription%>

          Start: <%=start%>, End: <%=end%>, Duration: <%=duration%>

        • ');r.prototype._init=function(m,d){this.renkan=m;this.proj_id= -d.project_id;this.ldt_platform=d.ldt_platform||"http://ldt.iri.centrepompidou.fr/";this.title_$.html(d.title);this.title_icon_$.addClass("Rk-Ldt-Title-Icon");this.refresh()};r.prototype.render=function(m){function d(i){var s=e(i).escape();return q.isempty?s:q.replace(s,"$1")}function n(i){function s(R){for(var M=R.toString();M.length<2;)M="0"+M;return M}var D=Math.abs(Math.floor(i/1E3)),I=Math.floor(D/3600),L=Math.floor(D/60)%60,J=D%60,N="";if(I)N+=s(I)+":";N+=s(L)+ -":"+s(J);return N}var q=m||o.Utils.regexpFromTextOrArray(),C="
        • Tags

        • ",G=this.data.meta["dc:title"],z=this,F=0;z.title_$.text('LDT Project: "'+G+'"');e(z.data.tags).map(function(i){var s=i.meta["dc:title"];if(q.isempty||q.test(s)){F++;C+=z.tagTemplate({ldt_platform:z.ldt_platform,title:s,htitle:d(s),encodedtitle:encodeURIComponent(s),static_url:z.renkan.options.static_url})}});C+="
        • Annotations

        • ";e(z.data.annotations).map(function(i){var s=i.content.description,D=i.content.title.replace(s, -"");if(!(!q.isempty&&!q.test(D)&&!q.test(s))){F++;var I=i.end-i.begin,L=i.content&&i.content.img&&i.content.img.src?i.content.img.src:I?z.renkan.options.static_url+"img/ldt-segment.png":z.renkan.options.static_url+"img/ldt-point.png";C+=z.annotationTemplate({ldt_platform:z.ldt_platform,title:D,htitle:d(D),description:s,hdescription:d(s),start:n(i.begin),end:n(i.end),duration:n(I),mediaid:i.media,annotationid:i.id,image:L,static_url:z.renkan.options.static_url})}});this.main_$.html(C);!q.isempty&& -F?this.count_$.text(F).show():this.count_$.hide();!q.isempty&&!F?this.$.hide():this.$.show();this.renkan.resizeBins()};r.prototype.refresh=function(){var m=this;o.$.ajax({url:this.ldt_platform+"ldtplatform/ldt/cljson/id/"+this.proj_id,dataType:"jsonp",success:function(d){m.data=d;m.render()}})};r=h.Search=function(m,d){this.renkan=m;this.lang=d.lang||"en"};r.prototype.getBgClass=function(){return"Rk-Ldt-Icon"};r.prototype.getSearchTitle=function(){return this.renkan.translate("Lignes de Temps")}; -r.prototype.search=function(m){this.renkan.tabs.push(new y(this.renkan,{search:m}))};var y=h.ResultsBin=o.Utils.inherit(o._BaseBin);y.prototype.segmentTemplate=e.template('
        • <%=htitle%>

          <%=hdescription%>

          Start: <%=start%>, End: <%=end%>, Duration: <%=duration%>

        • '); -y.prototype._init=function(m,d){this.renkan=m;this.ldt_platform=d.ldt_platform||"http://ldt.iri.centrepompidou.fr/";this.max_results=d.max_results||50;this.search=d.search;this.title_$.html('Lignes de Temps: "'+d.search+'"');this.title_icon_$.addClass("Rk-Ldt-Title-Icon");this.refresh()};y.prototype.render=function(m){function d(i){return C.replace(e(i).escape(),"$1")}function n(i){function s(R){for(var M=R.toString();M.length<2;)M="0"+M;return M}var D=Math.abs(Math.floor(i/ -1E3)),I=Math.floor(D/3600),L=Math.floor(D/60)%60,J=D%60,N="";if(I)N+=s(I)+":";N+=s(L)+":"+s(J);return N}if(this.data){var q=m||o.Utils.regexpFromTextOrArray(),C=q.isempty?o.Utils.regexpFromTextOrArray(this.search):q,G="",z=this,F=0;e(this.data.objects).each(function(i){var s=i["abstract"],D=i.title;if(!(!q.isempty&&!q.test(D)&&!q.test(s))){F++;var I=i.duration,L=i.start_ts,J=+i.duration+L,N=I?z.renkan.options.static_url+"img/ldt-segment.png":z.renkan.options.static_url+"img/ldt-point.png";G+=z.segmentTemplate({ldt_platform:z.ldt_platform, -title:D,htitle:d(D),description:s,hdescription:d(s),start:n(L),end:n(J),duration:n(I),mediaid:i.iri_id,annotationid:i.element_id,image:N})}});this.main_$.html(G);!q.isempty&&F?this.count_$.text(F).show():this.count_$.hide();!q.isempty&&!F?this.$.hide():this.$.show();this.renkan.resizeBins()}};y.prototype.refresh=function(){var m=this;o.$.ajax({url:this.ldt_platform+"ldtplatform/api/ldt/1.0/segments/search/",data:{format:"jsonp",q:this.search,limit:this.max_results},dataType:"jsonp",success:function(d){m.data= -d;m.render()}})}})(window.Rkns);Rkns.ResourceList={};Rkns.ResourceList.Bin=Rkns.Utils.inherit(Rkns._BaseBin);Rkns.ResourceList.Bin.prototype.resultTemplate=Rkns._.template('
        • data-image="<%- Rkns.Utils.getFullURL(image) %>"<% } else { %>data-image=""<% } %> ><% if (image) { %><% } %>

          <% if (url) { %><% } %><%=htitle%><% if (url) { %><% } %>

          <% if (description) { %>

          <%=hdescription%>

          <% } %><% if (image) { %>
          <% } %>
        • '); -Rkns.ResourceList.Bin.prototype._init=function(o,e){this.renkan=o;this.title_$.html(e.title);if(e.list)this.data=e.list;this.refresh()}; -Rkns.ResourceList.Bin.prototype.render=function(o){function e(d){var n=_(d).escape();return h.isempty?n:h.replace(n,"$1")}var h=o||Rkns.Utils.regexpFromTextOrArray(),r="",y=this,m=0;Rkns._(this.data).each(function(d){if(typeof d==="string")if(/^(https?:\/\/|www)/.test(d))var n={url:d};else{n={title:d.replace(/[:,]?\s?(https?:\/\/|www)[\d\w\/.&?=#%-_]+\s?/,"").trim()};var q=d.match(/(https?:\/\/|www)[\d\w\/.&?=#%-_]+/);if(q)n.url=q[0];if(n.title.length>80){n.description= -n.title;n.title=n.title.replace(/^(.{30,60})\s.+$/,"$1\u2026")}}else n=d;var C=n.title||(n.url||"").replace(/^https?:\/\/(www\.)?/,"").replace(/^(.{40}).+$/,"$1\u2026"),G=n.url||"",z=n.description||"",F=n.image||"";if(G&&!/^https?:\/\//.test(G))G="http://"+G;if(!(!h.isempty&&!h.test(C)&&!h.test(z))){m++;r+=y.resultTemplate({url:G,title:C,htitle:e(C),image:F,description:z,hdescription:e(z),static_url:y.renkan.options.static_url})}});y.main_$.html(r);!h.isempty&&m?this.count_$.text(m).show():this.count_$.hide(); -!h.isempty&&!m?this.$.hide():this.$.show();this.renkan.resizeBins()};Rkns.ResourceList.Bin.prototype.refresh=function(){this.data&&this.render()};Rkns.Wikipedia={};Rkns.Wikipedia.Search=function(o,e){this.renkan=o;this.lang=e.lang||"en"};Rkns.Wikipedia.Search.prototype.getBgClass=function(){return"Rk-Wikipedia-Search-Icon Rk-Wikipedia-Lang-"+this.lang}; -Rkns.Wikipedia.Search.prototype.getSearchTitle=function(){var o={fr:"French",en:"English",ja:"Japanese"};return o[this.lang]?this.renkan.translate("Wikipedia in ")+this.renkan.translate(o[this.lang]):this.renkan.translate("Wikipedia")+" ["+this.lang+"]"};Rkns.Wikipedia.Search.prototype.search=function(o){this.renkan.tabs.push(new Rkns.Wikipedia.Bin(this.renkan,{lang:this.lang,search:o}))};Rkns.Wikipedia.Bin=Rkns.Utils.inherit(Rkns._BaseBin);Rkns.Wikipedia.Bin.prototype.resultTemplate=Rkns._.template('
        • <%=htitle%>

          <%=hdescription%>

        • '); -Rkns.Wikipedia.Bin.prototype._init=function(o,e){this.renkan=o;this.search=e.search;this.lang=e.lang||"en";this.title_icon_$.addClass("Rk-Wikipedia-Title-Icon Rk-Wikipedia-Lang-"+this.lang);this.title_$.html(this.search).addClass("Rk-Wikipedia-Title");this.refresh()}; -Rkns.Wikipedia.Bin.prototype.render=function(o){function e(n){return r.replace(_(n).escape(),"$1")}var h=o||Rkns.Utils.regexpFromTextOrArray(),r=h.isempty?Rkns.Utils.regexpFromTextOrArray(this.search):h,y="",m=this,d=0;Rkns._(this.data.query.search).each(function(n){var q=n.title,C="http://"+m.lang+".wikipedia.org/wiki/"+encodeURI(q.replace(/ /g,"_")),G=Rkns.$("
          ").html(n.snippet).text();if(!(!h.isempty&&!h.test(q)&&!h.test(G))){d++;y+=m.resultTemplate({url:C, -title:q,htitle:e(q),description:G,hdescription:e(G),static_url:m.renkan.options.static_url})}});m.main_$.html(y);!h.isempty&&d?this.count_$.text(d).show():this.count_$.hide();!h.isempty&&!d?this.$.hide():this.$.show();this.renkan.resizeBins()};Rkns.Wikipedia.Bin.prototype.refresh=function(){var o=this;Rkns.$.ajax({url:"http://"+o.lang+".wikipedia.org/w/api.php?action=query&list=search&srsearch="+encodeURIComponent(this.search)+"&format=json",dataType:"jsonp",success:function(e){o.data=e;o.render()}})}; \ No newline at end of file + */ + +/*! renkan - v0.12.4 - Copyright Ā© IRI 2015 */ + + +this.renkanJST=this.renkanJST||{},this.renkanJST["templates/colorpicker.html"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='
        • ';return __p},this.renkanJST["templates/edgeeditor.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='

          \n ×'+__e(renkan.translate("Edit Edge"))+"\n

          \n

          \n \n \n

          \n',options.show_edge_editor_uri&&(__p+="\n

          \n \n \n \n

          \n ',options.properties.length&&(__p+="\n

          \n \n \n

          \n")),__p+="\n",options.show_edge_editor_style&&(__p+='\n
          \n ',options.show_edge_editor_style_color&&(__p+='\n
          \n '+__e(renkan.translate("Edge color:"))+'\n
          \n \n \n \n '+(null==(__t=renkan.colorPicker)?"":__t)+'\n '+__e(renkan.translate("Choose color"))+"\n
          \n
          \n "),__p+="\n ",options.show_edge_editor_style_dash&&(__p+='\n
          \n '+__e(renkan.translate("Dash:"))+'\n \n
          \n "),__p+="\n ",options.show_edge_editor_style_thickness&&(__p+='\n
          \n '+__e(renkan.translate("Thickness:"))+'\n -\n '+__e(edge.thickness)+'\n +\n
          \n '),__p+="\n ",options.show_edge_editor_style_arrow&&(__p+='\n
          \n '+__e(renkan.translate("Arrow:"))+'\n \n
          \n "),__p+="\n
          \n"),__p+="\n",options.show_edge_editor_direction&&(__p+='\n

          \n '+__e(renkan.translate("Change edge direction"))+"\n

          \n"),__p+="\n",options.show_edge_editor_nodes&&(__p+='\n

          \n '+__e(renkan.translate("From:"))+'\n \n '+__e(shortenText(edge.from_title,25))+'\n

          \n

          \n '+__e(renkan.translate("To:"))+'\n \n '+__e(shortenText(edge.to_title,25))+"\n

          \n"),__p+="\n",options.show_edge_editor_creator&&edge.has_creator&&(__p+='\n

          \n '+__e(renkan.translate("Created by:"))+'\n \n '+__e(shortenText(edge.created_by_title,25))+"\n

          \n"),__p+="\n";return __p},this.renkanJST["templates/edgeeditor_readonly.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='

          \n ×\n ',options.show_edge_tooltip_color&&(__p+='\n \n '),__p+='\n \n ',edge.uri&&(__p+='\n \n '),__p+="\n "+__e(edge.title)+"\n ",edge.uri&&(__p+=" "),__p+="\n \n

          \n",options.show_edge_tooltip_uri&&edge.uri&&(__p+='\n

          \n '+__e(edge.short_uri)+"\n

          \n"),__p+="\n

          "+(null==(__t=edge.description)?"":__t)+"

          \n",options.show_edge_tooltip_nodes&&(__p+='\n

          \n '+__e(renkan.translate("From:"))+'\n \n '+__e(shortenText(edge.from_title,25))+'\n

          \n

          \n '+__e(renkan.translate("To:"))+'\n \n '+__e(shortenText(edge.to_title,25))+"\n

          \n"),__p+="\n",options.show_edge_tooltip_creator&&edge.has_creator&&(__p+='\n

          \n '+__e(renkan.translate("Created by:"))+'\n \n '+__e(shortenText(edge.created_by_title,25))+"\n

          \n"),__p+="\n";return __p},this.renkanJST["templates/ldtjson-bin/annotationtemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='
        • \n\n \n

          '+(null==(__t=htitle)?"":__t)+"

          \n

          "+(null==(__t=hdescription)?"":__t)+"

          \n

          Start: "+(null==(__t=start)?"":__t)+", End: "+(null==(__t=end)?"":__t)+", Duration: "+(null==(__t=duration)?"":__t)+'

          \n
          \n
        • \n';return __p},this.renkanJST["templates/ldtjson-bin/segmenttemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='
        • \n\n \n

          '+(null==(__t=htitle)?"":__t)+"

          \n

          "+(null==(__t=hdescription)?"":__t)+"

          \n

          Start: "+(null==(__t=start)?"":__t)+", End: "+(null==(__t=end)?"":__t)+", Duration: "+(null==(__t=duration)?"":__t)+'

          \n
          \n
        • \n';return __p},this.renkanJST["templates/ldtjson-bin/tagtemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='
        • \n\n \n

          '+(null==(__t=htitle)?"":__t)+'

          \n
          \n
        • \n';return __p},this.renkanJST["templates/list-bin.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='
        • \n'),__p+='\n

          \n ',url&&(__p+='\n \n '),__p+="\n "+(null==(__t=htitle)?"":__t)+"\n ",url&&(__p+=""),__p+="\n

          \n ",description&&(__p+='\n

          '+(null==(__t=hdescription)?"":__t)+"

          \n "),__p+="\n ",image&&(__p+='\n
          \n '),__p+="\n
        • \n";return __p},this.renkanJST["templates/main.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)options.show_bins&&(__p+='\n
          \n
          \n

          '+__e(translate("Select contents:"))+'

          \n
          \n \n
          \n
          \n
            \n
            \n \n
            \n
            \n \n \n
            \n \n
            \n'),__p+=" ",options.show_editor&&(__p+='\n
            \n ×'+__e(renkan.translate("Edit Node"))+"\n\n

            \n \n \n

            \n',options.show_node_editor_uri&&(__p+="\n

            \n \n \n \n

            \n'),__p+=" ",options.change_types&&(__p+="\n

            \n \n \n

            \n"),__p+=" ",options.show_node_editor_description&&(__p+="\n

            \n \n ",__p+=options.show_node_editor_description_richtext?'\n

            '+(null==(__t=node.description)?"":__t)+"
            \n ":'\n \n ",__p+="\n

            \n"),__p+=" ",options.show_node_editor_size&&(__p+='\n

            \n '+__e(renkan.translate("Size:"))+'\n -\n '+__e(node.size)+'\n +\n

            \n'),__p+=" ",options.show_node_editor_style&&(__p+='\n
            \n ',options.show_node_editor_style_color&&(__p+='\n
            \n \n '+__e(renkan.translate("Node color:"))+'\n
            \n \n \n \n '+(null==(__t=renkan.colorPicker)?"":__t)+'\n '+__e(renkan.translate("Choose color"))+"\n
            \n
            \n "),__p+="\n ",options.show_node_editor_style_dash&&(__p+='\n
            \n '+__e(renkan.translate("Dash:"))+'\n \n
            \n "),__p+="\n ",options.show_node_editor_style_thickness&&(__p+='\n
            \n '+__e(renkan.translate("Thickness:"))+'\n -\n '+__e(node.thickness)+'\n +\n
            \n '),__p+="\n
            \n"),__p+=" ",options.show_node_editor_image&&(__p+='\n
            \n
            \n \n ',node.clip_path&&(__p+='\n \n \n \n '),__p+="\n
            \n
            \n

            \n \n

            \n \n \n
            \n

            \n",options.allow_image_upload&&(__p+="\n

            \n \n \n

            \n')),__p+=" ",options.show_node_editor_creator&&node.has_creator&&(__p+='\n

            \n '+__e(renkan.translate("Created by:"))+'\n \n '+__e(shortenText(node.created_by_title,25))+"\n

            \n"),__p+=" ",options.change_shapes&&(__p+="\n

            \n \n \n

            \n"),__p+="\n";return __p},this.renkanJST["templates/nodeeditor_readonly.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='

            \n ×\n ',options.show_node_tooltip_color&&(__p+='\n \n '),__p+='\n \n ',node.uri&&(__p+='\n \n '),__p+="\n "+__e(node.title)+"\n ",node.uri&&(__p+=""),__p+="\n \n

            \n",node.uri&&options.show_node_tooltip_uri&&(__p+='\n

            \n '+__e(node.short_uri)+"\n

            \n"),__p+=" ",options.show_node_tooltip_description&&(__p+='\n

            '+(null==(__t=node.description)?"":__t)+"

            \n"),__p+=" ",node.image&&options.show_node_tooltip_image&&(__p+='\n \n'),__p+=" ",node.has_creator&&options.show_node_tooltip_creator&&(__p+='\n

            \n '+__e(renkan.translate("Created by:"))+'\n \n '+__e(shortenText(node.created_by_title,25))+"\n

            \n"),__p+='\n '+__e(renkan.translate("Link to the node"))+"\n";return __p},this.renkanJST["templates/nodeeditor_video.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='

            \n ×\n ',options.show_node_tooltip_color&&(__p+='\n \n '),__p+='\n \n ',node.uri&&(__p+='\n \n '),__p+="\n "+__e(node.title)+"\n ",node.uri&&(__p+=""),__p+="\n \n

            \n",node.uri&&options.show_node_tooltip_uri&&(__p+='\n \n'),__p+='\n '+__e(renkan.translate("Link to the node"))+"\n";return __p},this.renkanJST["templates/scene.html"]=function(obj){function print(){__p+=__j.call(arguments,"")}obj||(obj={});var __p="",__e=_.escape,__j=Array.prototype.join;with(obj)options.show_top_bar&&(__p+='\n
            \n
            \n ',__p+=options.editor_mode?'\n \n ':'\n

            \n '+__e(project.get("title")||translate("Untitled project"))+"\n

            \n ",__p+="\n ",options.show_user_list&&(__p+='\n
            \n
            \n ',options.show_user_color&&(__p+='\n
            \n \n ',options.user_color_editable&&(__p+='\n \n '),__p+="\n \n ",options.user_color_editable&&print(colorPicker),__p+="\n
            \n "),__p+='\n <unknown user>\n
            \n
              \n
              \n '),__p+="\n ",options.home_button_url&&(__p+='\n
              \n \n
              \n
              \n '+__e(translate(options.home_button_title))+"\n
              \n
              \n
              \n "),__p+="\n ",options.show_fullscreen_button&&(__p+='\n
              \n
              \n
              \n
              \n '+__e(translate("Full Screen"))+"\n
              \n
              \n
              \n "),__p+="\n ",options.editor_mode?(__p+="\n ",options.show_addnode_button&&(__p+='\n
              \n
              \n
              \n
              \n '+__e(translate("Add Node"))+"\n
              \n
              \n
              \n "),__p+="\n ",options.show_addedge_button&&(__p+='\n
              \n
              \n
              \n
              \n '+__e(translate("Add Edge"))+"\n
              \n
              \n
              \n "),__p+="\n ",options.show_export_button&&(__p+='\n
              \n
              \n
              \n
              \n '+__e(translate("Download Project"))+"\n
              \n
              \n
              \n "),__p+="\n ",options.show_save_button&&(__p+='\n
              \n
              \n
              \n
              \n
              \n
              \n '),__p+="\n ",options.show_open_button&&(__p+='\n
              \n
              \n
              \n
              \n '+__e(translate("Open Project"))+"\n
              \n
              \n
              \n "),__p+="\n ",options.show_bookmarklet&&(__p+='\n
              \n \n
              \n
              \n '+__e(translate("Renkan 'Drag-to-Add' bookmarklet"))+'\n
              \n
              \n
              \n
              \n '),__p+="\n "):(__p+="\n ",options.show_export_button&&(__p+='\n
              \n
              \n
              \n
              \n '+__e(translate("Download Project"))+'\n
              \n
              \n
              \n
              \n '),__p+="\n "),__p+="\n ",options.show_search_field&&(__p+='\n
              \n \n
              \n
              \n '),__p+="\n
              \n"),__p+='\n
              \n
              \n
              \n ',options.editor_mode&&options.save_view&&(__p+='\n
              \n '),__p+="\n ",options.save_view&&(__p+='\n
              \n ',options.hide_nodes&&(__p+='\n \n '),__p+=" \n "),__p+="\n
              \n "),__p+="\n
              \n\n";return __p},this.renkanJST["templates/search.html"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='
            • '+(null==(__t=title)?"":__t)+"
            • ";return __p},this.renkanJST["templates/wikipedia-bin/resulttemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='
            • \n\n \n

              \n '+(null==(__t=htitle)?"":__t)+'\n

              \n

              '+(null==(__t=hdescription)?"":__t)+"

              \n
            • \n";return __p},function(a){"use strict";"object"!=typeof a.Rkns&&(a.Rkns={});var b=a.Rkns,c=b.$=a.jQuery,d=b._=a._;b.pickerColors=["#8f1919","#a80000","#d82626","#ff0000","#e87c7c","#ff6565","#f7d3d3","#fecccc","#8f5419","#a85400","#d87f26","#ff7f00","#e8b27c","#ffb265","#f7e5d3","#fee5cc","#8f8f19","#a8a800","#d8d826","#feff00","#e8e87c","#feff65","#f7f7d3","#fefecc","#198f19","#00a800","#26d826","#00ff00","#7ce87c","#65ff65","#d3f7d3","#ccfecc","#198f8f","#00a8a8","#26d8d8","#00feff","#7ce8e8","#65feff","#d3f7f7","#ccfefe","#19198f","#0000a8","#2626d8","#0000ff","#7c7ce8","#6565ff","#d3d3f7","#ccccfe","#8f198f","#a800a8","#d826d8","#ff00fe","#e87ce8","#ff65fe","#f7d3f7","#feccfe","#000000","#242424","#484848","#6d6d6d","#919191","#b6b6b6","#dadada","#ffffff"],b.__renkans=[];var e=b._BaseBin=function(a,c){if("undefined"!=typeof a){this.renkan=a,this.renkan.$.find(".Rk-Bin-Main").hide(),this.$=b.$("
            • ").addClass("Rk-Bin").appendTo(a.$.find(".Rk-Bin-List")),this.title_icon_$=b.$("").addClass("Rk-Bin-Title-Icon").appendTo(this.$);var d=this;b.$("").attr({href:"#",title:a.translate("Close bin")}).addClass("Rk-Bin-Close").html("×").appendTo(this.$).click(function(){return d.destroy(),a.$.find(".Rk-Bin-Main:visible").length||a.$.find(".Rk-Bin-Main:last").slideDown(),a.resizeBins(),!1}),b.$("").attr({href:"#",title:a.translate("Refresh bin")}).addClass("Rk-Bin-Refresh").appendTo(this.$).click(function(){return d.refresh(),!1}),this.count_$=b.$("
              ").addClass("Rk-Bin-Count").appendTo(this.$),this.title_$=b.$("

              ").addClass("Rk-Bin-Title").appendTo(this.$),this.main_$=b.$("
              ").addClass("Rk-Bin-Main").appendTo(this.$).html('

              '+a.translate("Loading, please wait")+"

              "),this.title_$.html(c.title||"(new bin)"),this.renkan.resizeBins(),c.auto_refresh&&window.setInterval(function(){d.refresh()},c.auto_refresh)}};e.prototype.destroy=function(){this.$.detach(),this.renkan.resizeBins()};var f=b.Renkan=function(a){var e=this;b.__renkans.push(this),this.options=d.defaults(a,b.defaults,{templates:d.defaults(a.templates,renkanJST)||renkanJST,node_editor_templates:d.defaults(a.node_editor_templates,b.defaults.node_editor_templates)}),this.template=renkanJST["templates/main.html"];var f={};if(d.each(this.options.node_editor_templates,function(a,b){f[b]=e.options.templates[a],delete e.options.templates[a]}),this.options.node_editor_templates=f,d.each(this.options.property_files,function(a){b.$.getJSON(a,function(a){e.options.properties=e.options.properties.concat(a)})}),this.read_only=this.options.read_only||!this.options.editor_mode,this.router=new b.Router,this.project=new b.Models.Project,this.dataloader=new b.DataLoader.Loader(this.project,this.options),this.setCurrentUser=function(a,b){this.project.addUser({_id:a,title:b}),this.current_user=a,this.renderer.redrawUsers()},"undefined"!=typeof this.options.user_id&&(this.current_user=this.options.user_id),this.$=b.$("#"+this.options.container),this.$.addClass("Rk-Main").html(this.template(this)),this.tabs=[],this.search_engines=[],this.current_user_list=new b.Models.UsersList,this.current_user_list.on("add remove",function(){this.renderer&&this.renderer.redrawUsers()}),this.colorPicker=function(){var a=renkanJST["templates/colorpicker.html"];return'
                '+b.pickerColors.map(function(b){return a({c:b})}).join("")+"
              "}(),this.options.show_editor&&(this.renderer=new b.Renderer.Scene(this)),this.options.search.length){var g=renkanJST["templates/search.html"],h=this.$.find(".Rk-Search-List"),i=this.$.find(".Rk-Web-Search-Input"),j=this.$.find(".Rk-Web-Search-Form");d.each(this.options.search,function(a,c){b[a.type]&&b[a.type].Search&&e.search_engines.push(new b[a.type].Search(e,a))}),h.html(d(this.search_engines).map(function(a,b){return g({key:b,title:a.getSearchTitle(),className:a.getBgClass()})}).join("")),h.find("li").click(function(){var a=b.$(this);e.setSearchEngine(a.attr("data-key")),j.submit()}),j.submit(function(){if(i.val()){var a=e.search_engine;a.search(i.val())}return!1}),this.$.find(".Rk-Search-Current").mouseenter(function(){h.slideDown()}),this.$.find(".Rk-Search-Select").mouseleave(function(){h.hide()}),this.setSearchEngine(0)}else this.$.find(".Rk-Web-Search-Form").detach();d.each(this.options.bins,function(a){b[a.type]&&b[a.type].Bin&&e.tabs.push(new b[a.type].Bin(e,a))});var k=!1;this.$.find(".Rk-Bins").on("click",".Rk-Bin-Title,.Rk-Bin-Title-Icon",function(){var a=b.$(this).siblings(".Rk-Bin-Main");a.is(":hidden")&&(e.$.find(".Rk-Bin-Main").slideUp(),a.slideDown())}),this.options.show_editor&&this.$.find(".Rk-Bins").on("mouseover",".Rk-Bin-Item",function(a){var f=b.$(this);if(f&&c(f).attr("data-uri")){var g=e.project.get("nodes").where({uri:c(f).attr("data-uri")});d.each(g,function(a){e.renderer.highlightModel(a)})}}).mouseout(function(){ +e.renderer.unhighlightAll()}).on("mousemove",".Rk-Bin-Item",function(a){try{this.dragDrop()}catch(b){}}).on("touchstart",".Rk-Bin-Item",function(a){k=!1}).on("touchmove",".Rk-Bin-Item",function(a){a.preventDefault();var b=a.originalEvent.changedTouches[0],c=e.renderer.canvas_$.offset(),d=e.renderer.canvas_$.width(),f=e.renderer.canvas_$.height();if(b.pageX>=c.left&&b.pageX=c.top&&b.pageY1?a:null);c.source!==l&&(l=c.source,d.each(e.tabs,function(a){a.render(c)}))}}),this.$.find(".Rk-Bins-Search-Form").submit(function(){return!1})};f.prototype.translate=function(a){return b.i18n[this.options.language]&&b.i18n[this.options.language][a]?b.i18n[this.options.language][a]:this.options.language.length>2&&b.i18n[this.options.language.substr(0,2)]&&b.i18n[this.options.language.substr(0,2)][a]?b.i18n[this.options.language.substr(0,2)][a]:a},f.prototype.onStatusChange=function(){this.renderer.onStatusChange()},f.prototype.setSearchEngine=function(a){this.search_engine=this.search_engines[a],this.$.find(".Rk-Search-Current").attr("class","Rk-Search-Current "+this.search_engine.getBgClass());for(var b=this.search_engine.getBgClass().split(" "),c="",d=0;da?"0"+a:a}var b=new Date,c=0,d=b.getUTCFullYear()+"-"+a(b.getUTCMonth()+1)+"-"+a(b.getUTCDate())+"-"+g();return function(a){for(var b=(++c).toString(16),e="undefined"==typeof a?"":a+"-";b.length<4;)b="0"+b;return e+d+"-"+b}}(),getFullURL:function(a){if("undefined"==typeof a||null==a)return"";if(/https?:\/\//.test(a))return a;var b=new Image;b.src=a;var c=b.src;return b.src=null,c},inherit:function(a,b){var c=function(c){"function"==typeof b&&b.apply(this,Array.prototype.slice.call(arguments,0)),a.apply(this,Array.prototype.slice.call(arguments,0)),"function"!=typeof this._init||this._initialized||(this._init.apply(this,Array.prototype.slice.call(arguments,0)),this._initialized=!0)};return d.extend(c.prototype,a.prototype),c},regexpFromTextOrArray:function(){function a(a){function b(a){return function(b,c){a=a.replace(h[b],c)}}for(var e=a.toLowerCase().replace(g,""),i="",j=0;j"+a.translate("Drag items from this website, drop them in Renkan").replace(/ /g,"_")+"

              '.replace(/_/g,String.fromCharCode(32));b.appendChild(d);e=[{r:/https?:\\/\\/[^\\/]*twitter\\.com\\//,s:'.tweet',n:'twitter'},{r:/https?:\\/\\/[^\\/]*google\\.[^\\/]+\\//,s:'.g',n:'google'},{r:/https?:\\/\\/[^\\/]*lemonde\\.fr\\//,s:'[data-vr-contentbox]',n:'lemonde'}];f=false;e.forEach(function(g){if(g.r.test(c)){f=g;}});if(f){h=function(){Array.prototype.forEach.call(a.querySelectorAll(f.s),function(i){i[j]=true;k=i.style;k.borderWidth='2px';k.borderColor='#909';k.borderStyle='solid';k.backgroundColor='rgba(200,0,180,.1)';})};window.setInterval(h,500);h();};a.addEventListener('dragstart',function(k){l=k.dataTransfer;l.setData(m+'source-uri',c);l.setData(m+'source-title',a.title);n=k.target;if(f){o=n;while(!o.attributes[j]){o=o.parentNode;if(o==b){break;}}}if(f&&o.attributes[j]){p=o.cloneNode(true);l.setData(m+'specific-site',f.n)}else{q=a.getSelection();if(q.type==='Range'||!q.type){p=q.getRangeAt(0).cloneContents();}else{p=n.cloneNode();}}r=a.createElement('div');r.appendChild(p);l.setData('text/x-iri-selected-text',r.textContent.trim());l.setData('text/x-iri-selected-html',r.innerHTML);},false);})();"},shortenText:function(a,b){return a.length>b?a.substr(0,b)+"…":a},drawEditBox:function(a,b,c,d,e){e.css({width:a.tooltip_width-2*a.tooltip_padding});var f=e.outerHeight()+2*a.tooltip_padding,g=b.xpaper.view.size.height-a.tooltip_margin&&(j=Math.max(paper.view.size.height-a.tooltip_margin,b.y+a.tooltip_arrow_width/2)-f),jb;b++){var d=a.nodes[b];d.color?d.style={color:d.color}:d.style={}}if("undefined"!=typeof a.edges)for(b=0,c=a.edges.length;c>b;b++){var e=a.edges[b];e.color?e.style={color:e.color}:e.style={}}return a.schema_version="2",a}}};b.Loader=function(a,c){this.project=a,this.dataConverters=_.defaults(c.converters||{},b.converters)},b.Loader.prototype.convert=function(a){var b=this.project.getSchemaVersion(a),c=this.project.getSchemaVersion();if(b!==c){var d="from"+b+"to"+c;"function"==typeof this.dataConverters[d]&&(a=this.dataConverters[d](a))}return a},b.Loader.prototype.load=function(a){this.project.set(this.convert(a),{validate:!0})}}(window),function(a){"use strict";var b=a.Backbone,c=a.Rkns.Models={};c.getUID=function(a){var b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"===a?b:3&b|8;return c.toString(16)});return"undefined"!=typeof a?a.type+"-"+b:b};var d=b.RelationalModel.extend({idAttribute:"_id",constructor:function(a){"undefined"!=typeof a&&(a._id=a._id||a.id||c.getUID(this),a.title=a.title||"",a.description=a.description||"",a.uri=a.uri||"","function"==typeof this.prepare&&(a=this.prepare(a))),b.RelationalModel.prototype.constructor.call(this,a)},validate:function(){return this.type?void 0:"object has no type"},addReference:function(a,b,c,d,e){var f=c.get(d);"undefined"==typeof f&&"undefined"!=typeof e?a[b]=e:a[b]=f}}),e=c.User=d.extend({type:"user",prepare:function(a){return a.color=a.color||"#666666",a},toJSON:function(){return{_id:this.get("_id"),title:this.get("title"),uri:this.get("uri"),description:this.get("description"),color:this.get("color")}}}),f=c.Node=d.extend({type:"node",relations:[{type:b.HasOne,key:"created_by",relatedModel:e}],prepare:function(a){var b=a.project;return this.addReference(a,"created_by",b.get("users"),a.created_by,b.current_user),a.description=a.description||"",a},toJSON:function(){return{_id:this.get("_id"),title:this.get("title"),uri:this.get("uri"),description:this.get("description"),position:this.get("position"),image:this.get("image"),style:this.get("style"),created_by:this.get("created_by")?this.get("created_by").get("_id"):null,size:this.get("size"),clip_path:this.get("clip_path"),shape:this.get("shape"),type:this.get("type")}}}),g=c.Edge=d.extend({type:"edge",relations:[{type:b.HasOne,key:"created_by",relatedModel:e},{type:b.HasOne,key:"from",relatedModel:f},{type:b.HasOne,key:"to",relatedModel:f}],prepare:function(a){var b=a.project;return this.addReference(a,"created_by",b.get("users"),a.created_by,b.current_user),this.addReference(a,"from",b.get("nodes"),a.from),this.addReference(a,"to",b.get("nodes"),a.to),a},toJSON:function(){return{_id:this.get("_id"),title:this.get("title"),uri:this.get("uri"),description:this.get("description"),from:this.get("from")?this.get("from").get("_id"):null,to:this.get("to")?this.get("to").get("_id"):null,style:this.get("style"),created_by:this.get("created_by")?this.get("created_by").get("_id"):null}}}),h=c.View=d.extend({type:"view",relations:[{type:b.HasOne,key:"created_by",relatedModel:e}],prepare:function(a){var b=a.project;if(this.addReference(a,"created_by",b.get("users"),a.created_by,b.current_user),a.description=a.description||"","undefined"!=typeof a.offset){var c={};Array.isArray(a.offset)?(c.x=a.offset[0],c.y=a.offset.length>1?a.offset[1]:a.offset[0]):null!=a.offset.x&&(c.x=a.offset.x,c.y=a.offset.y),a.offset=c}return a},toJSON:function(){return{_id:this.get("_id"),zoom_level:this.get("zoom_level"),offset:this.get("offset"),title:this.get("title"),description:this.get("description"),created_by:this.get("created_by")?this.get("created_by").get("_id"):null,hidden_nodes:this.get("hidden_nodes")}}}),i=(c.Project=d.extend({schema_version:"2",type:"project",blacklist:["saveStatus","loadingStatus"],relations:[{type:b.HasMany,key:"users",relatedModel:e,reverseRelation:{key:"project",includeInJSON:"_id"}},{type:b.HasMany,key:"nodes",relatedModel:f,reverseRelation:{key:"project",includeInJSON:"_id"}},{type:b.HasMany,key:"edges",relatedModel:g,reverseRelation:{key:"project",includeInJSON:"_id"}},{type:b.HasMany,key:"views",relatedModel:h,reverseRelation:{key:"project",includeInJSON:"_id"}}],addUser:function(a,b){a.project=this;var c=e.findOrCreate(a);return this.get("users").push(c,b),c},addNode:function(a,b){a.project=this;var c=f.findOrCreate(a);return this.get("nodes").push(c,b),c},addEdge:function(a,b){a.project=this;var c=g.findOrCreate(a);return this.get("edges").push(c,b),c},addView:function(a,b){a.project=this;var c=h.findOrCreate(a);return this.get("views").push(c,b),c},removeNode:function(a){this.get("nodes").remove(a)},removeEdge:function(a){this.get("edges").remove(a)},validate:function(a){var b=this;_.each([].concat(a.users,a.nodes,a.edges,a.views),function(a){a&&(a.project=b)})},getSchemaVersion:function(a){var b=a;"undefined"==typeof b&&(b=this);var c=b.schema_version;return c?c:1},initialize:function(){var a=this;this.on("remove:nodes",function(b){a.get("edges").remove(a.get("edges").filter(function(a){return a.get("from")===b||a.get("to")===b}))})},toJSON:function(){var a=_.clone(this.attributes);for(var c in a)(a[c]instanceof b.Model||a[c]instanceof b.Collection||a[c]instanceof d)&&(a[c]=a[c].toJSON());return _.omit(a,this.blacklist)}}),c.RosterUser=b.Model.extend({type:"roster_user",idAttribute:"_id",constructor:function(a){"undefined"!=typeof a&&(a._id=a._id||a.id||c.getUID(this),a.title=a.title||"(untitled "+this.type+")",a.description=a.description||"",a.uri=a.uri||"",a.project=a.project||null,a.site_id=a.site_id||0,"function"==typeof this.prepare&&(a=this.prepare(a))),b.Model.prototype.constructor.call(this,a)},validate:function(){return this.type?void 0:"object has no type"},prepare:function(a){return a.color=a.color||"#666666",a},toJSON:function(){return{_id:this.get("_id"),title:this.get("title"),uri:this.get("uri"),description:this.get("description"),color:this.get("color"),project:null!=this.get("project")?this.get("project").get("id"):null,site_id:this.get("site_id")}}}));c.UsersList=b.Collection.extend({model:i})}(window),Rkns.defaults={language:navigator.language||navigator.userLanguage||"en",container:"renkan",search:[],bins:[],static_url:"",popup_editor:!0,editor_panel:"editor-panel",show_bins:!0,properties:[],show_editor:!0,read_only:!1,editor_mode:!0,manual_save:!1,show_top_bar:!0,default_user_color:"#303030",size_bug_fix:!1,force_resize:!1,allow_double_click:!0,zoom_on_scroll:!0,element_delete_delay:0,autoscale_padding:50,resize:!0,show_zoom:!0,save_view:!0,default_view:!1,default_index_view:-1,update_url:!0,show_search_field:!0,show_user_list:!0,user_name_editable:!0,user_color_editable:!0,show_user_color:!0,show_save_button:!0,show_export_button:!0,show_open_button:!1,show_addnode_button:!0,show_addedge_button:!0,show_bookmarklet:!0,show_fullscreen_button:!0,home_button_url:!1,home_button_title:"Home",show_minimap:!0,minimap_width:160,minimap_height:120,minimap_padding:20,minimap_background_color:"#ffffff",minimap_border_color:"#cccccc",minimap_highlight_color:"#ffff00",minimap_highlight_weight:5,buttons_background:"#202020",buttons_label_color:"#c000c0",buttons_label_font_size:9,ghost_opacity:.3,default_dash_array:[4,5],show_node_circles:!0,clip_node_images:!0,node_images_fill_mode:!1,node_size_base:25,node_stroke_width:2,node_stroke_max_width:12,selected_node_stroke_width:4,selected_node_stroke_max_width:24,node_stroke_witdh_scale:5,node_fill_color:"#ffffff",highlighted_node_fill_color:"#ffff00",node_label_distance:5,node_label_max_length:60,label_untitled_nodes:"(untitled)",hide_nodes:!0,change_shapes:!0,change_types:!0,node_editor_templates:{"default":"templates/nodeeditor_readonly.html",video:"templates/nodeeditor_video.html"},edge_stroke_width:2,edge_stroke_max_width:12,selected_edge_stroke_width:4,selected_edge_stroke_max_width:24,edge_stroke_witdh_scale:5,edge_label_distance:0,edge_label_max_length:20,edge_arrow_length:18,edge_arrow_width:12,edge_arrow_max_width:32,edge_gap_in_bundles:12,label_untitled_edges:"",tooltip_width:275,tooltip_padding:10,tooltip_margin:15,tooltip_arrow_length:20,tooltip_arrow_width:40,tooltip_top_color:"#f0f0f0",tooltip_bottom_color:"#d0d0d0",tooltip_border_color:"#808080",tooltip_border_width:1,tooltip_opacity:.8,richtext_editor_config:{toolbarGroups:[{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"clipboard",groups:["clipboard","undo"]},"/",{name:"styles"}],removePlugins:"colorbutton,find,flash,font,forms,iframe,image,newpage,smiley,specialchar,stylescombo,templates"},show_node_editor_uri:!0,show_node_editor_description:!0,show_node_editor_description_richtext:!0,show_node_editor_size:!0,show_node_editor_style:!0,show_node_editor_style_color:!0,show_node_editor_style_dash:!0,show_node_editor_style_thickness:!0,show_node_editor_image:!0,show_node_editor_creator:!0,allow_image_upload:!0,uploaded_image_max_kb:500,show_node_tooltip_uri:!0,show_node_tooltip_description:!0,show_node_tooltip_color:!0,show_node_tooltip_image:!0,show_node_tooltip_creator:!0,show_edge_editor_uri:!0,show_edge_editor_style:!0,show_edge_editor_style_color:!0,show_edge_editor_style_dash:!0,show_edge_editor_style_thickness:!0,show_edge_editor_style_arrow:!0,show_edge_editor_direction:!0,show_edge_editor_nodes:!0,show_edge_editor_creator:!0,show_edge_tooltip_uri:!0,show_edge_tooltip_color:!0,show_edge_tooltip_nodes:!0,show_edge_tooltip_creator:!0},Rkns.i18n={fr:{"Edit Node":"Ɖdition d’un nœud","Edit Edge":"Ɖdition d’un lien","Title:":"Titre :","URI:":"URI :","Description:":"Description :","From:":"De :","To:":"Vers :",Image:"Image","Image URL:":"URL d'Image","Choose Image File:":"Choisir un fichier image","Full Screen":"Mode plein Ć©cran","Add Node":"Ajouter un nœud","Add Edge":"Ajouter un lien","Save Project":"Enregistrer le projet","Open Project":"Ouvrir un projet","Auto-save enabled":"Enregistrement automatique activĆ©","Connection lost":"Connexion perdue","Created by:":"CrƩƩ par :","Zoom In":"Agrandir l’échelle","Zoom Out":"Rapetisser l’échelle",Edit:"Ɖditer",Remove:"Supprimer","Cancel deletion":"Annuler la suppression","Link to another node":"CrĆ©er un lien",Enlarge:"Agrandir",Shrink:"RĆ©trĆ©cir","Click on the background canvas to add a node":"Cliquer sur le fond du graphe pour rajouter un nœud","Click on a first node to start the edge":"Cliquer sur un premier nœud pour commencer le lien","Click on a second node to complete the edge":"Cliquer sur un second nœud pour terminer le lien",Wikipedia:"WikipĆ©dia","Wikipedia in ":"WikipĆ©dia en ",French:"FranƧais",English:"Anglais",Japanese:"Japonais","Untitled project":"Projet sans titre","Lignes de Temps":"Lignes de Temps","Loading, please wait":"Chargement en cours, merci de patienter","Edge color:":"Couleur :","Dash:":"Point. :","Thickness:":"Epaisseur :","Arrow:":"FlĆØche :","Node color:":"Couleur :","Choose color":"Choisir une couleur","Change edge direction":"Changer le sens du lien","Do you really wish to remove node ":"Voulez-vous rĆ©ellement supprimer le nœud ","Do you really wish to remove edge ":"Voulez-vous rĆ©ellement supprimer le lien ","This file is not an image":"Ce fichier n'est pas une image","Image size must be under ":"L'image doit peser moins de ","Size:":"Taille :",KB:"ko","Choose from vocabulary:":"Choisir dans un vocabulaire :","SKOS Documentation properties":"SKOS: PropriĆ©tĆ©s documentaires","has note":"a pour note","has example":"a pour exemple","has definition":"a pour dĆ©finition","SKOS Semantic relations":"SKOS: Relations sĆ©mantiques","has broader":"a pour concept plus large","has narrower":"a pour concept plus Ć©troit","has related":"a pour concept apparentĆ©","Dublin Core Metadata":"MĆ©tadonnĆ©es Dublin Core","has contributor":"a pour contributeur",covers:"couvre","created by":"crƩƩ par","has date":"a pour date","published by":"Ć©ditĆ© par","has source":"a pour source","has subject":"a pour sujet","Dragged resource":"Ressource glisĆ©e-dĆ©posĆ©e","Search the Web":"Rechercher en ligne","Search in Bins":"Rechercher dans les chutiers","Close bin":"Fermer le chutier","Refresh bin":"RafraĆ®chir le chutier","(untitled)":"(sans titre)","Select contents:":"SĆ©lectionner des contenus :","Drag items from this website, drop them in Renkan":"Glissez des Ć©lĆ©ments de ce site web vers Renkan","Drag this button to your bookmark bar. When on a third-party website, click it to enable drag-and-drop from the website to Renkan.":"Glissez ce bouton vers votre barre de favoris. Ensuite, depuis un site tiers, cliquez dessus pour activer 'Drag-to-Add' puis glissez des Ć©lĆ©ments de ce site vers Renkan","Shapes available":"Formes disponibles",Circle:"Cercle",Square:"CarrĆ©",Diamond:"Losange",Hexagone:"Hexagone",Ellipse:"Ellipse",Star:"Ɖtoile",Cloud:"Nuage",Triangle:"Triangle","Zoom Fit":"Ajuster le Zoom","Download Project":"TĆ©lĆ©charger le projet","Save view":"Sauver la vue","View saved view":"Restaurer la Vue","Renkan 'Drag-to-Add' bookmarklet":"Renkan 'Deplacer-Pour-Ajouter' Signet","(unknown user)":"(non authentifiĆ©)","":"","Search in graph":"Rechercher dans carte","Search in ":"Chercher dans "}},Rkns.jsonIO=function(a,b){var c=a.project;"undefined"==typeof b.http_method&&(b.http_method="PUT");var d=function(){a.renderer.redrawActive=!1,c.set({loadingStatus:!0}),Rkns.$.getJSON(b.url,function(b){a.dataloader.load(b),c.set({loadingStatus:!1}),c.set({saveStatus:0}),a.renderer.redrawActive=!0})},e=function(){c.set({saveStatus:2});var d=c.toJSON();a.read_only||Rkns.$.ajax({type:b.http_method,url:b.url,contentType:"application/json",data:JSON.stringify(d),success:function(a,b,d){c.set({saveStatus:0})}})},f=Rkns._.throttle(function(){setTimeout(e,100)},1e3);c.on("add:nodes add:edges add:users add:views",function(a){a.on("change remove",function(a){f()}),f()}),c.on("change",function(){1===c.changedAttributes.length&&c.hasChanged("saveStatus")||f()}),d()},Rkns.jsonIOSaveOnClick=function(a,b){var c=a.project,d=!1,e=function(){return"Project not saved"};"undefined"==typeof b.http_method&&(b.http_method="POST");var f=function(){var d={},e=/id=([^&#?=]+)/,f=document.location.hash.match(e);f&&(d.id=f[1]),Rkns.$.ajax({url:b.url,data:d,beforeSend:function(){a.renderer.redrawActive=!1,c.set({loadingStatus:!0})},success:function(b){a.dataloader.load(b),c.set({loadingStatus:!1}),c.set({saveStatus:0}),a.renderer.redrawActive=!0}})},g=function(){c.set("saved_at",new Date);var a=c.toJSON();Rkns.$.ajax({type:b.http_method,url:b.url,contentType:"application/json",data:JSON.stringify(a),beforeSend:function(){c.set({saveStatus:2})},success:function(a,b,f){$(window).off("beforeunload",e),d=!1,c.set({saveStatus:0})}})},h=function(){c.set({saveStatus:1});var a=c.get("title");a&&c.get("nodes").length?$(".Rk-Save-Button").removeClass("disabled"):$(".Rk-Save-Button").addClass("disabled"),a&&$(".Rk-PadTitle").css("border-color","#333333"),d||(d=!0,$(window).on("beforeunload",e))};f(),c.on("add:nodes add:edges add:users change",function(a){a.on("change remove",function(a){1===a.changedAttributes.length&&a.hasChanged("saveStatus")||h()}),1===c.changedAttributes.length&&c.hasChanged("saveStatus")||h()}),a.renderer.save=function(){$(".Rk-Save-Button").hasClass("disabled")?c.get("title")||$(".Rk-PadTitle").css("border-color","#ff0000"):g()}},function(a){"use strict";var b=a._,c=a.Ldt={},d=(c.Bin=function(a,b){if(b.ldt_type){var d=c[b.ldt_type+"Bin"];if(d)return new d(a,b)}console.error("No such LDT Bin Type")},c.ProjectBin=a.Utils.inherit(a._BaseBin));d.prototype.tagTemplate=renkanJST["templates/ldtjson-bin/tagtemplate.html"],d.prototype.annotationTemplate=renkanJST["templates/ldtjson-bin/annotationtemplate.html"],d.prototype._init=function(a,b){this.renkan=a,this.proj_id=b.project_id,this.ldt_platform=b.ldt_platform||"http://ldt.iri.centrepompidou.fr/",this.title_$.html(b.title),this.title_icon_$.addClass("Rk-Ldt-Title-Icon"),this.refresh()},d.prototype.render=function(c){function d(a){var c=b(a).escape();return f.isempty?c:f.replace(c,"$1")}function e(a){function b(a){for(var b=a.toString();b.length<2;)b="0"+b;return b}var c=Math.abs(Math.floor(a/1e3)),d=Math.floor(c/3600),e=Math.floor(c/60)%60,f=c%60,g="";return d&&(g+=b(d)+":"),g+=b(e)+":"+b(f)}var f=c||a.Utils.regexpFromTextOrArray(),g="
            • Tags

            • ",h=this.data.meta["dc:title"],i=this,j=0;i.title_$.text('LDT Project: "'+h+'"'),b.map(i.data.tags,function(a){var b=a.meta["dc:title"];(f.isempty||f.test(b))&&(j++,g+=i.tagTemplate({ldt_platform:i.ldt_platform,title:b,htitle:d(b),encodedtitle:encodeURIComponent(b),static_url:i.renkan.options.static_url}))}),g+="
            • Annotations

            • ",b.map(i.data.annotations,function(a){var b=a.content.description,c=a.content.title.replace(b,"");if(f.isempty||f.test(c)||f.test(b)){j++;var h=a.end-a.begin,k=a.content&&a.content.img&&a.content.img.src?a.content.img.src:h?i.renkan.options.static_url+"img/ldt-segment.png":i.renkan.options.static_url+"img/ldt-point.png";g+=i.annotationTemplate({ldt_platform:i.ldt_platform,title:c,htitle:d(c),description:b,hdescription:d(b),start:e(a.begin),end:e(a.end),duration:e(h),mediaid:a.media,annotationid:a.id,image:k,static_url:i.renkan.options.static_url})}}),this.main_$.html(g),!f.isempty&&j?this.count_$.text(j).show():this.count_$.hide(),f.isempty||j?this.$.show():this.$.hide(),this.renkan.resizeBins()},d.prototype.refresh=function(){var b=this;a.$.ajax({url:this.ldt_platform+"ldtplatform/ldt/cljson/id/"+this.proj_id,dataType:"jsonp",success:function(a){b.data=a,b.render()}})};var e=c.Search=function(a,b){this.renkan=a,this.lang=b.lang||"en"};e.prototype.getBgClass=function(){return"Rk-Ldt-Icon"},e.prototype.getSearchTitle=function(){return this.renkan.translate("Lignes de Temps")},e.prototype.search=function(a){this.renkan.tabs.push(new f(this.renkan,{search:a}))};var f=c.ResultsBin=a.Utils.inherit(a._BaseBin);f.prototype.segmentTemplate=renkanJST["templates/ldtjson-bin/segmenttemplate.html"],f.prototype._init=function(a,b){this.renkan=a,this.ldt_platform=b.ldt_platform||"http://ldt.iri.centrepompidou.fr/",this.max_results=b.max_results||50,this.search=b.search,this.title_$.html('Lignes de Temps: "'+b.search+'"'),this.title_icon_$.addClass("Rk-Ldt-Title-Icon"),this.refresh()},f.prototype.render=function(c){function d(a){return g.replace(b(a).escape(),"$1")}function e(a){function b(a){for(var b=a.toString();b.length<2;)b="0"+b;return b}var c=Math.abs(Math.floor(a/1e3)),d=Math.floor(c/3600),e=Math.floor(c/60)%60,f=c%60,g="";return d&&(g+=b(d)+":"),g+=b(e)+":"+b(f)}if(this.data){var f=c||a.Utils.regexpFromTextOrArray(),g=f.isempty?a.Utils.regexpFromTextOrArray(this.search):f,h="",i=this,j=0;b.each(this.data.objects,function(a){var b=a["abstract"],c=a.title;if(f.isempty||f.test(c)||f.test(b)){j++;var g=a.duration,k=a.start_ts,l=+a.duration+k,m=g?i.renkan.options.static_url+"img/ldt-segment.png":i.renkan.options.static_url+"img/ldt-point.png";h+=i.segmentTemplate({ldt_platform:i.ldt_platform,title:c,htitle:d(c),description:b,hdescription:d(b),start:e(k),end:e(l),duration:e(g),mediaid:a.iri_id,annotationid:a.element_id,image:m})}}),this.main_$.html(h),!f.isempty&&j?this.count_$.text(j).show():this.count_$.hide(),f.isempty||j?this.$.show():this.$.hide(),this.renkan.resizeBins()}},f.prototype.refresh=function(){var b=this;a.$.ajax({url:this.ldt_platform+"ldtplatform/api/ldt/1.0/segments/search/",data:{format:"jsonp",q:this.search,limit:this.max_results},dataType:"jsonp",success:function(a){b.data=a,b.render()}})}}(window.Rkns),Rkns.ResourceList={},Rkns.ResourceList.Bin=Rkns.Utils.inherit(Rkns._BaseBin),Rkns.ResourceList.Bin.prototype.resultTemplate=renkanJST["templates/list-bin.html"],Rkns.ResourceList.Bin.prototype._init=function(a,b){this.renkan=a,this.title_$.html(b.title),b.list&&(this.data=b.list),this.refresh()},Rkns.ResourceList.Bin.prototype.render=function(a){function b(a){var b=_(a).escape();return c.isempty?b:c.replace(b,"$1")}var c=a||Rkns.Utils.regexpFromTextOrArray(),d="",e=this,f=0;Rkns._.each(this.data,function(a){var g;if("string"==typeof a)if(/^(https?:\/\/|www)/.test(a))g={url:a};else{g={title:a.replace(/[:,]?\s?(https?:\/\/|www)[\d\w\/.&?=#%-_]+\s?/,"").trim()};var h=a.match(/(https?:\/\/|www)[\d\w\/.&?=#%-_]+/);h&&(g.url=h[0]),g.title.length>80&&(g.description=g.title,g.title=g.title.replace(/^(.{30,60})\s.+$/,"$1…"))}else g=a;var i=g.title||(g.url||"").replace(/^https?:\/\/(www\.)?/,"").replace(/^(.{40}).+$/,"$1…"),j=g.url||"",k=g.description||"",l=g.image||"";j&&!/^https?:\/\//.test(j)&&(j="http://"+j),(c.isempty||c.test(i)||c.test(k))&&(f++,d+=e.resultTemplate({url:j,title:i,htitle:b(i),image:l,description:k,hdescription:b(k),static_url:e.renkan.options.static_url}))}),e.main_$.html(d),!c.isempty&&f?this.count_$.text(f).show():this.count_$.hide(),c.isempty||f?this.$.show():this.$.hide(),this.renkan.resizeBins()},Rkns.ResourceList.Bin.prototype.refresh=function(){this.data&&this.render()},Rkns.Wikipedia={},Rkns.Wikipedia.Search=function(a,b){this.renkan=a,this.lang=b.lang||"en"},Rkns.Wikipedia.Search.prototype.getBgClass=function(){return"Rk-Wikipedia-Search-Icon Rk-Wikipedia-Lang-"+this.lang},Rkns.Wikipedia.Search.prototype.getSearchTitle=function(){var a={fr:"French",en:"English",ja:"Japanese"};return a[this.lang]?this.renkan.translate("Wikipedia in ")+this.renkan.translate(a[this.lang]):this.renkan.translate("Wikipedia")+" ["+this.lang+"]"},Rkns.Wikipedia.Search.prototype.search=function(a){this.renkan.tabs.push(new Rkns.Wikipedia.Bin(this.renkan,{lang:this.lang,search:a}))},Rkns.Wikipedia.Bin=Rkns.Utils.inherit(Rkns._BaseBin),Rkns.Wikipedia.Bin.prototype.resultTemplate=renkanJST["templates/wikipedia-bin/resulttemplate.html"],Rkns.Wikipedia.Bin.prototype._init=function(a,b){this.renkan=a,this.search=b.search,this.lang=b.lang||"en",this.title_icon_$.addClass("Rk-Wikipedia-Title-Icon Rk-Wikipedia-Lang-"+this.lang),this.title_$.html(this.search).addClass("Rk-Wikipedia-Title"),this.refresh()},Rkns.Wikipedia.Bin.prototype.render=function(a){function b(a){return d.replace(_(a).escape(),"$1")}var c=a||Rkns.Utils.regexpFromTextOrArray(),d=c.isempty?Rkns.Utils.regexpFromTextOrArray(this.search):c,e="",f=this,g=0;Rkns._.each(this.data.query.search,function(a){var d=a.title,h="http://"+f.lang+".wikipedia.org/wiki/"+encodeURI(d.replace(/ /g,"_")),i=Rkns.$("
              ").html(a.snippet).text();(c.isempty||c.test(d)||c.test(i))&&(g++,e+=f.resultTemplate({url:h,title:d,htitle:b(d),description:i,hdescription:b(i),static_url:f.renkan.options.static_url}))}),f.main_$.html(e),!c.isempty&&g?this.count_$.text(g).show():this.count_$.hide(),c.isempty||g?this.$.show():this.$.hide(),this.renkan.resizeBins()},Rkns.Wikipedia.Bin.prototype.refresh=function(){var a=this;Rkns.$.ajax({url:"http://"+a.lang+".wikipedia.org/w/api.php?action=query&list=search&srsearch="+encodeURIComponent(this.search)+"&format=json",dataType:"jsonp",success:function(b){a.data=b,a.render()}})},define("renderer/baserepresentation",["jquery","underscore"],function(a,b){"use strict";var c=function(a,c){if("undefined"!=typeof a&&(this.renderer=a,this.renkan=a.renkan,this.project=a.renkan.project,this.options=a.renkan.options,this.model=c,this.model)){var d=this;this._changeBinding=function(){d.redraw({change:!0})},this._removeBinding=function(){a.removeRepresentation(d),b.defer(function(){a.redraw()})},this._selectBinding=function(){d.select()},this._unselectBinding=function(){d.unselect()},this.model.on("change",this._changeBinding),this.model.on("remove",this._removeBinding),this.model.on("select",this._selectBinding),this.model.on("unselect",this._unselectBinding)}};return b(c.prototype).extend({_super:function(a){return c.prototype[a].apply(this,Array.prototype.slice.call(arguments,1)); +},redraw:function(){},moveTo:function(){},show:function(){return"BaseRepresentation.show"},hide:function(){},select:function(){this.model&&this.model.trigger("selected")},unselect:function(){this.model&&this.model.trigger("unselected")},highlight:function(){},unhighlight:function(){},mousedown:function(){},mouseup:function(){this.model&&this.model.trigger("clicked")},destroy:function(){this.model&&(this.model.off("change",this._changeBinding),this.model.off("remove",this._removeBinding),this.model.off("select",this._selectBinding),this.model.off("unselect",this._unselectBinding))}}).value(),c}),define("requtils",[],function(a,b){"use strict";return{getUtils:function(){return window.Rkns.Utils},getRenderer:function(){return window.Rkns.Renderer}}}),define("renderer/basebutton",["jquery","underscore","requtils","renderer/baserepresentation"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({moveTo:function(a){this.sector.moveTo(a)},show:function(){this.sector.show()},hide:function(){this.sector&&this.sector.hide()},select:function(){this.sector.select()},unselect:function(a){this.sector.unselect(),(!a||a!==this.source_representation&&a.source_representation!==this.source_representation)&&this.source_representation.unselect()},destroy:function(){this.sector.destroy()}}).value(),f}),define("renderer/shapebuilder",[],function(){"use strict";var a="M0,0c-0.1218516546,-0.0336420601 -0.2451649928,0.0048580836 -0.3302944641,0.0884969975c-0.0444763883,-0.0550844815 -0.1047003238,-0.0975985034 -0.1769360893,-0.1175406746c-0.1859066673,-0.0513257002 -0.3774236254,0.0626045858 -0.4272374613,0.2541588105c-0.0036603877,0.0140753132 -0.0046241235,0.028229722 -0.0065872453,0.042307536c-0.1674179627,-0.0179317735 -0.3276106855,0.0900599386 -0.3725537463,0.2628868425c-0.0445325077,0.1712456429 0.0395025693,0.3463497959 0.1905420475,0.4183458793c-0.0082101538,0.0183442886 -0.0158652506,0.0372432828 -0.0211098452,0.0574080693c-0.0498130336,0.1915540431 0.0608692569,0.3884647499 0.2467762814,0.4397904033c0.0910577256,0.0251434257 0.1830791813,0.0103792696 0.2594677475,-0.0334472349c0.042100113,0.0928009202 0.1205930075,0.1674914182 0.2240666796,0.1960572479c0.1476344161,0.0407610407 0.297446165,-0.0238077445 0.3783262342,-0.1475652419c0.0327623278,0.0238981846 0.0691792333,0.0436665447 0.1102008706,0.0549940004c0.1859065794,0.0513256592 0.3770116432,-0.0627203154 0.4268255671,-0.2542745401c0.0250490557,-0.0963230532 0.0095494076,-0.1938010889 -0.0356681889,-0.2736906101c0.0447507424,-0.0439678867 0.0797796014,-0.0996624318 0.0969425462,-0.1656617192c0.0498137481,-0.1915564561 -0.0608688118,-0.3884669813 -0.2467755669,-0.4397928163c-0.0195699622,-0.0054005426 -0.0391731675,-0.0084429542 -0.0586916488,-0.0102888295c0.0115683912,-0.1682147574 -0.0933564223,-0.3269222408 -0.2572937178,-0.3721841203z",b={circle:{getShape:function(){return new paper.Path.Circle([0,0],1)},getImageShape:function(a,b){return new paper.Path.Circle(a,b)}},rectangle:{getShape:function(){return new paper.Path.Rectangle([-2,-2],[2,2])},getImageShape:function(a,b){return new paper.Path.Rectangle([-b,-b],[2*b,2*b])}},ellipse:{getShape:function(){return new paper.Path.Ellipse(new paper.Rectangle([-2,-1],[2,1]))},getImageShape:function(a,b){return new paper.Path.Ellipse(new paper.Rectangle([-b,-b/2],[2*b,b]))}},polygon:{getShape:function(){return new paper.Path.RegularPolygon([0,0],6,1)},getImageShape:function(a,b){return new paper.Path.RegularPolygon(a,6,b)}},diamond:{getShape:function(){var a=new paper.Path.Rectangle([-Math.SQRT2,-Math.SQRT2],[Math.SQRT2,Math.SQRT2]);return a.rotate(45),a},getImageShape:function(a,b){var c=new paper.Path.Rectangle([-b*Math.SQRT2/2,-b*Math.SQRT2/2],[b*Math.SQRT2,b*Math.SQRT2]);return c.rotate(45),c}},star:{getShape:function(){return new paper.Path.Star([0,0],8,1,.7)},getImageShape:function(a,b){return new paper.Path.Star(a,8,1*b,.7*b)}},cloud:{getShape:function(){var b=new paper.Path(a);return b},getImageShape:function(b,c){var d=new paper.Path(a);return d.scale(c),d.translate(b),d}},triangle:{getShape:function(){return new paper.Path.RegularPolygon([0,0],3,1)},getImageShape:function(a,b){var c=new paper.Path.RegularPolygon([0,0],3,1);return c.scale(b),c.translate(a),c}},svg:function(a){return{getShape:function(){return new paper.Path(a)},getImageShape:function(a,b){return new paper.Path}}}},c=function(a){return(null===a||"undefined"==typeof a)&&(a="circle"),"svg:"===a.substr(0,4)?b.svg(a.substr(4)):(a in b||(a="circle"),b[a])};return c.builders=b,c}),define("renderer/noderepr",["jquery","underscore","requtils","renderer/baserepresentation","renderer/shapebuilder"],function(a,b,c,d,e){"use strict";var f=c.getUtils(),g=f.inherit(d);return b(g.prototype).extend({_init:function(){if(this.renderer.node_layer.activate(),this.type="Node",this.buildShape(),this.hidden=!1,this.ghost=!1,this.options.show_node_circles?(this.circle.strokeWidth=this.options.node_stroke_width,this.h_ratio=1):this.h_ratio=0,this.title=a('
              ').appendTo(this.renderer.labels_$),this.options.editor_mode){var b=c.getRenderer();this.normal_buttons=[new b.NodeEditButton(this.renderer,null),new b.NodeRemoveButton(this.renderer,null),new b.NodeLinkButton(this.renderer,null),new b.NodeEnlargeButton(this.renderer,null),new b.NodeShrinkButton(this.renderer,null)],this.options.hide_nodes&&this.normal_buttons.push(new b.NodeHideButton(this.renderer,null),new b.NodeShowButton(this.renderer,null)),this.pending_delete_buttons=[new b.NodeRevertButton(this.renderer,null)],this.all_buttons=this.normal_buttons.concat(this.pending_delete_buttons);for(var d=0;d$1')):this.title.text(h);var i=this._getStrokeWidth();this.title.css({left:this.paper_coords.x,top:this.paper_coords.y+this.circle_radius*this.h_ratio+this.options.node_label_distance+.5*i,opacity:g});var j=this.model.has("style")&&this.model.get("style").color||(this.model.get("created_by")||f._USER_PLACEHOLDER(this.renkan)).get("color"),k=this.model.has("style")&&this.model.get("style").dash?this.options.default_dash_array:null;this.circle.strokeWidth=i,this.circle.strokeColor=j,this.circle.dashArray=k;var l=this.paper_coords;this.all_buttons.forEach(function(a){a.moveTo(l)});var m=this.img;if(this.img=this.model.get("image"),this.img&&this.img!==m&&(this.showImage(),this.circle&&this.circle.sendToBack()),this.node_image&&!this.img&&(this.node_image.remove(),delete this.node_image),this.renderer.minimap){this.minimap_circle.fillColor=j;var n=this.renderer.toMinimapCoords(c),o=this.renderer.minimap.scale*d,p=new paper.Size([o,o]);this.minimap_circle.fitBounds(n.subtract(p),p.multiply(2))}if(!("undefined"!=typeof a&&"dontRedrawEdges"in a&&a.dontRedrawEdges)){var q=this;b.each(this.project.get("edges").filter(function(a){return a.get("to")===q.model||a.get("from")===q.model}),function(a,b,c){var d=q.renderer.getRepresentationByModel(a);d&&"undefined"!=typeof d.from_representation&&"undefined"!=typeof d.from_representation.paper_coords&&"undefined"!=typeof d.to_representation&&"undefined"!=typeof d.to_representation.paper_coords&&d.redraw()})}this.ghost?this.show(!0):this.hidden&&this.hide()},showImage:function(){var b=null;if("undefined"==typeof this.renderer.image_cache[this.img]?(b=new Image,this.renderer.image_cache[this.img]=b,b.src=this.img):b=this.renderer.image_cache[this.img],b.width){this.node_image&&this.node_image.remove(),this.renderer.node_layer.activate();var c=b.width,d=b.height,e=this.model.get("clip_path"),f="undefined"!=typeof e&&e,g=null,h=null,i=null;if(f){g=new paper.Path;var j=e.match(/[a-z][^a-z]+/gi)||[],k=[0,0],l=1/0,m=1/0,n=-(1/0),o=-(1/0),p=function(a,b){var e=a.slice(1).map(function(a,e){var f=parseFloat(a),g=e%2;return f=g?(f-.5)*d:(f-.5)*c,b&&(f+=k[g]),g?(m=Math.min(m,f),o=Math.max(o,f)):(l=Math.min(l,f),n=Math.max(n,f)),f});return k=e.slice(-2),e};j.forEach(function(a){var b=a.match(/([a-z]|[0-9.-]+)/gi)||[""];switch(b[0]){case"M":g.moveTo(p(b));break;case"m":g.moveTo(p(b,!0));break;case"L":g.lineTo(p(b));break;case"l":g.lineTo(p(b,!0));break;case"C":g.cubicCurveTo(p(b));break;case"c":g.cubicCurveTo(p(b,!0));break;case"Q":g.quadraticCurveTo(p(b));break;case"q":g.quadraticCurveTo(p(b,!0))}}),h=Math[this.options.node_images_fill_mode?"min":"max"](n-l,o-m)/2,i=new paper.Point((n+l)/2,(o+m)/2),this.options.show_node_circles||(this.h_ratio=(o-m)/(2*h))}else h=Math[this.options.node_images_fill_mode?"min":"max"](c,d)/2,i=new paper.Point(0,0),this.options.show_node_circles||(this.h_ratio=d/(2*h));var q=new paper.Raster(b);if(q.locked=!0,f&&(q=new paper.Group(g,q),q.opacity=.99,q.clipped=!0,g.__representation=this),this.options.clip_node_images){var r=this.shapeBuilder.getImageShape(i,h);q=new paper.Group(r,q),q.opacity=.99,q.clipped=!0,r.__representation=this}this.image_delta=i.divide(h),this.node_image=q,this.node_image.__representation=s,this.node_image.scale(this.circle_radius/h),this.node_image.position=this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius)),this.node_image.insertAbove(this.circle)}else{var s=this;a(b).on("load",function(){s.showImage()})}},paperShift:function(a){this.options.editor_mode?this.renkan.read_only||(this.is_dragging=!0,this.paper_coords=this.paper_coords.add(a),this.redraw()):this.renderer.view.paperShift(a)},openEditor:function(){this.renderer.removeRepresentationsOfType("editor");var a=this.renderer.addRepresentation("NodeEditor",null);a.source_representation=this,a.draw()},select:function(){this.selected=!0,this.circle.strokeWidth=this._getSelectedStrokeWidth(),this.renderer.isEditable()&&!this.hidden&&this.active_buttons.forEach(function(a){a.show()});var b=this.model.get("uri");b&&a(".Rk-Bin-Item").each(function(){var c=a(this);c.attr("data-uri")===b&&c.addClass("selected")}),this.options.editor_mode||this.openEditor(),this.renderer.minimap&&(this.minimap_circle.strokeWidth=this.options.minimap_highlight_weight,this.minimap_circle.strokeColor=this.options.minimap_highlight_color),this.hidden?this.show(!0):this.showNeighbors(!0),this._super("select")},hideButtons:function(){this.all_buttons.forEach(function(a){a.hide()}),delete this.buttonTimeout},unselect:function(b){if(!b||b.source_representation!==this){this.selected=!1;var c=this;this.buttons_timeout=setTimeout(function(){c.hideButtons()},200),this.circle.strokeWidth=this._getStrokeWidth(),a(".Rk-Bin-Item").removeClass("selected"),this.renderer.minimap&&(this.minimap_circle.strokeColor=void 0),this.hidden?this.hide():this.hideNeighbors(),this._super("unselect")}},hide:function(){var a=this;this.ghost=!1,this.hidden=!0,"undefined"!=typeof this.node_image&&(this.node_image.opacity=0),this.hideButtons(),this.circle.opacity=0,this.title.css("opacity",0),this.minimap_circle.opacity=0,b.each(this.project.get("edges").filter(function(b){return b.get("to")===a.model||b.get("from")===a.model}),function(b,c,d){var e=a.renderer.getRepresentationByModel(b);e&&"undefined"!=typeof e.from_representation&&"undefined"!=typeof e.from_representation.paper_coords&&"undefined"!=typeof e.to_representation&&"undefined"!=typeof e.to_representation.paper_coords&&e.hide()}),this.hideNeighbors()},show:function(a){var c=this;this.ghost=a,this.ghost?("undefined"!=typeof this.node_image&&(this.node_image.opacity=this.options.ghost_opacity),this.circle.opacity=this.options.ghost_opacity,this.title.css("opacity",this.options.ghost_opacity),this.minimap_circle.opacity=this.options.ghost_opacity):(this.minimap_circle.opacity=1,this.hidden=!1,this.redraw()),b.each(this.project.get("edges").filter(function(a){return a.get("to")===c.model||a.get("from")===c.model}),function(a,b,d){var e=c.renderer.getRepresentationByModel(a);e&&"undefined"!=typeof e.from_representation&&"undefined"!=typeof e.from_representation.paper_coords&&"undefined"!=typeof e.to_representation&&"undefined"!=typeof e.to_representation.paper_coords&&e.show(c.ghost)})},hideNeighbors:function(){var a=this;b.each(this.project.get("edges").filter(function(b){return b.get("from")===a.model}),function(b,c,d){var e=a.renderer.getRepresentationByModel(b.get("to"));e&&e.ghost&&e.hide()})},showNeighbors:function(a){var c=this;b.each(this.project.get("edges").filter(function(a){return a.get("from")===c.model}),function(b,d,e){var f=c.renderer.getRepresentationByModel(b.get("to"));if(f&&f.hidden&&(f.show(a),!a)){var g=c.renderer.view.hiddenNodes.indexOf(f.model.id);-1!==g&&c.renderer.view.hiddenNodes.splice(g,1)}})},highlight:function(a){var b=a||!0;this.highlighted!==b&&(this.highlighted=b,this.redraw(),this.renderer.throttledPaperDraw())},unhighlight:function(){this.highlighted&&(this.highlighted=!1,this.redraw(),this.renderer.throttledPaperDraw())},saveCoords:function(){var a=this.renderer.toModelCoords(this.paper_coords),b={position:{x:a.x,y:a.y}};this.renderer.isEditable()&&this.model.set(b)},mousedown:function(a,b){b&&(this.renderer.unselectAll(),this.select())},mouseup:function(a,b){if(this.renderer.is_dragging&&this.renderer.isEditable())this.saveCoords();else if(this.hidden){var c=this.renderer.view.hiddenNodes.indexOf(this.model.id);-1!==c&&this.renderer.view.hiddenNodes.splice(c,1),this.show(!1),this.select()}else b||this.model.get("delete_scheduled")||this.openEditor(),this.model.trigger("clicked");this.renderer.click_target=null,this.renderer.is_dragging=!1,this.is_dragging=!1},destroy:function(a){this._super("destroy"),this.all_buttons.forEach(function(a){a.destroy()}),this.circle.remove(),this.title.remove(),this.renderer.minimap&&this.minimap_circle.remove(),this.node_image&&this.node_image.remove()}}).value(),g}),define("renderer/edge",["jquery","underscore","requtils","renderer/baserepresentation"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){if(this.renderer.edge_layer.activate(),this.type="Edge",this.hidden=!1,this.ghost=!1,this.from_representation=this.renderer.getRepresentationByModel(this.model.get("from")),this.to_representation=this.renderer.getRepresentationByModel(this.model.get("to")),this.bundle=this.renderer.addToBundles(this),this.line=new paper.Path,this.line.add([0,0],[0,0],[0,0]),this.line.__representation=this,this.line.strokeWidth=this.options.edge_stroke_width,this.arrow_scale=1,this.arrow=new paper.Path,this.arrow.add([0,0],[this.options.edge_arrow_length,this.options.edge_arrow_width/2],[0,this.options.edge_arrow_width]),this.arrow.pivot=new paper.Point([this.options.edge_arrow_length/2,this.options.edge_arrow_width/2]),this.arrow.__representation=this,this.text=a('
              ').appendTo(this.renderer.labels_$),this.arrow_angle=0,this.options.editor_mode){var b=c.getRenderer();this.normal_buttons=[new b.EdgeEditButton(this.renderer,null),new b.EdgeRemoveButton(this.renderer,null)],this.pending_delete_buttons=[new b.EdgeRevertButton(this.renderer,null)],this.all_buttons=this.normal_buttons.concat(this.pending_delete_buttons);for(var d=0;d90&&(q-=180,r=r.multiply(-1)),-90>q&&(q+=180,r=r.multiply(-1));var w=this.model.get("title")||this.renkan.translate(this.options.label_untitled_edges)||"";w=e.shortenText(w,this.options.node_label_max_length),this.text.text(w);var x=this.paper_coords.add(r);this.text.css({left:x.x,top:x.y,transform:"rotate("+q+"deg)","-moz-transform":"rotate("+q+"deg)","-webkit-transform":"rotate("+q+"deg)",opacity:c}),this.text_angle=q;var y=this.paper_coords;this.all_buttons.forEach(function(a){a.moveTo(y)}),this.renderer.minimap&&(this.minimap_line.strokeColor=t,this.minimap_line.segments[0].point=this.renderer.toMinimapCoords(new paper.Point(this.from_representation.model.get("position"))),this.minimap_line.segments[1].point=this.renderer.toMinimapCoords(new paper.Point(this.to_representation.model.get("position"))))}},hide:function(){this.hidden=!0,this.ghost=!1,this.text.hide(),this.line.visible=!1,this.arrow.visible=!1,this.minimap_line.visible=!1},show:function(a){this.ghost=a,this.ghost?(this.text.css("opacity",.3),this.line.opacity=.3,this.arrow.opacity=.3,this.minimap_line.opacity=.3):(this.hidden=!1,this.text.css("opacity",1),this.line.opacity=1,this.arrow.opacity=1,this.minimap_line.opacity=1),this.text.show(),this.line.visible=!0,this.arrow.visible=!0,this.minimap_line.visible=!0,this.redraw()},openEditor:function(){this.renderer.removeRepresentationsOfType("editor");var a=this.renderer.addRepresentation("EdgeEditor",null);a.source_representation=this,a.draw()},select:function(){this.selected=!0,this.line.strokeWidth=this._getSelectedStrokeWidth(),this.renderer.isEditable()&&this.active_buttons.forEach(function(a){a.show()}),this.options.editor_mode||this.openEditor(),this._super("select")},unselect:function(a){a&&a.source_representation===this||(this.selected=!1,this.options.editor_mode&&this.all_buttons.forEach(function(a){a.hide()}),this.line.strokeWidth=this._getStrokeWidth(),this._super("unselect"))},mousedown:function(a,b){b&&(this.renderer.unselectAll(),this.select())},mouseup:function(a,b){!this.renkan.read_only&&this.renderer.is_dragging?(this.from_representation.saveCoords(),this.to_representation.saveCoords(),this.from_representation.is_dragging=!1,this.to_representation.is_dragging=!1):(b||this.openEditor(),this.model.trigger("clicked")),this.renderer.click_target=null,this.renderer.is_dragging=!1},paperShift:function(a){this.options.editor_mode?this.options.read_only||(this.from_representation.paperShift(a),this.to_representation.paperShift(a)):this.renderer.paperShift(a)},destroy:function(){this._super("destroy"),this.line.remove(),this.arrow.remove(),this.text.remove(),this.renderer.minimap&&this.minimap_line.remove(),this.all_buttons.forEach(function(a){a.destroy()});var a=this;this.bundle.edges=b.reject(this.bundle.edges,function(b){return a===b})}}).value(),f}),define("renderer/tempedge",["jquery","underscore","requtils","renderer/baserepresentation"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.renderer.edge_layer.activate(),this.type="Temp-edge";var a=(this.project.get("users").get(this.renkan.current_user)||e._USER_PLACEHOLDER(this.renkan)).get("color");this.line=new paper.Path,this.line.strokeColor=a,this.line.dashArray=[4,2],this.line.strokeWidth=this.options.selected_edge_stroke_width,this.line.add([0,0],[0,0]),this.line.__representation=this,this.arrow=new paper.Path,this.arrow.fillColor=a,this.arrow.add([0,0],[this.options.edge_arrow_length,this.options.edge_arrow_width/2],[0,this.options.edge_arrow_width]),this.arrow.__representation=this,this.arrow_angle=0},redraw:function(){var a=this.from_representation.paper_coords,b=this.end_pos,c=b.subtract(a).angle,d=a.add(b).divide(2);this.line.segments[0].point=a,this.line.segments[1].point=b,this.arrow.rotate(c-this.arrow_angle),this.arrow.position=d,this.arrow_angle=c},paperShift:function(a){if(!this.renderer.isEditable())return this.renderer.removeRepresentation(_this),void paper.view.draw();this.end_pos=this.end_pos.add(a);var b=paper.project.hitTest(this.end_pos);this.renderer.findTarget(b),this.redraw()},mouseup:function(a,b){var c=paper.project.hitTest(a.point),d=this.from_representation.model,f=!0;if(c&&"undefined"!=typeof c.item.__representation){var g=c.item.__representation;if("Node"===g.type.substr(0,4)){var h=g.model||g.source_representation.model;if(d!==h){var i={id:e.getUID("edge"),created_by:this.renkan.current_user,from:d,to:h};this.renderer.isEditable()&&this.project.addEdge(i)}}(d===g.model||g.source_representation&&g.source_representation.model===d)&&(f=!1,this.renderer.is_dragging=!0)}f&&(this.renderer.click_target=null,this.renderer.is_dragging=!1,this.renderer.removeRepresentation(this),paper.view.draw())},destroy:function(){this.arrow.remove(),this.line.remove()}}).value(),f}),define("renderer/baseeditor",["jquery","underscore","requtils","renderer/baserepresentation"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.renderer.buttons_layer.activate(),this.type="editor",this.editor_block=new paper.Path;var c=b.map(b.range(8),function(){return[0,0]});this.editor_block.add.apply(this.editor_block,c),this.editor_block.strokeWidth=this.options.tooltip_border_width,this.editor_block.strokeColor=this.options.tooltip_border_color,this.editor_block.opacity=this.options.tooltip_opacity,this.editor_$=a("
              ").appendTo(this.renderer.editor_$).css({position:"absolute",opacity:this.options.tooltip_opacity}).hide()},destroy:function(){this.editor_block.remove(),this.editor_$.remove()}}).value(),f}),define("renderer/nodeeditor",["jquery","underscore","requtils","renderer/baseeditor","renderer/shapebuilder","ckeditor-jquery"],function(a,b,c,d,e){"use strict";var f=c.getUtils(),g=f.inherit(d);return b(g.prototype).extend({_init:function(){d.prototype._init.apply(this),this.template=this.options.templates["templates/nodeeditor.html"],this.readOnlyTemplate=this.options.node_editor_templates},draw:function(){var c=this.source_representation.model,d=c.get("created_by")||f._USER_PLACEHOLDER(this.renkan),g=this.renderer.isEditable()?this.template:this.readOnlyTemplate[c.get("type")]||this.readOnlyTemplate["default"],h=this.options.static_url+"img/image-placeholder.png",i=c.get("size")||0;this.editor_$.html(g({node:{_id:c.get("_id"),has_creator:!!c.get("created_by"),title:c.get("title"),uri:c.get("uri"),type:c.get("type")||"default",short_uri:f.shortenText((c.get("uri")||"").replace(/^(https?:\/\/)?(www\.)?/,"").replace(/\/$/,""),40),description:c.get("description"),image:c.get("image")||"",image_placeholder:h,color:c.has("style")&&c.get("style").color||d.get("color"),thickness:c.has("style")&&c.get("style").thickness||1,dash:c.has("style")&&c.get("style").dash?"checked":"",clip_path:c.get("clip_path")||!1,created_by_color:d.get("color"),created_by_title:d.get("title"),size:(i>0?"+":"")+i,shape:c.get("shape")||"circle"},renkan:this.renkan,options:this.options,shortenText:f.shortenText,shapes:b(e.builders).omit("svg").keys().value(),types:b(this.options.node_editor_templates).keys().value()})),this.redraw();var j=this,k=j.options.show_node_editor_description_richtext?a(".Rk-Edit-Description").ckeditor(j.options.richtext_editor_config):!1,l=function(){j.renderer.removeRepresentation(j),paper.view.draw()};if(j.cleanEditor=function(){if(j.editor_$.off("keyup"),j.editor_$.find("input, textarea, select").off("change keyup paste"),j.editor_$.find(".Rk-Edit-Image-File").off("change"),j.editor_$.find(".Rk-Edit-ColorPicker-Wrapper").off("hover"),j.editor_$.find(".Rk-Edit-Size-Btn").off("click"),j.editor_$.find(".Rk-Edit-Image-Del").off("click"),j.editor_$.find(".Rk-Edit-ColorPicker").find("li").off("hover click"),j.editor_$.find(".Rk-CloseX").off("click"),j.editor_$.find(".Rk-Edit-Goto").off("click"),j.options.show_node_editor_description_richtext&&"undefined"!=typeof k.editor){var a=k.editor;delete k.editor,a.focusManager.blur(!0),a.destroy()}},this.editor_$.find(".Rk-CloseX").click(function(a){a.preventDefault(),l()}),this.editor_$.find(".Rk-Edit-Goto").click(function(){return c.get("uri")?void 0:!1}),this.renderer.isEditable()){var m=b.throttle(function(){b.defer(function(){if(j.renderer.isEditable()){var a={title:j.editor_$.find(".Rk-Edit-Title").val()};if(j.options.show_node_editor_uri&&(a.uri=j.editor_$.find(".Rk-Edit-URI").val(),j.editor_$.find(".Rk-Edit-Goto").attr("href",a.uri||"#")),j.options.show_node_editor_image&&(a.image=j.editor_$.find(".Rk-Edit-Image").val(),j.editor_$.find(".Rk-Edit-ImgPreview").attr("src",a.image||h)),j.options.show_node_editor_description&&(j.options.show_node_editor_description_richtext?"undefined"!=typeof k.editor&&k.editor.checkDirty()&&(a.description=k.editor.getData(),k.editor.resetDirty()):a.description=j.editor_$.find(".Rk-Edit-Description").val()),j.options.show_node_editor_style){var d=j.editor_$.find(".Rk-Edit-Dash").is(":checked");a.style=b.assign(c.has("style")&&b.clone(c.get("style"))||{},{dash:d})}j.options.change_shapes&&c.get("shape")!==j.editor_$.find(".Rk-Edit-Shape").val()&&(a.shape=j.editor_$.find(".Rk-Edit-Shape").val()),j.options.change_types&&c.get("type")!==j.editor_$.find(".Rk-Edit-Type").val()&&(a.type=j.editor_$.find(".Rk-Edit-Type").val()),c.set(a),j.redraw()}else l()})},1e3);this.editor_$.on("keyup",function(a){27===a.keyCode&&l()}),this.editor_$.find("input, textarea, select").on("change keyup paste",m),j.options.show_node_editor_description&&j.options.show_node_editor_description_richtext&&"undefined"!=typeof k.editor&&(k.editor.on("change",m),k.editor.on("blur",m)),j.options.allow_image_upload&&this.editor_$.find(".Rk-Edit-Image-File").change(function(){if(this.files.length){var a=this.files[0],b=new FileReader;if("image"!==a.type.substr(0,5))return void alert(j.renkan.translate("This file is not an image"));if(a.size>1024*j.options.uploaded_image_max_kb)return void alert(j.renkan.translate("Image size must be under ")+j.options.uploaded_image_max_kb+j.renkan.translate("KB"));b.onload=function(a){j.editor_$.find(".Rk-Edit-Image").val(a.target.result),m()},b.readAsDataURL(a)}}),this.editor_$.find(".Rk-Edit-Title")[0].focus();var n=j.editor_$.find(".Rk-Edit-ColorPicker");this.editor_$.find(".Rk-Edit-ColorPicker-Wrapper").hover(function(a){a.preventDefault(),n.show()},function(a){a.preventDefault(),n.hide()}),n.find("li").hover(function(b){b.preventDefault(),j.editor_$.find(".Rk-Edit-Color").css("background",a(this).attr("data-color"))},function(a){a.preventDefault(),j.editor_$.find(".Rk-Edit-Color").css("background",c.has("style")&&c.get("style").color||(c.get("created_by")||f._USER_PLACEHOLDER(j.renkan)).get("color")); +}).click(function(d){d.preventDefault(),j.renderer.isEditable()?(c.set("style",b.assign(c.has("style")&&b.clone(c.get("style"))||{},{color:a(this).attr("data-color")})),n.hide(),paper.view.draw()):l()});var o=function(a){if(j.renderer.isEditable()){var b=a+(c.get("size")||0);j.editor_$.find("#Rk-Edit-Size-Value").text((b>0?"+":"")+b),c.set("size",b),paper.view.draw()}else l()};this.editor_$.find("#Rk-Edit-Size-Down").click(function(){return o(-1),!1}),this.editor_$.find("#Rk-Edit-Size-Up").click(function(){return o(1),!1});var p=function(a){if(j.renderer.isEditable()){var d=c.has("style")&&c.get("style").thickness||1,e=a+d;1>e?e=1:e>j.options.node_stroke_witdh_scale&&(e=j.options.node_stroke_witdh_scale),e!==d&&(j.editor_$.find("#Rk-Edit-Thickness-Value").text(e),c.set("style",b.assign(c.has("style")&&b.clone(c.get("style"))||{},{thickness:e})),paper.view.draw())}else l()};this.editor_$.find("#Rk-Edit-Thickness-Down").click(function(){return p(-1),!1}),this.editor_$.find("#Rk-Edit-Thickness-Up").click(function(){return p(1),!1}),this.editor_$.find(".Rk-Edit-Image-Del").click(function(){return j.editor_$.find(".Rk-Edit-Image").val(""),m(),!1})}else if("object"==typeof this.source_representation.highlighted){var q=this.source_representation.highlighted.replace(b(c.get("title")).escape(),'$1');this.editor_$.find(".Rk-Display-Title"+(c.get("uri")?" a":"")).html(q),this.options.show_node_tooltip_description&&this.editor_$.find(".Rk-Display-Description").html(this.source_representation.highlighted.replace(b(c.get("description")).escape(),'$1'))}this.editor_$.find("img").load(function(){j.redraw()})},redraw:function(){if(this.options.popup_editor){var a=this.source_representation.paper_coords;f.drawEditBox(this.options,a,this.editor_block,.75*this.source_representation.circle_radius,this.editor_$)}this.editor_$.show(),paper.view.draw()},destroy:function(){"undefined"!=typeof this.cleanEditor&&this.cleanEditor(),this.editor_block.remove(),this.editor_$.remove()}}).value(),g}),define("renderer/edgeeditor",["jquery","underscore","requtils","renderer/baseeditor"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){d.prototype._init.apply(this),this.template=this.options.templates["templates/edgeeditor.html"],this.readOnlyTemplate=this.options.templates["templates/edgeeditor_readonly.html"]},draw:function(){var c=this.source_representation.model,d=c.get("from"),f=c.get("to"),g=c.get("created_by")||e._USER_PLACEHOLDER(this.renkan),h=this.renderer.isEditable()?this.template:this.readOnlyTemplate;this.editor_$.html(h({edge:{has_creator:!!c.get("created_by"),title:c.get("title"),uri:c.get("uri"),short_uri:e.shortenText((c.get("uri")||"").replace(/^(https?:\/\/)?(www\.)?/,"").replace(/\/$/,""),40),description:c.get("description"),color:c.has("style")&&c.get("style").color||g.get("color"),dash:c.has("style")&&c.get("style").dash?"checked":"",arrow:c.has("style")&&c.get("style").arrow||!c.has("style")||"undefined"==typeof c.get("style").arrow?"checked":"",thickness:c.has("style")&&c.get("style").thickness||1,from_title:d.get("title"),to_title:f.get("title"),from_color:d.has("style")&&d.get("style").color||(d.get("created_by")||e._USER_PLACEHOLDER(this.renkan)).get("color"),to_color:f.has("style")&&f.get("style").color||(f.get("created_by")||e._USER_PLACEHOLDER(this.renkan)).get("color"),created_by_color:g.get("color"),created_by_title:g.get("title")},renkan:this.renkan,shortenText:e.shortenText,options:this.options})),this.redraw();var i=this,j=function(){i.renderer.removeRepresentation(i),i.editor_$.find(".Rk-Edit-Size-Btn").off("click"),paper.view.draw()};if(this.editor_$.find(".Rk-CloseX").click(j),this.editor_$.find(".Rk-Edit-Goto").click(function(){return c.get("uri")?void 0:!1}),this.renderer.isEditable()){var k=b.throttle(function(){b.defer(function(){if(i.renderer.isEditable()){var a={title:i.editor_$.find(".Rk-Edit-Title").val()};if(i.options.show_edge_editor_uri&&(a.uri=i.editor_$.find(".Rk-Edit-URI").val()),i.options.show_node_editor_style){var d=i.editor_$.find(".Rk-Edit-Dash").is(":checked"),e=i.editor_$.find(".Rk-Edit-Arrow").is(":checked");a.style=b.assign(c.has("style")&&b.clone(c.get("style"))||{},{dash:d,arrow:e})}i.editor_$.find(".Rk-Edit-Goto").attr("href",a.uri||"#"),c.set(a),paper.view.draw()}else j()})},500);this.editor_$.on("keyup",function(a){27===a.keyCode&&j()}),this.editor_$.find("input").on("keyup change paste",k),this.editor_$.find(".Rk-Edit-Vocabulary").change(function(){var b=a(this),c=b.val();c&&(i.editor_$.find(".Rk-Edit-Title").val(b.find(":selected").text()),i.editor_$.find(".Rk-Edit-URI").val(c),k())}),this.editor_$.find(".Rk-Edit-Direction").click(function(){i.renderer.isEditable()?(c.set({from:c.get("to"),to:c.get("from")}),i.draw()):j()});var l=i.editor_$.find(".Rk-Edit-ColorPicker");this.editor_$.find(".Rk-Edit-ColorPicker-Wrapper").hover(function(a){a.preventDefault(),l.show()},function(a){a.preventDefault(),l.hide()}),l.find("li").hover(function(b){b.preventDefault(),i.editor_$.find(".Rk-Edit-Color").css("background",a(this).attr("data-color"))},function(a){a.preventDefault(),i.editor_$.find(".Rk-Edit-Color").css("background",c.has("style")&&c.get("style").color||(c.get("created_by")||e._USER_PLACEHOLDER(i.renkan)).get("color"))}).click(function(d){d.preventDefault(),i.renderer.isEditable()?(c.set("style",b.assign(c.has("style")&&b.clone(c.get("style"))||{},{color:a(this).attr("data-color")})),l.hide(),paper.view.draw()):j()});var m=function(a){if(i.renderer.isEditable()){var d=c.has("style")&&c.get("style").thickness||1,e=a+d;1>e?e=1:e>i.options.node_stroke_witdh_scale&&(e=i.options.node_stroke_witdh_scale),e!==d&&(i.editor_$.find("#Rk-Edit-Thickness-Value").text(e),c.set("style",b.assign(c.has("style")&&b.clone(c.get("style"))||{},{thickness:e})),paper.view.draw())}else j()};this.editor_$.find("#Rk-Edit-Thickness-Down").click(function(){return m(-1),!1}),this.editor_$.find("#Rk-Edit-Thickness-Up").click(function(){return m(1),!1})}},redraw:function(){if(this.options.popup_editor){var a=this.source_representation.paper_coords;e.drawEditBox(this.options,a,this.editor_block,5,this.editor_$)}this.editor_$.show(),paper.view.draw()}}).value(),f}),define("renderer/nodebutton",["jquery","underscore","requtils","renderer/basebutton"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({setSectorSize:function(){var a=this.source_representation.circle_radius;a!==this.lastSectorInner&&(this.sector&&this.sector.destroy(),this.sector=this.renderer.drawSector(this,1+a,e._NODE_BUTTON_WIDTH+a,this.startAngle,this.endAngle,1,this.imageName,this.renkan.translate(this.text)),this.lastSectorInner=a)},unselect:function(){d.prototype.unselect.apply(this,Array.prototype.slice.call(arguments,1)),this.source_representation&&this.source_representation.buttons_timeout&&(clearTimeout(this.source_representation.buttons_timeout),this.source_representation.hideButtons())},select:function(){this.source_representation&&this.source_representation.buttons_timeout&&clearTimeout(this.source_representation.buttons_timeout),this.sector.select()}}).value(),f}),define("renderer/nodeeditbutton",["jquery","underscore","requtils","renderer/nodebutton"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.type="Node-edit-button",this.lastSectorInner=0,this.startAngle=this.options.hide_nodes?-125:-135,this.endAngle=this.options.hide_nodes?-55:-45,this.imageName="edit",this.text="Edit"},mouseup:function(){this.renderer.is_dragging||this.source_representation.openEditor()}}).value(),f}),define("renderer/noderemovebutton",["jquery","underscore","requtils","renderer/nodebutton"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.type="Node-remove-button",this.lastSectorInner=0,this.startAngle=this.options.hide_nodes?-10:0,this.endAngle=this.options.hide_nodes?45:90,this.imageName="remove",this.text="Remove"},mouseup:function(){if(this.renderer.click_target=null,this.renderer.is_dragging=!1,this.renderer.removeRepresentationsOfType("editor"),this.renderer.isEditable())if(this.options.element_delete_delay){var a=e.getUID("delete");this.renderer.delete_list.push({id:a,time:(new Date).valueOf()+this.options.element_delete_delay}),this.source_representation.model.set("delete_scheduled",a)}else confirm(this.renkan.translate("Do you really wish to remove node ")+'"'+this.source_representation.model.get("title")+'"?')&&this.project.removeNode(this.source_representation.model)}}).value(),f}),define("renderer/nodehidebutton",["jquery","underscore","requtils","renderer/nodebutton"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.type="Node-hide-button",this.lastSectorInner=0,this.startAngle=45,this.endAngle=90,this.imageName="hide",this.text="Hide"},mouseup:function(){this.renderer.click_target=null,this.renderer.is_dragging=!1,this.renderer.removeRepresentationsOfType("editor"),this.renderer.isEditable()&&this.renderer.view.addHiddenNode(this.source_representation.model)}}).value(),f}),define("renderer/nodeshowbutton",["jquery","underscore","requtils","renderer/nodebutton"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.type="Node-show-button",this.lastSectorInner=0,this.startAngle=90,this.endAngle=135,this.imageName="show",this.text="Show"},mouseup:function(){this.renderer.click_target=null,this.renderer.is_dragging=!1,this.renderer.removeRepresentationsOfType("editor"),this.renderer.isEditable()&&this.source_representation.showNeighbors(!1)}}).value(),f}),define("renderer/noderevertbutton",["jquery","underscore","requtils","renderer/nodebutton"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.type="Node-revert-button",this.lastSectorInner=0,this.startAngle=-135,this.endAngle=135,this.imageName="revert",this.text="Cancel deletion"},mouseup:function(){this.renderer.click_target=null,this.renderer.is_dragging=!1,this.renderer.isEditable()&&this.source_representation.model.unset("delete_scheduled")}}).value(),f}),define("renderer/nodelinkbutton",["jquery","underscore","requtils","renderer/nodebutton"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.type="Node-link-button",this.lastSectorInner=0,this.startAngle=this.options.hide_nodes?135:90,this.endAngle=this.options.hide_nodes?190:180,this.imageName="link",this.text="Link to another node"},mousedown:function(a,b){if(this.renderer.isEditable()){var c=this.renderer.canvas_$.offset(),d=new paper.Point([a.pageX-c.left,a.pageY-c.top]);this.renderer.click_target=null,this.renderer.removeRepresentationsOfType("editor"),this.renderer.addTempEdge(this.source_representation,d)}}}).value(),f}),define("renderer/nodeenlargebutton",["jquery","underscore","requtils","renderer/nodebutton"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.type="Node-enlarge-button",this.lastSectorInner=0,this.startAngle=this.options.hide_nodes?-55:-45,this.endAngle=this.options.hide_nodes?-10:0,this.imageName="enlarge",this.text="Enlarge"},mouseup:function(){var a=1+(this.source_representation.model.get("size")||0);this.source_representation.model.set("size",a),this.source_representation.select(),this.select(),paper.view.draw()}}).value(),f}),define("renderer/nodeshrinkbutton",["jquery","underscore","requtils","renderer/nodebutton"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.type="Node-shrink-button",this.lastSectorInner=0,this.startAngle=this.options.hide_nodes?-170:-180,this.endAngle=this.options.hide_nodes?-125:-135,this.imageName="shrink",this.text="Shrink"},mouseup:function(){var a=-1+(this.source_representation.model.get("size")||0);this.source_representation.model.set("size",a),this.source_representation.select(),this.select(),paper.view.draw()}}).value(),f}),define("renderer/edgeeditbutton",["jquery","underscore","requtils","renderer/basebutton"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.type="Edge-edit-button",this.sector=this.renderer.drawSector(this,e._EDGE_BUTTON_INNER,e._EDGE_BUTTON_OUTER,-270,-90,1,"edit",this.renkan.translate("Edit"))},mouseup:function(){this.renderer.is_dragging||this.source_representation.openEditor()}}).value(),f}),define("renderer/edgeremovebutton",["jquery","underscore","requtils","renderer/basebutton"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.type="Edge-remove-button",this.sector=this.renderer.drawSector(this,e._EDGE_BUTTON_INNER,e._EDGE_BUTTON_OUTER,-90,90,1,"remove",this.renkan.translate("Remove"))},mouseup:function(){if(this.renderer.click_target=null,this.renderer.is_dragging=!1,this.renderer.removeRepresentationsOfType("editor"),this.renderer.isEditable())if(this.options.element_delete_delay){var a=e.getUID("delete");this.renderer.delete_list.push({id:a,time:(new Date).valueOf()+this.options.element_delete_delay}),this.source_representation.model.set("delete_scheduled",a)}else confirm(this.renkan.translate("Do you really wish to remove edge ")+'"'+this.source_representation.model.get("title")+'"?')&&this.project.removeEdge(this.source_representation.model)}}).value(),f}),define("renderer/edgerevertbutton",["jquery","underscore","requtils","renderer/basebutton"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){this.type="Edge-revert-button",this.sector=this.renderer.drawSector(this,e._EDGE_BUTTON_INNER,e._EDGE_BUTTON_OUTER,-135,135,1,"revert",this.renkan.translate("Cancel deletion"))},mouseup:function(){this.renderer.click_target=null,this.renderer.is_dragging=!1,this.renderer.isEditable()&&this.source_representation.model.unset("delete_scheduled")}}).value(),f}),define("renderer/miniframe",["jquery","underscore","requtils","renderer/baserepresentation"],function(a,b,c,d){"use strict";var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({paperShift:function(a){this.renderer.offset=this.renderer.offset.subtract(a.divide(this.renderer.minimap.scale).multiply(this.renderer.scale)),this.renderer.redraw()},mouseup:function(a){this.renderer.click_target=null,this.renderer.is_dragging=!1}}).value(),f}),define("renderer/scene",["jquery","underscore","filesaver","requtils","renderer/miniframe"],function(a,b,c,d,e){"use strict";var f=d.getUtils(),g=function(c){this.renkan=c,this.$=a(".Rk-Render"),this.representations=[],this.$.html(c.options.templates["templates/scene.html"](c)),this.onStatusChange(),this.canvas_$=this.$.find(".Rk-Canvas"),this.labels_$=this.$.find(".Rk-Labels"),c.options.popup_editor?this.editor_$=this.$.find(".Rk-Editor"):this.editor_$=a("#"+c.options.editor_panel),this.notif_$=this.$.find(".Rk-Notifications"),paper.setup(this.canvas_$[0]),this.totalScroll=0,this.mouse_down=!1,this.click_target=null,this.selected_target=null,this.edge_layer=new paper.Layer,this.node_layer=new paper.Layer,this.buttons_layer=new paper.Layer,this.delete_list=[],this.redrawActive=!0,c.options.show_minimap&&(this.minimap={background_layer:new paper.Layer,edge_layer:new paper.Layer,node_layer:new paper.Layer,node_group:new paper.Group,size:new paper.Size(c.options.minimap_width,c.options.minimap_height)},this.minimap.background_layer.activate(),this.minimap.topleft=paper.view.bounds.bottomRight.subtract(this.minimap.size),this.minimap.rectangle=new paper.Path.Rectangle(this.minimap.topleft.subtract([2,2]),this.minimap.size.add([4,4])),this.minimap.rectangle.fillColor=c.options.minimap_background_color,this.minimap.rectangle.strokeColor=c.options.minimap_border_color,this.minimap.rectangle.strokeWidth=4,this.minimap.offset=new paper.Point(this.minimap.size.divide(2)),this.minimap.scale=.1,this.minimap.node_layer.activate(),this.minimap.cliprectangle=new paper.Path.Rectangle(this.minimap.topleft,this.minimap.size),this.minimap.node_group.addChild(this.minimap.cliprectangle),this.minimap.node_group.clipped=!0,this.minimap.miniframe=new paper.Path.Rectangle(this.minimap.topleft,this.minimap.size),this.minimap.node_group.addChild(this.minimap.miniframe),this.minimap.miniframe.fillColor="#c0c0ff",this.minimap.miniframe.opacity=.3,this.minimap.miniframe.strokeColor="#000080",this.minimap.miniframe.strokeWidth=2,this.minimap.miniframe.__representation=new e(this,null)),this.throttledPaperDraw=b(function(){paper.view.draw()}).throttle(100).value(),this.bundles=[],this.click_mode=!1;var d=this,g=!0,h=1,i=!1,j=0,k=0;this.image_cache={},this.icon_cache={},["edit","remove","hide","show","link","enlarge","shrink","revert"].forEach(function(a){var b=new Image;b.src=c.options.static_url+"img/"+a+".png",d.icon_cache[a]=b});var l=b.throttle(function(a,b){d.onMouseMove(a,b)},f._MOUSEMOVE_RATE);this.canvas_$.on({mousedown:function(a){a.preventDefault(),d.onMouseDown(a,!1)},mousemove:function(a){a.preventDefault(),l(a,!1)},mouseup:function(a){a.preventDefault(),d.onMouseUp(a,!1)},mousewheel:function(a,b){c.options.zoom_on_scroll&&(a.preventDefault(),g&&d.onScroll(a,b))},touchstart:function(a){a.preventDefault();var b=a.originalEvent.touches[0];c.options.allow_double_click&&new Date-_lastTap0&&this.renkan.options.save_view&&this.$.find(".Rk-ZoomSetSaved").show(),this.$.find(".Rk-CurrentUser").mouseenter(function(){d.$.find(".Rk-UserList").slideDown()}),this.$.find(".Rk-Users").mouseleave(function(){d.$.find(".Rk-UserList").slideUp()}),m(".Rk-FullScreen-Button","fullScreen"),m(".Rk-AddNode-Button","addNodeBtn"),m(".Rk-AddEdge-Button","addEdgeBtn"),m(".Rk-Save-Button","save"),m(".Rk-Open-Button","open"),m(".Rk-Export-Button","exportProject"),this.$.find(".Rk-Bookmarklet-Button").attr("href","javascript:"+f._BOOKMARKLET_CODE(c)).click(function(){return d.notif_$.text(c.translate("Drag this button to your bookmark bar. When on a third-party website, click it to enable drag-and-drop from the website to Renkan.")).fadeIn().delay(5e3).fadeOut(),!1}),this.$.find(".Rk-TopBar-Button").mouseover(function(){a(this).find(".Rk-TopBar-Tooltip").show()}).mouseout(function(){a(this).find(".Rk-TopBar-Tooltip").hide()}),m(".Rk-Fold-Bins","foldBins"),paper.view.onResize=function(a){var b,c=a.width,e=a.height;d.minimap&&(d.minimap.topleft=paper.view.bounds.bottomRight.subtract(d.minimap.size),d.minimap.rectangle.fitBounds(d.minimap.topleft.subtract([2,2]),d.minimap.size.add([4,4])),d.minimap.cliprectangle.fitBounds(d.minimap.topleft,d.minimap.size));var f=e/(e-a.delta.height),g=c/(c-a.delta.width);b=c>e?f:g,d.view.resizeZoom(g,f,b),d.redraw()};var n=b.throttle(function(){d.redraw()},50);this.addRepresentations("Node",this.renkan.project.get("nodes")),this.addRepresentations("Edge",this.renkan.project.get("edges")),this.renkan.project.on("change:title",function(){d.$.find(".Rk-PadTitle").val(c.project.get("title"))}),this.$.find(".Rk-PadTitle").on("keyup input paste",function(){c.project.set({title:a(this).val()})});var o=b.throttle(function(){d.redrawUsers()},100);if(o(),this.renkan.project.on("change:saveStatus",function(){switch(d.renkan.project.get("saveStatus")){case 0:d.$.find(".Rk-Save-Button").removeClass("to-save"),d.$.find(".Rk-Save-Button").removeClass("saving"),d.$.find(".Rk-Save-Button").addClass("saved");break;case 1:d.$.find(".Rk-Save-Button").removeClass("saved"),d.$.find(".Rk-Save-Button").removeClass("saving"),d.$.find(".Rk-Save-Button").addClass("to-save");break;case 2:d.$.find(".Rk-Save-Button").removeClass("saved"),d.$.find(".Rk-Save-Button").removeClass("to-save"),d.$.find(".Rk-Save-Button").addClass("saving")}}),this.renkan.project.on("change:loadingStatus",function(){if(d.renkan.project.get("loadingStatus")){d.$.find(".loader").addClass("run"),setTimeout(function(){d.$.find(".loader").hide(250)},3e3)}else Backbone.history.start(),n()}),this.renkan.project.on("add:users remove:users",o),this.renkan.project.on("add:views remove:views",function(a){d.renkan.project.get("views").length>0?d.$.find(".Rk-ZoomSetSaved").show():d.$.find(".Rk-ZoomSetSaved").hide()}),this.renkan.project.on("add:nodes",function(a){d.addRepresentation("Node",a),d.renkan.project.get("loadingStatus")||n()}),this.renkan.project.on("add:edges",function(a){d.addRepresentation("Edge",a),d.renkan.project.get("loadingStatus")||n()}),this.renkan.project.on("change:title",function(a,b){var c=d.$.find(".Rk-PadTitle");c.is("input")?c.val()!==b&&c.val(b):c.text(b)}),this.renkan.router.on("router",function(a){d.parameters(a)}),c.options.size_bug_fix){var p="number"==typeof c.options.size_bug_fix?c.options.size_bug_fix:500;window.setTimeout(function(){d.fixSize()},p)}if(c.options.force_resize&&a(window).resize(function(){d.autoScale()}),c.options.show_user_list&&c.options.user_color_editable){var q=this.$.find(".Rk-Users .Rk-Edit-ColorPicker-Wrapper"),r=this.$.find(".Rk-Users .Rk-Edit-ColorPicker");q.hover(function(a){d.isEditable()&&(a.preventDefault(),r.show())},function(a){a.preventDefault(),r.hide()}),r.find("li").mouseenter(function(b){d.isEditable()&&(b.preventDefault(),d.$.find(".Rk-CurrentUser-Color").css("background",a(this).attr("data-color")))})}if(c.options.show_search_field){var s="";this.$.find(".Rk-GraphSearch-Field").on("keyup change paste input",function(){var b=a(this),e=b.val();if(e!==s)if(s=e,e.length<2)c.project.get("nodes").each(function(a){d.getRepresentationByModel(a).unhighlight()});else{var g=f.regexpFromTextOrArray(e);c.project.get("nodes").each(function(a){g.test(a.get("title"))||g.test(a.get("description"))?d.getRepresentationByModel(a).highlight(g):d.getRepresentationByModel(a).unhighlight()})}})}this.redraw(),window.setInterval(function(){var a=(new Date).valueOf();d.delete_list.forEach(function(b){if(a>=b.time){var d=c.project.get("nodes").findWhere({delete_scheduled:b.id});d&&project.removeNode(d),d=c.project.get("edges").findWhere({delete_scheduled:b.id}),d&&project.removeEdge(d)}}),d.delete_list=d.delete_list.filter(function(a){return c.project.get("nodes").findWhere({delete_scheduled:a.id})||c.project.get("edges").findWhere({delete_scheduled:a.id})})},500),this.minimap&&window.setInterval(function(){d.rescaleMinimap()},2e3)};return b(g.prototype).extend({fixSize:function(){"undefined"==typeof this.view?(this.view=this.addRepresentation("View",this.renkan.project.get("views").last()),this.view.setScale(view.get("zoom_level"),new paper.Point(view.get("offset")))):this.view.autoScale()},drawSector:function(b,c,d,e,f,g,h,i){var j=this.renkan.options,k=e*Math.PI/180,l=f*Math.PI/180,m=this.icon_cache[h],n=-Math.sin(k),o=Math.cos(k),p=Math.cos(k)*c+g*n,q=Math.sin(k)*c+g*o,r=Math.cos(k)*d+g*n,s=Math.sin(k)*d+g*o,t=-Math.sin(l),u=Math.cos(l),v=Math.cos(l)*c-g*t,w=Math.sin(l)*c-g*u,x=Math.cos(l)*d-g*t,y=Math.sin(l)*d-g*u,z=(c+d)/2,A=(k+l)/2,B=Math.cos(A)*z,C=Math.sin(A)*z,D=Math.cos(A)*c,E=Math.cos(A)*d,F=Math.sin(A)*c,G=Math.sin(A)*d,H=Math.cos(A)*(d+3),I=Math.sin(A)*(d+j.buttons_label_font_size)+j.buttons_label_font_size/2;this.buttons_layer.activate();var J=new paper.Path;J.add([p,q]),J.arcTo([D,F],[v,w]),J.lineTo([x,y]),J.arcTo([E,G],[r,s]),J.fillColor=j.buttons_background,J.opacity=.5,J.closed=!0,J.__representation=b;var K=new paper.PointText(H,I);K.characterStyle={fontSize:j.buttons_label_font_size,fillColor:j.buttons_label_color},H>2?K.paragraphStyle.justification="left":-2>H?K.paragraphStyle.justification="right":K.paragraphStyle.justification="center",K.visible=!1;var L=!1,M=new paper.Point(-200,-200),N=new paper.Group([J,K]),O=N.position,P=new paper.Point([B,C]),Q=new paper.Point(0,0);K.content=i,N.pivot=N.bounds.center,N.visible=!1,N.position=M;var R={show:function(){L=!0,N.position=Q.add(O),N.visible=!0},moveTo:function(a){Q=a,L&&(N.position=a.add(O))},hide:function(){L=!1,N.visible=!1,N.position=M},select:function(){J.opacity=.8,K.visible=!0},unselect:function(){J.opacity=.5,K.visible=!1},destroy:function(){N.remove()}},S=function(){var a=new paper.Raster(m);a.position=P.add(N.position).subtract(O),a.locked=!0,N.addChild(a)};return m.width?S():a(m).on("load",S),R},addToBundles:function(a){var c=b(this.bundles).find(function(b){return b.from===a.from_representation&&b.to===a.to_representation||b.from===a.to_representation&&b.to===a.from_representation});return"undefined"!=typeof c?c.edges.push(a):(c={from:a.from_representation,to:a.to_representation,edges:[a],getPosition:function(a){var c=a.from_representation===this.from?1:-1;return c*(b(this.edges).indexOf(a)-(this.edges.length-1)/2)}},this.bundles.push(c)),c},isEditable:function(){return this.renkan.options.editor_mode&&!this.renkan.read_only},onStatusChange:function(){var a=this.$.find(".Rk-Save-Button"),b=a.find(".Rk-TopBar-Tooltip-Contents");this.renkan.read_only?(a.removeClass("disabled Rk-Save-Online").addClass("Rk-Save-ReadOnly"),b.text(this.renkan.translate("Connection lost"))):this.renkan.options.manual_save?(a.removeClass("Rk-Save-ReadOnly Rk-Save-Online"),b.text(this.renkan.translate("Save Project"))):(a.removeClass("disabled Rk-Save-ReadOnly").addClass("Rk-Save-Online"),b.text(this.renkan.translate("Auto-save enabled"))),this.redrawUsers()},redrawMiniframe:function(){var a=this.toMinimapCoords(this.toModelCoords(new paper.Point([0,0]))),b=this.toMinimapCoords(this.toModelCoords(paper.view.bounds.bottomRight));this.minimap.miniframe.fitBounds(a,b)},rescaleMinimap:function(){var a=this.renkan.project.get("nodes");if(a.length>1){var b=a.map(function(a){return a.get("position").x}),c=a.map(function(a){return a.get("position").y}),d=Math.min.apply(Math,b),e=Math.min.apply(Math,c),f=Math.max.apply(Math,b),g=Math.max.apply(Math,c),h=Math.min(.8*this.view.scale*this.renkan.options.minimap_width/paper.view.bounds.width,.8*this.view.scale*this.renkan.options.minimap_height/paper.view.bounds.height,(this.renkan.options.minimap_width-2*this.renkan.options.minimap_padding)/(f-d),(this.renkan.options.minimap_height-2*this.renkan.options.minimap_padding)/(g-e));this.minimap.offset=this.minimap.size.divide(2).subtract(new paper.Point([(f+d)/2,(g+e)/2]).multiply(h)),this.minimap.scale=h}1===a.length&&(this.minimap.scale=.1,this.minimap.offset=this.minimap.size.divide(2).subtract(new paper.Point([a.at(0).get("position").x,a.at(0).get("position").y]).multiply(this.minimap.scale))),this.redraw()},toPaperCoords:function(a){return a.multiply(this.view.scale).add(this.view.offset)},toMinimapCoords:function(a){return a.multiply(this.minimap.scale).add(this.minimap.offset).add(this.minimap.topleft)},toModelCoords:function(a){return a.subtract(this.view.offset).divide(this.view.scale)},addRepresentation:function(a,b){var c=d.getRenderer()[a],e=new c(this,b);return this.representations.push(e),e},addRepresentations:function(a,b){var c=this;b.forEach(function(b){c.addRepresentation(a,b)})},userTemplate:b.template('
            • <%=name%>
            • '),redrawUsers:function(){if(this.renkan.options.show_user_list){var b=[].concat((this.renkan.project.current_user_list||{}).models||[],(this.renkan.project.get("users")||{}).models||[]),c="",d=this.$.find(".Rk-Users"),e=d.find(".Rk-CurrentUser-Name"),f=d.find(".Rk-Edit-ColorPicker li"),g=d.find(".Rk-CurrentUser-Color"),h=this;e.off("click").text(this.renkan.translate("")),f.off("mouseleave click"),b.forEach(function(b){b.get("_id")===h.renkan.current_user?(e.text(b.get("title")),g.css("background",b.get("color")),h.isEditable()&&(h.renkan.options.user_name_editable&&e.click(function(){var c=a(this),d=a("").val(b.get("title")).blur(function(){b.set("title",a(this).val()),h.redrawUsers(),h.redraw()});c.empty().html(d),d.select()}),h.renkan.options.user_color_editable&&f.click(function(c){c.preventDefault(),h.isEditable()&&b.set("color",a(this).attr("data-color")),a(this).parent().hide()}).mouseleave(function(){g.css("background",b.get("color"))}))):c+=h.userTemplate({name:b.get("title"),background:b.get("color")})}),d.find(".Rk-UserList").html(c)}},removeRepresentation:function(a){a.destroy(),this.representations=b.reject(this.representations,function(b){return b===a})},getRepresentationByModel:function(a){return a?b.find(this.representations,function(b){return b.model===a}):void 0},removeRepresentationsOfType:function(a){var c=b.filter(this.representations,function(b){return b.type===a}),d=this;b.each(c,function(a){d.removeRepresentation(a)})},highlightModel:function(a){var b=this.getRepresentationByModel(a);b&&b.highlight()},unhighlightAll:function(a){b.each(this.representations,function(a){a.unhighlight()})},unselectAll:function(a){b.each(this.representations,function(a){a.unselect()})},redraw:function(){this.redrawActive&&(b.each(this.representations,function(a){a.redraw({dontRedrawEdges:!0})}),this.minimap&&"undefined"!=typeof this.view&&this.redrawMiniframe(),paper.view.draw())},addTempEdge:function(a,b){var c=this.addRepresentation("TempEdge",null);c.end_pos=b,c.from_representation=a,c.redraw(),this.click_target=c},findTarget:function(a){if(a&&"undefined"!=typeof a.item.__representation){var b=a.item.__representation;this.selected_target!==a.item.__representation&&(this.selected_target&&this.selected_target.unselect(b),b.select(this.selected_target),this.selected_target=b)}else this.selected_target&&this.selected_target.unselect(),this.selected_target=null},onMouseMove:function(a){var b=this.canvas_$.offset(),c=new paper.Point([a.pageX-b.left,a.pageY-b.top]),d=c.subtract(this.last_point);this.last_point=c,!this.is_dragging&&this.mouse_down&&d.length>f._MIN_DRAG_DISTANCE&&(this.is_dragging=!0);var e=paper.project.hitTest(c);this.is_dragging?this.click_target&&"function"==typeof this.click_target.paperShift?this.click_target.paperShift(d):this.view.paperShift(d):this.findTarget(e),paper.view.draw()},onMouseDown:function(b,c){var d=this.canvas_$.offset(),e=new paper.Point([b.pageX-d.left,b.pageY-d.top]); +if(this.last_point=e,this.mouse_down=!0,!this.click_target||"Temp-edge"!==this.click_target.type){this.removeRepresentationsOfType("editor"),this.is_dragging=!1;var g=paper.project.hitTest(e);if(g&&"undefined"!=typeof g.item.__representation)this.click_target=g.item.__representation,this.click_target.mousedown(b,c);else if(this.click_target=null,this.isEditable()&&this.click_mode===f._CLICKMODE_ADDNODE){var h=this.toModelCoords(e),i={id:f.getUID("node"),created_by:this.renkan.current_user,position:{x:h.x,y:h.y}},j=this.renkan.project.addNode(i);this.getRepresentationByModel(j).openEditor()}}this.click_mode&&(this.isEditable()&&this.click_mode===f._CLICKMODE_STARTEDGE&&this.click_target&&"Node"===this.click_target.type?(this.removeRepresentationsOfType("editor"),this.addTempEdge(this.click_target,e),this.click_mode=f._CLICKMODE_ENDEDGE,this.notif_$.fadeOut(function(){a(this).html(this.renkan.translate("Click on a second node to complete the edge")).fadeIn()})):(this.notif_$.hide(),this.click_mode=!1)),paper.view.draw()},onMouseUp:function(a,b){if(this.mouse_down=!1,this.click_target){var c=this.canvas_$.offset();this.click_target.mouseup({point:new paper.Point([a.pageX-c.left,a.pageY-c.top])},b)}else this.click_target=null,this.is_dragging=!1,b&&this.unselectAll(),this.view.updateUrl();paper.view.draw()},onScroll:function(a,b){if(this.totalScroll+=b,Math.abs(this.totalScroll)>=1){var c=this.canvas_$.offset(),d=new paper.Point([a.pageX-c.left,a.pageY-c.top]).subtract(this.view.offset).multiply(Math.SQRT2-1);this.totalScroll>0?this.view.setScale(this.view.scale*Math.SQRT2,this.view.offset.subtract(d)):this.view.setScale(this.view.scale*Math.SQRT1_2,this.view.offset.add(d.divide(Math.SQRT2))),this.totalScroll=0}},onDoubleClick:function(a){var b=this.canvas_$.offset(),c=new paper.Point([a.pageX-b.left,a.pageY-b.top]),d=paper.project.hitTest(c);if(!this.isEditable())return void(d&&"undefined"!=typeof d.item.__representation&&d.item.__representation.model.get("uri")&&window.open(d.item.__representation.model.get("uri"),"_blank"));if(this.isEditable()&&(!d||"undefined"==typeof d.item.__representation)){var e=this.toModelCoords(c),g={id:f.getUID("node"),created_by:this.renkan.current_user,position:{x:e.x,y:e.y}},h=this.renkan.project.addNode(g);this.getRepresentationByModel(h).openEditor()}paper.view.draw()},defaultDropHandler:function(b){var c={},d="";switch(b["text/x-iri-specific-site"]){case"twitter":d=a("
              ").html(b["text/x-iri-selected-html"]);var e=d.find(".tweet");c.title=this.renkan.translate("Tweet by ")+e.attr("data-name"),c.uri="http://twitter.com/"+e.attr("data-screen-name")+"/status/"+e.attr("data-tweet-id"),c.image=e.find(".avatar").attr("src"),c.description=e.find(".js-tweet-text:first").text();break;case"google":d=a("
              ").html(b["text/x-iri-selected-html"]),c.title=d.find("h3:first").text().trim(),c.uri=d.find("h3 a").attr("href"),c.description=d.find(".st:first").text().trim();break;default:b["text/x-iri-source-uri"]&&(c.uri=b["text/x-iri-source-uri"])}if((b["text/plain"]||b["text/x-iri-selected-text"])&&(c.description=(b["text/plain"]||b["text/x-iri-selected-text"]).replace(/[\s\n]+/gm," ").trim()),b["text/html"]||b["text/x-iri-selected-html"]){d=a("
              ").html(b["text/html"]||b["text/x-iri-selected-html"]);var f=d.find("image");f.length&&(c.image=f.attr("xlink:href"));var g=d.find("path");g.length&&(c.clipPath=g.attr("d"));var h=d.find("img");h.length&&(c.image=h[0].src);var i=d.find("a");i.length&&(c.uri=i[0].href),c.title=d.find("[title]").attr("title")||c.title,c.description=d.text().replace(/[\s\n]+/gm," ").trim()}b["text/uri-list"]&&(c.uri=b["text/uri-list"]),b["text/x-moz-url"]&&!c.title&&(c.title=(b["text/x-moz-url"].split("\n")[1]||"").trim(),c.title===c.uri&&(c.title=!1)),b["text/x-iri-source-title"]&&!c.title&&(c.title=b["text/x-iri-source-title"]),(b["text/html"]||b["text/x-iri-selected-html"])&&(d=a("
              ").html(b["text/html"]||b["text/x-iri-selected-html"]),c.image=d.find("[data-image]").attr("data-image")||c.image,c.uri=d.find("[data-uri]").attr("data-uri")||c.uri,c.title=d.find("[data-title]").attr("data-title")||c.title,c.description=d.find("[data-description]").attr("data-description")||c.description,c.clipPath=d.find("[data-clip-path]").attr("data-clip-path")||c.clipPath),c.title||(c.title=this.renkan.translate("Dragged resource"));for(var j=["title","description","uri","image"],k=0;k0&&(f-=this.renkan.$.find(".Rk-Bins").width()),paper.view.viewSize=new paper.Size([f,g])}else{for(a=0;a=3){var c=b.view.split(","),d={project:this.renkan.project,offset:{x:parseFloat(c[0]),y:parseFloat(c[1])},zoom_level:parseFloat(c[2])};this.view?this.view.setScale(d.zoom_level,new paper.Point(d.offset)):(this.view=this.addRepresentation("View",null),this.view.params=d,this.view.init())}this.view||(this.view=this.addRepresentation("View",this.renkan.project.get("views").at(this.validViewIndex(this.renkan.options.default_index_view))),this.view.autoScale()),this.unhighlightAll(),"undefined"!=typeof b.idNode&&this.highlightModel(this.renkan.project.get("nodes").get(b.idNode))},validViewIndex:function(a){var b=parseInt(a),c=0;return c=0>b?this.renkan.project.get("views").length+b:b,"undefined"==typeof this.renkan.project.get("views").at(b)&&(c=0),c},foldBins:function(){var a,b=this.$.find(".Rk-Fold-Bins"),c=this.renkan.$.find(".Rk-Bins"),d=this,e=d.canvas_$.width();c.position().left<0?(c.animate({left:0},250),this.$.animate({left:300},250,function(){var a=d.$.width();paper.view.viewSize=new paper.Size([a,d.canvas_$.height()])}),a=e-c.width()0&&this.renkan.options.save_view&&this.$.find(".Rk-ZoomSetSaved").show()},redraw:function(a){},init:function(){var a=this;a.setScale(a.params.zoom_level,new paper.Point(a.params.offset)),a.options.hide_nodes&&(a.hiddenNodes=(a.params.hidden_nodes||[]).concat(),a.hideNodes())},addHiddenNode:function(a){this.hideNode(a),this.hiddenNodes.push(a.id),this.updateUrl()},hideNode:function(a){"undefined"!=typeof this.renderer.getRepresentationByModel(a)&&this.renderer.getRepresentationByModel(a).hide()},hideNodes:function(){var a=this;this.hiddenNodes.forEach(function(b,c){var d=a.renkan.project.get("nodes").get(b);return"undefined"!=typeof d?a.hideNode(a.renkan.project.get("nodes").get(b)):void a.hiddenNodes.splice(c,1)}),paper.view.draw()},showNodes:function(a){var b=this;this.hiddenNodes.forEach(function(c){b.renderer.getRepresentationByModel(b.renkan.project.get("nodes").get(c)).show(a)}),a||(this.hiddenNodes=[]),paper.view.draw()},setScale:function(a,b){a/this.initialScale>e._MIN_SCALE&&a/this.initialScale1){var c=b.map(function(a){return a.get("position").x}),d=b.map(function(a){return a.get("position").y}),e=Math.min.apply(Math,c),f=Math.min.apply(Math,d),g=Math.max.apply(Math,c),h=Math.max.apply(Math,d),i=Math.min((paper.view.size.width-2*this.renkan.options.autoscale_padding)/(g-e),(paper.view.size.height-2*this.renkan.options.autoscale_padding)/(h-f));this.initialScale=i,"undefined"!=typeof a&&parseFloat(a.zoom_level)>0&&parseFloat(a.offset.x)>0&&parseFloat(a.offset.y)>0?this.setScale(parseFloat(a.zoom_level),new paper.Point(parseFloat(a.offset.x),parseFloat(a.offset.y))):this.setScale(i,paper.view.center.subtract(new paper.Point([(g+e)/2,(h+f)/2]).multiply(i)))}1===b.length&&this.setScale(1,paper.view.center.subtract(new paper.Point([b.at(0).get("position").x,b.at(0).get("position").y])))},paperShift:function(a){this.offset=this.offset.add(a),this.renderer.redraw()},updateUrl:function(){if(this.options.update_url){var b={},c=Backbone.history.getFragment().split("?");c.length>1&&c[1].split("&").forEach(function(a){var c=a.split("=");b[c[0]]=decodeURIComponent(c[1])}),b.view=Math.round(1e3*this.offset.x)/1e3+","+Math.round(1e3*this.offset.y)/1e3+","+Math.round(1e3*this.scale)/1e3,this.renkan.project.get("views").indexOf(this.model)>-1?(b.viewIndex=this.renkan.project.get("views").indexOf(this.model),b.viewIndex===this.renkan.project.get("views").length-1&&(b.viewIndex=-1)):b.viewIndex&&delete b.viewIndex,this.renkan.router.navigate("?"+decodeURIComponent(a.param(b)),{trigger:!1,replace:!0})}},destroy:function(a){this._super("destroy"),this.showNodes(!1)}}).value(),f}),"function"==typeof require.config&&require.config({paths:{jquery:"../lib/jquery/jquery",underscore:"../lib/lodash/lodash",filesaver:"../lib/FileSaver/FileSaver",requtils:"require-utils","ckeditor-core":"../lib/ckeditor/ckeditor","ckeditor-jquery":"../lib/ckeditor/adapters/jquery"},shim:{"ckeditor-jquery":{deps:["jquery","ckeditor-core"]}}}),require(["renderer/baserepresentation","renderer/basebutton","renderer/noderepr","renderer/edge","renderer/tempedge","renderer/baseeditor","renderer/nodeeditor","renderer/edgeeditor","renderer/nodebutton","renderer/nodeeditbutton","renderer/noderemovebutton","renderer/nodehidebutton","renderer/nodeshowbutton","renderer/noderevertbutton","renderer/nodelinkbutton","renderer/nodeenlargebutton","renderer/nodeshrinkbutton","renderer/edgeeditbutton","renderer/edgeremovebutton","renderer/edgerevertbutton","renderer/miniframe","renderer/scene","renderer/viewrepr"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){"use strict";var x=window.Rkns;"undefined"==typeof x.Renderer&&(x.Renderer={});var y=x.Renderer;y._BaseRepresentation=a,y._BaseButton=b,y.Node=c,y.Edge=d,y.View=w,y.TempEdge=e,y._BaseEditor=f,y.NodeEditor=g,y.EdgeEditor=h,y._NodeButton=i,y.NodeEditButton=j,y.NodeRemoveButton=k,y.NodeHideButton=l,y.NodeShowButton=m,y.NodeRevertButton=n,y.NodeLinkButton=o,y.NodeEnlargeButton=p,y.NodeShrinkButton=q,y.EdgeEditButton=r,y.EdgeRemoveButton=s,y.EdgeRevertButton=t,y.MiniFrame=u,y.Scene=v,startRenkan()}),define("main-renderer",function(){}); +//# sourceMappingURL=renkan.min.map \ No newline at end of file