Update version number and copy-server new client version V00.12.03
authorrougeronj
Tue, 15 Sep 2015 17:08:53 +0200
changeset 522 1cb7122dd427
parent 521 0d9b3f1b97e7
child 523 dc04aa440c11
Update version number and copy-server new client version
client/bower.json
client/css/renkan.css
client/package.json
server/java/build.gradle
server/java/pom.xml
server/php/basic/public_html/static/lib/renkan/css/renkan.css
server/php/basic/public_html/static/lib/renkan/css/renkan.min.css
server/php/basic/public_html/static/lib/renkan/css/space-editor.css
server/php/basic/public_html/static/lib/renkan/css/space-editor.min.css
server/php/basic/public_html/static/lib/renkan/js/renkan.js
server/php/basic/public_html/static/lib/renkan/js/renkan.min.js
server/php/basic/public_html/static/lib/renkan/js/renkan.min.map
server/python/django/renkanmanager/__init__.py
server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/renkan.css
server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/renkan.min.css
server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/space-editor.css
server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/space-editor.min.css
server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.js
server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.min.js
server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.min.map
--- a/client/bower.json	Tue Sep 15 12:24:58 2015 +0200
+++ b/client/bower.json	Tue Sep 15 17:08:53 2015 +0200
@@ -1,6 +1,6 @@
 {
   "name": "renkan",
-  "version": "0.12.2",
+  "version": "0.12.3",
   "authors": [
     "IRI <dev@iri-research.org>"
   ],
--- a/client/css/renkan.css	Tue Sep 15 12:24:58 2015 +0200
+++ b/client/css/renkan.css	Tue Sep 15 17:08:53 2015 +0200
@@ -387,6 +387,13 @@
     display: block; float: right; width: 18px; height: 17px; margin: 1px 0; border: none; background: url(../img/goto.png);
 }
 
+.Rk-Edit-Title {
+    background-color: #fff;
+    border: 1px solid #d4d4d4;
+    line-height: 15px;
+    min-height: 15px;
+}
+
 .Rk-Edit-Title, .Rk-Edit-URI, .Rk-Edit-Image-File, .Rk-Edit-Vocabulary {
     font-size: 12px; width: 250px;
 }
--- a/client/package.json	Tue Sep 15 12:24:58 2015 +0200
+++ b/client/package.json	Tue Sep 15 17:08:53 2015 +0200
@@ -1,6 +1,6 @@
 {
   "name": "renkan",
-  "version": "0.12.2",
+  "version": "0.12.3",
   "description": "Renkan client application",
   "repository": {
     "type": "hg",
--- a/server/java/build.gradle	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/java/build.gradle	Tue Sep 15 17:08:53 2015 +0200
@@ -2,7 +2,7 @@
   apply plugin: 'maven'
 
   group = 'org.iri_research.renkan'
-  version = '0.12.2'
+  version = '0.12.3'
 
 
   gradle.projectsEvaluated {
--- a/server/java/pom.xml	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/java/pom.xml	Tue Sep 15 17:08:53 2015 +0200
@@ -5,7 +5,7 @@
     <groupId>org.iri_research.renkan</groupId>
     <artifactId>renkan</artifactId>
     <packaging>pom</packaging>
-    <version>0.12.2</version>
+    <version>0.12.3</version>
     <name>Renkan project</name>
 
     <modules>
--- a/server/php/basic/public_html/static/lib/renkan/css/renkan.css	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/php/basic/public_html/static/lib/renkan/css/renkan.css	Tue Sep 15 17:08:53 2015 +0200
@@ -24,7 +24,7 @@
  *  knowledge of the CeCILL-C license and that you accept its terms.
  */
 
-/*! renkan - v0.12.1 - Copyright © IRI 2015 */
+/*! renkan - v - Copyright © IRI 2015 */
 
 /*!
  *    _____            _
@@ -415,6 +415,13 @@
     display: block; float: right; width: 18px; height: 17px; margin: 1px 0; border: none; background: url(../img/goto.png);
 }
 
+.Rk-Edit-Title {
+    background-color: #fff;
+    border: 1px solid #d4d4d4;
+    line-height: 15px;
+    min-height: 15px;
+}
+
 .Rk-Edit-Title, .Rk-Edit-URI, .Rk-Edit-Image-File, .Rk-Edit-Vocabulary {
     font-size: 12px; width: 250px;
 }
--- a/server/php/basic/public_html/static/lib/renkan/css/renkan.min.css	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/php/basic/public_html/static/lib/renkan/css/renkan.min.css	Tue Sep 15 17:08:53 2015 +0200
@@ -24,7 +24,7 @@
  *  knowledge of the CeCILL-C license and that you accept its terms.
  */
 
-/*! renkan - v0.12.1 - Copyright © IRI 2015 */
+/*! renkan - v - Copyright © IRI 2015 */
 
 
 /*!
@@ -50,4 +50,4 @@
  *
  *  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.
- *//*! renkan - v0.7.11 - Copyright © IRI 2014 */#renkan{overflow:hidden}.Rk-Main h3,.Rk-Main h4,.Rk-Main li,.Rk-Main p,.Rk-Main ul{border:0 none;margin:0;padding:0}.Rk-Main li,.Rk-Main ul{list-style:none}.Rk-Main input::-moz-focus-inner{border:0;padding:0}.Rk-Main table{border-collapse:separate;border-spacing:0}.Rk-Main td,.Rk-Main th{vertical-align:top}.Rk-Main img a{border:none}.Rk-Main{font-size:10px;font-family:Arial,Helvetica,sans-serif;background:#fff;color:#000}.Rk-Main a{color:#6060c0}.Rk-Main{position:absolute;left:0;top:0;right:0;bottom:0}.Rk-Render{position:absolute;top:0;right:0;bottom:0;background:#fff}.Rk-Render-Full{left:0}.Rk-Render-Panel{left:300px}.Rk-TopBar{position:absolute;left:0;top:0;right:0;height:35px;background:#333;background:-moz-linear-gradient(top,#505050 5px,#1e1e1e 30px);background:-webkit-linear-gradient(top,#505050 5px,#1e1e1e 30px);background:-ms-linear-gradient(top,#505050 5px,#1e1e1e 30px);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#505050', endColorstr='#1e1e1e', GradientType=0)}.Rk-TopBar .loader{display:block;background:none repeat red;width:0;height:4px;overflow:hidden;position:absolute;bottom:0;left:0;transition:width 3s linear;z-index:50}.Rk-TopBar .loader.run{width:100%}.Rk-PadTitle{float:left;font-size:14px;height:16px;margin:4px 5px;background:#666;padding:4px;border:1px solid #333;border-radius:3px;box-shadow:0 1px 0 #505050;color:#fff;font-weight:700}input.Rk-PadTitle{width:180px}h2.Rk-PadTitle{min-width:180px;max-width:320px;overflow:hidden}.Rk-Users{float:right;width:130px;margin:4px 5px}.Rk-CurrentUser{font-size:13px;background:#666;padding:4px;border:1px solid #333;border-radius:3px;box-shadow:0 1px 0 #505050;color:#fff;text-align:center}.Rk-CurrentUser-Color{display:inline-block;width:12px;height:12px;border:1px solid #333;margin:-2px 2px;position:relative}.Rk-CurrentUser input{width:95px;padding:1px;border:none;border-radius:2px}.Rk-UserList{box-shadow:0 2px 2px #999;position:relative;z-index:3;display:none;padding-top:8px}.Rk-User{background:#fff;padding:3px;font-size:12px;border-style:solid solid none;border-color:#ccc;border-width:1px}.Rk-TopBar-Button{float:right;background:url(../img/topbarbuttons.png) no-repeat;height:35px;cursor:pointer;position:relative}.Rk-TopBar-Separator{background:#666;background:-moz-linear-gradient(top,#666 20%,#333 80%);background:-webkit-linear-gradient(top,#666 20%,#333 80%);background:-ms-linear-gradient(top,#666 20%,#333 80%);content:"";display:block;height:35px;float:right;width:1px;border-left:1px solid #111;margin:0 3px}.Rk-TopBar-Tooltip{position:absolute;top:31px;left:50%;margin-left:-60px;width:120px;z-index:4;display:none}.Rk-TopBar-Tooltip-Contents{background:#fff;font-size:13px;font-weight:700;color:#6060c0;text-align:center;padding:2px;border-style:none solid solid;border-width:1px;border-color:#ccc;border-bottom-left-radius:2px;border-bottom-right-radius:2px}.Rk-TopBar-Tooltip:before{content:".";display:block;text-indent:-8000px;height:7px;background:url(../img/tooltiparrow.png) center no-repeat;margin:0 1px}.Rk-AddNode-Button{width:30px;background-position:-2px 0}.Rk-AddNode-Button:hover{background-position:-2px -35px}.Rk-FullScreen-Button{width:30px;background-position:-36px 0}.Rk-FullScreen-Button:hover{background-position:-36px -35px}.Rk-AddEdge-Button{width:30px;background-position:-70px 0}.Rk-AddEdge-Button:hover{background-position:-70px -35px}.Rk-Save-Button{width:30px;background-position:-104px 0}.Rk-Save-Button.saving{background-position:-104px 0}.Rk-Save-Button.Rk-Save-Online:hover,.Rk-Save-Button.saved:hover,.Rk-Save-Button:hover{background-position:-104px -35px}.Rk-Save-Button.Rk-Save-Online:active,.Rk-Save-Button.saved:active,.Rk-Save-Button:active{background-position:-104px 0}.Rk-Save-Button.to-save{background-position:-172px -35px}.Rk-Save-Button.Rk-Save-Online,.Rk-Save-Button.saved{background-position:-172px 0}.Rk-Save-Button.Rk-Save-ReadOnly,.Rk-Save-Button.disabled{opacity:.4;cursor:default}.Rk-Export-Button{width:30px;background-position:-274px 0}.Rk-Export-Button.disabled{opacity:.5;cursor:default}.Rk-Export-Button:hover{background-position:-274px -35px}.Rk-Export-Button.disabled:hover{opacity:1;background-position:-274px 0}.Rk-Bookmarklet-Button{width:30px;background-position:-138px 0}.Rk-Bookmarklet-Button.disabled{opacity:.5;cursor:default}.Rk-Bookmarklet-Button:hover{background-position:-138px -35px}.Rk-Bookmarklet-Button.disabled:hover{opacity:1;background-position:-138px 0}.Rk-Home-Button{width:30px;background-position:-206px 0}.Rk-Home-Button:hover{background-position:-206px -35px}.Rk-Open-Button{width:30px;background-position:-240px 0}.Rk-Open-Button:hover{background-position:-240px -35px}.Rk-GraphSearch-Form{float:right;width:185px;position:relative}.Rk-GraphSearch-Form:after,.Rk-GraphSearch-Form:before{position:absolute;display:block;content:".";text-indent:-9999px}.Rk-GraphSearch-Form:before{right:10px;top:20px;width:7px;height:2px;border:none;padding:0;background:#666;transform:rotate(40deg);-webkit-transform:rotate(40deg)}.Rk-GraphSearch-Form:after{right:13px;top:11px;width:6px;height:6px;border-radius:8px;border:2px solid #666}.Rk-GraphSearch-Field{line-height:23px;font-size:14px;height:23px;padding:0 5px;border:none;margin:6px 5px;width:165px;background:#f0f0f0;box-shadow:1px 1px 1px #999 inset;border-radius:5px;-webkit-appearance:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.Rk-Editing-Space{position:absolute;left:0;top:35px;right:0;bottom:0;overflow:hidden;background:-moz-radial-gradient(center,circle,#fff 40%,#e0e0e0 90%);background:-webkit-radial-gradient(center,circle,#fff 40%,#e0e0e0 90%);background:-ms-radial-gradient(center,circle,#fff 40%,#e0e0e0 90%)}.Rk-Editing-Space-Full{top:0}.Rk-Canvas{position:absolute;left:0;top:0;right:0;bottom:0;z-index:2}.Rk-Canvas[resize]{width:100%;height:100%}.Rk-Highlighted{background:rgba(255,255,0,.5)}.Rk-Labels{position:absolute;left:0;top:0;z-index:1;font-family:"Segoe UI","Helvetica Neue",Arial,Helvetica,sans-serif}.Rk-Label{position:absolute;width:160px;margin-left:-80px;text-align:center;font-size:13px;line-height:13px}.Rk-Edge-Label{font-size:11px;transform-origin:50% 0;-moz-transform-origin:50% 0;-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0}.Rk-Editor{position:absolute;left:0;top:0;z-index:3}.Rk-Notifications{position:absolute;right:15px;top:15px;width:200px;padding:10px;border-radius:8px;display:none;color:#fff;font-size:13px;text-align:center;font-weight:700;background:rgba(20,20,20,.7);background:-moz-linear-gradient(top,rgba(40,40,40,.7)20%,rgba(0,0,0,.7)80%);background:-webkit-linear-gradient(top,rgba(40,40,40,.7)20%,rgba(0,0,0,.7)80%);background:-ms-linear-gradient(top,rgba(40,40,40,.7)20%,rgba(0,0,0,.7)80%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#202020', endColorstr='#000000', GradientType=0)}.Rk-CloseX{float:right;cursor:pointer}.Rk-Editor h2{font-size:16px;font-weight:700}.Rk-Editor audio,.Rk-Editor video{max-height:100%;max-width:100%}.Rk-Editor p,.Rk-Editor-p,.Rk-Editor-p>div{margin:5px 0;font-size:12px;clear:both}.Rk-Editor-Label{float:left;width:80px}a.Rk-Edit-Goto{display:block;float:right;width:18px;height:17px;margin:1px 0;border:none;background:url(../img/goto.png)}.Rk-Edit-Image-File,.Rk-Edit-Title,.Rk-Edit-URI,.Rk-Edit-Vocabulary{font-size:12px;width:250px}.Rk-Edit-Image{font-size:12px;width:220px}.Rk-Edit-Image-Del{display:inline-block;background:url(../img/remove.png);background-size:15px 20px;background-repeat:no-repeat;vertical-align:top;height:20px;width:15px;margin-right:2px}.Rk-Edit-URI{font-size:12px;width:220px}.Rk-Edit-ImgWrap{text-align:center}.Rk-Edit-ImgPreview{display:inline-block;border:1px solid #666;margin:5px auto;position:relative}.Rk-Edit-ImgPreview img{display:inline-block;max-width:253px!important;max-height:200px!important}.Rk-Edit-ImgPreview svg{height:100%;left:0;position:absolute;top:0;width:100%}.Rk-Editor textarea{width:250px;height:120px;resize:none}div.Rk-Edit-Description{-moz-appearance:textfield-multiline;-webkit-appearance:textarea;background-color:#FFF;border:1px solid #F0F0F0;width:250px;height:120px;resize:vertical;overflow:auto;padding:2px}.Rk-UserColor{display:inline-block;width:12px;height:12px;border:1px solid #666;margin:-2px 2px}.Rk-Edit-Color{display:inline-block;width:10px;height:10px;border:2px solid #333;margin:-2px 2px;position:relative}.Rk-Edit-ColorTip{display:block;width:3px;height:3px;background:#fff;position:absolute;bottom:0;right:0;cursor:pointer}.Rk-Edit-ColorPicker-Wrapper{display:inline-block;position:relative;float:left}.Rk-Edit-ColorPicker{position:absolute;top:-2px;left:15px;width:96px;height:96px;border:1px solid #CCC;padding:5px 4px 4px 5px;background:#fff;border-radius:5px;display:none;z-index:4}.Rk-CurrentUser .Rk-Edit-ColorPicker{left:-105px;top:2px}.Rk-Edit-ColorPicker-Text{color:#303080;font-weight:700}.Rk-Edit-ColorPicker li{float:left;width:11px;height:11px;margin:0 1px 1px 0;cursor:pointer}.Rk-Edit-Dash{float:left;display:inline-block}.Rk-Edit-Size-Btn{font-size:13px;font-weight:700;padding:0 4px;background:#fff;color:#000;border:1px solid #ccc;text-decoration:none}.Rk-Edit-Size-Btn:hover{background:#666}.Rk-Edit-Size-Disp{display:inline-block;padding:0 5px;text-align:center;width:20px}.Rk-Edit-Vocabulary-Class{color:#999;font-style:italic;font-weight:700}.Rk-Edit-Vocabulary-Property{padding-left:20px}.Rk-Edit-Direction{border:1px solid #666;padding:3px 5px;line-height:20px;border-radius:3px;background:#f0f0f0;cursor:pointer}.Rk-Edit-Direction:hover{background:silver}.Rk-Display-Title a{text-decoration:none;color:#000}.Rk-Display-Title a:hover{text-decoration:underline}.Rk-Display-URI{font-style:italic}.Rk-Display-ImgPreview{margin:5px auto;display:block;max-width:255px!important;max-height:260px!important}.Rk-Fold-Bins{position:absolute;top:5px;width:12px;text-align:center;font-size:16px;cursor:pointer;line-height:16px;padding:4px;color:#fff;background:#666;border-radius:0 6px 6px 0;font-weight:700}.Rk-Fold-Bins:hover{background:#333}.Rk-ZoomButtons{position:absolute;left:0;top:35px;cursor:pointer}.Rk-Editing-Space-Full .Rk-ZoomButtons{top:0}.Rk-ShowHiddenNodes,.Rk-ZoomFit,.Rk-ZoomIn,.Rk-ZoomOut,.Rk-ZoomSave,.Rk-ZoomSetSaved{width:21px;height:20px;background:url(../img/zoombuttons.png);margin:5px}.Rk-ZoomIn:hover{background-position:0 -20px}.Rk-ZoomFit{background-position:-42px 0}.Rk-ZoomFit:hover{background-position:-42px -20px}.Rk-ZoomOut{background-position:-21px 0}.Rk-ZoomOut:hover{background-position:-21px -20px}.Rk-ZoomSave{background-position:-63px 0}.Rk-ZoomSave:hover{background-position:-63px -20px}.Rk-ZoomSetSaved{background-position:-84px 0;display:none}.Rk-ZoomSetSaved:hover{background-position:-84px -20px}.Rk-ShowHiddenNodes{background-position:-105px 0}.Rk-ShowHiddenNodes:hover{background-position:-105px -20px}.Rk-Bins{background:#fff;position:absolute;left:0;top:0;width:299px;bottom:0;overflow:hidden;border-right:1px solid #252525}.Rk-Bins-Title{border:0 none;width:290px;height:15px;line-height:15px;margin:0;padding:15px 0 5px 10px;font-size:14px;color:#F0F0F0;background:-moz-linear-gradient(top,#1e1e1e 5px,#606060 30px);background:-webkit-linear-gradient(top,#1e1e1e 5px,#606060 30px);background:-ms-linear-gradient(top,#1e1e1e 5px,#606060 30px);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e1e1e', endColorstr='#606060', GradientType=0)}.Rk-Search-Form{padding:0 10px 8px;height:27px;background:#606060}.Rk-Search-Input,.Rk-Search-Select{float:left;margin:0}.Rk-Search-Input{border-top-left-radius:5px;border-bottom-left-radius:5px;border:1px solid #003050;font-size:13px;background:#fff;height:25px;padding:0 5px;line-height:25px;-webkit-appearance:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.Rk-Web-Search-Input{width:190px}.Rk-Bins-Search-Input{width:235px}.Rk-Search-Select{display:inline-block;position:relative;width:45px;border-width:1px;border-color:#003050;border-style:solid none;cursor:pointer;height:25px;background:#fff url(../img/more.png) 30px 10px no-repeat}.Rk-Search-Select:hover{background-color:#3030FF}.Rk-Search-Current{width:40px;height:20px;margin:2px;background-repeat:no-repeat}.Rk-Search-List{width:180px;margin-left:15px;font-size:13px;position:absolute;right:0;top:25px;background:#fff;box-shadow:1px 1px 2px #505050;display:none;border:1px solid #ccc;z-index:2}.Rk-Search-List li{padding:2px 2px 2px 30px;border-top:1px solid #ccc;height:16px;background-color:#fff;background-repeat:no-repeat;cursor:pointer}.Rk-Search-List li:hover{background-color:#3030ff;color:#fff}.Rk-Search-Submit{border:1px solid #003050;height:27px;width:30px;border-top-right-radius:5px;border-bottom-right-radius:5px;background:#333 center no-repeat url(../img/search.png);cursor:pointer}.Rk-Search-Submit:hover{background-color:#999}.Rk-Bin-Title{background:#333;background:-moz-linear-gradient(top,#505050 20%,#1e1e1e 80%);background:-webkit-linear-gradient(top,#505050 20%,#1e1e1e 80%);background:-ms-linear-gradient(top,#505050 20%,#1e1e1e 80%);font-weight:700;font-size:14px;padding:5px;cursor:pointer;color:#f0f0f0;margin:0;border:0 none}.Rk-Bin-Close{float:right;display:block;font-size:16px;font-weight:700;margin:2px 3px 0;color:#f0f0f0;cursor:pointer;text-shadow:-1px -1px 1px #999,1px 1px 1px #000;text-decoration:none}.Rk-Bin-Close:hover{color:#ffff80}.Rk-Bin-Title:hover{color:#ffffe0;background:#505050;background:-moz-linear-gradient(top,#141414 20%,#3c3c3c 80%);background:-webkit-linear-gradient(top,#141414 20%,#3c3c3c 80%);background:-ms-linear-gradient(top,#141414 20%,#3c3c3c 80%)}.Rk-Bin-Refresh{width:18px;height:17px;background:url(../img/refresh.png);display:block;float:right;margin-top:4px}.Rk-Bin-Refresh:hover{background-position:-18px 0}.Rk-Bin-Count{float:right;background:#c000a0;color:#FFF;text-shadow:1px 1px 1px #000;display:none;border-radius:4px;padding:1px 3px;font-size:10px;font-weight:700;margin-top:4px}.Rk-Bin-Title-Icon{float:left;width:25px;margin:2px}.Rk-Bin-Main{overflow:auto;background:#fff;background:-moz-linear-gradient(top,#e0e0e0 0,#FFF 2%,#FFF 98%,#e0e0e0 100%);background:-webkit-linear-gradient(top,#e0e0e0 0,#FFF 2%,#FFF 98%,#e0e0e0 100%);background:-ms-linear-gradient(top,#e0e0e0 0,#FFF 2%,#FFF 98%,#e0e0e0 100%)}.Rk-Bin-Item{cursor:move}.Rk-Bin-Item.hover,.Rk-Bin-Item:hover{background:-moz-linear-gradient(top,rgba(0,0,0,.1)20%,rgba(128,128,128,.1)80%);background:-webkit-linear-gradient(top,rgba(0,0,0,.1)20%,rgba(128,128,128,.1)80%);background:-ms-linear-gradient(top,rgba(0,0,0,.1)20%,rgba(128,128,128,.1)80%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d0d0d0', endColorstr='#f3f3f3', GradientType=0)}.Rk-Bin-Item.selected{background:#ffffc0}.Rk-Bin-Main li{padding:2px;border-bottom:1px solid #ccc;clear:both;overflow:hidden}.Rk-Bin-Main h3{font-size:14px;font-style:italic;font-weight:700;text-align:center}.Rk-Bin-Main h4{font-size:12px;font-weight:700}.Rk-Bin-Main p{font-size:11px}.Rk-Bin-Main h4 a{color:#303080}.Rk-Bin-Main .searchmatch{background:#ffff80}.Rk-Wikipedia-Search-Icon{background-image:url(../img/search-logos.png)}.Rk-Wikipedia-Icon{float:left;margin:3px;max-height:48px;max-width:48px}.Rk-Wikipedia-Title-Icon{height:20px;background:url(../img/search-logos.png)}.Rk-Wikipedia-Lang-en{background-position:0 -20px}.Rk-Wikipedia-Lang-fr{background-position:0 -40px}.Rk-Wikipedia-Lang-ja{background-position:0 -60px}.Rk-Wikipedia-Result{min-height:51px}.Rk-Wikipedia-Result h4,.Rk-Wikipedia-Result p{margin-left:54px}.Rk-ResourceList-Image{float:left;max-width:100px;max-height:75px;margin-right:2px}.Rk-Ldt-Icon,.Rk-Ldt-Title-Icon{background:url(../img/search-logos.png);background-position:0 -100px;background-repeat:no-repeat}.Rk-Ldt-Title-Icon{height:20px;margin-top:4px}.Rk-Ldt-Tag-Icon{float:left;margin:0 2px 0 0}.Rk-Ldt-Annotation-Icon{float:left;margin:3px}.Rk-Clear{clear:both}h4.Rk-Bin-Loading{margin:10px;text-align:center;font-size:20px;color:#999}
\ No newline at end of file
+ *//*! renkan - v0.7.11 - Copyright © IRI 2014 */#renkan{overflow:hidden}.Rk-Main h3,.Rk-Main h4,.Rk-Main li,.Rk-Main p,.Rk-Main ul{border:0 none;margin:0;padding:0}.Rk-Main li,.Rk-Main ul{list-style:none}.Rk-Main input::-moz-focus-inner{border:0;padding:0}.Rk-Main table{border-collapse:separate;border-spacing:0}.Rk-Main td,.Rk-Main th{vertical-align:top}.Rk-Main img a{border:none}.Rk-Main{font-size:10px;font-family:Arial,Helvetica,sans-serif;background:#fff;color:#000}.Rk-Main a{color:#6060c0}.Rk-Main{position:absolute;left:0;top:0;right:0;bottom:0}.Rk-Render{position:absolute;top:0;right:0;bottom:0;background:#fff}.Rk-Render-Full{left:0}.Rk-Render-Panel{left:300px}.Rk-TopBar{position:absolute;left:0;top:0;right:0;height:35px;background:#333;background:-moz-linear-gradient(top,#505050 5px,#1e1e1e 30px);background:-webkit-linear-gradient(top,#505050 5px,#1e1e1e 30px);background:-ms-linear-gradient(top,#505050 5px,#1e1e1e 30px);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#505050', endColorstr='#1e1e1e', GradientType=0)}.Rk-TopBar .loader{display:block;background:none repeat red;width:0;height:4px;overflow:hidden;position:absolute;bottom:0;left:0;transition:width 3s linear;z-index:50}.Rk-TopBar .loader.run{width:100%}.Rk-PadTitle{float:left;font-size:14px;height:16px;margin:4px 5px;background:#666;padding:4px;border:1px solid #333;border-radius:3px;box-shadow:0 1px 0 #505050;color:#fff;font-weight:700}input.Rk-PadTitle{width:180px}h2.Rk-PadTitle{min-width:180px;max-width:320px;overflow:hidden}.Rk-Users{float:right;width:130px;margin:4px 5px}.Rk-CurrentUser{font-size:13px;background:#666;padding:4px;border:1px solid #333;border-radius:3px;box-shadow:0 1px 0 #505050;color:#fff;text-align:center}.Rk-CurrentUser-Color{display:inline-block;width:12px;height:12px;border:1px solid #333;margin:-2px 2px;position:relative}.Rk-CurrentUser input{width:95px;padding:1px;border:none;border-radius:2px}.Rk-UserList{box-shadow:0 2px 2px #999;position:relative;z-index:3;display:none;padding-top:8px}.Rk-User{background:#fff;padding:3px;font-size:12px;border-style:solid solid none;border-color:#ccc;border-width:1px}.Rk-TopBar-Button{float:right;background:url(../img/topbarbuttons.png) no-repeat;height:35px;cursor:pointer;position:relative}.Rk-TopBar-Separator{background:#666;background:-moz-linear-gradient(top,#666 20%,#333 80%);background:-webkit-linear-gradient(top,#666 20%,#333 80%);background:-ms-linear-gradient(top,#666 20%,#333 80%);content:"";display:block;height:35px;float:right;width:1px;border-left:1px solid #111;margin:0 3px}.Rk-TopBar-Tooltip{position:absolute;top:31px;left:50%;margin-left:-60px;width:120px;z-index:4;display:none}.Rk-TopBar-Tooltip-Contents{background:#fff;font-size:13px;font-weight:700;color:#6060c0;text-align:center;padding:2px;border-style:none solid solid;border-width:1px;border-color:#ccc;border-bottom-left-radius:2px;border-bottom-right-radius:2px}.Rk-TopBar-Tooltip:before{content:".";display:block;text-indent:-8000px;height:7px;background:url(../img/tooltiparrow.png) center no-repeat;margin:0 1px}.Rk-AddNode-Button{width:30px;background-position:-2px 0}.Rk-AddNode-Button:hover{background-position:-2px -35px}.Rk-FullScreen-Button{width:30px;background-position:-36px 0}.Rk-FullScreen-Button:hover{background-position:-36px -35px}.Rk-AddEdge-Button{width:30px;background-position:-70px 0}.Rk-AddEdge-Button:hover{background-position:-70px -35px}.Rk-Save-Button{width:30px;background-position:-104px 0}.Rk-Save-Button.saving{background-position:-104px 0}.Rk-Save-Button.Rk-Save-Online:hover,.Rk-Save-Button.saved:hover,.Rk-Save-Button:hover{background-position:-104px -35px}.Rk-Save-Button.Rk-Save-Online:active,.Rk-Save-Button.saved:active,.Rk-Save-Button:active{background-position:-104px 0}.Rk-Save-Button.to-save{background-position:-172px -35px}.Rk-Save-Button.Rk-Save-Online,.Rk-Save-Button.saved{background-position:-172px 0}.Rk-Save-Button.Rk-Save-ReadOnly,.Rk-Save-Button.disabled{opacity:.4;cursor:default}.Rk-Export-Button{width:30px;background-position:-274px 0}.Rk-Export-Button.disabled{opacity:.5;cursor:default}.Rk-Export-Button:hover{background-position:-274px -35px}.Rk-Export-Button.disabled:hover{opacity:1;background-position:-274px 0}.Rk-Bookmarklet-Button{width:30px;background-position:-138px 0}.Rk-Bookmarklet-Button.disabled{opacity:.5;cursor:default}.Rk-Bookmarklet-Button:hover{background-position:-138px -35px}.Rk-Bookmarklet-Button.disabled:hover{opacity:1;background-position:-138px 0}.Rk-Home-Button{width:30px;background-position:-206px 0}.Rk-Home-Button:hover{background-position:-206px -35px}.Rk-Open-Button{width:30px;background-position:-240px 0}.Rk-Open-Button:hover{background-position:-240px -35px}.Rk-GraphSearch-Form{float:right;width:185px;position:relative}.Rk-GraphSearch-Form:after,.Rk-GraphSearch-Form:before{position:absolute;display:block;content:".";text-indent:-9999px}.Rk-GraphSearch-Form:before{right:10px;top:20px;width:7px;height:2px;border:none;padding:0;background:#666;transform:rotate(40deg);-webkit-transform:rotate(40deg)}.Rk-GraphSearch-Form:after{right:13px;top:11px;width:6px;height:6px;border-radius:8px;border:2px solid #666}.Rk-GraphSearch-Field{line-height:23px;font-size:14px;height:23px;padding:0 5px;border:none;margin:6px 5px;width:165px;background:#f0f0f0;box-shadow:1px 1px 1px #999 inset;border-radius:5px;-webkit-appearance:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.Rk-Editing-Space{position:absolute;left:0;top:35px;right:0;bottom:0;overflow:hidden;background:-moz-radial-gradient(center,circle,#fff 40%,#e0e0e0 90%);background:-webkit-radial-gradient(center,circle,#fff 40%,#e0e0e0 90%);background:-ms-radial-gradient(center,circle,#fff 40%,#e0e0e0 90%)}.Rk-Editing-Space-Full{top:0}.Rk-Canvas{position:absolute;left:0;top:0;right:0;bottom:0;z-index:2}.Rk-Canvas[resize]{width:100%;height:100%}.Rk-Highlighted{background:rgba(255,255,0,.5)}.Rk-Labels{position:absolute;left:0;top:0;z-index:1;font-family:"Segoe UI","Helvetica Neue",Arial,Helvetica,sans-serif}.Rk-Label{position:absolute;width:160px;margin-left:-80px;text-align:center;font-size:13px;line-height:13px}.Rk-Edge-Label{font-size:11px;transform-origin:50% 0;-moz-transform-origin:50% 0;-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0}.Rk-Editor{position:absolute;left:0;top:0;z-index:3}.Rk-Notifications{position:absolute;right:15px;top:15px;width:200px;padding:10px;border-radius:8px;display:none;color:#fff;font-size:13px;text-align:center;font-weight:700;background:rgba(20,20,20,.7);background:-moz-linear-gradient(top,rgba(40,40,40,.7)20%,rgba(0,0,0,.7)80%);background:-webkit-linear-gradient(top,rgba(40,40,40,.7)20%,rgba(0,0,0,.7)80%);background:-ms-linear-gradient(top,rgba(40,40,40,.7)20%,rgba(0,0,0,.7)80%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#202020', endColorstr='#000000', GradientType=0)}.Rk-CloseX{float:right;cursor:pointer}.Rk-Editor h2{font-size:16px;font-weight:700}.Rk-Editor audio,.Rk-Editor video{max-height:100%;max-width:100%}.Rk-Editor p,.Rk-Editor-p,.Rk-Editor-p>div{margin:5px 0;font-size:12px;clear:both}.Rk-Editor-Label{float:left;width:80px}a.Rk-Edit-Goto{display:block;float:right;width:18px;height:17px;margin:1px 0;border:none;background:url(../img/goto.png)}.Rk-Edit-Title{background-color:#fff;border:1px solid #d4d4d4;line-height:15px;min-height:15px}.Rk-Edit-Image-File,.Rk-Edit-Title,.Rk-Edit-URI,.Rk-Edit-Vocabulary{font-size:12px;width:250px}.Rk-Edit-Image{font-size:12px;width:220px}.Rk-Edit-Image-Del{display:inline-block;background:url(../img/remove.png);background-size:15px 20px;background-repeat:no-repeat;vertical-align:top;height:20px;width:15px;margin-right:2px}.Rk-Edit-URI{font-size:12px;width:220px}.Rk-Edit-ImgWrap{text-align:center}.Rk-Edit-ImgPreview{display:inline-block;border:1px solid #666;margin:5px auto;position:relative}.Rk-Edit-ImgPreview img{display:inline-block;max-width:253px!important;max-height:200px!important}.Rk-Edit-ImgPreview svg{height:100%;left:0;position:absolute;top:0;width:100%}.Rk-Editor textarea{width:250px;height:120px;resize:none}div.Rk-Edit-Description{-moz-appearance:textfield-multiline;-webkit-appearance:textarea;background-color:#FFF;border:1px solid #F0F0F0;width:250px;height:120px;resize:vertical;overflow:auto;padding:2px}.Rk-UserColor{display:inline-block;width:12px;height:12px;border:1px solid #666;margin:-2px 2px}.Rk-Edit-Color{display:inline-block;width:10px;height:10px;border:2px solid #333;margin:-2px 2px;position:relative}.Rk-Edit-ColorTip{display:block;width:3px;height:3px;background:#fff;position:absolute;bottom:0;right:0;cursor:pointer}.Rk-Edit-ColorPicker-Wrapper{display:inline-block;position:relative;float:left}.Rk-Edit-ColorPicker{position:absolute;top:-2px;left:15px;width:96px;height:96px;border:1px solid #CCC;padding:5px 4px 4px 5px;background:#fff;border-radius:5px;display:none;z-index:4}.Rk-CurrentUser .Rk-Edit-ColorPicker{left:-105px;top:2px}.Rk-Edit-ColorPicker-Text{color:#303080;font-weight:700}.Rk-Edit-ColorPicker li{float:left;width:11px;height:11px;margin:0 1px 1px 0;cursor:pointer}.Rk-Edit-Dash{float:left;display:inline-block}.Rk-Edit-Size-Btn{font-size:13px;font-weight:700;padding:0 4px;background:#fff;color:#000;border:1px solid #ccc;text-decoration:none}.Rk-Edit-Size-Btn:hover{background:#666}.Rk-Edit-Size-Disp{display:inline-block;padding:0 5px;text-align:center;width:20px}.Rk-Edit-Vocabulary-Class{color:#999;font-style:italic;font-weight:700}.Rk-Edit-Vocabulary-Property{padding-left:20px}.Rk-Edit-Direction{border:1px solid #666;padding:3px 5px;line-height:20px;border-radius:3px;background:#f0f0f0;cursor:pointer}.Rk-Edit-Direction:hover{background:silver}.Rk-Display-Title a{text-decoration:none;color:#000}.Rk-Display-Title a:hover{text-decoration:underline}.Rk-Display-URI{font-style:italic}.Rk-Display-ImgPreview{margin:5px auto;display:block;max-width:255px!important;max-height:260px!important}.Rk-Fold-Bins{position:absolute;top:5px;width:12px;text-align:center;font-size:16px;cursor:pointer;line-height:16px;padding:4px;color:#fff;background:#666;border-radius:0 6px 6px 0;font-weight:700}.Rk-Fold-Bins:hover{background:#333}.Rk-ZoomButtons{position:absolute;left:0;top:35px;cursor:pointer}.Rk-Editing-Space-Full .Rk-ZoomButtons{top:0}.Rk-ShowHiddenNodes,.Rk-ZoomFit,.Rk-ZoomIn,.Rk-ZoomOut,.Rk-ZoomSave,.Rk-ZoomSetSaved{width:21px;height:20px;background:url(../img/zoombuttons.png);margin:5px}.Rk-ZoomIn:hover{background-position:0 -20px}.Rk-ZoomFit{background-position:-42px 0}.Rk-ZoomFit:hover{background-position:-42px -20px}.Rk-ZoomOut{background-position:-21px 0}.Rk-ZoomOut:hover{background-position:-21px -20px}.Rk-ZoomSave{background-position:-63px 0}.Rk-ZoomSave:hover{background-position:-63px -20px}.Rk-ZoomSetSaved{background-position:-84px 0;display:none}.Rk-ZoomSetSaved:hover{background-position:-84px -20px}.Rk-ShowHiddenNodes{background-position:-105px 0}.Rk-ShowHiddenNodes:hover{background-position:-105px -20px}.Rk-Bins{background:#fff;position:absolute;left:0;top:0;width:299px;bottom:0;overflow:hidden;border-right:1px solid #252525}.Rk-Bins-Title{border:0 none;width:290px;height:15px;line-height:15px;margin:0;padding:15px 0 5px 10px;font-size:14px;color:#F0F0F0;background:-moz-linear-gradient(top,#1e1e1e 5px,#606060 30px);background:-webkit-linear-gradient(top,#1e1e1e 5px,#606060 30px);background:-ms-linear-gradient(top,#1e1e1e 5px,#606060 30px);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e1e1e', endColorstr='#606060', GradientType=0)}.Rk-Search-Form{padding:0 10px 8px;height:27px;background:#606060}.Rk-Search-Input,.Rk-Search-Select{float:left;margin:0}.Rk-Search-Input{border-top-left-radius:5px;border-bottom-left-radius:5px;border:1px solid #003050;font-size:13px;background:#fff;height:25px;padding:0 5px;line-height:25px;-webkit-appearance:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.Rk-Web-Search-Input{width:190px}.Rk-Bins-Search-Input{width:235px}.Rk-Search-Select{display:inline-block;position:relative;width:45px;border-width:1px;border-color:#003050;border-style:solid none;cursor:pointer;height:25px;background:#fff url(../img/more.png) 30px 10px no-repeat}.Rk-Search-Select:hover{background-color:#3030FF}.Rk-Search-Current{width:40px;height:20px;margin:2px;background-repeat:no-repeat}.Rk-Search-List{width:180px;margin-left:15px;font-size:13px;position:absolute;right:0;top:25px;background:#fff;box-shadow:1px 1px 2px #505050;display:none;border:1px solid #ccc;z-index:2}.Rk-Search-List li{padding:2px 2px 2px 30px;border-top:1px solid #ccc;height:16px;background-color:#fff;background-repeat:no-repeat;cursor:pointer}.Rk-Search-List li:hover{background-color:#3030ff;color:#fff}.Rk-Search-Submit{border:1px solid #003050;height:27px;width:30px;border-top-right-radius:5px;border-bottom-right-radius:5px;background:#333 center no-repeat url(../img/search.png);cursor:pointer}.Rk-Search-Submit:hover{background-color:#999}.Rk-Bin-Title{background:#333;background:-moz-linear-gradient(top,#505050 20%,#1e1e1e 80%);background:-webkit-linear-gradient(top,#505050 20%,#1e1e1e 80%);background:-ms-linear-gradient(top,#505050 20%,#1e1e1e 80%);font-weight:700;font-size:14px;padding:5px;cursor:pointer;color:#f0f0f0;margin:0;border:0 none}.Rk-Bin-Close{float:right;display:block;font-size:16px;font-weight:700;margin:2px 3px 0;color:#f0f0f0;cursor:pointer;text-shadow:-1px -1px 1px #999,1px 1px 1px #000;text-decoration:none}.Rk-Bin-Close:hover{color:#ffff80}.Rk-Bin-Title:hover{color:#ffffe0;background:#505050;background:-moz-linear-gradient(top,#141414 20%,#3c3c3c 80%);background:-webkit-linear-gradient(top,#141414 20%,#3c3c3c 80%);background:-ms-linear-gradient(top,#141414 20%,#3c3c3c 80%)}.Rk-Bin-Refresh{width:18px;height:17px;background:url(../img/refresh.png);display:block;float:right;margin-top:4px}.Rk-Bin-Refresh:hover{background-position:-18px 0}.Rk-Bin-Count{float:right;background:#c000a0;color:#FFF;text-shadow:1px 1px 1px #000;display:none;border-radius:4px;padding:1px 3px;font-size:10px;font-weight:700;margin-top:4px}.Rk-Bin-Title-Icon{float:left;width:25px;margin:2px}.Rk-Bin-Main{overflow:auto;background:#fff;background:-moz-linear-gradient(top,#e0e0e0 0,#FFF 2%,#FFF 98%,#e0e0e0 100%);background:-webkit-linear-gradient(top,#e0e0e0 0,#FFF 2%,#FFF 98%,#e0e0e0 100%);background:-ms-linear-gradient(top,#e0e0e0 0,#FFF 2%,#FFF 98%,#e0e0e0 100%)}.Rk-Bin-Item{cursor:move}.Rk-Bin-Item.hover,.Rk-Bin-Item:hover{background:-moz-linear-gradient(top,rgba(0,0,0,.1)20%,rgba(128,128,128,.1)80%);background:-webkit-linear-gradient(top,rgba(0,0,0,.1)20%,rgba(128,128,128,.1)80%);background:-ms-linear-gradient(top,rgba(0,0,0,.1)20%,rgba(128,128,128,.1)80%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d0d0d0', endColorstr='#f3f3f3', GradientType=0)}.Rk-Bin-Item.selected{background:#ffffc0}.Rk-Bin-Main li{padding:2px;border-bottom:1px solid #ccc;clear:both;overflow:hidden}.Rk-Bin-Main h3{font-size:14px;font-style:italic;font-weight:700;text-align:center}.Rk-Bin-Main h4{font-size:12px;font-weight:700}.Rk-Bin-Main p{font-size:11px}.Rk-Bin-Main h4 a{color:#303080}.Rk-Bin-Main .searchmatch{background:#ffff80}.Rk-Wikipedia-Search-Icon{background-image:url(../img/search-logos.png)}.Rk-Wikipedia-Icon{float:left;margin:3px;max-height:48px;max-width:48px}.Rk-Wikipedia-Title-Icon{height:20px;background:url(../img/search-logos.png)}.Rk-Wikipedia-Lang-en{background-position:0 -20px}.Rk-Wikipedia-Lang-fr{background-position:0 -40px}.Rk-Wikipedia-Lang-ja{background-position:0 -60px}.Rk-Wikipedia-Result{min-height:51px}.Rk-Wikipedia-Result h4,.Rk-Wikipedia-Result p{margin-left:54px}.Rk-ResourceList-Image{float:left;max-width:100px;max-height:75px;margin-right:2px}.Rk-Ldt-Icon,.Rk-Ldt-Title-Icon{background:url(../img/search-logos.png);background-position:0 -100px;background-repeat:no-repeat}.Rk-Ldt-Title-Icon{height:20px;margin-top:4px}.Rk-Ldt-Tag-Icon{float:left;margin:0 2px 0 0}.Rk-Ldt-Annotation-Icon{float:left;margin:3px}.Rk-Clear{clear:both}h4.Rk-Bin-Loading{margin:10px;text-align:center;font-size:20px;color:#999}
\ No newline at end of file
--- a/server/php/basic/public_html/static/lib/renkan/css/space-editor.css	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/php/basic/public_html/static/lib/renkan/css/space-editor.css	Tue Sep 15 17:08:53 2015 +0200
@@ -24,7 +24,7 @@
  *  knowledge of the CeCILL-C license and that you accept its terms.
  */
 
-/*! renkan - v0.12.1 - Copyright © IRI 2015 */
+/*! renkan - v - Copyright © IRI 2015 */
 
 html {
     overflow: visible !important;
--- a/server/php/basic/public_html/static/lib/renkan/css/space-editor.min.css	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/php/basic/public_html/static/lib/renkan/css/space-editor.min.css	Tue Sep 15 17:08:53 2015 +0200
@@ -24,7 +24,7 @@
  *  knowledge of the CeCILL-C license and that you accept its terms.
  */
 
-/*! renkan - v0.12.1 - Copyright © IRI 2015 */
+/*! renkan - v - Copyright © IRI 2015 */
 
 
 html{overflow:visible!important}body{font-family:Arial,Helvetica,sans-serif;background:#F6F6F6;color:#333}.clearer{display:block;clear:both;height:1px}h1{margin-bottom:5px;padding:0 15px;background:#333;color:#fff;font-weight:700;font-size:30px;line-height:60px}.right{width:301px;position:absolute;top:10px;right:10px}.main{margin:10px 330px 10px 20px}.blue-button{display:inline-block;padding:4px 6px;color:#fff;text-decoration:none;border-radius:4px;background:-moz-linear-gradient(top,#6080c0,#2040a0);background:-webkit-linear-gradient(top,#6080c0,#2040a0);box-shadow:1px 1px 2px gray}.blue-button:hover{background:-moz-linear-gradient(top,#2040a0,#6080c0);background:-webkit-linear-gradient(top,#2040a0,#6080c0)}.update-preview{text-align:center;display:block;margin-bottom:10px;font-size:24px;font-weight:700;line-height:34px}#preview{position:relative;border-left:1px solid #000;border-bottom:1px solid #000;width:300px;height:800px;border-radius:4px;overflow:hidden;margin-bottom:10px}.section-title{font-size:20px;font-weight:700;margin:20px 0 5px}.first-level-list{margin:5px 0}.add-item{margin:5px 0;font-size:22px;font-weight:700;line-height:18px}.add-item:hover:after{float:right;font-size:14px;font-weight:400;line-height:18px;margin-left:4px}.add-search-engine:hover:after{content:"Add Search Engine"}.add-resource:hover:after{content:"Add Resource"}.add-bin:hover:after{content:"Add Bin"}.item{padding:5px;margin:5px 0;border-radius:4px;font-size:12px;background:-moz-linear-gradient(top,#ffcc8f,#fff0d0);background:-webkit-linear-gradient(top,#ffcc8f,#fff0d0);box-shadow:1px 1px 2px gray}.remove-item{float:right;font-size:22px;line-height:18px;height:18px;margin:0 0 2px -10px;font-weight:700}.setting{float:left;width:260px;margin:2px 15px 2px 2px;line-height:24px;min-height:24px}.setting label{float:left;display:block;width:100px;font-weight:700}.display-value{float:left;display:block;width:160px}.edit-value{width:160px;display:none;border:1px solid #ccc;border-radius:3px}input.edit-value,textarea.edit-value{width:154px;padding:2px}textarea.edit-value{resize:vertical;height:72px}.item-editing .display-value{display:none}.item-editing .edit-value{display:inline-block}.resource-list-title{clear:both;width:100%;font-size:16px;font-weight:700;margin:5px 0 0}.resource{display:block;clear:both;padding:5px;margin:5px;border-radius:4px;background:-moz-linear-gradient(top,#ff8f00,#ffcc8f);background:-webkit-linear-gradient(top,#ff8f00,#ffcc8f);box-shadow:1px 1px 2px gray}.resource .display-value{display:inline-block}.resource .edit-value,.resource.resource-editing .display-value{display:none}.resource.resource-editing .edit-value{display:inline-block}
\ No newline at end of file
--- a/server/php/basic/public_html/static/lib/renkan/js/renkan.js	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/php/basic/public_html/static/lib/renkan/js/renkan.js	Tue Sep 15 17:08:53 2015 +0200
@@ -24,7 +24,7 @@
  *  knowledge of the CeCILL-C license and that you accept its terms.
  */
 
-/*! renkan - v0.12.1 - Copyright © IRI 2015 */
+/*! renkan - v - Copyright © IRI 2015 */
 
 this["renkanJST"] = this["renkanJST"] || {};
 
@@ -413,9 +413,17 @@
 __e(renkan.translate("Edit Node")) +
 '</span>\n</h2>\n<p>\n    <label>' +
 __e(renkan.translate("Title:")) +
-'</label>\n    <input class="Rk-Edit-Title" type="text" value="' +
+'</label>\n    ';
+ if (options.show_node_editor_title_richtext) { ;
+__p += '\n        <div class="Rk-Edit-Title" contenteditable="true">' +
+((__t = (node.title)) == null ? '' : __t) +
+'</div>\n    ';
+ } else { ;
+__p += '\n        <input class="Rk-Edit-Title" type="text" value="' +
 __e(node.title) +
-'" />\n</p>\n';
+'" />\n    ';
+ } ;
+__p += '    \n</p>\n';
  if (options.show_node_editor_uri) { ;
 __p += '\n    <p>\n        <label>' +
 __e(renkan.translate("URI:")) +
@@ -608,7 +616,7 @@
 __e( shortenText(node.created_by_title, 25) ) +
 '\n    </p>\n';
  } ;
-__p += '\n    <a href="#?idnode=' +
+__p += '\n    <a href="#?idNode=' +
 __e(node._id) +
 '">' +
 __e(renkan.translate("Link to the node")) +
@@ -964,9 +972,9 @@
         });
 
         this.read_only = this.options.read_only || !this.options.editor_mode;
-        
+
         this.router = new Rkns.Router();
-        
+
         this.project = new Rkns.Models.Project();
         this.dataloader = new Rkns.DataLoader.Loader(this.project, this.options);
 
@@ -1410,8 +1418,7 @@
             _path.segments[4].point.y = _path.segments[5].point.y = _bottom;
             _path.segments[1].point.y = _coords.y - _options.tooltip_arrow_width / 2;
             _path.segments[6].point.y = _coords.y + _options.tooltip_arrow_width / 2;
-            _path.closed = true;
-            _path.fillColor = new paper.GradientColor(new paper.Gradient([_options.tooltip_top_color, _options.tooltip_bottom_color]), [0, _top], [0, _bottom]);
+            _path.fillColor = new paper.Color(new paper.Gradient([_options.tooltip_top_color, _options.tooltip_bottom_color]), [0, _top], [0, _bottom]);
             _selector.css({
                 left: (_options.tooltip_padding + Math.min(_left, _right)),
                 top: (_options.tooltip_padding + _top)
@@ -1455,14 +1462,13 @@
         index: function (parameters) {
             
             var result = {};
-            if (parameters === null){
-                return;
-            }
-            parameters.split("&").forEach(function(part) {
-              var item = part.split("=");
-              result[item[0]] = decodeURIComponent(item[1]);
-            });
-            this.trigger('router', result);            
+            if (parameters !== null){
+                parameters.split("&").forEach(function(part) {
+                    var item = part.split("=");
+                    result[item[0]] = decodeURIComponent(item[1]);
+                });
+            }
+            this.trigger('router', result);        
         }  
     });
 
@@ -1933,7 +1939,7 @@
     show_top_bar: true,
         /* Show the top bar, (title, buttons, users) */
     default_user_color: "#303030",
-    size_bug_fix: true,
+    size_bug_fix: false,
         /* Resize the canvas after load (fixes a bug on iPad and FF Mac) */
     force_resize: false,
     allow_double_click: true,
@@ -1954,6 +1960,10 @@
     default_view: false,
         /* Allows to load default view (zoom+offset) at start on read_only mode, instead of autoScale. the default_view will be the last */
 
+    /* URL parsing */
+    update_url:true,
+        /* update the url each time the paper shift or on zoom in/out, with the serialized view (offset and scale) */
+    
 
     /* TOP BAR BUTTONS */
     show_search_field: true,
@@ -2018,15 +2028,15 @@
         /* Maximum displayed text length */
     label_untitled_nodes: "(untitled)",
         /* Label to display on untitled nodes */
-    hide_nodes: true, 
+    hide_nodes: true,
         /* allow hide/show nodes */
     change_shapes: true,
         /* Change shapes enabled */
     change_types: true,
     /* Change type enabled */
-    
+
     /* NODE EDITOR TEMPLATE*/
-    
+
     node_editor_templates: {
         "default": "templates/nodeeditor_readonly.html",
         "video": "templates/nodeeditor_video.html"
@@ -2059,6 +2069,7 @@
     tooltip_bottom_color: "#d0d0d0",
     tooltip_border_color: "#808080",
     tooltip_border_width: 1,
+    tooltip_opacity: 0.8,
 
     richtext_editor_config: {
         toolbarGroups: [
@@ -2073,8 +2084,10 @@
     /* NODE EDITOR OPTIONS */
 
     show_node_editor_uri: true,
+    show_node_editor_title: true,
     show_node_editor_description: true,
     show_node_editor_description_richtext: true,
+    show_node_editor_title_richtext: true,
     show_node_editor_size: true,
     show_node_editor_style: true,
     show_node_editor_style_color: true,
@@ -2235,7 +2248,6 @@
                 saveStatus : 0
             });
             _renkan.renderer.redrawActive = true;
-            _renkan.renderer.fixSize();
         });
     };
     var _save = function() {
@@ -2261,6 +2273,9 @@
     var _thrSave = Rkns._.throttle(function() {
         setTimeout(_save, 100);
     }, 1000);
+    
+    //TODO: Rearrange to avoid the 2 firts PUT due to a change in the project model
+    // Take car of setting up the listener correctly to listen the save action on the view
     _proj.on("add:nodes add:edges add:users add:views", function(_model) {
         _model.on("change remove", function(_model) {
             _thrSave();
@@ -2299,13 +2314,14 @@
             url: _opts.url,
             data: getdata,
             beforeSend: function(){
+                _renkan.renderer.redrawActive = false;
             	_proj.set({loadingStatus:true});
             },
             success: function(_data) {
                 _renkan.dataloader.load(_data);
                 _proj.set({loadingStatus:false});
                 _proj.set({saveStatus:0});
-                _renkan.renderer.autoScale();
+                _renkan.renderer.redrawActive = true;
             }
         });
     };
@@ -2818,7 +2834,7 @@
 
 
 define('renderer/baserepresentation',['jquery', 'underscore'], function ($, _) {
-    'use strict';
+    
 
     /* Rkns.Renderer._BaseRepresentation Class */
 
@@ -2903,7 +2919,7 @@
 });
 
 define('requtils',[], function ($, _) {
-    'use strict';
+    
     return {
         getUtils: function(){
             return window.Rkns.Utils;
@@ -2917,7 +2933,7 @@
 
 
 define('renderer/basebutton',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -2935,7 +2951,9 @@
             this.sector.show();
         },
         hide: function() {
-            this.sector.hide();
+            if (this.sector){
+                this.sector.hide();                
+            }
         },
         select: function() {
             this.sector.select();
@@ -2957,7 +2975,7 @@
 
 
 define('renderer/shapebuilder',[], function () {
-    'use strict';
+    
 
     var cloud_path = "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";
     /* ShapeBuilder Begin */
@@ -3072,7 +3090,7 @@
 });
 
 define('renderer/noderepr',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation', 'renderer/shapebuilder'], function ($, _, requtils, BaseRepresentation, ShapeBuilder) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -3169,7 +3187,7 @@
             if (!this.is_dragging || !this.paper_coords) {
                 this.paper_coords = this.renderer.toPaperCoords(_model_coords);
             }
-            this.circle_radius = _baseRadius * this.renderer.scale;
+            this.circle_radius = _baseRadius * this.renderer.view.scale;
             if (this.last_circle_radius !== this.circle_radius) {
                 this.all_buttons.forEach(function(b) {
                     b.setSectorSize();
@@ -3420,7 +3438,7 @@
                     this.redraw();
                 }
             } else {
-                this.renderer.paperShift(_delta);
+                this.renderer.view.paperShift(_delta);
             }
         },
         openEditor: function() {
@@ -3482,8 +3500,7 @@
                 //when the mouse don't hover the node anymore, we hide it
                 if (this.hidden) {
                     this.hide();
-                }
-                else {
+                } else {
                     this.hideNeighbors();
                 }
                 this._super("unselect");
@@ -3528,6 +3545,7 @@
                 this.title.css('opacity', this.options.ghost_opacity);
                 this.minimap_circle.opacity = this.options.ghost_opacity;
             } else {
+                this.minimap_circle.opacity = 1; 
                 this.hidden = false;
                 this.redraw();
             }
@@ -3575,9 +3593,9 @@
                         if (repr && repr.hidden) {
                             repr.show(ghost);
                             if (!ghost){
-                                var indexNode = _this.renderer.hiddenNodes.indexOf(repr.model.id);
+                                var indexNode = _this.renderer.view.hiddenNodes.indexOf(repr.model.id);
                                 if (indexNode !== -1){
-                                    _this.renderer.hiddenNodes.splice(indexNode, 1);
+                                    _this.renderer.view.hiddenNodes.splice(indexNode, 1);
                                 }
                             }
                         }
@@ -3624,9 +3642,9 @@
                 this.saveCoords();
             } else {
                 if (this.hidden) {
-                    var index = this.renderer.hiddenNodes.indexOf(this.model.id);
+                    var index = this.renderer.view.hiddenNodes.indexOf(this.model.id);
                     if (index !== -1){
-                        this.renderer.hiddenNodes.splice(index, 1);
+                        this.renderer.view.hiddenNodes.splice(index, 1);
                     }
                     this.show(false);
                     this.select();
@@ -3663,7 +3681,7 @@
 
 
 define('renderer/edge',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -3961,7 +3979,7 @@
 
 
 define('renderer/tempedge',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4061,7 +4079,7 @@
 
 
 define('renderer/baseeditor',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4078,14 +4096,14 @@
             this.editor_block.add.apply(this.editor_block, _pts);
             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_block.opacity = this.options.tooltip_opacity;
             this.editor_$ = $('<div>')
-            .appendTo(this.renderer.editor_$)
-            .css({
-                position: "absolute",
-                opacity: 0.8
-            })
-            .hide();
+                .appendTo(this.renderer.editor_$)
+                .css({
+                    position: "absolute",
+                    opacity: this.options.tooltip_opacity
+                })
+                .hide();
         },
         destroy: function() {
             this.editor_block.remove();
@@ -4101,7 +4119,7 @@
 
 
 define('renderer/nodeeditor',['jquery', 'underscore', 'requtils', 'renderer/baseeditor', 'renderer/shapebuilder', 'ckeditor-jquery'], function ($, _, requtils, BaseEditor, ShapeBuilder) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4155,6 +4173,9 @@
                 editorInstance = _this.options.show_node_editor_description_richtext ?
                     $(".Rk-Edit-Description").ckeditor(_this.options.richtext_editor_config) :
                     false,
+                editorInstanceTitle = _this.options.show_node_editor_title_richtext ?
+                    $(".Rk-Edit-Title").ckeditor(_this.options.richtext_editor_config) :
+                    false,
                 closeEditor = function() {
                     _this.renderer.removeRepresentation(_this);
                     paper.view.draw();
@@ -4179,6 +4200,14 @@
                         _editor.destroy();
                     }
                 }
+                if(_this.options.show_node_editor_title_richtext) {
+                    if(typeof editorInstanceTitle.editor !== 'undefined') {
+                        var _editor_title = editorInstanceTitle.editor;
+                        delete editorInstanceTitle.editor;
+                        _editor_title.focusManager.blur(true);
+                        _editor_title.destroy();
+                    }
+                }
             };
 
             this.editor_$.find(".Rk-CloseX").click(function (e) {
@@ -4197,9 +4226,7 @@
                 var onFieldChange = _.throttle(function() {
                   _.defer(function() {
                     if (_this.renderer.isEditable()) {
-                        var _data = {
-                            title: _this.editor_$.find(".Rk-Edit-Title").val()
-                        };
+                        var _data = {};
                         if (_this.options.show_node_editor_uri) {
                             _data.uri = _this.editor_$.find(".Rk-Edit-URI").val();
                             _this.editor_$.find(".Rk-Edit-Goto").attr("href",_data.uri || "#");
@@ -4220,6 +4247,18 @@
                                 _data.description = _this.editor_$.find(".Rk-Edit-Description").val();
                             }
                         }
+                        if (_this.options.show_node_editor_title) {
+                            if(_this.options.show_node_editor_title_richtext) {
+                                if(typeof editorInstanceTitle.editor !== 'undefined' &&
+                                        editorInstanceTitle.editor.checkDirty()) {
+                                    _data.title = editorInstanceTitle.editor.getData();
+                                    editorInstanceTitle.editor.resetDirty();
+                                }
+                            }
+                            else {
+                                _data.title = _this.editor_$.find(".Rk-Edit-Title").val();
+                            }
+                        }
                         if (_this.options.show_node_editor_style) {
                             var dash = _this.editor_$.find(".Rk-Edit-Dash").is(':checked');
                             _data.style = _.assign( ((_model.has("style") && _.clone(_model.get("style"))) || {}), {dash: dash});
@@ -4256,6 +4295,14 @@
                     editorInstance.editor.on("change", onFieldChange);
                     editorInstance.editor.on("blur", onFieldChange);
                 }
+                
+                if( _this.options.show_node_editor_title &&
+                    _this.options.show_node_editor_title_richtext &&
+                    typeof editorInstanceTitle.editor !== 'undefined')
+                {
+                    editorInstanceTitle.editor.on("change", onFieldChange);
+                    editorInstanceTitle.editor.on("blur", onFieldChange);
+                }
 
                 if(_this.options.allow_image_upload) {
                     this.editor_$.find(".Rk-Edit-Image-File").change(function() {
@@ -4406,7 +4453,7 @@
 
 
 define('renderer/edgeeditor',['jquery', 'underscore', 'requtils', 'renderer/baseeditor'], function ($, _, requtils, BaseEditor) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4599,7 +4646,7 @@
 
 
 define('renderer/nodebutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4651,7 +4698,7 @@
 
 
 define('renderer/nodeeditbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4684,7 +4731,7 @@
 
 
 define('renderer/noderemovebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4731,7 +4778,7 @@
 
 
 define('renderer/nodehidebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4754,7 +4801,7 @@
             this.renderer.is_dragging = false;
             this.renderer.removeRepresentationsOfType("editor");
             if (this.renderer.isEditable()) {
-                this.renderer.addHiddenNode(this.source_representation.model);
+                this.renderer.view.addHiddenNode(this.source_representation.model);
             }
         }
     }).value();
@@ -4767,7 +4814,7 @@
 
 
 define('renderer/nodeshowbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4803,7 +4850,7 @@
 
 
 define('renderer/noderevertbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4838,7 +4885,7 @@
 
 
 define('renderer/nodelinkbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4879,7 +4926,7 @@
 
 
 define('renderer/nodeenlargebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4914,7 +4961,7 @@
 
 
 define('renderer/nodeshrinkbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4949,7 +4996,7 @@
 
 
 define('renderer/edgeeditbutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4978,7 +5025,7 @@
 
 
 define('renderer/edgeremovebutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -5021,7 +5068,7 @@
 
 
 define('renderer/edgerevertbutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -5052,7 +5099,7 @@
 
 
 define('renderer/miniframe',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -5081,7 +5128,7 @@
 
 
 define('renderer/scene',['jquery', 'underscore', 'filesaver', 'requtils', 'renderer/miniframe'], function ($, _, filesaver, requtils, MiniFrame) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -5102,11 +5149,7 @@
         }
         this.notif_$ = this.$.find(".Rk-Notifications");
         paper.setup(this.canvas_$[0]);
-        this.scale = 1;
-        this.initialScale = 1;
-        this.offset = paper.view.center;
         this.totalScroll = 0;
-        this.hiddenNodes = [];
         this.mouse_down = false;
         this.click_target = null;
         this.selected_target = null;
@@ -5209,7 +5252,7 @@
                     _lastTap = new Date();
                     _lastTapX = _touches.pageX;
                     _lastTapY = _touches.pageY;
-                    _originalScale = _this.scale;
+                    _originalScale = _this.view.scale;
                     _zooming = false;
                     _this.onMouseDown(_touches, true);
                 }
@@ -5230,12 +5273,12 @@
                         return;
                     }
                     var _newScale = _event.originalEvent.scale * _originalScale,
-                    _scaleRatio = _newScale / _this.scale,
+                    _scaleRatio = _newScale / _this.view.scale,
                     _newOffset = new paper.Point([
                                                   _this.canvas_$.width(),
                                                   _this.canvas_$.height()
-                                                  ]).multiply( 0.5 * ( 1 - _scaleRatio ) ).add(_this.offset.multiply( _scaleRatio ));
-                    _this.setScale(_newScale, _newOffset);
+                                                  ]).multiply( 0.5 * ( 1 - _scaleRatio ) ).add(_this.view.offset.multiply( _scaleRatio ));
+                    _this.view.setScale(_newScale, _newOffset);
                 }
             },
             touchend: function(_event) {
@@ -5315,34 +5358,6 @@
             });
         };
 
-        bindClick(".Rk-ZoomOut", "zoomOut");
-        bindClick(".Rk-ZoomIn", "zoomIn");
-        bindClick(".Rk-ZoomFit", "autoScale");
-        this.$.find(".Rk-ZoomSave").click( function() {
-            // Save scale and offset point
-            _this.renkan.project.addView( { zoom_level:_this.scale, offset:_this.offset, hidden_nodes: _this.hiddenNodes } );
-        });
-        this.$.find(".Rk-ZoomSetSaved").click( function() {
-            var view = _this.renkan.project.get("views").last();
-            if(view){
-                _this.showNodes(false);
-                _this.setScale(view.get("zoom_level"), new paper.Point(view.get("offset")));
-                if (_this.renkan.options.hide_nodes){
-                    _this.hiddenNodes = (view.get("hidden_nodes") || []).concat();
-                    _this.hideNodes();                    
-                }
-            }
-        });
-        this.$.find(".Rk-ShowHiddenNodes").mouseenter( function() {
-            _this.showNodes(true);
-            _this.$.find(".Rk-ShowHiddenNodes").mouseleave( function() {
-                _this.hideNodes();
-            });
-        });
-        this.$.find(".Rk-ShowHiddenNodes").click( function() {
-            _this.showNodes(false);
-            _this.$.find(".Rk-ShowHiddenNodes").off( "mouseleave" );
-        });
         if(this.renkan.project.get("views").length > 0 && this.renkan.options.save_view){
             this.$.find(".Rk-ZoomSetSaved").show();
         }
@@ -5395,7 +5410,7 @@
                 _ratio = ratioW;
             }
 
-            _this.resizeZoom(ratioW, ratioH, _ratio);
+            _this.view.resizeZoom(ratioW, ratioH, _ratio);
 
             _this.redraw();
 
@@ -5404,7 +5419,7 @@
         var _thRedraw = _.throttle(function() {
             _this.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() {
@@ -5451,6 +5466,7 @@
             }
             else{
                 Backbone.history.start();
+                _thRedraw();
             }
         });
 
@@ -5599,12 +5615,12 @@
 
     _(Scene.prototype).extend({
         fixSize: function() {
-            if( this.renkan.options.default_view && this.renkan.project.get("views").length > 0) {
-                var view = this.renkan.project.get("views").last();
-                this.setScale(view.get("zoom_level"), new paper.Point(view.get("offset")));
+            if(typeof this.view === 'undefined') {
+                this.view = this.addRepresentation("View", this.renkan.project.get("views").last());
+                this.view.setScale(view.get("zoom_level"), new paper.Point(view.get("offset")));
             }
             else{
-                this.autoScale();
+                this.view.autoScale();
             }
         },
         drawSector: function(_repr, _inR, _outR, _startAngle, _endAngle, _padding, _imgname, _caption) {
@@ -5755,38 +5771,6 @@
             }
             this.redrawUsers();
         },
-        setScale: function(_newScale, _offset) {
-            if ((_newScale/this.initialScale) > Utils._MIN_SCALE && (_newScale/this.initialScale) < Utils._MAX_SCALE) {
-                this.scale = _newScale;
-                if (_offset) {
-                    this.offset = _offset;
-                }
-                this.redraw();
-            }
-        },
-        autoScale: function(force_view) {
-            var nodes = this.renkan.project.get("nodes");
-            if (nodes.length > 1) {
-                var _xx = nodes.map(function(_node) { return _node.get("position").x; }),
-                _yy = nodes.map(function(_node) { return _node.get("position").y; }),
-                _minx = Math.min.apply(Math, _xx),
-                _miny = Math.min.apply(Math, _yy),
-                _maxx = Math.max.apply(Math, _xx),
-                _maxy = Math.max.apply(Math, _yy);
-                var _scale = Math.min( (paper.view.size.width - 2 * this.renkan.options.autoscale_padding) / (_maxx - _minx), (paper.view.size.height - 2 * this.renkan.options.autoscale_padding) / (_maxy - _miny));
-                this.initialScale = _scale;
-                // Override calculated scale if asked
-                if((typeof force_view !== "undefined") && parseFloat(force_view.zoom_level)>0 && parseFloat(force_view.offset.x)>0 && parseFloat(force_view.offset.y)>0){
-                    this.setScale(parseFloat(force_view.zoom_level), new paper.Point(parseFloat(force_view.offset.x), parseFloat(force_view.offset.y)));
-                }
-                else{
-                    this.setScale(_scale, paper.view.center.subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale)));
-                }
-            }
-            if (nodes.length === 1) {
-                this.setScale(1, paper.view.center.subtract(new paper.Point([nodes.at(0).get("position").x, nodes.at(0).get("position").y])));
-            }
-        },
         redrawMiniframe: function() {
             var topleft = this.toMinimapCoords(this.toModelCoords(new paper.Point([0,0]))),
                 bottomright = this.toMinimapCoords(this.toModelCoords(paper.view.bounds.bottomRight));
@@ -5802,8 +5786,8 @@
                     _maxx = Math.max.apply(Math, _xx),
                     _maxy = Math.max.apply(Math, _yy);
                 var _scale = 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.view.scale * 0.8 * this.renkan.options.minimap_width / paper.view.bounds.width,
+                        this.view.scale * 0.8 * this.renkan.options.minimap_height / paper.view.bounds.height,
                         ( this.renkan.options.minimap_width - 2 * this.renkan.options.minimap_padding ) / (_maxx - _minx),
                         ( this.renkan.options.minimap_height - 2 * this.renkan.options.minimap_padding ) / (_maxy - _miny)
                 );
@@ -5817,19 +5801,19 @@
             this.redraw();
         },
         toPaperCoords: function(_point) {
-            return _point.multiply(this.scale).add(this.offset);
+            return _point.multiply(this.view.scale).add(this.view.offset);
         },
         toMinimapCoords: function(_point) {
             return _point.multiply(this.minimap.scale).add(this.minimap.offset).add(this.minimap.topleft);
         },
         toModelCoords: function(_point) {
-            return _point.subtract(this.offset).divide(this.scale);
+            return _point.subtract(this.view.offset).divide(this.view.scale);
         },
         addRepresentation: function(_type, _model) {
             var RendererType = requtils.getRenderer()[_type];
             var _repr = new RendererType(this, _model);
             this.representations.push(_repr);
-            return _repr;
+            return _repr;                
         },
         addRepresentations: function(_type, _collection) {
             var _this = this;
@@ -5945,7 +5929,7 @@
             _.each(this.representations, function(_representation) {
                 _representation.redraw({ dontRedrawEdges:true });
             });
-            if (this.minimap) {
+            if (this.minimap && typeof this.view !== 'undefined') {
                 this.redrawMiniframe();
             }
             paper.view.draw();
@@ -5957,40 +5941,6 @@
             _tmpEdge.redraw();
             this.click_target = _tmpEdge;
         },
-        addHiddenNode: function(_model){
-            this.hideNode(_model);
-            this.hiddenNodes.push(_model.id);
-        },
-        hideNode: function(_model){
-            var _this = this;
-            if (typeof _this.getRepresentationByModel(_model) !== 'undefined'){
-                _this.getRepresentationByModel(_model).hide();
-            }
-        },
-        hideNodes: function(){
-            var _this = this;
-            this.hiddenNodes.forEach(function(_id, index){
-                var node = _this.renkan.project.get("nodes").get(_id);
-                if (typeof node !== 'undefined'){
-                    return _this.hideNode(_this.renkan.project.get("nodes").get(_id));
-                }else{
-                    _this.hiddenNodes.splice(index, 1);
-                }
-            });
-            paper.view.draw();
-        },
-        showNodes: function(ghost){
-            var _this = this;
-            var i = 0;
-            this.hiddenNodes.forEach(function(_id){
-                i++;
-                _this.getRepresentationByModel(_this.renkan.project.get("nodes").get(_id)).show(ghost);
-            });
-            if (!ghost){
-                this.hiddenNodes = [];
-            }
-            paper.view.draw();
-        },
         findTarget: function(_hitResult) {
             if (_hitResult && typeof _hitResult.item.__representation !== "undefined") {
                 var _newTarget = _hitResult.item.__representation;
@@ -6008,10 +5958,6 @@
                 this.selected_target = null;
             }
         },
-        paperShift: function(_delta) {
-            this.offset = this.offset.add(_delta);
-            this.redraw();
-        },
         onMouseMove: function(_event) {
             var _off = this.canvas_$.offset(),
             _point = new paper.Point([
@@ -6028,7 +5974,7 @@
                 if (this.click_target && typeof this.click_target.paperShift === "function") {
                     this.click_target.paperShift(_delta);
                 } else {
-                    this.paperShift(_delta);
+                    this.view.paperShift(_delta);
                 }
             } else {
                 this.findTarget(_hitResult);
@@ -6101,6 +6047,7 @@
                 if (_isTouch) {
                     this.unselectAll();
                 }
+                this.view.updateUrl();
             }
             paper.view.draw();
         },
@@ -6111,11 +6058,11 @@
                 _delta = new paper.Point([
                                           _event.pageX - _off.left,
                                           _event.pageY - _off.top
-                                          ]).subtract(this.offset).multiply( Math.SQRT2 - 1 );
+                                          ]).subtract(this.view.offset).multiply( Math.SQRT2 - 1 );
                 if (this.totalScroll > 0) {
-                    this.setScale( this.scale * Math.SQRT2, this.offset.subtract(_delta) );
+                    this.view.setScale( this.view.scale * Math.SQRT2, this.view.offset.subtract(_delta) );
                 } else {
-                    this.setScale( this.scale * Math.SQRT1_2, this.offset.add(_delta.divide(Math.SQRT2)));
+                    this.view.setScale( this.view.scale * Math.SQRT1_2, this.view.offset.add(_delta.divide(Math.SQRT2)));
                 }
                 this.totalScroll = 0;
             }
@@ -6315,30 +6262,6 @@
                 this.redraw();
             }
         },
-        zoomOut: function() {
-            var _newScale = this.scale * Math.SQRT1_2,
-            _offset = new paper.Point([
-                                       this.canvas_$.width(),
-                                       this.canvas_$.height()
-                                       ]).multiply( 0.5 * ( 1 - Math.SQRT1_2 ) ).add(this.offset.multiply( Math.SQRT1_2 ));
-            this.setScale( _newScale, _offset );
-        },
-        zoomIn: function() {
-            var _newScale = this.scale * Math.SQRT2,
-            _offset = new paper.Point([
-                                       this.canvas_$.width(),
-                                       this.canvas_$.height()
-                                       ]).multiply( 0.5 * ( 1 - Math.SQRT2 ) ).add(this.offset.multiply( Math.SQRT2 ));
-            this.setScale( _newScale, _offset );
-        },
-        resizeZoom: function(_scaleWidth, _scaleHeight, _ratio) {
-            var _newScale = this.scale * _ratio,
-                _offset = new paper.Point([
-                                       (this.offset.x * _scaleWidth),
-                                       (this.offset.y * _scaleHeight)
-                                       ]);
-            this.setScale( _newScale, _offset );
-        },
         addNodeBtn: function() {
             if (this.click_mode === Utils._CLICKMODE_ADDNODE) {
                 this.click_mode = false;
@@ -6406,9 +6329,40 @@
 
         },
         parameters: function(_params){
-            if (typeof _params.idnode !== 'undefined'){
-                this.unhighlightAll();
-                this.highlightModel(this.renkan.project.get("nodes").get(_params.idnode));                 
+            if ($.isEmptyObject(_params)){
+                this.view = this.addRepresentation("View", this.renkan.project.get("views").first());
+                this.view.autoScale();
+                return;
+            }
+            if (typeof _params.idView !== 'undefined' && typeof this.renkan.project.get("views").at(_params.idView) !== 'undefined'){
+                this.view = this.addRepresentation("View", this.renkan.project.get("views").at(_params.idView));
+            }
+            if (typeof _params.view !== 'undefined' && _params.view.split(",").length >= 3){
+                var viewParams = _params.view.split(",");
+                var params = {
+                        "project": this.renkan.project,
+                        "offset": {
+                            "x": parseFloat(viewParams[0]),
+                            "y": parseFloat(viewParams[1])
+                        },
+                        "zoom_level": parseFloat(viewParams[2])
+                };
+                if (this.view){
+                    this.view.setScale(params.zoom_level, new paper.Point(params.offset));
+                } else{
+                    this.view = this.addRepresentation("View", null);
+                    this.view.params = params;
+                    this.view.init();                    
+                }
+            }
+            if(!this.view){
+                this.view = this.addRepresentation("View", this.renkan.project.get("views").first());
+                this.view.autoScale();
+            }
+            //other parameters must go after because most of them depends on a view that must be initialize before
+            this.unhighlightAll();
+            if (typeof _params.idNode !== 'undefined'){
+                this.highlightModel(this.renkan.project.get("nodes").get(_params.idNode));                 
             }
         },
         foldBins: function() {
@@ -6438,7 +6392,7 @@
                 sizeAft = sizeBef+300;
                 foldBinsButton.html("&raquo;");
             }
-            _this.resizeZoom(1, 1, (sizeAft/sizeBef));
+            _this.view.resizeZoom(1, 1, (sizeAft/sizeBef));
         },
         save: function() { },
         open: function() { }
@@ -6450,6 +6404,224 @@
 
 });
 
+define('renderer/viewrepr',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
+    
+
+    var Utils = requtils.getUtils();
+
+    /* Rkns.Renderer.View Class */
+
+    /* The representation for the view. */
+
+    var ViewRepr = Utils.inherit(BaseRepresentation);
+
+    _(ViewRepr.prototype).extend({
+        _init: function() {
+            var _this = this;
+            this.$ = $(".Rk-Render");
+            this.type = "View";
+            this.hiddenNodes = [];
+            this.scale = 1;
+            this.initialScale = 1;
+            this.offset = paper.view.center;
+            this.params = {};
+            
+            if (this.model){
+                this.params = {
+                    "zoom_level": _this.model.get("zoom_level"),
+                    "offset": _this.model.get("offset"),
+                    "hidden_nodes": _this.model.get("hidden_nodes")
+                };
+            }
+                
+            this.init();
+            
+            var bindClick = function(selector, fname) {
+                _this.$.find(selector).click(function(evt) {
+                    _this[fname](evt);
+                    return false;
+                });
+            };
+            
+            bindClick(".Rk-ZoomOut", "zoomOut");
+            bindClick(".Rk-ZoomIn", "zoomIn");
+            bindClick(".Rk-ZoomFit", "autoScale");
+            
+            this.$.find(".Rk-ZoomSave").click( function() {
+                var offset = {
+                    "x": _this.offset.x,
+                    "y": _this.offset.y
+                };
+                //TODO: make the if else the same function
+                if (_this.model && _this.renkan.project.get("views").indexOf(_this.model) > 0){
+                    _this.model.set( { zoom_level:_this.scale, offset:offset, hidden_nodes: _this.hiddenNodes.concat() } );
+                }else{
+                    _this.model = _this.renkan.project.addView( { zoom_level:_this.scale, offset:offset, hidden_nodes: _this.hiddenNodes.concat() } );
+                }
+                _this.params = {
+                        "zoom_level": _this.model.get("zoom_level"),
+                        "offset": _this.model.get("offset"),
+                        "hidden_nodes": _this.model.get("hidden_nodes")
+                };
+                _this.updateUrl();
+            });
+            
+            this.$.find(".Rk-ZoomSetSaved").click( function() {
+                _this.setScale(_this.params.zoom_level, new paper.Point(_this.params.offset));
+                _this.showNodes(false);
+                if (_this.options.hide_nodes){
+                    _this.hiddenNodes = (_this.params.hidden_nodes || []).concat();
+                    _this.hideNodes();
+                }
+            });
+            
+            this.$.find(".Rk-ShowHiddenNodes").mouseenter( function() {
+                _this.showNodes(true);
+                _this.$.find(".Rk-ShowHiddenNodes").mouseleave( function() {
+                    _this.hideNodes();
+                });
+            });
+            this.$.find(".Rk-ShowHiddenNodes").click( function() {
+                _this.showNodes(false);
+                _this.$.find(".Rk-ShowHiddenNodes").off( "mouseleave" ); 
+            });
+            if(this.renkan.project.get("views").length > 0 && this.renkan.options.save_view){
+                this.$.find(".Rk-ZoomSetSaved").show();
+            }
+        },
+        redraw: function(options) {
+            //console.log("view : ", this.model.toJSON());
+        },
+        init: function(){
+            var _this = this;
+            _this.setScale(_this.params.zoom_level, new paper.Point(_this.params.offset));
+            _this.showNodes(false);
+            if (_this.options.hide_nodes){
+                _this.hiddenNodes = (_this.params.hidden_nodes || []).concat();
+                _this.hideNodes();
+            }
+        },
+        addHiddenNode: function(_model){
+            this.hideNode(_model);
+            this.hiddenNodes.push(_model.id);
+            this.updateUrl();
+        },
+        hideNode: function(_model){
+            if (typeof this.renderer.getRepresentationByModel(_model) !== 'undefined'){
+                this.renderer.getRepresentationByModel(_model).hide();
+            }
+        },
+        hideNodes: function(){
+            var _this = this;
+            this.hiddenNodes.forEach(function(_id, index){
+                var node = _this.renkan.project.get("nodes").get(_id);
+                if (typeof node !== 'undefined'){
+                    return _this.hideNode(_this.renkan.project.get("nodes").get(_id));
+                }else{
+                    _this.hiddenNodes.splice(index, 1);
+                }
+            });
+            paper.view.draw();
+        },
+        showNodes: function(ghost){
+            var _this = this;
+            this.hiddenNodes.forEach(function(_id){
+                _this.renderer.getRepresentationByModel(_this.renkan.project.get("nodes").get(_id)).show(ghost);
+            });
+            if (!ghost){
+                this.hiddenNodes = [];
+            }
+            paper.view.draw();
+        },
+        setScale: function(_newScale, _offset) {
+            if ((_newScale/this.initialScale) > Utils._MIN_SCALE && (_newScale/this.initialScale) < Utils._MAX_SCALE) {
+                this.scale = _newScale;
+                if (_offset) {
+                    this.offset = _offset;
+                }
+                this.renderer.redraw();
+                this.updateUrl();
+            }
+        },
+        zoomOut: function() {
+            var _newScale = this.scale * Math.SQRT1_2,
+            _offset = new paper.Point([
+                                       this.renderer.canvas_$.width(),
+                                       this.renderer.canvas_$.height()
+                                       ]).multiply( 0.5 * ( 1 - Math.SQRT1_2 ) ).add(this.offset.multiply( Math.SQRT1_2 ));
+            this.setScale( _newScale, _offset );
+        },
+        zoomIn: function() {
+            var _newScale = this.scale * Math.SQRT2,
+            _offset = new paper.Point([
+                                       this.renderer.canvas_$.width(),
+                                       this.renderer.canvas_$.height()
+                                       ]).multiply( 0.5 * ( 1 - Math.SQRT2 ) ).add(this.offset.multiply( Math.SQRT2 ));
+            this.setScale( _newScale, _offset );
+        },
+        resizeZoom: function(_scaleWidth, _scaleHeight, _ratio) {
+            var _newScale = this.scale * _ratio,
+                _offset = new paper.Point([
+                                       (this.offset.x * _scaleWidth),
+                                       (this.offset.y * _scaleHeight)
+                                       ]);
+            this.setScale( _newScale, _offset );
+        },
+        autoScale: function(force_view) {
+            var nodes = this.renkan.project.get("nodes");
+            if (nodes.length > 1) {
+                var _xx = nodes.map(function(_node) { return _node.get("position").x; }),
+                _yy = nodes.map(function(_node) { return _node.get("position").y; }),
+                _minx = Math.min.apply(Math, _xx),
+                _miny = Math.min.apply(Math, _yy),
+                _maxx = Math.max.apply(Math, _xx),
+                _maxy = Math.max.apply(Math, _yy);
+                var _scale = Math.min( (paper.view.size.width - 2 * this.renkan.options.autoscale_padding) / (_maxx - _minx), (paper.view.size.height - 2 * this.renkan.options.autoscale_padding) / (_maxy - _miny));
+                this.initialScale = _scale;
+                // Override calculated scale if asked
+                if((typeof force_view !== "undefined") && parseFloat(force_view.zoom_level)>0 && parseFloat(force_view.offset.x)>0 && parseFloat(force_view.offset.y)>0){
+                    this.setScale(parseFloat(force_view.zoom_level), new paper.Point(parseFloat(force_view.offset.x), parseFloat(force_view.offset.y)));
+                }
+                else{
+                    this.setScale(_scale, paper.view.center.subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale)));
+                }
+            }
+            if (nodes.length === 1) {
+                this.setScale(1, paper.view.center.subtract(new paper.Point([nodes.at(0).get("position").x, nodes.at(0).get("position").y])));
+            }
+        },
+        paperShift: function(_delta) {
+            this.offset = this.offset.add(_delta);
+            this.renderer.redraw();
+        },
+        updateUrl: function(){
+            if(this.options.update_url){
+                var result = {};
+                var parameters = Backbone.history.getFragment().split('?');
+                if (parameters.length > 1){
+                    parameters[1].split("&").forEach(function(part) {
+                        var item = part.split("=");
+                        result[item[0]] = decodeURIComponent(item[1]);
+                    });
+                }
+                result.view = Math.round(this.offset.x*1000)/1000 + ',' + Math.round(this.offset.y*1000)/1000 + ',' + Math.round(this.scale*1000)/1000;
+
+                if (this.renkan.project.get("views").indexOf(this.model) > -1){
+                    result.idView = this.renkan.project.get("views").indexOf(this.model);
+                } else {
+                    if (result.idView){
+                        delete result.idView;
+                    }
+                }
+                this.renkan.router.navigate("?" + decodeURIComponent($.param(result)), {trigger: false, replace: true});
+            }
+        },
+    }).value();
+
+    return ViewRepr;
+
+});
+
 
 //Load modules and use them
 if( typeof require.config === "function" ) {
@@ -6491,10 +6663,11 @@
          'renderer/edgeremovebutton',
          'renderer/edgerevertbutton',
          'renderer/miniframe',
-         'renderer/scene'
-         ], function(BaseRepresentation, BaseButton, NodeRepr, Edge, TempEdge, BaseEditor, NodeEditor, EdgeEditor, NodeButton, NodeEditButton, NodeRemoveButton, NodeHideButton, NodeShowButton, NodeRevertButton, NodeLinkButton, NodeEnlargeButton, NodeShrinkButton, EdgeEditButton, EdgeRemoveButton, EdgeRevertButton, MiniFrame, Scene){
-
-    'use strict';
+         'renderer/scene',
+         'renderer/viewrepr'
+         ], function(BaseRepresentation, BaseButton, NodeRepr, Edge, TempEdge, BaseEditor, NodeEditor, EdgeEditor, NodeButton, NodeEditButton, NodeRemoveButton, NodeHideButton, NodeShowButton, NodeRevertButton, NodeLinkButton, NodeEnlargeButton, NodeShrinkButton, EdgeEditButton, EdgeRemoveButton, EdgeRevertButton, MiniFrame, Scene, ViewRepr){
+
+    
 
     var Rkns = window.Rkns;
 
@@ -6507,6 +6680,7 @@
     Renderer._BaseButton = BaseButton;
     Renderer.Node = NodeRepr;
     Renderer.Edge = Edge;
+    Renderer.View = ViewRepr;
     Renderer.TempEdge = TempEdge;
     Renderer._BaseEditor = BaseEditor;
     Renderer.NodeEditor = NodeEditor;
--- a/server/php/basic/public_html/static/lib/renkan/js/renkan.min.js	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/php/basic/public_html/static/lib/renkan/js/renkan.min.js	Tue Sep 15 17:08:53 2015 +0200
@@ -24,12 +24,12 @@
  *  knowledge of the CeCILL-C license and that you accept its terms.
  */
 
-/*! renkan - v0.12.1 - Copyright © IRI 2015 */
+/*! renkan - v - Copyright © IRI 2015 */
 
 
-this.renkanJST=this.renkanJST||{},this.renkanJST["templates/colorpicker.html"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='<li data-color="'+(null==(__t=c)?"":__t)+'" style="background: '+(null==(__t=c)?"":__t)+'"></li>';return __p},this.renkanJST["templates/edgeeditor.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<h2>\n    <span class="Rk-CloseX">&times;</span>'+__e(renkan.translate("Edit Edge"))+"</span>\n</h2>\n<p>\n    <label>"+__e(renkan.translate("Title:"))+'</label>\n    <input class="Rk-Edit-Title" type="text" value="'+__e(edge.title)+'" />\n</p>\n',options.show_edge_editor_uri&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("URI:"))+'</label>\n        <input class="Rk-Edit-URI" type="text" value="'+__e(edge.uri)+'" />\n        <a class="Rk-Edit-Goto" href="'+__e(edge.uri)+'" target="_blank"></a>\n    </p>\n    ',options.properties.length&&(__p+="\n        <p>\n            <label>"+__e(renkan.translate("Choose from vocabulary:"))+'</label>\n            <select class="Rk-Edit-Vocabulary">\n                ',_.each(options.properties,function(a){__p+='\n                    <option class="Rk-Edit-Vocabulary-Class" value="">\n                        '+__e(renkan.translate(a.label))+"\n                    </option>\n                    ",_.each(a.properties,function(b){var c=a["base-uri"]+b.uri;__p+='\n                        <option class="Rk-Edit-Vocabulary-Property" value="'+__e(c)+'"\n                            ',c===edge.uri&&(__p+=" selected"),__p+=">\n                            "+__e(renkan.translate(b.label))+"\n                        </option>\n                    "}),__p+="\n                "}),__p+="\n            </select>\n        </p>\n")),__p+="\n",options.show_edge_editor_style&&(__p+='\n    <div class="Rk-Editor-p">\n      ',options.show_edge_editor_style_color&&(__p+='\n      <div id="Rk-Editor-p-color">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Edge color:"))+'</span>\n        <div class="Rk-Edit-ColorPicker-Wrapper">\n            <span class="Rk-Edit-Color" style="background: &lt;%-edge.color%>;">\n                <span class="Rk-Edit-ColorTip"></span>\n            </span>\n            '+(null==(__t=renkan.colorPicker)?"":__t)+'\n            <span class="Rk-Edit-ColorPicker-Text">'+__e(renkan.translate("Choose color"))+"</span>\n        </div>\n      </div>\n      "),__p+="\n      ",options.show_edge_editor_style_dash&&(__p+='\n      <div id="Rk-Editor-p-dash">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Dash:"))+'</span>\n        <input type="checkbox" name="Rk-Edit-Dash" class="Rk-Edit-Dash" '+__e(edge.dash)+" />\n      </div>\n      "),__p+="\n      ",options.show_edge_editor_style_thickness&&(__p+='\n      <div id="Rk-Editor-p-thickness">\n          <span class="Rk-Editor-Label">'+__e(renkan.translate("Thickness:"))+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Down">-</a>\n          <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Thickness-Value">'+__e(edge.thickness)+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Up">+</a>\n      </div>\n      '),__p+="\n      ",options.show_edge_editor_style_arrow&&(__p+='\n      <div id="Rk-Editor-p-arrow">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Arrow:"))+'</span>\n        <input type="checkbox" name="Rk-Edit-Arrow" class="Rk-Edit-Arrow" '+__e(edge.arrow)+" />\n      </div>\n      "),__p+="\n    </div>\n"),__p+="\n",options.show_edge_editor_direction&&(__p+='\n    <p>\n        <span class="Rk-Edit-Direction">'+__e(renkan.translate("Change edge direction"))+"</span>\n    </p>\n"),__p+="\n",options.show_edge_editor_nodes&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("From:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.from_color)+';"></span>\n        '+__e(shortenText(edge.from_title,25))+'\n    </p>\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("To:"))+'</span>\n        <span class="Rk-UserColor" style="background: >%-edge.to_color%>;"></span>\n        '+__e(shortenText(edge.to_title,25))+"\n    </p>\n"),__p+="\n",options.show_edge_editor_creator&&edge.has_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: &lt;%-edge.created_by_color%>;"></span>\n        '+__e(shortenText(edge.created_by_title,25))+"\n    </p>\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+='<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ',options.show_edge_tooltip_color&&(__p+='\n        <span class="Rk-UserColor" style="background: '+__e(edge.color)+';"></span>\n    '),__p+='\n    <span class="Rk-Display-Title">\n        ',edge.uri&&(__p+='\n            <a href="'+__e(edge.uri)+'" target="_blank">\n        '),__p+="\n        "+__e(edge.title)+"\n        ",edge.uri&&(__p+=" </a> "),__p+="\n    </span>\n</h2>\n",options.show_edge_tooltip_uri&&edge.uri&&(__p+='\n    <p class="Rk-Display-URI">\n        <a href="'+__e(edge.uri)+'" target="_blank">'+__e(edge.short_uri)+"</a>\n    </p>\n"),__p+="\n<p>"+(null==(__t=edge.description)?"":__t)+"</p>\n",options.show_edge_tooltip_nodes&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("From:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.from_color)+';"></span>\n        '+__e(shortenText(edge.from_title,25))+'\n    </p>\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("To:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.to_color)+';"></span>\n        '+__e(shortenText(edge.to_title,25))+"\n    </p>\n"),__p+="\n",options.show_edge_tooltip_creator&&edge.has_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.created_by_color)+';"></span>\n        '+__e(shortenText(edge.created_by_title,25))+"\n    </p>\n"),__p+="\n";return __p},this.renkanJST["templates/ldtjson-bin/annotationtemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Bin-Item" draggable="true"\n    data-image="'+__e(Rkns.Utils.getFullURL(image))+'"\n    data-uri="'+(null==(__t=ldt_platform)?"":__t)+"ldtplatform/ldt/front/player/"+(null==(__t=mediaid)?"":__t)+"/#id="+(null==(__t=annotationid)?"":__t)+'"\n    data-title="'+__e(title)+'" data-description="'+__e(description)+'">\n\n    <img class="Rk-Ldt-Annotation-Icon" src="'+(null==(__t=image)?"":__t)+'" />\n    <h4>'+(null==(__t=htitle)?"":__t)+"</h4>\n    <p>"+(null==(__t=hdescription)?"":__t)+"</p>\n    <p>Start: "+(null==(__t=start)?"":__t)+", End: "+(null==(__t=end)?"":__t)+", Duration: "+(null==(__t=duration)?"":__t)+'</p>\n    <div class="Rk-Clear"></div>\n</li>\n';return __p},this.renkanJST["templates/ldtjson-bin/segmenttemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Bin-Item" draggable="true"\n    data-image="'+__e(Rkns.Utils.getFullURL(image))+'"\n    data-uri="'+(null==(__t=ldt_platform)?"":__t)+"ldtplatform/ldt/front/player/"+(null==(__t=mediaid)?"":__t)+"/#id="+(null==(__t=annotationid)?"":__t)+'"\n    data-title="'+__e(title)+'" data-description="'+__e(description)+'">\n\n    <img class="Rk-Ldt-Annotation-Icon" src="'+(null==(__t=image)?"":__t)+'" />\n    <h4>'+(null==(__t=htitle)?"":__t)+"</h4>\n    <p>"+(null==(__t=hdescription)?"":__t)+"</p>\n    <p>Start: "+(null==(__t=start)?"":__t)+", End: "+(null==(__t=end)?"":__t)+", Duration: "+(null==(__t=duration)?"":__t)+'</p>\n    <div class="Rk-Clear"></div>\n</li>\n';return __p},this.renkanJST["templates/ldtjson-bin/tagtemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Bin-Item" draggable="true"\n    data-image="'+__e(Rkns.Utils.getFullURL(static_url+"img/ldt-tag.png"))+'"\n    data-uri="'+(null==(__t=ldt_platform)?"":__t)+"ldtplatform/ldt/front/search/?search="+(null==(__t=encodedtitle)?"":__t)+'&field=all"\n    data-title="'+__e(title)+'" data-description="Tag \''+__e(title)+'\'">\n\n    <img class="Rk-Ldt-Tag-Icon" src="'+__e(static_url)+'img/ldt-tag.png" />\n    <h4>'+(null==(__t=htitle)?"":__t)+'</h4>\n    <div class="Rk-Clear"></div>\n</li>\n';return __p},this.renkanJST["templates/list-bin.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<li class="Rk-Bin-Item Rk-ResourceList-Item" draggable="true"\n    data-uri="'+__e(url)+'" data-title="'+__e(title)+'"\n    data-description="'+__e(description)+'"\n    ',__p+=image?'\n        data-image="'+__e(Rkns.Utils.getFullURL(image))+'"\n    ':'\n        data-image=""\n    ',__p+="\n>",image&&(__p+='\n    <img class="Rk-ResourceList-Image" src="'+__e(image)+'" />\n'),__p+='\n<h4 class="Rk-ResourceList-Title">\n    ',url&&(__p+='\n        <a href="'+__e(url)+'" target="_blank">\n    '),__p+="\n    "+(null==(__t=htitle)?"":__t)+"\n    ",url&&(__p+="</a>"),__p+="\n    </h4>\n    ",description&&(__p+='\n        <p class="Rk-ResourceList-Description">'+(null==(__t=hdescription)?"":__t)+"</p>\n    "),__p+="\n    ",image&&(__p+='\n        <div style="clear: both;"></div>\n    '),__p+="\n</li>\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    <div class="Rk-Bins">\n        <div class="Rk-Bins-Head">\n            <h2 class="Rk-Bins-Title">'+__e(translate("Select contents:"))+'</h2>\n            <form class="Rk-Web-Search-Form Rk-Search-Form">\n                <input class="Rk-Web-Search-Input Rk-Search-Input" type="search"\n                    placeholder="'+__e(translate("Search the Web"))+'" />\n                <div class="Rk-Search-Select">\n                    <div class="Rk-Search-Current"></div>\n                    <ul class="Rk-Search-List"></ul>\n                </div>\n                <input type="submit" value=""\n                    class="Rk-Web-Search-Submit Rk-Search-Submit" title="'+__e(translate("Search the Web"))+'" />\n            </form>\n            <form class="Rk-Bins-Search-Form Rk-Search-Form">\n                <input class="Rk-Bins-Search-Input Rk-Search-Input" type="search"\n                    placeholder="'+__e(translate("Search in Bins"))+'" /> <input\n                    type="submit" value=""\n                    class="Rk-Bins-Search-Submit Rk-Search-Submit"\n                    title="'+__e(translate("Search in Bins"))+'" />\n            </form>\n        </div>\n        <ul class="Rk-Bin-List"></ul>\n    </div>\n'),__p+=" ",options.show_editor&&(__p+='\n    <div class="Rk-Render Rk-Render-',__p+=options.show_bins?"Panel":"Full",__p+='"></div>\n'),__p+="\n";return __p},this.renkanJST["templates/nodeeditor.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='\n<h2>\n    <span class="Rk-CloseX">&times;</span>'+__e(renkan.translate("Edit Node"))+"</span>\n</h2>\n<p>\n    <label>"+__e(renkan.translate("Title:"))+'</label>\n    <input class="Rk-Edit-Title" type="text" value="'+__e(node.title)+'" />\n</p>\n',options.show_node_editor_uri&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("URI:"))+'</label>\n        <input class="Rk-Edit-URI" type="text" value="'+__e(node.uri)+'" />\n        <a class="Rk-Edit-Goto" href="'+__e(node.uri)+'" target="_blank"></a>\n    </p>\n'),__p+=" ",options.change_types&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Types available"))+':</label>\n        <select class="Rk-Edit-Type">\n          ',_.each(types,function(a){__p+='\n            <option class="Rk-Edit-Vocabulary-Property" value="'+__e(a)+'"',node.type===a&&(__p+=" selected"),__p+=">\n                "+__e(renkan.translate(a.charAt(0).toUpperCase()+a.substring(1)))+"\n            </option>\n          "}),__p+="\n        </select>\n    </p>\n"),__p+=" ",options.show_node_editor_description&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Description:"))+"</label>\n        ",__p+=options.show_node_editor_description_richtext?'\n            <div class="Rk-Edit-Description" contenteditable="true">'+(null==(__t=node.description)?"":__t)+"</div>\n        ":'\n            <textarea class="Rk-Edit-Description">'+(null==(__t=node.description)?"":__t)+"</textarea>\n        ",__p+="\n    </p>\n"),__p+=" ",options.show_node_editor_size&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Size:"))+'</span>\n        <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Size-Down">-</a>\n        <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Size-Value">'+__e(node.size)+'</span>\n        <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Size-Up">+</a>\n    </p>\n'),__p+=" ",options.show_node_editor_style&&(__p+='\n    <div class="Rk-Editor-p">\n      ',options.show_node_editor_style_color&&(__p+='\n      <div id="Rk-Editor-p-color">\n        <span class="Rk-Editor-Label">\n        '+__e(renkan.translate("Node color:"))+'</span>\n        <div class="Rk-Edit-ColorPicker-Wrapper">\n            <span class="Rk-Edit-Color" style="background: '+__e(node.color)+';">\n                <span class="Rk-Edit-ColorTip"></span>\n            </span>\n            '+(null==(__t=renkan.colorPicker)?"":__t)+'\n            <span class="Rk-Edit-ColorPicker-Text">'+__e(renkan.translate("Choose color"))+"</span>\n        </div>\n      </div>\n      "),__p+="\n      ",options.show_node_editor_style_dash&&(__p+='\n      <div id="Rk-Editor-p-dash">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Dash:"))+'</span>\n        <input type="checkbox" name="Rk-Edit-Dash" class="Rk-Edit-Dash" '+__e(node.dash)+" />\n      </div>\n      "),__p+="\n      ",options.show_node_editor_style_thickness&&(__p+='\n      <div id="Rk-Editor-p-thickness">\n          <span class="Rk-Editor-Label">'+__e(renkan.translate("Thickness:"))+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Down">-</a>\n          <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Thickness-Value">'+__e(node.thickness)+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Up">+</a>\n      </div>\n      '),__p+="\n    </div>\n"),__p+=" ",options.show_node_editor_image&&(__p+='\n    <div class="Rk-Edit-ImgWrap">\n        <div class="Rk-Edit-ImgPreview">\n            <img src="'+__e(node.image||node.image_placeholder)+'" />\n            ',node.clip_path&&(__p+='\n                <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 1 1" preserveAspectRatio="none">\n                    <path style="stroke-width: .02; stroke:red; fill-opacity:.3; fill:red;" d="'+__e(node.clip_path)+'" />\n                </svg>\n            '),__p+="\n        </div>\n    </div>\n    <p>\n        <label>"+__e(renkan.translate("Image URL:"))+'</label>\n        <div>\n            <a class="Rk-Edit-Image-Del" href="#"></a>\n            <input class="Rk-Edit-Image" type="text" value=\''+__e(node.image)+"' />\n        </div>\n    </p>\n",options.allow_image_upload&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Choose Image File:"))+'</label>\n        <input class="Rk-Edit-Image-File" type="file" accept="image/*" />\n    </p>\n')),__p+=" ",options.show_node_editor_creator&&node.has_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(node.created_by_color)+';"></span>\n        '+__e(shortenText(node.created_by_title,25))+"\n    </p>\n"),__p+=" ",options.change_shapes&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Shapes available"))+':</label>\n        <select class="Rk-Edit-Shape">\n          ',_.each(shapes,function(a){__p+='\n            <option class="Rk-Edit-Vocabulary-Property" value="'+__e(a)+'"',node.shape===a&&(__p+=" selected"),__p+=">\n                "+__e(renkan.translate(a.charAt(0).toUpperCase()+a.substring(1)))+"\n            </option>\n          "}),__p+="\n        </select>\n    </p>\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+='<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ',options.show_node_tooltip_color&&(__p+='\n        <span class="Rk-UserColor" style="background: '+__e(node.color)+';"></span>\n    '),__p+='\n    <span class="Rk-Display-Title">\n        ',node.uri&&(__p+='\n            <a href="'+__e(node.uri)+'" target="_blank">\n        '),__p+="\n        "+__e(node.title)+"\n        ",node.uri&&(__p+="</a>"),__p+="\n    </span>\n</h2>\n",node.uri&&options.show_node_tooltip_uri&&(__p+='\n    <p class="Rk-Display-URI">\n        <a href="'+__e(node.uri)+'" target="_blank">'+__e(node.short_uri)+"</a>\n    </p>\n"),__p+=" ",options.show_node_tooltip_description&&(__p+='\n    <p class="Rk-Display-Description">'+(null==(__t=node.description)?"":__t)+"</p>\n"),__p+=" ",node.image&&options.show_node_tooltip_image&&(__p+='\n    <img class="Rk-Display-ImgPreview" src="'+__e(node.image)+'" />\n'),__p+=" ",node.has_creator&&options.show_node_tooltip_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(node.created_by_color)+';"></span>\n        '+__e(shortenText(node.created_by_title,25))+"\n    </p>\n"),__p+='\n    <a href="#?idnode='+__e(node._id)+'">'+__e(renkan.translate("Link to the node"))+"</a>\n";return __p},this.renkanJST["templates/nodeeditor_video.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ',options.show_node_tooltip_color&&(__p+='\n        <span class="Rk-UserColor" style="background: '+__e(node.color)+';"></span>\n    '),__p+='\n    <span class="Rk-Display-Title">\n        ',node.uri&&(__p+='\n            <a href="'+__e(node.uri)+'" target="_blank">\n        '),__p+="\n        "+__e(node.title)+"\n        ",node.uri&&(__p+="</a>"),__p+="\n    </span>\n</h2>\n",node.uri&&options.show_node_tooltip_uri&&(__p+='\n     <video width="320" height="240" controls>\n        <source src="'+__e(node.uri)+'" type="video/mp4">\n     </video> \n'),__p+='\n    <a href="#?idnode='+__e(node._id)+'">'+__e(renkan.translate("Link to the node"))+"</a>\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    <div class="Rk-TopBar">\n        <div class="loader"></div>\n        ',__p+=options.editor_mode?'\n            <input type="text" class="Rk-PadTitle" value="'+__e(project.get("title")||"")+'" placeholder="'+__e(translate("Untitled project"))+'" />\n        ':'\n            <h2 class="Rk-PadTitle">\n                '+__e(project.get("title")||translate("Untitled project"))+"\n            </h2>\n        ",__p+="\n        ",options.show_user_list&&(__p+='\n            <div class="Rk-Users">\n                <div class="Rk-CurrentUser">\n                    ',options.show_user_color&&(__p+='\n                        <div class="Rk-Edit-ColorPicker-Wrapper">\n                            <span class="Rk-CurrentUser-Color">\n                            ',options.user_color_editable&&(__p+='\n                                <span class="Rk-Edit-ColorTip"></span>\n                            '),__p+="\n                            </span>\n                            ",options.user_color_editable&&print(colorPicker),__p+="\n                        </div>\n                    "),__p+='\n                    <span class="Rk-CurrentUser-Name">&lt;unknown user&gt;</span>\n                </div>\n                <ul class="Rk-UserList"></ul>\n            </div>\n        '),__p+="\n        ",options.home_button_url&&(__p+='\n            <div class="Rk-TopBar-Separator"></div>\n            <a class="Rk-TopBar-Button Rk-Home-Button" href="'+__e(options.home_button_url)+'">\n                <div class="Rk-TopBar-Tooltip">\n                    <div class="Rk-TopBar-Tooltip-Contents">\n                        '+__e(translate(options.home_button_title))+"\n                    </div>\n                </div>\n            </a>\n        "),__p+="\n        ",options.show_fullscreen_button&&(__p+='\n            <div class="Rk-TopBar-Separator"></div>\n            <div class="Rk-TopBar-Button Rk-FullScreen-Button">\n                <div class="Rk-TopBar-Tooltip">\n                    <div class="Rk-TopBar-Tooltip-Contents">\n                        '+__e(translate("Full Screen"))+"\n                    </div>\n                </div>\n            </div>\n        "),__p+="\n        ",options.editor_mode?(__p+="\n            ",options.show_addnode_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-AddNode-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Add Node"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_addedge_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-AddEdge-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Add Edge"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_export_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Export-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Download Project"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_save_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Save-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents"></div>\n                    </div>\n                </div>\n            '),__p+="\n            ",options.show_open_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Open-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Open Project"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_bookmarklet&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <a class="Rk-TopBar-Button Rk-Bookmarklet-Button" href="#">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Renkan 'Drag-to-Add' bookmarklet"))+'\n                        </div>\n                    </div>\n                </a>\n                <div class="Rk-TopBar-Separator"></div>\n            '),__p+="\n        "):(__p+="\n            ",options.show_export_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Export-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Download Project"))+'\n                        </div>\n                    </div>\n                </div>\n                <div class="Rk-TopBar-Separator"></div>\n            '),__p+="\n        "),__p+="\n        ",options.show_search_field&&(__p+='\n            <form action="#" class="Rk-GraphSearch-Form">\n                <input type="search" class="Rk-GraphSearch-Field" placeholder="'+__e(translate("Search in graph"))+'" />\n            </form>\n            <div class="Rk-TopBar-Separator"></div>\n        '),__p+="\n    </div>\n"),__p+='\n<div class="Rk-Editing-Space',options.show_top_bar||(__p+=" Rk-Editing-Space-Full"),__p+='">\n    <div class="Rk-Labels"></div>\n    <canvas class="Rk-Canvas" ',options.resize&&(__p+=' resize="" '),__p+=' ></canvas>\n    <div class="Rk-Notifications"></div>\n    <div class="Rk-Editor">\n        ',options.show_bins&&(__p+='\n            <div class="Rk-Fold-Bins">&laquo;</div>\n        '),__p+="\n        ",options.show_zoom&&(__p+='\n            <div class="Rk-ZoomButtons">\n                <div class="Rk-ZoomIn" title="'+__e(translate("Zoom In"))+'"></div>\n                <div class="Rk-ZoomFit" title="'+__e(translate("Zoom Fit"))+'"></div>\n                <div class="Rk-ZoomOut" title="'+__e(translate("Zoom Out"))+'"></div>\n                ',options.editor_mode&&options.save_view&&(__p+='\n                    <div class="Rk-ZoomSave" title="'+__e(translate("Save view"))+'"></div>\n                '),__p+="\n                ",options.save_view&&(__p+='\n                    <div class="Rk-ZoomSetSaved" title="'+__e(translate("View saved view"))+'"></div>\n                    ',options.hide_nodes&&(__p+='\n                	   <div class="Rk-ShowHiddenNodes" title="'+__e(translate("Show hidden nodes"))+'"></div>\n                    '),__p+="       \n                "),__p+="\n            </div>\n        "),__p+="\n    </div>\n</div>\n";return __p},this.renkanJST["templates/search.html"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='<li class="'+(null==(__t=className)?"":__t)+'" data-key="'+(null==(__t=key)?"":__t)+'">'+(null==(__t=title)?"":__t)+"</li>";return __p},this.renkanJST["templates/wikipedia-bin/resulttemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Wikipedia-Result Rk-Bin-Item" draggable="true"\n    data-uri="'+__e(url)+'" data-title="Wikipedia: '+__e(title)+'"\n    data-description="'+__e(description)+'"\n    data-image="'+__e(Rkns.Utils.getFullURL(static_url+"img/wikipedia.png"))+'">\n\n    <img class="Rk-Wikipedia-Icon" src="'+__e(static_url)+'img/wikipedia.png">\n    <h4 class="Rk-Wikipedia-Title">\n        <a href="'+__e(url)+'" target="_blank">'+(null==(__t=htitle)?"":__t)+'</a>\n    </h4>\n    <p class="Rk-Wikipedia-Snippet">'+(null==(__t=hdescription)?"":__t)+"</p>\n</li>\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.$("<li>").addClass("Rk-Bin").appendTo(a.$.find(".Rk-Bin-List")),this.title_icon_$=b.$("<span>").addClass("Rk-Bin-Title-Icon").appendTo(this.$);var d=this;b.$("<a>").attr({href:"#",title:a.translate("Close bin")}).addClass("Rk-Bin-Close").html("&times;").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.$("<a>").attr({href:"#",title:a.translate("Refresh bin")}).addClass("Rk-Bin-Refresh").appendTo(this.$).click(function(){return d.refresh(),!1}),this.count_$=b.$("<div>").addClass("Rk-Bin-Count").appendTo(this.$),this.title_$=b.$("<h2>").addClass("Rk-Bin-Title").appendTo(this.$),this.main_$=b.$("<div>").addClass("Rk-Bin-Main").appendTo(this.$).html('<h4 class="Rk-Bin-Loading">'+a.translate("Loading, please wait")+"</h4>"),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'<ul class="Rk-Edit-ColorPicker">'+b.pickerColors.map(function(b){return a({c:b})}).join("")+"</ul>"}(),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.left+d&&b.pageY>=c.top&&b.pageY<c.top+f)if(k)e.renderer.onMouseMove(b,!0);else{k=!0;var g=document.createElement("div");g.appendChild(this.cloneNode(!0)),e.renderer.dropData({"text/html":g.innerHTML},b),e.renderer.onMouseDown(b,!0)}}).on("touchend",".Rk-Bin-Item",function(a){k&&e.renderer.onMouseUp(a.originalEvent.changedTouches[0],!0),k=!1}).on("dragstart",".Rk-Bin-Item",function(a){var b=document.createElement("div");b.appendChild(this.cloneNode(!0));try{a.originalEvent.dataTransfer.setData("text/html",b.innerHTML)}catch(c){a.originalEvent.dataTransfer.setData("text",b.innerHTML)}}),b.$(window).resize(function(){e.resizeBins()});var l=!1,m="";this.$.find(".Rk-Bins-Search-Input").on("change keyup paste input",function(){var a=b.$(this).val();if(a!==m){var c=b.Utils.regexpFromTextOrArray(a.length>1?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;d<b.length;d++)c+="."+b[d];this.$.find(".Rk-Web-Search-Input.Rk-Search-Input").attr("placeholder",this.translate("Search in ")+this.$.find(".Rk-Search-List "+c).html())},f.prototype.resizeBins=function(){var a=+this.$.find(".Rk-Bins-Head").outerHeight();this.$.find(".Rk-Bin-Title:visible").each(function(){a+=b.$(this).outerHeight()}),this.$.find(".Rk-Bin-Main").css({height:this.$.find(".Rk-Bins").height()-a})};var g=function(){return"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)})};b.Utils={getUUID4:g,getUID:function(){function a(a){return 10>a?"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<e.length;j++){j&&(i+=f+"*");var k=e[j];d.each(c,b(k)),i+=k}return i}function b(c){switch(typeof c){case"string":return a(c);case"object":var e="";return d.each(c,function(a){var c=b(a);c&&(e&&(e+="|"),e+=c)}),e}return""}var c=["[aáàâä]","[cç]","[eéèêë]","[iíìîï]","[oóòôö]","[uùûü]"],e=[String.fromCharCode(768),String.fromCharCode(769),String.fromCharCode(770),String.fromCharCode(771),String.fromCharCode(807),"{","}","(",")","[","]","【","】","、","・","‥","。","「","」","『","』","〜",":","!","?"," ",","," ",";","(",")",".","*","+","\\","?","|","{","}","[","]","^","#","/"],f="[\\"+e.join("\\")+"]",g=new RegExp(f,"gm"),h=d.map(c,function(a){return new RegExp(a)});return function(a){var c=b(a);if(c){var d=new RegExp(c,"im"),e=new RegExp("("+c+")","igm");return{isempty:!1,source:c,test:function(a){return d.test(a)},replace:function(a,b){return a.replace(e,b)}}}return{isempty:!0,source:"",test:function(){return!0},replace:function(a){return text}}}}(),_MIN_DRAG_DISTANCE:2,_NODE_BUTTON_WIDTH:40,_EDGE_BUTTON_INNER:2,_EDGE_BUTTON_OUTER:40,_CLICKMODE_ADDNODE:1,_CLICKMODE_STARTEDGE:2,_CLICKMODE_ENDEDGE:3,_NODE_SIZE_STEP:Math.LN2/4,_MIN_SCALE:.05,_MAX_SCALE:20,_MOUSEMOVE_RATE:80,_DOUBLETAP_DELAY:800,_DOUBLETAP_DISTANCE:400,_USER_PLACEHOLDER:function(a){return{color:a.options.default_user_color,title:a.translate("(unknown user)"),get:function(a){return this[a]||!1}}},_BOOKMARKLET_CODE:function(a){return"(function(a,b,c,d,e,f,h,i,j,k,l,m,n,o,p,q,r){a=document;b=a.body;c=a.location.href;j='draggable';m='text/x-iri-';d=a.createElement('div');d.innerHTML='<p_style=\"position:fixed;top:0;right:0;font:bold_18px_sans-serif;color:#fff;background:#909;padding:10px;z-index:100000;\">"+a.translate("Drag items from this website, drop them in Renkan").replace(/ /g,"_")+"</p>'.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.x<paper.view.center.x?1:-1,h=b.x+g*(d+a.tooltip_arrow_length),i=b.x+g*(d+a.tooltip_arrow_length+a.tooltip_width),j=b.y-f/2;j+f>paper.view.size.height-a.tooltip_margin&&(j=Math.max(paper.view.size.height-a.tooltip_margin,b.y+a.tooltip_arrow_width/2)-f),j<a.tooltip_margin&&(j=Math.min(a.tooltip_margin,b.y-a.tooltip_arrow_width/2));var k=j+f;return c.segments[0].point=c.segments[7].point=b.add([g*d,0]),c.segments[1].point.x=c.segments[2].point.x=c.segments[5].point.x=c.segments[6].point.x=h,c.segments[3].point.x=c.segments[4].point.x=i,c.segments[2].point.y=c.segments[3].point.y=j,c.segments[4].point.y=c.segments[5].point.y=k,c.segments[1].point.y=b.y-a.tooltip_arrow_width/2,c.segments[6].point.y=b.y+a.tooltip_arrow_width/2,c.closed=!0,c.fillColor=new paper.GradientColor(new paper.Gradient([a.tooltip_top_color,a.tooltip_bottom_color]),[0,j],[0,k]),e.css({left:a.tooltip_padding+Math.min(h,i),top:a.tooltip_padding+j}),c},increaseBrightness:function(a,b){a=a.replace(/^\s*#|\s*$/g,""),3===a.length&&(a=a.replace(/(.)/g,"$1$1"));var c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=parseInt(a.substr(4,2),16);return"#"+(0|256+c+(256-c)*b/100).toString(16).substr(1)+(0|256+d+(256-d)*b/100).toString(16).substr(1)+(0|256+e+(256-e)*b/100).toString(16).substr(1)}}}(window),function(a){"use strict";var b=a.Backbone;a.Rkns.Router=b.Router.extend({routes:{"":"index"},index:function(a){var b={};null!==a&&(a.split("&").forEach(function(a){var c=a.split("=");b[c[0]]=decodeURIComponent(c[1])}),this.trigger("router",b))}})}(window),function(a){"use strict";var b=a.Rkns.DataLoader={converters:{from1to2:function(a){var b,c;if("undefined"!=typeof a.nodes)for(b=0,c=a.nodes.length;c>b;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:!0,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,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,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é)","<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,a.renderer.fixSize()})},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(){c.set({loadingStatus:!0})},success:function(b){a.dataloader.load(b),c.set({loadingStatus:!1}),c.set({saveStatus:0}),a.renderer.autoScale()}})},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,"<span class='searchmatch'>$1</span>")}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="<li><h3>Tags</h3></li>",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+="<li><h3>Annotations</h3></li>",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(),"<span class='searchmatch'>$1</span>")}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,"<span class='searchmatch'>$1</span>")}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(),"<span class='searchmatch'>$1</span>")}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.$("<div>").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.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('<div class="Rk-Label">').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<this.all_buttons.length;d++)this.all_buttons[d].source_representation=this;this.active_buttons=[]}else this.active_buttons=this.all_buttons=[];this.last_circle_radius=1,this.renderer.minimap&&(this.renderer.minimap.node_layer.activate(),this.minimap_circle=new paper.Path.Circle([0,0],1),this.minimap_circle.__representation=this.renderer.minimap.miniframe.__representation,this.renderer.minimap.node_group.addChild(this.minimap_circle))},_getStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.node_stroke_width+(a-1)*(this.options.node_stroke_max_width-this.options.node_stroke_width)/(this.options.node_stroke_witdh_scale-1)},_getSelectedStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.selected_node_stroke_width+(a-1)*(this.options.selected_node_stroke_max_width-this.options.selected_node_stroke_width)/(this.options.node_stroke_witdh_scale-1)},buildShape:function(){"shape"in this.model.changed&&delete this.img,this.circle&&(this.circle.remove(),delete this.circle),this.shapeBuilder=new e(this.model.get("shape")),this.circle=this.shapeBuilder.getShape(),this.circle.__representation=this,this.circle.sendToBack(),this.last_circle_radius=1},redraw:function(a){"shape"in this.model.changed&&"change"in a&&a.change&&this.buildShape();var c=new paper.Point(this.model.get("position")),d=this.options.node_size_base*Math.exp((this.model.get("size")||0)*f._NODE_SIZE_STEP);this.is_dragging&&this.paper_coords||(this.paper_coords=this.renderer.toPaperCoords(c)),this.circle_radius=d*this.renderer.scale,this.last_circle_radius!==this.circle_radius&&(this.all_buttons.forEach(function(a){a.setSectorSize()}),this.circle.scale(this.circle_radius/this.last_circle_radius),this.node_image&&this.node_image.scale(this.circle_radius/this.last_circle_radius)),this.circle.position=this.paper_coords,this.node_image&&(this.node_image.position=this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius))),this.last_circle_radius=this.circle_radius;var e=this.active_buttons,g=1;this.model.get("delete_scheduled")?(g=.5,this.active_buttons=this.pending_delete_buttons,this.circle.dashArray=[2,2]):(g=1,this.active_buttons=this.normal_buttons,this.circle.dashArray=null),this.selected&&this.renderer.isEditable()&&!this.ghost&&(e!==this.active_buttons&&e.forEach(function(a){a.hide()}),this.active_buttons.forEach(function(a){a.show()})),this.node_image&&(this.node_image.opacity=this.highlighted?.5*g:g-.01),this.circle.fillColor=this.highlighted?this.options.highlighted_node_fill_color:this.options.node_fill_color,this.circle.opacity=this.options.show_node_circles?g:.01;var h=this.model.get("title")||this.renkan.translate(this.options.label_untitled_nodes)||"";h=f.shortenText(h,this.options.node_label_max_length),"object"==typeof this.highlighted?this.title.html(this.highlighted.replace(b(h).escape(),'<span class="Rk-Highlighted">$1</span>')):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.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.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.hiddenNodes.indexOf(f.model.id);-1!==g&&c.renderer.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.hiddenNodes.indexOf(this.model.id);-1!==c&&this.renderer.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('<div class="Rk-Label Rk-Edge-Label">').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;d<this.all_buttons.length;d++)this.all_buttons[d].source_representation=this;this.active_buttons=[]}else this.active_buttons=this.all_buttons=[];this.renderer.minimap&&(this.renderer.minimap.edge_layer.activate(),this.minimap_line=new paper.Path,this.minimap_line.add([0,0],[0,0]),this.minimap_line.__representation=this.renderer.minimap.miniframe.__representation,this.minimap_line.strokeWidth=1)},_getStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.edge_stroke_width+(a-1)*(this.options.edge_stroke_max_width-this.options.edge_stroke_width)/(this.options.edge_stroke_witdh_scale-1)},_getSelectedStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.selected_edge_stroke_width+(a-1)*(this.options.selected_edge_stroke_max_width-this.options.selected_edge_stroke_width)/(this.options.edge_stroke_witdh_scale-1)},_getArrowScale:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return 1+(a-1)*(this.options.edge_arrow_max_width/this.options.edge_arrow_width-1)/(this.options.edge_stroke_witdh_scale-1)},redraw:function(){var a=this.model.get("from"),b=this.model.get("to");if(a&&b&&(!this.hidden||this.ghost)){if(this.from_representation=this.renderer.getRepresentationByModel(a),this.to_representation=this.renderer.getRepresentationByModel(b),"undefined"==typeof this.from_representation||"undefined"==typeof this.to_representation||this.from_representation.hidden&&!this.from_representation.ghost||this.to_representation.hidden&&!this.to_representation.ghost)return void this.hide();var c,d=this._getStrokeWidth(),f=this._getArrowScale(),g=this.from_representation.paper_coords,h=this.to_representation.paper_coords,i=h.subtract(g),j=i.length,k=i.divide(j),l=new paper.Point([-k.y,k.x]),m=this.bundle.getPosition(this),n=l.multiply(this.options.edge_gap_in_bundles*m),o=g.add(n),p=h.add(n),q=i.angle,r=l.multiply(this.options.edge_label_distance+.5*f*this.options.edge_arrow_width),s=i.divide(3),t=this.model.has("style")&&this.model.get("style").color||(this.model.get("created_by")||e._USER_PLACEHOLDER(this.renkan)).get("color"),u=this.model.has("style")&&this.model.get("style").dash?this.options.default_dash_array:null;this.model.get("delete_scheduled")||this.from_representation.model.get("delete_scheduled")||this.to_representation.model.get("delete_scheduled")?(c=.5,this.line.dashArray=[2,2]):(c=this.ghost?this.options.ghost_opacity:1,this.line.dashArray=null);var v=this.active_buttons;this.arrow.visible=this.model.has("style")&&this.model.get("style").arrow||!this.model.has("style")||"undefined"==typeof this.model.get("style").arrow,this.active_buttons=this.model.get("delete_scheduled")?this.pending_delete_buttons:this.normal_buttons,this.selected&&this.renderer.isEditable()&&v!==this.active_buttons&&(v.forEach(function(a){a.hide()}),this.active_buttons.forEach(function(a){a.show()})),this.paper_coords=o.add(p).divide(2),this.line.strokeWidth=d,this.line.strokeColor=t,this.line.dashArray=u,this.line.opacity=c,this.line.segments[0].point=g,this.line.segments[1].point=this.paper_coords,this.line.segments[1].handleIn=s.multiply(-1),this.line.segments[1].handleOut=s,this.line.segments[2].point=h,this.arrow.scale(f/this.arrow_scale),this.arrow_scale=f,this.arrow.fillColor=t,this.arrow.opacity=c,this.arrow.rotate(q-this.arrow_angle,this.arrow.bounds.center),this.arrow.position=this.paper_coords,this.arrow_angle=q,q>90&&(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=.8,this.editor_$=a("<div>").appendTo(this.renderer.editor_$).css({position:"absolute",opacity:.8}).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(),'<span class="Rk-Highlighted">$1</span>');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(),'<span class="Rk-Highlighted">$1</span>'))}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.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.scale=1,this.initialScale=1,this.offset=paper.view.center,this.totalScroll=0,this.hiddenNodes=[],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-_lastTap<f._DOUBLETAP_DELAY&&Math.pow(j-b.pageX,2)+Math.pow(k-b.pageY,2)<f._DOUBLETAP_DISTANCE?(_lastTap=0,d.onDoubleClick(b)):(_lastTap=new Date,j=b.pageX,k=b.pageY,h=d.scale,i=!1,d.onMouseDown(b,!0))},touchmove:function(a){if(a.preventDefault(),_lastTap=0,1===a.originalEvent.touches.length)d.onMouseMove(a.originalEvent.touches[0],!0);else{if(i||(d.onMouseUp(a.originalEvent.touches[0],!0),d.click_target=null,d.is_dragging=!1,i=!0),"undefined"===a.originalEvent.scale)return;var b=a.originalEvent.scale*h,c=b/d.scale,e=new paper.Point([d.canvas_$.width(),d.canvas_$.height()]).multiply(.5*(1-c)).add(d.offset.multiply(c));d.setScale(b,e)}},touchend:function(a){a.preventDefault(),d.onMouseUp(a.originalEvent.changedTouches[0],!0)},dblclick:function(a){a.preventDefault(),c.options.allow_double_click&&d.onDoubleClick(a)},mouseleave:function(a){a.preventDefault(),d.click_target=null,d.is_dragging=!1},dragover:function(a){a.preventDefault()},dragenter:function(a){a.preventDefault(),g=!1},dragleave:function(a){a.preventDefault(),g=!0},drop:function(a){a.preventDefault(),g=!0;var c={};b.each(a.originalEvent.dataTransfer.types,function(b){try{c[b]=a.originalEvent.dataTransfer.getData(b)}catch(d){}});var e=a.originalEvent.dataTransfer.getData("Text");if("string"==typeof e)switch(e[0]){case"{":case"[":try{var f=JSON.parse(e);b.extend(c,f)}catch(h){c["text/plain"]||(c["text/plain"]=e)}break;case"<":c["text/html"]||(c["text/html"]=e);break;default:c["text/plain"]||(c["text/plain"]=e)}var i=a.originalEvent.dataTransfer.getData("URL");i&&!c["text/uri-list"]&&(c["text/uri-list"]=i),d.dropData(c,a.originalEvent)}});var m=function(a,b){d.$.find(a).click(function(a){return d[b](a),!1})};m(".Rk-ZoomOut","zoomOut"),m(".Rk-ZoomIn","zoomIn"),m(".Rk-ZoomFit","autoScale"),this.$.find(".Rk-ZoomSave").click(function(){d.renkan.project.addView({zoom_level:d.scale,offset:d.offset,hidden_nodes:d.hiddenNodes})}),this.$.find(".Rk-ZoomSetSaved").click(function(){var a=d.renkan.project.get("views").last();a&&(d.showNodes(!1),d.setScale(a.get("zoom_level"),new paper.Point(a.get("offset"))),d.renkan.options.hide_nodes&&(d.hiddenNodes=(a.get("hidden_nodes")||[]).concat(),d.hideNodes()))}),this.$.find(".Rk-ShowHiddenNodes").mouseenter(function(){d.showNodes(!0),d.$.find(".Rk-ShowHiddenNodes").mouseleave(function(){d.hideNodes()})}),this.$.find(".Rk-ShowHiddenNodes").click(function(){d.showNodes(!1),d.$.find(".Rk-ShowHiddenNodes").off("mouseleave")}),this.renkan.project.get("views").length>0&&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.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()}),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(){if(this.renkan.options.default_view&&this.renkan.project.get("views").length>0){var a=this.renkan.project.get("views").last();this.setScale(a.get("zoom_level"),new paper.Point(a.get("offset")))}else this.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()},setScale:function(a,b){a/this.initialScale>f._MIN_SCALE&&a/this.initialScale<f._MAX_SCALE&&(this.scale=a,b&&(this.offset=b),this.redraw())},autoScale:function(a){var b=this.renkan.project.get("nodes");if(b.length>1){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])))},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.scale*this.renkan.options.minimap_width/paper.view.bounds.width,.8*this.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.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=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('<li class="Rk-User"><span class="Rk-UserColor" style="background:<%=background%>;"></span><%=name%></li>'),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("<unknown user>")),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("<input>").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&&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},addHiddenNode:function(a){this.hideNode(a),this.hiddenNodes.push(a.id)},hideNode:function(a){var b=this;"undefined"!=typeof b.getRepresentationByModel(a)&&b.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,c=0;this.hiddenNodes.forEach(function(d){c++,b.getRepresentationByModel(b.renkan.project.get("nodes").get(d)).show(a)}),a||(this.hiddenNodes=[]),paper.view.draw()},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},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]),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.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();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.offset).multiply(Math.SQRT2-1);this.totalScroll>0?this.setScale(this.scale*Math.SQRT2,this.offset.subtract(d)):this.setScale(this.scale*Math.SQRT1_2,this.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("<div>").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("<div>").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("<div>").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("<div>").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;k<j.length;k++){var l=j[k];(b["text/x-iri-"+l]||b[l])&&(c[l]=b["text/x-iri-"+l]||b[l]),("none"===c[l]||"null"===c[l])&&(c[l]=void 0)}return"function"==typeof this.renkan.options.drop_enhancer&&(c=this.renkan.options.drop_enhancer(c,b)),c},dropData:function(a,c){if(this.isEditable()){if(a["text/json"]||a["application/json"])try{var d=JSON.parse(a["text/json"]||a["application/json"]);b.extend(a,d)}catch(e){}var g="undefined"==typeof this.renkan.options.drop_handler?this.defaultDropHandler(a):this.renkan.options.drop_handler(a),h=this.canvas_$.offset(),i=new paper.Point([c.pageX-h.left,c.pageY-h.top]),j=this.toModelCoords(i),k={id:f.getUID("node"),created_by:this.renkan.current_user,uri:g.uri||"",title:g.title||"",description:g.description||"",image:g.image||"",color:g.color||void 0,clip_path:g.clipPath||void 0,position:{x:j.x,y:j.y}},l=this.renkan.project.addNode(k),m=this.getRepresentationByModel(l);"drop"===c.type&&m.openEditor()}},fullScreen:function(){var a,b=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen,c=this.renkan.$[0],d=["requestFullScreen","mozRequestFullScreen","webkitRequestFullScreen"],e=["cancelFullScreen","mozCancelFullScreen","webkitCancelFullScreen"];if(b){for(a=0;a<e.length;a++)if("function"==typeof document[e[a]]){document[e[a]]();break}var f=this.$.width(),g=this.$.height();this.renkan.options.show_top_bar&&(g-=this.$.find(".Rk-TopBar").height()),this.renkan.options.show_bins&&this.renkan.$.find(".Rk-Bins").position().left>0&&(f-=this.renkan.$.find(".Rk-Bins").width()),paper.view.viewSize=new paper.Size([f,g])}else{for(a=0;a<d.length;a++)if("function"==typeof c[d[a]]){c[d[a]]();break}this.redraw()}},zoomOut:function(){var a=this.scale*Math.SQRT1_2,b=new paper.Point([this.canvas_$.width(),this.canvas_$.height()]).multiply(.5*(1-Math.SQRT1_2)).add(this.offset.multiply(Math.SQRT1_2));this.setScale(a,b)},zoomIn:function(){var a=this.scale*Math.SQRT2,b=new paper.Point([this.canvas_$.width(),this.canvas_$.height()]).multiply(.5*(1-Math.SQRT2)).add(this.offset.multiply(Math.SQRT2));this.setScale(a,b)},resizeZoom:function(a,b,c){var d=this.scale*c,e=new paper.Point([this.offset.x*a,this.offset.y*b]);this.setScale(d,e)},addNodeBtn:function(){return this.click_mode===f._CLICKMODE_ADDNODE?(this.click_mode=!1,this.notif_$.hide()):(this.click_mode=f._CLICKMODE_ADDNODE,this.notif_$.text(this.renkan.translate("Click on the background canvas to add a node")).fadeIn()),!1},addEdgeBtn:function(){return this.click_mode===f._CLICKMODE_STARTEDGE||this.click_mode===f._CLICKMODE_ENDEDGE?(this.click_mode=!1,this.notif_$.hide()):(this.click_mode=f._CLICKMODE_STARTEDGE,this.notif_$.text(this.renkan.translate("Click on a first node to start the edge")).fadeIn()),!1},exportProject:function(){var a=this.renkan.project.toJSON(),d=(document.createElement("a"),a.id),e=d+".json";delete a.id,delete a._id,delete a.space_id;var g,h,i={};b.each(a.nodes,function(a,b,c){g=a.id||a._id,delete a._id,delete a.id,i[g]=a["@id"]=f.getUUID4()}),b.each(a.edges,function(a,b,c){delete a._id,delete a.id,a.to=i[a.to],a.from=i[a.from]}),b.each(a.views,function(a,c,d){delete a._id,delete a.id,a.hidden_nodes&&(h=a.hidden_nodes,a.hidden_nodes=[],b.each(h,function(b,c){a.hidden_nodes.push(i[b])}))}),a.users=[];var j=JSON.stringify(a,null,2),k=new Blob([j],{type:"application/json;charset=utf-8"});c(k,e)},parameters:function(a){"undefined"!=typeof a.idnode&&(this.unhighlightAll(),this.highlightModel(this.renkan.project.get("nodes").get(a.idnode)))},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()<c.height()?e:e-c.width(),b.html("&laquo;")):(c.animate({left:-300},250),this.$.animate({left:0},250,function(){var a=d.$.width();paper.view.viewSize=new paper.Size([a,d.canvas_$.height()])}),a=e+300,b.html("&raquo;")),d.resizeZoom(1,1,a/e)},save:function(){},open:function(){}}).value(),g}),"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"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v){"use strict";var w=window.Rkns;"undefined"==typeof w.Renderer&&(w.Renderer={});var x=w.Renderer;x._BaseRepresentation=a,x._BaseButton=b,x.Node=c,x.Edge=d,x.TempEdge=e,x._BaseEditor=f,x.NodeEditor=g,x.EdgeEditor=h,x._NodeButton=i,x.NodeEditButton=j,x.NodeRemoveButton=k,x.NodeHideButton=l,x.NodeShowButton=m,x.NodeRevertButton=n,x.NodeLinkButton=o,x.NodeEnlargeButton=p,x.NodeShrinkButton=q,x.EdgeEditButton=r,x.EdgeRemoveButton=s,x.EdgeRevertButton=t,x.MiniFrame=u,x.Scene=v,startRenkan()}),define("main-renderer",function(){});
+this.renkanJST=this.renkanJST||{},this.renkanJST["templates/colorpicker.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='<li data-color="'+(null==(__t=c)?"":__t)+'" style="background: '+(null==(__t=c)?"":__t)+'"></li>';return __p},this.renkanJST["templates/edgeeditor.html"]=function(obj){obj||(obj={});{var __t,__p="",__e=_.escape;Array.prototype.join}with(obj)__p+='<h2>\n    <span class="Rk-CloseX">&times;</span>'+__e(renkan.translate("Edit Edge"))+"</span>\n</h2>\n<p>\n    <label>"+__e(renkan.translate("Title:"))+'</label>\n    <input class="Rk-Edit-Title" type="text" value="'+__e(edge.title)+'" />\n</p>\n',options.show_edge_editor_uri&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("URI:"))+'</label>\n        <input class="Rk-Edit-URI" type="text" value="'+__e(edge.uri)+'" />\n        <a class="Rk-Edit-Goto" href="'+__e(edge.uri)+'" target="_blank"></a>\n    </p>\n    ',options.properties.length&&(__p+="\n        <p>\n            <label>"+__e(renkan.translate("Choose from vocabulary:"))+'</label>\n            <select class="Rk-Edit-Vocabulary">\n                ',_.each(options.properties,function(a){__p+='\n                    <option class="Rk-Edit-Vocabulary-Class" value="">\n                        '+__e(renkan.translate(a.label))+"\n                    </option>\n                    ",_.each(a.properties,function(b){var c=a["base-uri"]+b.uri;__p+='\n                        <option class="Rk-Edit-Vocabulary-Property" value="'+__e(c)+'"\n                            ',c===edge.uri&&(__p+=" selected"),__p+=">\n                            "+__e(renkan.translate(b.label))+"\n                        </option>\n                    "}),__p+="\n                "}),__p+="\n            </select>\n        </p>\n")),__p+="\n",options.show_edge_editor_style&&(__p+='\n    <div class="Rk-Editor-p">\n      ',options.show_edge_editor_style_color&&(__p+='\n      <div id="Rk-Editor-p-color">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Edge color:"))+'</span>\n        <div class="Rk-Edit-ColorPicker-Wrapper">\n            <span class="Rk-Edit-Color" style="background: &lt;%-edge.color%>;">\n                <span class="Rk-Edit-ColorTip"></span>\n            </span>\n            '+(null==(__t=renkan.colorPicker)?"":__t)+'\n            <span class="Rk-Edit-ColorPicker-Text">'+__e(renkan.translate("Choose color"))+"</span>\n        </div>\n      </div>\n      "),__p+="\n      ",options.show_edge_editor_style_dash&&(__p+='\n      <div id="Rk-Editor-p-dash">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Dash:"))+'</span>\n        <input type="checkbox" name="Rk-Edit-Dash" class="Rk-Edit-Dash" '+__e(edge.dash)+" />\n      </div>\n      "),__p+="\n      ",options.show_edge_editor_style_thickness&&(__p+='\n      <div id="Rk-Editor-p-thickness">\n          <span class="Rk-Editor-Label">'+__e(renkan.translate("Thickness:"))+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Down">-</a>\n          <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Thickness-Value">'+__e(edge.thickness)+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Up">+</a>\n      </div>\n      '),__p+="\n      ",options.show_edge_editor_style_arrow&&(__p+='\n      <div id="Rk-Editor-p-arrow">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Arrow:"))+'</span>\n        <input type="checkbox" name="Rk-Edit-Arrow" class="Rk-Edit-Arrow" '+__e(edge.arrow)+" />\n      </div>\n      "),__p+="\n    </div>\n"),__p+="\n",options.show_edge_editor_direction&&(__p+='\n    <p>\n        <span class="Rk-Edit-Direction">'+__e(renkan.translate("Change edge direction"))+"</span>\n    </p>\n"),__p+="\n",options.show_edge_editor_nodes&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("From:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.from_color)+';"></span>\n        '+__e(shortenText(edge.from_title,25))+'\n    </p>\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("To:"))+'</span>\n        <span class="Rk-UserColor" style="background: >%-edge.to_color%>;"></span>\n        '+__e(shortenText(edge.to_title,25))+"\n    </p>\n"),__p+="\n",options.show_edge_editor_creator&&edge.has_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: &lt;%-edge.created_by_color%>;"></span>\n        '+__e(shortenText(edge.created_by_title,25))+"\n    </p>\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+='<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ',options.show_edge_tooltip_color&&(__p+='\n        <span class="Rk-UserColor" style="background: '+__e(edge.color)+';"></span>\n    '),__p+='\n    <span class="Rk-Display-Title">\n        ',edge.uri&&(__p+='\n            <a href="'+__e(edge.uri)+'" target="_blank">\n        '),__p+="\n        "+__e(edge.title)+"\n        ",edge.uri&&(__p+=" </a> "),__p+="\n    </span>\n</h2>\n",options.show_edge_tooltip_uri&&edge.uri&&(__p+='\n    <p class="Rk-Display-URI">\n        <a href="'+__e(edge.uri)+'" target="_blank">'+__e(edge.short_uri)+"</a>\n    </p>\n"),__p+="\n<p>"+(null==(__t=edge.description)?"":__t)+"</p>\n",options.show_edge_tooltip_nodes&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("From:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.from_color)+';"></span>\n        '+__e(shortenText(edge.from_title,25))+'\n    </p>\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("To:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.to_color)+';"></span>\n        '+__e(shortenText(edge.to_title,25))+"\n    </p>\n"),__p+="\n",options.show_edge_tooltip_creator&&edge.has_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.created_by_color)+';"></span>\n        '+__e(shortenText(edge.created_by_title,25))+"\n    </p>\n"),__p+="\n";return __p},this.renkanJST["templates/ldtjson-bin/annotationtemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Bin-Item" draggable="true"\n    data-image="'+__e(Rkns.Utils.getFullURL(image))+'"\n    data-uri="'+(null==(__t=ldt_platform)?"":__t)+"ldtplatform/ldt/front/player/"+(null==(__t=mediaid)?"":__t)+"/#id="+(null==(__t=annotationid)?"":__t)+'"\n    data-title="'+__e(title)+'" data-description="'+__e(description)+'">\n\n    <img class="Rk-Ldt-Annotation-Icon" src="'+(null==(__t=image)?"":__t)+'" />\n    <h4>'+(null==(__t=htitle)?"":__t)+"</h4>\n    <p>"+(null==(__t=hdescription)?"":__t)+"</p>\n    <p>Start: "+(null==(__t=start)?"":__t)+", End: "+(null==(__t=end)?"":__t)+", Duration: "+(null==(__t=duration)?"":__t)+'</p>\n    <div class="Rk-Clear"></div>\n</li>\n';return __p},this.renkanJST["templates/ldtjson-bin/segmenttemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Bin-Item" draggable="true"\n    data-image="'+__e(Rkns.Utils.getFullURL(image))+'"\n    data-uri="'+(null==(__t=ldt_platform)?"":__t)+"ldtplatform/ldt/front/player/"+(null==(__t=mediaid)?"":__t)+"/#id="+(null==(__t=annotationid)?"":__t)+'"\n    data-title="'+__e(title)+'" data-description="'+__e(description)+'">\n\n    <img class="Rk-Ldt-Annotation-Icon" src="'+(null==(__t=image)?"":__t)+'" />\n    <h4>'+(null==(__t=htitle)?"":__t)+"</h4>\n    <p>"+(null==(__t=hdescription)?"":__t)+"</p>\n    <p>Start: "+(null==(__t=start)?"":__t)+", End: "+(null==(__t=end)?"":__t)+", Duration: "+(null==(__t=duration)?"":__t)+'</p>\n    <div class="Rk-Clear"></div>\n</li>\n';return __p},this.renkanJST["templates/ldtjson-bin/tagtemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Bin-Item" draggable="true"\n    data-image="'+__e(Rkns.Utils.getFullURL(static_url+"img/ldt-tag.png"))+'"\n    data-uri="'+(null==(__t=ldt_platform)?"":__t)+"ldtplatform/ldt/front/search/?search="+(null==(__t=encodedtitle)?"":__t)+'&field=all"\n    data-title="'+__e(title)+'" data-description="Tag \''+__e(title)+'\'">\n\n    <img class="Rk-Ldt-Tag-Icon" src="'+__e(static_url)+'img/ldt-tag.png" />\n    <h4>'+(null==(__t=htitle)?"":__t)+'</h4>\n    <div class="Rk-Clear"></div>\n</li>\n';return __p},this.renkanJST["templates/list-bin.html"]=function(obj){obj||(obj={});{var __t,__p="",__e=_.escape;Array.prototype.join}with(obj)__p+='<li class="Rk-Bin-Item Rk-ResourceList-Item" draggable="true"\n    data-uri="'+__e(url)+'" data-title="'+__e(title)+'"\n    data-description="'+__e(description)+'"\n    ',__p+=image?'\n        data-image="'+__e(Rkns.Utils.getFullURL(image))+'"\n    ':'\n        data-image=""\n    ',__p+="\n>",image&&(__p+='\n    <img class="Rk-ResourceList-Image" src="'+__e(image)+'" />\n'),__p+='\n<h4 class="Rk-ResourceList-Title">\n    ',url&&(__p+='\n        <a href="'+__e(url)+'" target="_blank">\n    '),__p+="\n    "+(null==(__t=htitle)?"":__t)+"\n    ",url&&(__p+="</a>"),__p+="\n    </h4>\n    ",description&&(__p+='\n        <p class="Rk-ResourceList-Description">'+(null==(__t=hdescription)?"":__t)+"</p>\n    "),__p+="\n    ",image&&(__p+='\n        <div style="clear: both;"></div>\n    '),__p+="\n</li>\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    <div class="Rk-Bins">\n        <div class="Rk-Bins-Head">\n            <h2 class="Rk-Bins-Title">'+__e(translate("Select contents:"))+'</h2>\n            <form class="Rk-Web-Search-Form Rk-Search-Form">\n                <input class="Rk-Web-Search-Input Rk-Search-Input" type="search"\n                    placeholder="'+__e(translate("Search the Web"))+'" />\n                <div class="Rk-Search-Select">\n                    <div class="Rk-Search-Current"></div>\n                    <ul class="Rk-Search-List"></ul>\n                </div>\n                <input type="submit" value=""\n                    class="Rk-Web-Search-Submit Rk-Search-Submit" title="'+__e(translate("Search the Web"))+'" />\n            </form>\n            <form class="Rk-Bins-Search-Form Rk-Search-Form">\n                <input class="Rk-Bins-Search-Input Rk-Search-Input" type="search"\n                    placeholder="'+__e(translate("Search in Bins"))+'" /> <input\n                    type="submit" value=""\n                    class="Rk-Bins-Search-Submit Rk-Search-Submit"\n                    title="'+__e(translate("Search in Bins"))+'" />\n            </form>\n        </div>\n        <ul class="Rk-Bin-List"></ul>\n    </div>\n'),__p+=" ",options.show_editor&&(__p+='\n    <div class="Rk-Render Rk-Render-',__p+=options.show_bins?"Panel":"Full",__p+='"></div>\n'),__p+="\n";return __p},this.renkanJST["templates/nodeeditor.html"]=function(obj){obj||(obj={});{var __t,__p="",__e=_.escape;Array.prototype.join}with(obj)__p+='\n<h2>\n    <span class="Rk-CloseX">&times;</span>'+__e(renkan.translate("Edit Node"))+"</span>\n</h2>\n<p>\n    <label>"+__e(renkan.translate("Title:"))+"</label>\n    ",__p+=options.show_node_editor_title_richtext?'\n        <div class="Rk-Edit-Title" contenteditable="true">'+(null==(__t=node.title)?"":__t)+"</div>\n    ":'\n        <input class="Rk-Edit-Title" type="text" value="'+__e(node.title)+'" />\n    ',__p+="    \n</p>\n",options.show_node_editor_uri&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("URI:"))+'</label>\n        <input class="Rk-Edit-URI" type="text" value="'+__e(node.uri)+'" />\n        <a class="Rk-Edit-Goto" href="'+__e(node.uri)+'" target="_blank"></a>\n    </p>\n'),__p+=" ",options.change_types&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Types available"))+':</label>\n        <select class="Rk-Edit-Type">\n          ',_.each(types,function(a){__p+='\n            <option class="Rk-Edit-Vocabulary-Property" value="'+__e(a)+'"',node.type===a&&(__p+=" selected"),__p+=">\n                "+__e(renkan.translate(a.charAt(0).toUpperCase()+a.substring(1)))+"\n            </option>\n          "}),__p+="\n        </select>\n    </p>\n"),__p+=" ",options.show_node_editor_description&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Description:"))+"</label>\n        ",__p+=options.show_node_editor_description_richtext?'\n            <div class="Rk-Edit-Description" contenteditable="true">'+(null==(__t=node.description)?"":__t)+"</div>\n        ":'\n            <textarea class="Rk-Edit-Description">'+(null==(__t=node.description)?"":__t)+"</textarea>\n        ",__p+="\n    </p>\n"),__p+=" ",options.show_node_editor_size&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Size:"))+'</span>\n        <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Size-Down">-</a>\n        <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Size-Value">'+__e(node.size)+'</span>\n        <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Size-Up">+</a>\n    </p>\n'),__p+=" ",options.show_node_editor_style&&(__p+='\n    <div class="Rk-Editor-p">\n      ',options.show_node_editor_style_color&&(__p+='\n      <div id="Rk-Editor-p-color">\n        <span class="Rk-Editor-Label">\n        '+__e(renkan.translate("Node color:"))+'</span>\n        <div class="Rk-Edit-ColorPicker-Wrapper">\n            <span class="Rk-Edit-Color" style="background: '+__e(node.color)+';">\n                <span class="Rk-Edit-ColorTip"></span>\n            </span>\n            '+(null==(__t=renkan.colorPicker)?"":__t)+'\n            <span class="Rk-Edit-ColorPicker-Text">'+__e(renkan.translate("Choose color"))+"</span>\n        </div>\n      </div>\n      "),__p+="\n      ",options.show_node_editor_style_dash&&(__p+='\n      <div id="Rk-Editor-p-dash">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Dash:"))+'</span>\n        <input type="checkbox" name="Rk-Edit-Dash" class="Rk-Edit-Dash" '+__e(node.dash)+" />\n      </div>\n      "),__p+="\n      ",options.show_node_editor_style_thickness&&(__p+='\n      <div id="Rk-Editor-p-thickness">\n          <span class="Rk-Editor-Label">'+__e(renkan.translate("Thickness:"))+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Down">-</a>\n          <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Thickness-Value">'+__e(node.thickness)+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Up">+</a>\n      </div>\n      '),__p+="\n    </div>\n"),__p+=" ",options.show_node_editor_image&&(__p+='\n    <div class="Rk-Edit-ImgWrap">\n        <div class="Rk-Edit-ImgPreview">\n            <img src="'+__e(node.image||node.image_placeholder)+'" />\n            ',node.clip_path&&(__p+='\n                <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 1 1" preserveAspectRatio="none">\n                    <path style="stroke-width: .02; stroke:red; fill-opacity:.3; fill:red;" d="'+__e(node.clip_path)+'" />\n                </svg>\n            '),__p+="\n        </div>\n    </div>\n    <p>\n        <label>"+__e(renkan.translate("Image URL:"))+'</label>\n        <div>\n            <a class="Rk-Edit-Image-Del" href="#"></a>\n            <input class="Rk-Edit-Image" type="text" value=\''+__e(node.image)+"' />\n        </div>\n    </p>\n",options.allow_image_upload&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Choose Image File:"))+'</label>\n        <input class="Rk-Edit-Image-File" type="file" accept="image/*" />\n    </p>\n')),__p+=" ",options.show_node_editor_creator&&node.has_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(node.created_by_color)+';"></span>\n        '+__e(shortenText(node.created_by_title,25))+"\n    </p>\n"),__p+=" ",options.change_shapes&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Shapes available"))+':</label>\n        <select class="Rk-Edit-Shape">\n          ',_.each(shapes,function(a){__p+='\n            <option class="Rk-Edit-Vocabulary-Property" value="'+__e(a)+'"',node.shape===a&&(__p+=" selected"),__p+=">\n                "+__e(renkan.translate(a.charAt(0).toUpperCase()+a.substring(1)))+"\n            </option>\n          "}),__p+="\n        </select>\n    </p>\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+='<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ',options.show_node_tooltip_color&&(__p+='\n        <span class="Rk-UserColor" style="background: '+__e(node.color)+';"></span>\n    '),__p+='\n    <span class="Rk-Display-Title">\n        ',node.uri&&(__p+='\n            <a href="'+__e(node.uri)+'" target="_blank">\n        '),__p+="\n        "+__e(node.title)+"\n        ",node.uri&&(__p+="</a>"),__p+="\n    </span>\n</h2>\n",node.uri&&options.show_node_tooltip_uri&&(__p+='\n    <p class="Rk-Display-URI">\n        <a href="'+__e(node.uri)+'" target="_blank">'+__e(node.short_uri)+"</a>\n    </p>\n"),__p+=" ",options.show_node_tooltip_description&&(__p+='\n    <p class="Rk-Display-Description">'+(null==(__t=node.description)?"":__t)+"</p>\n"),__p+=" ",node.image&&options.show_node_tooltip_image&&(__p+='\n    <img class="Rk-Display-ImgPreview" src="'+__e(node.image)+'" />\n'),__p+=" ",node.has_creator&&options.show_node_tooltip_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(node.created_by_color)+';"></span>\n        '+__e(shortenText(node.created_by_title,25))+"\n    </p>\n"),__p+='\n    <a href="#?idNode='+__e(node._id)+'">'+__e(renkan.translate("Link to the node"))+"</a>\n";return __p},this.renkanJST["templates/nodeeditor_video.html"]=function(obj){obj||(obj={});{var __p="",__e=_.escape;Array.prototype.join}with(obj)__p+='<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ',options.show_node_tooltip_color&&(__p+='\n        <span class="Rk-UserColor" style="background: '+__e(node.color)+';"></span>\n    '),__p+='\n    <span class="Rk-Display-Title">\n        ',node.uri&&(__p+='\n            <a href="'+__e(node.uri)+'" target="_blank">\n        '),__p+="\n        "+__e(node.title)+"\n        ",node.uri&&(__p+="</a>"),__p+="\n    </span>\n</h2>\n",node.uri&&options.show_node_tooltip_uri&&(__p+='\n     <video width="320" height="240" controls>\n        <source src="'+__e(node.uri)+'" type="video/mp4">\n     </video> \n'),__p+='\n    <a href="#?idnode='+__e(node._id)+'">'+__e(renkan.translate("Link to the node"))+"</a>\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    <div class="Rk-TopBar">\n        <div class="loader"></div>\n        ',__p+=options.editor_mode?'\n            <input type="text" class="Rk-PadTitle" value="'+__e(project.get("title")||"")+'" placeholder="'+__e(translate("Untitled project"))+'" />\n        ':'\n            <h2 class="Rk-PadTitle">\n                '+__e(project.get("title")||translate("Untitled project"))+"\n            </h2>\n        ",__p+="\n        ",options.show_user_list&&(__p+='\n            <div class="Rk-Users">\n                <div class="Rk-CurrentUser">\n                    ',options.show_user_color&&(__p+='\n                        <div class="Rk-Edit-ColorPicker-Wrapper">\n                            <span class="Rk-CurrentUser-Color">\n                            ',options.user_color_editable&&(__p+='\n                                <span class="Rk-Edit-ColorTip"></span>\n                            '),__p+="\n                            </span>\n                            ",options.user_color_editable&&print(colorPicker),__p+="\n                        </div>\n                    "),__p+='\n                    <span class="Rk-CurrentUser-Name">&lt;unknown user&gt;</span>\n                </div>\n                <ul class="Rk-UserList"></ul>\n            </div>\n        '),__p+="\n        ",options.home_button_url&&(__p+='\n            <div class="Rk-TopBar-Separator"></div>\n            <a class="Rk-TopBar-Button Rk-Home-Button" href="'+__e(options.home_button_url)+'">\n                <div class="Rk-TopBar-Tooltip">\n                    <div class="Rk-TopBar-Tooltip-Contents">\n                        '+__e(translate(options.home_button_title))+"\n                    </div>\n                </div>\n            </a>\n        "),__p+="\n        ",options.show_fullscreen_button&&(__p+='\n            <div class="Rk-TopBar-Separator"></div>\n            <div class="Rk-TopBar-Button Rk-FullScreen-Button">\n                <div class="Rk-TopBar-Tooltip">\n                    <div class="Rk-TopBar-Tooltip-Contents">\n                        '+__e(translate("Full Screen"))+"\n                    </div>\n                </div>\n            </div>\n        "),__p+="\n        ",options.editor_mode?(__p+="\n            ",options.show_addnode_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-AddNode-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Add Node"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_addedge_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-AddEdge-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Add Edge"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_export_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Export-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Download Project"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_save_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Save-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents"></div>\n                    </div>\n                </div>\n            '),__p+="\n            ",options.show_open_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Open-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Open Project"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_bookmarklet&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <a class="Rk-TopBar-Button Rk-Bookmarklet-Button" href="#">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Renkan 'Drag-to-Add' bookmarklet"))+'\n                        </div>\n                    </div>\n                </a>\n                <div class="Rk-TopBar-Separator"></div>\n            '),__p+="\n        "):(__p+="\n            ",options.show_export_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Export-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Download Project"))+'\n                        </div>\n                    </div>\n                </div>\n                <div class="Rk-TopBar-Separator"></div>\n            '),__p+="\n        "),__p+="\n        ",options.show_search_field&&(__p+='\n            <form action="#" class="Rk-GraphSearch-Form">\n                <input type="search" class="Rk-GraphSearch-Field" placeholder="'+__e(translate("Search in graph"))+'" />\n            </form>\n            <div class="Rk-TopBar-Separator"></div>\n        '),__p+="\n    </div>\n"),__p+='\n<div class="Rk-Editing-Space',options.show_top_bar||(__p+=" Rk-Editing-Space-Full"),__p+='">\n    <div class="Rk-Labels"></div>\n    <canvas class="Rk-Canvas" ',options.resize&&(__p+=' resize="" '),__p+=' ></canvas>\n    <div class="Rk-Notifications"></div>\n    <div class="Rk-Editor">\n        ',options.show_bins&&(__p+='\n            <div class="Rk-Fold-Bins">&laquo;</div>\n        '),__p+="\n        ",options.show_zoom&&(__p+='\n            <div class="Rk-ZoomButtons">\n                <div class="Rk-ZoomIn" title="'+__e(translate("Zoom In"))+'"></div>\n                <div class="Rk-ZoomFit" title="'+__e(translate("Zoom Fit"))+'"></div>\n                <div class="Rk-ZoomOut" title="'+__e(translate("Zoom Out"))+'"></div>\n                ',options.editor_mode&&options.save_view&&(__p+='\n                    <div class="Rk-ZoomSave" title="'+__e(translate("Save view"))+'"></div>\n                '),__p+="\n                ",options.save_view&&(__p+='\n                    <div class="Rk-ZoomSetSaved" title="'+__e(translate("View saved view"))+'"></div>\n                    ',options.hide_nodes&&(__p+='\n                	   <div class="Rk-ShowHiddenNodes" title="'+__e(translate("Show hidden nodes"))+'"></div>\n                    '),__p+="       \n                "),__p+="\n            </div>\n        "),__p+="\n    </div>\n</div>\n";return __p},this.renkanJST["templates/search.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='<li class="'+(null==(__t=className)?"":__t)+'" data-key="'+(null==(__t=key)?"":__t)+'">'+(null==(__t=title)?"":__t)+"</li>";return __p},this.renkanJST["templates/wikipedia-bin/resulttemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Wikipedia-Result Rk-Bin-Item" draggable="true"\n    data-uri="'+__e(url)+'" data-title="Wikipedia: '+__e(title)+'"\n    data-description="'+__e(description)+'"\n    data-image="'+__e(Rkns.Utils.getFullURL(static_url+"img/wikipedia.png"))+'">\n\n    <img class="Rk-Wikipedia-Icon" src="'+__e(static_url)+'img/wikipedia.png">\n    <h4 class="Rk-Wikipedia-Title">\n        <a href="'+__e(url)+'" target="_blank">'+(null==(__t=htitle)?"":__t)+'</a>\n    </h4>\n    <p class="Rk-Wikipedia-Snippet">'+(null==(__t=hdescription)?"":__t)+"</p>\n</li>\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.$("<li>").addClass("Rk-Bin").appendTo(a.$.find(".Rk-Bin-List")),this.title_icon_$=b.$("<span>").addClass("Rk-Bin-Title-Icon").appendTo(this.$);var d=this;b.$("<a>").attr({href:"#",title:a.translate("Close bin")}).addClass("Rk-Bin-Close").html("&times;").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.$("<a>").attr({href:"#",title:a.translate("Refresh bin")}).addClass("Rk-Bin-Refresh").appendTo(this.$).click(function(){return d.refresh(),!1}),this.count_$=b.$("<div>").addClass("Rk-Bin-Count").appendTo(this.$),this.title_$=b.$("<h2>").addClass("Rk-Bin-Title").appendTo(this.$),this.main_$=b.$("<div>").addClass("Rk-Bin-Main").appendTo(this.$).html('<h4 class="Rk-Bin-Loading">'+a.translate("Loading, please wait")+"</h4>"),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'<ul class="Rk-Edit-ColorPicker">'+b.pickerColors.map(function(b){return a({c:b})}).join("")+"</ul>"}(),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){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(){var a=b.$(this);
+if(a&&c(a).attr("data-uri")){var f=e.project.get("nodes").where({uri:c(a).attr("data-uri")});d.each(f,function(a){e.renderer.highlightModel(a)})}}).mouseout(function(){e.renderer.unhighlightAll()}).on("mousemove",".Rk-Bin-Item",function(){try{this.dragDrop()}catch(a){}}).on("touchstart",".Rk-Bin-Item",function(){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.left+d&&b.pageY>=c.top&&b.pageY<c.top+f)if(k)e.renderer.onMouseMove(b,!0);else{k=!0;var g=document.createElement("div");g.appendChild(this.cloneNode(!0)),e.renderer.dropData({"text/html":g.innerHTML},b),e.renderer.onMouseDown(b,!0)}}).on("touchend",".Rk-Bin-Item",function(a){k&&e.renderer.onMouseUp(a.originalEvent.changedTouches[0],!0),k=!1}).on("dragstart",".Rk-Bin-Item",function(a){var b=document.createElement("div");b.appendChild(this.cloneNode(!0));try{a.originalEvent.dataTransfer.setData("text/html",b.innerHTML)}catch(c){a.originalEvent.dataTransfer.setData("text",b.innerHTML)}}),b.$(window).resize(function(){e.resizeBins()});var l=!1,m="";this.$.find(".Rk-Bins-Search-Input").on("change keyup paste input",function(){var a=b.$(this).val();if(a!==m){var c=b.Utils.regexpFromTextOrArray(a.length>1?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;d<b.length;d++)c+="."+b[d];this.$.find(".Rk-Web-Search-Input.Rk-Search-Input").attr("placeholder",this.translate("Search in ")+this.$.find(".Rk-Search-List "+c).html())},f.prototype.resizeBins=function(){var a=+this.$.find(".Rk-Bins-Head").outerHeight();this.$.find(".Rk-Bin-Title:visible").each(function(){a+=b.$(this).outerHeight()}),this.$.find(".Rk-Bin-Main").css({height:this.$.find(".Rk-Bins").height()-a})};var g=function(){return"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)})};b.Utils={getUUID4:g,getUID:function(){function a(a){return 10>a?"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(){"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<e.length;j++){j&&(i+=f+"*");var k=e[j];d.each(c,b(k)),i+=k}return i}function b(c){switch(typeof c){case"string":return a(c);case"object":var e="";return d.each(c,function(a){var c=b(a);c&&(e&&(e+="|"),e+=c)}),e}return""}var c=["[aáàâä]","[cç]","[eéèêë]","[iíìîï]","[oóòôö]","[uùûü]"],e=[String.fromCharCode(768),String.fromCharCode(769),String.fromCharCode(770),String.fromCharCode(771),String.fromCharCode(807),"{","}","(",")","[","]","【","】","、","・","‥","。","「","」","『","』","〜",":","!","?"," ",","," ",";","(",")",".","*","+","\\","?","|","{","}","[","]","^","#","/"],f="[\\"+e.join("\\")+"]",g=new RegExp(f,"gm"),h=d.map(c,function(a){return new RegExp(a)});return function(a){var c=b(a);if(c){var d=new RegExp(c,"im"),e=new RegExp("("+c+")","igm");return{isempty:!1,source:c,test:function(a){return d.test(a)},replace:function(a,b){return a.replace(e,b)}}}return{isempty:!0,source:"",test:function(){return!0},replace:function(){return text}}}}(),_MIN_DRAG_DISTANCE:2,_NODE_BUTTON_WIDTH:40,_EDGE_BUTTON_INNER:2,_EDGE_BUTTON_OUTER:40,_CLICKMODE_ADDNODE:1,_CLICKMODE_STARTEDGE:2,_CLICKMODE_ENDEDGE:3,_NODE_SIZE_STEP:Math.LN2/4,_MIN_SCALE:.05,_MAX_SCALE:20,_MOUSEMOVE_RATE:80,_DOUBLETAP_DELAY:800,_DOUBLETAP_DISTANCE:400,_USER_PLACEHOLDER:function(a){return{color:a.options.default_user_color,title:a.translate("(unknown user)"),get:function(a){return this[a]||!1}}},_BOOKMARKLET_CODE:function(a){return"(function(a,b,c,d,e,f,h,i,j,k,l,m,n,o,p,q,r){a=document;b=a.body;c=a.location.href;j='draggable';m='text/x-iri-';d=a.createElement('div');d.innerHTML='<p_style=\"position:fixed;top:0;right:0;font:bold_18px_sans-serif;color:#fff;background:#909;padding:10px;z-index:100000;\">"+a.translate("Drag items from this website, drop them in Renkan").replace(/ /g,"_")+"</p>'.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.x<paper.view.center.x?1:-1,h=b.x+g*(d+a.tooltip_arrow_length),i=b.x+g*(d+a.tooltip_arrow_length+a.tooltip_width),j=b.y-f/2;j+f>paper.view.size.height-a.tooltip_margin&&(j=Math.max(paper.view.size.height-a.tooltip_margin,b.y+a.tooltip_arrow_width/2)-f),j<a.tooltip_margin&&(j=Math.min(a.tooltip_margin,b.y-a.tooltip_arrow_width/2));var k=j+f;return c.segments[0].point=c.segments[7].point=b.add([g*d,0]),c.segments[1].point.x=c.segments[2].point.x=c.segments[5].point.x=c.segments[6].point.x=h,c.segments[3].point.x=c.segments[4].point.x=i,c.segments[2].point.y=c.segments[3].point.y=j,c.segments[4].point.y=c.segments[5].point.y=k,c.segments[1].point.y=b.y-a.tooltip_arrow_width/2,c.segments[6].point.y=b.y+a.tooltip_arrow_width/2,c.fillColor=new paper.Color(new paper.Gradient([a.tooltip_top_color,a.tooltip_bottom_color]),[0,j],[0,k]),e.css({left:a.tooltip_padding+Math.min(h,i),top:a.tooltip_padding+j}),c},increaseBrightness:function(a,b){a=a.replace(/^\s*#|\s*$/g,""),3===a.length&&(a=a.replace(/(.)/g,"$1$1"));var c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=parseInt(a.substr(4,2),16);return"#"+(0|256+c+(256-c)*b/100).toString(16).substr(1)+(0|256+d+(256-d)*b/100).toString(16).substr(1)+(0|256+e+(256-e)*b/100).toString(16).substr(1)}}}(window),function(a){"use strict";{var b=a.Backbone;a.Rkns.Router=b.Router.extend({routes:{"":"index"},index:function(a){var b={};null!==a&&a.split("&").forEach(function(a){var c=a.split("=");b[c[0]]=decodeURIComponent(c[1])}),this.trigger("router",b)}})}}(window),function(a){"use strict";var b=a.Rkns.DataLoader={converters:{from1to2:function(a){var b,c;if("undefined"!=typeof a.nodes)for(b=0,c=a.nodes.length;c>b;b++){var d=a.nodes[b];d.style=d.color?{color:d.color}:{}}if("undefined"!=typeof a.edges)for(b=0,c=a.edges.length;c>b;b++){var e=a.edges[b];e.style=e.color?{color:e.color}:{}}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);a[b]="undefined"==typeof f&&"undefined"!=typeof e?e: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,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_title:!0,show_node_editor_description:!0,show_node_editor_description_richtext:!0,show_node_editor_title_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é)","<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(){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(){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(){$(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,"<span class='searchmatch'>$1</span>")}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="<li><h3>Tags</h3></li>",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+="<li><h3>Annotations</h3></li>",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(),"<span class='searchmatch'>$1</span>")}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,"<span class='searchmatch'>$1</span>")}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(),"<span class='searchmatch'>$1</span>")}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.$("<div>").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){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(){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){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(){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(){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){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('<div class="Rk-Label">').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<this.all_buttons.length;d++)this.all_buttons[d].source_representation=this;this.active_buttons=[]}else this.active_buttons=this.all_buttons=[];this.last_circle_radius=1,this.renderer.minimap&&(this.renderer.minimap.node_layer.activate(),this.minimap_circle=new paper.Path.Circle([0,0],1),this.minimap_circle.__representation=this.renderer.minimap.miniframe.__representation,this.renderer.minimap.node_group.addChild(this.minimap_circle))},_getStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.node_stroke_width+(a-1)*(this.options.node_stroke_max_width-this.options.node_stroke_width)/(this.options.node_stroke_witdh_scale-1)},_getSelectedStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.selected_node_stroke_width+(a-1)*(this.options.selected_node_stroke_max_width-this.options.selected_node_stroke_width)/(this.options.node_stroke_witdh_scale-1)},buildShape:function(){"shape"in this.model.changed&&delete this.img,this.circle&&(this.circle.remove(),delete this.circle),this.shapeBuilder=new e(this.model.get("shape")),this.circle=this.shapeBuilder.getShape(),this.circle.__representation=this,this.circle.sendToBack(),this.last_circle_radius=1},redraw:function(a){"shape"in this.model.changed&&"change"in a&&a.change&&this.buildShape();var c=new paper.Point(this.model.get("position")),d=this.options.node_size_base*Math.exp((this.model.get("size")||0)*f._NODE_SIZE_STEP);this.is_dragging&&this.paper_coords||(this.paper_coords=this.renderer.toPaperCoords(c)),this.circle_radius=d*this.renderer.view.scale,this.last_circle_radius!==this.circle_radius&&(this.all_buttons.forEach(function(a){a.setSectorSize()}),this.circle.scale(this.circle_radius/this.last_circle_radius),this.node_image&&this.node_image.scale(this.circle_radius/this.last_circle_radius)),this.circle.position=this.paper_coords,this.node_image&&(this.node_image.position=this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius))),this.last_circle_radius=this.circle_radius;var e=this.active_buttons,g=1;this.model.get("delete_scheduled")?(g=.5,this.active_buttons=this.pending_delete_buttons,this.circle.dashArray=[2,2]):(g=1,this.active_buttons=this.normal_buttons,this.circle.dashArray=null),this.selected&&this.renderer.isEditable()&&!this.ghost&&(e!==this.active_buttons&&e.forEach(function(a){a.hide()}),this.active_buttons.forEach(function(a){a.show()})),this.node_image&&(this.node_image.opacity=this.highlighted?.5*g:g-.01),this.circle.fillColor=this.highlighted?this.options.highlighted_node_fill_color:this.options.node_fill_color,this.circle.opacity=this.options.show_node_circles?g:.01;var h=this.model.get("title")||this.renkan.translate(this.options.label_untitled_nodes)||"";h=f.shortenText(h,this.options.node_label_max_length),"object"==typeof this.highlighted?this.title.html(this.highlighted.replace(b(h).escape(),'<span class="Rk-Highlighted">$1</span>')):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){var b=q.renderer.getRepresentationByModel(a);b&&"undefined"!=typeof b.from_representation&&"undefined"!=typeof b.from_representation.paper_coords&&"undefined"!=typeof b.to_representation&&"undefined"!=typeof b.to_representation.paper_coords&&b.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){var c=a.renderer.getRepresentationByModel(b);c&&"undefined"!=typeof c.from_representation&&"undefined"!=typeof c.from_representation.paper_coords&&"undefined"!=typeof c.to_representation&&"undefined"!=typeof c.to_representation.paper_coords&&c.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){var b=c.renderer.getRepresentationByModel(a);b&&"undefined"!=typeof b.from_representation&&"undefined"!=typeof b.from_representation.paper_coords&&"undefined"!=typeof b.to_representation&&"undefined"!=typeof b.to_representation.paper_coords&&b.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){var c=a.renderer.getRepresentationByModel(b.get("to"));c&&c.ghost&&c.hide()})},showNeighbors:function(a){var c=this;b.each(this.project.get("edges").filter(function(a){return a.get("from")===c.model}),function(b){var d=c.renderer.getRepresentationByModel(b.get("to"));if(d&&d.hidden&&(d.show(a),!a)){var e=c.renderer.view.hiddenNodes.indexOf(d.model.id);-1!==e&&c.renderer.view.hiddenNodes.splice(e,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(){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){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('<div class="Rk-Label Rk-Edge-Label">').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;d<this.all_buttons.length;d++)this.all_buttons[d].source_representation=this;this.active_buttons=[]}else this.active_buttons=this.all_buttons=[];this.renderer.minimap&&(this.renderer.minimap.edge_layer.activate(),this.minimap_line=new paper.Path,this.minimap_line.add([0,0],[0,0]),this.minimap_line.__representation=this.renderer.minimap.miniframe.__representation,this.minimap_line.strokeWidth=1)},_getStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.edge_stroke_width+(a-1)*(this.options.edge_stroke_max_width-this.options.edge_stroke_width)/(this.options.edge_stroke_witdh_scale-1)},_getSelectedStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.selected_edge_stroke_width+(a-1)*(this.options.selected_edge_stroke_max_width-this.options.selected_edge_stroke_width)/(this.options.edge_stroke_witdh_scale-1)},_getArrowScale:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return 1+(a-1)*(this.options.edge_arrow_max_width/this.options.edge_arrow_width-1)/(this.options.edge_stroke_witdh_scale-1)},redraw:function(){var a=this.model.get("from"),b=this.model.get("to");if(a&&b&&(!this.hidden||this.ghost)){if(this.from_representation=this.renderer.getRepresentationByModel(a),this.to_representation=this.renderer.getRepresentationByModel(b),"undefined"==typeof this.from_representation||"undefined"==typeof this.to_representation||this.from_representation.hidden&&!this.from_representation.ghost||this.to_representation.hidden&&!this.to_representation.ghost)return void this.hide();var c,d=this._getStrokeWidth(),f=this._getArrowScale(),g=this.from_representation.paper_coords,h=this.to_representation.paper_coords,i=h.subtract(g),j=i.length,k=i.divide(j),l=new paper.Point([-k.y,k.x]),m=this.bundle.getPosition(this),n=l.multiply(this.options.edge_gap_in_bundles*m),o=g.add(n),p=h.add(n),q=i.angle,r=l.multiply(this.options.edge_label_distance+.5*f*this.options.edge_arrow_width),s=i.divide(3),t=this.model.has("style")&&this.model.get("style").color||(this.model.get("created_by")||e._USER_PLACEHOLDER(this.renkan)).get("color"),u=this.model.has("style")&&this.model.get("style").dash?this.options.default_dash_array:null;this.model.get("delete_scheduled")||this.from_representation.model.get("delete_scheduled")||this.to_representation.model.get("delete_scheduled")?(c=.5,this.line.dashArray=[2,2]):(c=this.ghost?this.options.ghost_opacity:1,this.line.dashArray=null);var v=this.active_buttons;this.arrow.visible=this.model.has("style")&&this.model.get("style").arrow||!this.model.has("style")||"undefined"==typeof this.model.get("style").arrow,this.active_buttons=this.model.get("delete_scheduled")?this.pending_delete_buttons:this.normal_buttons,this.selected&&this.renderer.isEditable()&&v!==this.active_buttons&&(v.forEach(function(a){a.hide()}),this.active_buttons.forEach(function(a){a.show()})),this.paper_coords=o.add(p).divide(2),this.line.strokeWidth=d,this.line.strokeColor=t,this.line.dashArray=u,this.line.opacity=c,this.line.segments[0].point=g,this.line.segments[1].point=this.paper_coords,this.line.segments[1].handleIn=s.multiply(-1),this.line.segments[1].handleOut=s,this.line.segments[2].point=h,this.arrow.scale(f/this.arrow_scale),this.arrow_scale=f,this.arrow.fillColor=t,this.arrow.opacity=c,this.arrow.rotate(q-this.arrow_angle,this.arrow.bounds.center),this.arrow.position=this.paper_coords,this.arrow_angle=q,q>90&&(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){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){var b=paper.project.hitTest(a.point),c=this.from_representation.model,d=!0;if(b&&"undefined"!=typeof b.item.__representation){var f=b.item.__representation;if("Node"===f.type.substr(0,4)){var g=f.model||f.source_representation.model;if(c!==g){var h={id:e.getUID("edge"),created_by:this.renkan.current_user,from:c,to:g};this.renderer.isEditable()&&this.project.addEdge(h)}}(c===f.model||f.source_representation&&f.source_representation.model===c)&&(d=!1,this.renderer.is_dragging=!0)}d&&(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){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("<div>").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){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=j.options.show_node_editor_title_richtext?a(".Rk-Edit-Title").ckeditor(j.options.richtext_editor_config):!1,m=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()}if(j.options.show_node_editor_title_richtext&&"undefined"!=typeof l.editor){var b=l.editor;delete l.editor,b.focusManager.blur(!0),b.destroy()}},this.editor_$.find(".Rk-CloseX").click(function(a){a.preventDefault(),m()}),this.editor_$.find(".Rk-Edit-Goto").click(function(){return c.get("uri")?void 0:!1}),this.renderer.isEditable()){var n=b.throttle(function(){b.defer(function(){if(j.renderer.isEditable()){var a={};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_title&&(j.options.show_node_editor_title_richtext?"undefined"!=typeof l.editor&&l.editor.checkDirty()&&(a.title=l.editor.getData(),l.editor.resetDirty()):a.title=j.editor_$.find(".Rk-Edit-Title").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 m()})},1e3);this.editor_$.on("keyup",function(a){27===a.keyCode&&m()}),this.editor_$.find("input, textarea, select").on("change keyup paste",n),j.options.show_node_editor_description&&j.options.show_node_editor_description_richtext&&"undefined"!=typeof k.editor&&(k.editor.on("change",n),k.editor.on("blur",n)),j.options.show_node_editor_title&&j.options.show_node_editor_title_richtext&&"undefined"!=typeof l.editor&&(l.editor.on("change",n),l.editor.on("blur",n)),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),n()},b.readAsDataURL(a)}}),this.editor_$.find(".Rk-Edit-Title")[0].focus();var o=j.editor_$.find(".Rk-Edit-ColorPicker");this.editor_$.find(".Rk-Edit-ColorPicker-Wrapper").hover(function(a){a.preventDefault(),o.show()},function(a){a.preventDefault(),o.hide()}),o.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")})),o.hide(),paper.view.draw()):m()});var p=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 m()};this.editor_$.find("#Rk-Edit-Size-Down").click(function(){return p(-1),!1}),this.editor_$.find("#Rk-Edit-Size-Up").click(function(){return p(1),!1});var q=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 m()};this.editor_$.find("#Rk-Edit-Thickness-Down").click(function(){return q(-1),!1}),this.editor_$.find("#Rk-Edit-Thickness-Up").click(function(){return q(1),!1}),this.editor_$.find(".Rk-Edit-Image-Del").click(function(){return j.editor_$.find(".Rk-Edit-Image").val(""),n(),!1})}else if("object"==typeof this.source_representation.highlighted){var r=this.source_representation.highlighted.replace(b(c.get("title")).escape(),'<span class="Rk-Highlighted">$1</span>');this.editor_$.find(".Rk-Display-Title"+(c.get("uri")?" a":"")).html(r),this.options.show_node_tooltip_description&&this.editor_$.find(".Rk-Display-Description").html(this.source_representation.highlighted.replace(b(c.get("description")).escape(),'<span class="Rk-Highlighted">$1</span>'))}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){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){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){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){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){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){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){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){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){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)}}}).value(),f}),define("renderer/nodeenlargebutton",["jquery","underscore","requtils","renderer/nodebutton"],function(a,b,c,d){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){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){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){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){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){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(){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){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"),this.editor_$=c.options.popup_editor?this.$.find(".Rk-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-_lastTap<f._DOUBLETAP_DELAY&&Math.pow(j-b.pageX,2)+Math.pow(k-b.pageY,2)<f._DOUBLETAP_DISTANCE?(_lastTap=0,d.onDoubleClick(b)):(_lastTap=new Date,j=b.pageX,k=b.pageY,h=d.view.scale,i=!1,d.onMouseDown(b,!0))},touchmove:function(a){if(a.preventDefault(),_lastTap=0,1===a.originalEvent.touches.length)d.onMouseMove(a.originalEvent.touches[0],!0);else{if(i||(d.onMouseUp(a.originalEvent.touches[0],!0),d.click_target=null,d.is_dragging=!1,i=!0),"undefined"===a.originalEvent.scale)return;var b=a.originalEvent.scale*h,c=b/d.view.scale,e=new paper.Point([d.canvas_$.width(),d.canvas_$.height()]).multiply(.5*(1-c)).add(d.view.offset.multiply(c));d.view.setScale(b,e)}},touchend:function(a){a.preventDefault(),d.onMouseUp(a.originalEvent.changedTouches[0],!0)},dblclick:function(a){a.preventDefault(),c.options.allow_double_click&&d.onDoubleClick(a)},mouseleave:function(a){a.preventDefault(),d.click_target=null,d.is_dragging=!1},dragover:function(a){a.preventDefault()},dragenter:function(a){a.preventDefault(),g=!1},dragleave:function(a){a.preventDefault(),g=!0},drop:function(a){a.preventDefault(),g=!0;var c={};b.each(a.originalEvent.dataTransfer.types,function(b){try{c[b]=a.originalEvent.dataTransfer.getData(b)}catch(d){}});var e=a.originalEvent.dataTransfer.getData("Text");if("string"==typeof e)switch(e[0]){case"{":case"[":try{var f=JSON.parse(e);b.extend(c,f)}catch(h){c["text/plain"]||(c["text/plain"]=e)}break;case"<":c["text/html"]||(c["text/html"]=e);break;default:c["text/plain"]||(c["text/plain"]=e)}var i=a.originalEvent.dataTransfer.getData("URL");i&&!c["text/uri-list"]&&(c["text/uri-list"]=i),d.dropData(c,a.originalEvent)}});var m=function(a,b){d.$.find(a).click(function(a){return d[b](a),!1})};this.renkan.project.get("views").length>0&&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(){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},K.paragraphStyle.justification=H>2?"left":-2>H?"right":"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('<li class="Rk-User"><span class="Rk-UserColor" style="background:<%=background%>;"></span><%=name%></li>'),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("<unknown user>")),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("<input>").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(){b.each(this.representations,function(a){a.unhighlight()})},unselectAll:function(){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("<div>").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("<div>").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("<div>").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("<div>").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;k<j.length;k++){var l=j[k];(b["text/x-iri-"+l]||b[l])&&(c[l]=b["text/x-iri-"+l]||b[l]),("none"===c[l]||"null"===c[l])&&(c[l]=void 0)}return"function"==typeof this.renkan.options.drop_enhancer&&(c=this.renkan.options.drop_enhancer(c,b)),c},dropData:function(a,c){if(this.isEditable()){if(a["text/json"]||a["application/json"])try{var d=JSON.parse(a["text/json"]||a["application/json"]);b.extend(a,d)}catch(e){}var g="undefined"==typeof this.renkan.options.drop_handler?this.defaultDropHandler(a):this.renkan.options.drop_handler(a),h=this.canvas_$.offset(),i=new paper.Point([c.pageX-h.left,c.pageY-h.top]),j=this.toModelCoords(i),k={id:f.getUID("node"),created_by:this.renkan.current_user,uri:g.uri||"",title:g.title||"",description:g.description||"",image:g.image||"",color:g.color||void 0,clip_path:g.clipPath||void 0,position:{x:j.x,y:j.y}},l=this.renkan.project.addNode(k),m=this.getRepresentationByModel(l);"drop"===c.type&&m.openEditor()}},fullScreen:function(){var a,b=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen,c=this.renkan.$[0],d=["requestFullScreen","mozRequestFullScreen","webkitRequestFullScreen"],e=["cancelFullScreen","mozCancelFullScreen","webkitCancelFullScreen"];if(b){for(a=0;a<e.length;a++)if("function"==typeof document[e[a]]){document[e[a]]();break}var f=this.$.width(),g=this.$.height();this.renkan.options.show_top_bar&&(g-=this.$.find(".Rk-TopBar").height()),this.renkan.options.show_bins&&this.renkan.$.find(".Rk-Bins").position().left>0&&(f-=this.renkan.$.find(".Rk-Bins").width()),paper.view.viewSize=new paper.Size([f,g])}else{for(a=0;a<d.length;a++)if("function"==typeof c[d[a]]){c[d[a]]();break}this.redraw()}},addNodeBtn:function(){return this.click_mode===f._CLICKMODE_ADDNODE?(this.click_mode=!1,this.notif_$.hide()):(this.click_mode=f._CLICKMODE_ADDNODE,this.notif_$.text(this.renkan.translate("Click on the background canvas to add a node")).fadeIn()),!1},addEdgeBtn:function(){return this.click_mode===f._CLICKMODE_STARTEDGE||this.click_mode===f._CLICKMODE_ENDEDGE?(this.click_mode=!1,this.notif_$.hide()):(this.click_mode=f._CLICKMODE_STARTEDGE,this.notif_$.text(this.renkan.translate("Click on a first node to start the edge")).fadeIn()),!1},exportProject:function(){var a=this.renkan.project.toJSON(),d=(document.createElement("a"),a.id),e=d+".json";delete a.id,delete a._id,delete a.space_id;var g,h,i={};b.each(a.nodes,function(a){g=a.id||a._id,delete a._id,delete a.id,i[g]=a["@id"]=f.getUUID4()}),b.each(a.edges,function(a){delete a._id,delete a.id,a.to=i[a.to],a.from=i[a.from]}),b.each(a.views,function(a){delete a._id,delete a.id,a.hidden_nodes&&(h=a.hidden_nodes,a.hidden_nodes=[],b.each(h,function(b){a.hidden_nodes.push(i[b])}))}),a.users=[];var j=JSON.stringify(a,null,2),k=new Blob([j],{type:"application/json;charset=utf-8"});c(k,e)},parameters:function(b){if(a.isEmptyObject(b))return this.view=this.addRepresentation("View",this.renkan.project.get("views").first()),void this.view.autoScale();if("undefined"!=typeof b.idView&&"undefined"!=typeof this.renkan.project.get("views").at(b.idView)&&(this.view=this.addRepresentation("View",this.renkan.project.get("views").at(b.idView))),"undefined"!=typeof b.view&&b.view.split(",").length>=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").first()),this.view.autoScale()),this.unhighlightAll(),"undefined"!=typeof b.idNode&&this.highlightModel(this.renkan.project.get("nodes").get(b.idNode))},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()<c.height()?e:e-c.width(),b.html("&laquo;")):(c.animate({left:-300},250),this.$.animate({left:0},250,function(){var a=d.$.width();paper.view.viewSize=new paper.Size([a,d.canvas_$.height()])}),a=e+300,b.html("&raquo;")),d.view.resizeZoom(1,1,a/e)},save:function(){},open:function(){}}).value(),g}),define("renderer/viewrepr",["jquery","underscore","requtils","renderer/baserepresentation"],function(a,b,c,d){var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){var b=this;this.$=a(".Rk-Render"),this.type="View",this.hiddenNodes=[],this.scale=1,this.initialScale=1,this.offset=paper.view.center,this.params={},this.model&&(this.params={zoom_level:b.model.get("zoom_level"),offset:b.model.get("offset"),hidden_nodes:b.model.get("hidden_nodes")}),this.init();var c=function(a,c){b.$.find(a).click(function(a){return b[c](a),!1})};c(".Rk-ZoomOut","zoomOut"),c(".Rk-ZoomIn","zoomIn"),c(".Rk-ZoomFit","autoScale"),this.$.find(".Rk-ZoomSave").click(function(){var a={x:b.offset.x,y:b.offset.y};b.model&&b.renkan.project.get("views").indexOf(b.model)>0?b.model.set({zoom_level:b.scale,offset:a,hidden_nodes:b.hiddenNodes.concat()}):b.model=b.renkan.project.addView({zoom_level:b.scale,offset:a,hidden_nodes:b.hiddenNodes.concat()}),b.params={zoom_level:b.model.get("zoom_level"),offset:b.model.get("offset"),hidden_nodes:b.model.get("hidden_nodes")},b.updateUrl()}),this.$.find(".Rk-ZoomSetSaved").click(function(){b.setScale(b.params.zoom_level,new paper.Point(b.params.offset)),b.showNodes(!1),b.options.hide_nodes&&(b.hiddenNodes=(b.params.hidden_nodes||[]).concat(),b.hideNodes())}),this.$.find(".Rk-ShowHiddenNodes").mouseenter(function(){b.showNodes(!0),b.$.find(".Rk-ShowHiddenNodes").mouseleave(function(){b.hideNodes()})}),this.$.find(".Rk-ShowHiddenNodes").click(function(){b.showNodes(!1),b.$.find(".Rk-ShowHiddenNodes").off("mouseleave")}),this.renkan.project.get("views").length>0&&this.renkan.options.save_view&&this.$.find(".Rk-ZoomSetSaved").show()},redraw:function(){},init:function(){var a=this;a.setScale(a.params.zoom_level,new paper.Point(a.params.offset)),a.showNodes(!1),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.initialScale<e._MAX_SCALE&&(this.scale=a,b&&(this.offset=b),this.renderer.redraw(),this.updateUrl())},zoomOut:function(){var a=this.scale*Math.SQRT1_2,b=new paper.Point([this.renderer.canvas_$.width(),this.renderer.canvas_$.height()]).multiply(.5*(1-Math.SQRT1_2)).add(this.offset.multiply(Math.SQRT1_2));this.setScale(a,b)},zoomIn:function(){var a=this.scale*Math.SQRT2,b=new paper.Point([this.renderer.canvas_$.width(),this.renderer.canvas_$.height()]).multiply(.5*(1-Math.SQRT2)).add(this.offset.multiply(Math.SQRT2));this.setScale(a,b)},resizeZoom:function(a,b,c){var d=this.scale*c,e=new paper.Point([this.offset.x*a,this.offset.y*b]);this.setScale(d,e)},autoScale:function(a){var b=this.renkan.project.get("nodes");if(b.length>1){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.idView=this.renkan.project.get("views").indexOf(this.model):b.idView&&delete b.idView,this.renkan.router.navigate("?"+decodeURIComponent(a.param(b)),{trigger:!1,replace:!0})}}}).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){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
--- a/server/php/basic/public_html/static/lib/renkan/js/renkan.min.map	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/php/basic/public_html/static/lib/renkan/js/renkan.min.map	Tue Sep 15 17:08:53 2015 +0200
@@ -1,1 +1,1 @@
-{"version":3,"file":"renkan.min.js","sources":["templates.js","../../js/main.js","../../js/router.js","../../js/dataloader.js","../../js/models.js","../../js/defaults.js","../../js/i18n.js","../../js/full-json.js","../../js/save-once.js","../../js/ldtjson-bin.js","../../js/list-bin.js","../../js/wikipedia-bin.js","paper-renderer.js"],"names":["this","obj","__t","__p","_","escape","__e","Array","prototype","join","renkan","translate","edge","title","options","show_edge_editor_uri","uri","properties","length","each","ontology","label","property","show_edge_editor_style","show_edge_editor_style_color","show_edge_editor_style_dash","dash","show_edge_editor_style_thickness","thickness","show_edge_editor_style_arrow","arrow","show_edge_editor_direction","show_edge_editor_nodes","from_color","shortenText","from_title","to_title","show_edge_editor_creator","has_creator","created_by_title","show_edge_tooltip_color","color","show_edge_tooltip_uri","short_uri","show_edge_tooltip_nodes","to_color","show_edge_tooltip_creator","created_by_color","Rkns","Utils","getFullURL","image","description","static_url","url","show_bins","show_editor","node","show_node_editor_uri","change_types","types","type","charAt","toUpperCase","substring","show_node_editor_description","show_node_editor_description_richtext","show_node_editor_size","size","show_node_editor_style","show_node_editor_style_color","show_node_editor_style_dash","show_node_editor_style_thickness","show_node_editor_image","image_placeholder","clip_path","allow_image_upload","show_node_editor_creator","change_shapes","shapes","shape","show_node_tooltip_color","show_node_tooltip_uri","show_node_tooltip_description","show_node_tooltip_image","show_node_tooltip_creator","_id","print","__j","call","arguments","show_top_bar","editor_mode","project","get","show_user_list","show_user_color","user_color_editable","colorPicker","home_button_url","home_button_title","show_fullscreen_button","show_addnode_button","show_addedge_button","show_export_button","show_save_button","show_open_button","show_bookmarklet","show_search_field","resize","show_zoom","save_view","hide_nodes","root","$","jQuery","pickerColors","__renkans","_BaseBin","_renkan","_opts","find","hide","addClass","appendTo","title_icon_$","_this","attr","href","html","click","destroy","slideDown","resizeBins","refresh","count_$","title_$","main_$","auto_refresh","window","setInterval","detach","Renkan","push","defaults","templates","renkanJST","node_editor_templates","template","types_templates","value","key","property_files","f","getJSON","data","concat","read_only","router","Router","Models","Project","dataloader","DataLoader","Loader","setCurrentUser","user_id","user_name","addUser","current_user","renderer","redrawUsers","container","tabs","search_engines","current_user_list","UsersList","on","_tmpl","map","c","Renderer","Scene","search","_select","_input","_form","_search","_key","Search","getSearchTitle","className","getBgClass","_el","setSearchEngine","submit","val","search_engine","mouseenter","mouseleave","bins","_bin","Bin","elementDropped","_mainDiv","siblings","is","slideUp","_e","_t","_models","where","_model","highlightModel","mouseout","unhighlightAll","e","dragDrop","err","preventDefault","touch","originalEvent","changedTouches","off","canvas_$","offset","w","width","h","height","pageX","left","pageY","top","onMouseMove","div","document","createElement","appendChild","cloneNode","dropData","text/html","innerHTML","onMouseDown","onMouseUp","dataTransfer","setData","lastsearch","lastval","regexpFromTextOrArray","source","tab","render","_text","i18n","language","substr","onStatusChange","listClasses","split","classes","i","_d","outerHeight","css","getUUID4","replace","r","Math","random","v","toString","getUID","pad","n","Date","ID_AUTO_INCREMENT","ID_BASE","getUTCFullYear","getUTCMonth","getUTCDate","_base","_n","_uidbase","test","img","Image","src","res","inherit","_baseClass","_callbefore","_class","_arg","apply","slice","_init","_initialized","extend","replaceText","makeReplaceFunc","l","k","charsrx","txt","toLowerCase","remrx","j","remsrc","charsub","getSource","inp","removeChars","String","fromCharCode","RegExp","_textOrArray","testrx","replacerx","isempty","_replace","text","_MIN_DRAG_DISTANCE","_NODE_BUTTON_WIDTH","_EDGE_BUTTON_INNER","_EDGE_BUTTON_OUTER","_CLICKMODE_ADDNODE","_CLICKMODE_STARTEDGE","_CLICKMODE_ENDEDGE","_NODE_SIZE_STEP","LN2","_MIN_SCALE","_MAX_SCALE","_MOUSEMOVE_RATE","_DOUBLETAP_DELAY","_DOUBLETAP_DISTANCE","_USER_PLACEHOLDER","default_user_color","_BOOKMARKLET_CODE","_maxlength","drawEditBox","_options","_coords","_path","_xmargin","_selector","tooltip_width","tooltip_padding","_height","_isLeft","x","paper","view","center","_left","tooltip_arrow_length","_right","_top","y","tooltip_margin","max","tooltip_arrow_width","min","_bottom","segments","point","add","closed","fillColor","GradientColor","Gradient","tooltip_top_color","tooltip_bottom_color","increaseBrightness","hex","percent","parseInt","g","b","Backbone","routes","index","parameters","result","forEach","part","item","decodeURIComponent","trigger","converters","from1to2","len","nodes","style","edges","schema_version","dataConverters","convert","schemaVersionFrom","getSchemaVersion","schemaVersionTo","converterName","load","set","validate","guid","RenkanModel","RelationalModel","idAttribute","constructor","id","prepare","addReference","_propName","_list","_default","_element","User","toJSON","Node","relations","HasOne","relatedModel","created_by","position","Edge","from","to","View","isArray","zoom_level","hidden_nodes","RosterUser","blacklist","HasMany","reverseRelation","includeInJSON","_props","_user","findOrCreate","addNode","_node","addEdge","_edge","addView","_view","removeNode","remove","removeEdge","_project","users","views","_item","t","version","initialize","filter","json","clone","attributes","Model","Collection","omit","site_id","model","navigator","userLanguage","popup_editor","editor_panel","manual_save","size_bug_fix","force_resize","allow_double_click","zoom_on_scroll","element_delete_delay","autoscale_padding","default_view","user_name_editable","show_minimap","minimap_width","minimap_height","minimap_padding","minimap_background_color","minimap_border_color","minimap_highlight_color","minimap_highlight_weight","buttons_background","buttons_label_color","buttons_label_font_size","ghost_opacity","default_dash_array","show_node_circles","clip_node_images","node_images_fill_mode","node_size_base","node_stroke_width","node_stroke_max_width","selected_node_stroke_width","selected_node_stroke_max_width","node_stroke_witdh_scale","node_fill_color","highlighted_node_fill_color","node_label_distance","node_label_max_length","label_untitled_nodes","default","video","edge_stroke_width","edge_stroke_max_width","selected_edge_stroke_width","selected_edge_stroke_max_width","edge_stroke_witdh_scale","edge_label_distance","edge_label_max_length","edge_arrow_length","edge_arrow_width","edge_arrow_max_width","edge_gap_in_bundles","label_untitled_edges","tooltip_border_color","tooltip_border_width","richtext_editor_config","toolbarGroups","name","groups","removePlugins","uploaded_image_max_kb","fr","Edit Node","Edit Edge","Title:","URI:","Description:","From:","To:","Image URL:","Choose Image File:","Full Screen","Add Node","Add Edge","Save Project","Open Project","Auto-save enabled","Connection lost","Created by:","Zoom In","Zoom Out","Edit","Remove","Cancel deletion","Link to another node","Enlarge","Shrink","Click on the background canvas to add a node","Click on a first node to start the edge","Click on a second node to complete the edge","Wikipedia","Wikipedia in ","French","English","Japanese","Untitled project","Lignes de Temps","Loading, please wait","Edge color:","Dash:","Thickness:","Arrow:","Node color:","Choose color","Change edge direction","Do you really wish to remove node ","Do you really wish to remove edge ","This file is not an image","Image size must be under ","Size:","KB","Choose from vocabulary:","SKOS Documentation properties","has note","has example","has definition","SKOS Semantic relations","has broader","has narrower","has related","Dublin Core Metadata","has contributor","covers","created by","has date","published by","has source","has subject","Dragged resource","Search the Web","Search in Bins","Close bin","Refresh bin","(untitled)","Select contents:","Drag items from this website, drop them in 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.","Shapes available","Circle","Square","Diamond","Hexagone","Ellipse","Star","Cloud","Triangle","Zoom Fit","Download Project","Save view","View saved view","Renkan 'Drag-to-Add' bookmarklet","(unknown user)","<unknown user>","Search in graph","Search in ","jsonIO","_proj","http_method","_load","redrawActive","loadingStatus","_data","saveStatus","fixSize","_save","ajax","contentType","JSON","stringify","success","textStatus","jqXHR","_thrSave","throttle","setTimeout","changedAttributes","hasChanged","jsonIOSaveOnClick","_saveWarn","_onLeave","getdata","rx","matches","location","hash","match","beforeSend","autoScale","_checkLeave","removeClass","save","hasClass","Ldt","ProjectBin","ldt_type","Resclass","console","error","tagTemplate","annotationTemplate","proj_id","project_id","ldt_platform","searchbase","highlight","convertTC","_ms","_res","_totalSeconds","abs","floor","_hours","_minutes","_seconds","_html","_projtitle","meta","count","tags","_tag","_title","htitle","encodedtitle","encodeURIComponent","annotations","_annotation","_description","content","_duration","end","begin","_img","hdescription","start","duration","mediaid","media","annotationid","show","dataType","lang","_q","ResultsBin","segmentTemplate","max_results","highlightrx","objects","_segment","_begin","start_ts","_end","iri_id","element_id","format","q","limit","ResourceList","resultTemplate","list","trim","_match","langs","en","ja","query","_result","encodeURI","snippet","define","_BaseRepresentation","_renderer","_changeBinding","redraw","change","_removeBinding","removeRepresentation","defer","_selectBinding","select","_unselectBinding","unselect","_super","_func","moveTo","unhighlight","mousedown","mouseup","getUtils","getRenderer","requtils","BaseRepresentation","_BaseButton","_pos","sector","_newTarget","source_representation","cloud_path","builders","circle","getShape","Path","getImageShape","radius","rectangle","Rectangle","ellipse","polygon","RegularPolygon","diamond","d","SQRT2","rotate","star","cloud","path","scale","triangle","svg","ShapeBuilder","NodeRepr","node_layer","activate","buildShape","hidden","ghost","strokeWidth","h_ratio","labels_$","normal_buttons","NodeEditButton","NodeRemoveButton","NodeLinkButton","NodeEnlargeButton","NodeShrinkButton","NodeHideButton","NodeShowButton","pending_delete_buttons","NodeRevertButton","all_buttons","active_buttons","last_circle_radius","minimap","minimap_circle","__representation","miniframe","node_group","addChild","_getStrokeWidth","has","_getSelectedStrokeWidth","changed","shapeBuilder","sendToBack","_model_coords","Point","_baseRadius","exp","is_dragging","paper_coords","toPaperCoords","circle_radius","setSectorSize","node_image","subtract","image_delta","multiply","old_act_btn","opacity","dashArray","selected","isEditable","highlighted","_strokeWidth","_color","_dash","strokeColor","_pc","lastImage","showImage","minipos","toMinimapCoords","miniradius","minisize","Size","fitBounds","dontRedrawEdges","ed","repr","getRepresentationByModel","from_representation","to_representation","_image","image_cache","clipPath","hasClipPath","_clip","baseRadius","centerPoint","instructions","lastCoords","minX","Infinity","minY","maxX","maxY","transformCoords","tabc","relative","newCoords","parseFloat","isY","instr","coords","lineTo","cubicCurveTo","quadraticCurveTo","_raster","Raster","locked","Group","clipped","_circleClip","divide","insertAbove","paperShift","_delta","openEditor","removeRepresentationsOfType","_editor","addRepresentation","draw","_uri","showNeighbors","hideButtons","buttons_timeout","undefined","hideNeighbors","indexNode","hiddenNodes","indexOf","splice","textToReplace","hlvalue","throttledPaperDraw","saveCoords","toModelCoords","_event","_isTouch","unselectAll","click_target","edge_layer","bundle","addToBundles","line","arrow_scale","pivot","arrow_angle","EdgeEditButton","EdgeRemoveButton","EdgeRevertButton","minimap_line","_getArrowScale","_opacity","_arrow_scale","_p0a","_p1a","_v","_r","_u","_ortho","_group_pos","getPosition","_p0b","_p1b","_a","angle","_textdelta","_handle","visible","handleIn","handleOut","bounds","_textpos","transform","-moz-transform","-webkit-transform","text_angle","reject","TempEdge","_p0","_p1","end_pos","_c","_hitResult","hitTest","findTarget","_endDrag","_target","_destmodel","_BaseEditor","buttons_layer","editor_block","_pts","range","editor_$","BaseEditor","NodeEditor","readOnlyTemplate","_created_by","_template","_image_placeholder","_size","keys","editorInstance","ckeditor","closeEditor","cleanEditor","editor","focusManager","blur","onFieldChange","checkDirty","getData","resetDirty","assign","keyCode","files","FileReader","alert","onload","target","readAsDataURL","focus","_picker","hover","shiftSize","_newsize","shiftThickness","_oldThickness","_newThickness","titlehtml","EdgeEditor","_from_model","_to_model","BaseButton","_NodeButton","sectorInner","lastSectorInner","drawSector","startAngle","endAngle","imageName","clearTimeout","NodeButton","delid","delete_list","time","valueOf","confirm","addHiddenNode","unset","_off","_point","addTempEdge","MiniFrame","filesaver","representations","notif_$","setup","initialScale","totalScroll","mouse_down","selected_target","Layer","background_layer","topleft","bottomRight","cliprectangle","bundles","click_mode","_allowScroll","_originalScale","_zooming","_lastTapX","_lastTapY","icon_cache","imgname","throttledMouseMove","mousemove","mousewheel","onScroll","touchstart","_touches","touches","_lastTap","pow","onDoubleClick","touchmove","_newScale","_scaleRatio","_newOffset","setScale","touchend","dblclick","dragover","dragenter","dragleave","drop","parse","bindClick","selector","fname","evt","last","showNodes","hideNodes","fadeIn","delay","fadeOut","mouseover","onResize","_ratio","newWidth","newHeight","ratioH","delta","ratioW","resizeZoom","_thRedraw","addRepresentations","_thRedrawUsers","history","el","_params","_delay","$cpwrapper","$cplist","$this","rxs","_now","findWhere","delete_scheduled","rescaleMinimap","_repr","_inR","_outR","_startAngle","_endAngle","_padding","_imgname","_caption","_startRads","PI","_endRads","_startdx","sin","_startdy","cos","_startXIn","_startYIn","_startXOut","_startYOut","_enddx","_enddy","_endXIn","_endYIn","_endXOut","_endYOut","_centerR","_centerRads","_centerX","_centerY","_centerXIn","_centerXOut","_centerYIn","_centerYOut","_textX","_textY","arcTo","PointText","characterStyle","fontSize","paragraphStyle","justification","_visible","_restPos","_grp","_imgdelta","_currentPos","_edgeRepr","_bundle","_er","_dir","savebtn","tip","_offset","force_view","_xx","_yy","_minx","_miny","_maxx","_maxy","_scale","at","redrawMiniframe","bottomright","_type","RendererType","_collection","userTemplate","allUsers","models","ulistHtml","$userpanel","$name","$cpitems","$colorsquare","$input","empty","parent","background","_representation","_representations","_from","_tmpEdge","hideNode","last_point","_scrolldelta","SQRT1_2","open","defaultDropHandler","newNode","tweetdiv","_svgimgs","_svgpaths","_imgs","_as","fields","drop_enhancer","jsondata","drop_handler","_nodedata","fullScreen","_isFull","mozFullScreen","webkitIsFullScreen","_requestMethods","_cancelMethods","widthAft","heightAft","viewSize","zoomOut","zoomIn","_scaleWidth","_scaleHeight","addNodeBtn","addEdgeBtn","exportProject","projectJSON","projectId","fileNameToSaveAs","space_id","objId","idsMap","projectJSONStr","blob","Blob","idnode","foldBins","sizeAft","foldBinsButton","sizeBef","animate","require","config","paths","jquery","underscore","ckeditor-core","ckeditor-jquery","shim","deps","startRenkan"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,KAAgB,UAAIA,KAAgB,cAEpCA,KAAgB,UAAE,8BAAgC,SAASC,KAC3DA,MAAQA,OACR,IAAIC,KAAKC,IAAM,EAAUC,GAAEC,MAC3B,MAAMJ,IACNE,KAAO,oBACS,OAAdD,IAAM,GAAe,GAAKA,KAC5B,yBACgB,OAAdA,IAAM,GAAe,GAAKA,KAC5B,SAGA,OAAOC,MAGPH,KAAgB,UAAE,6BAA+B,SAASC,KAC1DA,MAAQA,OACR,IAAIC,KAAKC,IAAM,GAAIG,IAAMF,EAAEC,MAAcE,OAAMC,UAAUC,IAEzD,MAAMR,IACNE,KAAO,mDACPG,IAAII,OAAOC,UAAU,cACrB,mCACAL,IAAII,OAAOC,UAAU,WACrB,iEACAL,IAAIM,KAAKC,OACT,eACKC,QAAQC,uBACbZ,KAAO,6BACPG,IAAII,O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AAKqI,QAEpBA,GAAS0iB,oBAAsBqB,EAC/B/jB,EAASgkB,YAAc6P,EACvB7zB,EAAS8O,KAAO8W,EAChB5lB,EAASoP,KAAOA,EAChBpP,EAASqwB,SAAWA,EACpBrwB,EAASgxB,YAAcM,EACvBtxB,EAASuxB,WAAaA,EACtBvxB,EAAS0zB,WAAaA,EACtB1zB,EAAS8zB,YAAcQ,EACvBt0B,EAASsmB,eAAiBA,EAC1BtmB,EAASumB,iBAAmBA,EAC5BvmB,EAAS2mB,eAAiBA,EAC1B3mB,EAAS4mB,eAAiBA,EAC1B5mB,EAAS8mB,iBAAmBA,EAC5B9mB,EAASwmB,eAAiBA,EAC1BxmB,EAASymB,kBAAoBA,EAC7BzmB,EAAS0mB,iBAAmBA,EAC5B1mB,EAASsuB,eAAiBA,EAC1BtuB,EAASuuB,iBAAmBA,EAC5BvuB,EAASwuB,iBAAmBA,EAC5BxuB,EAASi1B,UAAYA,EACrBj1B,EAASC,MAAQA,EAEjB2iC,gBAGJngB,OAAO,gBAAiB","sourcesContent":["this[\"renkanJST\"] = this[\"renkanJST\"] || {};\n\nthis[\"renkanJST\"][\"templates/colorpicker.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li data-color=\"' +\n((__t = (c)) == null ? '' : __t) +\n'\" style=\"background: ' +\n((__t = (c)) == null ? '' : __t) +\n'\"></li>';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/edgeeditor.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>' +\n__e(renkan.translate(\"Edit Edge\")) +\n'</span>\\n</h2>\\n<p>\\n    <label>' +\n__e(renkan.translate(\"Title:\")) +\n'</label>\\n    <input class=\"Rk-Edit-Title\" type=\"text\" value=\"' +\n__e(edge.title) +\n'\" />\\n</p>\\n';\n if (options.show_edge_editor_uri) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"URI:\")) +\n'</label>\\n        <input class=\"Rk-Edit-URI\" type=\"text\" value=\"' +\n__e(edge.uri) +\n'\" />\\n        <a class=\"Rk-Edit-Goto\" href=\"' +\n__e(edge.uri) +\n'\" target=\"_blank\"></a>\\n    </p>\\n    ';\n if (options.properties.length) { ;\n__p += '\\n        <p>\\n            <label>' +\n__e(renkan.translate(\"Choose from vocabulary:\")) +\n'</label>\\n            <select class=\"Rk-Edit-Vocabulary\">\\n                ';\n _.each(options.properties, function(ontology) { ;\n__p += '\\n                    <option class=\"Rk-Edit-Vocabulary-Class\" value=\"\">\\n                        ' +\n__e( renkan.translate(ontology.label) ) +\n'\\n                    </option>\\n                    ';\n _.each(ontology.properties, function(property) { var uri = ontology[\"base-uri\"] + property.uri; ;\n__p += '\\n                        <option class=\"Rk-Edit-Vocabulary-Property\" value=\"' +\n__e( uri ) +\n'\"\\n                            ';\n if (uri === edge.uri) { ;\n__p += ' selected';\n } ;\n__p += '>\\n                            ' +\n__e( renkan.translate(property.label) ) +\n'\\n                        </option>\\n                    ';\n }) ;\n__p += '\\n                ';\n }) ;\n__p += '\\n            </select>\\n        </p>\\n';\n } } ;\n__p += '\\n';\n if (options.show_edge_editor_style) { ;\n__p += '\\n    <div class=\"Rk-Editor-p\">\\n      ';\n if (options.show_edge_editor_style_color) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-color\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Edge color:\")) +\n'</span>\\n        <div class=\"Rk-Edit-ColorPicker-Wrapper\">\\n            <span class=\"Rk-Edit-Color\" style=\"background: &lt;%-edge.color%>;\">\\n                <span class=\"Rk-Edit-ColorTip\"></span>\\n            </span>\\n            ' +\n((__t = ( renkan.colorPicker )) == null ? '' : __t) +\n'\\n            <span class=\"Rk-Edit-ColorPicker-Text\">' +\n__e( renkan.translate(\"Choose color\") ) +\n'</span>\\n        </div>\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_edge_editor_style_dash) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-dash\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Dash:\")) +\n'</span>\\n        <input type=\"checkbox\" name=\"Rk-Edit-Dash\" class=\"Rk-Edit-Dash\" ' +\n__e( edge.dash ) +\n' />\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_edge_editor_style_thickness) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-thickness\">\\n          <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Thickness:\")) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Down\">-</a>\\n          <span class=\"Rk-Edit-Size-Disp\" id=\"Rk-Edit-Thickness-Value\">' +\n__e( edge.thickness ) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Up\">+</a>\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_edge_editor_style_arrow) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-arrow\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Arrow:\")) +\n'</span>\\n        <input type=\"checkbox\" name=\"Rk-Edit-Arrow\" class=\"Rk-Edit-Arrow\" ' +\n__e( edge.arrow ) +\n' />\\n      </div>\\n      ';\n } ;\n__p += '\\n    </div>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_editor_direction) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Edit-Direction\">' +\n__e( renkan.translate(\"Change edge direction\") ) +\n'</span>\\n    </p>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_editor_nodes) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"From:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(edge.from_color) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.from_title, 25) ) +\n'\\n    </p>\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"To:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: >%-edge.to_color%>;\"></span>\\n        ' +\n__e( shortenText(edge.to_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_editor_creator && edge.has_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: &lt;%-edge.created_by_color%>;\"></span>\\n        ' +\n__e( shortenText(edge.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/edgeeditor_readonly.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>\\n    ';\n if (options.show_edge_tooltip_color) { ;\n__p += '\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.color ) +\n';\"></span>\\n    ';\n } ;\n__p += '\\n    <span class=\"Rk-Display-Title\">\\n        ';\n if (edge.uri) { ;\n__p += '\\n            <a href=\"' +\n__e(edge.uri) +\n'\" target=\"_blank\">\\n        ';\n } ;\n__p += '\\n        ' +\n__e(edge.title) +\n'\\n        ';\n if (edge.uri) { ;\n__p += ' </a> ';\n } ;\n__p += '\\n    </span>\\n</h2>\\n';\n if (options.show_edge_tooltip_uri && edge.uri) { ;\n__p += '\\n    <p class=\"Rk-Display-URI\">\\n        <a href=\"' +\n__e(edge.uri) +\n'\" target=\"_blank\">' +\n__e( edge.short_uri ) +\n'</a>\\n    </p>\\n';\n } ;\n__p += '\\n<p>' +\n((__t = (edge.description)) == null ? '' : __t) +\n'</p>\\n';\n if (options.show_edge_tooltip_nodes) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"From:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.from_color ) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.from_title, 25) ) +\n'\\n    </p>\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"To:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.to_color ) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.to_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_tooltip_creator && edge.has_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.created_by_color ) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/ldtjson-bin/annotationtemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item\" draggable=\"true\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL(image) ) +\n'\"\\n    data-uri=\"' +\n((__t = (ldt_platform)) == null ? '' : __t) +\n'ldtplatform/ldt/front/player/' +\n((__t = (mediaid)) == null ? '' : __t) +\n'/#id=' +\n((__t = (annotationid)) == null ? '' : __t) +\n'\"\\n    data-title=\"' +\n__e(title) +\n'\" data-description=\"' +\n__e(description) +\n'\">\\n\\n    <img class=\"Rk-Ldt-Annotation-Icon\" src=\"' +\n((__t = (image)) == null ? '' : __t) +\n'\" />\\n    <h4>' +\n((__t = (htitle)) == null ? '' : __t) +\n'</h4>\\n    <p>' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n    <p>Start: ' +\n((__t = (start)) == null ? '' : __t) +\n', End: ' +\n((__t = (end)) == null ? '' : __t) +\n', Duration: ' +\n((__t = (duration)) == null ? '' : __t) +\n'</p>\\n    <div class=\"Rk-Clear\"></div>\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/ldtjson-bin/segmenttemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item\" draggable=\"true\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL(image) ) +\n'\"\\n    data-uri=\"' +\n((__t = (ldt_platform)) == null ? '' : __t) +\n'ldtplatform/ldt/front/player/' +\n((__t = (mediaid)) == null ? '' : __t) +\n'/#id=' +\n((__t = (annotationid)) == null ? '' : __t) +\n'\"\\n    data-title=\"' +\n__e(title) +\n'\" data-description=\"' +\n__e(description) +\n'\">\\n\\n    <img class=\"Rk-Ldt-Annotation-Icon\" src=\"' +\n((__t = (image)) == null ? '' : __t) +\n'\" />\\n    <h4>' +\n((__t = (htitle)) == null ? '' : __t) +\n'</h4>\\n    <p>' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n    <p>Start: ' +\n((__t = (start)) == null ? '' : __t) +\n', End: ' +\n((__t = (end)) == null ? '' : __t) +\n', Duration: ' +\n((__t = (duration)) == null ? '' : __t) +\n'</p>\\n    <div class=\"Rk-Clear\"></div>\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/ldtjson-bin/tagtemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item\" draggable=\"true\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL(static_url+'img/ldt-tag.png') ) +\n'\"\\n    data-uri=\"' +\n((__t = (ldt_platform)) == null ? '' : __t) +\n'ldtplatform/ldt/front/search/?search=' +\n((__t = (encodedtitle)) == null ? '' : __t) +\n'&field=all\"\\n    data-title=\"' +\n__e(title) +\n'\" data-description=\"Tag \\'' +\n__e(title) +\n'\\'\">\\n\\n    <img class=\"Rk-Ldt-Tag-Icon\" src=\"' +\n__e(static_url) +\n'img/ldt-tag.png\" />\\n    <h4>' +\n((__t = (htitle)) == null ? '' : __t) +\n'</h4>\\n    <div class=\"Rk-Clear\"></div>\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/list-bin.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item Rk-ResourceList-Item\" draggable=\"true\"\\n    data-uri=\"' +\n__e(url) +\n'\" data-title=\"' +\n__e(title) +\n'\"\\n    data-description=\"' +\n__e(description) +\n'\"\\n    ';\n if (image) { ;\n__p += '\\n        data-image=\"' +\n__e( Rkns.Utils.getFullURL(image) ) +\n'\"\\n    ';\n } else { ;\n__p += '\\n        data-image=\"\"\\n    ';\n } ;\n__p += '\\n>';\n if (image) { ;\n__p += '\\n    <img class=\"Rk-ResourceList-Image\" src=\"' +\n__e(image) +\n'\" />\\n';\n } ;\n__p += '\\n<h4 class=\"Rk-ResourceList-Title\">\\n    ';\n if (url) { ;\n__p += '\\n        <a href=\"' +\n__e(url) +\n'\" target=\"_blank\">\\n    ';\n } ;\n__p += '\\n    ' +\n((__t = (htitle)) == null ? '' : __t) +\n'\\n    ';\n if (url) { ;\n__p += '</a>';\n } ;\n__p += '\\n    </h4>\\n    ';\n if (description) { ;\n__p += '\\n        <p class=\"Rk-ResourceList-Description\">' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n    ';\n } ;\n__p += '\\n    ';\n if (image) { ;\n__p += '\\n        <div style=\"clear: both;\"></div>\\n    ';\n } ;\n__p += '\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/main.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n\n if (options.show_bins) { ;\n__p += '\\n    <div class=\"Rk-Bins\">\\n        <div class=\"Rk-Bins-Head\">\\n            <h2 class=\"Rk-Bins-Title\">' +\n__e( translate(\"Select contents:\")) +\n'</h2>\\n            <form class=\"Rk-Web-Search-Form Rk-Search-Form\">\\n                <input class=\"Rk-Web-Search-Input Rk-Search-Input\" type=\"search\"\\n                    placeholder=\"' +\n__e( translate('Search the Web') ) +\n'\" />\\n                <div class=\"Rk-Search-Select\">\\n                    <div class=\"Rk-Search-Current\"></div>\\n                    <ul class=\"Rk-Search-List\"></ul>\\n                </div>\\n                <input type=\"submit\" value=\"\"\\n                    class=\"Rk-Web-Search-Submit Rk-Search-Submit\" title=\"' +\n__e( translate('Search the Web') ) +\n'\" />\\n            </form>\\n            <form class=\"Rk-Bins-Search-Form Rk-Search-Form\">\\n                <input class=\"Rk-Bins-Search-Input Rk-Search-Input\" type=\"search\"\\n                    placeholder=\"' +\n__e( translate('Search in Bins') ) +\n'\" /> <input\\n                    type=\"submit\" value=\"\"\\n                    class=\"Rk-Bins-Search-Submit Rk-Search-Submit\"\\n                    title=\"' +\n__e( translate('Search in Bins') ) +\n'\" />\\n            </form>\\n        </div>\\n        <ul class=\"Rk-Bin-List\"></ul>\\n    </div>\\n';\n } ;\n__p += ' ';\n if (options.show_editor) { ;\n__p += '\\n    <div class=\"Rk-Render Rk-Render-';\n if (options.show_bins) { ;\n__p += 'Panel';\n } else { ;\n__p += 'Full';\n } ;\n__p += '\"></div>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/nodeeditor.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n\n //TODO: change class to id ;\n__p += '\\n<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>' +\n__e(renkan.translate(\"Edit Node\")) +\n'</span>\\n</h2>\\n<p>\\n    <label>' +\n__e(renkan.translate(\"Title:\")) +\n'</label>\\n    <input class=\"Rk-Edit-Title\" type=\"text\" value=\"' +\n__e(node.title) +\n'\" />\\n</p>\\n';\n if (options.show_node_editor_uri) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"URI:\")) +\n'</label>\\n        <input class=\"Rk-Edit-URI\" type=\"text\" value=\"' +\n__e(node.uri) +\n'\" />\\n        <a class=\"Rk-Edit-Goto\" href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\"></a>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.change_types) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Types available\")) +\n':</label>\\n        <select class=\"Rk-Edit-Type\">\\n          ';\n _.each(types, function(type) { ;\n__p += '\\n            <option class=\"Rk-Edit-Vocabulary-Property\" value=\"' +\n__e( type ) +\n'\"';\n if (node.type === type) { ;\n__p += ' selected';\n } ;\n__p += '>\\n                ' +\n__e( renkan.translate(type.charAt(0).toUpperCase() + type.substring(1)) ) +\n'\\n            </option>\\n          ';\n }); ;\n__p += '\\n        </select>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_description) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Description:\")) +\n'</label>\\n        ';\n if (options.show_node_editor_description_richtext) { ;\n__p += '\\n            <div class=\"Rk-Edit-Description\" contenteditable=\"true\">' +\n((__t = (node.description)) == null ? '' : __t) +\n'</div>\\n        ';\n } else { ;\n__p += '\\n            <textarea class=\"Rk-Edit-Description\">' +\n((__t = (node.description)) == null ? '' : __t) +\n'</textarea>\\n        ';\n } ;\n__p += '\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_size) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Size:\")) +\n'</span>\\n        <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Size-Down\">-</a>\\n        <span class=\"Rk-Edit-Size-Disp\" id=\"Rk-Edit-Size-Value\">' +\n__e(node.size) +\n'</span>\\n        <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Size-Up\">+</a>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_style) { ;\n__p += '\\n    <div class=\"Rk-Editor-p\">\\n      ';\n if (options.show_node_editor_style_color) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-color\">\\n        <span class=\"Rk-Editor-Label\">\\n        ' +\n__e(renkan.translate(\"Node color:\")) +\n'</span>\\n        <div class=\"Rk-Edit-ColorPicker-Wrapper\">\\n            <span class=\"Rk-Edit-Color\" style=\"background: ' +\n__e(node.color) +\n';\">\\n                <span class=\"Rk-Edit-ColorTip\"></span>\\n            </span>\\n            ' +\n((__t = ( renkan.colorPicker )) == null ? '' : __t) +\n'\\n            <span class=\"Rk-Edit-ColorPicker-Text\">' +\n__e( renkan.translate(\"Choose color\") ) +\n'</span>\\n        </div>\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_node_editor_style_dash) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-dash\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Dash:\")) +\n'</span>\\n        <input type=\"checkbox\" name=\"Rk-Edit-Dash\" class=\"Rk-Edit-Dash\" ' +\n__e( node.dash ) +\n' />\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_node_editor_style_thickness) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-thickness\">\\n          <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Thickness:\")) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Down\">-</a>\\n          <span class=\"Rk-Edit-Size-Disp\" id=\"Rk-Edit-Thickness-Value\">' +\n__e(node.thickness) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Up\">+</a>\\n      </div>\\n      ';\n } ;\n__p += '\\n    </div>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_image) { ;\n__p += '\\n    <div class=\"Rk-Edit-ImgWrap\">\\n        <div class=\"Rk-Edit-ImgPreview\">\\n            <img src=\"' +\n__e(node.image || node.image_placeholder) +\n'\" />\\n            ';\n if (node.clip_path) { ;\n__p += '\\n                <svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewbox=\"0 0 1 1\" preserveAspectRatio=\"none\">\\n                    <path style=\"stroke-width: .02; stroke:red; fill-opacity:.3; fill:red;\" d=\"' +\n__e( node.clip_path ) +\n'\" />\\n                </svg>\\n            ';\n };\n__p += '\\n        </div>\\n    </div>\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Image URL:\")) +\n'</label>\\n        <div>\\n            <a class=\"Rk-Edit-Image-Del\" href=\"#\"></a>\\n            <input class=\"Rk-Edit-Image\" type=\"text\" value=\\'' +\n__e(node.image) +\n'\\' />\\n        </div>\\n    </p>\\n';\n if (options.allow_image_upload) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Choose Image File:\")) +\n'</label>\\n        <input class=\"Rk-Edit-Image-File\" type=\"file\" accept=\"image/*\" />\\n    </p>\\n';\n };\n\n } ;\n__p += ' ';\n if (options.show_node_editor_creator && node.has_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.created_by_color) +\n';\"></span>\\n        ' +\n__e( shortenText(node.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.change_shapes) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Shapes available\")) +\n':</label>\\n        <select class=\"Rk-Edit-Shape\">\\n          ';\n _.each(shapes, function(shape) { ;\n__p += '\\n            <option class=\"Rk-Edit-Vocabulary-Property\" value=\"' +\n__e( shape ) +\n'\"';\n if (node.shape === shape) { ;\n__p += ' selected';\n } ;\n__p += '>\\n                ' +\n__e( renkan.translate(shape.charAt(0).toUpperCase() + shape.substring(1)) ) +\n'\\n            </option>\\n          ';\n }); ;\n__p += '\\n        </select>\\n    </p>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/nodeeditor_readonly.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>\\n    ';\n if (options.show_node_tooltip_color) { ;\n__p += '\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.color) +\n';\"></span>\\n    ';\n } ;\n__p += '\\n    <span class=\"Rk-Display-Title\">\\n        ';\n if (node.uri) { ;\n__p += '\\n            <a href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\">\\n        ';\n } ;\n__p += '\\n        ' +\n__e(node.title) +\n'\\n        ';\n if (node.uri) { ;\n__p += '</a>';\n } ;\n__p += '\\n    </span>\\n</h2>\\n';\n if (node.uri && options.show_node_tooltip_uri) { ;\n__p += '\\n    <p class=\"Rk-Display-URI\">\\n        <a href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\">' +\n__e(node.short_uri) +\n'</a>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_tooltip_description) { ;\n__p += '\\n    <p class=\"Rk-Display-Description\">' +\n((__t = (node.description)) == null ? '' : __t) +\n'</p>\\n';\n } ;\n__p += ' ';\n if (node.image && options.show_node_tooltip_image) { ;\n__p += '\\n    <img class=\"Rk-Display-ImgPreview\" src=\"' +\n__e(node.image) +\n'\" />\\n';\n } ;\n__p += ' ';\n if (node.has_creator && options.show_node_tooltip_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.created_by_color) +\n';\"></span>\\n        ' +\n__e( shortenText(node.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n    <a href=\"#?idnode=' +\n__e(node._id) +\n'\">' +\n__e(renkan.translate(\"Link to the node\")) +\n'</a>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/nodeeditor_video.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>\\n    ';\n if (options.show_node_tooltip_color) { ;\n__p += '\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.color) +\n';\"></span>\\n    ';\n } ;\n__p += '\\n    <span class=\"Rk-Display-Title\">\\n        ';\n if (node.uri) { ;\n__p += '\\n            <a href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\">\\n        ';\n } ;\n__p += '\\n        ' +\n__e(node.title) +\n'\\n        ';\n if (node.uri) { ;\n__p += '</a>';\n } ;\n__p += '\\n    </span>\\n</h2>\\n';\n if (node.uri && options.show_node_tooltip_uri) { ;\n__p += '\\n     <video width=\"320\" height=\"240\" controls>\\n        <source src=\"' +\n__e(node.uri) +\n'\" type=\"video/mp4\">\\n     </video> \\n';\n } ;\n__p += '\\n    <a href=\"#?idnode=' +\n__e(node._id) +\n'\">' +\n__e(renkan.translate(\"Link to the node\")) +\n'</a>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/scene.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n\n if (options.show_top_bar) { ;\n__p += '\\n    <div class=\"Rk-TopBar\">\\n        <div class=\"loader\"></div>\\n        ';\n if (!options.editor_mode) { ;\n__p += '\\n            <h2 class=\"Rk-PadTitle\">\\n                ' +\n__e( project.get(\"title\") || translate(\"Untitled project\")) +\n'\\n            </h2>\\n        ';\n } else { ;\n__p += '\\n            <input type=\"text\" class=\"Rk-PadTitle\" value=\"' +\n__e( project.get('title') || '' ) +\n'\" placeholder=\"' +\n__e(translate('Untitled project')) +\n'\" />\\n        ';\n } ;\n__p += '\\n        ';\n if (options.show_user_list) { ;\n__p += '\\n            <div class=\"Rk-Users\">\\n                <div class=\"Rk-CurrentUser\">\\n                    ';\n if (options.show_user_color) { ;\n__p += '\\n                        <div class=\"Rk-Edit-ColorPicker-Wrapper\">\\n                            <span class=\"Rk-CurrentUser-Color\">\\n                            ';\n if (options.user_color_editable) { ;\n__p += '\\n                                <span class=\"Rk-Edit-ColorTip\"></span>\\n                            ';\n } ;\n__p += '\\n                            </span>\\n                            ';\n if (options.user_color_editable) { print(colorPicker) } ;\n__p += '\\n                        </div>\\n                    ';\n } ;\n__p += '\\n                    <span class=\"Rk-CurrentUser-Name\">&lt;unknown user&gt;</span>\\n                </div>\\n                <ul class=\"Rk-UserList\"></ul>\\n            </div>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.home_button_url) {;\n__p += '\\n            <div class=\"Rk-TopBar-Separator\"></div>\\n            <a class=\"Rk-TopBar-Button Rk-Home-Button\" href=\"' +\n__e( options.home_button_url ) +\n'\">\\n                <div class=\"Rk-TopBar-Tooltip\">\\n                    <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                        ' +\n__e( translate(options.home_button_title) ) +\n'\\n                    </div>\\n                </div>\\n            </a>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.show_fullscreen_button) { ;\n__p += '\\n            <div class=\"Rk-TopBar-Separator\"></div>\\n            <div class=\"Rk-TopBar-Button Rk-FullScreen-Button\">\\n                <div class=\"Rk-TopBar-Tooltip\">\\n                    <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                        ' +\n__e(translate(\"Full Screen\")) +\n'\\n                    </div>\\n                </div>\\n            </div>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.editor_mode) { ;\n__p += '\\n            ';\n if (options.show_addnode_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-AddNode-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Add Node\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_addedge_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-AddEdge-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Add Edge\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_export_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Export-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Download Project\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_save_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Save-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\"></div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_open_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Open-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Open Project\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_bookmarklet) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <a class=\"Rk-TopBar-Button Rk-Bookmarklet-Button\" href=\"#\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Renkan \\'Drag-to-Add\\' bookmarklet\")) +\n'\\n                        </div>\\n                    </div>\\n                </a>\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n            ';\n } ;\n__p += '\\n        ';\n } else { ;\n__p += '\\n            ';\n if (options.show_export_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Export-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Download Project\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n            ';\n } ;\n__p += '\\n        ';\n }; ;\n__p += '\\n        ';\n if (options.show_search_field) { ;\n__p += '\\n            <form action=\"#\" class=\"Rk-GraphSearch-Form\">\\n                <input type=\"search\" class=\"Rk-GraphSearch-Field\" placeholder=\"' +\n__e( translate('Search in graph') ) +\n'\" />\\n            </form>\\n            <div class=\"Rk-TopBar-Separator\"></div>\\n        ';\n } ;\n__p += '\\n    </div>\\n';\n } ;\n__p += '\\n<div class=\"Rk-Editing-Space';\n if (!options.show_top_bar) { ;\n__p += ' Rk-Editing-Space-Full';\n } ;\n__p += '\">\\n    <div class=\"Rk-Labels\"></div>\\n    <canvas class=\"Rk-Canvas\" ';\n if (options.resize) { ;\n__p += ' resize=\"\" ';\n } ;\n__p += ' ></canvas>\\n    <div class=\"Rk-Notifications\"></div>\\n    <div class=\"Rk-Editor\">\\n        ';\n if (options.show_bins) { ;\n__p += '\\n            <div class=\"Rk-Fold-Bins\">&laquo;</div>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.show_zoom) { ;\n__p += '\\n            <div class=\"Rk-ZoomButtons\">\\n                <div class=\"Rk-ZoomIn\" title=\"' +\n__e(translate('Zoom In')) +\n'\"></div>\\n                <div class=\"Rk-ZoomFit\" title=\"' +\n__e(translate('Zoom Fit')) +\n'\"></div>\\n                <div class=\"Rk-ZoomOut\" title=\"' +\n__e(translate('Zoom Out')) +\n'\"></div>\\n                ';\n if (options.editor_mode && options.save_view) { ;\n__p += '\\n                    <div class=\"Rk-ZoomSave\" title=\"' +\n__e(translate('Save view')) +\n'\"></div>\\n                ';\n } ;\n__p += '\\n                ';\n if (options.save_view) { ;\n__p += '\\n                    <div class=\"Rk-ZoomSetSaved\" title=\"' +\n__e(translate('View saved view')) +\n'\"></div>\\n                    ';\n if (options.hide_nodes) { ;\n__p += '\\n                \\t   <div class=\"Rk-ShowHiddenNodes\" title=\"' +\n__e(translate('Show hidden nodes')) +\n'\"></div>\\n                    ';\n } ;\n__p += '       \\n                ';\n } ;\n__p += '\\n            </div>\\n        ';\n } ;\n__p += '\\n    </div>\\n</div>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/search.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"' +\n((__t = ( className )) == null ? '' : __t) +\n'\" data-key=\"' +\n((__t = ( key )) == null ? '' : __t) +\n'\">' +\n((__t = ( title )) == null ? '' : __t) +\n'</li>';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/wikipedia-bin/resulttemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Wikipedia-Result Rk-Bin-Item\" draggable=\"true\"\\n    data-uri=\"' +\n__e(url) +\n'\" data-title=\"Wikipedia: ' +\n__e(title) +\n'\"\\n    data-description=\"' +\n__e(description) +\n'\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL( static_url + 'img/wikipedia.png' ) ) +\n'\">\\n\\n    <img class=\"Rk-Wikipedia-Icon\" src=\"' +\n__e(static_url) +\n'img/wikipedia.png\">\\n    <h4 class=\"Rk-Wikipedia-Title\">\\n        <a href=\"' +\n__e(url) +\n'\" target=\"_blank\">' +\n((__t = (htitle)) == null ? '' : __t) +\n'</a>\\n    </h4>\\n    <p class=\"Rk-Wikipedia-Snippet\">' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n</li>\\n';\n\n}\nreturn __p\n};","/* Declaring the Renkan Namespace Rkns and Default values */\n\n(function(root) {\n\n    \"use strict\";\n\n    if (typeof root.Rkns !== \"object\") {\n        root.Rkns = {};\n    }\n\n    var Rkns = root.Rkns;\n    var $ = Rkns.$ = root.jQuery;\n    var _ = Rkns._ = root._;\n\n    Rkns.pickerColors = [\"#8f1919\", \"#a80000\", \"#d82626\", \"#ff0000\", \"#e87c7c\", \"#ff6565\", \"#f7d3d3\", \"#fecccc\",\n        \"#8f5419\", \"#a85400\", \"#d87f26\", \"#ff7f00\", \"#e8b27c\", \"#ffb265\", \"#f7e5d3\", \"#fee5cc\",\n        \"#8f8f19\", \"#a8a800\", \"#d8d826\", \"#feff00\", \"#e8e87c\", \"#feff65\", \"#f7f7d3\", \"#fefecc\",\n        \"#198f19\", \"#00a800\", \"#26d826\", \"#00ff00\", \"#7ce87c\", \"#65ff65\", \"#d3f7d3\", \"#ccfecc\",\n        \"#198f8f\", \"#00a8a8\", \"#26d8d8\", \"#00feff\", \"#7ce8e8\", \"#65feff\", \"#d3f7f7\", \"#ccfefe\",\n        \"#19198f\", \"#0000a8\", \"#2626d8\", \"#0000ff\", \"#7c7ce8\", \"#6565ff\", \"#d3d3f7\", \"#ccccfe\",\n        \"#8f198f\", \"#a800a8\", \"#d826d8\", \"#ff00fe\", \"#e87ce8\", \"#ff65fe\", \"#f7d3f7\", \"#feccfe\",\n        \"#000000\", \"#242424\", \"#484848\", \"#6d6d6d\", \"#919191\", \"#b6b6b6\", \"#dadada\", \"#ffffff\"\n    ];\n\n    Rkns.__renkans = [];\n\n    var _BaseBin = Rkns._BaseBin = function(_renkan, _opts) {\n        if (typeof _renkan !== \"undefined\") {\n            this.renkan = _renkan;\n            this.renkan.$.find(\".Rk-Bin-Main\").hide();\n            this.$ = Rkns.$('<li>')\n                .addClass(\"Rk-Bin\")\n                .appendTo(_renkan.$.find(\".Rk-Bin-List\"));\n            this.title_icon_$ = Rkns.$('<span>')\n                .addClass(\"Rk-Bin-Title-Icon\")\n                .appendTo(this.$);\n\n            var _this = this;\n\n            Rkns.$('<a>')\n                .attr({\n                    href: \"#\",\n                    title: _renkan.translate(\"Close bin\")\n                })\n                .addClass(\"Rk-Bin-Close\")\n                .html('&times;')\n                .appendTo(this.$)\n                .click(function() {\n                    _this.destroy();\n                    if (!_renkan.$.find(\".Rk-Bin-Main:visible\").length) {\n                        _renkan.$.find(\".Rk-Bin-Main:last\").slideDown();\n                    }\n                    _renkan.resizeBins();\n                    return false;\n                });\n            Rkns.$('<a>')\n                .attr({\n                    href: \"#\",\n                    title: _renkan.translate(\"Refresh bin\")\n                })\n                .addClass(\"Rk-Bin-Refresh\")\n                .appendTo(this.$)\n                .click(function() {\n                    _this.refresh();\n                    return false;\n                });\n            this.count_$ = Rkns.$('<div>')\n                .addClass(\"Rk-Bin-Count\")\n                .appendTo(this.$);\n            this.title_$ = Rkns.$('<h2>')\n                .addClass(\"Rk-Bin-Title\")\n                .appendTo(this.$);\n            this.main_$ = Rkns.$('<div>')\n                .addClass(\"Rk-Bin-Main\")\n                .appendTo(this.$)\n                .html('<h4 class=\"Rk-Bin-Loading\">' + _renkan.translate(\"Loading, please wait\") + '</h4>');\n            this.title_$.html(_opts.title || '(new bin)');\n            this.renkan.resizeBins();\n\n            if (_opts.auto_refresh) {\n                window.setInterval(function() {\n                    _this.refresh();\n                }, _opts.auto_refresh);\n            }\n        }\n    };\n\n    _BaseBin.prototype.destroy = function() {\n        this.$.detach();\n        this.renkan.resizeBins();\n    };\n\n    /* Point of entry */\n\n    var Renkan = Rkns.Renkan = function(_opts) {\n        var _this = this;\n\n        Rkns.__renkans.push(this);\n\n        this.options = _.defaults(_opts, Rkns.defaults, {\n            templates: _.defaults(_opts.templates, renkanJST) || renkanJST,\n            node_editor_templates: _.defaults(_opts.node_editor_templates, Rkns.defaults.node_editor_templates)\n        });\n        this.template = renkanJST['templates/main.html'];\n\n        var types_templates = {};\n        _.each(this.options.node_editor_templates, function(value, key) {\n            types_templates[key] = _this.options.templates[value];\n            delete _this.options.templates[value];\n        });\n        this.options.node_editor_templates = types_templates;\n\n        _.each(this.options.property_files, function(f) {\n            Rkns.$.getJSON(f, function(data) {\n                _this.options.properties = _this.options.properties.concat(data);\n            });\n        });\n\n        this.read_only = this.options.read_only || !this.options.editor_mode;\n        \n        this.router = new Rkns.Router();\n        \n        this.project = new Rkns.Models.Project();\n        this.dataloader = new Rkns.DataLoader.Loader(this.project, this.options);\n\n        this.setCurrentUser = function(user_id, user_name) {\n            this.project.addUser({\n                _id: user_id,\n                title: user_name\n            });\n            this.current_user = user_id;\n            this.renderer.redrawUsers();\n        };\n\n        if (typeof this.options.user_id !== \"undefined\") {\n            this.current_user = this.options.user_id;\n        }\n        this.$ = Rkns.$(\"#\" + this.options.container);\n        this.$\n            .addClass(\"Rk-Main\")\n            .html(this.template(this));\n\n        this.tabs = [];\n        this.search_engines = [];\n\n        this.current_user_list = new Rkns.Models.UsersList();\n\n        this.current_user_list.on(\"add remove\", function() {\n            if (this.renderer) {\n                this.renderer.redrawUsers();\n            }\n        });\n\n        this.colorPicker = (function() {\n            var _tmpl = renkanJST['templates/colorpicker.html'];\n            return '<ul class=\"Rk-Edit-ColorPicker\">' + Rkns.pickerColors.map(function(c) {\n                return _tmpl({\n                    c: c\n                });\n            }).join(\"\") + '</ul>';\n        })();\n\n        if (this.options.show_editor) {\n            this.renderer = new Rkns.Renderer.Scene(this);\n        }\n\n        if (!this.options.search.length) {\n            this.$.find(\".Rk-Web-Search-Form\").detach();\n        } else {\n            var _tmpl = renkanJST['templates/search.html'],\n                _select = this.$.find(\".Rk-Search-List\"),\n                _input = this.$.find(\".Rk-Web-Search-Input\"),\n                _form = this.$.find(\".Rk-Web-Search-Form\");\n            _.each(this.options.search, function(_search, _key) {\n                if (Rkns[_search.type] && Rkns[_search.type].Search) {\n                    _this.search_engines.push(new Rkns[_search.type].Search(_this, _search));\n                }\n            });\n            _select.html(\n                _(this.search_engines).map(function(_search, _key) {\n                    return _tmpl({\n                        key: _key,\n                        title: _search.getSearchTitle(),\n                        className: _search.getBgClass()\n                    });\n                }).join(\"\")\n            );\n            _select.find(\"li\").click(function() {\n                var _el = Rkns.$(this);\n                _this.setSearchEngine(_el.attr(\"data-key\"));\n                _form.submit();\n            });\n            _form.submit(function() {\n                if (_input.val()) {\n                    var _search = _this.search_engine;\n                    _search.search(_input.val());\n                }\n                return false;\n            });\n            this.$.find(\".Rk-Search-Current\").mouseenter(\n                function() {\n                    _select.slideDown();\n                }\n            );\n            this.$.find(\".Rk-Search-Select\").mouseleave(\n                function() {\n                    _select.hide();\n                }\n            );\n            this.setSearchEngine(0);\n        }\n        _.each(this.options.bins, function(_bin) {\n            if (Rkns[_bin.type] && Rkns[_bin.type].Bin) {\n                _this.tabs.push(new Rkns[_bin.type].Bin(_this, _bin));\n            }\n        });\n\n        var elementDropped = false;\n\n        this.$.find(\".Rk-Bins\")\n            .on(\"click\", \".Rk-Bin-Title,.Rk-Bin-Title-Icon\", function() {\n                var _mainDiv = Rkns.$(this).siblings(\".Rk-Bin-Main\");\n                if (_mainDiv.is(\":hidden\")) {\n                    _this.$.find(\".Rk-Bin-Main\").slideUp();\n                    _mainDiv.slideDown();\n                }\n            });\n\n        if (this.options.show_editor) {\n\n            this.$.find(\".Rk-Bins\").on(\"mouseover\", \".Rk-Bin-Item\", function(_e) {\n                var _t = Rkns.$(this);\n                if (_t && $(_t).attr(\"data-uri\")) {\n                    var _models = _this.project.get(\"nodes\").where({\n                        uri: $(_t).attr(\"data-uri\")\n                    });\n                    _.each(_models, function(_model) {\n                        _this.renderer.highlightModel(_model);\n                    });\n                }\n            }).mouseout(function() {\n                _this.renderer.unhighlightAll();\n            }).on(\"mousemove\", \".Rk-Bin-Item\", function(e) {\n                try {\n                    this.dragDrop();\n                } catch (err) {}\n            }).on(\"touchstart\", \".Rk-Bin-Item\", function(e) {\n                elementDropped = false;\n            }).on(\"touchmove\", \".Rk-Bin-Item\", function(e) {\n                e.preventDefault();\n                var touch = e.originalEvent.changedTouches[0],\n                    off = _this.renderer.canvas_$.offset(),\n                    w = _this.renderer.canvas_$.width(),\n                    h = _this.renderer.canvas_$.height();\n                if (touch.pageX >= off.left && touch.pageX < (off.left + w) && touch.pageY >= off.top && touch.pageY < (off.top + h)) {\n                    if (elementDropped) {\n                        _this.renderer.onMouseMove(touch, true);\n                    } else {\n                        elementDropped = true;\n                        var div = document.createElement('div');\n                        div.appendChild(this.cloneNode(true));\n                        _this.renderer.dropData({\n                            \"text/html\": div.innerHTML\n                        }, touch);\n                        _this.renderer.onMouseDown(touch, true);\n                    }\n                }\n            }).on(\"touchend\", \".Rk-Bin-Item\", function(e) {\n                if (elementDropped) {\n                    _this.renderer.onMouseUp(e.originalEvent.changedTouches[0], true);\n                }\n                elementDropped = false;\n            }).on(\"dragstart\", \".Rk-Bin-Item\", function(e) {\n                var div = document.createElement('div');\n                div.appendChild(this.cloneNode(true));\n                try {\n                    e.originalEvent.dataTransfer.setData(\"text/html\", div.innerHTML);\n                } catch (err) {\n                    e.originalEvent.dataTransfer.setData(\"text\", div.innerHTML);\n                }\n            });\n\n        }\n\n        Rkns.$(window).resize(function() {\n            _this.resizeBins();\n        });\n\n        var lastsearch = false,\n            lastval = '';\n\n        this.$.find(\".Rk-Bins-Search-Input\").on(\"change keyup paste input\", function() {\n            var val = Rkns.$(this).val();\n            if (val === lastval) {\n                return;\n            }\n            var search = Rkns.Utils.regexpFromTextOrArray(val.length > 1 ? val : null);\n            if (search.source === lastsearch) {\n                return;\n            }\n            lastsearch = search.source;\n            _.each(_this.tabs, function(tab) {\n                tab.render(search);\n            });\n\n        });\n        this.$.find(\".Rk-Bins-Search-Form\").submit(function() {\n            return false;\n        });\n    };\n\n    Renkan.prototype.translate = function(_text) {\n        if (Rkns.i18n[this.options.language] && Rkns.i18n[this.options.language][_text]) {\n            return Rkns.i18n[this.options.language][_text];\n        }\n        if (this.options.language.length > 2 && Rkns.i18n[this.options.language.substr(0, 2)] && Rkns.i18n[this.options.language.substr(0, 2)][_text]) {\n            return Rkns.i18n[this.options.language.substr(0, 2)][_text];\n        }\n        return _text;\n    };\n\n    Renkan.prototype.onStatusChange = function() {\n        this.renderer.onStatusChange();\n    };\n\n    Renkan.prototype.setSearchEngine = function(_key) {\n        this.search_engine = this.search_engines[_key];\n        this.$.find(\".Rk-Search-Current\").attr(\"class\", \"Rk-Search-Current \" + this.search_engine.getBgClass());\n        var listClasses = this.search_engine.getBgClass().split(\" \");\n        var classes = \"\";\n        for (var i = 0; i < listClasses.length; i++) {\n            classes += \".\" + listClasses[i];\n        }\n        this.$.find(\".Rk-Web-Search-Input.Rk-Search-Input\").attr(\"placeholder\", this.translate(\"Search in \") + this.$.find(\".Rk-Search-List \" + classes).html());\n    };\n\n    Renkan.prototype.resizeBins = function() {\n        var _d = +this.$.find(\".Rk-Bins-Head\").outerHeight();\n        this.$.find(\".Rk-Bin-Title:visible\").each(function() {\n            _d += Rkns.$(this).outerHeight();\n        });\n        this.$.find(\".Rk-Bin-Main\").css({\n            height: this.$.find(\".Rk-Bins\").height() - _d\n        });\n    };\n\n    /* Utility functions */\n    var getUUID4 = function() {\n        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n            var r = Math.random() * 16 | 0,\n                v = c === 'x' ? r : (r & 0x3 | 0x8);\n            return v.toString(16);\n        });\n    };\n\n    Rkns.Utils = {\n        getUUID4: getUUID4,\n        getUID: (function() {\n            function pad(n) {\n                return n < 10 ? '0' + n : n;\n            }\n            var _d = new Date(),\n                ID_AUTO_INCREMENT = 0,\n                ID_BASE = _d.getUTCFullYear() + '-' +\n                pad(_d.getUTCMonth() + 1) + '-' +\n                pad(_d.getUTCDate()) + '-' +\n                getUUID4();\n            return function(_base) {\n                var _n = (++ID_AUTO_INCREMENT).toString(16),\n                    _uidbase = (typeof _base === \"undefined\" ? \"\" : _base + \"-\");\n                while (_n.length < 4) {\n                    _n = '0' + _n;\n                }\n                return _uidbase + ID_BASE + '-' + _n;\n            };\n        })(),\n        getFullURL: function(url) {\n\n            if (typeof(url) === 'undefined' || url == null) {\n                return \"\";\n            }\n            if (/https?:\\/\\//.test(url)) {\n                return url;\n            }\n            var img = new Image();\n            img.src = url;\n            var res = img.src;\n            img.src = null;\n            return res;\n\n        },\n        inherit: function(_baseClass, _callbefore) {\n\n            var _class = function(_arg) {\n                if (typeof _callbefore === \"function\") {\n                    _callbefore.apply(this, Array.prototype.slice.call(arguments, 0));\n                }\n                _baseClass.apply(this, Array.prototype.slice.call(arguments, 0));\n                if (typeof this._init === \"function\" && !this._initialized) {\n                    this._init.apply(this, Array.prototype.slice.call(arguments, 0));\n                    this._initialized = true;\n                }\n            };\n            _.extend(_class.prototype, _baseClass.prototype);\n\n            return _class;\n\n        },\n        regexpFromTextOrArray: (function() {\n            var charsub = [\n                    '[aáàâä]',\n                    '[cç]',\n                    '[eéèêë]',\n                    '[iíìîï]',\n                    '[oóòôö]',\n                    '[uùûü]'\n                ],\n                removeChars = [\n                    String.fromCharCode(768), String.fromCharCode(769), String.fromCharCode(770), String.fromCharCode(771), String.fromCharCode(807),\n                    \"{\", \"}\", \"(\", \")\", \"[\", \"]\", \"【\", \"】\", \"、\", \"・\", \"‥\", \"。\", \"「\", \"」\", \"『\", \"』\", \"〜\", \":\", \"!\", \"?\", \" \",\n                    \",\", \" \", \";\", \"(\", \")\", \".\", \"*\", \"+\", \"\\\\\", \"?\", \"|\", \"{\", \"}\", \"[\", \"]\", \"^\", \"#\", \"/\"\n                ],\n                remsrc = \"[\\\\\" + removeChars.join(\"\\\\\") + \"]\",\n                remrx = new RegExp(remsrc, \"gm\"),\n                charsrx = _.map(charsub, function(c) {\n                    return new RegExp(c);\n                });\n\n            function replaceText(_text) {\n                var txt = _text.toLowerCase().replace(remrx, \"\"),\n                    src = \"\";\n\n                function makeReplaceFunc(l) {\n                    return function(k, v) {\n                        l = l.replace(charsrx[k], v);\n                    };\n                }\n                for (var j = 0; j < txt.length; j++) {\n                    if (j) {\n                        src += remsrc + \"*\";\n                    }\n                    var l = txt[j];\n                    _.each(charsub, makeReplaceFunc(l));\n                    src += l;\n                }\n                return src;\n            }\n\n            function getSource(inp) {\n                switch (typeof inp) {\n                    case \"string\":\n                        return replaceText(inp);\n                    case \"object\":\n                        var src = '';\n                        _.each(inp, function(v) {\n                            var res = getSource(v);\n                            if (res) {\n                                if (src) {\n                                    src += '|';\n                                }\n                                src += res;\n                            }\n                        });\n                        return src;\n                }\n                return '';\n            }\n\n            return function(_textOrArray) {\n                var source = getSource(_textOrArray);\n                if (source) {\n                    var testrx = new RegExp(source, \"im\"),\n                        replacerx = new RegExp('(' + source + ')', \"igm\");\n                    return {\n                        isempty: false,\n                        source: source,\n                        test: function(_t) {\n                            return testrx.test(_t);\n                        },\n                        replace: function(_text, _replace) {\n                            return _text.replace(replacerx, _replace);\n                        }\n                    };\n                } else {\n                    return {\n                        isempty: true,\n                        source: '',\n                        test: function() {\n                            return true;\n                        },\n                        replace: function(_text) {\n                            return text;\n                        }\n                    };\n                }\n            };\n        })(),\n        /* The minimum distance (in pixels) the mouse has to move to consider an element was dragged */\n        _MIN_DRAG_DISTANCE: 2,\n        /* Distance between the inner and outer radius of buttons that appear when hovering on a node */\n        _NODE_BUTTON_WIDTH: 40,\n\n        _EDGE_BUTTON_INNER: 2,\n        _EDGE_BUTTON_OUTER: 40,\n        /* Constants used to know if a specific action is to be performed when clicking on the canvas */\n        _CLICKMODE_ADDNODE: 1,\n        _CLICKMODE_STARTEDGE: 2,\n        _CLICKMODE_ENDEDGE: 3,\n        /* Node size step: Used to calculate the size change when clicking the +/- buttons */\n        _NODE_SIZE_STEP: Math.LN2 / 4,\n        _MIN_SCALE: 1 / 20,\n        _MAX_SCALE: 20,\n        _MOUSEMOVE_RATE: 80,\n        _DOUBLETAP_DELAY: 800,\n        /* Maximum distance in pixels (squared, to reduce calculations)\n         * between two taps when double-tapping on a touch terminal */\n        _DOUBLETAP_DISTANCE: 20 * 20,\n        /* A placeholder so a default colour is displayed when a node has a null value for its user property */\n        _USER_PLACEHOLDER: function(_renkan) {\n            return {\n                color: _renkan.options.default_user_color,\n                title: _renkan.translate(\"(unknown user)\"),\n                get: function(attr) {\n                    return this[attr] || false;\n                }\n            };\n        },\n        /* The code for the \"Drag and Add Bookmarklet\", slightly minified and with whitespaces removed, though\n         * it doesn't seem that it's still a requirement in newer browsers (i.e. the ones compatibles with canvas drawing)\n         */\n        _BOOKMARKLET_CODE: function(_renkan) {\n            return \"(function(a,b,c,d,e,f,h,i,j,k,l,m,n,o,p,q,r){a=document;b=a.body;c=a.location.href;j='draggable';m='text/x-iri-';d=a.createElement('div');d.innerHTML='<p_style=\\\"position:fixed;top:0;right:0;font:bold_18px_sans-serif;color:#fff;background:#909;padding:10px;z-index:100000;\\\">\" +\n                _renkan.translate(\"Drag items from this website, drop them in Renkan\").replace(/ /g, \"_\") +\n                \"</p>'.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);})();\";\n        },\n        /* Shortens text to the required length then adds ellipsis */\n        shortenText: function(_text, _maxlength) {\n            return (_text.length > _maxlength ? (_text.substr(0, _maxlength) + '…') : _text);\n        },\n        /* Drawing an edit box with an arrow and positioning the edit box according to the position of the node/edge being edited\n         * Called by Rkns.Renderer.NodeEditor and Rkns.Renderer.EdgeEditor */\n        drawEditBox: function(_options, _coords, _path, _xmargin, _selector) {\n            _selector.css({\n                width: (_options.tooltip_width - 2 * _options.tooltip_padding)\n            });\n            var _height = _selector.outerHeight() + 2 * _options.tooltip_padding,\n                _isLeft = (_coords.x < paper.view.center.x ? 1 : -1),\n                _left = _coords.x + _isLeft * (_xmargin + _options.tooltip_arrow_length),\n                _right = _coords.x + _isLeft * (_xmargin + _options.tooltip_arrow_length + _options.tooltip_width),\n                _top = _coords.y - _height / 2;\n            if (_top + _height > (paper.view.size.height - _options.tooltip_margin)) {\n                _top = Math.max(paper.view.size.height - _options.tooltip_margin, _coords.y + _options.tooltip_arrow_width / 2) - _height;\n            }\n            if (_top < _options.tooltip_margin) {\n                _top = Math.min(_options.tooltip_margin, _coords.y - _options.tooltip_arrow_width / 2);\n            }\n            var _bottom = _top + _height;\n            /* jshint laxbreak:true */\n            _path.segments[0].point = _path.segments[7].point = _coords.add([_isLeft * _xmargin, 0]);\n            _path.segments[1].point.x = _path.segments[2].point.x = _path.segments[5].point.x = _path.segments[6].point.x = _left;\n            _path.segments[3].point.x = _path.segments[4].point.x = _right;\n            _path.segments[2].point.y = _path.segments[3].point.y = _top;\n            _path.segments[4].point.y = _path.segments[5].point.y = _bottom;\n            _path.segments[1].point.y = _coords.y - _options.tooltip_arrow_width / 2;\n            _path.segments[6].point.y = _coords.y + _options.tooltip_arrow_width / 2;\n            _path.closed = true;\n            _path.fillColor = new paper.GradientColor(new paper.Gradient([_options.tooltip_top_color, _options.tooltip_bottom_color]), [0, _top], [0, _bottom]);\n            _selector.css({\n                left: (_options.tooltip_padding + Math.min(_left, _right)),\n                top: (_options.tooltip_padding + _top)\n            });\n            return _path;\n        },\n        // from http://stackoverflow.com/a/6444043\n        increaseBrightness: function (hex, percent){\n            // strip the leading # if it's there\n            hex = hex.replace(/^\\s*#|\\s*$/g, '');\n\n            // convert 3 char codes --> 6, e.g. `E0F` --> `EE00FF`\n            if(hex.length === 3){\n                hex = hex.replace(/(.)/g, '$1$1');\n            }\n\n            var r = parseInt(hex.substr(0, 2), 16),\n                g = parseInt(hex.substr(2, 2), 16),\n                b = parseInt(hex.substr(4, 2), 16);\n\n            return '#' +\n               ((0|(1<<8) + r + (256 - r) * percent / 100).toString(16)).substr(1) +\n               ((0|(1<<8) + g + (256 - g) * percent / 100).toString(16)).substr(1) +\n               ((0|(1<<8) + b + (256 - b) * percent / 100).toString(16)).substr(1);\n        }\n    };\n})(window);\n\n/* END main.js */\n","(function(root) {\n    \"use strict\";\n    \n    var Backbone = root.Backbone;\n    \n    var Router = root.Rkns.Router = Backbone.Router.extend({\n        routes: {\n            '': 'index'\n        },\n        \n        index: function (parameters) {\n            \n            var result = {};\n            if (parameters === null){\n                return;\n            }\n            parameters.split(\"&\").forEach(function(part) {\n              var item = part.split(\"=\");\n              result[item[0]] = decodeURIComponent(item[1]);\n            });\n            this.trigger('router', result);            \n        }  \n    });\n\n})(window);","(function(root) {\n\n    \"use strict\";\n\n    var DataLoader = root.Rkns.DataLoader = {\n        converters: {\n            from1to2: function(data) {\n\n                var i, len;\n                if(typeof data.nodes !== 'undefined') {\n                    for(i=0, len=data.nodes.length; i<len; i++) {\n                        var node = data.nodes[i];\n                        if(node.color) {\n                            node.style = {\n                                color: node.color,\n                            };\n                        }\n                        else {\n                            node.style = {};\n                        }\n                    }\n                }\n                if(typeof data.edges !== 'undefined') {\n                    for(i=0, len=data.edges.length; i<len; i++) {\n                        var edge = data.edges[i];\n                        if(edge.color) {\n                            edge.style = {\n                                color: edge.color,\n                            };\n                        }\n                        else {\n                            edge.style = {};\n                        }\n                    }\n                }\n\n                data.schema_version = \"2\";\n\n                return data;\n            },\n        }\n    };\n\n\n    DataLoader.Loader = function(project, options) {\n        this.project = project;\n        this.dataConverters = _.defaults(options.converters || {}, DataLoader.converters);\n    };\n\n\n    DataLoader.Loader.prototype.convert = function(data) {\n        var schemaVersionFrom = this.project.getSchemaVersion(data);\n        var schemaVersionTo = this.project.getSchemaVersion();\n\n        if (schemaVersionFrom !== schemaVersionTo) {\n            var converterName = \"from\" + schemaVersionFrom + \"to\" + schemaVersionTo;\n            if (typeof this.dataConverters[converterName] === 'function') {\n                data = this.dataConverters[converterName](data);\n            }\n        }\n        return data;\n    };\n\n    DataLoader.Loader.prototype.load = function(data) {\n        this.project.set(this.convert(data), {\n            validate: true\n        });\n    };\n\n})(window);\n","(function(root) {\n    \"use strict\";\n\n    var Backbone = root.Backbone;\n\n    var Models = root.Rkns.Models = {};\n\n    Models.getUID = function(obj) {\n        var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,\n                function(c) {\n                    var r = Math.random() * 16 | 0, v = c === 'x' ? r\n                            : (r & 0x3 | 0x8);\n                    return v.toString(16);\n                });\n        if (typeof obj !== 'undefined') {\n            return obj.type + \"-\" + guid;\n        }\n        else {\n            return guid;\n        }\n    };\n\n    var RenkanModel = Backbone.RelationalModel.extend({\n        idAttribute : \"_id\",\n        constructor : function(options) {\n\n            if (typeof options !== \"undefined\") {\n                options._id = options._id || options.id || Models.getUID(this);\n                options.title = options.title || \"\";\n                options.description = options.description || \"\";\n                options.uri = options.uri || \"\";\n\n                if (typeof this.prepare === \"function\") {\n                    options = this.prepare(options);\n                }\n            }\n            Backbone.RelationalModel.prototype.constructor.call(this, options);\n        },\n        validate : function() {\n            if (!this.type) {\n                return \"object has no type\";\n            }\n        },\n        addReference : function(_options, _propName, _list, _id, _default) {\n            var _element = _list.get(_id);\n            if (typeof _element === \"undefined\" &&\n                typeof _default !== \"undefined\") {\n                _options[_propName] = _default;\n            }\n            else {\n                _options[_propName] = _element;\n            }\n        }\n    });\n\n    // USER\n    var User = Models.User = RenkanModel.extend({\n        type : \"user\",\n        prepare : function(options) {\n            options.color = options.color || \"#666666\";\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                title : this.get(\"title\"),\n                uri : this.get(\"uri\"),\n                description : this.get(\"description\"),\n                color : this.get(\"color\")\n            };\n        }\n    });\n\n    // NODE\n    var Node = Models.Node = RenkanModel.extend({\n        type : \"node\",\n        relations : [ {\n            type : Backbone.HasOne,\n            key : \"created_by\",\n            relatedModel : User\n        } ],\n        prepare : function(options) {\n            var project = options.project;\n            this.addReference(options, \"created_by\", project.get(\"users\"),\n                    options.created_by, project.current_user);\n            options.description = options.description || \"\";\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                title : this.get(\"title\"),\n                uri : this.get(\"uri\"),\n                description : this.get(\"description\"),\n                position : this.get(\"position\"),\n                image : this.get(\"image\"),\n                style : this.get(\"style\"),\n                created_by : this.get(\"created_by\") ? this.get(\"created_by\")\n                        .get(\"_id\") : null,\n                size : this.get(\"size\"),\n                clip_path : this.get(\"clip_path\"),\n                shape : this.get(\"shape\"),  \n                type : this.get(\"type\")\n            };\n        }\n    });\n\n    // EDGE\n    var Edge = Models.Edge = RenkanModel.extend({\n        type : \"edge\",\n        relations : [ {\n            type : Backbone.HasOne,\n            key : \"created_by\",\n            relatedModel : User\n        }, {\n            type : Backbone.HasOne,\n            key : \"from\",\n            relatedModel : Node\n        }, {\n            type : Backbone.HasOne,\n            key : \"to\",\n            relatedModel : Node\n        } ],\n        prepare : function(options) {\n            var project = options.project;\n            this.addReference(options, \"created_by\", project.get(\"users\"),\n                    options.created_by, project.current_user);\n            this.addReference(options, \"from\", project.get(\"nodes\"),\n                    options.from);\n            this.addReference(options, \"to\", project.get(\"nodes\"), options.to);\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                title : this.get(\"title\"),\n                uri : this.get(\"uri\"),\n                description : this.get(\"description\"),\n                from : this.get(\"from\") ? this.get(\"from\").get(\"_id\") : null,\n                to : this.get(\"to\") ? this.get(\"to\").get(\"_id\") : null,\n                style : this.get(\"style\"),\n                created_by : this.get(\"created_by\") ? this.get(\"created_by\")\n                        .get(\"_id\") : null\n            };\n        }\n    });\n\n    // View\n    var View = Models.View = RenkanModel.extend({\n        type : \"view\",\n        relations : [ {\n            type : Backbone.HasOne,\n            key : \"created_by\",\n            relatedModel : User\n        } ],\n        prepare : function(options) {\n            var project = options.project;\n            this.addReference(options, \"created_by\", project.get(\"users\"),\n                    options.created_by, project.current_user);\n            options.description = options.description || \"\";\n            if (typeof options.offset !== \"undefined\") {\n                var offset = {};\n                if (Array.isArray(options.offset)) {\n                    offset.x = options.offset[0];\n                    offset.y = options.offset.length > 1 ? options.offset[1]\n                            : options.offset[0];\n                }\n                else if (options.offset.x != null) {\n                    offset.x = options.offset.x;\n                    offset.y = options.offset.y;\n                }\n                options.offset = offset;\n            }\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                zoom_level : this.get(\"zoom_level\"),\n                offset : this.get(\"offset\"),\n                title : this.get(\"title\"),\n                description : this.get(\"description\"),\n                created_by : this.get(\"created_by\") ? this.get(\"created_by\")\n                        .get(\"_id\") : null,\n                hidden_nodes: this.get(\"hidden_nodes\")\n            // Don't need project id\n            };\n        }\n    });\n\n    // PROJECT\n    var Project = Models.Project = RenkanModel.extend({\n        schema_version : \"2\",\n        type : \"project\",\n        blacklist : [ 'saveStatus', 'loadingStatus'],\n        relations : [ {\n            type : Backbone.HasMany,\n            key : \"users\",\n            relatedModel : User,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        }, {\n            type : Backbone.HasMany,\n            key : \"nodes\",\n            relatedModel : Node,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        }, {\n            type : Backbone.HasMany,\n            key : \"edges\",\n            relatedModel : Edge,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        }, {\n            type : Backbone.HasMany,\n            key : \"views\",\n            relatedModel : View,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        } ],\n        addUser : function(_props, _options) {\n            _props.project = this;\n            var _user = User.findOrCreate(_props);\n            this.get(\"users\").push(_user, _options);\n            return _user;\n        },\n        addNode : function(_props, _options) {\n            _props.project = this;\n            var _node = Node.findOrCreate(_props);\n            this.get(\"nodes\").push(_node, _options);\n            return _node;\n        },\n        addEdge : function(_props, _options) {\n            _props.project = this;\n            var _edge = Edge.findOrCreate(_props);\n            this.get(\"edges\").push(_edge, _options);\n            return _edge;\n        },\n        addView : function(_props, _options) {\n            _props.project = this;\n            // TODO: check if need to replace with create only\n            var _view = View.findOrCreate(_props);\n            // TODO: Should we remember only one view?\n            this.get(\"views\").push(_view, _options);\n            return _view;\n        },\n        removeNode : function(_model) {\n            this.get(\"nodes\").remove(_model);\n        },\n        removeEdge : function(_model) {\n            this.get(\"edges\").remove(_model);\n        },\n        validate : function(options) {\n            var _project = this;\n            _.each(\n              [].concat(options.users, options.nodes, options.edges,options.views),\n              function(_item) {\n                if (_item) {\n                    _item.project = _project;\n                }\n              }\n            );\n        },\n        getSchemaVersion : function(data) {\n          var t = data;\n          if(typeof(t) === \"undefined\") {\n            t = this;\n          }\n          var version = t.schema_version;\n          if(!version) {\n            return 1;\n          }\n          else {\n            return version;\n          }\n        },\n        // Add event handler to remove edges when a node is removed\n        initialize : function() {\n            var _this = this;\n            this.on(\"remove:nodes\", function(_node) {\n                _this.get(\"edges\").remove(\n                        _this.get(\"edges\").filter(\n                                function(_edge) {\n                                    return _edge.get(\"from\") === _node ||\n                                           _edge.get(\"to\") === _node;\n                                }));\n            });\n        },\n        toJSON : function() {\n            var json = _.clone(this.attributes);\n            for ( var attr in json) {\n                if ((json[attr] instanceof Backbone.Model) ||\n                        (json[attr] instanceof Backbone.Collection) ||\n                        (json[attr] instanceof RenkanModel)) {\n                    json[attr] = json[attr].toJSON();\n                }\n            }\n            return _.omit(json, this.blacklist);\n        }\n    });\n\n    var RosterUser = Models.RosterUser = Backbone.Model\n            .extend({\n                type : \"roster_user\",\n                idAttribute : \"_id\",\n\n                constructor : function(options) {\n\n                    if (typeof options !== \"undefined\") {\n                        options._id = options._id ||\n                            options.id ||\n                            Models.getUID(this);\n                        options.title = options.title || \"(untitled \" + this.type + \")\";\n                        options.description = options.description || \"\";\n                        options.uri = options.uri || \"\";\n                        options.project = options.project || null;\n                        options.site_id = options.site_id || 0;\n\n                        if (typeof this.prepare === \"function\") {\n                            options = this.prepare(options);\n                        }\n                    }\n                    Backbone.Model.prototype.constructor.call(this, options);\n                },\n\n                validate : function() {\n                    if (!this.type) {\n                        return \"object has no type\";\n                    }\n                },\n\n                prepare : function(options) {\n                    options.color = options.color || \"#666666\";\n                    return options;\n                },\n\n                toJSON : function() {\n                    return {\n                        _id : this.get(\"_id\"),\n                        title : this.get(\"title\"),\n                        uri : this.get(\"uri\"),\n                        description : this.get(\"description\"),\n                        color : this.get(\"color\"),\n                        project : (this.get(\"project\") != null) ? this.get(\n                                \"project\").get(\"id\") : null,\n                        site_id : this.get(\"site_id\")\n                    };\n                }\n            });\n\n    var UsersList = Models.UsersList = Backbone.Collection.extend({\n        model : RosterUser\n    });\n\n})(window);\n","Rkns.defaults = {\n\n    language: (navigator.language || navigator.userLanguage || \"en\"),\n        /* GUI Language */\n    container: \"renkan\",\n        /* GUI Container DOM element ID */\n    search: [],\n        /* List of Search Engines */\n    bins: [],\n           /* List of Bins */\n    static_url: \"\",\n        /* URL for static resources */\n    popup_editor: true,\n        /* show the node editor as a popup inside the renkan view */\n    editor_panel: 'editor-panel',\n        /* GUI continer DOM element ID of the editor panel */\n    show_bins: true,\n        /* Show bins in left column */\n    properties: [],\n        /* Semantic properties for edges */\n    show_editor: true,\n        /* Show the graph editor... Setting this to \"false\" only shows the bins part ! */\n    read_only: false,\n        /* Allows editing of renkan without changing the rest of the GUI. Can be switched on/off on the fly to block/enable editing */\n    editor_mode: true,\n        /* Switch for Publish/Edit GUI. If editor_mode is false, read_only will be true.  */\n    manual_save: false,\n        /* In snapshot mode, clicking on the floppy will save a snapshot. Otherwise, it will show the connection status */\n    show_top_bar: true,\n        /* Show the top bar, (title, buttons, users) */\n    default_user_color: \"#303030\",\n    size_bug_fix: true,\n        /* Resize the canvas after load (fixes a bug on iPad and FF Mac) */\n    force_resize: false,\n    allow_double_click: true,\n        /* Allows Double Click to create a node on an empty background */\n    zoom_on_scroll: true,\n        /* Allows to use the scrollwheel to zoom */\n    element_delete_delay: 0,\n        /* Delay between clicking on the bin on an element and really deleting it\n           Set to 0 for delete confirm */\n    autoscale_padding: 50,\n    resize: true,\n\n    /* zoom options */\n    show_zoom: true,\n        /* show zoom buttons */\n    save_view: true,\n        /* show buttons to save view */\n    default_view: false,\n        /* Allows to load default view (zoom+offset) at start on read_only mode, instead of autoScale. the default_view will be the last */\n\n\n    /* TOP BAR BUTTONS */\n    show_search_field: true,\n    show_user_list: true,\n    user_name_editable: true,\n    user_color_editable: true,\n    show_user_color: true,\n    show_save_button: true,\n    show_export_button: true,\n    show_open_button: false,\n    show_addnode_button: true,\n    show_addedge_button: true,\n    show_bookmarklet: true,\n    show_fullscreen_button: true,\n    home_button_url: false,\n    home_button_title: \"Home\",\n\n    /* MINI-MAP OPTIONS */\n\n    show_minimap: true,\n        /* Show a small map at the bottom right */\n    minimap_width: 160,\n    minimap_height: 120,\n    minimap_padding: 20,\n    minimap_background_color: \"#ffffff\",\n    minimap_border_color: \"#cccccc\",\n    minimap_highlight_color: \"#ffff00\",\n    minimap_highlight_weight: 5,\n\n\n    /* EDGE/NODE COMMON OPTIONS */\n\n    buttons_background: \"#202020\",\n    buttons_label_color: \"#c000c0\",\n    buttons_label_font_size: 9,\n\n    ghost_opacity : 0.3,\n        /* opacity when the hidden element is revealed */\n    default_dash_array : [4, 5],\n        /* dash line genometry */\n\n    /* NODE DISPLAY OPTIONS */\n\n    show_node_circles: true,\n        /* Show circles for nodes */\n    clip_node_images: true,\n        /* Constraint node images to circles */\n    node_images_fill_mode: false,\n        /* Set to false for \"letterboxing\" (height/width of node adapted to show full image)\n           Set to true for \"crop\" (adapted to fill circle) */\n    node_size_base: 25,\n    node_stroke_width: 2,\n    node_stroke_max_width: 12,\n    selected_node_stroke_width: 4,\n    selected_node_stroke_max_width: 24,\n    node_stroke_witdh_scale: 5,\n    node_fill_color: \"#ffffff\",\n    highlighted_node_fill_color: \"#ffff00\",\n    node_label_distance: 5,\n        /* Vertical distance between node and label */\n    node_label_max_length: 60,\n        /* Maximum displayed text length */\n    label_untitled_nodes: \"(untitled)\",\n        /* Label to display on untitled nodes */\n    hide_nodes: true, \n        /* allow hide/show nodes */\n    change_shapes: true,\n        /* Change shapes enabled */\n    change_types: true,\n    /* Change type enabled */\n    \n    /* NODE EDITOR TEMPLATE*/\n    \n    node_editor_templates: {\n        \"default\": \"templates/nodeeditor_readonly.html\",\n        \"video\": \"templates/nodeeditor_video.html\"\n    },\n\n    /* EDGE DISPLAY OPTIONS */\n\n    edge_stroke_width: 2,\n    edge_stroke_max_width: 12,\n    selected_edge_stroke_width: 4,\n    selected_edge_stroke_max_width: 24,\n    edge_stroke_witdh_scale: 5,\n\n    edge_label_distance: 0,\n    edge_label_max_length: 20,\n    edge_arrow_length: 18,\n    edge_arrow_width: 12,\n    edge_arrow_max_width: 32,\n    edge_gap_in_bundles: 12,\n    label_untitled_edges: \"\",\n\n    /* CONTEXTUAL DISPLAY (TOOLTIP OR EDITOR) OPTIONS */\n\n    tooltip_width: 275,\n    tooltip_padding: 10,\n    tooltip_margin: 15,\n    tooltip_arrow_length : 20,\n    tooltip_arrow_width : 40,\n    tooltip_top_color: \"#f0f0f0\",\n    tooltip_bottom_color: \"#d0d0d0\",\n    tooltip_border_color: \"#808080\",\n    tooltip_border_width: 1,\n\n    richtext_editor_config: {\n        toolbarGroups: [\n            { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },\n            { name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },\n            '/',\n\t        { name: 'styles'},\n        ],\n        removePlugins : 'colorbutton,find,flash,font,forms,iframe,image,newpage,smiley,specialchar,stylescombo,templates',\n    },\n\n    /* NODE EDITOR OPTIONS */\n\n    show_node_editor_uri: true,\n    show_node_editor_description: true,\n    show_node_editor_description_richtext: true,\n    show_node_editor_size: true,\n    show_node_editor_style: true,\n    show_node_editor_style_color: true,\n    show_node_editor_style_dash: true,\n    show_node_editor_style_thickness: true,\n    show_node_editor_image: true,\n    show_node_editor_creator: true,\n    allow_image_upload: true,\n    uploaded_image_max_kb: 500,\n\n\n    /* NODE TOOLTIP OPTIONS */\n\n    show_node_tooltip_uri: true,\n    show_node_tooltip_description: true,\n    show_node_tooltip_color: true,\n    show_node_tooltip_image: true,\n    show_node_tooltip_creator: true,\n\n    /* EDGE EDITOR OPTIONS */\n\n    show_edge_editor_uri: true,\n    show_edge_editor_style: true,\n    show_edge_editor_style_color: true,\n    show_edge_editor_style_dash: true,\n    show_edge_editor_style_thickness: true,\n    show_edge_editor_style_arrow: true,\n    show_edge_editor_direction: true,\n    show_edge_editor_nodes: true,\n    show_edge_editor_creator: true,\n\n    /* EDGE TOOLTIP OPTIONS */\n\n    show_edge_tooltip_uri: true,\n    show_edge_tooltip_color: true,\n    show_edge_tooltip_nodes: true,\n    show_edge_tooltip_creator: true,\n\n};\n","Rkns.i18n = {\n    fr: {\n        \"Edit Node\": \"Édition d’un nœud\",\n        \"Edit Edge\": \"Édition d’un lien\",\n        \"Title:\": \"Titre :\",\n        \"URI:\": \"URI :\",\n        \"Description:\": \"Description :\",\n        \"From:\": \"De :\",\n        \"To:\": \"Vers :\",\n        \"Image\": \"Image\",\n        \"Image URL:\": \"URL d'Image\",\n        \"Choose Image File:\": \"Choisir un fichier image\",\n        \"Full Screen\": \"Mode plein écran\",\n        \"Add Node\": \"Ajouter un nœud\",\n        \"Add Edge\": \"Ajouter un lien\",\n        \"Save Project\": \"Enregistrer le projet\",\n        \"Open Project\": \"Ouvrir un projet\",\n        \"Auto-save enabled\": \"Enregistrement automatique activé\",\n        \"Connection lost\": \"Connexion perdue\",\n        \"Created by:\": \"Créé par :\",\n        \"Zoom In\": \"Agrandir l’échelle\",\n        \"Zoom Out\": \"Rapetisser l’échelle\",\n        \"Edit\": \"Éditer\",\n        \"Remove\": \"Supprimer\",\n        \"Cancel deletion\": \"Annuler la suppression\",\n        \"Link to another node\": \"Créer un lien\",\n        \"Enlarge\": \"Agrandir\",\n        \"Shrink\": \"Rétrécir\",\n        \"Click on the background canvas to add a node\": \"Cliquer sur le fond du graphe pour rajouter un nœud\",\n        \"Click on a first node to start the edge\": \"Cliquer sur un premier nœud pour commencer le lien\",\n        \"Click on a second node to complete the edge\": \"Cliquer sur un second nœud pour terminer le lien\",\n        \"Wikipedia\": \"Wikipédia\",\n        \"Wikipedia in \": \"Wikipédia en \",\n        \"French\": \"Français\",\n        \"English\": \"Anglais\",\n        \"Japanese\": \"Japonais\",\n        \"Untitled project\": \"Projet sans titre\",\n        \"Lignes de Temps\": \"Lignes de Temps\",\n        \"Loading, please wait\": \"Chargement en cours, merci de patienter\",\n        \"Edge color:\": \"Couleur :\",\n        \"Dash:\": \"Point. :\",\n        \"Thickness:\": \"Epaisseur :\",\n        \"Arrow:\": \"Flèche :\",\n        \"Node color:\": \"Couleur :\",\n        \"Choose color\": \"Choisir une couleur\",\n        \"Change edge direction\": \"Changer le sens du lien\",\n        \"Do you really wish to remove node \": \"Voulez-vous réellement supprimer le nœud \",\n        \"Do you really wish to remove edge \": \"Voulez-vous réellement supprimer le lien \",\n        \"This file is not an image\": \"Ce fichier n'est pas une image\",\n        \"Image size must be under \": \"L'image doit peser moins de \",\n        \"Size:\": \"Taille :\",\n        \"KB\": \"ko\",\n        \"Choose from vocabulary:\": \"Choisir dans un vocabulaire :\",\n        \"SKOS Documentation properties\": \"SKOS: Propriétés documentaires\",\n        \"has note\": \"a pour note\",\n        \"has example\": \"a pour exemple\",\n        \"has definition\": \"a pour définition\",\n        \"SKOS Semantic relations\": \"SKOS: Relations sémantiques\",\n        \"has broader\": \"a pour concept plus large\",\n        \"has narrower\": \"a pour concept plus étroit\",\n        \"has related\": \"a pour concept apparenté\",\n        \"Dublin Core Metadata\": \"Métadonnées Dublin Core\",\n        \"has contributor\": \"a pour contributeur\",\n        \"covers\": \"couvre\",\n        \"created by\": \"créé par\",\n        \"has date\": \"a pour date\",\n        \"published by\": \"édité par\",\n        \"has source\": \"a pour source\",\n        \"has subject\": \"a pour sujet\",\n        \"Dragged resource\": \"Ressource glisée-déposée\",\n        \"Search the Web\": \"Rechercher en ligne\",\n        \"Search in Bins\": \"Rechercher dans les chutiers\",\n        \"Close bin\": \"Fermer le chutier\",\n        \"Refresh bin\": \"Rafraîchir le chutier\",\n        \"(untitled)\": \"(sans titre)\",\n        \"Select contents:\": \"Sélectionner des contenus :\",\n        \"Drag items from this website, drop them in Renkan\": \"Glissez des éléments de ce site web vers Renkan\",\n        \"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\",\n        \"Shapes available\": \"Formes disponibles\",\n        \"Circle\": \"Cercle\",\n        \"Square\": \"Carré\",\n        \"Diamond\": \"Losange\",\n        \"Hexagone\": \"Hexagone\",\n        \"Ellipse\": \"Ellipse\",\n        \"Star\": \"Étoile\",\n        \"Cloud\": \"Nuage\",\n        \"Triangle\": \"Triangle\",\n        \"Zoom Fit\": \"Ajuster le Zoom\",\n        \"Download Project\": \"Télécharger le projet\",\n        \"Save view\": \"Sauver la vue\",\n        \"View saved view\": \"Restaurer la Vue\",\n        \"Renkan \\'Drag-to-Add\\' bookmarklet\": \"Renkan \\'Deplacer-Pour-Ajouter\\' Signet\",\n        \"(unknown user)\":\"(non authentifié)\",\n        \"<unknown user>\":\"<non authentifié>\",\n        \"Search in graph\":\"Rechercher dans carte\",\n        \"Search in \" : \"Chercher dans \"\n    }\n};\n","/* Saves the Full JSON at each modification */\n\nRkns.jsonIO = function(_renkan, _opts) {\n    var _proj = _renkan.project;\n    if (typeof _opts.http_method === \"undefined\") {\n        _opts.http_method = 'PUT';\n    }\n    var _load = function() {\n        _renkan.renderer.redrawActive = false;\n        _proj.set({\n            loadingStatus : true\n        });\n        Rkns.$.getJSON(_opts.url, function(_data) {\n            _renkan.dataloader.load(_data);\n            _proj.set({\n                loadingStatus : false\n            });\n            _proj.set({\n                saveStatus : 0\n            });\n            _renkan.renderer.redrawActive = true;\n            _renkan.renderer.fixSize();\n        });\n    };\n    var _save = function() {\n        _proj.set({\n            saveStatus : 2\n        });\n        var _data = _proj.toJSON();\n        if (!_renkan.read_only) {\n            Rkns.$.ajax({\n                type : _opts.http_method,\n                url : _opts.url,\n                contentType : \"application/json\",\n                data : JSON.stringify(_data),\n                success : function(data, textStatus, jqXHR) {\n                    _proj.set({\n                        saveStatus : 0\n                    });\n                }\n            });\n        }\n\n    };\n    var _thrSave = Rkns._.throttle(function() {\n        setTimeout(_save, 100);\n    }, 1000);\n    _proj.on(\"add:nodes add:edges add:users add:views\", function(_model) {\n        _model.on(\"change remove\", function(_model) {\n            _thrSave();\n        });\n        _thrSave();\n    });\n    _proj.on(\"change\", function() {\n        if (!(_proj.changedAttributes.length === 1 && _proj\n                .hasChanged('saveStatus'))) {\n            _thrSave();\n        }\n    });\n\n    _load();\n};\n","/* Saves the Full JSON once */\n\nRkns.jsonIOSaveOnClick = function(_renkan, _opts) {\n    var _proj = _renkan.project,\n        _saveWarn = false,\n        _onLeave = function() {\n            return \"Project not saved\";\n        };\n    if (typeof _opts.http_method === \"undefined\") {\n        _opts.http_method = 'POST';\n    }\n    var _load = function() {\n        var getdata = {},\n            rx = /id=([^&#?=]+)/,\n            matches = document.location.hash.match(rx);\n        if (matches) {\n            getdata.id = matches[1];\n        }\n        Rkns.$.ajax({\n            url: _opts.url,\n            data: getdata,\n            beforeSend: function(){\n            \t_proj.set({loadingStatus:true});\n            },\n            success: function(_data) {\n                _renkan.dataloader.load(_data);\n                _proj.set({loadingStatus:false});\n                _proj.set({saveStatus:0});\n                _renkan.renderer.autoScale();\n            }\n        });\n    };\n    var _save = function() {\n        _proj.set(\"saved_at\", new Date());\n        var _data = _proj.toJSON();\n        Rkns.$.ajax({\n            type: _opts.http_method,\n            url: _opts.url,\n            contentType: \"application/json\",\n            data: JSON.stringify(_data),\n            beforeSend: function(){\n            \t_proj.set({saveStatus:2});\n            },\n            success: function(data, textStatus, jqXHR) {\n                $(window).off(\"beforeunload\", _onLeave);\n                _saveWarn = false;\n                _proj.set({saveStatus:0});\n                //document.location.hash = \"#id=\" + data.id;\n                //$(\".Rk-Notifications\").text(\"Saved as \"+document.location.href).fadeIn().delay(2000).fadeOut();\n            }\n        });\n    };\n    var _checkLeave = function() {\n    \t_proj.set({saveStatus:1});\n\n        var title = _proj.get(\"title\");\n        if (title && _proj.get(\"nodes\").length) {\n            $(\".Rk-Save-Button\").removeClass(\"disabled\");\n        } else {\n            $(\".Rk-Save-Button\").addClass(\"disabled\");\n        }\n        if (title) {\n            $(\".Rk-PadTitle\").css(\"border-color\",\"#333333\");\n        }\n        if (!_saveWarn) {\n            _saveWarn = true;\n            $(window).on(\"beforeunload\", _onLeave);\n        }\n    };\n    _load();\n    _proj.on(\"add:nodes add:edges add:users change\", function(_model) {\n\t    _model.on(\"change remove\", function(_model) {\n\t    \tif(!(_model.changedAttributes.length === 1 && _model.hasChanged('saveStatus'))) {\n\t    \t\t_checkLeave();\n\t    \t}\n\t    });\n\t\tif(!(_proj.changedAttributes.length === 1 && _proj.hasChanged('saveStatus'))) {\n\t\t    _checkLeave();\n    \t}\n    });\n    _renkan.renderer.save = function() {\n        if ($(\".Rk-Save-Button\").hasClass(\"disabled\")) {\n            if (!_proj.get(\"title\")) {\n                $(\".Rk-PadTitle\").css(\"border-color\",\"#ff0000\");\n            }\n        } else {\n            _save();\n        }\n    };\n};\n","(function(Rkns) {\n\"use strict\";\n\nvar _ = Rkns._;\n\nvar Ldt = Rkns.Ldt = {};\n\nvar Bin = Ldt.Bin = function(_renkan, _opts) {\n    if (_opts.ldt_type) {\n        var Resclass = Ldt[_opts.ldt_type+\"Bin\"];\n        if (Resclass) {\n            return new Resclass(_renkan, _opts);\n        }\n    }\n    console.error(\"No such LDT Bin Type\");\n};\n\nvar ProjectBin = Ldt.ProjectBin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nProjectBin.prototype.tagTemplate = renkanJST['templates/ldtjson-bin/tagtemplate.html'];\n\nProjectBin.prototype.annotationTemplate = renkanJST['templates/ldtjson-bin/annotationtemplate.html'];\n\nProjectBin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.proj_id = _opts.project_id;\n    this.ldt_platform = _opts.ldt_platform || \"http://ldt.iri.centrepompidou.fr/\";\n    this.title_$.html(_opts.title);\n    this.title_icon_$.addClass('Rk-Ldt-Title-Icon');\n    this.refresh();\n};\n\nProjectBin.prototype.render = function(searchbase) {\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    function highlight(_text) {\n        var _e = _(_text).escape();\n        return search.isempty ? _e : search.replace(_e, \"<span class='searchmatch'>$1</span>\");\n    }\n    function convertTC(_ms) {\n        function pad(_n) {\n            var _res = _n.toString();\n            while (_res.length < 2) {\n                _res = '0' + _res;\n            }\n            return _res;\n        }\n        var _totalSeconds = Math.abs(Math.floor(_ms/1000)),\n            _hours = Math.floor(_totalSeconds / 3600),\n            _minutes = (Math.floor(_totalSeconds / 60) % 60),\n            _seconds = _totalSeconds % 60,\n            _res = '';\n        if (_hours) {\n            _res += pad(_hours) + ':';\n        }\n        _res += pad(_minutes) + ':' + pad(_seconds);\n        return _res;\n    }\n\n    var _html = '<li><h3>Tags</h3></li>',\n        _projtitle = this.data.meta[\"dc:title\"],\n        _this = this,\n        count = 0;\n    _this.title_$.text('LDT Project: \"' + _projtitle + '\"');\n    _.map(_this.data.tags,function(_tag) {\n        var _title = _tag.meta[\"dc:title\"];\n        if (!search.isempty && !search.test(_title)) {\n            return;\n        }\n        count++;\n        _html += _this.tagTemplate({\n            ldt_platform: _this.ldt_platform,\n            title: _title,\n            htitle: highlight(_title),\n            encodedtitle : encodeURIComponent(_title),\n            static_url: _this.renkan.options.static_url\n        });\n    });\n    _html += '<li><h3>Annotations</h3></li>';\n    _.map(_this.data.annotations,function(_annotation) {\n        var _description = _annotation.content.description,\n            _title = _annotation.content.title.replace(_description,\"\");\n        if (!search.isempty && !search.test(_title) && !search.test(_description)) {\n            return;\n        }\n        count++;\n        var _duration = _annotation.end - _annotation.begin,\n            _img = (\n                (_annotation.content && _annotation.content.img && _annotation.content.img.src) ?\n                  _annotation.content.img.src :\n                  ( _duration ? _this.renkan.options.static_url+\"img/ldt-segment.png\" : _this.renkan.options.static_url+\"img/ldt-point.png\" )\n            );\n        _html += _this.annotationTemplate({\n            ldt_platform: _this.ldt_platform,\n            title: _title,\n            htitle: highlight(_title),\n            description: _description,\n            hdescription: highlight(_description),\n            start: convertTC(_annotation.begin),\n            end: convertTC(_annotation.end),\n            duration: convertTC(_duration),\n            mediaid: _annotation.media,\n            annotationid: _annotation.id,\n            image: _img,\n            static_url: _this.renkan.options.static_url\n        });\n    });\n\n    this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nProjectBin.prototype.refresh = function() {\n    var _this = this;\n    Rkns.$.ajax({\n        url: this.ldt_platform + 'ldtplatform/ldt/cljson/id/' + this.proj_id,\n        dataType: \"jsonp\",\n        success: function(_data) {\n            _this.data = _data;\n            _this.render();\n        }\n    });\n};\n\nvar Search = Ldt.Search = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.lang = _opts.lang || \"en\";\n};\n\nSearch.prototype.getBgClass = function() {\n    return \"Rk-Ldt-Icon\";\n};\n\nSearch.prototype.getSearchTitle = function() {\n    return this.renkan.translate(\"Lignes de Temps\");\n};\n\nSearch.prototype.search = function(_q) {\n    this.renkan.tabs.push(\n        new ResultsBin(this.renkan, {\n            search: _q\n        })\n    );\n};\n\nvar ResultsBin = Ldt.ResultsBin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nResultsBin.prototype.segmentTemplate = renkanJST['templates/ldtjson-bin/segmenttemplate.html'];\n\nResultsBin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.ldt_platform = _opts.ldt_platform || \"http://ldt.iri.centrepompidou.fr/\";\n    this.max_results = _opts.max_results || 50;\n    this.search = _opts.search;\n    this.title_$.html('Lignes de Temps: \"' + _opts.search + '\"');\n    this.title_icon_$.addClass('Rk-Ldt-Title-Icon');\n    this.refresh();\n};\n\nResultsBin.prototype.render = function(searchbase) {\n    if (!this.data) {\n        return;\n    }\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    var highlightrx = (search.isempty ? Rkns.Utils.regexpFromTextOrArray(this.search) : search);\n    function highlight(_text) {\n        return highlightrx.replace(_(_text).escape(), \"<span class='searchmatch'>$1</span>\");\n    }\n    function convertTC(_ms) {\n        function pad(_n) {\n            var _res = _n.toString();\n            while (_res.length < 2) {\n                _res = '0' + _res;\n            }\n            return _res;\n        }\n        var _totalSeconds = Math.abs(Math.floor(_ms/1000)),\n            _hours = Math.floor(_totalSeconds / 3600),\n            _minutes = (Math.floor(_totalSeconds / 60) % 60),\n            _seconds = _totalSeconds % 60,\n            _res = '';\n        if (_hours) {\n            _res += pad(_hours) + ':';\n        }\n        _res += pad(_minutes) + ':' + pad(_seconds);\n        return _res;\n    }\n\n    var _html = '',\n        _this = this,\n        count = 0;\n    _.each(this.data.objects,function(_segment) {\n        var _description = _segment.abstract,\n            _title = _segment.title;\n        if (!search.isempty && !search.test(_title) && !search.test(_description)) {\n            return;\n        }\n        count++;\n        var _duration = _segment.duration,\n            _begin = _segment.start_ts,\n            _end = + _segment.duration + _begin,\n            _img = (\n                _duration ?\n                  _this.renkan.options.static_url + \"img/ldt-segment.png\" :\n                  _this.renkan.options.static_url + \"img/ldt-point.png\"\n            );\n        _html += _this.segmentTemplate({\n            ldt_platform: _this.ldt_platform,\n            title: _title,\n            htitle: highlight(_title),\n            description: _description,\n            hdescription: highlight(_description),\n            start: convertTC(_begin),\n            end: convertTC(_end),\n            duration: convertTC(_duration),\n            mediaid: _segment.iri_id,\n            //projectid: _segment.project_id,\n            //cuttingid: _segment.cutting_id,\n            annotationid: _segment.element_id,\n            image: _img\n        });\n    });\n\n    this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nResultsBin.prototype.refresh = function() {\n    var _this = this;\n    Rkns.$.ajax({\n        url: this.ldt_platform + 'ldtplatform/api/ldt/1.0/segments/search/',\n        data: {\n            format: \"jsonp\",\n            q: this.search,\n            limit: this.max_results\n        },\n        dataType: \"jsonp\",\n        success: function(_data) {\n            _this.data = _data;\n            _this.render();\n        }\n    });\n};\n\n})(window.Rkns);\n","Rkns.ResourceList = {};\n\nRkns.ResourceList.Bin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nRkns.ResourceList.Bin.prototype.resultTemplate = renkanJST['templates/list-bin.html'];\n\nRkns.ResourceList.Bin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.title_$.html(_opts.title);\n    if (_opts.list) {\n        this.data = _opts.list;\n    }\n    this.refresh();\n};\n\nRkns.ResourceList.Bin.prototype.render = function(searchbase) {\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    function highlight(_text) {\n        var _e = _(_text).escape();\n        return search.isempty ? _e : search.replace(_e, \"<span class='searchmatch'>$1</span>\");\n    }\n    var _html = \"\",\n        _this = this,\n        count = 0;\n    Rkns._.each(this.data,function(_item) {\n        var _element;\n        if (typeof _item === \"string\") {\n            if (/^(https?:\\/\\/|www)/.test(_item)) {\n                _element = { url: _item };\n            } else {\n                _element = { title: _item.replace(/[:,]?\\s?(https?:\\/\\/|www)[\\d\\w\\/.&?=#%-_]+\\s?/,'').trim() };\n                var _match = _item.match(/(https?:\\/\\/|www)[\\d\\w\\/.&?=#%-_]+/);\n                if (_match) {\n                    _element.url = _match[0];\n                }\n                if (_element.title.length > 80) {\n                    _element.description = _element.title;\n                    _element.title = _element.title.replace(/^(.{30,60})\\s.+$/,'$1…');\n                }\n            }\n        } else {\n            _element = _item;\n        }\n        var title = _element.title || (_element.url || \"\").replace(/^https?:\\/\\/(www\\.)?/,'').replace(/^(.{40}).+$/,'$1…'),\n            url = _element.url || \"\",\n            description = _element.description || \"\",\n            image = _element.image || \"\";\n        if (url && !/^https?:\\/\\//.test(url)) {\n            url = 'http://' + url;\n        }\n        if (!search.isempty && !search.test(title) && !search.test(description)) {\n            return;\n        }\n        count++;\n        _html += _this.resultTemplate({\n            url: url,\n            title: title,\n            htitle: highlight(title),\n            image: image,\n            description: description,\n            hdescription: highlight(description),\n            static_url: _this.renkan.options.static_url\n        });\n    });\n    _this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nRkns.ResourceList.Bin.prototype.refresh = function() {\n    if (this.data) {\n        this.render();\n    }\n};\n","Rkns.Wikipedia = {\n};\n\nRkns.Wikipedia.Search = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.lang = _opts.lang || \"en\";\n};\n\nRkns.Wikipedia.Search.prototype.getBgClass = function() {\n    return \"Rk-Wikipedia-Search-Icon Rk-Wikipedia-Lang-\" + this.lang;\n};\n\nRkns.Wikipedia.Search.prototype.getSearchTitle = function() {\n    var langs = {\n        \"fr\": \"French\",\n        \"en\": \"English\",\n        \"ja\": \"Japanese\"\n    };\n    if (langs[this.lang]) {\n        return this.renkan.translate(\"Wikipedia in \") + this.renkan.translate(langs[this.lang]);\n    } else {\n        return this.renkan.translate(\"Wikipedia\") + \" [\" + this.lang + \"]\";\n    }\n};\n\nRkns.Wikipedia.Search.prototype.search = function(_q) {\n    this.renkan.tabs.push(\n        new Rkns.Wikipedia.Bin(this.renkan, {\n            lang: this.lang,\n            search: _q\n        })\n    );\n};\n\nRkns.Wikipedia.Bin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nRkns.Wikipedia.Bin.prototype.resultTemplate = renkanJST['templates/wikipedia-bin/resulttemplate.html'];\n\nRkns.Wikipedia.Bin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.search = _opts.search;\n    this.lang = _opts.lang || \"en\";\n    this.title_icon_$.addClass('Rk-Wikipedia-Title-Icon Rk-Wikipedia-Lang-' + this.lang);\n    this.title_$.html(this.search).addClass(\"Rk-Wikipedia-Title\");\n    this.refresh();\n};\n\nRkns.Wikipedia.Bin.prototype.render = function(searchbase) {\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    var highlightrx = (search.isempty ? Rkns.Utils.regexpFromTextOrArray(this.search) : search);\n    function highlight(_text) {\n        return highlightrx.replace(_(_text).escape(), \"<span class='searchmatch'>$1</span>\");\n    }\n    var _html = \"\",\n        _this = this,\n        count = 0;\n    Rkns._.each(this.data.query.search, function(_result) {\n        var title = _result.title,\n            url = \"http://\" + _this.lang + \".wikipedia.org/wiki/\" + encodeURI(title.replace(/ /g,\"_\")),\n            description = Rkns.$('<div>').html(_result.snippet).text();\n        if (!search.isempty && !search.test(title) && !search.test(description)) {\n            return;\n        }\n        count++;\n        _html += _this.resultTemplate({\n            url: url,\n            title: title,\n            htitle: highlight(title),\n            description: description,\n            hdescription: highlight(description),\n            static_url: _this.renkan.options.static_url\n        });\n    });\n    _this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nRkns.Wikipedia.Bin.prototype.refresh = function() {\n    var _this = this;\n    Rkns.$.ajax({\n        url: \"http://\" + _this.lang + \".wikipedia.org/w/api.php?action=query&list=search&srsearch=\" + encodeURIComponent(this.search) + \"&format=json\",\n        dataType: \"jsonp\",\n        success: function(_data) {\n            _this.data = _data;\n            _this.render();\n        }\n    });\n};\n","\ndefine('renderer/baserepresentation',['jquery', 'underscore'], function ($, _) {\n    'use strict';\n\n    /* Rkns.Renderer._BaseRepresentation Class */\n\n    /* In Renkan, a \"Representation\" is a sort of ViewModel (in the MVVM paradigm) and bridges the gap between\n     * models (written with Backbone.js) and the view (written with Paper.js)\n     * Renkan's representations all inherit from Rkns.Renderer._BaseRepresentation '*/\n\n    var _BaseRepresentation = function(_renderer, _model) {\n        if (typeof _renderer !== \"undefined\") {\n            this.renderer = _renderer;\n            this.renkan = _renderer.renkan;\n            this.project = _renderer.renkan.project;\n            this.options = _renderer.renkan.options;\n            this.model = _model;\n            if (this.model) {\n                var _this = this;\n                this._changeBinding = function() {\n                    _this.redraw({change: true});\n                };\n                this._removeBinding = function() {\n                    _renderer.removeRepresentation(_this);\n                    _.defer(function() {\n                        _renderer.redraw();\n                    });\n                };\n                this._selectBinding = function() {\n                    _this.select();\n                };\n                this._unselectBinding = function() {\n                    _this.unselect();\n                };\n                this.model.on(\"change\", this._changeBinding );\n                this.model.on(\"remove\", this._removeBinding );\n                this.model.on(\"select\", this._selectBinding );\n                this.model.on(\"unselect\", this._unselectBinding );\n            }\n        }\n    };\n\n    /* Rkns.Renderer._BaseRepresentation Methods */\n\n    _(_BaseRepresentation.prototype).extend({\n        _super: function(_func) {\n            return _BaseRepresentation.prototype[_func].apply(this, Array.prototype.slice.call(arguments, 1));\n        },\n        redraw: function() {},\n        moveTo: function() {},\n        show: function() { return \"BaseRepresentation.show\"; },\n        hide: function() {},\n        select: function() {\n            if (this.model) {\n                this.model.trigger(\"selected\");\n            }\n        },\n        unselect: function() {\n            if (this.model) {\n                this.model.trigger(\"unselected\");\n            }\n        },\n        highlight: function() {},\n        unhighlight: function() {},\n        mousedown: function() {},\n        mouseup: function() {\n            if (this.model) {\n                this.model.trigger(\"clicked\");\n            }\n        },\n        destroy: function() {\n            if (this.model) {\n                this.model.off(\"change\", this._changeBinding );\n                this.model.off(\"remove\", this._removeBinding );\n                this.model.off(\"select\", this._selectBinding );\n                this.model.off(\"unselect\", this._unselectBinding );\n            }\n        }\n    }).value();\n\n    /* End of Rkns.Renderer._BaseRepresentation Class */\n\n    return _BaseRepresentation;\n\n});\n\ndefine('requtils',[], function ($, _) {\n    'use strict';\n    return {\n        getUtils: function(){\n            return window.Rkns.Utils;\n        },\n        getRenderer: function(){\n            return window.Rkns.Renderer;\n        }\n    };\n\n});\n\n\ndefine('renderer/basebutton',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* Rkns.Renderer._BaseButton Class */\n\n    /* BaseButton is extended by contextual buttons that appear when hovering on nodes and edges */\n\n    var _BaseButton = Utils.inherit(BaseRepresentation);\n\n    _(_BaseButton.prototype).extend({\n        moveTo: function(_pos) {\n            this.sector.moveTo(_pos);\n        },\n        show: function() {\n            this.sector.show();\n        },\n        hide: function() {\n            this.sector.hide();\n        },\n        select: function() {\n            this.sector.select();\n        },\n        unselect: function(_newTarget) {\n            this.sector.unselect();\n            if (!_newTarget || (_newTarget !== this.source_representation && _newTarget.source_representation !== this.source_representation)) {\n                this.source_representation.unselect();\n            }\n        },\n        destroy: function() {\n            this.sector.destroy();\n        }\n    }).value();\n\n    return _BaseButton;\n\n});\n\n\ndefine('renderer/shapebuilder',[], function () {\n    'use strict';\n\n    var cloud_path = \"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\";\n    /* ShapeBuilder Begin */\n\n    var builders = {\n        \"circle\":{\n            getShape: function() {\n                return new paper.Path.Circle([0, 0], 1);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Circle(center, radius);\n            }\n        },\n        \"rectangle\":{\n            getShape: function() {\n                return new paper.Path.Rectangle([-2, -2], [2, 2]);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Rectangle([-radius, -radius], [radius*2, radius*2]);\n            }\n        },\n        \"ellipse\":{\n            getShape: function() {\n                return new paper.Path.Ellipse(new paper.Rectangle([-2, -1], [2, 1]));\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Ellipse(new paper.Rectangle([-radius, -radius/2], [radius*2, radius]));\n            }\n        },\n        \"polygon\":{\n            getShape: function() {\n                return new paper.Path.RegularPolygon([0, 0], 6, 1);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.RegularPolygon(center, 6, radius);\n            }\n        },\n        \"diamond\":{\n            getShape: function() {\n                var d = new paper.Path.Rectangle([-Math.SQRT2, -Math.SQRT2], [Math.SQRT2, Math.SQRT2]);\n                d.rotate(45);\n                return d;\n            },\n            getImageShape: function(center, radius) {\n                var d = new paper.Path.Rectangle([-radius*Math.SQRT2/2, -radius*Math.SQRT2/2], [radius*Math.SQRT2, radius*Math.SQRT2]);\n                d.rotate(45);\n                return d;\n            }\n        },\n        \"star\":{\n            getShape: function() {\n                return new paper.Path.Star([0, 0], 8, 1, 0.7);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Star(center, 8, radius*1, radius*0.7);\n            }\n        },\n        \"cloud\": {\n            getShape: function() {\n                var path = new paper.Path(cloud_path);\n                return path;\n\n            },\n            getImageShape: function(center, radius) {\n                var path = new paper.Path(cloud_path);\n                path.scale(radius);\n                path.translate(center);\n                return path;\n            }\n        },\n        \"triangle\": {\n            getShape: function() {\n                return new paper.Path.RegularPolygon([0,0], 3, 1);\n            },\n            getImageShape: function(center, radius) {\n                var shape = new paper.Path.RegularPolygon([0,0], 3, 1);\n                shape.scale(radius);\n                shape.translate(center);\n                return shape;\n            }\n        },\n        \"svg\": function(path){\n            return {\n                getShape: function() {\n                    return new paper.Path(path);\n                },\n                getImageShape: function(center, radius) {\n                    // No calcul for the moment\n                    return new paper.Path();\n                }\n            };\n        }\n    };\n\n    var ShapeBuilder = function (shape){\n        if(shape === null || typeof shape === \"undefined\"){\n            shape = \"circle\";\n        }\n        if(shape.substr(0,4)===\"svg:\"){\n            return builders.svg(shape.substr(4));\n        }\n        if(!(shape in builders)){\n            shape = \"circle\";\n        }\n        return builders[shape];\n    };\n\n    ShapeBuilder.builders = builders;\n\n    return ShapeBuilder;\n\n});\n\ndefine('renderer/noderepr',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation', 'renderer/shapebuilder'], function ($, _, requtils, BaseRepresentation, ShapeBuilder) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* Rkns.Renderer.Node Class */\n\n    /* The representation for the node : A circle, with an image inside and a text label underneath.\n     * The circle and the image are drawn on canvas and managed by Paper.js.\n     * The text label is an HTML node, managed by jQuery. */\n\n    //var NodeRepr = Renderer.Node = Utils.inherit(Renderer._BaseRepresentation);\n    var NodeRepr = Utils.inherit(BaseRepresentation);\n\n    _(NodeRepr.prototype).extend({\n        _init: function() {\n            this.renderer.node_layer.activate();\n            this.type = \"Node\";\n            this.buildShape();\n            this.hidden = false;\n            this.ghost= false;\n            if (this.options.show_node_circles) {\n                this.circle.strokeWidth = this.options.node_stroke_width;\n                this.h_ratio = 1;\n            } else {\n                this.h_ratio = 0;\n            }\n            this.title = $('<div class=\"Rk-Label\">').appendTo(this.renderer.labels_$);\n\n            if (this.options.editor_mode) {\n                var Renderer = requtils.getRenderer();\n                this.normal_buttons = [\n                                       new Renderer.NodeEditButton(this.renderer, null),\n                                       new Renderer.NodeRemoveButton(this.renderer, null),\n                                       new Renderer.NodeLinkButton(this.renderer, null),\n                                       new Renderer.NodeEnlargeButton(this.renderer, null),\n                                       new Renderer.NodeShrinkButton(this.renderer, null)\n                                       ];\n                if (this.options.hide_nodes){\n                    this.normal_buttons.push(\n                            new Renderer.NodeHideButton(this.renderer, null),\n                            new Renderer.NodeShowButton(this.renderer, null)\n                            );\n                }\n                this.pending_delete_buttons = [\n                                               new Renderer.NodeRevertButton(this.renderer, null)\n                                               ];\n                this.all_buttons = this.normal_buttons.concat(this.pending_delete_buttons);\n\n                for (var i = 0; i < this.all_buttons.length; i++) {\n                    this.all_buttons[i].source_representation = this;\n                }\n                this.active_buttons = [];\n            } else {\n                this.active_buttons = this.all_buttons = [];\n            }\n            this.last_circle_radius = 1;\n\n            if (this.renderer.minimap) {\n                this.renderer.minimap.node_layer.activate();\n                this.minimap_circle = new paper.Path.Circle([0, 0], 1);\n                this.minimap_circle.__representation = this.renderer.minimap.miniframe.__representation;\n                this.renderer.minimap.node_group.addChild(this.minimap_circle);\n            }\n        },\n        _getStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.node_stroke_width + (thickness-1) * (this.options.node_stroke_max_width - this.options.node_stroke_width) / (this.options.node_stroke_witdh_scale-1);\n        },\n        _getSelectedStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.selected_node_stroke_width + (thickness-1) * (this.options.selected_node_stroke_max_width - this.options.selected_node_stroke_width) / (this.options.node_stroke_witdh_scale-1);\n        },\n        buildShape: function(){\n            if( 'shape' in this.model.changed ) {\n                delete this.img;\n            }\n            if(this.circle){\n                this.circle.remove();\n                delete this.circle;\n            }\n            // \"circle\" \"rectangle\" \"ellipse\" \"polygon\" \"star\" \"diamond\"\n            this.shapeBuilder = new ShapeBuilder(this.model.get(\"shape\"));\n            this.circle = this.shapeBuilder.getShape();\n            this.circle.__representation = this;\n            this.circle.sendToBack();\n            this.last_circle_radius = 1;\n        },\n        redraw: function(options) {\n            if( 'shape' in this.model.changed && 'change' in options && options.change ) {\n            //if( 'shape' in this.model.changed ) {\n                this.buildShape();\n            }\n            var _model_coords = new paper.Point(this.model.get(\"position\")),\n                _baseRadius = this.options.node_size_base * Math.exp((this.model.get(\"size\") || 0) * Utils._NODE_SIZE_STEP);\n            if (!this.is_dragging || !this.paper_coords) {\n                this.paper_coords = this.renderer.toPaperCoords(_model_coords);\n            }\n            this.circle_radius = _baseRadius * this.renderer.scale;\n            if (this.last_circle_radius !== this.circle_radius) {\n                this.all_buttons.forEach(function(b) {\n                    b.setSectorSize();\n                });\n                this.circle.scale(this.circle_radius / this.last_circle_radius);\n                if (this.node_image) {\n                    this.node_image.scale(this.circle_radius / this.last_circle_radius);\n                }\n            }\n            this.circle.position = this.paper_coords;\n            if (this.node_image) {\n                this.node_image.position = this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius));\n            }\n            this.last_circle_radius = this.circle_radius;\n\n            var old_act_btn = this.active_buttons;\n\n            var opacity = 1;\n            if (this.model.get(\"delete_scheduled\")) {\n                opacity = 0.5;\n                this.active_buttons = this.pending_delete_buttons;\n                this.circle.dashArray = [2,2];\n            } else {\n                opacity = 1;\n                this.active_buttons = this.normal_buttons;\n                this.circle.dashArray = null;\n            }\n            if (this.selected && this.renderer.isEditable() && !this.ghost) {\n                if (old_act_btn !== this.active_buttons) {\n                    old_act_btn.forEach(function(b) {\n                        b.hide();\n                    });\n                }\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n\n            if (this.node_image) {\n                this.node_image.opacity = this.highlighted ? opacity * 0.5 : (opacity - 0.01);\n            }\n\n            this.circle.fillColor = this.highlighted ? this.options.highlighted_node_fill_color : this.options.node_fill_color;\n\n            this.circle.opacity = this.options.show_node_circles ? opacity : 0.01;\n\n            var _text = this.model.get(\"title\") || this.renkan.translate(this.options.label_untitled_nodes) || \"\";\n            _text = Utils.shortenText(_text, this.options.node_label_max_length);\n\n            if (typeof this.highlighted === \"object\") {\n                this.title.html(this.highlighted.replace(_(_text).escape(),'<span class=\"Rk-Highlighted\">$1</span>'));\n            } else {\n                this.title.text(_text);\n            }\n\n            var _strokeWidth = this._getStrokeWidth();\n            this.title.css({\n                left: this.paper_coords.x,\n                top: this.paper_coords.y + this.circle_radius * this.h_ratio + this.options.node_label_distance + 0.5*_strokeWidth,\n                opacity: opacity\n            });\n            var _color = (this.model.has(\"style\") && this.model.get(\"style\").color) || (this.model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                _dash = (this.model.has(\"style\") && this.model.get(\"style\").dash) ? this.options.default_dash_array : null;\n            this.circle.strokeWidth = _strokeWidth;\n            this.circle.strokeColor = _color;\n            this.circle.dashArray = _dash;\n            var _pc = this.paper_coords;\n            this.all_buttons.forEach(function(b) {\n                b.moveTo(_pc);\n            });\n            var lastImage = this.img;\n            this.img = this.model.get(\"image\");\n            if (this.img && this.img !== lastImage) {\n                this.showImage();\n                if(this.circle) {\n                    this.circle.sendToBack();\n                }\n            }\n            if (this.node_image && !this.img) {\n                this.node_image.remove();\n                delete this.node_image;\n            }\n\n            if (this.renderer.minimap) {\n                this.minimap_circle.fillColor = _color;\n                var minipos = this.renderer.toMinimapCoords(_model_coords),\n                miniradius = this.renderer.minimap.scale * _baseRadius,\n                minisize = new paper.Size([miniradius, miniradius]);\n                this.minimap_circle.fitBounds(minipos.subtract(minisize), minisize.multiply(2));\n            }\n\n            if (typeof options === 'undefined' || !('dontRedrawEdges' in options) || !options.dontRedrawEdges) {\n                var _this = this;\n                _.each(\n                        this.project.get(\"edges\").filter(\n                                function (ed) {\n                                    return ((ed.get(\"to\") === _this.model) || (ed.get(\"from\") === _this.model));\n                                }\n                        ),\n                        function(edge, index, list) {\n                            var repr = _this.renderer.getRepresentationByModel(edge);\n                            if (repr && typeof repr.from_representation !== \"undefined\" && typeof repr.from_representation.paper_coords !== \"undefined\" && typeof repr.to_representation !== \"undefined\" && typeof repr.to_representation.paper_coords !== \"undefined\") {\n                                repr.redraw();\n                            }\n                        }\n                );\n            }\n            if (this.ghost){\n                this.show(true);\n            } else {\n                if (this.hidden) { this.hide(); }\n            }\n        },\n        showImage: function() {\n            var _image = null;\n            if (typeof this.renderer.image_cache[this.img] === \"undefined\") {\n                _image = new Image();\n                this.renderer.image_cache[this.img] = _image;\n                _image.src = this.img;\n            } else {\n                _image = this.renderer.image_cache[this.img];\n            }\n            if (_image.width) {\n                if (this.node_image) {\n                    this.node_image.remove();\n                }\n                this.renderer.node_layer.activate();\n                var width = _image.width,\n                    height = _image.height,\n                    clipPath = this.model.get(\"clip_path\"),\n                    hasClipPath = (typeof clipPath !== \"undefined\" && clipPath),\n                    _clip = null,\n                    baseRadius = null,\n                    centerPoint = null;\n\n                if (hasClipPath) {\n                    _clip = new paper.Path();\n                    var instructions = clipPath.match(/[a-z][^a-z]+/gi) || [],\n                    lastCoords = [0,0],\n                    minX = Infinity,\n                    minY = Infinity,\n                    maxX = -Infinity,\n                    maxY = -Infinity;\n\n                    var transformCoords = function(tabc, relative) {\n                        var newCoords = tabc.slice(1).map(function(v, k) {\n                            var res = parseFloat(v),\n                            isY = k % 2;\n                            if (isY) {\n                                res = ( res - 0.5 ) * height;\n                            } else {\n                                res = ( res - 0.5 ) * width;\n                            }\n                            if (relative) {\n                                res += lastCoords[isY];\n                            }\n                            if (isY) {\n                                minY = Math.min(minY, res);\n                                maxY = Math.max(maxY, res);\n                            } else {\n                                minX = Math.min(minX, res);\n                                maxX = Math.max(maxX, res);\n                            }\n                            return res;\n                        });\n                        lastCoords = newCoords.slice(-2);\n                        return newCoords;\n                    };\n\n                    instructions.forEach(function(instr) {\n                        var coords = instr.match(/([a-z]|[0-9.-]+)/ig) || [\"\"];\n                        switch(coords[0]) {\n                        case \"M\":\n                            _clip.moveTo(transformCoords(coords));\n                            break;\n                        case \"m\":\n                            _clip.moveTo(transformCoords(coords, true));\n                            break;\n                        case \"L\":\n                            _clip.lineTo(transformCoords(coords));\n                            break;\n                        case \"l\":\n                            _clip.lineTo(transformCoords(coords, true));\n                            break;\n                        case \"C\":\n                            _clip.cubicCurveTo(transformCoords(coords));\n                            break;\n                        case \"c\":\n                            _clip.cubicCurveTo(transformCoords(coords, true));\n                            break;\n                        case \"Q\":\n                            _clip.quadraticCurveTo(transformCoords(coords));\n                            break;\n                        case \"q\":\n                            _clip.quadraticCurveTo(transformCoords(coords, true));\n                            break;\n                        }\n                    });\n\n                    baseRadius = Math[this.options.node_images_fill_mode ? \"min\" : \"max\"](maxX - minX, maxY - minY) / 2;\n                    centerPoint = new paper.Point((maxX + minX) / 2, (maxY + minY) / 2);\n                    if (!this.options.show_node_circles) {\n                        this.h_ratio = (maxY - minY) / (2 * baseRadius);\n                    }\n                } else {\n                    baseRadius = Math[this.options.node_images_fill_mode ? \"min\" : \"max\"](width, height) / 2;\n                    centerPoint = new paper.Point(0,0);\n                    if (!this.options.show_node_circles) {\n                        this.h_ratio = height / (2 * baseRadius);\n                    }\n                }\n                var _raster = new paper.Raster(_image);\n                _raster.locked = true; // Disable mouse events on icon\n                if (hasClipPath) {\n                    _raster = new paper.Group(_clip, _raster);\n                    _raster.opacity = 0.99;\n                    /* This is a workaround to allow clipping at group level\n                     * If opacity was set to 1, paper.js would merge all clipping groups in one (known bug).\n                     */\n                    _raster.clipped = true;\n                    _clip.__representation = this;\n                }\n                if (this.options.clip_node_images) {\n                    var _circleClip = this.shapeBuilder.getImageShape(centerPoint, baseRadius);\n                    _raster = new paper.Group(_circleClip, _raster);\n                    _raster.opacity = 0.99;\n                    _raster.clipped = true;\n                    _circleClip.__representation = this;\n                }\n                this.image_delta = centerPoint.divide(baseRadius);\n                this.node_image = _raster;\n                this.node_image.__representation = _this;\n                this.node_image.scale(this.circle_radius / baseRadius);\n                this.node_image.position = this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius));\n                this.node_image.insertAbove(this.circle);\n            } else {\n                var _this = this;\n                $(_image).on(\"load\", function() {\n                    _this.showImage();\n                });\n            }\n        },\n        paperShift: function(_delta) {\n            if (this.options.editor_mode) {\n                if (!this.renkan.read_only) {\n                    this.is_dragging = true;\n                    this.paper_coords = this.paper_coords.add(_delta);\n                    this.redraw();\n                }\n            } else {\n                this.renderer.paperShift(_delta);\n            }\n        },\n        openEditor: function() {\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            var _editor = this.renderer.addRepresentation(\"NodeEditor\",null);\n            _editor.source_representation = this;\n            _editor.draw();\n        },\n        select: function() {\n            this.selected = true;\n            this.circle.strokeWidth = this._getSelectedStrokeWidth();\n            if (this.renderer.isEditable() && !this.hidden) {\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n            var _uri = this.model.get(\"uri\");\n            if (_uri) {\n                $('.Rk-Bin-Item').each(function() {\n                    var _el = $(this);\n                    if (_el.attr(\"data-uri\") === _uri) {\n                        _el.addClass(\"selected\");\n                    }\n                });\n            }\n            if (!this.options.editor_mode) {\n                this.openEditor();\n            }\n\n            if (this.renderer.minimap) {\n                this.minimap_circle.strokeWidth = this.options.minimap_highlight_weight;\n                this.minimap_circle.strokeColor = this.options.minimap_highlight_color;\n            }\n            //if the node is hidden and the mouse hover it, it appears as a ghost\n            if (this.hidden) {\n                this.show(true);\n            }\n            else {\n                this.showNeighbors(true);\n            }\n            this._super(\"select\");\n        },\n        hideButtons: function() {\n            this.all_buttons.forEach(function(b) {\n                b.hide();\n            });\n            delete(this.buttonTimeout);\n        },\n        unselect: function(_newTarget) {\n            if (!_newTarget || _newTarget.source_representation !== this) {\n                this.selected = false;\n                var _this = this;\n                this.buttons_timeout = setTimeout(function() { _this.hideButtons(); }, 200);\n                this.circle.strokeWidth = this._getStrokeWidth();\n                $('.Rk-Bin-Item').removeClass(\"selected\");\n                if (this.renderer.minimap) {\n                    this.minimap_circle.strokeColor = undefined;\n                }\n                //when the mouse don't hover the node anymore, we hide it\n                if (this.hidden) {\n                    this.hide();\n                }\n                else {\n                    this.hideNeighbors();\n                }\n                this._super(\"unselect\");\n            }\n        },\n        hide: function(){\n            var _this = this;\n            this.ghost = false;\n            this.hidden = true;\n            if (typeof this.node_image !== 'undefined'){\n                this.node_image.opacity = 0;\n            }\n            this.hideButtons();\n            this.circle.opacity = 0;\n            this.title.css('opacity', 0);\n            this.minimap_circle.opacity = 0;\n\n\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return ((ed.get(\"to\") === _this.model) || (ed.get(\"from\") === _this.model));\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge);\n                        if (repr && typeof repr.from_representation !== \"undefined\" && typeof repr.from_representation.paper_coords !== \"undefined\" && typeof repr.to_representation !== \"undefined\" && typeof repr.to_representation.paper_coords !== \"undefined\") {\n                            repr.hide();\n                        }\n                    }\n            );\n            this.hideNeighbors();\n        },\n        show: function(ghost){\n            var _this = this;\n            this.ghost = ghost;\n            if (this.ghost){\n                if (typeof this.node_image !== 'undefined'){\n                    this.node_image.opacity = this.options.ghost_opacity;\n                }\n                this.circle.opacity = this.options.ghost_opacity;\n                this.title.css('opacity', this.options.ghost_opacity);\n                this.minimap_circle.opacity = this.options.ghost_opacity;\n            } else {\n                this.hidden = false;\n                this.redraw();\n            }\n\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return ((ed.get(\"to\") === _this.model) || (ed.get(\"from\") === _this.model));\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge);\n                        if (repr && typeof repr.from_representation !== \"undefined\" && typeof repr.from_representation.paper_coords !== \"undefined\" && typeof repr.to_representation !== \"undefined\" && typeof repr.to_representation.paper_coords !== \"undefined\") {\n                            repr.show(_this.ghost);\n                        }\n                    }\n            );\n        },\n        hideNeighbors: function(){\n            var _this = this;\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return (ed.get(\"from\") === _this.model);\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge.get(\"to\"));\n                        if (repr && repr.ghost) {\n                            repr.hide();\n                        }\n                    }\n            );\n        },\n        showNeighbors: function(ghost){\n            var _this = this;\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return (ed.get(\"from\") === _this.model);\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge.get(\"to\"));\n                        if (repr && repr.hidden) {\n                            repr.show(ghost);\n                            if (!ghost){\n                                var indexNode = _this.renderer.hiddenNodes.indexOf(repr.model.id);\n                                if (indexNode !== -1){\n                                    _this.renderer.hiddenNodes.splice(indexNode, 1);\n                                }\n                            }\n                        }\n                    }\n            );\n        },\n        highlight: function(textToReplace) {\n            var hlvalue = textToReplace || true;\n            if (this.highlighted === hlvalue) {\n                return;\n            }\n            this.highlighted = hlvalue;\n            this.redraw();\n            this.renderer.throttledPaperDraw();\n        },\n        unhighlight: function() {\n            if (!this.highlighted) {\n                return;\n            }\n            this.highlighted = false;\n            this.redraw();\n            this.renderer.throttledPaperDraw();\n        },\n        saveCoords: function() {\n            var _coords = this.renderer.toModelCoords(this.paper_coords),\n            _data = {\n                position: {\n                    x: _coords.x,\n                    y: _coords.y\n                }\n            };\n            if (this.renderer.isEditable()) {\n                this.model.set(_data);\n            }\n        },\n        mousedown: function(_event, _isTouch) {\n            if (_isTouch) {\n                this.renderer.unselectAll();\n                this.select();\n            }\n        },\n        mouseup: function(_event, _isTouch) {\n            if (this.renderer.is_dragging && this.renderer.isEditable()) {\n                this.saveCoords();\n            } else {\n                if (this.hidden) {\n                    var index = this.renderer.hiddenNodes.indexOf(this.model.id);\n                    if (index !== -1){\n                        this.renderer.hiddenNodes.splice(index, 1);\n                    }\n                    this.show(false);\n                    this.select();\n                } else {\n                    if (!_isTouch && !this.model.get(\"delete_scheduled\")) {\n                        this.openEditor();\n                    }\n                    this.model.trigger(\"clicked\");\n                }\n            }\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.is_dragging = false;\n        },\n        destroy: function(_event) {\n            this._super(\"destroy\");\n            this.all_buttons.forEach(function(b) {\n                b.destroy();\n            });\n            this.circle.remove();\n            this.title.remove();\n            if (this.renderer.minimap) {\n                this.minimap_circle.remove();\n            }\n            if (this.node_image) {\n                this.node_image.remove();\n            }\n        }\n    }).value();\n\n    return NodeRepr;\n\n});\n\n\ndefine('renderer/edge',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* Edge Class Begin */\n\n    //var Edge = Renderer.Edge = Utils.inherit(Renderer._BaseRepresentation);\n    var Edge = Utils.inherit(BaseRepresentation);\n\n    _(Edge.prototype).extend({\n        _init: function() {\n            this.renderer.edge_layer.activate();\n            this.type = \"Edge\";\n            this.hidden = false;\n            this.ghost = false;\n            this.from_representation = this.renderer.getRepresentationByModel(this.model.get(\"from\"));\n            this.to_representation = this.renderer.getRepresentationByModel(this.model.get(\"to\"));\n            this.bundle = this.renderer.addToBundles(this);\n            this.line = new paper.Path();\n            this.line.add([0,0],[0,0],[0,0]);\n            this.line.__representation = this;\n            this.line.strokeWidth = this.options.edge_stroke_width;\n            this.arrow_scale = 1;\n            this.arrow = new paper.Path();\n            this.arrow.add(\n                    [ 0, 0 ],\n                    [ this.options.edge_arrow_length, this.options.edge_arrow_width / 2 ],\n                    [ 0, this.options.edge_arrow_width ]\n            );\n            this.arrow.pivot = new paper.Point([ this.options.edge_arrow_length / 2, this.options.edge_arrow_width / 2 ]);\n            this.arrow.__representation = this;\n            this.text = $('<div class=\"Rk-Label Rk-Edge-Label\">').appendTo(this.renderer.labels_$);\n            this.arrow_angle = 0;\n            if (this.options.editor_mode) {\n                var Renderer = requtils.getRenderer();\n                this.normal_buttons = [\n                                       new Renderer.EdgeEditButton(this.renderer, null),\n                                       new Renderer.EdgeRemoveButton(this.renderer, null)\n                                       ];\n                this.pending_delete_buttons = [\n                                               new Renderer.EdgeRevertButton(this.renderer, null)\n                                               ];\n                this.all_buttons = this.normal_buttons.concat(this.pending_delete_buttons);\n                for (var i = 0; i < this.all_buttons.length; i++) {\n                    this.all_buttons[i].source_representation = this;\n                }\n                this.active_buttons = [];\n            } else {\n                this.active_buttons = this.all_buttons = [];\n            }\n\n            if (this.renderer.minimap) {\n                this.renderer.minimap.edge_layer.activate();\n                this.minimap_line = new paper.Path();\n                this.minimap_line.add([0,0],[0,0]);\n                this.minimap_line.__representation = this.renderer.minimap.miniframe.__representation;\n                this.minimap_line.strokeWidth = 1;\n            }\n        },\n        _getStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.edge_stroke_width + (thickness-1) * (this.options.edge_stroke_max_width - this.options.edge_stroke_width) / (this.options.edge_stroke_witdh_scale-1);\n        },\n        _getSelectedStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.selected_edge_stroke_width + (thickness-1) * (this.options.selected_edge_stroke_max_width - this.options.selected_edge_stroke_width) / (this.options.edge_stroke_witdh_scale-1);\n        },\n        _getArrowScale: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return 1 + (thickness-1) * ((this.options.edge_arrow_max_width / this.options.edge_arrow_width) - 1) / (this.options.edge_stroke_witdh_scale-1);\n        },\n        redraw: function() {\n            var from = this.model.get(\"from\"),\n            to = this.model.get(\"to\");\n            if (!from || !to || (this.hidden && !this.ghost)) {\n                return;\n            }\n            this.from_representation = this.renderer.getRepresentationByModel(from);\n            this.to_representation = this.renderer.getRepresentationByModel(to);\n            if (typeof this.from_representation === \"undefined\" || typeof this.to_representation === \"undefined\" ||\n                    (this.from_representation.hidden && !this.from_representation.ghost) ||\n                    (this.to_representation.hidden && !this.to_representation.ghost)) {\n                this.hide();\n                return;\n            }\n            var _strokeWidth = this._getStrokeWidth(),\n                _arrow_scale = this._getArrowScale(),\n                _p0a = this.from_representation.paper_coords,\n                _p1a = this.to_representation.paper_coords,\n                _v = _p1a.subtract(_p0a),\n                _r = _v.length,\n                _u = _v.divide(_r),\n                _ortho = new paper.Point([- _u.y, _u.x]),\n                _group_pos = this.bundle.getPosition(this),\n                _delta = _ortho.multiply( this.options.edge_gap_in_bundles * _group_pos ),\n                _p0b = _p0a.add(_delta), /* Adding a 4 px difference */\n                _p1b = _p1a.add(_delta), /* to differentiate bundled links */\n                _a = _v.angle,\n                _textdelta = _ortho.multiply(this.options.edge_label_distance + 0.5 * _arrow_scale * this.options.edge_arrow_width),\n                _handle = _v.divide(3),\n                _color = (this.model.has(\"style\") && this.model.get(\"style\").color) || (this.model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                _dash = (this.model.has(\"style\") && this.model.get(\"style\").dash) ? this.options.default_dash_array : null,\n                _opacity;\n\n            if (this.model.get(\"delete_scheduled\") || this.from_representation.model.get(\"delete_scheduled\") || this.to_representation.model.get(\"delete_scheduled\")) {\n                _opacity = 0.5;\n                this.line.dashArray = [2, 2];\n            } else {\n                _opacity = this.ghost ? this.options.ghost_opacity : 1;\n                this.line.dashArray = null;\n            }\n\n            var old_act_btn = this.active_buttons;\n\n            this.arrow.visible =\n                (this.model.has(\"style\") && this.model.get(\"style\").arrow) ||\n                !this.model.has(\"style\") ||\n                typeof this.model.get(\"style\").arrow === 'undefined';\n\n            this.active_buttons = this.model.get(\"delete_scheduled\") ? this.pending_delete_buttons : this.normal_buttons;\n\n            if (this.selected && this.renderer.isEditable() && old_act_btn !== this.active_buttons) {\n                old_act_btn.forEach(function(b) {\n                    b.hide();\n                });\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n\n            this.paper_coords = _p0b.add(_p1b).divide(2);\n            this.line.strokeWidth = _strokeWidth;\n            this.line.strokeColor = _color;\n            this.line.dashArray = _dash;\n            this.line.opacity = _opacity;\n            this.line.segments[0].point = _p0a;\n            this.line.segments[1].point = this.paper_coords;\n            this.line.segments[1].handleIn = _handle.multiply(-1);\n            this.line.segments[1].handleOut = _handle;\n            this.line.segments[2].point = _p1a;\n            this.arrow.scale(_arrow_scale / this.arrow_scale);\n            this.arrow_scale = _arrow_scale;\n            this.arrow.fillColor = _color;\n            this.arrow.opacity = _opacity;\n            this.arrow.rotate(_a - this.arrow_angle, this.arrow.bounds.center);\n            this.arrow.position = this.paper_coords;\n\n            this.arrow_angle = _a;\n            if (_a > 90) {\n                _a -= 180;\n                _textdelta = _textdelta.multiply(-1);\n            }\n            if (_a < -90) {\n                _a += 180;\n                _textdelta = _textdelta.multiply(-1);\n            }\n            var _text = this.model.get(\"title\") || this.renkan.translate(this.options.label_untitled_edges) || \"\";\n            _text = Utils.shortenText(_text, this.options.node_label_max_length);\n            this.text.text(_text);\n            var _textpos = this.paper_coords.add(_textdelta);\n            this.text.css({\n                left: _textpos.x,\n                top: _textpos.y,\n                transform: \"rotate(\" + _a + \"deg)\",\n                \"-moz-transform\": \"rotate(\" + _a + \"deg)\",\n                \"-webkit-transform\": \"rotate(\" + _a + \"deg)\",\n                opacity: _opacity\n            });\n            this.text_angle = _a;\n\n            var _pc = this.paper_coords;\n            this.all_buttons.forEach(function(b) {\n                b.moveTo(_pc);\n            });\n\n            if (this.renderer.minimap) {\n                this.minimap_line.strokeColor = _color;\n                this.minimap_line.segments[0].point = this.renderer.toMinimapCoords(new paper.Point(this.from_representation.model.get(\"position\")));\n                this.minimap_line.segments[1].point = this.renderer.toMinimapCoords(new paper.Point(this.to_representation.model.get(\"position\")));\n            }\n        },\n        hide: function(){\n            this.hidden = true;\n            this.ghost = false;\n\n            this.text.hide();\n            this.line.visible = false;\n            this.arrow.visible = false;\n            this.minimap_line.visible = false;\n        },\n        show: function(ghost){\n            this.ghost = ghost;\n            if (this.ghost) {\n                this.text.css('opacity', 0.3);\n                this.line.opacity = 0.3;\n                this.arrow.opacity = 0.3;\n                this.minimap_line.opacity = 0.3;\n            } else {\n                this.hidden = false;\n\n                this.text.css('opacity', 1);\n                this.line.opacity = 1;\n                this.arrow.opacity = 1;\n                this.minimap_line.opacity = 1;\n            }\n            this.text.show();\n            this.line.visible = true;\n            this.arrow.visible = true;\n            this.minimap_line.visible = true;\n            this.redraw();\n        },\n        openEditor: function() {\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            var _editor = this.renderer.addRepresentation(\"EdgeEditor\",null);\n            _editor.source_representation = this;\n            _editor.draw();\n        },\n        select: function() {\n            this.selected = true;\n            this.line.strokeWidth = this._getSelectedStrokeWidth();\n            if (this.renderer.isEditable()) {\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n            if (!this.options.editor_mode) {\n                this.openEditor();\n            }\n            this._super(\"select\");\n        },\n        unselect: function(_newTarget) {\n            if (!_newTarget || _newTarget.source_representation !== this) {\n                this.selected = false;\n                if (this.options.editor_mode) {\n                    this.all_buttons.forEach(function(b) {\n                        b.hide();\n                    });\n                }\n                this.line.strokeWidth = this._getStrokeWidth();\n                this._super(\"unselect\");\n            }\n        },\n        mousedown: function(_event, _isTouch) {\n            if (_isTouch) {\n                this.renderer.unselectAll();\n                this.select();\n            }\n        },\n        mouseup: function(_event, _isTouch) {\n            if (!this.renkan.read_only && this.renderer.is_dragging) {\n                this.from_representation.saveCoords();\n                this.to_representation.saveCoords();\n                this.from_representation.is_dragging = false;\n                this.to_representation.is_dragging = false;\n            } else {\n                if (!_isTouch) {\n                    this.openEditor();\n                }\n                this.model.trigger(\"clicked\");\n            }\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n        },\n        paperShift: function(_delta) {\n            if (this.options.editor_mode) {\n                if (!this.options.read_only) {\n                    this.from_representation.paperShift(_delta);\n                    this.to_representation.paperShift(_delta);\n                }\n            } else {\n                this.renderer.paperShift(_delta);\n            }\n        },\n        destroy: function() {\n            this._super(\"destroy\");\n            this.line.remove();\n            this.arrow.remove();\n            this.text.remove();\n            if (this.renderer.minimap) {\n                this.minimap_line.remove();\n            }\n            this.all_buttons.forEach(function(b) {\n                b.destroy();\n            });\n            var _this = this;\n            this.bundle.edges = _.reject(this.bundle.edges, function(_edge) {\n                return _this === _edge;\n            });\n        }\n    }).value();\n\n    return Edge;\n\n});\n\n\n\ndefine('renderer/tempedge',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* TempEdge Class Begin */\n\n    //var TempEdge = Renderer.TempEdge = Utils.inherit(Renderer._BaseRepresentation);\n    var TempEdge = Utils.inherit(BaseRepresentation);\n\n    _(TempEdge.prototype).extend({\n        _init: function() {\n            this.renderer.edge_layer.activate();\n            this.type = \"Temp-edge\";\n\n            var _color = (this.project.get(\"users\").get(this.renkan.current_user) || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\");\n            this.line = new paper.Path();\n            this.line.strokeColor = _color;\n            this.line.dashArray = [4, 2];\n            this.line.strokeWidth = this.options.selected_edge_stroke_width;\n            this.line.add([0,0],[0,0]);\n            this.line.__representation = this;\n            this.arrow = new paper.Path();\n            this.arrow.fillColor = _color;\n            this.arrow.add(\n                    [ 0, 0 ],\n                    [ this.options.edge_arrow_length, this.options.edge_arrow_width / 2 ],\n                    [ 0, this.options.edge_arrow_width ]\n            );\n            this.arrow.__representation = this;\n            this.arrow_angle = 0;\n        },\n        redraw: function() {\n            var _p0 = this.from_representation.paper_coords,\n            _p1 = this.end_pos,\n            _a = _p1.subtract(_p0).angle,\n            _c = _p0.add(_p1).divide(2);\n            this.line.segments[0].point = _p0;\n            this.line.segments[1].point = _p1;\n            this.arrow.rotate(_a - this.arrow_angle);\n            this.arrow.position = _c;\n            this.arrow_angle = _a;\n        },\n        paperShift: function(_delta) {\n            if (!this.renderer.isEditable()) {\n                this.renderer.removeRepresentation(_this);\n                paper.view.draw();\n                return;\n            }\n            this.end_pos = this.end_pos.add(_delta);\n            var _hitResult = paper.project.hitTest(this.end_pos);\n            this.renderer.findTarget(_hitResult);\n            this.redraw();\n        },\n        mouseup: function(_event, _isTouch) {\n            var _hitResult = paper.project.hitTest(_event.point),\n            _model = this.from_representation.model,\n            _endDrag = true;\n            if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                var _target = _hitResult.item.__representation;\n                if (_target.type.substr(0,4) === \"Node\") {\n                    var _destmodel = _target.model || _target.source_representation.model;\n                    if (_model !== _destmodel) {\n                        var _data = {\n                                id: Utils.getUID('edge'),\n                                created_by: this.renkan.current_user,\n                                from: _model,\n                                to: _destmodel\n                        };\n                        if (this.renderer.isEditable()) {\n                            this.project.addEdge(_data);\n                        }\n                    }\n                }\n\n                if (_model === _target.model || (_target.source_representation && _target.source_representation.model === _model)) {\n                    _endDrag = false;\n                    this.renderer.is_dragging = true;\n                }\n            }\n            if (_endDrag) {\n                this.renderer.click_target = null;\n                this.renderer.is_dragging = false;\n                this.renderer.removeRepresentation(this);\n                paper.view.draw();\n            }\n        },\n        destroy: function() {\n            this.arrow.remove();\n            this.line.remove();\n        }\n    }).value();\n\n    /* TempEdge Class End */\n\n    return TempEdge;\n\n});\n\n\ndefine('renderer/baseeditor',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* _BaseEditor Begin */\n    //var _BaseEditor = Renderer._BaseEditor = Utils.inherit(Renderer._BaseRepresentation);\n    var _BaseEditor = Utils.inherit(BaseRepresentation);\n\n    _(_BaseEditor.prototype).extend({\n        _init: function() {\n            this.renderer.buttons_layer.activate();\n            this.type = \"editor\";\n            this.editor_block = new paper.Path();\n            var _pts = _.map(_.range(8), function() {return [0,0];});\n            this.editor_block.add.apply(this.editor_block, _pts);\n            this.editor_block.strokeWidth = this.options.tooltip_border_width;\n            this.editor_block.strokeColor = this.options.tooltip_border_color;\n            this.editor_block.opacity = 0.8;\n            this.editor_$ = $('<div>')\n            .appendTo(this.renderer.editor_$)\n            .css({\n                position: \"absolute\",\n                opacity: 0.8\n            })\n            .hide();\n        },\n        destroy: function() {\n            this.editor_block.remove();\n            this.editor_$.remove();\n        }\n    }).value();\n\n    /* _BaseEditor End */\n\n    return _BaseEditor;\n\n});\n\n\ndefine('renderer/nodeeditor',['jquery', 'underscore', 'requtils', 'renderer/baseeditor', 'renderer/shapebuilder', 'ckeditor-jquery'], function ($, _, requtils, BaseEditor, ShapeBuilder) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeEditor Begin */\n    //var NodeEditor = Renderer.NodeEditor = Utils.inherit(Renderer._BaseEditor);\n    var NodeEditor = Utils.inherit(BaseEditor);\n\n    _(NodeEditor.prototype).extend({\n        _init: function() {\n            BaseEditor.prototype._init.apply(this);\n            this.template = this.options.templates['templates/nodeeditor.html'];\n            //this.templates['default']= this.options.templates['templates/nodeeditor.html'];\n            //fusionner avec this.options.node_editor_templates\n            this.readOnlyTemplate = this.options.node_editor_templates;\n        },\n        draw: function() {\n            var _model = this.source_representation.model,\n            _created_by = _model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan),\n            _template = (this.renderer.isEditable() ? this.template : this.readOnlyTemplate[_model.get(\"type\")] || this.readOnlyTemplate[\"default\"]),\n            _image_placeholder = this.options.static_url + \"img/image-placeholder.png\",\n            _size = (_model.get(\"size\") || 0);\n            this.editor_$\n            .html(_template({\n                node: {\n                    _id: _model.get(\"_id\"),\n                    has_creator: !!_model.get(\"created_by\"),\n                    title: _model.get(\"title\"),\n                    uri: _model.get(\"uri\"),\n                    type: _model.get(\"type\") || \"default\",\n                    short_uri:  Utils.shortenText((_model.get(\"uri\") || \"\").replace(/^(https?:\\/\\/)?(www\\.)?/,'').replace(/\\/$/,''),40),\n                    description: _model.get(\"description\"),\n                    image: _model.get(\"image\") || \"\",\n                    image_placeholder: _image_placeholder,\n                    color: (_model.has(\"style\") && _model.get(\"style\").color) || _created_by.get(\"color\"),\n                    thickness: (_model.has(\"style\") && _model.get(\"style\").thickness) || 1,\n                    dash: _model.has(\"style\") && _model.get(\"style\").dash ? \"checked\" : \"\",\n                    clip_path: _model.get(\"clip_path\") || false,\n                    created_by_color: _created_by.get(\"color\"),\n                    created_by_title: _created_by.get(\"title\"),\n                    size: (_size > 0 ? \"+\" : \"\") + _size,\n                    shape: _model.get(\"shape\") || \"circle\"\n                },\n                renkan: this.renkan,\n                options: this.options,\n                shortenText: Utils.shortenText,\n                shapes : _(ShapeBuilder.builders).omit('svg').keys().value(),\n                types : _(this.options.node_editor_templates).keys().value(),\n            }));\n            this.redraw();\n            var _this = this,\n                editorInstance = _this.options.show_node_editor_description_richtext ?\n                    $(\".Rk-Edit-Description\").ckeditor(_this.options.richtext_editor_config) :\n                    false,\n                closeEditor = function() {\n                    _this.renderer.removeRepresentation(_this);\n                    paper.view.draw();\n                };\n\n            _this.cleanEditor = function() {\n                _this.editor_$.off(\"keyup\");\n                _this.editor_$.find(\"input, textarea, select\").off(\"change keyup paste\");\n                _this.editor_$.find(\".Rk-Edit-Image-File\").off('change');\n                _this.editor_$.find(\".Rk-Edit-ColorPicker-Wrapper\").off('hover');\n                _this.editor_$.find(\".Rk-Edit-Size-Btn\").off('click');\n                _this.editor_$.find(\".Rk-Edit-Image-Del\").off('click');\n                _this.editor_$.find(\".Rk-Edit-ColorPicker\").find(\"li\").off('hover click');\n                _this.editor_$.find(\".Rk-CloseX\").off('click');\n                _this.editor_$.find(\".Rk-Edit-Goto\").off('click');\n\n                if(_this.options.show_node_editor_description_richtext) {\n                    if(typeof editorInstance.editor !== 'undefined') {\n                        var _editor = editorInstance.editor;\n                        delete editorInstance.editor;\n                        _editor.focusManager.blur(true);\n                        _editor.destroy();\n                    }\n                }\n            };\n\n            this.editor_$.find(\".Rk-CloseX\").click(function (e) {\n                e.preventDefault();\n                closeEditor();\n            });\n\n            this.editor_$.find(\".Rk-Edit-Goto\").click(function() {\n                if (!_model.get(\"uri\")) {\n                    return false;\n                }\n            });\n\n            if (this.renderer.isEditable()) {\n\n                var onFieldChange = _.throttle(function() {\n                  _.defer(function() {\n                    if (_this.renderer.isEditable()) {\n                        var _data = {\n                            title: _this.editor_$.find(\".Rk-Edit-Title\").val()\n                        };\n                        if (_this.options.show_node_editor_uri) {\n                            _data.uri = _this.editor_$.find(\".Rk-Edit-URI\").val();\n                            _this.editor_$.find(\".Rk-Edit-Goto\").attr(\"href\",_data.uri || \"#\");\n                        }\n                        if (_this.options.show_node_editor_image) {\n                            _data.image = _this.editor_$.find(\".Rk-Edit-Image\").val();\n                            _this.editor_$.find(\".Rk-Edit-ImgPreview\").attr(\"src\", _data.image || _image_placeholder);\n                        }\n                        if (_this.options.show_node_editor_description) {\n                            if(_this.options.show_node_editor_description_richtext) {\n                                if(typeof editorInstance.editor !== 'undefined' &&\n                                    editorInstance.editor.checkDirty()) {\n                                    _data.description = editorInstance.editor.getData();\n                                    editorInstance.editor.resetDirty();\n                                }\n                            }\n                            else {\n                                _data.description = _this.editor_$.find(\".Rk-Edit-Description\").val();\n                            }\n                        }\n                        if (_this.options.show_node_editor_style) {\n                            var dash = _this.editor_$.find(\".Rk-Edit-Dash\").is(':checked');\n                            _data.style = _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {dash: dash});\n                        }\n                        if (_this.options.change_shapes) {\n                            if(_model.get(\"shape\")!==_this.editor_$.find(\".Rk-Edit-Shape\").val()){\n                                _data.shape = _this.editor_$.find(\".Rk-Edit-Shape\").val();\n                            }\n                        }\n                        if (_this.options.change_types) {\n                            if(_model.get(\"type\")!==_this.editor_$.find(\".Rk-Edit-Type\").val()){\n                                _data.type = _this.editor_$.find(\".Rk-Edit-Type\").val();\n                            }\n                        }\n                        _model.set(_data);\n                        _this.redraw();\n                    } else {\n                        closeEditor();\n                    }\n                  });\n                }, 1000);\n\n                this.editor_$.on(\"keyup\", function(_e) {\n                    if (_e.keyCode === 27) {\n                        closeEditor();\n                    }\n                });\n\n                this.editor_$.find(\"input, textarea, select\").on(\"change keyup paste\", onFieldChange);\n                if( _this.options.show_node_editor_description &&\n                    _this.options.show_node_editor_description_richtext &&\n                    typeof editorInstance.editor !== 'undefined')\n                {\n                    editorInstance.editor.on(\"change\", onFieldChange);\n                    editorInstance.editor.on(\"blur\", onFieldChange);\n                }\n\n                if(_this.options.allow_image_upload) {\n                    this.editor_$.find(\".Rk-Edit-Image-File\").change(function() {\n                        if (this.files.length) {\n                            var f = this.files[0],\n                            fr = new FileReader();\n                            if (f.type.substr(0,5) !== \"image\") {\n                                alert(_this.renkan.translate(\"This file is not an image\"));\n                                return;\n                            }\n                            if (f.size > (_this.options.uploaded_image_max_kb * 1024)) {\n                                alert(_this.renkan.translate(\"Image size must be under \") + _this.options.uploaded_image_max_kb + _this.renkan.translate(\"KB\"));\n                                return;\n                            }\n                            fr.onload = function(e) {\n                                _this.editor_$.find(\".Rk-Edit-Image\").val(e.target.result);\n                                onFieldChange();\n                            };\n                            fr.readAsDataURL(f);\n                        }\n                    });\n                }\n                this.editor_$.find(\".Rk-Edit-Title\")[0].focus();\n\n                var _picker = _this.editor_$.find(\".Rk-Edit-ColorPicker\");\n\n                this.editor_$.find(\".Rk-Edit-ColorPicker-Wrapper\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.show();\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.hide();\n                        }\n                );\n\n                _picker.find(\"li\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", $(this).attr(\"data-color\"));\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", (_model.has(\"style\") && _model.get(\"style\").color) || (_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(_this.renkan)).get(\"color\"));\n                        }\n                ).click(function(_e) {\n                    _e.preventDefault();\n                    if (_this.renderer.isEditable()) {\n                        _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {color: $(this).attr(\"data-color\")}));\n                        _picker.hide();\n                        paper.view.draw();\n                    } else {\n                        closeEditor();\n                    }\n                });\n\n                var shiftSize = function(n) {\n                    if (_this.renderer.isEditable()) {\n                        var _newsize = n+(_model.get(\"size\") || 0);\n                        _this.editor_$.find(\"#Rk-Edit-Size-Value\").text((_newsize > 0 ? \"+\" : \"\") + _newsize);\n                        _model.set(\"size\", _newsize);\n                        paper.view.draw();\n                    } else {\n                        closeEditor();\n                    }\n                };\n\n                this.editor_$.find(\"#Rk-Edit-Size-Down\").click(function() {\n                    shiftSize(-1);\n                    return false;\n                });\n                this.editor_$.find(\"#Rk-Edit-Size-Up\").click(function() {\n                    shiftSize(1);\n                    return false;\n                });\n\n                var shiftThickness = function(n) {\n                    if (_this.renderer.isEditable()) {\n                        var _oldThickness = ((_model.has('style') && _model.get('style').thickness) || 1),\n                            _newThickness = n + _oldThickness;\n                        if(_newThickness < 1 ) {\n                            _newThickness = 1;\n                        }\n                        else if (_newThickness > _this.options.node_stroke_witdh_scale) {\n                            _newThickness = _this.options.node_stroke_witdh_scale;\n                        }\n                        if (_newThickness !== _oldThickness) {\n                            _this.editor_$.find(\"#Rk-Edit-Thickness-Value\").text(_newThickness);\n                            _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {thickness: _newThickness}));\n                            paper.view.draw();\n                        }\n                    }\n                    else {\n                        closeEditor();\n                    }\n                };\n\n                this.editor_$.find(\"#Rk-Edit-Thickness-Down\").click(function() {\n                    shiftThickness(-1);\n                    return false;\n                });\n                this.editor_$.find(\"#Rk-Edit-Thickness-Up\").click(function() {\n                    shiftThickness(1);\n                    return false;\n                });\n\n                this.editor_$.find(\".Rk-Edit-Image-Del\").click(function() {\n                    _this.editor_$.find(\".Rk-Edit-Image\").val('');\n                    onFieldChange();\n                    return false;\n                });\n            } else {\n                if (typeof this.source_representation.highlighted === \"object\") {\n                    var titlehtml = this.source_representation.highlighted.replace(_(_model.get(\"title\")).escape(),'<span class=\"Rk-Highlighted\">$1</span>');\n                    this.editor_$.find(\".Rk-Display-Title\" + (_model.get(\"uri\") ? \" a\" : \"\")).html(titlehtml);\n                    if (this.options.show_node_tooltip_description) {\n                        this.editor_$.find(\".Rk-Display-Description\").html(this.source_representation.highlighted.replace(_(_model.get(\"description\")).escape(),'<span class=\"Rk-Highlighted\">$1</span>'));\n                    }\n                }\n            }\n            this.editor_$.find(\"img\").load(function() {\n                _this.redraw();\n            });\n        },\n        redraw: function() {\n            if (this.options.popup_editor){\n                var _coords = this.source_representation.paper_coords;\n                Utils.drawEditBox(this.options, _coords, this.editor_block, this.source_representation.circle_radius * 0.75, this.editor_$);\n            }\n            this.editor_$.show();\n            paper.view.draw();\n        },\n        destroy: function() {\n            if(typeof this.cleanEditor !== 'undefined') {\n                this.cleanEditor();\n            }\n            this.editor_block.remove();\n            this.editor_$.remove();\n        }\n    }).value();\n\n    /* NodeEditor End */\n\n    return NodeEditor;\n\n});\n\n\ndefine('renderer/edgeeditor',['jquery', 'underscore', 'requtils', 'renderer/baseeditor'], function ($, _, requtils, BaseEditor) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* EdgeEditor Begin */\n\n    //var EdgeEditor = Renderer.EdgeEditor = Utils.inherit(Renderer._BaseEditor);\n    var EdgeEditor = Utils.inherit(BaseEditor);\n\n    _(EdgeEditor.prototype).extend({\n        _init: function() {\n          BaseEditor.prototype._init.apply(this);\n          this.template = this.options.templates['templates/edgeeditor.html'];\n          this.readOnlyTemplate = this.options.templates['templates/edgeeditor_readonly.html'];\n        },\n        draw: function() {\n            var _model = this.source_representation.model,\n            _from_model = _model.get(\"from\"),\n            _to_model = _model.get(\"to\"),\n            _created_by = _model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan),\n            _template = (this.renderer.isEditable() ? this.template : this.readOnlyTemplate);\n            this.editor_$\n              .html(_template({\n                edge: {\n                    has_creator: !!_model.get(\"created_by\"),\n                    title: _model.get(\"title\"),\n                    uri: _model.get(\"uri\"),\n                    short_uri:  Utils.shortenText((_model.get(\"uri\") || \"\").replace(/^(https?:\\/\\/)?(www\\.)?/,'').replace(/\\/$/,''),40),\n                    description: _model.get(\"description\"),\n                    color: (_model.has(\"style\") && _model.get(\"style\").color) || _created_by.get(\"color\"),\n                    dash: _model.has(\"style\") && _model.get(\"style\").dash ? \"checked\" : \"\",\n                    arrow: (_model.has(\"style\") && _model.get(\"style\").arrow) || !_model.has(\"style\") || (typeof _model.get(\"style\").arrow === 'undefined') ? \"checked\" : \"\",\n                    thickness: (_model.has(\"style\") && _model.get(\"style\").thickness) || 1,\n                    from_title: _from_model.get(\"title\"),\n                    to_title: _to_model.get(\"title\"),\n                    from_color: (_from_model.has(\"style\") && _from_model.get(\"style\").color) || (_from_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                    to_color: (_to_model.has(\"style\") && _to_model.get(\"style\").color) || (_to_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                    created_by_color: _created_by.get(\"color\"),\n                    created_by_title: _created_by.get(\"title\")\n                },\n                renkan: this.renkan,\n                shortenText: Utils.shortenText,\n                options: this.options\n            }));\n            this.redraw();\n            var _this = this,\n            closeEditor = function() {\n                _this.renderer.removeRepresentation(_this);\n                _this.editor_$.find(\".Rk-Edit-Size-Btn\").off('click');\n                paper.view.draw();\n            };\n            this.editor_$.find(\".Rk-CloseX\").click(closeEditor);\n            this.editor_$.find(\".Rk-Edit-Goto\").click(function() {\n                if (!_model.get(\"uri\")) {\n                    return false;\n                }\n            });\n\n            if (this.renderer.isEditable()) {\n\n                var onFieldChange = _.throttle(function() {\n                    _.defer(function() {\n                        if (_this.renderer.isEditable()) {\n                            var _data = {\n                                title: _this.editor_$.find(\".Rk-Edit-Title\").val()\n                            };\n                            if (_this.options.show_edge_editor_uri) {\n                                _data.uri = _this.editor_$.find(\".Rk-Edit-URI\").val();\n                            }\n                            if (_this.options.show_node_editor_style) {\n                                var dash = _this.editor_$.find(\".Rk-Edit-Dash\").is(':checked'),\n                                    arrow = _this.editor_$.find(\".Rk-Edit-Arrow\").is(':checked');\n                                _data.style = _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {dash: dash, arrow: arrow});\n                            }\n                            _this.editor_$.find(\".Rk-Edit-Goto\").attr(\"href\",_data.uri || \"#\");\n                            _model.set(_data);\n                            paper.view.draw();\n                        } else {\n                            closeEditor();\n                        }\n                    });\n                },500);\n\n                this.editor_$.on(\"keyup\", function(_e) {\n                    if (_e.keyCode === 27) {\n                        closeEditor();\n                    }\n                });\n\n                this.editor_$.find(\"input\").on(\"keyup change paste\", onFieldChange);\n\n                this.editor_$.find(\".Rk-Edit-Vocabulary\").change(function() {\n                    var e = $(this),\n                    v = e.val();\n                    if (v) {\n                        _this.editor_$.find(\".Rk-Edit-Title\").val(e.find(\":selected\").text());\n                        _this.editor_$.find(\".Rk-Edit-URI\").val(v);\n                        onFieldChange();\n                    }\n                });\n                this.editor_$.find(\".Rk-Edit-Direction\").click(function() {\n                    if (_this.renderer.isEditable()) {\n                        _model.set({\n                            from: _model.get(\"to\"),\n                            to: _model.get(\"from\")\n                        });\n                        _this.draw();\n                    } else {\n                        closeEditor();\n                    }\n                });\n\n                var _picker = _this.editor_$.find(\".Rk-Edit-ColorPicker\");\n\n                this.editor_$.find(\".Rk-Edit-ColorPicker-Wrapper\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.show();\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.hide();\n                        }\n                );\n\n                _picker.find(\"li\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", $(this).attr(\"data-color\"));\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", (_model.has(\"style\") && _model.get(\"style\").color)|| (_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(_this.renkan)).get(\"color\"));\n                        }\n                ).click(function(_e) {\n                    _e.preventDefault();\n                    if (_this.renderer.isEditable()) {\n                        _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {color: $(this).attr(\"data-color\")}));\n                        _picker.hide();\n                        paper.view.draw();\n                    } else {\n                        closeEditor();\n                    }\n                });\n                var shiftThickness = function(n) {\n                    if (_this.renderer.isEditable()) {\n                        var _oldThickness = ((_model.has('style') && _model.get('style').thickness) || 1),\n                            _newThickness = n + _oldThickness;\n                        if(_newThickness < 1 ) {\n                            _newThickness = 1;\n                        }\n                        else if (_newThickness > _this.options.node_stroke_witdh_scale) {\n                            _newThickness = _this.options.node_stroke_witdh_scale;\n                        }\n                        if (_newThickness !== _oldThickness) {\n                            _this.editor_$.find(\"#Rk-Edit-Thickness-Value\").text(_newThickness);\n                            _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {thickness: _newThickness}));\n                            paper.view.draw();\n                        }\n                    }\n                    else {\n                        closeEditor();\n                    }\n                };\n\n                this.editor_$.find(\"#Rk-Edit-Thickness-Down\").click(function() {\n                    shiftThickness(-1);\n                    return false;\n                });\n                this.editor_$.find(\"#Rk-Edit-Thickness-Up\").click(function() {\n                    shiftThickness(1);\n                    return false;\n                });\n            }\n        },\n        redraw: function() {\n            if (this.options.popup_editor){\n                var _coords = this.source_representation.paper_coords;\n                Utils.drawEditBox(this.options, _coords, this.editor_block, 5, this.editor_$);\n            }\n            this.editor_$.show();\n            paper.view.draw();\n        }\n    }).value();\n\n    /* EdgeEditor End */\n\n    return EdgeEditor;\n\n});\n\n\ndefine('renderer/nodebutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* _NodeButton Begin */\n\n    //var _NodeButton = Renderer._NodeButton = Utils.inherit(Renderer._BaseButton);\n    var _NodeButton = Utils.inherit(BaseButton);\n\n    _(_NodeButton.prototype).extend({\n        setSectorSize: function() {\n            var sectorInner = this.source_representation.circle_radius;\n            if (sectorInner !== this.lastSectorInner) {\n                if (this.sector) {\n                    this.sector.destroy();\n                }\n                this.sector = this.renderer.drawSector(\n                        this, 1 + sectorInner,\n                        Utils._NODE_BUTTON_WIDTH + sectorInner,\n                        this.startAngle,\n                        this.endAngle,\n                        1,\n                        this.imageName,\n                        this.renkan.translate(this.text)\n                );\n                this.lastSectorInner = sectorInner;\n            }\n        },\n        unselect: function() {\n            BaseButton.prototype.unselect.apply(this, Array.prototype.slice.call(arguments, 1));\n            if(this.source_representation && this.source_representation.buttons_timeout) {\n                clearTimeout(this.source_representation.buttons_timeout);\n                this.source_representation.hideButtons();\n            }\n        },\n        select: function() {\n            if(this.source_representation && this.source_representation.buttons_timeout) {\n                clearTimeout(this.source_representation.buttons_timeout);\n            }\n            this.sector.select();\n        },\n    }).value();\n\n\n    /* _NodeButton End */\n\n    return _NodeButton;\n\n});\n\n\ndefine('renderer/nodeeditbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeEditButton Begin */\n\n    //var NodeEditButton = Renderer.NodeEditButton = Utils.inherit(Renderer._NodeButton);\n    var NodeEditButton = Utils.inherit(NodeButton);\n\n    _(NodeEditButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-edit-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -125 : -135;\n            this.endAngle = this.options.hide_nodes ? -55 : -45;\n            this.imageName = \"edit\";\n            this.text = \"Edit\";\n        },\n        mouseup: function() {\n            if (!this.renderer.is_dragging) {\n                this.source_representation.openEditor();\n            }\n        }\n    }).value();\n\n    /* NodeEditButton End */\n\n    return NodeEditButton;\n\n});\n\n\ndefine('renderer/noderemovebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeRemoveButton Begin */\n\n    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);\n    var NodeRemoveButton = Utils.inherit(NodeButton);\n\n    _(NodeRemoveButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-remove-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -10 : 0;\n            this.endAngle = this.options.hide_nodes ? 45 : 90;\n            this.imageName = \"remove\";\n            this.text = \"Remove\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                if (this.options.element_delete_delay) {\n                    var delid = Utils.getUID(\"delete\");\n                    this.renderer.delete_list.push({\n                        id: delid,\n                        time: new Date().valueOf() + this.options.element_delete_delay\n                    });\n                    this.source_representation.model.set(\"delete_scheduled\", delid);\n                } else {\n                    if (confirm(this.renkan.translate('Do you really wish to remove node ') + '\"' + this.source_representation.model.get(\"title\") + '\"?')) {\n                        this.project.removeNode(this.source_representation.model);\n                    }\n                }\n            }\n        }\n    }).value();\n\n    /* NodeRemoveButton End */\n\n    return NodeRemoveButton;\n\n});\n\n\ndefine('renderer/nodehidebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeRemoveButton Begin */\n\n    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);\n    var NodeHideButton = Utils.inherit(NodeButton);\n\n    _(NodeHideButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-hide-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = 45;\n            this.endAngle = 90;\n            this.imageName = \"hide\";\n            this.text = \"Hide\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                this.renderer.addHiddenNode(this.source_representation.model);\n            }\n        }\n    }).value();\n\n    /* NodeRemoveButton End */\n\n    return NodeHideButton;\n\n});\n\n\ndefine('renderer/nodeshowbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeRemoveButton Begin */\n\n    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);\n    var NodeShowButton = Utils.inherit(NodeButton);\n\n    _(NodeShowButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-show-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = 90;\n            this.endAngle = 135;\n            this.imageName = \"show\";\n            this.text = \"Show\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                this.source_representation.showNeighbors(false);\n            }\n        }\n    }).value();\n\n    /* NodeShowButton End */\n\n    return NodeShowButton;\n\n});\n\n\ndefine('renderer/noderevertbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeRevertButton Begin */\n\n    //var NodeRevertButton = Renderer.NodeRevertButton = Utils.inherit(Renderer._NodeButton);\n    var NodeRevertButton = Utils.inherit(NodeButton);\n\n    _(NodeRevertButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-revert-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = -135;\n            this.endAngle = 135;\n            this.imageName = \"revert\";\n            this.text = \"Cancel deletion\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            if (this.renderer.isEditable()) {\n                this.source_representation.model.unset(\"delete_scheduled\");\n            }\n        }\n    }).value();\n\n    /* NodeRevertButton End */\n\n    return NodeRevertButton;\n\n});\n\n\ndefine('renderer/nodelinkbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeLinkButton Begin */\n\n    //var NodeLinkButton = Renderer.NodeLinkButton = Utils.inherit(Renderer._NodeButton);\n    var NodeLinkButton = Utils.inherit(NodeButton);\n\n    _(NodeLinkButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-link-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? 135 : 90;\n            this.endAngle = this.options.hide_nodes ? 190 : 180;\n            this.imageName = \"link\";\n            this.text = \"Link to another node\";\n        },\n        mousedown: function(_event, _isTouch) {\n            if (this.renderer.isEditable()) {\n                var _off = this.renderer.canvas_$.offset(),\n                _point = new paper.Point([\n                                          _event.pageX - _off.left,\n                                          _event.pageY - _off.top\n                                          ]);\n                this.renderer.click_target = null;\n                this.renderer.removeRepresentationsOfType(\"editor\");\n                this.renderer.addTempEdge(this.source_representation, _point);\n            }\n        }\n    }).value();\n\n    /* NodeLinkButton End */\n\n    return NodeLinkButton;\n\n});\n\n\n\ndefine('renderer/nodeenlargebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeEnlargeButton Begin */\n\n    //var NodeEnlargeButton = Renderer.NodeEnlargeButton = Utils.inherit(Renderer._NodeButton);\n    var NodeEnlargeButton = Utils.inherit(NodeButton);\n\n    _(NodeEnlargeButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-enlarge-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -55 : -45;\n            this.endAngle = this.options.hide_nodes ? -10 : 0;\n            this.imageName = \"enlarge\";\n            this.text = \"Enlarge\";\n        },\n        mouseup: function() {\n            var _newsize = 1 + (this.source_representation.model.get(\"size\") || 0);\n            this.source_representation.model.set(\"size\", _newsize);\n            this.source_representation.select();\n            this.select();\n            paper.view.draw();\n        }\n    }).value();\n\n    /* NodeEnlargeButton End */\n\n    return NodeEnlargeButton;\n\n});\n\n\ndefine('renderer/nodeshrinkbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeShrinkButton Begin */\n\n    //var NodeShrinkButton = Renderer.NodeShrinkButton = Utils.inherit(Renderer._NodeButton);\n    var NodeShrinkButton = Utils.inherit(NodeButton);\n\n    _(NodeShrinkButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-shrink-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -170 : -180;\n            this.endAngle = this.options.hide_nodes ? -125 : -135;\n            this.imageName = \"shrink\";\n            this.text = \"Shrink\";\n        },\n        mouseup: function() {\n            var _newsize = -1 + (this.source_representation.model.get(\"size\") || 0);\n            this.source_representation.model.set(\"size\", _newsize);\n            this.source_representation.select();\n            this.select();\n            paper.view.draw();\n        }\n    }).value();\n\n    /* NodeShrinkButton End */\n\n    return NodeShrinkButton;\n\n});\n\n\ndefine('renderer/edgeeditbutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* EdgeEditButton Begin */\n\n    //var EdgeEditButton = Renderer.EdgeEditButton = Utils.inherit(Renderer._BaseButton);\n    var EdgeEditButton = Utils.inherit(BaseButton);\n\n    _(EdgeEditButton.prototype).extend({\n        _init: function() {\n            this.type = \"Edge-edit-button\";\n            this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -270, -90, 1, \"edit\", this.renkan.translate(\"Edit\"));\n        },\n        mouseup: function() {\n            if (!this.renderer.is_dragging) {\n                this.source_representation.openEditor();\n            }\n        }\n    }).value();\n\n    /* EdgeEditButton End */\n\n    return EdgeEditButton;\n\n});\n\n\ndefine('renderer/edgeremovebutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* EdgeRemoveButton Begin */\n\n    //var EdgeRemoveButton = Renderer.EdgeRemoveButton = Utils.inherit(Renderer._BaseButton);\n    var EdgeRemoveButton = Utils.inherit(BaseButton);\n\n    _(EdgeRemoveButton.prototype).extend({\n        _init: function() {\n            this.type = \"Edge-remove-button\";\n            this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -90, 90, 1, \"remove\", this.renkan.translate(\"Remove\"));\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                if (this.options.element_delete_delay) {\n                    var delid = Utils.getUID(\"delete\");\n                    this.renderer.delete_list.push({\n                        id: delid,\n                        time: new Date().valueOf() + this.options.element_delete_delay\n                    });\n                    this.source_representation.model.set(\"delete_scheduled\", delid);\n                } else {\n                    if (confirm(this.renkan.translate('Do you really wish to remove edge ') + '\"' + this.source_representation.model.get(\"title\") + '\"?')) {\n                        this.project.removeEdge(this.source_representation.model);\n                    }\n                }\n            }\n        }\n    }).value();\n\n    /* EdgeRemoveButton End */\n\n    return EdgeRemoveButton;\n\n});\n\n\ndefine('renderer/edgerevertbutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* EdgeRevertButton Begin */\n\n    //var EdgeRevertButton = Renderer.EdgeRevertButton = Utils.inherit(Renderer._BaseButton);\n    var EdgeRevertButton = Utils.inherit(BaseButton);\n\n    _(EdgeRevertButton.prototype).extend({\n        _init: function() {\n            this.type = \"Edge-revert-button\";\n            this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -135, 135, 1, \"revert\", this.renkan.translate(\"Cancel deletion\"));\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            if (this.renderer.isEditable()) {\n                this.source_representation.model.unset(\"delete_scheduled\");\n            }\n        }\n    }).value();\n\n    /* EdgeRevertButton End */\n\n    return EdgeRevertButton;\n\n});\n\n\ndefine('renderer/miniframe',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* MiniFrame Begin */\n\n    //var MiniFrame = Renderer.MiniFrame = Utils.inherit(Renderer._BaseRepresentation);\n    var MiniFrame = Utils.inherit(BaseRepresentation);\n\n    _(MiniFrame.prototype).extend({\n        paperShift: function(_delta) {\n            this.renderer.offset = this.renderer.offset.subtract(_delta.divide(this.renderer.minimap.scale).multiply(this.renderer.scale));\n            this.renderer.redraw();\n        },\n        mouseup: function(_delta) {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n        }\n    }).value();\n\n\n    /* MiniFrame End */\n\n    return MiniFrame;\n\n});\n\n\ndefine('renderer/scene',['jquery', 'underscore', 'filesaver', 'requtils', 'renderer/miniframe'], function ($, _, filesaver, requtils, MiniFrame) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* Scene Begin */\n\n    var Scene = function(_renkan) {\n        this.renkan = _renkan;\n        this.$ = $(\".Rk-Render\");\n        this.representations = [];\n        this.$.html(_renkan.options.templates['templates/scene.html'](_renkan));\n        this.onStatusChange();\n        this.canvas_$ = this.$.find(\".Rk-Canvas\");\n        this.labels_$ = this.$.find(\".Rk-Labels\");\n        if (!_renkan.options.popup_editor){\n            this.editor_$ = $(\"#\" + _renkan.options.editor_panel);\n        }else{\n            this.editor_$ = this.$.find(\".Rk-Editor\");\n        }\n        this.notif_$ = this.$.find(\".Rk-Notifications\");\n        paper.setup(this.canvas_$[0]);\n        this.scale = 1;\n        this.initialScale = 1;\n        this.offset = paper.view.center;\n        this.totalScroll = 0;\n        this.hiddenNodes = [];\n        this.mouse_down = false;\n        this.click_target = null;\n        this.selected_target = null;\n        this.edge_layer = new paper.Layer();\n        this.node_layer = new paper.Layer();\n        this.buttons_layer = new paper.Layer();\n        this.delete_list = [];\n        this.redrawActive = true;\n\n        if (_renkan.options.show_minimap) {\n            this.minimap = {\n                    background_layer: new paper.Layer(),\n                    edge_layer: new paper.Layer(),\n                    node_layer: new paper.Layer(),\n                    node_group: new paper.Group(),\n                    size: new paper.Size( _renkan.options.minimap_width, _renkan.options.minimap_height )\n            };\n\n            this.minimap.background_layer.activate();\n            this.minimap.topleft = paper.view.bounds.bottomRight.subtract(this.minimap.size);\n            this.minimap.rectangle = new paper.Path.Rectangle(this.minimap.topleft.subtract([2,2]), this.minimap.size.add([4,4]));\n            this.minimap.rectangle.fillColor = _renkan.options.minimap_background_color;\n            this.minimap.rectangle.strokeColor = _renkan.options.minimap_border_color;\n            this.minimap.rectangle.strokeWidth = 4;\n            this.minimap.offset = new paper.Point(this.minimap.size.divide(2));\n            this.minimap.scale = 0.1;\n\n            this.minimap.node_layer.activate();\n            this.minimap.cliprectangle = new paper.Path.Rectangle(this.minimap.topleft, this.minimap.size);\n            this.minimap.node_group.addChild(this.minimap.cliprectangle);\n            this.minimap.node_group.clipped = true;\n            this.minimap.miniframe = new paper.Path.Rectangle(this.minimap.topleft, this.minimap.size);\n            this.minimap.node_group.addChild(this.minimap.miniframe);\n            this.minimap.miniframe.fillColor = '#c0c0ff';\n            this.minimap.miniframe.opacity = 0.3;\n            this.minimap.miniframe.strokeColor = '#000080';\n            this.minimap.miniframe.strokeWidth = 2;\n            this.minimap.miniframe.__representation = new MiniFrame(this, null);\n        }\n\n        this.throttledPaperDraw = _(function() {\n            paper.view.draw();\n        }).throttle(100).value();\n\n        this.bundles = [];\n        this.click_mode = false;\n\n        var _this = this,\n        _allowScroll = true,\n        _originalScale = 1,\n        _zooming = false,\n        _lastTapX = 0,\n        _lastTapY = 0;\n\n        this.image_cache = {};\n        this.icon_cache = {};\n\n        ['edit', 'remove', 'hide', 'show', 'link', 'enlarge', 'shrink', 'revert' ].forEach(function(imgname) {\n            var img = new Image();\n            img.src = _renkan.options.static_url + 'img/' + imgname + '.png';\n            _this.icon_cache[imgname] = img;\n        });\n\n        var throttledMouseMove = _.throttle(function(_event, _isTouch) {\n            _this.onMouseMove(_event, _isTouch);\n        }, Utils._MOUSEMOVE_RATE);\n\n        this.canvas_$.on({\n            mousedown: function(_event) {\n                _event.preventDefault();\n                _this.onMouseDown(_event, false);\n            },\n            mousemove: function(_event) {\n                _event.preventDefault();\n                throttledMouseMove(_event, false);\n            },\n            mouseup: function(_event) {\n                _event.preventDefault();\n                _this.onMouseUp(_event, false);\n            },\n            mousewheel: function(_event, _delta) {\n                if(_renkan.options.zoom_on_scroll) {\n                    _event.preventDefault();\n                    if (_allowScroll) {\n                        _this.onScroll(_event, _delta);\n                    }\n                }\n            },\n            touchstart: function(_event) {\n                _event.preventDefault();\n                var _touches = _event.originalEvent.touches[0];\n                if (\n                        _renkan.options.allow_double_click &&\n                        new Date() - _lastTap < Utils._DOUBLETAP_DELAY &&\n                        ( Math.pow(_lastTapX - _touches.pageX, 2) + Math.pow(_lastTapY - _touches.pageY, 2) < Utils._DOUBLETAP_DISTANCE )\n                ) {\n                    _lastTap = 0;\n                    _this.onDoubleClick(_touches);\n                } else {\n                    _lastTap = new Date();\n                    _lastTapX = _touches.pageX;\n                    _lastTapY = _touches.pageY;\n                    _originalScale = _this.scale;\n                    _zooming = false;\n                    _this.onMouseDown(_touches, true);\n                }\n            },\n            touchmove: function(_event) {\n                _event.preventDefault();\n                _lastTap = 0;\n                if (_event.originalEvent.touches.length === 1) {\n                    _this.onMouseMove(_event.originalEvent.touches[0], true);\n                } else {\n                    if (!_zooming) {\n                        _this.onMouseUp(_event.originalEvent.touches[0], true);\n                        _this.click_target = null;\n                        _this.is_dragging = false;\n                        _zooming = true;\n                    }\n                    if (_event.originalEvent.scale === \"undefined\") {\n                        return;\n                    }\n                    var _newScale = _event.originalEvent.scale * _originalScale,\n                    _scaleRatio = _newScale / _this.scale,\n                    _newOffset = new paper.Point([\n                                                  _this.canvas_$.width(),\n                                                  _this.canvas_$.height()\n                                                  ]).multiply( 0.5 * ( 1 - _scaleRatio ) ).add(_this.offset.multiply( _scaleRatio ));\n                    _this.setScale(_newScale, _newOffset);\n                }\n            },\n            touchend: function(_event) {\n                _event.preventDefault();\n                _this.onMouseUp(_event.originalEvent.changedTouches[0], true);\n            },\n            dblclick: function(_event) {\n                _event.preventDefault();\n                if (_renkan.options.allow_double_click) {\n                    _this.onDoubleClick(_event);\n                }\n            },\n            mouseleave: function(_event) {\n                _event.preventDefault();\n                //_this.onMouseUp(_event, false);\n                _this.click_target = null;\n                _this.is_dragging = false;\n            },\n            dragover: function(_event) {\n                _event.preventDefault();\n            },\n            dragenter: function(_event) {\n                _event.preventDefault();\n                _allowScroll = false;\n            },\n            dragleave: function(_event) {\n                _event.preventDefault();\n                _allowScroll = true;\n            },\n            drop: function(_event) {\n                _event.preventDefault();\n                _allowScroll = true;\n                var res = {};\n                _.each(_event.originalEvent.dataTransfer.types, function(t) {\n                    try {\n                        res[t] = _event.originalEvent.dataTransfer.getData(t);\n                    } catch(e) {}\n                });\n                var text = _event.originalEvent.dataTransfer.getData(\"Text\");\n                if (typeof text === \"string\") {\n                    switch(text[0]) {\n                    case \"{\":\n                    case \"[\":\n                        try {\n                            var data = JSON.parse(text);\n                            _.extend(res,data);\n                        }\n                        catch(e) {\n                            if (!res[\"text/plain\"]) {\n                                res[\"text/plain\"] = text;\n                            }\n                        }\n                        break;\n                    case \"<\":\n                        if (!res[\"text/html\"]) {\n                            res[\"text/html\"] = text;\n                        }\n                        break;\n                    default:\n                        if (!res[\"text/plain\"]) {\n                            res[\"text/plain\"] = text;\n                        }\n                    }\n                }\n                var url = _event.originalEvent.dataTransfer.getData(\"URL\");\n                if (url && !res[\"text/uri-list\"]) {\n                    res[\"text/uri-list\"] = url;\n                }\n                _this.dropData(res, _event.originalEvent);\n            }\n        });\n\n        var bindClick = function(selector, fname) {\n            _this.$.find(selector).click(function(evt) {\n                _this[fname](evt);\n                return false;\n            });\n        };\n\n        bindClick(\".Rk-ZoomOut\", \"zoomOut\");\n        bindClick(\".Rk-ZoomIn\", \"zoomIn\");\n        bindClick(\".Rk-ZoomFit\", \"autoScale\");\n        this.$.find(\".Rk-ZoomSave\").click( function() {\n            // Save scale and offset point\n            _this.renkan.project.addView( { zoom_level:_this.scale, offset:_this.offset, hidden_nodes: _this.hiddenNodes } );\n        });\n        this.$.find(\".Rk-ZoomSetSaved\").click( function() {\n            var view = _this.renkan.project.get(\"views\").last();\n            if(view){\n                _this.showNodes(false);\n                _this.setScale(view.get(\"zoom_level\"), new paper.Point(view.get(\"offset\")));\n                if (_this.renkan.options.hide_nodes){\n                    _this.hiddenNodes = (view.get(\"hidden_nodes\") || []).concat();\n                    _this.hideNodes();                    \n                }\n            }\n        });\n        this.$.find(\".Rk-ShowHiddenNodes\").mouseenter( function() {\n            _this.showNodes(true);\n            _this.$.find(\".Rk-ShowHiddenNodes\").mouseleave( function() {\n                _this.hideNodes();\n            });\n        });\n        this.$.find(\".Rk-ShowHiddenNodes\").click( function() {\n            _this.showNodes(false);\n            _this.$.find(\".Rk-ShowHiddenNodes\").off( \"mouseleave\" );\n        });\n        if(this.renkan.project.get(\"views\").length > 0 && this.renkan.options.save_view){\n            this.$.find(\".Rk-ZoomSetSaved\").show();\n        }\n        this.$.find(\".Rk-CurrentUser\").mouseenter(\n                function() { _this.$.find(\".Rk-UserList\").slideDown(); }\n        );\n        this.$.find(\".Rk-Users\").mouseleave(\n                function() { _this.$.find(\".Rk-UserList\").slideUp(); }\n        );\n        bindClick(\".Rk-FullScreen-Button\", \"fullScreen\");\n        bindClick(\".Rk-AddNode-Button\", \"addNodeBtn\");\n        bindClick(\".Rk-AddEdge-Button\", \"addEdgeBtn\");\n        bindClick(\".Rk-Save-Button\", \"save\");\n        bindClick(\".Rk-Open-Button\", \"open\");\n        bindClick(\".Rk-Export-Button\", \"exportProject\");\n        this.$.find(\".Rk-Bookmarklet-Button\")\n          /*jshint scripturl:true */\n          .attr(\"href\",\"javascript:\" + Utils._BOOKMARKLET_CODE(_renkan))\n          .click(function(){\n              _this.notif_$\n              .text(_renkan.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.\"))\n              .fadeIn()\n              .delay(5000)\n              .fadeOut();\n              return false;\n          });\n        this.$.find(\".Rk-TopBar-Button\").mouseover(function() {\n            $(this).find(\".Rk-TopBar-Tooltip\").show();\n        }).mouseout(function() {\n            $(this).find(\".Rk-TopBar-Tooltip\").hide();\n        });\n        bindClick(\".Rk-Fold-Bins\", \"foldBins\");\n\n        paper.view.onResize = function(_event) {\n            var _ratio,\n                newWidth = _event.width,\n                newHeight = _event.height;\n\n            if (_this.minimap) {\n                _this.minimap.topleft = paper.view.bounds.bottomRight.subtract(_this.minimap.size);\n                _this.minimap.rectangle.fitBounds(_this.minimap.topleft.subtract([2,2]), _this.minimap.size.add([4,4]));\n                _this.minimap.cliprectangle.fitBounds(_this.minimap.topleft, _this.minimap.size);\n            }\n\n            var ratioH = newHeight/(newHeight-_event.delta.height),\n                ratioW = newWidth/(newWidth-_event.delta.width);\n            if (newHeight < newWidth) {\n                    _ratio = ratioH;\n            } else {\n                _ratio = ratioW;\n            }\n\n            _this.resizeZoom(ratioW, ratioH, _ratio);\n\n            _this.redraw();\n\n        };\n\n        var _thRedraw = _.throttle(function() {\n            _this.redraw();\n        },50);\n\n        this.addRepresentations(\"Node\", this.renkan.project.get(\"nodes\"));\n        this.addRepresentations(\"Edge\", this.renkan.project.get(\"edges\"));\n        this.renkan.project.on(\"change:title\", function() {\n            _this.$.find(\".Rk-PadTitle\").val(_renkan.project.get(\"title\"));\n        });\n\n        this.$.find(\".Rk-PadTitle\").on(\"keyup input paste\", function() {\n            _renkan.project.set({\"title\": $(this).val()});\n        });\n\n        var _thRedrawUsers = _.throttle(function() {\n            _this.redrawUsers();\n        }, 100);\n\n        _thRedrawUsers();\n\n        // register model events\n        this.renkan.project.on(\"change:saveStatus\", function(){\n            switch (_this.renkan.project.get(\"saveStatus\")) {\n                case 0: //clean\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"to-save\");\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saving\");\n                    _this.$.find(\".Rk-Save-Button\").addClass(\"saved\");\n                    break;\n                case 1: //dirty\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saved\");\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saving\");\n                    _this.$.find(\".Rk-Save-Button\").addClass(\"to-save\");\n                    break;\n                case 2: //saving\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saved\");\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"to-save\");\n                    _this.$.find(\".Rk-Save-Button\").addClass(\"saving\");\n                    break;\n            }\n        });\n\n        this.renkan.project.on(\"change:loadingStatus\", function(){\n            if (_this.renkan.project.get(\"loadingStatus\")){\n                var animate = _this.$.find(\".loader\").addClass(\"run\");\n                var timer = setTimeout(function(){\n                    _this.$.find(\".loader\").hide(250);\n                }, 3000);\n            }\n            else{\n                Backbone.history.start();\n            }\n        });\n\n        this.renkan.project.on(\"add:users remove:users\", _thRedrawUsers);\n\n        this.renkan.project.on(\"add:views remove:views\", function(_node) {\n            if(_this.renkan.project.get('views').length > 0) {\n                _this.$.find(\".Rk-ZoomSetSaved\").show();\n            }\n            else {\n                _this.$.find(\".Rk-ZoomSetSaved\").hide();\n            }\n        });\n\n        this.renkan.project.on(\"add:nodes\", function(_node) {\n            _this.addRepresentation(\"Node\", _node);\n            if (!_this.renkan.project.get(\"loadingStatus\")){\n                _thRedraw();\n            }\n        });\n        this.renkan.project.on(\"add:edges\", function(_edge) {\n            _this.addRepresentation(\"Edge\", _edge);\n            if (!_this.renkan.project.get(\"loadingStatus\")){\n                _thRedraw();\n            }\n        });\n        this.renkan.project.on(\"change:title\", function(_model, _title) {\n            var el = _this.$.find(\".Rk-PadTitle\");\n            if (el.is(\"input\")) {\n                if (el.val() !== _title) {\n                    el.val(_title);\n                }\n            } else {\n                el.text(_title);\n            }\n        });\n        \n        //register router events\n        this.renkan.router.on(\"router\", function(_params){\n            _this.parameters(_params);\n        });\n\n        if (_renkan.options.size_bug_fix) {\n            var _delay = (\n                    typeof _renkan.options.size_bug_fix === \"number\" ?\n                        _renkan.options.size_bug_fix\n                                : 500\n            );\n            window.setTimeout(\n                    function() {\n                        _this.fixSize();\n                    },\n                    _delay\n            );\n        }\n\n        if (_renkan.options.force_resize) {\n            $(window).resize(function() {\n                _this.autoScale();\n            });\n        }\n\n        if (_renkan.options.show_user_list && _renkan.options.user_color_editable) {\n            var $cpwrapper = this.$.find(\".Rk-Users .Rk-Edit-ColorPicker-Wrapper\"),\n            $cplist = this.$.find(\".Rk-Users .Rk-Edit-ColorPicker\");\n\n            $cpwrapper.hover(\n                    function(_e) {\n                        if (_this.isEditable()) {\n                            _e.preventDefault();\n                            $cplist.show();\n                        }\n                    },\n                    function(_e) {\n                        _e.preventDefault();\n                        $cplist.hide();\n                    }\n            );\n\n            $cplist.find(\"li\").mouseenter(\n                    function(_e) {\n                        if (_this.isEditable()) {\n                            _e.preventDefault();\n                            _this.$.find(\".Rk-CurrentUser-Color\").css(\"background\", $(this).attr(\"data-color\"));\n                        }\n                    }\n            );\n        }\n\n        if (_renkan.options.show_search_field) {\n\n            var lastval = '';\n\n            this.$.find(\".Rk-GraphSearch-Field\").on(\"keyup change paste input\", function() {\n                var $this = $(this),\n                val = $this.val();\n                if (val === lastval) {\n                    return;\n                }\n                lastval = val;\n                if (val.length < 2) {\n                    _renkan.project.get(\"nodes\").each(function(n) {\n                        _this.getRepresentationByModel(n).unhighlight();\n                    });\n                } else {\n                    var rxs = Utils.regexpFromTextOrArray(val);\n                    _renkan.project.get(\"nodes\").each(function(n) {\n                        if (rxs.test(n.get(\"title\")) || rxs.test(n.get(\"description\"))) {\n                            _this.getRepresentationByModel(n).highlight(rxs);\n                        } else {\n                            _this.getRepresentationByModel(n).unhighlight();\n                        }\n                    });\n                }\n            });\n        }\n\n        this.redraw();\n\n        window.setInterval(function() {\n            var _now = new Date().valueOf();\n            _this.delete_list.forEach(function(d) {\n                if (_now >= d.time) {\n                    var el = _renkan.project.get(\"nodes\").findWhere({\"delete_scheduled\":d.id});\n                    if (el) {\n                        project.removeNode(el);\n                    }\n                    el = _renkan.project.get(\"edges\").findWhere({\"delete_scheduled\":d.id});\n                    if (el) {\n                        project.removeEdge(el);\n                    }\n                }\n            });\n            _this.delete_list = _this.delete_list.filter(function(d) {\n                return _renkan.project.get(\"nodes\").findWhere({\"delete_scheduled\":d.id}) || _renkan.project.get(\"edges\").findWhere({\"delete_scheduled\":d.id});\n            });\n        }, 500);\n\n        if (this.minimap) {\n            window.setInterval(function() {\n                _this.rescaleMinimap();\n            }, 2000);\n        }\n\n    };\n\n    _(Scene.prototype).extend({\n        fixSize: function() {\n            if( this.renkan.options.default_view && this.renkan.project.get(\"views\").length > 0) {\n                var view = this.renkan.project.get(\"views\").last();\n                this.setScale(view.get(\"zoom_level\"), new paper.Point(view.get(\"offset\")));\n            }\n            else{\n                this.autoScale();\n            }\n        },\n        drawSector: function(_repr, _inR, _outR, _startAngle, _endAngle, _padding, _imgname, _caption) {\n            var _options = this.renkan.options,\n                _startRads = _startAngle * Math.PI / 180,\n                _endRads = _endAngle * Math.PI / 180,\n                _img = this.icon_cache[_imgname],\n                _startdx = - Math.sin(_startRads),\n                _startdy = Math.cos(_startRads),\n                _startXIn = Math.cos(_startRads) * _inR + _padding * _startdx,\n                _startYIn = Math.sin(_startRads) * _inR + _padding * _startdy,\n                _startXOut = Math.cos(_startRads) * _outR + _padding * _startdx,\n                _startYOut = Math.sin(_startRads) * _outR + _padding * _startdy,\n                _enddx = - Math.sin(_endRads),\n                _enddy = Math.cos(_endRads),\n                _endXIn = Math.cos(_endRads) * _inR - _padding * _enddx,\n                _endYIn = Math.sin(_endRads) * _inR - _padding * _enddy,\n                _endXOut = Math.cos(_endRads) * _outR - _padding * _enddx,\n                _endYOut = Math.sin(_endRads) * _outR - _padding * _enddy,\n                _centerR = (_inR + _outR) / 2,\n                _centerRads = (_startRads + _endRads) / 2,\n                _centerX = Math.cos(_centerRads) * _centerR,\n                _centerY = Math.sin(_centerRads) * _centerR,\n                _centerXIn = Math.cos(_centerRads) * _inR,\n                _centerXOut = Math.cos(_centerRads) * _outR,\n                _centerYIn = Math.sin(_centerRads) * _inR,\n                _centerYOut = Math.sin(_centerRads) * _outR,\n                _textX = Math.cos(_centerRads) * (_outR + 3),\n                _textY = Math.sin(_centerRads) * (_outR + _options.buttons_label_font_size) + _options.buttons_label_font_size / 2;\n            this.buttons_layer.activate();\n            var _path = new paper.Path();\n            _path.add([_startXIn, _startYIn]);\n            _path.arcTo([_centerXIn, _centerYIn], [_endXIn, _endYIn]);\n            _path.lineTo([_endXOut,  _endYOut]);\n            _path.arcTo([_centerXOut, _centerYOut], [_startXOut, _startYOut]);\n            _path.fillColor = _options.buttons_background;\n            _path.opacity = 0.5;\n            _path.closed = true;\n            _path.__representation = _repr;\n            var _text = new paper.PointText(_textX,_textY);\n            _text.characterStyle = {\n                    fontSize: _options.buttons_label_font_size,\n                    fillColor: _options.buttons_label_color\n            };\n            if (_textX > 2) {\n                _text.paragraphStyle.justification = 'left';\n            } else if (_textX < -2) {\n                _text.paragraphStyle.justification = 'right';\n            } else {\n                _text.paragraphStyle.justification = 'center';\n            }\n            _text.visible = false;\n            var _visible = false,\n                _restPos = new paper.Point(-200, -200),\n                _grp = new paper.Group([_path, _text]),\n                //_grp = new paper.Group([_path]),\n                _delta = _grp.position,\n                _imgdelta = new paper.Point([_centerX, _centerY]),\n                _currentPos = new paper.Point(0,0);\n            _text.content = _caption;\n            // set group pivot to not depend on text visibility that changes the group bounding box.\n            _grp.pivot = _grp.bounds.center;\n            _grp.visible = false;\n            _grp.position = _restPos;\n            var _res = {\n                    show: function() {\n                        _visible = true;\n                        _grp.position = _currentPos.add(_delta);\n                        _grp.visible = true;\n                    },\n                    moveTo: function(_point) {\n                        _currentPos = _point;\n                        if (_visible) {\n                            _grp.position = _point.add(_delta);\n                        }\n                    },\n                    hide: function() {\n                        _visible = false;\n                        _grp.visible = false;\n                        _grp.position = _restPos;\n                    },\n                    select: function() {\n                        _path.opacity = 0.8;\n                        _text.visible = true;\n                    },\n                    unselect: function() {\n                        _path.opacity = 0.5;\n                        _text.visible = false;\n                    },\n                    destroy: function() {\n                        _grp.remove();\n                    }\n            };\n            var showImage = function() {\n                var _raster = new paper.Raster(_img);\n                _raster.position = _imgdelta.add(_grp.position).subtract(_delta);\n                _raster.locked = true; // Disable mouse events on icon\n                _grp.addChild(_raster);\n            };\n            if (_img.width) {\n                showImage();\n            } else {\n                $(_img).on(\"load\",showImage);\n            }\n\n            return _res;\n        },\n        addToBundles: function(_edgeRepr) {\n            var _bundle = _(this.bundles).find(function(_bundle) {\n                return (\n                        ( _bundle.from === _edgeRepr.from_representation && _bundle.to === _edgeRepr.to_representation ) ||\n                        ( _bundle.from === _edgeRepr.to_representation && _bundle.to === _edgeRepr.from_representation )\n                );\n            });\n            if (typeof _bundle !== \"undefined\") {\n                _bundle.edges.push(_edgeRepr);\n            } else {\n                _bundle = {\n                        from: _edgeRepr.from_representation,\n                        to: _edgeRepr.to_representation,\n                        edges: [ _edgeRepr ],\n                        getPosition: function(_er) {\n                            var _dir = (_er.from_representation === this.from) ? 1 : -1;\n                            return _dir * ( _(this.edges).indexOf(_er) - (this.edges.length - 1) / 2 );\n                        }\n                };\n                this.bundles.push(_bundle);\n            }\n            return _bundle;\n        },\n        isEditable: function() {\n            return (this.renkan.options.editor_mode && !this.renkan.read_only);\n        },\n        onStatusChange: function() {\n            var savebtn = this.$.find(\".Rk-Save-Button\"),\n            tip = savebtn.find(\".Rk-TopBar-Tooltip-Contents\");\n            if (this.renkan.read_only) {\n                savebtn.removeClass(\"disabled Rk-Save-Online\").addClass(\"Rk-Save-ReadOnly\");\n                tip.text(this.renkan.translate(\"Connection lost\"));\n            } else {\n                if (this.renkan.options.manual_save) {\n                    savebtn.removeClass(\"Rk-Save-ReadOnly Rk-Save-Online\");\n                    tip.text(this.renkan.translate(\"Save Project\"));\n                } else {\n                    savebtn.removeClass(\"disabled Rk-Save-ReadOnly\").addClass(\"Rk-Save-Online\");\n                    tip.text(this.renkan.translate(\"Auto-save enabled\"));\n                }\n            }\n            this.redrawUsers();\n        },\n        setScale: function(_newScale, _offset) {\n            if ((_newScale/this.initialScale) > Utils._MIN_SCALE && (_newScale/this.initialScale) < Utils._MAX_SCALE) {\n                this.scale = _newScale;\n                if (_offset) {\n                    this.offset = _offset;\n                }\n                this.redraw();\n            }\n        },\n        autoScale: function(force_view) {\n            var nodes = this.renkan.project.get(\"nodes\");\n            if (nodes.length > 1) {\n                var _xx = nodes.map(function(_node) { return _node.get(\"position\").x; }),\n                _yy = nodes.map(function(_node) { return _node.get(\"position\").y; }),\n                _minx = Math.min.apply(Math, _xx),\n                _miny = Math.min.apply(Math, _yy),\n                _maxx = Math.max.apply(Math, _xx),\n                _maxy = Math.max.apply(Math, _yy);\n                var _scale = Math.min( (paper.view.size.width - 2 * this.renkan.options.autoscale_padding) / (_maxx - _minx), (paper.view.size.height - 2 * this.renkan.options.autoscale_padding) / (_maxy - _miny));\n                this.initialScale = _scale;\n                // Override calculated scale if asked\n                if((typeof force_view !== \"undefined\") && parseFloat(force_view.zoom_level)>0 && parseFloat(force_view.offset.x)>0 && parseFloat(force_view.offset.y)>0){\n                    this.setScale(parseFloat(force_view.zoom_level), new paper.Point(parseFloat(force_view.offset.x), parseFloat(force_view.offset.y)));\n                }\n                else{\n                    this.setScale(_scale, paper.view.center.subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale)));\n                }\n            }\n            if (nodes.length === 1) {\n                this.setScale(1, paper.view.center.subtract(new paper.Point([nodes.at(0).get(\"position\").x, nodes.at(0).get(\"position\").y])));\n            }\n        },\n        redrawMiniframe: function() {\n            var topleft = this.toMinimapCoords(this.toModelCoords(new paper.Point([0,0]))),\n                bottomright = this.toMinimapCoords(this.toModelCoords(paper.view.bounds.bottomRight));\n            this.minimap.miniframe.fitBounds(topleft, bottomright);\n        },\n        rescaleMinimap: function() {\n            var nodes = this.renkan.project.get(\"nodes\");\n            if (nodes.length > 1) {\n                var _xx = nodes.map(function(_node) { return _node.get(\"position\").x; }),\n                    _yy = nodes.map(function(_node) { return _node.get(\"position\").y; }),\n                    _minx = Math.min.apply(Math, _xx),\n                    _miny = Math.min.apply(Math, _yy),\n                    _maxx = Math.max.apply(Math, _xx),\n                    _maxy = Math.max.apply(Math, _yy);\n                var _scale = Math.min(\n                        this.scale * 0.8 * this.renkan.options.minimap_width / paper.view.bounds.width,\n                        this.scale * 0.8 * this.renkan.options.minimap_height / paper.view.bounds.height,\n                        ( this.renkan.options.minimap_width - 2 * this.renkan.options.minimap_padding ) / (_maxx - _minx),\n                        ( this.renkan.options.minimap_height - 2 * this.renkan.options.minimap_padding ) / (_maxy - _miny)\n                );\n                this.minimap.offset = this.minimap.size.divide(2).subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale));\n                this.minimap.scale = _scale;\n            }\n            if (nodes.length === 1) {\n                this.minimap.scale = 0.1;\n                this.minimap.offset = this.minimap.size.divide(2).subtract(new paper.Point([nodes.at(0).get(\"position\").x, nodes.at(0).get(\"position\").y]).multiply(this.minimap.scale));\n            }\n            this.redraw();\n        },\n        toPaperCoords: function(_point) {\n            return _point.multiply(this.scale).add(this.offset);\n        },\n        toMinimapCoords: function(_point) {\n            return _point.multiply(this.minimap.scale).add(this.minimap.offset).add(this.minimap.topleft);\n        },\n        toModelCoords: function(_point) {\n            return _point.subtract(this.offset).divide(this.scale);\n        },\n        addRepresentation: function(_type, _model) {\n            var RendererType = requtils.getRenderer()[_type];\n            var _repr = new RendererType(this, _model);\n            this.representations.push(_repr);\n            return _repr;\n        },\n        addRepresentations: function(_type, _collection) {\n            var _this = this;\n            _collection.forEach(function(_model) {\n                _this.addRepresentation(_type, _model);\n            });\n        },\n        userTemplate: _.template(\n                '<li class=\"Rk-User\"><span class=\"Rk-UserColor\" style=\"background:<%=background%>;\"></span><%=name%></li>'\n        ),\n        redrawUsers: function() {\n            if (!this.renkan.options.show_user_list) {\n                return;\n            }\n            var allUsers = [].concat((this.renkan.project.current_user_list || {}).models || [], (this.renkan.project.get(\"users\") || {}).models || []),\n            ulistHtml = '',\n            $userpanel = this.$.find(\".Rk-Users\"),\n            $name = $userpanel.find(\".Rk-CurrentUser-Name\"),\n            $cpitems = $userpanel.find(\".Rk-Edit-ColorPicker li\"),\n            $colorsquare = $userpanel.find(\".Rk-CurrentUser-Color\"),\n            _this = this;\n            $name.off(\"click\").text(this.renkan.translate(\"<unknown user>\"));\n            $cpitems.off(\"mouseleave click\");\n            allUsers.forEach(function(_user) {\n                if (_user.get(\"_id\") === _this.renkan.current_user) {\n                    $name.text(_user.get(\"title\"));\n                    $colorsquare.css(\"background\", _user.get(\"color\"));\n                    if (_this.isEditable()) {\n\n                        if (_this.renkan.options.user_name_editable) {\n                            $name.click(function() {\n                                var $this = $(this),\n                                $input = $('<input>').val(_user.get(\"title\")).blur(function() {\n                                    _user.set(\"title\", $(this).val());\n                                    _this.redrawUsers();\n                                    _this.redraw();\n                                });\n                                $this.empty().html($input);\n                                $input.select();\n                            });\n                        }\n\n                        if (_this.renkan.options.user_color_editable) {\n                            $cpitems.click(\n                                    function(_e) {\n                                        _e.preventDefault();\n                                        if (_this.isEditable()) {\n                                            _user.set(\"color\", $(this).attr(\"data-color\"));\n                                        }\n                                        $(this).parent().hide();\n                                    }\n                            ).mouseleave(function() {\n                                $colorsquare.css(\"background\", _user.get(\"color\"));\n                            });\n                        }\n                    }\n\n                } else {\n                    ulistHtml += _this.userTemplate({\n                        name: _user.get(\"title\"),\n                        background: _user.get(\"color\")\n                    });\n                }\n            });\n            $userpanel.find(\".Rk-UserList\").html(ulistHtml);\n        },\n        removeRepresentation: function(_representation) {\n            _representation.destroy();\n            this.representations = _.reject(this.representations,\n                function(_repr) {\n                    return _repr === _representation;\n                }\n            );\n        },\n        getRepresentationByModel: function(_model) {\n            if (!_model) {\n                return undefined;\n            }\n            return _.find(this.representations, function(_repr) {\n                return _repr.model === _model;\n            });\n        },\n        removeRepresentationsOfType: function(_type) {\n            var _representations = _.filter(this.representations,function(_repr) {\n                return _repr.type === _type;\n                }),\n                _this = this;\n            _.each(_representations, function(_repr) {\n                _this.removeRepresentation(_repr);\n            });\n        },\n        highlightModel: function(_model) {\n            var _repr = this.getRepresentationByModel(_model);\n            if (_repr) {\n                _repr.highlight();\n            }\n        },\n        unhighlightAll: function(_model) {\n            _.each(this.representations, function(_repr) {\n                _repr.unhighlight();\n            });\n        },\n        unselectAll: function(_model) {\n            _.each(this.representations, function(_repr) {\n                _repr.unselect();\n            });\n        },\n        redraw: function() {\n            var _this = this;\n            if(! this.redrawActive ) {\n                return;\n            }\n            _.each(this.representations, function(_representation) {\n                _representation.redraw({ dontRedrawEdges:true });\n            });\n            if (this.minimap) {\n                this.redrawMiniframe();\n            }\n            paper.view.draw();\n        },\n        addTempEdge: function(_from, _point) {\n            var _tmpEdge = this.addRepresentation(\"TempEdge\",null);\n            _tmpEdge.end_pos = _point;\n            _tmpEdge.from_representation = _from;\n            _tmpEdge.redraw();\n            this.click_target = _tmpEdge;\n        },\n        addHiddenNode: function(_model){\n            this.hideNode(_model);\n            this.hiddenNodes.push(_model.id);\n        },\n        hideNode: function(_model){\n            var _this = this;\n            if (typeof _this.getRepresentationByModel(_model) !== 'undefined'){\n                _this.getRepresentationByModel(_model).hide();\n            }\n        },\n        hideNodes: function(){\n            var _this = this;\n            this.hiddenNodes.forEach(function(_id, index){\n                var node = _this.renkan.project.get(\"nodes\").get(_id);\n                if (typeof node !== 'undefined'){\n                    return _this.hideNode(_this.renkan.project.get(\"nodes\").get(_id));\n                }else{\n                    _this.hiddenNodes.splice(index, 1);\n                }\n            });\n            paper.view.draw();\n        },\n        showNodes: function(ghost){\n            var _this = this;\n            var i = 0;\n            this.hiddenNodes.forEach(function(_id){\n                i++;\n                _this.getRepresentationByModel(_this.renkan.project.get(\"nodes\").get(_id)).show(ghost);\n            });\n            if (!ghost){\n                this.hiddenNodes = [];\n            }\n            paper.view.draw();\n        },\n        findTarget: function(_hitResult) {\n            if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                var _newTarget = _hitResult.item.__representation;\n                if (this.selected_target !== _hitResult.item.__representation) {\n                    if (this.selected_target) {\n                        this.selected_target.unselect(_newTarget);\n                    }\n                    _newTarget.select(this.selected_target);\n                    this.selected_target = _newTarget;\n                }\n            } else {\n                if (this.selected_target) {\n                    this.selected_target.unselect();\n                }\n                this.selected_target = null;\n            }\n        },\n        paperShift: function(_delta) {\n            this.offset = this.offset.add(_delta);\n            this.redraw();\n        },\n        onMouseMove: function(_event) {\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]),\n                                      _delta = _point.subtract(this.last_point);\n            this.last_point = _point;\n            if (!this.is_dragging && this.mouse_down && _delta.length > Utils._MIN_DRAG_DISTANCE) {\n                this.is_dragging = true;\n            }\n            var _hitResult = paper.project.hitTest(_point);\n            if (this.is_dragging) {\n                if (this.click_target && typeof this.click_target.paperShift === \"function\") {\n                    this.click_target.paperShift(_delta);\n                } else {\n                    this.paperShift(_delta);\n                }\n            } else {\n                this.findTarget(_hitResult);\n            }\n            paper.view.draw();\n        },\n        onMouseDown: function(_event, _isTouch) {\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]);\n            this.last_point = _point;\n            this.mouse_down = true;\n            if (!this.click_target || this.click_target.type !== \"Temp-edge\") {\n                this.removeRepresentationsOfType(\"editor\");\n                this.is_dragging = false;\n                var _hitResult = paper.project.hitTest(_point);\n                if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                    this.click_target = _hitResult.item.__representation;\n                    this.click_target.mousedown(_event, _isTouch);\n                } else {\n                    this.click_target = null;\n                    if (this.isEditable() && this.click_mode === Utils._CLICKMODE_ADDNODE) {\n                        var _coords = this.toModelCoords(_point),\n                        _data = {\n                            id: Utils.getUID('node'),\n                            created_by: this.renkan.current_user,\n                            position: {\n                                x: _coords.x,\n                                y: _coords.y\n                            }\n                        };\n                        var _node = this.renkan.project.addNode(_data);\n                        this.getRepresentationByModel(_node).openEditor();\n                    }\n                }\n            }\n            if (this.click_mode) {\n                if (this.isEditable() && this.click_mode === Utils._CLICKMODE_STARTEDGE && this.click_target && this.click_target.type === \"Node\") {\n                    this.removeRepresentationsOfType(\"editor\");\n                    this.addTempEdge(this.click_target, _point);\n                    this.click_mode = Utils._CLICKMODE_ENDEDGE;\n                    this.notif_$.fadeOut(function() {\n                        $(this).html(this.renkan.translate(\"Click on a second node to complete the edge\")).fadeIn();\n                    });\n                } else {\n                    this.notif_$.hide();\n                    this.click_mode = false;\n                }\n            }\n            paper.view.draw();\n        },\n        onMouseUp: function(_event, _isTouch) {\n            this.mouse_down = false;\n            if (this.click_target) {\n                var _off = this.canvas_$.offset();\n                this.click_target.mouseup(\n                        {\n                            point: new paper.Point([\n                                                    _event.pageX - _off.left,\n                                                    _event.pageY - _off.top\n                                                    ])\n                        },\n                        _isTouch\n                );\n            } else {\n                this.click_target = null;\n                this.is_dragging = false;\n                if (_isTouch) {\n                    this.unselectAll();\n                }\n            }\n            paper.view.draw();\n        },\n        onScroll: function(_event, _scrolldelta) {\n            this.totalScroll += _scrolldelta;\n            if (Math.abs(this.totalScroll) >= 1) {\n                var _off = this.canvas_$.offset(),\n                _delta = new paper.Point([\n                                          _event.pageX - _off.left,\n                                          _event.pageY - _off.top\n                                          ]).subtract(this.offset).multiply( Math.SQRT2 - 1 );\n                if (this.totalScroll > 0) {\n                    this.setScale( this.scale * Math.SQRT2, this.offset.subtract(_delta) );\n                } else {\n                    this.setScale( this.scale * Math.SQRT1_2, this.offset.add(_delta.divide(Math.SQRT2)));\n                }\n                this.totalScroll = 0;\n            }\n        },\n        onDoubleClick: function(_event) {\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]);\n            var _hitResult = paper.project.hitTest(_point);\n\n            if (!this.isEditable()) {\n                if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                    if (_hitResult.item.__representation.model.get('uri')){\n                        window.open(_hitResult.item.__representation.model.get('uri'), '_blank');\n                    }\n                }\n                return;\n            }\n            if (this.isEditable() && (!_hitResult || typeof _hitResult.item.__representation === \"undefined\")) {\n                var _coords = this.toModelCoords(_point),\n                _data = {\n                    id: Utils.getUID('node'),\n                    created_by: this.renkan.current_user,\n                    position: {\n                        x: _coords.x,\n                        y: _coords.y\n                    }\n                },\n                _node = this.renkan.project.addNode(_data);\n                this.getRepresentationByModel(_node).openEditor();\n            }\n            paper.view.draw();\n        },\n        defaultDropHandler: function(_data) {\n            var newNode = {};\n            var snippet = \"\";\n            switch(_data[\"text/x-iri-specific-site\"]) {\n                case \"twitter\":\n                    snippet = $('<div>').html(_data[\"text/x-iri-selected-html\"]);\n                    var tweetdiv = snippet.find(\".tweet\");\n                    newNode.title = this.renkan.translate(\"Tweet by \") + tweetdiv.attr(\"data-name\");\n                    newNode.uri = \"http://twitter.com/\" + tweetdiv.attr(\"data-screen-name\") + \"/status/\" + tweetdiv.attr(\"data-tweet-id\");\n                    newNode.image = tweetdiv.find(\".avatar\").attr(\"src\");\n                    newNode.description = tweetdiv.find(\".js-tweet-text:first\").text();\n                    break;\n                case \"google\":\n                    snippet = $('<div>').html(_data[\"text/x-iri-selected-html\"]);\n                    newNode.title = snippet.find(\"h3:first\").text().trim();\n                    newNode.uri = snippet.find(\"h3 a\").attr(\"href\");\n                    newNode.description = snippet.find(\".st:first\").text().trim();\n                    break;\n                default:\n                    if (_data[\"text/x-iri-source-uri\"]) {\n                        newNode.uri = _data[\"text/x-iri-source-uri\"];\n                    }\n            }\n            if (_data[\"text/plain\"] || _data[\"text/x-iri-selected-text\"]) {\n                newNode.description = (_data[\"text/plain\"] || _data[\"text/x-iri-selected-text\"]).replace(/[\\s\\n]+/gm,' ').trim();\n            }\n            if (_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]) {\n                snippet = $('<div>').html(_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]);\n                var _svgimgs = snippet.find(\"image\");\n                if (_svgimgs.length) {\n                    newNode.image = _svgimgs.attr(\"xlink:href\");\n                }\n                var _svgpaths = snippet.find(\"path\");\n                if (_svgpaths.length) {\n                    newNode.clipPath = _svgpaths.attr(\"d\");\n                }\n                var _imgs = snippet.find(\"img\");\n                if (_imgs.length) {\n                    newNode.image = _imgs[0].src;\n                }\n                var _as = snippet.find(\"a\");\n                if (_as.length) {\n                    newNode.uri = _as[0].href;\n                }\n                newNode.title = snippet.find(\"[title]\").attr(\"title\") || newNode.title;\n                newNode.description = snippet.text().replace(/[\\s\\n]+/gm,' ').trim();\n            }\n            if (_data[\"text/uri-list\"]) {\n                newNode.uri = _data[\"text/uri-list\"];\n            }\n            if (_data[\"text/x-moz-url\"] && !newNode.title) {\n                newNode.title = (_data[\"text/x-moz-url\"].split(\"\\n\")[1] || \"\").trim();\n                if (newNode.title === newNode.uri) {\n                    newNode.title = false;\n                }\n            }\n            if (_data[\"text/x-iri-source-title\"] && !newNode.title) {\n                newNode.title = _data[\"text/x-iri-source-title\"];\n            }\n            if (_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]) {\n                snippet = $('<div>').html(_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]);\n                newNode.image = snippet.find(\"[data-image]\").attr(\"data-image\") || newNode.image;\n                newNode.uri = snippet.find(\"[data-uri]\").attr(\"data-uri\") || newNode.uri;\n                newNode.title = snippet.find(\"[data-title]\").attr(\"data-title\") || newNode.title;\n                newNode.description = snippet.find(\"[data-description]\").attr(\"data-description\") || newNode.description;\n                newNode.clipPath = snippet.find(\"[data-clip-path]\").attr(\"data-clip-path\") || newNode.clipPath;\n            }\n\n            if (!newNode.title) {\n                newNode.title = this.renkan.translate(\"Dragged resource\");\n            }\n            var fields = [\"title\", \"description\", \"uri\", \"image\"];\n            for (var i = 0; i < fields.length; i++) {\n                var f = fields[i];\n                if (_data[\"text/x-iri-\" + f] || _data[f]) {\n                    newNode[f] = _data[\"text/x-iri-\" + f] || _data[f];\n                }\n                if (newNode[f] === \"none\" || newNode[f] === \"null\") {\n                    newNode[f] = undefined;\n                }\n            }\n\n            if(typeof this.renkan.options.drop_enhancer === \"function\"){\n                newNode = this.renkan.options.drop_enhancer(newNode, _data);\n            }\n\n            return newNode;\n\n        },\n        dropData: function(_data, _event) {\n            if (!this.isEditable()) {\n                return;\n            }\n            if (_data[\"text/json\"] || _data[\"application/json\"]) {\n                try {\n                    var jsondata = JSON.parse(_data[\"text/json\"] || _data[\"application/json\"]);\n                    _.extend(_data,jsondata);\n                }\n                catch(e) {}\n            }\n\n            var newNode = (typeof this.renkan.options.drop_handler === \"undefined\")?this.defaultDropHandler(_data):this.renkan.options.drop_handler(_data);\n\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]),\n                                      _coords = this.toModelCoords(_point),\n                                      _nodedata = {\n                id: Utils.getUID('node'),\n                created_by: this.renkan.current_user,\n                uri: newNode.uri || \"\",\n                title: newNode.title || \"\",\n                description: newNode.description || \"\",\n                image: newNode.image || \"\",\n                color: newNode.color || undefined,\n                clip_path: newNode.clipPath || undefined,\n                position: {\n                    x: _coords.x,\n                    y: _coords.y\n                }\n            };\n            var _node = this.renkan.project.addNode(_nodedata),\n            _repr = this.getRepresentationByModel(_node);\n            if (_event.type === \"drop\") {\n                _repr.openEditor();\n            }\n        },\n        fullScreen: function() {\n            var _isFull = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen,\n                _el = this.renkan.$[0],\n                _requestMethods = [\"requestFullScreen\",\"mozRequestFullScreen\",\"webkitRequestFullScreen\"],\n                _cancelMethods = [\"cancelFullScreen\",\"mozCancelFullScreen\",\"webkitCancelFullScreen\"],\n                i;\n            if (_isFull) {\n                for (i = 0; i < _cancelMethods.length; i++) {\n                    if (typeof document[_cancelMethods[i]] === \"function\") {\n                        document[_cancelMethods[i]]();\n                        break;\n                    }\n                }\n                var widthAft = this.$.width();\n                var heightAft = this.$.height();\n\n                if (this.renkan.options.show_top_bar) {\n                    heightAft -= this.$.find(\".Rk-TopBar\").height();\n                }\n                if (this.renkan.options.show_bins && (this.renkan.$.find(\".Rk-Bins\").position().left > 0)) {\n                    widthAft -= this.renkan.$.find(\".Rk-Bins\").width();\n                }\n\n                paper.view.viewSize = new paper.Size([widthAft, heightAft]);\n\n            } else {\n                for (i = 0; i < _requestMethods.length; i++) {\n                    if (typeof _el[_requestMethods[i]] === \"function\") {\n                        _el[_requestMethods[i]]();\n                        break;\n                    }\n                }\n                this.redraw();\n            }\n        },\n        zoomOut: function() {\n            var _newScale = this.scale * Math.SQRT1_2,\n            _offset = new paper.Point([\n                                       this.canvas_$.width(),\n                                       this.canvas_$.height()\n                                       ]).multiply( 0.5 * ( 1 - Math.SQRT1_2 ) ).add(this.offset.multiply( Math.SQRT1_2 ));\n            this.setScale( _newScale, _offset );\n        },\n        zoomIn: function() {\n            var _newScale = this.scale * Math.SQRT2,\n            _offset = new paper.Point([\n                                       this.canvas_$.width(),\n                                       this.canvas_$.height()\n                                       ]).multiply( 0.5 * ( 1 - Math.SQRT2 ) ).add(this.offset.multiply( Math.SQRT2 ));\n            this.setScale( _newScale, _offset );\n        },\n        resizeZoom: function(_scaleWidth, _scaleHeight, _ratio) {\n            var _newScale = this.scale * _ratio,\n                _offset = new paper.Point([\n                                       (this.offset.x * _scaleWidth),\n                                       (this.offset.y * _scaleHeight)\n                                       ]);\n            this.setScale( _newScale, _offset );\n        },\n        addNodeBtn: function() {\n            if (this.click_mode === Utils._CLICKMODE_ADDNODE) {\n                this.click_mode = false;\n                this.notif_$.hide();\n            } else {\n                this.click_mode = Utils._CLICKMODE_ADDNODE;\n                this.notif_$.text(this.renkan.translate(\"Click on the background canvas to add a node\")).fadeIn();\n            }\n            return false;\n        },\n        addEdgeBtn: function() {\n            if (this.click_mode === Utils._CLICKMODE_STARTEDGE || this.click_mode === Utils._CLICKMODE_ENDEDGE) {\n                this.click_mode = false;\n                this.notif_$.hide();\n            } else {\n                this.click_mode = Utils._CLICKMODE_STARTEDGE;\n                this.notif_$.text(this.renkan.translate(\"Click on a first node to start the edge\")).fadeIn();\n            }\n            return false;\n        },\n        exportProject: function() {\n          var projectJSON = this.renkan.project.toJSON(),\n              downloadLink = document.createElement(\"a\"),\n              projectId = projectJSON.id,\n              fileNameToSaveAs = projectId + \".json\";\n\n          // clean ids\n          delete projectJSON.id;\n          delete projectJSON._id;\n          delete projectJSON.space_id;\n\n          var objId,\n              idsMap = {},\n              hiddenNodes;\n\n          _.each(projectJSON.nodes, function(e,i,l) {\n            objId = e.id || e._id;\n            delete e._id;\n            delete e.id;\n            idsMap[objId] = e['@id'] = Utils.getUUID4();\n          });\n          _.each(projectJSON.edges, function(e,i,l) {\n            delete e._id;\n            delete e.id;\n            e.to = idsMap[e.to];\n            e.from = idsMap[e.from];\n          });\n          _.each(projectJSON.views, function(e,i,l) {\n            delete e._id;\n            delete e.id;\n\n            if(e.hidden_nodes) {\n                hiddenNodes = e.hidden_nodes;\n                e.hidden_nodes = [];\n                _.each(hiddenNodes, function(h,j) {\n                    e.hidden_nodes.push(idsMap[h]);\n                });\n            }\n          });\n          projectJSON.users = [];\n\n          var projectJSONStr = JSON.stringify(projectJSON, null, 2);\n          var blob = new Blob([projectJSONStr], {type: \"application/json;charset=utf-8\"});\n          filesaver(blob,fileNameToSaveAs);\n\n        },\n        parameters: function(_params){\n            if (typeof _params.idnode !== 'undefined'){\n                this.unhighlightAll();\n                this.highlightModel(this.renkan.project.get(\"nodes\").get(_params.idnode));                 \n            }\n        },\n        foldBins: function() {\n            var foldBinsButton = this.$.find(\".Rk-Fold-Bins\"),\n                bins = this.renkan.$.find(\".Rk-Bins\");\n            var _this = this,\n                sizeBef = _this.canvas_$.width(),\n                sizeAft;\n            if (bins.position().left < 0) {\n                bins.animate({left: 0},250);\n                this.$.animate({left: 300},250,function() {\n                    var w = _this.$.width();\n                    paper.view.viewSize = new paper.Size([w, _this.canvas_$.height()]);\n                });\n                if ((sizeBef -  bins.width()) < bins.height()){\n                    sizeAft = sizeBef;\n                } else {\n                    sizeAft = sizeBef - bins.width();\n                }\n                foldBinsButton.html(\"&laquo;\");\n            } else {\n                bins.animate({left: -300},250);\n                this.$.animate({left: 0},250,function() {\n                    var w = _this.$.width();\n                    paper.view.viewSize = new paper.Size([w, _this.canvas_$.height()]);\n                });\n                sizeAft = sizeBef+300;\n                foldBinsButton.html(\"&raquo;\");\n            }\n            _this.resizeZoom(1, 1, (sizeAft/sizeBef));\n        },\n        save: function() { },\n        open: function() { }\n    }).value();\n\n    /* Scene End */\n\n    return Scene;\n\n});\n\n\n//Load modules and use them\nif( typeof require.config === \"function\" ) {\n    require.config({\n        paths: {\n            'jquery':'../lib/jquery/jquery',\n            'underscore':'../lib/lodash/lodash',\n            'filesaver' :'../lib/FileSaver/FileSaver',\n            'requtils':'require-utils',\n            'ckeditor-core':'../lib/ckeditor/ckeditor',\n            'ckeditor-jquery':'../lib/ckeditor/adapters/jquery'\n        },\n        shim: {\n            'ckeditor-jquery':{\n                deps:['jquery','ckeditor-core']\n            }\n        },\n    });\n}\n\nrequire(['renderer/baserepresentation',\n         'renderer/basebutton',\n         'renderer/noderepr',\n         'renderer/edge',\n         'renderer/tempedge',\n         'renderer/baseeditor',\n         'renderer/nodeeditor',\n         'renderer/edgeeditor',\n         'renderer/nodebutton',\n         'renderer/nodeeditbutton',\n         'renderer/noderemovebutton',\n         'renderer/nodehidebutton',\n         'renderer/nodeshowbutton',\n         'renderer/noderevertbutton',\n         'renderer/nodelinkbutton',\n         'renderer/nodeenlargebutton',\n         'renderer/nodeshrinkbutton',\n         'renderer/edgeeditbutton',\n         'renderer/edgeremovebutton',\n         'renderer/edgerevertbutton',\n         'renderer/miniframe',\n         'renderer/scene'\n         ], function(BaseRepresentation, BaseButton, NodeRepr, Edge, TempEdge, BaseEditor, NodeEditor, EdgeEditor, NodeButton, NodeEditButton, NodeRemoveButton, NodeHideButton, NodeShowButton, NodeRevertButton, NodeLinkButton, NodeEnlargeButton, NodeShrinkButton, EdgeEditButton, EdgeRemoveButton, EdgeRevertButton, MiniFrame, Scene){\n\n    'use strict';\n\n    var Rkns = window.Rkns;\n\n    if(typeof Rkns.Renderer === \"undefined\"){\n        Rkns.Renderer = {};\n    }\n    var Renderer = Rkns.Renderer;\n\n    Renderer._BaseRepresentation = BaseRepresentation;\n    Renderer._BaseButton = BaseButton;\n    Renderer.Node = NodeRepr;\n    Renderer.Edge = Edge;\n    Renderer.TempEdge = TempEdge;\n    Renderer._BaseEditor = BaseEditor;\n    Renderer.NodeEditor = NodeEditor;\n    Renderer.EdgeEditor = EdgeEditor;\n    Renderer._NodeButton = NodeButton;\n    Renderer.NodeEditButton = NodeEditButton;\n    Renderer.NodeRemoveButton = NodeRemoveButton;\n    Renderer.NodeHideButton = NodeHideButton;\n    Renderer.NodeShowButton = NodeShowButton;\n    Renderer.NodeRevertButton = NodeRevertButton;\n    Renderer.NodeLinkButton = NodeLinkButton;\n    Renderer.NodeEnlargeButton = NodeEnlargeButton;\n    Renderer.NodeShrinkButton = NodeShrinkButton;\n    Renderer.EdgeEditButton = EdgeEditButton;\n    Renderer.EdgeRemoveButton = EdgeRemoveButton;\n    Renderer.EdgeRevertButton = EdgeRevertButton;\n    Renderer.MiniFrame = MiniFrame;\n    Renderer.Scene = Scene;\n\n    startRenkan();\n});\n\ndefine(\"main-renderer\", function(){});\n\n"]}
\ No newline at end of file
+{"version":3,"file":"renkan.min.js","sources":["templates.js","../../js/main.js","../../js/router.js","../../js/dataloader.js","../../js/models.js","../../js/defaults.js","../../js/i18n.js","../../js/full-json.js","../../js/save-once.js","../../js/ldtjson-bin.js","../../js/list-bin.js","../../js/wikipedia-bin.js","paper-renderer.js"],"names":["this","obj","__t","__p","_","escape","__e","Array","prototype","join","renkan","translate","edge","title","options","show_edge_editor_uri","uri","properties","length","each","ontology","label","property","show_edge_editor_style","show_edge_editor_style_color","show_edge_editor_style_dash","dash","show_edge_editor_style_thickness","thickness","show_edge_editor_style_arrow","arrow","show_edge_editor_direction","show_edge_editor_nodes","from_color","shortenText","from_title","to_title","show_edge_editor_creator","has_creator","created_by_title","show_edge_tooltip_color","color","show_edge_tooltip_uri","short_uri","show_edge_tooltip_nodes","to_color","show_edge_tooltip_creator","created_by_color","Rkns","Utils","getFullURL","image","description","static_url","url","show_bins","show_editor","show_node_editor_title_richtext","node","show_node_editor_uri","change_types","types","type","charAt","toUpperCase","substring","show_node_editor_description","show_node_editor_description_richtext","show_node_editor_size","size","show_node_editor_style","show_node_editor_style_color","show_node_editor_style_dash","show_node_editor_style_thickness","show_node_editor_image","image_placeholder","clip_path","allow_image_upload","show_node_editor_creator","change_shapes","shapes","shape","show_node_tooltip_color","show_node_tooltip_uri","show_node_tooltip_description","show_node_tooltip_image","show_node_tooltip_creator","_id","print","__j","call","arguments","show_top_bar","editor_mode","project","get","show_user_list","show_user_color","user_color_editable","colorPicker","home_button_url","home_button_title","show_fullscreen_button","show_addnode_button","show_addedge_button","show_export_button","show_save_button","show_open_button","show_bookmarklet","show_search_field","resize","show_zoom","save_view","hide_nodes","root","$","jQuery","pickerColors","__renkans","_BaseBin","_renkan","_opts","find","hide","addClass","appendTo","title_icon_$","_this","attr","href","html","click","destroy","slideDown","resizeBins","refresh","count_$","title_$","main_$","auto_refresh","window","setInterval","detach","Renkan","push","defaults","templates","renkanJST","node_editor_templates","template","types_templates","value","key","property_files","f","getJSON","data","concat","read_only","router","Router","Models","Project","dataloader","DataLoader","Loader","setCurrentUser","user_id","user_name","addUser","current_user","renderer","redrawUsers","container","tabs","search_engines","current_user_list","UsersList","on","_tmpl","map","c","Renderer","Scene","search","_select","_input","_form","_search","Search","_key","getSearchTitle","className","getBgClass","_el","setSearchEngine","submit","val","search_engine","mouseenter","mouseleave","bins","_bin","Bin","elementDropped","_mainDiv","siblings","is","slideUp","_t","_models","where","_model","highlightModel","mouseout","unhighlightAll","dragDrop","err","e","preventDefault","touch","originalEvent","changedTouches","off","canvas_$","offset","w","width","h","height","pageX","left","pageY","top","onMouseMove","div","document","createElement","appendChild","cloneNode","dropData","text/html","innerHTML","onMouseDown","onMouseUp","dataTransfer","setData","lastsearch","lastval","regexpFromTextOrArray","source","tab","render","_text","i18n","language","substr","onStatusChange","listClasses","split","classes","i","_d","outerHeight","css","getUUID4","replace","r","Math","random","v","toString","getUID","pad","n","Date","ID_AUTO_INCREMENT","ID_BASE","getUTCFullYear","getUTCMonth","getUTCDate","_base","_n","_uidbase","test","img","Image","src","res","inherit","_baseClass","_callbefore","_class","apply","slice","_init","_initialized","extend","replaceText","makeReplaceFunc","l","k","charsrx","txt","toLowerCase","remrx","j","remsrc","charsub","getSource","inp","removeChars","String","fromCharCode","RegExp","_textOrArray","testrx","replacerx","isempty","_replace","text","_MIN_DRAG_DISTANCE","_NODE_BUTTON_WIDTH","_EDGE_BUTTON_INNER","_EDGE_BUTTON_OUTER","_CLICKMODE_ADDNODE","_CLICKMODE_STARTEDGE","_CLICKMODE_ENDEDGE","_NODE_SIZE_STEP","LN2","_MIN_SCALE","_MAX_SCALE","_MOUSEMOVE_RATE","_DOUBLETAP_DELAY","_DOUBLETAP_DISTANCE","_USER_PLACEHOLDER","default_user_color","_BOOKMARKLET_CODE","_maxlength","drawEditBox","_options","_coords","_path","_xmargin","_selector","tooltip_width","tooltip_padding","_height","_isLeft","x","paper","view","center","_left","tooltip_arrow_length","_right","_top","y","tooltip_margin","max","tooltip_arrow_width","min","_bottom","segments","point","add","fillColor","Color","Gradient","tooltip_top_color","tooltip_bottom_color","increaseBrightness","hex","percent","parseInt","g","b","Backbone","routes","index","parameters","result","forEach","part","item","decodeURIComponent","trigger","converters","from1to2","len","nodes","style","edges","schema_version","dataConverters","convert","schemaVersionFrom","getSchemaVersion","schemaVersionTo","converterName","load","set","validate","guid","RenkanModel","RelationalModel","idAttribute","constructor","id","prepare","addReference","_propName","_list","_default","_element","User","toJSON","Node","relations","HasOne","relatedModel","created_by","position","Edge","from","to","View","isArray","zoom_level","hidden_nodes","RosterUser","blacklist","HasMany","reverseRelation","includeInJSON","_props","_user","findOrCreate","addNode","_node","addEdge","_edge","addView","_view","removeNode","remove","removeEdge","_project","users","views","_item","t","version","initialize","filter","json","clone","attributes","Model","Collection","omit","site_id","model","navigator","userLanguage","popup_editor","editor_panel","manual_save","size_bug_fix","force_resize","allow_double_click","zoom_on_scroll","element_delete_delay","autoscale_padding","default_view","update_url","user_name_editable","show_minimap","minimap_width","minimap_height","minimap_padding","minimap_background_color","minimap_border_color","minimap_highlight_color","minimap_highlight_weight","buttons_background","buttons_label_color","buttons_label_font_size","ghost_opacity","default_dash_array","show_node_circles","clip_node_images","node_images_fill_mode","node_size_base","node_stroke_width","node_stroke_max_width","selected_node_stroke_width","selected_node_stroke_max_width","node_stroke_witdh_scale","node_fill_color","highlighted_node_fill_color","node_label_distance","node_label_max_length","label_untitled_nodes","default","video","edge_stroke_width","edge_stroke_max_width","selected_edge_stroke_width","selected_edge_stroke_max_width","edge_stroke_witdh_scale","edge_label_distance","edge_label_max_length","edge_arrow_length","edge_arrow_width","edge_arrow_max_width","edge_gap_in_bundles","label_untitled_edges","tooltip_border_color","tooltip_border_width","tooltip_opacity","richtext_editor_config","toolbarGroups","name","groups","removePlugins","show_node_editor_title","uploaded_image_max_kb","fr","Edit Node","Edit Edge","Title:","URI:","Description:","From:","To:","Image URL:","Choose Image File:","Full Screen","Add Node","Add Edge","Save Project","Open Project","Auto-save enabled","Connection lost","Created by:","Zoom In","Zoom Out","Edit","Remove","Cancel deletion","Link to another node","Enlarge","Shrink","Click on the background canvas to add a node","Click on a first node to start the edge","Click on a second node to complete the edge","Wikipedia","Wikipedia in ","French","English","Japanese","Untitled project","Lignes de Temps","Loading, please wait","Edge color:","Dash:","Thickness:","Arrow:","Node color:","Choose color","Change edge direction","Do you really wish to remove node ","Do you really wish to remove edge ","This file is not an image","Image size must be under ","Size:","KB","Choose from vocabulary:","SKOS Documentation properties","has note","has example","has definition","SKOS Semantic relations","has broader","has narrower","has related","Dublin Core Metadata","has contributor","covers","created by","has date","published by","has source","has subject","Dragged resource","Search the Web","Search in Bins","Close bin","Refresh bin","(untitled)","Select contents:","Drag items from this website, drop them in 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.","Shapes available","Circle","Square","Diamond","Hexagone","Ellipse","Star","Cloud","Triangle","Zoom Fit","Download Project","Save view","View saved view","Renkan 'Drag-to-Add' bookmarklet","(unknown user)","<unknown user>","Search in graph","Search in ","jsonIO","_proj","http_method","_load","redrawActive","loadingStatus","_data","saveStatus","_save","ajax","contentType","JSON","stringify","success","_thrSave","throttle","setTimeout","changedAttributes","hasChanged","jsonIOSaveOnClick","_saveWarn","_onLeave","getdata","rx","matches","location","hash","match","beforeSend","_checkLeave","removeClass","save","hasClass","Ldt","ProjectBin","ldt_type","Resclass","console","error","tagTemplate","annotationTemplate","proj_id","project_id","ldt_platform","searchbase","highlight","_e","convertTC","_ms","_res","_totalSeconds","abs","floor","_hours","_minutes","_seconds","_html","_projtitle","meta","count","tags","_tag","_title","htitle","encodedtitle","encodeURIComponent","annotations","_annotation","_description","content","_duration","end","begin","_img","hdescription","start","duration","mediaid","media","annotationid","show","dataType","lang","_q","ResultsBin","segmentTemplate","max_results","highlightrx","objects","_segment","_begin","start_ts","_end","iri_id","element_id","format","q","limit","ResourceList","resultTemplate","list","trim","_match","langs","en","ja","query","_result","encodeURI","snippet","define","_BaseRepresentation","_renderer","_changeBinding","redraw","change","_removeBinding","removeRepresentation","defer","_selectBinding","select","_unselectBinding","unselect","_super","_func","moveTo","unhighlight","mousedown","mouseup","getUtils","getRenderer","requtils","BaseRepresentation","_BaseButton","_pos","sector","_newTarget","source_representation","cloud_path","builders","circle","getShape","Path","getImageShape","radius","rectangle","Rectangle","ellipse","polygon","RegularPolygon","diamond","d","SQRT2","rotate","star","cloud","path","scale","triangle","svg","ShapeBuilder","NodeRepr","node_layer","activate","buildShape","hidden","ghost","strokeWidth","h_ratio","labels_$","normal_buttons","NodeEditButton","NodeRemoveButton","NodeLinkButton","NodeEnlargeButton","NodeShrinkButton","NodeHideButton","NodeShowButton","pending_delete_buttons","NodeRevertButton","all_buttons","active_buttons","last_circle_radius","minimap","minimap_circle","__representation","miniframe","node_group","addChild","_getStrokeWidth","has","_getSelectedStrokeWidth","changed","shapeBuilder","sendToBack","_model_coords","Point","_baseRadius","exp","is_dragging","paper_coords","toPaperCoords","circle_radius","setSectorSize","node_image","subtract","image_delta","multiply","old_act_btn","opacity","dashArray","selected","isEditable","highlighted","_strokeWidth","_color","_dash","strokeColor","_pc","lastImage","showImage","minipos","toMinimapCoords","miniradius","minisize","Size","fitBounds","dontRedrawEdges","ed","repr","getRepresentationByModel","from_representation","to_representation","_image","image_cache","clipPath","hasClipPath","_clip","baseRadius","centerPoint","instructions","lastCoords","minX","Infinity","minY","maxX","maxY","transformCoords","tabc","relative","newCoords","parseFloat","isY","instr","coords","lineTo","cubicCurveTo","quadraticCurveTo","_raster","Raster","locked","Group","clipped","_circleClip","divide","insertAbove","paperShift","_delta","openEditor","removeRepresentationsOfType","_editor","addRepresentation","draw","_uri","showNeighbors","hideButtons","buttons_timeout","undefined","hideNeighbors","indexNode","hiddenNodes","indexOf","splice","textToReplace","hlvalue","throttledPaperDraw","saveCoords","toModelCoords","_event","_isTouch","unselectAll","click_target","edge_layer","bundle","addToBundles","line","arrow_scale","pivot","arrow_angle","EdgeEditButton","EdgeRemoveButton","EdgeRevertButton","minimap_line","_getArrowScale","_opacity","_arrow_scale","_p0a","_p1a","_v","_r","_u","_ortho","_group_pos","getPosition","_p0b","_p1b","_a","angle","_textdelta","_handle","visible","handleIn","handleOut","bounds","_textpos","transform","-moz-transform","-webkit-transform","text_angle","reject","TempEdge","_p0","_p1","end_pos","_c","_hitResult","hitTest","findTarget","_endDrag","_target","_destmodel","_BaseEditor","buttons_layer","editor_block","_pts","range","editor_$","BaseEditor","NodeEditor","readOnlyTemplate","_created_by","_template","_image_placeholder","_size","keys","editorInstance","ckeditor","editorInstanceTitle","closeEditor","cleanEditor","editor","focusManager","blur","_editor_title","onFieldChange","checkDirty","getData","resetDirty","assign","keyCode","files","FileReader","alert","onload","target","readAsDataURL","focus","_picker","hover","shiftSize","_newsize","shiftThickness","_oldThickness","_newThickness","titlehtml","EdgeEditor","_from_model","_to_model","BaseButton","_NodeButton","sectorInner","lastSectorInner","drawSector","startAngle","endAngle","imageName","clearTimeout","NodeButton","delid","delete_list","time","valueOf","confirm","addHiddenNode","unset","_off","_point","addTempEdge","MiniFrame","filesaver","representations","notif_$","setup","totalScroll","mouse_down","selected_target","Layer","background_layer","topleft","bottomRight","cliprectangle","bundles","click_mode","_allowScroll","_originalScale","_zooming","_lastTapX","_lastTapY","icon_cache","imgname","throttledMouseMove","mousemove","mousewheel","onScroll","touchstart","_touches","touches","_lastTap","pow","onDoubleClick","touchmove","_newScale","_scaleRatio","_newOffset","setScale","touchend","dblclick","dragover","dragenter","dragleave","drop","parse","bindClick","selector","fname","evt","fadeIn","delay","fadeOut","mouseover","onResize","_ratio","newWidth","newHeight","ratioH","delta","ratioW","resizeZoom","_thRedraw","addRepresentations","_thRedrawUsers","history","el","_params","_delay","fixSize","autoScale","$cpwrapper","$cplist","$this","rxs","_now","findWhere","delete_scheduled","rescaleMinimap","last","_repr","_inR","_outR","_startAngle","_endAngle","_padding","_imgname","_caption","_startRads","PI","_endRads","_startdx","sin","_startdy","cos","_startXIn","_startYIn","_startXOut","_startYOut","_enddx","_enddy","_endXIn","_endYIn","_endXOut","_endYOut","_centerR","_centerRads","_centerX","_centerY","_centerXIn","_centerXOut","_centerYIn","_centerYOut","_textX","_textY","arcTo","closed","PointText","characterStyle","fontSize","paragraphStyle","justification","_visible","_restPos","_grp","_imgdelta","_currentPos","_edgeRepr","_bundle","_er","_dir","savebtn","tip","redrawMiniframe","bottomright","_xx","_yy","_minx","_miny","_maxx","_maxy","_scale","at","_type","RendererType","_collection","userTemplate","allUsers","models","ulistHtml","$userpanel","$name","$cpitems","$colorsquare","$input","empty","parent","background","_representation","_representations","_from","_tmpEdge","last_point","updateUrl","_scrolldelta","SQRT1_2","open","defaultDropHandler","newNode","tweetdiv","_svgimgs","_svgpaths","_imgs","_as","fields","drop_enhancer","jsondata","drop_handler","_nodedata","fullScreen","_isFull","mozFullScreen","webkitIsFullScreen","_requestMethods","_cancelMethods","widthAft","heightAft","viewSize","addNodeBtn","addEdgeBtn","exportProject","projectJSON","projectId","fileNameToSaveAs","space_id","objId","idsMap","projectJSONStr","blob","Blob","isEmptyObject","first","idView","viewParams","params","init","idNode","foldBins","sizeAft","foldBinsButton","sizeBef","animate","ViewRepr","initialScale","showNodes","hideNodes","hideNode","_offset","zoomOut","zoomIn","_scaleWidth","_scaleHeight","force_view","getFragment","round","navigate","param","require","config","paths","jquery","underscore","ckeditor-core","ckeditor-jquery","shim","deps","startRenkan"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,KAAgB,UAAIA,KAAgB,cAEpCA,KAAgB,UAAE,8BAAgC,SAASC,KAC3DA,MAAQA,OACR,EAAA,GAAIC,KAAKC,IAAM,EAAUC,GAAEC,OAC3B,KAAMJ,IACNE,KAAO,oBACS,OAAdD,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S,8BACA,sBACA,oBACA,gBACA,oBACA,sBACA,sBACA,sBACA,sBACA,0BACA,4BACA,0BACA,0BACA,4BACA,0BACA,6BACA,4BACA,0BACA,4BACA,4BACA,qBACA,iBACA,qBACG,SAASrf,EAAoBgQ,EAAYnO,EAAUxW,EAAMihB,EAAUiB,EAAYC,EAAYqC,EAAYY,EAAYlO,EAAgBC,EAAkBI,EAAgBC,EAAgBE,EAAkBN,EAAgBC,EAAmBC,EAAkB4H,EAAgBC,EAAkBC,EAAkB2G,EAAW/0B,EAAOiiC,GAI1U,GAAIxqC,GAAO4F,OAAO5F,IAEU,oBAAlBA,GAAKsI,WACXtI,EAAKsI,YAET,IAAIA,GAAWtI,EAAKsI,QAEpBA,GAASuiB,oBAAsBqB,EAC/B5jB,EAAS6jB,YAAc+P,EACvB5zB,EAAS2O,KAAO8W,EAChBzlB,EAASiP,KAAOA,EAChBjP,EAASoP,KAAO8yB,EAChBliC,EAASkwB,SAAWA,EACpBlwB,EAAS6wB,YAAcM,EACvBnxB,EAASoxB,WAAaA,EACtBpxB,EAASyzB,WAAaA,EACtBzzB,EAAS6zB,YAAcQ,EACvBr0B,EAASmmB,eAAiBA,EAC1BnmB,EAASomB,iBAAmBA,EAC5BpmB,EAASwmB,eAAiBA,EAC1BxmB,EAASymB,eAAiBA,EAC1BzmB,EAAS2mB,iBAAmBA,EAC5B3mB,EAASqmB,eAAiBA,EAC1BrmB,EAASsmB,kBAAoBA,EAC7BtmB,EAASumB,iBAAmBA,EAC5BvmB,EAASmuB,eAAiBA,EAC1BnuB,EAASouB,iBAAmBA,EAC5BpuB,EAASquB,iBAAmBA,EAC5BruB,EAASg1B,UAAYA,EACrBh1B,EAASC,MAAQA,EAEjByjC,gBAGJphB,OAAO,gBAAiB","sourcesContent":["this[\"renkanJST\"] = this[\"renkanJST\"] || {};\n\nthis[\"renkanJST\"][\"templates/colorpicker.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li data-color=\"' +\n((__t = (c)) == null ? '' : __t) +\n'\" style=\"background: ' +\n((__t = (c)) == null ? '' : __t) +\n'\"></li>';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/edgeeditor.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>' +\n__e(renkan.translate(\"Edit Edge\")) +\n'</span>\\n</h2>\\n<p>\\n    <label>' +\n__e(renkan.translate(\"Title:\")) +\n'</label>\\n    <input class=\"Rk-Edit-Title\" type=\"text\" value=\"' +\n__e(edge.title) +\n'\" />\\n</p>\\n';\n if (options.show_edge_editor_uri) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"URI:\")) +\n'</label>\\n        <input class=\"Rk-Edit-URI\" type=\"text\" value=\"' +\n__e(edge.uri) +\n'\" />\\n        <a class=\"Rk-Edit-Goto\" href=\"' +\n__e(edge.uri) +\n'\" target=\"_blank\"></a>\\n    </p>\\n    ';\n if (options.properties.length) { ;\n__p += '\\n        <p>\\n            <label>' +\n__e(renkan.translate(\"Choose from vocabulary:\")) +\n'</label>\\n            <select class=\"Rk-Edit-Vocabulary\">\\n                ';\n _.each(options.properties, function(ontology) { ;\n__p += '\\n                    <option class=\"Rk-Edit-Vocabulary-Class\" value=\"\">\\n                        ' +\n__e( renkan.translate(ontology.label) ) +\n'\\n                    </option>\\n                    ';\n _.each(ontology.properties, function(property) { var uri = ontology[\"base-uri\"] + property.uri; ;\n__p += '\\n                        <option class=\"Rk-Edit-Vocabulary-Property\" value=\"' +\n__e( uri ) +\n'\"\\n                            ';\n if (uri === edge.uri) { ;\n__p += ' selected';\n } ;\n__p += '>\\n                            ' +\n__e( renkan.translate(property.label) ) +\n'\\n                        </option>\\n                    ';\n }) ;\n__p += '\\n                ';\n }) ;\n__p += '\\n            </select>\\n        </p>\\n';\n } } ;\n__p += '\\n';\n if (options.show_edge_editor_style) { ;\n__p += '\\n    <div class=\"Rk-Editor-p\">\\n      ';\n if (options.show_edge_editor_style_color) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-color\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Edge color:\")) +\n'</span>\\n        <div class=\"Rk-Edit-ColorPicker-Wrapper\">\\n            <span class=\"Rk-Edit-Color\" style=\"background: &lt;%-edge.color%>;\">\\n                <span class=\"Rk-Edit-ColorTip\"></span>\\n            </span>\\n            ' +\n((__t = ( renkan.colorPicker )) == null ? '' : __t) +\n'\\n            <span class=\"Rk-Edit-ColorPicker-Text\">' +\n__e( renkan.translate(\"Choose color\") ) +\n'</span>\\n        </div>\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_edge_editor_style_dash) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-dash\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Dash:\")) +\n'</span>\\n        <input type=\"checkbox\" name=\"Rk-Edit-Dash\" class=\"Rk-Edit-Dash\" ' +\n__e( edge.dash ) +\n' />\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_edge_editor_style_thickness) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-thickness\">\\n          <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Thickness:\")) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Down\">-</a>\\n          <span class=\"Rk-Edit-Size-Disp\" id=\"Rk-Edit-Thickness-Value\">' +\n__e( edge.thickness ) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Up\">+</a>\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_edge_editor_style_arrow) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-arrow\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Arrow:\")) +\n'</span>\\n        <input type=\"checkbox\" name=\"Rk-Edit-Arrow\" class=\"Rk-Edit-Arrow\" ' +\n__e( edge.arrow ) +\n' />\\n      </div>\\n      ';\n } ;\n__p += '\\n    </div>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_editor_direction) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Edit-Direction\">' +\n__e( renkan.translate(\"Change edge direction\") ) +\n'</span>\\n    </p>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_editor_nodes) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"From:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(edge.from_color) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.from_title, 25) ) +\n'\\n    </p>\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"To:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: >%-edge.to_color%>;\"></span>\\n        ' +\n__e( shortenText(edge.to_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_editor_creator && edge.has_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: &lt;%-edge.created_by_color%>;\"></span>\\n        ' +\n__e( shortenText(edge.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/edgeeditor_readonly.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>\\n    ';\n if (options.show_edge_tooltip_color) { ;\n__p += '\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.color ) +\n';\"></span>\\n    ';\n } ;\n__p += '\\n    <span class=\"Rk-Display-Title\">\\n        ';\n if (edge.uri) { ;\n__p += '\\n            <a href=\"' +\n__e(edge.uri) +\n'\" target=\"_blank\">\\n        ';\n } ;\n__p += '\\n        ' +\n__e(edge.title) +\n'\\n        ';\n if (edge.uri) { ;\n__p += ' </a> ';\n } ;\n__p += '\\n    </span>\\n</h2>\\n';\n if (options.show_edge_tooltip_uri && edge.uri) { ;\n__p += '\\n    <p class=\"Rk-Display-URI\">\\n        <a href=\"' +\n__e(edge.uri) +\n'\" target=\"_blank\">' +\n__e( edge.short_uri ) +\n'</a>\\n    </p>\\n';\n } ;\n__p += '\\n<p>' +\n((__t = (edge.description)) == null ? '' : __t) +\n'</p>\\n';\n if (options.show_edge_tooltip_nodes) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"From:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.from_color ) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.from_title, 25) ) +\n'\\n    </p>\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"To:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.to_color ) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.to_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_tooltip_creator && edge.has_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.created_by_color ) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/ldtjson-bin/annotationtemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item\" draggable=\"true\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL(image) ) +\n'\"\\n    data-uri=\"' +\n((__t = (ldt_platform)) == null ? '' : __t) +\n'ldtplatform/ldt/front/player/' +\n((__t = (mediaid)) == null ? '' : __t) +\n'/#id=' +\n((__t = (annotationid)) == null ? '' : __t) +\n'\"\\n    data-title=\"' +\n__e(title) +\n'\" data-description=\"' +\n__e(description) +\n'\">\\n\\n    <img class=\"Rk-Ldt-Annotation-Icon\" src=\"' +\n((__t = (image)) == null ? '' : __t) +\n'\" />\\n    <h4>' +\n((__t = (htitle)) == null ? '' : __t) +\n'</h4>\\n    <p>' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n    <p>Start: ' +\n((__t = (start)) == null ? '' : __t) +\n', End: ' +\n((__t = (end)) == null ? '' : __t) +\n', Duration: ' +\n((__t = (duration)) == null ? '' : __t) +\n'</p>\\n    <div class=\"Rk-Clear\"></div>\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/ldtjson-bin/segmenttemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item\" draggable=\"true\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL(image) ) +\n'\"\\n    data-uri=\"' +\n((__t = (ldt_platform)) == null ? '' : __t) +\n'ldtplatform/ldt/front/player/' +\n((__t = (mediaid)) == null ? '' : __t) +\n'/#id=' +\n((__t = (annotationid)) == null ? '' : __t) +\n'\"\\n    data-title=\"' +\n__e(title) +\n'\" data-description=\"' +\n__e(description) +\n'\">\\n\\n    <img class=\"Rk-Ldt-Annotation-Icon\" src=\"' +\n((__t = (image)) == null ? '' : __t) +\n'\" />\\n    <h4>' +\n((__t = (htitle)) == null ? '' : __t) +\n'</h4>\\n    <p>' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n    <p>Start: ' +\n((__t = (start)) == null ? '' : __t) +\n', End: ' +\n((__t = (end)) == null ? '' : __t) +\n', Duration: ' +\n((__t = (duration)) == null ? '' : __t) +\n'</p>\\n    <div class=\"Rk-Clear\"></div>\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/ldtjson-bin/tagtemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item\" draggable=\"true\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL(static_url+'img/ldt-tag.png') ) +\n'\"\\n    data-uri=\"' +\n((__t = (ldt_platform)) == null ? '' : __t) +\n'ldtplatform/ldt/front/search/?search=' +\n((__t = (encodedtitle)) == null ? '' : __t) +\n'&field=all\"\\n    data-title=\"' +\n__e(title) +\n'\" data-description=\"Tag \\'' +\n__e(title) +\n'\\'\">\\n\\n    <img class=\"Rk-Ldt-Tag-Icon\" src=\"' +\n__e(static_url) +\n'img/ldt-tag.png\" />\\n    <h4>' +\n((__t = (htitle)) == null ? '' : __t) +\n'</h4>\\n    <div class=\"Rk-Clear\"></div>\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/list-bin.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item Rk-ResourceList-Item\" draggable=\"true\"\\n    data-uri=\"' +\n__e(url) +\n'\" data-title=\"' +\n__e(title) +\n'\"\\n    data-description=\"' +\n__e(description) +\n'\"\\n    ';\n if (image) { ;\n__p += '\\n        data-image=\"' +\n__e( Rkns.Utils.getFullURL(image) ) +\n'\"\\n    ';\n } else { ;\n__p += '\\n        data-image=\"\"\\n    ';\n } ;\n__p += '\\n>';\n if (image) { ;\n__p += '\\n    <img class=\"Rk-ResourceList-Image\" src=\"' +\n__e(image) +\n'\" />\\n';\n } ;\n__p += '\\n<h4 class=\"Rk-ResourceList-Title\">\\n    ';\n if (url) { ;\n__p += '\\n        <a href=\"' +\n__e(url) +\n'\" target=\"_blank\">\\n    ';\n } ;\n__p += '\\n    ' +\n((__t = (htitle)) == null ? '' : __t) +\n'\\n    ';\n if (url) { ;\n__p += '</a>';\n } ;\n__p += '\\n    </h4>\\n    ';\n if (description) { ;\n__p += '\\n        <p class=\"Rk-ResourceList-Description\">' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n    ';\n } ;\n__p += '\\n    ';\n if (image) { ;\n__p += '\\n        <div style=\"clear: both;\"></div>\\n    ';\n } ;\n__p += '\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/main.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n\n if (options.show_bins) { ;\n__p += '\\n    <div class=\"Rk-Bins\">\\n        <div class=\"Rk-Bins-Head\">\\n            <h2 class=\"Rk-Bins-Title\">' +\n__e( translate(\"Select contents:\")) +\n'</h2>\\n            <form class=\"Rk-Web-Search-Form Rk-Search-Form\">\\n                <input class=\"Rk-Web-Search-Input Rk-Search-Input\" type=\"search\"\\n                    placeholder=\"' +\n__e( translate('Search the Web') ) +\n'\" />\\n                <div class=\"Rk-Search-Select\">\\n                    <div class=\"Rk-Search-Current\"></div>\\n                    <ul class=\"Rk-Search-List\"></ul>\\n                </div>\\n                <input type=\"submit\" value=\"\"\\n                    class=\"Rk-Web-Search-Submit Rk-Search-Submit\" title=\"' +\n__e( translate('Search the Web') ) +\n'\" />\\n            </form>\\n            <form class=\"Rk-Bins-Search-Form Rk-Search-Form\">\\n                <input class=\"Rk-Bins-Search-Input Rk-Search-Input\" type=\"search\"\\n                    placeholder=\"' +\n__e( translate('Search in Bins') ) +\n'\" /> <input\\n                    type=\"submit\" value=\"\"\\n                    class=\"Rk-Bins-Search-Submit Rk-Search-Submit\"\\n                    title=\"' +\n__e( translate('Search in Bins') ) +\n'\" />\\n            </form>\\n        </div>\\n        <ul class=\"Rk-Bin-List\"></ul>\\n    </div>\\n';\n } ;\n__p += ' ';\n if (options.show_editor) { ;\n__p += '\\n    <div class=\"Rk-Render Rk-Render-';\n if (options.show_bins) { ;\n__p += 'Panel';\n } else { ;\n__p += 'Full';\n } ;\n__p += '\"></div>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/nodeeditor.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n\n //TODO: change class to id ;\n__p += '\\n<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>' +\n__e(renkan.translate(\"Edit Node\")) +\n'</span>\\n</h2>\\n<p>\\n    <label>' +\n__e(renkan.translate(\"Title:\")) +\n'</label>\\n    ';\n if (options.show_node_editor_title_richtext) { ;\n__p += '\\n        <div class=\"Rk-Edit-Title\" contenteditable=\"true\">' +\n((__t = (node.title)) == null ? '' : __t) +\n'</div>\\n    ';\n } else { ;\n__p += '\\n        <input class=\"Rk-Edit-Title\" type=\"text\" value=\"' +\n__e(node.title) +\n'\" />\\n    ';\n } ;\n__p += '    \\n</p>\\n';\n if (options.show_node_editor_uri) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"URI:\")) +\n'</label>\\n        <input class=\"Rk-Edit-URI\" type=\"text\" value=\"' +\n__e(node.uri) +\n'\" />\\n        <a class=\"Rk-Edit-Goto\" href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\"></a>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.change_types) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Types available\")) +\n':</label>\\n        <select class=\"Rk-Edit-Type\">\\n          ';\n _.each(types, function(type) { ;\n__p += '\\n            <option class=\"Rk-Edit-Vocabulary-Property\" value=\"' +\n__e( type ) +\n'\"';\n if (node.type === type) { ;\n__p += ' selected';\n } ;\n__p += '>\\n                ' +\n__e( renkan.translate(type.charAt(0).toUpperCase() + type.substring(1)) ) +\n'\\n            </option>\\n          ';\n }); ;\n__p += '\\n        </select>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_description) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Description:\")) +\n'</label>\\n        ';\n if (options.show_node_editor_description_richtext) { ;\n__p += '\\n            <div class=\"Rk-Edit-Description\" contenteditable=\"true\">' +\n((__t = (node.description)) == null ? '' : __t) +\n'</div>\\n        ';\n } else { ;\n__p += '\\n            <textarea class=\"Rk-Edit-Description\">' +\n((__t = (node.description)) == null ? '' : __t) +\n'</textarea>\\n        ';\n } ;\n__p += '\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_size) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Size:\")) +\n'</span>\\n        <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Size-Down\">-</a>\\n        <span class=\"Rk-Edit-Size-Disp\" id=\"Rk-Edit-Size-Value\">' +\n__e(node.size) +\n'</span>\\n        <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Size-Up\">+</a>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_style) { ;\n__p += '\\n    <div class=\"Rk-Editor-p\">\\n      ';\n if (options.show_node_editor_style_color) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-color\">\\n        <span class=\"Rk-Editor-Label\">\\n        ' +\n__e(renkan.translate(\"Node color:\")) +\n'</span>\\n        <div class=\"Rk-Edit-ColorPicker-Wrapper\">\\n            <span class=\"Rk-Edit-Color\" style=\"background: ' +\n__e(node.color) +\n';\">\\n                <span class=\"Rk-Edit-ColorTip\"></span>\\n            </span>\\n            ' +\n((__t = ( renkan.colorPicker )) == null ? '' : __t) +\n'\\n            <span class=\"Rk-Edit-ColorPicker-Text\">' +\n__e( renkan.translate(\"Choose color\") ) +\n'</span>\\n        </div>\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_node_editor_style_dash) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-dash\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Dash:\")) +\n'</span>\\n        <input type=\"checkbox\" name=\"Rk-Edit-Dash\" class=\"Rk-Edit-Dash\" ' +\n__e( node.dash ) +\n' />\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_node_editor_style_thickness) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-thickness\">\\n          <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Thickness:\")) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Down\">-</a>\\n          <span class=\"Rk-Edit-Size-Disp\" id=\"Rk-Edit-Thickness-Value\">' +\n__e(node.thickness) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Up\">+</a>\\n      </div>\\n      ';\n } ;\n__p += '\\n    </div>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_image) { ;\n__p += '\\n    <div class=\"Rk-Edit-ImgWrap\">\\n        <div class=\"Rk-Edit-ImgPreview\">\\n            <img src=\"' +\n__e(node.image || node.image_placeholder) +\n'\" />\\n            ';\n if (node.clip_path) { ;\n__p += '\\n                <svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewbox=\"0 0 1 1\" preserveAspectRatio=\"none\">\\n                    <path style=\"stroke-width: .02; stroke:red; fill-opacity:.3; fill:red;\" d=\"' +\n__e( node.clip_path ) +\n'\" />\\n                </svg>\\n            ';\n };\n__p += '\\n        </div>\\n    </div>\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Image URL:\")) +\n'</label>\\n        <div>\\n            <a class=\"Rk-Edit-Image-Del\" href=\"#\"></a>\\n            <input class=\"Rk-Edit-Image\" type=\"text\" value=\\'' +\n__e(node.image) +\n'\\' />\\n        </div>\\n    </p>\\n';\n if (options.allow_image_upload) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Choose Image File:\")) +\n'</label>\\n        <input class=\"Rk-Edit-Image-File\" type=\"file\" accept=\"image/*\" />\\n    </p>\\n';\n };\n\n } ;\n__p += ' ';\n if (options.show_node_editor_creator && node.has_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.created_by_color) +\n';\"></span>\\n        ' +\n__e( shortenText(node.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.change_shapes) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Shapes available\")) +\n':</label>\\n        <select class=\"Rk-Edit-Shape\">\\n          ';\n _.each(shapes, function(shape) { ;\n__p += '\\n            <option class=\"Rk-Edit-Vocabulary-Property\" value=\"' +\n__e( shape ) +\n'\"';\n if (node.shape === shape) { ;\n__p += ' selected';\n } ;\n__p += '>\\n                ' +\n__e( renkan.translate(shape.charAt(0).toUpperCase() + shape.substring(1)) ) +\n'\\n            </option>\\n          ';\n }); ;\n__p += '\\n        </select>\\n    </p>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/nodeeditor_readonly.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>\\n    ';\n if (options.show_node_tooltip_color) { ;\n__p += '\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.color) +\n';\"></span>\\n    ';\n } ;\n__p += '\\n    <span class=\"Rk-Display-Title\">\\n        ';\n if (node.uri) { ;\n__p += '\\n            <a href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\">\\n        ';\n } ;\n__p += '\\n        ' +\n__e(node.title) +\n'\\n        ';\n if (node.uri) { ;\n__p += '</a>';\n } ;\n__p += '\\n    </span>\\n</h2>\\n';\n if (node.uri && options.show_node_tooltip_uri) { ;\n__p += '\\n    <p class=\"Rk-Display-URI\">\\n        <a href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\">' +\n__e(node.short_uri) +\n'</a>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_tooltip_description) { ;\n__p += '\\n    <p class=\"Rk-Display-Description\">' +\n((__t = (node.description)) == null ? '' : __t) +\n'</p>\\n';\n } ;\n__p += ' ';\n if (node.image && options.show_node_tooltip_image) { ;\n__p += '\\n    <img class=\"Rk-Display-ImgPreview\" src=\"' +\n__e(node.image) +\n'\" />\\n';\n } ;\n__p += ' ';\n if (node.has_creator && options.show_node_tooltip_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.created_by_color) +\n';\"></span>\\n        ' +\n__e( shortenText(node.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n    <a href=\"#?idNode=' +\n__e(node._id) +\n'\">' +\n__e(renkan.translate(\"Link to the node\")) +\n'</a>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/nodeeditor_video.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>\\n    ';\n if (options.show_node_tooltip_color) { ;\n__p += '\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.color) +\n';\"></span>\\n    ';\n } ;\n__p += '\\n    <span class=\"Rk-Display-Title\">\\n        ';\n if (node.uri) { ;\n__p += '\\n            <a href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\">\\n        ';\n } ;\n__p += '\\n        ' +\n__e(node.title) +\n'\\n        ';\n if (node.uri) { ;\n__p += '</a>';\n } ;\n__p += '\\n    </span>\\n</h2>\\n';\n if (node.uri && options.show_node_tooltip_uri) { ;\n__p += '\\n     <video width=\"320\" height=\"240\" controls>\\n        <source src=\"' +\n__e(node.uri) +\n'\" type=\"video/mp4\">\\n     </video> \\n';\n } ;\n__p += '\\n    <a href=\"#?idnode=' +\n__e(node._id) +\n'\">' +\n__e(renkan.translate(\"Link to the node\")) +\n'</a>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/scene.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n\n if (options.show_top_bar) { ;\n__p += '\\n    <div class=\"Rk-TopBar\">\\n        <div class=\"loader\"></div>\\n        ';\n if (!options.editor_mode) { ;\n__p += '\\n            <h2 class=\"Rk-PadTitle\">\\n                ' +\n__e( project.get(\"title\") || translate(\"Untitled project\")) +\n'\\n            </h2>\\n        ';\n } else { ;\n__p += '\\n            <input type=\"text\" class=\"Rk-PadTitle\" value=\"' +\n__e( project.get('title') || '' ) +\n'\" placeholder=\"' +\n__e(translate('Untitled project')) +\n'\" />\\n        ';\n } ;\n__p += '\\n        ';\n if (options.show_user_list) { ;\n__p += '\\n            <div class=\"Rk-Users\">\\n                <div class=\"Rk-CurrentUser\">\\n                    ';\n if (options.show_user_color) { ;\n__p += '\\n                        <div class=\"Rk-Edit-ColorPicker-Wrapper\">\\n                            <span class=\"Rk-CurrentUser-Color\">\\n                            ';\n if (options.user_color_editable) { ;\n__p += '\\n                                <span class=\"Rk-Edit-ColorTip\"></span>\\n                            ';\n } ;\n__p += '\\n                            </span>\\n                            ';\n if (options.user_color_editable) { print(colorPicker) } ;\n__p += '\\n                        </div>\\n                    ';\n } ;\n__p += '\\n                    <span class=\"Rk-CurrentUser-Name\">&lt;unknown user&gt;</span>\\n                </div>\\n                <ul class=\"Rk-UserList\"></ul>\\n            </div>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.home_button_url) {;\n__p += '\\n            <div class=\"Rk-TopBar-Separator\"></div>\\n            <a class=\"Rk-TopBar-Button Rk-Home-Button\" href=\"' +\n__e( options.home_button_url ) +\n'\">\\n                <div class=\"Rk-TopBar-Tooltip\">\\n                    <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                        ' +\n__e( translate(options.home_button_title) ) +\n'\\n                    </div>\\n                </div>\\n            </a>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.show_fullscreen_button) { ;\n__p += '\\n            <div class=\"Rk-TopBar-Separator\"></div>\\n            <div class=\"Rk-TopBar-Button Rk-FullScreen-Button\">\\n                <div class=\"Rk-TopBar-Tooltip\">\\n                    <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                        ' +\n__e(translate(\"Full Screen\")) +\n'\\n                    </div>\\n                </div>\\n            </div>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.editor_mode) { ;\n__p += '\\n            ';\n if (options.show_addnode_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-AddNode-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Add Node\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_addedge_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-AddEdge-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Add Edge\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_export_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Export-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Download Project\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_save_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Save-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\"></div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_open_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Open-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Open Project\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_bookmarklet) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <a class=\"Rk-TopBar-Button Rk-Bookmarklet-Button\" href=\"#\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Renkan \\'Drag-to-Add\\' bookmarklet\")) +\n'\\n                        </div>\\n                    </div>\\n                </a>\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n            ';\n } ;\n__p += '\\n        ';\n } else { ;\n__p += '\\n            ';\n if (options.show_export_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Export-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Download Project\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n            ';\n } ;\n__p += '\\n        ';\n }; ;\n__p += '\\n        ';\n if (options.show_search_field) { ;\n__p += '\\n            <form action=\"#\" class=\"Rk-GraphSearch-Form\">\\n                <input type=\"search\" class=\"Rk-GraphSearch-Field\" placeholder=\"' +\n__e( translate('Search in graph') ) +\n'\" />\\n            </form>\\n            <div class=\"Rk-TopBar-Separator\"></div>\\n        ';\n } ;\n__p += '\\n    </div>\\n';\n } ;\n__p += '\\n<div class=\"Rk-Editing-Space';\n if (!options.show_top_bar) { ;\n__p += ' Rk-Editing-Space-Full';\n } ;\n__p += '\">\\n    <div class=\"Rk-Labels\"></div>\\n    <canvas class=\"Rk-Canvas\" ';\n if (options.resize) { ;\n__p += ' resize=\"\" ';\n } ;\n__p += ' ></canvas>\\n    <div class=\"Rk-Notifications\"></div>\\n    <div class=\"Rk-Editor\">\\n        ';\n if (options.show_bins) { ;\n__p += '\\n            <div class=\"Rk-Fold-Bins\">&laquo;</div>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.show_zoom) { ;\n__p += '\\n            <div class=\"Rk-ZoomButtons\">\\n                <div class=\"Rk-ZoomIn\" title=\"' +\n__e(translate('Zoom In')) +\n'\"></div>\\n                <div class=\"Rk-ZoomFit\" title=\"' +\n__e(translate('Zoom Fit')) +\n'\"></div>\\n                <div class=\"Rk-ZoomOut\" title=\"' +\n__e(translate('Zoom Out')) +\n'\"></div>\\n                ';\n if (options.editor_mode && options.save_view) { ;\n__p += '\\n                    <div class=\"Rk-ZoomSave\" title=\"' +\n__e(translate('Save view')) +\n'\"></div>\\n                ';\n } ;\n__p += '\\n                ';\n if (options.save_view) { ;\n__p += '\\n                    <div class=\"Rk-ZoomSetSaved\" title=\"' +\n__e(translate('View saved view')) +\n'\"></div>\\n                    ';\n if (options.hide_nodes) { ;\n__p += '\\n                \\t   <div class=\"Rk-ShowHiddenNodes\" title=\"' +\n__e(translate('Show hidden nodes')) +\n'\"></div>\\n                    ';\n } ;\n__p += '       \\n                ';\n } ;\n__p += '\\n            </div>\\n        ';\n } ;\n__p += '\\n    </div>\\n</div>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/search.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"' +\n((__t = ( className )) == null ? '' : __t) +\n'\" data-key=\"' +\n((__t = ( key )) == null ? '' : __t) +\n'\">' +\n((__t = ( title )) == null ? '' : __t) +\n'</li>';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/wikipedia-bin/resulttemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Wikipedia-Result Rk-Bin-Item\" draggable=\"true\"\\n    data-uri=\"' +\n__e(url) +\n'\" data-title=\"Wikipedia: ' +\n__e(title) +\n'\"\\n    data-description=\"' +\n__e(description) +\n'\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL( static_url + 'img/wikipedia.png' ) ) +\n'\">\\n\\n    <img class=\"Rk-Wikipedia-Icon\" src=\"' +\n__e(static_url) +\n'img/wikipedia.png\">\\n    <h4 class=\"Rk-Wikipedia-Title\">\\n        <a href=\"' +\n__e(url) +\n'\" target=\"_blank\">' +\n((__t = (htitle)) == null ? '' : __t) +\n'</a>\\n    </h4>\\n    <p class=\"Rk-Wikipedia-Snippet\">' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n</li>\\n';\n\n}\nreturn __p\n};","/* Declaring the Renkan Namespace Rkns and Default values */\n\n(function(root) {\n\n    \"use strict\";\n\n    if (typeof root.Rkns !== \"object\") {\n        root.Rkns = {};\n    }\n\n    var Rkns = root.Rkns;\n    var $ = Rkns.$ = root.jQuery;\n    var _ = Rkns._ = root._;\n\n    Rkns.pickerColors = [\"#8f1919\", \"#a80000\", \"#d82626\", \"#ff0000\", \"#e87c7c\", \"#ff6565\", \"#f7d3d3\", \"#fecccc\",\n        \"#8f5419\", \"#a85400\", \"#d87f26\", \"#ff7f00\", \"#e8b27c\", \"#ffb265\", \"#f7e5d3\", \"#fee5cc\",\n        \"#8f8f19\", \"#a8a800\", \"#d8d826\", \"#feff00\", \"#e8e87c\", \"#feff65\", \"#f7f7d3\", \"#fefecc\",\n        \"#198f19\", \"#00a800\", \"#26d826\", \"#00ff00\", \"#7ce87c\", \"#65ff65\", \"#d3f7d3\", \"#ccfecc\",\n        \"#198f8f\", \"#00a8a8\", \"#26d8d8\", \"#00feff\", \"#7ce8e8\", \"#65feff\", \"#d3f7f7\", \"#ccfefe\",\n        \"#19198f\", \"#0000a8\", \"#2626d8\", \"#0000ff\", \"#7c7ce8\", \"#6565ff\", \"#d3d3f7\", \"#ccccfe\",\n        \"#8f198f\", \"#a800a8\", \"#d826d8\", \"#ff00fe\", \"#e87ce8\", \"#ff65fe\", \"#f7d3f7\", \"#feccfe\",\n        \"#000000\", \"#242424\", \"#484848\", \"#6d6d6d\", \"#919191\", \"#b6b6b6\", \"#dadada\", \"#ffffff\"\n    ];\n\n    Rkns.__renkans = [];\n\n    var _BaseBin = Rkns._BaseBin = function(_renkan, _opts) {\n        if (typeof _renkan !== \"undefined\") {\n            this.renkan = _renkan;\n            this.renkan.$.find(\".Rk-Bin-Main\").hide();\n            this.$ = Rkns.$('<li>')\n                .addClass(\"Rk-Bin\")\n                .appendTo(_renkan.$.find(\".Rk-Bin-List\"));\n            this.title_icon_$ = Rkns.$('<span>')\n                .addClass(\"Rk-Bin-Title-Icon\")\n                .appendTo(this.$);\n\n            var _this = this;\n\n            Rkns.$('<a>')\n                .attr({\n                    href: \"#\",\n                    title: _renkan.translate(\"Close bin\")\n                })\n                .addClass(\"Rk-Bin-Close\")\n                .html('&times;')\n                .appendTo(this.$)\n                .click(function() {\n                    _this.destroy();\n                    if (!_renkan.$.find(\".Rk-Bin-Main:visible\").length) {\n                        _renkan.$.find(\".Rk-Bin-Main:last\").slideDown();\n                    }\n                    _renkan.resizeBins();\n                    return false;\n                });\n            Rkns.$('<a>')\n                .attr({\n                    href: \"#\",\n                    title: _renkan.translate(\"Refresh bin\")\n                })\n                .addClass(\"Rk-Bin-Refresh\")\n                .appendTo(this.$)\n                .click(function() {\n                    _this.refresh();\n                    return false;\n                });\n            this.count_$ = Rkns.$('<div>')\n                .addClass(\"Rk-Bin-Count\")\n                .appendTo(this.$);\n            this.title_$ = Rkns.$('<h2>')\n                .addClass(\"Rk-Bin-Title\")\n                .appendTo(this.$);\n            this.main_$ = Rkns.$('<div>')\n                .addClass(\"Rk-Bin-Main\")\n                .appendTo(this.$)\n                .html('<h4 class=\"Rk-Bin-Loading\">' + _renkan.translate(\"Loading, please wait\") + '</h4>');\n            this.title_$.html(_opts.title || '(new bin)');\n            this.renkan.resizeBins();\n\n            if (_opts.auto_refresh) {\n                window.setInterval(function() {\n                    _this.refresh();\n                }, _opts.auto_refresh);\n            }\n        }\n    };\n\n    _BaseBin.prototype.destroy = function() {\n        this.$.detach();\n        this.renkan.resizeBins();\n    };\n\n    /* Point of entry */\n\n    var Renkan = Rkns.Renkan = function(_opts) {\n        var _this = this;\n\n        Rkns.__renkans.push(this);\n\n        this.options = _.defaults(_opts, Rkns.defaults, {\n            templates: _.defaults(_opts.templates, renkanJST) || renkanJST,\n            node_editor_templates: _.defaults(_opts.node_editor_templates, Rkns.defaults.node_editor_templates)\n        });\n        this.template = renkanJST['templates/main.html'];\n\n        var types_templates = {};\n        _.each(this.options.node_editor_templates, function(value, key) {\n            types_templates[key] = _this.options.templates[value];\n            delete _this.options.templates[value];\n        });\n        this.options.node_editor_templates = types_templates;\n\n        _.each(this.options.property_files, function(f) {\n            Rkns.$.getJSON(f, function(data) {\n                _this.options.properties = _this.options.properties.concat(data);\n            });\n        });\n\n        this.read_only = this.options.read_only || !this.options.editor_mode;\n\n        this.router = new Rkns.Router();\n\n        this.project = new Rkns.Models.Project();\n        this.dataloader = new Rkns.DataLoader.Loader(this.project, this.options);\n\n        this.setCurrentUser = function(user_id, user_name) {\n            this.project.addUser({\n                _id: user_id,\n                title: user_name\n            });\n            this.current_user = user_id;\n            this.renderer.redrawUsers();\n        };\n\n        if (typeof this.options.user_id !== \"undefined\") {\n            this.current_user = this.options.user_id;\n        }\n        this.$ = Rkns.$(\"#\" + this.options.container);\n        this.$\n            .addClass(\"Rk-Main\")\n            .html(this.template(this));\n\n        this.tabs = [];\n        this.search_engines = [];\n\n        this.current_user_list = new Rkns.Models.UsersList();\n\n        this.current_user_list.on(\"add remove\", function() {\n            if (this.renderer) {\n                this.renderer.redrawUsers();\n            }\n        });\n\n        this.colorPicker = (function() {\n            var _tmpl = renkanJST['templates/colorpicker.html'];\n            return '<ul class=\"Rk-Edit-ColorPicker\">' + Rkns.pickerColors.map(function(c) {\n                return _tmpl({\n                    c: c\n                });\n            }).join(\"\") + '</ul>';\n        })();\n\n        if (this.options.show_editor) {\n            this.renderer = new Rkns.Renderer.Scene(this);\n        }\n\n        if (!this.options.search.length) {\n            this.$.find(\".Rk-Web-Search-Form\").detach();\n        } else {\n            var _tmpl = renkanJST['templates/search.html'],\n                _select = this.$.find(\".Rk-Search-List\"),\n                _input = this.$.find(\".Rk-Web-Search-Input\"),\n                _form = this.$.find(\".Rk-Web-Search-Form\");\n            _.each(this.options.search, function(_search, _key) {\n                if (Rkns[_search.type] && Rkns[_search.type].Search) {\n                    _this.search_engines.push(new Rkns[_search.type].Search(_this, _search));\n                }\n            });\n            _select.html(\n                _(this.search_engines).map(function(_search, _key) {\n                    return _tmpl({\n                        key: _key,\n                        title: _search.getSearchTitle(),\n                        className: _search.getBgClass()\n                    });\n                }).join(\"\")\n            );\n            _select.find(\"li\").click(function() {\n                var _el = Rkns.$(this);\n                _this.setSearchEngine(_el.attr(\"data-key\"));\n                _form.submit();\n            });\n            _form.submit(function() {\n                if (_input.val()) {\n                    var _search = _this.search_engine;\n                    _search.search(_input.val());\n                }\n                return false;\n            });\n            this.$.find(\".Rk-Search-Current\").mouseenter(\n                function() {\n                    _select.slideDown();\n                }\n            );\n            this.$.find(\".Rk-Search-Select\").mouseleave(\n                function() {\n                    _select.hide();\n                }\n            );\n            this.setSearchEngine(0);\n        }\n        _.each(this.options.bins, function(_bin) {\n            if (Rkns[_bin.type] && Rkns[_bin.type].Bin) {\n                _this.tabs.push(new Rkns[_bin.type].Bin(_this, _bin));\n            }\n        });\n\n        var elementDropped = false;\n\n        this.$.find(\".Rk-Bins\")\n            .on(\"click\", \".Rk-Bin-Title,.Rk-Bin-Title-Icon\", function() {\n                var _mainDiv = Rkns.$(this).siblings(\".Rk-Bin-Main\");\n                if (_mainDiv.is(\":hidden\")) {\n                    _this.$.find(\".Rk-Bin-Main\").slideUp();\n                    _mainDiv.slideDown();\n                }\n            });\n\n        if (this.options.show_editor) {\n\n            this.$.find(\".Rk-Bins\").on(\"mouseover\", \".Rk-Bin-Item\", function(_e) {\n                var _t = Rkns.$(this);\n                if (_t && $(_t).attr(\"data-uri\")) {\n                    var _models = _this.project.get(\"nodes\").where({\n                        uri: $(_t).attr(\"data-uri\")\n                    });\n                    _.each(_models, function(_model) {\n                        _this.renderer.highlightModel(_model);\n                    });\n                }\n            }).mouseout(function() {\n                _this.renderer.unhighlightAll();\n            }).on(\"mousemove\", \".Rk-Bin-Item\", function(e) {\n                try {\n                    this.dragDrop();\n                } catch (err) {}\n            }).on(\"touchstart\", \".Rk-Bin-Item\", function(e) {\n                elementDropped = false;\n            }).on(\"touchmove\", \".Rk-Bin-Item\", function(e) {\n                e.preventDefault();\n                var touch = e.originalEvent.changedTouches[0],\n                    off = _this.renderer.canvas_$.offset(),\n                    w = _this.renderer.canvas_$.width(),\n                    h = _this.renderer.canvas_$.height();\n                if (touch.pageX >= off.left && touch.pageX < (off.left + w) && touch.pageY >= off.top && touch.pageY < (off.top + h)) {\n                    if (elementDropped) {\n                        _this.renderer.onMouseMove(touch, true);\n                    } else {\n                        elementDropped = true;\n                        var div = document.createElement('div');\n                        div.appendChild(this.cloneNode(true));\n                        _this.renderer.dropData({\n                            \"text/html\": div.innerHTML\n                        }, touch);\n                        _this.renderer.onMouseDown(touch, true);\n                    }\n                }\n            }).on(\"touchend\", \".Rk-Bin-Item\", function(e) {\n                if (elementDropped) {\n                    _this.renderer.onMouseUp(e.originalEvent.changedTouches[0], true);\n                }\n                elementDropped = false;\n            }).on(\"dragstart\", \".Rk-Bin-Item\", function(e) {\n                var div = document.createElement('div');\n                div.appendChild(this.cloneNode(true));\n                try {\n                    e.originalEvent.dataTransfer.setData(\"text/html\", div.innerHTML);\n                } catch (err) {\n                    e.originalEvent.dataTransfer.setData(\"text\", div.innerHTML);\n                }\n            });\n\n        }\n\n        Rkns.$(window).resize(function() {\n            _this.resizeBins();\n        });\n\n        var lastsearch = false,\n            lastval = '';\n\n        this.$.find(\".Rk-Bins-Search-Input\").on(\"change keyup paste input\", function() {\n            var val = Rkns.$(this).val();\n            if (val === lastval) {\n                return;\n            }\n            var search = Rkns.Utils.regexpFromTextOrArray(val.length > 1 ? val : null);\n            if (search.source === lastsearch) {\n                return;\n            }\n            lastsearch = search.source;\n            _.each(_this.tabs, function(tab) {\n                tab.render(search);\n            });\n\n        });\n        this.$.find(\".Rk-Bins-Search-Form\").submit(function() {\n            return false;\n        });\n    };\n\n    Renkan.prototype.translate = function(_text) {\n        if (Rkns.i18n[this.options.language] && Rkns.i18n[this.options.language][_text]) {\n            return Rkns.i18n[this.options.language][_text];\n        }\n        if (this.options.language.length > 2 && Rkns.i18n[this.options.language.substr(0, 2)] && Rkns.i18n[this.options.language.substr(0, 2)][_text]) {\n            return Rkns.i18n[this.options.language.substr(0, 2)][_text];\n        }\n        return _text;\n    };\n\n    Renkan.prototype.onStatusChange = function() {\n        this.renderer.onStatusChange();\n    };\n\n    Renkan.prototype.setSearchEngine = function(_key) {\n        this.search_engine = this.search_engines[_key];\n        this.$.find(\".Rk-Search-Current\").attr(\"class\", \"Rk-Search-Current \" + this.search_engine.getBgClass());\n        var listClasses = this.search_engine.getBgClass().split(\" \");\n        var classes = \"\";\n        for (var i = 0; i < listClasses.length; i++) {\n            classes += \".\" + listClasses[i];\n        }\n        this.$.find(\".Rk-Web-Search-Input.Rk-Search-Input\").attr(\"placeholder\", this.translate(\"Search in \") + this.$.find(\".Rk-Search-List \" + classes).html());\n    };\n\n    Renkan.prototype.resizeBins = function() {\n        var _d = +this.$.find(\".Rk-Bins-Head\").outerHeight();\n        this.$.find(\".Rk-Bin-Title:visible\").each(function() {\n            _d += Rkns.$(this).outerHeight();\n        });\n        this.$.find(\".Rk-Bin-Main\").css({\n            height: this.$.find(\".Rk-Bins\").height() - _d\n        });\n    };\n\n    /* Utility functions */\n    var getUUID4 = function() {\n        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n            var r = Math.random() * 16 | 0,\n                v = c === 'x' ? r : (r & 0x3 | 0x8);\n            return v.toString(16);\n        });\n    };\n\n    Rkns.Utils = {\n        getUUID4: getUUID4,\n        getUID: (function() {\n            function pad(n) {\n                return n < 10 ? '0' + n : n;\n            }\n            var _d = new Date(),\n                ID_AUTO_INCREMENT = 0,\n                ID_BASE = _d.getUTCFullYear() + '-' +\n                pad(_d.getUTCMonth() + 1) + '-' +\n                pad(_d.getUTCDate()) + '-' +\n                getUUID4();\n            return function(_base) {\n                var _n = (++ID_AUTO_INCREMENT).toString(16),\n                    _uidbase = (typeof _base === \"undefined\" ? \"\" : _base + \"-\");\n                while (_n.length < 4) {\n                    _n = '0' + _n;\n                }\n                return _uidbase + ID_BASE + '-' + _n;\n            };\n        })(),\n        getFullURL: function(url) {\n\n            if (typeof(url) === 'undefined' || url == null) {\n                return \"\";\n            }\n            if (/https?:\\/\\//.test(url)) {\n                return url;\n            }\n            var img = new Image();\n            img.src = url;\n            var res = img.src;\n            img.src = null;\n            return res;\n\n        },\n        inherit: function(_baseClass, _callbefore) {\n\n            var _class = function(_arg) {\n                if (typeof _callbefore === \"function\") {\n                    _callbefore.apply(this, Array.prototype.slice.call(arguments, 0));\n                }\n                _baseClass.apply(this, Array.prototype.slice.call(arguments, 0));\n                if (typeof this._init === \"function\" && !this._initialized) {\n                    this._init.apply(this, Array.prototype.slice.call(arguments, 0));\n                    this._initialized = true;\n                }\n            };\n            _.extend(_class.prototype, _baseClass.prototype);\n\n            return _class;\n\n        },\n        regexpFromTextOrArray: (function() {\n            var charsub = [\n                    '[aáàâä]',\n                    '[cç]',\n                    '[eéèêë]',\n                    '[iíìîï]',\n                    '[oóòôö]',\n                    '[uùûü]'\n                ],\n                removeChars = [\n                    String.fromCharCode(768), String.fromCharCode(769), String.fromCharCode(770), String.fromCharCode(771), String.fromCharCode(807),\n                    \"{\", \"}\", \"(\", \")\", \"[\", \"]\", \"【\", \"】\", \"、\", \"・\", \"‥\", \"。\", \"「\", \"」\", \"『\", \"』\", \"〜\", \":\", \"!\", \"?\", \" \",\n                    \",\", \" \", \";\", \"(\", \")\", \".\", \"*\", \"+\", \"\\\\\", \"?\", \"|\", \"{\", \"}\", \"[\", \"]\", \"^\", \"#\", \"/\"\n                ],\n                remsrc = \"[\\\\\" + removeChars.join(\"\\\\\") + \"]\",\n                remrx = new RegExp(remsrc, \"gm\"),\n                charsrx = _.map(charsub, function(c) {\n                    return new RegExp(c);\n                });\n\n            function replaceText(_text) {\n                var txt = _text.toLowerCase().replace(remrx, \"\"),\n                    src = \"\";\n\n                function makeReplaceFunc(l) {\n                    return function(k, v) {\n                        l = l.replace(charsrx[k], v);\n                    };\n                }\n                for (var j = 0; j < txt.length; j++) {\n                    if (j) {\n                        src += remsrc + \"*\";\n                    }\n                    var l = txt[j];\n                    _.each(charsub, makeReplaceFunc(l));\n                    src += l;\n                }\n                return src;\n            }\n\n            function getSource(inp) {\n                switch (typeof inp) {\n                    case \"string\":\n                        return replaceText(inp);\n                    case \"object\":\n                        var src = '';\n                        _.each(inp, function(v) {\n                            var res = getSource(v);\n                            if (res) {\n                                if (src) {\n                                    src += '|';\n                                }\n                                src += res;\n                            }\n                        });\n                        return src;\n                }\n                return '';\n            }\n\n            return function(_textOrArray) {\n                var source = getSource(_textOrArray);\n                if (source) {\n                    var testrx = new RegExp(source, \"im\"),\n                        replacerx = new RegExp('(' + source + ')', \"igm\");\n                    return {\n                        isempty: false,\n                        source: source,\n                        test: function(_t) {\n                            return testrx.test(_t);\n                        },\n                        replace: function(_text, _replace) {\n                            return _text.replace(replacerx, _replace);\n                        }\n                    };\n                } else {\n                    return {\n                        isempty: true,\n                        source: '',\n                        test: function() {\n                            return true;\n                        },\n                        replace: function(_text) {\n                            return text;\n                        }\n                    };\n                }\n            };\n        })(),\n        /* The minimum distance (in pixels) the mouse has to move to consider an element was dragged */\n        _MIN_DRAG_DISTANCE: 2,\n        /* Distance between the inner and outer radius of buttons that appear when hovering on a node */\n        _NODE_BUTTON_WIDTH: 40,\n\n        _EDGE_BUTTON_INNER: 2,\n        _EDGE_BUTTON_OUTER: 40,\n        /* Constants used to know if a specific action is to be performed when clicking on the canvas */\n        _CLICKMODE_ADDNODE: 1,\n        _CLICKMODE_STARTEDGE: 2,\n        _CLICKMODE_ENDEDGE: 3,\n        /* Node size step: Used to calculate the size change when clicking the +/- buttons */\n        _NODE_SIZE_STEP: Math.LN2 / 4,\n        _MIN_SCALE: 1 / 20,\n        _MAX_SCALE: 20,\n        _MOUSEMOVE_RATE: 80,\n        _DOUBLETAP_DELAY: 800,\n        /* Maximum distance in pixels (squared, to reduce calculations)\n         * between two taps when double-tapping on a touch terminal */\n        _DOUBLETAP_DISTANCE: 20 * 20,\n        /* A placeholder so a default colour is displayed when a node has a null value for its user property */\n        _USER_PLACEHOLDER: function(_renkan) {\n            return {\n                color: _renkan.options.default_user_color,\n                title: _renkan.translate(\"(unknown user)\"),\n                get: function(attr) {\n                    return this[attr] || false;\n                }\n            };\n        },\n        /* The code for the \"Drag and Add Bookmarklet\", slightly minified and with whitespaces removed, though\n         * it doesn't seem that it's still a requirement in newer browsers (i.e. the ones compatibles with canvas drawing)\n         */\n        _BOOKMARKLET_CODE: function(_renkan) {\n            return \"(function(a,b,c,d,e,f,h,i,j,k,l,m,n,o,p,q,r){a=document;b=a.body;c=a.location.href;j='draggable';m='text/x-iri-';d=a.createElement('div');d.innerHTML='<p_style=\\\"position:fixed;top:0;right:0;font:bold_18px_sans-serif;color:#fff;background:#909;padding:10px;z-index:100000;\\\">\" +\n                _renkan.translate(\"Drag items from this website, drop them in Renkan\").replace(/ /g, \"_\") +\n                \"</p>'.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);})();\";\n        },\n        /* Shortens text to the required length then adds ellipsis */\n        shortenText: function(_text, _maxlength) {\n            return (_text.length > _maxlength ? (_text.substr(0, _maxlength) + '…') : _text);\n        },\n        /* Drawing an edit box with an arrow and positioning the edit box according to the position of the node/edge being edited\n         * Called by Rkns.Renderer.NodeEditor and Rkns.Renderer.EdgeEditor */\n        drawEditBox: function(_options, _coords, _path, _xmargin, _selector) {\n            _selector.css({\n                width: (_options.tooltip_width - 2 * _options.tooltip_padding)\n            });\n            var _height = _selector.outerHeight() + 2 * _options.tooltip_padding,\n                _isLeft = (_coords.x < paper.view.center.x ? 1 : -1),\n                _left = _coords.x + _isLeft * (_xmargin + _options.tooltip_arrow_length),\n                _right = _coords.x + _isLeft * (_xmargin + _options.tooltip_arrow_length + _options.tooltip_width),\n                _top = _coords.y - _height / 2;\n            if (_top + _height > (paper.view.size.height - _options.tooltip_margin)) {\n                _top = Math.max(paper.view.size.height - _options.tooltip_margin, _coords.y + _options.tooltip_arrow_width / 2) - _height;\n            }\n            if (_top < _options.tooltip_margin) {\n                _top = Math.min(_options.tooltip_margin, _coords.y - _options.tooltip_arrow_width / 2);\n            }\n            var _bottom = _top + _height;\n            /* jshint laxbreak:true */\n            _path.segments[0].point = _path.segments[7].point = _coords.add([_isLeft * _xmargin, 0]);\n            _path.segments[1].point.x = _path.segments[2].point.x = _path.segments[5].point.x = _path.segments[6].point.x = _left;\n            _path.segments[3].point.x = _path.segments[4].point.x = _right;\n            _path.segments[2].point.y = _path.segments[3].point.y = _top;\n            _path.segments[4].point.y = _path.segments[5].point.y = _bottom;\n            _path.segments[1].point.y = _coords.y - _options.tooltip_arrow_width / 2;\n            _path.segments[6].point.y = _coords.y + _options.tooltip_arrow_width / 2;\n            _path.fillColor = new paper.Color(new paper.Gradient([_options.tooltip_top_color, _options.tooltip_bottom_color]), [0, _top], [0, _bottom]);\n            _selector.css({\n                left: (_options.tooltip_padding + Math.min(_left, _right)),\n                top: (_options.tooltip_padding + _top)\n            });\n            return _path;\n        },\n        // from http://stackoverflow.com/a/6444043\n        increaseBrightness: function (hex, percent){\n            // strip the leading # if it's there\n            hex = hex.replace(/^\\s*#|\\s*$/g, '');\n\n            // convert 3 char codes --> 6, e.g. `E0F` --> `EE00FF`\n            if(hex.length === 3){\n                hex = hex.replace(/(.)/g, '$1$1');\n            }\n\n            var r = parseInt(hex.substr(0, 2), 16),\n                g = parseInt(hex.substr(2, 2), 16),\n                b = parseInt(hex.substr(4, 2), 16);\n\n            return '#' +\n               ((0|(1<<8) + r + (256 - r) * percent / 100).toString(16)).substr(1) +\n               ((0|(1<<8) + g + (256 - g) * percent / 100).toString(16)).substr(1) +\n               ((0|(1<<8) + b + (256 - b) * percent / 100).toString(16)).substr(1);\n        }\n    };\n})(window);\n\n/* END main.js */\n","(function(root) {\n    \"use strict\";\n    \n    var Backbone = root.Backbone;\n    \n    var Router = root.Rkns.Router = Backbone.Router.extend({\n        routes: {\n            '': 'index'\n        },\n        \n        index: function (parameters) {\n            \n            var result = {};\n            if (parameters !== null){\n                parameters.split(\"&\").forEach(function(part) {\n                    var item = part.split(\"=\");\n                    result[item[0]] = decodeURIComponent(item[1]);\n                });\n            }\n            this.trigger('router', result);        \n        }  \n    });\n\n})(window);","(function(root) {\n\n    \"use strict\";\n\n    var DataLoader = root.Rkns.DataLoader = {\n        converters: {\n            from1to2: function(data) {\n\n                var i, len;\n                if(typeof data.nodes !== 'undefined') {\n                    for(i=0, len=data.nodes.length; i<len; i++) {\n                        var node = data.nodes[i];\n                        if(node.color) {\n                            node.style = {\n                                color: node.color,\n                            };\n                        }\n                        else {\n                            node.style = {};\n                        }\n                    }\n                }\n                if(typeof data.edges !== 'undefined') {\n                    for(i=0, len=data.edges.length; i<len; i++) {\n                        var edge = data.edges[i];\n                        if(edge.color) {\n                            edge.style = {\n                                color: edge.color,\n                            };\n                        }\n                        else {\n                            edge.style = {};\n                        }\n                    }\n                }\n\n                data.schema_version = \"2\";\n\n                return data;\n            },\n        }\n    };\n\n\n    DataLoader.Loader = function(project, options) {\n        this.project = project;\n        this.dataConverters = _.defaults(options.converters || {}, DataLoader.converters);\n    };\n\n\n    DataLoader.Loader.prototype.convert = function(data) {\n        var schemaVersionFrom = this.project.getSchemaVersion(data);\n        var schemaVersionTo = this.project.getSchemaVersion();\n\n        if (schemaVersionFrom !== schemaVersionTo) {\n            var converterName = \"from\" + schemaVersionFrom + \"to\" + schemaVersionTo;\n            if (typeof this.dataConverters[converterName] === 'function') {\n                data = this.dataConverters[converterName](data);\n            }\n        }\n        return data;\n    };\n\n    DataLoader.Loader.prototype.load = function(data) {\n        this.project.set(this.convert(data), {\n            validate: true\n        });\n    };\n\n})(window);\n","(function(root) {\n    \"use strict\";\n\n    var Backbone = root.Backbone;\n\n    var Models = root.Rkns.Models = {};\n\n    Models.getUID = function(obj) {\n        var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,\n                function(c) {\n                    var r = Math.random() * 16 | 0, v = c === 'x' ? r\n                            : (r & 0x3 | 0x8);\n                    return v.toString(16);\n                });\n        if (typeof obj !== 'undefined') {\n            return obj.type + \"-\" + guid;\n        }\n        else {\n            return guid;\n        }\n    };\n\n    var RenkanModel = Backbone.RelationalModel.extend({\n        idAttribute : \"_id\",\n        constructor : function(options) {\n\n            if (typeof options !== \"undefined\") {\n                options._id = options._id || options.id || Models.getUID(this);\n                options.title = options.title || \"\";\n                options.description = options.description || \"\";\n                options.uri = options.uri || \"\";\n\n                if (typeof this.prepare === \"function\") {\n                    options = this.prepare(options);\n                }\n            }\n            Backbone.RelationalModel.prototype.constructor.call(this, options);\n        },\n        validate : function() {\n            if (!this.type) {\n                return \"object has no type\";\n            }\n        },\n        addReference : function(_options, _propName, _list, _id, _default) {\n            var _element = _list.get(_id);\n            if (typeof _element === \"undefined\" &&\n                typeof _default !== \"undefined\") {\n                _options[_propName] = _default;\n            }\n            else {\n                _options[_propName] = _element;\n            }\n        }\n    });\n\n    // USER\n    var User = Models.User = RenkanModel.extend({\n        type : \"user\",\n        prepare : function(options) {\n            options.color = options.color || \"#666666\";\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                title : this.get(\"title\"),\n                uri : this.get(\"uri\"),\n                description : this.get(\"description\"),\n                color : this.get(\"color\")\n            };\n        }\n    });\n\n    // NODE\n    var Node = Models.Node = RenkanModel.extend({\n        type : \"node\",\n        relations : [ {\n            type : Backbone.HasOne,\n            key : \"created_by\",\n            relatedModel : User\n        } ],\n        prepare : function(options) {\n            var project = options.project;\n            this.addReference(options, \"created_by\", project.get(\"users\"),\n                    options.created_by, project.current_user);\n            options.description = options.description || \"\";\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                title : this.get(\"title\"),\n                uri : this.get(\"uri\"),\n                description : this.get(\"description\"),\n                position : this.get(\"position\"),\n                image : this.get(\"image\"),\n                style : this.get(\"style\"),\n                created_by : this.get(\"created_by\") ? this.get(\"created_by\")\n                        .get(\"_id\") : null,\n                size : this.get(\"size\"),\n                clip_path : this.get(\"clip_path\"),\n                shape : this.get(\"shape\"),  \n                type : this.get(\"type\")\n            };\n        }\n    });\n\n    // EDGE\n    var Edge = Models.Edge = RenkanModel.extend({\n        type : \"edge\",\n        relations : [ {\n            type : Backbone.HasOne,\n            key : \"created_by\",\n            relatedModel : User\n        }, {\n            type : Backbone.HasOne,\n            key : \"from\",\n            relatedModel : Node\n        }, {\n            type : Backbone.HasOne,\n            key : \"to\",\n            relatedModel : Node\n        } ],\n        prepare : function(options) {\n            var project = options.project;\n            this.addReference(options, \"created_by\", project.get(\"users\"),\n                    options.created_by, project.current_user);\n            this.addReference(options, \"from\", project.get(\"nodes\"),\n                    options.from);\n            this.addReference(options, \"to\", project.get(\"nodes\"), options.to);\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                title : this.get(\"title\"),\n                uri : this.get(\"uri\"),\n                description : this.get(\"description\"),\n                from : this.get(\"from\") ? this.get(\"from\").get(\"_id\") : null,\n                to : this.get(\"to\") ? this.get(\"to\").get(\"_id\") : null,\n                style : this.get(\"style\"),\n                created_by : this.get(\"created_by\") ? this.get(\"created_by\")\n                        .get(\"_id\") : null\n            };\n        }\n    });\n\n    // View\n    var View = Models.View = RenkanModel.extend({\n        type : \"view\",\n        relations : [ {\n            type : Backbone.HasOne,\n            key : \"created_by\",\n            relatedModel : User\n        } ],\n        prepare : function(options) {\n            var project = options.project;\n            this.addReference(options, \"created_by\", project.get(\"users\"),\n                    options.created_by, project.current_user);\n            options.description = options.description || \"\";\n            if (typeof options.offset !== \"undefined\") {\n                var offset = {};\n                if (Array.isArray(options.offset)) {\n                    offset.x = options.offset[0];\n                    offset.y = options.offset.length > 1 ? options.offset[1]\n                            : options.offset[0];\n                }\n                else if (options.offset.x != null) {\n                    offset.x = options.offset.x;\n                    offset.y = options.offset.y;\n                }\n                options.offset = offset;\n            }\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                zoom_level : this.get(\"zoom_level\"),\n                offset : this.get(\"offset\"),\n                title : this.get(\"title\"),\n                description : this.get(\"description\"),\n                created_by : this.get(\"created_by\") ? this.get(\"created_by\")\n                        .get(\"_id\") : null,\n                hidden_nodes: this.get(\"hidden_nodes\")\n            // Don't need project id\n            };\n        }\n    });\n\n    // PROJECT\n    var Project = Models.Project = RenkanModel.extend({\n        schema_version : \"2\",\n        type : \"project\",\n        blacklist : [ 'saveStatus', 'loadingStatus'],\n        relations : [ {\n            type : Backbone.HasMany,\n            key : \"users\",\n            relatedModel : User,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        }, {\n            type : Backbone.HasMany,\n            key : \"nodes\",\n            relatedModel : Node,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        }, {\n            type : Backbone.HasMany,\n            key : \"edges\",\n            relatedModel : Edge,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        }, {\n            type : Backbone.HasMany,\n            key : \"views\",\n            relatedModel : View,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        } ],\n        addUser : function(_props, _options) {\n            _props.project = this;\n            var _user = User.findOrCreate(_props);\n            this.get(\"users\").push(_user, _options);\n            return _user;\n        },\n        addNode : function(_props, _options) {\n            _props.project = this;\n            var _node = Node.findOrCreate(_props);\n            this.get(\"nodes\").push(_node, _options);\n            return _node;\n        },\n        addEdge : function(_props, _options) {\n            _props.project = this;\n            var _edge = Edge.findOrCreate(_props);\n            this.get(\"edges\").push(_edge, _options);\n            return _edge;\n        },\n        addView : function(_props, _options) {\n            _props.project = this;\n            // TODO: check if need to replace with create only\n            var _view = View.findOrCreate(_props);\n            // TODO: Should we remember only one view?\n            this.get(\"views\").push(_view, _options);\n            return _view;\n        },\n        removeNode : function(_model) {\n            this.get(\"nodes\").remove(_model);\n        },\n        removeEdge : function(_model) {\n            this.get(\"edges\").remove(_model);\n        },\n        validate : function(options) {\n            var _project = this;\n            _.each(\n              [].concat(options.users, options.nodes, options.edges,options.views),\n              function(_item) {\n                if (_item) {\n                    _item.project = _project;\n                }\n              }\n            );\n        },\n        getSchemaVersion : function(data) {\n          var t = data;\n          if(typeof(t) === \"undefined\") {\n            t = this;\n          }\n          var version = t.schema_version;\n          if(!version) {\n            return 1;\n          }\n          else {\n            return version;\n          }\n        },\n        // Add event handler to remove edges when a node is removed\n        initialize : function() {\n            var _this = this;\n            this.on(\"remove:nodes\", function(_node) {\n                _this.get(\"edges\").remove(\n                        _this.get(\"edges\").filter(\n                                function(_edge) {\n                                    return _edge.get(\"from\") === _node ||\n                                           _edge.get(\"to\") === _node;\n                                }));\n            });\n        },\n        toJSON : function() {\n            var json = _.clone(this.attributes);\n            for ( var attr in json) {\n                if ((json[attr] instanceof Backbone.Model) ||\n                        (json[attr] instanceof Backbone.Collection) ||\n                        (json[attr] instanceof RenkanModel)) {\n                    json[attr] = json[attr].toJSON();\n                }\n            }\n            return _.omit(json, this.blacklist);\n        }\n    });\n\n    var RosterUser = Models.RosterUser = Backbone.Model\n            .extend({\n                type : \"roster_user\",\n                idAttribute : \"_id\",\n\n                constructor : function(options) {\n\n                    if (typeof options !== \"undefined\") {\n                        options._id = options._id ||\n                            options.id ||\n                            Models.getUID(this);\n                        options.title = options.title || \"(untitled \" + this.type + \")\";\n                        options.description = options.description || \"\";\n                        options.uri = options.uri || \"\";\n                        options.project = options.project || null;\n                        options.site_id = options.site_id || 0;\n\n                        if (typeof this.prepare === \"function\") {\n                            options = this.prepare(options);\n                        }\n                    }\n                    Backbone.Model.prototype.constructor.call(this, options);\n                },\n\n                validate : function() {\n                    if (!this.type) {\n                        return \"object has no type\";\n                    }\n                },\n\n                prepare : function(options) {\n                    options.color = options.color || \"#666666\";\n                    return options;\n                },\n\n                toJSON : function() {\n                    return {\n                        _id : this.get(\"_id\"),\n                        title : this.get(\"title\"),\n                        uri : this.get(\"uri\"),\n                        description : this.get(\"description\"),\n                        color : this.get(\"color\"),\n                        project : (this.get(\"project\") != null) ? this.get(\n                                \"project\").get(\"id\") : null,\n                        site_id : this.get(\"site_id\")\n                    };\n                }\n            });\n\n    var UsersList = Models.UsersList = Backbone.Collection.extend({\n        model : RosterUser\n    });\n\n})(window);\n","Rkns.defaults = {\n\n    language: (navigator.language || navigator.userLanguage || \"en\"),\n        /* GUI Language */\n    container: \"renkan\",\n        /* GUI Container DOM element ID */\n    search: [],\n        /* List of Search Engines */\n    bins: [],\n           /* List of Bins */\n    static_url: \"\",\n        /* URL for static resources */\n    popup_editor: true,\n        /* show the node editor as a popup inside the renkan view */\n    editor_panel: 'editor-panel',\n        /* GUI continer DOM element ID of the editor panel */\n    show_bins: true,\n        /* Show bins in left column */\n    properties: [],\n        /* Semantic properties for edges */\n    show_editor: true,\n        /* Show the graph editor... Setting this to \"false\" only shows the bins part ! */\n    read_only: false,\n        /* Allows editing of renkan without changing the rest of the GUI. Can be switched on/off on the fly to block/enable editing */\n    editor_mode: true,\n        /* Switch for Publish/Edit GUI. If editor_mode is false, read_only will be true.  */\n    manual_save: false,\n        /* In snapshot mode, clicking on the floppy will save a snapshot. Otherwise, it will show the connection status */\n    show_top_bar: true,\n        /* Show the top bar, (title, buttons, users) */\n    default_user_color: \"#303030\",\n    size_bug_fix: false,\n        /* Resize the canvas after load (fixes a bug on iPad and FF Mac) */\n    force_resize: false,\n    allow_double_click: true,\n        /* Allows Double Click to create a node on an empty background */\n    zoom_on_scroll: true,\n        /* Allows to use the scrollwheel to zoom */\n    element_delete_delay: 0,\n        /* Delay between clicking on the bin on an element and really deleting it\n           Set to 0 for delete confirm */\n    autoscale_padding: 50,\n    resize: true,\n\n    /* zoom options */\n    show_zoom: true,\n        /* show zoom buttons */\n    save_view: true,\n        /* show buttons to save view */\n    default_view: false,\n        /* Allows to load default view (zoom+offset) at start on read_only mode, instead of autoScale. the default_view will be the last */\n\n    /* URL parsing */\n    update_url:true,\n        /* update the url each time the paper shift or on zoom in/out, with the serialized view (offset and scale) */\n    \n\n    /* TOP BAR BUTTONS */\n    show_search_field: true,\n    show_user_list: true,\n    user_name_editable: true,\n    user_color_editable: true,\n    show_user_color: true,\n    show_save_button: true,\n    show_export_button: true,\n    show_open_button: false,\n    show_addnode_button: true,\n    show_addedge_button: true,\n    show_bookmarklet: true,\n    show_fullscreen_button: true,\n    home_button_url: false,\n    home_button_title: \"Home\",\n\n    /* MINI-MAP OPTIONS */\n\n    show_minimap: true,\n        /* Show a small map at the bottom right */\n    minimap_width: 160,\n    minimap_height: 120,\n    minimap_padding: 20,\n    minimap_background_color: \"#ffffff\",\n    minimap_border_color: \"#cccccc\",\n    minimap_highlight_color: \"#ffff00\",\n    minimap_highlight_weight: 5,\n\n\n    /* EDGE/NODE COMMON OPTIONS */\n\n    buttons_background: \"#202020\",\n    buttons_label_color: \"#c000c0\",\n    buttons_label_font_size: 9,\n\n    ghost_opacity : 0.3,\n        /* opacity when the hidden element is revealed */\n    default_dash_array : [4, 5],\n        /* dash line genometry */\n\n    /* NODE DISPLAY OPTIONS */\n\n    show_node_circles: true,\n        /* Show circles for nodes */\n    clip_node_images: true,\n        /* Constraint node images to circles */\n    node_images_fill_mode: false,\n        /* Set to false for \"letterboxing\" (height/width of node adapted to show full image)\n           Set to true for \"crop\" (adapted to fill circle) */\n    node_size_base: 25,\n    node_stroke_width: 2,\n    node_stroke_max_width: 12,\n    selected_node_stroke_width: 4,\n    selected_node_stroke_max_width: 24,\n    node_stroke_witdh_scale: 5,\n    node_fill_color: \"#ffffff\",\n    highlighted_node_fill_color: \"#ffff00\",\n    node_label_distance: 5,\n        /* Vertical distance between node and label */\n    node_label_max_length: 60,\n        /* Maximum displayed text length */\n    label_untitled_nodes: \"(untitled)\",\n        /* Label to display on untitled nodes */\n    hide_nodes: true,\n        /* allow hide/show nodes */\n    change_shapes: true,\n        /* Change shapes enabled */\n    change_types: true,\n    /* Change type enabled */\n\n    /* NODE EDITOR TEMPLATE*/\n\n    node_editor_templates: {\n        \"default\": \"templates/nodeeditor_readonly.html\",\n        \"video\": \"templates/nodeeditor_video.html\"\n    },\n\n    /* EDGE DISPLAY OPTIONS */\n\n    edge_stroke_width: 2,\n    edge_stroke_max_width: 12,\n    selected_edge_stroke_width: 4,\n    selected_edge_stroke_max_width: 24,\n    edge_stroke_witdh_scale: 5,\n\n    edge_label_distance: 0,\n    edge_label_max_length: 20,\n    edge_arrow_length: 18,\n    edge_arrow_width: 12,\n    edge_arrow_max_width: 32,\n    edge_gap_in_bundles: 12,\n    label_untitled_edges: \"\",\n\n    /* CONTEXTUAL DISPLAY (TOOLTIP OR EDITOR) OPTIONS */\n\n    tooltip_width: 275,\n    tooltip_padding: 10,\n    tooltip_margin: 15,\n    tooltip_arrow_length : 20,\n    tooltip_arrow_width : 40,\n    tooltip_top_color: \"#f0f0f0\",\n    tooltip_bottom_color: \"#d0d0d0\",\n    tooltip_border_color: \"#808080\",\n    tooltip_border_width: 1,\n    tooltip_opacity: 0.8,\n\n    richtext_editor_config: {\n        toolbarGroups: [\n            { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },\n            { name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },\n            '/',\n\t        { name: 'styles'},\n        ],\n        removePlugins : 'colorbutton,find,flash,font,forms,iframe,image,newpage,smiley,specialchar,stylescombo,templates',\n    },\n\n    /* NODE EDITOR OPTIONS */\n\n    show_node_editor_uri: true,\n    show_node_editor_title: true,\n    show_node_editor_description: true,\n    show_node_editor_description_richtext: true,\n    show_node_editor_title_richtext: true,\n    show_node_editor_size: true,\n    show_node_editor_style: true,\n    show_node_editor_style_color: true,\n    show_node_editor_style_dash: true,\n    show_node_editor_style_thickness: true,\n    show_node_editor_image: true,\n    show_node_editor_creator: true,\n    allow_image_upload: true,\n    uploaded_image_max_kb: 500,\n\n\n    /* NODE TOOLTIP OPTIONS */\n\n    show_node_tooltip_uri: true,\n    show_node_tooltip_description: true,\n    show_node_tooltip_color: true,\n    show_node_tooltip_image: true,\n    show_node_tooltip_creator: true,\n\n    /* EDGE EDITOR OPTIONS */\n\n    show_edge_editor_uri: true,\n    show_edge_editor_style: true,\n    show_edge_editor_style_color: true,\n    show_edge_editor_style_dash: true,\n    show_edge_editor_style_thickness: true,\n    show_edge_editor_style_arrow: true,\n    show_edge_editor_direction: true,\n    show_edge_editor_nodes: true,\n    show_edge_editor_creator: true,\n\n    /* EDGE TOOLTIP OPTIONS */\n\n    show_edge_tooltip_uri: true,\n    show_edge_tooltip_color: true,\n    show_edge_tooltip_nodes: true,\n    show_edge_tooltip_creator: true,\n\n};\n","Rkns.i18n = {\n    fr: {\n        \"Edit Node\": \"Édition d’un nœud\",\n        \"Edit Edge\": \"Édition d’un lien\",\n        \"Title:\": \"Titre :\",\n        \"URI:\": \"URI :\",\n        \"Description:\": \"Description :\",\n        \"From:\": \"De :\",\n        \"To:\": \"Vers :\",\n        \"Image\": \"Image\",\n        \"Image URL:\": \"URL d'Image\",\n        \"Choose Image File:\": \"Choisir un fichier image\",\n        \"Full Screen\": \"Mode plein écran\",\n        \"Add Node\": \"Ajouter un nœud\",\n        \"Add Edge\": \"Ajouter un lien\",\n        \"Save Project\": \"Enregistrer le projet\",\n        \"Open Project\": \"Ouvrir un projet\",\n        \"Auto-save enabled\": \"Enregistrement automatique activé\",\n        \"Connection lost\": \"Connexion perdue\",\n        \"Created by:\": \"Créé par :\",\n        \"Zoom In\": \"Agrandir l’échelle\",\n        \"Zoom Out\": \"Rapetisser l’échelle\",\n        \"Edit\": \"Éditer\",\n        \"Remove\": \"Supprimer\",\n        \"Cancel deletion\": \"Annuler la suppression\",\n        \"Link to another node\": \"Créer un lien\",\n        \"Enlarge\": \"Agrandir\",\n        \"Shrink\": \"Rétrécir\",\n        \"Click on the background canvas to add a node\": \"Cliquer sur le fond du graphe pour rajouter un nœud\",\n        \"Click on a first node to start the edge\": \"Cliquer sur un premier nœud pour commencer le lien\",\n        \"Click on a second node to complete the edge\": \"Cliquer sur un second nœud pour terminer le lien\",\n        \"Wikipedia\": \"Wikipédia\",\n        \"Wikipedia in \": \"Wikipédia en \",\n        \"French\": \"Français\",\n        \"English\": \"Anglais\",\n        \"Japanese\": \"Japonais\",\n        \"Untitled project\": \"Projet sans titre\",\n        \"Lignes de Temps\": \"Lignes de Temps\",\n        \"Loading, please wait\": \"Chargement en cours, merci de patienter\",\n        \"Edge color:\": \"Couleur :\",\n        \"Dash:\": \"Point. :\",\n        \"Thickness:\": \"Epaisseur :\",\n        \"Arrow:\": \"Flèche :\",\n        \"Node color:\": \"Couleur :\",\n        \"Choose color\": \"Choisir une couleur\",\n        \"Change edge direction\": \"Changer le sens du lien\",\n        \"Do you really wish to remove node \": \"Voulez-vous réellement supprimer le nœud \",\n        \"Do you really wish to remove edge \": \"Voulez-vous réellement supprimer le lien \",\n        \"This file is not an image\": \"Ce fichier n'est pas une image\",\n        \"Image size must be under \": \"L'image doit peser moins de \",\n        \"Size:\": \"Taille :\",\n        \"KB\": \"ko\",\n        \"Choose from vocabulary:\": \"Choisir dans un vocabulaire :\",\n        \"SKOS Documentation properties\": \"SKOS: Propriétés documentaires\",\n        \"has note\": \"a pour note\",\n        \"has example\": \"a pour exemple\",\n        \"has definition\": \"a pour définition\",\n        \"SKOS Semantic relations\": \"SKOS: Relations sémantiques\",\n        \"has broader\": \"a pour concept plus large\",\n        \"has narrower\": \"a pour concept plus étroit\",\n        \"has related\": \"a pour concept apparenté\",\n        \"Dublin Core Metadata\": \"Métadonnées Dublin Core\",\n        \"has contributor\": \"a pour contributeur\",\n        \"covers\": \"couvre\",\n        \"created by\": \"créé par\",\n        \"has date\": \"a pour date\",\n        \"published by\": \"édité par\",\n        \"has source\": \"a pour source\",\n        \"has subject\": \"a pour sujet\",\n        \"Dragged resource\": \"Ressource glisée-déposée\",\n        \"Search the Web\": \"Rechercher en ligne\",\n        \"Search in Bins\": \"Rechercher dans les chutiers\",\n        \"Close bin\": \"Fermer le chutier\",\n        \"Refresh bin\": \"Rafraîchir le chutier\",\n        \"(untitled)\": \"(sans titre)\",\n        \"Select contents:\": \"Sélectionner des contenus :\",\n        \"Drag items from this website, drop them in Renkan\": \"Glissez des éléments de ce site web vers Renkan\",\n        \"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\",\n        \"Shapes available\": \"Formes disponibles\",\n        \"Circle\": \"Cercle\",\n        \"Square\": \"Carré\",\n        \"Diamond\": \"Losange\",\n        \"Hexagone\": \"Hexagone\",\n        \"Ellipse\": \"Ellipse\",\n        \"Star\": \"Étoile\",\n        \"Cloud\": \"Nuage\",\n        \"Triangle\": \"Triangle\",\n        \"Zoom Fit\": \"Ajuster le Zoom\",\n        \"Download Project\": \"Télécharger le projet\",\n        \"Save view\": \"Sauver la vue\",\n        \"View saved view\": \"Restaurer la Vue\",\n        \"Renkan \\'Drag-to-Add\\' bookmarklet\": \"Renkan \\'Deplacer-Pour-Ajouter\\' Signet\",\n        \"(unknown user)\":\"(non authentifié)\",\n        \"<unknown user>\":\"<non authentifié>\",\n        \"Search in graph\":\"Rechercher dans carte\",\n        \"Search in \" : \"Chercher dans \"\n    }\n};\n","/* Saves the Full JSON at each modification */\n\nRkns.jsonIO = function(_renkan, _opts) {\n    var _proj = _renkan.project;\n    if (typeof _opts.http_method === \"undefined\") {\n        _opts.http_method = 'PUT';\n    }\n    var _load = function() {\n        _renkan.renderer.redrawActive = false;\n        _proj.set({\n            loadingStatus : true\n        });\n        Rkns.$.getJSON(_opts.url, function(_data) {\n            _renkan.dataloader.load(_data);\n            _proj.set({\n                loadingStatus : false\n            });\n            _proj.set({\n                saveStatus : 0\n            });\n            _renkan.renderer.redrawActive = true;\n        });\n    };\n    var _save = function() {\n        _proj.set({\n            saveStatus : 2\n        });\n        var _data = _proj.toJSON();\n        if (!_renkan.read_only) {\n            Rkns.$.ajax({\n                type : _opts.http_method,\n                url : _opts.url,\n                contentType : \"application/json\",\n                data : JSON.stringify(_data),\n                success : function(data, textStatus, jqXHR) {\n                    _proj.set({\n                        saveStatus : 0\n                    });\n                }\n            });\n        }\n\n    };\n    var _thrSave = Rkns._.throttle(function() {\n        setTimeout(_save, 100);\n    }, 1000);\n    \n    //TODO: Rearrange to avoid the 2 firts PUT due to a change in the project model\n    // Take car of setting up the listener correctly to listen the save action on the view\n    _proj.on(\"add:nodes add:edges add:users add:views\", function(_model) {\n        _model.on(\"change remove\", function(_model) {\n            _thrSave();\n        });\n        _thrSave();\n    });\n    _proj.on(\"change\", function() {\n        if (!(_proj.changedAttributes.length === 1 && _proj\n                .hasChanged('saveStatus'))) {\n            _thrSave();\n        }\n    });\n\n    _load();\n};\n","/* Saves the Full JSON once */\n\nRkns.jsonIOSaveOnClick = function(_renkan, _opts) {\n    var _proj = _renkan.project,\n        _saveWarn = false,\n        _onLeave = function() {\n            return \"Project not saved\";\n        };\n    if (typeof _opts.http_method === \"undefined\") {\n        _opts.http_method = 'POST';\n    }\n    var _load = function() {\n        var getdata = {},\n            rx = /id=([^&#?=]+)/,\n            matches = document.location.hash.match(rx);\n        if (matches) {\n            getdata.id = matches[1];\n        }\n        Rkns.$.ajax({\n            url: _opts.url,\n            data: getdata,\n            beforeSend: function(){\n                _renkan.renderer.redrawActive = false;\n            \t_proj.set({loadingStatus:true});\n            },\n            success: function(_data) {\n                _renkan.dataloader.load(_data);\n                _proj.set({loadingStatus:false});\n                _proj.set({saveStatus:0});\n                _renkan.renderer.redrawActive = true;\n            }\n        });\n    };\n    var _save = function() {\n        _proj.set(\"saved_at\", new Date());\n        var _data = _proj.toJSON();\n        Rkns.$.ajax({\n            type: _opts.http_method,\n            url: _opts.url,\n            contentType: \"application/json\",\n            data: JSON.stringify(_data),\n            beforeSend: function(){\n            \t_proj.set({saveStatus:2});\n            },\n            success: function(data, textStatus, jqXHR) {\n                $(window).off(\"beforeunload\", _onLeave);\n                _saveWarn = false;\n                _proj.set({saveStatus:0});\n                //document.location.hash = \"#id=\" + data.id;\n                //$(\".Rk-Notifications\").text(\"Saved as \"+document.location.href).fadeIn().delay(2000).fadeOut();\n            }\n        });\n    };\n    var _checkLeave = function() {\n    \t_proj.set({saveStatus:1});\n\n        var title = _proj.get(\"title\");\n        if (title && _proj.get(\"nodes\").length) {\n            $(\".Rk-Save-Button\").removeClass(\"disabled\");\n        } else {\n            $(\".Rk-Save-Button\").addClass(\"disabled\");\n        }\n        if (title) {\n            $(\".Rk-PadTitle\").css(\"border-color\",\"#333333\");\n        }\n        if (!_saveWarn) {\n            _saveWarn = true;\n            $(window).on(\"beforeunload\", _onLeave);\n        }\n    };\n    _load();\n    _proj.on(\"add:nodes add:edges add:users change\", function(_model) {\n\t    _model.on(\"change remove\", function(_model) {\n\t    \tif(!(_model.changedAttributes.length === 1 && _model.hasChanged('saveStatus'))) {\n\t    \t\t_checkLeave();\n\t    \t}\n\t    });\n\t\tif(!(_proj.changedAttributes.length === 1 && _proj.hasChanged('saveStatus'))) {\n\t\t    _checkLeave();\n    \t}\n    });\n    _renkan.renderer.save = function() {\n        if ($(\".Rk-Save-Button\").hasClass(\"disabled\")) {\n            if (!_proj.get(\"title\")) {\n                $(\".Rk-PadTitle\").css(\"border-color\",\"#ff0000\");\n            }\n        } else {\n            _save();\n        }\n    };\n};\n","(function(Rkns) {\n\"use strict\";\n\nvar _ = Rkns._;\n\nvar Ldt = Rkns.Ldt = {};\n\nvar Bin = Ldt.Bin = function(_renkan, _opts) {\n    if (_opts.ldt_type) {\n        var Resclass = Ldt[_opts.ldt_type+\"Bin\"];\n        if (Resclass) {\n            return new Resclass(_renkan, _opts);\n        }\n    }\n    console.error(\"No such LDT Bin Type\");\n};\n\nvar ProjectBin = Ldt.ProjectBin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nProjectBin.prototype.tagTemplate = renkanJST['templates/ldtjson-bin/tagtemplate.html'];\n\nProjectBin.prototype.annotationTemplate = renkanJST['templates/ldtjson-bin/annotationtemplate.html'];\n\nProjectBin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.proj_id = _opts.project_id;\n    this.ldt_platform = _opts.ldt_platform || \"http://ldt.iri.centrepompidou.fr/\";\n    this.title_$.html(_opts.title);\n    this.title_icon_$.addClass('Rk-Ldt-Title-Icon');\n    this.refresh();\n};\n\nProjectBin.prototype.render = function(searchbase) {\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    function highlight(_text) {\n        var _e = _(_text).escape();\n        return search.isempty ? _e : search.replace(_e, \"<span class='searchmatch'>$1</span>\");\n    }\n    function convertTC(_ms) {\n        function pad(_n) {\n            var _res = _n.toString();\n            while (_res.length < 2) {\n                _res = '0' + _res;\n            }\n            return _res;\n        }\n        var _totalSeconds = Math.abs(Math.floor(_ms/1000)),\n            _hours = Math.floor(_totalSeconds / 3600),\n            _minutes = (Math.floor(_totalSeconds / 60) % 60),\n            _seconds = _totalSeconds % 60,\n            _res = '';\n        if (_hours) {\n            _res += pad(_hours) + ':';\n        }\n        _res += pad(_minutes) + ':' + pad(_seconds);\n        return _res;\n    }\n\n    var _html = '<li><h3>Tags</h3></li>',\n        _projtitle = this.data.meta[\"dc:title\"],\n        _this = this,\n        count = 0;\n    _this.title_$.text('LDT Project: \"' + _projtitle + '\"');\n    _.map(_this.data.tags,function(_tag) {\n        var _title = _tag.meta[\"dc:title\"];\n        if (!search.isempty && !search.test(_title)) {\n            return;\n        }\n        count++;\n        _html += _this.tagTemplate({\n            ldt_platform: _this.ldt_platform,\n            title: _title,\n            htitle: highlight(_title),\n            encodedtitle : encodeURIComponent(_title),\n            static_url: _this.renkan.options.static_url\n        });\n    });\n    _html += '<li><h3>Annotations</h3></li>';\n    _.map(_this.data.annotations,function(_annotation) {\n        var _description = _annotation.content.description,\n            _title = _annotation.content.title.replace(_description,\"\");\n        if (!search.isempty && !search.test(_title) && !search.test(_description)) {\n            return;\n        }\n        count++;\n        var _duration = _annotation.end - _annotation.begin,\n            _img = (\n                (_annotation.content && _annotation.content.img && _annotation.content.img.src) ?\n                  _annotation.content.img.src :\n                  ( _duration ? _this.renkan.options.static_url+\"img/ldt-segment.png\" : _this.renkan.options.static_url+\"img/ldt-point.png\" )\n            );\n        _html += _this.annotationTemplate({\n            ldt_platform: _this.ldt_platform,\n            title: _title,\n            htitle: highlight(_title),\n            description: _description,\n            hdescription: highlight(_description),\n            start: convertTC(_annotation.begin),\n            end: convertTC(_annotation.end),\n            duration: convertTC(_duration),\n            mediaid: _annotation.media,\n            annotationid: _annotation.id,\n            image: _img,\n            static_url: _this.renkan.options.static_url\n        });\n    });\n\n    this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nProjectBin.prototype.refresh = function() {\n    var _this = this;\n    Rkns.$.ajax({\n        url: this.ldt_platform + 'ldtplatform/ldt/cljson/id/' + this.proj_id,\n        dataType: \"jsonp\",\n        success: function(_data) {\n            _this.data = _data;\n            _this.render();\n        }\n    });\n};\n\nvar Search = Ldt.Search = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.lang = _opts.lang || \"en\";\n};\n\nSearch.prototype.getBgClass = function() {\n    return \"Rk-Ldt-Icon\";\n};\n\nSearch.prototype.getSearchTitle = function() {\n    return this.renkan.translate(\"Lignes de Temps\");\n};\n\nSearch.prototype.search = function(_q) {\n    this.renkan.tabs.push(\n        new ResultsBin(this.renkan, {\n            search: _q\n        })\n    );\n};\n\nvar ResultsBin = Ldt.ResultsBin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nResultsBin.prototype.segmentTemplate = renkanJST['templates/ldtjson-bin/segmenttemplate.html'];\n\nResultsBin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.ldt_platform = _opts.ldt_platform || \"http://ldt.iri.centrepompidou.fr/\";\n    this.max_results = _opts.max_results || 50;\n    this.search = _opts.search;\n    this.title_$.html('Lignes de Temps: \"' + _opts.search + '\"');\n    this.title_icon_$.addClass('Rk-Ldt-Title-Icon');\n    this.refresh();\n};\n\nResultsBin.prototype.render = function(searchbase) {\n    if (!this.data) {\n        return;\n    }\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    var highlightrx = (search.isempty ? Rkns.Utils.regexpFromTextOrArray(this.search) : search);\n    function highlight(_text) {\n        return highlightrx.replace(_(_text).escape(), \"<span class='searchmatch'>$1</span>\");\n    }\n    function convertTC(_ms) {\n        function pad(_n) {\n            var _res = _n.toString();\n            while (_res.length < 2) {\n                _res = '0' + _res;\n            }\n            return _res;\n        }\n        var _totalSeconds = Math.abs(Math.floor(_ms/1000)),\n            _hours = Math.floor(_totalSeconds / 3600),\n            _minutes = (Math.floor(_totalSeconds / 60) % 60),\n            _seconds = _totalSeconds % 60,\n            _res = '';\n        if (_hours) {\n            _res += pad(_hours) + ':';\n        }\n        _res += pad(_minutes) + ':' + pad(_seconds);\n        return _res;\n    }\n\n    var _html = '',\n        _this = this,\n        count = 0;\n    _.each(this.data.objects,function(_segment) {\n        var _description = _segment.abstract,\n            _title = _segment.title;\n        if (!search.isempty && !search.test(_title) && !search.test(_description)) {\n            return;\n        }\n        count++;\n        var _duration = _segment.duration,\n            _begin = _segment.start_ts,\n            _end = + _segment.duration + _begin,\n            _img = (\n                _duration ?\n                  _this.renkan.options.static_url + \"img/ldt-segment.png\" :\n                  _this.renkan.options.static_url + \"img/ldt-point.png\"\n            );\n        _html += _this.segmentTemplate({\n            ldt_platform: _this.ldt_platform,\n            title: _title,\n            htitle: highlight(_title),\n            description: _description,\n            hdescription: highlight(_description),\n            start: convertTC(_begin),\n            end: convertTC(_end),\n            duration: convertTC(_duration),\n            mediaid: _segment.iri_id,\n            //projectid: _segment.project_id,\n            //cuttingid: _segment.cutting_id,\n            annotationid: _segment.element_id,\n            image: _img\n        });\n    });\n\n    this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nResultsBin.prototype.refresh = function() {\n    var _this = this;\n    Rkns.$.ajax({\n        url: this.ldt_platform + 'ldtplatform/api/ldt/1.0/segments/search/',\n        data: {\n            format: \"jsonp\",\n            q: this.search,\n            limit: this.max_results\n        },\n        dataType: \"jsonp\",\n        success: function(_data) {\n            _this.data = _data;\n            _this.render();\n        }\n    });\n};\n\n})(window.Rkns);\n","Rkns.ResourceList = {};\n\nRkns.ResourceList.Bin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nRkns.ResourceList.Bin.prototype.resultTemplate = renkanJST['templates/list-bin.html'];\n\nRkns.ResourceList.Bin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.title_$.html(_opts.title);\n    if (_opts.list) {\n        this.data = _opts.list;\n    }\n    this.refresh();\n};\n\nRkns.ResourceList.Bin.prototype.render = function(searchbase) {\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    function highlight(_text) {\n        var _e = _(_text).escape();\n        return search.isempty ? _e : search.replace(_e, \"<span class='searchmatch'>$1</span>\");\n    }\n    var _html = \"\",\n        _this = this,\n        count = 0;\n    Rkns._.each(this.data,function(_item) {\n        var _element;\n        if (typeof _item === \"string\") {\n            if (/^(https?:\\/\\/|www)/.test(_item)) {\n                _element = { url: _item };\n            } else {\n                _element = { title: _item.replace(/[:,]?\\s?(https?:\\/\\/|www)[\\d\\w\\/.&?=#%-_]+\\s?/,'').trim() };\n                var _match = _item.match(/(https?:\\/\\/|www)[\\d\\w\\/.&?=#%-_]+/);\n                if (_match) {\n                    _element.url = _match[0];\n                }\n                if (_element.title.length > 80) {\n                    _element.description = _element.title;\n                    _element.title = _element.title.replace(/^(.{30,60})\\s.+$/,'$1…');\n                }\n            }\n        } else {\n            _element = _item;\n        }\n        var title = _element.title || (_element.url || \"\").replace(/^https?:\\/\\/(www\\.)?/,'').replace(/^(.{40}).+$/,'$1…'),\n            url = _element.url || \"\",\n            description = _element.description || \"\",\n            image = _element.image || \"\";\n        if (url && !/^https?:\\/\\//.test(url)) {\n            url = 'http://' + url;\n        }\n        if (!search.isempty && !search.test(title) && !search.test(description)) {\n            return;\n        }\n        count++;\n        _html += _this.resultTemplate({\n            url: url,\n            title: title,\n            htitle: highlight(title),\n            image: image,\n            description: description,\n            hdescription: highlight(description),\n            static_url: _this.renkan.options.static_url\n        });\n    });\n    _this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nRkns.ResourceList.Bin.prototype.refresh = function() {\n    if (this.data) {\n        this.render();\n    }\n};\n","Rkns.Wikipedia = {\n};\n\nRkns.Wikipedia.Search = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.lang = _opts.lang || \"en\";\n};\n\nRkns.Wikipedia.Search.prototype.getBgClass = function() {\n    return \"Rk-Wikipedia-Search-Icon Rk-Wikipedia-Lang-\" + this.lang;\n};\n\nRkns.Wikipedia.Search.prototype.getSearchTitle = function() {\n    var langs = {\n        \"fr\": \"French\",\n        \"en\": \"English\",\n        \"ja\": \"Japanese\"\n    };\n    if (langs[this.lang]) {\n        return this.renkan.translate(\"Wikipedia in \") + this.renkan.translate(langs[this.lang]);\n    } else {\n        return this.renkan.translate(\"Wikipedia\") + \" [\" + this.lang + \"]\";\n    }\n};\n\nRkns.Wikipedia.Search.prototype.search = function(_q) {\n    this.renkan.tabs.push(\n        new Rkns.Wikipedia.Bin(this.renkan, {\n            lang: this.lang,\n            search: _q\n        })\n    );\n};\n\nRkns.Wikipedia.Bin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nRkns.Wikipedia.Bin.prototype.resultTemplate = renkanJST['templates/wikipedia-bin/resulttemplate.html'];\n\nRkns.Wikipedia.Bin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.search = _opts.search;\n    this.lang = _opts.lang || \"en\";\n    this.title_icon_$.addClass('Rk-Wikipedia-Title-Icon Rk-Wikipedia-Lang-' + this.lang);\n    this.title_$.html(this.search).addClass(\"Rk-Wikipedia-Title\");\n    this.refresh();\n};\n\nRkns.Wikipedia.Bin.prototype.render = function(searchbase) {\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    var highlightrx = (search.isempty ? Rkns.Utils.regexpFromTextOrArray(this.search) : search);\n    function highlight(_text) {\n        return highlightrx.replace(_(_text).escape(), \"<span class='searchmatch'>$1</span>\");\n    }\n    var _html = \"\",\n        _this = this,\n        count = 0;\n    Rkns._.each(this.data.query.search, function(_result) {\n        var title = _result.title,\n            url = \"http://\" + _this.lang + \".wikipedia.org/wiki/\" + encodeURI(title.replace(/ /g,\"_\")),\n            description = Rkns.$('<div>').html(_result.snippet).text();\n        if (!search.isempty && !search.test(title) && !search.test(description)) {\n            return;\n        }\n        count++;\n        _html += _this.resultTemplate({\n            url: url,\n            title: title,\n            htitle: highlight(title),\n            description: description,\n            hdescription: highlight(description),\n            static_url: _this.renkan.options.static_url\n        });\n    });\n    _this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nRkns.Wikipedia.Bin.prototype.refresh = function() {\n    var _this = this;\n    Rkns.$.ajax({\n        url: \"http://\" + _this.lang + \".wikipedia.org/w/api.php?action=query&list=search&srsearch=\" + encodeURIComponent(this.search) + \"&format=json\",\n        dataType: \"jsonp\",\n        success: function(_data) {\n            _this.data = _data;\n            _this.render();\n        }\n    });\n};\n","\ndefine('renderer/baserepresentation',['jquery', 'underscore'], function ($, _) {\n    \n\n    /* Rkns.Renderer._BaseRepresentation Class */\n\n    /* In Renkan, a \"Representation\" is a sort of ViewModel (in the MVVM paradigm) and bridges the gap between\n     * models (written with Backbone.js) and the view (written with Paper.js)\n     * Renkan's representations all inherit from Rkns.Renderer._BaseRepresentation '*/\n\n    var _BaseRepresentation = function(_renderer, _model) {\n        if (typeof _renderer !== \"undefined\") {\n            this.renderer = _renderer;\n            this.renkan = _renderer.renkan;\n            this.project = _renderer.renkan.project;\n            this.options = _renderer.renkan.options;\n            this.model = _model;\n            if (this.model) {\n                var _this = this;\n                this._changeBinding = function() {\n                    _this.redraw({change: true});\n                };\n                this._removeBinding = function() {\n                    _renderer.removeRepresentation(_this);\n                    _.defer(function() {\n                        _renderer.redraw();\n                    });\n                };\n                this._selectBinding = function() {\n                    _this.select();\n                };\n                this._unselectBinding = function() {\n                    _this.unselect();\n                };\n                this.model.on(\"change\", this._changeBinding );\n                this.model.on(\"remove\", this._removeBinding );\n                this.model.on(\"select\", this._selectBinding );\n                this.model.on(\"unselect\", this._unselectBinding );\n            }\n        }\n    };\n\n    /* Rkns.Renderer._BaseRepresentation Methods */\n\n    _(_BaseRepresentation.prototype).extend({\n        _super: function(_func) {\n            return _BaseRepresentation.prototype[_func].apply(this, Array.prototype.slice.call(arguments, 1));\n        },\n        redraw: function() {},\n        moveTo: function() {},\n        show: function() { return \"BaseRepresentation.show\"; },\n        hide: function() {},\n        select: function() {\n            if (this.model) {\n                this.model.trigger(\"selected\");\n            }\n        },\n        unselect: function() {\n            if (this.model) {\n                this.model.trigger(\"unselected\");\n            }\n        },\n        highlight: function() {},\n        unhighlight: function() {},\n        mousedown: function() {},\n        mouseup: function() {\n            if (this.model) {\n                this.model.trigger(\"clicked\");\n            }\n        },\n        destroy: function() {\n            if (this.model) {\n                this.model.off(\"change\", this._changeBinding );\n                this.model.off(\"remove\", this._removeBinding );\n                this.model.off(\"select\", this._selectBinding );\n                this.model.off(\"unselect\", this._unselectBinding );\n            }\n        }\n    }).value();\n\n    /* End of Rkns.Renderer._BaseRepresentation Class */\n\n    return _BaseRepresentation;\n\n});\n\ndefine('requtils',[], function ($, _) {\n    \n    return {\n        getUtils: function(){\n            return window.Rkns.Utils;\n        },\n        getRenderer: function(){\n            return window.Rkns.Renderer;\n        }\n    };\n\n});\n\n\ndefine('renderer/basebutton',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* Rkns.Renderer._BaseButton Class */\n\n    /* BaseButton is extended by contextual buttons that appear when hovering on nodes and edges */\n\n    var _BaseButton = Utils.inherit(BaseRepresentation);\n\n    _(_BaseButton.prototype).extend({\n        moveTo: function(_pos) {\n            this.sector.moveTo(_pos);\n        },\n        show: function() {\n            this.sector.show();\n        },\n        hide: function() {\n            if (this.sector){\n                this.sector.hide();                \n            }\n        },\n        select: function() {\n            this.sector.select();\n        },\n        unselect: function(_newTarget) {\n            this.sector.unselect();\n            if (!_newTarget || (_newTarget !== this.source_representation && _newTarget.source_representation !== this.source_representation)) {\n                this.source_representation.unselect();\n            }\n        },\n        destroy: function() {\n            this.sector.destroy();\n        }\n    }).value();\n\n    return _BaseButton;\n\n});\n\n\ndefine('renderer/shapebuilder',[], function () {\n    \n\n    var cloud_path = \"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\";\n    /* ShapeBuilder Begin */\n\n    var builders = {\n        \"circle\":{\n            getShape: function() {\n                return new paper.Path.Circle([0, 0], 1);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Circle(center, radius);\n            }\n        },\n        \"rectangle\":{\n            getShape: function() {\n                return new paper.Path.Rectangle([-2, -2], [2, 2]);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Rectangle([-radius, -radius], [radius*2, radius*2]);\n            }\n        },\n        \"ellipse\":{\n            getShape: function() {\n                return new paper.Path.Ellipse(new paper.Rectangle([-2, -1], [2, 1]));\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Ellipse(new paper.Rectangle([-radius, -radius/2], [radius*2, radius]));\n            }\n        },\n        \"polygon\":{\n            getShape: function() {\n                return new paper.Path.RegularPolygon([0, 0], 6, 1);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.RegularPolygon(center, 6, radius);\n            }\n        },\n        \"diamond\":{\n            getShape: function() {\n                var d = new paper.Path.Rectangle([-Math.SQRT2, -Math.SQRT2], [Math.SQRT2, Math.SQRT2]);\n                d.rotate(45);\n                return d;\n            },\n            getImageShape: function(center, radius) {\n                var d = new paper.Path.Rectangle([-radius*Math.SQRT2/2, -radius*Math.SQRT2/2], [radius*Math.SQRT2, radius*Math.SQRT2]);\n                d.rotate(45);\n                return d;\n            }\n        },\n        \"star\":{\n            getShape: function() {\n                return new paper.Path.Star([0, 0], 8, 1, 0.7);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Star(center, 8, radius*1, radius*0.7);\n            }\n        },\n        \"cloud\": {\n            getShape: function() {\n                var path = new paper.Path(cloud_path);\n                return path;\n\n            },\n            getImageShape: function(center, radius) {\n                var path = new paper.Path(cloud_path);\n                path.scale(radius);\n                path.translate(center);\n                return path;\n            }\n        },\n        \"triangle\": {\n            getShape: function() {\n                return new paper.Path.RegularPolygon([0,0], 3, 1);\n            },\n            getImageShape: function(center, radius) {\n                var shape = new paper.Path.RegularPolygon([0,0], 3, 1);\n                shape.scale(radius);\n                shape.translate(center);\n                return shape;\n            }\n        },\n        \"svg\": function(path){\n            return {\n                getShape: function() {\n                    return new paper.Path(path);\n                },\n                getImageShape: function(center, radius) {\n                    // No calcul for the moment\n                    return new paper.Path();\n                }\n            };\n        }\n    };\n\n    var ShapeBuilder = function (shape){\n        if(shape === null || typeof shape === \"undefined\"){\n            shape = \"circle\";\n        }\n        if(shape.substr(0,4)===\"svg:\"){\n            return builders.svg(shape.substr(4));\n        }\n        if(!(shape in builders)){\n            shape = \"circle\";\n        }\n        return builders[shape];\n    };\n\n    ShapeBuilder.builders = builders;\n\n    return ShapeBuilder;\n\n});\n\ndefine('renderer/noderepr',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation', 'renderer/shapebuilder'], function ($, _, requtils, BaseRepresentation, ShapeBuilder) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* Rkns.Renderer.Node Class */\n\n    /* The representation for the node : A circle, with an image inside and a text label underneath.\n     * The circle and the image are drawn on canvas and managed by Paper.js.\n     * The text label is an HTML node, managed by jQuery. */\n\n    //var NodeRepr = Renderer.Node = Utils.inherit(Renderer._BaseRepresentation);\n    var NodeRepr = Utils.inherit(BaseRepresentation);\n\n    _(NodeRepr.prototype).extend({\n        _init: function() {\n            this.renderer.node_layer.activate();\n            this.type = \"Node\";\n            this.buildShape();\n            this.hidden = false;\n            this.ghost= false;\n            if (this.options.show_node_circles) {\n                this.circle.strokeWidth = this.options.node_stroke_width;\n                this.h_ratio = 1;\n            } else {\n                this.h_ratio = 0;\n            }\n            this.title = $('<div class=\"Rk-Label\">').appendTo(this.renderer.labels_$);\n\n            if (this.options.editor_mode) {\n                var Renderer = requtils.getRenderer();\n                this.normal_buttons = [\n                                       new Renderer.NodeEditButton(this.renderer, null),\n                                       new Renderer.NodeRemoveButton(this.renderer, null),\n                                       new Renderer.NodeLinkButton(this.renderer, null),\n                                       new Renderer.NodeEnlargeButton(this.renderer, null),\n                                       new Renderer.NodeShrinkButton(this.renderer, null)\n                                       ];\n                if (this.options.hide_nodes){\n                    this.normal_buttons.push(\n                            new Renderer.NodeHideButton(this.renderer, null),\n                            new Renderer.NodeShowButton(this.renderer, null)\n                            );\n                }\n                this.pending_delete_buttons = [\n                                               new Renderer.NodeRevertButton(this.renderer, null)\n                                               ];\n                this.all_buttons = this.normal_buttons.concat(this.pending_delete_buttons);\n\n                for (var i = 0; i < this.all_buttons.length; i++) {\n                    this.all_buttons[i].source_representation = this;\n                }\n                this.active_buttons = [];\n            } else {\n                this.active_buttons = this.all_buttons = [];\n            }\n            this.last_circle_radius = 1;\n\n            if (this.renderer.minimap) {\n                this.renderer.minimap.node_layer.activate();\n                this.minimap_circle = new paper.Path.Circle([0, 0], 1);\n                this.minimap_circle.__representation = this.renderer.minimap.miniframe.__representation;\n                this.renderer.minimap.node_group.addChild(this.minimap_circle);\n            }\n        },\n        _getStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.node_stroke_width + (thickness-1) * (this.options.node_stroke_max_width - this.options.node_stroke_width) / (this.options.node_stroke_witdh_scale-1);\n        },\n        _getSelectedStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.selected_node_stroke_width + (thickness-1) * (this.options.selected_node_stroke_max_width - this.options.selected_node_stroke_width) / (this.options.node_stroke_witdh_scale-1);\n        },\n        buildShape: function(){\n            if( 'shape' in this.model.changed ) {\n                delete this.img;\n            }\n            if(this.circle){\n                this.circle.remove();\n                delete this.circle;\n            }\n            // \"circle\" \"rectangle\" \"ellipse\" \"polygon\" \"star\" \"diamond\"\n            this.shapeBuilder = new ShapeBuilder(this.model.get(\"shape\"));\n            this.circle = this.shapeBuilder.getShape();\n            this.circle.__representation = this;\n            this.circle.sendToBack();\n            this.last_circle_radius = 1;\n        },\n        redraw: function(options) {\n            if( 'shape' in this.model.changed && 'change' in options && options.change ) {\n            //if( 'shape' in this.model.changed ) {\n                this.buildShape();\n            }\n            var _model_coords = new paper.Point(this.model.get(\"position\")),\n                _baseRadius = this.options.node_size_base * Math.exp((this.model.get(\"size\") || 0) * Utils._NODE_SIZE_STEP);\n            if (!this.is_dragging || !this.paper_coords) {\n                this.paper_coords = this.renderer.toPaperCoords(_model_coords);\n            }\n            this.circle_radius = _baseRadius * this.renderer.view.scale;\n            if (this.last_circle_radius !== this.circle_radius) {\n                this.all_buttons.forEach(function(b) {\n                    b.setSectorSize();\n                });\n                this.circle.scale(this.circle_radius / this.last_circle_radius);\n                if (this.node_image) {\n                    this.node_image.scale(this.circle_radius / this.last_circle_radius);\n                }\n            }\n            this.circle.position = this.paper_coords;\n            if (this.node_image) {\n                this.node_image.position = this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius));\n            }\n            this.last_circle_radius = this.circle_radius;\n\n            var old_act_btn = this.active_buttons;\n\n            var opacity = 1;\n            if (this.model.get(\"delete_scheduled\")) {\n                opacity = 0.5;\n                this.active_buttons = this.pending_delete_buttons;\n                this.circle.dashArray = [2,2];\n            } else {\n                opacity = 1;\n                this.active_buttons = this.normal_buttons;\n                this.circle.dashArray = null;\n            }\n            if (this.selected && this.renderer.isEditable() && !this.ghost) {\n                if (old_act_btn !== this.active_buttons) {\n                    old_act_btn.forEach(function(b) {\n                        b.hide();\n                    });\n                }\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n\n            if (this.node_image) {\n                this.node_image.opacity = this.highlighted ? opacity * 0.5 : (opacity - 0.01);\n            }\n\n            this.circle.fillColor = this.highlighted ? this.options.highlighted_node_fill_color : this.options.node_fill_color;\n\n            this.circle.opacity = this.options.show_node_circles ? opacity : 0.01;\n\n            var _text = this.model.get(\"title\") || this.renkan.translate(this.options.label_untitled_nodes) || \"\";\n            _text = Utils.shortenText(_text, this.options.node_label_max_length);\n\n            if (typeof this.highlighted === \"object\") {\n                this.title.html(this.highlighted.replace(_(_text).escape(),'<span class=\"Rk-Highlighted\">$1</span>'));\n            } else {\n                this.title.text(_text);\n            }\n\n            var _strokeWidth = this._getStrokeWidth();\n            this.title.css({\n                left: this.paper_coords.x,\n                top: this.paper_coords.y + this.circle_radius * this.h_ratio + this.options.node_label_distance + 0.5*_strokeWidth,\n                opacity: opacity\n            });\n            var _color = (this.model.has(\"style\") && this.model.get(\"style\").color) || (this.model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                _dash = (this.model.has(\"style\") && this.model.get(\"style\").dash) ? this.options.default_dash_array : null;\n            this.circle.strokeWidth = _strokeWidth;\n            this.circle.strokeColor = _color;\n            this.circle.dashArray = _dash;\n            var _pc = this.paper_coords;\n            this.all_buttons.forEach(function(b) {\n                b.moveTo(_pc);\n            });\n            var lastImage = this.img;\n            this.img = this.model.get(\"image\");\n            if (this.img && this.img !== lastImage) {\n                this.showImage();\n                if(this.circle) {\n                    this.circle.sendToBack();\n                }\n            }\n            if (this.node_image && !this.img) {\n                this.node_image.remove();\n                delete this.node_image;\n            }\n\n            if (this.renderer.minimap) {\n                this.minimap_circle.fillColor = _color;\n                var minipos = this.renderer.toMinimapCoords(_model_coords),\n                miniradius = this.renderer.minimap.scale * _baseRadius,\n                minisize = new paper.Size([miniradius, miniradius]);\n                this.minimap_circle.fitBounds(minipos.subtract(minisize), minisize.multiply(2));\n            }\n\n            if (typeof options === 'undefined' || !('dontRedrawEdges' in options) || !options.dontRedrawEdges) {\n                var _this = this;\n                _.each(\n                        this.project.get(\"edges\").filter(\n                                function (ed) {\n                                    return ((ed.get(\"to\") === _this.model) || (ed.get(\"from\") === _this.model));\n                                }\n                        ),\n                        function(edge, index, list) {\n                            var repr = _this.renderer.getRepresentationByModel(edge);\n                            if (repr && typeof repr.from_representation !== \"undefined\" && typeof repr.from_representation.paper_coords !== \"undefined\" && typeof repr.to_representation !== \"undefined\" && typeof repr.to_representation.paper_coords !== \"undefined\") {\n                                repr.redraw();\n                            }\n                        }\n                );\n            }\n            if (this.ghost){\n                this.show(true);\n            } else {\n                if (this.hidden) { this.hide(); }\n            }\n        },\n        showImage: function() {\n            var _image = null;\n            if (typeof this.renderer.image_cache[this.img] === \"undefined\") {\n                _image = new Image();\n                this.renderer.image_cache[this.img] = _image;\n                _image.src = this.img;\n            } else {\n                _image = this.renderer.image_cache[this.img];\n            }\n            if (_image.width) {\n                if (this.node_image) {\n                    this.node_image.remove();\n                }\n                this.renderer.node_layer.activate();\n                var width = _image.width,\n                    height = _image.height,\n                    clipPath = this.model.get(\"clip_path\"),\n                    hasClipPath = (typeof clipPath !== \"undefined\" && clipPath),\n                    _clip = null,\n                    baseRadius = null,\n                    centerPoint = null;\n\n                if (hasClipPath) {\n                    _clip = new paper.Path();\n                    var instructions = clipPath.match(/[a-z][^a-z]+/gi) || [],\n                    lastCoords = [0,0],\n                    minX = Infinity,\n                    minY = Infinity,\n                    maxX = -Infinity,\n                    maxY = -Infinity;\n\n                    var transformCoords = function(tabc, relative) {\n                        var newCoords = tabc.slice(1).map(function(v, k) {\n                            var res = parseFloat(v),\n                            isY = k % 2;\n                            if (isY) {\n                                res = ( res - 0.5 ) * height;\n                            } else {\n                                res = ( res - 0.5 ) * width;\n                            }\n                            if (relative) {\n                                res += lastCoords[isY];\n                            }\n                            if (isY) {\n                                minY = Math.min(minY, res);\n                                maxY = Math.max(maxY, res);\n                            } else {\n                                minX = Math.min(minX, res);\n                                maxX = Math.max(maxX, res);\n                            }\n                            return res;\n                        });\n                        lastCoords = newCoords.slice(-2);\n                        return newCoords;\n                    };\n\n                    instructions.forEach(function(instr) {\n                        var coords = instr.match(/([a-z]|[0-9.-]+)/ig) || [\"\"];\n                        switch(coords[0]) {\n                        case \"M\":\n                            _clip.moveTo(transformCoords(coords));\n                            break;\n                        case \"m\":\n                            _clip.moveTo(transformCoords(coords, true));\n                            break;\n                        case \"L\":\n                            _clip.lineTo(transformCoords(coords));\n                            break;\n                        case \"l\":\n                            _clip.lineTo(transformCoords(coords, true));\n                            break;\n                        case \"C\":\n                            _clip.cubicCurveTo(transformCoords(coords));\n                            break;\n                        case \"c\":\n                            _clip.cubicCurveTo(transformCoords(coords, true));\n                            break;\n                        case \"Q\":\n                            _clip.quadraticCurveTo(transformCoords(coords));\n                            break;\n                        case \"q\":\n                            _clip.quadraticCurveTo(transformCoords(coords, true));\n                            break;\n                        }\n                    });\n\n                    baseRadius = Math[this.options.node_images_fill_mode ? \"min\" : \"max\"](maxX - minX, maxY - minY) / 2;\n                    centerPoint = new paper.Point((maxX + minX) / 2, (maxY + minY) / 2);\n                    if (!this.options.show_node_circles) {\n                        this.h_ratio = (maxY - minY) / (2 * baseRadius);\n                    }\n                } else {\n                    baseRadius = Math[this.options.node_images_fill_mode ? \"min\" : \"max\"](width, height) / 2;\n                    centerPoint = new paper.Point(0,0);\n                    if (!this.options.show_node_circles) {\n                        this.h_ratio = height / (2 * baseRadius);\n                    }\n                }\n                var _raster = new paper.Raster(_image);\n                _raster.locked = true; // Disable mouse events on icon\n                if (hasClipPath) {\n                    _raster = new paper.Group(_clip, _raster);\n                    _raster.opacity = 0.99;\n                    /* This is a workaround to allow clipping at group level\n                     * If opacity was set to 1, paper.js would merge all clipping groups in one (known bug).\n                     */\n                    _raster.clipped = true;\n                    _clip.__representation = this;\n                }\n                if (this.options.clip_node_images) {\n                    var _circleClip = this.shapeBuilder.getImageShape(centerPoint, baseRadius);\n                    _raster = new paper.Group(_circleClip, _raster);\n                    _raster.opacity = 0.99;\n                    _raster.clipped = true;\n                    _circleClip.__representation = this;\n                }\n                this.image_delta = centerPoint.divide(baseRadius);\n                this.node_image = _raster;\n                this.node_image.__representation = _this;\n                this.node_image.scale(this.circle_radius / baseRadius);\n                this.node_image.position = this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius));\n                this.node_image.insertAbove(this.circle);\n            } else {\n                var _this = this;\n                $(_image).on(\"load\", function() {\n                    _this.showImage();\n                });\n            }\n        },\n        paperShift: function(_delta) {\n            if (this.options.editor_mode) {\n                if (!this.renkan.read_only) {\n                    this.is_dragging = true;\n                    this.paper_coords = this.paper_coords.add(_delta);\n                    this.redraw();\n                }\n            } else {\n                this.renderer.view.paperShift(_delta);\n            }\n        },\n        openEditor: function() {\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            var _editor = this.renderer.addRepresentation(\"NodeEditor\",null);\n            _editor.source_representation = this;\n            _editor.draw();\n        },\n        select: function() {\n            this.selected = true;\n            this.circle.strokeWidth = this._getSelectedStrokeWidth();\n            if (this.renderer.isEditable() && !this.hidden) {\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n            var _uri = this.model.get(\"uri\");\n            if (_uri) {\n                $('.Rk-Bin-Item').each(function() {\n                    var _el = $(this);\n                    if (_el.attr(\"data-uri\") === _uri) {\n                        _el.addClass(\"selected\");\n                    }\n                });\n            }\n            if (!this.options.editor_mode) {\n                this.openEditor();\n            }\n\n            if (this.renderer.minimap) {\n                this.minimap_circle.strokeWidth = this.options.minimap_highlight_weight;\n                this.minimap_circle.strokeColor = this.options.minimap_highlight_color;\n            }\n            //if the node is hidden and the mouse hover it, it appears as a ghost\n            if (this.hidden) {\n                this.show(true);\n            }\n            else {\n                this.showNeighbors(true);\n            }\n            this._super(\"select\");\n        },\n        hideButtons: function() {\n            this.all_buttons.forEach(function(b) {\n                b.hide();\n            });\n            delete(this.buttonTimeout);\n        },\n        unselect: function(_newTarget) {\n            if (!_newTarget || _newTarget.source_representation !== this) {\n                this.selected = false;\n                var _this = this;\n                this.buttons_timeout = setTimeout(function() { _this.hideButtons(); }, 200);\n                this.circle.strokeWidth = this._getStrokeWidth();\n                $('.Rk-Bin-Item').removeClass(\"selected\");\n                if (this.renderer.minimap) {\n                    this.minimap_circle.strokeColor = undefined;\n                }\n                //when the mouse don't hover the node anymore, we hide it\n                if (this.hidden) {\n                    this.hide();\n                } else {\n                    this.hideNeighbors();\n                }\n                this._super(\"unselect\");\n            }\n        },\n        hide: function(){\n            var _this = this;\n            this.ghost = false;\n            this.hidden = true;\n            if (typeof this.node_image !== 'undefined'){\n                this.node_image.opacity = 0;\n            }\n            this.hideButtons();\n            this.circle.opacity = 0;\n            this.title.css('opacity', 0);\n            this.minimap_circle.opacity = 0;\n\n\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return ((ed.get(\"to\") === _this.model) || (ed.get(\"from\") === _this.model));\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge);\n                        if (repr && typeof repr.from_representation !== \"undefined\" && typeof repr.from_representation.paper_coords !== \"undefined\" && typeof repr.to_representation !== \"undefined\" && typeof repr.to_representation.paper_coords !== \"undefined\") {\n                            repr.hide();\n                        }\n                    }\n            );\n            this.hideNeighbors();\n        },\n        show: function(ghost){\n            var _this = this;\n            this.ghost = ghost;\n            if (this.ghost){\n                if (typeof this.node_image !== 'undefined'){\n                    this.node_image.opacity = this.options.ghost_opacity;\n                }\n                this.circle.opacity = this.options.ghost_opacity;\n                this.title.css('opacity', this.options.ghost_opacity);\n                this.minimap_circle.opacity = this.options.ghost_opacity;\n            } else {\n                this.minimap_circle.opacity = 1; \n                this.hidden = false;\n                this.redraw();\n            }\n\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return ((ed.get(\"to\") === _this.model) || (ed.get(\"from\") === _this.model));\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge);\n                        if (repr && typeof repr.from_representation !== \"undefined\" && typeof repr.from_representation.paper_coords !== \"undefined\" && typeof repr.to_representation !== \"undefined\" && typeof repr.to_representation.paper_coords !== \"undefined\") {\n                            repr.show(_this.ghost);\n                        }\n                    }\n            );\n        },\n        hideNeighbors: function(){\n            var _this = this;\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return (ed.get(\"from\") === _this.model);\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge.get(\"to\"));\n                        if (repr && repr.ghost) {\n                            repr.hide();\n                        }\n                    }\n            );\n        },\n        showNeighbors: function(ghost){\n            var _this = this;\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return (ed.get(\"from\") === _this.model);\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge.get(\"to\"));\n                        if (repr && repr.hidden) {\n                            repr.show(ghost);\n                            if (!ghost){\n                                var indexNode = _this.renderer.view.hiddenNodes.indexOf(repr.model.id);\n                                if (indexNode !== -1){\n                                    _this.renderer.view.hiddenNodes.splice(indexNode, 1);\n                                }\n                            }\n                        }\n                    }\n            );\n        },\n        highlight: function(textToReplace) {\n            var hlvalue = textToReplace || true;\n            if (this.highlighted === hlvalue) {\n                return;\n            }\n            this.highlighted = hlvalue;\n            this.redraw();\n            this.renderer.throttledPaperDraw();\n        },\n        unhighlight: function() {\n            if (!this.highlighted) {\n                return;\n            }\n            this.highlighted = false;\n            this.redraw();\n            this.renderer.throttledPaperDraw();\n        },\n        saveCoords: function() {\n            var _coords = this.renderer.toModelCoords(this.paper_coords),\n            _data = {\n                position: {\n                    x: _coords.x,\n                    y: _coords.y\n                }\n            };\n            if (this.renderer.isEditable()) {\n                this.model.set(_data);\n            }\n        },\n        mousedown: function(_event, _isTouch) {\n            if (_isTouch) {\n                this.renderer.unselectAll();\n                this.select();\n            }\n        },\n        mouseup: function(_event, _isTouch) {\n            if (this.renderer.is_dragging && this.renderer.isEditable()) {\n                this.saveCoords();\n            } else {\n                if (this.hidden) {\n                    var index = this.renderer.view.hiddenNodes.indexOf(this.model.id);\n                    if (index !== -1){\n                        this.renderer.view.hiddenNodes.splice(index, 1);\n                    }\n                    this.show(false);\n                    this.select();\n                } else {\n                    if (!_isTouch && !this.model.get(\"delete_scheduled\")) {\n                        this.openEditor();\n                    }\n                    this.model.trigger(\"clicked\");\n                }\n            }\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.is_dragging = false;\n        },\n        destroy: function(_event) {\n            this._super(\"destroy\");\n            this.all_buttons.forEach(function(b) {\n                b.destroy();\n            });\n            this.circle.remove();\n            this.title.remove();\n            if (this.renderer.minimap) {\n                this.minimap_circle.remove();\n            }\n            if (this.node_image) {\n                this.node_image.remove();\n            }\n        }\n    }).value();\n\n    return NodeRepr;\n\n});\n\n\ndefine('renderer/edge',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* Edge Class Begin */\n\n    //var Edge = Renderer.Edge = Utils.inherit(Renderer._BaseRepresentation);\n    var Edge = Utils.inherit(BaseRepresentation);\n\n    _(Edge.prototype).extend({\n        _init: function() {\n            this.renderer.edge_layer.activate();\n            this.type = \"Edge\";\n            this.hidden = false;\n            this.ghost = false;\n            this.from_representation = this.renderer.getRepresentationByModel(this.model.get(\"from\"));\n            this.to_representation = this.renderer.getRepresentationByModel(this.model.get(\"to\"));\n            this.bundle = this.renderer.addToBundles(this);\n            this.line = new paper.Path();\n            this.line.add([0,0],[0,0],[0,0]);\n            this.line.__representation = this;\n            this.line.strokeWidth = this.options.edge_stroke_width;\n            this.arrow_scale = 1;\n            this.arrow = new paper.Path();\n            this.arrow.add(\n                    [ 0, 0 ],\n                    [ this.options.edge_arrow_length, this.options.edge_arrow_width / 2 ],\n                    [ 0, this.options.edge_arrow_width ]\n            );\n            this.arrow.pivot = new paper.Point([ this.options.edge_arrow_length / 2, this.options.edge_arrow_width / 2 ]);\n            this.arrow.__representation = this;\n            this.text = $('<div class=\"Rk-Label Rk-Edge-Label\">').appendTo(this.renderer.labels_$);\n            this.arrow_angle = 0;\n            if (this.options.editor_mode) {\n                var Renderer = requtils.getRenderer();\n                this.normal_buttons = [\n                                       new Renderer.EdgeEditButton(this.renderer, null),\n                                       new Renderer.EdgeRemoveButton(this.renderer, null)\n                                       ];\n                this.pending_delete_buttons = [\n                                               new Renderer.EdgeRevertButton(this.renderer, null)\n                                               ];\n                this.all_buttons = this.normal_buttons.concat(this.pending_delete_buttons);\n                for (var i = 0; i < this.all_buttons.length; i++) {\n                    this.all_buttons[i].source_representation = this;\n                }\n                this.active_buttons = [];\n            } else {\n                this.active_buttons = this.all_buttons = [];\n            }\n\n            if (this.renderer.minimap) {\n                this.renderer.minimap.edge_layer.activate();\n                this.minimap_line = new paper.Path();\n                this.minimap_line.add([0,0],[0,0]);\n                this.minimap_line.__representation = this.renderer.minimap.miniframe.__representation;\n                this.minimap_line.strokeWidth = 1;\n            }\n        },\n        _getStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.edge_stroke_width + (thickness-1) * (this.options.edge_stroke_max_width - this.options.edge_stroke_width) / (this.options.edge_stroke_witdh_scale-1);\n        },\n        _getSelectedStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.selected_edge_stroke_width + (thickness-1) * (this.options.selected_edge_stroke_max_width - this.options.selected_edge_stroke_width) / (this.options.edge_stroke_witdh_scale-1);\n        },\n        _getArrowScale: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return 1 + (thickness-1) * ((this.options.edge_arrow_max_width / this.options.edge_arrow_width) - 1) / (this.options.edge_stroke_witdh_scale-1);\n        },\n        redraw: function() {\n            var from = this.model.get(\"from\"),\n            to = this.model.get(\"to\");\n            if (!from || !to || (this.hidden && !this.ghost)) {\n                return;\n            }\n            this.from_representation = this.renderer.getRepresentationByModel(from);\n            this.to_representation = this.renderer.getRepresentationByModel(to);\n            if (typeof this.from_representation === \"undefined\" || typeof this.to_representation === \"undefined\" ||\n                    (this.from_representation.hidden && !this.from_representation.ghost) ||\n                    (this.to_representation.hidden && !this.to_representation.ghost)) {\n                this.hide();\n                return;\n            }\n            var _strokeWidth = this._getStrokeWidth(),\n                _arrow_scale = this._getArrowScale(),\n                _p0a = this.from_representation.paper_coords,\n                _p1a = this.to_representation.paper_coords,\n                _v = _p1a.subtract(_p0a),\n                _r = _v.length,\n                _u = _v.divide(_r),\n                _ortho = new paper.Point([- _u.y, _u.x]),\n                _group_pos = this.bundle.getPosition(this),\n                _delta = _ortho.multiply( this.options.edge_gap_in_bundles * _group_pos ),\n                _p0b = _p0a.add(_delta), /* Adding a 4 px difference */\n                _p1b = _p1a.add(_delta), /* to differentiate bundled links */\n                _a = _v.angle,\n                _textdelta = _ortho.multiply(this.options.edge_label_distance + 0.5 * _arrow_scale * this.options.edge_arrow_width),\n                _handle = _v.divide(3),\n                _color = (this.model.has(\"style\") && this.model.get(\"style\").color) || (this.model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                _dash = (this.model.has(\"style\") && this.model.get(\"style\").dash) ? this.options.default_dash_array : null,\n                _opacity;\n\n            if (this.model.get(\"delete_scheduled\") || this.from_representation.model.get(\"delete_scheduled\") || this.to_representation.model.get(\"delete_scheduled\")) {\n                _opacity = 0.5;\n                this.line.dashArray = [2, 2];\n            } else {\n                _opacity = this.ghost ? this.options.ghost_opacity : 1;\n                this.line.dashArray = null;\n            }\n\n            var old_act_btn = this.active_buttons;\n\n            this.arrow.visible =\n                (this.model.has(\"style\") && this.model.get(\"style\").arrow) ||\n                !this.model.has(\"style\") ||\n                typeof this.model.get(\"style\").arrow === 'undefined';\n\n            this.active_buttons = this.model.get(\"delete_scheduled\") ? this.pending_delete_buttons : this.normal_buttons;\n\n            if (this.selected && this.renderer.isEditable() && old_act_btn !== this.active_buttons) {\n                old_act_btn.forEach(function(b) {\n                    b.hide();\n                });\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n\n            this.paper_coords = _p0b.add(_p1b).divide(2);\n            this.line.strokeWidth = _strokeWidth;\n            this.line.strokeColor = _color;\n            this.line.dashArray = _dash;\n            this.line.opacity = _opacity;\n            this.line.segments[0].point = _p0a;\n            this.line.segments[1].point = this.paper_coords;\n            this.line.segments[1].handleIn = _handle.multiply(-1);\n            this.line.segments[1].handleOut = _handle;\n            this.line.segments[2].point = _p1a;\n            this.arrow.scale(_arrow_scale / this.arrow_scale);\n            this.arrow_scale = _arrow_scale;\n            this.arrow.fillColor = _color;\n            this.arrow.opacity = _opacity;\n            this.arrow.rotate(_a - this.arrow_angle, this.arrow.bounds.center);\n            this.arrow.position = this.paper_coords;\n\n            this.arrow_angle = _a;\n            if (_a > 90) {\n                _a -= 180;\n                _textdelta = _textdelta.multiply(-1);\n            }\n            if (_a < -90) {\n                _a += 180;\n                _textdelta = _textdelta.multiply(-1);\n            }\n            var _text = this.model.get(\"title\") || this.renkan.translate(this.options.label_untitled_edges) || \"\";\n            _text = Utils.shortenText(_text, this.options.node_label_max_length);\n            this.text.text(_text);\n            var _textpos = this.paper_coords.add(_textdelta);\n            this.text.css({\n                left: _textpos.x,\n                top: _textpos.y,\n                transform: \"rotate(\" + _a + \"deg)\",\n                \"-moz-transform\": \"rotate(\" + _a + \"deg)\",\n                \"-webkit-transform\": \"rotate(\" + _a + \"deg)\",\n                opacity: _opacity\n            });\n            this.text_angle = _a;\n\n            var _pc = this.paper_coords;\n            this.all_buttons.forEach(function(b) {\n                b.moveTo(_pc);\n            });\n\n            if (this.renderer.minimap) {\n                this.minimap_line.strokeColor = _color;\n                this.minimap_line.segments[0].point = this.renderer.toMinimapCoords(new paper.Point(this.from_representation.model.get(\"position\")));\n                this.minimap_line.segments[1].point = this.renderer.toMinimapCoords(new paper.Point(this.to_representation.model.get(\"position\")));\n            }\n        },\n        hide: function(){\n            this.hidden = true;\n            this.ghost = false;\n\n            this.text.hide();\n            this.line.visible = false;\n            this.arrow.visible = false;\n            this.minimap_line.visible = false;\n        },\n        show: function(ghost){\n            this.ghost = ghost;\n            if (this.ghost) {\n                this.text.css('opacity', 0.3);\n                this.line.opacity = 0.3;\n                this.arrow.opacity = 0.3;\n                this.minimap_line.opacity = 0.3;\n            } else {\n                this.hidden = false;\n\n                this.text.css('opacity', 1);\n                this.line.opacity = 1;\n                this.arrow.opacity = 1;\n                this.minimap_line.opacity = 1;\n            }\n            this.text.show();\n            this.line.visible = true;\n            this.arrow.visible = true;\n            this.minimap_line.visible = true;\n            this.redraw();\n        },\n        openEditor: function() {\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            var _editor = this.renderer.addRepresentation(\"EdgeEditor\",null);\n            _editor.source_representation = this;\n            _editor.draw();\n        },\n        select: function() {\n            this.selected = true;\n            this.line.strokeWidth = this._getSelectedStrokeWidth();\n            if (this.renderer.isEditable()) {\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n            if (!this.options.editor_mode) {\n                this.openEditor();\n            }\n            this._super(\"select\");\n        },\n        unselect: function(_newTarget) {\n            if (!_newTarget || _newTarget.source_representation !== this) {\n                this.selected = false;\n                if (this.options.editor_mode) {\n                    this.all_buttons.forEach(function(b) {\n                        b.hide();\n                    });\n                }\n                this.line.strokeWidth = this._getStrokeWidth();\n                this._super(\"unselect\");\n            }\n        },\n        mousedown: function(_event, _isTouch) {\n            if (_isTouch) {\n                this.renderer.unselectAll();\n                this.select();\n            }\n        },\n        mouseup: function(_event, _isTouch) {\n            if (!this.renkan.read_only && this.renderer.is_dragging) {\n                this.from_representation.saveCoords();\n                this.to_representation.saveCoords();\n                this.from_representation.is_dragging = false;\n                this.to_representation.is_dragging = false;\n            } else {\n                if (!_isTouch) {\n                    this.openEditor();\n                }\n                this.model.trigger(\"clicked\");\n            }\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n        },\n        paperShift: function(_delta) {\n            if (this.options.editor_mode) {\n                if (!this.options.read_only) {\n                    this.from_representation.paperShift(_delta);\n                    this.to_representation.paperShift(_delta);\n                }\n            } else {\n                this.renderer.paperShift(_delta);\n            }\n        },\n        destroy: function() {\n            this._super(\"destroy\");\n            this.line.remove();\n            this.arrow.remove();\n            this.text.remove();\n            if (this.renderer.minimap) {\n                this.minimap_line.remove();\n            }\n            this.all_buttons.forEach(function(b) {\n                b.destroy();\n            });\n            var _this = this;\n            this.bundle.edges = _.reject(this.bundle.edges, function(_edge) {\n                return _this === _edge;\n            });\n        }\n    }).value();\n\n    return Edge;\n\n});\n\n\n\ndefine('renderer/tempedge',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* TempEdge Class Begin */\n\n    //var TempEdge = Renderer.TempEdge = Utils.inherit(Renderer._BaseRepresentation);\n    var TempEdge = Utils.inherit(BaseRepresentation);\n\n    _(TempEdge.prototype).extend({\n        _init: function() {\n            this.renderer.edge_layer.activate();\n            this.type = \"Temp-edge\";\n\n            var _color = (this.project.get(\"users\").get(this.renkan.current_user) || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\");\n            this.line = new paper.Path();\n            this.line.strokeColor = _color;\n            this.line.dashArray = [4, 2];\n            this.line.strokeWidth = this.options.selected_edge_stroke_width;\n            this.line.add([0,0],[0,0]);\n            this.line.__representation = this;\n            this.arrow = new paper.Path();\n            this.arrow.fillColor = _color;\n            this.arrow.add(\n                    [ 0, 0 ],\n                    [ this.options.edge_arrow_length, this.options.edge_arrow_width / 2 ],\n                    [ 0, this.options.edge_arrow_width ]\n            );\n            this.arrow.__representation = this;\n            this.arrow_angle = 0;\n        },\n        redraw: function() {\n            var _p0 = this.from_representation.paper_coords,\n            _p1 = this.end_pos,\n            _a = _p1.subtract(_p0).angle,\n            _c = _p0.add(_p1).divide(2);\n            this.line.segments[0].point = _p0;\n            this.line.segments[1].point = _p1;\n            this.arrow.rotate(_a - this.arrow_angle);\n            this.arrow.position = _c;\n            this.arrow_angle = _a;\n        },\n        paperShift: function(_delta) {\n            if (!this.renderer.isEditable()) {\n                this.renderer.removeRepresentation(_this);\n                paper.view.draw();\n                return;\n            }\n            this.end_pos = this.end_pos.add(_delta);\n            var _hitResult = paper.project.hitTest(this.end_pos);\n            this.renderer.findTarget(_hitResult);\n            this.redraw();\n        },\n        mouseup: function(_event, _isTouch) {\n            var _hitResult = paper.project.hitTest(_event.point),\n            _model = this.from_representation.model,\n            _endDrag = true;\n            if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                var _target = _hitResult.item.__representation;\n                if (_target.type.substr(0,4) === \"Node\") {\n                    var _destmodel = _target.model || _target.source_representation.model;\n                    if (_model !== _destmodel) {\n                        var _data = {\n                                id: Utils.getUID('edge'),\n                                created_by: this.renkan.current_user,\n                                from: _model,\n                                to: _destmodel\n                        };\n                        if (this.renderer.isEditable()) {\n                            this.project.addEdge(_data);\n                        }\n                    }\n                }\n\n                if (_model === _target.model || (_target.source_representation && _target.source_representation.model === _model)) {\n                    _endDrag = false;\n                    this.renderer.is_dragging = true;\n                }\n            }\n            if (_endDrag) {\n                this.renderer.click_target = null;\n                this.renderer.is_dragging = false;\n                this.renderer.removeRepresentation(this);\n                paper.view.draw();\n            }\n        },\n        destroy: function() {\n            this.arrow.remove();\n            this.line.remove();\n        }\n    }).value();\n\n    /* TempEdge Class End */\n\n    return TempEdge;\n\n});\n\n\ndefine('renderer/baseeditor',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* _BaseEditor Begin */\n    //var _BaseEditor = Renderer._BaseEditor = Utils.inherit(Renderer._BaseRepresentation);\n    var _BaseEditor = Utils.inherit(BaseRepresentation);\n\n    _(_BaseEditor.prototype).extend({\n        _init: function() {\n            this.renderer.buttons_layer.activate();\n            this.type = \"editor\";\n            this.editor_block = new paper.Path();\n            var _pts = _.map(_.range(8), function() {return [0,0];});\n            this.editor_block.add.apply(this.editor_block, _pts);\n            this.editor_block.strokeWidth = this.options.tooltip_border_width;\n            this.editor_block.strokeColor = this.options.tooltip_border_color;\n            this.editor_block.opacity = this.options.tooltip_opacity;\n            this.editor_$ = $('<div>')\n                .appendTo(this.renderer.editor_$)\n                .css({\n                    position: \"absolute\",\n                    opacity: this.options.tooltip_opacity\n                })\n                .hide();\n        },\n        destroy: function() {\n            this.editor_block.remove();\n            this.editor_$.remove();\n        }\n    }).value();\n\n    /* _BaseEditor End */\n\n    return _BaseEditor;\n\n});\n\n\ndefine('renderer/nodeeditor',['jquery', 'underscore', 'requtils', 'renderer/baseeditor', 'renderer/shapebuilder', 'ckeditor-jquery'], function ($, _, requtils, BaseEditor, ShapeBuilder) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeEditor Begin */\n    //var NodeEditor = Renderer.NodeEditor = Utils.inherit(Renderer._BaseEditor);\n    var NodeEditor = Utils.inherit(BaseEditor);\n\n    _(NodeEditor.prototype).extend({\n        _init: function() {\n            BaseEditor.prototype._init.apply(this);\n            this.template = this.options.templates['templates/nodeeditor.html'];\n            //this.templates['default']= this.options.templates['templates/nodeeditor.html'];\n            //fusionner avec this.options.node_editor_templates\n            this.readOnlyTemplate = this.options.node_editor_templates;\n        },\n        draw: function() {\n            var _model = this.source_representation.model,\n            _created_by = _model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan),\n            _template = (this.renderer.isEditable() ? this.template : this.readOnlyTemplate[_model.get(\"type\")] || this.readOnlyTemplate[\"default\"]),\n            _image_placeholder = this.options.static_url + \"img/image-placeholder.png\",\n            _size = (_model.get(\"size\") || 0);\n            this.editor_$\n            .html(_template({\n                node: {\n                    _id: _model.get(\"_id\"),\n                    has_creator: !!_model.get(\"created_by\"),\n                    title: _model.get(\"title\"),\n                    uri: _model.get(\"uri\"),\n                    type: _model.get(\"type\") || \"default\",\n                    short_uri:  Utils.shortenText((_model.get(\"uri\") || \"\").replace(/^(https?:\\/\\/)?(www\\.)?/,'').replace(/\\/$/,''),40),\n                    description: _model.get(\"description\"),\n                    image: _model.get(\"image\") || \"\",\n                    image_placeholder: _image_placeholder,\n                    color: (_model.has(\"style\") && _model.get(\"style\").color) || _created_by.get(\"color\"),\n                    thickness: (_model.has(\"style\") && _model.get(\"style\").thickness) || 1,\n                    dash: _model.has(\"style\") && _model.get(\"style\").dash ? \"checked\" : \"\",\n                    clip_path: _model.get(\"clip_path\") || false,\n                    created_by_color: _created_by.get(\"color\"),\n                    created_by_title: _created_by.get(\"title\"),\n                    size: (_size > 0 ? \"+\" : \"\") + _size,\n                    shape: _model.get(\"shape\") || \"circle\"\n                },\n                renkan: this.renkan,\n                options: this.options,\n                shortenText: Utils.shortenText,\n                shapes : _(ShapeBuilder.builders).omit('svg').keys().value(),\n                types : _(this.options.node_editor_templates).keys().value(),\n            }));\n            this.redraw();\n            var _this = this,\n                editorInstance = _this.options.show_node_editor_description_richtext ?\n                    $(\".Rk-Edit-Description\").ckeditor(_this.options.richtext_editor_config) :\n                    false,\n                editorInstanceTitle = _this.options.show_node_editor_title_richtext ?\n                    $(\".Rk-Edit-Title\").ckeditor(_this.options.richtext_editor_config) :\n                    false,\n                closeEditor = function() {\n                    _this.renderer.removeRepresentation(_this);\n                    paper.view.draw();\n                };\n\n            _this.cleanEditor = function() {\n                _this.editor_$.off(\"keyup\");\n                _this.editor_$.find(\"input, textarea, select\").off(\"change keyup paste\");\n                _this.editor_$.find(\".Rk-Edit-Image-File\").off('change');\n                _this.editor_$.find(\".Rk-Edit-ColorPicker-Wrapper\").off('hover');\n                _this.editor_$.find(\".Rk-Edit-Size-Btn\").off('click');\n                _this.editor_$.find(\".Rk-Edit-Image-Del\").off('click');\n                _this.editor_$.find(\".Rk-Edit-ColorPicker\").find(\"li\").off('hover click');\n                _this.editor_$.find(\".Rk-CloseX\").off('click');\n                _this.editor_$.find(\".Rk-Edit-Goto\").off('click');\n\n                if(_this.options.show_node_editor_description_richtext) {\n                    if(typeof editorInstance.editor !== 'undefined') {\n                        var _editor = editorInstance.editor;\n                        delete editorInstance.editor;\n                        _editor.focusManager.blur(true);\n                        _editor.destroy();\n                    }\n                }\n                if(_this.options.show_node_editor_title_richtext) {\n                    if(typeof editorInstanceTitle.editor !== 'undefined') {\n                        var _editor_title = editorInstanceTitle.editor;\n                        delete editorInstanceTitle.editor;\n                        _editor_title.focusManager.blur(true);\n                        _editor_title.destroy();\n                    }\n                }\n            };\n\n            this.editor_$.find(\".Rk-CloseX\").click(function (e) {\n                e.preventDefault();\n                closeEditor();\n            });\n\n            this.editor_$.find(\".Rk-Edit-Goto\").click(function() {\n                if (!_model.get(\"uri\")) {\n                    return false;\n                }\n            });\n\n            if (this.renderer.isEditable()) {\n\n                var onFieldChange = _.throttle(function() {\n                  _.defer(function() {\n                    if (_this.renderer.isEditable()) {\n                        var _data = {};\n                        if (_this.options.show_node_editor_uri) {\n                            _data.uri = _this.editor_$.find(\".Rk-Edit-URI\").val();\n                            _this.editor_$.find(\".Rk-Edit-Goto\").attr(\"href\",_data.uri || \"#\");\n                        }\n                        if (_this.options.show_node_editor_image) {\n                            _data.image = _this.editor_$.find(\".Rk-Edit-Image\").val();\n                            _this.editor_$.find(\".Rk-Edit-ImgPreview\").attr(\"src\", _data.image || _image_placeholder);\n                        }\n                        if (_this.options.show_node_editor_description) {\n                            if(_this.options.show_node_editor_description_richtext) {\n                                if(typeof editorInstance.editor !== 'undefined' &&\n                                    editorInstance.editor.checkDirty()) {\n                                    _data.description = editorInstance.editor.getData();\n                                    editorInstance.editor.resetDirty();\n                                }\n                            }\n                            else {\n                                _data.description = _this.editor_$.find(\".Rk-Edit-Description\").val();\n                            }\n                        }\n                        if (_this.options.show_node_editor_title) {\n                            if(_this.options.show_node_editor_title_richtext) {\n                                if(typeof editorInstanceTitle.editor !== 'undefined' &&\n                                        editorInstanceTitle.editor.checkDirty()) {\n                                    _data.title = editorInstanceTitle.editor.getData();\n                                    editorInstanceTitle.editor.resetDirty();\n                                }\n                            }\n                            else {\n                                _data.title = _this.editor_$.find(\".Rk-Edit-Title\").val();\n                            }\n                        }\n                        if (_this.options.show_node_editor_style) {\n                            var dash = _this.editor_$.find(\".Rk-Edit-Dash\").is(':checked');\n                            _data.style = _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {dash: dash});\n                        }\n                        if (_this.options.change_shapes) {\n                            if(_model.get(\"shape\")!==_this.editor_$.find(\".Rk-Edit-Shape\").val()){\n                                _data.shape = _this.editor_$.find(\".Rk-Edit-Shape\").val();\n                            }\n                        }\n                        if (_this.options.change_types) {\n                            if(_model.get(\"type\")!==_this.editor_$.find(\".Rk-Edit-Type\").val()){\n                                _data.type = _this.editor_$.find(\".Rk-Edit-Type\").val();\n                            }\n                        }\n                        _model.set(_data);\n                        _this.redraw();\n                    } else {\n                        closeEditor();\n                    }\n                  });\n                }, 1000);\n\n                this.editor_$.on(\"keyup\", function(_e) {\n                    if (_e.keyCode === 27) {\n                        closeEditor();\n                    }\n                });\n\n                this.editor_$.find(\"input, textarea, select\").on(\"change keyup paste\", onFieldChange);\n                if( _this.options.show_node_editor_description &&\n                    _this.options.show_node_editor_description_richtext &&\n                    typeof editorInstance.editor !== 'undefined')\n                {\n                    editorInstance.editor.on(\"change\", onFieldChange);\n                    editorInstance.editor.on(\"blur\", onFieldChange);\n                }\n                \n                if( _this.options.show_node_editor_title &&\n                    _this.options.show_node_editor_title_richtext &&\n                    typeof editorInstanceTitle.editor !== 'undefined')\n                {\n                    editorInstanceTitle.editor.on(\"change\", onFieldChange);\n                    editorInstanceTitle.editor.on(\"blur\", onFieldChange);\n                }\n\n                if(_this.options.allow_image_upload) {\n                    this.editor_$.find(\".Rk-Edit-Image-File\").change(function() {\n                        if (this.files.length) {\n                            var f = this.files[0],\n                            fr = new FileReader();\n                            if (f.type.substr(0,5) !== \"image\") {\n                                alert(_this.renkan.translate(\"This file is not an image\"));\n                                return;\n                            }\n                            if (f.size > (_this.options.uploaded_image_max_kb * 1024)) {\n                                alert(_this.renkan.translate(\"Image size must be under \") + _this.options.uploaded_image_max_kb + _this.renkan.translate(\"KB\"));\n                                return;\n                            }\n                            fr.onload = function(e) {\n                                _this.editor_$.find(\".Rk-Edit-Image\").val(e.target.result);\n                                onFieldChange();\n                            };\n                            fr.readAsDataURL(f);\n                        }\n                    });\n                }\n                this.editor_$.find(\".Rk-Edit-Title\")[0].focus();\n\n                var _picker = _this.editor_$.find(\".Rk-Edit-ColorPicker\");\n\n                this.editor_$.find(\".Rk-Edit-ColorPicker-Wrapper\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.show();\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.hide();\n                        }\n                );\n\n                _picker.find(\"li\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", $(this).attr(\"data-color\"));\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", (_model.has(\"style\") && _model.get(\"style\").color) || (_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(_this.renkan)).get(\"color\"));\n                        }\n                ).click(function(_e) {\n                    _e.preventDefault();\n                    if (_this.renderer.isEditable()) {\n                        _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {color: $(this).attr(\"data-color\")}));\n                        _picker.hide();\n                        paper.view.draw();\n                    } else {\n                        closeEditor();\n                    }\n                });\n\n                var shiftSize = function(n) {\n                    if (_this.renderer.isEditable()) {\n                        var _newsize = n+(_model.get(\"size\") || 0);\n                        _this.editor_$.find(\"#Rk-Edit-Size-Value\").text((_newsize > 0 ? \"+\" : \"\") + _newsize);\n                        _model.set(\"size\", _newsize);\n                        paper.view.draw();\n                    } else {\n                        closeEditor();\n                    }\n                };\n\n                this.editor_$.find(\"#Rk-Edit-Size-Down\").click(function() {\n                    shiftSize(-1);\n                    return false;\n                });\n                this.editor_$.find(\"#Rk-Edit-Size-Up\").click(function() {\n                    shiftSize(1);\n                    return false;\n                });\n\n                var shiftThickness = function(n) {\n                    if (_this.renderer.isEditable()) {\n                        var _oldThickness = ((_model.has('style') && _model.get('style').thickness) || 1),\n                            _newThickness = n + _oldThickness;\n                        if(_newThickness < 1 ) {\n                            _newThickness = 1;\n                        }\n                        else if (_newThickness > _this.options.node_stroke_witdh_scale) {\n                            _newThickness = _this.options.node_stroke_witdh_scale;\n                        }\n                        if (_newThickness !== _oldThickness) {\n                            _this.editor_$.find(\"#Rk-Edit-Thickness-Value\").text(_newThickness);\n                            _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {thickness: _newThickness}));\n                            paper.view.draw();\n                        }\n                    }\n                    else {\n                        closeEditor();\n                    }\n                };\n\n                this.editor_$.find(\"#Rk-Edit-Thickness-Down\").click(function() {\n                    shiftThickness(-1);\n                    return false;\n                });\n                this.editor_$.find(\"#Rk-Edit-Thickness-Up\").click(function() {\n                    shiftThickness(1);\n                    return false;\n                });\n\n                this.editor_$.find(\".Rk-Edit-Image-Del\").click(function() {\n                    _this.editor_$.find(\".Rk-Edit-Image\").val('');\n                    onFieldChange();\n                    return false;\n                });\n            } else {\n                if (typeof this.source_representation.highlighted === \"object\") {\n                    var titlehtml = this.source_representation.highlighted.replace(_(_model.get(\"title\")).escape(),'<span class=\"Rk-Highlighted\">$1</span>');\n                    this.editor_$.find(\".Rk-Display-Title\" + (_model.get(\"uri\") ? \" a\" : \"\")).html(titlehtml);\n                    if (this.options.show_node_tooltip_description) {\n                        this.editor_$.find(\".Rk-Display-Description\").html(this.source_representation.highlighted.replace(_(_model.get(\"description\")).escape(),'<span class=\"Rk-Highlighted\">$1</span>'));\n                    }\n                }\n            }\n            this.editor_$.find(\"img\").load(function() {\n                _this.redraw();\n            });\n        },\n        redraw: function() {\n            if (this.options.popup_editor){\n                var _coords = this.source_representation.paper_coords;\n                Utils.drawEditBox(this.options, _coords, this.editor_block, this.source_representation.circle_radius * 0.75, this.editor_$);\n            }\n            this.editor_$.show();\n            paper.view.draw();\n        },\n        destroy: function() {\n            if(typeof this.cleanEditor !== 'undefined') {\n                this.cleanEditor();\n            }\n            this.editor_block.remove();\n            this.editor_$.remove();\n        }\n    }).value();\n\n    /* NodeEditor End */\n\n    return NodeEditor;\n\n});\n\n\ndefine('renderer/edgeeditor',['jquery', 'underscore', 'requtils', 'renderer/baseeditor'], function ($, _, requtils, BaseEditor) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* EdgeEditor Begin */\n\n    //var EdgeEditor = Renderer.EdgeEditor = Utils.inherit(Renderer._BaseEditor);\n    var EdgeEditor = Utils.inherit(BaseEditor);\n\n    _(EdgeEditor.prototype).extend({\n        _init: function() {\n          BaseEditor.prototype._init.apply(this);\n          this.template = this.options.templates['templates/edgeeditor.html'];\n          this.readOnlyTemplate = this.options.templates['templates/edgeeditor_readonly.html'];\n        },\n        draw: function() {\n            var _model = this.source_representation.model,\n            _from_model = _model.get(\"from\"),\n            _to_model = _model.get(\"to\"),\n            _created_by = _model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan),\n            _template = (this.renderer.isEditable() ? this.template : this.readOnlyTemplate);\n            this.editor_$\n              .html(_template({\n                edge: {\n                    has_creator: !!_model.get(\"created_by\"),\n                    title: _model.get(\"title\"),\n                    uri: _model.get(\"uri\"),\n                    short_uri:  Utils.shortenText((_model.get(\"uri\") || \"\").replace(/^(https?:\\/\\/)?(www\\.)?/,'').replace(/\\/$/,''),40),\n                    description: _model.get(\"description\"),\n                    color: (_model.has(\"style\") && _model.get(\"style\").color) || _created_by.get(\"color\"),\n                    dash: _model.has(\"style\") && _model.get(\"style\").dash ? \"checked\" : \"\",\n                    arrow: (_model.has(\"style\") && _model.get(\"style\").arrow) || !_model.has(\"style\") || (typeof _model.get(\"style\").arrow === 'undefined') ? \"checked\" : \"\",\n                    thickness: (_model.has(\"style\") && _model.get(\"style\").thickness) || 1,\n                    from_title: _from_model.get(\"title\"),\n                    to_title: _to_model.get(\"title\"),\n                    from_color: (_from_model.has(\"style\") && _from_model.get(\"style\").color) || (_from_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                    to_color: (_to_model.has(\"style\") && _to_model.get(\"style\").color) || (_to_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                    created_by_color: _created_by.get(\"color\"),\n                    created_by_title: _created_by.get(\"title\")\n                },\n                renkan: this.renkan,\n                shortenText: Utils.shortenText,\n                options: this.options\n            }));\n            this.redraw();\n            var _this = this,\n            closeEditor = function() {\n                _this.renderer.removeRepresentation(_this);\n                _this.editor_$.find(\".Rk-Edit-Size-Btn\").off('click');\n                paper.view.draw();\n            };\n            this.editor_$.find(\".Rk-CloseX\").click(closeEditor);\n            this.editor_$.find(\".Rk-Edit-Goto\").click(function() {\n                if (!_model.get(\"uri\")) {\n                    return false;\n                }\n            });\n\n            if (this.renderer.isEditable()) {\n\n                var onFieldChange = _.throttle(function() {\n                    _.defer(function() {\n                        if (_this.renderer.isEditable()) {\n                            var _data = {\n                                title: _this.editor_$.find(\".Rk-Edit-Title\").val()\n                            };\n                            if (_this.options.show_edge_editor_uri) {\n                                _data.uri = _this.editor_$.find(\".Rk-Edit-URI\").val();\n                            }\n                            if (_this.options.show_node_editor_style) {\n                                var dash = _this.editor_$.find(\".Rk-Edit-Dash\").is(':checked'),\n                                    arrow = _this.editor_$.find(\".Rk-Edit-Arrow\").is(':checked');\n                                _data.style = _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {dash: dash, arrow: arrow});\n                            }\n                            _this.editor_$.find(\".Rk-Edit-Goto\").attr(\"href\",_data.uri || \"#\");\n                            _model.set(_data);\n                            paper.view.draw();\n                        } else {\n                            closeEditor();\n                        }\n                    });\n                },500);\n\n                this.editor_$.on(\"keyup\", function(_e) {\n                    if (_e.keyCode === 27) {\n                        closeEditor();\n                    }\n                });\n\n                this.editor_$.find(\"input\").on(\"keyup change paste\", onFieldChange);\n\n                this.editor_$.find(\".Rk-Edit-Vocabulary\").change(function() {\n                    var e = $(this),\n                    v = e.val();\n                    if (v) {\n                        _this.editor_$.find(\".Rk-Edit-Title\").val(e.find(\":selected\").text());\n                        _this.editor_$.find(\".Rk-Edit-URI\").val(v);\n                        onFieldChange();\n                    }\n                });\n                this.editor_$.find(\".Rk-Edit-Direction\").click(function() {\n                    if (_this.renderer.isEditable()) {\n                        _model.set({\n                            from: _model.get(\"to\"),\n                            to: _model.get(\"from\")\n                        });\n                        _this.draw();\n                    } else {\n                        closeEditor();\n                    }\n                });\n\n                var _picker = _this.editor_$.find(\".Rk-Edit-ColorPicker\");\n\n                this.editor_$.find(\".Rk-Edit-ColorPicker-Wrapper\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.show();\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.hide();\n                        }\n                );\n\n                _picker.find(\"li\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", $(this).attr(\"data-color\"));\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", (_model.has(\"style\") && _model.get(\"style\").color)|| (_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(_this.renkan)).get(\"color\"));\n                        }\n                ).click(function(_e) {\n                    _e.preventDefault();\n                    if (_this.renderer.isEditable()) {\n                        _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {color: $(this).attr(\"data-color\")}));\n                        _picker.hide();\n                        paper.view.draw();\n                    } else {\n                        closeEditor();\n                    }\n                });\n                var shiftThickness = function(n) {\n                    if (_this.renderer.isEditable()) {\n                        var _oldThickness = ((_model.has('style') && _model.get('style').thickness) || 1),\n                            _newThickness = n + _oldThickness;\n                        if(_newThickness < 1 ) {\n                            _newThickness = 1;\n                        }\n                        else if (_newThickness > _this.options.node_stroke_witdh_scale) {\n                            _newThickness = _this.options.node_stroke_witdh_scale;\n                        }\n                        if (_newThickness !== _oldThickness) {\n                            _this.editor_$.find(\"#Rk-Edit-Thickness-Value\").text(_newThickness);\n                            _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {thickness: _newThickness}));\n                            paper.view.draw();\n                        }\n                    }\n                    else {\n                        closeEditor();\n                    }\n                };\n\n                this.editor_$.find(\"#Rk-Edit-Thickness-Down\").click(function() {\n                    shiftThickness(-1);\n                    return false;\n                });\n                this.editor_$.find(\"#Rk-Edit-Thickness-Up\").click(function() {\n                    shiftThickness(1);\n                    return false;\n                });\n            }\n        },\n        redraw: function() {\n            if (this.options.popup_editor){\n                var _coords = this.source_representation.paper_coords;\n                Utils.drawEditBox(this.options, _coords, this.editor_block, 5, this.editor_$);\n            }\n            this.editor_$.show();\n            paper.view.draw();\n        }\n    }).value();\n\n    /* EdgeEditor End */\n\n    return EdgeEditor;\n\n});\n\n\ndefine('renderer/nodebutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* _NodeButton Begin */\n\n    //var _NodeButton = Renderer._NodeButton = Utils.inherit(Renderer._BaseButton);\n    var _NodeButton = Utils.inherit(BaseButton);\n\n    _(_NodeButton.prototype).extend({\n        setSectorSize: function() {\n            var sectorInner = this.source_representation.circle_radius;\n            if (sectorInner !== this.lastSectorInner) {\n                if (this.sector) {\n                    this.sector.destroy();\n                }\n                this.sector = this.renderer.drawSector(\n                        this, 1 + sectorInner,\n                        Utils._NODE_BUTTON_WIDTH + sectorInner,\n                        this.startAngle,\n                        this.endAngle,\n                        1,\n                        this.imageName,\n                        this.renkan.translate(this.text)\n                );\n                this.lastSectorInner = sectorInner;\n            }\n        },\n        unselect: function() {\n            BaseButton.prototype.unselect.apply(this, Array.prototype.slice.call(arguments, 1));\n            if(this.source_representation && this.source_representation.buttons_timeout) {\n                clearTimeout(this.source_representation.buttons_timeout);\n                this.source_representation.hideButtons();\n            }\n        },\n        select: function() {\n            if(this.source_representation && this.source_representation.buttons_timeout) {\n                clearTimeout(this.source_representation.buttons_timeout);\n            }\n            this.sector.select();\n        },\n    }).value();\n\n\n    /* _NodeButton End */\n\n    return _NodeButton;\n\n});\n\n\ndefine('renderer/nodeeditbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeEditButton Begin */\n\n    //var NodeEditButton = Renderer.NodeEditButton = Utils.inherit(Renderer._NodeButton);\n    var NodeEditButton = Utils.inherit(NodeButton);\n\n    _(NodeEditButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-edit-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -125 : -135;\n            this.endAngle = this.options.hide_nodes ? -55 : -45;\n            this.imageName = \"edit\";\n            this.text = \"Edit\";\n        },\n        mouseup: function() {\n            if (!this.renderer.is_dragging) {\n                this.source_representation.openEditor();\n            }\n        }\n    }).value();\n\n    /* NodeEditButton End */\n\n    return NodeEditButton;\n\n});\n\n\ndefine('renderer/noderemovebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeRemoveButton Begin */\n\n    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);\n    var NodeRemoveButton = Utils.inherit(NodeButton);\n\n    _(NodeRemoveButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-remove-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -10 : 0;\n            this.endAngle = this.options.hide_nodes ? 45 : 90;\n            this.imageName = \"remove\";\n            this.text = \"Remove\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                if (this.options.element_delete_delay) {\n                    var delid = Utils.getUID(\"delete\");\n                    this.renderer.delete_list.push({\n                        id: delid,\n                        time: new Date().valueOf() + this.options.element_delete_delay\n                    });\n                    this.source_representation.model.set(\"delete_scheduled\", delid);\n                } else {\n                    if (confirm(this.renkan.translate('Do you really wish to remove node ') + '\"' + this.source_representation.model.get(\"title\") + '\"?')) {\n                        this.project.removeNode(this.source_representation.model);\n                    }\n                }\n            }\n        }\n    }).value();\n\n    /* NodeRemoveButton End */\n\n    return NodeRemoveButton;\n\n});\n\n\ndefine('renderer/nodehidebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeRemoveButton Begin */\n\n    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);\n    var NodeHideButton = Utils.inherit(NodeButton);\n\n    _(NodeHideButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-hide-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = 45;\n            this.endAngle = 90;\n            this.imageName = \"hide\";\n            this.text = \"Hide\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                this.renderer.view.addHiddenNode(this.source_representation.model);\n            }\n        }\n    }).value();\n\n    /* NodeRemoveButton End */\n\n    return NodeHideButton;\n\n});\n\n\ndefine('renderer/nodeshowbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeRemoveButton Begin */\n\n    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);\n    var NodeShowButton = Utils.inherit(NodeButton);\n\n    _(NodeShowButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-show-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = 90;\n            this.endAngle = 135;\n            this.imageName = \"show\";\n            this.text = \"Show\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                this.source_representation.showNeighbors(false);\n            }\n        }\n    }).value();\n\n    /* NodeShowButton End */\n\n    return NodeShowButton;\n\n});\n\n\ndefine('renderer/noderevertbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeRevertButton Begin */\n\n    //var NodeRevertButton = Renderer.NodeRevertButton = Utils.inherit(Renderer._NodeButton);\n    var NodeRevertButton = Utils.inherit(NodeButton);\n\n    _(NodeRevertButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-revert-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = -135;\n            this.endAngle = 135;\n            this.imageName = \"revert\";\n            this.text = \"Cancel deletion\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            if (this.renderer.isEditable()) {\n                this.source_representation.model.unset(\"delete_scheduled\");\n            }\n        }\n    }).value();\n\n    /* NodeRevertButton End */\n\n    return NodeRevertButton;\n\n});\n\n\ndefine('renderer/nodelinkbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeLinkButton Begin */\n\n    //var NodeLinkButton = Renderer.NodeLinkButton = Utils.inherit(Renderer._NodeButton);\n    var NodeLinkButton = Utils.inherit(NodeButton);\n\n    _(NodeLinkButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-link-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? 135 : 90;\n            this.endAngle = this.options.hide_nodes ? 190 : 180;\n            this.imageName = \"link\";\n            this.text = \"Link to another node\";\n        },\n        mousedown: function(_event, _isTouch) {\n            if (this.renderer.isEditable()) {\n                var _off = this.renderer.canvas_$.offset(),\n                _point = new paper.Point([\n                                          _event.pageX - _off.left,\n                                          _event.pageY - _off.top\n                                          ]);\n                this.renderer.click_target = null;\n                this.renderer.removeRepresentationsOfType(\"editor\");\n                this.renderer.addTempEdge(this.source_representation, _point);\n            }\n        }\n    }).value();\n\n    /* NodeLinkButton End */\n\n    return NodeLinkButton;\n\n});\n\n\n\ndefine('renderer/nodeenlargebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeEnlargeButton Begin */\n\n    //var NodeEnlargeButton = Renderer.NodeEnlargeButton = Utils.inherit(Renderer._NodeButton);\n    var NodeEnlargeButton = Utils.inherit(NodeButton);\n\n    _(NodeEnlargeButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-enlarge-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -55 : -45;\n            this.endAngle = this.options.hide_nodes ? -10 : 0;\n            this.imageName = \"enlarge\";\n            this.text = \"Enlarge\";\n        },\n        mouseup: function() {\n            var _newsize = 1 + (this.source_representation.model.get(\"size\") || 0);\n            this.source_representation.model.set(\"size\", _newsize);\n            this.source_representation.select();\n            this.select();\n            paper.view.draw();\n        }\n    }).value();\n\n    /* NodeEnlargeButton End */\n\n    return NodeEnlargeButton;\n\n});\n\n\ndefine('renderer/nodeshrinkbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeShrinkButton Begin */\n\n    //var NodeShrinkButton = Renderer.NodeShrinkButton = Utils.inherit(Renderer._NodeButton);\n    var NodeShrinkButton = Utils.inherit(NodeButton);\n\n    _(NodeShrinkButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-shrink-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -170 : -180;\n            this.endAngle = this.options.hide_nodes ? -125 : -135;\n            this.imageName = \"shrink\";\n            this.text = \"Shrink\";\n        },\n        mouseup: function() {\n            var _newsize = -1 + (this.source_representation.model.get(\"size\") || 0);\n            this.source_representation.model.set(\"size\", _newsize);\n            this.source_representation.select();\n            this.select();\n            paper.view.draw();\n        }\n    }).value();\n\n    /* NodeShrinkButton End */\n\n    return NodeShrinkButton;\n\n});\n\n\ndefine('renderer/edgeeditbutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* EdgeEditButton Begin */\n\n    //var EdgeEditButton = Renderer.EdgeEditButton = Utils.inherit(Renderer._BaseButton);\n    var EdgeEditButton = Utils.inherit(BaseButton);\n\n    _(EdgeEditButton.prototype).extend({\n        _init: function() {\n            this.type = \"Edge-edit-button\";\n            this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -270, -90, 1, \"edit\", this.renkan.translate(\"Edit\"));\n        },\n        mouseup: function() {\n            if (!this.renderer.is_dragging) {\n                this.source_representation.openEditor();\n            }\n        }\n    }).value();\n\n    /* EdgeEditButton End */\n\n    return EdgeEditButton;\n\n});\n\n\ndefine('renderer/edgeremovebutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* EdgeRemoveButton Begin */\n\n    //var EdgeRemoveButton = Renderer.EdgeRemoveButton = Utils.inherit(Renderer._BaseButton);\n    var EdgeRemoveButton = Utils.inherit(BaseButton);\n\n    _(EdgeRemoveButton.prototype).extend({\n        _init: function() {\n            this.type = \"Edge-remove-button\";\n            this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -90, 90, 1, \"remove\", this.renkan.translate(\"Remove\"));\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                if (this.options.element_delete_delay) {\n                    var delid = Utils.getUID(\"delete\");\n                    this.renderer.delete_list.push({\n                        id: delid,\n                        time: new Date().valueOf() + this.options.element_delete_delay\n                    });\n                    this.source_representation.model.set(\"delete_scheduled\", delid);\n                } else {\n                    if (confirm(this.renkan.translate('Do you really wish to remove edge ') + '\"' + this.source_representation.model.get(\"title\") + '\"?')) {\n                        this.project.removeEdge(this.source_representation.model);\n                    }\n                }\n            }\n        }\n    }).value();\n\n    /* EdgeRemoveButton End */\n\n    return EdgeRemoveButton;\n\n});\n\n\ndefine('renderer/edgerevertbutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* EdgeRevertButton Begin */\n\n    //var EdgeRevertButton = Renderer.EdgeRevertButton = Utils.inherit(Renderer._BaseButton);\n    var EdgeRevertButton = Utils.inherit(BaseButton);\n\n    _(EdgeRevertButton.prototype).extend({\n        _init: function() {\n            this.type = \"Edge-revert-button\";\n            this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -135, 135, 1, \"revert\", this.renkan.translate(\"Cancel deletion\"));\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            if (this.renderer.isEditable()) {\n                this.source_representation.model.unset(\"delete_scheduled\");\n            }\n        }\n    }).value();\n\n    /* EdgeRevertButton End */\n\n    return EdgeRevertButton;\n\n});\n\n\ndefine('renderer/miniframe',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* MiniFrame Begin */\n\n    //var MiniFrame = Renderer.MiniFrame = Utils.inherit(Renderer._BaseRepresentation);\n    var MiniFrame = Utils.inherit(BaseRepresentation);\n\n    _(MiniFrame.prototype).extend({\n        paperShift: function(_delta) {\n            this.renderer.offset = this.renderer.offset.subtract(_delta.divide(this.renderer.minimap.scale).multiply(this.renderer.scale));\n            this.renderer.redraw();\n        },\n        mouseup: function(_delta) {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n        }\n    }).value();\n\n\n    /* MiniFrame End */\n\n    return MiniFrame;\n\n});\n\n\ndefine('renderer/scene',['jquery', 'underscore', 'filesaver', 'requtils', 'renderer/miniframe'], function ($, _, filesaver, requtils, MiniFrame) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* Scene Begin */\n\n    var Scene = function(_renkan) {\n        this.renkan = _renkan;\n        this.$ = $(\".Rk-Render\");\n        this.representations = [];\n        this.$.html(_renkan.options.templates['templates/scene.html'](_renkan));\n        this.onStatusChange();\n        this.canvas_$ = this.$.find(\".Rk-Canvas\");\n        this.labels_$ = this.$.find(\".Rk-Labels\");\n        if (!_renkan.options.popup_editor){\n            this.editor_$ = $(\"#\" + _renkan.options.editor_panel);\n        }else{\n            this.editor_$ = this.$.find(\".Rk-Editor\");\n        }\n        this.notif_$ = this.$.find(\".Rk-Notifications\");\n        paper.setup(this.canvas_$[0]);\n        this.totalScroll = 0;\n        this.mouse_down = false;\n        this.click_target = null;\n        this.selected_target = null;\n        this.edge_layer = new paper.Layer();\n        this.node_layer = new paper.Layer();\n        this.buttons_layer = new paper.Layer();\n        this.delete_list = [];\n        this.redrawActive = true;\n\n        if (_renkan.options.show_minimap) {\n            this.minimap = {\n                    background_layer: new paper.Layer(),\n                    edge_layer: new paper.Layer(),\n                    node_layer: new paper.Layer(),\n                    node_group: new paper.Group(),\n                    size: new paper.Size( _renkan.options.minimap_width, _renkan.options.minimap_height )\n            };\n\n            this.minimap.background_layer.activate();\n            this.minimap.topleft = paper.view.bounds.bottomRight.subtract(this.minimap.size);\n            this.minimap.rectangle = new paper.Path.Rectangle(this.minimap.topleft.subtract([2,2]), this.minimap.size.add([4,4]));\n            this.minimap.rectangle.fillColor = _renkan.options.minimap_background_color;\n            this.minimap.rectangle.strokeColor = _renkan.options.minimap_border_color;\n            this.minimap.rectangle.strokeWidth = 4;\n            this.minimap.offset = new paper.Point(this.minimap.size.divide(2));\n            this.minimap.scale = 0.1;\n\n            this.minimap.node_layer.activate();\n            this.minimap.cliprectangle = new paper.Path.Rectangle(this.minimap.topleft, this.minimap.size);\n            this.minimap.node_group.addChild(this.minimap.cliprectangle);\n            this.minimap.node_group.clipped = true;\n            this.minimap.miniframe = new paper.Path.Rectangle(this.minimap.topleft, this.minimap.size);\n            this.minimap.node_group.addChild(this.minimap.miniframe);\n            this.minimap.miniframe.fillColor = '#c0c0ff';\n            this.minimap.miniframe.opacity = 0.3;\n            this.minimap.miniframe.strokeColor = '#000080';\n            this.minimap.miniframe.strokeWidth = 2;\n            this.minimap.miniframe.__representation = new MiniFrame(this, null);\n        }\n\n        this.throttledPaperDraw = _(function() {\n            paper.view.draw();\n        }).throttle(100).value();\n\n        this.bundles = [];\n        this.click_mode = false;\n\n        var _this = this,\n        _allowScroll = true,\n        _originalScale = 1,\n        _zooming = false,\n        _lastTapX = 0,\n        _lastTapY = 0;\n\n        this.image_cache = {};\n        this.icon_cache = {};\n\n        ['edit', 'remove', 'hide', 'show', 'link', 'enlarge', 'shrink', 'revert' ].forEach(function(imgname) {\n            var img = new Image();\n            img.src = _renkan.options.static_url + 'img/' + imgname + '.png';\n            _this.icon_cache[imgname] = img;\n        });\n\n        var throttledMouseMove = _.throttle(function(_event, _isTouch) {\n            _this.onMouseMove(_event, _isTouch);\n        }, Utils._MOUSEMOVE_RATE);\n\n        this.canvas_$.on({\n            mousedown: function(_event) {\n                _event.preventDefault();\n                _this.onMouseDown(_event, false);\n            },\n            mousemove: function(_event) {\n                _event.preventDefault();\n                throttledMouseMove(_event, false);\n            },\n            mouseup: function(_event) {\n                _event.preventDefault();\n                _this.onMouseUp(_event, false);\n            },\n            mousewheel: function(_event, _delta) {\n                if(_renkan.options.zoom_on_scroll) {\n                    _event.preventDefault();\n                    if (_allowScroll) {\n                        _this.onScroll(_event, _delta);\n                    }\n                }\n            },\n            touchstart: function(_event) {\n                _event.preventDefault();\n                var _touches = _event.originalEvent.touches[0];\n                if (\n                        _renkan.options.allow_double_click &&\n                        new Date() - _lastTap < Utils._DOUBLETAP_DELAY &&\n                        ( Math.pow(_lastTapX - _touches.pageX, 2) + Math.pow(_lastTapY - _touches.pageY, 2) < Utils._DOUBLETAP_DISTANCE )\n                ) {\n                    _lastTap = 0;\n                    _this.onDoubleClick(_touches);\n                } else {\n                    _lastTap = new Date();\n                    _lastTapX = _touches.pageX;\n                    _lastTapY = _touches.pageY;\n                    _originalScale = _this.view.scale;\n                    _zooming = false;\n                    _this.onMouseDown(_touches, true);\n                }\n            },\n            touchmove: function(_event) {\n                _event.preventDefault();\n                _lastTap = 0;\n                if (_event.originalEvent.touches.length === 1) {\n                    _this.onMouseMove(_event.originalEvent.touches[0], true);\n                } else {\n                    if (!_zooming) {\n                        _this.onMouseUp(_event.originalEvent.touches[0], true);\n                        _this.click_target = null;\n                        _this.is_dragging = false;\n                        _zooming = true;\n                    }\n                    if (_event.originalEvent.scale === \"undefined\") {\n                        return;\n                    }\n                    var _newScale = _event.originalEvent.scale * _originalScale,\n                    _scaleRatio = _newScale / _this.view.scale,\n                    _newOffset = new paper.Point([\n                                                  _this.canvas_$.width(),\n                                                  _this.canvas_$.height()\n                                                  ]).multiply( 0.5 * ( 1 - _scaleRatio ) ).add(_this.view.offset.multiply( _scaleRatio ));\n                    _this.view.setScale(_newScale, _newOffset);\n                }\n            },\n            touchend: function(_event) {\n                _event.preventDefault();\n                _this.onMouseUp(_event.originalEvent.changedTouches[0], true);\n            },\n            dblclick: function(_event) {\n                _event.preventDefault();\n                if (_renkan.options.allow_double_click) {\n                    _this.onDoubleClick(_event);\n                }\n            },\n            mouseleave: function(_event) {\n                _event.preventDefault();\n                //_this.onMouseUp(_event, false);\n                _this.click_target = null;\n                _this.is_dragging = false;\n            },\n            dragover: function(_event) {\n                _event.preventDefault();\n            },\n            dragenter: function(_event) {\n                _event.preventDefault();\n                _allowScroll = false;\n            },\n            dragleave: function(_event) {\n                _event.preventDefault();\n                _allowScroll = true;\n            },\n            drop: function(_event) {\n                _event.preventDefault();\n                _allowScroll = true;\n                var res = {};\n                _.each(_event.originalEvent.dataTransfer.types, function(t) {\n                    try {\n                        res[t] = _event.originalEvent.dataTransfer.getData(t);\n                    } catch(e) {}\n                });\n                var text = _event.originalEvent.dataTransfer.getData(\"Text\");\n                if (typeof text === \"string\") {\n                    switch(text[0]) {\n                    case \"{\":\n                    case \"[\":\n                        try {\n                            var data = JSON.parse(text);\n                            _.extend(res,data);\n                        }\n                        catch(e) {\n                            if (!res[\"text/plain\"]) {\n                                res[\"text/plain\"] = text;\n                            }\n                        }\n                        break;\n                    case \"<\":\n                        if (!res[\"text/html\"]) {\n                            res[\"text/html\"] = text;\n                        }\n                        break;\n                    default:\n                        if (!res[\"text/plain\"]) {\n                            res[\"text/plain\"] = text;\n                        }\n                    }\n                }\n                var url = _event.originalEvent.dataTransfer.getData(\"URL\");\n                if (url && !res[\"text/uri-list\"]) {\n                    res[\"text/uri-list\"] = url;\n                }\n                _this.dropData(res, _event.originalEvent);\n            }\n        });\n\n        var bindClick = function(selector, fname) {\n            _this.$.find(selector).click(function(evt) {\n                _this[fname](evt);\n                return false;\n            });\n        };\n\n        if(this.renkan.project.get(\"views\").length > 0 && this.renkan.options.save_view){\n            this.$.find(\".Rk-ZoomSetSaved\").show();\n        }\n        this.$.find(\".Rk-CurrentUser\").mouseenter(\n                function() { _this.$.find(\".Rk-UserList\").slideDown(); }\n        );\n        this.$.find(\".Rk-Users\").mouseleave(\n                function() { _this.$.find(\".Rk-UserList\").slideUp(); }\n        );\n        bindClick(\".Rk-FullScreen-Button\", \"fullScreen\");\n        bindClick(\".Rk-AddNode-Button\", \"addNodeBtn\");\n        bindClick(\".Rk-AddEdge-Button\", \"addEdgeBtn\");\n        bindClick(\".Rk-Save-Button\", \"save\");\n        bindClick(\".Rk-Open-Button\", \"open\");\n        bindClick(\".Rk-Export-Button\", \"exportProject\");\n        this.$.find(\".Rk-Bookmarklet-Button\")\n          /*jshint scripturl:true */\n          .attr(\"href\",\"javascript:\" + Utils._BOOKMARKLET_CODE(_renkan))\n          .click(function(){\n              _this.notif_$\n              .text(_renkan.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.\"))\n              .fadeIn()\n              .delay(5000)\n              .fadeOut();\n              return false;\n          });\n        this.$.find(\".Rk-TopBar-Button\").mouseover(function() {\n            $(this).find(\".Rk-TopBar-Tooltip\").show();\n        }).mouseout(function() {\n            $(this).find(\".Rk-TopBar-Tooltip\").hide();\n        });\n        bindClick(\".Rk-Fold-Bins\", \"foldBins\");\n\n        paper.view.onResize = function(_event) {\n            var _ratio,\n                newWidth = _event.width,\n                newHeight = _event.height;\n\n            if (_this.minimap) {\n                _this.minimap.topleft = paper.view.bounds.bottomRight.subtract(_this.minimap.size);\n                _this.minimap.rectangle.fitBounds(_this.minimap.topleft.subtract([2,2]), _this.minimap.size.add([4,4]));\n                _this.minimap.cliprectangle.fitBounds(_this.minimap.topleft, _this.minimap.size);\n            }\n\n            var ratioH = newHeight/(newHeight-_event.delta.height),\n                ratioW = newWidth/(newWidth-_event.delta.width);\n            if (newHeight < newWidth) {\n                    _ratio = ratioH;\n            } else {\n                _ratio = ratioW;\n            }\n\n            _this.view.resizeZoom(ratioW, ratioH, _ratio);\n\n            _this.redraw();\n\n        };\n\n        var _thRedraw = _.throttle(function() {\n            _this.redraw();\n        },50);\n           \n        this.addRepresentations(\"Node\", this.renkan.project.get(\"nodes\"));\n        this.addRepresentations(\"Edge\", this.renkan.project.get(\"edges\"));\n        this.renkan.project.on(\"change:title\", function() {\n            _this.$.find(\".Rk-PadTitle\").val(_renkan.project.get(\"title\"));\n        });\n\n        this.$.find(\".Rk-PadTitle\").on(\"keyup input paste\", function() {\n            _renkan.project.set({\"title\": $(this).val()});\n        });\n\n        var _thRedrawUsers = _.throttle(function() {\n            _this.redrawUsers();\n        }, 100);\n\n        _thRedrawUsers();\n\n        // register model events\n        this.renkan.project.on(\"change:saveStatus\", function(){\n            switch (_this.renkan.project.get(\"saveStatus\")) {\n                case 0: //clean\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"to-save\");\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saving\");\n                    _this.$.find(\".Rk-Save-Button\").addClass(\"saved\");\n                    break;\n                case 1: //dirty\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saved\");\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saving\");\n                    _this.$.find(\".Rk-Save-Button\").addClass(\"to-save\");\n                    break;\n                case 2: //saving\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saved\");\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"to-save\");\n                    _this.$.find(\".Rk-Save-Button\").addClass(\"saving\");\n                    break;\n            }\n        });\n\n        this.renkan.project.on(\"change:loadingStatus\", function(){\n            if (_this.renkan.project.get(\"loadingStatus\")){\n                var animate = _this.$.find(\".loader\").addClass(\"run\");\n                var timer = setTimeout(function(){\n                    _this.$.find(\".loader\").hide(250);\n                }, 3000);\n            }\n            else{\n                Backbone.history.start();\n                _thRedraw();\n            }\n        });\n\n        this.renkan.project.on(\"add:users remove:users\", _thRedrawUsers);\n\n        this.renkan.project.on(\"add:views remove:views\", function(_node) {\n            if(_this.renkan.project.get('views').length > 0) {\n                _this.$.find(\".Rk-ZoomSetSaved\").show();\n            }\n            else {\n                _this.$.find(\".Rk-ZoomSetSaved\").hide();\n            }\n        });\n\n        this.renkan.project.on(\"add:nodes\", function(_node) {\n            _this.addRepresentation(\"Node\", _node);\n            if (!_this.renkan.project.get(\"loadingStatus\")){\n                _thRedraw();\n            }\n        });\n        this.renkan.project.on(\"add:edges\", function(_edge) {\n            _this.addRepresentation(\"Edge\", _edge);\n            if (!_this.renkan.project.get(\"loadingStatus\")){\n                _thRedraw();\n            }\n        });\n        this.renkan.project.on(\"change:title\", function(_model, _title) {\n            var el = _this.$.find(\".Rk-PadTitle\");\n            if (el.is(\"input\")) {\n                if (el.val() !== _title) {\n                    el.val(_title);\n                }\n            } else {\n                el.text(_title);\n            }\n        });\n        \n        //register router events\n        this.renkan.router.on(\"router\", function(_params){\n            _this.parameters(_params);\n        });\n\n        if (_renkan.options.size_bug_fix) {\n            var _delay = (\n                    typeof _renkan.options.size_bug_fix === \"number\" ?\n                        _renkan.options.size_bug_fix\n                                : 500\n            );\n            window.setTimeout(\n                    function() {\n                        _this.fixSize();\n                    },\n                    _delay\n            );\n        }\n\n        if (_renkan.options.force_resize) {\n            $(window).resize(function() {\n                _this.autoScale();\n            });\n        }\n\n        if (_renkan.options.show_user_list && _renkan.options.user_color_editable) {\n            var $cpwrapper = this.$.find(\".Rk-Users .Rk-Edit-ColorPicker-Wrapper\"),\n            $cplist = this.$.find(\".Rk-Users .Rk-Edit-ColorPicker\");\n\n            $cpwrapper.hover(\n                    function(_e) {\n                        if (_this.isEditable()) {\n                            _e.preventDefault();\n                            $cplist.show();\n                        }\n                    },\n                    function(_e) {\n                        _e.preventDefault();\n                        $cplist.hide();\n                    }\n            );\n\n            $cplist.find(\"li\").mouseenter(\n                    function(_e) {\n                        if (_this.isEditable()) {\n                            _e.preventDefault();\n                            _this.$.find(\".Rk-CurrentUser-Color\").css(\"background\", $(this).attr(\"data-color\"));\n                        }\n                    }\n            );\n        }\n\n        if (_renkan.options.show_search_field) {\n\n            var lastval = '';\n\n            this.$.find(\".Rk-GraphSearch-Field\").on(\"keyup change paste input\", function() {\n                var $this = $(this),\n                val = $this.val();\n                if (val === lastval) {\n                    return;\n                }\n                lastval = val;\n                if (val.length < 2) {\n                    _renkan.project.get(\"nodes\").each(function(n) {\n                        _this.getRepresentationByModel(n).unhighlight();\n                    });\n                } else {\n                    var rxs = Utils.regexpFromTextOrArray(val);\n                    _renkan.project.get(\"nodes\").each(function(n) {\n                        if (rxs.test(n.get(\"title\")) || rxs.test(n.get(\"description\"))) {\n                            _this.getRepresentationByModel(n).highlight(rxs);\n                        } else {\n                            _this.getRepresentationByModel(n).unhighlight();\n                        }\n                    });\n                }\n            });\n        }\n\n        this.redraw();\n\n        window.setInterval(function() {\n            var _now = new Date().valueOf();\n            _this.delete_list.forEach(function(d) {\n                if (_now >= d.time) {\n                    var el = _renkan.project.get(\"nodes\").findWhere({\"delete_scheduled\":d.id});\n                    if (el) {\n                        project.removeNode(el);\n                    }\n                    el = _renkan.project.get(\"edges\").findWhere({\"delete_scheduled\":d.id});\n                    if (el) {\n                        project.removeEdge(el);\n                    }\n                }\n            });\n            _this.delete_list = _this.delete_list.filter(function(d) {\n                return _renkan.project.get(\"nodes\").findWhere({\"delete_scheduled\":d.id}) || _renkan.project.get(\"edges\").findWhere({\"delete_scheduled\":d.id});\n            });\n        }, 500);\n\n        if (this.minimap) {\n            window.setInterval(function() {\n                _this.rescaleMinimap();\n            }, 2000);\n        }\n\n    };\n\n    _(Scene.prototype).extend({\n        fixSize: function() {\n            if(typeof this.view === 'undefined') {\n                this.view = this.addRepresentation(\"View\", this.renkan.project.get(\"views\").last());\n                this.view.setScale(view.get(\"zoom_level\"), new paper.Point(view.get(\"offset\")));\n            }\n            else{\n                this.view.autoScale();\n            }\n        },\n        drawSector: function(_repr, _inR, _outR, _startAngle, _endAngle, _padding, _imgname, _caption) {\n            var _options = this.renkan.options,\n                _startRads = _startAngle * Math.PI / 180,\n                _endRads = _endAngle * Math.PI / 180,\n                _img = this.icon_cache[_imgname],\n                _startdx = - Math.sin(_startRads),\n                _startdy = Math.cos(_startRads),\n                _startXIn = Math.cos(_startRads) * _inR + _padding * _startdx,\n                _startYIn = Math.sin(_startRads) * _inR + _padding * _startdy,\n                _startXOut = Math.cos(_startRads) * _outR + _padding * _startdx,\n                _startYOut = Math.sin(_startRads) * _outR + _padding * _startdy,\n                _enddx = - Math.sin(_endRads),\n                _enddy = Math.cos(_endRads),\n                _endXIn = Math.cos(_endRads) * _inR - _padding * _enddx,\n                _endYIn = Math.sin(_endRads) * _inR - _padding * _enddy,\n                _endXOut = Math.cos(_endRads) * _outR - _padding * _enddx,\n                _endYOut = Math.sin(_endRads) * _outR - _padding * _enddy,\n                _centerR = (_inR + _outR) / 2,\n                _centerRads = (_startRads + _endRads) / 2,\n                _centerX = Math.cos(_centerRads) * _centerR,\n                _centerY = Math.sin(_centerRads) * _centerR,\n                _centerXIn = Math.cos(_centerRads) * _inR,\n                _centerXOut = Math.cos(_centerRads) * _outR,\n                _centerYIn = Math.sin(_centerRads) * _inR,\n                _centerYOut = Math.sin(_centerRads) * _outR,\n                _textX = Math.cos(_centerRads) * (_outR + 3),\n                _textY = Math.sin(_centerRads) * (_outR + _options.buttons_label_font_size) + _options.buttons_label_font_size / 2;\n            this.buttons_layer.activate();\n            var _path = new paper.Path();\n            _path.add([_startXIn, _startYIn]);\n            _path.arcTo([_centerXIn, _centerYIn], [_endXIn, _endYIn]);\n            _path.lineTo([_endXOut,  _endYOut]);\n            _path.arcTo([_centerXOut, _centerYOut], [_startXOut, _startYOut]);\n            _path.fillColor = _options.buttons_background;\n            _path.opacity = 0.5;\n            _path.closed = true;\n            _path.__representation = _repr;\n            var _text = new paper.PointText(_textX,_textY);\n            _text.characterStyle = {\n                    fontSize: _options.buttons_label_font_size,\n                    fillColor: _options.buttons_label_color\n            };\n            if (_textX > 2) {\n                _text.paragraphStyle.justification = 'left';\n            } else if (_textX < -2) {\n                _text.paragraphStyle.justification = 'right';\n            } else {\n                _text.paragraphStyle.justification = 'center';\n            }\n            _text.visible = false;\n            var _visible = false,\n                _restPos = new paper.Point(-200, -200),\n                _grp = new paper.Group([_path, _text]),\n                //_grp = new paper.Group([_path]),\n                _delta = _grp.position,\n                _imgdelta = new paper.Point([_centerX, _centerY]),\n                _currentPos = new paper.Point(0,0);\n            _text.content = _caption;\n            // set group pivot to not depend on text visibility that changes the group bounding box.\n            _grp.pivot = _grp.bounds.center;\n            _grp.visible = false;\n            _grp.position = _restPos;\n            var _res = {\n                    show: function() {\n                        _visible = true;\n                        _grp.position = _currentPos.add(_delta);\n                        _grp.visible = true;\n                    },\n                    moveTo: function(_point) {\n                        _currentPos = _point;\n                        if (_visible) {\n                            _grp.position = _point.add(_delta);\n                        }\n                    },\n                    hide: function() {\n                        _visible = false;\n                        _grp.visible = false;\n                        _grp.position = _restPos;\n                    },\n                    select: function() {\n                        _path.opacity = 0.8;\n                        _text.visible = true;\n                    },\n                    unselect: function() {\n                        _path.opacity = 0.5;\n                        _text.visible = false;\n                    },\n                    destroy: function() {\n                        _grp.remove();\n                    }\n            };\n            var showImage = function() {\n                var _raster = new paper.Raster(_img);\n                _raster.position = _imgdelta.add(_grp.position).subtract(_delta);\n                _raster.locked = true; // Disable mouse events on icon\n                _grp.addChild(_raster);\n            };\n            if (_img.width) {\n                showImage();\n            } else {\n                $(_img).on(\"load\",showImage);\n            }\n\n            return _res;\n        },\n        addToBundles: function(_edgeRepr) {\n            var _bundle = _(this.bundles).find(function(_bundle) {\n                return (\n                        ( _bundle.from === _edgeRepr.from_representation && _bundle.to === _edgeRepr.to_representation ) ||\n                        ( _bundle.from === _edgeRepr.to_representation && _bundle.to === _edgeRepr.from_representation )\n                );\n            });\n            if (typeof _bundle !== \"undefined\") {\n                _bundle.edges.push(_edgeRepr);\n            } else {\n                _bundle = {\n                        from: _edgeRepr.from_representation,\n                        to: _edgeRepr.to_representation,\n                        edges: [ _edgeRepr ],\n                        getPosition: function(_er) {\n                            var _dir = (_er.from_representation === this.from) ? 1 : -1;\n                            return _dir * ( _(this.edges).indexOf(_er) - (this.edges.length - 1) / 2 );\n                        }\n                };\n                this.bundles.push(_bundle);\n            }\n            return _bundle;\n        },\n        isEditable: function() {\n            return (this.renkan.options.editor_mode && !this.renkan.read_only);\n        },\n        onStatusChange: function() {\n            var savebtn = this.$.find(\".Rk-Save-Button\"),\n            tip = savebtn.find(\".Rk-TopBar-Tooltip-Contents\");\n            if (this.renkan.read_only) {\n                savebtn.removeClass(\"disabled Rk-Save-Online\").addClass(\"Rk-Save-ReadOnly\");\n                tip.text(this.renkan.translate(\"Connection lost\"));\n            } else {\n                if (this.renkan.options.manual_save) {\n                    savebtn.removeClass(\"Rk-Save-ReadOnly Rk-Save-Online\");\n                    tip.text(this.renkan.translate(\"Save Project\"));\n                } else {\n                    savebtn.removeClass(\"disabled Rk-Save-ReadOnly\").addClass(\"Rk-Save-Online\");\n                    tip.text(this.renkan.translate(\"Auto-save enabled\"));\n                }\n            }\n            this.redrawUsers();\n        },\n        redrawMiniframe: function() {\n            var topleft = this.toMinimapCoords(this.toModelCoords(new paper.Point([0,0]))),\n                bottomright = this.toMinimapCoords(this.toModelCoords(paper.view.bounds.bottomRight));\n            this.minimap.miniframe.fitBounds(topleft, bottomright);\n        },\n        rescaleMinimap: function() {\n            var nodes = this.renkan.project.get(\"nodes\");\n            if (nodes.length > 1) {\n                var _xx = nodes.map(function(_node) { return _node.get(\"position\").x; }),\n                    _yy = nodes.map(function(_node) { return _node.get(\"position\").y; }),\n                    _minx = Math.min.apply(Math, _xx),\n                    _miny = Math.min.apply(Math, _yy),\n                    _maxx = Math.max.apply(Math, _xx),\n                    _maxy = Math.max.apply(Math, _yy);\n                var _scale = Math.min(\n                        this.view.scale * 0.8 * this.renkan.options.minimap_width / paper.view.bounds.width,\n                        this.view.scale * 0.8 * this.renkan.options.minimap_height / paper.view.bounds.height,\n                        ( this.renkan.options.minimap_width - 2 * this.renkan.options.minimap_padding ) / (_maxx - _minx),\n                        ( this.renkan.options.minimap_height - 2 * this.renkan.options.minimap_padding ) / (_maxy - _miny)\n                );\n                this.minimap.offset = this.minimap.size.divide(2).subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale));\n                this.minimap.scale = _scale;\n            }\n            if (nodes.length === 1) {\n                this.minimap.scale = 0.1;\n                this.minimap.offset = this.minimap.size.divide(2).subtract(new paper.Point([nodes.at(0).get(\"position\").x, nodes.at(0).get(\"position\").y]).multiply(this.minimap.scale));\n            }\n            this.redraw();\n        },\n        toPaperCoords: function(_point) {\n            return _point.multiply(this.view.scale).add(this.view.offset);\n        },\n        toMinimapCoords: function(_point) {\n            return _point.multiply(this.minimap.scale).add(this.minimap.offset).add(this.minimap.topleft);\n        },\n        toModelCoords: function(_point) {\n            return _point.subtract(this.view.offset).divide(this.view.scale);\n        },\n        addRepresentation: function(_type, _model) {\n            var RendererType = requtils.getRenderer()[_type];\n            var _repr = new RendererType(this, _model);\n            this.representations.push(_repr);\n            return _repr;                \n        },\n        addRepresentations: function(_type, _collection) {\n            var _this = this;\n            _collection.forEach(function(_model) {\n                _this.addRepresentation(_type, _model);\n            });\n        },\n        userTemplate: _.template(\n                '<li class=\"Rk-User\"><span class=\"Rk-UserColor\" style=\"background:<%=background%>;\"></span><%=name%></li>'\n        ),\n        redrawUsers: function() {\n            if (!this.renkan.options.show_user_list) {\n                return;\n            }\n            var allUsers = [].concat((this.renkan.project.current_user_list || {}).models || [], (this.renkan.project.get(\"users\") || {}).models || []),\n            ulistHtml = '',\n            $userpanel = this.$.find(\".Rk-Users\"),\n            $name = $userpanel.find(\".Rk-CurrentUser-Name\"),\n            $cpitems = $userpanel.find(\".Rk-Edit-ColorPicker li\"),\n            $colorsquare = $userpanel.find(\".Rk-CurrentUser-Color\"),\n            _this = this;\n            $name.off(\"click\").text(this.renkan.translate(\"<unknown user>\"));\n            $cpitems.off(\"mouseleave click\");\n            allUsers.forEach(function(_user) {\n                if (_user.get(\"_id\") === _this.renkan.current_user) {\n                    $name.text(_user.get(\"title\"));\n                    $colorsquare.css(\"background\", _user.get(\"color\"));\n                    if (_this.isEditable()) {\n\n                        if (_this.renkan.options.user_name_editable) {\n                            $name.click(function() {\n                                var $this = $(this),\n                                $input = $('<input>').val(_user.get(\"title\")).blur(function() {\n                                    _user.set(\"title\", $(this).val());\n                                    _this.redrawUsers();\n                                    _this.redraw();\n                                });\n                                $this.empty().html($input);\n                                $input.select();\n                            });\n                        }\n\n                        if (_this.renkan.options.user_color_editable) {\n                            $cpitems.click(\n                                    function(_e) {\n                                        _e.preventDefault();\n                                        if (_this.isEditable()) {\n                                            _user.set(\"color\", $(this).attr(\"data-color\"));\n                                        }\n                                        $(this).parent().hide();\n                                    }\n                            ).mouseleave(function() {\n                                $colorsquare.css(\"background\", _user.get(\"color\"));\n                            });\n                        }\n                    }\n\n                } else {\n                    ulistHtml += _this.userTemplate({\n                        name: _user.get(\"title\"),\n                        background: _user.get(\"color\")\n                    });\n                }\n            });\n            $userpanel.find(\".Rk-UserList\").html(ulistHtml);\n        },\n        removeRepresentation: function(_representation) {\n            _representation.destroy();\n            this.representations = _.reject(this.representations,\n                function(_repr) {\n                    return _repr === _representation;\n                }\n            );\n        },\n        getRepresentationByModel: function(_model) {\n            if (!_model) {\n                return undefined;\n            }\n            return _.find(this.representations, function(_repr) {\n                return _repr.model === _model;\n            });\n        },\n        removeRepresentationsOfType: function(_type) {\n            var _representations = _.filter(this.representations,function(_repr) {\n                return _repr.type === _type;\n                }),\n                _this = this;\n            _.each(_representations, function(_repr) {\n                _this.removeRepresentation(_repr);\n            });\n        },\n        highlightModel: function(_model) {\n            var _repr = this.getRepresentationByModel(_model);\n            if (_repr) {\n                _repr.highlight();\n            }\n        },\n        unhighlightAll: function(_model) {\n            _.each(this.representations, function(_repr) {\n                _repr.unhighlight();\n            });\n        },\n        unselectAll: function(_model) {\n            _.each(this.representations, function(_repr) {\n                _repr.unselect();\n            });\n        },\n        redraw: function() {\n            var _this = this;\n            if(! this.redrawActive ) {\n                return;\n            }\n            _.each(this.representations, function(_representation) {\n                _representation.redraw({ dontRedrawEdges:true });\n            });\n            if (this.minimap && typeof this.view !== 'undefined') {\n                this.redrawMiniframe();\n            }\n            paper.view.draw();\n        },\n        addTempEdge: function(_from, _point) {\n            var _tmpEdge = this.addRepresentation(\"TempEdge\",null);\n            _tmpEdge.end_pos = _point;\n            _tmpEdge.from_representation = _from;\n            _tmpEdge.redraw();\n            this.click_target = _tmpEdge;\n        },\n        findTarget: function(_hitResult) {\n            if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                var _newTarget = _hitResult.item.__representation;\n                if (this.selected_target !== _hitResult.item.__representation) {\n                    if (this.selected_target) {\n                        this.selected_target.unselect(_newTarget);\n                    }\n                    _newTarget.select(this.selected_target);\n                    this.selected_target = _newTarget;\n                }\n            } else {\n                if (this.selected_target) {\n                    this.selected_target.unselect();\n                }\n                this.selected_target = null;\n            }\n        },\n        onMouseMove: function(_event) {\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]),\n                                      _delta = _point.subtract(this.last_point);\n            this.last_point = _point;\n            if (!this.is_dragging && this.mouse_down && _delta.length > Utils._MIN_DRAG_DISTANCE) {\n                this.is_dragging = true;\n            }\n            var _hitResult = paper.project.hitTest(_point);\n            if (this.is_dragging) {\n                if (this.click_target && typeof this.click_target.paperShift === \"function\") {\n                    this.click_target.paperShift(_delta);\n                } else {\n                    this.view.paperShift(_delta);\n                }\n            } else {\n                this.findTarget(_hitResult);\n            }\n            paper.view.draw();\n        },\n        onMouseDown: function(_event, _isTouch) {\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]);\n            this.last_point = _point;\n            this.mouse_down = true;\n            if (!this.click_target || this.click_target.type !== \"Temp-edge\") {\n                this.removeRepresentationsOfType(\"editor\");\n                this.is_dragging = false;\n                var _hitResult = paper.project.hitTest(_point);\n                if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                    this.click_target = _hitResult.item.__representation;\n                    this.click_target.mousedown(_event, _isTouch);\n                } else {\n                    this.click_target = null;\n                    if (this.isEditable() && this.click_mode === Utils._CLICKMODE_ADDNODE) {\n                        var _coords = this.toModelCoords(_point),\n                        _data = {\n                            id: Utils.getUID('node'),\n                            created_by: this.renkan.current_user,\n                            position: {\n                                x: _coords.x,\n                                y: _coords.y\n                            }\n                        };\n                        var _node = this.renkan.project.addNode(_data);\n                        this.getRepresentationByModel(_node).openEditor();\n                    }\n                }\n            }\n            if (this.click_mode) {\n                if (this.isEditable() && this.click_mode === Utils._CLICKMODE_STARTEDGE && this.click_target && this.click_target.type === \"Node\") {\n                    this.removeRepresentationsOfType(\"editor\");\n                    this.addTempEdge(this.click_target, _point);\n                    this.click_mode = Utils._CLICKMODE_ENDEDGE;\n                    this.notif_$.fadeOut(function() {\n                        $(this).html(this.renkan.translate(\"Click on a second node to complete the edge\")).fadeIn();\n                    });\n                } else {\n                    this.notif_$.hide();\n                    this.click_mode = false;\n                }\n            }\n            paper.view.draw();\n        },\n        onMouseUp: function(_event, _isTouch) {\n            this.mouse_down = false;\n            if (this.click_target) {\n                var _off = this.canvas_$.offset();\n                this.click_target.mouseup(\n                        {\n                            point: new paper.Point([\n                                                    _event.pageX - _off.left,\n                                                    _event.pageY - _off.top\n                                                    ])\n                        },\n                        _isTouch\n                );\n            } else {\n                this.click_target = null;\n                this.is_dragging = false;\n                if (_isTouch) {\n                    this.unselectAll();\n                }\n                this.view.updateUrl();\n            }\n            paper.view.draw();\n        },\n        onScroll: function(_event, _scrolldelta) {\n            this.totalScroll += _scrolldelta;\n            if (Math.abs(this.totalScroll) >= 1) {\n                var _off = this.canvas_$.offset(),\n                _delta = new paper.Point([\n                                          _event.pageX - _off.left,\n                                          _event.pageY - _off.top\n                                          ]).subtract(this.view.offset).multiply( Math.SQRT2 - 1 );\n                if (this.totalScroll > 0) {\n                    this.view.setScale( this.view.scale * Math.SQRT2, this.view.offset.subtract(_delta) );\n                } else {\n                    this.view.setScale( this.view.scale * Math.SQRT1_2, this.view.offset.add(_delta.divide(Math.SQRT2)));\n                }\n                this.totalScroll = 0;\n            }\n        },\n        onDoubleClick: function(_event) {\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]);\n            var _hitResult = paper.project.hitTest(_point);\n\n            if (!this.isEditable()) {\n                if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                    if (_hitResult.item.__representation.model.get('uri')){\n                        window.open(_hitResult.item.__representation.model.get('uri'), '_blank');\n                    }\n                }\n                return;\n            }\n            if (this.isEditable() && (!_hitResult || typeof _hitResult.item.__representation === \"undefined\")) {\n                var _coords = this.toModelCoords(_point),\n                _data = {\n                    id: Utils.getUID('node'),\n                    created_by: this.renkan.current_user,\n                    position: {\n                        x: _coords.x,\n                        y: _coords.y\n                    }\n                },\n                _node = this.renkan.project.addNode(_data);\n                this.getRepresentationByModel(_node).openEditor();\n            }\n            paper.view.draw();\n        },\n        defaultDropHandler: function(_data) {\n            var newNode = {};\n            var snippet = \"\";\n            switch(_data[\"text/x-iri-specific-site\"]) {\n                case \"twitter\":\n                    snippet = $('<div>').html(_data[\"text/x-iri-selected-html\"]);\n                    var tweetdiv = snippet.find(\".tweet\");\n                    newNode.title = this.renkan.translate(\"Tweet by \") + tweetdiv.attr(\"data-name\");\n                    newNode.uri = \"http://twitter.com/\" + tweetdiv.attr(\"data-screen-name\") + \"/status/\" + tweetdiv.attr(\"data-tweet-id\");\n                    newNode.image = tweetdiv.find(\".avatar\").attr(\"src\");\n                    newNode.description = tweetdiv.find(\".js-tweet-text:first\").text();\n                    break;\n                case \"google\":\n                    snippet = $('<div>').html(_data[\"text/x-iri-selected-html\"]);\n                    newNode.title = snippet.find(\"h3:first\").text().trim();\n                    newNode.uri = snippet.find(\"h3 a\").attr(\"href\");\n                    newNode.description = snippet.find(\".st:first\").text().trim();\n                    break;\n                default:\n                    if (_data[\"text/x-iri-source-uri\"]) {\n                        newNode.uri = _data[\"text/x-iri-source-uri\"];\n                    }\n            }\n            if (_data[\"text/plain\"] || _data[\"text/x-iri-selected-text\"]) {\n                newNode.description = (_data[\"text/plain\"] || _data[\"text/x-iri-selected-text\"]).replace(/[\\s\\n]+/gm,' ').trim();\n            }\n            if (_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]) {\n                snippet = $('<div>').html(_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]);\n                var _svgimgs = snippet.find(\"image\");\n                if (_svgimgs.length) {\n                    newNode.image = _svgimgs.attr(\"xlink:href\");\n                }\n                var _svgpaths = snippet.find(\"path\");\n                if (_svgpaths.length) {\n                    newNode.clipPath = _svgpaths.attr(\"d\");\n                }\n                var _imgs = snippet.find(\"img\");\n                if (_imgs.length) {\n                    newNode.image = _imgs[0].src;\n                }\n                var _as = snippet.find(\"a\");\n                if (_as.length) {\n                    newNode.uri = _as[0].href;\n                }\n                newNode.title = snippet.find(\"[title]\").attr(\"title\") || newNode.title;\n                newNode.description = snippet.text().replace(/[\\s\\n]+/gm,' ').trim();\n            }\n            if (_data[\"text/uri-list\"]) {\n                newNode.uri = _data[\"text/uri-list\"];\n            }\n            if (_data[\"text/x-moz-url\"] && !newNode.title) {\n                newNode.title = (_data[\"text/x-moz-url\"].split(\"\\n\")[1] || \"\").trim();\n                if (newNode.title === newNode.uri) {\n                    newNode.title = false;\n                }\n            }\n            if (_data[\"text/x-iri-source-title\"] && !newNode.title) {\n                newNode.title = _data[\"text/x-iri-source-title\"];\n            }\n            if (_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]) {\n                snippet = $('<div>').html(_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]);\n                newNode.image = snippet.find(\"[data-image]\").attr(\"data-image\") || newNode.image;\n                newNode.uri = snippet.find(\"[data-uri]\").attr(\"data-uri\") || newNode.uri;\n                newNode.title = snippet.find(\"[data-title]\").attr(\"data-title\") || newNode.title;\n                newNode.description = snippet.find(\"[data-description]\").attr(\"data-description\") || newNode.description;\n                newNode.clipPath = snippet.find(\"[data-clip-path]\").attr(\"data-clip-path\") || newNode.clipPath;\n            }\n\n            if (!newNode.title) {\n                newNode.title = this.renkan.translate(\"Dragged resource\");\n            }\n            var fields = [\"title\", \"description\", \"uri\", \"image\"];\n            for (var i = 0; i < fields.length; i++) {\n                var f = fields[i];\n                if (_data[\"text/x-iri-\" + f] || _data[f]) {\n                    newNode[f] = _data[\"text/x-iri-\" + f] || _data[f];\n                }\n                if (newNode[f] === \"none\" || newNode[f] === \"null\") {\n                    newNode[f] = undefined;\n                }\n            }\n\n            if(typeof this.renkan.options.drop_enhancer === \"function\"){\n                newNode = this.renkan.options.drop_enhancer(newNode, _data);\n            }\n\n            return newNode;\n\n        },\n        dropData: function(_data, _event) {\n            if (!this.isEditable()) {\n                return;\n            }\n            if (_data[\"text/json\"] || _data[\"application/json\"]) {\n                try {\n                    var jsondata = JSON.parse(_data[\"text/json\"] || _data[\"application/json\"]);\n                    _.extend(_data,jsondata);\n                }\n                catch(e) {}\n            }\n\n            var newNode = (typeof this.renkan.options.drop_handler === \"undefined\")?this.defaultDropHandler(_data):this.renkan.options.drop_handler(_data);\n\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]),\n                                      _coords = this.toModelCoords(_point),\n                                      _nodedata = {\n                id: Utils.getUID('node'),\n                created_by: this.renkan.current_user,\n                uri: newNode.uri || \"\",\n                title: newNode.title || \"\",\n                description: newNode.description || \"\",\n                image: newNode.image || \"\",\n                color: newNode.color || undefined,\n                clip_path: newNode.clipPath || undefined,\n                position: {\n                    x: _coords.x,\n                    y: _coords.y\n                }\n            };\n            var _node = this.renkan.project.addNode(_nodedata),\n            _repr = this.getRepresentationByModel(_node);\n            if (_event.type === \"drop\") {\n                _repr.openEditor();\n            }\n        },\n        fullScreen: function() {\n            var _isFull = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen,\n                _el = this.renkan.$[0],\n                _requestMethods = [\"requestFullScreen\",\"mozRequestFullScreen\",\"webkitRequestFullScreen\"],\n                _cancelMethods = [\"cancelFullScreen\",\"mozCancelFullScreen\",\"webkitCancelFullScreen\"],\n                i;\n            if (_isFull) {\n                for (i = 0; i < _cancelMethods.length; i++) {\n                    if (typeof document[_cancelMethods[i]] === \"function\") {\n                        document[_cancelMethods[i]]();\n                        break;\n                    }\n                }\n                var widthAft = this.$.width();\n                var heightAft = this.$.height();\n\n                if (this.renkan.options.show_top_bar) {\n                    heightAft -= this.$.find(\".Rk-TopBar\").height();\n                }\n                if (this.renkan.options.show_bins && (this.renkan.$.find(\".Rk-Bins\").position().left > 0)) {\n                    widthAft -= this.renkan.$.find(\".Rk-Bins\").width();\n                }\n\n                paper.view.viewSize = new paper.Size([widthAft, heightAft]);\n\n            } else {\n                for (i = 0; i < _requestMethods.length; i++) {\n                    if (typeof _el[_requestMethods[i]] === \"function\") {\n                        _el[_requestMethods[i]]();\n                        break;\n                    }\n                }\n                this.redraw();\n            }\n        },\n        addNodeBtn: function() {\n            if (this.click_mode === Utils._CLICKMODE_ADDNODE) {\n                this.click_mode = false;\n                this.notif_$.hide();\n            } else {\n                this.click_mode = Utils._CLICKMODE_ADDNODE;\n                this.notif_$.text(this.renkan.translate(\"Click on the background canvas to add a node\")).fadeIn();\n            }\n            return false;\n        },\n        addEdgeBtn: function() {\n            if (this.click_mode === Utils._CLICKMODE_STARTEDGE || this.click_mode === Utils._CLICKMODE_ENDEDGE) {\n                this.click_mode = false;\n                this.notif_$.hide();\n            } else {\n                this.click_mode = Utils._CLICKMODE_STARTEDGE;\n                this.notif_$.text(this.renkan.translate(\"Click on a first node to start the edge\")).fadeIn();\n            }\n            return false;\n        },\n        exportProject: function() {\n          var projectJSON = this.renkan.project.toJSON(),\n              downloadLink = document.createElement(\"a\"),\n              projectId = projectJSON.id,\n              fileNameToSaveAs = projectId + \".json\";\n\n          // clean ids\n          delete projectJSON.id;\n          delete projectJSON._id;\n          delete projectJSON.space_id;\n\n          var objId,\n              idsMap = {},\n              hiddenNodes;\n\n          _.each(projectJSON.nodes, function(e,i,l) {\n            objId = e.id || e._id;\n            delete e._id;\n            delete e.id;\n            idsMap[objId] = e['@id'] = Utils.getUUID4();\n          });\n          _.each(projectJSON.edges, function(e,i,l) {\n            delete e._id;\n            delete e.id;\n            e.to = idsMap[e.to];\n            e.from = idsMap[e.from];\n          });\n          _.each(projectJSON.views, function(e,i,l) {\n            delete e._id;\n            delete e.id;\n\n            if(e.hidden_nodes) {\n                hiddenNodes = e.hidden_nodes;\n                e.hidden_nodes = [];\n                _.each(hiddenNodes, function(h,j) {\n                    e.hidden_nodes.push(idsMap[h]);\n                });\n            }\n          });\n          projectJSON.users = [];\n\n          var projectJSONStr = JSON.stringify(projectJSON, null, 2);\n          var blob = new Blob([projectJSONStr], {type: \"application/json;charset=utf-8\"});\n          filesaver(blob,fileNameToSaveAs);\n\n        },\n        parameters: function(_params){\n            if ($.isEmptyObject(_params)){\n                this.view = this.addRepresentation(\"View\", this.renkan.project.get(\"views\").first());\n                this.view.autoScale();\n                return;\n            }\n            if (typeof _params.idView !== 'undefined' && typeof this.renkan.project.get(\"views\").at(_params.idView) !== 'undefined'){\n                this.view = this.addRepresentation(\"View\", this.renkan.project.get(\"views\").at(_params.idView));\n            }\n            if (typeof _params.view !== 'undefined' && _params.view.split(\",\").length >= 3){\n                var viewParams = _params.view.split(\",\");\n                var params = {\n                        \"project\": this.renkan.project,\n                        \"offset\": {\n                            \"x\": parseFloat(viewParams[0]),\n                            \"y\": parseFloat(viewParams[1])\n                        },\n                        \"zoom_level\": parseFloat(viewParams[2])\n                };\n                if (this.view){\n                    this.view.setScale(params.zoom_level, new paper.Point(params.offset));\n                } else{\n                    this.view = this.addRepresentation(\"View\", null);\n                    this.view.params = params;\n                    this.view.init();                    \n                }\n            }\n            if(!this.view){\n                this.view = this.addRepresentation(\"View\", this.renkan.project.get(\"views\").first());\n                this.view.autoScale();\n            }\n            //other parameters must go after because most of them depends on a view that must be initialize before\n            this.unhighlightAll();\n            if (typeof _params.idNode !== 'undefined'){\n                this.highlightModel(this.renkan.project.get(\"nodes\").get(_params.idNode));                 \n            }\n        },\n        foldBins: function() {\n            var foldBinsButton = this.$.find(\".Rk-Fold-Bins\"),\n                bins = this.renkan.$.find(\".Rk-Bins\");\n            var _this = this,\n                sizeBef = _this.canvas_$.width(),\n                sizeAft;\n            if (bins.position().left < 0) {\n                bins.animate({left: 0},250);\n                this.$.animate({left: 300},250,function() {\n                    var w = _this.$.width();\n                    paper.view.viewSize = new paper.Size([w, _this.canvas_$.height()]);\n                });\n                if ((sizeBef -  bins.width()) < bins.height()){\n                    sizeAft = sizeBef;\n                } else {\n                    sizeAft = sizeBef - bins.width();\n                }\n                foldBinsButton.html(\"&laquo;\");\n            } else {\n                bins.animate({left: -300},250);\n                this.$.animate({left: 0},250,function() {\n                    var w = _this.$.width();\n                    paper.view.viewSize = new paper.Size([w, _this.canvas_$.height()]);\n                });\n                sizeAft = sizeBef+300;\n                foldBinsButton.html(\"&raquo;\");\n            }\n            _this.view.resizeZoom(1, 1, (sizeAft/sizeBef));\n        },\n        save: function() { },\n        open: function() { }\n    }).value();\n\n    /* Scene End */\n\n    return Scene;\n\n});\n\ndefine('renderer/viewrepr',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* Rkns.Renderer.View Class */\n\n    /* The representation for the view. */\n\n    var ViewRepr = Utils.inherit(BaseRepresentation);\n\n    _(ViewRepr.prototype).extend({\n        _init: function() {\n            var _this = this;\n            this.$ = $(\".Rk-Render\");\n            this.type = \"View\";\n            this.hiddenNodes = [];\n            this.scale = 1;\n            this.initialScale = 1;\n            this.offset = paper.view.center;\n            this.params = {};\n            \n            if (this.model){\n                this.params = {\n                    \"zoom_level\": _this.model.get(\"zoom_level\"),\n                    \"offset\": _this.model.get(\"offset\"),\n                    \"hidden_nodes\": _this.model.get(\"hidden_nodes\")\n                };\n            }\n                \n            this.init();\n            \n            var bindClick = function(selector, fname) {\n                _this.$.find(selector).click(function(evt) {\n                    _this[fname](evt);\n                    return false;\n                });\n            };\n            \n            bindClick(\".Rk-ZoomOut\", \"zoomOut\");\n            bindClick(\".Rk-ZoomIn\", \"zoomIn\");\n            bindClick(\".Rk-ZoomFit\", \"autoScale\");\n            \n            this.$.find(\".Rk-ZoomSave\").click( function() {\n                var offset = {\n                    \"x\": _this.offset.x,\n                    \"y\": _this.offset.y\n                };\n                //TODO: make the if else the same function\n                if (_this.model && _this.renkan.project.get(\"views\").indexOf(_this.model) > 0){\n                    _this.model.set( { zoom_level:_this.scale, offset:offset, hidden_nodes: _this.hiddenNodes.concat() } );\n                }else{\n                    _this.model = _this.renkan.project.addView( { zoom_level:_this.scale, offset:offset, hidden_nodes: _this.hiddenNodes.concat() } );\n                }\n                _this.params = {\n                        \"zoom_level\": _this.model.get(\"zoom_level\"),\n                        \"offset\": _this.model.get(\"offset\"),\n                        \"hidden_nodes\": _this.model.get(\"hidden_nodes\")\n                };\n                _this.updateUrl();\n            });\n            \n            this.$.find(\".Rk-ZoomSetSaved\").click( function() {\n                _this.setScale(_this.params.zoom_level, new paper.Point(_this.params.offset));\n                _this.showNodes(false);\n                if (_this.options.hide_nodes){\n                    _this.hiddenNodes = (_this.params.hidden_nodes || []).concat();\n                    _this.hideNodes();\n                }\n            });\n            \n            this.$.find(\".Rk-ShowHiddenNodes\").mouseenter( function() {\n                _this.showNodes(true);\n                _this.$.find(\".Rk-ShowHiddenNodes\").mouseleave( function() {\n                    _this.hideNodes();\n                });\n            });\n            this.$.find(\".Rk-ShowHiddenNodes\").click( function() {\n                _this.showNodes(false);\n                _this.$.find(\".Rk-ShowHiddenNodes\").off( \"mouseleave\" ); \n            });\n            if(this.renkan.project.get(\"views\").length > 0 && this.renkan.options.save_view){\n                this.$.find(\".Rk-ZoomSetSaved\").show();\n            }\n        },\n        redraw: function(options) {\n            //console.log(\"view : \", this.model.toJSON());\n        },\n        init: function(){\n            var _this = this;\n            _this.setScale(_this.params.zoom_level, new paper.Point(_this.params.offset));\n            _this.showNodes(false);\n            if (_this.options.hide_nodes){\n                _this.hiddenNodes = (_this.params.hidden_nodes || []).concat();\n                _this.hideNodes();\n            }\n        },\n        addHiddenNode: function(_model){\n            this.hideNode(_model);\n            this.hiddenNodes.push(_model.id);\n            this.updateUrl();\n        },\n        hideNode: function(_model){\n            if (typeof this.renderer.getRepresentationByModel(_model) !== 'undefined'){\n                this.renderer.getRepresentationByModel(_model).hide();\n            }\n        },\n        hideNodes: function(){\n            var _this = this;\n            this.hiddenNodes.forEach(function(_id, index){\n                var node = _this.renkan.project.get(\"nodes\").get(_id);\n                if (typeof node !== 'undefined'){\n                    return _this.hideNode(_this.renkan.project.get(\"nodes\").get(_id));\n                }else{\n                    _this.hiddenNodes.splice(index, 1);\n                }\n            });\n            paper.view.draw();\n        },\n        showNodes: function(ghost){\n            var _this = this;\n            this.hiddenNodes.forEach(function(_id){\n                _this.renderer.getRepresentationByModel(_this.renkan.project.get(\"nodes\").get(_id)).show(ghost);\n            });\n            if (!ghost){\n                this.hiddenNodes = [];\n            }\n            paper.view.draw();\n        },\n        setScale: function(_newScale, _offset) {\n            if ((_newScale/this.initialScale) > Utils._MIN_SCALE && (_newScale/this.initialScale) < Utils._MAX_SCALE) {\n                this.scale = _newScale;\n                if (_offset) {\n                    this.offset = _offset;\n                }\n                this.renderer.redraw();\n                this.updateUrl();\n            }\n        },\n        zoomOut: function() {\n            var _newScale = this.scale * Math.SQRT1_2,\n            _offset = new paper.Point([\n                                       this.renderer.canvas_$.width(),\n                                       this.renderer.canvas_$.height()\n                                       ]).multiply( 0.5 * ( 1 - Math.SQRT1_2 ) ).add(this.offset.multiply( Math.SQRT1_2 ));\n            this.setScale( _newScale, _offset );\n        },\n        zoomIn: function() {\n            var _newScale = this.scale * Math.SQRT2,\n            _offset = new paper.Point([\n                                       this.renderer.canvas_$.width(),\n                                       this.renderer.canvas_$.height()\n                                       ]).multiply( 0.5 * ( 1 - Math.SQRT2 ) ).add(this.offset.multiply( Math.SQRT2 ));\n            this.setScale( _newScale, _offset );\n        },\n        resizeZoom: function(_scaleWidth, _scaleHeight, _ratio) {\n            var _newScale = this.scale * _ratio,\n                _offset = new paper.Point([\n                                       (this.offset.x * _scaleWidth),\n                                       (this.offset.y * _scaleHeight)\n                                       ]);\n            this.setScale( _newScale, _offset );\n        },\n        autoScale: function(force_view) {\n            var nodes = this.renkan.project.get(\"nodes\");\n            if (nodes.length > 1) {\n                var _xx = nodes.map(function(_node) { return _node.get(\"position\").x; }),\n                _yy = nodes.map(function(_node) { return _node.get(\"position\").y; }),\n                _minx = Math.min.apply(Math, _xx),\n                _miny = Math.min.apply(Math, _yy),\n                _maxx = Math.max.apply(Math, _xx),\n                _maxy = Math.max.apply(Math, _yy);\n                var _scale = Math.min( (paper.view.size.width - 2 * this.renkan.options.autoscale_padding) / (_maxx - _minx), (paper.view.size.height - 2 * this.renkan.options.autoscale_padding) / (_maxy - _miny));\n                this.initialScale = _scale;\n                // Override calculated scale if asked\n                if((typeof force_view !== \"undefined\") && parseFloat(force_view.zoom_level)>0 && parseFloat(force_view.offset.x)>0 && parseFloat(force_view.offset.y)>0){\n                    this.setScale(parseFloat(force_view.zoom_level), new paper.Point(parseFloat(force_view.offset.x), parseFloat(force_view.offset.y)));\n                }\n                else{\n                    this.setScale(_scale, paper.view.center.subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale)));\n                }\n            }\n            if (nodes.length === 1) {\n                this.setScale(1, paper.view.center.subtract(new paper.Point([nodes.at(0).get(\"position\").x, nodes.at(0).get(\"position\").y])));\n            }\n        },\n        paperShift: function(_delta) {\n            this.offset = this.offset.add(_delta);\n            this.renderer.redraw();\n        },\n        updateUrl: function(){\n            if(this.options.update_url){\n                var result = {};\n                var parameters = Backbone.history.getFragment().split('?');\n                if (parameters.length > 1){\n                    parameters[1].split(\"&\").forEach(function(part) {\n                        var item = part.split(\"=\");\n                        result[item[0]] = decodeURIComponent(item[1]);\n                    });\n                }\n                result.view = Math.round(this.offset.x*1000)/1000 + ',' + Math.round(this.offset.y*1000)/1000 + ',' + Math.round(this.scale*1000)/1000;\n\n                if (this.renkan.project.get(\"views\").indexOf(this.model) > -1){\n                    result.idView = this.renkan.project.get(\"views\").indexOf(this.model);\n                } else {\n                    if (result.idView){\n                        delete result.idView;\n                    }\n                }\n                this.renkan.router.navigate(\"?\" + decodeURIComponent($.param(result)), {trigger: false, replace: true});\n            }\n        },\n    }).value();\n\n    return ViewRepr;\n\n});\n\n\n//Load modules and use them\nif( typeof require.config === \"function\" ) {\n    require.config({\n        paths: {\n            'jquery':'../lib/jquery/jquery',\n            'underscore':'../lib/lodash/lodash',\n            'filesaver' :'../lib/FileSaver/FileSaver',\n            'requtils':'require-utils',\n            'ckeditor-core':'../lib/ckeditor/ckeditor',\n            'ckeditor-jquery':'../lib/ckeditor/adapters/jquery'\n        },\n        shim: {\n            'ckeditor-jquery':{\n                deps:['jquery','ckeditor-core']\n            }\n        },\n    });\n}\n\nrequire(['renderer/baserepresentation',\n         'renderer/basebutton',\n         'renderer/noderepr',\n         'renderer/edge',\n         'renderer/tempedge',\n         'renderer/baseeditor',\n         'renderer/nodeeditor',\n         'renderer/edgeeditor',\n         'renderer/nodebutton',\n         'renderer/nodeeditbutton',\n         'renderer/noderemovebutton',\n         'renderer/nodehidebutton',\n         'renderer/nodeshowbutton',\n         'renderer/noderevertbutton',\n         'renderer/nodelinkbutton',\n         'renderer/nodeenlargebutton',\n         'renderer/nodeshrinkbutton',\n         'renderer/edgeeditbutton',\n         'renderer/edgeremovebutton',\n         'renderer/edgerevertbutton',\n         'renderer/miniframe',\n         'renderer/scene',\n         'renderer/viewrepr'\n         ], function(BaseRepresentation, BaseButton, NodeRepr, Edge, TempEdge, BaseEditor, NodeEditor, EdgeEditor, NodeButton, NodeEditButton, NodeRemoveButton, NodeHideButton, NodeShowButton, NodeRevertButton, NodeLinkButton, NodeEnlargeButton, NodeShrinkButton, EdgeEditButton, EdgeRemoveButton, EdgeRevertButton, MiniFrame, Scene, ViewRepr){\n\n    \n\n    var Rkns = window.Rkns;\n\n    if(typeof Rkns.Renderer === \"undefined\"){\n        Rkns.Renderer = {};\n    }\n    var Renderer = Rkns.Renderer;\n\n    Renderer._BaseRepresentation = BaseRepresentation;\n    Renderer._BaseButton = BaseButton;\n    Renderer.Node = NodeRepr;\n    Renderer.Edge = Edge;\n    Renderer.View = ViewRepr;\n    Renderer.TempEdge = TempEdge;\n    Renderer._BaseEditor = BaseEditor;\n    Renderer.NodeEditor = NodeEditor;\n    Renderer.EdgeEditor = EdgeEditor;\n    Renderer._NodeButton = NodeButton;\n    Renderer.NodeEditButton = NodeEditButton;\n    Renderer.NodeRemoveButton = NodeRemoveButton;\n    Renderer.NodeHideButton = NodeHideButton;\n    Renderer.NodeShowButton = NodeShowButton;\n    Renderer.NodeRevertButton = NodeRevertButton;\n    Renderer.NodeLinkButton = NodeLinkButton;\n    Renderer.NodeEnlargeButton = NodeEnlargeButton;\n    Renderer.NodeShrinkButton = NodeShrinkButton;\n    Renderer.EdgeEditButton = EdgeEditButton;\n    Renderer.EdgeRemoveButton = EdgeRemoveButton;\n    Renderer.EdgeRevertButton = EdgeRevertButton;\n    Renderer.MiniFrame = MiniFrame;\n    Renderer.Scene = Scene;\n\n    startRenkan();\n});\n\ndefine(\"main-renderer\", function(){});\n\n"]}
\ No newline at end of file
--- a/server/python/django/renkanmanager/__init__.py	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/python/django/renkanmanager/__init__.py	Tue Sep 15 17:08:53 2015 +0200
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-VERSION = (0, 12, 2, "final", 0)
+VERSION = (0, 12, 3, "final", 0)
 
 
 def get_version():
--- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/renkan.css	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/renkan.css	Tue Sep 15 17:08:53 2015 +0200
@@ -24,7 +24,7 @@
  *  knowledge of the CeCILL-C license and that you accept its terms.
  */
 
-/*! renkan - v0.12.1 - Copyright © IRI 2015 */
+/*! renkan - v - Copyright © IRI 2015 */
 
 /*!
  *    _____            _
@@ -415,6 +415,13 @@
     display: block; float: right; width: 18px; height: 17px; margin: 1px 0; border: none; background: url(../img/goto.png);
 }
 
+.Rk-Edit-Title {
+    background-color: #fff;
+    border: 1px solid #d4d4d4;
+    line-height: 15px;
+    min-height: 15px;
+}
+
 .Rk-Edit-Title, .Rk-Edit-URI, .Rk-Edit-Image-File, .Rk-Edit-Vocabulary {
     font-size: 12px; width: 250px;
 }
--- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/renkan.min.css	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/renkan.min.css	Tue Sep 15 17:08:53 2015 +0200
@@ -24,7 +24,7 @@
  *  knowledge of the CeCILL-C license and that you accept its terms.
  */
 
-/*! renkan - v0.12.1 - Copyright © IRI 2015 */
+/*! renkan - v - Copyright © IRI 2015 */
 
 
 /*!
@@ -50,4 +50,4 @@
  *
  *  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.
- *//*! renkan - v0.7.11 - Copyright © IRI 2014 */#renkan{overflow:hidden}.Rk-Main h3,.Rk-Main h4,.Rk-Main li,.Rk-Main p,.Rk-Main ul{border:0 none;margin:0;padding:0}.Rk-Main li,.Rk-Main ul{list-style:none}.Rk-Main input::-moz-focus-inner{border:0;padding:0}.Rk-Main table{border-collapse:separate;border-spacing:0}.Rk-Main td,.Rk-Main th{vertical-align:top}.Rk-Main img a{border:none}.Rk-Main{font-size:10px;font-family:Arial,Helvetica,sans-serif;background:#fff;color:#000}.Rk-Main a{color:#6060c0}.Rk-Main{position:absolute;left:0;top:0;right:0;bottom:0}.Rk-Render{position:absolute;top:0;right:0;bottom:0;background:#fff}.Rk-Render-Full{left:0}.Rk-Render-Panel{left:300px}.Rk-TopBar{position:absolute;left:0;top:0;right:0;height:35px;background:#333;background:-moz-linear-gradient(top,#505050 5px,#1e1e1e 30px);background:-webkit-linear-gradient(top,#505050 5px,#1e1e1e 30px);background:-ms-linear-gradient(top,#505050 5px,#1e1e1e 30px);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#505050', endColorstr='#1e1e1e', GradientType=0)}.Rk-TopBar .loader{display:block;background:none repeat red;width:0;height:4px;overflow:hidden;position:absolute;bottom:0;left:0;transition:width 3s linear;z-index:50}.Rk-TopBar .loader.run{width:100%}.Rk-PadTitle{float:left;font-size:14px;height:16px;margin:4px 5px;background:#666;padding:4px;border:1px solid #333;border-radius:3px;box-shadow:0 1px 0 #505050;color:#fff;font-weight:700}input.Rk-PadTitle{width:180px}h2.Rk-PadTitle{min-width:180px;max-width:320px;overflow:hidden}.Rk-Users{float:right;width:130px;margin:4px 5px}.Rk-CurrentUser{font-size:13px;background:#666;padding:4px;border:1px solid #333;border-radius:3px;box-shadow:0 1px 0 #505050;color:#fff;text-align:center}.Rk-CurrentUser-Color{display:inline-block;width:12px;height:12px;border:1px solid #333;margin:-2px 2px;position:relative}.Rk-CurrentUser input{width:95px;padding:1px;border:none;border-radius:2px}.Rk-UserList{box-shadow:0 2px 2px #999;position:relative;z-index:3;display:none;padding-top:8px}.Rk-User{background:#fff;padding:3px;font-size:12px;border-style:solid solid none;border-color:#ccc;border-width:1px}.Rk-TopBar-Button{float:right;background:url(../img/topbarbuttons.png) no-repeat;height:35px;cursor:pointer;position:relative}.Rk-TopBar-Separator{background:#666;background:-moz-linear-gradient(top,#666 20%,#333 80%);background:-webkit-linear-gradient(top,#666 20%,#333 80%);background:-ms-linear-gradient(top,#666 20%,#333 80%);content:"";display:block;height:35px;float:right;width:1px;border-left:1px solid #111;margin:0 3px}.Rk-TopBar-Tooltip{position:absolute;top:31px;left:50%;margin-left:-60px;width:120px;z-index:4;display:none}.Rk-TopBar-Tooltip-Contents{background:#fff;font-size:13px;font-weight:700;color:#6060c0;text-align:center;padding:2px;border-style:none solid solid;border-width:1px;border-color:#ccc;border-bottom-left-radius:2px;border-bottom-right-radius:2px}.Rk-TopBar-Tooltip:before{content:".";display:block;text-indent:-8000px;height:7px;background:url(../img/tooltiparrow.png) center no-repeat;margin:0 1px}.Rk-AddNode-Button{width:30px;background-position:-2px 0}.Rk-AddNode-Button:hover{background-position:-2px -35px}.Rk-FullScreen-Button{width:30px;background-position:-36px 0}.Rk-FullScreen-Button:hover{background-position:-36px -35px}.Rk-AddEdge-Button{width:30px;background-position:-70px 0}.Rk-AddEdge-Button:hover{background-position:-70px -35px}.Rk-Save-Button{width:30px;background-position:-104px 0}.Rk-Save-Button.saving{background-position:-104px 0}.Rk-Save-Button.Rk-Save-Online:hover,.Rk-Save-Button.saved:hover,.Rk-Save-Button:hover{background-position:-104px -35px}.Rk-Save-Button.Rk-Save-Online:active,.Rk-Save-Button.saved:active,.Rk-Save-Button:active{background-position:-104px 0}.Rk-Save-Button.to-save{background-position:-172px -35px}.Rk-Save-Button.Rk-Save-Online,.Rk-Save-Button.saved{background-position:-172px 0}.Rk-Save-Button.Rk-Save-ReadOnly,.Rk-Save-Button.disabled{opacity:.4;cursor:default}.Rk-Export-Button{width:30px;background-position:-274px 0}.Rk-Export-Button.disabled{opacity:.5;cursor:default}.Rk-Export-Button:hover{background-position:-274px -35px}.Rk-Export-Button.disabled:hover{opacity:1;background-position:-274px 0}.Rk-Bookmarklet-Button{width:30px;background-position:-138px 0}.Rk-Bookmarklet-Button.disabled{opacity:.5;cursor:default}.Rk-Bookmarklet-Button:hover{background-position:-138px -35px}.Rk-Bookmarklet-Button.disabled:hover{opacity:1;background-position:-138px 0}.Rk-Home-Button{width:30px;background-position:-206px 0}.Rk-Home-Button:hover{background-position:-206px -35px}.Rk-Open-Button{width:30px;background-position:-240px 0}.Rk-Open-Button:hover{background-position:-240px -35px}.Rk-GraphSearch-Form{float:right;width:185px;position:relative}.Rk-GraphSearch-Form:after,.Rk-GraphSearch-Form:before{position:absolute;display:block;content:".";text-indent:-9999px}.Rk-GraphSearch-Form:before{right:10px;top:20px;width:7px;height:2px;border:none;padding:0;background:#666;transform:rotate(40deg);-webkit-transform:rotate(40deg)}.Rk-GraphSearch-Form:after{right:13px;top:11px;width:6px;height:6px;border-radius:8px;border:2px solid #666}.Rk-GraphSearch-Field{line-height:23px;font-size:14px;height:23px;padding:0 5px;border:none;margin:6px 5px;width:165px;background:#f0f0f0;box-shadow:1px 1px 1px #999 inset;border-radius:5px;-webkit-appearance:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.Rk-Editing-Space{position:absolute;left:0;top:35px;right:0;bottom:0;overflow:hidden;background:-moz-radial-gradient(center,circle,#fff 40%,#e0e0e0 90%);background:-webkit-radial-gradient(center,circle,#fff 40%,#e0e0e0 90%);background:-ms-radial-gradient(center,circle,#fff 40%,#e0e0e0 90%)}.Rk-Editing-Space-Full{top:0}.Rk-Canvas{position:absolute;left:0;top:0;right:0;bottom:0;z-index:2}.Rk-Canvas[resize]{width:100%;height:100%}.Rk-Highlighted{background:rgba(255,255,0,.5)}.Rk-Labels{position:absolute;left:0;top:0;z-index:1;font-family:"Segoe UI","Helvetica Neue",Arial,Helvetica,sans-serif}.Rk-Label{position:absolute;width:160px;margin-left:-80px;text-align:center;font-size:13px;line-height:13px}.Rk-Edge-Label{font-size:11px;transform-origin:50% 0;-moz-transform-origin:50% 0;-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0}.Rk-Editor{position:absolute;left:0;top:0;z-index:3}.Rk-Notifications{position:absolute;right:15px;top:15px;width:200px;padding:10px;border-radius:8px;display:none;color:#fff;font-size:13px;text-align:center;font-weight:700;background:rgba(20,20,20,.7);background:-moz-linear-gradient(top,rgba(40,40,40,.7)20%,rgba(0,0,0,.7)80%);background:-webkit-linear-gradient(top,rgba(40,40,40,.7)20%,rgba(0,0,0,.7)80%);background:-ms-linear-gradient(top,rgba(40,40,40,.7)20%,rgba(0,0,0,.7)80%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#202020', endColorstr='#000000', GradientType=0)}.Rk-CloseX{float:right;cursor:pointer}.Rk-Editor h2{font-size:16px;font-weight:700}.Rk-Editor audio,.Rk-Editor video{max-height:100%;max-width:100%}.Rk-Editor p,.Rk-Editor-p,.Rk-Editor-p>div{margin:5px 0;font-size:12px;clear:both}.Rk-Editor-Label{float:left;width:80px}a.Rk-Edit-Goto{display:block;float:right;width:18px;height:17px;margin:1px 0;border:none;background:url(../img/goto.png)}.Rk-Edit-Image-File,.Rk-Edit-Title,.Rk-Edit-URI,.Rk-Edit-Vocabulary{font-size:12px;width:250px}.Rk-Edit-Image{font-size:12px;width:220px}.Rk-Edit-Image-Del{display:inline-block;background:url(../img/remove.png);background-size:15px 20px;background-repeat:no-repeat;vertical-align:top;height:20px;width:15px;margin-right:2px}.Rk-Edit-URI{font-size:12px;width:220px}.Rk-Edit-ImgWrap{text-align:center}.Rk-Edit-ImgPreview{display:inline-block;border:1px solid #666;margin:5px auto;position:relative}.Rk-Edit-ImgPreview img{display:inline-block;max-width:253px!important;max-height:200px!important}.Rk-Edit-ImgPreview svg{height:100%;left:0;position:absolute;top:0;width:100%}.Rk-Editor textarea{width:250px;height:120px;resize:none}div.Rk-Edit-Description{-moz-appearance:textfield-multiline;-webkit-appearance:textarea;background-color:#FFF;border:1px solid #F0F0F0;width:250px;height:120px;resize:vertical;overflow:auto;padding:2px}.Rk-UserColor{display:inline-block;width:12px;height:12px;border:1px solid #666;margin:-2px 2px}.Rk-Edit-Color{display:inline-block;width:10px;height:10px;border:2px solid #333;margin:-2px 2px;position:relative}.Rk-Edit-ColorTip{display:block;width:3px;height:3px;background:#fff;position:absolute;bottom:0;right:0;cursor:pointer}.Rk-Edit-ColorPicker-Wrapper{display:inline-block;position:relative;float:left}.Rk-Edit-ColorPicker{position:absolute;top:-2px;left:15px;width:96px;height:96px;border:1px solid #CCC;padding:5px 4px 4px 5px;background:#fff;border-radius:5px;display:none;z-index:4}.Rk-CurrentUser .Rk-Edit-ColorPicker{left:-105px;top:2px}.Rk-Edit-ColorPicker-Text{color:#303080;font-weight:700}.Rk-Edit-ColorPicker li{float:left;width:11px;height:11px;margin:0 1px 1px 0;cursor:pointer}.Rk-Edit-Dash{float:left;display:inline-block}.Rk-Edit-Size-Btn{font-size:13px;font-weight:700;padding:0 4px;background:#fff;color:#000;border:1px solid #ccc;text-decoration:none}.Rk-Edit-Size-Btn:hover{background:#666}.Rk-Edit-Size-Disp{display:inline-block;padding:0 5px;text-align:center;width:20px}.Rk-Edit-Vocabulary-Class{color:#999;font-style:italic;font-weight:700}.Rk-Edit-Vocabulary-Property{padding-left:20px}.Rk-Edit-Direction{border:1px solid #666;padding:3px 5px;line-height:20px;border-radius:3px;background:#f0f0f0;cursor:pointer}.Rk-Edit-Direction:hover{background:silver}.Rk-Display-Title a{text-decoration:none;color:#000}.Rk-Display-Title a:hover{text-decoration:underline}.Rk-Display-URI{font-style:italic}.Rk-Display-ImgPreview{margin:5px auto;display:block;max-width:255px!important;max-height:260px!important}.Rk-Fold-Bins{position:absolute;top:5px;width:12px;text-align:center;font-size:16px;cursor:pointer;line-height:16px;padding:4px;color:#fff;background:#666;border-radius:0 6px 6px 0;font-weight:700}.Rk-Fold-Bins:hover{background:#333}.Rk-ZoomButtons{position:absolute;left:0;top:35px;cursor:pointer}.Rk-Editing-Space-Full .Rk-ZoomButtons{top:0}.Rk-ShowHiddenNodes,.Rk-ZoomFit,.Rk-ZoomIn,.Rk-ZoomOut,.Rk-ZoomSave,.Rk-ZoomSetSaved{width:21px;height:20px;background:url(../img/zoombuttons.png);margin:5px}.Rk-ZoomIn:hover{background-position:0 -20px}.Rk-ZoomFit{background-position:-42px 0}.Rk-ZoomFit:hover{background-position:-42px -20px}.Rk-ZoomOut{background-position:-21px 0}.Rk-ZoomOut:hover{background-position:-21px -20px}.Rk-ZoomSave{background-position:-63px 0}.Rk-ZoomSave:hover{background-position:-63px -20px}.Rk-ZoomSetSaved{background-position:-84px 0;display:none}.Rk-ZoomSetSaved:hover{background-position:-84px -20px}.Rk-ShowHiddenNodes{background-position:-105px 0}.Rk-ShowHiddenNodes:hover{background-position:-105px -20px}.Rk-Bins{background:#fff;position:absolute;left:0;top:0;width:299px;bottom:0;overflow:hidden;border-right:1px solid #252525}.Rk-Bins-Title{border:0 none;width:290px;height:15px;line-height:15px;margin:0;padding:15px 0 5px 10px;font-size:14px;color:#F0F0F0;background:-moz-linear-gradient(top,#1e1e1e 5px,#606060 30px);background:-webkit-linear-gradient(top,#1e1e1e 5px,#606060 30px);background:-ms-linear-gradient(top,#1e1e1e 5px,#606060 30px);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e1e1e', endColorstr='#606060', GradientType=0)}.Rk-Search-Form{padding:0 10px 8px;height:27px;background:#606060}.Rk-Search-Input,.Rk-Search-Select{float:left;margin:0}.Rk-Search-Input{border-top-left-radius:5px;border-bottom-left-radius:5px;border:1px solid #003050;font-size:13px;background:#fff;height:25px;padding:0 5px;line-height:25px;-webkit-appearance:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.Rk-Web-Search-Input{width:190px}.Rk-Bins-Search-Input{width:235px}.Rk-Search-Select{display:inline-block;position:relative;width:45px;border-width:1px;border-color:#003050;border-style:solid none;cursor:pointer;height:25px;background:#fff url(../img/more.png) 30px 10px no-repeat}.Rk-Search-Select:hover{background-color:#3030FF}.Rk-Search-Current{width:40px;height:20px;margin:2px;background-repeat:no-repeat}.Rk-Search-List{width:180px;margin-left:15px;font-size:13px;position:absolute;right:0;top:25px;background:#fff;box-shadow:1px 1px 2px #505050;display:none;border:1px solid #ccc;z-index:2}.Rk-Search-List li{padding:2px 2px 2px 30px;border-top:1px solid #ccc;height:16px;background-color:#fff;background-repeat:no-repeat;cursor:pointer}.Rk-Search-List li:hover{background-color:#3030ff;color:#fff}.Rk-Search-Submit{border:1px solid #003050;height:27px;width:30px;border-top-right-radius:5px;border-bottom-right-radius:5px;background:#333 center no-repeat url(../img/search.png);cursor:pointer}.Rk-Search-Submit:hover{background-color:#999}.Rk-Bin-Title{background:#333;background:-moz-linear-gradient(top,#505050 20%,#1e1e1e 80%);background:-webkit-linear-gradient(top,#505050 20%,#1e1e1e 80%);background:-ms-linear-gradient(top,#505050 20%,#1e1e1e 80%);font-weight:700;font-size:14px;padding:5px;cursor:pointer;color:#f0f0f0;margin:0;border:0 none}.Rk-Bin-Close{float:right;display:block;font-size:16px;font-weight:700;margin:2px 3px 0;color:#f0f0f0;cursor:pointer;text-shadow:-1px -1px 1px #999,1px 1px 1px #000;text-decoration:none}.Rk-Bin-Close:hover{color:#ffff80}.Rk-Bin-Title:hover{color:#ffffe0;background:#505050;background:-moz-linear-gradient(top,#141414 20%,#3c3c3c 80%);background:-webkit-linear-gradient(top,#141414 20%,#3c3c3c 80%);background:-ms-linear-gradient(top,#141414 20%,#3c3c3c 80%)}.Rk-Bin-Refresh{width:18px;height:17px;background:url(../img/refresh.png);display:block;float:right;margin-top:4px}.Rk-Bin-Refresh:hover{background-position:-18px 0}.Rk-Bin-Count{float:right;background:#c000a0;color:#FFF;text-shadow:1px 1px 1px #000;display:none;border-radius:4px;padding:1px 3px;font-size:10px;font-weight:700;margin-top:4px}.Rk-Bin-Title-Icon{float:left;width:25px;margin:2px}.Rk-Bin-Main{overflow:auto;background:#fff;background:-moz-linear-gradient(top,#e0e0e0 0,#FFF 2%,#FFF 98%,#e0e0e0 100%);background:-webkit-linear-gradient(top,#e0e0e0 0,#FFF 2%,#FFF 98%,#e0e0e0 100%);background:-ms-linear-gradient(top,#e0e0e0 0,#FFF 2%,#FFF 98%,#e0e0e0 100%)}.Rk-Bin-Item{cursor:move}.Rk-Bin-Item.hover,.Rk-Bin-Item:hover{background:-moz-linear-gradient(top,rgba(0,0,0,.1)20%,rgba(128,128,128,.1)80%);background:-webkit-linear-gradient(top,rgba(0,0,0,.1)20%,rgba(128,128,128,.1)80%);background:-ms-linear-gradient(top,rgba(0,0,0,.1)20%,rgba(128,128,128,.1)80%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d0d0d0', endColorstr='#f3f3f3', GradientType=0)}.Rk-Bin-Item.selected{background:#ffffc0}.Rk-Bin-Main li{padding:2px;border-bottom:1px solid #ccc;clear:both;overflow:hidden}.Rk-Bin-Main h3{font-size:14px;font-style:italic;font-weight:700;text-align:center}.Rk-Bin-Main h4{font-size:12px;font-weight:700}.Rk-Bin-Main p{font-size:11px}.Rk-Bin-Main h4 a{color:#303080}.Rk-Bin-Main .searchmatch{background:#ffff80}.Rk-Wikipedia-Search-Icon{background-image:url(../img/search-logos.png)}.Rk-Wikipedia-Icon{float:left;margin:3px;max-height:48px;max-width:48px}.Rk-Wikipedia-Title-Icon{height:20px;background:url(../img/search-logos.png)}.Rk-Wikipedia-Lang-en{background-position:0 -20px}.Rk-Wikipedia-Lang-fr{background-position:0 -40px}.Rk-Wikipedia-Lang-ja{background-position:0 -60px}.Rk-Wikipedia-Result{min-height:51px}.Rk-Wikipedia-Result h4,.Rk-Wikipedia-Result p{margin-left:54px}.Rk-ResourceList-Image{float:left;max-width:100px;max-height:75px;margin-right:2px}.Rk-Ldt-Icon,.Rk-Ldt-Title-Icon{background:url(../img/search-logos.png);background-position:0 -100px;background-repeat:no-repeat}.Rk-Ldt-Title-Icon{height:20px;margin-top:4px}.Rk-Ldt-Tag-Icon{float:left;margin:0 2px 0 0}.Rk-Ldt-Annotation-Icon{float:left;margin:3px}.Rk-Clear{clear:both}h4.Rk-Bin-Loading{margin:10px;text-align:center;font-size:20px;color:#999}
\ No newline at end of file
+ *//*! renkan - v0.7.11 - Copyright © IRI 2014 */#renkan{overflow:hidden}.Rk-Main h3,.Rk-Main h4,.Rk-Main li,.Rk-Main p,.Rk-Main ul{border:0 none;margin:0;padding:0}.Rk-Main li,.Rk-Main ul{list-style:none}.Rk-Main input::-moz-focus-inner{border:0;padding:0}.Rk-Main table{border-collapse:separate;border-spacing:0}.Rk-Main td,.Rk-Main th{vertical-align:top}.Rk-Main img a{border:none}.Rk-Main{font-size:10px;font-family:Arial,Helvetica,sans-serif;background:#fff;color:#000}.Rk-Main a{color:#6060c0}.Rk-Main{position:absolute;left:0;top:0;right:0;bottom:0}.Rk-Render{position:absolute;top:0;right:0;bottom:0;background:#fff}.Rk-Render-Full{left:0}.Rk-Render-Panel{left:300px}.Rk-TopBar{position:absolute;left:0;top:0;right:0;height:35px;background:#333;background:-moz-linear-gradient(top,#505050 5px,#1e1e1e 30px);background:-webkit-linear-gradient(top,#505050 5px,#1e1e1e 30px);background:-ms-linear-gradient(top,#505050 5px,#1e1e1e 30px);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#505050', endColorstr='#1e1e1e', GradientType=0)}.Rk-TopBar .loader{display:block;background:none repeat red;width:0;height:4px;overflow:hidden;position:absolute;bottom:0;left:0;transition:width 3s linear;z-index:50}.Rk-TopBar .loader.run{width:100%}.Rk-PadTitle{float:left;font-size:14px;height:16px;margin:4px 5px;background:#666;padding:4px;border:1px solid #333;border-radius:3px;box-shadow:0 1px 0 #505050;color:#fff;font-weight:700}input.Rk-PadTitle{width:180px}h2.Rk-PadTitle{min-width:180px;max-width:320px;overflow:hidden}.Rk-Users{float:right;width:130px;margin:4px 5px}.Rk-CurrentUser{font-size:13px;background:#666;padding:4px;border:1px solid #333;border-radius:3px;box-shadow:0 1px 0 #505050;color:#fff;text-align:center}.Rk-CurrentUser-Color{display:inline-block;width:12px;height:12px;border:1px solid #333;margin:-2px 2px;position:relative}.Rk-CurrentUser input{width:95px;padding:1px;border:none;border-radius:2px}.Rk-UserList{box-shadow:0 2px 2px #999;position:relative;z-index:3;display:none;padding-top:8px}.Rk-User{background:#fff;padding:3px;font-size:12px;border-style:solid solid none;border-color:#ccc;border-width:1px}.Rk-TopBar-Button{float:right;background:url(../img/topbarbuttons.png) no-repeat;height:35px;cursor:pointer;position:relative}.Rk-TopBar-Separator{background:#666;background:-moz-linear-gradient(top,#666 20%,#333 80%);background:-webkit-linear-gradient(top,#666 20%,#333 80%);background:-ms-linear-gradient(top,#666 20%,#333 80%);content:"";display:block;height:35px;float:right;width:1px;border-left:1px solid #111;margin:0 3px}.Rk-TopBar-Tooltip{position:absolute;top:31px;left:50%;margin-left:-60px;width:120px;z-index:4;display:none}.Rk-TopBar-Tooltip-Contents{background:#fff;font-size:13px;font-weight:700;color:#6060c0;text-align:center;padding:2px;border-style:none solid solid;border-width:1px;border-color:#ccc;border-bottom-left-radius:2px;border-bottom-right-radius:2px}.Rk-TopBar-Tooltip:before{content:".";display:block;text-indent:-8000px;height:7px;background:url(../img/tooltiparrow.png) center no-repeat;margin:0 1px}.Rk-AddNode-Button{width:30px;background-position:-2px 0}.Rk-AddNode-Button:hover{background-position:-2px -35px}.Rk-FullScreen-Button{width:30px;background-position:-36px 0}.Rk-FullScreen-Button:hover{background-position:-36px -35px}.Rk-AddEdge-Button{width:30px;background-position:-70px 0}.Rk-AddEdge-Button:hover{background-position:-70px -35px}.Rk-Save-Button{width:30px;background-position:-104px 0}.Rk-Save-Button.saving{background-position:-104px 0}.Rk-Save-Button.Rk-Save-Online:hover,.Rk-Save-Button.saved:hover,.Rk-Save-Button:hover{background-position:-104px -35px}.Rk-Save-Button.Rk-Save-Online:active,.Rk-Save-Button.saved:active,.Rk-Save-Button:active{background-position:-104px 0}.Rk-Save-Button.to-save{background-position:-172px -35px}.Rk-Save-Button.Rk-Save-Online,.Rk-Save-Button.saved{background-position:-172px 0}.Rk-Save-Button.Rk-Save-ReadOnly,.Rk-Save-Button.disabled{opacity:.4;cursor:default}.Rk-Export-Button{width:30px;background-position:-274px 0}.Rk-Export-Button.disabled{opacity:.5;cursor:default}.Rk-Export-Button:hover{background-position:-274px -35px}.Rk-Export-Button.disabled:hover{opacity:1;background-position:-274px 0}.Rk-Bookmarklet-Button{width:30px;background-position:-138px 0}.Rk-Bookmarklet-Button.disabled{opacity:.5;cursor:default}.Rk-Bookmarklet-Button:hover{background-position:-138px -35px}.Rk-Bookmarklet-Button.disabled:hover{opacity:1;background-position:-138px 0}.Rk-Home-Button{width:30px;background-position:-206px 0}.Rk-Home-Button:hover{background-position:-206px -35px}.Rk-Open-Button{width:30px;background-position:-240px 0}.Rk-Open-Button:hover{background-position:-240px -35px}.Rk-GraphSearch-Form{float:right;width:185px;position:relative}.Rk-GraphSearch-Form:after,.Rk-GraphSearch-Form:before{position:absolute;display:block;content:".";text-indent:-9999px}.Rk-GraphSearch-Form:before{right:10px;top:20px;width:7px;height:2px;border:none;padding:0;background:#666;transform:rotate(40deg);-webkit-transform:rotate(40deg)}.Rk-GraphSearch-Form:after{right:13px;top:11px;width:6px;height:6px;border-radius:8px;border:2px solid #666}.Rk-GraphSearch-Field{line-height:23px;font-size:14px;height:23px;padding:0 5px;border:none;margin:6px 5px;width:165px;background:#f0f0f0;box-shadow:1px 1px 1px #999 inset;border-radius:5px;-webkit-appearance:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.Rk-Editing-Space{position:absolute;left:0;top:35px;right:0;bottom:0;overflow:hidden;background:-moz-radial-gradient(center,circle,#fff 40%,#e0e0e0 90%);background:-webkit-radial-gradient(center,circle,#fff 40%,#e0e0e0 90%);background:-ms-radial-gradient(center,circle,#fff 40%,#e0e0e0 90%)}.Rk-Editing-Space-Full{top:0}.Rk-Canvas{position:absolute;left:0;top:0;right:0;bottom:0;z-index:2}.Rk-Canvas[resize]{width:100%;height:100%}.Rk-Highlighted{background:rgba(255,255,0,.5)}.Rk-Labels{position:absolute;left:0;top:0;z-index:1;font-family:"Segoe UI","Helvetica Neue",Arial,Helvetica,sans-serif}.Rk-Label{position:absolute;width:160px;margin-left:-80px;text-align:center;font-size:13px;line-height:13px}.Rk-Edge-Label{font-size:11px;transform-origin:50% 0;-moz-transform-origin:50% 0;-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0}.Rk-Editor{position:absolute;left:0;top:0;z-index:3}.Rk-Notifications{position:absolute;right:15px;top:15px;width:200px;padding:10px;border-radius:8px;display:none;color:#fff;font-size:13px;text-align:center;font-weight:700;background:rgba(20,20,20,.7);background:-moz-linear-gradient(top,rgba(40,40,40,.7)20%,rgba(0,0,0,.7)80%);background:-webkit-linear-gradient(top,rgba(40,40,40,.7)20%,rgba(0,0,0,.7)80%);background:-ms-linear-gradient(top,rgba(40,40,40,.7)20%,rgba(0,0,0,.7)80%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#202020', endColorstr='#000000', GradientType=0)}.Rk-CloseX{float:right;cursor:pointer}.Rk-Editor h2{font-size:16px;font-weight:700}.Rk-Editor audio,.Rk-Editor video{max-height:100%;max-width:100%}.Rk-Editor p,.Rk-Editor-p,.Rk-Editor-p>div{margin:5px 0;font-size:12px;clear:both}.Rk-Editor-Label{float:left;width:80px}a.Rk-Edit-Goto{display:block;float:right;width:18px;height:17px;margin:1px 0;border:none;background:url(../img/goto.png)}.Rk-Edit-Title{background-color:#fff;border:1px solid #d4d4d4;line-height:15px;min-height:15px}.Rk-Edit-Image-File,.Rk-Edit-Title,.Rk-Edit-URI,.Rk-Edit-Vocabulary{font-size:12px;width:250px}.Rk-Edit-Image{font-size:12px;width:220px}.Rk-Edit-Image-Del{display:inline-block;background:url(../img/remove.png);background-size:15px 20px;background-repeat:no-repeat;vertical-align:top;height:20px;width:15px;margin-right:2px}.Rk-Edit-URI{font-size:12px;width:220px}.Rk-Edit-ImgWrap{text-align:center}.Rk-Edit-ImgPreview{display:inline-block;border:1px solid #666;margin:5px auto;position:relative}.Rk-Edit-ImgPreview img{display:inline-block;max-width:253px!important;max-height:200px!important}.Rk-Edit-ImgPreview svg{height:100%;left:0;position:absolute;top:0;width:100%}.Rk-Editor textarea{width:250px;height:120px;resize:none}div.Rk-Edit-Description{-moz-appearance:textfield-multiline;-webkit-appearance:textarea;background-color:#FFF;border:1px solid #F0F0F0;width:250px;height:120px;resize:vertical;overflow:auto;padding:2px}.Rk-UserColor{display:inline-block;width:12px;height:12px;border:1px solid #666;margin:-2px 2px}.Rk-Edit-Color{display:inline-block;width:10px;height:10px;border:2px solid #333;margin:-2px 2px;position:relative}.Rk-Edit-ColorTip{display:block;width:3px;height:3px;background:#fff;position:absolute;bottom:0;right:0;cursor:pointer}.Rk-Edit-ColorPicker-Wrapper{display:inline-block;position:relative;float:left}.Rk-Edit-ColorPicker{position:absolute;top:-2px;left:15px;width:96px;height:96px;border:1px solid #CCC;padding:5px 4px 4px 5px;background:#fff;border-radius:5px;display:none;z-index:4}.Rk-CurrentUser .Rk-Edit-ColorPicker{left:-105px;top:2px}.Rk-Edit-ColorPicker-Text{color:#303080;font-weight:700}.Rk-Edit-ColorPicker li{float:left;width:11px;height:11px;margin:0 1px 1px 0;cursor:pointer}.Rk-Edit-Dash{float:left;display:inline-block}.Rk-Edit-Size-Btn{font-size:13px;font-weight:700;padding:0 4px;background:#fff;color:#000;border:1px solid #ccc;text-decoration:none}.Rk-Edit-Size-Btn:hover{background:#666}.Rk-Edit-Size-Disp{display:inline-block;padding:0 5px;text-align:center;width:20px}.Rk-Edit-Vocabulary-Class{color:#999;font-style:italic;font-weight:700}.Rk-Edit-Vocabulary-Property{padding-left:20px}.Rk-Edit-Direction{border:1px solid #666;padding:3px 5px;line-height:20px;border-radius:3px;background:#f0f0f0;cursor:pointer}.Rk-Edit-Direction:hover{background:silver}.Rk-Display-Title a{text-decoration:none;color:#000}.Rk-Display-Title a:hover{text-decoration:underline}.Rk-Display-URI{font-style:italic}.Rk-Display-ImgPreview{margin:5px auto;display:block;max-width:255px!important;max-height:260px!important}.Rk-Fold-Bins{position:absolute;top:5px;width:12px;text-align:center;font-size:16px;cursor:pointer;line-height:16px;padding:4px;color:#fff;background:#666;border-radius:0 6px 6px 0;font-weight:700}.Rk-Fold-Bins:hover{background:#333}.Rk-ZoomButtons{position:absolute;left:0;top:35px;cursor:pointer}.Rk-Editing-Space-Full .Rk-ZoomButtons{top:0}.Rk-ShowHiddenNodes,.Rk-ZoomFit,.Rk-ZoomIn,.Rk-ZoomOut,.Rk-ZoomSave,.Rk-ZoomSetSaved{width:21px;height:20px;background:url(../img/zoombuttons.png);margin:5px}.Rk-ZoomIn:hover{background-position:0 -20px}.Rk-ZoomFit{background-position:-42px 0}.Rk-ZoomFit:hover{background-position:-42px -20px}.Rk-ZoomOut{background-position:-21px 0}.Rk-ZoomOut:hover{background-position:-21px -20px}.Rk-ZoomSave{background-position:-63px 0}.Rk-ZoomSave:hover{background-position:-63px -20px}.Rk-ZoomSetSaved{background-position:-84px 0;display:none}.Rk-ZoomSetSaved:hover{background-position:-84px -20px}.Rk-ShowHiddenNodes{background-position:-105px 0}.Rk-ShowHiddenNodes:hover{background-position:-105px -20px}.Rk-Bins{background:#fff;position:absolute;left:0;top:0;width:299px;bottom:0;overflow:hidden;border-right:1px solid #252525}.Rk-Bins-Title{border:0 none;width:290px;height:15px;line-height:15px;margin:0;padding:15px 0 5px 10px;font-size:14px;color:#F0F0F0;background:-moz-linear-gradient(top,#1e1e1e 5px,#606060 30px);background:-webkit-linear-gradient(top,#1e1e1e 5px,#606060 30px);background:-ms-linear-gradient(top,#1e1e1e 5px,#606060 30px);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e1e1e', endColorstr='#606060', GradientType=0)}.Rk-Search-Form{padding:0 10px 8px;height:27px;background:#606060}.Rk-Search-Input,.Rk-Search-Select{float:left;margin:0}.Rk-Search-Input{border-top-left-radius:5px;border-bottom-left-radius:5px;border:1px solid #003050;font-size:13px;background:#fff;height:25px;padding:0 5px;line-height:25px;-webkit-appearance:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.Rk-Web-Search-Input{width:190px}.Rk-Bins-Search-Input{width:235px}.Rk-Search-Select{display:inline-block;position:relative;width:45px;border-width:1px;border-color:#003050;border-style:solid none;cursor:pointer;height:25px;background:#fff url(../img/more.png) 30px 10px no-repeat}.Rk-Search-Select:hover{background-color:#3030FF}.Rk-Search-Current{width:40px;height:20px;margin:2px;background-repeat:no-repeat}.Rk-Search-List{width:180px;margin-left:15px;font-size:13px;position:absolute;right:0;top:25px;background:#fff;box-shadow:1px 1px 2px #505050;display:none;border:1px solid #ccc;z-index:2}.Rk-Search-List li{padding:2px 2px 2px 30px;border-top:1px solid #ccc;height:16px;background-color:#fff;background-repeat:no-repeat;cursor:pointer}.Rk-Search-List li:hover{background-color:#3030ff;color:#fff}.Rk-Search-Submit{border:1px solid #003050;height:27px;width:30px;border-top-right-radius:5px;border-bottom-right-radius:5px;background:#333 center no-repeat url(../img/search.png);cursor:pointer}.Rk-Search-Submit:hover{background-color:#999}.Rk-Bin-Title{background:#333;background:-moz-linear-gradient(top,#505050 20%,#1e1e1e 80%);background:-webkit-linear-gradient(top,#505050 20%,#1e1e1e 80%);background:-ms-linear-gradient(top,#505050 20%,#1e1e1e 80%);font-weight:700;font-size:14px;padding:5px;cursor:pointer;color:#f0f0f0;margin:0;border:0 none}.Rk-Bin-Close{float:right;display:block;font-size:16px;font-weight:700;margin:2px 3px 0;color:#f0f0f0;cursor:pointer;text-shadow:-1px -1px 1px #999,1px 1px 1px #000;text-decoration:none}.Rk-Bin-Close:hover{color:#ffff80}.Rk-Bin-Title:hover{color:#ffffe0;background:#505050;background:-moz-linear-gradient(top,#141414 20%,#3c3c3c 80%);background:-webkit-linear-gradient(top,#141414 20%,#3c3c3c 80%);background:-ms-linear-gradient(top,#141414 20%,#3c3c3c 80%)}.Rk-Bin-Refresh{width:18px;height:17px;background:url(../img/refresh.png);display:block;float:right;margin-top:4px}.Rk-Bin-Refresh:hover{background-position:-18px 0}.Rk-Bin-Count{float:right;background:#c000a0;color:#FFF;text-shadow:1px 1px 1px #000;display:none;border-radius:4px;padding:1px 3px;font-size:10px;font-weight:700;margin-top:4px}.Rk-Bin-Title-Icon{float:left;width:25px;margin:2px}.Rk-Bin-Main{overflow:auto;background:#fff;background:-moz-linear-gradient(top,#e0e0e0 0,#FFF 2%,#FFF 98%,#e0e0e0 100%);background:-webkit-linear-gradient(top,#e0e0e0 0,#FFF 2%,#FFF 98%,#e0e0e0 100%);background:-ms-linear-gradient(top,#e0e0e0 0,#FFF 2%,#FFF 98%,#e0e0e0 100%)}.Rk-Bin-Item{cursor:move}.Rk-Bin-Item.hover,.Rk-Bin-Item:hover{background:-moz-linear-gradient(top,rgba(0,0,0,.1)20%,rgba(128,128,128,.1)80%);background:-webkit-linear-gradient(top,rgba(0,0,0,.1)20%,rgba(128,128,128,.1)80%);background:-ms-linear-gradient(top,rgba(0,0,0,.1)20%,rgba(128,128,128,.1)80%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d0d0d0', endColorstr='#f3f3f3', GradientType=0)}.Rk-Bin-Item.selected{background:#ffffc0}.Rk-Bin-Main li{padding:2px;border-bottom:1px solid #ccc;clear:both;overflow:hidden}.Rk-Bin-Main h3{font-size:14px;font-style:italic;font-weight:700;text-align:center}.Rk-Bin-Main h4{font-size:12px;font-weight:700}.Rk-Bin-Main p{font-size:11px}.Rk-Bin-Main h4 a{color:#303080}.Rk-Bin-Main .searchmatch{background:#ffff80}.Rk-Wikipedia-Search-Icon{background-image:url(../img/search-logos.png)}.Rk-Wikipedia-Icon{float:left;margin:3px;max-height:48px;max-width:48px}.Rk-Wikipedia-Title-Icon{height:20px;background:url(../img/search-logos.png)}.Rk-Wikipedia-Lang-en{background-position:0 -20px}.Rk-Wikipedia-Lang-fr{background-position:0 -40px}.Rk-Wikipedia-Lang-ja{background-position:0 -60px}.Rk-Wikipedia-Result{min-height:51px}.Rk-Wikipedia-Result h4,.Rk-Wikipedia-Result p{margin-left:54px}.Rk-ResourceList-Image{float:left;max-width:100px;max-height:75px;margin-right:2px}.Rk-Ldt-Icon,.Rk-Ldt-Title-Icon{background:url(../img/search-logos.png);background-position:0 -100px;background-repeat:no-repeat}.Rk-Ldt-Title-Icon{height:20px;margin-top:4px}.Rk-Ldt-Tag-Icon{float:left;margin:0 2px 0 0}.Rk-Ldt-Annotation-Icon{float:left;margin:3px}.Rk-Clear{clear:both}h4.Rk-Bin-Loading{margin:10px;text-align:center;font-size:20px;color:#999}
\ No newline at end of file
--- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/space-editor.css	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/space-editor.css	Tue Sep 15 17:08:53 2015 +0200
@@ -24,7 +24,7 @@
  *  knowledge of the CeCILL-C license and that you accept its terms.
  */
 
-/*! renkan - v0.12.1 - Copyright © IRI 2015 */
+/*! renkan - v - Copyright © IRI 2015 */
 
 html {
     overflow: visible !important;
--- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/space-editor.min.css	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/space-editor.min.css	Tue Sep 15 17:08:53 2015 +0200
@@ -24,7 +24,7 @@
  *  knowledge of the CeCILL-C license and that you accept its terms.
  */
 
-/*! renkan - v0.12.1 - Copyright © IRI 2015 */
+/*! renkan - v - Copyright © IRI 2015 */
 
 
 html{overflow:visible!important}body{font-family:Arial,Helvetica,sans-serif;background:#F6F6F6;color:#333}.clearer{display:block;clear:both;height:1px}h1{margin-bottom:5px;padding:0 15px;background:#333;color:#fff;font-weight:700;font-size:30px;line-height:60px}.right{width:301px;position:absolute;top:10px;right:10px}.main{margin:10px 330px 10px 20px}.blue-button{display:inline-block;padding:4px 6px;color:#fff;text-decoration:none;border-radius:4px;background:-moz-linear-gradient(top,#6080c0,#2040a0);background:-webkit-linear-gradient(top,#6080c0,#2040a0);box-shadow:1px 1px 2px gray}.blue-button:hover{background:-moz-linear-gradient(top,#2040a0,#6080c0);background:-webkit-linear-gradient(top,#2040a0,#6080c0)}.update-preview{text-align:center;display:block;margin-bottom:10px;font-size:24px;font-weight:700;line-height:34px}#preview{position:relative;border-left:1px solid #000;border-bottom:1px solid #000;width:300px;height:800px;border-radius:4px;overflow:hidden;margin-bottom:10px}.section-title{font-size:20px;font-weight:700;margin:20px 0 5px}.first-level-list{margin:5px 0}.add-item{margin:5px 0;font-size:22px;font-weight:700;line-height:18px}.add-item:hover:after{float:right;font-size:14px;font-weight:400;line-height:18px;margin-left:4px}.add-search-engine:hover:after{content:"Add Search Engine"}.add-resource:hover:after{content:"Add Resource"}.add-bin:hover:after{content:"Add Bin"}.item{padding:5px;margin:5px 0;border-radius:4px;font-size:12px;background:-moz-linear-gradient(top,#ffcc8f,#fff0d0);background:-webkit-linear-gradient(top,#ffcc8f,#fff0d0);box-shadow:1px 1px 2px gray}.remove-item{float:right;font-size:22px;line-height:18px;height:18px;margin:0 0 2px -10px;font-weight:700}.setting{float:left;width:260px;margin:2px 15px 2px 2px;line-height:24px;min-height:24px}.setting label{float:left;display:block;width:100px;font-weight:700}.display-value{float:left;display:block;width:160px}.edit-value{width:160px;display:none;border:1px solid #ccc;border-radius:3px}input.edit-value,textarea.edit-value{width:154px;padding:2px}textarea.edit-value{resize:vertical;height:72px}.item-editing .display-value{display:none}.item-editing .edit-value{display:inline-block}.resource-list-title{clear:both;width:100%;font-size:16px;font-weight:700;margin:5px 0 0}.resource{display:block;clear:both;padding:5px;margin:5px;border-radius:4px;background:-moz-linear-gradient(top,#ff8f00,#ffcc8f);background:-webkit-linear-gradient(top,#ff8f00,#ffcc8f);box-shadow:1px 1px 2px gray}.resource .display-value{display:inline-block}.resource .edit-value,.resource.resource-editing .display-value{display:none}.resource.resource-editing .edit-value{display:inline-block}
\ No newline at end of file
--- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.js	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.js	Tue Sep 15 17:08:53 2015 +0200
@@ -24,7 +24,7 @@
  *  knowledge of the CeCILL-C license and that you accept its terms.
  */
 
-/*! renkan - v0.12.1 - Copyright © IRI 2015 */
+/*! renkan - v - Copyright © IRI 2015 */
 
 this["renkanJST"] = this["renkanJST"] || {};
 
@@ -413,9 +413,17 @@
 __e(renkan.translate("Edit Node")) +
 '</span>\n</h2>\n<p>\n    <label>' +
 __e(renkan.translate("Title:")) +
-'</label>\n    <input class="Rk-Edit-Title" type="text" value="' +
+'</label>\n    ';
+ if (options.show_node_editor_title_richtext) { ;
+__p += '\n        <div class="Rk-Edit-Title" contenteditable="true">' +
+((__t = (node.title)) == null ? '' : __t) +
+'</div>\n    ';
+ } else { ;
+__p += '\n        <input class="Rk-Edit-Title" type="text" value="' +
 __e(node.title) +
-'" />\n</p>\n';
+'" />\n    ';
+ } ;
+__p += '    \n</p>\n';
  if (options.show_node_editor_uri) { ;
 __p += '\n    <p>\n        <label>' +
 __e(renkan.translate("URI:")) +
@@ -608,7 +616,7 @@
 __e( shortenText(node.created_by_title, 25) ) +
 '\n    </p>\n';
  } ;
-__p += '\n    <a href="#?idnode=' +
+__p += '\n    <a href="#?idNode=' +
 __e(node._id) +
 '">' +
 __e(renkan.translate("Link to the node")) +
@@ -964,9 +972,9 @@
         });
 
         this.read_only = this.options.read_only || !this.options.editor_mode;
-        
+
         this.router = new Rkns.Router();
-        
+
         this.project = new Rkns.Models.Project();
         this.dataloader = new Rkns.DataLoader.Loader(this.project, this.options);
 
@@ -1410,8 +1418,7 @@
             _path.segments[4].point.y = _path.segments[5].point.y = _bottom;
             _path.segments[1].point.y = _coords.y - _options.tooltip_arrow_width / 2;
             _path.segments[6].point.y = _coords.y + _options.tooltip_arrow_width / 2;
-            _path.closed = true;
-            _path.fillColor = new paper.GradientColor(new paper.Gradient([_options.tooltip_top_color, _options.tooltip_bottom_color]), [0, _top], [0, _bottom]);
+            _path.fillColor = new paper.Color(new paper.Gradient([_options.tooltip_top_color, _options.tooltip_bottom_color]), [0, _top], [0, _bottom]);
             _selector.css({
                 left: (_options.tooltip_padding + Math.min(_left, _right)),
                 top: (_options.tooltip_padding + _top)
@@ -1455,14 +1462,13 @@
         index: function (parameters) {
             
             var result = {};
-            if (parameters === null){
-                return;
-            }
-            parameters.split("&").forEach(function(part) {
-              var item = part.split("=");
-              result[item[0]] = decodeURIComponent(item[1]);
-            });
-            this.trigger('router', result);            
+            if (parameters !== null){
+                parameters.split("&").forEach(function(part) {
+                    var item = part.split("=");
+                    result[item[0]] = decodeURIComponent(item[1]);
+                });
+            }
+            this.trigger('router', result);        
         }  
     });
 
@@ -1933,7 +1939,7 @@
     show_top_bar: true,
         /* Show the top bar, (title, buttons, users) */
     default_user_color: "#303030",
-    size_bug_fix: true,
+    size_bug_fix: false,
         /* Resize the canvas after load (fixes a bug on iPad and FF Mac) */
     force_resize: false,
     allow_double_click: true,
@@ -1954,6 +1960,10 @@
     default_view: false,
         /* Allows to load default view (zoom+offset) at start on read_only mode, instead of autoScale. the default_view will be the last */
 
+    /* URL parsing */
+    update_url:true,
+        /* update the url each time the paper shift or on zoom in/out, with the serialized view (offset and scale) */
+    
 
     /* TOP BAR BUTTONS */
     show_search_field: true,
@@ -2018,15 +2028,15 @@
         /* Maximum displayed text length */
     label_untitled_nodes: "(untitled)",
         /* Label to display on untitled nodes */
-    hide_nodes: true, 
+    hide_nodes: true,
         /* allow hide/show nodes */
     change_shapes: true,
         /* Change shapes enabled */
     change_types: true,
     /* Change type enabled */
-    
+
     /* NODE EDITOR TEMPLATE*/
-    
+
     node_editor_templates: {
         "default": "templates/nodeeditor_readonly.html",
         "video": "templates/nodeeditor_video.html"
@@ -2059,6 +2069,7 @@
     tooltip_bottom_color: "#d0d0d0",
     tooltip_border_color: "#808080",
     tooltip_border_width: 1,
+    tooltip_opacity: 0.8,
 
     richtext_editor_config: {
         toolbarGroups: [
@@ -2073,8 +2084,10 @@
     /* NODE EDITOR OPTIONS */
 
     show_node_editor_uri: true,
+    show_node_editor_title: true,
     show_node_editor_description: true,
     show_node_editor_description_richtext: true,
+    show_node_editor_title_richtext: true,
     show_node_editor_size: true,
     show_node_editor_style: true,
     show_node_editor_style_color: true,
@@ -2235,7 +2248,6 @@
                 saveStatus : 0
             });
             _renkan.renderer.redrawActive = true;
-            _renkan.renderer.fixSize();
         });
     };
     var _save = function() {
@@ -2261,6 +2273,9 @@
     var _thrSave = Rkns._.throttle(function() {
         setTimeout(_save, 100);
     }, 1000);
+    
+    //TODO: Rearrange to avoid the 2 firts PUT due to a change in the project model
+    // Take car of setting up the listener correctly to listen the save action on the view
     _proj.on("add:nodes add:edges add:users add:views", function(_model) {
         _model.on("change remove", function(_model) {
             _thrSave();
@@ -2299,13 +2314,14 @@
             url: _opts.url,
             data: getdata,
             beforeSend: function(){
+                _renkan.renderer.redrawActive = false;
             	_proj.set({loadingStatus:true});
             },
             success: function(_data) {
                 _renkan.dataloader.load(_data);
                 _proj.set({loadingStatus:false});
                 _proj.set({saveStatus:0});
-                _renkan.renderer.autoScale();
+                _renkan.renderer.redrawActive = true;
             }
         });
     };
@@ -2818,7 +2834,7 @@
 
 
 define('renderer/baserepresentation',['jquery', 'underscore'], function ($, _) {
-    'use strict';
+    
 
     /* Rkns.Renderer._BaseRepresentation Class */
 
@@ -2903,7 +2919,7 @@
 });
 
 define('requtils',[], function ($, _) {
-    'use strict';
+    
     return {
         getUtils: function(){
             return window.Rkns.Utils;
@@ -2917,7 +2933,7 @@
 
 
 define('renderer/basebutton',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -2935,7 +2951,9 @@
             this.sector.show();
         },
         hide: function() {
-            this.sector.hide();
+            if (this.sector){
+                this.sector.hide();                
+            }
         },
         select: function() {
             this.sector.select();
@@ -2957,7 +2975,7 @@
 
 
 define('renderer/shapebuilder',[], function () {
-    'use strict';
+    
 
     var cloud_path = "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";
     /* ShapeBuilder Begin */
@@ -3072,7 +3090,7 @@
 });
 
 define('renderer/noderepr',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation', 'renderer/shapebuilder'], function ($, _, requtils, BaseRepresentation, ShapeBuilder) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -3169,7 +3187,7 @@
             if (!this.is_dragging || !this.paper_coords) {
                 this.paper_coords = this.renderer.toPaperCoords(_model_coords);
             }
-            this.circle_radius = _baseRadius * this.renderer.scale;
+            this.circle_radius = _baseRadius * this.renderer.view.scale;
             if (this.last_circle_radius !== this.circle_radius) {
                 this.all_buttons.forEach(function(b) {
                     b.setSectorSize();
@@ -3420,7 +3438,7 @@
                     this.redraw();
                 }
             } else {
-                this.renderer.paperShift(_delta);
+                this.renderer.view.paperShift(_delta);
             }
         },
         openEditor: function() {
@@ -3482,8 +3500,7 @@
                 //when the mouse don't hover the node anymore, we hide it
                 if (this.hidden) {
                     this.hide();
-                }
-                else {
+                } else {
                     this.hideNeighbors();
                 }
                 this._super("unselect");
@@ -3528,6 +3545,7 @@
                 this.title.css('opacity', this.options.ghost_opacity);
                 this.minimap_circle.opacity = this.options.ghost_opacity;
             } else {
+                this.minimap_circle.opacity = 1; 
                 this.hidden = false;
                 this.redraw();
             }
@@ -3575,9 +3593,9 @@
                         if (repr && repr.hidden) {
                             repr.show(ghost);
                             if (!ghost){
-                                var indexNode = _this.renderer.hiddenNodes.indexOf(repr.model.id);
+                                var indexNode = _this.renderer.view.hiddenNodes.indexOf(repr.model.id);
                                 if (indexNode !== -1){
-                                    _this.renderer.hiddenNodes.splice(indexNode, 1);
+                                    _this.renderer.view.hiddenNodes.splice(indexNode, 1);
                                 }
                             }
                         }
@@ -3624,9 +3642,9 @@
                 this.saveCoords();
             } else {
                 if (this.hidden) {
-                    var index = this.renderer.hiddenNodes.indexOf(this.model.id);
+                    var index = this.renderer.view.hiddenNodes.indexOf(this.model.id);
                     if (index !== -1){
-                        this.renderer.hiddenNodes.splice(index, 1);
+                        this.renderer.view.hiddenNodes.splice(index, 1);
                     }
                     this.show(false);
                     this.select();
@@ -3663,7 +3681,7 @@
 
 
 define('renderer/edge',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -3961,7 +3979,7 @@
 
 
 define('renderer/tempedge',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4061,7 +4079,7 @@
 
 
 define('renderer/baseeditor',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4078,14 +4096,14 @@
             this.editor_block.add.apply(this.editor_block, _pts);
             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_block.opacity = this.options.tooltip_opacity;
             this.editor_$ = $('<div>')
-            .appendTo(this.renderer.editor_$)
-            .css({
-                position: "absolute",
-                opacity: 0.8
-            })
-            .hide();
+                .appendTo(this.renderer.editor_$)
+                .css({
+                    position: "absolute",
+                    opacity: this.options.tooltip_opacity
+                })
+                .hide();
         },
         destroy: function() {
             this.editor_block.remove();
@@ -4101,7 +4119,7 @@
 
 
 define('renderer/nodeeditor',['jquery', 'underscore', 'requtils', 'renderer/baseeditor', 'renderer/shapebuilder', 'ckeditor-jquery'], function ($, _, requtils, BaseEditor, ShapeBuilder) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4155,6 +4173,9 @@
                 editorInstance = _this.options.show_node_editor_description_richtext ?
                     $(".Rk-Edit-Description").ckeditor(_this.options.richtext_editor_config) :
                     false,
+                editorInstanceTitle = _this.options.show_node_editor_title_richtext ?
+                    $(".Rk-Edit-Title").ckeditor(_this.options.richtext_editor_config) :
+                    false,
                 closeEditor = function() {
                     _this.renderer.removeRepresentation(_this);
                     paper.view.draw();
@@ -4179,6 +4200,14 @@
                         _editor.destroy();
                     }
                 }
+                if(_this.options.show_node_editor_title_richtext) {
+                    if(typeof editorInstanceTitle.editor !== 'undefined') {
+                        var _editor_title = editorInstanceTitle.editor;
+                        delete editorInstanceTitle.editor;
+                        _editor_title.focusManager.blur(true);
+                        _editor_title.destroy();
+                    }
+                }
             };
 
             this.editor_$.find(".Rk-CloseX").click(function (e) {
@@ -4197,9 +4226,7 @@
                 var onFieldChange = _.throttle(function() {
                   _.defer(function() {
                     if (_this.renderer.isEditable()) {
-                        var _data = {
-                            title: _this.editor_$.find(".Rk-Edit-Title").val()
-                        };
+                        var _data = {};
                         if (_this.options.show_node_editor_uri) {
                             _data.uri = _this.editor_$.find(".Rk-Edit-URI").val();
                             _this.editor_$.find(".Rk-Edit-Goto").attr("href",_data.uri || "#");
@@ -4220,6 +4247,18 @@
                                 _data.description = _this.editor_$.find(".Rk-Edit-Description").val();
                             }
                         }
+                        if (_this.options.show_node_editor_title) {
+                            if(_this.options.show_node_editor_title_richtext) {
+                                if(typeof editorInstanceTitle.editor !== 'undefined' &&
+                                        editorInstanceTitle.editor.checkDirty()) {
+                                    _data.title = editorInstanceTitle.editor.getData();
+                                    editorInstanceTitle.editor.resetDirty();
+                                }
+                            }
+                            else {
+                                _data.title = _this.editor_$.find(".Rk-Edit-Title").val();
+                            }
+                        }
                         if (_this.options.show_node_editor_style) {
                             var dash = _this.editor_$.find(".Rk-Edit-Dash").is(':checked');
                             _data.style = _.assign( ((_model.has("style") && _.clone(_model.get("style"))) || {}), {dash: dash});
@@ -4256,6 +4295,14 @@
                     editorInstance.editor.on("change", onFieldChange);
                     editorInstance.editor.on("blur", onFieldChange);
                 }
+                
+                if( _this.options.show_node_editor_title &&
+                    _this.options.show_node_editor_title_richtext &&
+                    typeof editorInstanceTitle.editor !== 'undefined')
+                {
+                    editorInstanceTitle.editor.on("change", onFieldChange);
+                    editorInstanceTitle.editor.on("blur", onFieldChange);
+                }
 
                 if(_this.options.allow_image_upload) {
                     this.editor_$.find(".Rk-Edit-Image-File").change(function() {
@@ -4406,7 +4453,7 @@
 
 
 define('renderer/edgeeditor',['jquery', 'underscore', 'requtils', 'renderer/baseeditor'], function ($, _, requtils, BaseEditor) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4599,7 +4646,7 @@
 
 
 define('renderer/nodebutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4651,7 +4698,7 @@
 
 
 define('renderer/nodeeditbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4684,7 +4731,7 @@
 
 
 define('renderer/noderemovebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4731,7 +4778,7 @@
 
 
 define('renderer/nodehidebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4754,7 +4801,7 @@
             this.renderer.is_dragging = false;
             this.renderer.removeRepresentationsOfType("editor");
             if (this.renderer.isEditable()) {
-                this.renderer.addHiddenNode(this.source_representation.model);
+                this.renderer.view.addHiddenNode(this.source_representation.model);
             }
         }
     }).value();
@@ -4767,7 +4814,7 @@
 
 
 define('renderer/nodeshowbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4803,7 +4850,7 @@
 
 
 define('renderer/noderevertbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4838,7 +4885,7 @@
 
 
 define('renderer/nodelinkbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4879,7 +4926,7 @@
 
 
 define('renderer/nodeenlargebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4914,7 +4961,7 @@
 
 
 define('renderer/nodeshrinkbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4949,7 +4996,7 @@
 
 
 define('renderer/edgeeditbutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -4978,7 +5025,7 @@
 
 
 define('renderer/edgeremovebutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -5021,7 +5068,7 @@
 
 
 define('renderer/edgerevertbutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -5052,7 +5099,7 @@
 
 
 define('renderer/miniframe',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -5081,7 +5128,7 @@
 
 
 define('renderer/scene',['jquery', 'underscore', 'filesaver', 'requtils', 'renderer/miniframe'], function ($, _, filesaver, requtils, MiniFrame) {
-    'use strict';
+    
 
     var Utils = requtils.getUtils();
 
@@ -5102,11 +5149,7 @@
         }
         this.notif_$ = this.$.find(".Rk-Notifications");
         paper.setup(this.canvas_$[0]);
-        this.scale = 1;
-        this.initialScale = 1;
-        this.offset = paper.view.center;
         this.totalScroll = 0;
-        this.hiddenNodes = [];
         this.mouse_down = false;
         this.click_target = null;
         this.selected_target = null;
@@ -5209,7 +5252,7 @@
                     _lastTap = new Date();
                     _lastTapX = _touches.pageX;
                     _lastTapY = _touches.pageY;
-                    _originalScale = _this.scale;
+                    _originalScale = _this.view.scale;
                     _zooming = false;
                     _this.onMouseDown(_touches, true);
                 }
@@ -5230,12 +5273,12 @@
                         return;
                     }
                     var _newScale = _event.originalEvent.scale * _originalScale,
-                    _scaleRatio = _newScale / _this.scale,
+                    _scaleRatio = _newScale / _this.view.scale,
                     _newOffset = new paper.Point([
                                                   _this.canvas_$.width(),
                                                   _this.canvas_$.height()
-                                                  ]).multiply( 0.5 * ( 1 - _scaleRatio ) ).add(_this.offset.multiply( _scaleRatio ));
-                    _this.setScale(_newScale, _newOffset);
+                                                  ]).multiply( 0.5 * ( 1 - _scaleRatio ) ).add(_this.view.offset.multiply( _scaleRatio ));
+                    _this.view.setScale(_newScale, _newOffset);
                 }
             },
             touchend: function(_event) {
@@ -5315,34 +5358,6 @@
             });
         };
 
-        bindClick(".Rk-ZoomOut", "zoomOut");
-        bindClick(".Rk-ZoomIn", "zoomIn");
-        bindClick(".Rk-ZoomFit", "autoScale");
-        this.$.find(".Rk-ZoomSave").click( function() {
-            // Save scale and offset point
-            _this.renkan.project.addView( { zoom_level:_this.scale, offset:_this.offset, hidden_nodes: _this.hiddenNodes } );
-        });
-        this.$.find(".Rk-ZoomSetSaved").click( function() {
-            var view = _this.renkan.project.get("views").last();
-            if(view){
-                _this.showNodes(false);
-                _this.setScale(view.get("zoom_level"), new paper.Point(view.get("offset")));
-                if (_this.renkan.options.hide_nodes){
-                    _this.hiddenNodes = (view.get("hidden_nodes") || []).concat();
-                    _this.hideNodes();                    
-                }
-            }
-        });
-        this.$.find(".Rk-ShowHiddenNodes").mouseenter( function() {
-            _this.showNodes(true);
-            _this.$.find(".Rk-ShowHiddenNodes").mouseleave( function() {
-                _this.hideNodes();
-            });
-        });
-        this.$.find(".Rk-ShowHiddenNodes").click( function() {
-            _this.showNodes(false);
-            _this.$.find(".Rk-ShowHiddenNodes").off( "mouseleave" );
-        });
         if(this.renkan.project.get("views").length > 0 && this.renkan.options.save_view){
             this.$.find(".Rk-ZoomSetSaved").show();
         }
@@ -5395,7 +5410,7 @@
                 _ratio = ratioW;
             }
 
-            _this.resizeZoom(ratioW, ratioH, _ratio);
+            _this.view.resizeZoom(ratioW, ratioH, _ratio);
 
             _this.redraw();
 
@@ -5404,7 +5419,7 @@
         var _thRedraw = _.throttle(function() {
             _this.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() {
@@ -5451,6 +5466,7 @@
             }
             else{
                 Backbone.history.start();
+                _thRedraw();
             }
         });
 
@@ -5599,12 +5615,12 @@
 
     _(Scene.prototype).extend({
         fixSize: function() {
-            if( this.renkan.options.default_view && this.renkan.project.get("views").length > 0) {
-                var view = this.renkan.project.get("views").last();
-                this.setScale(view.get("zoom_level"), new paper.Point(view.get("offset")));
+            if(typeof this.view === 'undefined') {
+                this.view = this.addRepresentation("View", this.renkan.project.get("views").last());
+                this.view.setScale(view.get("zoom_level"), new paper.Point(view.get("offset")));
             }
             else{
-                this.autoScale();
+                this.view.autoScale();
             }
         },
         drawSector: function(_repr, _inR, _outR, _startAngle, _endAngle, _padding, _imgname, _caption) {
@@ -5755,38 +5771,6 @@
             }
             this.redrawUsers();
         },
-        setScale: function(_newScale, _offset) {
-            if ((_newScale/this.initialScale) > Utils._MIN_SCALE && (_newScale/this.initialScale) < Utils._MAX_SCALE) {
-                this.scale = _newScale;
-                if (_offset) {
-                    this.offset = _offset;
-                }
-                this.redraw();
-            }
-        },
-        autoScale: function(force_view) {
-            var nodes = this.renkan.project.get("nodes");
-            if (nodes.length > 1) {
-                var _xx = nodes.map(function(_node) { return _node.get("position").x; }),
-                _yy = nodes.map(function(_node) { return _node.get("position").y; }),
-                _minx = Math.min.apply(Math, _xx),
-                _miny = Math.min.apply(Math, _yy),
-                _maxx = Math.max.apply(Math, _xx),
-                _maxy = Math.max.apply(Math, _yy);
-                var _scale = Math.min( (paper.view.size.width - 2 * this.renkan.options.autoscale_padding) / (_maxx - _minx), (paper.view.size.height - 2 * this.renkan.options.autoscale_padding) / (_maxy - _miny));
-                this.initialScale = _scale;
-                // Override calculated scale if asked
-                if((typeof force_view !== "undefined") && parseFloat(force_view.zoom_level)>0 && parseFloat(force_view.offset.x)>0 && parseFloat(force_view.offset.y)>0){
-                    this.setScale(parseFloat(force_view.zoom_level), new paper.Point(parseFloat(force_view.offset.x), parseFloat(force_view.offset.y)));
-                }
-                else{
-                    this.setScale(_scale, paper.view.center.subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale)));
-                }
-            }
-            if (nodes.length === 1) {
-                this.setScale(1, paper.view.center.subtract(new paper.Point([nodes.at(0).get("position").x, nodes.at(0).get("position").y])));
-            }
-        },
         redrawMiniframe: function() {
             var topleft = this.toMinimapCoords(this.toModelCoords(new paper.Point([0,0]))),
                 bottomright = this.toMinimapCoords(this.toModelCoords(paper.view.bounds.bottomRight));
@@ -5802,8 +5786,8 @@
                     _maxx = Math.max.apply(Math, _xx),
                     _maxy = Math.max.apply(Math, _yy);
                 var _scale = 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.view.scale * 0.8 * this.renkan.options.minimap_width / paper.view.bounds.width,
+                        this.view.scale * 0.8 * this.renkan.options.minimap_height / paper.view.bounds.height,
                         ( this.renkan.options.minimap_width - 2 * this.renkan.options.minimap_padding ) / (_maxx - _minx),
                         ( this.renkan.options.minimap_height - 2 * this.renkan.options.minimap_padding ) / (_maxy - _miny)
                 );
@@ -5817,19 +5801,19 @@
             this.redraw();
         },
         toPaperCoords: function(_point) {
-            return _point.multiply(this.scale).add(this.offset);
+            return _point.multiply(this.view.scale).add(this.view.offset);
         },
         toMinimapCoords: function(_point) {
             return _point.multiply(this.minimap.scale).add(this.minimap.offset).add(this.minimap.topleft);
         },
         toModelCoords: function(_point) {
-            return _point.subtract(this.offset).divide(this.scale);
+            return _point.subtract(this.view.offset).divide(this.view.scale);
         },
         addRepresentation: function(_type, _model) {
             var RendererType = requtils.getRenderer()[_type];
             var _repr = new RendererType(this, _model);
             this.representations.push(_repr);
-            return _repr;
+            return _repr;                
         },
         addRepresentations: function(_type, _collection) {
             var _this = this;
@@ -5945,7 +5929,7 @@
             _.each(this.representations, function(_representation) {
                 _representation.redraw({ dontRedrawEdges:true });
             });
-            if (this.minimap) {
+            if (this.minimap && typeof this.view !== 'undefined') {
                 this.redrawMiniframe();
             }
             paper.view.draw();
@@ -5957,40 +5941,6 @@
             _tmpEdge.redraw();
             this.click_target = _tmpEdge;
         },
-        addHiddenNode: function(_model){
-            this.hideNode(_model);
-            this.hiddenNodes.push(_model.id);
-        },
-        hideNode: function(_model){
-            var _this = this;
-            if (typeof _this.getRepresentationByModel(_model) !== 'undefined'){
-                _this.getRepresentationByModel(_model).hide();
-            }
-        },
-        hideNodes: function(){
-            var _this = this;
-            this.hiddenNodes.forEach(function(_id, index){
-                var node = _this.renkan.project.get("nodes").get(_id);
-                if (typeof node !== 'undefined'){
-                    return _this.hideNode(_this.renkan.project.get("nodes").get(_id));
-                }else{
-                    _this.hiddenNodes.splice(index, 1);
-                }
-            });
-            paper.view.draw();
-        },
-        showNodes: function(ghost){
-            var _this = this;
-            var i = 0;
-            this.hiddenNodes.forEach(function(_id){
-                i++;
-                _this.getRepresentationByModel(_this.renkan.project.get("nodes").get(_id)).show(ghost);
-            });
-            if (!ghost){
-                this.hiddenNodes = [];
-            }
-            paper.view.draw();
-        },
         findTarget: function(_hitResult) {
             if (_hitResult && typeof _hitResult.item.__representation !== "undefined") {
                 var _newTarget = _hitResult.item.__representation;
@@ -6008,10 +5958,6 @@
                 this.selected_target = null;
             }
         },
-        paperShift: function(_delta) {
-            this.offset = this.offset.add(_delta);
-            this.redraw();
-        },
         onMouseMove: function(_event) {
             var _off = this.canvas_$.offset(),
             _point = new paper.Point([
@@ -6028,7 +5974,7 @@
                 if (this.click_target && typeof this.click_target.paperShift === "function") {
                     this.click_target.paperShift(_delta);
                 } else {
-                    this.paperShift(_delta);
+                    this.view.paperShift(_delta);
                 }
             } else {
                 this.findTarget(_hitResult);
@@ -6101,6 +6047,7 @@
                 if (_isTouch) {
                     this.unselectAll();
                 }
+                this.view.updateUrl();
             }
             paper.view.draw();
         },
@@ -6111,11 +6058,11 @@
                 _delta = new paper.Point([
                                           _event.pageX - _off.left,
                                           _event.pageY - _off.top
-                                          ]).subtract(this.offset).multiply( Math.SQRT2 - 1 );
+                                          ]).subtract(this.view.offset).multiply( Math.SQRT2 - 1 );
                 if (this.totalScroll > 0) {
-                    this.setScale( this.scale * Math.SQRT2, this.offset.subtract(_delta) );
+                    this.view.setScale( this.view.scale * Math.SQRT2, this.view.offset.subtract(_delta) );
                 } else {
-                    this.setScale( this.scale * Math.SQRT1_2, this.offset.add(_delta.divide(Math.SQRT2)));
+                    this.view.setScale( this.view.scale * Math.SQRT1_2, this.view.offset.add(_delta.divide(Math.SQRT2)));
                 }
                 this.totalScroll = 0;
             }
@@ -6315,30 +6262,6 @@
                 this.redraw();
             }
         },
-        zoomOut: function() {
-            var _newScale = this.scale * Math.SQRT1_2,
-            _offset = new paper.Point([
-                                       this.canvas_$.width(),
-                                       this.canvas_$.height()
-                                       ]).multiply( 0.5 * ( 1 - Math.SQRT1_2 ) ).add(this.offset.multiply( Math.SQRT1_2 ));
-            this.setScale( _newScale, _offset );
-        },
-        zoomIn: function() {
-            var _newScale = this.scale * Math.SQRT2,
-            _offset = new paper.Point([
-                                       this.canvas_$.width(),
-                                       this.canvas_$.height()
-                                       ]).multiply( 0.5 * ( 1 - Math.SQRT2 ) ).add(this.offset.multiply( Math.SQRT2 ));
-            this.setScale( _newScale, _offset );
-        },
-        resizeZoom: function(_scaleWidth, _scaleHeight, _ratio) {
-            var _newScale = this.scale * _ratio,
-                _offset = new paper.Point([
-                                       (this.offset.x * _scaleWidth),
-                                       (this.offset.y * _scaleHeight)
-                                       ]);
-            this.setScale( _newScale, _offset );
-        },
         addNodeBtn: function() {
             if (this.click_mode === Utils._CLICKMODE_ADDNODE) {
                 this.click_mode = false;
@@ -6406,9 +6329,40 @@
 
         },
         parameters: function(_params){
-            if (typeof _params.idnode !== 'undefined'){
-                this.unhighlightAll();
-                this.highlightModel(this.renkan.project.get("nodes").get(_params.idnode));                 
+            if ($.isEmptyObject(_params)){
+                this.view = this.addRepresentation("View", this.renkan.project.get("views").first());
+                this.view.autoScale();
+                return;
+            }
+            if (typeof _params.idView !== 'undefined' && typeof this.renkan.project.get("views").at(_params.idView) !== 'undefined'){
+                this.view = this.addRepresentation("View", this.renkan.project.get("views").at(_params.idView));
+            }
+            if (typeof _params.view !== 'undefined' && _params.view.split(",").length >= 3){
+                var viewParams = _params.view.split(",");
+                var params = {
+                        "project": this.renkan.project,
+                        "offset": {
+                            "x": parseFloat(viewParams[0]),
+                            "y": parseFloat(viewParams[1])
+                        },
+                        "zoom_level": parseFloat(viewParams[2])
+                };
+                if (this.view){
+                    this.view.setScale(params.zoom_level, new paper.Point(params.offset));
+                } else{
+                    this.view = this.addRepresentation("View", null);
+                    this.view.params = params;
+                    this.view.init();                    
+                }
+            }
+            if(!this.view){
+                this.view = this.addRepresentation("View", this.renkan.project.get("views").first());
+                this.view.autoScale();
+            }
+            //other parameters must go after because most of them depends on a view that must be initialize before
+            this.unhighlightAll();
+            if (typeof _params.idNode !== 'undefined'){
+                this.highlightModel(this.renkan.project.get("nodes").get(_params.idNode));                 
             }
         },
         foldBins: function() {
@@ -6438,7 +6392,7 @@
                 sizeAft = sizeBef+300;
                 foldBinsButton.html("&raquo;");
             }
-            _this.resizeZoom(1, 1, (sizeAft/sizeBef));
+            _this.view.resizeZoom(1, 1, (sizeAft/sizeBef));
         },
         save: function() { },
         open: function() { }
@@ -6450,6 +6404,224 @@
 
 });
 
+define('renderer/viewrepr',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
+    
+
+    var Utils = requtils.getUtils();
+
+    /* Rkns.Renderer.View Class */
+
+    /* The representation for the view. */
+
+    var ViewRepr = Utils.inherit(BaseRepresentation);
+
+    _(ViewRepr.prototype).extend({
+        _init: function() {
+            var _this = this;
+            this.$ = $(".Rk-Render");
+            this.type = "View";
+            this.hiddenNodes = [];
+            this.scale = 1;
+            this.initialScale = 1;
+            this.offset = paper.view.center;
+            this.params = {};
+            
+            if (this.model){
+                this.params = {
+                    "zoom_level": _this.model.get("zoom_level"),
+                    "offset": _this.model.get("offset"),
+                    "hidden_nodes": _this.model.get("hidden_nodes")
+                };
+            }
+                
+            this.init();
+            
+            var bindClick = function(selector, fname) {
+                _this.$.find(selector).click(function(evt) {
+                    _this[fname](evt);
+                    return false;
+                });
+            };
+            
+            bindClick(".Rk-ZoomOut", "zoomOut");
+            bindClick(".Rk-ZoomIn", "zoomIn");
+            bindClick(".Rk-ZoomFit", "autoScale");
+            
+            this.$.find(".Rk-ZoomSave").click( function() {
+                var offset = {
+                    "x": _this.offset.x,
+                    "y": _this.offset.y
+                };
+                //TODO: make the if else the same function
+                if (_this.model && _this.renkan.project.get("views").indexOf(_this.model) > 0){
+                    _this.model.set( { zoom_level:_this.scale, offset:offset, hidden_nodes: _this.hiddenNodes.concat() } );
+                }else{
+                    _this.model = _this.renkan.project.addView( { zoom_level:_this.scale, offset:offset, hidden_nodes: _this.hiddenNodes.concat() } );
+                }
+                _this.params = {
+                        "zoom_level": _this.model.get("zoom_level"),
+                        "offset": _this.model.get("offset"),
+                        "hidden_nodes": _this.model.get("hidden_nodes")
+                };
+                _this.updateUrl();
+            });
+            
+            this.$.find(".Rk-ZoomSetSaved").click( function() {
+                _this.setScale(_this.params.zoom_level, new paper.Point(_this.params.offset));
+                _this.showNodes(false);
+                if (_this.options.hide_nodes){
+                    _this.hiddenNodes = (_this.params.hidden_nodes || []).concat();
+                    _this.hideNodes();
+                }
+            });
+            
+            this.$.find(".Rk-ShowHiddenNodes").mouseenter( function() {
+                _this.showNodes(true);
+                _this.$.find(".Rk-ShowHiddenNodes").mouseleave( function() {
+                    _this.hideNodes();
+                });
+            });
+            this.$.find(".Rk-ShowHiddenNodes").click( function() {
+                _this.showNodes(false);
+                _this.$.find(".Rk-ShowHiddenNodes").off( "mouseleave" ); 
+            });
+            if(this.renkan.project.get("views").length > 0 && this.renkan.options.save_view){
+                this.$.find(".Rk-ZoomSetSaved").show();
+            }
+        },
+        redraw: function(options) {
+            //console.log("view : ", this.model.toJSON());
+        },
+        init: function(){
+            var _this = this;
+            _this.setScale(_this.params.zoom_level, new paper.Point(_this.params.offset));
+            _this.showNodes(false);
+            if (_this.options.hide_nodes){
+                _this.hiddenNodes = (_this.params.hidden_nodes || []).concat();
+                _this.hideNodes();
+            }
+        },
+        addHiddenNode: function(_model){
+            this.hideNode(_model);
+            this.hiddenNodes.push(_model.id);
+            this.updateUrl();
+        },
+        hideNode: function(_model){
+            if (typeof this.renderer.getRepresentationByModel(_model) !== 'undefined'){
+                this.renderer.getRepresentationByModel(_model).hide();
+            }
+        },
+        hideNodes: function(){
+            var _this = this;
+            this.hiddenNodes.forEach(function(_id, index){
+                var node = _this.renkan.project.get("nodes").get(_id);
+                if (typeof node !== 'undefined'){
+                    return _this.hideNode(_this.renkan.project.get("nodes").get(_id));
+                }else{
+                    _this.hiddenNodes.splice(index, 1);
+                }
+            });
+            paper.view.draw();
+        },
+        showNodes: function(ghost){
+            var _this = this;
+            this.hiddenNodes.forEach(function(_id){
+                _this.renderer.getRepresentationByModel(_this.renkan.project.get("nodes").get(_id)).show(ghost);
+            });
+            if (!ghost){
+                this.hiddenNodes = [];
+            }
+            paper.view.draw();
+        },
+        setScale: function(_newScale, _offset) {
+            if ((_newScale/this.initialScale) > Utils._MIN_SCALE && (_newScale/this.initialScale) < Utils._MAX_SCALE) {
+                this.scale = _newScale;
+                if (_offset) {
+                    this.offset = _offset;
+                }
+                this.renderer.redraw();
+                this.updateUrl();
+            }
+        },
+        zoomOut: function() {
+            var _newScale = this.scale * Math.SQRT1_2,
+            _offset = new paper.Point([
+                                       this.renderer.canvas_$.width(),
+                                       this.renderer.canvas_$.height()
+                                       ]).multiply( 0.5 * ( 1 - Math.SQRT1_2 ) ).add(this.offset.multiply( Math.SQRT1_2 ));
+            this.setScale( _newScale, _offset );
+        },
+        zoomIn: function() {
+            var _newScale = this.scale * Math.SQRT2,
+            _offset = new paper.Point([
+                                       this.renderer.canvas_$.width(),
+                                       this.renderer.canvas_$.height()
+                                       ]).multiply( 0.5 * ( 1 - Math.SQRT2 ) ).add(this.offset.multiply( Math.SQRT2 ));
+            this.setScale( _newScale, _offset );
+        },
+        resizeZoom: function(_scaleWidth, _scaleHeight, _ratio) {
+            var _newScale = this.scale * _ratio,
+                _offset = new paper.Point([
+                                       (this.offset.x * _scaleWidth),
+                                       (this.offset.y * _scaleHeight)
+                                       ]);
+            this.setScale( _newScale, _offset );
+        },
+        autoScale: function(force_view) {
+            var nodes = this.renkan.project.get("nodes");
+            if (nodes.length > 1) {
+                var _xx = nodes.map(function(_node) { return _node.get("position").x; }),
+                _yy = nodes.map(function(_node) { return _node.get("position").y; }),
+                _minx = Math.min.apply(Math, _xx),
+                _miny = Math.min.apply(Math, _yy),
+                _maxx = Math.max.apply(Math, _xx),
+                _maxy = Math.max.apply(Math, _yy);
+                var _scale = Math.min( (paper.view.size.width - 2 * this.renkan.options.autoscale_padding) / (_maxx - _minx), (paper.view.size.height - 2 * this.renkan.options.autoscale_padding) / (_maxy - _miny));
+                this.initialScale = _scale;
+                // Override calculated scale if asked
+                if((typeof force_view !== "undefined") && parseFloat(force_view.zoom_level)>0 && parseFloat(force_view.offset.x)>0 && parseFloat(force_view.offset.y)>0){
+                    this.setScale(parseFloat(force_view.zoom_level), new paper.Point(parseFloat(force_view.offset.x), parseFloat(force_view.offset.y)));
+                }
+                else{
+                    this.setScale(_scale, paper.view.center.subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale)));
+                }
+            }
+            if (nodes.length === 1) {
+                this.setScale(1, paper.view.center.subtract(new paper.Point([nodes.at(0).get("position").x, nodes.at(0).get("position").y])));
+            }
+        },
+        paperShift: function(_delta) {
+            this.offset = this.offset.add(_delta);
+            this.renderer.redraw();
+        },
+        updateUrl: function(){
+            if(this.options.update_url){
+                var result = {};
+                var parameters = Backbone.history.getFragment().split('?');
+                if (parameters.length > 1){
+                    parameters[1].split("&").forEach(function(part) {
+                        var item = part.split("=");
+                        result[item[0]] = decodeURIComponent(item[1]);
+                    });
+                }
+                result.view = Math.round(this.offset.x*1000)/1000 + ',' + Math.round(this.offset.y*1000)/1000 + ',' + Math.round(this.scale*1000)/1000;
+
+                if (this.renkan.project.get("views").indexOf(this.model) > -1){
+                    result.idView = this.renkan.project.get("views").indexOf(this.model);
+                } else {
+                    if (result.idView){
+                        delete result.idView;
+                    }
+                }
+                this.renkan.router.navigate("?" + decodeURIComponent($.param(result)), {trigger: false, replace: true});
+            }
+        },
+    }).value();
+
+    return ViewRepr;
+
+});
+
 
 //Load modules and use them
 if( typeof require.config === "function" ) {
@@ -6491,10 +6663,11 @@
          'renderer/edgeremovebutton',
          'renderer/edgerevertbutton',
          'renderer/miniframe',
-         'renderer/scene'
-         ], function(BaseRepresentation, BaseButton, NodeRepr, Edge, TempEdge, BaseEditor, NodeEditor, EdgeEditor, NodeButton, NodeEditButton, NodeRemoveButton, NodeHideButton, NodeShowButton, NodeRevertButton, NodeLinkButton, NodeEnlargeButton, NodeShrinkButton, EdgeEditButton, EdgeRemoveButton, EdgeRevertButton, MiniFrame, Scene){
-
-    'use strict';
+         'renderer/scene',
+         'renderer/viewrepr'
+         ], function(BaseRepresentation, BaseButton, NodeRepr, Edge, TempEdge, BaseEditor, NodeEditor, EdgeEditor, NodeButton, NodeEditButton, NodeRemoveButton, NodeHideButton, NodeShowButton, NodeRevertButton, NodeLinkButton, NodeEnlargeButton, NodeShrinkButton, EdgeEditButton, EdgeRemoveButton, EdgeRevertButton, MiniFrame, Scene, ViewRepr){
+
+    
 
     var Rkns = window.Rkns;
 
@@ -6507,6 +6680,7 @@
     Renderer._BaseButton = BaseButton;
     Renderer.Node = NodeRepr;
     Renderer.Edge = Edge;
+    Renderer.View = ViewRepr;
     Renderer.TempEdge = TempEdge;
     Renderer._BaseEditor = BaseEditor;
     Renderer.NodeEditor = NodeEditor;
--- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.min.js	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.min.js	Tue Sep 15 17:08:53 2015 +0200
@@ -24,12 +24,12 @@
  *  knowledge of the CeCILL-C license and that you accept its terms.
  */
 
-/*! renkan - v0.12.1 - Copyright © IRI 2015 */
+/*! renkan - v - Copyright © IRI 2015 */
 
 
-this.renkanJST=this.renkanJST||{},this.renkanJST["templates/colorpicker.html"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='<li data-color="'+(null==(__t=c)?"":__t)+'" style="background: '+(null==(__t=c)?"":__t)+'"></li>';return __p},this.renkanJST["templates/edgeeditor.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<h2>\n    <span class="Rk-CloseX">&times;</span>'+__e(renkan.translate("Edit Edge"))+"</span>\n</h2>\n<p>\n    <label>"+__e(renkan.translate("Title:"))+'</label>\n    <input class="Rk-Edit-Title" type="text" value="'+__e(edge.title)+'" />\n</p>\n',options.show_edge_editor_uri&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("URI:"))+'</label>\n        <input class="Rk-Edit-URI" type="text" value="'+__e(edge.uri)+'" />\n        <a class="Rk-Edit-Goto" href="'+__e(edge.uri)+'" target="_blank"></a>\n    </p>\n    ',options.properties.length&&(__p+="\n        <p>\n            <label>"+__e(renkan.translate("Choose from vocabulary:"))+'</label>\n            <select class="Rk-Edit-Vocabulary">\n                ',_.each(options.properties,function(a){__p+='\n                    <option class="Rk-Edit-Vocabulary-Class" value="">\n                        '+__e(renkan.translate(a.label))+"\n                    </option>\n                    ",_.each(a.properties,function(b){var c=a["base-uri"]+b.uri;__p+='\n                        <option class="Rk-Edit-Vocabulary-Property" value="'+__e(c)+'"\n                            ',c===edge.uri&&(__p+=" selected"),__p+=">\n                            "+__e(renkan.translate(b.label))+"\n                        </option>\n                    "}),__p+="\n                "}),__p+="\n            </select>\n        </p>\n")),__p+="\n",options.show_edge_editor_style&&(__p+='\n    <div class="Rk-Editor-p">\n      ',options.show_edge_editor_style_color&&(__p+='\n      <div id="Rk-Editor-p-color">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Edge color:"))+'</span>\n        <div class="Rk-Edit-ColorPicker-Wrapper">\n            <span class="Rk-Edit-Color" style="background: &lt;%-edge.color%>;">\n                <span class="Rk-Edit-ColorTip"></span>\n            </span>\n            '+(null==(__t=renkan.colorPicker)?"":__t)+'\n            <span class="Rk-Edit-ColorPicker-Text">'+__e(renkan.translate("Choose color"))+"</span>\n        </div>\n      </div>\n      "),__p+="\n      ",options.show_edge_editor_style_dash&&(__p+='\n      <div id="Rk-Editor-p-dash">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Dash:"))+'</span>\n        <input type="checkbox" name="Rk-Edit-Dash" class="Rk-Edit-Dash" '+__e(edge.dash)+" />\n      </div>\n      "),__p+="\n      ",options.show_edge_editor_style_thickness&&(__p+='\n      <div id="Rk-Editor-p-thickness">\n          <span class="Rk-Editor-Label">'+__e(renkan.translate("Thickness:"))+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Down">-</a>\n          <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Thickness-Value">'+__e(edge.thickness)+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Up">+</a>\n      </div>\n      '),__p+="\n      ",options.show_edge_editor_style_arrow&&(__p+='\n      <div id="Rk-Editor-p-arrow">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Arrow:"))+'</span>\n        <input type="checkbox" name="Rk-Edit-Arrow" class="Rk-Edit-Arrow" '+__e(edge.arrow)+" />\n      </div>\n      "),__p+="\n    </div>\n"),__p+="\n",options.show_edge_editor_direction&&(__p+='\n    <p>\n        <span class="Rk-Edit-Direction">'+__e(renkan.translate("Change edge direction"))+"</span>\n    </p>\n"),__p+="\n",options.show_edge_editor_nodes&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("From:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.from_color)+';"></span>\n        '+__e(shortenText(edge.from_title,25))+'\n    </p>\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("To:"))+'</span>\n        <span class="Rk-UserColor" style="background: >%-edge.to_color%>;"></span>\n        '+__e(shortenText(edge.to_title,25))+"\n    </p>\n"),__p+="\n",options.show_edge_editor_creator&&edge.has_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: &lt;%-edge.created_by_color%>;"></span>\n        '+__e(shortenText(edge.created_by_title,25))+"\n    </p>\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+='<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ',options.show_edge_tooltip_color&&(__p+='\n        <span class="Rk-UserColor" style="background: '+__e(edge.color)+';"></span>\n    '),__p+='\n    <span class="Rk-Display-Title">\n        ',edge.uri&&(__p+='\n            <a href="'+__e(edge.uri)+'" target="_blank">\n        '),__p+="\n        "+__e(edge.title)+"\n        ",edge.uri&&(__p+=" </a> "),__p+="\n    </span>\n</h2>\n",options.show_edge_tooltip_uri&&edge.uri&&(__p+='\n    <p class="Rk-Display-URI">\n        <a href="'+__e(edge.uri)+'" target="_blank">'+__e(edge.short_uri)+"</a>\n    </p>\n"),__p+="\n<p>"+(null==(__t=edge.description)?"":__t)+"</p>\n",options.show_edge_tooltip_nodes&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("From:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.from_color)+';"></span>\n        '+__e(shortenText(edge.from_title,25))+'\n    </p>\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("To:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.to_color)+';"></span>\n        '+__e(shortenText(edge.to_title,25))+"\n    </p>\n"),__p+="\n",options.show_edge_tooltip_creator&&edge.has_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.created_by_color)+';"></span>\n        '+__e(shortenText(edge.created_by_title,25))+"\n    </p>\n"),__p+="\n";return __p},this.renkanJST["templates/ldtjson-bin/annotationtemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Bin-Item" draggable="true"\n    data-image="'+__e(Rkns.Utils.getFullURL(image))+'"\n    data-uri="'+(null==(__t=ldt_platform)?"":__t)+"ldtplatform/ldt/front/player/"+(null==(__t=mediaid)?"":__t)+"/#id="+(null==(__t=annotationid)?"":__t)+'"\n    data-title="'+__e(title)+'" data-description="'+__e(description)+'">\n\n    <img class="Rk-Ldt-Annotation-Icon" src="'+(null==(__t=image)?"":__t)+'" />\n    <h4>'+(null==(__t=htitle)?"":__t)+"</h4>\n    <p>"+(null==(__t=hdescription)?"":__t)+"</p>\n    <p>Start: "+(null==(__t=start)?"":__t)+", End: "+(null==(__t=end)?"":__t)+", Duration: "+(null==(__t=duration)?"":__t)+'</p>\n    <div class="Rk-Clear"></div>\n</li>\n';return __p},this.renkanJST["templates/ldtjson-bin/segmenttemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Bin-Item" draggable="true"\n    data-image="'+__e(Rkns.Utils.getFullURL(image))+'"\n    data-uri="'+(null==(__t=ldt_platform)?"":__t)+"ldtplatform/ldt/front/player/"+(null==(__t=mediaid)?"":__t)+"/#id="+(null==(__t=annotationid)?"":__t)+'"\n    data-title="'+__e(title)+'" data-description="'+__e(description)+'">\n\n    <img class="Rk-Ldt-Annotation-Icon" src="'+(null==(__t=image)?"":__t)+'" />\n    <h4>'+(null==(__t=htitle)?"":__t)+"</h4>\n    <p>"+(null==(__t=hdescription)?"":__t)+"</p>\n    <p>Start: "+(null==(__t=start)?"":__t)+", End: "+(null==(__t=end)?"":__t)+", Duration: "+(null==(__t=duration)?"":__t)+'</p>\n    <div class="Rk-Clear"></div>\n</li>\n';return __p},this.renkanJST["templates/ldtjson-bin/tagtemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Bin-Item" draggable="true"\n    data-image="'+__e(Rkns.Utils.getFullURL(static_url+"img/ldt-tag.png"))+'"\n    data-uri="'+(null==(__t=ldt_platform)?"":__t)+"ldtplatform/ldt/front/search/?search="+(null==(__t=encodedtitle)?"":__t)+'&field=all"\n    data-title="'+__e(title)+'" data-description="Tag \''+__e(title)+'\'">\n\n    <img class="Rk-Ldt-Tag-Icon" src="'+__e(static_url)+'img/ldt-tag.png" />\n    <h4>'+(null==(__t=htitle)?"":__t)+'</h4>\n    <div class="Rk-Clear"></div>\n</li>\n';return __p},this.renkanJST["templates/list-bin.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<li class="Rk-Bin-Item Rk-ResourceList-Item" draggable="true"\n    data-uri="'+__e(url)+'" data-title="'+__e(title)+'"\n    data-description="'+__e(description)+'"\n    ',__p+=image?'\n        data-image="'+__e(Rkns.Utils.getFullURL(image))+'"\n    ':'\n        data-image=""\n    ',__p+="\n>",image&&(__p+='\n    <img class="Rk-ResourceList-Image" src="'+__e(image)+'" />\n'),__p+='\n<h4 class="Rk-ResourceList-Title">\n    ',url&&(__p+='\n        <a href="'+__e(url)+'" target="_blank">\n    '),__p+="\n    "+(null==(__t=htitle)?"":__t)+"\n    ",url&&(__p+="</a>"),__p+="\n    </h4>\n    ",description&&(__p+='\n        <p class="Rk-ResourceList-Description">'+(null==(__t=hdescription)?"":__t)+"</p>\n    "),__p+="\n    ",image&&(__p+='\n        <div style="clear: both;"></div>\n    '),__p+="\n</li>\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    <div class="Rk-Bins">\n        <div class="Rk-Bins-Head">\n            <h2 class="Rk-Bins-Title">'+__e(translate("Select contents:"))+'</h2>\n            <form class="Rk-Web-Search-Form Rk-Search-Form">\n                <input class="Rk-Web-Search-Input Rk-Search-Input" type="search"\n                    placeholder="'+__e(translate("Search the Web"))+'" />\n                <div class="Rk-Search-Select">\n                    <div class="Rk-Search-Current"></div>\n                    <ul class="Rk-Search-List"></ul>\n                </div>\n                <input type="submit" value=""\n                    class="Rk-Web-Search-Submit Rk-Search-Submit" title="'+__e(translate("Search the Web"))+'" />\n            </form>\n            <form class="Rk-Bins-Search-Form Rk-Search-Form">\n                <input class="Rk-Bins-Search-Input Rk-Search-Input" type="search"\n                    placeholder="'+__e(translate("Search in Bins"))+'" /> <input\n                    type="submit" value=""\n                    class="Rk-Bins-Search-Submit Rk-Search-Submit"\n                    title="'+__e(translate("Search in Bins"))+'" />\n            </form>\n        </div>\n        <ul class="Rk-Bin-List"></ul>\n    </div>\n'),__p+=" ",options.show_editor&&(__p+='\n    <div class="Rk-Render Rk-Render-',__p+=options.show_bins?"Panel":"Full",__p+='"></div>\n'),__p+="\n";return __p},this.renkanJST["templates/nodeeditor.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='\n<h2>\n    <span class="Rk-CloseX">&times;</span>'+__e(renkan.translate("Edit Node"))+"</span>\n</h2>\n<p>\n    <label>"+__e(renkan.translate("Title:"))+'</label>\n    <input class="Rk-Edit-Title" type="text" value="'+__e(node.title)+'" />\n</p>\n',options.show_node_editor_uri&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("URI:"))+'</label>\n        <input class="Rk-Edit-URI" type="text" value="'+__e(node.uri)+'" />\n        <a class="Rk-Edit-Goto" href="'+__e(node.uri)+'" target="_blank"></a>\n    </p>\n'),__p+=" ",options.change_types&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Types available"))+':</label>\n        <select class="Rk-Edit-Type">\n          ',_.each(types,function(a){__p+='\n            <option class="Rk-Edit-Vocabulary-Property" value="'+__e(a)+'"',node.type===a&&(__p+=" selected"),__p+=">\n                "+__e(renkan.translate(a.charAt(0).toUpperCase()+a.substring(1)))+"\n            </option>\n          "}),__p+="\n        </select>\n    </p>\n"),__p+=" ",options.show_node_editor_description&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Description:"))+"</label>\n        ",__p+=options.show_node_editor_description_richtext?'\n            <div class="Rk-Edit-Description" contenteditable="true">'+(null==(__t=node.description)?"":__t)+"</div>\n        ":'\n            <textarea class="Rk-Edit-Description">'+(null==(__t=node.description)?"":__t)+"</textarea>\n        ",__p+="\n    </p>\n"),__p+=" ",options.show_node_editor_size&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Size:"))+'</span>\n        <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Size-Down">-</a>\n        <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Size-Value">'+__e(node.size)+'</span>\n        <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Size-Up">+</a>\n    </p>\n'),__p+=" ",options.show_node_editor_style&&(__p+='\n    <div class="Rk-Editor-p">\n      ',options.show_node_editor_style_color&&(__p+='\n      <div id="Rk-Editor-p-color">\n        <span class="Rk-Editor-Label">\n        '+__e(renkan.translate("Node color:"))+'</span>\n        <div class="Rk-Edit-ColorPicker-Wrapper">\n            <span class="Rk-Edit-Color" style="background: '+__e(node.color)+';">\n                <span class="Rk-Edit-ColorTip"></span>\n            </span>\n            '+(null==(__t=renkan.colorPicker)?"":__t)+'\n            <span class="Rk-Edit-ColorPicker-Text">'+__e(renkan.translate("Choose color"))+"</span>\n        </div>\n      </div>\n      "),__p+="\n      ",options.show_node_editor_style_dash&&(__p+='\n      <div id="Rk-Editor-p-dash">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Dash:"))+'</span>\n        <input type="checkbox" name="Rk-Edit-Dash" class="Rk-Edit-Dash" '+__e(node.dash)+" />\n      </div>\n      "),__p+="\n      ",options.show_node_editor_style_thickness&&(__p+='\n      <div id="Rk-Editor-p-thickness">\n          <span class="Rk-Editor-Label">'+__e(renkan.translate("Thickness:"))+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Down">-</a>\n          <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Thickness-Value">'+__e(node.thickness)+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Up">+</a>\n      </div>\n      '),__p+="\n    </div>\n"),__p+=" ",options.show_node_editor_image&&(__p+='\n    <div class="Rk-Edit-ImgWrap">\n        <div class="Rk-Edit-ImgPreview">\n            <img src="'+__e(node.image||node.image_placeholder)+'" />\n            ',node.clip_path&&(__p+='\n                <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 1 1" preserveAspectRatio="none">\n                    <path style="stroke-width: .02; stroke:red; fill-opacity:.3; fill:red;" d="'+__e(node.clip_path)+'" />\n                </svg>\n            '),__p+="\n        </div>\n    </div>\n    <p>\n        <label>"+__e(renkan.translate("Image URL:"))+'</label>\n        <div>\n            <a class="Rk-Edit-Image-Del" href="#"></a>\n            <input class="Rk-Edit-Image" type="text" value=\''+__e(node.image)+"' />\n        </div>\n    </p>\n",options.allow_image_upload&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Choose Image File:"))+'</label>\n        <input class="Rk-Edit-Image-File" type="file" accept="image/*" />\n    </p>\n')),__p+=" ",options.show_node_editor_creator&&node.has_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(node.created_by_color)+';"></span>\n        '+__e(shortenText(node.created_by_title,25))+"\n    </p>\n"),__p+=" ",options.change_shapes&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Shapes available"))+':</label>\n        <select class="Rk-Edit-Shape">\n          ',_.each(shapes,function(a){__p+='\n            <option class="Rk-Edit-Vocabulary-Property" value="'+__e(a)+'"',node.shape===a&&(__p+=" selected"),__p+=">\n                "+__e(renkan.translate(a.charAt(0).toUpperCase()+a.substring(1)))+"\n            </option>\n          "}),__p+="\n        </select>\n    </p>\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+='<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ',options.show_node_tooltip_color&&(__p+='\n        <span class="Rk-UserColor" style="background: '+__e(node.color)+';"></span>\n    '),__p+='\n    <span class="Rk-Display-Title">\n        ',node.uri&&(__p+='\n            <a href="'+__e(node.uri)+'" target="_blank">\n        '),__p+="\n        "+__e(node.title)+"\n        ",node.uri&&(__p+="</a>"),__p+="\n    </span>\n</h2>\n",node.uri&&options.show_node_tooltip_uri&&(__p+='\n    <p class="Rk-Display-URI">\n        <a href="'+__e(node.uri)+'" target="_blank">'+__e(node.short_uri)+"</a>\n    </p>\n"),__p+=" ",options.show_node_tooltip_description&&(__p+='\n    <p class="Rk-Display-Description">'+(null==(__t=node.description)?"":__t)+"</p>\n"),__p+=" ",node.image&&options.show_node_tooltip_image&&(__p+='\n    <img class="Rk-Display-ImgPreview" src="'+__e(node.image)+'" />\n'),__p+=" ",node.has_creator&&options.show_node_tooltip_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(node.created_by_color)+';"></span>\n        '+__e(shortenText(node.created_by_title,25))+"\n    </p>\n"),__p+='\n    <a href="#?idnode='+__e(node._id)+'">'+__e(renkan.translate("Link to the node"))+"</a>\n";return __p},this.renkanJST["templates/nodeeditor_video.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ',options.show_node_tooltip_color&&(__p+='\n        <span class="Rk-UserColor" style="background: '+__e(node.color)+';"></span>\n    '),__p+='\n    <span class="Rk-Display-Title">\n        ',node.uri&&(__p+='\n            <a href="'+__e(node.uri)+'" target="_blank">\n        '),__p+="\n        "+__e(node.title)+"\n        ",node.uri&&(__p+="</a>"),__p+="\n    </span>\n</h2>\n",node.uri&&options.show_node_tooltip_uri&&(__p+='\n     <video width="320" height="240" controls>\n        <source src="'+__e(node.uri)+'" type="video/mp4">\n     </video> \n'),__p+='\n    <a href="#?idnode='+__e(node._id)+'">'+__e(renkan.translate("Link to the node"))+"</a>\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    <div class="Rk-TopBar">\n        <div class="loader"></div>\n        ',__p+=options.editor_mode?'\n            <input type="text" class="Rk-PadTitle" value="'+__e(project.get("title")||"")+'" placeholder="'+__e(translate("Untitled project"))+'" />\n        ':'\n            <h2 class="Rk-PadTitle">\n                '+__e(project.get("title")||translate("Untitled project"))+"\n            </h2>\n        ",__p+="\n        ",options.show_user_list&&(__p+='\n            <div class="Rk-Users">\n                <div class="Rk-CurrentUser">\n                    ',options.show_user_color&&(__p+='\n                        <div class="Rk-Edit-ColorPicker-Wrapper">\n                            <span class="Rk-CurrentUser-Color">\n                            ',options.user_color_editable&&(__p+='\n                                <span class="Rk-Edit-ColorTip"></span>\n                            '),__p+="\n                            </span>\n                            ",options.user_color_editable&&print(colorPicker),__p+="\n                        </div>\n                    "),__p+='\n                    <span class="Rk-CurrentUser-Name">&lt;unknown user&gt;</span>\n                </div>\n                <ul class="Rk-UserList"></ul>\n            </div>\n        '),__p+="\n        ",options.home_button_url&&(__p+='\n            <div class="Rk-TopBar-Separator"></div>\n            <a class="Rk-TopBar-Button Rk-Home-Button" href="'+__e(options.home_button_url)+'">\n                <div class="Rk-TopBar-Tooltip">\n                    <div class="Rk-TopBar-Tooltip-Contents">\n                        '+__e(translate(options.home_button_title))+"\n                    </div>\n                </div>\n            </a>\n        "),__p+="\n        ",options.show_fullscreen_button&&(__p+='\n            <div class="Rk-TopBar-Separator"></div>\n            <div class="Rk-TopBar-Button Rk-FullScreen-Button">\n                <div class="Rk-TopBar-Tooltip">\n                    <div class="Rk-TopBar-Tooltip-Contents">\n                        '+__e(translate("Full Screen"))+"\n                    </div>\n                </div>\n            </div>\n        "),__p+="\n        ",options.editor_mode?(__p+="\n            ",options.show_addnode_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-AddNode-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Add Node"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_addedge_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-AddEdge-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Add Edge"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_export_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Export-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Download Project"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_save_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Save-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents"></div>\n                    </div>\n                </div>\n            '),__p+="\n            ",options.show_open_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Open-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Open Project"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_bookmarklet&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <a class="Rk-TopBar-Button Rk-Bookmarklet-Button" href="#">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Renkan 'Drag-to-Add' bookmarklet"))+'\n                        </div>\n                    </div>\n                </a>\n                <div class="Rk-TopBar-Separator"></div>\n            '),__p+="\n        "):(__p+="\n            ",options.show_export_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Export-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Download Project"))+'\n                        </div>\n                    </div>\n                </div>\n                <div class="Rk-TopBar-Separator"></div>\n            '),__p+="\n        "),__p+="\n        ",options.show_search_field&&(__p+='\n            <form action="#" class="Rk-GraphSearch-Form">\n                <input type="search" class="Rk-GraphSearch-Field" placeholder="'+__e(translate("Search in graph"))+'" />\n            </form>\n            <div class="Rk-TopBar-Separator"></div>\n        '),__p+="\n    </div>\n"),__p+='\n<div class="Rk-Editing-Space',options.show_top_bar||(__p+=" Rk-Editing-Space-Full"),__p+='">\n    <div class="Rk-Labels"></div>\n    <canvas class="Rk-Canvas" ',options.resize&&(__p+=' resize="" '),__p+=' ></canvas>\n    <div class="Rk-Notifications"></div>\n    <div class="Rk-Editor">\n        ',options.show_bins&&(__p+='\n            <div class="Rk-Fold-Bins">&laquo;</div>\n        '),__p+="\n        ",options.show_zoom&&(__p+='\n            <div class="Rk-ZoomButtons">\n                <div class="Rk-ZoomIn" title="'+__e(translate("Zoom In"))+'"></div>\n                <div class="Rk-ZoomFit" title="'+__e(translate("Zoom Fit"))+'"></div>\n                <div class="Rk-ZoomOut" title="'+__e(translate("Zoom Out"))+'"></div>\n                ',options.editor_mode&&options.save_view&&(__p+='\n                    <div class="Rk-ZoomSave" title="'+__e(translate("Save view"))+'"></div>\n                '),__p+="\n                ",options.save_view&&(__p+='\n                    <div class="Rk-ZoomSetSaved" title="'+__e(translate("View saved view"))+'"></div>\n                    ',options.hide_nodes&&(__p+='\n                	   <div class="Rk-ShowHiddenNodes" title="'+__e(translate("Show hidden nodes"))+'"></div>\n                    '),__p+="       \n                "),__p+="\n            </div>\n        "),__p+="\n    </div>\n</div>\n";return __p},this.renkanJST["templates/search.html"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='<li class="'+(null==(__t=className)?"":__t)+'" data-key="'+(null==(__t=key)?"":__t)+'">'+(null==(__t=title)?"":__t)+"</li>";return __p},this.renkanJST["templates/wikipedia-bin/resulttemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Wikipedia-Result Rk-Bin-Item" draggable="true"\n    data-uri="'+__e(url)+'" data-title="Wikipedia: '+__e(title)+'"\n    data-description="'+__e(description)+'"\n    data-image="'+__e(Rkns.Utils.getFullURL(static_url+"img/wikipedia.png"))+'">\n\n    <img class="Rk-Wikipedia-Icon" src="'+__e(static_url)+'img/wikipedia.png">\n    <h4 class="Rk-Wikipedia-Title">\n        <a href="'+__e(url)+'" target="_blank">'+(null==(__t=htitle)?"":__t)+'</a>\n    </h4>\n    <p class="Rk-Wikipedia-Snippet">'+(null==(__t=hdescription)?"":__t)+"</p>\n</li>\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.$("<li>").addClass("Rk-Bin").appendTo(a.$.find(".Rk-Bin-List")),this.title_icon_$=b.$("<span>").addClass("Rk-Bin-Title-Icon").appendTo(this.$);var d=this;b.$("<a>").attr({href:"#",title:a.translate("Close bin")}).addClass("Rk-Bin-Close").html("&times;").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.$("<a>").attr({href:"#",title:a.translate("Refresh bin")}).addClass("Rk-Bin-Refresh").appendTo(this.$).click(function(){return d.refresh(),!1}),this.count_$=b.$("<div>").addClass("Rk-Bin-Count").appendTo(this.$),this.title_$=b.$("<h2>").addClass("Rk-Bin-Title").appendTo(this.$),this.main_$=b.$("<div>").addClass("Rk-Bin-Main").appendTo(this.$).html('<h4 class="Rk-Bin-Loading">'+a.translate("Loading, please wait")+"</h4>"),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'<ul class="Rk-Edit-ColorPicker">'+b.pickerColors.map(function(b){return a({c:b})}).join("")+"</ul>"}(),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.left+d&&b.pageY>=c.top&&b.pageY<c.top+f)if(k)e.renderer.onMouseMove(b,!0);else{k=!0;var g=document.createElement("div");g.appendChild(this.cloneNode(!0)),e.renderer.dropData({"text/html":g.innerHTML},b),e.renderer.onMouseDown(b,!0)}}).on("touchend",".Rk-Bin-Item",function(a){k&&e.renderer.onMouseUp(a.originalEvent.changedTouches[0],!0),k=!1}).on("dragstart",".Rk-Bin-Item",function(a){var b=document.createElement("div");b.appendChild(this.cloneNode(!0));try{a.originalEvent.dataTransfer.setData("text/html",b.innerHTML)}catch(c){a.originalEvent.dataTransfer.setData("text",b.innerHTML)}}),b.$(window).resize(function(){e.resizeBins()});var l=!1,m="";this.$.find(".Rk-Bins-Search-Input").on("change keyup paste input",function(){var a=b.$(this).val();if(a!==m){var c=b.Utils.regexpFromTextOrArray(a.length>1?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;d<b.length;d++)c+="."+b[d];this.$.find(".Rk-Web-Search-Input.Rk-Search-Input").attr("placeholder",this.translate("Search in ")+this.$.find(".Rk-Search-List "+c).html())},f.prototype.resizeBins=function(){var a=+this.$.find(".Rk-Bins-Head").outerHeight();this.$.find(".Rk-Bin-Title:visible").each(function(){a+=b.$(this).outerHeight()}),this.$.find(".Rk-Bin-Main").css({height:this.$.find(".Rk-Bins").height()-a})};var g=function(){return"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)})};b.Utils={getUUID4:g,getUID:function(){function a(a){return 10>a?"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<e.length;j++){j&&(i+=f+"*");var k=e[j];d.each(c,b(k)),i+=k}return i}function b(c){switch(typeof c){case"string":return a(c);case"object":var e="";return d.each(c,function(a){var c=b(a);c&&(e&&(e+="|"),e+=c)}),e}return""}var c=["[aáàâä]","[cç]","[eéèêë]","[iíìîï]","[oóòôö]","[uùûü]"],e=[String.fromCharCode(768),String.fromCharCode(769),String.fromCharCode(770),String.fromCharCode(771),String.fromCharCode(807),"{","}","(",")","[","]","【","】","、","・","‥","。","「","」","『","』","〜",":","!","?"," ",","," ",";","(",")",".","*","+","\\","?","|","{","}","[","]","^","#","/"],f="[\\"+e.join("\\")+"]",g=new RegExp(f,"gm"),h=d.map(c,function(a){return new RegExp(a)});return function(a){var c=b(a);if(c){var d=new RegExp(c,"im"),e=new RegExp("("+c+")","igm");return{isempty:!1,source:c,test:function(a){return d.test(a)},replace:function(a,b){return a.replace(e,b)}}}return{isempty:!0,source:"",test:function(){return!0},replace:function(a){return text}}}}(),_MIN_DRAG_DISTANCE:2,_NODE_BUTTON_WIDTH:40,_EDGE_BUTTON_INNER:2,_EDGE_BUTTON_OUTER:40,_CLICKMODE_ADDNODE:1,_CLICKMODE_STARTEDGE:2,_CLICKMODE_ENDEDGE:3,_NODE_SIZE_STEP:Math.LN2/4,_MIN_SCALE:.05,_MAX_SCALE:20,_MOUSEMOVE_RATE:80,_DOUBLETAP_DELAY:800,_DOUBLETAP_DISTANCE:400,_USER_PLACEHOLDER:function(a){return{color:a.options.default_user_color,title:a.translate("(unknown user)"),get:function(a){return this[a]||!1}}},_BOOKMARKLET_CODE:function(a){return"(function(a,b,c,d,e,f,h,i,j,k,l,m,n,o,p,q,r){a=document;b=a.body;c=a.location.href;j='draggable';m='text/x-iri-';d=a.createElement('div');d.innerHTML='<p_style=\"position:fixed;top:0;right:0;font:bold_18px_sans-serif;color:#fff;background:#909;padding:10px;z-index:100000;\">"+a.translate("Drag items from this website, drop them in Renkan").replace(/ /g,"_")+"</p>'.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.x<paper.view.center.x?1:-1,h=b.x+g*(d+a.tooltip_arrow_length),i=b.x+g*(d+a.tooltip_arrow_length+a.tooltip_width),j=b.y-f/2;j+f>paper.view.size.height-a.tooltip_margin&&(j=Math.max(paper.view.size.height-a.tooltip_margin,b.y+a.tooltip_arrow_width/2)-f),j<a.tooltip_margin&&(j=Math.min(a.tooltip_margin,b.y-a.tooltip_arrow_width/2));var k=j+f;return c.segments[0].point=c.segments[7].point=b.add([g*d,0]),c.segments[1].point.x=c.segments[2].point.x=c.segments[5].point.x=c.segments[6].point.x=h,c.segments[3].point.x=c.segments[4].point.x=i,c.segments[2].point.y=c.segments[3].point.y=j,c.segments[4].point.y=c.segments[5].point.y=k,c.segments[1].point.y=b.y-a.tooltip_arrow_width/2,c.segments[6].point.y=b.y+a.tooltip_arrow_width/2,c.closed=!0,c.fillColor=new paper.GradientColor(new paper.Gradient([a.tooltip_top_color,a.tooltip_bottom_color]),[0,j],[0,k]),e.css({left:a.tooltip_padding+Math.min(h,i),top:a.tooltip_padding+j}),c},increaseBrightness:function(a,b){a=a.replace(/^\s*#|\s*$/g,""),3===a.length&&(a=a.replace(/(.)/g,"$1$1"));var c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=parseInt(a.substr(4,2),16);return"#"+(0|256+c+(256-c)*b/100).toString(16).substr(1)+(0|256+d+(256-d)*b/100).toString(16).substr(1)+(0|256+e+(256-e)*b/100).toString(16).substr(1)}}}(window),function(a){"use strict";var b=a.Backbone;a.Rkns.Router=b.Router.extend({routes:{"":"index"},index:function(a){var b={};null!==a&&(a.split("&").forEach(function(a){var c=a.split("=");b[c[0]]=decodeURIComponent(c[1])}),this.trigger("router",b))}})}(window),function(a){"use strict";var b=a.Rkns.DataLoader={converters:{from1to2:function(a){var b,c;if("undefined"!=typeof a.nodes)for(b=0,c=a.nodes.length;c>b;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:!0,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,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,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é)","<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,a.renderer.fixSize()})},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(){c.set({loadingStatus:!0})},success:function(b){a.dataloader.load(b),c.set({loadingStatus:!1}),c.set({saveStatus:0}),a.renderer.autoScale()}})},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,"<span class='searchmatch'>$1</span>")}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="<li><h3>Tags</h3></li>",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+="<li><h3>Annotations</h3></li>",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(),"<span class='searchmatch'>$1</span>")}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,"<span class='searchmatch'>$1</span>")}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(),"<span class='searchmatch'>$1</span>")}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.$("<div>").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.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('<div class="Rk-Label">').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<this.all_buttons.length;d++)this.all_buttons[d].source_representation=this;this.active_buttons=[]}else this.active_buttons=this.all_buttons=[];this.last_circle_radius=1,this.renderer.minimap&&(this.renderer.minimap.node_layer.activate(),this.minimap_circle=new paper.Path.Circle([0,0],1),this.minimap_circle.__representation=this.renderer.minimap.miniframe.__representation,this.renderer.minimap.node_group.addChild(this.minimap_circle))},_getStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.node_stroke_width+(a-1)*(this.options.node_stroke_max_width-this.options.node_stroke_width)/(this.options.node_stroke_witdh_scale-1)},_getSelectedStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.selected_node_stroke_width+(a-1)*(this.options.selected_node_stroke_max_width-this.options.selected_node_stroke_width)/(this.options.node_stroke_witdh_scale-1)},buildShape:function(){"shape"in this.model.changed&&delete this.img,this.circle&&(this.circle.remove(),delete this.circle),this.shapeBuilder=new e(this.model.get("shape")),this.circle=this.shapeBuilder.getShape(),this.circle.__representation=this,this.circle.sendToBack(),this.last_circle_radius=1},redraw:function(a){"shape"in this.model.changed&&"change"in a&&a.change&&this.buildShape();var c=new paper.Point(this.model.get("position")),d=this.options.node_size_base*Math.exp((this.model.get("size")||0)*f._NODE_SIZE_STEP);this.is_dragging&&this.paper_coords||(this.paper_coords=this.renderer.toPaperCoords(c)),this.circle_radius=d*this.renderer.scale,this.last_circle_radius!==this.circle_radius&&(this.all_buttons.forEach(function(a){a.setSectorSize()}),this.circle.scale(this.circle_radius/this.last_circle_radius),this.node_image&&this.node_image.scale(this.circle_radius/this.last_circle_radius)),this.circle.position=this.paper_coords,this.node_image&&(this.node_image.position=this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius))),this.last_circle_radius=this.circle_radius;var e=this.active_buttons,g=1;this.model.get("delete_scheduled")?(g=.5,this.active_buttons=this.pending_delete_buttons,this.circle.dashArray=[2,2]):(g=1,this.active_buttons=this.normal_buttons,this.circle.dashArray=null),this.selected&&this.renderer.isEditable()&&!this.ghost&&(e!==this.active_buttons&&e.forEach(function(a){a.hide()}),this.active_buttons.forEach(function(a){a.show()})),this.node_image&&(this.node_image.opacity=this.highlighted?.5*g:g-.01),this.circle.fillColor=this.highlighted?this.options.highlighted_node_fill_color:this.options.node_fill_color,this.circle.opacity=this.options.show_node_circles?g:.01;var h=this.model.get("title")||this.renkan.translate(this.options.label_untitled_nodes)||"";h=f.shortenText(h,this.options.node_label_max_length),"object"==typeof this.highlighted?this.title.html(this.highlighted.replace(b(h).escape(),'<span class="Rk-Highlighted">$1</span>')):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.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.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.hiddenNodes.indexOf(f.model.id);-1!==g&&c.renderer.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.hiddenNodes.indexOf(this.model.id);-1!==c&&this.renderer.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('<div class="Rk-Label Rk-Edge-Label">').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;d<this.all_buttons.length;d++)this.all_buttons[d].source_representation=this;this.active_buttons=[]}else this.active_buttons=this.all_buttons=[];this.renderer.minimap&&(this.renderer.minimap.edge_layer.activate(),this.minimap_line=new paper.Path,this.minimap_line.add([0,0],[0,0]),this.minimap_line.__representation=this.renderer.minimap.miniframe.__representation,this.minimap_line.strokeWidth=1)},_getStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.edge_stroke_width+(a-1)*(this.options.edge_stroke_max_width-this.options.edge_stroke_width)/(this.options.edge_stroke_witdh_scale-1)},_getSelectedStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.selected_edge_stroke_width+(a-1)*(this.options.selected_edge_stroke_max_width-this.options.selected_edge_stroke_width)/(this.options.edge_stroke_witdh_scale-1)},_getArrowScale:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return 1+(a-1)*(this.options.edge_arrow_max_width/this.options.edge_arrow_width-1)/(this.options.edge_stroke_witdh_scale-1)},redraw:function(){var a=this.model.get("from"),b=this.model.get("to");if(a&&b&&(!this.hidden||this.ghost)){if(this.from_representation=this.renderer.getRepresentationByModel(a),this.to_representation=this.renderer.getRepresentationByModel(b),"undefined"==typeof this.from_representation||"undefined"==typeof this.to_representation||this.from_representation.hidden&&!this.from_representation.ghost||this.to_representation.hidden&&!this.to_representation.ghost)return void this.hide();var c,d=this._getStrokeWidth(),f=this._getArrowScale(),g=this.from_representation.paper_coords,h=this.to_representation.paper_coords,i=h.subtract(g),j=i.length,k=i.divide(j),l=new paper.Point([-k.y,k.x]),m=this.bundle.getPosition(this),n=l.multiply(this.options.edge_gap_in_bundles*m),o=g.add(n),p=h.add(n),q=i.angle,r=l.multiply(this.options.edge_label_distance+.5*f*this.options.edge_arrow_width),s=i.divide(3),t=this.model.has("style")&&this.model.get("style").color||(this.model.get("created_by")||e._USER_PLACEHOLDER(this.renkan)).get("color"),u=this.model.has("style")&&this.model.get("style").dash?this.options.default_dash_array:null;this.model.get("delete_scheduled")||this.from_representation.model.get("delete_scheduled")||this.to_representation.model.get("delete_scheduled")?(c=.5,this.line.dashArray=[2,2]):(c=this.ghost?this.options.ghost_opacity:1,this.line.dashArray=null);var v=this.active_buttons;this.arrow.visible=this.model.has("style")&&this.model.get("style").arrow||!this.model.has("style")||"undefined"==typeof this.model.get("style").arrow,this.active_buttons=this.model.get("delete_scheduled")?this.pending_delete_buttons:this.normal_buttons,this.selected&&this.renderer.isEditable()&&v!==this.active_buttons&&(v.forEach(function(a){a.hide()}),this.active_buttons.forEach(function(a){a.show()})),this.paper_coords=o.add(p).divide(2),this.line.strokeWidth=d,this.line.strokeColor=t,this.line.dashArray=u,this.line.opacity=c,this.line.segments[0].point=g,this.line.segments[1].point=this.paper_coords,this.line.segments[1].handleIn=s.multiply(-1),this.line.segments[1].handleOut=s,this.line.segments[2].point=h,this.arrow.scale(f/this.arrow_scale),this.arrow_scale=f,this.arrow.fillColor=t,this.arrow.opacity=c,this.arrow.rotate(q-this.arrow_angle,this.arrow.bounds.center),this.arrow.position=this.paper_coords,this.arrow_angle=q,q>90&&(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=.8,this.editor_$=a("<div>").appendTo(this.renderer.editor_$).css({position:"absolute",opacity:.8}).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(),'<span class="Rk-Highlighted">$1</span>');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(),'<span class="Rk-Highlighted">$1</span>'))}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.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.scale=1,this.initialScale=1,this.offset=paper.view.center,this.totalScroll=0,this.hiddenNodes=[],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-_lastTap<f._DOUBLETAP_DELAY&&Math.pow(j-b.pageX,2)+Math.pow(k-b.pageY,2)<f._DOUBLETAP_DISTANCE?(_lastTap=0,d.onDoubleClick(b)):(_lastTap=new Date,j=b.pageX,k=b.pageY,h=d.scale,i=!1,d.onMouseDown(b,!0))},touchmove:function(a){if(a.preventDefault(),_lastTap=0,1===a.originalEvent.touches.length)d.onMouseMove(a.originalEvent.touches[0],!0);else{if(i||(d.onMouseUp(a.originalEvent.touches[0],!0),d.click_target=null,d.is_dragging=!1,i=!0),"undefined"===a.originalEvent.scale)return;var b=a.originalEvent.scale*h,c=b/d.scale,e=new paper.Point([d.canvas_$.width(),d.canvas_$.height()]).multiply(.5*(1-c)).add(d.offset.multiply(c));d.setScale(b,e)}},touchend:function(a){a.preventDefault(),d.onMouseUp(a.originalEvent.changedTouches[0],!0)},dblclick:function(a){a.preventDefault(),c.options.allow_double_click&&d.onDoubleClick(a)},mouseleave:function(a){a.preventDefault(),d.click_target=null,d.is_dragging=!1},dragover:function(a){a.preventDefault()},dragenter:function(a){a.preventDefault(),g=!1},dragleave:function(a){a.preventDefault(),g=!0},drop:function(a){a.preventDefault(),g=!0;var c={};b.each(a.originalEvent.dataTransfer.types,function(b){try{c[b]=a.originalEvent.dataTransfer.getData(b)}catch(d){}});var e=a.originalEvent.dataTransfer.getData("Text");if("string"==typeof e)switch(e[0]){case"{":case"[":try{var f=JSON.parse(e);b.extend(c,f)}catch(h){c["text/plain"]||(c["text/plain"]=e)}break;case"<":c["text/html"]||(c["text/html"]=e);break;default:c["text/plain"]||(c["text/plain"]=e)}var i=a.originalEvent.dataTransfer.getData("URL");i&&!c["text/uri-list"]&&(c["text/uri-list"]=i),d.dropData(c,a.originalEvent)}});var m=function(a,b){d.$.find(a).click(function(a){return d[b](a),!1})};m(".Rk-ZoomOut","zoomOut"),m(".Rk-ZoomIn","zoomIn"),m(".Rk-ZoomFit","autoScale"),this.$.find(".Rk-ZoomSave").click(function(){d.renkan.project.addView({zoom_level:d.scale,offset:d.offset,hidden_nodes:d.hiddenNodes})}),this.$.find(".Rk-ZoomSetSaved").click(function(){var a=d.renkan.project.get("views").last();a&&(d.showNodes(!1),d.setScale(a.get("zoom_level"),new paper.Point(a.get("offset"))),d.renkan.options.hide_nodes&&(d.hiddenNodes=(a.get("hidden_nodes")||[]).concat(),d.hideNodes()))}),this.$.find(".Rk-ShowHiddenNodes").mouseenter(function(){d.showNodes(!0),d.$.find(".Rk-ShowHiddenNodes").mouseleave(function(){d.hideNodes()})}),this.$.find(".Rk-ShowHiddenNodes").click(function(){d.showNodes(!1),d.$.find(".Rk-ShowHiddenNodes").off("mouseleave")}),this.renkan.project.get("views").length>0&&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.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()}),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(){if(this.renkan.options.default_view&&this.renkan.project.get("views").length>0){var a=this.renkan.project.get("views").last();this.setScale(a.get("zoom_level"),new paper.Point(a.get("offset")))}else this.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()},setScale:function(a,b){a/this.initialScale>f._MIN_SCALE&&a/this.initialScale<f._MAX_SCALE&&(this.scale=a,b&&(this.offset=b),this.redraw())},autoScale:function(a){var b=this.renkan.project.get("nodes");if(b.length>1){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])))},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.scale*this.renkan.options.minimap_width/paper.view.bounds.width,.8*this.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.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=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('<li class="Rk-User"><span class="Rk-UserColor" style="background:<%=background%>;"></span><%=name%></li>'),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("<unknown user>")),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("<input>").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&&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},addHiddenNode:function(a){this.hideNode(a),this.hiddenNodes.push(a.id)},hideNode:function(a){var b=this;"undefined"!=typeof b.getRepresentationByModel(a)&&b.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,c=0;this.hiddenNodes.forEach(function(d){c++,b.getRepresentationByModel(b.renkan.project.get("nodes").get(d)).show(a)}),a||(this.hiddenNodes=[]),paper.view.draw()},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},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]),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.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();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.offset).multiply(Math.SQRT2-1);this.totalScroll>0?this.setScale(this.scale*Math.SQRT2,this.offset.subtract(d)):this.setScale(this.scale*Math.SQRT1_2,this.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("<div>").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("<div>").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("<div>").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("<div>").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;k<j.length;k++){var l=j[k];(b["text/x-iri-"+l]||b[l])&&(c[l]=b["text/x-iri-"+l]||b[l]),("none"===c[l]||"null"===c[l])&&(c[l]=void 0)}return"function"==typeof this.renkan.options.drop_enhancer&&(c=this.renkan.options.drop_enhancer(c,b)),c},dropData:function(a,c){if(this.isEditable()){if(a["text/json"]||a["application/json"])try{var d=JSON.parse(a["text/json"]||a["application/json"]);b.extend(a,d)}catch(e){}var g="undefined"==typeof this.renkan.options.drop_handler?this.defaultDropHandler(a):this.renkan.options.drop_handler(a),h=this.canvas_$.offset(),i=new paper.Point([c.pageX-h.left,c.pageY-h.top]),j=this.toModelCoords(i),k={id:f.getUID("node"),created_by:this.renkan.current_user,uri:g.uri||"",title:g.title||"",description:g.description||"",image:g.image||"",color:g.color||void 0,clip_path:g.clipPath||void 0,position:{x:j.x,y:j.y}},l=this.renkan.project.addNode(k),m=this.getRepresentationByModel(l);"drop"===c.type&&m.openEditor()}},fullScreen:function(){var a,b=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen,c=this.renkan.$[0],d=["requestFullScreen","mozRequestFullScreen","webkitRequestFullScreen"],e=["cancelFullScreen","mozCancelFullScreen","webkitCancelFullScreen"];if(b){for(a=0;a<e.length;a++)if("function"==typeof document[e[a]]){document[e[a]]();break}var f=this.$.width(),g=this.$.height();this.renkan.options.show_top_bar&&(g-=this.$.find(".Rk-TopBar").height()),this.renkan.options.show_bins&&this.renkan.$.find(".Rk-Bins").position().left>0&&(f-=this.renkan.$.find(".Rk-Bins").width()),paper.view.viewSize=new paper.Size([f,g])}else{for(a=0;a<d.length;a++)if("function"==typeof c[d[a]]){c[d[a]]();break}this.redraw()}},zoomOut:function(){var a=this.scale*Math.SQRT1_2,b=new paper.Point([this.canvas_$.width(),this.canvas_$.height()]).multiply(.5*(1-Math.SQRT1_2)).add(this.offset.multiply(Math.SQRT1_2));this.setScale(a,b)},zoomIn:function(){var a=this.scale*Math.SQRT2,b=new paper.Point([this.canvas_$.width(),this.canvas_$.height()]).multiply(.5*(1-Math.SQRT2)).add(this.offset.multiply(Math.SQRT2));this.setScale(a,b)},resizeZoom:function(a,b,c){var d=this.scale*c,e=new paper.Point([this.offset.x*a,this.offset.y*b]);this.setScale(d,e)},addNodeBtn:function(){return this.click_mode===f._CLICKMODE_ADDNODE?(this.click_mode=!1,this.notif_$.hide()):(this.click_mode=f._CLICKMODE_ADDNODE,this.notif_$.text(this.renkan.translate("Click on the background canvas to add a node")).fadeIn()),!1},addEdgeBtn:function(){return this.click_mode===f._CLICKMODE_STARTEDGE||this.click_mode===f._CLICKMODE_ENDEDGE?(this.click_mode=!1,this.notif_$.hide()):(this.click_mode=f._CLICKMODE_STARTEDGE,this.notif_$.text(this.renkan.translate("Click on a first node to start the edge")).fadeIn()),!1},exportProject:function(){var a=this.renkan.project.toJSON(),d=(document.createElement("a"),a.id),e=d+".json";delete a.id,delete a._id,delete a.space_id;var g,h,i={};b.each(a.nodes,function(a,b,c){g=a.id||a._id,delete a._id,delete a.id,i[g]=a["@id"]=f.getUUID4()}),b.each(a.edges,function(a,b,c){delete a._id,delete a.id,a.to=i[a.to],a.from=i[a.from]}),b.each(a.views,function(a,c,d){delete a._id,delete a.id,a.hidden_nodes&&(h=a.hidden_nodes,a.hidden_nodes=[],b.each(h,function(b,c){a.hidden_nodes.push(i[b])}))}),a.users=[];var j=JSON.stringify(a,null,2),k=new Blob([j],{type:"application/json;charset=utf-8"});c(k,e)},parameters:function(a){"undefined"!=typeof a.idnode&&(this.unhighlightAll(),this.highlightModel(this.renkan.project.get("nodes").get(a.idnode)))},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()<c.height()?e:e-c.width(),b.html("&laquo;")):(c.animate({left:-300},250),this.$.animate({left:0},250,function(){var a=d.$.width();paper.view.viewSize=new paper.Size([a,d.canvas_$.height()])}),a=e+300,b.html("&raquo;")),d.resizeZoom(1,1,a/e)},save:function(){},open:function(){}}).value(),g}),"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"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v){"use strict";var w=window.Rkns;"undefined"==typeof w.Renderer&&(w.Renderer={});var x=w.Renderer;x._BaseRepresentation=a,x._BaseButton=b,x.Node=c,x.Edge=d,x.TempEdge=e,x._BaseEditor=f,x.NodeEditor=g,x.EdgeEditor=h,x._NodeButton=i,x.NodeEditButton=j,x.NodeRemoveButton=k,x.NodeHideButton=l,x.NodeShowButton=m,x.NodeRevertButton=n,x.NodeLinkButton=o,x.NodeEnlargeButton=p,x.NodeShrinkButton=q,x.EdgeEditButton=r,x.EdgeRemoveButton=s,x.EdgeRevertButton=t,x.MiniFrame=u,x.Scene=v,startRenkan()}),define("main-renderer",function(){});
+this.renkanJST=this.renkanJST||{},this.renkanJST["templates/colorpicker.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='<li data-color="'+(null==(__t=c)?"":__t)+'" style="background: '+(null==(__t=c)?"":__t)+'"></li>';return __p},this.renkanJST["templates/edgeeditor.html"]=function(obj){obj||(obj={});{var __t,__p="",__e=_.escape;Array.prototype.join}with(obj)__p+='<h2>\n    <span class="Rk-CloseX">&times;</span>'+__e(renkan.translate("Edit Edge"))+"</span>\n</h2>\n<p>\n    <label>"+__e(renkan.translate("Title:"))+'</label>\n    <input class="Rk-Edit-Title" type="text" value="'+__e(edge.title)+'" />\n</p>\n',options.show_edge_editor_uri&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("URI:"))+'</label>\n        <input class="Rk-Edit-URI" type="text" value="'+__e(edge.uri)+'" />\n        <a class="Rk-Edit-Goto" href="'+__e(edge.uri)+'" target="_blank"></a>\n    </p>\n    ',options.properties.length&&(__p+="\n        <p>\n            <label>"+__e(renkan.translate("Choose from vocabulary:"))+'</label>\n            <select class="Rk-Edit-Vocabulary">\n                ',_.each(options.properties,function(a){__p+='\n                    <option class="Rk-Edit-Vocabulary-Class" value="">\n                        '+__e(renkan.translate(a.label))+"\n                    </option>\n                    ",_.each(a.properties,function(b){var c=a["base-uri"]+b.uri;__p+='\n                        <option class="Rk-Edit-Vocabulary-Property" value="'+__e(c)+'"\n                            ',c===edge.uri&&(__p+=" selected"),__p+=">\n                            "+__e(renkan.translate(b.label))+"\n                        </option>\n                    "}),__p+="\n                "}),__p+="\n            </select>\n        </p>\n")),__p+="\n",options.show_edge_editor_style&&(__p+='\n    <div class="Rk-Editor-p">\n      ',options.show_edge_editor_style_color&&(__p+='\n      <div id="Rk-Editor-p-color">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Edge color:"))+'</span>\n        <div class="Rk-Edit-ColorPicker-Wrapper">\n            <span class="Rk-Edit-Color" style="background: &lt;%-edge.color%>;">\n                <span class="Rk-Edit-ColorTip"></span>\n            </span>\n            '+(null==(__t=renkan.colorPicker)?"":__t)+'\n            <span class="Rk-Edit-ColorPicker-Text">'+__e(renkan.translate("Choose color"))+"</span>\n        </div>\n      </div>\n      "),__p+="\n      ",options.show_edge_editor_style_dash&&(__p+='\n      <div id="Rk-Editor-p-dash">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Dash:"))+'</span>\n        <input type="checkbox" name="Rk-Edit-Dash" class="Rk-Edit-Dash" '+__e(edge.dash)+" />\n      </div>\n      "),__p+="\n      ",options.show_edge_editor_style_thickness&&(__p+='\n      <div id="Rk-Editor-p-thickness">\n          <span class="Rk-Editor-Label">'+__e(renkan.translate("Thickness:"))+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Down">-</a>\n          <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Thickness-Value">'+__e(edge.thickness)+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Up">+</a>\n      </div>\n      '),__p+="\n      ",options.show_edge_editor_style_arrow&&(__p+='\n      <div id="Rk-Editor-p-arrow">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Arrow:"))+'</span>\n        <input type="checkbox" name="Rk-Edit-Arrow" class="Rk-Edit-Arrow" '+__e(edge.arrow)+" />\n      </div>\n      "),__p+="\n    </div>\n"),__p+="\n",options.show_edge_editor_direction&&(__p+='\n    <p>\n        <span class="Rk-Edit-Direction">'+__e(renkan.translate("Change edge direction"))+"</span>\n    </p>\n"),__p+="\n",options.show_edge_editor_nodes&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("From:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.from_color)+';"></span>\n        '+__e(shortenText(edge.from_title,25))+'\n    </p>\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("To:"))+'</span>\n        <span class="Rk-UserColor" style="background: >%-edge.to_color%>;"></span>\n        '+__e(shortenText(edge.to_title,25))+"\n    </p>\n"),__p+="\n",options.show_edge_editor_creator&&edge.has_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: &lt;%-edge.created_by_color%>;"></span>\n        '+__e(shortenText(edge.created_by_title,25))+"\n    </p>\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+='<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ',options.show_edge_tooltip_color&&(__p+='\n        <span class="Rk-UserColor" style="background: '+__e(edge.color)+';"></span>\n    '),__p+='\n    <span class="Rk-Display-Title">\n        ',edge.uri&&(__p+='\n            <a href="'+__e(edge.uri)+'" target="_blank">\n        '),__p+="\n        "+__e(edge.title)+"\n        ",edge.uri&&(__p+=" </a> "),__p+="\n    </span>\n</h2>\n",options.show_edge_tooltip_uri&&edge.uri&&(__p+='\n    <p class="Rk-Display-URI">\n        <a href="'+__e(edge.uri)+'" target="_blank">'+__e(edge.short_uri)+"</a>\n    </p>\n"),__p+="\n<p>"+(null==(__t=edge.description)?"":__t)+"</p>\n",options.show_edge_tooltip_nodes&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("From:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.from_color)+';"></span>\n        '+__e(shortenText(edge.from_title,25))+'\n    </p>\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("To:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.to_color)+';"></span>\n        '+__e(shortenText(edge.to_title,25))+"\n    </p>\n"),__p+="\n",options.show_edge_tooltip_creator&&edge.has_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(edge.created_by_color)+';"></span>\n        '+__e(shortenText(edge.created_by_title,25))+"\n    </p>\n"),__p+="\n";return __p},this.renkanJST["templates/ldtjson-bin/annotationtemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Bin-Item" draggable="true"\n    data-image="'+__e(Rkns.Utils.getFullURL(image))+'"\n    data-uri="'+(null==(__t=ldt_platform)?"":__t)+"ldtplatform/ldt/front/player/"+(null==(__t=mediaid)?"":__t)+"/#id="+(null==(__t=annotationid)?"":__t)+'"\n    data-title="'+__e(title)+'" data-description="'+__e(description)+'">\n\n    <img class="Rk-Ldt-Annotation-Icon" src="'+(null==(__t=image)?"":__t)+'" />\n    <h4>'+(null==(__t=htitle)?"":__t)+"</h4>\n    <p>"+(null==(__t=hdescription)?"":__t)+"</p>\n    <p>Start: "+(null==(__t=start)?"":__t)+", End: "+(null==(__t=end)?"":__t)+", Duration: "+(null==(__t=duration)?"":__t)+'</p>\n    <div class="Rk-Clear"></div>\n</li>\n';return __p},this.renkanJST["templates/ldtjson-bin/segmenttemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Bin-Item" draggable="true"\n    data-image="'+__e(Rkns.Utils.getFullURL(image))+'"\n    data-uri="'+(null==(__t=ldt_platform)?"":__t)+"ldtplatform/ldt/front/player/"+(null==(__t=mediaid)?"":__t)+"/#id="+(null==(__t=annotationid)?"":__t)+'"\n    data-title="'+__e(title)+'" data-description="'+__e(description)+'">\n\n    <img class="Rk-Ldt-Annotation-Icon" src="'+(null==(__t=image)?"":__t)+'" />\n    <h4>'+(null==(__t=htitle)?"":__t)+"</h4>\n    <p>"+(null==(__t=hdescription)?"":__t)+"</p>\n    <p>Start: "+(null==(__t=start)?"":__t)+", End: "+(null==(__t=end)?"":__t)+", Duration: "+(null==(__t=duration)?"":__t)+'</p>\n    <div class="Rk-Clear"></div>\n</li>\n';return __p},this.renkanJST["templates/ldtjson-bin/tagtemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Bin-Item" draggable="true"\n    data-image="'+__e(Rkns.Utils.getFullURL(static_url+"img/ldt-tag.png"))+'"\n    data-uri="'+(null==(__t=ldt_platform)?"":__t)+"ldtplatform/ldt/front/search/?search="+(null==(__t=encodedtitle)?"":__t)+'&field=all"\n    data-title="'+__e(title)+'" data-description="Tag \''+__e(title)+'\'">\n\n    <img class="Rk-Ldt-Tag-Icon" src="'+__e(static_url)+'img/ldt-tag.png" />\n    <h4>'+(null==(__t=htitle)?"":__t)+'</h4>\n    <div class="Rk-Clear"></div>\n</li>\n';return __p},this.renkanJST["templates/list-bin.html"]=function(obj){obj||(obj={});{var __t,__p="",__e=_.escape;Array.prototype.join}with(obj)__p+='<li class="Rk-Bin-Item Rk-ResourceList-Item" draggable="true"\n    data-uri="'+__e(url)+'" data-title="'+__e(title)+'"\n    data-description="'+__e(description)+'"\n    ',__p+=image?'\n        data-image="'+__e(Rkns.Utils.getFullURL(image))+'"\n    ':'\n        data-image=""\n    ',__p+="\n>",image&&(__p+='\n    <img class="Rk-ResourceList-Image" src="'+__e(image)+'" />\n'),__p+='\n<h4 class="Rk-ResourceList-Title">\n    ',url&&(__p+='\n        <a href="'+__e(url)+'" target="_blank">\n    '),__p+="\n    "+(null==(__t=htitle)?"":__t)+"\n    ",url&&(__p+="</a>"),__p+="\n    </h4>\n    ",description&&(__p+='\n        <p class="Rk-ResourceList-Description">'+(null==(__t=hdescription)?"":__t)+"</p>\n    "),__p+="\n    ",image&&(__p+='\n        <div style="clear: both;"></div>\n    '),__p+="\n</li>\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    <div class="Rk-Bins">\n        <div class="Rk-Bins-Head">\n            <h2 class="Rk-Bins-Title">'+__e(translate("Select contents:"))+'</h2>\n            <form class="Rk-Web-Search-Form Rk-Search-Form">\n                <input class="Rk-Web-Search-Input Rk-Search-Input" type="search"\n                    placeholder="'+__e(translate("Search the Web"))+'" />\n                <div class="Rk-Search-Select">\n                    <div class="Rk-Search-Current"></div>\n                    <ul class="Rk-Search-List"></ul>\n                </div>\n                <input type="submit" value=""\n                    class="Rk-Web-Search-Submit Rk-Search-Submit" title="'+__e(translate("Search the Web"))+'" />\n            </form>\n            <form class="Rk-Bins-Search-Form Rk-Search-Form">\n                <input class="Rk-Bins-Search-Input Rk-Search-Input" type="search"\n                    placeholder="'+__e(translate("Search in Bins"))+'" /> <input\n                    type="submit" value=""\n                    class="Rk-Bins-Search-Submit Rk-Search-Submit"\n                    title="'+__e(translate("Search in Bins"))+'" />\n            </form>\n        </div>\n        <ul class="Rk-Bin-List"></ul>\n    </div>\n'),__p+=" ",options.show_editor&&(__p+='\n    <div class="Rk-Render Rk-Render-',__p+=options.show_bins?"Panel":"Full",__p+='"></div>\n'),__p+="\n";return __p},this.renkanJST["templates/nodeeditor.html"]=function(obj){obj||(obj={});{var __t,__p="",__e=_.escape;Array.prototype.join}with(obj)__p+='\n<h2>\n    <span class="Rk-CloseX">&times;</span>'+__e(renkan.translate("Edit Node"))+"</span>\n</h2>\n<p>\n    <label>"+__e(renkan.translate("Title:"))+"</label>\n    ",__p+=options.show_node_editor_title_richtext?'\n        <div class="Rk-Edit-Title" contenteditable="true">'+(null==(__t=node.title)?"":__t)+"</div>\n    ":'\n        <input class="Rk-Edit-Title" type="text" value="'+__e(node.title)+'" />\n    ',__p+="    \n</p>\n",options.show_node_editor_uri&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("URI:"))+'</label>\n        <input class="Rk-Edit-URI" type="text" value="'+__e(node.uri)+'" />\n        <a class="Rk-Edit-Goto" href="'+__e(node.uri)+'" target="_blank"></a>\n    </p>\n'),__p+=" ",options.change_types&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Types available"))+':</label>\n        <select class="Rk-Edit-Type">\n          ',_.each(types,function(a){__p+='\n            <option class="Rk-Edit-Vocabulary-Property" value="'+__e(a)+'"',node.type===a&&(__p+=" selected"),__p+=">\n                "+__e(renkan.translate(a.charAt(0).toUpperCase()+a.substring(1)))+"\n            </option>\n          "}),__p+="\n        </select>\n    </p>\n"),__p+=" ",options.show_node_editor_description&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Description:"))+"</label>\n        ",__p+=options.show_node_editor_description_richtext?'\n            <div class="Rk-Edit-Description" contenteditable="true">'+(null==(__t=node.description)?"":__t)+"</div>\n        ":'\n            <textarea class="Rk-Edit-Description">'+(null==(__t=node.description)?"":__t)+"</textarea>\n        ",__p+="\n    </p>\n"),__p+=" ",options.show_node_editor_size&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Size:"))+'</span>\n        <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Size-Down">-</a>\n        <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Size-Value">'+__e(node.size)+'</span>\n        <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Size-Up">+</a>\n    </p>\n'),__p+=" ",options.show_node_editor_style&&(__p+='\n    <div class="Rk-Editor-p">\n      ',options.show_node_editor_style_color&&(__p+='\n      <div id="Rk-Editor-p-color">\n        <span class="Rk-Editor-Label">\n        '+__e(renkan.translate("Node color:"))+'</span>\n        <div class="Rk-Edit-ColorPicker-Wrapper">\n            <span class="Rk-Edit-Color" style="background: '+__e(node.color)+';">\n                <span class="Rk-Edit-ColorTip"></span>\n            </span>\n            '+(null==(__t=renkan.colorPicker)?"":__t)+'\n            <span class="Rk-Edit-ColorPicker-Text">'+__e(renkan.translate("Choose color"))+"</span>\n        </div>\n      </div>\n      "),__p+="\n      ",options.show_node_editor_style_dash&&(__p+='\n      <div id="Rk-Editor-p-dash">\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Dash:"))+'</span>\n        <input type="checkbox" name="Rk-Edit-Dash" class="Rk-Edit-Dash" '+__e(node.dash)+" />\n      </div>\n      "),__p+="\n      ",options.show_node_editor_style_thickness&&(__p+='\n      <div id="Rk-Editor-p-thickness">\n          <span class="Rk-Editor-Label">'+__e(renkan.translate("Thickness:"))+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Down">-</a>\n          <span class="Rk-Edit-Size-Disp" id="Rk-Edit-Thickness-Value">'+__e(node.thickness)+'</span>\n          <a href="#" class="Rk-Edit-Size-Btn" id="Rk-Edit-Thickness-Up">+</a>\n      </div>\n      '),__p+="\n    </div>\n"),__p+=" ",options.show_node_editor_image&&(__p+='\n    <div class="Rk-Edit-ImgWrap">\n        <div class="Rk-Edit-ImgPreview">\n            <img src="'+__e(node.image||node.image_placeholder)+'" />\n            ',node.clip_path&&(__p+='\n                <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 1 1" preserveAspectRatio="none">\n                    <path style="stroke-width: .02; stroke:red; fill-opacity:.3; fill:red;" d="'+__e(node.clip_path)+'" />\n                </svg>\n            '),__p+="\n        </div>\n    </div>\n    <p>\n        <label>"+__e(renkan.translate("Image URL:"))+'</label>\n        <div>\n            <a class="Rk-Edit-Image-Del" href="#"></a>\n            <input class="Rk-Edit-Image" type="text" value=\''+__e(node.image)+"' />\n        </div>\n    </p>\n",options.allow_image_upload&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Choose Image File:"))+'</label>\n        <input class="Rk-Edit-Image-File" type="file" accept="image/*" />\n    </p>\n')),__p+=" ",options.show_node_editor_creator&&node.has_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(node.created_by_color)+';"></span>\n        '+__e(shortenText(node.created_by_title,25))+"\n    </p>\n"),__p+=" ",options.change_shapes&&(__p+="\n    <p>\n        <label>"+__e(renkan.translate("Shapes available"))+':</label>\n        <select class="Rk-Edit-Shape">\n          ',_.each(shapes,function(a){__p+='\n            <option class="Rk-Edit-Vocabulary-Property" value="'+__e(a)+'"',node.shape===a&&(__p+=" selected"),__p+=">\n                "+__e(renkan.translate(a.charAt(0).toUpperCase()+a.substring(1)))+"\n            </option>\n          "}),__p+="\n        </select>\n    </p>\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+='<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ',options.show_node_tooltip_color&&(__p+='\n        <span class="Rk-UserColor" style="background: '+__e(node.color)+';"></span>\n    '),__p+='\n    <span class="Rk-Display-Title">\n        ',node.uri&&(__p+='\n            <a href="'+__e(node.uri)+'" target="_blank">\n        '),__p+="\n        "+__e(node.title)+"\n        ",node.uri&&(__p+="</a>"),__p+="\n    </span>\n</h2>\n",node.uri&&options.show_node_tooltip_uri&&(__p+='\n    <p class="Rk-Display-URI">\n        <a href="'+__e(node.uri)+'" target="_blank">'+__e(node.short_uri)+"</a>\n    </p>\n"),__p+=" ",options.show_node_tooltip_description&&(__p+='\n    <p class="Rk-Display-Description">'+(null==(__t=node.description)?"":__t)+"</p>\n"),__p+=" ",node.image&&options.show_node_tooltip_image&&(__p+='\n    <img class="Rk-Display-ImgPreview" src="'+__e(node.image)+'" />\n'),__p+=" ",node.has_creator&&options.show_node_tooltip_creator&&(__p+='\n    <p>\n        <span class="Rk-Editor-Label">'+__e(renkan.translate("Created by:"))+'</span>\n        <span class="Rk-UserColor" style="background: '+__e(node.created_by_color)+';"></span>\n        '+__e(shortenText(node.created_by_title,25))+"\n    </p>\n"),__p+='\n    <a href="#?idNode='+__e(node._id)+'">'+__e(renkan.translate("Link to the node"))+"</a>\n";return __p},this.renkanJST["templates/nodeeditor_video.html"]=function(obj){obj||(obj={});{var __p="",__e=_.escape;Array.prototype.join}with(obj)__p+='<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ',options.show_node_tooltip_color&&(__p+='\n        <span class="Rk-UserColor" style="background: '+__e(node.color)+';"></span>\n    '),__p+='\n    <span class="Rk-Display-Title">\n        ',node.uri&&(__p+='\n            <a href="'+__e(node.uri)+'" target="_blank">\n        '),__p+="\n        "+__e(node.title)+"\n        ",node.uri&&(__p+="</a>"),__p+="\n    </span>\n</h2>\n",node.uri&&options.show_node_tooltip_uri&&(__p+='\n     <video width="320" height="240" controls>\n        <source src="'+__e(node.uri)+'" type="video/mp4">\n     </video> \n'),__p+='\n    <a href="#?idnode='+__e(node._id)+'">'+__e(renkan.translate("Link to the node"))+"</a>\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    <div class="Rk-TopBar">\n        <div class="loader"></div>\n        ',__p+=options.editor_mode?'\n            <input type="text" class="Rk-PadTitle" value="'+__e(project.get("title")||"")+'" placeholder="'+__e(translate("Untitled project"))+'" />\n        ':'\n            <h2 class="Rk-PadTitle">\n                '+__e(project.get("title")||translate("Untitled project"))+"\n            </h2>\n        ",__p+="\n        ",options.show_user_list&&(__p+='\n            <div class="Rk-Users">\n                <div class="Rk-CurrentUser">\n                    ',options.show_user_color&&(__p+='\n                        <div class="Rk-Edit-ColorPicker-Wrapper">\n                            <span class="Rk-CurrentUser-Color">\n                            ',options.user_color_editable&&(__p+='\n                                <span class="Rk-Edit-ColorTip"></span>\n                            '),__p+="\n                            </span>\n                            ",options.user_color_editable&&print(colorPicker),__p+="\n                        </div>\n                    "),__p+='\n                    <span class="Rk-CurrentUser-Name">&lt;unknown user&gt;</span>\n                </div>\n                <ul class="Rk-UserList"></ul>\n            </div>\n        '),__p+="\n        ",options.home_button_url&&(__p+='\n            <div class="Rk-TopBar-Separator"></div>\n            <a class="Rk-TopBar-Button Rk-Home-Button" href="'+__e(options.home_button_url)+'">\n                <div class="Rk-TopBar-Tooltip">\n                    <div class="Rk-TopBar-Tooltip-Contents">\n                        '+__e(translate(options.home_button_title))+"\n                    </div>\n                </div>\n            </a>\n        "),__p+="\n        ",options.show_fullscreen_button&&(__p+='\n            <div class="Rk-TopBar-Separator"></div>\n            <div class="Rk-TopBar-Button Rk-FullScreen-Button">\n                <div class="Rk-TopBar-Tooltip">\n                    <div class="Rk-TopBar-Tooltip-Contents">\n                        '+__e(translate("Full Screen"))+"\n                    </div>\n                </div>\n            </div>\n        "),__p+="\n        ",options.editor_mode?(__p+="\n            ",options.show_addnode_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-AddNode-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Add Node"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_addedge_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-AddEdge-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Add Edge"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_export_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Export-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Download Project"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_save_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Save-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents"></div>\n                    </div>\n                </div>\n            '),__p+="\n            ",options.show_open_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Open-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Open Project"))+"\n                        </div>\n                    </div>\n                </div>\n            "),__p+="\n            ",options.show_bookmarklet&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <a class="Rk-TopBar-Button Rk-Bookmarklet-Button" href="#">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Renkan 'Drag-to-Add' bookmarklet"))+'\n                        </div>\n                    </div>\n                </a>\n                <div class="Rk-TopBar-Separator"></div>\n            '),__p+="\n        "):(__p+="\n            ",options.show_export_button&&(__p+='\n                <div class="Rk-TopBar-Separator"></div>\n                <div class="Rk-TopBar-Button Rk-Export-Button">\n                    <div class="Rk-TopBar-Tooltip">\n                        <div class="Rk-TopBar-Tooltip-Contents">\n                            '+__e(translate("Download Project"))+'\n                        </div>\n                    </div>\n                </div>\n                <div class="Rk-TopBar-Separator"></div>\n            '),__p+="\n        "),__p+="\n        ",options.show_search_field&&(__p+='\n            <form action="#" class="Rk-GraphSearch-Form">\n                <input type="search" class="Rk-GraphSearch-Field" placeholder="'+__e(translate("Search in graph"))+'" />\n            </form>\n            <div class="Rk-TopBar-Separator"></div>\n        '),__p+="\n    </div>\n"),__p+='\n<div class="Rk-Editing-Space',options.show_top_bar||(__p+=" Rk-Editing-Space-Full"),__p+='">\n    <div class="Rk-Labels"></div>\n    <canvas class="Rk-Canvas" ',options.resize&&(__p+=' resize="" '),__p+=' ></canvas>\n    <div class="Rk-Notifications"></div>\n    <div class="Rk-Editor">\n        ',options.show_bins&&(__p+='\n            <div class="Rk-Fold-Bins">&laquo;</div>\n        '),__p+="\n        ",options.show_zoom&&(__p+='\n            <div class="Rk-ZoomButtons">\n                <div class="Rk-ZoomIn" title="'+__e(translate("Zoom In"))+'"></div>\n                <div class="Rk-ZoomFit" title="'+__e(translate("Zoom Fit"))+'"></div>\n                <div class="Rk-ZoomOut" title="'+__e(translate("Zoom Out"))+'"></div>\n                ',options.editor_mode&&options.save_view&&(__p+='\n                    <div class="Rk-ZoomSave" title="'+__e(translate("Save view"))+'"></div>\n                '),__p+="\n                ",options.save_view&&(__p+='\n                    <div class="Rk-ZoomSetSaved" title="'+__e(translate("View saved view"))+'"></div>\n                    ',options.hide_nodes&&(__p+='\n                	   <div class="Rk-ShowHiddenNodes" title="'+__e(translate("Show hidden nodes"))+'"></div>\n                    '),__p+="       \n                "),__p+="\n            </div>\n        "),__p+="\n    </div>\n</div>\n";return __p},this.renkanJST["templates/search.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='<li class="'+(null==(__t=className)?"":__t)+'" data-key="'+(null==(__t=key)?"":__t)+'">'+(null==(__t=title)?"":__t)+"</li>";return __p},this.renkanJST["templates/wikipedia-bin/resulttemplate.html"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<li class="Rk-Wikipedia-Result Rk-Bin-Item" draggable="true"\n    data-uri="'+__e(url)+'" data-title="Wikipedia: '+__e(title)+'"\n    data-description="'+__e(description)+'"\n    data-image="'+__e(Rkns.Utils.getFullURL(static_url+"img/wikipedia.png"))+'">\n\n    <img class="Rk-Wikipedia-Icon" src="'+__e(static_url)+'img/wikipedia.png">\n    <h4 class="Rk-Wikipedia-Title">\n        <a href="'+__e(url)+'" target="_blank">'+(null==(__t=htitle)?"":__t)+'</a>\n    </h4>\n    <p class="Rk-Wikipedia-Snippet">'+(null==(__t=hdescription)?"":__t)+"</p>\n</li>\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.$("<li>").addClass("Rk-Bin").appendTo(a.$.find(".Rk-Bin-List")),this.title_icon_$=b.$("<span>").addClass("Rk-Bin-Title-Icon").appendTo(this.$);var d=this;b.$("<a>").attr({href:"#",title:a.translate("Close bin")}).addClass("Rk-Bin-Close").html("&times;").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.$("<a>").attr({href:"#",title:a.translate("Refresh bin")}).addClass("Rk-Bin-Refresh").appendTo(this.$).click(function(){return d.refresh(),!1}),this.count_$=b.$("<div>").addClass("Rk-Bin-Count").appendTo(this.$),this.title_$=b.$("<h2>").addClass("Rk-Bin-Title").appendTo(this.$),this.main_$=b.$("<div>").addClass("Rk-Bin-Main").appendTo(this.$).html('<h4 class="Rk-Bin-Loading">'+a.translate("Loading, please wait")+"</h4>"),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'<ul class="Rk-Edit-ColorPicker">'+b.pickerColors.map(function(b){return a({c:b})}).join("")+"</ul>"}(),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){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(){var a=b.$(this);
+if(a&&c(a).attr("data-uri")){var f=e.project.get("nodes").where({uri:c(a).attr("data-uri")});d.each(f,function(a){e.renderer.highlightModel(a)})}}).mouseout(function(){e.renderer.unhighlightAll()}).on("mousemove",".Rk-Bin-Item",function(){try{this.dragDrop()}catch(a){}}).on("touchstart",".Rk-Bin-Item",function(){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.left+d&&b.pageY>=c.top&&b.pageY<c.top+f)if(k)e.renderer.onMouseMove(b,!0);else{k=!0;var g=document.createElement("div");g.appendChild(this.cloneNode(!0)),e.renderer.dropData({"text/html":g.innerHTML},b),e.renderer.onMouseDown(b,!0)}}).on("touchend",".Rk-Bin-Item",function(a){k&&e.renderer.onMouseUp(a.originalEvent.changedTouches[0],!0),k=!1}).on("dragstart",".Rk-Bin-Item",function(a){var b=document.createElement("div");b.appendChild(this.cloneNode(!0));try{a.originalEvent.dataTransfer.setData("text/html",b.innerHTML)}catch(c){a.originalEvent.dataTransfer.setData("text",b.innerHTML)}}),b.$(window).resize(function(){e.resizeBins()});var l=!1,m="";this.$.find(".Rk-Bins-Search-Input").on("change keyup paste input",function(){var a=b.$(this).val();if(a!==m){var c=b.Utils.regexpFromTextOrArray(a.length>1?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;d<b.length;d++)c+="."+b[d];this.$.find(".Rk-Web-Search-Input.Rk-Search-Input").attr("placeholder",this.translate("Search in ")+this.$.find(".Rk-Search-List "+c).html())},f.prototype.resizeBins=function(){var a=+this.$.find(".Rk-Bins-Head").outerHeight();this.$.find(".Rk-Bin-Title:visible").each(function(){a+=b.$(this).outerHeight()}),this.$.find(".Rk-Bin-Main").css({height:this.$.find(".Rk-Bins").height()-a})};var g=function(){return"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)})};b.Utils={getUUID4:g,getUID:function(){function a(a){return 10>a?"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(){"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<e.length;j++){j&&(i+=f+"*");var k=e[j];d.each(c,b(k)),i+=k}return i}function b(c){switch(typeof c){case"string":return a(c);case"object":var e="";return d.each(c,function(a){var c=b(a);c&&(e&&(e+="|"),e+=c)}),e}return""}var c=["[aáàâä]","[cç]","[eéèêë]","[iíìîï]","[oóòôö]","[uùûü]"],e=[String.fromCharCode(768),String.fromCharCode(769),String.fromCharCode(770),String.fromCharCode(771),String.fromCharCode(807),"{","}","(",")","[","]","【","】","、","・","‥","。","「","」","『","』","〜",":","!","?"," ",","," ",";","(",")",".","*","+","\\","?","|","{","}","[","]","^","#","/"],f="[\\"+e.join("\\")+"]",g=new RegExp(f,"gm"),h=d.map(c,function(a){return new RegExp(a)});return function(a){var c=b(a);if(c){var d=new RegExp(c,"im"),e=new RegExp("("+c+")","igm");return{isempty:!1,source:c,test:function(a){return d.test(a)},replace:function(a,b){return a.replace(e,b)}}}return{isempty:!0,source:"",test:function(){return!0},replace:function(){return text}}}}(),_MIN_DRAG_DISTANCE:2,_NODE_BUTTON_WIDTH:40,_EDGE_BUTTON_INNER:2,_EDGE_BUTTON_OUTER:40,_CLICKMODE_ADDNODE:1,_CLICKMODE_STARTEDGE:2,_CLICKMODE_ENDEDGE:3,_NODE_SIZE_STEP:Math.LN2/4,_MIN_SCALE:.05,_MAX_SCALE:20,_MOUSEMOVE_RATE:80,_DOUBLETAP_DELAY:800,_DOUBLETAP_DISTANCE:400,_USER_PLACEHOLDER:function(a){return{color:a.options.default_user_color,title:a.translate("(unknown user)"),get:function(a){return this[a]||!1}}},_BOOKMARKLET_CODE:function(a){return"(function(a,b,c,d,e,f,h,i,j,k,l,m,n,o,p,q,r){a=document;b=a.body;c=a.location.href;j='draggable';m='text/x-iri-';d=a.createElement('div');d.innerHTML='<p_style=\"position:fixed;top:0;right:0;font:bold_18px_sans-serif;color:#fff;background:#909;padding:10px;z-index:100000;\">"+a.translate("Drag items from this website, drop them in Renkan").replace(/ /g,"_")+"</p>'.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.x<paper.view.center.x?1:-1,h=b.x+g*(d+a.tooltip_arrow_length),i=b.x+g*(d+a.tooltip_arrow_length+a.tooltip_width),j=b.y-f/2;j+f>paper.view.size.height-a.tooltip_margin&&(j=Math.max(paper.view.size.height-a.tooltip_margin,b.y+a.tooltip_arrow_width/2)-f),j<a.tooltip_margin&&(j=Math.min(a.tooltip_margin,b.y-a.tooltip_arrow_width/2));var k=j+f;return c.segments[0].point=c.segments[7].point=b.add([g*d,0]),c.segments[1].point.x=c.segments[2].point.x=c.segments[5].point.x=c.segments[6].point.x=h,c.segments[3].point.x=c.segments[4].point.x=i,c.segments[2].point.y=c.segments[3].point.y=j,c.segments[4].point.y=c.segments[5].point.y=k,c.segments[1].point.y=b.y-a.tooltip_arrow_width/2,c.segments[6].point.y=b.y+a.tooltip_arrow_width/2,c.fillColor=new paper.Color(new paper.Gradient([a.tooltip_top_color,a.tooltip_bottom_color]),[0,j],[0,k]),e.css({left:a.tooltip_padding+Math.min(h,i),top:a.tooltip_padding+j}),c},increaseBrightness:function(a,b){a=a.replace(/^\s*#|\s*$/g,""),3===a.length&&(a=a.replace(/(.)/g,"$1$1"));var c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=parseInt(a.substr(4,2),16);return"#"+(0|256+c+(256-c)*b/100).toString(16).substr(1)+(0|256+d+(256-d)*b/100).toString(16).substr(1)+(0|256+e+(256-e)*b/100).toString(16).substr(1)}}}(window),function(a){"use strict";{var b=a.Backbone;a.Rkns.Router=b.Router.extend({routes:{"":"index"},index:function(a){var b={};null!==a&&a.split("&").forEach(function(a){var c=a.split("=");b[c[0]]=decodeURIComponent(c[1])}),this.trigger("router",b)}})}}(window),function(a){"use strict";var b=a.Rkns.DataLoader={converters:{from1to2:function(a){var b,c;if("undefined"!=typeof a.nodes)for(b=0,c=a.nodes.length;c>b;b++){var d=a.nodes[b];d.style=d.color?{color:d.color}:{}}if("undefined"!=typeof a.edges)for(b=0,c=a.edges.length;c>b;b++){var e=a.edges[b];e.style=e.color?{color:e.color}:{}}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);a[b]="undefined"==typeof f&&"undefined"!=typeof e?e: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,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_title:!0,show_node_editor_description:!0,show_node_editor_description_richtext:!0,show_node_editor_title_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é)","<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(){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(){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(){$(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,"<span class='searchmatch'>$1</span>")}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="<li><h3>Tags</h3></li>",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+="<li><h3>Annotations</h3></li>",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(),"<span class='searchmatch'>$1</span>")}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,"<span class='searchmatch'>$1</span>")}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(),"<span class='searchmatch'>$1</span>")}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.$("<div>").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){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(){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){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(){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(){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){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('<div class="Rk-Label">').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<this.all_buttons.length;d++)this.all_buttons[d].source_representation=this;this.active_buttons=[]}else this.active_buttons=this.all_buttons=[];this.last_circle_radius=1,this.renderer.minimap&&(this.renderer.minimap.node_layer.activate(),this.minimap_circle=new paper.Path.Circle([0,0],1),this.minimap_circle.__representation=this.renderer.minimap.miniframe.__representation,this.renderer.minimap.node_group.addChild(this.minimap_circle))},_getStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.node_stroke_width+(a-1)*(this.options.node_stroke_max_width-this.options.node_stroke_width)/(this.options.node_stroke_witdh_scale-1)},_getSelectedStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.selected_node_stroke_width+(a-1)*(this.options.selected_node_stroke_max_width-this.options.selected_node_stroke_width)/(this.options.node_stroke_witdh_scale-1)},buildShape:function(){"shape"in this.model.changed&&delete this.img,this.circle&&(this.circle.remove(),delete this.circle),this.shapeBuilder=new e(this.model.get("shape")),this.circle=this.shapeBuilder.getShape(),this.circle.__representation=this,this.circle.sendToBack(),this.last_circle_radius=1},redraw:function(a){"shape"in this.model.changed&&"change"in a&&a.change&&this.buildShape();var c=new paper.Point(this.model.get("position")),d=this.options.node_size_base*Math.exp((this.model.get("size")||0)*f._NODE_SIZE_STEP);this.is_dragging&&this.paper_coords||(this.paper_coords=this.renderer.toPaperCoords(c)),this.circle_radius=d*this.renderer.view.scale,this.last_circle_radius!==this.circle_radius&&(this.all_buttons.forEach(function(a){a.setSectorSize()}),this.circle.scale(this.circle_radius/this.last_circle_radius),this.node_image&&this.node_image.scale(this.circle_radius/this.last_circle_radius)),this.circle.position=this.paper_coords,this.node_image&&(this.node_image.position=this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius))),this.last_circle_radius=this.circle_radius;var e=this.active_buttons,g=1;this.model.get("delete_scheduled")?(g=.5,this.active_buttons=this.pending_delete_buttons,this.circle.dashArray=[2,2]):(g=1,this.active_buttons=this.normal_buttons,this.circle.dashArray=null),this.selected&&this.renderer.isEditable()&&!this.ghost&&(e!==this.active_buttons&&e.forEach(function(a){a.hide()}),this.active_buttons.forEach(function(a){a.show()})),this.node_image&&(this.node_image.opacity=this.highlighted?.5*g:g-.01),this.circle.fillColor=this.highlighted?this.options.highlighted_node_fill_color:this.options.node_fill_color,this.circle.opacity=this.options.show_node_circles?g:.01;var h=this.model.get("title")||this.renkan.translate(this.options.label_untitled_nodes)||"";h=f.shortenText(h,this.options.node_label_max_length),"object"==typeof this.highlighted?this.title.html(this.highlighted.replace(b(h).escape(),'<span class="Rk-Highlighted">$1</span>')):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){var b=q.renderer.getRepresentationByModel(a);b&&"undefined"!=typeof b.from_representation&&"undefined"!=typeof b.from_representation.paper_coords&&"undefined"!=typeof b.to_representation&&"undefined"!=typeof b.to_representation.paper_coords&&b.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){var c=a.renderer.getRepresentationByModel(b);c&&"undefined"!=typeof c.from_representation&&"undefined"!=typeof c.from_representation.paper_coords&&"undefined"!=typeof c.to_representation&&"undefined"!=typeof c.to_representation.paper_coords&&c.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){var b=c.renderer.getRepresentationByModel(a);b&&"undefined"!=typeof b.from_representation&&"undefined"!=typeof b.from_representation.paper_coords&&"undefined"!=typeof b.to_representation&&"undefined"!=typeof b.to_representation.paper_coords&&b.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){var c=a.renderer.getRepresentationByModel(b.get("to"));c&&c.ghost&&c.hide()})},showNeighbors:function(a){var c=this;b.each(this.project.get("edges").filter(function(a){return a.get("from")===c.model}),function(b){var d=c.renderer.getRepresentationByModel(b.get("to"));if(d&&d.hidden&&(d.show(a),!a)){var e=c.renderer.view.hiddenNodes.indexOf(d.model.id);-1!==e&&c.renderer.view.hiddenNodes.splice(e,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(){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){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('<div class="Rk-Label Rk-Edge-Label">').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;d<this.all_buttons.length;d++)this.all_buttons[d].source_representation=this;this.active_buttons=[]}else this.active_buttons=this.all_buttons=[];this.renderer.minimap&&(this.renderer.minimap.edge_layer.activate(),this.minimap_line=new paper.Path,this.minimap_line.add([0,0],[0,0]),this.minimap_line.__representation=this.renderer.minimap.miniframe.__representation,this.minimap_line.strokeWidth=1)},_getStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.edge_stroke_width+(a-1)*(this.options.edge_stroke_max_width-this.options.edge_stroke_width)/(this.options.edge_stroke_witdh_scale-1)},_getSelectedStrokeWidth:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return this.options.selected_edge_stroke_width+(a-1)*(this.options.selected_edge_stroke_max_width-this.options.selected_edge_stroke_width)/(this.options.edge_stroke_witdh_scale-1)},_getArrowScale:function(){var a=this.model.has("style")&&this.model.get("style").thickness||1;return 1+(a-1)*(this.options.edge_arrow_max_width/this.options.edge_arrow_width-1)/(this.options.edge_stroke_witdh_scale-1)},redraw:function(){var a=this.model.get("from"),b=this.model.get("to");if(a&&b&&(!this.hidden||this.ghost)){if(this.from_representation=this.renderer.getRepresentationByModel(a),this.to_representation=this.renderer.getRepresentationByModel(b),"undefined"==typeof this.from_representation||"undefined"==typeof this.to_representation||this.from_representation.hidden&&!this.from_representation.ghost||this.to_representation.hidden&&!this.to_representation.ghost)return void this.hide();var c,d=this._getStrokeWidth(),f=this._getArrowScale(),g=this.from_representation.paper_coords,h=this.to_representation.paper_coords,i=h.subtract(g),j=i.length,k=i.divide(j),l=new paper.Point([-k.y,k.x]),m=this.bundle.getPosition(this),n=l.multiply(this.options.edge_gap_in_bundles*m),o=g.add(n),p=h.add(n),q=i.angle,r=l.multiply(this.options.edge_label_distance+.5*f*this.options.edge_arrow_width),s=i.divide(3),t=this.model.has("style")&&this.model.get("style").color||(this.model.get("created_by")||e._USER_PLACEHOLDER(this.renkan)).get("color"),u=this.model.has("style")&&this.model.get("style").dash?this.options.default_dash_array:null;this.model.get("delete_scheduled")||this.from_representation.model.get("delete_scheduled")||this.to_representation.model.get("delete_scheduled")?(c=.5,this.line.dashArray=[2,2]):(c=this.ghost?this.options.ghost_opacity:1,this.line.dashArray=null);var v=this.active_buttons;this.arrow.visible=this.model.has("style")&&this.model.get("style").arrow||!this.model.has("style")||"undefined"==typeof this.model.get("style").arrow,this.active_buttons=this.model.get("delete_scheduled")?this.pending_delete_buttons:this.normal_buttons,this.selected&&this.renderer.isEditable()&&v!==this.active_buttons&&(v.forEach(function(a){a.hide()}),this.active_buttons.forEach(function(a){a.show()})),this.paper_coords=o.add(p).divide(2),this.line.strokeWidth=d,this.line.strokeColor=t,this.line.dashArray=u,this.line.opacity=c,this.line.segments[0].point=g,this.line.segments[1].point=this.paper_coords,this.line.segments[1].handleIn=s.multiply(-1),this.line.segments[1].handleOut=s,this.line.segments[2].point=h,this.arrow.scale(f/this.arrow_scale),this.arrow_scale=f,this.arrow.fillColor=t,this.arrow.opacity=c,this.arrow.rotate(q-this.arrow_angle,this.arrow.bounds.center),this.arrow.position=this.paper_coords,this.arrow_angle=q,q>90&&(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){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){var b=paper.project.hitTest(a.point),c=this.from_representation.model,d=!0;if(b&&"undefined"!=typeof b.item.__representation){var f=b.item.__representation;if("Node"===f.type.substr(0,4)){var g=f.model||f.source_representation.model;if(c!==g){var h={id:e.getUID("edge"),created_by:this.renkan.current_user,from:c,to:g};this.renderer.isEditable()&&this.project.addEdge(h)}}(c===f.model||f.source_representation&&f.source_representation.model===c)&&(d=!1,this.renderer.is_dragging=!0)}d&&(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){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("<div>").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){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=j.options.show_node_editor_title_richtext?a(".Rk-Edit-Title").ckeditor(j.options.richtext_editor_config):!1,m=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()}if(j.options.show_node_editor_title_richtext&&"undefined"!=typeof l.editor){var b=l.editor;delete l.editor,b.focusManager.blur(!0),b.destroy()}},this.editor_$.find(".Rk-CloseX").click(function(a){a.preventDefault(),m()}),this.editor_$.find(".Rk-Edit-Goto").click(function(){return c.get("uri")?void 0:!1}),this.renderer.isEditable()){var n=b.throttle(function(){b.defer(function(){if(j.renderer.isEditable()){var a={};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_title&&(j.options.show_node_editor_title_richtext?"undefined"!=typeof l.editor&&l.editor.checkDirty()&&(a.title=l.editor.getData(),l.editor.resetDirty()):a.title=j.editor_$.find(".Rk-Edit-Title").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 m()})},1e3);this.editor_$.on("keyup",function(a){27===a.keyCode&&m()}),this.editor_$.find("input, textarea, select").on("change keyup paste",n),j.options.show_node_editor_description&&j.options.show_node_editor_description_richtext&&"undefined"!=typeof k.editor&&(k.editor.on("change",n),k.editor.on("blur",n)),j.options.show_node_editor_title&&j.options.show_node_editor_title_richtext&&"undefined"!=typeof l.editor&&(l.editor.on("change",n),l.editor.on("blur",n)),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),n()},b.readAsDataURL(a)}}),this.editor_$.find(".Rk-Edit-Title")[0].focus();var o=j.editor_$.find(".Rk-Edit-ColorPicker");this.editor_$.find(".Rk-Edit-ColorPicker-Wrapper").hover(function(a){a.preventDefault(),o.show()},function(a){a.preventDefault(),o.hide()}),o.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")})),o.hide(),paper.view.draw()):m()});var p=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 m()};this.editor_$.find("#Rk-Edit-Size-Down").click(function(){return p(-1),!1}),this.editor_$.find("#Rk-Edit-Size-Up").click(function(){return p(1),!1});var q=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 m()};this.editor_$.find("#Rk-Edit-Thickness-Down").click(function(){return q(-1),!1}),this.editor_$.find("#Rk-Edit-Thickness-Up").click(function(){return q(1),!1}),this.editor_$.find(".Rk-Edit-Image-Del").click(function(){return j.editor_$.find(".Rk-Edit-Image").val(""),n(),!1})}else if("object"==typeof this.source_representation.highlighted){var r=this.source_representation.highlighted.replace(b(c.get("title")).escape(),'<span class="Rk-Highlighted">$1</span>');this.editor_$.find(".Rk-Display-Title"+(c.get("uri")?" a":"")).html(r),this.options.show_node_tooltip_description&&this.editor_$.find(".Rk-Display-Description").html(this.source_representation.highlighted.replace(b(c.get("description")).escape(),'<span class="Rk-Highlighted">$1</span>'))}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){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){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){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){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){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){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){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){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){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)}}}).value(),f}),define("renderer/nodeenlargebutton",["jquery","underscore","requtils","renderer/nodebutton"],function(a,b,c,d){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){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){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){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){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){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(){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){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"),this.editor_$=c.options.popup_editor?this.$.find(".Rk-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-_lastTap<f._DOUBLETAP_DELAY&&Math.pow(j-b.pageX,2)+Math.pow(k-b.pageY,2)<f._DOUBLETAP_DISTANCE?(_lastTap=0,d.onDoubleClick(b)):(_lastTap=new Date,j=b.pageX,k=b.pageY,h=d.view.scale,i=!1,d.onMouseDown(b,!0))},touchmove:function(a){if(a.preventDefault(),_lastTap=0,1===a.originalEvent.touches.length)d.onMouseMove(a.originalEvent.touches[0],!0);else{if(i||(d.onMouseUp(a.originalEvent.touches[0],!0),d.click_target=null,d.is_dragging=!1,i=!0),"undefined"===a.originalEvent.scale)return;var b=a.originalEvent.scale*h,c=b/d.view.scale,e=new paper.Point([d.canvas_$.width(),d.canvas_$.height()]).multiply(.5*(1-c)).add(d.view.offset.multiply(c));d.view.setScale(b,e)}},touchend:function(a){a.preventDefault(),d.onMouseUp(a.originalEvent.changedTouches[0],!0)},dblclick:function(a){a.preventDefault(),c.options.allow_double_click&&d.onDoubleClick(a)},mouseleave:function(a){a.preventDefault(),d.click_target=null,d.is_dragging=!1},dragover:function(a){a.preventDefault()},dragenter:function(a){a.preventDefault(),g=!1},dragleave:function(a){a.preventDefault(),g=!0},drop:function(a){a.preventDefault(),g=!0;var c={};b.each(a.originalEvent.dataTransfer.types,function(b){try{c[b]=a.originalEvent.dataTransfer.getData(b)}catch(d){}});var e=a.originalEvent.dataTransfer.getData("Text");if("string"==typeof e)switch(e[0]){case"{":case"[":try{var f=JSON.parse(e);b.extend(c,f)}catch(h){c["text/plain"]||(c["text/plain"]=e)}break;case"<":c["text/html"]||(c["text/html"]=e);break;default:c["text/plain"]||(c["text/plain"]=e)}var i=a.originalEvent.dataTransfer.getData("URL");i&&!c["text/uri-list"]&&(c["text/uri-list"]=i),d.dropData(c,a.originalEvent)}});var m=function(a,b){d.$.find(a).click(function(a){return d[b](a),!1})};this.renkan.project.get("views").length>0&&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(){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},K.paragraphStyle.justification=H>2?"left":-2>H?"right":"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('<li class="Rk-User"><span class="Rk-UserColor" style="background:<%=background%>;"></span><%=name%></li>'),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("<unknown user>")),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("<input>").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(){b.each(this.representations,function(a){a.unhighlight()})},unselectAll:function(){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("<div>").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("<div>").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("<div>").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("<div>").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;k<j.length;k++){var l=j[k];(b["text/x-iri-"+l]||b[l])&&(c[l]=b["text/x-iri-"+l]||b[l]),("none"===c[l]||"null"===c[l])&&(c[l]=void 0)}return"function"==typeof this.renkan.options.drop_enhancer&&(c=this.renkan.options.drop_enhancer(c,b)),c},dropData:function(a,c){if(this.isEditable()){if(a["text/json"]||a["application/json"])try{var d=JSON.parse(a["text/json"]||a["application/json"]);b.extend(a,d)}catch(e){}var g="undefined"==typeof this.renkan.options.drop_handler?this.defaultDropHandler(a):this.renkan.options.drop_handler(a),h=this.canvas_$.offset(),i=new paper.Point([c.pageX-h.left,c.pageY-h.top]),j=this.toModelCoords(i),k={id:f.getUID("node"),created_by:this.renkan.current_user,uri:g.uri||"",title:g.title||"",description:g.description||"",image:g.image||"",color:g.color||void 0,clip_path:g.clipPath||void 0,position:{x:j.x,y:j.y}},l=this.renkan.project.addNode(k),m=this.getRepresentationByModel(l);"drop"===c.type&&m.openEditor()}},fullScreen:function(){var a,b=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen,c=this.renkan.$[0],d=["requestFullScreen","mozRequestFullScreen","webkitRequestFullScreen"],e=["cancelFullScreen","mozCancelFullScreen","webkitCancelFullScreen"];if(b){for(a=0;a<e.length;a++)if("function"==typeof document[e[a]]){document[e[a]]();break}var f=this.$.width(),g=this.$.height();this.renkan.options.show_top_bar&&(g-=this.$.find(".Rk-TopBar").height()),this.renkan.options.show_bins&&this.renkan.$.find(".Rk-Bins").position().left>0&&(f-=this.renkan.$.find(".Rk-Bins").width()),paper.view.viewSize=new paper.Size([f,g])}else{for(a=0;a<d.length;a++)if("function"==typeof c[d[a]]){c[d[a]]();break}this.redraw()}},addNodeBtn:function(){return this.click_mode===f._CLICKMODE_ADDNODE?(this.click_mode=!1,this.notif_$.hide()):(this.click_mode=f._CLICKMODE_ADDNODE,this.notif_$.text(this.renkan.translate("Click on the background canvas to add a node")).fadeIn()),!1},addEdgeBtn:function(){return this.click_mode===f._CLICKMODE_STARTEDGE||this.click_mode===f._CLICKMODE_ENDEDGE?(this.click_mode=!1,this.notif_$.hide()):(this.click_mode=f._CLICKMODE_STARTEDGE,this.notif_$.text(this.renkan.translate("Click on a first node to start the edge")).fadeIn()),!1},exportProject:function(){var a=this.renkan.project.toJSON(),d=(document.createElement("a"),a.id),e=d+".json";delete a.id,delete a._id,delete a.space_id;var g,h,i={};b.each(a.nodes,function(a){g=a.id||a._id,delete a._id,delete a.id,i[g]=a["@id"]=f.getUUID4()}),b.each(a.edges,function(a){delete a._id,delete a.id,a.to=i[a.to],a.from=i[a.from]}),b.each(a.views,function(a){delete a._id,delete a.id,a.hidden_nodes&&(h=a.hidden_nodes,a.hidden_nodes=[],b.each(h,function(b){a.hidden_nodes.push(i[b])}))}),a.users=[];var j=JSON.stringify(a,null,2),k=new Blob([j],{type:"application/json;charset=utf-8"});c(k,e)},parameters:function(b){if(a.isEmptyObject(b))return this.view=this.addRepresentation("View",this.renkan.project.get("views").first()),void this.view.autoScale();if("undefined"!=typeof b.idView&&"undefined"!=typeof this.renkan.project.get("views").at(b.idView)&&(this.view=this.addRepresentation("View",this.renkan.project.get("views").at(b.idView))),"undefined"!=typeof b.view&&b.view.split(",").length>=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").first()),this.view.autoScale()),this.unhighlightAll(),"undefined"!=typeof b.idNode&&this.highlightModel(this.renkan.project.get("nodes").get(b.idNode))},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()<c.height()?e:e-c.width(),b.html("&laquo;")):(c.animate({left:-300},250),this.$.animate({left:0},250,function(){var a=d.$.width();paper.view.viewSize=new paper.Size([a,d.canvas_$.height()])}),a=e+300,b.html("&raquo;")),d.view.resizeZoom(1,1,a/e)},save:function(){},open:function(){}}).value(),g}),define("renderer/viewrepr",["jquery","underscore","requtils","renderer/baserepresentation"],function(a,b,c,d){var e=c.getUtils(),f=e.inherit(d);return b(f.prototype).extend({_init:function(){var b=this;this.$=a(".Rk-Render"),this.type="View",this.hiddenNodes=[],this.scale=1,this.initialScale=1,this.offset=paper.view.center,this.params={},this.model&&(this.params={zoom_level:b.model.get("zoom_level"),offset:b.model.get("offset"),hidden_nodes:b.model.get("hidden_nodes")}),this.init();var c=function(a,c){b.$.find(a).click(function(a){return b[c](a),!1})};c(".Rk-ZoomOut","zoomOut"),c(".Rk-ZoomIn","zoomIn"),c(".Rk-ZoomFit","autoScale"),this.$.find(".Rk-ZoomSave").click(function(){var a={x:b.offset.x,y:b.offset.y};b.model&&b.renkan.project.get("views").indexOf(b.model)>0?b.model.set({zoom_level:b.scale,offset:a,hidden_nodes:b.hiddenNodes.concat()}):b.model=b.renkan.project.addView({zoom_level:b.scale,offset:a,hidden_nodes:b.hiddenNodes.concat()}),b.params={zoom_level:b.model.get("zoom_level"),offset:b.model.get("offset"),hidden_nodes:b.model.get("hidden_nodes")},b.updateUrl()}),this.$.find(".Rk-ZoomSetSaved").click(function(){b.setScale(b.params.zoom_level,new paper.Point(b.params.offset)),b.showNodes(!1),b.options.hide_nodes&&(b.hiddenNodes=(b.params.hidden_nodes||[]).concat(),b.hideNodes())}),this.$.find(".Rk-ShowHiddenNodes").mouseenter(function(){b.showNodes(!0),b.$.find(".Rk-ShowHiddenNodes").mouseleave(function(){b.hideNodes()})}),this.$.find(".Rk-ShowHiddenNodes").click(function(){b.showNodes(!1),b.$.find(".Rk-ShowHiddenNodes").off("mouseleave")}),this.renkan.project.get("views").length>0&&this.renkan.options.save_view&&this.$.find(".Rk-ZoomSetSaved").show()},redraw:function(){},init:function(){var a=this;a.setScale(a.params.zoom_level,new paper.Point(a.params.offset)),a.showNodes(!1),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.initialScale<e._MAX_SCALE&&(this.scale=a,b&&(this.offset=b),this.renderer.redraw(),this.updateUrl())},zoomOut:function(){var a=this.scale*Math.SQRT1_2,b=new paper.Point([this.renderer.canvas_$.width(),this.renderer.canvas_$.height()]).multiply(.5*(1-Math.SQRT1_2)).add(this.offset.multiply(Math.SQRT1_2));this.setScale(a,b)},zoomIn:function(){var a=this.scale*Math.SQRT2,b=new paper.Point([this.renderer.canvas_$.width(),this.renderer.canvas_$.height()]).multiply(.5*(1-Math.SQRT2)).add(this.offset.multiply(Math.SQRT2));this.setScale(a,b)},resizeZoom:function(a,b,c){var d=this.scale*c,e=new paper.Point([this.offset.x*a,this.offset.y*b]);this.setScale(d,e)},autoScale:function(a){var b=this.renkan.project.get("nodes");if(b.length>1){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.idView=this.renkan.project.get("views").indexOf(this.model):b.idView&&delete b.idView,this.renkan.router.navigate("?"+decodeURIComponent(a.param(b)),{trigger:!1,replace:!0})}}}).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){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
--- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.min.map	Tue Sep 15 12:24:58 2015 +0200
+++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.min.map	Tue Sep 15 17:08:53 2015 +0200
@@ -1,1 +1,1 @@
-{"version":3,"file":"renkan.min.js","sources":["templates.js","../../js/main.js","../../js/router.js","../../js/dataloader.js","../../js/models.js","../../js/defaults.js","../../js/i18n.js","../../js/full-json.js","../../js/save-once.js","../../js/ldtjson-bin.js","../../js/list-bin.js","../../js/wikipedia-bin.js","paper-renderer.js"],"names":["this","obj","__t","__p","_","escape","__e","Array","prototype","join","renkan","translate","edge","title","options","show_edge_editor_uri","uri","properties","length","each","ontology","label","property","show_edge_editor_style","show_edge_editor_style_color","show_edge_editor_style_dash","dash","show_edge_editor_style_thickness","thickness","show_edge_editor_style_arrow","arrow","show_edge_editor_direction","show_edge_editor_nodes","from_color","shortenText","from_title","to_title","show_edge_editor_creator","has_creator","created_by_title","show_edge_tooltip_color","color","show_edge_tooltip_uri","short_uri","show_edge_tooltip_nodes","to_color","show_edge_tooltip_creator","created_by_color","Rkns","Utils","getFullURL","image","description","static_url","url","show_bins","show_editor","node","show_node_editor_uri","change_types","types","type","charAt","toUpperCase","substring","show_node_editor_description","show_node_editor_description_richtext","show_node_editor_size","size","show_node_editor_style","show_node_editor_style_color","show_node_editor_style_dash","show_node_editor_style_thickness","show_node_editor_image","image_placeholder","clip_path","allow_image_upload","show_node_editor_creator","change_shapes","shapes","shape","show_node_tooltip_color","show_node_tooltip_uri","show_node_tooltip_description","show_node_tooltip_image","show_node_tooltip_creator","_id","print","__j","call","arguments","show_top_bar","editor_mode","project","get","show_user_list","show_user_color","user_color_editable","colorPicker","home_button_url","home_button_title","show_fullscreen_button","show_addnode_button","show_addedge_button","show_export_button","show_save_button","show_open_button","show_bookmarklet","show_search_field","resize","show_zoom","save_view","hide_nodes","root","$","jQuery","pickerColors","__renkans","_BaseBin","_renkan","_opts","find","hide","addClass","appendTo","title_icon_$","_this","attr","href","html","click","destroy","slideDown","resizeBins","refresh","count_$","title_$","main_$","auto_refresh","window","setInterval","detach","Renkan","push","defaults","templates","renkanJST","node_editor_templates","template","types_templates","value","key","property_files","f","getJSON","data","concat","read_only","router","Router","Models","Project","dataloader","DataLoader","Loader","setCurrentUser","user_id","user_name","addUser","current_user","renderer","redrawUsers","container","tabs","search_engines","current_user_list","UsersList","on","_tmpl","map","c","Renderer","Scene","search","_select","_input","_form","_search","_key","Search","getSearchTitle","className","getBgClass","_el","setSearchEngine","submit","val","search_engine","mouseenter","mouseleave","bins","_bin","Bin","elementDropped","_mainDiv","siblings","is","slideUp","_e","_t","_models","where","_model","highlightModel","mouseout","unhighlightAll","e","dragDrop","err","preventDefault","touch","originalEvent","changedTouches","off","canvas_$","offset","w","width","h","height","pageX","left","pageY","top","onMouseMove","div","document","createElement","appendChild","cloneNode","dropData","text/html","innerHTML","onMouseDown","onMouseUp","dataTransfer","setData","lastsearch","lastval","regexpFromTextOrArray","source","tab","render","_text","i18n","language","substr","onStatusChange","listClasses","split","classes","i","_d","outerHeight","css","getUUID4","replace","r","Math","random","v","toString","getUID","pad","n","Date","ID_AUTO_INCREMENT","ID_BASE","getUTCFullYear","getUTCMonth","getUTCDate","_base","_n","_uidbase","test","img","Image","src","res","inherit","_baseClass","_callbefore","_class","_arg","apply","slice","_init","_initialized","extend","replaceText","makeReplaceFunc","l","k","charsrx","txt","toLowerCase","remrx","j","remsrc","charsub","getSource","inp","removeChars","String","fromCharCode","RegExp","_textOrArray","testrx","replacerx","isempty","_replace","text","_MIN_DRAG_DISTANCE","_NODE_BUTTON_WIDTH","_EDGE_BUTTON_INNER","_EDGE_BUTTON_OUTER","_CLICKMODE_ADDNODE","_CLICKMODE_STARTEDGE","_CLICKMODE_ENDEDGE","_NODE_SIZE_STEP","LN2","_MIN_SCALE","_MAX_SCALE","_MOUSEMOVE_RATE","_DOUBLETAP_DELAY","_DOUBLETAP_DISTANCE","_USER_PLACEHOLDER","default_user_color","_BOOKMARKLET_CODE","_maxlength","drawEditBox","_options","_coords","_path","_xmargin","_selector","tooltip_width","tooltip_padding","_height","_isLeft","x","paper","view","center","_left","tooltip_arrow_length","_right","_top","y","tooltip_margin","max","tooltip_arrow_width","min","_bottom","segments","point","add","closed","fillColor","GradientColor","Gradient","tooltip_top_color","tooltip_bottom_color","increaseBrightness","hex","percent","parseInt","g","b","Backbone","routes","index","parameters","result","forEach","part","item","decodeURIComponent","trigger","converters","from1to2","len","nodes","style","edges","schema_version","dataConverters","convert","schemaVersionFrom","getSchemaVersion","schemaVersionTo","converterName","load","set","validate","guid","RenkanModel","RelationalModel","idAttribute","constructor","id","prepare","addReference","_propName","_list","_default","_element","User","toJSON","Node","relations","HasOne","relatedModel","created_by","position","Edge","from","to","View","isArray","zoom_level","hidden_nodes","RosterUser","blacklist","HasMany","reverseRelation","includeInJSON","_props","_user","findOrCreate","addNode","_node","addEdge","_edge","addView","_view","removeNode","remove","removeEdge","_project","users","views","_item","t","version","initialize","filter","json","clone","attributes","Model","Collection","omit","site_id","model","navigator","userLanguage","popup_editor","editor_panel","manual_save","size_bug_fix","force_resize","allow_double_click","zoom_on_scroll","element_delete_delay","autoscale_padding","default_view","user_name_editable","show_minimap","minimap_width","minimap_height","minimap_padding","minimap_background_color","minimap_border_color","minimap_highlight_color","minimap_highlight_weight","buttons_background","buttons_label_color","buttons_label_font_size","ghost_opacity","default_dash_array","show_node_circles","clip_node_images","node_images_fill_mode","node_size_base","node_stroke_width","node_stroke_max_width","selected_node_stroke_width","selected_node_stroke_max_width","node_stroke_witdh_scale","node_fill_color","highlighted_node_fill_color","node_label_distance","node_label_max_length","label_untitled_nodes","default","video","edge_stroke_width","edge_stroke_max_width","selected_edge_stroke_width","selected_edge_stroke_max_width","edge_stroke_witdh_scale","edge_label_distance","edge_label_max_length","edge_arrow_length","edge_arrow_width","edge_arrow_max_width","edge_gap_in_bundles","label_untitled_edges","tooltip_border_color","tooltip_border_width","richtext_editor_config","toolbarGroups","name","groups","removePlugins","uploaded_image_max_kb","fr","Edit Node","Edit Edge","Title:","URI:","Description:","From:","To:","Image URL:","Choose Image File:","Full Screen","Add Node","Add Edge","Save Project","Open Project","Auto-save enabled","Connection lost","Created by:","Zoom In","Zoom Out","Edit","Remove","Cancel deletion","Link to another node","Enlarge","Shrink","Click on the background canvas to add a node","Click on a first node to start the edge","Click on a second node to complete the edge","Wikipedia","Wikipedia in ","French","English","Japanese","Untitled project","Lignes de Temps","Loading, please wait","Edge color:","Dash:","Thickness:","Arrow:","Node color:","Choose color","Change edge direction","Do you really wish to remove node ","Do you really wish to remove edge ","This file is not an image","Image size must be under ","Size:","KB","Choose from vocabulary:","SKOS Documentation properties","has note","has example","has definition","SKOS Semantic relations","has broader","has narrower","has related","Dublin Core Metadata","has contributor","covers","created by","has date","published by","has source","has subject","Dragged resource","Search the Web","Search in Bins","Close bin","Refresh bin","(untitled)","Select contents:","Drag items from this website, drop them in 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.","Shapes available","Circle","Square","Diamond","Hexagone","Ellipse","Star","Cloud","Triangle","Zoom Fit","Download Project","Save view","View saved view","Renkan 'Drag-to-Add' bookmarklet","(unknown user)","<unknown user>","Search in graph","Search in ","jsonIO","_proj","http_method","_load","redrawActive","loadingStatus","_data","saveStatus","fixSize","_save","ajax","contentType","JSON","stringify","success","textStatus","jqXHR","_thrSave","throttle","setTimeout","changedAttributes","hasChanged","jsonIOSaveOnClick","_saveWarn","_onLeave","getdata","rx","matches","location","hash","match","beforeSend","autoScale","_checkLeave","removeClass","save","hasClass","Ldt","ProjectBin","ldt_type","Resclass","console","error","tagTemplate","annotationTemplate","proj_id","project_id","ldt_platform","searchbase","highlight","convertTC","_ms","_res","_totalSeconds","abs","floor","_hours","_minutes","_seconds","_html","_projtitle","meta","count","tags","_tag","_title","htitle","encodedtitle","encodeURIComponent","annotations","_annotation","_description","content","_duration","end","begin","_img","hdescription","start","duration","mediaid","media","annotationid","show","dataType","lang","_q","ResultsBin","segmentTemplate","max_results","highlightrx","objects","_segment","_begin","start_ts","_end","iri_id","element_id","format","q","limit","ResourceList","resultTemplate","list","trim","_match","langs","en","ja","query","_result","encodeURI","snippet","define","_BaseRepresentation","_renderer","_changeBinding","redraw","change","_removeBinding","removeRepresentation","defer","_selectBinding","select","_unselectBinding","unselect","_super","_func","moveTo","unhighlight","mousedown","mouseup","getUtils","getRenderer","requtils","BaseRepresentation","_BaseButton","_pos","sector","_newTarget","source_representation","cloud_path","builders","circle","getShape","Path","getImageShape","radius","rectangle","Rectangle","ellipse","polygon","RegularPolygon","diamond","d","SQRT2","rotate","star","cloud","path","scale","triangle","svg","ShapeBuilder","NodeRepr","node_layer","activate","buildShape","hidden","ghost","strokeWidth","h_ratio","labels_$","normal_buttons","NodeEditButton","NodeRemoveButton","NodeLinkButton","NodeEnlargeButton","NodeShrinkButton","NodeHideButton","NodeShowButton","pending_delete_buttons","NodeRevertButton","all_buttons","active_buttons","last_circle_radius","minimap","minimap_circle","__representation","miniframe","node_group","addChild","_getStrokeWidth","has","_getSelectedStrokeWidth","changed","shapeBuilder","sendToBack","_model_coords","Point","_baseRadius","exp","is_dragging","paper_coords","toPaperCoords","circle_radius","setSectorSize","node_image","subtract","image_delta","multiply","old_act_btn","opacity","dashArray","selected","isEditable","highlighted","_strokeWidth","_color","_dash","strokeColor","_pc","lastImage","showImage","minipos","toMinimapCoords","miniradius","minisize","Size","fitBounds","dontRedrawEdges","ed","repr","getRepresentationByModel","from_representation","to_representation","_image","image_cache","clipPath","hasClipPath","_clip","baseRadius","centerPoint","instructions","lastCoords","minX","Infinity","minY","maxX","maxY","transformCoords","tabc","relative","newCoords","parseFloat","isY","instr","coords","lineTo","cubicCurveTo","quadraticCurveTo","_raster","Raster","locked","Group","clipped","_circleClip","divide","insertAbove","paperShift","_delta","openEditor","removeRepresentationsOfType","_editor","addRepresentation","draw","_uri","showNeighbors","hideButtons","buttons_timeout","undefined","hideNeighbors","indexNode","hiddenNodes","indexOf","splice","textToReplace","hlvalue","throttledPaperDraw","saveCoords","toModelCoords","_event","_isTouch","unselectAll","click_target","edge_layer","bundle","addToBundles","line","arrow_scale","pivot","arrow_angle","EdgeEditButton","EdgeRemoveButton","EdgeRevertButton","minimap_line","_getArrowScale","_opacity","_arrow_scale","_p0a","_p1a","_v","_r","_u","_ortho","_group_pos","getPosition","_p0b","_p1b","_a","angle","_textdelta","_handle","visible","handleIn","handleOut","bounds","_textpos","transform","-moz-transform","-webkit-transform","text_angle","reject","TempEdge","_p0","_p1","end_pos","_c","_hitResult","hitTest","findTarget","_endDrag","_target","_destmodel","_BaseEditor","buttons_layer","editor_block","_pts","range","editor_$","BaseEditor","NodeEditor","readOnlyTemplate","_created_by","_template","_image_placeholder","_size","keys","editorInstance","ckeditor","closeEditor","cleanEditor","editor","focusManager","blur","onFieldChange","checkDirty","getData","resetDirty","assign","keyCode","files","FileReader","alert","onload","target","readAsDataURL","focus","_picker","hover","shiftSize","_newsize","shiftThickness","_oldThickness","_newThickness","titlehtml","EdgeEditor","_from_model","_to_model","BaseButton","_NodeButton","sectorInner","lastSectorInner","drawSector","startAngle","endAngle","imageName","clearTimeout","NodeButton","delid","delete_list","time","valueOf","confirm","addHiddenNode","unset","_off","_point","addTempEdge","MiniFrame","filesaver","representations","notif_$","setup","initialScale","totalScroll","mouse_down","selected_target","Layer","background_layer","topleft","bottomRight","cliprectangle","bundles","click_mode","_allowScroll","_originalScale","_zooming","_lastTapX","_lastTapY","icon_cache","imgname","throttledMouseMove","mousemove","mousewheel","onScroll","touchstart","_touches","touches","_lastTap","pow","onDoubleClick","touchmove","_newScale","_scaleRatio","_newOffset","setScale","touchend","dblclick","dragover","dragenter","dragleave","drop","parse","bindClick","selector","fname","evt","last","showNodes","hideNodes","fadeIn","delay","fadeOut","mouseover","onResize","_ratio","newWidth","newHeight","ratioH","delta","ratioW","resizeZoom","_thRedraw","addRepresentations","_thRedrawUsers","history","el","_params","_delay","$cpwrapper","$cplist","$this","rxs","_now","findWhere","delete_scheduled","rescaleMinimap","_repr","_inR","_outR","_startAngle","_endAngle","_padding","_imgname","_caption","_startRads","PI","_endRads","_startdx","sin","_startdy","cos","_startXIn","_startYIn","_startXOut","_startYOut","_enddx","_enddy","_endXIn","_endYIn","_endXOut","_endYOut","_centerR","_centerRads","_centerX","_centerY","_centerXIn","_centerXOut","_centerYIn","_centerYOut","_textX","_textY","arcTo","PointText","characterStyle","fontSize","paragraphStyle","justification","_visible","_restPos","_grp","_imgdelta","_currentPos","_edgeRepr","_bundle","_er","_dir","savebtn","tip","_offset","force_view","_xx","_yy","_minx","_miny","_maxx","_maxy","_scale","at","redrawMiniframe","bottomright","_type","RendererType","_collection","userTemplate","allUsers","models","ulistHtml","$userpanel","$name","$cpitems","$colorsquare","$input","empty","parent","background","_representation","_representations","_from","_tmpEdge","hideNode","last_point","_scrolldelta","SQRT1_2","open","defaultDropHandler","newNode","tweetdiv","_svgimgs","_svgpaths","_imgs","_as","fields","drop_enhancer","jsondata","drop_handler","_nodedata","fullScreen","_isFull","mozFullScreen","webkitIsFullScreen","_requestMethods","_cancelMethods","widthAft","heightAft","viewSize","zoomOut","zoomIn","_scaleWidth","_scaleHeight","addNodeBtn","addEdgeBtn","exportProject","projectJSON","projectId","fileNameToSaveAs","space_id","objId","idsMap","projectJSONStr","blob","Blob","idnode","foldBins","sizeAft","foldBinsButton","sizeBef","animate","require","config","paths","jquery","underscore","ckeditor-core","ckeditor-jquery","shim","deps","startRenkan"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,KAAgB,UAAIA,KAAgB,cAEpCA,KAAgB,UAAE,8BAAgC,SAASC,KAC3DA,MAAQA,OACR,IAAIC,KAAKC,IAAM,EAAUC,GAAEC,MAC3B,MAAMJ,IACNE,KAAO,oBACS,OAAdD,IAAM,GAAe,GAAKA,KAC5B,yBACgB,OAAdA,IAAM,GAAe,GAAKA,KAC5B,SAGA,OAAOC,MAGPH,KAAgB,UAAE,6BAA+B,SAASC,KAC1DA,MAAQA,OACR,IAAIC,KAAKC,IAAM,GAAIG,IAAMF,EAAEC,MAAcE,OAAMC,UAAUC,IAEzD,MAAMR,IACNE,KAAO,mDACPG,IAAII,OAAOC,UAAU,cACrB,mCACAL,IAAII,OAAOC,UAAU,WACrB,iEACAL,IAAIM,KAAKC,OACT,eACKC,QAAQC,uBACbZ,KAAO,6BACPG,IAAII,OAAOC,UAAU,SACrB,mEACAL,IAAI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sBqB,EAC/B/jB,EAASgkB,YAAc6P,EACvB7zB,EAAS8O,KAAO8W,EAChB5lB,EAASoP,KAAOA,EAChBpP,EAASqwB,SAAWA,EACpBrwB,EAASgxB,YAAcM,EACvBtxB,EAASuxB,WAAaA,EACtBvxB,EAAS0zB,WAAaA,EACtB1zB,EAAS8zB,YAAcQ,EACvBt0B,EAASsmB,eAAiBA,EAC1BtmB,EAASumB,iBAAmBA,EAC5BvmB,EAAS2mB,eAAiBA,EAC1B3mB,EAAS4mB,eAAiBA,EAC1B5mB,EAAS8mB,iBAAmBA,EAC5B9mB,EAASwmB,eAAiBA,EAC1BxmB,EAASymB,kBAAoBA,EAC7BzmB,EAAS0mB,iBAAmBA,EAC5B1mB,EAASsuB,eAAiBA,EAC1BtuB,EAASuuB,iBAAmBA,EAC5BvuB,EAASwuB,iBAAmBA,EAC5BxuB,EAASi1B,UAAYA,EACrBj1B,EAASC,MAAQA,EAEjB2iC,gBAGJngB,OAAO,gBAAiB","sourcesContent":["this[\"renkanJST\"] = this[\"renkanJST\"] || {};\n\nthis[\"renkanJST\"][\"templates/colorpicker.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li data-color=\"' +\n((__t = (c)) == null ? '' : __t) +\n'\" style=\"background: ' +\n((__t = (c)) == null ? '' : __t) +\n'\"></li>';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/edgeeditor.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>' +\n__e(renkan.translate(\"Edit Edge\")) +\n'</span>\\n</h2>\\n<p>\\n    <label>' +\n__e(renkan.translate(\"Title:\")) +\n'</label>\\n    <input class=\"Rk-Edit-Title\" type=\"text\" value=\"' +\n__e(edge.title) +\n'\" />\\n</p>\\n';\n if (options.show_edge_editor_uri) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"URI:\")) +\n'</label>\\n        <input class=\"Rk-Edit-URI\" type=\"text\" value=\"' +\n__e(edge.uri) +\n'\" />\\n        <a class=\"Rk-Edit-Goto\" href=\"' +\n__e(edge.uri) +\n'\" target=\"_blank\"></a>\\n    </p>\\n    ';\n if (options.properties.length) { ;\n__p += '\\n        <p>\\n            <label>' +\n__e(renkan.translate(\"Choose from vocabulary:\")) +\n'</label>\\n            <select class=\"Rk-Edit-Vocabulary\">\\n                ';\n _.each(options.properties, function(ontology) { ;\n__p += '\\n                    <option class=\"Rk-Edit-Vocabulary-Class\" value=\"\">\\n                        ' +\n__e( renkan.translate(ontology.label) ) +\n'\\n                    </option>\\n                    ';\n _.each(ontology.properties, function(property) { var uri = ontology[\"base-uri\"] + property.uri; ;\n__p += '\\n                        <option class=\"Rk-Edit-Vocabulary-Property\" value=\"' +\n__e( uri ) +\n'\"\\n                            ';\n if (uri === edge.uri) { ;\n__p += ' selected';\n } ;\n__p += '>\\n                            ' +\n__e( renkan.translate(property.label) ) +\n'\\n                        </option>\\n                    ';\n }) ;\n__p += '\\n                ';\n }) ;\n__p += '\\n            </select>\\n        </p>\\n';\n } } ;\n__p += '\\n';\n if (options.show_edge_editor_style) { ;\n__p += '\\n    <div class=\"Rk-Editor-p\">\\n      ';\n if (options.show_edge_editor_style_color) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-color\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Edge color:\")) +\n'</span>\\n        <div class=\"Rk-Edit-ColorPicker-Wrapper\">\\n            <span class=\"Rk-Edit-Color\" style=\"background: &lt;%-edge.color%>;\">\\n                <span class=\"Rk-Edit-ColorTip\"></span>\\n            </span>\\n            ' +\n((__t = ( renkan.colorPicker )) == null ? '' : __t) +\n'\\n            <span class=\"Rk-Edit-ColorPicker-Text\">' +\n__e( renkan.translate(\"Choose color\") ) +\n'</span>\\n        </div>\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_edge_editor_style_dash) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-dash\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Dash:\")) +\n'</span>\\n        <input type=\"checkbox\" name=\"Rk-Edit-Dash\" class=\"Rk-Edit-Dash\" ' +\n__e( edge.dash ) +\n' />\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_edge_editor_style_thickness) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-thickness\">\\n          <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Thickness:\")) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Down\">-</a>\\n          <span class=\"Rk-Edit-Size-Disp\" id=\"Rk-Edit-Thickness-Value\">' +\n__e( edge.thickness ) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Up\">+</a>\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_edge_editor_style_arrow) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-arrow\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Arrow:\")) +\n'</span>\\n        <input type=\"checkbox\" name=\"Rk-Edit-Arrow\" class=\"Rk-Edit-Arrow\" ' +\n__e( edge.arrow ) +\n' />\\n      </div>\\n      ';\n } ;\n__p += '\\n    </div>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_editor_direction) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Edit-Direction\">' +\n__e( renkan.translate(\"Change edge direction\") ) +\n'</span>\\n    </p>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_editor_nodes) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"From:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(edge.from_color) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.from_title, 25) ) +\n'\\n    </p>\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"To:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: >%-edge.to_color%>;\"></span>\\n        ' +\n__e( shortenText(edge.to_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_editor_creator && edge.has_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: &lt;%-edge.created_by_color%>;\"></span>\\n        ' +\n__e( shortenText(edge.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/edgeeditor_readonly.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>\\n    ';\n if (options.show_edge_tooltip_color) { ;\n__p += '\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.color ) +\n';\"></span>\\n    ';\n } ;\n__p += '\\n    <span class=\"Rk-Display-Title\">\\n        ';\n if (edge.uri) { ;\n__p += '\\n            <a href=\"' +\n__e(edge.uri) +\n'\" target=\"_blank\">\\n        ';\n } ;\n__p += '\\n        ' +\n__e(edge.title) +\n'\\n        ';\n if (edge.uri) { ;\n__p += ' </a> ';\n } ;\n__p += '\\n    </span>\\n</h2>\\n';\n if (options.show_edge_tooltip_uri && edge.uri) { ;\n__p += '\\n    <p class=\"Rk-Display-URI\">\\n        <a href=\"' +\n__e(edge.uri) +\n'\" target=\"_blank\">' +\n__e( edge.short_uri ) +\n'</a>\\n    </p>\\n';\n } ;\n__p += '\\n<p>' +\n((__t = (edge.description)) == null ? '' : __t) +\n'</p>\\n';\n if (options.show_edge_tooltip_nodes) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"From:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.from_color ) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.from_title, 25) ) +\n'\\n    </p>\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"To:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.to_color ) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.to_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_tooltip_creator && edge.has_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.created_by_color ) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/ldtjson-bin/annotationtemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item\" draggable=\"true\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL(image) ) +\n'\"\\n    data-uri=\"' +\n((__t = (ldt_platform)) == null ? '' : __t) +\n'ldtplatform/ldt/front/player/' +\n((__t = (mediaid)) == null ? '' : __t) +\n'/#id=' +\n((__t = (annotationid)) == null ? '' : __t) +\n'\"\\n    data-title=\"' +\n__e(title) +\n'\" data-description=\"' +\n__e(description) +\n'\">\\n\\n    <img class=\"Rk-Ldt-Annotation-Icon\" src=\"' +\n((__t = (image)) == null ? '' : __t) +\n'\" />\\n    <h4>' +\n((__t = (htitle)) == null ? '' : __t) +\n'</h4>\\n    <p>' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n    <p>Start: ' +\n((__t = (start)) == null ? '' : __t) +\n', End: ' +\n((__t = (end)) == null ? '' : __t) +\n', Duration: ' +\n((__t = (duration)) == null ? '' : __t) +\n'</p>\\n    <div class=\"Rk-Clear\"></div>\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/ldtjson-bin/segmenttemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item\" draggable=\"true\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL(image) ) +\n'\"\\n    data-uri=\"' +\n((__t = (ldt_platform)) == null ? '' : __t) +\n'ldtplatform/ldt/front/player/' +\n((__t = (mediaid)) == null ? '' : __t) +\n'/#id=' +\n((__t = (annotationid)) == null ? '' : __t) +\n'\"\\n    data-title=\"' +\n__e(title) +\n'\" data-description=\"' +\n__e(description) +\n'\">\\n\\n    <img class=\"Rk-Ldt-Annotation-Icon\" src=\"' +\n((__t = (image)) == null ? '' : __t) +\n'\" />\\n    <h4>' +\n((__t = (htitle)) == null ? '' : __t) +\n'</h4>\\n    <p>' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n    <p>Start: ' +\n((__t = (start)) == null ? '' : __t) +\n', End: ' +\n((__t = (end)) == null ? '' : __t) +\n', Duration: ' +\n((__t = (duration)) == null ? '' : __t) +\n'</p>\\n    <div class=\"Rk-Clear\"></div>\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/ldtjson-bin/tagtemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item\" draggable=\"true\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL(static_url+'img/ldt-tag.png') ) +\n'\"\\n    data-uri=\"' +\n((__t = (ldt_platform)) == null ? '' : __t) +\n'ldtplatform/ldt/front/search/?search=' +\n((__t = (encodedtitle)) == null ? '' : __t) +\n'&field=all\"\\n    data-title=\"' +\n__e(title) +\n'\" data-description=\"Tag \\'' +\n__e(title) +\n'\\'\">\\n\\n    <img class=\"Rk-Ldt-Tag-Icon\" src=\"' +\n__e(static_url) +\n'img/ldt-tag.png\" />\\n    <h4>' +\n((__t = (htitle)) == null ? '' : __t) +\n'</h4>\\n    <div class=\"Rk-Clear\"></div>\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/list-bin.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item Rk-ResourceList-Item\" draggable=\"true\"\\n    data-uri=\"' +\n__e(url) +\n'\" data-title=\"' +\n__e(title) +\n'\"\\n    data-description=\"' +\n__e(description) +\n'\"\\n    ';\n if (image) { ;\n__p += '\\n        data-image=\"' +\n__e( Rkns.Utils.getFullURL(image) ) +\n'\"\\n    ';\n } else { ;\n__p += '\\n        data-image=\"\"\\n    ';\n } ;\n__p += '\\n>';\n if (image) { ;\n__p += '\\n    <img class=\"Rk-ResourceList-Image\" src=\"' +\n__e(image) +\n'\" />\\n';\n } ;\n__p += '\\n<h4 class=\"Rk-ResourceList-Title\">\\n    ';\n if (url) { ;\n__p += '\\n        <a href=\"' +\n__e(url) +\n'\" target=\"_blank\">\\n    ';\n } ;\n__p += '\\n    ' +\n((__t = (htitle)) == null ? '' : __t) +\n'\\n    ';\n if (url) { ;\n__p += '</a>';\n } ;\n__p += '\\n    </h4>\\n    ';\n if (description) { ;\n__p += '\\n        <p class=\"Rk-ResourceList-Description\">' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n    ';\n } ;\n__p += '\\n    ';\n if (image) { ;\n__p += '\\n        <div style=\"clear: both;\"></div>\\n    ';\n } ;\n__p += '\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/main.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n\n if (options.show_bins) { ;\n__p += '\\n    <div class=\"Rk-Bins\">\\n        <div class=\"Rk-Bins-Head\">\\n            <h2 class=\"Rk-Bins-Title\">' +\n__e( translate(\"Select contents:\")) +\n'</h2>\\n            <form class=\"Rk-Web-Search-Form Rk-Search-Form\">\\n                <input class=\"Rk-Web-Search-Input Rk-Search-Input\" type=\"search\"\\n                    placeholder=\"' +\n__e( translate('Search the Web') ) +\n'\" />\\n                <div class=\"Rk-Search-Select\">\\n                    <div class=\"Rk-Search-Current\"></div>\\n                    <ul class=\"Rk-Search-List\"></ul>\\n                </div>\\n                <input type=\"submit\" value=\"\"\\n                    class=\"Rk-Web-Search-Submit Rk-Search-Submit\" title=\"' +\n__e( translate('Search the Web') ) +\n'\" />\\n            </form>\\n            <form class=\"Rk-Bins-Search-Form Rk-Search-Form\">\\n                <input class=\"Rk-Bins-Search-Input Rk-Search-Input\" type=\"search\"\\n                    placeholder=\"' +\n__e( translate('Search in Bins') ) +\n'\" /> <input\\n                    type=\"submit\" value=\"\"\\n                    class=\"Rk-Bins-Search-Submit Rk-Search-Submit\"\\n                    title=\"' +\n__e( translate('Search in Bins') ) +\n'\" />\\n            </form>\\n        </div>\\n        <ul class=\"Rk-Bin-List\"></ul>\\n    </div>\\n';\n } ;\n__p += ' ';\n if (options.show_editor) { ;\n__p += '\\n    <div class=\"Rk-Render Rk-Render-';\n if (options.show_bins) { ;\n__p += 'Panel';\n } else { ;\n__p += 'Full';\n } ;\n__p += '\"></div>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/nodeeditor.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n\n //TODO: change class to id ;\n__p += '\\n<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>' +\n__e(renkan.translate(\"Edit Node\")) +\n'</span>\\n</h2>\\n<p>\\n    <label>' +\n__e(renkan.translate(\"Title:\")) +\n'</label>\\n    <input class=\"Rk-Edit-Title\" type=\"text\" value=\"' +\n__e(node.title) +\n'\" />\\n</p>\\n';\n if (options.show_node_editor_uri) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"URI:\")) +\n'</label>\\n        <input class=\"Rk-Edit-URI\" type=\"text\" value=\"' +\n__e(node.uri) +\n'\" />\\n        <a class=\"Rk-Edit-Goto\" href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\"></a>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.change_types) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Types available\")) +\n':</label>\\n        <select class=\"Rk-Edit-Type\">\\n          ';\n _.each(types, function(type) { ;\n__p += '\\n            <option class=\"Rk-Edit-Vocabulary-Property\" value=\"' +\n__e( type ) +\n'\"';\n if (node.type === type) { ;\n__p += ' selected';\n } ;\n__p += '>\\n                ' +\n__e( renkan.translate(type.charAt(0).toUpperCase() + type.substring(1)) ) +\n'\\n            </option>\\n          ';\n }); ;\n__p += '\\n        </select>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_description) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Description:\")) +\n'</label>\\n        ';\n if (options.show_node_editor_description_richtext) { ;\n__p += '\\n            <div class=\"Rk-Edit-Description\" contenteditable=\"true\">' +\n((__t = (node.description)) == null ? '' : __t) +\n'</div>\\n        ';\n } else { ;\n__p += '\\n            <textarea class=\"Rk-Edit-Description\">' +\n((__t = (node.description)) == null ? '' : __t) +\n'</textarea>\\n        ';\n } ;\n__p += '\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_size) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Size:\")) +\n'</span>\\n        <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Size-Down\">-</a>\\n        <span class=\"Rk-Edit-Size-Disp\" id=\"Rk-Edit-Size-Value\">' +\n__e(node.size) +\n'</span>\\n        <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Size-Up\">+</a>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_style) { ;\n__p += '\\n    <div class=\"Rk-Editor-p\">\\n      ';\n if (options.show_node_editor_style_color) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-color\">\\n        <span class=\"Rk-Editor-Label\">\\n        ' +\n__e(renkan.translate(\"Node color:\")) +\n'</span>\\n        <div class=\"Rk-Edit-ColorPicker-Wrapper\">\\n            <span class=\"Rk-Edit-Color\" style=\"background: ' +\n__e(node.color) +\n';\">\\n                <span class=\"Rk-Edit-ColorTip\"></span>\\n            </span>\\n            ' +\n((__t = ( renkan.colorPicker )) == null ? '' : __t) +\n'\\n            <span class=\"Rk-Edit-ColorPicker-Text\">' +\n__e( renkan.translate(\"Choose color\") ) +\n'</span>\\n        </div>\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_node_editor_style_dash) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-dash\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Dash:\")) +\n'</span>\\n        <input type=\"checkbox\" name=\"Rk-Edit-Dash\" class=\"Rk-Edit-Dash\" ' +\n__e( node.dash ) +\n' />\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_node_editor_style_thickness) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-thickness\">\\n          <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Thickness:\")) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Down\">-</a>\\n          <span class=\"Rk-Edit-Size-Disp\" id=\"Rk-Edit-Thickness-Value\">' +\n__e(node.thickness) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Up\">+</a>\\n      </div>\\n      ';\n } ;\n__p += '\\n    </div>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_image) { ;\n__p += '\\n    <div class=\"Rk-Edit-ImgWrap\">\\n        <div class=\"Rk-Edit-ImgPreview\">\\n            <img src=\"' +\n__e(node.image || node.image_placeholder) +\n'\" />\\n            ';\n if (node.clip_path) { ;\n__p += '\\n                <svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewbox=\"0 0 1 1\" preserveAspectRatio=\"none\">\\n                    <path style=\"stroke-width: .02; stroke:red; fill-opacity:.3; fill:red;\" d=\"' +\n__e( node.clip_path ) +\n'\" />\\n                </svg>\\n            ';\n };\n__p += '\\n        </div>\\n    </div>\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Image URL:\")) +\n'</label>\\n        <div>\\n            <a class=\"Rk-Edit-Image-Del\" href=\"#\"></a>\\n            <input class=\"Rk-Edit-Image\" type=\"text\" value=\\'' +\n__e(node.image) +\n'\\' />\\n        </div>\\n    </p>\\n';\n if (options.allow_image_upload) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Choose Image File:\")) +\n'</label>\\n        <input class=\"Rk-Edit-Image-File\" type=\"file\" accept=\"image/*\" />\\n    </p>\\n';\n };\n\n } ;\n__p += ' ';\n if (options.show_node_editor_creator && node.has_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.created_by_color) +\n';\"></span>\\n        ' +\n__e( shortenText(node.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.change_shapes) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Shapes available\")) +\n':</label>\\n        <select class=\"Rk-Edit-Shape\">\\n          ';\n _.each(shapes, function(shape) { ;\n__p += '\\n            <option class=\"Rk-Edit-Vocabulary-Property\" value=\"' +\n__e( shape ) +\n'\"';\n if (node.shape === shape) { ;\n__p += ' selected';\n } ;\n__p += '>\\n                ' +\n__e( renkan.translate(shape.charAt(0).toUpperCase() + shape.substring(1)) ) +\n'\\n            </option>\\n          ';\n }); ;\n__p += '\\n        </select>\\n    </p>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/nodeeditor_readonly.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>\\n    ';\n if (options.show_node_tooltip_color) { ;\n__p += '\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.color) +\n';\"></span>\\n    ';\n } ;\n__p += '\\n    <span class=\"Rk-Display-Title\">\\n        ';\n if (node.uri) { ;\n__p += '\\n            <a href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\">\\n        ';\n } ;\n__p += '\\n        ' +\n__e(node.title) +\n'\\n        ';\n if (node.uri) { ;\n__p += '</a>';\n } ;\n__p += '\\n    </span>\\n</h2>\\n';\n if (node.uri && options.show_node_tooltip_uri) { ;\n__p += '\\n    <p class=\"Rk-Display-URI\">\\n        <a href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\">' +\n__e(node.short_uri) +\n'</a>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_tooltip_description) { ;\n__p += '\\n    <p class=\"Rk-Display-Description\">' +\n((__t = (node.description)) == null ? '' : __t) +\n'</p>\\n';\n } ;\n__p += ' ';\n if (node.image && options.show_node_tooltip_image) { ;\n__p += '\\n    <img class=\"Rk-Display-ImgPreview\" src=\"' +\n__e(node.image) +\n'\" />\\n';\n } ;\n__p += ' ';\n if (node.has_creator && options.show_node_tooltip_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.created_by_color) +\n';\"></span>\\n        ' +\n__e( shortenText(node.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n    <a href=\"#?idnode=' +\n__e(node._id) +\n'\">' +\n__e(renkan.translate(\"Link to the node\")) +\n'</a>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/nodeeditor_video.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>\\n    ';\n if (options.show_node_tooltip_color) { ;\n__p += '\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.color) +\n';\"></span>\\n    ';\n } ;\n__p += '\\n    <span class=\"Rk-Display-Title\">\\n        ';\n if (node.uri) { ;\n__p += '\\n            <a href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\">\\n        ';\n } ;\n__p += '\\n        ' +\n__e(node.title) +\n'\\n        ';\n if (node.uri) { ;\n__p += '</a>';\n } ;\n__p += '\\n    </span>\\n</h2>\\n';\n if (node.uri && options.show_node_tooltip_uri) { ;\n__p += '\\n     <video width=\"320\" height=\"240\" controls>\\n        <source src=\"' +\n__e(node.uri) +\n'\" type=\"video/mp4\">\\n     </video> \\n';\n } ;\n__p += '\\n    <a href=\"#?idnode=' +\n__e(node._id) +\n'\">' +\n__e(renkan.translate(\"Link to the node\")) +\n'</a>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/scene.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n\n if (options.show_top_bar) { ;\n__p += '\\n    <div class=\"Rk-TopBar\">\\n        <div class=\"loader\"></div>\\n        ';\n if (!options.editor_mode) { ;\n__p += '\\n            <h2 class=\"Rk-PadTitle\">\\n                ' +\n__e( project.get(\"title\") || translate(\"Untitled project\")) +\n'\\n            </h2>\\n        ';\n } else { ;\n__p += '\\n            <input type=\"text\" class=\"Rk-PadTitle\" value=\"' +\n__e( project.get('title') || '' ) +\n'\" placeholder=\"' +\n__e(translate('Untitled project')) +\n'\" />\\n        ';\n } ;\n__p += '\\n        ';\n if (options.show_user_list) { ;\n__p += '\\n            <div class=\"Rk-Users\">\\n                <div class=\"Rk-CurrentUser\">\\n                    ';\n if (options.show_user_color) { ;\n__p += '\\n                        <div class=\"Rk-Edit-ColorPicker-Wrapper\">\\n                            <span class=\"Rk-CurrentUser-Color\">\\n                            ';\n if (options.user_color_editable) { ;\n__p += '\\n                                <span class=\"Rk-Edit-ColorTip\"></span>\\n                            ';\n } ;\n__p += '\\n                            </span>\\n                            ';\n if (options.user_color_editable) { print(colorPicker) } ;\n__p += '\\n                        </div>\\n                    ';\n } ;\n__p += '\\n                    <span class=\"Rk-CurrentUser-Name\">&lt;unknown user&gt;</span>\\n                </div>\\n                <ul class=\"Rk-UserList\"></ul>\\n            </div>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.home_button_url) {;\n__p += '\\n            <div class=\"Rk-TopBar-Separator\"></div>\\n            <a class=\"Rk-TopBar-Button Rk-Home-Button\" href=\"' +\n__e( options.home_button_url ) +\n'\">\\n                <div class=\"Rk-TopBar-Tooltip\">\\n                    <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                        ' +\n__e( translate(options.home_button_title) ) +\n'\\n                    </div>\\n                </div>\\n            </a>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.show_fullscreen_button) { ;\n__p += '\\n            <div class=\"Rk-TopBar-Separator\"></div>\\n            <div class=\"Rk-TopBar-Button Rk-FullScreen-Button\">\\n                <div class=\"Rk-TopBar-Tooltip\">\\n                    <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                        ' +\n__e(translate(\"Full Screen\")) +\n'\\n                    </div>\\n                </div>\\n            </div>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.editor_mode) { ;\n__p += '\\n            ';\n if (options.show_addnode_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-AddNode-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Add Node\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_addedge_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-AddEdge-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Add Edge\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_export_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Export-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Download Project\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_save_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Save-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\"></div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_open_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Open-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Open Project\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_bookmarklet) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <a class=\"Rk-TopBar-Button Rk-Bookmarklet-Button\" href=\"#\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Renkan \\'Drag-to-Add\\' bookmarklet\")) +\n'\\n                        </div>\\n                    </div>\\n                </a>\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n            ';\n } ;\n__p += '\\n        ';\n } else { ;\n__p += '\\n            ';\n if (options.show_export_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Export-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Download Project\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n            ';\n } ;\n__p += '\\n        ';\n }; ;\n__p += '\\n        ';\n if (options.show_search_field) { ;\n__p += '\\n            <form action=\"#\" class=\"Rk-GraphSearch-Form\">\\n                <input type=\"search\" class=\"Rk-GraphSearch-Field\" placeholder=\"' +\n__e( translate('Search in graph') ) +\n'\" />\\n            </form>\\n            <div class=\"Rk-TopBar-Separator\"></div>\\n        ';\n } ;\n__p += '\\n    </div>\\n';\n } ;\n__p += '\\n<div class=\"Rk-Editing-Space';\n if (!options.show_top_bar) { ;\n__p += ' Rk-Editing-Space-Full';\n } ;\n__p += '\">\\n    <div class=\"Rk-Labels\"></div>\\n    <canvas class=\"Rk-Canvas\" ';\n if (options.resize) { ;\n__p += ' resize=\"\" ';\n } ;\n__p += ' ></canvas>\\n    <div class=\"Rk-Notifications\"></div>\\n    <div class=\"Rk-Editor\">\\n        ';\n if (options.show_bins) { ;\n__p += '\\n            <div class=\"Rk-Fold-Bins\">&laquo;</div>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.show_zoom) { ;\n__p += '\\n            <div class=\"Rk-ZoomButtons\">\\n                <div class=\"Rk-ZoomIn\" title=\"' +\n__e(translate('Zoom In')) +\n'\"></div>\\n                <div class=\"Rk-ZoomFit\" title=\"' +\n__e(translate('Zoom Fit')) +\n'\"></div>\\n                <div class=\"Rk-ZoomOut\" title=\"' +\n__e(translate('Zoom Out')) +\n'\"></div>\\n                ';\n if (options.editor_mode && options.save_view) { ;\n__p += '\\n                    <div class=\"Rk-ZoomSave\" title=\"' +\n__e(translate('Save view')) +\n'\"></div>\\n                ';\n } ;\n__p += '\\n                ';\n if (options.save_view) { ;\n__p += '\\n                    <div class=\"Rk-ZoomSetSaved\" title=\"' +\n__e(translate('View saved view')) +\n'\"></div>\\n                    ';\n if (options.hide_nodes) { ;\n__p += '\\n                \\t   <div class=\"Rk-ShowHiddenNodes\" title=\"' +\n__e(translate('Show hidden nodes')) +\n'\"></div>\\n                    ';\n } ;\n__p += '       \\n                ';\n } ;\n__p += '\\n            </div>\\n        ';\n } ;\n__p += '\\n    </div>\\n</div>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/search.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"' +\n((__t = ( className )) == null ? '' : __t) +\n'\" data-key=\"' +\n((__t = ( key )) == null ? '' : __t) +\n'\">' +\n((__t = ( title )) == null ? '' : __t) +\n'</li>';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/wikipedia-bin/resulttemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Wikipedia-Result Rk-Bin-Item\" draggable=\"true\"\\n    data-uri=\"' +\n__e(url) +\n'\" data-title=\"Wikipedia: ' +\n__e(title) +\n'\"\\n    data-description=\"' +\n__e(description) +\n'\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL( static_url + 'img/wikipedia.png' ) ) +\n'\">\\n\\n    <img class=\"Rk-Wikipedia-Icon\" src=\"' +\n__e(static_url) +\n'img/wikipedia.png\">\\n    <h4 class=\"Rk-Wikipedia-Title\">\\n        <a href=\"' +\n__e(url) +\n'\" target=\"_blank\">' +\n((__t = (htitle)) == null ? '' : __t) +\n'</a>\\n    </h4>\\n    <p class=\"Rk-Wikipedia-Snippet\">' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n</li>\\n';\n\n}\nreturn __p\n};","/* Declaring the Renkan Namespace Rkns and Default values */\n\n(function(root) {\n\n    \"use strict\";\n\n    if (typeof root.Rkns !== \"object\") {\n        root.Rkns = {};\n    }\n\n    var Rkns = root.Rkns;\n    var $ = Rkns.$ = root.jQuery;\n    var _ = Rkns._ = root._;\n\n    Rkns.pickerColors = [\"#8f1919\", \"#a80000\", \"#d82626\", \"#ff0000\", \"#e87c7c\", \"#ff6565\", \"#f7d3d3\", \"#fecccc\",\n        \"#8f5419\", \"#a85400\", \"#d87f26\", \"#ff7f00\", \"#e8b27c\", \"#ffb265\", \"#f7e5d3\", \"#fee5cc\",\n        \"#8f8f19\", \"#a8a800\", \"#d8d826\", \"#feff00\", \"#e8e87c\", \"#feff65\", \"#f7f7d3\", \"#fefecc\",\n        \"#198f19\", \"#00a800\", \"#26d826\", \"#00ff00\", \"#7ce87c\", \"#65ff65\", \"#d3f7d3\", \"#ccfecc\",\n        \"#198f8f\", \"#00a8a8\", \"#26d8d8\", \"#00feff\", \"#7ce8e8\", \"#65feff\", \"#d3f7f7\", \"#ccfefe\",\n        \"#19198f\", \"#0000a8\", \"#2626d8\", \"#0000ff\", \"#7c7ce8\", \"#6565ff\", \"#d3d3f7\", \"#ccccfe\",\n        \"#8f198f\", \"#a800a8\", \"#d826d8\", \"#ff00fe\", \"#e87ce8\", \"#ff65fe\", \"#f7d3f7\", \"#feccfe\",\n        \"#000000\", \"#242424\", \"#484848\", \"#6d6d6d\", \"#919191\", \"#b6b6b6\", \"#dadada\", \"#ffffff\"\n    ];\n\n    Rkns.__renkans = [];\n\n    var _BaseBin = Rkns._BaseBin = function(_renkan, _opts) {\n        if (typeof _renkan !== \"undefined\") {\n            this.renkan = _renkan;\n            this.renkan.$.find(\".Rk-Bin-Main\").hide();\n            this.$ = Rkns.$('<li>')\n                .addClass(\"Rk-Bin\")\n                .appendTo(_renkan.$.find(\".Rk-Bin-List\"));\n            this.title_icon_$ = Rkns.$('<span>')\n                .addClass(\"Rk-Bin-Title-Icon\")\n                .appendTo(this.$);\n\n            var _this = this;\n\n            Rkns.$('<a>')\n                .attr({\n                    href: \"#\",\n                    title: _renkan.translate(\"Close bin\")\n                })\n                .addClass(\"Rk-Bin-Close\")\n                .html('&times;')\n                .appendTo(this.$)\n                .click(function() {\n                    _this.destroy();\n                    if (!_renkan.$.find(\".Rk-Bin-Main:visible\").length) {\n                        _renkan.$.find(\".Rk-Bin-Main:last\").slideDown();\n                    }\n                    _renkan.resizeBins();\n                    return false;\n                });\n            Rkns.$('<a>')\n                .attr({\n                    href: \"#\",\n                    title: _renkan.translate(\"Refresh bin\")\n                })\n                .addClass(\"Rk-Bin-Refresh\")\n                .appendTo(this.$)\n                .click(function() {\n                    _this.refresh();\n                    return false;\n                });\n            this.count_$ = Rkns.$('<div>')\n                .addClass(\"Rk-Bin-Count\")\n                .appendTo(this.$);\n            this.title_$ = Rkns.$('<h2>')\n                .addClass(\"Rk-Bin-Title\")\n                .appendTo(this.$);\n            this.main_$ = Rkns.$('<div>')\n                .addClass(\"Rk-Bin-Main\")\n                .appendTo(this.$)\n                .html('<h4 class=\"Rk-Bin-Loading\">' + _renkan.translate(\"Loading, please wait\") + '</h4>');\n            this.title_$.html(_opts.title || '(new bin)');\n            this.renkan.resizeBins();\n\n            if (_opts.auto_refresh) {\n                window.setInterval(function() {\n                    _this.refresh();\n                }, _opts.auto_refresh);\n            }\n        }\n    };\n\n    _BaseBin.prototype.destroy = function() {\n        this.$.detach();\n        this.renkan.resizeBins();\n    };\n\n    /* Point of entry */\n\n    var Renkan = Rkns.Renkan = function(_opts) {\n        var _this = this;\n\n        Rkns.__renkans.push(this);\n\n        this.options = _.defaults(_opts, Rkns.defaults, {\n            templates: _.defaults(_opts.templates, renkanJST) || renkanJST,\n            node_editor_templates: _.defaults(_opts.node_editor_templates, Rkns.defaults.node_editor_templates)\n        });\n        this.template = renkanJST['templates/main.html'];\n\n        var types_templates = {};\n        _.each(this.options.node_editor_templates, function(value, key) {\n            types_templates[key] = _this.options.templates[value];\n            delete _this.options.templates[value];\n        });\n        this.options.node_editor_templates = types_templates;\n\n        _.each(this.options.property_files, function(f) {\n            Rkns.$.getJSON(f, function(data) {\n                _this.options.properties = _this.options.properties.concat(data);\n            });\n        });\n\n        this.read_only = this.options.read_only || !this.options.editor_mode;\n        \n        this.router = new Rkns.Router();\n        \n        this.project = new Rkns.Models.Project();\n        this.dataloader = new Rkns.DataLoader.Loader(this.project, this.options);\n\n        this.setCurrentUser = function(user_id, user_name) {\n            this.project.addUser({\n                _id: user_id,\n                title: user_name\n            });\n            this.current_user = user_id;\n            this.renderer.redrawUsers();\n        };\n\n        if (typeof this.options.user_id !== \"undefined\") {\n            this.current_user = this.options.user_id;\n        }\n        this.$ = Rkns.$(\"#\" + this.options.container);\n        this.$\n            .addClass(\"Rk-Main\")\n            .html(this.template(this));\n\n        this.tabs = [];\n        this.search_engines = [];\n\n        this.current_user_list = new Rkns.Models.UsersList();\n\n        this.current_user_list.on(\"add remove\", function() {\n            if (this.renderer) {\n                this.renderer.redrawUsers();\n            }\n        });\n\n        this.colorPicker = (function() {\n            var _tmpl = renkanJST['templates/colorpicker.html'];\n            return '<ul class=\"Rk-Edit-ColorPicker\">' + Rkns.pickerColors.map(function(c) {\n                return _tmpl({\n                    c: c\n                });\n            }).join(\"\") + '</ul>';\n        })();\n\n        if (this.options.show_editor) {\n            this.renderer = new Rkns.Renderer.Scene(this);\n        }\n\n        if (!this.options.search.length) {\n            this.$.find(\".Rk-Web-Search-Form\").detach();\n        } else {\n            var _tmpl = renkanJST['templates/search.html'],\n                _select = this.$.find(\".Rk-Search-List\"),\n                _input = this.$.find(\".Rk-Web-Search-Input\"),\n                _form = this.$.find(\".Rk-Web-Search-Form\");\n            _.each(this.options.search, function(_search, _key) {\n                if (Rkns[_search.type] && Rkns[_search.type].Search) {\n                    _this.search_engines.push(new Rkns[_search.type].Search(_this, _search));\n                }\n            });\n            _select.html(\n                _(this.search_engines).map(function(_search, _key) {\n                    return _tmpl({\n                        key: _key,\n                        title: _search.getSearchTitle(),\n                        className: _search.getBgClass()\n                    });\n                }).join(\"\")\n            );\n            _select.find(\"li\").click(function() {\n                var _el = Rkns.$(this);\n                _this.setSearchEngine(_el.attr(\"data-key\"));\n                _form.submit();\n            });\n            _form.submit(function() {\n                if (_input.val()) {\n                    var _search = _this.search_engine;\n                    _search.search(_input.val());\n                }\n                return false;\n            });\n            this.$.find(\".Rk-Search-Current\").mouseenter(\n                function() {\n                    _select.slideDown();\n                }\n            );\n            this.$.find(\".Rk-Search-Select\").mouseleave(\n                function() {\n                    _select.hide();\n                }\n            );\n            this.setSearchEngine(0);\n        }\n        _.each(this.options.bins, function(_bin) {\n            if (Rkns[_bin.type] && Rkns[_bin.type].Bin) {\n                _this.tabs.push(new Rkns[_bin.type].Bin(_this, _bin));\n            }\n        });\n\n        var elementDropped = false;\n\n        this.$.find(\".Rk-Bins\")\n            .on(\"click\", \".Rk-Bin-Title,.Rk-Bin-Title-Icon\", function() {\n                var _mainDiv = Rkns.$(this).siblings(\".Rk-Bin-Main\");\n                if (_mainDiv.is(\":hidden\")) {\n                    _this.$.find(\".Rk-Bin-Main\").slideUp();\n                    _mainDiv.slideDown();\n                }\n            });\n\n        if (this.options.show_editor) {\n\n            this.$.find(\".Rk-Bins\").on(\"mouseover\", \".Rk-Bin-Item\", function(_e) {\n                var _t = Rkns.$(this);\n                if (_t && $(_t).attr(\"data-uri\")) {\n                    var _models = _this.project.get(\"nodes\").where({\n                        uri: $(_t).attr(\"data-uri\")\n                    });\n                    _.each(_models, function(_model) {\n                        _this.renderer.highlightModel(_model);\n                    });\n                }\n            }).mouseout(function() {\n                _this.renderer.unhighlightAll();\n            }).on(\"mousemove\", \".Rk-Bin-Item\", function(e) {\n                try {\n                    this.dragDrop();\n                } catch (err) {}\n            }).on(\"touchstart\", \".Rk-Bin-Item\", function(e) {\n                elementDropped = false;\n            }).on(\"touchmove\", \".Rk-Bin-Item\", function(e) {\n                e.preventDefault();\n                var touch = e.originalEvent.changedTouches[0],\n                    off = _this.renderer.canvas_$.offset(),\n                    w = _this.renderer.canvas_$.width(),\n                    h = _this.renderer.canvas_$.height();\n                if (touch.pageX >= off.left && touch.pageX < (off.left + w) && touch.pageY >= off.top && touch.pageY < (off.top + h)) {\n                    if (elementDropped) {\n                        _this.renderer.onMouseMove(touch, true);\n                    } else {\n                        elementDropped = true;\n                        var div = document.createElement('div');\n                        div.appendChild(this.cloneNode(true));\n                        _this.renderer.dropData({\n                            \"text/html\": div.innerHTML\n                        }, touch);\n                        _this.renderer.onMouseDown(touch, true);\n                    }\n                }\n            }).on(\"touchend\", \".Rk-Bin-Item\", function(e) {\n                if (elementDropped) {\n                    _this.renderer.onMouseUp(e.originalEvent.changedTouches[0], true);\n                }\n                elementDropped = false;\n            }).on(\"dragstart\", \".Rk-Bin-Item\", function(e) {\n                var div = document.createElement('div');\n                div.appendChild(this.cloneNode(true));\n                try {\n                    e.originalEvent.dataTransfer.setData(\"text/html\", div.innerHTML);\n                } catch (err) {\n                    e.originalEvent.dataTransfer.setData(\"text\", div.innerHTML);\n                }\n            });\n\n        }\n\n        Rkns.$(window).resize(function() {\n            _this.resizeBins();\n        });\n\n        var lastsearch = false,\n            lastval = '';\n\n        this.$.find(\".Rk-Bins-Search-Input\").on(\"change keyup paste input\", function() {\n            var val = Rkns.$(this).val();\n            if (val === lastval) {\n                return;\n            }\n            var search = Rkns.Utils.regexpFromTextOrArray(val.length > 1 ? val : null);\n            if (search.source === lastsearch) {\n                return;\n            }\n            lastsearch = search.source;\n            _.each(_this.tabs, function(tab) {\n                tab.render(search);\n            });\n\n        });\n        this.$.find(\".Rk-Bins-Search-Form\").submit(function() {\n            return false;\n        });\n    };\n\n    Renkan.prototype.translate = function(_text) {\n        if (Rkns.i18n[this.options.language] && Rkns.i18n[this.options.language][_text]) {\n            return Rkns.i18n[this.options.language][_text];\n        }\n        if (this.options.language.length > 2 && Rkns.i18n[this.options.language.substr(0, 2)] && Rkns.i18n[this.options.language.substr(0, 2)][_text]) {\n            return Rkns.i18n[this.options.language.substr(0, 2)][_text];\n        }\n        return _text;\n    };\n\n    Renkan.prototype.onStatusChange = function() {\n        this.renderer.onStatusChange();\n    };\n\n    Renkan.prototype.setSearchEngine = function(_key) {\n        this.search_engine = this.search_engines[_key];\n        this.$.find(\".Rk-Search-Current\").attr(\"class\", \"Rk-Search-Current \" + this.search_engine.getBgClass());\n        var listClasses = this.search_engine.getBgClass().split(\" \");\n        var classes = \"\";\n        for (var i = 0; i < listClasses.length; i++) {\n            classes += \".\" + listClasses[i];\n        }\n        this.$.find(\".Rk-Web-Search-Input.Rk-Search-Input\").attr(\"placeholder\", this.translate(\"Search in \") + this.$.find(\".Rk-Search-List \" + classes).html());\n    };\n\n    Renkan.prototype.resizeBins = function() {\n        var _d = +this.$.find(\".Rk-Bins-Head\").outerHeight();\n        this.$.find(\".Rk-Bin-Title:visible\").each(function() {\n            _d += Rkns.$(this).outerHeight();\n        });\n        this.$.find(\".Rk-Bin-Main\").css({\n            height: this.$.find(\".Rk-Bins\").height() - _d\n        });\n    };\n\n    /* Utility functions */\n    var getUUID4 = function() {\n        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n            var r = Math.random() * 16 | 0,\n                v = c === 'x' ? r : (r & 0x3 | 0x8);\n            return v.toString(16);\n        });\n    };\n\n    Rkns.Utils = {\n        getUUID4: getUUID4,\n        getUID: (function() {\n            function pad(n) {\n                return n < 10 ? '0' + n : n;\n            }\n            var _d = new Date(),\n                ID_AUTO_INCREMENT = 0,\n                ID_BASE = _d.getUTCFullYear() + '-' +\n                pad(_d.getUTCMonth() + 1) + '-' +\n                pad(_d.getUTCDate()) + '-' +\n                getUUID4();\n            return function(_base) {\n                var _n = (++ID_AUTO_INCREMENT).toString(16),\n                    _uidbase = (typeof _base === \"undefined\" ? \"\" : _base + \"-\");\n                while (_n.length < 4) {\n                    _n = '0' + _n;\n                }\n                return _uidbase + ID_BASE + '-' + _n;\n            };\n        })(),\n        getFullURL: function(url) {\n\n            if (typeof(url) === 'undefined' || url == null) {\n                return \"\";\n            }\n            if (/https?:\\/\\//.test(url)) {\n                return url;\n            }\n            var img = new Image();\n            img.src = url;\n            var res = img.src;\n            img.src = null;\n            return res;\n\n        },\n        inherit: function(_baseClass, _callbefore) {\n\n            var _class = function(_arg) {\n                if (typeof _callbefore === \"function\") {\n                    _callbefore.apply(this, Array.prototype.slice.call(arguments, 0));\n                }\n                _baseClass.apply(this, Array.prototype.slice.call(arguments, 0));\n                if (typeof this._init === \"function\" && !this._initialized) {\n                    this._init.apply(this, Array.prototype.slice.call(arguments, 0));\n                    this._initialized = true;\n                }\n            };\n            _.extend(_class.prototype, _baseClass.prototype);\n\n            return _class;\n\n        },\n        regexpFromTextOrArray: (function() {\n            var charsub = [\n                    '[aáàâä]',\n                    '[cç]',\n                    '[eéèêë]',\n                    '[iíìîï]',\n                    '[oóòôö]',\n                    '[uùûü]'\n                ],\n                removeChars = [\n                    String.fromCharCode(768), String.fromCharCode(769), String.fromCharCode(770), String.fromCharCode(771), String.fromCharCode(807),\n                    \"{\", \"}\", \"(\", \")\", \"[\", \"]\", \"【\", \"】\", \"、\", \"・\", \"‥\", \"。\", \"「\", \"」\", \"『\", \"』\", \"〜\", \":\", \"!\", \"?\", \" \",\n                    \",\", \" \", \";\", \"(\", \")\", \".\", \"*\", \"+\", \"\\\\\", \"?\", \"|\", \"{\", \"}\", \"[\", \"]\", \"^\", \"#\", \"/\"\n                ],\n                remsrc = \"[\\\\\" + removeChars.join(\"\\\\\") + \"]\",\n                remrx = new RegExp(remsrc, \"gm\"),\n                charsrx = _.map(charsub, function(c) {\n                    return new RegExp(c);\n                });\n\n            function replaceText(_text) {\n                var txt = _text.toLowerCase().replace(remrx, \"\"),\n                    src = \"\";\n\n                function makeReplaceFunc(l) {\n                    return function(k, v) {\n                        l = l.replace(charsrx[k], v);\n                    };\n                }\n                for (var j = 0; j < txt.length; j++) {\n                    if (j) {\n                        src += remsrc + \"*\";\n                    }\n                    var l = txt[j];\n                    _.each(charsub, makeReplaceFunc(l));\n                    src += l;\n                }\n                return src;\n            }\n\n            function getSource(inp) {\n                switch (typeof inp) {\n                    case \"string\":\n                        return replaceText(inp);\n                    case \"object\":\n                        var src = '';\n                        _.each(inp, function(v) {\n                            var res = getSource(v);\n                            if (res) {\n                                if (src) {\n                                    src += '|';\n                                }\n                                src += res;\n                            }\n                        });\n                        return src;\n                }\n                return '';\n            }\n\n            return function(_textOrArray) {\n                var source = getSource(_textOrArray);\n                if (source) {\n                    var testrx = new RegExp(source, \"im\"),\n                        replacerx = new RegExp('(' + source + ')', \"igm\");\n                    return {\n                        isempty: false,\n                        source: source,\n                        test: function(_t) {\n                            return testrx.test(_t);\n                        },\n                        replace: function(_text, _replace) {\n                            return _text.replace(replacerx, _replace);\n                        }\n                    };\n                } else {\n                    return {\n                        isempty: true,\n                        source: '',\n                        test: function() {\n                            return true;\n                        },\n                        replace: function(_text) {\n                            return text;\n                        }\n                    };\n                }\n            };\n        })(),\n        /* The minimum distance (in pixels) the mouse has to move to consider an element was dragged */\n        _MIN_DRAG_DISTANCE: 2,\n        /* Distance between the inner and outer radius of buttons that appear when hovering on a node */\n        _NODE_BUTTON_WIDTH: 40,\n\n        _EDGE_BUTTON_INNER: 2,\n        _EDGE_BUTTON_OUTER: 40,\n        /* Constants used to know if a specific action is to be performed when clicking on the canvas */\n        _CLICKMODE_ADDNODE: 1,\n        _CLICKMODE_STARTEDGE: 2,\n        _CLICKMODE_ENDEDGE: 3,\n        /* Node size step: Used to calculate the size change when clicking the +/- buttons */\n        _NODE_SIZE_STEP: Math.LN2 / 4,\n        _MIN_SCALE: 1 / 20,\n        _MAX_SCALE: 20,\n        _MOUSEMOVE_RATE: 80,\n        _DOUBLETAP_DELAY: 800,\n        /* Maximum distance in pixels (squared, to reduce calculations)\n         * between two taps when double-tapping on a touch terminal */\n        _DOUBLETAP_DISTANCE: 20 * 20,\n        /* A placeholder so a default colour is displayed when a node has a null value for its user property */\n        _USER_PLACEHOLDER: function(_renkan) {\n            return {\n                color: _renkan.options.default_user_color,\n                title: _renkan.translate(\"(unknown user)\"),\n                get: function(attr) {\n                    return this[attr] || false;\n                }\n            };\n        },\n        /* The code for the \"Drag and Add Bookmarklet\", slightly minified and with whitespaces removed, though\n         * it doesn't seem that it's still a requirement in newer browsers (i.e. the ones compatibles with canvas drawing)\n         */\n        _BOOKMARKLET_CODE: function(_renkan) {\n            return \"(function(a,b,c,d,e,f,h,i,j,k,l,m,n,o,p,q,r){a=document;b=a.body;c=a.location.href;j='draggable';m='text/x-iri-';d=a.createElement('div');d.innerHTML='<p_style=\\\"position:fixed;top:0;right:0;font:bold_18px_sans-serif;color:#fff;background:#909;padding:10px;z-index:100000;\\\">\" +\n                _renkan.translate(\"Drag items from this website, drop them in Renkan\").replace(/ /g, \"_\") +\n                \"</p>'.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);})();\";\n        },\n        /* Shortens text to the required length then adds ellipsis */\n        shortenText: function(_text, _maxlength) {\n            return (_text.length > _maxlength ? (_text.substr(0, _maxlength) + '…') : _text);\n        },\n        /* Drawing an edit box with an arrow and positioning the edit box according to the position of the node/edge being edited\n         * Called by Rkns.Renderer.NodeEditor and Rkns.Renderer.EdgeEditor */\n        drawEditBox: function(_options, _coords, _path, _xmargin, _selector) {\n            _selector.css({\n                width: (_options.tooltip_width - 2 * _options.tooltip_padding)\n            });\n            var _height = _selector.outerHeight() + 2 * _options.tooltip_padding,\n                _isLeft = (_coords.x < paper.view.center.x ? 1 : -1),\n                _left = _coords.x + _isLeft * (_xmargin + _options.tooltip_arrow_length),\n                _right = _coords.x + _isLeft * (_xmargin + _options.tooltip_arrow_length + _options.tooltip_width),\n                _top = _coords.y - _height / 2;\n            if (_top + _height > (paper.view.size.height - _options.tooltip_margin)) {\n                _top = Math.max(paper.view.size.height - _options.tooltip_margin, _coords.y + _options.tooltip_arrow_width / 2) - _height;\n            }\n            if (_top < _options.tooltip_margin) {\n                _top = Math.min(_options.tooltip_margin, _coords.y - _options.tooltip_arrow_width / 2);\n            }\n            var _bottom = _top + _height;\n            /* jshint laxbreak:true */\n            _path.segments[0].point = _path.segments[7].point = _coords.add([_isLeft * _xmargin, 0]);\n            _path.segments[1].point.x = _path.segments[2].point.x = _path.segments[5].point.x = _path.segments[6].point.x = _left;\n            _path.segments[3].point.x = _path.segments[4].point.x = _right;\n            _path.segments[2].point.y = _path.segments[3].point.y = _top;\n            _path.segments[4].point.y = _path.segments[5].point.y = _bottom;\n            _path.segments[1].point.y = _coords.y - _options.tooltip_arrow_width / 2;\n            _path.segments[6].point.y = _coords.y + _options.tooltip_arrow_width / 2;\n            _path.closed = true;\n            _path.fillColor = new paper.GradientColor(new paper.Gradient([_options.tooltip_top_color, _options.tooltip_bottom_color]), [0, _top], [0, _bottom]);\n            _selector.css({\n                left: (_options.tooltip_padding + Math.min(_left, _right)),\n                top: (_options.tooltip_padding + _top)\n            });\n            return _path;\n        },\n        // from http://stackoverflow.com/a/6444043\n        increaseBrightness: function (hex, percent){\n            // strip the leading # if it's there\n            hex = hex.replace(/^\\s*#|\\s*$/g, '');\n\n            // convert 3 char codes --> 6, e.g. `E0F` --> `EE00FF`\n            if(hex.length === 3){\n                hex = hex.replace(/(.)/g, '$1$1');\n            }\n\n            var r = parseInt(hex.substr(0, 2), 16),\n                g = parseInt(hex.substr(2, 2), 16),\n                b = parseInt(hex.substr(4, 2), 16);\n\n            return '#' +\n               ((0|(1<<8) + r + (256 - r) * percent / 100).toString(16)).substr(1) +\n               ((0|(1<<8) + g + (256 - g) * percent / 100).toString(16)).substr(1) +\n               ((0|(1<<8) + b + (256 - b) * percent / 100).toString(16)).substr(1);\n        }\n    };\n})(window);\n\n/* END main.js */\n","(function(root) {\n    \"use strict\";\n    \n    var Backbone = root.Backbone;\n    \n    var Router = root.Rkns.Router = Backbone.Router.extend({\n        routes: {\n            '': 'index'\n        },\n        \n        index: function (parameters) {\n            \n            var result = {};\n            if (parameters === null){\n                return;\n            }\n            parameters.split(\"&\").forEach(function(part) {\n              var item = part.split(\"=\");\n              result[item[0]] = decodeURIComponent(item[1]);\n            });\n            this.trigger('router', result);            \n        }  \n    });\n\n})(window);","(function(root) {\n\n    \"use strict\";\n\n    var DataLoader = root.Rkns.DataLoader = {\n        converters: {\n            from1to2: function(data) {\n\n                var i, len;\n                if(typeof data.nodes !== 'undefined') {\n                    for(i=0, len=data.nodes.length; i<len; i++) {\n                        var node = data.nodes[i];\n                        if(node.color) {\n                            node.style = {\n                                color: node.color,\n                            };\n                        }\n                        else {\n                            node.style = {};\n                        }\n                    }\n                }\n                if(typeof data.edges !== 'undefined') {\n                    for(i=0, len=data.edges.length; i<len; i++) {\n                        var edge = data.edges[i];\n                        if(edge.color) {\n                            edge.style = {\n                                color: edge.color,\n                            };\n                        }\n                        else {\n                            edge.style = {};\n                        }\n                    }\n                }\n\n                data.schema_version = \"2\";\n\n                return data;\n            },\n        }\n    };\n\n\n    DataLoader.Loader = function(project, options) {\n        this.project = project;\n        this.dataConverters = _.defaults(options.converters || {}, DataLoader.converters);\n    };\n\n\n    DataLoader.Loader.prototype.convert = function(data) {\n        var schemaVersionFrom = this.project.getSchemaVersion(data);\n        var schemaVersionTo = this.project.getSchemaVersion();\n\n        if (schemaVersionFrom !== schemaVersionTo) {\n            var converterName = \"from\" + schemaVersionFrom + \"to\" + schemaVersionTo;\n            if (typeof this.dataConverters[converterName] === 'function') {\n                data = this.dataConverters[converterName](data);\n            }\n        }\n        return data;\n    };\n\n    DataLoader.Loader.prototype.load = function(data) {\n        this.project.set(this.convert(data), {\n            validate: true\n        });\n    };\n\n})(window);\n","(function(root) {\n    \"use strict\";\n\n    var Backbone = root.Backbone;\n\n    var Models = root.Rkns.Models = {};\n\n    Models.getUID = function(obj) {\n        var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,\n                function(c) {\n                    var r = Math.random() * 16 | 0, v = c === 'x' ? r\n                            : (r & 0x3 | 0x8);\n                    return v.toString(16);\n                });\n        if (typeof obj !== 'undefined') {\n            return obj.type + \"-\" + guid;\n        }\n        else {\n            return guid;\n        }\n    };\n\n    var RenkanModel = Backbone.RelationalModel.extend({\n        idAttribute : \"_id\",\n        constructor : function(options) {\n\n            if (typeof options !== \"undefined\") {\n                options._id = options._id || options.id || Models.getUID(this);\n                options.title = options.title || \"\";\n                options.description = options.description || \"\";\n                options.uri = options.uri || \"\";\n\n                if (typeof this.prepare === \"function\") {\n                    options = this.prepare(options);\n                }\n            }\n            Backbone.RelationalModel.prototype.constructor.call(this, options);\n        },\n        validate : function() {\n            if (!this.type) {\n                return \"object has no type\";\n            }\n        },\n        addReference : function(_options, _propName, _list, _id, _default) {\n            var _element = _list.get(_id);\n            if (typeof _element === \"undefined\" &&\n                typeof _default !== \"undefined\") {\n                _options[_propName] = _default;\n            }\n            else {\n                _options[_propName] = _element;\n            }\n        }\n    });\n\n    // USER\n    var User = Models.User = RenkanModel.extend({\n        type : \"user\",\n        prepare : function(options) {\n            options.color = options.color || \"#666666\";\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                title : this.get(\"title\"),\n                uri : this.get(\"uri\"),\n                description : this.get(\"description\"),\n                color : this.get(\"color\")\n            };\n        }\n    });\n\n    // NODE\n    var Node = Models.Node = RenkanModel.extend({\n        type : \"node\",\n        relations : [ {\n            type : Backbone.HasOne,\n            key : \"created_by\",\n            relatedModel : User\n        } ],\n        prepare : function(options) {\n            var project = options.project;\n            this.addReference(options, \"created_by\", project.get(\"users\"),\n                    options.created_by, project.current_user);\n            options.description = options.description || \"\";\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                title : this.get(\"title\"),\n                uri : this.get(\"uri\"),\n                description : this.get(\"description\"),\n                position : this.get(\"position\"),\n                image : this.get(\"image\"),\n                style : this.get(\"style\"),\n                created_by : this.get(\"created_by\") ? this.get(\"created_by\")\n                        .get(\"_id\") : null,\n                size : this.get(\"size\"),\n                clip_path : this.get(\"clip_path\"),\n                shape : this.get(\"shape\"),  \n                type : this.get(\"type\")\n            };\n        }\n    });\n\n    // EDGE\n    var Edge = Models.Edge = RenkanModel.extend({\n        type : \"edge\",\n        relations : [ {\n            type : Backbone.HasOne,\n            key : \"created_by\",\n            relatedModel : User\n        }, {\n            type : Backbone.HasOne,\n            key : \"from\",\n            relatedModel : Node\n        }, {\n            type : Backbone.HasOne,\n            key : \"to\",\n            relatedModel : Node\n        } ],\n        prepare : function(options) {\n            var project = options.project;\n            this.addReference(options, \"created_by\", project.get(\"users\"),\n                    options.created_by, project.current_user);\n            this.addReference(options, \"from\", project.get(\"nodes\"),\n                    options.from);\n            this.addReference(options, \"to\", project.get(\"nodes\"), options.to);\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                title : this.get(\"title\"),\n                uri : this.get(\"uri\"),\n                description : this.get(\"description\"),\n                from : this.get(\"from\") ? this.get(\"from\").get(\"_id\") : null,\n                to : this.get(\"to\") ? this.get(\"to\").get(\"_id\") : null,\n                style : this.get(\"style\"),\n                created_by : this.get(\"created_by\") ? this.get(\"created_by\")\n                        .get(\"_id\") : null\n            };\n        }\n    });\n\n    // View\n    var View = Models.View = RenkanModel.extend({\n        type : \"view\",\n        relations : [ {\n            type : Backbone.HasOne,\n            key : \"created_by\",\n            relatedModel : User\n        } ],\n        prepare : function(options) {\n            var project = options.project;\n            this.addReference(options, \"created_by\", project.get(\"users\"),\n                    options.created_by, project.current_user);\n            options.description = options.description || \"\";\n            if (typeof options.offset !== \"undefined\") {\n                var offset = {};\n                if (Array.isArray(options.offset)) {\n                    offset.x = options.offset[0];\n                    offset.y = options.offset.length > 1 ? options.offset[1]\n                            : options.offset[0];\n                }\n                else if (options.offset.x != null) {\n                    offset.x = options.offset.x;\n                    offset.y = options.offset.y;\n                }\n                options.offset = offset;\n            }\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                zoom_level : this.get(\"zoom_level\"),\n                offset : this.get(\"offset\"),\n                title : this.get(\"title\"),\n                description : this.get(\"description\"),\n                created_by : this.get(\"created_by\") ? this.get(\"created_by\")\n                        .get(\"_id\") : null,\n                hidden_nodes: this.get(\"hidden_nodes\")\n            // Don't need project id\n            };\n        }\n    });\n\n    // PROJECT\n    var Project = Models.Project = RenkanModel.extend({\n        schema_version : \"2\",\n        type : \"project\",\n        blacklist : [ 'saveStatus', 'loadingStatus'],\n        relations : [ {\n            type : Backbone.HasMany,\n            key : \"users\",\n            relatedModel : User,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        }, {\n            type : Backbone.HasMany,\n            key : \"nodes\",\n            relatedModel : Node,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        }, {\n            type : Backbone.HasMany,\n            key : \"edges\",\n            relatedModel : Edge,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        }, {\n            type : Backbone.HasMany,\n            key : \"views\",\n            relatedModel : View,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        } ],\n        addUser : function(_props, _options) {\n            _props.project = this;\n            var _user = User.findOrCreate(_props);\n            this.get(\"users\").push(_user, _options);\n            return _user;\n        },\n        addNode : function(_props, _options) {\n            _props.project = this;\n            var _node = Node.findOrCreate(_props);\n            this.get(\"nodes\").push(_node, _options);\n            return _node;\n        },\n        addEdge : function(_props, _options) {\n            _props.project = this;\n            var _edge = Edge.findOrCreate(_props);\n            this.get(\"edges\").push(_edge, _options);\n            return _edge;\n        },\n        addView : function(_props, _options) {\n            _props.project = this;\n            // TODO: check if need to replace with create only\n            var _view = View.findOrCreate(_props);\n            // TODO: Should we remember only one view?\n            this.get(\"views\").push(_view, _options);\n            return _view;\n        },\n        removeNode : function(_model) {\n            this.get(\"nodes\").remove(_model);\n        },\n        removeEdge : function(_model) {\n            this.get(\"edges\").remove(_model);\n        },\n        validate : function(options) {\n            var _project = this;\n            _.each(\n              [].concat(options.users, options.nodes, options.edges,options.views),\n              function(_item) {\n                if (_item) {\n                    _item.project = _project;\n                }\n              }\n            );\n        },\n        getSchemaVersion : function(data) {\n          var t = data;\n          if(typeof(t) === \"undefined\") {\n            t = this;\n          }\n          var version = t.schema_version;\n          if(!version) {\n            return 1;\n          }\n          else {\n            return version;\n          }\n        },\n        // Add event handler to remove edges when a node is removed\n        initialize : function() {\n            var _this = this;\n            this.on(\"remove:nodes\", function(_node) {\n                _this.get(\"edges\").remove(\n                        _this.get(\"edges\").filter(\n                                function(_edge) {\n                                    return _edge.get(\"from\") === _node ||\n                                           _edge.get(\"to\") === _node;\n                                }));\n            });\n        },\n        toJSON : function() {\n            var json = _.clone(this.attributes);\n            for ( var attr in json) {\n                if ((json[attr] instanceof Backbone.Model) ||\n                        (json[attr] instanceof Backbone.Collection) ||\n                        (json[attr] instanceof RenkanModel)) {\n                    json[attr] = json[attr].toJSON();\n                }\n            }\n            return _.omit(json, this.blacklist);\n        }\n    });\n\n    var RosterUser = Models.RosterUser = Backbone.Model\n            .extend({\n                type : \"roster_user\",\n                idAttribute : \"_id\",\n\n                constructor : function(options) {\n\n                    if (typeof options !== \"undefined\") {\n                        options._id = options._id ||\n                            options.id ||\n                            Models.getUID(this);\n                        options.title = options.title || \"(untitled \" + this.type + \")\";\n                        options.description = options.description || \"\";\n                        options.uri = options.uri || \"\";\n                        options.project = options.project || null;\n                        options.site_id = options.site_id || 0;\n\n                        if (typeof this.prepare === \"function\") {\n                            options = this.prepare(options);\n                        }\n                    }\n                    Backbone.Model.prototype.constructor.call(this, options);\n                },\n\n                validate : function() {\n                    if (!this.type) {\n                        return \"object has no type\";\n                    }\n                },\n\n                prepare : function(options) {\n                    options.color = options.color || \"#666666\";\n                    return options;\n                },\n\n                toJSON : function() {\n                    return {\n                        _id : this.get(\"_id\"),\n                        title : this.get(\"title\"),\n                        uri : this.get(\"uri\"),\n                        description : this.get(\"description\"),\n                        color : this.get(\"color\"),\n                        project : (this.get(\"project\") != null) ? this.get(\n                                \"project\").get(\"id\") : null,\n                        site_id : this.get(\"site_id\")\n                    };\n                }\n            });\n\n    var UsersList = Models.UsersList = Backbone.Collection.extend({\n        model : RosterUser\n    });\n\n})(window);\n","Rkns.defaults = {\n\n    language: (navigator.language || navigator.userLanguage || \"en\"),\n        /* GUI Language */\n    container: \"renkan\",\n        /* GUI Container DOM element ID */\n    search: [],\n        /* List of Search Engines */\n    bins: [],\n           /* List of Bins */\n    static_url: \"\",\n        /* URL for static resources */\n    popup_editor: true,\n        /* show the node editor as a popup inside the renkan view */\n    editor_panel: 'editor-panel',\n        /* GUI continer DOM element ID of the editor panel */\n    show_bins: true,\n        /* Show bins in left column */\n    properties: [],\n        /* Semantic properties for edges */\n    show_editor: true,\n        /* Show the graph editor... Setting this to \"false\" only shows the bins part ! */\n    read_only: false,\n        /* Allows editing of renkan without changing the rest of the GUI. Can be switched on/off on the fly to block/enable editing */\n    editor_mode: true,\n        /* Switch for Publish/Edit GUI. If editor_mode is false, read_only will be true.  */\n    manual_save: false,\n        /* In snapshot mode, clicking on the floppy will save a snapshot. Otherwise, it will show the connection status */\n    show_top_bar: true,\n        /* Show the top bar, (title, buttons, users) */\n    default_user_color: \"#303030\",\n    size_bug_fix: true,\n        /* Resize the canvas after load (fixes a bug on iPad and FF Mac) */\n    force_resize: false,\n    allow_double_click: true,\n        /* Allows Double Click to create a node on an empty background */\n    zoom_on_scroll: true,\n        /* Allows to use the scrollwheel to zoom */\n    element_delete_delay: 0,\n        /* Delay between clicking on the bin on an element and really deleting it\n           Set to 0 for delete confirm */\n    autoscale_padding: 50,\n    resize: true,\n\n    /* zoom options */\n    show_zoom: true,\n        /* show zoom buttons */\n    save_view: true,\n        /* show buttons to save view */\n    default_view: false,\n        /* Allows to load default view (zoom+offset) at start on read_only mode, instead of autoScale. the default_view will be the last */\n\n\n    /* TOP BAR BUTTONS */\n    show_search_field: true,\n    show_user_list: true,\n    user_name_editable: true,\n    user_color_editable: true,\n    show_user_color: true,\n    show_save_button: true,\n    show_export_button: true,\n    show_open_button: false,\n    show_addnode_button: true,\n    show_addedge_button: true,\n    show_bookmarklet: true,\n    show_fullscreen_button: true,\n    home_button_url: false,\n    home_button_title: \"Home\",\n\n    /* MINI-MAP OPTIONS */\n\n    show_minimap: true,\n        /* Show a small map at the bottom right */\n    minimap_width: 160,\n    minimap_height: 120,\n    minimap_padding: 20,\n    minimap_background_color: \"#ffffff\",\n    minimap_border_color: \"#cccccc\",\n    minimap_highlight_color: \"#ffff00\",\n    minimap_highlight_weight: 5,\n\n\n    /* EDGE/NODE COMMON OPTIONS */\n\n    buttons_background: \"#202020\",\n    buttons_label_color: \"#c000c0\",\n    buttons_label_font_size: 9,\n\n    ghost_opacity : 0.3,\n        /* opacity when the hidden element is revealed */\n    default_dash_array : [4, 5],\n        /* dash line genometry */\n\n    /* NODE DISPLAY OPTIONS */\n\n    show_node_circles: true,\n        /* Show circles for nodes */\n    clip_node_images: true,\n        /* Constraint node images to circles */\n    node_images_fill_mode: false,\n        /* Set to false for \"letterboxing\" (height/width of node adapted to show full image)\n           Set to true for \"crop\" (adapted to fill circle) */\n    node_size_base: 25,\n    node_stroke_width: 2,\n    node_stroke_max_width: 12,\n    selected_node_stroke_width: 4,\n    selected_node_stroke_max_width: 24,\n    node_stroke_witdh_scale: 5,\n    node_fill_color: \"#ffffff\",\n    highlighted_node_fill_color: \"#ffff00\",\n    node_label_distance: 5,\n        /* Vertical distance between node and label */\n    node_label_max_length: 60,\n        /* Maximum displayed text length */\n    label_untitled_nodes: \"(untitled)\",\n        /* Label to display on untitled nodes */\n    hide_nodes: true, \n        /* allow hide/show nodes */\n    change_shapes: true,\n        /* Change shapes enabled */\n    change_types: true,\n    /* Change type enabled */\n    \n    /* NODE EDITOR TEMPLATE*/\n    \n    node_editor_templates: {\n        \"default\": \"templates/nodeeditor_readonly.html\",\n        \"video\": \"templates/nodeeditor_video.html\"\n    },\n\n    /* EDGE DISPLAY OPTIONS */\n\n    edge_stroke_width: 2,\n    edge_stroke_max_width: 12,\n    selected_edge_stroke_width: 4,\n    selected_edge_stroke_max_width: 24,\n    edge_stroke_witdh_scale: 5,\n\n    edge_label_distance: 0,\n    edge_label_max_length: 20,\n    edge_arrow_length: 18,\n    edge_arrow_width: 12,\n    edge_arrow_max_width: 32,\n    edge_gap_in_bundles: 12,\n    label_untitled_edges: \"\",\n\n    /* CONTEXTUAL DISPLAY (TOOLTIP OR EDITOR) OPTIONS */\n\n    tooltip_width: 275,\n    tooltip_padding: 10,\n    tooltip_margin: 15,\n    tooltip_arrow_length : 20,\n    tooltip_arrow_width : 40,\n    tooltip_top_color: \"#f0f0f0\",\n    tooltip_bottom_color: \"#d0d0d0\",\n    tooltip_border_color: \"#808080\",\n    tooltip_border_width: 1,\n\n    richtext_editor_config: {\n        toolbarGroups: [\n            { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },\n            { name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },\n            '/',\n\t        { name: 'styles'},\n        ],\n        removePlugins : 'colorbutton,find,flash,font,forms,iframe,image,newpage,smiley,specialchar,stylescombo,templates',\n    },\n\n    /* NODE EDITOR OPTIONS */\n\n    show_node_editor_uri: true,\n    show_node_editor_description: true,\n    show_node_editor_description_richtext: true,\n    show_node_editor_size: true,\n    show_node_editor_style: true,\n    show_node_editor_style_color: true,\n    show_node_editor_style_dash: true,\n    show_node_editor_style_thickness: true,\n    show_node_editor_image: true,\n    show_node_editor_creator: true,\n    allow_image_upload: true,\n    uploaded_image_max_kb: 500,\n\n\n    /* NODE TOOLTIP OPTIONS */\n\n    show_node_tooltip_uri: true,\n    show_node_tooltip_description: true,\n    show_node_tooltip_color: true,\n    show_node_tooltip_image: true,\n    show_node_tooltip_creator: true,\n\n    /* EDGE EDITOR OPTIONS */\n\n    show_edge_editor_uri: true,\n    show_edge_editor_style: true,\n    show_edge_editor_style_color: true,\n    show_edge_editor_style_dash: true,\n    show_edge_editor_style_thickness: true,\n    show_edge_editor_style_arrow: true,\n    show_edge_editor_direction: true,\n    show_edge_editor_nodes: true,\n    show_edge_editor_creator: true,\n\n    /* EDGE TOOLTIP OPTIONS */\n\n    show_edge_tooltip_uri: true,\n    show_edge_tooltip_color: true,\n    show_edge_tooltip_nodes: true,\n    show_edge_tooltip_creator: true,\n\n};\n","Rkns.i18n = {\n    fr: {\n        \"Edit Node\": \"Édition d’un nœud\",\n        \"Edit Edge\": \"Édition d’un lien\",\n        \"Title:\": \"Titre :\",\n        \"URI:\": \"URI :\",\n        \"Description:\": \"Description :\",\n        \"From:\": \"De :\",\n        \"To:\": \"Vers :\",\n        \"Image\": \"Image\",\n        \"Image URL:\": \"URL d'Image\",\n        \"Choose Image File:\": \"Choisir un fichier image\",\n        \"Full Screen\": \"Mode plein écran\",\n        \"Add Node\": \"Ajouter un nœud\",\n        \"Add Edge\": \"Ajouter un lien\",\n        \"Save Project\": \"Enregistrer le projet\",\n        \"Open Project\": \"Ouvrir un projet\",\n        \"Auto-save enabled\": \"Enregistrement automatique activé\",\n        \"Connection lost\": \"Connexion perdue\",\n        \"Created by:\": \"Créé par :\",\n        \"Zoom In\": \"Agrandir l’échelle\",\n        \"Zoom Out\": \"Rapetisser l’échelle\",\n        \"Edit\": \"Éditer\",\n        \"Remove\": \"Supprimer\",\n        \"Cancel deletion\": \"Annuler la suppression\",\n        \"Link to another node\": \"Créer un lien\",\n        \"Enlarge\": \"Agrandir\",\n        \"Shrink\": \"Rétrécir\",\n        \"Click on the background canvas to add a node\": \"Cliquer sur le fond du graphe pour rajouter un nœud\",\n        \"Click on a first node to start the edge\": \"Cliquer sur un premier nœud pour commencer le lien\",\n        \"Click on a second node to complete the edge\": \"Cliquer sur un second nœud pour terminer le lien\",\n        \"Wikipedia\": \"Wikipédia\",\n        \"Wikipedia in \": \"Wikipédia en \",\n        \"French\": \"Français\",\n        \"English\": \"Anglais\",\n        \"Japanese\": \"Japonais\",\n        \"Untitled project\": \"Projet sans titre\",\n        \"Lignes de Temps\": \"Lignes de Temps\",\n        \"Loading, please wait\": \"Chargement en cours, merci de patienter\",\n        \"Edge color:\": \"Couleur :\",\n        \"Dash:\": \"Point. :\",\n        \"Thickness:\": \"Epaisseur :\",\n        \"Arrow:\": \"Flèche :\",\n        \"Node color:\": \"Couleur :\",\n        \"Choose color\": \"Choisir une couleur\",\n        \"Change edge direction\": \"Changer le sens du lien\",\n        \"Do you really wish to remove node \": \"Voulez-vous réellement supprimer le nœud \",\n        \"Do you really wish to remove edge \": \"Voulez-vous réellement supprimer le lien \",\n        \"This file is not an image\": \"Ce fichier n'est pas une image\",\n        \"Image size must be under \": \"L'image doit peser moins de \",\n        \"Size:\": \"Taille :\",\n        \"KB\": \"ko\",\n        \"Choose from vocabulary:\": \"Choisir dans un vocabulaire :\",\n        \"SKOS Documentation properties\": \"SKOS: Propriétés documentaires\",\n        \"has note\": \"a pour note\",\n        \"has example\": \"a pour exemple\",\n        \"has definition\": \"a pour définition\",\n        \"SKOS Semantic relations\": \"SKOS: Relations sémantiques\",\n        \"has broader\": \"a pour concept plus large\",\n        \"has narrower\": \"a pour concept plus étroit\",\n        \"has related\": \"a pour concept apparenté\",\n        \"Dublin Core Metadata\": \"Métadonnées Dublin Core\",\n        \"has contributor\": \"a pour contributeur\",\n        \"covers\": \"couvre\",\n        \"created by\": \"créé par\",\n        \"has date\": \"a pour date\",\n        \"published by\": \"édité par\",\n        \"has source\": \"a pour source\",\n        \"has subject\": \"a pour sujet\",\n        \"Dragged resource\": \"Ressource glisée-déposée\",\n        \"Search the Web\": \"Rechercher en ligne\",\n        \"Search in Bins\": \"Rechercher dans les chutiers\",\n        \"Close bin\": \"Fermer le chutier\",\n        \"Refresh bin\": \"Rafraîchir le chutier\",\n        \"(untitled)\": \"(sans titre)\",\n        \"Select contents:\": \"Sélectionner des contenus :\",\n        \"Drag items from this website, drop them in Renkan\": \"Glissez des éléments de ce site web vers Renkan\",\n        \"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\",\n        \"Shapes available\": \"Formes disponibles\",\n        \"Circle\": \"Cercle\",\n        \"Square\": \"Carré\",\n        \"Diamond\": \"Losange\",\n        \"Hexagone\": \"Hexagone\",\n        \"Ellipse\": \"Ellipse\",\n        \"Star\": \"Étoile\",\n        \"Cloud\": \"Nuage\",\n        \"Triangle\": \"Triangle\",\n        \"Zoom Fit\": \"Ajuster le Zoom\",\n        \"Download Project\": \"Télécharger le projet\",\n        \"Save view\": \"Sauver la vue\",\n        \"View saved view\": \"Restaurer la Vue\",\n        \"Renkan \\'Drag-to-Add\\' bookmarklet\": \"Renkan \\'Deplacer-Pour-Ajouter\\' Signet\",\n        \"(unknown user)\":\"(non authentifié)\",\n        \"<unknown user>\":\"<non authentifié>\",\n        \"Search in graph\":\"Rechercher dans carte\",\n        \"Search in \" : \"Chercher dans \"\n    }\n};\n","/* Saves the Full JSON at each modification */\n\nRkns.jsonIO = function(_renkan, _opts) {\n    var _proj = _renkan.project;\n    if (typeof _opts.http_method === \"undefined\") {\n        _opts.http_method = 'PUT';\n    }\n    var _load = function() {\n        _renkan.renderer.redrawActive = false;\n        _proj.set({\n            loadingStatus : true\n        });\n        Rkns.$.getJSON(_opts.url, function(_data) {\n            _renkan.dataloader.load(_data);\n            _proj.set({\n                loadingStatus : false\n            });\n            _proj.set({\n                saveStatus : 0\n            });\n            _renkan.renderer.redrawActive = true;\n            _renkan.renderer.fixSize();\n        });\n    };\n    var _save = function() {\n        _proj.set({\n            saveStatus : 2\n        });\n        var _data = _proj.toJSON();\n        if (!_renkan.read_only) {\n            Rkns.$.ajax({\n                type : _opts.http_method,\n                url : _opts.url,\n                contentType : \"application/json\",\n                data : JSON.stringify(_data),\n                success : function(data, textStatus, jqXHR) {\n                    _proj.set({\n                        saveStatus : 0\n                    });\n                }\n            });\n        }\n\n    };\n    var _thrSave = Rkns._.throttle(function() {\n        setTimeout(_save, 100);\n    }, 1000);\n    _proj.on(\"add:nodes add:edges add:users add:views\", function(_model) {\n        _model.on(\"change remove\", function(_model) {\n            _thrSave();\n        });\n        _thrSave();\n    });\n    _proj.on(\"change\", function() {\n        if (!(_proj.changedAttributes.length === 1 && _proj\n                .hasChanged('saveStatus'))) {\n            _thrSave();\n        }\n    });\n\n    _load();\n};\n","/* Saves the Full JSON once */\n\nRkns.jsonIOSaveOnClick = function(_renkan, _opts) {\n    var _proj = _renkan.project,\n        _saveWarn = false,\n        _onLeave = function() {\n            return \"Project not saved\";\n        };\n    if (typeof _opts.http_method === \"undefined\") {\n        _opts.http_method = 'POST';\n    }\n    var _load = function() {\n        var getdata = {},\n            rx = /id=([^&#?=]+)/,\n            matches = document.location.hash.match(rx);\n        if (matches) {\n            getdata.id = matches[1];\n        }\n        Rkns.$.ajax({\n            url: _opts.url,\n            data: getdata,\n            beforeSend: function(){\n            \t_proj.set({loadingStatus:true});\n            },\n            success: function(_data) {\n                _renkan.dataloader.load(_data);\n                _proj.set({loadingStatus:false});\n                _proj.set({saveStatus:0});\n                _renkan.renderer.autoScale();\n            }\n        });\n    };\n    var _save = function() {\n        _proj.set(\"saved_at\", new Date());\n        var _data = _proj.toJSON();\n        Rkns.$.ajax({\n            type: _opts.http_method,\n            url: _opts.url,\n            contentType: \"application/json\",\n            data: JSON.stringify(_data),\n            beforeSend: function(){\n            \t_proj.set({saveStatus:2});\n            },\n            success: function(data, textStatus, jqXHR) {\n                $(window).off(\"beforeunload\", _onLeave);\n                _saveWarn = false;\n                _proj.set({saveStatus:0});\n                //document.location.hash = \"#id=\" + data.id;\n                //$(\".Rk-Notifications\").text(\"Saved as \"+document.location.href).fadeIn().delay(2000).fadeOut();\n            }\n        });\n    };\n    var _checkLeave = function() {\n    \t_proj.set({saveStatus:1});\n\n        var title = _proj.get(\"title\");\n        if (title && _proj.get(\"nodes\").length) {\n            $(\".Rk-Save-Button\").removeClass(\"disabled\");\n        } else {\n            $(\".Rk-Save-Button\").addClass(\"disabled\");\n        }\n        if (title) {\n            $(\".Rk-PadTitle\").css(\"border-color\",\"#333333\");\n        }\n        if (!_saveWarn) {\n            _saveWarn = true;\n            $(window).on(\"beforeunload\", _onLeave);\n        }\n    };\n    _load();\n    _proj.on(\"add:nodes add:edges add:users change\", function(_model) {\n\t    _model.on(\"change remove\", function(_model) {\n\t    \tif(!(_model.changedAttributes.length === 1 && _model.hasChanged('saveStatus'))) {\n\t    \t\t_checkLeave();\n\t    \t}\n\t    });\n\t\tif(!(_proj.changedAttributes.length === 1 && _proj.hasChanged('saveStatus'))) {\n\t\t    _checkLeave();\n    \t}\n    });\n    _renkan.renderer.save = function() {\n        if ($(\".Rk-Save-Button\").hasClass(\"disabled\")) {\n            if (!_proj.get(\"title\")) {\n                $(\".Rk-PadTitle\").css(\"border-color\",\"#ff0000\");\n            }\n        } else {\n            _save();\n        }\n    };\n};\n","(function(Rkns) {\n\"use strict\";\n\nvar _ = Rkns._;\n\nvar Ldt = Rkns.Ldt = {};\n\nvar Bin = Ldt.Bin = function(_renkan, _opts) {\n    if (_opts.ldt_type) {\n        var Resclass = Ldt[_opts.ldt_type+\"Bin\"];\n        if (Resclass) {\n            return new Resclass(_renkan, _opts);\n        }\n    }\n    console.error(\"No such LDT Bin Type\");\n};\n\nvar ProjectBin = Ldt.ProjectBin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nProjectBin.prototype.tagTemplate = renkanJST['templates/ldtjson-bin/tagtemplate.html'];\n\nProjectBin.prototype.annotationTemplate = renkanJST['templates/ldtjson-bin/annotationtemplate.html'];\n\nProjectBin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.proj_id = _opts.project_id;\n    this.ldt_platform = _opts.ldt_platform || \"http://ldt.iri.centrepompidou.fr/\";\n    this.title_$.html(_opts.title);\n    this.title_icon_$.addClass('Rk-Ldt-Title-Icon');\n    this.refresh();\n};\n\nProjectBin.prototype.render = function(searchbase) {\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    function highlight(_text) {\n        var _e = _(_text).escape();\n        return search.isempty ? _e : search.replace(_e, \"<span class='searchmatch'>$1</span>\");\n    }\n    function convertTC(_ms) {\n        function pad(_n) {\n            var _res = _n.toString();\n            while (_res.length < 2) {\n                _res = '0' + _res;\n            }\n            return _res;\n        }\n        var _totalSeconds = Math.abs(Math.floor(_ms/1000)),\n            _hours = Math.floor(_totalSeconds / 3600),\n            _minutes = (Math.floor(_totalSeconds / 60) % 60),\n            _seconds = _totalSeconds % 60,\n            _res = '';\n        if (_hours) {\n            _res += pad(_hours) + ':';\n        }\n        _res += pad(_minutes) + ':' + pad(_seconds);\n        return _res;\n    }\n\n    var _html = '<li><h3>Tags</h3></li>',\n        _projtitle = this.data.meta[\"dc:title\"],\n        _this = this,\n        count = 0;\n    _this.title_$.text('LDT Project: \"' + _projtitle + '\"');\n    _.map(_this.data.tags,function(_tag) {\n        var _title = _tag.meta[\"dc:title\"];\n        if (!search.isempty && !search.test(_title)) {\n            return;\n        }\n        count++;\n        _html += _this.tagTemplate({\n            ldt_platform: _this.ldt_platform,\n            title: _title,\n            htitle: highlight(_title),\n            encodedtitle : encodeURIComponent(_title),\n            static_url: _this.renkan.options.static_url\n        });\n    });\n    _html += '<li><h3>Annotations</h3></li>';\n    _.map(_this.data.annotations,function(_annotation) {\n        var _description = _annotation.content.description,\n            _title = _annotation.content.title.replace(_description,\"\");\n        if (!search.isempty && !search.test(_title) && !search.test(_description)) {\n            return;\n        }\n        count++;\n        var _duration = _annotation.end - _annotation.begin,\n            _img = (\n                (_annotation.content && _annotation.content.img && _annotation.content.img.src) ?\n                  _annotation.content.img.src :\n                  ( _duration ? _this.renkan.options.static_url+\"img/ldt-segment.png\" : _this.renkan.options.static_url+\"img/ldt-point.png\" )\n            );\n        _html += _this.annotationTemplate({\n            ldt_platform: _this.ldt_platform,\n            title: _title,\n            htitle: highlight(_title),\n            description: _description,\n            hdescription: highlight(_description),\n            start: convertTC(_annotation.begin),\n            end: convertTC(_annotation.end),\n            duration: convertTC(_duration),\n            mediaid: _annotation.media,\n            annotationid: _annotation.id,\n            image: _img,\n            static_url: _this.renkan.options.static_url\n        });\n    });\n\n    this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nProjectBin.prototype.refresh = function() {\n    var _this = this;\n    Rkns.$.ajax({\n        url: this.ldt_platform + 'ldtplatform/ldt/cljson/id/' + this.proj_id,\n        dataType: \"jsonp\",\n        success: function(_data) {\n            _this.data = _data;\n            _this.render();\n        }\n    });\n};\n\nvar Search = Ldt.Search = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.lang = _opts.lang || \"en\";\n};\n\nSearch.prototype.getBgClass = function() {\n    return \"Rk-Ldt-Icon\";\n};\n\nSearch.prototype.getSearchTitle = function() {\n    return this.renkan.translate(\"Lignes de Temps\");\n};\n\nSearch.prototype.search = function(_q) {\n    this.renkan.tabs.push(\n        new ResultsBin(this.renkan, {\n            search: _q\n        })\n    );\n};\n\nvar ResultsBin = Ldt.ResultsBin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nResultsBin.prototype.segmentTemplate = renkanJST['templates/ldtjson-bin/segmenttemplate.html'];\n\nResultsBin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.ldt_platform = _opts.ldt_platform || \"http://ldt.iri.centrepompidou.fr/\";\n    this.max_results = _opts.max_results || 50;\n    this.search = _opts.search;\n    this.title_$.html('Lignes de Temps: \"' + _opts.search + '\"');\n    this.title_icon_$.addClass('Rk-Ldt-Title-Icon');\n    this.refresh();\n};\n\nResultsBin.prototype.render = function(searchbase) {\n    if (!this.data) {\n        return;\n    }\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    var highlightrx = (search.isempty ? Rkns.Utils.regexpFromTextOrArray(this.search) : search);\n    function highlight(_text) {\n        return highlightrx.replace(_(_text).escape(), \"<span class='searchmatch'>$1</span>\");\n    }\n    function convertTC(_ms) {\n        function pad(_n) {\n            var _res = _n.toString();\n            while (_res.length < 2) {\n                _res = '0' + _res;\n            }\n            return _res;\n        }\n        var _totalSeconds = Math.abs(Math.floor(_ms/1000)),\n            _hours = Math.floor(_totalSeconds / 3600),\n            _minutes = (Math.floor(_totalSeconds / 60) % 60),\n            _seconds = _totalSeconds % 60,\n            _res = '';\n        if (_hours) {\n            _res += pad(_hours) + ':';\n        }\n        _res += pad(_minutes) + ':' + pad(_seconds);\n        return _res;\n    }\n\n    var _html = '',\n        _this = this,\n        count = 0;\n    _.each(this.data.objects,function(_segment) {\n        var _description = _segment.abstract,\n            _title = _segment.title;\n        if (!search.isempty && !search.test(_title) && !search.test(_description)) {\n            return;\n        }\n        count++;\n        var _duration = _segment.duration,\n            _begin = _segment.start_ts,\n            _end = + _segment.duration + _begin,\n            _img = (\n                _duration ?\n                  _this.renkan.options.static_url + \"img/ldt-segment.png\" :\n                  _this.renkan.options.static_url + \"img/ldt-point.png\"\n            );\n        _html += _this.segmentTemplate({\n            ldt_platform: _this.ldt_platform,\n            title: _title,\n            htitle: highlight(_title),\n            description: _description,\n            hdescription: highlight(_description),\n            start: convertTC(_begin),\n            end: convertTC(_end),\n            duration: convertTC(_duration),\n            mediaid: _segment.iri_id,\n            //projectid: _segment.project_id,\n            //cuttingid: _segment.cutting_id,\n            annotationid: _segment.element_id,\n            image: _img\n        });\n    });\n\n    this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nResultsBin.prototype.refresh = function() {\n    var _this = this;\n    Rkns.$.ajax({\n        url: this.ldt_platform + 'ldtplatform/api/ldt/1.0/segments/search/',\n        data: {\n            format: \"jsonp\",\n            q: this.search,\n            limit: this.max_results\n        },\n        dataType: \"jsonp\",\n        success: function(_data) {\n            _this.data = _data;\n            _this.render();\n        }\n    });\n};\n\n})(window.Rkns);\n","Rkns.ResourceList = {};\n\nRkns.ResourceList.Bin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nRkns.ResourceList.Bin.prototype.resultTemplate = renkanJST['templates/list-bin.html'];\n\nRkns.ResourceList.Bin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.title_$.html(_opts.title);\n    if (_opts.list) {\n        this.data = _opts.list;\n    }\n    this.refresh();\n};\n\nRkns.ResourceList.Bin.prototype.render = function(searchbase) {\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    function highlight(_text) {\n        var _e = _(_text).escape();\n        return search.isempty ? _e : search.replace(_e, \"<span class='searchmatch'>$1</span>\");\n    }\n    var _html = \"\",\n        _this = this,\n        count = 0;\n    Rkns._.each(this.data,function(_item) {\n        var _element;\n        if (typeof _item === \"string\") {\n            if (/^(https?:\\/\\/|www)/.test(_item)) {\n                _element = { url: _item };\n            } else {\n                _element = { title: _item.replace(/[:,]?\\s?(https?:\\/\\/|www)[\\d\\w\\/.&?=#%-_]+\\s?/,'').trim() };\n                var _match = _item.match(/(https?:\\/\\/|www)[\\d\\w\\/.&?=#%-_]+/);\n                if (_match) {\n                    _element.url = _match[0];\n                }\n                if (_element.title.length > 80) {\n                    _element.description = _element.title;\n                    _element.title = _element.title.replace(/^(.{30,60})\\s.+$/,'$1…');\n                }\n            }\n        } else {\n            _element = _item;\n        }\n        var title = _element.title || (_element.url || \"\").replace(/^https?:\\/\\/(www\\.)?/,'').replace(/^(.{40}).+$/,'$1…'),\n            url = _element.url || \"\",\n            description = _element.description || \"\",\n            image = _element.image || \"\";\n        if (url && !/^https?:\\/\\//.test(url)) {\n            url = 'http://' + url;\n        }\n        if (!search.isempty && !search.test(title) && !search.test(description)) {\n            return;\n        }\n        count++;\n        _html += _this.resultTemplate({\n            url: url,\n            title: title,\n            htitle: highlight(title),\n            image: image,\n            description: description,\n            hdescription: highlight(description),\n            static_url: _this.renkan.options.static_url\n        });\n    });\n    _this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nRkns.ResourceList.Bin.prototype.refresh = function() {\n    if (this.data) {\n        this.render();\n    }\n};\n","Rkns.Wikipedia = {\n};\n\nRkns.Wikipedia.Search = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.lang = _opts.lang || \"en\";\n};\n\nRkns.Wikipedia.Search.prototype.getBgClass = function() {\n    return \"Rk-Wikipedia-Search-Icon Rk-Wikipedia-Lang-\" + this.lang;\n};\n\nRkns.Wikipedia.Search.prototype.getSearchTitle = function() {\n    var langs = {\n        \"fr\": \"French\",\n        \"en\": \"English\",\n        \"ja\": \"Japanese\"\n    };\n    if (langs[this.lang]) {\n        return this.renkan.translate(\"Wikipedia in \") + this.renkan.translate(langs[this.lang]);\n    } else {\n        return this.renkan.translate(\"Wikipedia\") + \" [\" + this.lang + \"]\";\n    }\n};\n\nRkns.Wikipedia.Search.prototype.search = function(_q) {\n    this.renkan.tabs.push(\n        new Rkns.Wikipedia.Bin(this.renkan, {\n            lang: this.lang,\n            search: _q\n        })\n    );\n};\n\nRkns.Wikipedia.Bin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nRkns.Wikipedia.Bin.prototype.resultTemplate = renkanJST['templates/wikipedia-bin/resulttemplate.html'];\n\nRkns.Wikipedia.Bin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.search = _opts.search;\n    this.lang = _opts.lang || \"en\";\n    this.title_icon_$.addClass('Rk-Wikipedia-Title-Icon Rk-Wikipedia-Lang-' + this.lang);\n    this.title_$.html(this.search).addClass(\"Rk-Wikipedia-Title\");\n    this.refresh();\n};\n\nRkns.Wikipedia.Bin.prototype.render = function(searchbase) {\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    var highlightrx = (search.isempty ? Rkns.Utils.regexpFromTextOrArray(this.search) : search);\n    function highlight(_text) {\n        return highlightrx.replace(_(_text).escape(), \"<span class='searchmatch'>$1</span>\");\n    }\n    var _html = \"\",\n        _this = this,\n        count = 0;\n    Rkns._.each(this.data.query.search, function(_result) {\n        var title = _result.title,\n            url = \"http://\" + _this.lang + \".wikipedia.org/wiki/\" + encodeURI(title.replace(/ /g,\"_\")),\n            description = Rkns.$('<div>').html(_result.snippet).text();\n        if (!search.isempty && !search.test(title) && !search.test(description)) {\n            return;\n        }\n        count++;\n        _html += _this.resultTemplate({\n            url: url,\n            title: title,\n            htitle: highlight(title),\n            description: description,\n            hdescription: highlight(description),\n            static_url: _this.renkan.options.static_url\n        });\n    });\n    _this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nRkns.Wikipedia.Bin.prototype.refresh = function() {\n    var _this = this;\n    Rkns.$.ajax({\n        url: \"http://\" + _this.lang + \".wikipedia.org/w/api.php?action=query&list=search&srsearch=\" + encodeURIComponent(this.search) + \"&format=json\",\n        dataType: \"jsonp\",\n        success: function(_data) {\n            _this.data = _data;\n            _this.render();\n        }\n    });\n};\n","\ndefine('renderer/baserepresentation',['jquery', 'underscore'], function ($, _) {\n    'use strict';\n\n    /* Rkns.Renderer._BaseRepresentation Class */\n\n    /* In Renkan, a \"Representation\" is a sort of ViewModel (in the MVVM paradigm) and bridges the gap between\n     * models (written with Backbone.js) and the view (written with Paper.js)\n     * Renkan's representations all inherit from Rkns.Renderer._BaseRepresentation '*/\n\n    var _BaseRepresentation = function(_renderer, _model) {\n        if (typeof _renderer !== \"undefined\") {\n            this.renderer = _renderer;\n            this.renkan = _renderer.renkan;\n            this.project = _renderer.renkan.project;\n            this.options = _renderer.renkan.options;\n            this.model = _model;\n            if (this.model) {\n                var _this = this;\n                this._changeBinding = function() {\n                    _this.redraw({change: true});\n                };\n                this._removeBinding = function() {\n                    _renderer.removeRepresentation(_this);\n                    _.defer(function() {\n                        _renderer.redraw();\n                    });\n                };\n                this._selectBinding = function() {\n                    _this.select();\n                };\n                this._unselectBinding = function() {\n                    _this.unselect();\n                };\n                this.model.on(\"change\", this._changeBinding );\n                this.model.on(\"remove\", this._removeBinding );\n                this.model.on(\"select\", this._selectBinding );\n                this.model.on(\"unselect\", this._unselectBinding );\n            }\n        }\n    };\n\n    /* Rkns.Renderer._BaseRepresentation Methods */\n\n    _(_BaseRepresentation.prototype).extend({\n        _super: function(_func) {\n            return _BaseRepresentation.prototype[_func].apply(this, Array.prototype.slice.call(arguments, 1));\n        },\n        redraw: function() {},\n        moveTo: function() {},\n        show: function() { return \"BaseRepresentation.show\"; },\n        hide: function() {},\n        select: function() {\n            if (this.model) {\n                this.model.trigger(\"selected\");\n            }\n        },\n        unselect: function() {\n            if (this.model) {\n                this.model.trigger(\"unselected\");\n            }\n        },\n        highlight: function() {},\n        unhighlight: function() {},\n        mousedown: function() {},\n        mouseup: function() {\n            if (this.model) {\n                this.model.trigger(\"clicked\");\n            }\n        },\n        destroy: function() {\n            if (this.model) {\n                this.model.off(\"change\", this._changeBinding );\n                this.model.off(\"remove\", this._removeBinding );\n                this.model.off(\"select\", this._selectBinding );\n                this.model.off(\"unselect\", this._unselectBinding );\n            }\n        }\n    }).value();\n\n    /* End of Rkns.Renderer._BaseRepresentation Class */\n\n    return _BaseRepresentation;\n\n});\n\ndefine('requtils',[], function ($, _) {\n    'use strict';\n    return {\n        getUtils: function(){\n            return window.Rkns.Utils;\n        },\n        getRenderer: function(){\n            return window.Rkns.Renderer;\n        }\n    };\n\n});\n\n\ndefine('renderer/basebutton',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* Rkns.Renderer._BaseButton Class */\n\n    /* BaseButton is extended by contextual buttons that appear when hovering on nodes and edges */\n\n    var _BaseButton = Utils.inherit(BaseRepresentation);\n\n    _(_BaseButton.prototype).extend({\n        moveTo: function(_pos) {\n            this.sector.moveTo(_pos);\n        },\n        show: function() {\n            this.sector.show();\n        },\n        hide: function() {\n            this.sector.hide();\n        },\n        select: function() {\n            this.sector.select();\n        },\n        unselect: function(_newTarget) {\n            this.sector.unselect();\n            if (!_newTarget || (_newTarget !== this.source_representation && _newTarget.source_representation !== this.source_representation)) {\n                this.source_representation.unselect();\n            }\n        },\n        destroy: function() {\n            this.sector.destroy();\n        }\n    }).value();\n\n    return _BaseButton;\n\n});\n\n\ndefine('renderer/shapebuilder',[], function () {\n    'use strict';\n\n    var cloud_path = \"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\";\n    /* ShapeBuilder Begin */\n\n    var builders = {\n        \"circle\":{\n            getShape: function() {\n                return new paper.Path.Circle([0, 0], 1);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Circle(center, radius);\n            }\n        },\n        \"rectangle\":{\n            getShape: function() {\n                return new paper.Path.Rectangle([-2, -2], [2, 2]);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Rectangle([-radius, -radius], [radius*2, radius*2]);\n            }\n        },\n        \"ellipse\":{\n            getShape: function() {\n                return new paper.Path.Ellipse(new paper.Rectangle([-2, -1], [2, 1]));\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Ellipse(new paper.Rectangle([-radius, -radius/2], [radius*2, radius]));\n            }\n        },\n        \"polygon\":{\n            getShape: function() {\n                return new paper.Path.RegularPolygon([0, 0], 6, 1);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.RegularPolygon(center, 6, radius);\n            }\n        },\n        \"diamond\":{\n            getShape: function() {\n                var d = new paper.Path.Rectangle([-Math.SQRT2, -Math.SQRT2], [Math.SQRT2, Math.SQRT2]);\n                d.rotate(45);\n                return d;\n            },\n            getImageShape: function(center, radius) {\n                var d = new paper.Path.Rectangle([-radius*Math.SQRT2/2, -radius*Math.SQRT2/2], [radius*Math.SQRT2, radius*Math.SQRT2]);\n                d.rotate(45);\n                return d;\n            }\n        },\n        \"star\":{\n            getShape: function() {\n                return new paper.Path.Star([0, 0], 8, 1, 0.7);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Star(center, 8, radius*1, radius*0.7);\n            }\n        },\n        \"cloud\": {\n            getShape: function() {\n                var path = new paper.Path(cloud_path);\n                return path;\n\n            },\n            getImageShape: function(center, radius) {\n                var path = new paper.Path(cloud_path);\n                path.scale(radius);\n                path.translate(center);\n                return path;\n            }\n        },\n        \"triangle\": {\n            getShape: function() {\n                return new paper.Path.RegularPolygon([0,0], 3, 1);\n            },\n            getImageShape: function(center, radius) {\n                var shape = new paper.Path.RegularPolygon([0,0], 3, 1);\n                shape.scale(radius);\n                shape.translate(center);\n                return shape;\n            }\n        },\n        \"svg\": function(path){\n            return {\n                getShape: function() {\n                    return new paper.Path(path);\n                },\n                getImageShape: function(center, radius) {\n                    // No calcul for the moment\n                    return new paper.Path();\n                }\n            };\n        }\n    };\n\n    var ShapeBuilder = function (shape){\n        if(shape === null || typeof shape === \"undefined\"){\n            shape = \"circle\";\n        }\n        if(shape.substr(0,4)===\"svg:\"){\n            return builders.svg(shape.substr(4));\n        }\n        if(!(shape in builders)){\n            shape = \"circle\";\n        }\n        return builders[shape];\n    };\n\n    ShapeBuilder.builders = builders;\n\n    return ShapeBuilder;\n\n});\n\ndefine('renderer/noderepr',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation', 'renderer/shapebuilder'], function ($, _, requtils, BaseRepresentation, ShapeBuilder) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* Rkns.Renderer.Node Class */\n\n    /* The representation for the node : A circle, with an image inside and a text label underneath.\n     * The circle and the image are drawn on canvas and managed by Paper.js.\n     * The text label is an HTML node, managed by jQuery. */\n\n    //var NodeRepr = Renderer.Node = Utils.inherit(Renderer._BaseRepresentation);\n    var NodeRepr = Utils.inherit(BaseRepresentation);\n\n    _(NodeRepr.prototype).extend({\n        _init: function() {\n            this.renderer.node_layer.activate();\n            this.type = \"Node\";\n            this.buildShape();\n            this.hidden = false;\n            this.ghost= false;\n            if (this.options.show_node_circles) {\n                this.circle.strokeWidth = this.options.node_stroke_width;\n                this.h_ratio = 1;\n            } else {\n                this.h_ratio = 0;\n            }\n            this.title = $('<div class=\"Rk-Label\">').appendTo(this.renderer.labels_$);\n\n            if (this.options.editor_mode) {\n                var Renderer = requtils.getRenderer();\n                this.normal_buttons = [\n                                       new Renderer.NodeEditButton(this.renderer, null),\n                                       new Renderer.NodeRemoveButton(this.renderer, null),\n                                       new Renderer.NodeLinkButton(this.renderer, null),\n                                       new Renderer.NodeEnlargeButton(this.renderer, null),\n                                       new Renderer.NodeShrinkButton(this.renderer, null)\n                                       ];\n                if (this.options.hide_nodes){\n                    this.normal_buttons.push(\n                            new Renderer.NodeHideButton(this.renderer, null),\n                            new Renderer.NodeShowButton(this.renderer, null)\n                            );\n                }\n                this.pending_delete_buttons = [\n                                               new Renderer.NodeRevertButton(this.renderer, null)\n                                               ];\n                this.all_buttons = this.normal_buttons.concat(this.pending_delete_buttons);\n\n                for (var i = 0; i < this.all_buttons.length; i++) {\n                    this.all_buttons[i].source_representation = this;\n                }\n                this.active_buttons = [];\n            } else {\n                this.active_buttons = this.all_buttons = [];\n            }\n            this.last_circle_radius = 1;\n\n            if (this.renderer.minimap) {\n                this.renderer.minimap.node_layer.activate();\n                this.minimap_circle = new paper.Path.Circle([0, 0], 1);\n                this.minimap_circle.__representation = this.renderer.minimap.miniframe.__representation;\n                this.renderer.minimap.node_group.addChild(this.minimap_circle);\n            }\n        },\n        _getStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.node_stroke_width + (thickness-1) * (this.options.node_stroke_max_width - this.options.node_stroke_width) / (this.options.node_stroke_witdh_scale-1);\n        },\n        _getSelectedStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.selected_node_stroke_width + (thickness-1) * (this.options.selected_node_stroke_max_width - this.options.selected_node_stroke_width) / (this.options.node_stroke_witdh_scale-1);\n        },\n        buildShape: function(){\n            if( 'shape' in this.model.changed ) {\n                delete this.img;\n            }\n            if(this.circle){\n                this.circle.remove();\n                delete this.circle;\n            }\n            // \"circle\" \"rectangle\" \"ellipse\" \"polygon\" \"star\" \"diamond\"\n            this.shapeBuilder = new ShapeBuilder(this.model.get(\"shape\"));\n            this.circle = this.shapeBuilder.getShape();\n            this.circle.__representation = this;\n            this.circle.sendToBack();\n            this.last_circle_radius = 1;\n        },\n        redraw: function(options) {\n            if( 'shape' in this.model.changed && 'change' in options && options.change ) {\n            //if( 'shape' in this.model.changed ) {\n                this.buildShape();\n            }\n            var _model_coords = new paper.Point(this.model.get(\"position\")),\n                _baseRadius = this.options.node_size_base * Math.exp((this.model.get(\"size\") || 0) * Utils._NODE_SIZE_STEP);\n            if (!this.is_dragging || !this.paper_coords) {\n                this.paper_coords = this.renderer.toPaperCoords(_model_coords);\n            }\n            this.circle_radius = _baseRadius * this.renderer.scale;\n            if (this.last_circle_radius !== this.circle_radius) {\n                this.all_buttons.forEach(function(b) {\n                    b.setSectorSize();\n                });\n                this.circle.scale(this.circle_radius / this.last_circle_radius);\n                if (this.node_image) {\n                    this.node_image.scale(this.circle_radius / this.last_circle_radius);\n                }\n            }\n            this.circle.position = this.paper_coords;\n            if (this.node_image) {\n                this.node_image.position = this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius));\n            }\n            this.last_circle_radius = this.circle_radius;\n\n            var old_act_btn = this.active_buttons;\n\n            var opacity = 1;\n            if (this.model.get(\"delete_scheduled\")) {\n                opacity = 0.5;\n                this.active_buttons = this.pending_delete_buttons;\n                this.circle.dashArray = [2,2];\n            } else {\n                opacity = 1;\n                this.active_buttons = this.normal_buttons;\n                this.circle.dashArray = null;\n            }\n            if (this.selected && this.renderer.isEditable() && !this.ghost) {\n                if (old_act_btn !== this.active_buttons) {\n                    old_act_btn.forEach(function(b) {\n                        b.hide();\n                    });\n                }\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n\n            if (this.node_image) {\n                this.node_image.opacity = this.highlighted ? opacity * 0.5 : (opacity - 0.01);\n            }\n\n            this.circle.fillColor = this.highlighted ? this.options.highlighted_node_fill_color : this.options.node_fill_color;\n\n            this.circle.opacity = this.options.show_node_circles ? opacity : 0.01;\n\n            var _text = this.model.get(\"title\") || this.renkan.translate(this.options.label_untitled_nodes) || \"\";\n            _text = Utils.shortenText(_text, this.options.node_label_max_length);\n\n            if (typeof this.highlighted === \"object\") {\n                this.title.html(this.highlighted.replace(_(_text).escape(),'<span class=\"Rk-Highlighted\">$1</span>'));\n            } else {\n                this.title.text(_text);\n            }\n\n            var _strokeWidth = this._getStrokeWidth();\n            this.title.css({\n                left: this.paper_coords.x,\n                top: this.paper_coords.y + this.circle_radius * this.h_ratio + this.options.node_label_distance + 0.5*_strokeWidth,\n                opacity: opacity\n            });\n            var _color = (this.model.has(\"style\") && this.model.get(\"style\").color) || (this.model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                _dash = (this.model.has(\"style\") && this.model.get(\"style\").dash) ? this.options.default_dash_array : null;\n            this.circle.strokeWidth = _strokeWidth;\n            this.circle.strokeColor = _color;\n            this.circle.dashArray = _dash;\n            var _pc = this.paper_coords;\n            this.all_buttons.forEach(function(b) {\n                b.moveTo(_pc);\n            });\n            var lastImage = this.img;\n            this.img = this.model.get(\"image\");\n            if (this.img && this.img !== lastImage) {\n                this.showImage();\n                if(this.circle) {\n                    this.circle.sendToBack();\n                }\n            }\n            if (this.node_image && !this.img) {\n                this.node_image.remove();\n                delete this.node_image;\n            }\n\n            if (this.renderer.minimap) {\n                this.minimap_circle.fillColor = _color;\n                var minipos = this.renderer.toMinimapCoords(_model_coords),\n                miniradius = this.renderer.minimap.scale * _baseRadius,\n                minisize = new paper.Size([miniradius, miniradius]);\n                this.minimap_circle.fitBounds(minipos.subtract(minisize), minisize.multiply(2));\n            }\n\n            if (typeof options === 'undefined' || !('dontRedrawEdges' in options) || !options.dontRedrawEdges) {\n                var _this = this;\n                _.each(\n                        this.project.get(\"edges\").filter(\n                                function (ed) {\n                                    return ((ed.get(\"to\") === _this.model) || (ed.get(\"from\") === _this.model));\n                                }\n                        ),\n                        function(edge, index, list) {\n                            var repr = _this.renderer.getRepresentationByModel(edge);\n                            if (repr && typeof repr.from_representation !== \"undefined\" && typeof repr.from_representation.paper_coords !== \"undefined\" && typeof repr.to_representation !== \"undefined\" && typeof repr.to_representation.paper_coords !== \"undefined\") {\n                                repr.redraw();\n                            }\n                        }\n                );\n            }\n            if (this.ghost){\n                this.show(true);\n            } else {\n                if (this.hidden) { this.hide(); }\n            }\n        },\n        showImage: function() {\n            var _image = null;\n            if (typeof this.renderer.image_cache[this.img] === \"undefined\") {\n                _image = new Image();\n                this.renderer.image_cache[this.img] = _image;\n                _image.src = this.img;\n            } else {\n                _image = this.renderer.image_cache[this.img];\n            }\n            if (_image.width) {\n                if (this.node_image) {\n                    this.node_image.remove();\n                }\n                this.renderer.node_layer.activate();\n                var width = _image.width,\n                    height = _image.height,\n                    clipPath = this.model.get(\"clip_path\"),\n                    hasClipPath = (typeof clipPath !== \"undefined\" && clipPath),\n                    _clip = null,\n                    baseRadius = null,\n                    centerPoint = null;\n\n                if (hasClipPath) {\n                    _clip = new paper.Path();\n                    var instructions = clipPath.match(/[a-z][^a-z]+/gi) || [],\n                    lastCoords = [0,0],\n                    minX = Infinity,\n                    minY = Infinity,\n                    maxX = -Infinity,\n                    maxY = -Infinity;\n\n                    var transformCoords = function(tabc, relative) {\n                        var newCoords = tabc.slice(1).map(function(v, k) {\n                            var res = parseFloat(v),\n                            isY = k % 2;\n                            if (isY) {\n                                res = ( res - 0.5 ) * height;\n                            } else {\n                                res = ( res - 0.5 ) * width;\n                            }\n                            if (relative) {\n                                res += lastCoords[isY];\n                            }\n                            if (isY) {\n                                minY = Math.min(minY, res);\n                                maxY = Math.max(maxY, res);\n                            } else {\n                                minX = Math.min(minX, res);\n                                maxX = Math.max(maxX, res);\n                            }\n                            return res;\n                        });\n                        lastCoords = newCoords.slice(-2);\n                        return newCoords;\n                    };\n\n                    instructions.forEach(function(instr) {\n                        var coords = instr.match(/([a-z]|[0-9.-]+)/ig) || [\"\"];\n                        switch(coords[0]) {\n                        case \"M\":\n                            _clip.moveTo(transformCoords(coords));\n                            break;\n                        case \"m\":\n                            _clip.moveTo(transformCoords(coords, true));\n                            break;\n                        case \"L\":\n                            _clip.lineTo(transformCoords(coords));\n                            break;\n                        case \"l\":\n                            _clip.lineTo(transformCoords(coords, true));\n                            break;\n                        case \"C\":\n                            _clip.cubicCurveTo(transformCoords(coords));\n                            break;\n                        case \"c\":\n                            _clip.cubicCurveTo(transformCoords(coords, true));\n                            break;\n                        case \"Q\":\n                            _clip.quadraticCurveTo(transformCoords(coords));\n                            break;\n                        case \"q\":\n                            _clip.quadraticCurveTo(transformCoords(coords, true));\n                            break;\n                        }\n                    });\n\n                    baseRadius = Math[this.options.node_images_fill_mode ? \"min\" : \"max\"](maxX - minX, maxY - minY) / 2;\n                    centerPoint = new paper.Point((maxX + minX) / 2, (maxY + minY) / 2);\n                    if (!this.options.show_node_circles) {\n                        this.h_ratio = (maxY - minY) / (2 * baseRadius);\n                    }\n                } else {\n                    baseRadius = Math[this.options.node_images_fill_mode ? \"min\" : \"max\"](width, height) / 2;\n                    centerPoint = new paper.Point(0,0);\n                    if (!this.options.show_node_circles) {\n                        this.h_ratio = height / (2 * baseRadius);\n                    }\n                }\n                var _raster = new paper.Raster(_image);\n                _raster.locked = true; // Disable mouse events on icon\n                if (hasClipPath) {\n                    _raster = new paper.Group(_clip, _raster);\n                    _raster.opacity = 0.99;\n                    /* This is a workaround to allow clipping at group level\n                     * If opacity was set to 1, paper.js would merge all clipping groups in one (known bug).\n                     */\n                    _raster.clipped = true;\n                    _clip.__representation = this;\n                }\n                if (this.options.clip_node_images) {\n                    var _circleClip = this.shapeBuilder.getImageShape(centerPoint, baseRadius);\n                    _raster = new paper.Group(_circleClip, _raster);\n                    _raster.opacity = 0.99;\n                    _raster.clipped = true;\n                    _circleClip.__representation = this;\n                }\n                this.image_delta = centerPoint.divide(baseRadius);\n                this.node_image = _raster;\n                this.node_image.__representation = _this;\n                this.node_image.scale(this.circle_radius / baseRadius);\n                this.node_image.position = this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius));\n                this.node_image.insertAbove(this.circle);\n            } else {\n                var _this = this;\n                $(_image).on(\"load\", function() {\n                    _this.showImage();\n                });\n            }\n        },\n        paperShift: function(_delta) {\n            if (this.options.editor_mode) {\n                if (!this.renkan.read_only) {\n                    this.is_dragging = true;\n                    this.paper_coords = this.paper_coords.add(_delta);\n                    this.redraw();\n                }\n            } else {\n                this.renderer.paperShift(_delta);\n            }\n        },\n        openEditor: function() {\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            var _editor = this.renderer.addRepresentation(\"NodeEditor\",null);\n            _editor.source_representation = this;\n            _editor.draw();\n        },\n        select: function() {\n            this.selected = true;\n            this.circle.strokeWidth = this._getSelectedStrokeWidth();\n            if (this.renderer.isEditable() && !this.hidden) {\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n            var _uri = this.model.get(\"uri\");\n            if (_uri) {\n                $('.Rk-Bin-Item').each(function() {\n                    var _el = $(this);\n                    if (_el.attr(\"data-uri\") === _uri) {\n                        _el.addClass(\"selected\");\n                    }\n                });\n            }\n            if (!this.options.editor_mode) {\n                this.openEditor();\n            }\n\n            if (this.renderer.minimap) {\n                this.minimap_circle.strokeWidth = this.options.minimap_highlight_weight;\n                this.minimap_circle.strokeColor = this.options.minimap_highlight_color;\n            }\n            //if the node is hidden and the mouse hover it, it appears as a ghost\n            if (this.hidden) {\n                this.show(true);\n            }\n            else {\n                this.showNeighbors(true);\n            }\n            this._super(\"select\");\n        },\n        hideButtons: function() {\n            this.all_buttons.forEach(function(b) {\n                b.hide();\n            });\n            delete(this.buttonTimeout);\n        },\n        unselect: function(_newTarget) {\n            if (!_newTarget || _newTarget.source_representation !== this) {\n                this.selected = false;\n                var _this = this;\n                this.buttons_timeout = setTimeout(function() { _this.hideButtons(); }, 200);\n                this.circle.strokeWidth = this._getStrokeWidth();\n                $('.Rk-Bin-Item').removeClass(\"selected\");\n                if (this.renderer.minimap) {\n                    this.minimap_circle.strokeColor = undefined;\n                }\n                //when the mouse don't hover the node anymore, we hide it\n                if (this.hidden) {\n                    this.hide();\n                }\n                else {\n                    this.hideNeighbors();\n                }\n                this._super(\"unselect\");\n            }\n        },\n        hide: function(){\n            var _this = this;\n            this.ghost = false;\n            this.hidden = true;\n            if (typeof this.node_image !== 'undefined'){\n                this.node_image.opacity = 0;\n            }\n            this.hideButtons();\n            this.circle.opacity = 0;\n            this.title.css('opacity', 0);\n            this.minimap_circle.opacity = 0;\n\n\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return ((ed.get(\"to\") === _this.model) || (ed.get(\"from\") === _this.model));\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge);\n                        if (repr && typeof repr.from_representation !== \"undefined\" && typeof repr.from_representation.paper_coords !== \"undefined\" && typeof repr.to_representation !== \"undefined\" && typeof repr.to_representation.paper_coords !== \"undefined\") {\n                            repr.hide();\n                        }\n                    }\n            );\n            this.hideNeighbors();\n        },\n        show: function(ghost){\n            var _this = this;\n            this.ghost = ghost;\n            if (this.ghost){\n                if (typeof this.node_image !== 'undefined'){\n                    this.node_image.opacity = this.options.ghost_opacity;\n                }\n                this.circle.opacity = this.options.ghost_opacity;\n                this.title.css('opacity', this.options.ghost_opacity);\n                this.minimap_circle.opacity = this.options.ghost_opacity;\n            } else {\n                this.hidden = false;\n                this.redraw();\n            }\n\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return ((ed.get(\"to\") === _this.model) || (ed.get(\"from\") === _this.model));\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge);\n                        if (repr && typeof repr.from_representation !== \"undefined\" && typeof repr.from_representation.paper_coords !== \"undefined\" && typeof repr.to_representation !== \"undefined\" && typeof repr.to_representation.paper_coords !== \"undefined\") {\n                            repr.show(_this.ghost);\n                        }\n                    }\n            );\n        },\n        hideNeighbors: function(){\n            var _this = this;\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return (ed.get(\"from\") === _this.model);\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge.get(\"to\"));\n                        if (repr && repr.ghost) {\n                            repr.hide();\n                        }\n                    }\n            );\n        },\n        showNeighbors: function(ghost){\n            var _this = this;\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return (ed.get(\"from\") === _this.model);\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge.get(\"to\"));\n                        if (repr && repr.hidden) {\n                            repr.show(ghost);\n                            if (!ghost){\n                                var indexNode = _this.renderer.hiddenNodes.indexOf(repr.model.id);\n                                if (indexNode !== -1){\n                                    _this.renderer.hiddenNodes.splice(indexNode, 1);\n                                }\n                            }\n                        }\n                    }\n            );\n        },\n        highlight: function(textToReplace) {\n            var hlvalue = textToReplace || true;\n            if (this.highlighted === hlvalue) {\n                return;\n            }\n            this.highlighted = hlvalue;\n            this.redraw();\n            this.renderer.throttledPaperDraw();\n        },\n        unhighlight: function() {\n            if (!this.highlighted) {\n                return;\n            }\n            this.highlighted = false;\n            this.redraw();\n            this.renderer.throttledPaperDraw();\n        },\n        saveCoords: function() {\n            var _coords = this.renderer.toModelCoords(this.paper_coords),\n            _data = {\n                position: {\n                    x: _coords.x,\n                    y: _coords.y\n                }\n            };\n            if (this.renderer.isEditable()) {\n                this.model.set(_data);\n            }\n        },\n        mousedown: function(_event, _isTouch) {\n            if (_isTouch) {\n                this.renderer.unselectAll();\n                this.select();\n            }\n        },\n        mouseup: function(_event, _isTouch) {\n            if (this.renderer.is_dragging && this.renderer.isEditable()) {\n                this.saveCoords();\n            } else {\n                if (this.hidden) {\n                    var index = this.renderer.hiddenNodes.indexOf(this.model.id);\n                    if (index !== -1){\n                        this.renderer.hiddenNodes.splice(index, 1);\n                    }\n                    this.show(false);\n                    this.select();\n                } else {\n                    if (!_isTouch && !this.model.get(\"delete_scheduled\")) {\n                        this.openEditor();\n                    }\n                    this.model.trigger(\"clicked\");\n                }\n            }\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.is_dragging = false;\n        },\n        destroy: function(_event) {\n            this._super(\"destroy\");\n            this.all_buttons.forEach(function(b) {\n                b.destroy();\n            });\n            this.circle.remove();\n            this.title.remove();\n            if (this.renderer.minimap) {\n                this.minimap_circle.remove();\n            }\n            if (this.node_image) {\n                this.node_image.remove();\n            }\n        }\n    }).value();\n\n    return NodeRepr;\n\n});\n\n\ndefine('renderer/edge',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* Edge Class Begin */\n\n    //var Edge = Renderer.Edge = Utils.inherit(Renderer._BaseRepresentation);\n    var Edge = Utils.inherit(BaseRepresentation);\n\n    _(Edge.prototype).extend({\n        _init: function() {\n            this.renderer.edge_layer.activate();\n            this.type = \"Edge\";\n            this.hidden = false;\n            this.ghost = false;\n            this.from_representation = this.renderer.getRepresentationByModel(this.model.get(\"from\"));\n            this.to_representation = this.renderer.getRepresentationByModel(this.model.get(\"to\"));\n            this.bundle = this.renderer.addToBundles(this);\n            this.line = new paper.Path();\n            this.line.add([0,0],[0,0],[0,0]);\n            this.line.__representation = this;\n            this.line.strokeWidth = this.options.edge_stroke_width;\n            this.arrow_scale = 1;\n            this.arrow = new paper.Path();\n            this.arrow.add(\n                    [ 0, 0 ],\n                    [ this.options.edge_arrow_length, this.options.edge_arrow_width / 2 ],\n                    [ 0, this.options.edge_arrow_width ]\n            );\n            this.arrow.pivot = new paper.Point([ this.options.edge_arrow_length / 2, this.options.edge_arrow_width / 2 ]);\n            this.arrow.__representation = this;\n            this.text = $('<div class=\"Rk-Label Rk-Edge-Label\">').appendTo(this.renderer.labels_$);\n            this.arrow_angle = 0;\n            if (this.options.editor_mode) {\n                var Renderer = requtils.getRenderer();\n                this.normal_buttons = [\n                                       new Renderer.EdgeEditButton(this.renderer, null),\n                                       new Renderer.EdgeRemoveButton(this.renderer, null)\n                                       ];\n                this.pending_delete_buttons = [\n                                               new Renderer.EdgeRevertButton(this.renderer, null)\n                                               ];\n                this.all_buttons = this.normal_buttons.concat(this.pending_delete_buttons);\n                for (var i = 0; i < this.all_buttons.length; i++) {\n                    this.all_buttons[i].source_representation = this;\n                }\n                this.active_buttons = [];\n            } else {\n                this.active_buttons = this.all_buttons = [];\n            }\n\n            if (this.renderer.minimap) {\n                this.renderer.minimap.edge_layer.activate();\n                this.minimap_line = new paper.Path();\n                this.minimap_line.add([0,0],[0,0]);\n                this.minimap_line.__representation = this.renderer.minimap.miniframe.__representation;\n                this.minimap_line.strokeWidth = 1;\n            }\n        },\n        _getStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.edge_stroke_width + (thickness-1) * (this.options.edge_stroke_max_width - this.options.edge_stroke_width) / (this.options.edge_stroke_witdh_scale-1);\n        },\n        _getSelectedStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.selected_edge_stroke_width + (thickness-1) * (this.options.selected_edge_stroke_max_width - this.options.selected_edge_stroke_width) / (this.options.edge_stroke_witdh_scale-1);\n        },\n        _getArrowScale: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return 1 + (thickness-1) * ((this.options.edge_arrow_max_width / this.options.edge_arrow_width) - 1) / (this.options.edge_stroke_witdh_scale-1);\n        },\n        redraw: function() {\n            var from = this.model.get(\"from\"),\n            to = this.model.get(\"to\");\n            if (!from || !to || (this.hidden && !this.ghost)) {\n                return;\n            }\n            this.from_representation = this.renderer.getRepresentationByModel(from);\n            this.to_representation = this.renderer.getRepresentationByModel(to);\n            if (typeof this.from_representation === \"undefined\" || typeof this.to_representation === \"undefined\" ||\n                    (this.from_representation.hidden && !this.from_representation.ghost) ||\n                    (this.to_representation.hidden && !this.to_representation.ghost)) {\n                this.hide();\n                return;\n            }\n            var _strokeWidth = this._getStrokeWidth(),\n                _arrow_scale = this._getArrowScale(),\n                _p0a = this.from_representation.paper_coords,\n                _p1a = this.to_representation.paper_coords,\n                _v = _p1a.subtract(_p0a),\n                _r = _v.length,\n                _u = _v.divide(_r),\n                _ortho = new paper.Point([- _u.y, _u.x]),\n                _group_pos = this.bundle.getPosition(this),\n                _delta = _ortho.multiply( this.options.edge_gap_in_bundles * _group_pos ),\n                _p0b = _p0a.add(_delta), /* Adding a 4 px difference */\n                _p1b = _p1a.add(_delta), /* to differentiate bundled links */\n                _a = _v.angle,\n                _textdelta = _ortho.multiply(this.options.edge_label_distance + 0.5 * _arrow_scale * this.options.edge_arrow_width),\n                _handle = _v.divide(3),\n                _color = (this.model.has(\"style\") && this.model.get(\"style\").color) || (this.model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                _dash = (this.model.has(\"style\") && this.model.get(\"style\").dash) ? this.options.default_dash_array : null,\n                _opacity;\n\n            if (this.model.get(\"delete_scheduled\") || this.from_representation.model.get(\"delete_scheduled\") || this.to_representation.model.get(\"delete_scheduled\")) {\n                _opacity = 0.5;\n                this.line.dashArray = [2, 2];\n            } else {\n                _opacity = this.ghost ? this.options.ghost_opacity : 1;\n                this.line.dashArray = null;\n            }\n\n            var old_act_btn = this.active_buttons;\n\n            this.arrow.visible =\n                (this.model.has(\"style\") && this.model.get(\"style\").arrow) ||\n                !this.model.has(\"style\") ||\n                typeof this.model.get(\"style\").arrow === 'undefined';\n\n            this.active_buttons = this.model.get(\"delete_scheduled\") ? this.pending_delete_buttons : this.normal_buttons;\n\n            if (this.selected && this.renderer.isEditable() && old_act_btn !== this.active_buttons) {\n                old_act_btn.forEach(function(b) {\n                    b.hide();\n                });\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n\n            this.paper_coords = _p0b.add(_p1b).divide(2);\n            this.line.strokeWidth = _strokeWidth;\n            this.line.strokeColor = _color;\n            this.line.dashArray = _dash;\n            this.line.opacity = _opacity;\n            this.line.segments[0].point = _p0a;\n            this.line.segments[1].point = this.paper_coords;\n            this.line.segments[1].handleIn = _handle.multiply(-1);\n            this.line.segments[1].handleOut = _handle;\n            this.line.segments[2].point = _p1a;\n            this.arrow.scale(_arrow_scale / this.arrow_scale);\n            this.arrow_scale = _arrow_scale;\n            this.arrow.fillColor = _color;\n            this.arrow.opacity = _opacity;\n            this.arrow.rotate(_a - this.arrow_angle, this.arrow.bounds.center);\n            this.arrow.position = this.paper_coords;\n\n            this.arrow_angle = _a;\n            if (_a > 90) {\n                _a -= 180;\n                _textdelta = _textdelta.multiply(-1);\n            }\n            if (_a < -90) {\n                _a += 180;\n                _textdelta = _textdelta.multiply(-1);\n            }\n            var _text = this.model.get(\"title\") || this.renkan.translate(this.options.label_untitled_edges) || \"\";\n            _text = Utils.shortenText(_text, this.options.node_label_max_length);\n            this.text.text(_text);\n            var _textpos = this.paper_coords.add(_textdelta);\n            this.text.css({\n                left: _textpos.x,\n                top: _textpos.y,\n                transform: \"rotate(\" + _a + \"deg)\",\n                \"-moz-transform\": \"rotate(\" + _a + \"deg)\",\n                \"-webkit-transform\": \"rotate(\" + _a + \"deg)\",\n                opacity: _opacity\n            });\n            this.text_angle = _a;\n\n            var _pc = this.paper_coords;\n            this.all_buttons.forEach(function(b) {\n                b.moveTo(_pc);\n            });\n\n            if (this.renderer.minimap) {\n                this.minimap_line.strokeColor = _color;\n                this.minimap_line.segments[0].point = this.renderer.toMinimapCoords(new paper.Point(this.from_representation.model.get(\"position\")));\n                this.minimap_line.segments[1].point = this.renderer.toMinimapCoords(new paper.Point(this.to_representation.model.get(\"position\")));\n            }\n        },\n        hide: function(){\n            this.hidden = true;\n            this.ghost = false;\n\n            this.text.hide();\n            this.line.visible = false;\n            this.arrow.visible = false;\n            this.minimap_line.visible = false;\n        },\n        show: function(ghost){\n            this.ghost = ghost;\n            if (this.ghost) {\n                this.text.css('opacity', 0.3);\n                this.line.opacity = 0.3;\n                this.arrow.opacity = 0.3;\n                this.minimap_line.opacity = 0.3;\n            } else {\n                this.hidden = false;\n\n                this.text.css('opacity', 1);\n                this.line.opacity = 1;\n                this.arrow.opacity = 1;\n                this.minimap_line.opacity = 1;\n            }\n            this.text.show();\n            this.line.visible = true;\n            this.arrow.visible = true;\n            this.minimap_line.visible = true;\n            this.redraw();\n        },\n        openEditor: function() {\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            var _editor = this.renderer.addRepresentation(\"EdgeEditor\",null);\n            _editor.source_representation = this;\n            _editor.draw();\n        },\n        select: function() {\n            this.selected = true;\n            this.line.strokeWidth = this._getSelectedStrokeWidth();\n            if (this.renderer.isEditable()) {\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n            if (!this.options.editor_mode) {\n                this.openEditor();\n            }\n            this._super(\"select\");\n        },\n        unselect: function(_newTarget) {\n            if (!_newTarget || _newTarget.source_representation !== this) {\n                this.selected = false;\n                if (this.options.editor_mode) {\n                    this.all_buttons.forEach(function(b) {\n                        b.hide();\n                    });\n                }\n                this.line.strokeWidth = this._getStrokeWidth();\n                this._super(\"unselect\");\n            }\n        },\n        mousedown: function(_event, _isTouch) {\n            if (_isTouch) {\n                this.renderer.unselectAll();\n                this.select();\n            }\n        },\n        mouseup: function(_event, _isTouch) {\n            if (!this.renkan.read_only && this.renderer.is_dragging) {\n                this.from_representation.saveCoords();\n                this.to_representation.saveCoords();\n                this.from_representation.is_dragging = false;\n                this.to_representation.is_dragging = false;\n            } else {\n                if (!_isTouch) {\n                    this.openEditor();\n                }\n                this.model.trigger(\"clicked\");\n            }\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n        },\n        paperShift: function(_delta) {\n            if (this.options.editor_mode) {\n                if (!this.options.read_only) {\n                    this.from_representation.paperShift(_delta);\n                    this.to_representation.paperShift(_delta);\n                }\n            } else {\n                this.renderer.paperShift(_delta);\n            }\n        },\n        destroy: function() {\n            this._super(\"destroy\");\n            this.line.remove();\n            this.arrow.remove();\n            this.text.remove();\n            if (this.renderer.minimap) {\n                this.minimap_line.remove();\n            }\n            this.all_buttons.forEach(function(b) {\n                b.destroy();\n            });\n            var _this = this;\n            this.bundle.edges = _.reject(this.bundle.edges, function(_edge) {\n                return _this === _edge;\n            });\n        }\n    }).value();\n\n    return Edge;\n\n});\n\n\n\ndefine('renderer/tempedge',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* TempEdge Class Begin */\n\n    //var TempEdge = Renderer.TempEdge = Utils.inherit(Renderer._BaseRepresentation);\n    var TempEdge = Utils.inherit(BaseRepresentation);\n\n    _(TempEdge.prototype).extend({\n        _init: function() {\n            this.renderer.edge_layer.activate();\n            this.type = \"Temp-edge\";\n\n            var _color = (this.project.get(\"users\").get(this.renkan.current_user) || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\");\n            this.line = new paper.Path();\n            this.line.strokeColor = _color;\n            this.line.dashArray = [4, 2];\n            this.line.strokeWidth = this.options.selected_edge_stroke_width;\n            this.line.add([0,0],[0,0]);\n            this.line.__representation = this;\n            this.arrow = new paper.Path();\n            this.arrow.fillColor = _color;\n            this.arrow.add(\n                    [ 0, 0 ],\n                    [ this.options.edge_arrow_length, this.options.edge_arrow_width / 2 ],\n                    [ 0, this.options.edge_arrow_width ]\n            );\n            this.arrow.__representation = this;\n            this.arrow_angle = 0;\n        },\n        redraw: function() {\n            var _p0 = this.from_representation.paper_coords,\n            _p1 = this.end_pos,\n            _a = _p1.subtract(_p0).angle,\n            _c = _p0.add(_p1).divide(2);\n            this.line.segments[0].point = _p0;\n            this.line.segments[1].point = _p1;\n            this.arrow.rotate(_a - this.arrow_angle);\n            this.arrow.position = _c;\n            this.arrow_angle = _a;\n        },\n        paperShift: function(_delta) {\n            if (!this.renderer.isEditable()) {\n                this.renderer.removeRepresentation(_this);\n                paper.view.draw();\n                return;\n            }\n            this.end_pos = this.end_pos.add(_delta);\n            var _hitResult = paper.project.hitTest(this.end_pos);\n            this.renderer.findTarget(_hitResult);\n            this.redraw();\n        },\n        mouseup: function(_event, _isTouch) {\n            var _hitResult = paper.project.hitTest(_event.point),\n            _model = this.from_representation.model,\n            _endDrag = true;\n            if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                var _target = _hitResult.item.__representation;\n                if (_target.type.substr(0,4) === \"Node\") {\n                    var _destmodel = _target.model || _target.source_representation.model;\n                    if (_model !== _destmodel) {\n                        var _data = {\n                                id: Utils.getUID('edge'),\n                                created_by: this.renkan.current_user,\n                                from: _model,\n                                to: _destmodel\n                        };\n                        if (this.renderer.isEditable()) {\n                            this.project.addEdge(_data);\n                        }\n                    }\n                }\n\n                if (_model === _target.model || (_target.source_representation && _target.source_representation.model === _model)) {\n                    _endDrag = false;\n                    this.renderer.is_dragging = true;\n                }\n            }\n            if (_endDrag) {\n                this.renderer.click_target = null;\n                this.renderer.is_dragging = false;\n                this.renderer.removeRepresentation(this);\n                paper.view.draw();\n            }\n        },\n        destroy: function() {\n            this.arrow.remove();\n            this.line.remove();\n        }\n    }).value();\n\n    /* TempEdge Class End */\n\n    return TempEdge;\n\n});\n\n\ndefine('renderer/baseeditor',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* _BaseEditor Begin */\n    //var _BaseEditor = Renderer._BaseEditor = Utils.inherit(Renderer._BaseRepresentation);\n    var _BaseEditor = Utils.inherit(BaseRepresentation);\n\n    _(_BaseEditor.prototype).extend({\n        _init: function() {\n            this.renderer.buttons_layer.activate();\n            this.type = \"editor\";\n            this.editor_block = new paper.Path();\n            var _pts = _.map(_.range(8), function() {return [0,0];});\n            this.editor_block.add.apply(this.editor_block, _pts);\n            this.editor_block.strokeWidth = this.options.tooltip_border_width;\n            this.editor_block.strokeColor = this.options.tooltip_border_color;\n            this.editor_block.opacity = 0.8;\n            this.editor_$ = $('<div>')\n            .appendTo(this.renderer.editor_$)\n            .css({\n                position: \"absolute\",\n                opacity: 0.8\n            })\n            .hide();\n        },\n        destroy: function() {\n            this.editor_block.remove();\n            this.editor_$.remove();\n        }\n    }).value();\n\n    /* _BaseEditor End */\n\n    return _BaseEditor;\n\n});\n\n\ndefine('renderer/nodeeditor',['jquery', 'underscore', 'requtils', 'renderer/baseeditor', 'renderer/shapebuilder', 'ckeditor-jquery'], function ($, _, requtils, BaseEditor, ShapeBuilder) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeEditor Begin */\n    //var NodeEditor = Renderer.NodeEditor = Utils.inherit(Renderer._BaseEditor);\n    var NodeEditor = Utils.inherit(BaseEditor);\n\n    _(NodeEditor.prototype).extend({\n        _init: function() {\n            BaseEditor.prototype._init.apply(this);\n            this.template = this.options.templates['templates/nodeeditor.html'];\n            //this.templates['default']= this.options.templates['templates/nodeeditor.html'];\n            //fusionner avec this.options.node_editor_templates\n            this.readOnlyTemplate = this.options.node_editor_templates;\n        },\n        draw: function() {\n            var _model = this.source_representation.model,\n            _created_by = _model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan),\n            _template = (this.renderer.isEditable() ? this.template : this.readOnlyTemplate[_model.get(\"type\")] || this.readOnlyTemplate[\"default\"]),\n            _image_placeholder = this.options.static_url + \"img/image-placeholder.png\",\n            _size = (_model.get(\"size\") || 0);\n            this.editor_$\n            .html(_template({\n                node: {\n                    _id: _model.get(\"_id\"),\n                    has_creator: !!_model.get(\"created_by\"),\n                    title: _model.get(\"title\"),\n                    uri: _model.get(\"uri\"),\n                    type: _model.get(\"type\") || \"default\",\n                    short_uri:  Utils.shortenText((_model.get(\"uri\") || \"\").replace(/^(https?:\\/\\/)?(www\\.)?/,'').replace(/\\/$/,''),40),\n                    description: _model.get(\"description\"),\n                    image: _model.get(\"image\") || \"\",\n                    image_placeholder: _image_placeholder,\n                    color: (_model.has(\"style\") && _model.get(\"style\").color) || _created_by.get(\"color\"),\n                    thickness: (_model.has(\"style\") && _model.get(\"style\").thickness) || 1,\n                    dash: _model.has(\"style\") && _model.get(\"style\").dash ? \"checked\" : \"\",\n                    clip_path: _model.get(\"clip_path\") || false,\n                    created_by_color: _created_by.get(\"color\"),\n                    created_by_title: _created_by.get(\"title\"),\n                    size: (_size > 0 ? \"+\" : \"\") + _size,\n                    shape: _model.get(\"shape\") || \"circle\"\n                },\n                renkan: this.renkan,\n                options: this.options,\n                shortenText: Utils.shortenText,\n                shapes : _(ShapeBuilder.builders).omit('svg').keys().value(),\n                types : _(this.options.node_editor_templates).keys().value(),\n            }));\n            this.redraw();\n            var _this = this,\n                editorInstance = _this.options.show_node_editor_description_richtext ?\n                    $(\".Rk-Edit-Description\").ckeditor(_this.options.richtext_editor_config) :\n                    false,\n                closeEditor = function() {\n                    _this.renderer.removeRepresentation(_this);\n                    paper.view.draw();\n                };\n\n            _this.cleanEditor = function() {\n                _this.editor_$.off(\"keyup\");\n                _this.editor_$.find(\"input, textarea, select\").off(\"change keyup paste\");\n                _this.editor_$.find(\".Rk-Edit-Image-File\").off('change');\n                _this.editor_$.find(\".Rk-Edit-ColorPicker-Wrapper\").off('hover');\n                _this.editor_$.find(\".Rk-Edit-Size-Btn\").off('click');\n                _this.editor_$.find(\".Rk-Edit-Image-Del\").off('click');\n                _this.editor_$.find(\".Rk-Edit-ColorPicker\").find(\"li\").off('hover click');\n                _this.editor_$.find(\".Rk-CloseX\").off('click');\n                _this.editor_$.find(\".Rk-Edit-Goto\").off('click');\n\n                if(_this.options.show_node_editor_description_richtext) {\n                    if(typeof editorInstance.editor !== 'undefined') {\n                        var _editor = editorInstance.editor;\n                        delete editorInstance.editor;\n                        _editor.focusManager.blur(true);\n                        _editor.destroy();\n                    }\n                }\n            };\n\n            this.editor_$.find(\".Rk-CloseX\").click(function (e) {\n                e.preventDefault();\n                closeEditor();\n            });\n\n            this.editor_$.find(\".Rk-Edit-Goto\").click(function() {\n                if (!_model.get(\"uri\")) {\n                    return false;\n                }\n            });\n\n            if (this.renderer.isEditable()) {\n\n                var onFieldChange = _.throttle(function() {\n                  _.defer(function() {\n                    if (_this.renderer.isEditable()) {\n                        var _data = {\n                            title: _this.editor_$.find(\".Rk-Edit-Title\").val()\n                        };\n                        if (_this.options.show_node_editor_uri) {\n                            _data.uri = _this.editor_$.find(\".Rk-Edit-URI\").val();\n                            _this.editor_$.find(\".Rk-Edit-Goto\").attr(\"href\",_data.uri || \"#\");\n                        }\n                        if (_this.options.show_node_editor_image) {\n                            _data.image = _this.editor_$.find(\".Rk-Edit-Image\").val();\n                            _this.editor_$.find(\".Rk-Edit-ImgPreview\").attr(\"src\", _data.image || _image_placeholder);\n                        }\n                        if (_this.options.show_node_editor_description) {\n                            if(_this.options.show_node_editor_description_richtext) {\n                                if(typeof editorInstance.editor !== 'undefined' &&\n                                    editorInstance.editor.checkDirty()) {\n                                    _data.description = editorInstance.editor.getData();\n                                    editorInstance.editor.resetDirty();\n                                }\n                            }\n                            else {\n                                _data.description = _this.editor_$.find(\".Rk-Edit-Description\").val();\n                            }\n                        }\n                        if (_this.options.show_node_editor_style) {\n                            var dash = _this.editor_$.find(\".Rk-Edit-Dash\").is(':checked');\n                            _data.style = _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {dash: dash});\n                        }\n                        if (_this.options.change_shapes) {\n                            if(_model.get(\"shape\")!==_this.editor_$.find(\".Rk-Edit-Shape\").val()){\n                                _data.shape = _this.editor_$.find(\".Rk-Edit-Shape\").val();\n                            }\n                        }\n                        if (_this.options.change_types) {\n                            if(_model.get(\"type\")!==_this.editor_$.find(\".Rk-Edit-Type\").val()){\n                                _data.type = _this.editor_$.find(\".Rk-Edit-Type\").val();\n                            }\n                        }\n                        _model.set(_data);\n                        _this.redraw();\n                    } else {\n                        closeEditor();\n                    }\n                  });\n                }, 1000);\n\n                this.editor_$.on(\"keyup\", function(_e) {\n                    if (_e.keyCode === 27) {\n                        closeEditor();\n                    }\n                });\n\n                this.editor_$.find(\"input, textarea, select\").on(\"change keyup paste\", onFieldChange);\n                if( _this.options.show_node_editor_description &&\n                    _this.options.show_node_editor_description_richtext &&\n                    typeof editorInstance.editor !== 'undefined')\n                {\n                    editorInstance.editor.on(\"change\", onFieldChange);\n                    editorInstance.editor.on(\"blur\", onFieldChange);\n                }\n\n                if(_this.options.allow_image_upload) {\n                    this.editor_$.find(\".Rk-Edit-Image-File\").change(function() {\n                        if (this.files.length) {\n                            var f = this.files[0],\n                            fr = new FileReader();\n                            if (f.type.substr(0,5) !== \"image\") {\n                                alert(_this.renkan.translate(\"This file is not an image\"));\n                                return;\n                            }\n                            if (f.size > (_this.options.uploaded_image_max_kb * 1024)) {\n                                alert(_this.renkan.translate(\"Image size must be under \") + _this.options.uploaded_image_max_kb + _this.renkan.translate(\"KB\"));\n                                return;\n                            }\n                            fr.onload = function(e) {\n                                _this.editor_$.find(\".Rk-Edit-Image\").val(e.target.result);\n                                onFieldChange();\n                            };\n                            fr.readAsDataURL(f);\n                        }\n                    });\n                }\n                this.editor_$.find(\".Rk-Edit-Title\")[0].focus();\n\n                var _picker = _this.editor_$.find(\".Rk-Edit-ColorPicker\");\n\n                this.editor_$.find(\".Rk-Edit-ColorPicker-Wrapper\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.show();\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.hide();\n                        }\n                );\n\n                _picker.find(\"li\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", $(this).attr(\"data-color\"));\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", (_model.has(\"style\") && _model.get(\"style\").color) || (_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(_this.renkan)).get(\"color\"));\n                        }\n                ).click(function(_e) {\n                    _e.preventDefault();\n                    if (_this.renderer.isEditable()) {\n                        _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {color: $(this).attr(\"data-color\")}));\n                        _picker.hide();\n                        paper.view.draw();\n                    } else {\n                        closeEditor();\n                    }\n                });\n\n                var shiftSize = function(n) {\n                    if (_this.renderer.isEditable()) {\n                        var _newsize = n+(_model.get(\"size\") || 0);\n                        _this.editor_$.find(\"#Rk-Edit-Size-Value\").text((_newsize > 0 ? \"+\" : \"\") + _newsize);\n                        _model.set(\"size\", _newsize);\n                        paper.view.draw();\n                    } else {\n                        closeEditor();\n                    }\n                };\n\n                this.editor_$.find(\"#Rk-Edit-Size-Down\").click(function() {\n                    shiftSize(-1);\n                    return false;\n                });\n                this.editor_$.find(\"#Rk-Edit-Size-Up\").click(function() {\n                    shiftSize(1);\n                    return false;\n                });\n\n                var shiftThickness = function(n) {\n                    if (_this.renderer.isEditable()) {\n                        var _oldThickness = ((_model.has('style') && _model.get('style').thickness) || 1),\n                            _newThickness = n + _oldThickness;\n                        if(_newThickness < 1 ) {\n                            _newThickness = 1;\n                        }\n                        else if (_newThickness > _this.options.node_stroke_witdh_scale) {\n                            _newThickness = _this.options.node_stroke_witdh_scale;\n                        }\n                        if (_newThickness !== _oldThickness) {\n                            _this.editor_$.find(\"#Rk-Edit-Thickness-Value\").text(_newThickness);\n                            _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {thickness: _newThickness}));\n                            paper.view.draw();\n                        }\n                    }\n                    else {\n                        closeEditor();\n                    }\n                };\n\n                this.editor_$.find(\"#Rk-Edit-Thickness-Down\").click(function() {\n                    shiftThickness(-1);\n                    return false;\n                });\n                this.editor_$.find(\"#Rk-Edit-Thickness-Up\").click(function() {\n                    shiftThickness(1);\n                    return false;\n                });\n\n                this.editor_$.find(\".Rk-Edit-Image-Del\").click(function() {\n                    _this.editor_$.find(\".Rk-Edit-Image\").val('');\n                    onFieldChange();\n                    return false;\n                });\n            } else {\n                if (typeof this.source_representation.highlighted === \"object\") {\n                    var titlehtml = this.source_representation.highlighted.replace(_(_model.get(\"title\")).escape(),'<span class=\"Rk-Highlighted\">$1</span>');\n                    this.editor_$.find(\".Rk-Display-Title\" + (_model.get(\"uri\") ? \" a\" : \"\")).html(titlehtml);\n                    if (this.options.show_node_tooltip_description) {\n                        this.editor_$.find(\".Rk-Display-Description\").html(this.source_representation.highlighted.replace(_(_model.get(\"description\")).escape(),'<span class=\"Rk-Highlighted\">$1</span>'));\n                    }\n                }\n            }\n            this.editor_$.find(\"img\").load(function() {\n                _this.redraw();\n            });\n        },\n        redraw: function() {\n            if (this.options.popup_editor){\n                var _coords = this.source_representation.paper_coords;\n                Utils.drawEditBox(this.options, _coords, this.editor_block, this.source_representation.circle_radius * 0.75, this.editor_$);\n            }\n            this.editor_$.show();\n            paper.view.draw();\n        },\n        destroy: function() {\n            if(typeof this.cleanEditor !== 'undefined') {\n                this.cleanEditor();\n            }\n            this.editor_block.remove();\n            this.editor_$.remove();\n        }\n    }).value();\n\n    /* NodeEditor End */\n\n    return NodeEditor;\n\n});\n\n\ndefine('renderer/edgeeditor',['jquery', 'underscore', 'requtils', 'renderer/baseeditor'], function ($, _, requtils, BaseEditor) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* EdgeEditor Begin */\n\n    //var EdgeEditor = Renderer.EdgeEditor = Utils.inherit(Renderer._BaseEditor);\n    var EdgeEditor = Utils.inherit(BaseEditor);\n\n    _(EdgeEditor.prototype).extend({\n        _init: function() {\n          BaseEditor.prototype._init.apply(this);\n          this.template = this.options.templates['templates/edgeeditor.html'];\n          this.readOnlyTemplate = this.options.templates['templates/edgeeditor_readonly.html'];\n        },\n        draw: function() {\n            var _model = this.source_representation.model,\n            _from_model = _model.get(\"from\"),\n            _to_model = _model.get(\"to\"),\n            _created_by = _model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan),\n            _template = (this.renderer.isEditable() ? this.template : this.readOnlyTemplate);\n            this.editor_$\n              .html(_template({\n                edge: {\n                    has_creator: !!_model.get(\"created_by\"),\n                    title: _model.get(\"title\"),\n                    uri: _model.get(\"uri\"),\n                    short_uri:  Utils.shortenText((_model.get(\"uri\") || \"\").replace(/^(https?:\\/\\/)?(www\\.)?/,'').replace(/\\/$/,''),40),\n                    description: _model.get(\"description\"),\n                    color: (_model.has(\"style\") && _model.get(\"style\").color) || _created_by.get(\"color\"),\n                    dash: _model.has(\"style\") && _model.get(\"style\").dash ? \"checked\" : \"\",\n                    arrow: (_model.has(\"style\") && _model.get(\"style\").arrow) || !_model.has(\"style\") || (typeof _model.get(\"style\").arrow === 'undefined') ? \"checked\" : \"\",\n                    thickness: (_model.has(\"style\") && _model.get(\"style\").thickness) || 1,\n                    from_title: _from_model.get(\"title\"),\n                    to_title: _to_model.get(\"title\"),\n                    from_color: (_from_model.has(\"style\") && _from_model.get(\"style\").color) || (_from_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                    to_color: (_to_model.has(\"style\") && _to_model.get(\"style\").color) || (_to_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                    created_by_color: _created_by.get(\"color\"),\n                    created_by_title: _created_by.get(\"title\")\n                },\n                renkan: this.renkan,\n                shortenText: Utils.shortenText,\n                options: this.options\n            }));\n            this.redraw();\n            var _this = this,\n            closeEditor = function() {\n                _this.renderer.removeRepresentation(_this);\n                _this.editor_$.find(\".Rk-Edit-Size-Btn\").off('click');\n                paper.view.draw();\n            };\n            this.editor_$.find(\".Rk-CloseX\").click(closeEditor);\n            this.editor_$.find(\".Rk-Edit-Goto\").click(function() {\n                if (!_model.get(\"uri\")) {\n                    return false;\n                }\n            });\n\n            if (this.renderer.isEditable()) {\n\n                var onFieldChange = _.throttle(function() {\n                    _.defer(function() {\n                        if (_this.renderer.isEditable()) {\n                            var _data = {\n                                title: _this.editor_$.find(\".Rk-Edit-Title\").val()\n                            };\n                            if (_this.options.show_edge_editor_uri) {\n                                _data.uri = _this.editor_$.find(\".Rk-Edit-URI\").val();\n                            }\n                            if (_this.options.show_node_editor_style) {\n                                var dash = _this.editor_$.find(\".Rk-Edit-Dash\").is(':checked'),\n                                    arrow = _this.editor_$.find(\".Rk-Edit-Arrow\").is(':checked');\n                                _data.style = _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {dash: dash, arrow: arrow});\n                            }\n                            _this.editor_$.find(\".Rk-Edit-Goto\").attr(\"href\",_data.uri || \"#\");\n                            _model.set(_data);\n                            paper.view.draw();\n                        } else {\n                            closeEditor();\n                        }\n                    });\n                },500);\n\n                this.editor_$.on(\"keyup\", function(_e) {\n                    if (_e.keyCode === 27) {\n                        closeEditor();\n                    }\n                });\n\n                this.editor_$.find(\"input\").on(\"keyup change paste\", onFieldChange);\n\n                this.editor_$.find(\".Rk-Edit-Vocabulary\").change(function() {\n                    var e = $(this),\n                    v = e.val();\n                    if (v) {\n                        _this.editor_$.find(\".Rk-Edit-Title\").val(e.find(\":selected\").text());\n                        _this.editor_$.find(\".Rk-Edit-URI\").val(v);\n                        onFieldChange();\n                    }\n                });\n                this.editor_$.find(\".Rk-Edit-Direction\").click(function() {\n                    if (_this.renderer.isEditable()) {\n                        _model.set({\n                            from: _model.get(\"to\"),\n                            to: _model.get(\"from\")\n                        });\n                        _this.draw();\n                    } else {\n                        closeEditor();\n                    }\n                });\n\n                var _picker = _this.editor_$.find(\".Rk-Edit-ColorPicker\");\n\n                this.editor_$.find(\".Rk-Edit-ColorPicker-Wrapper\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.show();\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.hide();\n                        }\n                );\n\n                _picker.find(\"li\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", $(this).attr(\"data-color\"));\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", (_model.has(\"style\") && _model.get(\"style\").color)|| (_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(_this.renkan)).get(\"color\"));\n                        }\n                ).click(function(_e) {\n                    _e.preventDefault();\n                    if (_this.renderer.isEditable()) {\n                        _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {color: $(this).attr(\"data-color\")}));\n                        _picker.hide();\n                        paper.view.draw();\n                    } else {\n                        closeEditor();\n                    }\n                });\n                var shiftThickness = function(n) {\n                    if (_this.renderer.isEditable()) {\n                        var _oldThickness = ((_model.has('style') && _model.get('style').thickness) || 1),\n                            _newThickness = n + _oldThickness;\n                        if(_newThickness < 1 ) {\n                            _newThickness = 1;\n                        }\n                        else if (_newThickness > _this.options.node_stroke_witdh_scale) {\n                            _newThickness = _this.options.node_stroke_witdh_scale;\n                        }\n                        if (_newThickness !== _oldThickness) {\n                            _this.editor_$.find(\"#Rk-Edit-Thickness-Value\").text(_newThickness);\n                            _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {thickness: _newThickness}));\n                            paper.view.draw();\n                        }\n                    }\n                    else {\n                        closeEditor();\n                    }\n                };\n\n                this.editor_$.find(\"#Rk-Edit-Thickness-Down\").click(function() {\n                    shiftThickness(-1);\n                    return false;\n                });\n                this.editor_$.find(\"#Rk-Edit-Thickness-Up\").click(function() {\n                    shiftThickness(1);\n                    return false;\n                });\n            }\n        },\n        redraw: function() {\n            if (this.options.popup_editor){\n                var _coords = this.source_representation.paper_coords;\n                Utils.drawEditBox(this.options, _coords, this.editor_block, 5, this.editor_$);\n            }\n            this.editor_$.show();\n            paper.view.draw();\n        }\n    }).value();\n\n    /* EdgeEditor End */\n\n    return EdgeEditor;\n\n});\n\n\ndefine('renderer/nodebutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* _NodeButton Begin */\n\n    //var _NodeButton = Renderer._NodeButton = Utils.inherit(Renderer._BaseButton);\n    var _NodeButton = Utils.inherit(BaseButton);\n\n    _(_NodeButton.prototype).extend({\n        setSectorSize: function() {\n            var sectorInner = this.source_representation.circle_radius;\n            if (sectorInner !== this.lastSectorInner) {\n                if (this.sector) {\n                    this.sector.destroy();\n                }\n                this.sector = this.renderer.drawSector(\n                        this, 1 + sectorInner,\n                        Utils._NODE_BUTTON_WIDTH + sectorInner,\n                        this.startAngle,\n                        this.endAngle,\n                        1,\n                        this.imageName,\n                        this.renkan.translate(this.text)\n                );\n                this.lastSectorInner = sectorInner;\n            }\n        },\n        unselect: function() {\n            BaseButton.prototype.unselect.apply(this, Array.prototype.slice.call(arguments, 1));\n            if(this.source_representation && this.source_representation.buttons_timeout) {\n                clearTimeout(this.source_representation.buttons_timeout);\n                this.source_representation.hideButtons();\n            }\n        },\n        select: function() {\n            if(this.source_representation && this.source_representation.buttons_timeout) {\n                clearTimeout(this.source_representation.buttons_timeout);\n            }\n            this.sector.select();\n        },\n    }).value();\n\n\n    /* _NodeButton End */\n\n    return _NodeButton;\n\n});\n\n\ndefine('renderer/nodeeditbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeEditButton Begin */\n\n    //var NodeEditButton = Renderer.NodeEditButton = Utils.inherit(Renderer._NodeButton);\n    var NodeEditButton = Utils.inherit(NodeButton);\n\n    _(NodeEditButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-edit-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -125 : -135;\n            this.endAngle = this.options.hide_nodes ? -55 : -45;\n            this.imageName = \"edit\";\n            this.text = \"Edit\";\n        },\n        mouseup: function() {\n            if (!this.renderer.is_dragging) {\n                this.source_representation.openEditor();\n            }\n        }\n    }).value();\n\n    /* NodeEditButton End */\n\n    return NodeEditButton;\n\n});\n\n\ndefine('renderer/noderemovebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeRemoveButton Begin */\n\n    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);\n    var NodeRemoveButton = Utils.inherit(NodeButton);\n\n    _(NodeRemoveButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-remove-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -10 : 0;\n            this.endAngle = this.options.hide_nodes ? 45 : 90;\n            this.imageName = \"remove\";\n            this.text = \"Remove\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                if (this.options.element_delete_delay) {\n                    var delid = Utils.getUID(\"delete\");\n                    this.renderer.delete_list.push({\n                        id: delid,\n                        time: new Date().valueOf() + this.options.element_delete_delay\n                    });\n                    this.source_representation.model.set(\"delete_scheduled\", delid);\n                } else {\n                    if (confirm(this.renkan.translate('Do you really wish to remove node ') + '\"' + this.source_representation.model.get(\"title\") + '\"?')) {\n                        this.project.removeNode(this.source_representation.model);\n                    }\n                }\n            }\n        }\n    }).value();\n\n    /* NodeRemoveButton End */\n\n    return NodeRemoveButton;\n\n});\n\n\ndefine('renderer/nodehidebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeRemoveButton Begin */\n\n    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);\n    var NodeHideButton = Utils.inherit(NodeButton);\n\n    _(NodeHideButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-hide-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = 45;\n            this.endAngle = 90;\n            this.imageName = \"hide\";\n            this.text = \"Hide\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                this.renderer.addHiddenNode(this.source_representation.model);\n            }\n        }\n    }).value();\n\n    /* NodeRemoveButton End */\n\n    return NodeHideButton;\n\n});\n\n\ndefine('renderer/nodeshowbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeRemoveButton Begin */\n\n    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);\n    var NodeShowButton = Utils.inherit(NodeButton);\n\n    _(NodeShowButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-show-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = 90;\n            this.endAngle = 135;\n            this.imageName = \"show\";\n            this.text = \"Show\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                this.source_representation.showNeighbors(false);\n            }\n        }\n    }).value();\n\n    /* NodeShowButton End */\n\n    return NodeShowButton;\n\n});\n\n\ndefine('renderer/noderevertbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeRevertButton Begin */\n\n    //var NodeRevertButton = Renderer.NodeRevertButton = Utils.inherit(Renderer._NodeButton);\n    var NodeRevertButton = Utils.inherit(NodeButton);\n\n    _(NodeRevertButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-revert-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = -135;\n            this.endAngle = 135;\n            this.imageName = \"revert\";\n            this.text = \"Cancel deletion\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            if (this.renderer.isEditable()) {\n                this.source_representation.model.unset(\"delete_scheduled\");\n            }\n        }\n    }).value();\n\n    /* NodeRevertButton End */\n\n    return NodeRevertButton;\n\n});\n\n\ndefine('renderer/nodelinkbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeLinkButton Begin */\n\n    //var NodeLinkButton = Renderer.NodeLinkButton = Utils.inherit(Renderer._NodeButton);\n    var NodeLinkButton = Utils.inherit(NodeButton);\n\n    _(NodeLinkButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-link-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? 135 : 90;\n            this.endAngle = this.options.hide_nodes ? 190 : 180;\n            this.imageName = \"link\";\n            this.text = \"Link to another node\";\n        },\n        mousedown: function(_event, _isTouch) {\n            if (this.renderer.isEditable()) {\n                var _off = this.renderer.canvas_$.offset(),\n                _point = new paper.Point([\n                                          _event.pageX - _off.left,\n                                          _event.pageY - _off.top\n                                          ]);\n                this.renderer.click_target = null;\n                this.renderer.removeRepresentationsOfType(\"editor\");\n                this.renderer.addTempEdge(this.source_representation, _point);\n            }\n        }\n    }).value();\n\n    /* NodeLinkButton End */\n\n    return NodeLinkButton;\n\n});\n\n\n\ndefine('renderer/nodeenlargebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeEnlargeButton Begin */\n\n    //var NodeEnlargeButton = Renderer.NodeEnlargeButton = Utils.inherit(Renderer._NodeButton);\n    var NodeEnlargeButton = Utils.inherit(NodeButton);\n\n    _(NodeEnlargeButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-enlarge-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -55 : -45;\n            this.endAngle = this.options.hide_nodes ? -10 : 0;\n            this.imageName = \"enlarge\";\n            this.text = \"Enlarge\";\n        },\n        mouseup: function() {\n            var _newsize = 1 + (this.source_representation.model.get(\"size\") || 0);\n            this.source_representation.model.set(\"size\", _newsize);\n            this.source_representation.select();\n            this.select();\n            paper.view.draw();\n        }\n    }).value();\n\n    /* NodeEnlargeButton End */\n\n    return NodeEnlargeButton;\n\n});\n\n\ndefine('renderer/nodeshrinkbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* NodeShrinkButton Begin */\n\n    //var NodeShrinkButton = Renderer.NodeShrinkButton = Utils.inherit(Renderer._NodeButton);\n    var NodeShrinkButton = Utils.inherit(NodeButton);\n\n    _(NodeShrinkButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-shrink-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -170 : -180;\n            this.endAngle = this.options.hide_nodes ? -125 : -135;\n            this.imageName = \"shrink\";\n            this.text = \"Shrink\";\n        },\n        mouseup: function() {\n            var _newsize = -1 + (this.source_representation.model.get(\"size\") || 0);\n            this.source_representation.model.set(\"size\", _newsize);\n            this.source_representation.select();\n            this.select();\n            paper.view.draw();\n        }\n    }).value();\n\n    /* NodeShrinkButton End */\n\n    return NodeShrinkButton;\n\n});\n\n\ndefine('renderer/edgeeditbutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* EdgeEditButton Begin */\n\n    //var EdgeEditButton = Renderer.EdgeEditButton = Utils.inherit(Renderer._BaseButton);\n    var EdgeEditButton = Utils.inherit(BaseButton);\n\n    _(EdgeEditButton.prototype).extend({\n        _init: function() {\n            this.type = \"Edge-edit-button\";\n            this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -270, -90, 1, \"edit\", this.renkan.translate(\"Edit\"));\n        },\n        mouseup: function() {\n            if (!this.renderer.is_dragging) {\n                this.source_representation.openEditor();\n            }\n        }\n    }).value();\n\n    /* EdgeEditButton End */\n\n    return EdgeEditButton;\n\n});\n\n\ndefine('renderer/edgeremovebutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* EdgeRemoveButton Begin */\n\n    //var EdgeRemoveButton = Renderer.EdgeRemoveButton = Utils.inherit(Renderer._BaseButton);\n    var EdgeRemoveButton = Utils.inherit(BaseButton);\n\n    _(EdgeRemoveButton.prototype).extend({\n        _init: function() {\n            this.type = \"Edge-remove-button\";\n            this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -90, 90, 1, \"remove\", this.renkan.translate(\"Remove\"));\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                if (this.options.element_delete_delay) {\n                    var delid = Utils.getUID(\"delete\");\n                    this.renderer.delete_list.push({\n                        id: delid,\n                        time: new Date().valueOf() + this.options.element_delete_delay\n                    });\n                    this.source_representation.model.set(\"delete_scheduled\", delid);\n                } else {\n                    if (confirm(this.renkan.translate('Do you really wish to remove edge ') + '\"' + this.source_representation.model.get(\"title\") + '\"?')) {\n                        this.project.removeEdge(this.source_representation.model);\n                    }\n                }\n            }\n        }\n    }).value();\n\n    /* EdgeRemoveButton End */\n\n    return EdgeRemoveButton;\n\n});\n\n\ndefine('renderer/edgerevertbutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* EdgeRevertButton Begin */\n\n    //var EdgeRevertButton = Renderer.EdgeRevertButton = Utils.inherit(Renderer._BaseButton);\n    var EdgeRevertButton = Utils.inherit(BaseButton);\n\n    _(EdgeRevertButton.prototype).extend({\n        _init: function() {\n            this.type = \"Edge-revert-button\";\n            this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -135, 135, 1, \"revert\", this.renkan.translate(\"Cancel deletion\"));\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            if (this.renderer.isEditable()) {\n                this.source_representation.model.unset(\"delete_scheduled\");\n            }\n        }\n    }).value();\n\n    /* EdgeRevertButton End */\n\n    return EdgeRevertButton;\n\n});\n\n\ndefine('renderer/miniframe',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* MiniFrame Begin */\n\n    //var MiniFrame = Renderer.MiniFrame = Utils.inherit(Renderer._BaseRepresentation);\n    var MiniFrame = Utils.inherit(BaseRepresentation);\n\n    _(MiniFrame.prototype).extend({\n        paperShift: function(_delta) {\n            this.renderer.offset = this.renderer.offset.subtract(_delta.divide(this.renderer.minimap.scale).multiply(this.renderer.scale));\n            this.renderer.redraw();\n        },\n        mouseup: function(_delta) {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n        }\n    }).value();\n\n\n    /* MiniFrame End */\n\n    return MiniFrame;\n\n});\n\n\ndefine('renderer/scene',['jquery', 'underscore', 'filesaver', 'requtils', 'renderer/miniframe'], function ($, _, filesaver, requtils, MiniFrame) {\n    'use strict';\n\n    var Utils = requtils.getUtils();\n\n    /* Scene Begin */\n\n    var Scene = function(_renkan) {\n        this.renkan = _renkan;\n        this.$ = $(\".Rk-Render\");\n        this.representations = [];\n        this.$.html(_renkan.options.templates['templates/scene.html'](_renkan));\n        this.onStatusChange();\n        this.canvas_$ = this.$.find(\".Rk-Canvas\");\n        this.labels_$ = this.$.find(\".Rk-Labels\");\n        if (!_renkan.options.popup_editor){\n            this.editor_$ = $(\"#\" + _renkan.options.editor_panel);\n        }else{\n            this.editor_$ = this.$.find(\".Rk-Editor\");\n        }\n        this.notif_$ = this.$.find(\".Rk-Notifications\");\n        paper.setup(this.canvas_$[0]);\n        this.scale = 1;\n        this.initialScale = 1;\n        this.offset = paper.view.center;\n        this.totalScroll = 0;\n        this.hiddenNodes = [];\n        this.mouse_down = false;\n        this.click_target = null;\n        this.selected_target = null;\n        this.edge_layer = new paper.Layer();\n        this.node_layer = new paper.Layer();\n        this.buttons_layer = new paper.Layer();\n        this.delete_list = [];\n        this.redrawActive = true;\n\n        if (_renkan.options.show_minimap) {\n            this.minimap = {\n                    background_layer: new paper.Layer(),\n                    edge_layer: new paper.Layer(),\n                    node_layer: new paper.Layer(),\n                    node_group: new paper.Group(),\n                    size: new paper.Size( _renkan.options.minimap_width, _renkan.options.minimap_height )\n            };\n\n            this.minimap.background_layer.activate();\n            this.minimap.topleft = paper.view.bounds.bottomRight.subtract(this.minimap.size);\n            this.minimap.rectangle = new paper.Path.Rectangle(this.minimap.topleft.subtract([2,2]), this.minimap.size.add([4,4]));\n            this.minimap.rectangle.fillColor = _renkan.options.minimap_background_color;\n            this.minimap.rectangle.strokeColor = _renkan.options.minimap_border_color;\n            this.minimap.rectangle.strokeWidth = 4;\n            this.minimap.offset = new paper.Point(this.minimap.size.divide(2));\n            this.minimap.scale = 0.1;\n\n            this.minimap.node_layer.activate();\n            this.minimap.cliprectangle = new paper.Path.Rectangle(this.minimap.topleft, this.minimap.size);\n            this.minimap.node_group.addChild(this.minimap.cliprectangle);\n            this.minimap.node_group.clipped = true;\n            this.minimap.miniframe = new paper.Path.Rectangle(this.minimap.topleft, this.minimap.size);\n            this.minimap.node_group.addChild(this.minimap.miniframe);\n            this.minimap.miniframe.fillColor = '#c0c0ff';\n            this.minimap.miniframe.opacity = 0.3;\n            this.minimap.miniframe.strokeColor = '#000080';\n            this.minimap.miniframe.strokeWidth = 2;\n            this.minimap.miniframe.__representation = new MiniFrame(this, null);\n        }\n\n        this.throttledPaperDraw = _(function() {\n            paper.view.draw();\n        }).throttle(100).value();\n\n        this.bundles = [];\n        this.click_mode = false;\n\n        var _this = this,\n        _allowScroll = true,\n        _originalScale = 1,\n        _zooming = false,\n        _lastTapX = 0,\n        _lastTapY = 0;\n\n        this.image_cache = {};\n        this.icon_cache = {};\n\n        ['edit', 'remove', 'hide', 'show', 'link', 'enlarge', 'shrink', 'revert' ].forEach(function(imgname) {\n            var img = new Image();\n            img.src = _renkan.options.static_url + 'img/' + imgname + '.png';\n            _this.icon_cache[imgname] = img;\n        });\n\n        var throttledMouseMove = _.throttle(function(_event, _isTouch) {\n            _this.onMouseMove(_event, _isTouch);\n        }, Utils._MOUSEMOVE_RATE);\n\n        this.canvas_$.on({\n            mousedown: function(_event) {\n                _event.preventDefault();\n                _this.onMouseDown(_event, false);\n            },\n            mousemove: function(_event) {\n                _event.preventDefault();\n                throttledMouseMove(_event, false);\n            },\n            mouseup: function(_event) {\n                _event.preventDefault();\n                _this.onMouseUp(_event, false);\n            },\n            mousewheel: function(_event, _delta) {\n                if(_renkan.options.zoom_on_scroll) {\n                    _event.preventDefault();\n                    if (_allowScroll) {\n                        _this.onScroll(_event, _delta);\n                    }\n                }\n            },\n            touchstart: function(_event) {\n                _event.preventDefault();\n                var _touches = _event.originalEvent.touches[0];\n                if (\n                        _renkan.options.allow_double_click &&\n                        new Date() - _lastTap < Utils._DOUBLETAP_DELAY &&\n                        ( Math.pow(_lastTapX - _touches.pageX, 2) + Math.pow(_lastTapY - _touches.pageY, 2) < Utils._DOUBLETAP_DISTANCE )\n                ) {\n                    _lastTap = 0;\n                    _this.onDoubleClick(_touches);\n                } else {\n                    _lastTap = new Date();\n                    _lastTapX = _touches.pageX;\n                    _lastTapY = _touches.pageY;\n                    _originalScale = _this.scale;\n                    _zooming = false;\n                    _this.onMouseDown(_touches, true);\n                }\n            },\n            touchmove: function(_event) {\n                _event.preventDefault();\n                _lastTap = 0;\n                if (_event.originalEvent.touches.length === 1) {\n                    _this.onMouseMove(_event.originalEvent.touches[0], true);\n                } else {\n                    if (!_zooming) {\n                        _this.onMouseUp(_event.originalEvent.touches[0], true);\n                        _this.click_target = null;\n                        _this.is_dragging = false;\n                        _zooming = true;\n                    }\n                    if (_event.originalEvent.scale === \"undefined\") {\n                        return;\n                    }\n                    var _newScale = _event.originalEvent.scale * _originalScale,\n                    _scaleRatio = _newScale / _this.scale,\n                    _newOffset = new paper.Point([\n                                                  _this.canvas_$.width(),\n                                                  _this.canvas_$.height()\n                                                  ]).multiply( 0.5 * ( 1 - _scaleRatio ) ).add(_this.offset.multiply( _scaleRatio ));\n                    _this.setScale(_newScale, _newOffset);\n                }\n            },\n            touchend: function(_event) {\n                _event.preventDefault();\n                _this.onMouseUp(_event.originalEvent.changedTouches[0], true);\n            },\n            dblclick: function(_event) {\n                _event.preventDefault();\n                if (_renkan.options.allow_double_click) {\n                    _this.onDoubleClick(_event);\n                }\n            },\n            mouseleave: function(_event) {\n                _event.preventDefault();\n                //_this.onMouseUp(_event, false);\n                _this.click_target = null;\n                _this.is_dragging = false;\n            },\n            dragover: function(_event) {\n                _event.preventDefault();\n            },\n            dragenter: function(_event) {\n                _event.preventDefault();\n                _allowScroll = false;\n            },\n            dragleave: function(_event) {\n                _event.preventDefault();\n                _allowScroll = true;\n            },\n            drop: function(_event) {\n                _event.preventDefault();\n                _allowScroll = true;\n                var res = {};\n                _.each(_event.originalEvent.dataTransfer.types, function(t) {\n                    try {\n                        res[t] = _event.originalEvent.dataTransfer.getData(t);\n                    } catch(e) {}\n                });\n                var text = _event.originalEvent.dataTransfer.getData(\"Text\");\n                if (typeof text === \"string\") {\n                    switch(text[0]) {\n                    case \"{\":\n                    case \"[\":\n                        try {\n                            var data = JSON.parse(text);\n                            _.extend(res,data);\n                        }\n                        catch(e) {\n                            if (!res[\"text/plain\"]) {\n                                res[\"text/plain\"] = text;\n                            }\n                        }\n                        break;\n                    case \"<\":\n                        if (!res[\"text/html\"]) {\n                            res[\"text/html\"] = text;\n                        }\n                        break;\n                    default:\n                        if (!res[\"text/plain\"]) {\n                            res[\"text/plain\"] = text;\n                        }\n                    }\n                }\n                var url = _event.originalEvent.dataTransfer.getData(\"URL\");\n                if (url && !res[\"text/uri-list\"]) {\n                    res[\"text/uri-list\"] = url;\n                }\n                _this.dropData(res, _event.originalEvent);\n            }\n        });\n\n        var bindClick = function(selector, fname) {\n            _this.$.find(selector).click(function(evt) {\n                _this[fname](evt);\n                return false;\n            });\n        };\n\n        bindClick(\".Rk-ZoomOut\", \"zoomOut\");\n        bindClick(\".Rk-ZoomIn\", \"zoomIn\");\n        bindClick(\".Rk-ZoomFit\", \"autoScale\");\n        this.$.find(\".Rk-ZoomSave\").click( function() {\n            // Save scale and offset point\n            _this.renkan.project.addView( { zoom_level:_this.scale, offset:_this.offset, hidden_nodes: _this.hiddenNodes } );\n        });\n        this.$.find(\".Rk-ZoomSetSaved\").click( function() {\n            var view = _this.renkan.project.get(\"views\").last();\n            if(view){\n                _this.showNodes(false);\n                _this.setScale(view.get(\"zoom_level\"), new paper.Point(view.get(\"offset\")));\n                if (_this.renkan.options.hide_nodes){\n                    _this.hiddenNodes = (view.get(\"hidden_nodes\") || []).concat();\n                    _this.hideNodes();                    \n                }\n            }\n        });\n        this.$.find(\".Rk-ShowHiddenNodes\").mouseenter( function() {\n            _this.showNodes(true);\n            _this.$.find(\".Rk-ShowHiddenNodes\").mouseleave( function() {\n                _this.hideNodes();\n            });\n        });\n        this.$.find(\".Rk-ShowHiddenNodes\").click( function() {\n            _this.showNodes(false);\n            _this.$.find(\".Rk-ShowHiddenNodes\").off( \"mouseleave\" );\n        });\n        if(this.renkan.project.get(\"views\").length > 0 && this.renkan.options.save_view){\n            this.$.find(\".Rk-ZoomSetSaved\").show();\n        }\n        this.$.find(\".Rk-CurrentUser\").mouseenter(\n                function() { _this.$.find(\".Rk-UserList\").slideDown(); }\n        );\n        this.$.find(\".Rk-Users\").mouseleave(\n                function() { _this.$.find(\".Rk-UserList\").slideUp(); }\n        );\n        bindClick(\".Rk-FullScreen-Button\", \"fullScreen\");\n        bindClick(\".Rk-AddNode-Button\", \"addNodeBtn\");\n        bindClick(\".Rk-AddEdge-Button\", \"addEdgeBtn\");\n        bindClick(\".Rk-Save-Button\", \"save\");\n        bindClick(\".Rk-Open-Button\", \"open\");\n        bindClick(\".Rk-Export-Button\", \"exportProject\");\n        this.$.find(\".Rk-Bookmarklet-Button\")\n          /*jshint scripturl:true */\n          .attr(\"href\",\"javascript:\" + Utils._BOOKMARKLET_CODE(_renkan))\n          .click(function(){\n              _this.notif_$\n              .text(_renkan.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.\"))\n              .fadeIn()\n              .delay(5000)\n              .fadeOut();\n              return false;\n          });\n        this.$.find(\".Rk-TopBar-Button\").mouseover(function() {\n            $(this).find(\".Rk-TopBar-Tooltip\").show();\n        }).mouseout(function() {\n            $(this).find(\".Rk-TopBar-Tooltip\").hide();\n        });\n        bindClick(\".Rk-Fold-Bins\", \"foldBins\");\n\n        paper.view.onResize = function(_event) {\n            var _ratio,\n                newWidth = _event.width,\n                newHeight = _event.height;\n\n            if (_this.minimap) {\n                _this.minimap.topleft = paper.view.bounds.bottomRight.subtract(_this.minimap.size);\n                _this.minimap.rectangle.fitBounds(_this.minimap.topleft.subtract([2,2]), _this.minimap.size.add([4,4]));\n                _this.minimap.cliprectangle.fitBounds(_this.minimap.topleft, _this.minimap.size);\n            }\n\n            var ratioH = newHeight/(newHeight-_event.delta.height),\n                ratioW = newWidth/(newWidth-_event.delta.width);\n            if (newHeight < newWidth) {\n                    _ratio = ratioH;\n            } else {\n                _ratio = ratioW;\n            }\n\n            _this.resizeZoom(ratioW, ratioH, _ratio);\n\n            _this.redraw();\n\n        };\n\n        var _thRedraw = _.throttle(function() {\n            _this.redraw();\n        },50);\n\n        this.addRepresentations(\"Node\", this.renkan.project.get(\"nodes\"));\n        this.addRepresentations(\"Edge\", this.renkan.project.get(\"edges\"));\n        this.renkan.project.on(\"change:title\", function() {\n            _this.$.find(\".Rk-PadTitle\").val(_renkan.project.get(\"title\"));\n        });\n\n        this.$.find(\".Rk-PadTitle\").on(\"keyup input paste\", function() {\n            _renkan.project.set({\"title\": $(this).val()});\n        });\n\n        var _thRedrawUsers = _.throttle(function() {\n            _this.redrawUsers();\n        }, 100);\n\n        _thRedrawUsers();\n\n        // register model events\n        this.renkan.project.on(\"change:saveStatus\", function(){\n            switch (_this.renkan.project.get(\"saveStatus\")) {\n                case 0: //clean\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"to-save\");\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saving\");\n                    _this.$.find(\".Rk-Save-Button\").addClass(\"saved\");\n                    break;\n                case 1: //dirty\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saved\");\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saving\");\n                    _this.$.find(\".Rk-Save-Button\").addClass(\"to-save\");\n                    break;\n                case 2: //saving\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saved\");\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"to-save\");\n                    _this.$.find(\".Rk-Save-Button\").addClass(\"saving\");\n                    break;\n            }\n        });\n\n        this.renkan.project.on(\"change:loadingStatus\", function(){\n            if (_this.renkan.project.get(\"loadingStatus\")){\n                var animate = _this.$.find(\".loader\").addClass(\"run\");\n                var timer = setTimeout(function(){\n                    _this.$.find(\".loader\").hide(250);\n                }, 3000);\n            }\n            else{\n                Backbone.history.start();\n            }\n        });\n\n        this.renkan.project.on(\"add:users remove:users\", _thRedrawUsers);\n\n        this.renkan.project.on(\"add:views remove:views\", function(_node) {\n            if(_this.renkan.project.get('views').length > 0) {\n                _this.$.find(\".Rk-ZoomSetSaved\").show();\n            }\n            else {\n                _this.$.find(\".Rk-ZoomSetSaved\").hide();\n            }\n        });\n\n        this.renkan.project.on(\"add:nodes\", function(_node) {\n            _this.addRepresentation(\"Node\", _node);\n            if (!_this.renkan.project.get(\"loadingStatus\")){\n                _thRedraw();\n            }\n        });\n        this.renkan.project.on(\"add:edges\", function(_edge) {\n            _this.addRepresentation(\"Edge\", _edge);\n            if (!_this.renkan.project.get(\"loadingStatus\")){\n                _thRedraw();\n            }\n        });\n        this.renkan.project.on(\"change:title\", function(_model, _title) {\n            var el = _this.$.find(\".Rk-PadTitle\");\n            if (el.is(\"input\")) {\n                if (el.val() !== _title) {\n                    el.val(_title);\n                }\n            } else {\n                el.text(_title);\n            }\n        });\n        \n        //register router events\n        this.renkan.router.on(\"router\", function(_params){\n            _this.parameters(_params);\n        });\n\n        if (_renkan.options.size_bug_fix) {\n            var _delay = (\n                    typeof _renkan.options.size_bug_fix === \"number\" ?\n                        _renkan.options.size_bug_fix\n                                : 500\n            );\n            window.setTimeout(\n                    function() {\n                        _this.fixSize();\n                    },\n                    _delay\n            );\n        }\n\n        if (_renkan.options.force_resize) {\n            $(window).resize(function() {\n                _this.autoScale();\n            });\n        }\n\n        if (_renkan.options.show_user_list && _renkan.options.user_color_editable) {\n            var $cpwrapper = this.$.find(\".Rk-Users .Rk-Edit-ColorPicker-Wrapper\"),\n            $cplist = this.$.find(\".Rk-Users .Rk-Edit-ColorPicker\");\n\n            $cpwrapper.hover(\n                    function(_e) {\n                        if (_this.isEditable()) {\n                            _e.preventDefault();\n                            $cplist.show();\n                        }\n                    },\n                    function(_e) {\n                        _e.preventDefault();\n                        $cplist.hide();\n                    }\n            );\n\n            $cplist.find(\"li\").mouseenter(\n                    function(_e) {\n                        if (_this.isEditable()) {\n                            _e.preventDefault();\n                            _this.$.find(\".Rk-CurrentUser-Color\").css(\"background\", $(this).attr(\"data-color\"));\n                        }\n                    }\n            );\n        }\n\n        if (_renkan.options.show_search_field) {\n\n            var lastval = '';\n\n            this.$.find(\".Rk-GraphSearch-Field\").on(\"keyup change paste input\", function() {\n                var $this = $(this),\n                val = $this.val();\n                if (val === lastval) {\n                    return;\n                }\n                lastval = val;\n                if (val.length < 2) {\n                    _renkan.project.get(\"nodes\").each(function(n) {\n                        _this.getRepresentationByModel(n).unhighlight();\n                    });\n                } else {\n                    var rxs = Utils.regexpFromTextOrArray(val);\n                    _renkan.project.get(\"nodes\").each(function(n) {\n                        if (rxs.test(n.get(\"title\")) || rxs.test(n.get(\"description\"))) {\n                            _this.getRepresentationByModel(n).highlight(rxs);\n                        } else {\n                            _this.getRepresentationByModel(n).unhighlight();\n                        }\n                    });\n                }\n            });\n        }\n\n        this.redraw();\n\n        window.setInterval(function() {\n            var _now = new Date().valueOf();\n            _this.delete_list.forEach(function(d) {\n                if (_now >= d.time) {\n                    var el = _renkan.project.get(\"nodes\").findWhere({\"delete_scheduled\":d.id});\n                    if (el) {\n                        project.removeNode(el);\n                    }\n                    el = _renkan.project.get(\"edges\").findWhere({\"delete_scheduled\":d.id});\n                    if (el) {\n                        project.removeEdge(el);\n                    }\n                }\n            });\n            _this.delete_list = _this.delete_list.filter(function(d) {\n                return _renkan.project.get(\"nodes\").findWhere({\"delete_scheduled\":d.id}) || _renkan.project.get(\"edges\").findWhere({\"delete_scheduled\":d.id});\n            });\n        }, 500);\n\n        if (this.minimap) {\n            window.setInterval(function() {\n                _this.rescaleMinimap();\n            }, 2000);\n        }\n\n    };\n\n    _(Scene.prototype).extend({\n        fixSize: function() {\n            if( this.renkan.options.default_view && this.renkan.project.get(\"views\").length > 0) {\n                var view = this.renkan.project.get(\"views\").last();\n                this.setScale(view.get(\"zoom_level\"), new paper.Point(view.get(\"offset\")));\n            }\n            else{\n                this.autoScale();\n            }\n        },\n        drawSector: function(_repr, _inR, _outR, _startAngle, _endAngle, _padding, _imgname, _caption) {\n            var _options = this.renkan.options,\n                _startRads = _startAngle * Math.PI / 180,\n                _endRads = _endAngle * Math.PI / 180,\n                _img = this.icon_cache[_imgname],\n                _startdx = - Math.sin(_startRads),\n                _startdy = Math.cos(_startRads),\n                _startXIn = Math.cos(_startRads) * _inR + _padding * _startdx,\n                _startYIn = Math.sin(_startRads) * _inR + _padding * _startdy,\n                _startXOut = Math.cos(_startRads) * _outR + _padding * _startdx,\n                _startYOut = Math.sin(_startRads) * _outR + _padding * _startdy,\n                _enddx = - Math.sin(_endRads),\n                _enddy = Math.cos(_endRads),\n                _endXIn = Math.cos(_endRads) * _inR - _padding * _enddx,\n                _endYIn = Math.sin(_endRads) * _inR - _padding * _enddy,\n                _endXOut = Math.cos(_endRads) * _outR - _padding * _enddx,\n                _endYOut = Math.sin(_endRads) * _outR - _padding * _enddy,\n                _centerR = (_inR + _outR) / 2,\n                _centerRads = (_startRads + _endRads) / 2,\n                _centerX = Math.cos(_centerRads) * _centerR,\n                _centerY = Math.sin(_centerRads) * _centerR,\n                _centerXIn = Math.cos(_centerRads) * _inR,\n                _centerXOut = Math.cos(_centerRads) * _outR,\n                _centerYIn = Math.sin(_centerRads) * _inR,\n                _centerYOut = Math.sin(_centerRads) * _outR,\n                _textX = Math.cos(_centerRads) * (_outR + 3),\n                _textY = Math.sin(_centerRads) * (_outR + _options.buttons_label_font_size) + _options.buttons_label_font_size / 2;\n            this.buttons_layer.activate();\n            var _path = new paper.Path();\n            _path.add([_startXIn, _startYIn]);\n            _path.arcTo([_centerXIn, _centerYIn], [_endXIn, _endYIn]);\n            _path.lineTo([_endXOut,  _endYOut]);\n            _path.arcTo([_centerXOut, _centerYOut], [_startXOut, _startYOut]);\n            _path.fillColor = _options.buttons_background;\n            _path.opacity = 0.5;\n            _path.closed = true;\n            _path.__representation = _repr;\n            var _text = new paper.PointText(_textX,_textY);\n            _text.characterStyle = {\n                    fontSize: _options.buttons_label_font_size,\n                    fillColor: _options.buttons_label_color\n            };\n            if (_textX > 2) {\n                _text.paragraphStyle.justification = 'left';\n            } else if (_textX < -2) {\n                _text.paragraphStyle.justification = 'right';\n            } else {\n                _text.paragraphStyle.justification = 'center';\n            }\n            _text.visible = false;\n            var _visible = false,\n                _restPos = new paper.Point(-200, -200),\n                _grp = new paper.Group([_path, _text]),\n                //_grp = new paper.Group([_path]),\n                _delta = _grp.position,\n                _imgdelta = new paper.Point([_centerX, _centerY]),\n                _currentPos = new paper.Point(0,0);\n            _text.content = _caption;\n            // set group pivot to not depend on text visibility that changes the group bounding box.\n            _grp.pivot = _grp.bounds.center;\n            _grp.visible = false;\n            _grp.position = _restPos;\n            var _res = {\n                    show: function() {\n                        _visible = true;\n                        _grp.position = _currentPos.add(_delta);\n                        _grp.visible = true;\n                    },\n                    moveTo: function(_point) {\n                        _currentPos = _point;\n                        if (_visible) {\n                            _grp.position = _point.add(_delta);\n                        }\n                    },\n                    hide: function() {\n                        _visible = false;\n                        _grp.visible = false;\n                        _grp.position = _restPos;\n                    },\n                    select: function() {\n                        _path.opacity = 0.8;\n                        _text.visible = true;\n                    },\n                    unselect: function() {\n                        _path.opacity = 0.5;\n                        _text.visible = false;\n                    },\n                    destroy: function() {\n                        _grp.remove();\n                    }\n            };\n            var showImage = function() {\n                var _raster = new paper.Raster(_img);\n                _raster.position = _imgdelta.add(_grp.position).subtract(_delta);\n                _raster.locked = true; // Disable mouse events on icon\n                _grp.addChild(_raster);\n            };\n            if (_img.width) {\n                showImage();\n            } else {\n                $(_img).on(\"load\",showImage);\n            }\n\n            return _res;\n        },\n        addToBundles: function(_edgeRepr) {\n            var _bundle = _(this.bundles).find(function(_bundle) {\n                return (\n                        ( _bundle.from === _edgeRepr.from_representation && _bundle.to === _edgeRepr.to_representation ) ||\n                        ( _bundle.from === _edgeRepr.to_representation && _bundle.to === _edgeRepr.from_representation )\n                );\n            });\n            if (typeof _bundle !== \"undefined\") {\n                _bundle.edges.push(_edgeRepr);\n            } else {\n                _bundle = {\n                        from: _edgeRepr.from_representation,\n                        to: _edgeRepr.to_representation,\n                        edges: [ _edgeRepr ],\n                        getPosition: function(_er) {\n                            var _dir = (_er.from_representation === this.from) ? 1 : -1;\n                            return _dir * ( _(this.edges).indexOf(_er) - (this.edges.length - 1) / 2 );\n                        }\n                };\n                this.bundles.push(_bundle);\n            }\n            return _bundle;\n        },\n        isEditable: function() {\n            return (this.renkan.options.editor_mode && !this.renkan.read_only);\n        },\n        onStatusChange: function() {\n            var savebtn = this.$.find(\".Rk-Save-Button\"),\n            tip = savebtn.find(\".Rk-TopBar-Tooltip-Contents\");\n            if (this.renkan.read_only) {\n                savebtn.removeClass(\"disabled Rk-Save-Online\").addClass(\"Rk-Save-ReadOnly\");\n                tip.text(this.renkan.translate(\"Connection lost\"));\n            } else {\n                if (this.renkan.options.manual_save) {\n                    savebtn.removeClass(\"Rk-Save-ReadOnly Rk-Save-Online\");\n                    tip.text(this.renkan.translate(\"Save Project\"));\n                } else {\n                    savebtn.removeClass(\"disabled Rk-Save-ReadOnly\").addClass(\"Rk-Save-Online\");\n                    tip.text(this.renkan.translate(\"Auto-save enabled\"));\n                }\n            }\n            this.redrawUsers();\n        },\n        setScale: function(_newScale, _offset) {\n            if ((_newScale/this.initialScale) > Utils._MIN_SCALE && (_newScale/this.initialScale) < Utils._MAX_SCALE) {\n                this.scale = _newScale;\n                if (_offset) {\n                    this.offset = _offset;\n                }\n                this.redraw();\n            }\n        },\n        autoScale: function(force_view) {\n            var nodes = this.renkan.project.get(\"nodes\");\n            if (nodes.length > 1) {\n                var _xx = nodes.map(function(_node) { return _node.get(\"position\").x; }),\n                _yy = nodes.map(function(_node) { return _node.get(\"position\").y; }),\n                _minx = Math.min.apply(Math, _xx),\n                _miny = Math.min.apply(Math, _yy),\n                _maxx = Math.max.apply(Math, _xx),\n                _maxy = Math.max.apply(Math, _yy);\n                var _scale = Math.min( (paper.view.size.width - 2 * this.renkan.options.autoscale_padding) / (_maxx - _minx), (paper.view.size.height - 2 * this.renkan.options.autoscale_padding) / (_maxy - _miny));\n                this.initialScale = _scale;\n                // Override calculated scale if asked\n                if((typeof force_view !== \"undefined\") && parseFloat(force_view.zoom_level)>0 && parseFloat(force_view.offset.x)>0 && parseFloat(force_view.offset.y)>0){\n                    this.setScale(parseFloat(force_view.zoom_level), new paper.Point(parseFloat(force_view.offset.x), parseFloat(force_view.offset.y)));\n                }\n                else{\n                    this.setScale(_scale, paper.view.center.subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale)));\n                }\n            }\n            if (nodes.length === 1) {\n                this.setScale(1, paper.view.center.subtract(new paper.Point([nodes.at(0).get(\"position\").x, nodes.at(0).get(\"position\").y])));\n            }\n        },\n        redrawMiniframe: function() {\n            var topleft = this.toMinimapCoords(this.toModelCoords(new paper.Point([0,0]))),\n                bottomright = this.toMinimapCoords(this.toModelCoords(paper.view.bounds.bottomRight));\n            this.minimap.miniframe.fitBounds(topleft, bottomright);\n        },\n        rescaleMinimap: function() {\n            var nodes = this.renkan.project.get(\"nodes\");\n            if (nodes.length > 1) {\n                var _xx = nodes.map(function(_node) { return _node.get(\"position\").x; }),\n                    _yy = nodes.map(function(_node) { return _node.get(\"position\").y; }),\n                    _minx = Math.min.apply(Math, _xx),\n                    _miny = Math.min.apply(Math, _yy),\n                    _maxx = Math.max.apply(Math, _xx),\n                    _maxy = Math.max.apply(Math, _yy);\n                var _scale = Math.min(\n                        this.scale * 0.8 * this.renkan.options.minimap_width / paper.view.bounds.width,\n                        this.scale * 0.8 * this.renkan.options.minimap_height / paper.view.bounds.height,\n                        ( this.renkan.options.minimap_width - 2 * this.renkan.options.minimap_padding ) / (_maxx - _minx),\n                        ( this.renkan.options.minimap_height - 2 * this.renkan.options.minimap_padding ) / (_maxy - _miny)\n                );\n                this.minimap.offset = this.minimap.size.divide(2).subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale));\n                this.minimap.scale = _scale;\n            }\n            if (nodes.length === 1) {\n                this.minimap.scale = 0.1;\n                this.minimap.offset = this.minimap.size.divide(2).subtract(new paper.Point([nodes.at(0).get(\"position\").x, nodes.at(0).get(\"position\").y]).multiply(this.minimap.scale));\n            }\n            this.redraw();\n        },\n        toPaperCoords: function(_point) {\n            return _point.multiply(this.scale).add(this.offset);\n        },\n        toMinimapCoords: function(_point) {\n            return _point.multiply(this.minimap.scale).add(this.minimap.offset).add(this.minimap.topleft);\n        },\n        toModelCoords: function(_point) {\n            return _point.subtract(this.offset).divide(this.scale);\n        },\n        addRepresentation: function(_type, _model) {\n            var RendererType = requtils.getRenderer()[_type];\n            var _repr = new RendererType(this, _model);\n            this.representations.push(_repr);\n            return _repr;\n        },\n        addRepresentations: function(_type, _collection) {\n            var _this = this;\n            _collection.forEach(function(_model) {\n                _this.addRepresentation(_type, _model);\n            });\n        },\n        userTemplate: _.template(\n                '<li class=\"Rk-User\"><span class=\"Rk-UserColor\" style=\"background:<%=background%>;\"></span><%=name%></li>'\n        ),\n        redrawUsers: function() {\n            if (!this.renkan.options.show_user_list) {\n                return;\n            }\n            var allUsers = [].concat((this.renkan.project.current_user_list || {}).models || [], (this.renkan.project.get(\"users\") || {}).models || []),\n            ulistHtml = '',\n            $userpanel = this.$.find(\".Rk-Users\"),\n            $name = $userpanel.find(\".Rk-CurrentUser-Name\"),\n            $cpitems = $userpanel.find(\".Rk-Edit-ColorPicker li\"),\n            $colorsquare = $userpanel.find(\".Rk-CurrentUser-Color\"),\n            _this = this;\n            $name.off(\"click\").text(this.renkan.translate(\"<unknown user>\"));\n            $cpitems.off(\"mouseleave click\");\n            allUsers.forEach(function(_user) {\n                if (_user.get(\"_id\") === _this.renkan.current_user) {\n                    $name.text(_user.get(\"title\"));\n                    $colorsquare.css(\"background\", _user.get(\"color\"));\n                    if (_this.isEditable()) {\n\n                        if (_this.renkan.options.user_name_editable) {\n                            $name.click(function() {\n                                var $this = $(this),\n                                $input = $('<input>').val(_user.get(\"title\")).blur(function() {\n                                    _user.set(\"title\", $(this).val());\n                                    _this.redrawUsers();\n                                    _this.redraw();\n                                });\n                                $this.empty().html($input);\n                                $input.select();\n                            });\n                        }\n\n                        if (_this.renkan.options.user_color_editable) {\n                            $cpitems.click(\n                                    function(_e) {\n                                        _e.preventDefault();\n                                        if (_this.isEditable()) {\n                                            _user.set(\"color\", $(this).attr(\"data-color\"));\n                                        }\n                                        $(this).parent().hide();\n                                    }\n                            ).mouseleave(function() {\n                                $colorsquare.css(\"background\", _user.get(\"color\"));\n                            });\n                        }\n                    }\n\n                } else {\n                    ulistHtml += _this.userTemplate({\n                        name: _user.get(\"title\"),\n                        background: _user.get(\"color\")\n                    });\n                }\n            });\n            $userpanel.find(\".Rk-UserList\").html(ulistHtml);\n        },\n        removeRepresentation: function(_representation) {\n            _representation.destroy();\n            this.representations = _.reject(this.representations,\n                function(_repr) {\n                    return _repr === _representation;\n                }\n            );\n        },\n        getRepresentationByModel: function(_model) {\n            if (!_model) {\n                return undefined;\n            }\n            return _.find(this.representations, function(_repr) {\n                return _repr.model === _model;\n            });\n        },\n        removeRepresentationsOfType: function(_type) {\n            var _representations = _.filter(this.representations,function(_repr) {\n                return _repr.type === _type;\n                }),\n                _this = this;\n            _.each(_representations, function(_repr) {\n                _this.removeRepresentation(_repr);\n            });\n        },\n        highlightModel: function(_model) {\n            var _repr = this.getRepresentationByModel(_model);\n            if (_repr) {\n                _repr.highlight();\n            }\n        },\n        unhighlightAll: function(_model) {\n            _.each(this.representations, function(_repr) {\n                _repr.unhighlight();\n            });\n        },\n        unselectAll: function(_model) {\n            _.each(this.representations, function(_repr) {\n                _repr.unselect();\n            });\n        },\n        redraw: function() {\n            var _this = this;\n            if(! this.redrawActive ) {\n                return;\n            }\n            _.each(this.representations, function(_representation) {\n                _representation.redraw({ dontRedrawEdges:true });\n            });\n            if (this.minimap) {\n                this.redrawMiniframe();\n            }\n            paper.view.draw();\n        },\n        addTempEdge: function(_from, _point) {\n            var _tmpEdge = this.addRepresentation(\"TempEdge\",null);\n            _tmpEdge.end_pos = _point;\n            _tmpEdge.from_representation = _from;\n            _tmpEdge.redraw();\n            this.click_target = _tmpEdge;\n        },\n        addHiddenNode: function(_model){\n            this.hideNode(_model);\n            this.hiddenNodes.push(_model.id);\n        },\n        hideNode: function(_model){\n            var _this = this;\n            if (typeof _this.getRepresentationByModel(_model) !== 'undefined'){\n                _this.getRepresentationByModel(_model).hide();\n            }\n        },\n        hideNodes: function(){\n            var _this = this;\n            this.hiddenNodes.forEach(function(_id, index){\n                var node = _this.renkan.project.get(\"nodes\").get(_id);\n                if (typeof node !== 'undefined'){\n                    return _this.hideNode(_this.renkan.project.get(\"nodes\").get(_id));\n                }else{\n                    _this.hiddenNodes.splice(index, 1);\n                }\n            });\n            paper.view.draw();\n        },\n        showNodes: function(ghost){\n            var _this = this;\n            var i = 0;\n            this.hiddenNodes.forEach(function(_id){\n                i++;\n                _this.getRepresentationByModel(_this.renkan.project.get(\"nodes\").get(_id)).show(ghost);\n            });\n            if (!ghost){\n                this.hiddenNodes = [];\n            }\n            paper.view.draw();\n        },\n        findTarget: function(_hitResult) {\n            if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                var _newTarget = _hitResult.item.__representation;\n                if (this.selected_target !== _hitResult.item.__representation) {\n                    if (this.selected_target) {\n                        this.selected_target.unselect(_newTarget);\n                    }\n                    _newTarget.select(this.selected_target);\n                    this.selected_target = _newTarget;\n                }\n            } else {\n                if (this.selected_target) {\n                    this.selected_target.unselect();\n                }\n                this.selected_target = null;\n            }\n        },\n        paperShift: function(_delta) {\n            this.offset = this.offset.add(_delta);\n            this.redraw();\n        },\n        onMouseMove: function(_event) {\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]),\n                                      _delta = _point.subtract(this.last_point);\n            this.last_point = _point;\n            if (!this.is_dragging && this.mouse_down && _delta.length > Utils._MIN_DRAG_DISTANCE) {\n                this.is_dragging = true;\n            }\n            var _hitResult = paper.project.hitTest(_point);\n            if (this.is_dragging) {\n                if (this.click_target && typeof this.click_target.paperShift === \"function\") {\n                    this.click_target.paperShift(_delta);\n                } else {\n                    this.paperShift(_delta);\n                }\n            } else {\n                this.findTarget(_hitResult);\n            }\n            paper.view.draw();\n        },\n        onMouseDown: function(_event, _isTouch) {\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]);\n            this.last_point = _point;\n            this.mouse_down = true;\n            if (!this.click_target || this.click_target.type !== \"Temp-edge\") {\n                this.removeRepresentationsOfType(\"editor\");\n                this.is_dragging = false;\n                var _hitResult = paper.project.hitTest(_point);\n                if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                    this.click_target = _hitResult.item.__representation;\n                    this.click_target.mousedown(_event, _isTouch);\n                } else {\n                    this.click_target = null;\n                    if (this.isEditable() && this.click_mode === Utils._CLICKMODE_ADDNODE) {\n                        var _coords = this.toModelCoords(_point),\n                        _data = {\n                            id: Utils.getUID('node'),\n                            created_by: this.renkan.current_user,\n                            position: {\n                                x: _coords.x,\n                                y: _coords.y\n                            }\n                        };\n                        var _node = this.renkan.project.addNode(_data);\n                        this.getRepresentationByModel(_node).openEditor();\n                    }\n                }\n            }\n            if (this.click_mode) {\n                if (this.isEditable() && this.click_mode === Utils._CLICKMODE_STARTEDGE && this.click_target && this.click_target.type === \"Node\") {\n                    this.removeRepresentationsOfType(\"editor\");\n                    this.addTempEdge(this.click_target, _point);\n                    this.click_mode = Utils._CLICKMODE_ENDEDGE;\n                    this.notif_$.fadeOut(function() {\n                        $(this).html(this.renkan.translate(\"Click on a second node to complete the edge\")).fadeIn();\n                    });\n                } else {\n                    this.notif_$.hide();\n                    this.click_mode = false;\n                }\n            }\n            paper.view.draw();\n        },\n        onMouseUp: function(_event, _isTouch) {\n            this.mouse_down = false;\n            if (this.click_target) {\n                var _off = this.canvas_$.offset();\n                this.click_target.mouseup(\n                        {\n                            point: new paper.Point([\n                                                    _event.pageX - _off.left,\n                                                    _event.pageY - _off.top\n                                                    ])\n                        },\n                        _isTouch\n                );\n            } else {\n                this.click_target = null;\n                this.is_dragging = false;\n                if (_isTouch) {\n                    this.unselectAll();\n                }\n            }\n            paper.view.draw();\n        },\n        onScroll: function(_event, _scrolldelta) {\n            this.totalScroll += _scrolldelta;\n            if (Math.abs(this.totalScroll) >= 1) {\n                var _off = this.canvas_$.offset(),\n                _delta = new paper.Point([\n                                          _event.pageX - _off.left,\n                                          _event.pageY - _off.top\n                                          ]).subtract(this.offset).multiply( Math.SQRT2 - 1 );\n                if (this.totalScroll > 0) {\n                    this.setScale( this.scale * Math.SQRT2, this.offset.subtract(_delta) );\n                } else {\n                    this.setScale( this.scale * Math.SQRT1_2, this.offset.add(_delta.divide(Math.SQRT2)));\n                }\n                this.totalScroll = 0;\n            }\n        },\n        onDoubleClick: function(_event) {\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]);\n            var _hitResult = paper.project.hitTest(_point);\n\n            if (!this.isEditable()) {\n                if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                    if (_hitResult.item.__representation.model.get('uri')){\n                        window.open(_hitResult.item.__representation.model.get('uri'), '_blank');\n                    }\n                }\n                return;\n            }\n            if (this.isEditable() && (!_hitResult || typeof _hitResult.item.__representation === \"undefined\")) {\n                var _coords = this.toModelCoords(_point),\n                _data = {\n                    id: Utils.getUID('node'),\n                    created_by: this.renkan.current_user,\n                    position: {\n                        x: _coords.x,\n                        y: _coords.y\n                    }\n                },\n                _node = this.renkan.project.addNode(_data);\n                this.getRepresentationByModel(_node).openEditor();\n            }\n            paper.view.draw();\n        },\n        defaultDropHandler: function(_data) {\n            var newNode = {};\n            var snippet = \"\";\n            switch(_data[\"text/x-iri-specific-site\"]) {\n                case \"twitter\":\n                    snippet = $('<div>').html(_data[\"text/x-iri-selected-html\"]);\n                    var tweetdiv = snippet.find(\".tweet\");\n                    newNode.title = this.renkan.translate(\"Tweet by \") + tweetdiv.attr(\"data-name\");\n                    newNode.uri = \"http://twitter.com/\" + tweetdiv.attr(\"data-screen-name\") + \"/status/\" + tweetdiv.attr(\"data-tweet-id\");\n                    newNode.image = tweetdiv.find(\".avatar\").attr(\"src\");\n                    newNode.description = tweetdiv.find(\".js-tweet-text:first\").text();\n                    break;\n                case \"google\":\n                    snippet = $('<div>').html(_data[\"text/x-iri-selected-html\"]);\n                    newNode.title = snippet.find(\"h3:first\").text().trim();\n                    newNode.uri = snippet.find(\"h3 a\").attr(\"href\");\n                    newNode.description = snippet.find(\".st:first\").text().trim();\n                    break;\n                default:\n                    if (_data[\"text/x-iri-source-uri\"]) {\n                        newNode.uri = _data[\"text/x-iri-source-uri\"];\n                    }\n            }\n            if (_data[\"text/plain\"] || _data[\"text/x-iri-selected-text\"]) {\n                newNode.description = (_data[\"text/plain\"] || _data[\"text/x-iri-selected-text\"]).replace(/[\\s\\n]+/gm,' ').trim();\n            }\n            if (_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]) {\n                snippet = $('<div>').html(_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]);\n                var _svgimgs = snippet.find(\"image\");\n                if (_svgimgs.length) {\n                    newNode.image = _svgimgs.attr(\"xlink:href\");\n                }\n                var _svgpaths = snippet.find(\"path\");\n                if (_svgpaths.length) {\n                    newNode.clipPath = _svgpaths.attr(\"d\");\n                }\n                var _imgs = snippet.find(\"img\");\n                if (_imgs.length) {\n                    newNode.image = _imgs[0].src;\n                }\n                var _as = snippet.find(\"a\");\n                if (_as.length) {\n                    newNode.uri = _as[0].href;\n                }\n                newNode.title = snippet.find(\"[title]\").attr(\"title\") || newNode.title;\n                newNode.description = snippet.text().replace(/[\\s\\n]+/gm,' ').trim();\n            }\n            if (_data[\"text/uri-list\"]) {\n                newNode.uri = _data[\"text/uri-list\"];\n            }\n            if (_data[\"text/x-moz-url\"] && !newNode.title) {\n                newNode.title = (_data[\"text/x-moz-url\"].split(\"\\n\")[1] || \"\").trim();\n                if (newNode.title === newNode.uri) {\n                    newNode.title = false;\n                }\n            }\n            if (_data[\"text/x-iri-source-title\"] && !newNode.title) {\n                newNode.title = _data[\"text/x-iri-source-title\"];\n            }\n            if (_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]) {\n                snippet = $('<div>').html(_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]);\n                newNode.image = snippet.find(\"[data-image]\").attr(\"data-image\") || newNode.image;\n                newNode.uri = snippet.find(\"[data-uri]\").attr(\"data-uri\") || newNode.uri;\n                newNode.title = snippet.find(\"[data-title]\").attr(\"data-title\") || newNode.title;\n                newNode.description = snippet.find(\"[data-description]\").attr(\"data-description\") || newNode.description;\n                newNode.clipPath = snippet.find(\"[data-clip-path]\").attr(\"data-clip-path\") || newNode.clipPath;\n            }\n\n            if (!newNode.title) {\n                newNode.title = this.renkan.translate(\"Dragged resource\");\n            }\n            var fields = [\"title\", \"description\", \"uri\", \"image\"];\n            for (var i = 0; i < fields.length; i++) {\n                var f = fields[i];\n                if (_data[\"text/x-iri-\" + f] || _data[f]) {\n                    newNode[f] = _data[\"text/x-iri-\" + f] || _data[f];\n                }\n                if (newNode[f] === \"none\" || newNode[f] === \"null\") {\n                    newNode[f] = undefined;\n                }\n            }\n\n            if(typeof this.renkan.options.drop_enhancer === \"function\"){\n                newNode = this.renkan.options.drop_enhancer(newNode, _data);\n            }\n\n            return newNode;\n\n        },\n        dropData: function(_data, _event) {\n            if (!this.isEditable()) {\n                return;\n            }\n            if (_data[\"text/json\"] || _data[\"application/json\"]) {\n                try {\n                    var jsondata = JSON.parse(_data[\"text/json\"] || _data[\"application/json\"]);\n                    _.extend(_data,jsondata);\n                }\n                catch(e) {}\n            }\n\n            var newNode = (typeof this.renkan.options.drop_handler === \"undefined\")?this.defaultDropHandler(_data):this.renkan.options.drop_handler(_data);\n\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]),\n                                      _coords = this.toModelCoords(_point),\n                                      _nodedata = {\n                id: Utils.getUID('node'),\n                created_by: this.renkan.current_user,\n                uri: newNode.uri || \"\",\n                title: newNode.title || \"\",\n                description: newNode.description || \"\",\n                image: newNode.image || \"\",\n                color: newNode.color || undefined,\n                clip_path: newNode.clipPath || undefined,\n                position: {\n                    x: _coords.x,\n                    y: _coords.y\n                }\n            };\n            var _node = this.renkan.project.addNode(_nodedata),\n            _repr = this.getRepresentationByModel(_node);\n            if (_event.type === \"drop\") {\n                _repr.openEditor();\n            }\n        },\n        fullScreen: function() {\n            var _isFull = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen,\n                _el = this.renkan.$[0],\n                _requestMethods = [\"requestFullScreen\",\"mozRequestFullScreen\",\"webkitRequestFullScreen\"],\n                _cancelMethods = [\"cancelFullScreen\",\"mozCancelFullScreen\",\"webkitCancelFullScreen\"],\n                i;\n            if (_isFull) {\n                for (i = 0; i < _cancelMethods.length; i++) {\n                    if (typeof document[_cancelMethods[i]] === \"function\") {\n                        document[_cancelMethods[i]]();\n                        break;\n                    }\n                }\n                var widthAft = this.$.width();\n                var heightAft = this.$.height();\n\n                if (this.renkan.options.show_top_bar) {\n                    heightAft -= this.$.find(\".Rk-TopBar\").height();\n                }\n                if (this.renkan.options.show_bins && (this.renkan.$.find(\".Rk-Bins\").position().left > 0)) {\n                    widthAft -= this.renkan.$.find(\".Rk-Bins\").width();\n                }\n\n                paper.view.viewSize = new paper.Size([widthAft, heightAft]);\n\n            } else {\n                for (i = 0; i < _requestMethods.length; i++) {\n                    if (typeof _el[_requestMethods[i]] === \"function\") {\n                        _el[_requestMethods[i]]();\n                        break;\n                    }\n                }\n                this.redraw();\n            }\n        },\n        zoomOut: function() {\n            var _newScale = this.scale * Math.SQRT1_2,\n            _offset = new paper.Point([\n                                       this.canvas_$.width(),\n                                       this.canvas_$.height()\n                                       ]).multiply( 0.5 * ( 1 - Math.SQRT1_2 ) ).add(this.offset.multiply( Math.SQRT1_2 ));\n            this.setScale( _newScale, _offset );\n        },\n        zoomIn: function() {\n            var _newScale = this.scale * Math.SQRT2,\n            _offset = new paper.Point([\n                                       this.canvas_$.width(),\n                                       this.canvas_$.height()\n                                       ]).multiply( 0.5 * ( 1 - Math.SQRT2 ) ).add(this.offset.multiply( Math.SQRT2 ));\n            this.setScale( _newScale, _offset );\n        },\n        resizeZoom: function(_scaleWidth, _scaleHeight, _ratio) {\n            var _newScale = this.scale * _ratio,\n                _offset = new paper.Point([\n                                       (this.offset.x * _scaleWidth),\n                                       (this.offset.y * _scaleHeight)\n                                       ]);\n            this.setScale( _newScale, _offset );\n        },\n        addNodeBtn: function() {\n            if (this.click_mode === Utils._CLICKMODE_ADDNODE) {\n                this.click_mode = false;\n                this.notif_$.hide();\n            } else {\n                this.click_mode = Utils._CLICKMODE_ADDNODE;\n                this.notif_$.text(this.renkan.translate(\"Click on the background canvas to add a node\")).fadeIn();\n            }\n            return false;\n        },\n        addEdgeBtn: function() {\n            if (this.click_mode === Utils._CLICKMODE_STARTEDGE || this.click_mode === Utils._CLICKMODE_ENDEDGE) {\n                this.click_mode = false;\n                this.notif_$.hide();\n            } else {\n                this.click_mode = Utils._CLICKMODE_STARTEDGE;\n                this.notif_$.text(this.renkan.translate(\"Click on a first node to start the edge\")).fadeIn();\n            }\n            return false;\n        },\n        exportProject: function() {\n          var projectJSON = this.renkan.project.toJSON(),\n              downloadLink = document.createElement(\"a\"),\n              projectId = projectJSON.id,\n              fileNameToSaveAs = projectId + \".json\";\n\n          // clean ids\n          delete projectJSON.id;\n          delete projectJSON._id;\n          delete projectJSON.space_id;\n\n          var objId,\n              idsMap = {},\n              hiddenNodes;\n\n          _.each(projectJSON.nodes, function(e,i,l) {\n            objId = e.id || e._id;\n            delete e._id;\n            delete e.id;\n            idsMap[objId] = e['@id'] = Utils.getUUID4();\n          });\n          _.each(projectJSON.edges, function(e,i,l) {\n            delete e._id;\n            delete e.id;\n            e.to = idsMap[e.to];\n            e.from = idsMap[e.from];\n          });\n          _.each(projectJSON.views, function(e,i,l) {\n            delete e._id;\n            delete e.id;\n\n            if(e.hidden_nodes) {\n                hiddenNodes = e.hidden_nodes;\n                e.hidden_nodes = [];\n                _.each(hiddenNodes, function(h,j) {\n                    e.hidden_nodes.push(idsMap[h]);\n                });\n            }\n          });\n          projectJSON.users = [];\n\n          var projectJSONStr = JSON.stringify(projectJSON, null, 2);\n          var blob = new Blob([projectJSONStr], {type: \"application/json;charset=utf-8\"});\n          filesaver(blob,fileNameToSaveAs);\n\n        },\n        parameters: function(_params){\n            if (typeof _params.idnode !== 'undefined'){\n                this.unhighlightAll();\n                this.highlightModel(this.renkan.project.get(\"nodes\").get(_params.idnode));                 \n            }\n        },\n        foldBins: function() {\n            var foldBinsButton = this.$.find(\".Rk-Fold-Bins\"),\n                bins = this.renkan.$.find(\".Rk-Bins\");\n            var _this = this,\n                sizeBef = _this.canvas_$.width(),\n                sizeAft;\n            if (bins.position().left < 0) {\n                bins.animate({left: 0},250);\n                this.$.animate({left: 300},250,function() {\n                    var w = _this.$.width();\n                    paper.view.viewSize = new paper.Size([w, _this.canvas_$.height()]);\n                });\n                if ((sizeBef -  bins.width()) < bins.height()){\n                    sizeAft = sizeBef;\n                } else {\n                    sizeAft = sizeBef - bins.width();\n                }\n                foldBinsButton.html(\"&laquo;\");\n            } else {\n                bins.animate({left: -300},250);\n                this.$.animate({left: 0},250,function() {\n                    var w = _this.$.width();\n                    paper.view.viewSize = new paper.Size([w, _this.canvas_$.height()]);\n                });\n                sizeAft = sizeBef+300;\n                foldBinsButton.html(\"&raquo;\");\n            }\n            _this.resizeZoom(1, 1, (sizeAft/sizeBef));\n        },\n        save: function() { },\n        open: function() { }\n    }).value();\n\n    /* Scene End */\n\n    return Scene;\n\n});\n\n\n//Load modules and use them\nif( typeof require.config === \"function\" ) {\n    require.config({\n        paths: {\n            'jquery':'../lib/jquery/jquery',\n            'underscore':'../lib/lodash/lodash',\n            'filesaver' :'../lib/FileSaver/FileSaver',\n            'requtils':'require-utils',\n            'ckeditor-core':'../lib/ckeditor/ckeditor',\n            'ckeditor-jquery':'../lib/ckeditor/adapters/jquery'\n        },\n        shim: {\n            'ckeditor-jquery':{\n                deps:['jquery','ckeditor-core']\n            }\n        },\n    });\n}\n\nrequire(['renderer/baserepresentation',\n         'renderer/basebutton',\n         'renderer/noderepr',\n         'renderer/edge',\n         'renderer/tempedge',\n         'renderer/baseeditor',\n         'renderer/nodeeditor',\n         'renderer/edgeeditor',\n         'renderer/nodebutton',\n         'renderer/nodeeditbutton',\n         'renderer/noderemovebutton',\n         'renderer/nodehidebutton',\n         'renderer/nodeshowbutton',\n         'renderer/noderevertbutton',\n         'renderer/nodelinkbutton',\n         'renderer/nodeenlargebutton',\n         'renderer/nodeshrinkbutton',\n         'renderer/edgeeditbutton',\n         'renderer/edgeremovebutton',\n         'renderer/edgerevertbutton',\n         'renderer/miniframe',\n         'renderer/scene'\n         ], function(BaseRepresentation, BaseButton, NodeRepr, Edge, TempEdge, BaseEditor, NodeEditor, EdgeEditor, NodeButton, NodeEditButton, NodeRemoveButton, NodeHideButton, NodeShowButton, NodeRevertButton, NodeLinkButton, NodeEnlargeButton, NodeShrinkButton, EdgeEditButton, EdgeRemoveButton, EdgeRevertButton, MiniFrame, Scene){\n\n    'use strict';\n\n    var Rkns = window.Rkns;\n\n    if(typeof Rkns.Renderer === \"undefined\"){\n        Rkns.Renderer = {};\n    }\n    var Renderer = Rkns.Renderer;\n\n    Renderer._BaseRepresentation = BaseRepresentation;\n    Renderer._BaseButton = BaseButton;\n    Renderer.Node = NodeRepr;\n    Renderer.Edge = Edge;\n    Renderer.TempEdge = TempEdge;\n    Renderer._BaseEditor = BaseEditor;\n    Renderer.NodeEditor = NodeEditor;\n    Renderer.EdgeEditor = EdgeEditor;\n    Renderer._NodeButton = NodeButton;\n    Renderer.NodeEditButton = NodeEditButton;\n    Renderer.NodeRemoveButton = NodeRemoveButton;\n    Renderer.NodeHideButton = NodeHideButton;\n    Renderer.NodeShowButton = NodeShowButton;\n    Renderer.NodeRevertButton = NodeRevertButton;\n    Renderer.NodeLinkButton = NodeLinkButton;\n    Renderer.NodeEnlargeButton = NodeEnlargeButton;\n    Renderer.NodeShrinkButton = NodeShrinkButton;\n    Renderer.EdgeEditButton = EdgeEditButton;\n    Renderer.EdgeRemoveButton = EdgeRemoveButton;\n    Renderer.EdgeRevertButton = EdgeRevertButton;\n    Renderer.MiniFrame = MiniFrame;\n    Renderer.Scene = Scene;\n\n    startRenkan();\n});\n\ndefine(\"main-renderer\", function(){});\n\n"]}
\ No newline at end of file
+{"version":3,"file":"renkan.min.js","sources":["templates.js","../../js/main.js","../../js/router.js","../../js/dataloader.js","../../js/models.js","../../js/defaults.js","../../js/i18n.js","../../js/full-json.js","../../js/save-once.js","../../js/ldtjson-bin.js","../../js/list-bin.js","../../js/wikipedia-bin.js","paper-renderer.js"],"names":["this","obj","__t","__p","_","escape","__e","Array","prototype","join","renkan","translate","edge","title","options","show_edge_editor_uri","uri","properties","length","each","ontology","label","property","show_edge_editor_style","show_edge_editor_style_color","show_edge_editor_style_dash","dash","show_edge_editor_style_thickness","thickness","show_edge_editor_style_arrow","arrow","show_edge_editor_direction","show_edge_editor_nodes","from_color","shortenText","from_title","to_title","show_edge_editor_creator","has_creator","created_by_title","show_edge_tooltip_color","color","show_edge_tooltip_uri","short_uri","show_edge_tooltip_nodes","to_color","show_edge_tooltip_creator","created_by_color","Rkns","Utils","getFullURL","image","description","static_url","url","show_bins","show_editor","show_node_editor_title_richtext","node","show_node_editor_uri","change_types","types","type","charAt","toUpperCase","substring","show_node_editor_description","show_node_editor_description_richtext","show_node_editor_size","size","show_node_editor_style","show_node_editor_style_color","show_node_editor_style_dash","show_node_editor_style_thickness","show_node_editor_image","image_placeholder","clip_path","allow_image_upload","show_node_editor_creator","change_shapes","shapes","shape","show_node_tooltip_color","show_node_tooltip_uri","show_node_tooltip_description","show_node_tooltip_image","show_node_tooltip_creator","_id","print","__j","call","arguments","show_top_bar","editor_mode","project","get","show_user_list","show_user_color","user_color_editable","colorPicker","home_button_url","home_button_title","show_fullscreen_button","show_addnode_button","show_addedge_button","show_export_button","show_save_button","show_open_button","show_bookmarklet","show_search_field","resize","show_zoom","save_view","hide_nodes","root","$","jQuery","pickerColors","__renkans","_BaseBin","_renkan","_opts","find","hide","addClass","appendTo","title_icon_$","_this","attr","href","html","click","destroy","slideDown","resizeBins","refresh","count_$","title_$","main_$","auto_refresh","window","setInterval","detach","Renkan","push","defaults","templates","renkanJST","node_editor_templates","template","types_templates","value","key","property_files","f","getJSON","data","concat","read_only","router","Router","Models","Project","dataloader","DataLoader","Loader","setCurrentUser","user_id","user_name","addUser","current_user","renderer","redrawUsers","container","tabs","search_engines","current_user_list","UsersList","on","_tmpl","map","c","Renderer","Scene","search","_select","_input","_form","_search","Search","_key","getSearchTitle","className","getBgClass","_el","setSearchEngine","submit","val","search_engine","mouseenter","mouseleave","bins","_bin","Bin","elementDropped","_mainDiv","siblings","is","slideUp","_t","_models","where","_model","highlightModel","mouseout","unhighlightAll","dragDrop","err","e","preventDefault","touch","originalEvent","changedTouches","off","canvas_$","offset","w","width","h","height","pageX","left","pageY","top","onMouseMove","div","document","createElement","appendChild","cloneNode","dropData","text/html","innerHTML","onMouseDown","onMouseUp","dataTransfer","setData","lastsearch","lastval","regexpFromTextOrArray","source","tab","render","_text","i18n","language","substr","onStatusChange","listClasses","split","classes","i","_d","outerHeight","css","getUUID4","replace","r","Math","random","v","toString","getUID","pad","n","Date","ID_AUTO_INCREMENT","ID_BASE","getUTCFullYear","getUTCMonth","getUTCDate","_base","_n","_uidbase","test","img","Image","src","res","inherit","_baseClass","_callbefore","_class","apply","slice","_init","_initialized","extend","replaceText","makeReplaceFunc","l","k","charsrx","txt","toLowerCase","remrx","j","remsrc","charsub","getSource","inp","removeChars","String","fromCharCode","RegExp","_textOrArray","testrx","replacerx","isempty","_replace","text","_MIN_DRAG_DISTANCE","_NODE_BUTTON_WIDTH","_EDGE_BUTTON_INNER","_EDGE_BUTTON_OUTER","_CLICKMODE_ADDNODE","_CLICKMODE_STARTEDGE","_CLICKMODE_ENDEDGE","_NODE_SIZE_STEP","LN2","_MIN_SCALE","_MAX_SCALE","_MOUSEMOVE_RATE","_DOUBLETAP_DELAY","_DOUBLETAP_DISTANCE","_USER_PLACEHOLDER","default_user_color","_BOOKMARKLET_CODE","_maxlength","drawEditBox","_options","_coords","_path","_xmargin","_selector","tooltip_width","tooltip_padding","_height","_isLeft","x","paper","view","center","_left","tooltip_arrow_length","_right","_top","y","tooltip_margin","max","tooltip_arrow_width","min","_bottom","segments","point","add","fillColor","Color","Gradient","tooltip_top_color","tooltip_bottom_color","increaseBrightness","hex","percent","parseInt","g","b","Backbone","routes","index","parameters","result","forEach","part","item","decodeURIComponent","trigger","converters","from1to2","len","nodes","style","edges","schema_version","dataConverters","convert","schemaVersionFrom","getSchemaVersion","schemaVersionTo","converterName","load","set","validate","guid","RenkanModel","RelationalModel","idAttribute","constructor","id","prepare","addReference","_propName","_list","_default","_element","User","toJSON","Node","relations","HasOne","relatedModel","created_by","position","Edge","from","to","View","isArray","zoom_level","hidden_nodes","RosterUser","blacklist","HasMany","reverseRelation","includeInJSON","_props","_user","findOrCreate","addNode","_node","addEdge","_edge","addView","_view","removeNode","remove","removeEdge","_project","users","views","_item","t","version","initialize","filter","json","clone","attributes","Model","Collection","omit","site_id","model","navigator","userLanguage","popup_editor","editor_panel","manual_save","size_bug_fix","force_resize","allow_double_click","zoom_on_scroll","element_delete_delay","autoscale_padding","default_view","update_url","user_name_editable","show_minimap","minimap_width","minimap_height","minimap_padding","minimap_background_color","minimap_border_color","minimap_highlight_color","minimap_highlight_weight","buttons_background","buttons_label_color","buttons_label_font_size","ghost_opacity","default_dash_array","show_node_circles","clip_node_images","node_images_fill_mode","node_size_base","node_stroke_width","node_stroke_max_width","selected_node_stroke_width","selected_node_stroke_max_width","node_stroke_witdh_scale","node_fill_color","highlighted_node_fill_color","node_label_distance","node_label_max_length","label_untitled_nodes","default","video","edge_stroke_width","edge_stroke_max_width","selected_edge_stroke_width","selected_edge_stroke_max_width","edge_stroke_witdh_scale","edge_label_distance","edge_label_max_length","edge_arrow_length","edge_arrow_width","edge_arrow_max_width","edge_gap_in_bundles","label_untitled_edges","tooltip_border_color","tooltip_border_width","tooltip_opacity","richtext_editor_config","toolbarGroups","name","groups","removePlugins","show_node_editor_title","uploaded_image_max_kb","fr","Edit Node","Edit Edge","Title:","URI:","Description:","From:","To:","Image URL:","Choose Image File:","Full Screen","Add Node","Add Edge","Save Project","Open Project","Auto-save enabled","Connection lost","Created by:","Zoom In","Zoom Out","Edit","Remove","Cancel deletion","Link to another node","Enlarge","Shrink","Click on the background canvas to add a node","Click on a first node to start the edge","Click on a second node to complete the edge","Wikipedia","Wikipedia in ","French","English","Japanese","Untitled project","Lignes de Temps","Loading, please wait","Edge color:","Dash:","Thickness:","Arrow:","Node color:","Choose color","Change edge direction","Do you really wish to remove node ","Do you really wish to remove edge ","This file is not an image","Image size must be under ","Size:","KB","Choose from vocabulary:","SKOS Documentation properties","has note","has example","has definition","SKOS Semantic relations","has broader","has narrower","has related","Dublin Core Metadata","has contributor","covers","created by","has date","published by","has source","has subject","Dragged resource","Search the Web","Search in Bins","Close bin","Refresh bin","(untitled)","Select contents:","Drag items from this website, drop them in 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.","Shapes available","Circle","Square","Diamond","Hexagone","Ellipse","Star","Cloud","Triangle","Zoom Fit","Download Project","Save view","View saved view","Renkan 'Drag-to-Add' bookmarklet","(unknown user)","<unknown user>","Search in graph","Search in ","jsonIO","_proj","http_method","_load","redrawActive","loadingStatus","_data","saveStatus","_save","ajax","contentType","JSON","stringify","success","_thrSave","throttle","setTimeout","changedAttributes","hasChanged","jsonIOSaveOnClick","_saveWarn","_onLeave","getdata","rx","matches","location","hash","match","beforeSend","_checkLeave","removeClass","save","hasClass","Ldt","ProjectBin","ldt_type","Resclass","console","error","tagTemplate","annotationTemplate","proj_id","project_id","ldt_platform","searchbase","highlight","_e","convertTC","_ms","_res","_totalSeconds","abs","floor","_hours","_minutes","_seconds","_html","_projtitle","meta","count","tags","_tag","_title","htitle","encodedtitle","encodeURIComponent","annotations","_annotation","_description","content","_duration","end","begin","_img","hdescription","start","duration","mediaid","media","annotationid","show","dataType","lang","_q","ResultsBin","segmentTemplate","max_results","highlightrx","objects","_segment","_begin","start_ts","_end","iri_id","element_id","format","q","limit","ResourceList","resultTemplate","list","trim","_match","langs","en","ja","query","_result","encodeURI","snippet","define","_BaseRepresentation","_renderer","_changeBinding","redraw","change","_removeBinding","removeRepresentation","defer","_selectBinding","select","_unselectBinding","unselect","_super","_func","moveTo","unhighlight","mousedown","mouseup","getUtils","getRenderer","requtils","BaseRepresentation","_BaseButton","_pos","sector","_newTarget","source_representation","cloud_path","builders","circle","getShape","Path","getImageShape","radius","rectangle","Rectangle","ellipse","polygon","RegularPolygon","diamond","d","SQRT2","rotate","star","cloud","path","scale","triangle","svg","ShapeBuilder","NodeRepr","node_layer","activate","buildShape","hidden","ghost","strokeWidth","h_ratio","labels_$","normal_buttons","NodeEditButton","NodeRemoveButton","NodeLinkButton","NodeEnlargeButton","NodeShrinkButton","NodeHideButton","NodeShowButton","pending_delete_buttons","NodeRevertButton","all_buttons","active_buttons","last_circle_radius","minimap","minimap_circle","__representation","miniframe","node_group","addChild","_getStrokeWidth","has","_getSelectedStrokeWidth","changed","shapeBuilder","sendToBack","_model_coords","Point","_baseRadius","exp","is_dragging","paper_coords","toPaperCoords","circle_radius","setSectorSize","node_image","subtract","image_delta","multiply","old_act_btn","opacity","dashArray","selected","isEditable","highlighted","_strokeWidth","_color","_dash","strokeColor","_pc","lastImage","showImage","minipos","toMinimapCoords","miniradius","minisize","Size","fitBounds","dontRedrawEdges","ed","repr","getRepresentationByModel","from_representation","to_representation","_image","image_cache","clipPath","hasClipPath","_clip","baseRadius","centerPoint","instructions","lastCoords","minX","Infinity","minY","maxX","maxY","transformCoords","tabc","relative","newCoords","parseFloat","isY","instr","coords","lineTo","cubicCurveTo","quadraticCurveTo","_raster","Raster","locked","Group","clipped","_circleClip","divide","insertAbove","paperShift","_delta","openEditor","removeRepresentationsOfType","_editor","addRepresentation","draw","_uri","showNeighbors","hideButtons","buttons_timeout","undefined","hideNeighbors","indexNode","hiddenNodes","indexOf","splice","textToReplace","hlvalue","throttledPaperDraw","saveCoords","toModelCoords","_event","_isTouch","unselectAll","click_target","edge_layer","bundle","addToBundles","line","arrow_scale","pivot","arrow_angle","EdgeEditButton","EdgeRemoveButton","EdgeRevertButton","minimap_line","_getArrowScale","_opacity","_arrow_scale","_p0a","_p1a","_v","_r","_u","_ortho","_group_pos","getPosition","_p0b","_p1b","_a","angle","_textdelta","_handle","visible","handleIn","handleOut","bounds","_textpos","transform","-moz-transform","-webkit-transform","text_angle","reject","TempEdge","_p0","_p1","end_pos","_c","_hitResult","hitTest","findTarget","_endDrag","_target","_destmodel","_BaseEditor","buttons_layer","editor_block","_pts","range","editor_$","BaseEditor","NodeEditor","readOnlyTemplate","_created_by","_template","_image_placeholder","_size","keys","editorInstance","ckeditor","editorInstanceTitle","closeEditor","cleanEditor","editor","focusManager","blur","_editor_title","onFieldChange","checkDirty","getData","resetDirty","assign","keyCode","files","FileReader","alert","onload","target","readAsDataURL","focus","_picker","hover","shiftSize","_newsize","shiftThickness","_oldThickness","_newThickness","titlehtml","EdgeEditor","_from_model","_to_model","BaseButton","_NodeButton","sectorInner","lastSectorInner","drawSector","startAngle","endAngle","imageName","clearTimeout","NodeButton","delid","delete_list","time","valueOf","confirm","addHiddenNode","unset","_off","_point","addTempEdge","MiniFrame","filesaver","representations","notif_$","setup","totalScroll","mouse_down","selected_target","Layer","background_layer","topleft","bottomRight","cliprectangle","bundles","click_mode","_allowScroll","_originalScale","_zooming","_lastTapX","_lastTapY","icon_cache","imgname","throttledMouseMove","mousemove","mousewheel","onScroll","touchstart","_touches","touches","_lastTap","pow","onDoubleClick","touchmove","_newScale","_scaleRatio","_newOffset","setScale","touchend","dblclick","dragover","dragenter","dragleave","drop","parse","bindClick","selector","fname","evt","fadeIn","delay","fadeOut","mouseover","onResize","_ratio","newWidth","newHeight","ratioH","delta","ratioW","resizeZoom","_thRedraw","addRepresentations","_thRedrawUsers","history","el","_params","_delay","fixSize","autoScale","$cpwrapper","$cplist","$this","rxs","_now","findWhere","delete_scheduled","rescaleMinimap","last","_repr","_inR","_outR","_startAngle","_endAngle","_padding","_imgname","_caption","_startRads","PI","_endRads","_startdx","sin","_startdy","cos","_startXIn","_startYIn","_startXOut","_startYOut","_enddx","_enddy","_endXIn","_endYIn","_endXOut","_endYOut","_centerR","_centerRads","_centerX","_centerY","_centerXIn","_centerXOut","_centerYIn","_centerYOut","_textX","_textY","arcTo","closed","PointText","characterStyle","fontSize","paragraphStyle","justification","_visible","_restPos","_grp","_imgdelta","_currentPos","_edgeRepr","_bundle","_er","_dir","savebtn","tip","redrawMiniframe","bottomright","_xx","_yy","_minx","_miny","_maxx","_maxy","_scale","at","_type","RendererType","_collection","userTemplate","allUsers","models","ulistHtml","$userpanel","$name","$cpitems","$colorsquare","$input","empty","parent","background","_representation","_representations","_from","_tmpEdge","last_point","updateUrl","_scrolldelta","SQRT1_2","open","defaultDropHandler","newNode","tweetdiv","_svgimgs","_svgpaths","_imgs","_as","fields","drop_enhancer","jsondata","drop_handler","_nodedata","fullScreen","_isFull","mozFullScreen","webkitIsFullScreen","_requestMethods","_cancelMethods","widthAft","heightAft","viewSize","addNodeBtn","addEdgeBtn","exportProject","projectJSON","projectId","fileNameToSaveAs","space_id","objId","idsMap","projectJSONStr","blob","Blob","isEmptyObject","first","idView","viewParams","params","init","idNode","foldBins","sizeAft","foldBinsButton","sizeBef","animate","ViewRepr","initialScale","showNodes","hideNodes","hideNode","_offset","zoomOut","zoomIn","_scaleWidth","_scaleHeight","force_view","getFragment","round","navigate","param","require","config","paths","jquery","underscore","ckeditor-core","ckeditor-jquery","shim","deps","startRenkan"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,KAAgB,UAAIA,KAAgB,cAEpCA,KAAgB,UAAE,8BAAgC,SAASC,KAC3DA,MAAQA,OACR,EAAA,GAAIC,KAAKC,IAAM,EAAUC,GAAEC,OAC3B,KAAMJ,IACNE,KAAO,oBACS,OAAdD,IAAM,GAAe,GAAKA,KAC5B,yBAC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A,sBACA,sBACA,sBACA,sBACA,0BACA,4BACA,0BACA,0BACA,4BACA,0BACA,6BACA,4BACA,0BACA,4BACA,4BACA,qBACA,iBACA,qBACG,SAASrf,EAAoBgQ,EAAYnO,EAAUxW,EAAMihB,EAAUiB,EAAYC,EAAYqC,EAAYY,EAAYlO,EAAgBC,EAAkBI,EAAgBC,EAAgBE,EAAkBN,EAAgBC,EAAmBC,EAAkB4H,EAAgBC,EAAkBC,EAAkB2G,EAAW/0B,EAAOiiC,GAI1U,GAAIxqC,GAAO4F,OAAO5F,IAEU,oBAAlBA,GAAKsI,WACXtI,EAAKsI,YAET,IAAIA,GAAWtI,EAAKsI,QAEpBA,GAASuiB,oBAAsBqB,EAC/B5jB,EAAS6jB,YAAc+P,EACvB5zB,EAAS2O,KAAO8W,EAChBzlB,EAASiP,KAAOA,EAChBjP,EAASoP,KAAO8yB,EAChBliC,EAASkwB,SAAWA,EACpBlwB,EAAS6wB,YAAcM,EACvBnxB,EAASoxB,WAAaA,EACtBpxB,EAASyzB,WAAaA,EACtBzzB,EAAS6zB,YAAcQ,EACvBr0B,EAASmmB,eAAiBA,EAC1BnmB,EAASomB,iBAAmBA,EAC5BpmB,EAASwmB,eAAiBA,EAC1BxmB,EAASymB,eAAiBA,EAC1BzmB,EAAS2mB,iBAAmBA,EAC5B3mB,EAASqmB,eAAiBA,EAC1BrmB,EAASsmB,kBAAoBA,EAC7BtmB,EAASumB,iBAAmBA,EAC5BvmB,EAASmuB,eAAiBA,EAC1BnuB,EAASouB,iBAAmBA,EAC5BpuB,EAASquB,iBAAmBA,EAC5BruB,EAASg1B,UAAYA,EACrBh1B,EAASC,MAAQA,EAEjByjC,gBAGJphB,OAAO,gBAAiB","sourcesContent":["this[\"renkanJST\"] = this[\"renkanJST\"] || {};\n\nthis[\"renkanJST\"][\"templates/colorpicker.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li data-color=\"' +\n((__t = (c)) == null ? '' : __t) +\n'\" style=\"background: ' +\n((__t = (c)) == null ? '' : __t) +\n'\"></li>';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/edgeeditor.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>' +\n__e(renkan.translate(\"Edit Edge\")) +\n'</span>\\n</h2>\\n<p>\\n    <label>' +\n__e(renkan.translate(\"Title:\")) +\n'</label>\\n    <input class=\"Rk-Edit-Title\" type=\"text\" value=\"' +\n__e(edge.title) +\n'\" />\\n</p>\\n';\n if (options.show_edge_editor_uri) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"URI:\")) +\n'</label>\\n        <input class=\"Rk-Edit-URI\" type=\"text\" value=\"' +\n__e(edge.uri) +\n'\" />\\n        <a class=\"Rk-Edit-Goto\" href=\"' +\n__e(edge.uri) +\n'\" target=\"_blank\"></a>\\n    </p>\\n    ';\n if (options.properties.length) { ;\n__p += '\\n        <p>\\n            <label>' +\n__e(renkan.translate(\"Choose from vocabulary:\")) +\n'</label>\\n            <select class=\"Rk-Edit-Vocabulary\">\\n                ';\n _.each(options.properties, function(ontology) { ;\n__p += '\\n                    <option class=\"Rk-Edit-Vocabulary-Class\" value=\"\">\\n                        ' +\n__e( renkan.translate(ontology.label) ) +\n'\\n                    </option>\\n                    ';\n _.each(ontology.properties, function(property) { var uri = ontology[\"base-uri\"] + property.uri; ;\n__p += '\\n                        <option class=\"Rk-Edit-Vocabulary-Property\" value=\"' +\n__e( uri ) +\n'\"\\n                            ';\n if (uri === edge.uri) { ;\n__p += ' selected';\n } ;\n__p += '>\\n                            ' +\n__e( renkan.translate(property.label) ) +\n'\\n                        </option>\\n                    ';\n }) ;\n__p += '\\n                ';\n }) ;\n__p += '\\n            </select>\\n        </p>\\n';\n } } ;\n__p += '\\n';\n if (options.show_edge_editor_style) { ;\n__p += '\\n    <div class=\"Rk-Editor-p\">\\n      ';\n if (options.show_edge_editor_style_color) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-color\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Edge color:\")) +\n'</span>\\n        <div class=\"Rk-Edit-ColorPicker-Wrapper\">\\n            <span class=\"Rk-Edit-Color\" style=\"background: &lt;%-edge.color%>;\">\\n                <span class=\"Rk-Edit-ColorTip\"></span>\\n            </span>\\n            ' +\n((__t = ( renkan.colorPicker )) == null ? '' : __t) +\n'\\n            <span class=\"Rk-Edit-ColorPicker-Text\">' +\n__e( renkan.translate(\"Choose color\") ) +\n'</span>\\n        </div>\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_edge_editor_style_dash) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-dash\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Dash:\")) +\n'</span>\\n        <input type=\"checkbox\" name=\"Rk-Edit-Dash\" class=\"Rk-Edit-Dash\" ' +\n__e( edge.dash ) +\n' />\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_edge_editor_style_thickness) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-thickness\">\\n          <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Thickness:\")) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Down\">-</a>\\n          <span class=\"Rk-Edit-Size-Disp\" id=\"Rk-Edit-Thickness-Value\">' +\n__e( edge.thickness ) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Up\">+</a>\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_edge_editor_style_arrow) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-arrow\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Arrow:\")) +\n'</span>\\n        <input type=\"checkbox\" name=\"Rk-Edit-Arrow\" class=\"Rk-Edit-Arrow\" ' +\n__e( edge.arrow ) +\n' />\\n      </div>\\n      ';\n } ;\n__p += '\\n    </div>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_editor_direction) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Edit-Direction\">' +\n__e( renkan.translate(\"Change edge direction\") ) +\n'</span>\\n    </p>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_editor_nodes) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"From:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(edge.from_color) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.from_title, 25) ) +\n'\\n    </p>\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"To:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: >%-edge.to_color%>;\"></span>\\n        ' +\n__e( shortenText(edge.to_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_editor_creator && edge.has_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: &lt;%-edge.created_by_color%>;\"></span>\\n        ' +\n__e( shortenText(edge.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/edgeeditor_readonly.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>\\n    ';\n if (options.show_edge_tooltip_color) { ;\n__p += '\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.color ) +\n';\"></span>\\n    ';\n } ;\n__p += '\\n    <span class=\"Rk-Display-Title\">\\n        ';\n if (edge.uri) { ;\n__p += '\\n            <a href=\"' +\n__e(edge.uri) +\n'\" target=\"_blank\">\\n        ';\n } ;\n__p += '\\n        ' +\n__e(edge.title) +\n'\\n        ';\n if (edge.uri) { ;\n__p += ' </a> ';\n } ;\n__p += '\\n    </span>\\n</h2>\\n';\n if (options.show_edge_tooltip_uri && edge.uri) { ;\n__p += '\\n    <p class=\"Rk-Display-URI\">\\n        <a href=\"' +\n__e(edge.uri) +\n'\" target=\"_blank\">' +\n__e( edge.short_uri ) +\n'</a>\\n    </p>\\n';\n } ;\n__p += '\\n<p>' +\n((__t = (edge.description)) == null ? '' : __t) +\n'</p>\\n';\n if (options.show_edge_tooltip_nodes) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"From:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.from_color ) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.from_title, 25) ) +\n'\\n    </p>\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"To:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.to_color ) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.to_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n if (options.show_edge_tooltip_creator && edge.has_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e( edge.created_by_color ) +\n';\"></span>\\n        ' +\n__e( shortenText(edge.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/ldtjson-bin/annotationtemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item\" draggable=\"true\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL(image) ) +\n'\"\\n    data-uri=\"' +\n((__t = (ldt_platform)) == null ? '' : __t) +\n'ldtplatform/ldt/front/player/' +\n((__t = (mediaid)) == null ? '' : __t) +\n'/#id=' +\n((__t = (annotationid)) == null ? '' : __t) +\n'\"\\n    data-title=\"' +\n__e(title) +\n'\" data-description=\"' +\n__e(description) +\n'\">\\n\\n    <img class=\"Rk-Ldt-Annotation-Icon\" src=\"' +\n((__t = (image)) == null ? '' : __t) +\n'\" />\\n    <h4>' +\n((__t = (htitle)) == null ? '' : __t) +\n'</h4>\\n    <p>' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n    <p>Start: ' +\n((__t = (start)) == null ? '' : __t) +\n', End: ' +\n((__t = (end)) == null ? '' : __t) +\n', Duration: ' +\n((__t = (duration)) == null ? '' : __t) +\n'</p>\\n    <div class=\"Rk-Clear\"></div>\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/ldtjson-bin/segmenttemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item\" draggable=\"true\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL(image) ) +\n'\"\\n    data-uri=\"' +\n((__t = (ldt_platform)) == null ? '' : __t) +\n'ldtplatform/ldt/front/player/' +\n((__t = (mediaid)) == null ? '' : __t) +\n'/#id=' +\n((__t = (annotationid)) == null ? '' : __t) +\n'\"\\n    data-title=\"' +\n__e(title) +\n'\" data-description=\"' +\n__e(description) +\n'\">\\n\\n    <img class=\"Rk-Ldt-Annotation-Icon\" src=\"' +\n((__t = (image)) == null ? '' : __t) +\n'\" />\\n    <h4>' +\n((__t = (htitle)) == null ? '' : __t) +\n'</h4>\\n    <p>' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n    <p>Start: ' +\n((__t = (start)) == null ? '' : __t) +\n', End: ' +\n((__t = (end)) == null ? '' : __t) +\n', Duration: ' +\n((__t = (duration)) == null ? '' : __t) +\n'</p>\\n    <div class=\"Rk-Clear\"></div>\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/ldtjson-bin/tagtemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item\" draggable=\"true\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL(static_url+'img/ldt-tag.png') ) +\n'\"\\n    data-uri=\"' +\n((__t = (ldt_platform)) == null ? '' : __t) +\n'ldtplatform/ldt/front/search/?search=' +\n((__t = (encodedtitle)) == null ? '' : __t) +\n'&field=all\"\\n    data-title=\"' +\n__e(title) +\n'\" data-description=\"Tag \\'' +\n__e(title) +\n'\\'\">\\n\\n    <img class=\"Rk-Ldt-Tag-Icon\" src=\"' +\n__e(static_url) +\n'img/ldt-tag.png\" />\\n    <h4>' +\n((__t = (htitle)) == null ? '' : __t) +\n'</h4>\\n    <div class=\"Rk-Clear\"></div>\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/list-bin.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<li class=\"Rk-Bin-Item Rk-ResourceList-Item\" draggable=\"true\"\\n    data-uri=\"' +\n__e(url) +\n'\" data-title=\"' +\n__e(title) +\n'\"\\n    data-description=\"' +\n__e(description) +\n'\"\\n    ';\n if (image) { ;\n__p += '\\n        data-image=\"' +\n__e( Rkns.Utils.getFullURL(image) ) +\n'\"\\n    ';\n } else { ;\n__p += '\\n        data-image=\"\"\\n    ';\n } ;\n__p += '\\n>';\n if (image) { ;\n__p += '\\n    <img class=\"Rk-ResourceList-Image\" src=\"' +\n__e(image) +\n'\" />\\n';\n } ;\n__p += '\\n<h4 class=\"Rk-ResourceList-Title\">\\n    ';\n if (url) { ;\n__p += '\\n        <a href=\"' +\n__e(url) +\n'\" target=\"_blank\">\\n    ';\n } ;\n__p += '\\n    ' +\n((__t = (htitle)) == null ? '' : __t) +\n'\\n    ';\n if (url) { ;\n__p += '</a>';\n } ;\n__p += '\\n    </h4>\\n    ';\n if (description) { ;\n__p += '\\n        <p class=\"Rk-ResourceList-Description\">' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n    ';\n } ;\n__p += '\\n    ';\n if (image) { ;\n__p += '\\n        <div style=\"clear: both;\"></div>\\n    ';\n } ;\n__p += '\\n</li>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/main.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n\n if (options.show_bins) { ;\n__p += '\\n    <div class=\"Rk-Bins\">\\n        <div class=\"Rk-Bins-Head\">\\n            <h2 class=\"Rk-Bins-Title\">' +\n__e( translate(\"Select contents:\")) +\n'</h2>\\n            <form class=\"Rk-Web-Search-Form Rk-Search-Form\">\\n                <input class=\"Rk-Web-Search-Input Rk-Search-Input\" type=\"search\"\\n                    placeholder=\"' +\n__e( translate('Search the Web') ) +\n'\" />\\n                <div class=\"Rk-Search-Select\">\\n                    <div class=\"Rk-Search-Current\"></div>\\n                    <ul class=\"Rk-Search-List\"></ul>\\n                </div>\\n                <input type=\"submit\" value=\"\"\\n                    class=\"Rk-Web-Search-Submit Rk-Search-Submit\" title=\"' +\n__e( translate('Search the Web') ) +\n'\" />\\n            </form>\\n            <form class=\"Rk-Bins-Search-Form Rk-Search-Form\">\\n                <input class=\"Rk-Bins-Search-Input Rk-Search-Input\" type=\"search\"\\n                    placeholder=\"' +\n__e( translate('Search in Bins') ) +\n'\" /> <input\\n                    type=\"submit\" value=\"\"\\n                    class=\"Rk-Bins-Search-Submit Rk-Search-Submit\"\\n                    title=\"' +\n__e( translate('Search in Bins') ) +\n'\" />\\n            </form>\\n        </div>\\n        <ul class=\"Rk-Bin-List\"></ul>\\n    </div>\\n';\n } ;\n__p += ' ';\n if (options.show_editor) { ;\n__p += '\\n    <div class=\"Rk-Render Rk-Render-';\n if (options.show_bins) { ;\n__p += 'Panel';\n } else { ;\n__p += 'Full';\n } ;\n__p += '\"></div>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/nodeeditor.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n\n //TODO: change class to id ;\n__p += '\\n<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>' +\n__e(renkan.translate(\"Edit Node\")) +\n'</span>\\n</h2>\\n<p>\\n    <label>' +\n__e(renkan.translate(\"Title:\")) +\n'</label>\\n    ';\n if (options.show_node_editor_title_richtext) { ;\n__p += '\\n        <div class=\"Rk-Edit-Title\" contenteditable=\"true\">' +\n((__t = (node.title)) == null ? '' : __t) +\n'</div>\\n    ';\n } else { ;\n__p += '\\n        <input class=\"Rk-Edit-Title\" type=\"text\" value=\"' +\n__e(node.title) +\n'\" />\\n    ';\n } ;\n__p += '    \\n</p>\\n';\n if (options.show_node_editor_uri) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"URI:\")) +\n'</label>\\n        <input class=\"Rk-Edit-URI\" type=\"text\" value=\"' +\n__e(node.uri) +\n'\" />\\n        <a class=\"Rk-Edit-Goto\" href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\"></a>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.change_types) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Types available\")) +\n':</label>\\n        <select class=\"Rk-Edit-Type\">\\n          ';\n _.each(types, function(type) { ;\n__p += '\\n            <option class=\"Rk-Edit-Vocabulary-Property\" value=\"' +\n__e( type ) +\n'\"';\n if (node.type === type) { ;\n__p += ' selected';\n } ;\n__p += '>\\n                ' +\n__e( renkan.translate(type.charAt(0).toUpperCase() + type.substring(1)) ) +\n'\\n            </option>\\n          ';\n }); ;\n__p += '\\n        </select>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_description) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Description:\")) +\n'</label>\\n        ';\n if (options.show_node_editor_description_richtext) { ;\n__p += '\\n            <div class=\"Rk-Edit-Description\" contenteditable=\"true\">' +\n((__t = (node.description)) == null ? '' : __t) +\n'</div>\\n        ';\n } else { ;\n__p += '\\n            <textarea class=\"Rk-Edit-Description\">' +\n((__t = (node.description)) == null ? '' : __t) +\n'</textarea>\\n        ';\n } ;\n__p += '\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_size) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Size:\")) +\n'</span>\\n        <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Size-Down\">-</a>\\n        <span class=\"Rk-Edit-Size-Disp\" id=\"Rk-Edit-Size-Value\">' +\n__e(node.size) +\n'</span>\\n        <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Size-Up\">+</a>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_style) { ;\n__p += '\\n    <div class=\"Rk-Editor-p\">\\n      ';\n if (options.show_node_editor_style_color) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-color\">\\n        <span class=\"Rk-Editor-Label\">\\n        ' +\n__e(renkan.translate(\"Node color:\")) +\n'</span>\\n        <div class=\"Rk-Edit-ColorPicker-Wrapper\">\\n            <span class=\"Rk-Edit-Color\" style=\"background: ' +\n__e(node.color) +\n';\">\\n                <span class=\"Rk-Edit-ColorTip\"></span>\\n            </span>\\n            ' +\n((__t = ( renkan.colorPicker )) == null ? '' : __t) +\n'\\n            <span class=\"Rk-Edit-ColorPicker-Text\">' +\n__e( renkan.translate(\"Choose color\") ) +\n'</span>\\n        </div>\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_node_editor_style_dash) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-dash\">\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Dash:\")) +\n'</span>\\n        <input type=\"checkbox\" name=\"Rk-Edit-Dash\" class=\"Rk-Edit-Dash\" ' +\n__e( node.dash ) +\n' />\\n      </div>\\n      ';\n } ;\n__p += '\\n      ';\n if (options.show_node_editor_style_thickness) { ;\n__p += '\\n      <div id=\"Rk-Editor-p-thickness\">\\n          <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Thickness:\")) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Down\">-</a>\\n          <span class=\"Rk-Edit-Size-Disp\" id=\"Rk-Edit-Thickness-Value\">' +\n__e(node.thickness) +\n'</span>\\n          <a href=\"#\" class=\"Rk-Edit-Size-Btn\" id=\"Rk-Edit-Thickness-Up\">+</a>\\n      </div>\\n      ';\n } ;\n__p += '\\n    </div>\\n';\n } ;\n__p += ' ';\n if (options.show_node_editor_image) { ;\n__p += '\\n    <div class=\"Rk-Edit-ImgWrap\">\\n        <div class=\"Rk-Edit-ImgPreview\">\\n            <img src=\"' +\n__e(node.image || node.image_placeholder) +\n'\" />\\n            ';\n if (node.clip_path) { ;\n__p += '\\n                <svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewbox=\"0 0 1 1\" preserveAspectRatio=\"none\">\\n                    <path style=\"stroke-width: .02; stroke:red; fill-opacity:.3; fill:red;\" d=\"' +\n__e( node.clip_path ) +\n'\" />\\n                </svg>\\n            ';\n };\n__p += '\\n        </div>\\n    </div>\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Image URL:\")) +\n'</label>\\n        <div>\\n            <a class=\"Rk-Edit-Image-Del\" href=\"#\"></a>\\n            <input class=\"Rk-Edit-Image\" type=\"text\" value=\\'' +\n__e(node.image) +\n'\\' />\\n        </div>\\n    </p>\\n';\n if (options.allow_image_upload) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Choose Image File:\")) +\n'</label>\\n        <input class=\"Rk-Edit-Image-File\" type=\"file\" accept=\"image/*\" />\\n    </p>\\n';\n };\n\n } ;\n__p += ' ';\n if (options.show_node_editor_creator && node.has_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.created_by_color) +\n';\"></span>\\n        ' +\n__e( shortenText(node.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.change_shapes) { ;\n__p += '\\n    <p>\\n        <label>' +\n__e(renkan.translate(\"Shapes available\")) +\n':</label>\\n        <select class=\"Rk-Edit-Shape\">\\n          ';\n _.each(shapes, function(shape) { ;\n__p += '\\n            <option class=\"Rk-Edit-Vocabulary-Property\" value=\"' +\n__e( shape ) +\n'\"';\n if (node.shape === shape) { ;\n__p += ' selected';\n } ;\n__p += '>\\n                ' +\n__e( renkan.translate(shape.charAt(0).toUpperCase() + shape.substring(1)) ) +\n'\\n            </option>\\n          ';\n }); ;\n__p += '\\n        </select>\\n    </p>\\n';\n } ;\n__p += '\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/nodeeditor_readonly.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>\\n    ';\n if (options.show_node_tooltip_color) { ;\n__p += '\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.color) +\n';\"></span>\\n    ';\n } ;\n__p += '\\n    <span class=\"Rk-Display-Title\">\\n        ';\n if (node.uri) { ;\n__p += '\\n            <a href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\">\\n        ';\n } ;\n__p += '\\n        ' +\n__e(node.title) +\n'\\n        ';\n if (node.uri) { ;\n__p += '</a>';\n } ;\n__p += '\\n    </span>\\n</h2>\\n';\n if (node.uri && options.show_node_tooltip_uri) { ;\n__p += '\\n    <p class=\"Rk-Display-URI\">\\n        <a href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\">' +\n__e(node.short_uri) +\n'</a>\\n    </p>\\n';\n } ;\n__p += ' ';\n if (options.show_node_tooltip_description) { ;\n__p += '\\n    <p class=\"Rk-Display-Description\">' +\n((__t = (node.description)) == null ? '' : __t) +\n'</p>\\n';\n } ;\n__p += ' ';\n if (node.image && options.show_node_tooltip_image) { ;\n__p += '\\n    <img class=\"Rk-Display-ImgPreview\" src=\"' +\n__e(node.image) +\n'\" />\\n';\n } ;\n__p += ' ';\n if (node.has_creator && options.show_node_tooltip_creator) { ;\n__p += '\\n    <p>\\n        <span class=\"Rk-Editor-Label\">' +\n__e(renkan.translate(\"Created by:\")) +\n'</span>\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.created_by_color) +\n';\"></span>\\n        ' +\n__e( shortenText(node.created_by_title, 25) ) +\n'\\n    </p>\\n';\n } ;\n__p += '\\n    <a href=\"#?idNode=' +\n__e(node._id) +\n'\">' +\n__e(renkan.translate(\"Link to the node\")) +\n'</a>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/nodeeditor_video.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '<h2>\\n    <span class=\"Rk-CloseX\">&times;</span>\\n    ';\n if (options.show_node_tooltip_color) { ;\n__p += '\\n        <span class=\"Rk-UserColor\" style=\"background: ' +\n__e(node.color) +\n';\"></span>\\n    ';\n } ;\n__p += '\\n    <span class=\"Rk-Display-Title\">\\n        ';\n if (node.uri) { ;\n__p += '\\n            <a href=\"' +\n__e(node.uri) +\n'\" target=\"_blank\">\\n        ';\n } ;\n__p += '\\n        ' +\n__e(node.title) +\n'\\n        ';\n if (node.uri) { ;\n__p += '</a>';\n } ;\n__p += '\\n    </span>\\n</h2>\\n';\n if (node.uri && options.show_node_tooltip_uri) { ;\n__p += '\\n     <video width=\"320\" height=\"240\" controls>\\n        <source src=\"' +\n__e(node.uri) +\n'\" type=\"video/mp4\">\\n     </video> \\n';\n } ;\n__p += '\\n    <a href=\"#?idnode=' +\n__e(node._id) +\n'\">' +\n__e(renkan.translate(\"Link to the node\")) +\n'</a>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/scene.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n\n if (options.show_top_bar) { ;\n__p += '\\n    <div class=\"Rk-TopBar\">\\n        <div class=\"loader\"></div>\\n        ';\n if (!options.editor_mode) { ;\n__p += '\\n            <h2 class=\"Rk-PadTitle\">\\n                ' +\n__e( project.get(\"title\") || translate(\"Untitled project\")) +\n'\\n            </h2>\\n        ';\n } else { ;\n__p += '\\n            <input type=\"text\" class=\"Rk-PadTitle\" value=\"' +\n__e( project.get('title') || '' ) +\n'\" placeholder=\"' +\n__e(translate('Untitled project')) +\n'\" />\\n        ';\n } ;\n__p += '\\n        ';\n if (options.show_user_list) { ;\n__p += '\\n            <div class=\"Rk-Users\">\\n                <div class=\"Rk-CurrentUser\">\\n                    ';\n if (options.show_user_color) { ;\n__p += '\\n                        <div class=\"Rk-Edit-ColorPicker-Wrapper\">\\n                            <span class=\"Rk-CurrentUser-Color\">\\n                            ';\n if (options.user_color_editable) { ;\n__p += '\\n                                <span class=\"Rk-Edit-ColorTip\"></span>\\n                            ';\n } ;\n__p += '\\n                            </span>\\n                            ';\n if (options.user_color_editable) { print(colorPicker) } ;\n__p += '\\n                        </div>\\n                    ';\n } ;\n__p += '\\n                    <span class=\"Rk-CurrentUser-Name\">&lt;unknown user&gt;</span>\\n                </div>\\n                <ul class=\"Rk-UserList\"></ul>\\n            </div>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.home_button_url) {;\n__p += '\\n            <div class=\"Rk-TopBar-Separator\"></div>\\n            <a class=\"Rk-TopBar-Button Rk-Home-Button\" href=\"' +\n__e( options.home_button_url ) +\n'\">\\n                <div class=\"Rk-TopBar-Tooltip\">\\n                    <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                        ' +\n__e( translate(options.home_button_title) ) +\n'\\n                    </div>\\n                </div>\\n            </a>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.show_fullscreen_button) { ;\n__p += '\\n            <div class=\"Rk-TopBar-Separator\"></div>\\n            <div class=\"Rk-TopBar-Button Rk-FullScreen-Button\">\\n                <div class=\"Rk-TopBar-Tooltip\">\\n                    <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                        ' +\n__e(translate(\"Full Screen\")) +\n'\\n                    </div>\\n                </div>\\n            </div>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.editor_mode) { ;\n__p += '\\n            ';\n if (options.show_addnode_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-AddNode-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Add Node\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_addedge_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-AddEdge-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Add Edge\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_export_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Export-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Download Project\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_save_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Save-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\"></div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_open_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Open-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Open Project\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n            ';\n } ;\n__p += '\\n            ';\n if (options.show_bookmarklet) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <a class=\"Rk-TopBar-Button Rk-Bookmarklet-Button\" href=\"#\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Renkan \\'Drag-to-Add\\' bookmarklet\")) +\n'\\n                        </div>\\n                    </div>\\n                </a>\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n            ';\n } ;\n__p += '\\n        ';\n } else { ;\n__p += '\\n            ';\n if (options.show_export_button) { ;\n__p += '\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n                <div class=\"Rk-TopBar-Button Rk-Export-Button\">\\n                    <div class=\"Rk-TopBar-Tooltip\">\\n                        <div class=\"Rk-TopBar-Tooltip-Contents\">\\n                            ' +\n__e(translate(\"Download Project\")) +\n'\\n                        </div>\\n                    </div>\\n                </div>\\n                <div class=\"Rk-TopBar-Separator\"></div>\\n            ';\n } ;\n__p += '\\n        ';\n }; ;\n__p += '\\n        ';\n if (options.show_search_field) { ;\n__p += '\\n            <form action=\"#\" class=\"Rk-GraphSearch-Form\">\\n                <input type=\"search\" class=\"Rk-GraphSearch-Field\" placeholder=\"' +\n__e( translate('Search in graph') ) +\n'\" />\\n            </form>\\n            <div class=\"Rk-TopBar-Separator\"></div>\\n        ';\n } ;\n__p += '\\n    </div>\\n';\n } ;\n__p += '\\n<div class=\"Rk-Editing-Space';\n if (!options.show_top_bar) { ;\n__p += ' Rk-Editing-Space-Full';\n } ;\n__p += '\">\\n    <div class=\"Rk-Labels\"></div>\\n    <canvas class=\"Rk-Canvas\" ';\n if (options.resize) { ;\n__p += ' resize=\"\" ';\n } ;\n__p += ' ></canvas>\\n    <div class=\"Rk-Notifications\"></div>\\n    <div class=\"Rk-Editor\">\\n        ';\n if (options.show_bins) { ;\n__p += '\\n            <div class=\"Rk-Fold-Bins\">&laquo;</div>\\n        ';\n } ;\n__p += '\\n        ';\n if (options.show_zoom) { ;\n__p += '\\n            <div class=\"Rk-ZoomButtons\">\\n                <div class=\"Rk-ZoomIn\" title=\"' +\n__e(translate('Zoom In')) +\n'\"></div>\\n                <div class=\"Rk-ZoomFit\" title=\"' +\n__e(translate('Zoom Fit')) +\n'\"></div>\\n                <div class=\"Rk-ZoomOut\" title=\"' +\n__e(translate('Zoom Out')) +\n'\"></div>\\n                ';\n if (options.editor_mode && options.save_view) { ;\n__p += '\\n                    <div class=\"Rk-ZoomSave\" title=\"' +\n__e(translate('Save view')) +\n'\"></div>\\n                ';\n } ;\n__p += '\\n                ';\n if (options.save_view) { ;\n__p += '\\n                    <div class=\"Rk-ZoomSetSaved\" title=\"' +\n__e(translate('View saved view')) +\n'\"></div>\\n                    ';\n if (options.hide_nodes) { ;\n__p += '\\n                \\t   <div class=\"Rk-ShowHiddenNodes\" title=\"' +\n__e(translate('Show hidden nodes')) +\n'\"></div>\\n                    ';\n } ;\n__p += '       \\n                ';\n } ;\n__p += '\\n            </div>\\n        ';\n } ;\n__p += '\\n    </div>\\n</div>\\n';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/search.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"' +\n((__t = ( className )) == null ? '' : __t) +\n'\" data-key=\"' +\n((__t = ( key )) == null ? '' : __t) +\n'\">' +\n((__t = ( title )) == null ? '' : __t) +\n'</li>';\n\n}\nreturn __p\n};\n\nthis[\"renkanJST\"][\"templates/wikipedia-bin/resulttemplate.html\"] = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __e = _.escape;\nwith (obj) {\n__p += '<li class=\"Rk-Wikipedia-Result Rk-Bin-Item\" draggable=\"true\"\\n    data-uri=\"' +\n__e(url) +\n'\" data-title=\"Wikipedia: ' +\n__e(title) +\n'\"\\n    data-description=\"' +\n__e(description) +\n'\"\\n    data-image=\"' +\n__e( Rkns.Utils.getFullURL( static_url + 'img/wikipedia.png' ) ) +\n'\">\\n\\n    <img class=\"Rk-Wikipedia-Icon\" src=\"' +\n__e(static_url) +\n'img/wikipedia.png\">\\n    <h4 class=\"Rk-Wikipedia-Title\">\\n        <a href=\"' +\n__e(url) +\n'\" target=\"_blank\">' +\n((__t = (htitle)) == null ? '' : __t) +\n'</a>\\n    </h4>\\n    <p class=\"Rk-Wikipedia-Snippet\">' +\n((__t = (hdescription)) == null ? '' : __t) +\n'</p>\\n</li>\\n';\n\n}\nreturn __p\n};","/* Declaring the Renkan Namespace Rkns and Default values */\n\n(function(root) {\n\n    \"use strict\";\n\n    if (typeof root.Rkns !== \"object\") {\n        root.Rkns = {};\n    }\n\n    var Rkns = root.Rkns;\n    var $ = Rkns.$ = root.jQuery;\n    var _ = Rkns._ = root._;\n\n    Rkns.pickerColors = [\"#8f1919\", \"#a80000\", \"#d82626\", \"#ff0000\", \"#e87c7c\", \"#ff6565\", \"#f7d3d3\", \"#fecccc\",\n        \"#8f5419\", \"#a85400\", \"#d87f26\", \"#ff7f00\", \"#e8b27c\", \"#ffb265\", \"#f7e5d3\", \"#fee5cc\",\n        \"#8f8f19\", \"#a8a800\", \"#d8d826\", \"#feff00\", \"#e8e87c\", \"#feff65\", \"#f7f7d3\", \"#fefecc\",\n        \"#198f19\", \"#00a800\", \"#26d826\", \"#00ff00\", \"#7ce87c\", \"#65ff65\", \"#d3f7d3\", \"#ccfecc\",\n        \"#198f8f\", \"#00a8a8\", \"#26d8d8\", \"#00feff\", \"#7ce8e8\", \"#65feff\", \"#d3f7f7\", \"#ccfefe\",\n        \"#19198f\", \"#0000a8\", \"#2626d8\", \"#0000ff\", \"#7c7ce8\", \"#6565ff\", \"#d3d3f7\", \"#ccccfe\",\n        \"#8f198f\", \"#a800a8\", \"#d826d8\", \"#ff00fe\", \"#e87ce8\", \"#ff65fe\", \"#f7d3f7\", \"#feccfe\",\n        \"#000000\", \"#242424\", \"#484848\", \"#6d6d6d\", \"#919191\", \"#b6b6b6\", \"#dadada\", \"#ffffff\"\n    ];\n\n    Rkns.__renkans = [];\n\n    var _BaseBin = Rkns._BaseBin = function(_renkan, _opts) {\n        if (typeof _renkan !== \"undefined\") {\n            this.renkan = _renkan;\n            this.renkan.$.find(\".Rk-Bin-Main\").hide();\n            this.$ = Rkns.$('<li>')\n                .addClass(\"Rk-Bin\")\n                .appendTo(_renkan.$.find(\".Rk-Bin-List\"));\n            this.title_icon_$ = Rkns.$('<span>')\n                .addClass(\"Rk-Bin-Title-Icon\")\n                .appendTo(this.$);\n\n            var _this = this;\n\n            Rkns.$('<a>')\n                .attr({\n                    href: \"#\",\n                    title: _renkan.translate(\"Close bin\")\n                })\n                .addClass(\"Rk-Bin-Close\")\n                .html('&times;')\n                .appendTo(this.$)\n                .click(function() {\n                    _this.destroy();\n                    if (!_renkan.$.find(\".Rk-Bin-Main:visible\").length) {\n                        _renkan.$.find(\".Rk-Bin-Main:last\").slideDown();\n                    }\n                    _renkan.resizeBins();\n                    return false;\n                });\n            Rkns.$('<a>')\n                .attr({\n                    href: \"#\",\n                    title: _renkan.translate(\"Refresh bin\")\n                })\n                .addClass(\"Rk-Bin-Refresh\")\n                .appendTo(this.$)\n                .click(function() {\n                    _this.refresh();\n                    return false;\n                });\n            this.count_$ = Rkns.$('<div>')\n                .addClass(\"Rk-Bin-Count\")\n                .appendTo(this.$);\n            this.title_$ = Rkns.$('<h2>')\n                .addClass(\"Rk-Bin-Title\")\n                .appendTo(this.$);\n            this.main_$ = Rkns.$('<div>')\n                .addClass(\"Rk-Bin-Main\")\n                .appendTo(this.$)\n                .html('<h4 class=\"Rk-Bin-Loading\">' + _renkan.translate(\"Loading, please wait\") + '</h4>');\n            this.title_$.html(_opts.title || '(new bin)');\n            this.renkan.resizeBins();\n\n            if (_opts.auto_refresh) {\n                window.setInterval(function() {\n                    _this.refresh();\n                }, _opts.auto_refresh);\n            }\n        }\n    };\n\n    _BaseBin.prototype.destroy = function() {\n        this.$.detach();\n        this.renkan.resizeBins();\n    };\n\n    /* Point of entry */\n\n    var Renkan = Rkns.Renkan = function(_opts) {\n        var _this = this;\n\n        Rkns.__renkans.push(this);\n\n        this.options = _.defaults(_opts, Rkns.defaults, {\n            templates: _.defaults(_opts.templates, renkanJST) || renkanJST,\n            node_editor_templates: _.defaults(_opts.node_editor_templates, Rkns.defaults.node_editor_templates)\n        });\n        this.template = renkanJST['templates/main.html'];\n\n        var types_templates = {};\n        _.each(this.options.node_editor_templates, function(value, key) {\n            types_templates[key] = _this.options.templates[value];\n            delete _this.options.templates[value];\n        });\n        this.options.node_editor_templates = types_templates;\n\n        _.each(this.options.property_files, function(f) {\n            Rkns.$.getJSON(f, function(data) {\n                _this.options.properties = _this.options.properties.concat(data);\n            });\n        });\n\n        this.read_only = this.options.read_only || !this.options.editor_mode;\n\n        this.router = new Rkns.Router();\n\n        this.project = new Rkns.Models.Project();\n        this.dataloader = new Rkns.DataLoader.Loader(this.project, this.options);\n\n        this.setCurrentUser = function(user_id, user_name) {\n            this.project.addUser({\n                _id: user_id,\n                title: user_name\n            });\n            this.current_user = user_id;\n            this.renderer.redrawUsers();\n        };\n\n        if (typeof this.options.user_id !== \"undefined\") {\n            this.current_user = this.options.user_id;\n        }\n        this.$ = Rkns.$(\"#\" + this.options.container);\n        this.$\n            .addClass(\"Rk-Main\")\n            .html(this.template(this));\n\n        this.tabs = [];\n        this.search_engines = [];\n\n        this.current_user_list = new Rkns.Models.UsersList();\n\n        this.current_user_list.on(\"add remove\", function() {\n            if (this.renderer) {\n                this.renderer.redrawUsers();\n            }\n        });\n\n        this.colorPicker = (function() {\n            var _tmpl = renkanJST['templates/colorpicker.html'];\n            return '<ul class=\"Rk-Edit-ColorPicker\">' + Rkns.pickerColors.map(function(c) {\n                return _tmpl({\n                    c: c\n                });\n            }).join(\"\") + '</ul>';\n        })();\n\n        if (this.options.show_editor) {\n            this.renderer = new Rkns.Renderer.Scene(this);\n        }\n\n        if (!this.options.search.length) {\n            this.$.find(\".Rk-Web-Search-Form\").detach();\n        } else {\n            var _tmpl = renkanJST['templates/search.html'],\n                _select = this.$.find(\".Rk-Search-List\"),\n                _input = this.$.find(\".Rk-Web-Search-Input\"),\n                _form = this.$.find(\".Rk-Web-Search-Form\");\n            _.each(this.options.search, function(_search, _key) {\n                if (Rkns[_search.type] && Rkns[_search.type].Search) {\n                    _this.search_engines.push(new Rkns[_search.type].Search(_this, _search));\n                }\n            });\n            _select.html(\n                _(this.search_engines).map(function(_search, _key) {\n                    return _tmpl({\n                        key: _key,\n                        title: _search.getSearchTitle(),\n                        className: _search.getBgClass()\n                    });\n                }).join(\"\")\n            );\n            _select.find(\"li\").click(function() {\n                var _el = Rkns.$(this);\n                _this.setSearchEngine(_el.attr(\"data-key\"));\n                _form.submit();\n            });\n            _form.submit(function() {\n                if (_input.val()) {\n                    var _search = _this.search_engine;\n                    _search.search(_input.val());\n                }\n                return false;\n            });\n            this.$.find(\".Rk-Search-Current\").mouseenter(\n                function() {\n                    _select.slideDown();\n                }\n            );\n            this.$.find(\".Rk-Search-Select\").mouseleave(\n                function() {\n                    _select.hide();\n                }\n            );\n            this.setSearchEngine(0);\n        }\n        _.each(this.options.bins, function(_bin) {\n            if (Rkns[_bin.type] && Rkns[_bin.type].Bin) {\n                _this.tabs.push(new Rkns[_bin.type].Bin(_this, _bin));\n            }\n        });\n\n        var elementDropped = false;\n\n        this.$.find(\".Rk-Bins\")\n            .on(\"click\", \".Rk-Bin-Title,.Rk-Bin-Title-Icon\", function() {\n                var _mainDiv = Rkns.$(this).siblings(\".Rk-Bin-Main\");\n                if (_mainDiv.is(\":hidden\")) {\n                    _this.$.find(\".Rk-Bin-Main\").slideUp();\n                    _mainDiv.slideDown();\n                }\n            });\n\n        if (this.options.show_editor) {\n\n            this.$.find(\".Rk-Bins\").on(\"mouseover\", \".Rk-Bin-Item\", function(_e) {\n                var _t = Rkns.$(this);\n                if (_t && $(_t).attr(\"data-uri\")) {\n                    var _models = _this.project.get(\"nodes\").where({\n                        uri: $(_t).attr(\"data-uri\")\n                    });\n                    _.each(_models, function(_model) {\n                        _this.renderer.highlightModel(_model);\n                    });\n                }\n            }).mouseout(function() {\n                _this.renderer.unhighlightAll();\n            }).on(\"mousemove\", \".Rk-Bin-Item\", function(e) {\n                try {\n                    this.dragDrop();\n                } catch (err) {}\n            }).on(\"touchstart\", \".Rk-Bin-Item\", function(e) {\n                elementDropped = false;\n            }).on(\"touchmove\", \".Rk-Bin-Item\", function(e) {\n                e.preventDefault();\n                var touch = e.originalEvent.changedTouches[0],\n                    off = _this.renderer.canvas_$.offset(),\n                    w = _this.renderer.canvas_$.width(),\n                    h = _this.renderer.canvas_$.height();\n                if (touch.pageX >= off.left && touch.pageX < (off.left + w) && touch.pageY >= off.top && touch.pageY < (off.top + h)) {\n                    if (elementDropped) {\n                        _this.renderer.onMouseMove(touch, true);\n                    } else {\n                        elementDropped = true;\n                        var div = document.createElement('div');\n                        div.appendChild(this.cloneNode(true));\n                        _this.renderer.dropData({\n                            \"text/html\": div.innerHTML\n                        }, touch);\n                        _this.renderer.onMouseDown(touch, true);\n                    }\n                }\n            }).on(\"touchend\", \".Rk-Bin-Item\", function(e) {\n                if (elementDropped) {\n                    _this.renderer.onMouseUp(e.originalEvent.changedTouches[0], true);\n                }\n                elementDropped = false;\n            }).on(\"dragstart\", \".Rk-Bin-Item\", function(e) {\n                var div = document.createElement('div');\n                div.appendChild(this.cloneNode(true));\n                try {\n                    e.originalEvent.dataTransfer.setData(\"text/html\", div.innerHTML);\n                } catch (err) {\n                    e.originalEvent.dataTransfer.setData(\"text\", div.innerHTML);\n                }\n            });\n\n        }\n\n        Rkns.$(window).resize(function() {\n            _this.resizeBins();\n        });\n\n        var lastsearch = false,\n            lastval = '';\n\n        this.$.find(\".Rk-Bins-Search-Input\").on(\"change keyup paste input\", function() {\n            var val = Rkns.$(this).val();\n            if (val === lastval) {\n                return;\n            }\n            var search = Rkns.Utils.regexpFromTextOrArray(val.length > 1 ? val : null);\n            if (search.source === lastsearch) {\n                return;\n            }\n            lastsearch = search.source;\n            _.each(_this.tabs, function(tab) {\n                tab.render(search);\n            });\n\n        });\n        this.$.find(\".Rk-Bins-Search-Form\").submit(function() {\n            return false;\n        });\n    };\n\n    Renkan.prototype.translate = function(_text) {\n        if (Rkns.i18n[this.options.language] && Rkns.i18n[this.options.language][_text]) {\n            return Rkns.i18n[this.options.language][_text];\n        }\n        if (this.options.language.length > 2 && Rkns.i18n[this.options.language.substr(0, 2)] && Rkns.i18n[this.options.language.substr(0, 2)][_text]) {\n            return Rkns.i18n[this.options.language.substr(0, 2)][_text];\n        }\n        return _text;\n    };\n\n    Renkan.prototype.onStatusChange = function() {\n        this.renderer.onStatusChange();\n    };\n\n    Renkan.prototype.setSearchEngine = function(_key) {\n        this.search_engine = this.search_engines[_key];\n        this.$.find(\".Rk-Search-Current\").attr(\"class\", \"Rk-Search-Current \" + this.search_engine.getBgClass());\n        var listClasses = this.search_engine.getBgClass().split(\" \");\n        var classes = \"\";\n        for (var i = 0; i < listClasses.length; i++) {\n            classes += \".\" + listClasses[i];\n        }\n        this.$.find(\".Rk-Web-Search-Input.Rk-Search-Input\").attr(\"placeholder\", this.translate(\"Search in \") + this.$.find(\".Rk-Search-List \" + classes).html());\n    };\n\n    Renkan.prototype.resizeBins = function() {\n        var _d = +this.$.find(\".Rk-Bins-Head\").outerHeight();\n        this.$.find(\".Rk-Bin-Title:visible\").each(function() {\n            _d += Rkns.$(this).outerHeight();\n        });\n        this.$.find(\".Rk-Bin-Main\").css({\n            height: this.$.find(\".Rk-Bins\").height() - _d\n        });\n    };\n\n    /* Utility functions */\n    var getUUID4 = function() {\n        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n            var r = Math.random() * 16 | 0,\n                v = c === 'x' ? r : (r & 0x3 | 0x8);\n            return v.toString(16);\n        });\n    };\n\n    Rkns.Utils = {\n        getUUID4: getUUID4,\n        getUID: (function() {\n            function pad(n) {\n                return n < 10 ? '0' + n : n;\n            }\n            var _d = new Date(),\n                ID_AUTO_INCREMENT = 0,\n                ID_BASE = _d.getUTCFullYear() + '-' +\n                pad(_d.getUTCMonth() + 1) + '-' +\n                pad(_d.getUTCDate()) + '-' +\n                getUUID4();\n            return function(_base) {\n                var _n = (++ID_AUTO_INCREMENT).toString(16),\n                    _uidbase = (typeof _base === \"undefined\" ? \"\" : _base + \"-\");\n                while (_n.length < 4) {\n                    _n = '0' + _n;\n                }\n                return _uidbase + ID_BASE + '-' + _n;\n            };\n        })(),\n        getFullURL: function(url) {\n\n            if (typeof(url) === 'undefined' || url == null) {\n                return \"\";\n            }\n            if (/https?:\\/\\//.test(url)) {\n                return url;\n            }\n            var img = new Image();\n            img.src = url;\n            var res = img.src;\n            img.src = null;\n            return res;\n\n        },\n        inherit: function(_baseClass, _callbefore) {\n\n            var _class = function(_arg) {\n                if (typeof _callbefore === \"function\") {\n                    _callbefore.apply(this, Array.prototype.slice.call(arguments, 0));\n                }\n                _baseClass.apply(this, Array.prototype.slice.call(arguments, 0));\n                if (typeof this._init === \"function\" && !this._initialized) {\n                    this._init.apply(this, Array.prototype.slice.call(arguments, 0));\n                    this._initialized = true;\n                }\n            };\n            _.extend(_class.prototype, _baseClass.prototype);\n\n            return _class;\n\n        },\n        regexpFromTextOrArray: (function() {\n            var charsub = [\n                    '[aáàâä]',\n                    '[cç]',\n                    '[eéèêë]',\n                    '[iíìîï]',\n                    '[oóòôö]',\n                    '[uùûü]'\n                ],\n                removeChars = [\n                    String.fromCharCode(768), String.fromCharCode(769), String.fromCharCode(770), String.fromCharCode(771), String.fromCharCode(807),\n                    \"{\", \"}\", \"(\", \")\", \"[\", \"]\", \"【\", \"】\", \"、\", \"・\", \"‥\", \"。\", \"「\", \"」\", \"『\", \"』\", \"〜\", \":\", \"!\", \"?\", \" \",\n                    \",\", \" \", \";\", \"(\", \")\", \".\", \"*\", \"+\", \"\\\\\", \"?\", \"|\", \"{\", \"}\", \"[\", \"]\", \"^\", \"#\", \"/\"\n                ],\n                remsrc = \"[\\\\\" + removeChars.join(\"\\\\\") + \"]\",\n                remrx = new RegExp(remsrc, \"gm\"),\n                charsrx = _.map(charsub, function(c) {\n                    return new RegExp(c);\n                });\n\n            function replaceText(_text) {\n                var txt = _text.toLowerCase().replace(remrx, \"\"),\n                    src = \"\";\n\n                function makeReplaceFunc(l) {\n                    return function(k, v) {\n                        l = l.replace(charsrx[k], v);\n                    };\n                }\n                for (var j = 0; j < txt.length; j++) {\n                    if (j) {\n                        src += remsrc + \"*\";\n                    }\n                    var l = txt[j];\n                    _.each(charsub, makeReplaceFunc(l));\n                    src += l;\n                }\n                return src;\n            }\n\n            function getSource(inp) {\n                switch (typeof inp) {\n                    case \"string\":\n                        return replaceText(inp);\n                    case \"object\":\n                        var src = '';\n                        _.each(inp, function(v) {\n                            var res = getSource(v);\n                            if (res) {\n                                if (src) {\n                                    src += '|';\n                                }\n                                src += res;\n                            }\n                        });\n                        return src;\n                }\n                return '';\n            }\n\n            return function(_textOrArray) {\n                var source = getSource(_textOrArray);\n                if (source) {\n                    var testrx = new RegExp(source, \"im\"),\n                        replacerx = new RegExp('(' + source + ')', \"igm\");\n                    return {\n                        isempty: false,\n                        source: source,\n                        test: function(_t) {\n                            return testrx.test(_t);\n                        },\n                        replace: function(_text, _replace) {\n                            return _text.replace(replacerx, _replace);\n                        }\n                    };\n                } else {\n                    return {\n                        isempty: true,\n                        source: '',\n                        test: function() {\n                            return true;\n                        },\n                        replace: function(_text) {\n                            return text;\n                        }\n                    };\n                }\n            };\n        })(),\n        /* The minimum distance (in pixels) the mouse has to move to consider an element was dragged */\n        _MIN_DRAG_DISTANCE: 2,\n        /* Distance between the inner and outer radius of buttons that appear when hovering on a node */\n        _NODE_BUTTON_WIDTH: 40,\n\n        _EDGE_BUTTON_INNER: 2,\n        _EDGE_BUTTON_OUTER: 40,\n        /* Constants used to know if a specific action is to be performed when clicking on the canvas */\n        _CLICKMODE_ADDNODE: 1,\n        _CLICKMODE_STARTEDGE: 2,\n        _CLICKMODE_ENDEDGE: 3,\n        /* Node size step: Used to calculate the size change when clicking the +/- buttons */\n        _NODE_SIZE_STEP: Math.LN2 / 4,\n        _MIN_SCALE: 1 / 20,\n        _MAX_SCALE: 20,\n        _MOUSEMOVE_RATE: 80,\n        _DOUBLETAP_DELAY: 800,\n        /* Maximum distance in pixels (squared, to reduce calculations)\n         * between two taps when double-tapping on a touch terminal */\n        _DOUBLETAP_DISTANCE: 20 * 20,\n        /* A placeholder so a default colour is displayed when a node has a null value for its user property */\n        _USER_PLACEHOLDER: function(_renkan) {\n            return {\n                color: _renkan.options.default_user_color,\n                title: _renkan.translate(\"(unknown user)\"),\n                get: function(attr) {\n                    return this[attr] || false;\n                }\n            };\n        },\n        /* The code for the \"Drag and Add Bookmarklet\", slightly minified and with whitespaces removed, though\n         * it doesn't seem that it's still a requirement in newer browsers (i.e. the ones compatibles with canvas drawing)\n         */\n        _BOOKMARKLET_CODE: function(_renkan) {\n            return \"(function(a,b,c,d,e,f,h,i,j,k,l,m,n,o,p,q,r){a=document;b=a.body;c=a.location.href;j='draggable';m='text/x-iri-';d=a.createElement('div');d.innerHTML='<p_style=\\\"position:fixed;top:0;right:0;font:bold_18px_sans-serif;color:#fff;background:#909;padding:10px;z-index:100000;\\\">\" +\n                _renkan.translate(\"Drag items from this website, drop them in Renkan\").replace(/ /g, \"_\") +\n                \"</p>'.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);})();\";\n        },\n        /* Shortens text to the required length then adds ellipsis */\n        shortenText: function(_text, _maxlength) {\n            return (_text.length > _maxlength ? (_text.substr(0, _maxlength) + '…') : _text);\n        },\n        /* Drawing an edit box with an arrow and positioning the edit box according to the position of the node/edge being edited\n         * Called by Rkns.Renderer.NodeEditor and Rkns.Renderer.EdgeEditor */\n        drawEditBox: function(_options, _coords, _path, _xmargin, _selector) {\n            _selector.css({\n                width: (_options.tooltip_width - 2 * _options.tooltip_padding)\n            });\n            var _height = _selector.outerHeight() + 2 * _options.tooltip_padding,\n                _isLeft = (_coords.x < paper.view.center.x ? 1 : -1),\n                _left = _coords.x + _isLeft * (_xmargin + _options.tooltip_arrow_length),\n                _right = _coords.x + _isLeft * (_xmargin + _options.tooltip_arrow_length + _options.tooltip_width),\n                _top = _coords.y - _height / 2;\n            if (_top + _height > (paper.view.size.height - _options.tooltip_margin)) {\n                _top = Math.max(paper.view.size.height - _options.tooltip_margin, _coords.y + _options.tooltip_arrow_width / 2) - _height;\n            }\n            if (_top < _options.tooltip_margin) {\n                _top = Math.min(_options.tooltip_margin, _coords.y - _options.tooltip_arrow_width / 2);\n            }\n            var _bottom = _top + _height;\n            /* jshint laxbreak:true */\n            _path.segments[0].point = _path.segments[7].point = _coords.add([_isLeft * _xmargin, 0]);\n            _path.segments[1].point.x = _path.segments[2].point.x = _path.segments[5].point.x = _path.segments[6].point.x = _left;\n            _path.segments[3].point.x = _path.segments[4].point.x = _right;\n            _path.segments[2].point.y = _path.segments[3].point.y = _top;\n            _path.segments[4].point.y = _path.segments[5].point.y = _bottom;\n            _path.segments[1].point.y = _coords.y - _options.tooltip_arrow_width / 2;\n            _path.segments[6].point.y = _coords.y + _options.tooltip_arrow_width / 2;\n            _path.fillColor = new paper.Color(new paper.Gradient([_options.tooltip_top_color, _options.tooltip_bottom_color]), [0, _top], [0, _bottom]);\n            _selector.css({\n                left: (_options.tooltip_padding + Math.min(_left, _right)),\n                top: (_options.tooltip_padding + _top)\n            });\n            return _path;\n        },\n        // from http://stackoverflow.com/a/6444043\n        increaseBrightness: function (hex, percent){\n            // strip the leading # if it's there\n            hex = hex.replace(/^\\s*#|\\s*$/g, '');\n\n            // convert 3 char codes --> 6, e.g. `E0F` --> `EE00FF`\n            if(hex.length === 3){\n                hex = hex.replace(/(.)/g, '$1$1');\n            }\n\n            var r = parseInt(hex.substr(0, 2), 16),\n                g = parseInt(hex.substr(2, 2), 16),\n                b = parseInt(hex.substr(4, 2), 16);\n\n            return '#' +\n               ((0|(1<<8) + r + (256 - r) * percent / 100).toString(16)).substr(1) +\n               ((0|(1<<8) + g + (256 - g) * percent / 100).toString(16)).substr(1) +\n               ((0|(1<<8) + b + (256 - b) * percent / 100).toString(16)).substr(1);\n        }\n    };\n})(window);\n\n/* END main.js */\n","(function(root) {\n    \"use strict\";\n    \n    var Backbone = root.Backbone;\n    \n    var Router = root.Rkns.Router = Backbone.Router.extend({\n        routes: {\n            '': 'index'\n        },\n        \n        index: function (parameters) {\n            \n            var result = {};\n            if (parameters !== null){\n                parameters.split(\"&\").forEach(function(part) {\n                    var item = part.split(\"=\");\n                    result[item[0]] = decodeURIComponent(item[1]);\n                });\n            }\n            this.trigger('router', result);        \n        }  \n    });\n\n})(window);","(function(root) {\n\n    \"use strict\";\n\n    var DataLoader = root.Rkns.DataLoader = {\n        converters: {\n            from1to2: function(data) {\n\n                var i, len;\n                if(typeof data.nodes !== 'undefined') {\n                    for(i=0, len=data.nodes.length; i<len; i++) {\n                        var node = data.nodes[i];\n                        if(node.color) {\n                            node.style = {\n                                color: node.color,\n                            };\n                        }\n                        else {\n                            node.style = {};\n                        }\n                    }\n                }\n                if(typeof data.edges !== 'undefined') {\n                    for(i=0, len=data.edges.length; i<len; i++) {\n                        var edge = data.edges[i];\n                        if(edge.color) {\n                            edge.style = {\n                                color: edge.color,\n                            };\n                        }\n                        else {\n                            edge.style = {};\n                        }\n                    }\n                }\n\n                data.schema_version = \"2\";\n\n                return data;\n            },\n        }\n    };\n\n\n    DataLoader.Loader = function(project, options) {\n        this.project = project;\n        this.dataConverters = _.defaults(options.converters || {}, DataLoader.converters);\n    };\n\n\n    DataLoader.Loader.prototype.convert = function(data) {\n        var schemaVersionFrom = this.project.getSchemaVersion(data);\n        var schemaVersionTo = this.project.getSchemaVersion();\n\n        if (schemaVersionFrom !== schemaVersionTo) {\n            var converterName = \"from\" + schemaVersionFrom + \"to\" + schemaVersionTo;\n            if (typeof this.dataConverters[converterName] === 'function') {\n                data = this.dataConverters[converterName](data);\n            }\n        }\n        return data;\n    };\n\n    DataLoader.Loader.prototype.load = function(data) {\n        this.project.set(this.convert(data), {\n            validate: true\n        });\n    };\n\n})(window);\n","(function(root) {\n    \"use strict\";\n\n    var Backbone = root.Backbone;\n\n    var Models = root.Rkns.Models = {};\n\n    Models.getUID = function(obj) {\n        var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,\n                function(c) {\n                    var r = Math.random() * 16 | 0, v = c === 'x' ? r\n                            : (r & 0x3 | 0x8);\n                    return v.toString(16);\n                });\n        if (typeof obj !== 'undefined') {\n            return obj.type + \"-\" + guid;\n        }\n        else {\n            return guid;\n        }\n    };\n\n    var RenkanModel = Backbone.RelationalModel.extend({\n        idAttribute : \"_id\",\n        constructor : function(options) {\n\n            if (typeof options !== \"undefined\") {\n                options._id = options._id || options.id || Models.getUID(this);\n                options.title = options.title || \"\";\n                options.description = options.description || \"\";\n                options.uri = options.uri || \"\";\n\n                if (typeof this.prepare === \"function\") {\n                    options = this.prepare(options);\n                }\n            }\n            Backbone.RelationalModel.prototype.constructor.call(this, options);\n        },\n        validate : function() {\n            if (!this.type) {\n                return \"object has no type\";\n            }\n        },\n        addReference : function(_options, _propName, _list, _id, _default) {\n            var _element = _list.get(_id);\n            if (typeof _element === \"undefined\" &&\n                typeof _default !== \"undefined\") {\n                _options[_propName] = _default;\n            }\n            else {\n                _options[_propName] = _element;\n            }\n        }\n    });\n\n    // USER\n    var User = Models.User = RenkanModel.extend({\n        type : \"user\",\n        prepare : function(options) {\n            options.color = options.color || \"#666666\";\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                title : this.get(\"title\"),\n                uri : this.get(\"uri\"),\n                description : this.get(\"description\"),\n                color : this.get(\"color\")\n            };\n        }\n    });\n\n    // NODE\n    var Node = Models.Node = RenkanModel.extend({\n        type : \"node\",\n        relations : [ {\n            type : Backbone.HasOne,\n            key : \"created_by\",\n            relatedModel : User\n        } ],\n        prepare : function(options) {\n            var project = options.project;\n            this.addReference(options, \"created_by\", project.get(\"users\"),\n                    options.created_by, project.current_user);\n            options.description = options.description || \"\";\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                title : this.get(\"title\"),\n                uri : this.get(\"uri\"),\n                description : this.get(\"description\"),\n                position : this.get(\"position\"),\n                image : this.get(\"image\"),\n                style : this.get(\"style\"),\n                created_by : this.get(\"created_by\") ? this.get(\"created_by\")\n                        .get(\"_id\") : null,\n                size : this.get(\"size\"),\n                clip_path : this.get(\"clip_path\"),\n                shape : this.get(\"shape\"),  \n                type : this.get(\"type\")\n            };\n        }\n    });\n\n    // EDGE\n    var Edge = Models.Edge = RenkanModel.extend({\n        type : \"edge\",\n        relations : [ {\n            type : Backbone.HasOne,\n            key : \"created_by\",\n            relatedModel : User\n        }, {\n            type : Backbone.HasOne,\n            key : \"from\",\n            relatedModel : Node\n        }, {\n            type : Backbone.HasOne,\n            key : \"to\",\n            relatedModel : Node\n        } ],\n        prepare : function(options) {\n            var project = options.project;\n            this.addReference(options, \"created_by\", project.get(\"users\"),\n                    options.created_by, project.current_user);\n            this.addReference(options, \"from\", project.get(\"nodes\"),\n                    options.from);\n            this.addReference(options, \"to\", project.get(\"nodes\"), options.to);\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                title : this.get(\"title\"),\n                uri : this.get(\"uri\"),\n                description : this.get(\"description\"),\n                from : this.get(\"from\") ? this.get(\"from\").get(\"_id\") : null,\n                to : this.get(\"to\") ? this.get(\"to\").get(\"_id\") : null,\n                style : this.get(\"style\"),\n                created_by : this.get(\"created_by\") ? this.get(\"created_by\")\n                        .get(\"_id\") : null\n            };\n        }\n    });\n\n    // View\n    var View = Models.View = RenkanModel.extend({\n        type : \"view\",\n        relations : [ {\n            type : Backbone.HasOne,\n            key : \"created_by\",\n            relatedModel : User\n        } ],\n        prepare : function(options) {\n            var project = options.project;\n            this.addReference(options, \"created_by\", project.get(\"users\"),\n                    options.created_by, project.current_user);\n            options.description = options.description || \"\";\n            if (typeof options.offset !== \"undefined\") {\n                var offset = {};\n                if (Array.isArray(options.offset)) {\n                    offset.x = options.offset[0];\n                    offset.y = options.offset.length > 1 ? options.offset[1]\n                            : options.offset[0];\n                }\n                else if (options.offset.x != null) {\n                    offset.x = options.offset.x;\n                    offset.y = options.offset.y;\n                }\n                options.offset = offset;\n            }\n            return options;\n        },\n        toJSON : function() {\n            return {\n                _id : this.get(\"_id\"),\n                zoom_level : this.get(\"zoom_level\"),\n                offset : this.get(\"offset\"),\n                title : this.get(\"title\"),\n                description : this.get(\"description\"),\n                created_by : this.get(\"created_by\") ? this.get(\"created_by\")\n                        .get(\"_id\") : null,\n                hidden_nodes: this.get(\"hidden_nodes\")\n            // Don't need project id\n            };\n        }\n    });\n\n    // PROJECT\n    var Project = Models.Project = RenkanModel.extend({\n        schema_version : \"2\",\n        type : \"project\",\n        blacklist : [ 'saveStatus', 'loadingStatus'],\n        relations : [ {\n            type : Backbone.HasMany,\n            key : \"users\",\n            relatedModel : User,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        }, {\n            type : Backbone.HasMany,\n            key : \"nodes\",\n            relatedModel : Node,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        }, {\n            type : Backbone.HasMany,\n            key : \"edges\",\n            relatedModel : Edge,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        }, {\n            type : Backbone.HasMany,\n            key : \"views\",\n            relatedModel : View,\n            reverseRelation : {\n                key : 'project',\n                includeInJSON : '_id'\n            }\n        } ],\n        addUser : function(_props, _options) {\n            _props.project = this;\n            var _user = User.findOrCreate(_props);\n            this.get(\"users\").push(_user, _options);\n            return _user;\n        },\n        addNode : function(_props, _options) {\n            _props.project = this;\n            var _node = Node.findOrCreate(_props);\n            this.get(\"nodes\").push(_node, _options);\n            return _node;\n        },\n        addEdge : function(_props, _options) {\n            _props.project = this;\n            var _edge = Edge.findOrCreate(_props);\n            this.get(\"edges\").push(_edge, _options);\n            return _edge;\n        },\n        addView : function(_props, _options) {\n            _props.project = this;\n            // TODO: check if need to replace with create only\n            var _view = View.findOrCreate(_props);\n            // TODO: Should we remember only one view?\n            this.get(\"views\").push(_view, _options);\n            return _view;\n        },\n        removeNode : function(_model) {\n            this.get(\"nodes\").remove(_model);\n        },\n        removeEdge : function(_model) {\n            this.get(\"edges\").remove(_model);\n        },\n        validate : function(options) {\n            var _project = this;\n            _.each(\n              [].concat(options.users, options.nodes, options.edges,options.views),\n              function(_item) {\n                if (_item) {\n                    _item.project = _project;\n                }\n              }\n            );\n        },\n        getSchemaVersion : function(data) {\n          var t = data;\n          if(typeof(t) === \"undefined\") {\n            t = this;\n          }\n          var version = t.schema_version;\n          if(!version) {\n            return 1;\n          }\n          else {\n            return version;\n          }\n        },\n        // Add event handler to remove edges when a node is removed\n        initialize : function() {\n            var _this = this;\n            this.on(\"remove:nodes\", function(_node) {\n                _this.get(\"edges\").remove(\n                        _this.get(\"edges\").filter(\n                                function(_edge) {\n                                    return _edge.get(\"from\") === _node ||\n                                           _edge.get(\"to\") === _node;\n                                }));\n            });\n        },\n        toJSON : function() {\n            var json = _.clone(this.attributes);\n            for ( var attr in json) {\n                if ((json[attr] instanceof Backbone.Model) ||\n                        (json[attr] instanceof Backbone.Collection) ||\n                        (json[attr] instanceof RenkanModel)) {\n                    json[attr] = json[attr].toJSON();\n                }\n            }\n            return _.omit(json, this.blacklist);\n        }\n    });\n\n    var RosterUser = Models.RosterUser = Backbone.Model\n            .extend({\n                type : \"roster_user\",\n                idAttribute : \"_id\",\n\n                constructor : function(options) {\n\n                    if (typeof options !== \"undefined\") {\n                        options._id = options._id ||\n                            options.id ||\n                            Models.getUID(this);\n                        options.title = options.title || \"(untitled \" + this.type + \")\";\n                        options.description = options.description || \"\";\n                        options.uri = options.uri || \"\";\n                        options.project = options.project || null;\n                        options.site_id = options.site_id || 0;\n\n                        if (typeof this.prepare === \"function\") {\n                            options = this.prepare(options);\n                        }\n                    }\n                    Backbone.Model.prototype.constructor.call(this, options);\n                },\n\n                validate : function() {\n                    if (!this.type) {\n                        return \"object has no type\";\n                    }\n                },\n\n                prepare : function(options) {\n                    options.color = options.color || \"#666666\";\n                    return options;\n                },\n\n                toJSON : function() {\n                    return {\n                        _id : this.get(\"_id\"),\n                        title : this.get(\"title\"),\n                        uri : this.get(\"uri\"),\n                        description : this.get(\"description\"),\n                        color : this.get(\"color\"),\n                        project : (this.get(\"project\") != null) ? this.get(\n                                \"project\").get(\"id\") : null,\n                        site_id : this.get(\"site_id\")\n                    };\n                }\n            });\n\n    var UsersList = Models.UsersList = Backbone.Collection.extend({\n        model : RosterUser\n    });\n\n})(window);\n","Rkns.defaults = {\n\n    language: (navigator.language || navigator.userLanguage || \"en\"),\n        /* GUI Language */\n    container: \"renkan\",\n        /* GUI Container DOM element ID */\n    search: [],\n        /* List of Search Engines */\n    bins: [],\n           /* List of Bins */\n    static_url: \"\",\n        /* URL for static resources */\n    popup_editor: true,\n        /* show the node editor as a popup inside the renkan view */\n    editor_panel: 'editor-panel',\n        /* GUI continer DOM element ID of the editor panel */\n    show_bins: true,\n        /* Show bins in left column */\n    properties: [],\n        /* Semantic properties for edges */\n    show_editor: true,\n        /* Show the graph editor... Setting this to \"false\" only shows the bins part ! */\n    read_only: false,\n        /* Allows editing of renkan without changing the rest of the GUI. Can be switched on/off on the fly to block/enable editing */\n    editor_mode: true,\n        /* Switch for Publish/Edit GUI. If editor_mode is false, read_only will be true.  */\n    manual_save: false,\n        /* In snapshot mode, clicking on the floppy will save a snapshot. Otherwise, it will show the connection status */\n    show_top_bar: true,\n        /* Show the top bar, (title, buttons, users) */\n    default_user_color: \"#303030\",\n    size_bug_fix: false,\n        /* Resize the canvas after load (fixes a bug on iPad and FF Mac) */\n    force_resize: false,\n    allow_double_click: true,\n        /* Allows Double Click to create a node on an empty background */\n    zoom_on_scroll: true,\n        /* Allows to use the scrollwheel to zoom */\n    element_delete_delay: 0,\n        /* Delay between clicking on the bin on an element and really deleting it\n           Set to 0 for delete confirm */\n    autoscale_padding: 50,\n    resize: true,\n\n    /* zoom options */\n    show_zoom: true,\n        /* show zoom buttons */\n    save_view: true,\n        /* show buttons to save view */\n    default_view: false,\n        /* Allows to load default view (zoom+offset) at start on read_only mode, instead of autoScale. the default_view will be the last */\n\n    /* URL parsing */\n    update_url:true,\n        /* update the url each time the paper shift or on zoom in/out, with the serialized view (offset and scale) */\n    \n\n    /* TOP BAR BUTTONS */\n    show_search_field: true,\n    show_user_list: true,\n    user_name_editable: true,\n    user_color_editable: true,\n    show_user_color: true,\n    show_save_button: true,\n    show_export_button: true,\n    show_open_button: false,\n    show_addnode_button: true,\n    show_addedge_button: true,\n    show_bookmarklet: true,\n    show_fullscreen_button: true,\n    home_button_url: false,\n    home_button_title: \"Home\",\n\n    /* MINI-MAP OPTIONS */\n\n    show_minimap: true,\n        /* Show a small map at the bottom right */\n    minimap_width: 160,\n    minimap_height: 120,\n    minimap_padding: 20,\n    minimap_background_color: \"#ffffff\",\n    minimap_border_color: \"#cccccc\",\n    minimap_highlight_color: \"#ffff00\",\n    minimap_highlight_weight: 5,\n\n\n    /* EDGE/NODE COMMON OPTIONS */\n\n    buttons_background: \"#202020\",\n    buttons_label_color: \"#c000c0\",\n    buttons_label_font_size: 9,\n\n    ghost_opacity : 0.3,\n        /* opacity when the hidden element is revealed */\n    default_dash_array : [4, 5],\n        /* dash line genometry */\n\n    /* NODE DISPLAY OPTIONS */\n\n    show_node_circles: true,\n        /* Show circles for nodes */\n    clip_node_images: true,\n        /* Constraint node images to circles */\n    node_images_fill_mode: false,\n        /* Set to false for \"letterboxing\" (height/width of node adapted to show full image)\n           Set to true for \"crop\" (adapted to fill circle) */\n    node_size_base: 25,\n    node_stroke_width: 2,\n    node_stroke_max_width: 12,\n    selected_node_stroke_width: 4,\n    selected_node_stroke_max_width: 24,\n    node_stroke_witdh_scale: 5,\n    node_fill_color: \"#ffffff\",\n    highlighted_node_fill_color: \"#ffff00\",\n    node_label_distance: 5,\n        /* Vertical distance between node and label */\n    node_label_max_length: 60,\n        /* Maximum displayed text length */\n    label_untitled_nodes: \"(untitled)\",\n        /* Label to display on untitled nodes */\n    hide_nodes: true,\n        /* allow hide/show nodes */\n    change_shapes: true,\n        /* Change shapes enabled */\n    change_types: true,\n    /* Change type enabled */\n\n    /* NODE EDITOR TEMPLATE*/\n\n    node_editor_templates: {\n        \"default\": \"templates/nodeeditor_readonly.html\",\n        \"video\": \"templates/nodeeditor_video.html\"\n    },\n\n    /* EDGE DISPLAY OPTIONS */\n\n    edge_stroke_width: 2,\n    edge_stroke_max_width: 12,\n    selected_edge_stroke_width: 4,\n    selected_edge_stroke_max_width: 24,\n    edge_stroke_witdh_scale: 5,\n\n    edge_label_distance: 0,\n    edge_label_max_length: 20,\n    edge_arrow_length: 18,\n    edge_arrow_width: 12,\n    edge_arrow_max_width: 32,\n    edge_gap_in_bundles: 12,\n    label_untitled_edges: \"\",\n\n    /* CONTEXTUAL DISPLAY (TOOLTIP OR EDITOR) OPTIONS */\n\n    tooltip_width: 275,\n    tooltip_padding: 10,\n    tooltip_margin: 15,\n    tooltip_arrow_length : 20,\n    tooltip_arrow_width : 40,\n    tooltip_top_color: \"#f0f0f0\",\n    tooltip_bottom_color: \"#d0d0d0\",\n    tooltip_border_color: \"#808080\",\n    tooltip_border_width: 1,\n    tooltip_opacity: 0.8,\n\n    richtext_editor_config: {\n        toolbarGroups: [\n            { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },\n            { name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },\n            '/',\n\t        { name: 'styles'},\n        ],\n        removePlugins : 'colorbutton,find,flash,font,forms,iframe,image,newpage,smiley,specialchar,stylescombo,templates',\n    },\n\n    /* NODE EDITOR OPTIONS */\n\n    show_node_editor_uri: true,\n    show_node_editor_title: true,\n    show_node_editor_description: true,\n    show_node_editor_description_richtext: true,\n    show_node_editor_title_richtext: true,\n    show_node_editor_size: true,\n    show_node_editor_style: true,\n    show_node_editor_style_color: true,\n    show_node_editor_style_dash: true,\n    show_node_editor_style_thickness: true,\n    show_node_editor_image: true,\n    show_node_editor_creator: true,\n    allow_image_upload: true,\n    uploaded_image_max_kb: 500,\n\n\n    /* NODE TOOLTIP OPTIONS */\n\n    show_node_tooltip_uri: true,\n    show_node_tooltip_description: true,\n    show_node_tooltip_color: true,\n    show_node_tooltip_image: true,\n    show_node_tooltip_creator: true,\n\n    /* EDGE EDITOR OPTIONS */\n\n    show_edge_editor_uri: true,\n    show_edge_editor_style: true,\n    show_edge_editor_style_color: true,\n    show_edge_editor_style_dash: true,\n    show_edge_editor_style_thickness: true,\n    show_edge_editor_style_arrow: true,\n    show_edge_editor_direction: true,\n    show_edge_editor_nodes: true,\n    show_edge_editor_creator: true,\n\n    /* EDGE TOOLTIP OPTIONS */\n\n    show_edge_tooltip_uri: true,\n    show_edge_tooltip_color: true,\n    show_edge_tooltip_nodes: true,\n    show_edge_tooltip_creator: true,\n\n};\n","Rkns.i18n = {\n    fr: {\n        \"Edit Node\": \"Édition d’un nœud\",\n        \"Edit Edge\": \"Édition d’un lien\",\n        \"Title:\": \"Titre :\",\n        \"URI:\": \"URI :\",\n        \"Description:\": \"Description :\",\n        \"From:\": \"De :\",\n        \"To:\": \"Vers :\",\n        \"Image\": \"Image\",\n        \"Image URL:\": \"URL d'Image\",\n        \"Choose Image File:\": \"Choisir un fichier image\",\n        \"Full Screen\": \"Mode plein écran\",\n        \"Add Node\": \"Ajouter un nœud\",\n        \"Add Edge\": \"Ajouter un lien\",\n        \"Save Project\": \"Enregistrer le projet\",\n        \"Open Project\": \"Ouvrir un projet\",\n        \"Auto-save enabled\": \"Enregistrement automatique activé\",\n        \"Connection lost\": \"Connexion perdue\",\n        \"Created by:\": \"Créé par :\",\n        \"Zoom In\": \"Agrandir l’échelle\",\n        \"Zoom Out\": \"Rapetisser l’échelle\",\n        \"Edit\": \"Éditer\",\n        \"Remove\": \"Supprimer\",\n        \"Cancel deletion\": \"Annuler la suppression\",\n        \"Link to another node\": \"Créer un lien\",\n        \"Enlarge\": \"Agrandir\",\n        \"Shrink\": \"Rétrécir\",\n        \"Click on the background canvas to add a node\": \"Cliquer sur le fond du graphe pour rajouter un nœud\",\n        \"Click on a first node to start the edge\": \"Cliquer sur un premier nœud pour commencer le lien\",\n        \"Click on a second node to complete the edge\": \"Cliquer sur un second nœud pour terminer le lien\",\n        \"Wikipedia\": \"Wikipédia\",\n        \"Wikipedia in \": \"Wikipédia en \",\n        \"French\": \"Français\",\n        \"English\": \"Anglais\",\n        \"Japanese\": \"Japonais\",\n        \"Untitled project\": \"Projet sans titre\",\n        \"Lignes de Temps\": \"Lignes de Temps\",\n        \"Loading, please wait\": \"Chargement en cours, merci de patienter\",\n        \"Edge color:\": \"Couleur :\",\n        \"Dash:\": \"Point. :\",\n        \"Thickness:\": \"Epaisseur :\",\n        \"Arrow:\": \"Flèche :\",\n        \"Node color:\": \"Couleur :\",\n        \"Choose color\": \"Choisir une couleur\",\n        \"Change edge direction\": \"Changer le sens du lien\",\n        \"Do you really wish to remove node \": \"Voulez-vous réellement supprimer le nœud \",\n        \"Do you really wish to remove edge \": \"Voulez-vous réellement supprimer le lien \",\n        \"This file is not an image\": \"Ce fichier n'est pas une image\",\n        \"Image size must be under \": \"L'image doit peser moins de \",\n        \"Size:\": \"Taille :\",\n        \"KB\": \"ko\",\n        \"Choose from vocabulary:\": \"Choisir dans un vocabulaire :\",\n        \"SKOS Documentation properties\": \"SKOS: Propriétés documentaires\",\n        \"has note\": \"a pour note\",\n        \"has example\": \"a pour exemple\",\n        \"has definition\": \"a pour définition\",\n        \"SKOS Semantic relations\": \"SKOS: Relations sémantiques\",\n        \"has broader\": \"a pour concept plus large\",\n        \"has narrower\": \"a pour concept plus étroit\",\n        \"has related\": \"a pour concept apparenté\",\n        \"Dublin Core Metadata\": \"Métadonnées Dublin Core\",\n        \"has contributor\": \"a pour contributeur\",\n        \"covers\": \"couvre\",\n        \"created by\": \"créé par\",\n        \"has date\": \"a pour date\",\n        \"published by\": \"édité par\",\n        \"has source\": \"a pour source\",\n        \"has subject\": \"a pour sujet\",\n        \"Dragged resource\": \"Ressource glisée-déposée\",\n        \"Search the Web\": \"Rechercher en ligne\",\n        \"Search in Bins\": \"Rechercher dans les chutiers\",\n        \"Close bin\": \"Fermer le chutier\",\n        \"Refresh bin\": \"Rafraîchir le chutier\",\n        \"(untitled)\": \"(sans titre)\",\n        \"Select contents:\": \"Sélectionner des contenus :\",\n        \"Drag items from this website, drop them in Renkan\": \"Glissez des éléments de ce site web vers Renkan\",\n        \"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\",\n        \"Shapes available\": \"Formes disponibles\",\n        \"Circle\": \"Cercle\",\n        \"Square\": \"Carré\",\n        \"Diamond\": \"Losange\",\n        \"Hexagone\": \"Hexagone\",\n        \"Ellipse\": \"Ellipse\",\n        \"Star\": \"Étoile\",\n        \"Cloud\": \"Nuage\",\n        \"Triangle\": \"Triangle\",\n        \"Zoom Fit\": \"Ajuster le Zoom\",\n        \"Download Project\": \"Télécharger le projet\",\n        \"Save view\": \"Sauver la vue\",\n        \"View saved view\": \"Restaurer la Vue\",\n        \"Renkan \\'Drag-to-Add\\' bookmarklet\": \"Renkan \\'Deplacer-Pour-Ajouter\\' Signet\",\n        \"(unknown user)\":\"(non authentifié)\",\n        \"<unknown user>\":\"<non authentifié>\",\n        \"Search in graph\":\"Rechercher dans carte\",\n        \"Search in \" : \"Chercher dans \"\n    }\n};\n","/* Saves the Full JSON at each modification */\n\nRkns.jsonIO = function(_renkan, _opts) {\n    var _proj = _renkan.project;\n    if (typeof _opts.http_method === \"undefined\") {\n        _opts.http_method = 'PUT';\n    }\n    var _load = function() {\n        _renkan.renderer.redrawActive = false;\n        _proj.set({\n            loadingStatus : true\n        });\n        Rkns.$.getJSON(_opts.url, function(_data) {\n            _renkan.dataloader.load(_data);\n            _proj.set({\n                loadingStatus : false\n            });\n            _proj.set({\n                saveStatus : 0\n            });\n            _renkan.renderer.redrawActive = true;\n        });\n    };\n    var _save = function() {\n        _proj.set({\n            saveStatus : 2\n        });\n        var _data = _proj.toJSON();\n        if (!_renkan.read_only) {\n            Rkns.$.ajax({\n                type : _opts.http_method,\n                url : _opts.url,\n                contentType : \"application/json\",\n                data : JSON.stringify(_data),\n                success : function(data, textStatus, jqXHR) {\n                    _proj.set({\n                        saveStatus : 0\n                    });\n                }\n            });\n        }\n\n    };\n    var _thrSave = Rkns._.throttle(function() {\n        setTimeout(_save, 100);\n    }, 1000);\n    \n    //TODO: Rearrange to avoid the 2 firts PUT due to a change in the project model\n    // Take car of setting up the listener correctly to listen the save action on the view\n    _proj.on(\"add:nodes add:edges add:users add:views\", function(_model) {\n        _model.on(\"change remove\", function(_model) {\n            _thrSave();\n        });\n        _thrSave();\n    });\n    _proj.on(\"change\", function() {\n        if (!(_proj.changedAttributes.length === 1 && _proj\n                .hasChanged('saveStatus'))) {\n            _thrSave();\n        }\n    });\n\n    _load();\n};\n","/* Saves the Full JSON once */\n\nRkns.jsonIOSaveOnClick = function(_renkan, _opts) {\n    var _proj = _renkan.project,\n        _saveWarn = false,\n        _onLeave = function() {\n            return \"Project not saved\";\n        };\n    if (typeof _opts.http_method === \"undefined\") {\n        _opts.http_method = 'POST';\n    }\n    var _load = function() {\n        var getdata = {},\n            rx = /id=([^&#?=]+)/,\n            matches = document.location.hash.match(rx);\n        if (matches) {\n            getdata.id = matches[1];\n        }\n        Rkns.$.ajax({\n            url: _opts.url,\n            data: getdata,\n            beforeSend: function(){\n                _renkan.renderer.redrawActive = false;\n            \t_proj.set({loadingStatus:true});\n            },\n            success: function(_data) {\n                _renkan.dataloader.load(_data);\n                _proj.set({loadingStatus:false});\n                _proj.set({saveStatus:0});\n                _renkan.renderer.redrawActive = true;\n            }\n        });\n    };\n    var _save = function() {\n        _proj.set(\"saved_at\", new Date());\n        var _data = _proj.toJSON();\n        Rkns.$.ajax({\n            type: _opts.http_method,\n            url: _opts.url,\n            contentType: \"application/json\",\n            data: JSON.stringify(_data),\n            beforeSend: function(){\n            \t_proj.set({saveStatus:2});\n            },\n            success: function(data, textStatus, jqXHR) {\n                $(window).off(\"beforeunload\", _onLeave);\n                _saveWarn = false;\n                _proj.set({saveStatus:0});\n                //document.location.hash = \"#id=\" + data.id;\n                //$(\".Rk-Notifications\").text(\"Saved as \"+document.location.href).fadeIn().delay(2000).fadeOut();\n            }\n        });\n    };\n    var _checkLeave = function() {\n    \t_proj.set({saveStatus:1});\n\n        var title = _proj.get(\"title\");\n        if (title && _proj.get(\"nodes\").length) {\n            $(\".Rk-Save-Button\").removeClass(\"disabled\");\n        } else {\n            $(\".Rk-Save-Button\").addClass(\"disabled\");\n        }\n        if (title) {\n            $(\".Rk-PadTitle\").css(\"border-color\",\"#333333\");\n        }\n        if (!_saveWarn) {\n            _saveWarn = true;\n            $(window).on(\"beforeunload\", _onLeave);\n        }\n    };\n    _load();\n    _proj.on(\"add:nodes add:edges add:users change\", function(_model) {\n\t    _model.on(\"change remove\", function(_model) {\n\t    \tif(!(_model.changedAttributes.length === 1 && _model.hasChanged('saveStatus'))) {\n\t    \t\t_checkLeave();\n\t    \t}\n\t    });\n\t\tif(!(_proj.changedAttributes.length === 1 && _proj.hasChanged('saveStatus'))) {\n\t\t    _checkLeave();\n    \t}\n    });\n    _renkan.renderer.save = function() {\n        if ($(\".Rk-Save-Button\").hasClass(\"disabled\")) {\n            if (!_proj.get(\"title\")) {\n                $(\".Rk-PadTitle\").css(\"border-color\",\"#ff0000\");\n            }\n        } else {\n            _save();\n        }\n    };\n};\n","(function(Rkns) {\n\"use strict\";\n\nvar _ = Rkns._;\n\nvar Ldt = Rkns.Ldt = {};\n\nvar Bin = Ldt.Bin = function(_renkan, _opts) {\n    if (_opts.ldt_type) {\n        var Resclass = Ldt[_opts.ldt_type+\"Bin\"];\n        if (Resclass) {\n            return new Resclass(_renkan, _opts);\n        }\n    }\n    console.error(\"No such LDT Bin Type\");\n};\n\nvar ProjectBin = Ldt.ProjectBin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nProjectBin.prototype.tagTemplate = renkanJST['templates/ldtjson-bin/tagtemplate.html'];\n\nProjectBin.prototype.annotationTemplate = renkanJST['templates/ldtjson-bin/annotationtemplate.html'];\n\nProjectBin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.proj_id = _opts.project_id;\n    this.ldt_platform = _opts.ldt_platform || \"http://ldt.iri.centrepompidou.fr/\";\n    this.title_$.html(_opts.title);\n    this.title_icon_$.addClass('Rk-Ldt-Title-Icon');\n    this.refresh();\n};\n\nProjectBin.prototype.render = function(searchbase) {\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    function highlight(_text) {\n        var _e = _(_text).escape();\n        return search.isempty ? _e : search.replace(_e, \"<span class='searchmatch'>$1</span>\");\n    }\n    function convertTC(_ms) {\n        function pad(_n) {\n            var _res = _n.toString();\n            while (_res.length < 2) {\n                _res = '0' + _res;\n            }\n            return _res;\n        }\n        var _totalSeconds = Math.abs(Math.floor(_ms/1000)),\n            _hours = Math.floor(_totalSeconds / 3600),\n            _minutes = (Math.floor(_totalSeconds / 60) % 60),\n            _seconds = _totalSeconds % 60,\n            _res = '';\n        if (_hours) {\n            _res += pad(_hours) + ':';\n        }\n        _res += pad(_minutes) + ':' + pad(_seconds);\n        return _res;\n    }\n\n    var _html = '<li><h3>Tags</h3></li>',\n        _projtitle = this.data.meta[\"dc:title\"],\n        _this = this,\n        count = 0;\n    _this.title_$.text('LDT Project: \"' + _projtitle + '\"');\n    _.map(_this.data.tags,function(_tag) {\n        var _title = _tag.meta[\"dc:title\"];\n        if (!search.isempty && !search.test(_title)) {\n            return;\n        }\n        count++;\n        _html += _this.tagTemplate({\n            ldt_platform: _this.ldt_platform,\n            title: _title,\n            htitle: highlight(_title),\n            encodedtitle : encodeURIComponent(_title),\n            static_url: _this.renkan.options.static_url\n        });\n    });\n    _html += '<li><h3>Annotations</h3></li>';\n    _.map(_this.data.annotations,function(_annotation) {\n        var _description = _annotation.content.description,\n            _title = _annotation.content.title.replace(_description,\"\");\n        if (!search.isempty && !search.test(_title) && !search.test(_description)) {\n            return;\n        }\n        count++;\n        var _duration = _annotation.end - _annotation.begin,\n            _img = (\n                (_annotation.content && _annotation.content.img && _annotation.content.img.src) ?\n                  _annotation.content.img.src :\n                  ( _duration ? _this.renkan.options.static_url+\"img/ldt-segment.png\" : _this.renkan.options.static_url+\"img/ldt-point.png\" )\n            );\n        _html += _this.annotationTemplate({\n            ldt_platform: _this.ldt_platform,\n            title: _title,\n            htitle: highlight(_title),\n            description: _description,\n            hdescription: highlight(_description),\n            start: convertTC(_annotation.begin),\n            end: convertTC(_annotation.end),\n            duration: convertTC(_duration),\n            mediaid: _annotation.media,\n            annotationid: _annotation.id,\n            image: _img,\n            static_url: _this.renkan.options.static_url\n        });\n    });\n\n    this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nProjectBin.prototype.refresh = function() {\n    var _this = this;\n    Rkns.$.ajax({\n        url: this.ldt_platform + 'ldtplatform/ldt/cljson/id/' + this.proj_id,\n        dataType: \"jsonp\",\n        success: function(_data) {\n            _this.data = _data;\n            _this.render();\n        }\n    });\n};\n\nvar Search = Ldt.Search = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.lang = _opts.lang || \"en\";\n};\n\nSearch.prototype.getBgClass = function() {\n    return \"Rk-Ldt-Icon\";\n};\n\nSearch.prototype.getSearchTitle = function() {\n    return this.renkan.translate(\"Lignes de Temps\");\n};\n\nSearch.prototype.search = function(_q) {\n    this.renkan.tabs.push(\n        new ResultsBin(this.renkan, {\n            search: _q\n        })\n    );\n};\n\nvar ResultsBin = Ldt.ResultsBin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nResultsBin.prototype.segmentTemplate = renkanJST['templates/ldtjson-bin/segmenttemplate.html'];\n\nResultsBin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.ldt_platform = _opts.ldt_platform || \"http://ldt.iri.centrepompidou.fr/\";\n    this.max_results = _opts.max_results || 50;\n    this.search = _opts.search;\n    this.title_$.html('Lignes de Temps: \"' + _opts.search + '\"');\n    this.title_icon_$.addClass('Rk-Ldt-Title-Icon');\n    this.refresh();\n};\n\nResultsBin.prototype.render = function(searchbase) {\n    if (!this.data) {\n        return;\n    }\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    var highlightrx = (search.isempty ? Rkns.Utils.regexpFromTextOrArray(this.search) : search);\n    function highlight(_text) {\n        return highlightrx.replace(_(_text).escape(), \"<span class='searchmatch'>$1</span>\");\n    }\n    function convertTC(_ms) {\n        function pad(_n) {\n            var _res = _n.toString();\n            while (_res.length < 2) {\n                _res = '0' + _res;\n            }\n            return _res;\n        }\n        var _totalSeconds = Math.abs(Math.floor(_ms/1000)),\n            _hours = Math.floor(_totalSeconds / 3600),\n            _minutes = (Math.floor(_totalSeconds / 60) % 60),\n            _seconds = _totalSeconds % 60,\n            _res = '';\n        if (_hours) {\n            _res += pad(_hours) + ':';\n        }\n        _res += pad(_minutes) + ':' + pad(_seconds);\n        return _res;\n    }\n\n    var _html = '',\n        _this = this,\n        count = 0;\n    _.each(this.data.objects,function(_segment) {\n        var _description = _segment.abstract,\n            _title = _segment.title;\n        if (!search.isempty && !search.test(_title) && !search.test(_description)) {\n            return;\n        }\n        count++;\n        var _duration = _segment.duration,\n            _begin = _segment.start_ts,\n            _end = + _segment.duration + _begin,\n            _img = (\n                _duration ?\n                  _this.renkan.options.static_url + \"img/ldt-segment.png\" :\n                  _this.renkan.options.static_url + \"img/ldt-point.png\"\n            );\n        _html += _this.segmentTemplate({\n            ldt_platform: _this.ldt_platform,\n            title: _title,\n            htitle: highlight(_title),\n            description: _description,\n            hdescription: highlight(_description),\n            start: convertTC(_begin),\n            end: convertTC(_end),\n            duration: convertTC(_duration),\n            mediaid: _segment.iri_id,\n            //projectid: _segment.project_id,\n            //cuttingid: _segment.cutting_id,\n            annotationid: _segment.element_id,\n            image: _img\n        });\n    });\n\n    this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nResultsBin.prototype.refresh = function() {\n    var _this = this;\n    Rkns.$.ajax({\n        url: this.ldt_platform + 'ldtplatform/api/ldt/1.0/segments/search/',\n        data: {\n            format: \"jsonp\",\n            q: this.search,\n            limit: this.max_results\n        },\n        dataType: \"jsonp\",\n        success: function(_data) {\n            _this.data = _data;\n            _this.render();\n        }\n    });\n};\n\n})(window.Rkns);\n","Rkns.ResourceList = {};\n\nRkns.ResourceList.Bin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nRkns.ResourceList.Bin.prototype.resultTemplate = renkanJST['templates/list-bin.html'];\n\nRkns.ResourceList.Bin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.title_$.html(_opts.title);\n    if (_opts.list) {\n        this.data = _opts.list;\n    }\n    this.refresh();\n};\n\nRkns.ResourceList.Bin.prototype.render = function(searchbase) {\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    function highlight(_text) {\n        var _e = _(_text).escape();\n        return search.isempty ? _e : search.replace(_e, \"<span class='searchmatch'>$1</span>\");\n    }\n    var _html = \"\",\n        _this = this,\n        count = 0;\n    Rkns._.each(this.data,function(_item) {\n        var _element;\n        if (typeof _item === \"string\") {\n            if (/^(https?:\\/\\/|www)/.test(_item)) {\n                _element = { url: _item };\n            } else {\n                _element = { title: _item.replace(/[:,]?\\s?(https?:\\/\\/|www)[\\d\\w\\/.&?=#%-_]+\\s?/,'').trim() };\n                var _match = _item.match(/(https?:\\/\\/|www)[\\d\\w\\/.&?=#%-_]+/);\n                if (_match) {\n                    _element.url = _match[0];\n                }\n                if (_element.title.length > 80) {\n                    _element.description = _element.title;\n                    _element.title = _element.title.replace(/^(.{30,60})\\s.+$/,'$1…');\n                }\n            }\n        } else {\n            _element = _item;\n        }\n        var title = _element.title || (_element.url || \"\").replace(/^https?:\\/\\/(www\\.)?/,'').replace(/^(.{40}).+$/,'$1…'),\n            url = _element.url || \"\",\n            description = _element.description || \"\",\n            image = _element.image || \"\";\n        if (url && !/^https?:\\/\\//.test(url)) {\n            url = 'http://' + url;\n        }\n        if (!search.isempty && !search.test(title) && !search.test(description)) {\n            return;\n        }\n        count++;\n        _html += _this.resultTemplate({\n            url: url,\n            title: title,\n            htitle: highlight(title),\n            image: image,\n            description: description,\n            hdescription: highlight(description),\n            static_url: _this.renkan.options.static_url\n        });\n    });\n    _this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nRkns.ResourceList.Bin.prototype.refresh = function() {\n    if (this.data) {\n        this.render();\n    }\n};\n","Rkns.Wikipedia = {\n};\n\nRkns.Wikipedia.Search = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.lang = _opts.lang || \"en\";\n};\n\nRkns.Wikipedia.Search.prototype.getBgClass = function() {\n    return \"Rk-Wikipedia-Search-Icon Rk-Wikipedia-Lang-\" + this.lang;\n};\n\nRkns.Wikipedia.Search.prototype.getSearchTitle = function() {\n    var langs = {\n        \"fr\": \"French\",\n        \"en\": \"English\",\n        \"ja\": \"Japanese\"\n    };\n    if (langs[this.lang]) {\n        return this.renkan.translate(\"Wikipedia in \") + this.renkan.translate(langs[this.lang]);\n    } else {\n        return this.renkan.translate(\"Wikipedia\") + \" [\" + this.lang + \"]\";\n    }\n};\n\nRkns.Wikipedia.Search.prototype.search = function(_q) {\n    this.renkan.tabs.push(\n        new Rkns.Wikipedia.Bin(this.renkan, {\n            lang: this.lang,\n            search: _q\n        })\n    );\n};\n\nRkns.Wikipedia.Bin = Rkns.Utils.inherit(Rkns._BaseBin);\n\nRkns.Wikipedia.Bin.prototype.resultTemplate = renkanJST['templates/wikipedia-bin/resulttemplate.html'];\n\nRkns.Wikipedia.Bin.prototype._init = function(_renkan, _opts) {\n    this.renkan = _renkan;\n    this.search = _opts.search;\n    this.lang = _opts.lang || \"en\";\n    this.title_icon_$.addClass('Rk-Wikipedia-Title-Icon Rk-Wikipedia-Lang-' + this.lang);\n    this.title_$.html(this.search).addClass(\"Rk-Wikipedia-Title\");\n    this.refresh();\n};\n\nRkns.Wikipedia.Bin.prototype.render = function(searchbase) {\n    var search = searchbase || Rkns.Utils.regexpFromTextOrArray();\n    var highlightrx = (search.isempty ? Rkns.Utils.regexpFromTextOrArray(this.search) : search);\n    function highlight(_text) {\n        return highlightrx.replace(_(_text).escape(), \"<span class='searchmatch'>$1</span>\");\n    }\n    var _html = \"\",\n        _this = this,\n        count = 0;\n    Rkns._.each(this.data.query.search, function(_result) {\n        var title = _result.title,\n            url = \"http://\" + _this.lang + \".wikipedia.org/wiki/\" + encodeURI(title.replace(/ /g,\"_\")),\n            description = Rkns.$('<div>').html(_result.snippet).text();\n        if (!search.isempty && !search.test(title) && !search.test(description)) {\n            return;\n        }\n        count++;\n        _html += _this.resultTemplate({\n            url: url,\n            title: title,\n            htitle: highlight(title),\n            description: description,\n            hdescription: highlight(description),\n            static_url: _this.renkan.options.static_url\n        });\n    });\n    _this.main_$.html(_html);\n    if (!search.isempty && count) {\n        this.count_$.text(count).show();\n    } else {\n        this.count_$.hide();\n    }\n    if (!search.isempty && !count) {\n        this.$.hide();\n    } else {\n        this.$.show();\n    }\n    this.renkan.resizeBins();\n};\n\nRkns.Wikipedia.Bin.prototype.refresh = function() {\n    var _this = this;\n    Rkns.$.ajax({\n        url: \"http://\" + _this.lang + \".wikipedia.org/w/api.php?action=query&list=search&srsearch=\" + encodeURIComponent(this.search) + \"&format=json\",\n        dataType: \"jsonp\",\n        success: function(_data) {\n            _this.data = _data;\n            _this.render();\n        }\n    });\n};\n","\ndefine('renderer/baserepresentation',['jquery', 'underscore'], function ($, _) {\n    \n\n    /* Rkns.Renderer._BaseRepresentation Class */\n\n    /* In Renkan, a \"Representation\" is a sort of ViewModel (in the MVVM paradigm) and bridges the gap between\n     * models (written with Backbone.js) and the view (written with Paper.js)\n     * Renkan's representations all inherit from Rkns.Renderer._BaseRepresentation '*/\n\n    var _BaseRepresentation = function(_renderer, _model) {\n        if (typeof _renderer !== \"undefined\") {\n            this.renderer = _renderer;\n            this.renkan = _renderer.renkan;\n            this.project = _renderer.renkan.project;\n            this.options = _renderer.renkan.options;\n            this.model = _model;\n            if (this.model) {\n                var _this = this;\n                this._changeBinding = function() {\n                    _this.redraw({change: true});\n                };\n                this._removeBinding = function() {\n                    _renderer.removeRepresentation(_this);\n                    _.defer(function() {\n                        _renderer.redraw();\n                    });\n                };\n                this._selectBinding = function() {\n                    _this.select();\n                };\n                this._unselectBinding = function() {\n                    _this.unselect();\n                };\n                this.model.on(\"change\", this._changeBinding );\n                this.model.on(\"remove\", this._removeBinding );\n                this.model.on(\"select\", this._selectBinding );\n                this.model.on(\"unselect\", this._unselectBinding );\n            }\n        }\n    };\n\n    /* Rkns.Renderer._BaseRepresentation Methods */\n\n    _(_BaseRepresentation.prototype).extend({\n        _super: function(_func) {\n            return _BaseRepresentation.prototype[_func].apply(this, Array.prototype.slice.call(arguments, 1));\n        },\n        redraw: function() {},\n        moveTo: function() {},\n        show: function() { return \"BaseRepresentation.show\"; },\n        hide: function() {},\n        select: function() {\n            if (this.model) {\n                this.model.trigger(\"selected\");\n            }\n        },\n        unselect: function() {\n            if (this.model) {\n                this.model.trigger(\"unselected\");\n            }\n        },\n        highlight: function() {},\n        unhighlight: function() {},\n        mousedown: function() {},\n        mouseup: function() {\n            if (this.model) {\n                this.model.trigger(\"clicked\");\n            }\n        },\n        destroy: function() {\n            if (this.model) {\n                this.model.off(\"change\", this._changeBinding );\n                this.model.off(\"remove\", this._removeBinding );\n                this.model.off(\"select\", this._selectBinding );\n                this.model.off(\"unselect\", this._unselectBinding );\n            }\n        }\n    }).value();\n\n    /* End of Rkns.Renderer._BaseRepresentation Class */\n\n    return _BaseRepresentation;\n\n});\n\ndefine('requtils',[], function ($, _) {\n    \n    return {\n        getUtils: function(){\n            return window.Rkns.Utils;\n        },\n        getRenderer: function(){\n            return window.Rkns.Renderer;\n        }\n    };\n\n});\n\n\ndefine('renderer/basebutton',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* Rkns.Renderer._BaseButton Class */\n\n    /* BaseButton is extended by contextual buttons that appear when hovering on nodes and edges */\n\n    var _BaseButton = Utils.inherit(BaseRepresentation);\n\n    _(_BaseButton.prototype).extend({\n        moveTo: function(_pos) {\n            this.sector.moveTo(_pos);\n        },\n        show: function() {\n            this.sector.show();\n        },\n        hide: function() {\n            if (this.sector){\n                this.sector.hide();                \n            }\n        },\n        select: function() {\n            this.sector.select();\n        },\n        unselect: function(_newTarget) {\n            this.sector.unselect();\n            if (!_newTarget || (_newTarget !== this.source_representation && _newTarget.source_representation !== this.source_representation)) {\n                this.source_representation.unselect();\n            }\n        },\n        destroy: function() {\n            this.sector.destroy();\n        }\n    }).value();\n\n    return _BaseButton;\n\n});\n\n\ndefine('renderer/shapebuilder',[], function () {\n    \n\n    var cloud_path = \"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\";\n    /* ShapeBuilder Begin */\n\n    var builders = {\n        \"circle\":{\n            getShape: function() {\n                return new paper.Path.Circle([0, 0], 1);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Circle(center, radius);\n            }\n        },\n        \"rectangle\":{\n            getShape: function() {\n                return new paper.Path.Rectangle([-2, -2], [2, 2]);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Rectangle([-radius, -radius], [radius*2, radius*2]);\n            }\n        },\n        \"ellipse\":{\n            getShape: function() {\n                return new paper.Path.Ellipse(new paper.Rectangle([-2, -1], [2, 1]));\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Ellipse(new paper.Rectangle([-radius, -radius/2], [radius*2, radius]));\n            }\n        },\n        \"polygon\":{\n            getShape: function() {\n                return new paper.Path.RegularPolygon([0, 0], 6, 1);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.RegularPolygon(center, 6, radius);\n            }\n        },\n        \"diamond\":{\n            getShape: function() {\n                var d = new paper.Path.Rectangle([-Math.SQRT2, -Math.SQRT2], [Math.SQRT2, Math.SQRT2]);\n                d.rotate(45);\n                return d;\n            },\n            getImageShape: function(center, radius) {\n                var d = new paper.Path.Rectangle([-radius*Math.SQRT2/2, -radius*Math.SQRT2/2], [radius*Math.SQRT2, radius*Math.SQRT2]);\n                d.rotate(45);\n                return d;\n            }\n        },\n        \"star\":{\n            getShape: function() {\n                return new paper.Path.Star([0, 0], 8, 1, 0.7);\n            },\n            getImageShape: function(center, radius) {\n                return new paper.Path.Star(center, 8, radius*1, radius*0.7);\n            }\n        },\n        \"cloud\": {\n            getShape: function() {\n                var path = new paper.Path(cloud_path);\n                return path;\n\n            },\n            getImageShape: function(center, radius) {\n                var path = new paper.Path(cloud_path);\n                path.scale(radius);\n                path.translate(center);\n                return path;\n            }\n        },\n        \"triangle\": {\n            getShape: function() {\n                return new paper.Path.RegularPolygon([0,0], 3, 1);\n            },\n            getImageShape: function(center, radius) {\n                var shape = new paper.Path.RegularPolygon([0,0], 3, 1);\n                shape.scale(radius);\n                shape.translate(center);\n                return shape;\n            }\n        },\n        \"svg\": function(path){\n            return {\n                getShape: function() {\n                    return new paper.Path(path);\n                },\n                getImageShape: function(center, radius) {\n                    // No calcul for the moment\n                    return new paper.Path();\n                }\n            };\n        }\n    };\n\n    var ShapeBuilder = function (shape){\n        if(shape === null || typeof shape === \"undefined\"){\n            shape = \"circle\";\n        }\n        if(shape.substr(0,4)===\"svg:\"){\n            return builders.svg(shape.substr(4));\n        }\n        if(!(shape in builders)){\n            shape = \"circle\";\n        }\n        return builders[shape];\n    };\n\n    ShapeBuilder.builders = builders;\n\n    return ShapeBuilder;\n\n});\n\ndefine('renderer/noderepr',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation', 'renderer/shapebuilder'], function ($, _, requtils, BaseRepresentation, ShapeBuilder) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* Rkns.Renderer.Node Class */\n\n    /* The representation for the node : A circle, with an image inside and a text label underneath.\n     * The circle and the image are drawn on canvas and managed by Paper.js.\n     * The text label is an HTML node, managed by jQuery. */\n\n    //var NodeRepr = Renderer.Node = Utils.inherit(Renderer._BaseRepresentation);\n    var NodeRepr = Utils.inherit(BaseRepresentation);\n\n    _(NodeRepr.prototype).extend({\n        _init: function() {\n            this.renderer.node_layer.activate();\n            this.type = \"Node\";\n            this.buildShape();\n            this.hidden = false;\n            this.ghost= false;\n            if (this.options.show_node_circles) {\n                this.circle.strokeWidth = this.options.node_stroke_width;\n                this.h_ratio = 1;\n            } else {\n                this.h_ratio = 0;\n            }\n            this.title = $('<div class=\"Rk-Label\">').appendTo(this.renderer.labels_$);\n\n            if (this.options.editor_mode) {\n                var Renderer = requtils.getRenderer();\n                this.normal_buttons = [\n                                       new Renderer.NodeEditButton(this.renderer, null),\n                                       new Renderer.NodeRemoveButton(this.renderer, null),\n                                       new Renderer.NodeLinkButton(this.renderer, null),\n                                       new Renderer.NodeEnlargeButton(this.renderer, null),\n                                       new Renderer.NodeShrinkButton(this.renderer, null)\n                                       ];\n                if (this.options.hide_nodes){\n                    this.normal_buttons.push(\n                            new Renderer.NodeHideButton(this.renderer, null),\n                            new Renderer.NodeShowButton(this.renderer, null)\n                            );\n                }\n                this.pending_delete_buttons = [\n                                               new Renderer.NodeRevertButton(this.renderer, null)\n                                               ];\n                this.all_buttons = this.normal_buttons.concat(this.pending_delete_buttons);\n\n                for (var i = 0; i < this.all_buttons.length; i++) {\n                    this.all_buttons[i].source_representation = this;\n                }\n                this.active_buttons = [];\n            } else {\n                this.active_buttons = this.all_buttons = [];\n            }\n            this.last_circle_radius = 1;\n\n            if (this.renderer.minimap) {\n                this.renderer.minimap.node_layer.activate();\n                this.minimap_circle = new paper.Path.Circle([0, 0], 1);\n                this.minimap_circle.__representation = this.renderer.minimap.miniframe.__representation;\n                this.renderer.minimap.node_group.addChild(this.minimap_circle);\n            }\n        },\n        _getStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.node_stroke_width + (thickness-1) * (this.options.node_stroke_max_width - this.options.node_stroke_width) / (this.options.node_stroke_witdh_scale-1);\n        },\n        _getSelectedStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.selected_node_stroke_width + (thickness-1) * (this.options.selected_node_stroke_max_width - this.options.selected_node_stroke_width) / (this.options.node_stroke_witdh_scale-1);\n        },\n        buildShape: function(){\n            if( 'shape' in this.model.changed ) {\n                delete this.img;\n            }\n            if(this.circle){\n                this.circle.remove();\n                delete this.circle;\n            }\n            // \"circle\" \"rectangle\" \"ellipse\" \"polygon\" \"star\" \"diamond\"\n            this.shapeBuilder = new ShapeBuilder(this.model.get(\"shape\"));\n            this.circle = this.shapeBuilder.getShape();\n            this.circle.__representation = this;\n            this.circle.sendToBack();\n            this.last_circle_radius = 1;\n        },\n        redraw: function(options) {\n            if( 'shape' in this.model.changed && 'change' in options && options.change ) {\n            //if( 'shape' in this.model.changed ) {\n                this.buildShape();\n            }\n            var _model_coords = new paper.Point(this.model.get(\"position\")),\n                _baseRadius = this.options.node_size_base * Math.exp((this.model.get(\"size\") || 0) * Utils._NODE_SIZE_STEP);\n            if (!this.is_dragging || !this.paper_coords) {\n                this.paper_coords = this.renderer.toPaperCoords(_model_coords);\n            }\n            this.circle_radius = _baseRadius * this.renderer.view.scale;\n            if (this.last_circle_radius !== this.circle_radius) {\n                this.all_buttons.forEach(function(b) {\n                    b.setSectorSize();\n                });\n                this.circle.scale(this.circle_radius / this.last_circle_radius);\n                if (this.node_image) {\n                    this.node_image.scale(this.circle_radius / this.last_circle_radius);\n                }\n            }\n            this.circle.position = this.paper_coords;\n            if (this.node_image) {\n                this.node_image.position = this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius));\n            }\n            this.last_circle_radius = this.circle_radius;\n\n            var old_act_btn = this.active_buttons;\n\n            var opacity = 1;\n            if (this.model.get(\"delete_scheduled\")) {\n                opacity = 0.5;\n                this.active_buttons = this.pending_delete_buttons;\n                this.circle.dashArray = [2,2];\n            } else {\n                opacity = 1;\n                this.active_buttons = this.normal_buttons;\n                this.circle.dashArray = null;\n            }\n            if (this.selected && this.renderer.isEditable() && !this.ghost) {\n                if (old_act_btn !== this.active_buttons) {\n                    old_act_btn.forEach(function(b) {\n                        b.hide();\n                    });\n                }\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n\n            if (this.node_image) {\n                this.node_image.opacity = this.highlighted ? opacity * 0.5 : (opacity - 0.01);\n            }\n\n            this.circle.fillColor = this.highlighted ? this.options.highlighted_node_fill_color : this.options.node_fill_color;\n\n            this.circle.opacity = this.options.show_node_circles ? opacity : 0.01;\n\n            var _text = this.model.get(\"title\") || this.renkan.translate(this.options.label_untitled_nodes) || \"\";\n            _text = Utils.shortenText(_text, this.options.node_label_max_length);\n\n            if (typeof this.highlighted === \"object\") {\n                this.title.html(this.highlighted.replace(_(_text).escape(),'<span class=\"Rk-Highlighted\">$1</span>'));\n            } else {\n                this.title.text(_text);\n            }\n\n            var _strokeWidth = this._getStrokeWidth();\n            this.title.css({\n                left: this.paper_coords.x,\n                top: this.paper_coords.y + this.circle_radius * this.h_ratio + this.options.node_label_distance + 0.5*_strokeWidth,\n                opacity: opacity\n            });\n            var _color = (this.model.has(\"style\") && this.model.get(\"style\").color) || (this.model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                _dash = (this.model.has(\"style\") && this.model.get(\"style\").dash) ? this.options.default_dash_array : null;\n            this.circle.strokeWidth = _strokeWidth;\n            this.circle.strokeColor = _color;\n            this.circle.dashArray = _dash;\n            var _pc = this.paper_coords;\n            this.all_buttons.forEach(function(b) {\n                b.moveTo(_pc);\n            });\n            var lastImage = this.img;\n            this.img = this.model.get(\"image\");\n            if (this.img && this.img !== lastImage) {\n                this.showImage();\n                if(this.circle) {\n                    this.circle.sendToBack();\n                }\n            }\n            if (this.node_image && !this.img) {\n                this.node_image.remove();\n                delete this.node_image;\n            }\n\n            if (this.renderer.minimap) {\n                this.minimap_circle.fillColor = _color;\n                var minipos = this.renderer.toMinimapCoords(_model_coords),\n                miniradius = this.renderer.minimap.scale * _baseRadius,\n                minisize = new paper.Size([miniradius, miniradius]);\n                this.minimap_circle.fitBounds(minipos.subtract(minisize), minisize.multiply(2));\n            }\n\n            if (typeof options === 'undefined' || !('dontRedrawEdges' in options) || !options.dontRedrawEdges) {\n                var _this = this;\n                _.each(\n                        this.project.get(\"edges\").filter(\n                                function (ed) {\n                                    return ((ed.get(\"to\") === _this.model) || (ed.get(\"from\") === _this.model));\n                                }\n                        ),\n                        function(edge, index, list) {\n                            var repr = _this.renderer.getRepresentationByModel(edge);\n                            if (repr && typeof repr.from_representation !== \"undefined\" && typeof repr.from_representation.paper_coords !== \"undefined\" && typeof repr.to_representation !== \"undefined\" && typeof repr.to_representation.paper_coords !== \"undefined\") {\n                                repr.redraw();\n                            }\n                        }\n                );\n            }\n            if (this.ghost){\n                this.show(true);\n            } else {\n                if (this.hidden) { this.hide(); }\n            }\n        },\n        showImage: function() {\n            var _image = null;\n            if (typeof this.renderer.image_cache[this.img] === \"undefined\") {\n                _image = new Image();\n                this.renderer.image_cache[this.img] = _image;\n                _image.src = this.img;\n            } else {\n                _image = this.renderer.image_cache[this.img];\n            }\n            if (_image.width) {\n                if (this.node_image) {\n                    this.node_image.remove();\n                }\n                this.renderer.node_layer.activate();\n                var width = _image.width,\n                    height = _image.height,\n                    clipPath = this.model.get(\"clip_path\"),\n                    hasClipPath = (typeof clipPath !== \"undefined\" && clipPath),\n                    _clip = null,\n                    baseRadius = null,\n                    centerPoint = null;\n\n                if (hasClipPath) {\n                    _clip = new paper.Path();\n                    var instructions = clipPath.match(/[a-z][^a-z]+/gi) || [],\n                    lastCoords = [0,0],\n                    minX = Infinity,\n                    minY = Infinity,\n                    maxX = -Infinity,\n                    maxY = -Infinity;\n\n                    var transformCoords = function(tabc, relative) {\n                        var newCoords = tabc.slice(1).map(function(v, k) {\n                            var res = parseFloat(v),\n                            isY = k % 2;\n                            if (isY) {\n                                res = ( res - 0.5 ) * height;\n                            } else {\n                                res = ( res - 0.5 ) * width;\n                            }\n                            if (relative) {\n                                res += lastCoords[isY];\n                            }\n                            if (isY) {\n                                minY = Math.min(minY, res);\n                                maxY = Math.max(maxY, res);\n                            } else {\n                                minX = Math.min(minX, res);\n                                maxX = Math.max(maxX, res);\n                            }\n                            return res;\n                        });\n                        lastCoords = newCoords.slice(-2);\n                        return newCoords;\n                    };\n\n                    instructions.forEach(function(instr) {\n                        var coords = instr.match(/([a-z]|[0-9.-]+)/ig) || [\"\"];\n                        switch(coords[0]) {\n                        case \"M\":\n                            _clip.moveTo(transformCoords(coords));\n                            break;\n                        case \"m\":\n                            _clip.moveTo(transformCoords(coords, true));\n                            break;\n                        case \"L\":\n                            _clip.lineTo(transformCoords(coords));\n                            break;\n                        case \"l\":\n                            _clip.lineTo(transformCoords(coords, true));\n                            break;\n                        case \"C\":\n                            _clip.cubicCurveTo(transformCoords(coords));\n                            break;\n                        case \"c\":\n                            _clip.cubicCurveTo(transformCoords(coords, true));\n                            break;\n                        case \"Q\":\n                            _clip.quadraticCurveTo(transformCoords(coords));\n                            break;\n                        case \"q\":\n                            _clip.quadraticCurveTo(transformCoords(coords, true));\n                            break;\n                        }\n                    });\n\n                    baseRadius = Math[this.options.node_images_fill_mode ? \"min\" : \"max\"](maxX - minX, maxY - minY) / 2;\n                    centerPoint = new paper.Point((maxX + minX) / 2, (maxY + minY) / 2);\n                    if (!this.options.show_node_circles) {\n                        this.h_ratio = (maxY - minY) / (2 * baseRadius);\n                    }\n                } else {\n                    baseRadius = Math[this.options.node_images_fill_mode ? \"min\" : \"max\"](width, height) / 2;\n                    centerPoint = new paper.Point(0,0);\n                    if (!this.options.show_node_circles) {\n                        this.h_ratio = height / (2 * baseRadius);\n                    }\n                }\n                var _raster = new paper.Raster(_image);\n                _raster.locked = true; // Disable mouse events on icon\n                if (hasClipPath) {\n                    _raster = new paper.Group(_clip, _raster);\n                    _raster.opacity = 0.99;\n                    /* This is a workaround to allow clipping at group level\n                     * If opacity was set to 1, paper.js would merge all clipping groups in one (known bug).\n                     */\n                    _raster.clipped = true;\n                    _clip.__representation = this;\n                }\n                if (this.options.clip_node_images) {\n                    var _circleClip = this.shapeBuilder.getImageShape(centerPoint, baseRadius);\n                    _raster = new paper.Group(_circleClip, _raster);\n                    _raster.opacity = 0.99;\n                    _raster.clipped = true;\n                    _circleClip.__representation = this;\n                }\n                this.image_delta = centerPoint.divide(baseRadius);\n                this.node_image = _raster;\n                this.node_image.__representation = _this;\n                this.node_image.scale(this.circle_radius / baseRadius);\n                this.node_image.position = this.paper_coords.subtract(this.image_delta.multiply(this.circle_radius));\n                this.node_image.insertAbove(this.circle);\n            } else {\n                var _this = this;\n                $(_image).on(\"load\", function() {\n                    _this.showImage();\n                });\n            }\n        },\n        paperShift: function(_delta) {\n            if (this.options.editor_mode) {\n                if (!this.renkan.read_only) {\n                    this.is_dragging = true;\n                    this.paper_coords = this.paper_coords.add(_delta);\n                    this.redraw();\n                }\n            } else {\n                this.renderer.view.paperShift(_delta);\n            }\n        },\n        openEditor: function() {\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            var _editor = this.renderer.addRepresentation(\"NodeEditor\",null);\n            _editor.source_representation = this;\n            _editor.draw();\n        },\n        select: function() {\n            this.selected = true;\n            this.circle.strokeWidth = this._getSelectedStrokeWidth();\n            if (this.renderer.isEditable() && !this.hidden) {\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n            var _uri = this.model.get(\"uri\");\n            if (_uri) {\n                $('.Rk-Bin-Item').each(function() {\n                    var _el = $(this);\n                    if (_el.attr(\"data-uri\") === _uri) {\n                        _el.addClass(\"selected\");\n                    }\n                });\n            }\n            if (!this.options.editor_mode) {\n                this.openEditor();\n            }\n\n            if (this.renderer.minimap) {\n                this.minimap_circle.strokeWidth = this.options.minimap_highlight_weight;\n                this.minimap_circle.strokeColor = this.options.minimap_highlight_color;\n            }\n            //if the node is hidden and the mouse hover it, it appears as a ghost\n            if (this.hidden) {\n                this.show(true);\n            }\n            else {\n                this.showNeighbors(true);\n            }\n            this._super(\"select\");\n        },\n        hideButtons: function() {\n            this.all_buttons.forEach(function(b) {\n                b.hide();\n            });\n            delete(this.buttonTimeout);\n        },\n        unselect: function(_newTarget) {\n            if (!_newTarget || _newTarget.source_representation !== this) {\n                this.selected = false;\n                var _this = this;\n                this.buttons_timeout = setTimeout(function() { _this.hideButtons(); }, 200);\n                this.circle.strokeWidth = this._getStrokeWidth();\n                $('.Rk-Bin-Item').removeClass(\"selected\");\n                if (this.renderer.minimap) {\n                    this.minimap_circle.strokeColor = undefined;\n                }\n                //when the mouse don't hover the node anymore, we hide it\n                if (this.hidden) {\n                    this.hide();\n                } else {\n                    this.hideNeighbors();\n                }\n                this._super(\"unselect\");\n            }\n        },\n        hide: function(){\n            var _this = this;\n            this.ghost = false;\n            this.hidden = true;\n            if (typeof this.node_image !== 'undefined'){\n                this.node_image.opacity = 0;\n            }\n            this.hideButtons();\n            this.circle.opacity = 0;\n            this.title.css('opacity', 0);\n            this.minimap_circle.opacity = 0;\n\n\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return ((ed.get(\"to\") === _this.model) || (ed.get(\"from\") === _this.model));\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge);\n                        if (repr && typeof repr.from_representation !== \"undefined\" && typeof repr.from_representation.paper_coords !== \"undefined\" && typeof repr.to_representation !== \"undefined\" && typeof repr.to_representation.paper_coords !== \"undefined\") {\n                            repr.hide();\n                        }\n                    }\n            );\n            this.hideNeighbors();\n        },\n        show: function(ghost){\n            var _this = this;\n            this.ghost = ghost;\n            if (this.ghost){\n                if (typeof this.node_image !== 'undefined'){\n                    this.node_image.opacity = this.options.ghost_opacity;\n                }\n                this.circle.opacity = this.options.ghost_opacity;\n                this.title.css('opacity', this.options.ghost_opacity);\n                this.minimap_circle.opacity = this.options.ghost_opacity;\n            } else {\n                this.minimap_circle.opacity = 1; \n                this.hidden = false;\n                this.redraw();\n            }\n\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return ((ed.get(\"to\") === _this.model) || (ed.get(\"from\") === _this.model));\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge);\n                        if (repr && typeof repr.from_representation !== \"undefined\" && typeof repr.from_representation.paper_coords !== \"undefined\" && typeof repr.to_representation !== \"undefined\" && typeof repr.to_representation.paper_coords !== \"undefined\") {\n                            repr.show(_this.ghost);\n                        }\n                    }\n            );\n        },\n        hideNeighbors: function(){\n            var _this = this;\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return (ed.get(\"from\") === _this.model);\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge.get(\"to\"));\n                        if (repr && repr.ghost) {\n                            repr.hide();\n                        }\n                    }\n            );\n        },\n        showNeighbors: function(ghost){\n            var _this = this;\n            _.each(\n                    this.project.get(\"edges\").filter(\n                            function (ed) {\n                                return (ed.get(\"from\") === _this.model);\n                            }\n                    ),\n                    function(edge, index, list) {\n                        var repr = _this.renderer.getRepresentationByModel(edge.get(\"to\"));\n                        if (repr && repr.hidden) {\n                            repr.show(ghost);\n                            if (!ghost){\n                                var indexNode = _this.renderer.view.hiddenNodes.indexOf(repr.model.id);\n                                if (indexNode !== -1){\n                                    _this.renderer.view.hiddenNodes.splice(indexNode, 1);\n                                }\n                            }\n                        }\n                    }\n            );\n        },\n        highlight: function(textToReplace) {\n            var hlvalue = textToReplace || true;\n            if (this.highlighted === hlvalue) {\n                return;\n            }\n            this.highlighted = hlvalue;\n            this.redraw();\n            this.renderer.throttledPaperDraw();\n        },\n        unhighlight: function() {\n            if (!this.highlighted) {\n                return;\n            }\n            this.highlighted = false;\n            this.redraw();\n            this.renderer.throttledPaperDraw();\n        },\n        saveCoords: function() {\n            var _coords = this.renderer.toModelCoords(this.paper_coords),\n            _data = {\n                position: {\n                    x: _coords.x,\n                    y: _coords.y\n                }\n            };\n            if (this.renderer.isEditable()) {\n                this.model.set(_data);\n            }\n        },\n        mousedown: function(_event, _isTouch) {\n            if (_isTouch) {\n                this.renderer.unselectAll();\n                this.select();\n            }\n        },\n        mouseup: function(_event, _isTouch) {\n            if (this.renderer.is_dragging && this.renderer.isEditable()) {\n                this.saveCoords();\n            } else {\n                if (this.hidden) {\n                    var index = this.renderer.view.hiddenNodes.indexOf(this.model.id);\n                    if (index !== -1){\n                        this.renderer.view.hiddenNodes.splice(index, 1);\n                    }\n                    this.show(false);\n                    this.select();\n                } else {\n                    if (!_isTouch && !this.model.get(\"delete_scheduled\")) {\n                        this.openEditor();\n                    }\n                    this.model.trigger(\"clicked\");\n                }\n            }\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.is_dragging = false;\n        },\n        destroy: function(_event) {\n            this._super(\"destroy\");\n            this.all_buttons.forEach(function(b) {\n                b.destroy();\n            });\n            this.circle.remove();\n            this.title.remove();\n            if (this.renderer.minimap) {\n                this.minimap_circle.remove();\n            }\n            if (this.node_image) {\n                this.node_image.remove();\n            }\n        }\n    }).value();\n\n    return NodeRepr;\n\n});\n\n\ndefine('renderer/edge',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* Edge Class Begin */\n\n    //var Edge = Renderer.Edge = Utils.inherit(Renderer._BaseRepresentation);\n    var Edge = Utils.inherit(BaseRepresentation);\n\n    _(Edge.prototype).extend({\n        _init: function() {\n            this.renderer.edge_layer.activate();\n            this.type = \"Edge\";\n            this.hidden = false;\n            this.ghost = false;\n            this.from_representation = this.renderer.getRepresentationByModel(this.model.get(\"from\"));\n            this.to_representation = this.renderer.getRepresentationByModel(this.model.get(\"to\"));\n            this.bundle = this.renderer.addToBundles(this);\n            this.line = new paper.Path();\n            this.line.add([0,0],[0,0],[0,0]);\n            this.line.__representation = this;\n            this.line.strokeWidth = this.options.edge_stroke_width;\n            this.arrow_scale = 1;\n            this.arrow = new paper.Path();\n            this.arrow.add(\n                    [ 0, 0 ],\n                    [ this.options.edge_arrow_length, this.options.edge_arrow_width / 2 ],\n                    [ 0, this.options.edge_arrow_width ]\n            );\n            this.arrow.pivot = new paper.Point([ this.options.edge_arrow_length / 2, this.options.edge_arrow_width / 2 ]);\n            this.arrow.__representation = this;\n            this.text = $('<div class=\"Rk-Label Rk-Edge-Label\">').appendTo(this.renderer.labels_$);\n            this.arrow_angle = 0;\n            if (this.options.editor_mode) {\n                var Renderer = requtils.getRenderer();\n                this.normal_buttons = [\n                                       new Renderer.EdgeEditButton(this.renderer, null),\n                                       new Renderer.EdgeRemoveButton(this.renderer, null)\n                                       ];\n                this.pending_delete_buttons = [\n                                               new Renderer.EdgeRevertButton(this.renderer, null)\n                                               ];\n                this.all_buttons = this.normal_buttons.concat(this.pending_delete_buttons);\n                for (var i = 0; i < this.all_buttons.length; i++) {\n                    this.all_buttons[i].source_representation = this;\n                }\n                this.active_buttons = [];\n            } else {\n                this.active_buttons = this.all_buttons = [];\n            }\n\n            if (this.renderer.minimap) {\n                this.renderer.minimap.edge_layer.activate();\n                this.minimap_line = new paper.Path();\n                this.minimap_line.add([0,0],[0,0]);\n                this.minimap_line.__representation = this.renderer.minimap.miniframe.__representation;\n                this.minimap_line.strokeWidth = 1;\n            }\n        },\n        _getStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.edge_stroke_width + (thickness-1) * (this.options.edge_stroke_max_width - this.options.edge_stroke_width) / (this.options.edge_stroke_witdh_scale-1);\n        },\n        _getSelectedStrokeWidth: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return this.options.selected_edge_stroke_width + (thickness-1) * (this.options.selected_edge_stroke_max_width - this.options.selected_edge_stroke_width) / (this.options.edge_stroke_witdh_scale-1);\n        },\n        _getArrowScale: function() {\n            var thickness = (this.model.has('style') && this.model.get('style').thickness) || 1;\n            return 1 + (thickness-1) * ((this.options.edge_arrow_max_width / this.options.edge_arrow_width) - 1) / (this.options.edge_stroke_witdh_scale-1);\n        },\n        redraw: function() {\n            var from = this.model.get(\"from\"),\n            to = this.model.get(\"to\");\n            if (!from || !to || (this.hidden && !this.ghost)) {\n                return;\n            }\n            this.from_representation = this.renderer.getRepresentationByModel(from);\n            this.to_representation = this.renderer.getRepresentationByModel(to);\n            if (typeof this.from_representation === \"undefined\" || typeof this.to_representation === \"undefined\" ||\n                    (this.from_representation.hidden && !this.from_representation.ghost) ||\n                    (this.to_representation.hidden && !this.to_representation.ghost)) {\n                this.hide();\n                return;\n            }\n            var _strokeWidth = this._getStrokeWidth(),\n                _arrow_scale = this._getArrowScale(),\n                _p0a = this.from_representation.paper_coords,\n                _p1a = this.to_representation.paper_coords,\n                _v = _p1a.subtract(_p0a),\n                _r = _v.length,\n                _u = _v.divide(_r),\n                _ortho = new paper.Point([- _u.y, _u.x]),\n                _group_pos = this.bundle.getPosition(this),\n                _delta = _ortho.multiply( this.options.edge_gap_in_bundles * _group_pos ),\n                _p0b = _p0a.add(_delta), /* Adding a 4 px difference */\n                _p1b = _p1a.add(_delta), /* to differentiate bundled links */\n                _a = _v.angle,\n                _textdelta = _ortho.multiply(this.options.edge_label_distance + 0.5 * _arrow_scale * this.options.edge_arrow_width),\n                _handle = _v.divide(3),\n                _color = (this.model.has(\"style\") && this.model.get(\"style\").color) || (this.model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                _dash = (this.model.has(\"style\") && this.model.get(\"style\").dash) ? this.options.default_dash_array : null,\n                _opacity;\n\n            if (this.model.get(\"delete_scheduled\") || this.from_representation.model.get(\"delete_scheduled\") || this.to_representation.model.get(\"delete_scheduled\")) {\n                _opacity = 0.5;\n                this.line.dashArray = [2, 2];\n            } else {\n                _opacity = this.ghost ? this.options.ghost_opacity : 1;\n                this.line.dashArray = null;\n            }\n\n            var old_act_btn = this.active_buttons;\n\n            this.arrow.visible =\n                (this.model.has(\"style\") && this.model.get(\"style\").arrow) ||\n                !this.model.has(\"style\") ||\n                typeof this.model.get(\"style\").arrow === 'undefined';\n\n            this.active_buttons = this.model.get(\"delete_scheduled\") ? this.pending_delete_buttons : this.normal_buttons;\n\n            if (this.selected && this.renderer.isEditable() && old_act_btn !== this.active_buttons) {\n                old_act_btn.forEach(function(b) {\n                    b.hide();\n                });\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n\n            this.paper_coords = _p0b.add(_p1b).divide(2);\n            this.line.strokeWidth = _strokeWidth;\n            this.line.strokeColor = _color;\n            this.line.dashArray = _dash;\n            this.line.opacity = _opacity;\n            this.line.segments[0].point = _p0a;\n            this.line.segments[1].point = this.paper_coords;\n            this.line.segments[1].handleIn = _handle.multiply(-1);\n            this.line.segments[1].handleOut = _handle;\n            this.line.segments[2].point = _p1a;\n            this.arrow.scale(_arrow_scale / this.arrow_scale);\n            this.arrow_scale = _arrow_scale;\n            this.arrow.fillColor = _color;\n            this.arrow.opacity = _opacity;\n            this.arrow.rotate(_a - this.arrow_angle, this.arrow.bounds.center);\n            this.arrow.position = this.paper_coords;\n\n            this.arrow_angle = _a;\n            if (_a > 90) {\n                _a -= 180;\n                _textdelta = _textdelta.multiply(-1);\n            }\n            if (_a < -90) {\n                _a += 180;\n                _textdelta = _textdelta.multiply(-1);\n            }\n            var _text = this.model.get(\"title\") || this.renkan.translate(this.options.label_untitled_edges) || \"\";\n            _text = Utils.shortenText(_text, this.options.node_label_max_length);\n            this.text.text(_text);\n            var _textpos = this.paper_coords.add(_textdelta);\n            this.text.css({\n                left: _textpos.x,\n                top: _textpos.y,\n                transform: \"rotate(\" + _a + \"deg)\",\n                \"-moz-transform\": \"rotate(\" + _a + \"deg)\",\n                \"-webkit-transform\": \"rotate(\" + _a + \"deg)\",\n                opacity: _opacity\n            });\n            this.text_angle = _a;\n\n            var _pc = this.paper_coords;\n            this.all_buttons.forEach(function(b) {\n                b.moveTo(_pc);\n            });\n\n            if (this.renderer.minimap) {\n                this.minimap_line.strokeColor = _color;\n                this.minimap_line.segments[0].point = this.renderer.toMinimapCoords(new paper.Point(this.from_representation.model.get(\"position\")));\n                this.minimap_line.segments[1].point = this.renderer.toMinimapCoords(new paper.Point(this.to_representation.model.get(\"position\")));\n            }\n        },\n        hide: function(){\n            this.hidden = true;\n            this.ghost = false;\n\n            this.text.hide();\n            this.line.visible = false;\n            this.arrow.visible = false;\n            this.minimap_line.visible = false;\n        },\n        show: function(ghost){\n            this.ghost = ghost;\n            if (this.ghost) {\n                this.text.css('opacity', 0.3);\n                this.line.opacity = 0.3;\n                this.arrow.opacity = 0.3;\n                this.minimap_line.opacity = 0.3;\n            } else {\n                this.hidden = false;\n\n                this.text.css('opacity', 1);\n                this.line.opacity = 1;\n                this.arrow.opacity = 1;\n                this.minimap_line.opacity = 1;\n            }\n            this.text.show();\n            this.line.visible = true;\n            this.arrow.visible = true;\n            this.minimap_line.visible = true;\n            this.redraw();\n        },\n        openEditor: function() {\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            var _editor = this.renderer.addRepresentation(\"EdgeEditor\",null);\n            _editor.source_representation = this;\n            _editor.draw();\n        },\n        select: function() {\n            this.selected = true;\n            this.line.strokeWidth = this._getSelectedStrokeWidth();\n            if (this.renderer.isEditable()) {\n                this.active_buttons.forEach(function(b) {\n                    b.show();\n                });\n            }\n            if (!this.options.editor_mode) {\n                this.openEditor();\n            }\n            this._super(\"select\");\n        },\n        unselect: function(_newTarget) {\n            if (!_newTarget || _newTarget.source_representation !== this) {\n                this.selected = false;\n                if (this.options.editor_mode) {\n                    this.all_buttons.forEach(function(b) {\n                        b.hide();\n                    });\n                }\n                this.line.strokeWidth = this._getStrokeWidth();\n                this._super(\"unselect\");\n            }\n        },\n        mousedown: function(_event, _isTouch) {\n            if (_isTouch) {\n                this.renderer.unselectAll();\n                this.select();\n            }\n        },\n        mouseup: function(_event, _isTouch) {\n            if (!this.renkan.read_only && this.renderer.is_dragging) {\n                this.from_representation.saveCoords();\n                this.to_representation.saveCoords();\n                this.from_representation.is_dragging = false;\n                this.to_representation.is_dragging = false;\n            } else {\n                if (!_isTouch) {\n                    this.openEditor();\n                }\n                this.model.trigger(\"clicked\");\n            }\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n        },\n        paperShift: function(_delta) {\n            if (this.options.editor_mode) {\n                if (!this.options.read_only) {\n                    this.from_representation.paperShift(_delta);\n                    this.to_representation.paperShift(_delta);\n                }\n            } else {\n                this.renderer.paperShift(_delta);\n            }\n        },\n        destroy: function() {\n            this._super(\"destroy\");\n            this.line.remove();\n            this.arrow.remove();\n            this.text.remove();\n            if (this.renderer.minimap) {\n                this.minimap_line.remove();\n            }\n            this.all_buttons.forEach(function(b) {\n                b.destroy();\n            });\n            var _this = this;\n            this.bundle.edges = _.reject(this.bundle.edges, function(_edge) {\n                return _this === _edge;\n            });\n        }\n    }).value();\n\n    return Edge;\n\n});\n\n\n\ndefine('renderer/tempedge',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* TempEdge Class Begin */\n\n    //var TempEdge = Renderer.TempEdge = Utils.inherit(Renderer._BaseRepresentation);\n    var TempEdge = Utils.inherit(BaseRepresentation);\n\n    _(TempEdge.prototype).extend({\n        _init: function() {\n            this.renderer.edge_layer.activate();\n            this.type = \"Temp-edge\";\n\n            var _color = (this.project.get(\"users\").get(this.renkan.current_user) || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\");\n            this.line = new paper.Path();\n            this.line.strokeColor = _color;\n            this.line.dashArray = [4, 2];\n            this.line.strokeWidth = this.options.selected_edge_stroke_width;\n            this.line.add([0,0],[0,0]);\n            this.line.__representation = this;\n            this.arrow = new paper.Path();\n            this.arrow.fillColor = _color;\n            this.arrow.add(\n                    [ 0, 0 ],\n                    [ this.options.edge_arrow_length, this.options.edge_arrow_width / 2 ],\n                    [ 0, this.options.edge_arrow_width ]\n            );\n            this.arrow.__representation = this;\n            this.arrow_angle = 0;\n        },\n        redraw: function() {\n            var _p0 = this.from_representation.paper_coords,\n            _p1 = this.end_pos,\n            _a = _p1.subtract(_p0).angle,\n            _c = _p0.add(_p1).divide(2);\n            this.line.segments[0].point = _p0;\n            this.line.segments[1].point = _p1;\n            this.arrow.rotate(_a - this.arrow_angle);\n            this.arrow.position = _c;\n            this.arrow_angle = _a;\n        },\n        paperShift: function(_delta) {\n            if (!this.renderer.isEditable()) {\n                this.renderer.removeRepresentation(_this);\n                paper.view.draw();\n                return;\n            }\n            this.end_pos = this.end_pos.add(_delta);\n            var _hitResult = paper.project.hitTest(this.end_pos);\n            this.renderer.findTarget(_hitResult);\n            this.redraw();\n        },\n        mouseup: function(_event, _isTouch) {\n            var _hitResult = paper.project.hitTest(_event.point),\n            _model = this.from_representation.model,\n            _endDrag = true;\n            if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                var _target = _hitResult.item.__representation;\n                if (_target.type.substr(0,4) === \"Node\") {\n                    var _destmodel = _target.model || _target.source_representation.model;\n                    if (_model !== _destmodel) {\n                        var _data = {\n                                id: Utils.getUID('edge'),\n                                created_by: this.renkan.current_user,\n                                from: _model,\n                                to: _destmodel\n                        };\n                        if (this.renderer.isEditable()) {\n                            this.project.addEdge(_data);\n                        }\n                    }\n                }\n\n                if (_model === _target.model || (_target.source_representation && _target.source_representation.model === _model)) {\n                    _endDrag = false;\n                    this.renderer.is_dragging = true;\n                }\n            }\n            if (_endDrag) {\n                this.renderer.click_target = null;\n                this.renderer.is_dragging = false;\n                this.renderer.removeRepresentation(this);\n                paper.view.draw();\n            }\n        },\n        destroy: function() {\n            this.arrow.remove();\n            this.line.remove();\n        }\n    }).value();\n\n    /* TempEdge Class End */\n\n    return TempEdge;\n\n});\n\n\ndefine('renderer/baseeditor',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* _BaseEditor Begin */\n    //var _BaseEditor = Renderer._BaseEditor = Utils.inherit(Renderer._BaseRepresentation);\n    var _BaseEditor = Utils.inherit(BaseRepresentation);\n\n    _(_BaseEditor.prototype).extend({\n        _init: function() {\n            this.renderer.buttons_layer.activate();\n            this.type = \"editor\";\n            this.editor_block = new paper.Path();\n            var _pts = _.map(_.range(8), function() {return [0,0];});\n            this.editor_block.add.apply(this.editor_block, _pts);\n            this.editor_block.strokeWidth = this.options.tooltip_border_width;\n            this.editor_block.strokeColor = this.options.tooltip_border_color;\n            this.editor_block.opacity = this.options.tooltip_opacity;\n            this.editor_$ = $('<div>')\n                .appendTo(this.renderer.editor_$)\n                .css({\n                    position: \"absolute\",\n                    opacity: this.options.tooltip_opacity\n                })\n                .hide();\n        },\n        destroy: function() {\n            this.editor_block.remove();\n            this.editor_$.remove();\n        }\n    }).value();\n\n    /* _BaseEditor End */\n\n    return _BaseEditor;\n\n});\n\n\ndefine('renderer/nodeeditor',['jquery', 'underscore', 'requtils', 'renderer/baseeditor', 'renderer/shapebuilder', 'ckeditor-jquery'], function ($, _, requtils, BaseEditor, ShapeBuilder) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeEditor Begin */\n    //var NodeEditor = Renderer.NodeEditor = Utils.inherit(Renderer._BaseEditor);\n    var NodeEditor = Utils.inherit(BaseEditor);\n\n    _(NodeEditor.prototype).extend({\n        _init: function() {\n            BaseEditor.prototype._init.apply(this);\n            this.template = this.options.templates['templates/nodeeditor.html'];\n            //this.templates['default']= this.options.templates['templates/nodeeditor.html'];\n            //fusionner avec this.options.node_editor_templates\n            this.readOnlyTemplate = this.options.node_editor_templates;\n        },\n        draw: function() {\n            var _model = this.source_representation.model,\n            _created_by = _model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan),\n            _template = (this.renderer.isEditable() ? this.template : this.readOnlyTemplate[_model.get(\"type\")] || this.readOnlyTemplate[\"default\"]),\n            _image_placeholder = this.options.static_url + \"img/image-placeholder.png\",\n            _size = (_model.get(\"size\") || 0);\n            this.editor_$\n            .html(_template({\n                node: {\n                    _id: _model.get(\"_id\"),\n                    has_creator: !!_model.get(\"created_by\"),\n                    title: _model.get(\"title\"),\n                    uri: _model.get(\"uri\"),\n                    type: _model.get(\"type\") || \"default\",\n                    short_uri:  Utils.shortenText((_model.get(\"uri\") || \"\").replace(/^(https?:\\/\\/)?(www\\.)?/,'').replace(/\\/$/,''),40),\n                    description: _model.get(\"description\"),\n                    image: _model.get(\"image\") || \"\",\n                    image_placeholder: _image_placeholder,\n                    color: (_model.has(\"style\") && _model.get(\"style\").color) || _created_by.get(\"color\"),\n                    thickness: (_model.has(\"style\") && _model.get(\"style\").thickness) || 1,\n                    dash: _model.has(\"style\") && _model.get(\"style\").dash ? \"checked\" : \"\",\n                    clip_path: _model.get(\"clip_path\") || false,\n                    created_by_color: _created_by.get(\"color\"),\n                    created_by_title: _created_by.get(\"title\"),\n                    size: (_size > 0 ? \"+\" : \"\") + _size,\n                    shape: _model.get(\"shape\") || \"circle\"\n                },\n                renkan: this.renkan,\n                options: this.options,\n                shortenText: Utils.shortenText,\n                shapes : _(ShapeBuilder.builders).omit('svg').keys().value(),\n                types : _(this.options.node_editor_templates).keys().value(),\n            }));\n            this.redraw();\n            var _this = this,\n                editorInstance = _this.options.show_node_editor_description_richtext ?\n                    $(\".Rk-Edit-Description\").ckeditor(_this.options.richtext_editor_config) :\n                    false,\n                editorInstanceTitle = _this.options.show_node_editor_title_richtext ?\n                    $(\".Rk-Edit-Title\").ckeditor(_this.options.richtext_editor_config) :\n                    false,\n                closeEditor = function() {\n                    _this.renderer.removeRepresentation(_this);\n                    paper.view.draw();\n                };\n\n            _this.cleanEditor = function() {\n                _this.editor_$.off(\"keyup\");\n                _this.editor_$.find(\"input, textarea, select\").off(\"change keyup paste\");\n                _this.editor_$.find(\".Rk-Edit-Image-File\").off('change');\n                _this.editor_$.find(\".Rk-Edit-ColorPicker-Wrapper\").off('hover');\n                _this.editor_$.find(\".Rk-Edit-Size-Btn\").off('click');\n                _this.editor_$.find(\".Rk-Edit-Image-Del\").off('click');\n                _this.editor_$.find(\".Rk-Edit-ColorPicker\").find(\"li\").off('hover click');\n                _this.editor_$.find(\".Rk-CloseX\").off('click');\n                _this.editor_$.find(\".Rk-Edit-Goto\").off('click');\n\n                if(_this.options.show_node_editor_description_richtext) {\n                    if(typeof editorInstance.editor !== 'undefined') {\n                        var _editor = editorInstance.editor;\n                        delete editorInstance.editor;\n                        _editor.focusManager.blur(true);\n                        _editor.destroy();\n                    }\n                }\n                if(_this.options.show_node_editor_title_richtext) {\n                    if(typeof editorInstanceTitle.editor !== 'undefined') {\n                        var _editor_title = editorInstanceTitle.editor;\n                        delete editorInstanceTitle.editor;\n                        _editor_title.focusManager.blur(true);\n                        _editor_title.destroy();\n                    }\n                }\n            };\n\n            this.editor_$.find(\".Rk-CloseX\").click(function (e) {\n                e.preventDefault();\n                closeEditor();\n            });\n\n            this.editor_$.find(\".Rk-Edit-Goto\").click(function() {\n                if (!_model.get(\"uri\")) {\n                    return false;\n                }\n            });\n\n            if (this.renderer.isEditable()) {\n\n                var onFieldChange = _.throttle(function() {\n                  _.defer(function() {\n                    if (_this.renderer.isEditable()) {\n                        var _data = {};\n                        if (_this.options.show_node_editor_uri) {\n                            _data.uri = _this.editor_$.find(\".Rk-Edit-URI\").val();\n                            _this.editor_$.find(\".Rk-Edit-Goto\").attr(\"href\",_data.uri || \"#\");\n                        }\n                        if (_this.options.show_node_editor_image) {\n                            _data.image = _this.editor_$.find(\".Rk-Edit-Image\").val();\n                            _this.editor_$.find(\".Rk-Edit-ImgPreview\").attr(\"src\", _data.image || _image_placeholder);\n                        }\n                        if (_this.options.show_node_editor_description) {\n                            if(_this.options.show_node_editor_description_richtext) {\n                                if(typeof editorInstance.editor !== 'undefined' &&\n                                    editorInstance.editor.checkDirty()) {\n                                    _data.description = editorInstance.editor.getData();\n                                    editorInstance.editor.resetDirty();\n                                }\n                            }\n                            else {\n                                _data.description = _this.editor_$.find(\".Rk-Edit-Description\").val();\n                            }\n                        }\n                        if (_this.options.show_node_editor_title) {\n                            if(_this.options.show_node_editor_title_richtext) {\n                                if(typeof editorInstanceTitle.editor !== 'undefined' &&\n                                        editorInstanceTitle.editor.checkDirty()) {\n                                    _data.title = editorInstanceTitle.editor.getData();\n                                    editorInstanceTitle.editor.resetDirty();\n                                }\n                            }\n                            else {\n                                _data.title = _this.editor_$.find(\".Rk-Edit-Title\").val();\n                            }\n                        }\n                        if (_this.options.show_node_editor_style) {\n                            var dash = _this.editor_$.find(\".Rk-Edit-Dash\").is(':checked');\n                            _data.style = _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {dash: dash});\n                        }\n                        if (_this.options.change_shapes) {\n                            if(_model.get(\"shape\")!==_this.editor_$.find(\".Rk-Edit-Shape\").val()){\n                                _data.shape = _this.editor_$.find(\".Rk-Edit-Shape\").val();\n                            }\n                        }\n                        if (_this.options.change_types) {\n                            if(_model.get(\"type\")!==_this.editor_$.find(\".Rk-Edit-Type\").val()){\n                                _data.type = _this.editor_$.find(\".Rk-Edit-Type\").val();\n                            }\n                        }\n                        _model.set(_data);\n                        _this.redraw();\n                    } else {\n                        closeEditor();\n                    }\n                  });\n                }, 1000);\n\n                this.editor_$.on(\"keyup\", function(_e) {\n                    if (_e.keyCode === 27) {\n                        closeEditor();\n                    }\n                });\n\n                this.editor_$.find(\"input, textarea, select\").on(\"change keyup paste\", onFieldChange);\n                if( _this.options.show_node_editor_description &&\n                    _this.options.show_node_editor_description_richtext &&\n                    typeof editorInstance.editor !== 'undefined')\n                {\n                    editorInstance.editor.on(\"change\", onFieldChange);\n                    editorInstance.editor.on(\"blur\", onFieldChange);\n                }\n                \n                if( _this.options.show_node_editor_title &&\n                    _this.options.show_node_editor_title_richtext &&\n                    typeof editorInstanceTitle.editor !== 'undefined')\n                {\n                    editorInstanceTitle.editor.on(\"change\", onFieldChange);\n                    editorInstanceTitle.editor.on(\"blur\", onFieldChange);\n                }\n\n                if(_this.options.allow_image_upload) {\n                    this.editor_$.find(\".Rk-Edit-Image-File\").change(function() {\n                        if (this.files.length) {\n                            var f = this.files[0],\n                            fr = new FileReader();\n                            if (f.type.substr(0,5) !== \"image\") {\n                                alert(_this.renkan.translate(\"This file is not an image\"));\n                                return;\n                            }\n                            if (f.size > (_this.options.uploaded_image_max_kb * 1024)) {\n                                alert(_this.renkan.translate(\"Image size must be under \") + _this.options.uploaded_image_max_kb + _this.renkan.translate(\"KB\"));\n                                return;\n                            }\n                            fr.onload = function(e) {\n                                _this.editor_$.find(\".Rk-Edit-Image\").val(e.target.result);\n                                onFieldChange();\n                            };\n                            fr.readAsDataURL(f);\n                        }\n                    });\n                }\n                this.editor_$.find(\".Rk-Edit-Title\")[0].focus();\n\n                var _picker = _this.editor_$.find(\".Rk-Edit-ColorPicker\");\n\n                this.editor_$.find(\".Rk-Edit-ColorPicker-Wrapper\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.show();\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.hide();\n                        }\n                );\n\n                _picker.find(\"li\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", $(this).attr(\"data-color\"));\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", (_model.has(\"style\") && _model.get(\"style\").color) || (_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(_this.renkan)).get(\"color\"));\n                        }\n                ).click(function(_e) {\n                    _e.preventDefault();\n                    if (_this.renderer.isEditable()) {\n                        _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {color: $(this).attr(\"data-color\")}));\n                        _picker.hide();\n                        paper.view.draw();\n                    } else {\n                        closeEditor();\n                    }\n                });\n\n                var shiftSize = function(n) {\n                    if (_this.renderer.isEditable()) {\n                        var _newsize = n+(_model.get(\"size\") || 0);\n                        _this.editor_$.find(\"#Rk-Edit-Size-Value\").text((_newsize > 0 ? \"+\" : \"\") + _newsize);\n                        _model.set(\"size\", _newsize);\n                        paper.view.draw();\n                    } else {\n                        closeEditor();\n                    }\n                };\n\n                this.editor_$.find(\"#Rk-Edit-Size-Down\").click(function() {\n                    shiftSize(-1);\n                    return false;\n                });\n                this.editor_$.find(\"#Rk-Edit-Size-Up\").click(function() {\n                    shiftSize(1);\n                    return false;\n                });\n\n                var shiftThickness = function(n) {\n                    if (_this.renderer.isEditable()) {\n                        var _oldThickness = ((_model.has('style') && _model.get('style').thickness) || 1),\n                            _newThickness = n + _oldThickness;\n                        if(_newThickness < 1 ) {\n                            _newThickness = 1;\n                        }\n                        else if (_newThickness > _this.options.node_stroke_witdh_scale) {\n                            _newThickness = _this.options.node_stroke_witdh_scale;\n                        }\n                        if (_newThickness !== _oldThickness) {\n                            _this.editor_$.find(\"#Rk-Edit-Thickness-Value\").text(_newThickness);\n                            _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {thickness: _newThickness}));\n                            paper.view.draw();\n                        }\n                    }\n                    else {\n                        closeEditor();\n                    }\n                };\n\n                this.editor_$.find(\"#Rk-Edit-Thickness-Down\").click(function() {\n                    shiftThickness(-1);\n                    return false;\n                });\n                this.editor_$.find(\"#Rk-Edit-Thickness-Up\").click(function() {\n                    shiftThickness(1);\n                    return false;\n                });\n\n                this.editor_$.find(\".Rk-Edit-Image-Del\").click(function() {\n                    _this.editor_$.find(\".Rk-Edit-Image\").val('');\n                    onFieldChange();\n                    return false;\n                });\n            } else {\n                if (typeof this.source_representation.highlighted === \"object\") {\n                    var titlehtml = this.source_representation.highlighted.replace(_(_model.get(\"title\")).escape(),'<span class=\"Rk-Highlighted\">$1</span>');\n                    this.editor_$.find(\".Rk-Display-Title\" + (_model.get(\"uri\") ? \" a\" : \"\")).html(titlehtml);\n                    if (this.options.show_node_tooltip_description) {\n                        this.editor_$.find(\".Rk-Display-Description\").html(this.source_representation.highlighted.replace(_(_model.get(\"description\")).escape(),'<span class=\"Rk-Highlighted\">$1</span>'));\n                    }\n                }\n            }\n            this.editor_$.find(\"img\").load(function() {\n                _this.redraw();\n            });\n        },\n        redraw: function() {\n            if (this.options.popup_editor){\n                var _coords = this.source_representation.paper_coords;\n                Utils.drawEditBox(this.options, _coords, this.editor_block, this.source_representation.circle_radius * 0.75, this.editor_$);\n            }\n            this.editor_$.show();\n            paper.view.draw();\n        },\n        destroy: function() {\n            if(typeof this.cleanEditor !== 'undefined') {\n                this.cleanEditor();\n            }\n            this.editor_block.remove();\n            this.editor_$.remove();\n        }\n    }).value();\n\n    /* NodeEditor End */\n\n    return NodeEditor;\n\n});\n\n\ndefine('renderer/edgeeditor',['jquery', 'underscore', 'requtils', 'renderer/baseeditor'], function ($, _, requtils, BaseEditor) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* EdgeEditor Begin */\n\n    //var EdgeEditor = Renderer.EdgeEditor = Utils.inherit(Renderer._BaseEditor);\n    var EdgeEditor = Utils.inherit(BaseEditor);\n\n    _(EdgeEditor.prototype).extend({\n        _init: function() {\n          BaseEditor.prototype._init.apply(this);\n          this.template = this.options.templates['templates/edgeeditor.html'];\n          this.readOnlyTemplate = this.options.templates['templates/edgeeditor_readonly.html'];\n        },\n        draw: function() {\n            var _model = this.source_representation.model,\n            _from_model = _model.get(\"from\"),\n            _to_model = _model.get(\"to\"),\n            _created_by = _model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan),\n            _template = (this.renderer.isEditable() ? this.template : this.readOnlyTemplate);\n            this.editor_$\n              .html(_template({\n                edge: {\n                    has_creator: !!_model.get(\"created_by\"),\n                    title: _model.get(\"title\"),\n                    uri: _model.get(\"uri\"),\n                    short_uri:  Utils.shortenText((_model.get(\"uri\") || \"\").replace(/^(https?:\\/\\/)?(www\\.)?/,'').replace(/\\/$/,''),40),\n                    description: _model.get(\"description\"),\n                    color: (_model.has(\"style\") && _model.get(\"style\").color) || _created_by.get(\"color\"),\n                    dash: _model.has(\"style\") && _model.get(\"style\").dash ? \"checked\" : \"\",\n                    arrow: (_model.has(\"style\") && _model.get(\"style\").arrow) || !_model.has(\"style\") || (typeof _model.get(\"style\").arrow === 'undefined') ? \"checked\" : \"\",\n                    thickness: (_model.has(\"style\") && _model.get(\"style\").thickness) || 1,\n                    from_title: _from_model.get(\"title\"),\n                    to_title: _to_model.get(\"title\"),\n                    from_color: (_from_model.has(\"style\") && _from_model.get(\"style\").color) || (_from_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                    to_color: (_to_model.has(\"style\") && _to_model.get(\"style\").color) || (_to_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(this.renkan)).get(\"color\"),\n                    created_by_color: _created_by.get(\"color\"),\n                    created_by_title: _created_by.get(\"title\")\n                },\n                renkan: this.renkan,\n                shortenText: Utils.shortenText,\n                options: this.options\n            }));\n            this.redraw();\n            var _this = this,\n            closeEditor = function() {\n                _this.renderer.removeRepresentation(_this);\n                _this.editor_$.find(\".Rk-Edit-Size-Btn\").off('click');\n                paper.view.draw();\n            };\n            this.editor_$.find(\".Rk-CloseX\").click(closeEditor);\n            this.editor_$.find(\".Rk-Edit-Goto\").click(function() {\n                if (!_model.get(\"uri\")) {\n                    return false;\n                }\n            });\n\n            if (this.renderer.isEditable()) {\n\n                var onFieldChange = _.throttle(function() {\n                    _.defer(function() {\n                        if (_this.renderer.isEditable()) {\n                            var _data = {\n                                title: _this.editor_$.find(\".Rk-Edit-Title\").val()\n                            };\n                            if (_this.options.show_edge_editor_uri) {\n                                _data.uri = _this.editor_$.find(\".Rk-Edit-URI\").val();\n                            }\n                            if (_this.options.show_node_editor_style) {\n                                var dash = _this.editor_$.find(\".Rk-Edit-Dash\").is(':checked'),\n                                    arrow = _this.editor_$.find(\".Rk-Edit-Arrow\").is(':checked');\n                                _data.style = _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {dash: dash, arrow: arrow});\n                            }\n                            _this.editor_$.find(\".Rk-Edit-Goto\").attr(\"href\",_data.uri || \"#\");\n                            _model.set(_data);\n                            paper.view.draw();\n                        } else {\n                            closeEditor();\n                        }\n                    });\n                },500);\n\n                this.editor_$.on(\"keyup\", function(_e) {\n                    if (_e.keyCode === 27) {\n                        closeEditor();\n                    }\n                });\n\n                this.editor_$.find(\"input\").on(\"keyup change paste\", onFieldChange);\n\n                this.editor_$.find(\".Rk-Edit-Vocabulary\").change(function() {\n                    var e = $(this),\n                    v = e.val();\n                    if (v) {\n                        _this.editor_$.find(\".Rk-Edit-Title\").val(e.find(\":selected\").text());\n                        _this.editor_$.find(\".Rk-Edit-URI\").val(v);\n                        onFieldChange();\n                    }\n                });\n                this.editor_$.find(\".Rk-Edit-Direction\").click(function() {\n                    if (_this.renderer.isEditable()) {\n                        _model.set({\n                            from: _model.get(\"to\"),\n                            to: _model.get(\"from\")\n                        });\n                        _this.draw();\n                    } else {\n                        closeEditor();\n                    }\n                });\n\n                var _picker = _this.editor_$.find(\".Rk-Edit-ColorPicker\");\n\n                this.editor_$.find(\".Rk-Edit-ColorPicker-Wrapper\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.show();\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _picker.hide();\n                        }\n                );\n\n                _picker.find(\"li\").hover(\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", $(this).attr(\"data-color\"));\n                        },\n                        function(_e) {\n                            _e.preventDefault();\n                            _this.editor_$.find(\".Rk-Edit-Color\").css(\"background\", (_model.has(\"style\") && _model.get(\"style\").color)|| (_model.get(\"created_by\") || Utils._USER_PLACEHOLDER(_this.renkan)).get(\"color\"));\n                        }\n                ).click(function(_e) {\n                    _e.preventDefault();\n                    if (_this.renderer.isEditable()) {\n                        _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {color: $(this).attr(\"data-color\")}));\n                        _picker.hide();\n                        paper.view.draw();\n                    } else {\n                        closeEditor();\n                    }\n                });\n                var shiftThickness = function(n) {\n                    if (_this.renderer.isEditable()) {\n                        var _oldThickness = ((_model.has('style') && _model.get('style').thickness) || 1),\n                            _newThickness = n + _oldThickness;\n                        if(_newThickness < 1 ) {\n                            _newThickness = 1;\n                        }\n                        else if (_newThickness > _this.options.node_stroke_witdh_scale) {\n                            _newThickness = _this.options.node_stroke_witdh_scale;\n                        }\n                        if (_newThickness !== _oldThickness) {\n                            _this.editor_$.find(\"#Rk-Edit-Thickness-Value\").text(_newThickness);\n                            _model.set(\"style\", _.assign( ((_model.has(\"style\") && _.clone(_model.get(\"style\"))) || {}), {thickness: _newThickness}));\n                            paper.view.draw();\n                        }\n                    }\n                    else {\n                        closeEditor();\n                    }\n                };\n\n                this.editor_$.find(\"#Rk-Edit-Thickness-Down\").click(function() {\n                    shiftThickness(-1);\n                    return false;\n                });\n                this.editor_$.find(\"#Rk-Edit-Thickness-Up\").click(function() {\n                    shiftThickness(1);\n                    return false;\n                });\n            }\n        },\n        redraw: function() {\n            if (this.options.popup_editor){\n                var _coords = this.source_representation.paper_coords;\n                Utils.drawEditBox(this.options, _coords, this.editor_block, 5, this.editor_$);\n            }\n            this.editor_$.show();\n            paper.view.draw();\n        }\n    }).value();\n\n    /* EdgeEditor End */\n\n    return EdgeEditor;\n\n});\n\n\ndefine('renderer/nodebutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* _NodeButton Begin */\n\n    //var _NodeButton = Renderer._NodeButton = Utils.inherit(Renderer._BaseButton);\n    var _NodeButton = Utils.inherit(BaseButton);\n\n    _(_NodeButton.prototype).extend({\n        setSectorSize: function() {\n            var sectorInner = this.source_representation.circle_radius;\n            if (sectorInner !== this.lastSectorInner) {\n                if (this.sector) {\n                    this.sector.destroy();\n                }\n                this.sector = this.renderer.drawSector(\n                        this, 1 + sectorInner,\n                        Utils._NODE_BUTTON_WIDTH + sectorInner,\n                        this.startAngle,\n                        this.endAngle,\n                        1,\n                        this.imageName,\n                        this.renkan.translate(this.text)\n                );\n                this.lastSectorInner = sectorInner;\n            }\n        },\n        unselect: function() {\n            BaseButton.prototype.unselect.apply(this, Array.prototype.slice.call(arguments, 1));\n            if(this.source_representation && this.source_representation.buttons_timeout) {\n                clearTimeout(this.source_representation.buttons_timeout);\n                this.source_representation.hideButtons();\n            }\n        },\n        select: function() {\n            if(this.source_representation && this.source_representation.buttons_timeout) {\n                clearTimeout(this.source_representation.buttons_timeout);\n            }\n            this.sector.select();\n        },\n    }).value();\n\n\n    /* _NodeButton End */\n\n    return _NodeButton;\n\n});\n\n\ndefine('renderer/nodeeditbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeEditButton Begin */\n\n    //var NodeEditButton = Renderer.NodeEditButton = Utils.inherit(Renderer._NodeButton);\n    var NodeEditButton = Utils.inherit(NodeButton);\n\n    _(NodeEditButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-edit-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -125 : -135;\n            this.endAngle = this.options.hide_nodes ? -55 : -45;\n            this.imageName = \"edit\";\n            this.text = \"Edit\";\n        },\n        mouseup: function() {\n            if (!this.renderer.is_dragging) {\n                this.source_representation.openEditor();\n            }\n        }\n    }).value();\n\n    /* NodeEditButton End */\n\n    return NodeEditButton;\n\n});\n\n\ndefine('renderer/noderemovebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeRemoveButton Begin */\n\n    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);\n    var NodeRemoveButton = Utils.inherit(NodeButton);\n\n    _(NodeRemoveButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-remove-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -10 : 0;\n            this.endAngle = this.options.hide_nodes ? 45 : 90;\n            this.imageName = \"remove\";\n            this.text = \"Remove\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                if (this.options.element_delete_delay) {\n                    var delid = Utils.getUID(\"delete\");\n                    this.renderer.delete_list.push({\n                        id: delid,\n                        time: new Date().valueOf() + this.options.element_delete_delay\n                    });\n                    this.source_representation.model.set(\"delete_scheduled\", delid);\n                } else {\n                    if (confirm(this.renkan.translate('Do you really wish to remove node ') + '\"' + this.source_representation.model.get(\"title\") + '\"?')) {\n                        this.project.removeNode(this.source_representation.model);\n                    }\n                }\n            }\n        }\n    }).value();\n\n    /* NodeRemoveButton End */\n\n    return NodeRemoveButton;\n\n});\n\n\ndefine('renderer/nodehidebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeRemoveButton Begin */\n\n    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);\n    var NodeHideButton = Utils.inherit(NodeButton);\n\n    _(NodeHideButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-hide-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = 45;\n            this.endAngle = 90;\n            this.imageName = \"hide\";\n            this.text = \"Hide\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                this.renderer.view.addHiddenNode(this.source_representation.model);\n            }\n        }\n    }).value();\n\n    /* NodeRemoveButton End */\n\n    return NodeHideButton;\n\n});\n\n\ndefine('renderer/nodeshowbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeRemoveButton Begin */\n\n    //var NodeRemoveButton = Renderer.NodeRemoveButton = Utils.inherit(Renderer._NodeButton);\n    var NodeShowButton = Utils.inherit(NodeButton);\n\n    _(NodeShowButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-show-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = 90;\n            this.endAngle = 135;\n            this.imageName = \"show\";\n            this.text = \"Show\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                this.source_representation.showNeighbors(false);\n            }\n        }\n    }).value();\n\n    /* NodeShowButton End */\n\n    return NodeShowButton;\n\n});\n\n\ndefine('renderer/noderevertbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeRevertButton Begin */\n\n    //var NodeRevertButton = Renderer.NodeRevertButton = Utils.inherit(Renderer._NodeButton);\n    var NodeRevertButton = Utils.inherit(NodeButton);\n\n    _(NodeRevertButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-revert-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = -135;\n            this.endAngle = 135;\n            this.imageName = \"revert\";\n            this.text = \"Cancel deletion\";\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            if (this.renderer.isEditable()) {\n                this.source_representation.model.unset(\"delete_scheduled\");\n            }\n        }\n    }).value();\n\n    /* NodeRevertButton End */\n\n    return NodeRevertButton;\n\n});\n\n\ndefine('renderer/nodelinkbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeLinkButton Begin */\n\n    //var NodeLinkButton = Renderer.NodeLinkButton = Utils.inherit(Renderer._NodeButton);\n    var NodeLinkButton = Utils.inherit(NodeButton);\n\n    _(NodeLinkButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-link-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? 135 : 90;\n            this.endAngle = this.options.hide_nodes ? 190 : 180;\n            this.imageName = \"link\";\n            this.text = \"Link to another node\";\n        },\n        mousedown: function(_event, _isTouch) {\n            if (this.renderer.isEditable()) {\n                var _off = this.renderer.canvas_$.offset(),\n                _point = new paper.Point([\n                                          _event.pageX - _off.left,\n                                          _event.pageY - _off.top\n                                          ]);\n                this.renderer.click_target = null;\n                this.renderer.removeRepresentationsOfType(\"editor\");\n                this.renderer.addTempEdge(this.source_representation, _point);\n            }\n        }\n    }).value();\n\n    /* NodeLinkButton End */\n\n    return NodeLinkButton;\n\n});\n\n\n\ndefine('renderer/nodeenlargebutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeEnlargeButton Begin */\n\n    //var NodeEnlargeButton = Renderer.NodeEnlargeButton = Utils.inherit(Renderer._NodeButton);\n    var NodeEnlargeButton = Utils.inherit(NodeButton);\n\n    _(NodeEnlargeButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-enlarge-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -55 : -45;\n            this.endAngle = this.options.hide_nodes ? -10 : 0;\n            this.imageName = \"enlarge\";\n            this.text = \"Enlarge\";\n        },\n        mouseup: function() {\n            var _newsize = 1 + (this.source_representation.model.get(\"size\") || 0);\n            this.source_representation.model.set(\"size\", _newsize);\n            this.source_representation.select();\n            this.select();\n            paper.view.draw();\n        }\n    }).value();\n\n    /* NodeEnlargeButton End */\n\n    return NodeEnlargeButton;\n\n});\n\n\ndefine('renderer/nodeshrinkbutton',['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* NodeShrinkButton Begin */\n\n    //var NodeShrinkButton = Renderer.NodeShrinkButton = Utils.inherit(Renderer._NodeButton);\n    var NodeShrinkButton = Utils.inherit(NodeButton);\n\n    _(NodeShrinkButton.prototype).extend({\n        _init: function() {\n            this.type = \"Node-shrink-button\";\n            this.lastSectorInner = 0;\n            this.startAngle = this.options.hide_nodes ? -170 : -180;\n            this.endAngle = this.options.hide_nodes ? -125 : -135;\n            this.imageName = \"shrink\";\n            this.text = \"Shrink\";\n        },\n        mouseup: function() {\n            var _newsize = -1 + (this.source_representation.model.get(\"size\") || 0);\n            this.source_representation.model.set(\"size\", _newsize);\n            this.source_representation.select();\n            this.select();\n            paper.view.draw();\n        }\n    }).value();\n\n    /* NodeShrinkButton End */\n\n    return NodeShrinkButton;\n\n});\n\n\ndefine('renderer/edgeeditbutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* EdgeEditButton Begin */\n\n    //var EdgeEditButton = Renderer.EdgeEditButton = Utils.inherit(Renderer._BaseButton);\n    var EdgeEditButton = Utils.inherit(BaseButton);\n\n    _(EdgeEditButton.prototype).extend({\n        _init: function() {\n            this.type = \"Edge-edit-button\";\n            this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -270, -90, 1, \"edit\", this.renkan.translate(\"Edit\"));\n        },\n        mouseup: function() {\n            if (!this.renderer.is_dragging) {\n                this.source_representation.openEditor();\n            }\n        }\n    }).value();\n\n    /* EdgeEditButton End */\n\n    return EdgeEditButton;\n\n});\n\n\ndefine('renderer/edgeremovebutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* EdgeRemoveButton Begin */\n\n    //var EdgeRemoveButton = Renderer.EdgeRemoveButton = Utils.inherit(Renderer._BaseButton);\n    var EdgeRemoveButton = Utils.inherit(BaseButton);\n\n    _(EdgeRemoveButton.prototype).extend({\n        _init: function() {\n            this.type = \"Edge-remove-button\";\n            this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -90, 90, 1, \"remove\", this.renkan.translate(\"Remove\"));\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            this.renderer.removeRepresentationsOfType(\"editor\");\n            if (this.renderer.isEditable()) {\n                if (this.options.element_delete_delay) {\n                    var delid = Utils.getUID(\"delete\");\n                    this.renderer.delete_list.push({\n                        id: delid,\n                        time: new Date().valueOf() + this.options.element_delete_delay\n                    });\n                    this.source_representation.model.set(\"delete_scheduled\", delid);\n                } else {\n                    if (confirm(this.renkan.translate('Do you really wish to remove edge ') + '\"' + this.source_representation.model.get(\"title\") + '\"?')) {\n                        this.project.removeEdge(this.source_representation.model);\n                    }\n                }\n            }\n        }\n    }).value();\n\n    /* EdgeRemoveButton End */\n\n    return EdgeRemoveButton;\n\n});\n\n\ndefine('renderer/edgerevertbutton',['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* EdgeRevertButton Begin */\n\n    //var EdgeRevertButton = Renderer.EdgeRevertButton = Utils.inherit(Renderer._BaseButton);\n    var EdgeRevertButton = Utils.inherit(BaseButton);\n\n    _(EdgeRevertButton.prototype).extend({\n        _init: function() {\n            this.type = \"Edge-revert-button\";\n            this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -135, 135, 1, \"revert\", this.renkan.translate(\"Cancel deletion\"));\n        },\n        mouseup: function() {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n            if (this.renderer.isEditable()) {\n                this.source_representation.model.unset(\"delete_scheduled\");\n            }\n        }\n    }).value();\n\n    /* EdgeRevertButton End */\n\n    return EdgeRevertButton;\n\n});\n\n\ndefine('renderer/miniframe',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* MiniFrame Begin */\n\n    //var MiniFrame = Renderer.MiniFrame = Utils.inherit(Renderer._BaseRepresentation);\n    var MiniFrame = Utils.inherit(BaseRepresentation);\n\n    _(MiniFrame.prototype).extend({\n        paperShift: function(_delta) {\n            this.renderer.offset = this.renderer.offset.subtract(_delta.divide(this.renderer.minimap.scale).multiply(this.renderer.scale));\n            this.renderer.redraw();\n        },\n        mouseup: function(_delta) {\n            this.renderer.click_target = null;\n            this.renderer.is_dragging = false;\n        }\n    }).value();\n\n\n    /* MiniFrame End */\n\n    return MiniFrame;\n\n});\n\n\ndefine('renderer/scene',['jquery', 'underscore', 'filesaver', 'requtils', 'renderer/miniframe'], function ($, _, filesaver, requtils, MiniFrame) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* Scene Begin */\n\n    var Scene = function(_renkan) {\n        this.renkan = _renkan;\n        this.$ = $(\".Rk-Render\");\n        this.representations = [];\n        this.$.html(_renkan.options.templates['templates/scene.html'](_renkan));\n        this.onStatusChange();\n        this.canvas_$ = this.$.find(\".Rk-Canvas\");\n        this.labels_$ = this.$.find(\".Rk-Labels\");\n        if (!_renkan.options.popup_editor){\n            this.editor_$ = $(\"#\" + _renkan.options.editor_panel);\n        }else{\n            this.editor_$ = this.$.find(\".Rk-Editor\");\n        }\n        this.notif_$ = this.$.find(\".Rk-Notifications\");\n        paper.setup(this.canvas_$[0]);\n        this.totalScroll = 0;\n        this.mouse_down = false;\n        this.click_target = null;\n        this.selected_target = null;\n        this.edge_layer = new paper.Layer();\n        this.node_layer = new paper.Layer();\n        this.buttons_layer = new paper.Layer();\n        this.delete_list = [];\n        this.redrawActive = true;\n\n        if (_renkan.options.show_minimap) {\n            this.minimap = {\n                    background_layer: new paper.Layer(),\n                    edge_layer: new paper.Layer(),\n                    node_layer: new paper.Layer(),\n                    node_group: new paper.Group(),\n                    size: new paper.Size( _renkan.options.minimap_width, _renkan.options.minimap_height )\n            };\n\n            this.minimap.background_layer.activate();\n            this.minimap.topleft = paper.view.bounds.bottomRight.subtract(this.minimap.size);\n            this.minimap.rectangle = new paper.Path.Rectangle(this.minimap.topleft.subtract([2,2]), this.minimap.size.add([4,4]));\n            this.minimap.rectangle.fillColor = _renkan.options.minimap_background_color;\n            this.minimap.rectangle.strokeColor = _renkan.options.minimap_border_color;\n            this.minimap.rectangle.strokeWidth = 4;\n            this.minimap.offset = new paper.Point(this.minimap.size.divide(2));\n            this.minimap.scale = 0.1;\n\n            this.minimap.node_layer.activate();\n            this.minimap.cliprectangle = new paper.Path.Rectangle(this.minimap.topleft, this.minimap.size);\n            this.minimap.node_group.addChild(this.minimap.cliprectangle);\n            this.minimap.node_group.clipped = true;\n            this.minimap.miniframe = new paper.Path.Rectangle(this.minimap.topleft, this.minimap.size);\n            this.minimap.node_group.addChild(this.minimap.miniframe);\n            this.minimap.miniframe.fillColor = '#c0c0ff';\n            this.minimap.miniframe.opacity = 0.3;\n            this.minimap.miniframe.strokeColor = '#000080';\n            this.minimap.miniframe.strokeWidth = 2;\n            this.minimap.miniframe.__representation = new MiniFrame(this, null);\n        }\n\n        this.throttledPaperDraw = _(function() {\n            paper.view.draw();\n        }).throttle(100).value();\n\n        this.bundles = [];\n        this.click_mode = false;\n\n        var _this = this,\n        _allowScroll = true,\n        _originalScale = 1,\n        _zooming = false,\n        _lastTapX = 0,\n        _lastTapY = 0;\n\n        this.image_cache = {};\n        this.icon_cache = {};\n\n        ['edit', 'remove', 'hide', 'show', 'link', 'enlarge', 'shrink', 'revert' ].forEach(function(imgname) {\n            var img = new Image();\n            img.src = _renkan.options.static_url + 'img/' + imgname + '.png';\n            _this.icon_cache[imgname] = img;\n        });\n\n        var throttledMouseMove = _.throttle(function(_event, _isTouch) {\n            _this.onMouseMove(_event, _isTouch);\n        }, Utils._MOUSEMOVE_RATE);\n\n        this.canvas_$.on({\n            mousedown: function(_event) {\n                _event.preventDefault();\n                _this.onMouseDown(_event, false);\n            },\n            mousemove: function(_event) {\n                _event.preventDefault();\n                throttledMouseMove(_event, false);\n            },\n            mouseup: function(_event) {\n                _event.preventDefault();\n                _this.onMouseUp(_event, false);\n            },\n            mousewheel: function(_event, _delta) {\n                if(_renkan.options.zoom_on_scroll) {\n                    _event.preventDefault();\n                    if (_allowScroll) {\n                        _this.onScroll(_event, _delta);\n                    }\n                }\n            },\n            touchstart: function(_event) {\n                _event.preventDefault();\n                var _touches = _event.originalEvent.touches[0];\n                if (\n                        _renkan.options.allow_double_click &&\n                        new Date() - _lastTap < Utils._DOUBLETAP_DELAY &&\n                        ( Math.pow(_lastTapX - _touches.pageX, 2) + Math.pow(_lastTapY - _touches.pageY, 2) < Utils._DOUBLETAP_DISTANCE )\n                ) {\n                    _lastTap = 0;\n                    _this.onDoubleClick(_touches);\n                } else {\n                    _lastTap = new Date();\n                    _lastTapX = _touches.pageX;\n                    _lastTapY = _touches.pageY;\n                    _originalScale = _this.view.scale;\n                    _zooming = false;\n                    _this.onMouseDown(_touches, true);\n                }\n            },\n            touchmove: function(_event) {\n                _event.preventDefault();\n                _lastTap = 0;\n                if (_event.originalEvent.touches.length === 1) {\n                    _this.onMouseMove(_event.originalEvent.touches[0], true);\n                } else {\n                    if (!_zooming) {\n                        _this.onMouseUp(_event.originalEvent.touches[0], true);\n                        _this.click_target = null;\n                        _this.is_dragging = false;\n                        _zooming = true;\n                    }\n                    if (_event.originalEvent.scale === \"undefined\") {\n                        return;\n                    }\n                    var _newScale = _event.originalEvent.scale * _originalScale,\n                    _scaleRatio = _newScale / _this.view.scale,\n                    _newOffset = new paper.Point([\n                                                  _this.canvas_$.width(),\n                                                  _this.canvas_$.height()\n                                                  ]).multiply( 0.5 * ( 1 - _scaleRatio ) ).add(_this.view.offset.multiply( _scaleRatio ));\n                    _this.view.setScale(_newScale, _newOffset);\n                }\n            },\n            touchend: function(_event) {\n                _event.preventDefault();\n                _this.onMouseUp(_event.originalEvent.changedTouches[0], true);\n            },\n            dblclick: function(_event) {\n                _event.preventDefault();\n                if (_renkan.options.allow_double_click) {\n                    _this.onDoubleClick(_event);\n                }\n            },\n            mouseleave: function(_event) {\n                _event.preventDefault();\n                //_this.onMouseUp(_event, false);\n                _this.click_target = null;\n                _this.is_dragging = false;\n            },\n            dragover: function(_event) {\n                _event.preventDefault();\n            },\n            dragenter: function(_event) {\n                _event.preventDefault();\n                _allowScroll = false;\n            },\n            dragleave: function(_event) {\n                _event.preventDefault();\n                _allowScroll = true;\n            },\n            drop: function(_event) {\n                _event.preventDefault();\n                _allowScroll = true;\n                var res = {};\n                _.each(_event.originalEvent.dataTransfer.types, function(t) {\n                    try {\n                        res[t] = _event.originalEvent.dataTransfer.getData(t);\n                    } catch(e) {}\n                });\n                var text = _event.originalEvent.dataTransfer.getData(\"Text\");\n                if (typeof text === \"string\") {\n                    switch(text[0]) {\n                    case \"{\":\n                    case \"[\":\n                        try {\n                            var data = JSON.parse(text);\n                            _.extend(res,data);\n                        }\n                        catch(e) {\n                            if (!res[\"text/plain\"]) {\n                                res[\"text/plain\"] = text;\n                            }\n                        }\n                        break;\n                    case \"<\":\n                        if (!res[\"text/html\"]) {\n                            res[\"text/html\"] = text;\n                        }\n                        break;\n                    default:\n                        if (!res[\"text/plain\"]) {\n                            res[\"text/plain\"] = text;\n                        }\n                    }\n                }\n                var url = _event.originalEvent.dataTransfer.getData(\"URL\");\n                if (url && !res[\"text/uri-list\"]) {\n                    res[\"text/uri-list\"] = url;\n                }\n                _this.dropData(res, _event.originalEvent);\n            }\n        });\n\n        var bindClick = function(selector, fname) {\n            _this.$.find(selector).click(function(evt) {\n                _this[fname](evt);\n                return false;\n            });\n        };\n\n        if(this.renkan.project.get(\"views\").length > 0 && this.renkan.options.save_view){\n            this.$.find(\".Rk-ZoomSetSaved\").show();\n        }\n        this.$.find(\".Rk-CurrentUser\").mouseenter(\n                function() { _this.$.find(\".Rk-UserList\").slideDown(); }\n        );\n        this.$.find(\".Rk-Users\").mouseleave(\n                function() { _this.$.find(\".Rk-UserList\").slideUp(); }\n        );\n        bindClick(\".Rk-FullScreen-Button\", \"fullScreen\");\n        bindClick(\".Rk-AddNode-Button\", \"addNodeBtn\");\n        bindClick(\".Rk-AddEdge-Button\", \"addEdgeBtn\");\n        bindClick(\".Rk-Save-Button\", \"save\");\n        bindClick(\".Rk-Open-Button\", \"open\");\n        bindClick(\".Rk-Export-Button\", \"exportProject\");\n        this.$.find(\".Rk-Bookmarklet-Button\")\n          /*jshint scripturl:true */\n          .attr(\"href\",\"javascript:\" + Utils._BOOKMARKLET_CODE(_renkan))\n          .click(function(){\n              _this.notif_$\n              .text(_renkan.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.\"))\n              .fadeIn()\n              .delay(5000)\n              .fadeOut();\n              return false;\n          });\n        this.$.find(\".Rk-TopBar-Button\").mouseover(function() {\n            $(this).find(\".Rk-TopBar-Tooltip\").show();\n        }).mouseout(function() {\n            $(this).find(\".Rk-TopBar-Tooltip\").hide();\n        });\n        bindClick(\".Rk-Fold-Bins\", \"foldBins\");\n\n        paper.view.onResize = function(_event) {\n            var _ratio,\n                newWidth = _event.width,\n                newHeight = _event.height;\n\n            if (_this.minimap) {\n                _this.minimap.topleft = paper.view.bounds.bottomRight.subtract(_this.minimap.size);\n                _this.minimap.rectangle.fitBounds(_this.minimap.topleft.subtract([2,2]), _this.minimap.size.add([4,4]));\n                _this.minimap.cliprectangle.fitBounds(_this.minimap.topleft, _this.minimap.size);\n            }\n\n            var ratioH = newHeight/(newHeight-_event.delta.height),\n                ratioW = newWidth/(newWidth-_event.delta.width);\n            if (newHeight < newWidth) {\n                    _ratio = ratioH;\n            } else {\n                _ratio = ratioW;\n            }\n\n            _this.view.resizeZoom(ratioW, ratioH, _ratio);\n\n            _this.redraw();\n\n        };\n\n        var _thRedraw = _.throttle(function() {\n            _this.redraw();\n        },50);\n           \n        this.addRepresentations(\"Node\", this.renkan.project.get(\"nodes\"));\n        this.addRepresentations(\"Edge\", this.renkan.project.get(\"edges\"));\n        this.renkan.project.on(\"change:title\", function() {\n            _this.$.find(\".Rk-PadTitle\").val(_renkan.project.get(\"title\"));\n        });\n\n        this.$.find(\".Rk-PadTitle\").on(\"keyup input paste\", function() {\n            _renkan.project.set({\"title\": $(this).val()});\n        });\n\n        var _thRedrawUsers = _.throttle(function() {\n            _this.redrawUsers();\n        }, 100);\n\n        _thRedrawUsers();\n\n        // register model events\n        this.renkan.project.on(\"change:saveStatus\", function(){\n            switch (_this.renkan.project.get(\"saveStatus\")) {\n                case 0: //clean\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"to-save\");\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saving\");\n                    _this.$.find(\".Rk-Save-Button\").addClass(\"saved\");\n                    break;\n                case 1: //dirty\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saved\");\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saving\");\n                    _this.$.find(\".Rk-Save-Button\").addClass(\"to-save\");\n                    break;\n                case 2: //saving\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"saved\");\n                    _this.$.find(\".Rk-Save-Button\").removeClass(\"to-save\");\n                    _this.$.find(\".Rk-Save-Button\").addClass(\"saving\");\n                    break;\n            }\n        });\n\n        this.renkan.project.on(\"change:loadingStatus\", function(){\n            if (_this.renkan.project.get(\"loadingStatus\")){\n                var animate = _this.$.find(\".loader\").addClass(\"run\");\n                var timer = setTimeout(function(){\n                    _this.$.find(\".loader\").hide(250);\n                }, 3000);\n            }\n            else{\n                Backbone.history.start();\n                _thRedraw();\n            }\n        });\n\n        this.renkan.project.on(\"add:users remove:users\", _thRedrawUsers);\n\n        this.renkan.project.on(\"add:views remove:views\", function(_node) {\n            if(_this.renkan.project.get('views').length > 0) {\n                _this.$.find(\".Rk-ZoomSetSaved\").show();\n            }\n            else {\n                _this.$.find(\".Rk-ZoomSetSaved\").hide();\n            }\n        });\n\n        this.renkan.project.on(\"add:nodes\", function(_node) {\n            _this.addRepresentation(\"Node\", _node);\n            if (!_this.renkan.project.get(\"loadingStatus\")){\n                _thRedraw();\n            }\n        });\n        this.renkan.project.on(\"add:edges\", function(_edge) {\n            _this.addRepresentation(\"Edge\", _edge);\n            if (!_this.renkan.project.get(\"loadingStatus\")){\n                _thRedraw();\n            }\n        });\n        this.renkan.project.on(\"change:title\", function(_model, _title) {\n            var el = _this.$.find(\".Rk-PadTitle\");\n            if (el.is(\"input\")) {\n                if (el.val() !== _title) {\n                    el.val(_title);\n                }\n            } else {\n                el.text(_title);\n            }\n        });\n        \n        //register router events\n        this.renkan.router.on(\"router\", function(_params){\n            _this.parameters(_params);\n        });\n\n        if (_renkan.options.size_bug_fix) {\n            var _delay = (\n                    typeof _renkan.options.size_bug_fix === \"number\" ?\n                        _renkan.options.size_bug_fix\n                                : 500\n            );\n            window.setTimeout(\n                    function() {\n                        _this.fixSize();\n                    },\n                    _delay\n            );\n        }\n\n        if (_renkan.options.force_resize) {\n            $(window).resize(function() {\n                _this.autoScale();\n            });\n        }\n\n        if (_renkan.options.show_user_list && _renkan.options.user_color_editable) {\n            var $cpwrapper = this.$.find(\".Rk-Users .Rk-Edit-ColorPicker-Wrapper\"),\n            $cplist = this.$.find(\".Rk-Users .Rk-Edit-ColorPicker\");\n\n            $cpwrapper.hover(\n                    function(_e) {\n                        if (_this.isEditable()) {\n                            _e.preventDefault();\n                            $cplist.show();\n                        }\n                    },\n                    function(_e) {\n                        _e.preventDefault();\n                        $cplist.hide();\n                    }\n            );\n\n            $cplist.find(\"li\").mouseenter(\n                    function(_e) {\n                        if (_this.isEditable()) {\n                            _e.preventDefault();\n                            _this.$.find(\".Rk-CurrentUser-Color\").css(\"background\", $(this).attr(\"data-color\"));\n                        }\n                    }\n            );\n        }\n\n        if (_renkan.options.show_search_field) {\n\n            var lastval = '';\n\n            this.$.find(\".Rk-GraphSearch-Field\").on(\"keyup change paste input\", function() {\n                var $this = $(this),\n                val = $this.val();\n                if (val === lastval) {\n                    return;\n                }\n                lastval = val;\n                if (val.length < 2) {\n                    _renkan.project.get(\"nodes\").each(function(n) {\n                        _this.getRepresentationByModel(n).unhighlight();\n                    });\n                } else {\n                    var rxs = Utils.regexpFromTextOrArray(val);\n                    _renkan.project.get(\"nodes\").each(function(n) {\n                        if (rxs.test(n.get(\"title\")) || rxs.test(n.get(\"description\"))) {\n                            _this.getRepresentationByModel(n).highlight(rxs);\n                        } else {\n                            _this.getRepresentationByModel(n).unhighlight();\n                        }\n                    });\n                }\n            });\n        }\n\n        this.redraw();\n\n        window.setInterval(function() {\n            var _now = new Date().valueOf();\n            _this.delete_list.forEach(function(d) {\n                if (_now >= d.time) {\n                    var el = _renkan.project.get(\"nodes\").findWhere({\"delete_scheduled\":d.id});\n                    if (el) {\n                        project.removeNode(el);\n                    }\n                    el = _renkan.project.get(\"edges\").findWhere({\"delete_scheduled\":d.id});\n                    if (el) {\n                        project.removeEdge(el);\n                    }\n                }\n            });\n            _this.delete_list = _this.delete_list.filter(function(d) {\n                return _renkan.project.get(\"nodes\").findWhere({\"delete_scheduled\":d.id}) || _renkan.project.get(\"edges\").findWhere({\"delete_scheduled\":d.id});\n            });\n        }, 500);\n\n        if (this.minimap) {\n            window.setInterval(function() {\n                _this.rescaleMinimap();\n            }, 2000);\n        }\n\n    };\n\n    _(Scene.prototype).extend({\n        fixSize: function() {\n            if(typeof this.view === 'undefined') {\n                this.view = this.addRepresentation(\"View\", this.renkan.project.get(\"views\").last());\n                this.view.setScale(view.get(\"zoom_level\"), new paper.Point(view.get(\"offset\")));\n            }\n            else{\n                this.view.autoScale();\n            }\n        },\n        drawSector: function(_repr, _inR, _outR, _startAngle, _endAngle, _padding, _imgname, _caption) {\n            var _options = this.renkan.options,\n                _startRads = _startAngle * Math.PI / 180,\n                _endRads = _endAngle * Math.PI / 180,\n                _img = this.icon_cache[_imgname],\n                _startdx = - Math.sin(_startRads),\n                _startdy = Math.cos(_startRads),\n                _startXIn = Math.cos(_startRads) * _inR + _padding * _startdx,\n                _startYIn = Math.sin(_startRads) * _inR + _padding * _startdy,\n                _startXOut = Math.cos(_startRads) * _outR + _padding * _startdx,\n                _startYOut = Math.sin(_startRads) * _outR + _padding * _startdy,\n                _enddx = - Math.sin(_endRads),\n                _enddy = Math.cos(_endRads),\n                _endXIn = Math.cos(_endRads) * _inR - _padding * _enddx,\n                _endYIn = Math.sin(_endRads) * _inR - _padding * _enddy,\n                _endXOut = Math.cos(_endRads) * _outR - _padding * _enddx,\n                _endYOut = Math.sin(_endRads) * _outR - _padding * _enddy,\n                _centerR = (_inR + _outR) / 2,\n                _centerRads = (_startRads + _endRads) / 2,\n                _centerX = Math.cos(_centerRads) * _centerR,\n                _centerY = Math.sin(_centerRads) * _centerR,\n                _centerXIn = Math.cos(_centerRads) * _inR,\n                _centerXOut = Math.cos(_centerRads) * _outR,\n                _centerYIn = Math.sin(_centerRads) * _inR,\n                _centerYOut = Math.sin(_centerRads) * _outR,\n                _textX = Math.cos(_centerRads) * (_outR + 3),\n                _textY = Math.sin(_centerRads) * (_outR + _options.buttons_label_font_size) + _options.buttons_label_font_size / 2;\n            this.buttons_layer.activate();\n            var _path = new paper.Path();\n            _path.add([_startXIn, _startYIn]);\n            _path.arcTo([_centerXIn, _centerYIn], [_endXIn, _endYIn]);\n            _path.lineTo([_endXOut,  _endYOut]);\n            _path.arcTo([_centerXOut, _centerYOut], [_startXOut, _startYOut]);\n            _path.fillColor = _options.buttons_background;\n            _path.opacity = 0.5;\n            _path.closed = true;\n            _path.__representation = _repr;\n            var _text = new paper.PointText(_textX,_textY);\n            _text.characterStyle = {\n                    fontSize: _options.buttons_label_font_size,\n                    fillColor: _options.buttons_label_color\n            };\n            if (_textX > 2) {\n                _text.paragraphStyle.justification = 'left';\n            } else if (_textX < -2) {\n                _text.paragraphStyle.justification = 'right';\n            } else {\n                _text.paragraphStyle.justification = 'center';\n            }\n            _text.visible = false;\n            var _visible = false,\n                _restPos = new paper.Point(-200, -200),\n                _grp = new paper.Group([_path, _text]),\n                //_grp = new paper.Group([_path]),\n                _delta = _grp.position,\n                _imgdelta = new paper.Point([_centerX, _centerY]),\n                _currentPos = new paper.Point(0,0);\n            _text.content = _caption;\n            // set group pivot to not depend on text visibility that changes the group bounding box.\n            _grp.pivot = _grp.bounds.center;\n            _grp.visible = false;\n            _grp.position = _restPos;\n            var _res = {\n                    show: function() {\n                        _visible = true;\n                        _grp.position = _currentPos.add(_delta);\n                        _grp.visible = true;\n                    },\n                    moveTo: function(_point) {\n                        _currentPos = _point;\n                        if (_visible) {\n                            _grp.position = _point.add(_delta);\n                        }\n                    },\n                    hide: function() {\n                        _visible = false;\n                        _grp.visible = false;\n                        _grp.position = _restPos;\n                    },\n                    select: function() {\n                        _path.opacity = 0.8;\n                        _text.visible = true;\n                    },\n                    unselect: function() {\n                        _path.opacity = 0.5;\n                        _text.visible = false;\n                    },\n                    destroy: function() {\n                        _grp.remove();\n                    }\n            };\n            var showImage = function() {\n                var _raster = new paper.Raster(_img);\n                _raster.position = _imgdelta.add(_grp.position).subtract(_delta);\n                _raster.locked = true; // Disable mouse events on icon\n                _grp.addChild(_raster);\n            };\n            if (_img.width) {\n                showImage();\n            } else {\n                $(_img).on(\"load\",showImage);\n            }\n\n            return _res;\n        },\n        addToBundles: function(_edgeRepr) {\n            var _bundle = _(this.bundles).find(function(_bundle) {\n                return (\n                        ( _bundle.from === _edgeRepr.from_representation && _bundle.to === _edgeRepr.to_representation ) ||\n                        ( _bundle.from === _edgeRepr.to_representation && _bundle.to === _edgeRepr.from_representation )\n                );\n            });\n            if (typeof _bundle !== \"undefined\") {\n                _bundle.edges.push(_edgeRepr);\n            } else {\n                _bundle = {\n                        from: _edgeRepr.from_representation,\n                        to: _edgeRepr.to_representation,\n                        edges: [ _edgeRepr ],\n                        getPosition: function(_er) {\n                            var _dir = (_er.from_representation === this.from) ? 1 : -1;\n                            return _dir * ( _(this.edges).indexOf(_er) - (this.edges.length - 1) / 2 );\n                        }\n                };\n                this.bundles.push(_bundle);\n            }\n            return _bundle;\n        },\n        isEditable: function() {\n            return (this.renkan.options.editor_mode && !this.renkan.read_only);\n        },\n        onStatusChange: function() {\n            var savebtn = this.$.find(\".Rk-Save-Button\"),\n            tip = savebtn.find(\".Rk-TopBar-Tooltip-Contents\");\n            if (this.renkan.read_only) {\n                savebtn.removeClass(\"disabled Rk-Save-Online\").addClass(\"Rk-Save-ReadOnly\");\n                tip.text(this.renkan.translate(\"Connection lost\"));\n            } else {\n                if (this.renkan.options.manual_save) {\n                    savebtn.removeClass(\"Rk-Save-ReadOnly Rk-Save-Online\");\n                    tip.text(this.renkan.translate(\"Save Project\"));\n                } else {\n                    savebtn.removeClass(\"disabled Rk-Save-ReadOnly\").addClass(\"Rk-Save-Online\");\n                    tip.text(this.renkan.translate(\"Auto-save enabled\"));\n                }\n            }\n            this.redrawUsers();\n        },\n        redrawMiniframe: function() {\n            var topleft = this.toMinimapCoords(this.toModelCoords(new paper.Point([0,0]))),\n                bottomright = this.toMinimapCoords(this.toModelCoords(paper.view.bounds.bottomRight));\n            this.minimap.miniframe.fitBounds(topleft, bottomright);\n        },\n        rescaleMinimap: function() {\n            var nodes = this.renkan.project.get(\"nodes\");\n            if (nodes.length > 1) {\n                var _xx = nodes.map(function(_node) { return _node.get(\"position\").x; }),\n                    _yy = nodes.map(function(_node) { return _node.get(\"position\").y; }),\n                    _minx = Math.min.apply(Math, _xx),\n                    _miny = Math.min.apply(Math, _yy),\n                    _maxx = Math.max.apply(Math, _xx),\n                    _maxy = Math.max.apply(Math, _yy);\n                var _scale = Math.min(\n                        this.view.scale * 0.8 * this.renkan.options.minimap_width / paper.view.bounds.width,\n                        this.view.scale * 0.8 * this.renkan.options.minimap_height / paper.view.bounds.height,\n                        ( this.renkan.options.minimap_width - 2 * this.renkan.options.minimap_padding ) / (_maxx - _minx),\n                        ( this.renkan.options.minimap_height - 2 * this.renkan.options.minimap_padding ) / (_maxy - _miny)\n                );\n                this.minimap.offset = this.minimap.size.divide(2).subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale));\n                this.minimap.scale = _scale;\n            }\n            if (nodes.length === 1) {\n                this.minimap.scale = 0.1;\n                this.minimap.offset = this.minimap.size.divide(2).subtract(new paper.Point([nodes.at(0).get(\"position\").x, nodes.at(0).get(\"position\").y]).multiply(this.minimap.scale));\n            }\n            this.redraw();\n        },\n        toPaperCoords: function(_point) {\n            return _point.multiply(this.view.scale).add(this.view.offset);\n        },\n        toMinimapCoords: function(_point) {\n            return _point.multiply(this.minimap.scale).add(this.minimap.offset).add(this.minimap.topleft);\n        },\n        toModelCoords: function(_point) {\n            return _point.subtract(this.view.offset).divide(this.view.scale);\n        },\n        addRepresentation: function(_type, _model) {\n            var RendererType = requtils.getRenderer()[_type];\n            var _repr = new RendererType(this, _model);\n            this.representations.push(_repr);\n            return _repr;                \n        },\n        addRepresentations: function(_type, _collection) {\n            var _this = this;\n            _collection.forEach(function(_model) {\n                _this.addRepresentation(_type, _model);\n            });\n        },\n        userTemplate: _.template(\n                '<li class=\"Rk-User\"><span class=\"Rk-UserColor\" style=\"background:<%=background%>;\"></span><%=name%></li>'\n        ),\n        redrawUsers: function() {\n            if (!this.renkan.options.show_user_list) {\n                return;\n            }\n            var allUsers = [].concat((this.renkan.project.current_user_list || {}).models || [], (this.renkan.project.get(\"users\") || {}).models || []),\n            ulistHtml = '',\n            $userpanel = this.$.find(\".Rk-Users\"),\n            $name = $userpanel.find(\".Rk-CurrentUser-Name\"),\n            $cpitems = $userpanel.find(\".Rk-Edit-ColorPicker li\"),\n            $colorsquare = $userpanel.find(\".Rk-CurrentUser-Color\"),\n            _this = this;\n            $name.off(\"click\").text(this.renkan.translate(\"<unknown user>\"));\n            $cpitems.off(\"mouseleave click\");\n            allUsers.forEach(function(_user) {\n                if (_user.get(\"_id\") === _this.renkan.current_user) {\n                    $name.text(_user.get(\"title\"));\n                    $colorsquare.css(\"background\", _user.get(\"color\"));\n                    if (_this.isEditable()) {\n\n                        if (_this.renkan.options.user_name_editable) {\n                            $name.click(function() {\n                                var $this = $(this),\n                                $input = $('<input>').val(_user.get(\"title\")).blur(function() {\n                                    _user.set(\"title\", $(this).val());\n                                    _this.redrawUsers();\n                                    _this.redraw();\n                                });\n                                $this.empty().html($input);\n                                $input.select();\n                            });\n                        }\n\n                        if (_this.renkan.options.user_color_editable) {\n                            $cpitems.click(\n                                    function(_e) {\n                                        _e.preventDefault();\n                                        if (_this.isEditable()) {\n                                            _user.set(\"color\", $(this).attr(\"data-color\"));\n                                        }\n                                        $(this).parent().hide();\n                                    }\n                            ).mouseleave(function() {\n                                $colorsquare.css(\"background\", _user.get(\"color\"));\n                            });\n                        }\n                    }\n\n                } else {\n                    ulistHtml += _this.userTemplate({\n                        name: _user.get(\"title\"),\n                        background: _user.get(\"color\")\n                    });\n                }\n            });\n            $userpanel.find(\".Rk-UserList\").html(ulistHtml);\n        },\n        removeRepresentation: function(_representation) {\n            _representation.destroy();\n            this.representations = _.reject(this.representations,\n                function(_repr) {\n                    return _repr === _representation;\n                }\n            );\n        },\n        getRepresentationByModel: function(_model) {\n            if (!_model) {\n                return undefined;\n            }\n            return _.find(this.representations, function(_repr) {\n                return _repr.model === _model;\n            });\n        },\n        removeRepresentationsOfType: function(_type) {\n            var _representations = _.filter(this.representations,function(_repr) {\n                return _repr.type === _type;\n                }),\n                _this = this;\n            _.each(_representations, function(_repr) {\n                _this.removeRepresentation(_repr);\n            });\n        },\n        highlightModel: function(_model) {\n            var _repr = this.getRepresentationByModel(_model);\n            if (_repr) {\n                _repr.highlight();\n            }\n        },\n        unhighlightAll: function(_model) {\n            _.each(this.representations, function(_repr) {\n                _repr.unhighlight();\n            });\n        },\n        unselectAll: function(_model) {\n            _.each(this.representations, function(_repr) {\n                _repr.unselect();\n            });\n        },\n        redraw: function() {\n            var _this = this;\n            if(! this.redrawActive ) {\n                return;\n            }\n            _.each(this.representations, function(_representation) {\n                _representation.redraw({ dontRedrawEdges:true });\n            });\n            if (this.minimap && typeof this.view !== 'undefined') {\n                this.redrawMiniframe();\n            }\n            paper.view.draw();\n        },\n        addTempEdge: function(_from, _point) {\n            var _tmpEdge = this.addRepresentation(\"TempEdge\",null);\n            _tmpEdge.end_pos = _point;\n            _tmpEdge.from_representation = _from;\n            _tmpEdge.redraw();\n            this.click_target = _tmpEdge;\n        },\n        findTarget: function(_hitResult) {\n            if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                var _newTarget = _hitResult.item.__representation;\n                if (this.selected_target !== _hitResult.item.__representation) {\n                    if (this.selected_target) {\n                        this.selected_target.unselect(_newTarget);\n                    }\n                    _newTarget.select(this.selected_target);\n                    this.selected_target = _newTarget;\n                }\n            } else {\n                if (this.selected_target) {\n                    this.selected_target.unselect();\n                }\n                this.selected_target = null;\n            }\n        },\n        onMouseMove: function(_event) {\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]),\n                                      _delta = _point.subtract(this.last_point);\n            this.last_point = _point;\n            if (!this.is_dragging && this.mouse_down && _delta.length > Utils._MIN_DRAG_DISTANCE) {\n                this.is_dragging = true;\n            }\n            var _hitResult = paper.project.hitTest(_point);\n            if (this.is_dragging) {\n                if (this.click_target && typeof this.click_target.paperShift === \"function\") {\n                    this.click_target.paperShift(_delta);\n                } else {\n                    this.view.paperShift(_delta);\n                }\n            } else {\n                this.findTarget(_hitResult);\n            }\n            paper.view.draw();\n        },\n        onMouseDown: function(_event, _isTouch) {\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]);\n            this.last_point = _point;\n            this.mouse_down = true;\n            if (!this.click_target || this.click_target.type !== \"Temp-edge\") {\n                this.removeRepresentationsOfType(\"editor\");\n                this.is_dragging = false;\n                var _hitResult = paper.project.hitTest(_point);\n                if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                    this.click_target = _hitResult.item.__representation;\n                    this.click_target.mousedown(_event, _isTouch);\n                } else {\n                    this.click_target = null;\n                    if (this.isEditable() && this.click_mode === Utils._CLICKMODE_ADDNODE) {\n                        var _coords = this.toModelCoords(_point),\n                        _data = {\n                            id: Utils.getUID('node'),\n                            created_by: this.renkan.current_user,\n                            position: {\n                                x: _coords.x,\n                                y: _coords.y\n                            }\n                        };\n                        var _node = this.renkan.project.addNode(_data);\n                        this.getRepresentationByModel(_node).openEditor();\n                    }\n                }\n            }\n            if (this.click_mode) {\n                if (this.isEditable() && this.click_mode === Utils._CLICKMODE_STARTEDGE && this.click_target && this.click_target.type === \"Node\") {\n                    this.removeRepresentationsOfType(\"editor\");\n                    this.addTempEdge(this.click_target, _point);\n                    this.click_mode = Utils._CLICKMODE_ENDEDGE;\n                    this.notif_$.fadeOut(function() {\n                        $(this).html(this.renkan.translate(\"Click on a second node to complete the edge\")).fadeIn();\n                    });\n                } else {\n                    this.notif_$.hide();\n                    this.click_mode = false;\n                }\n            }\n            paper.view.draw();\n        },\n        onMouseUp: function(_event, _isTouch) {\n            this.mouse_down = false;\n            if (this.click_target) {\n                var _off = this.canvas_$.offset();\n                this.click_target.mouseup(\n                        {\n                            point: new paper.Point([\n                                                    _event.pageX - _off.left,\n                                                    _event.pageY - _off.top\n                                                    ])\n                        },\n                        _isTouch\n                );\n            } else {\n                this.click_target = null;\n                this.is_dragging = false;\n                if (_isTouch) {\n                    this.unselectAll();\n                }\n                this.view.updateUrl();\n            }\n            paper.view.draw();\n        },\n        onScroll: function(_event, _scrolldelta) {\n            this.totalScroll += _scrolldelta;\n            if (Math.abs(this.totalScroll) >= 1) {\n                var _off = this.canvas_$.offset(),\n                _delta = new paper.Point([\n                                          _event.pageX - _off.left,\n                                          _event.pageY - _off.top\n                                          ]).subtract(this.view.offset).multiply( Math.SQRT2 - 1 );\n                if (this.totalScroll > 0) {\n                    this.view.setScale( this.view.scale * Math.SQRT2, this.view.offset.subtract(_delta) );\n                } else {\n                    this.view.setScale( this.view.scale * Math.SQRT1_2, this.view.offset.add(_delta.divide(Math.SQRT2)));\n                }\n                this.totalScroll = 0;\n            }\n        },\n        onDoubleClick: function(_event) {\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]);\n            var _hitResult = paper.project.hitTest(_point);\n\n            if (!this.isEditable()) {\n                if (_hitResult && typeof _hitResult.item.__representation !== \"undefined\") {\n                    if (_hitResult.item.__representation.model.get('uri')){\n                        window.open(_hitResult.item.__representation.model.get('uri'), '_blank');\n                    }\n                }\n                return;\n            }\n            if (this.isEditable() && (!_hitResult || typeof _hitResult.item.__representation === \"undefined\")) {\n                var _coords = this.toModelCoords(_point),\n                _data = {\n                    id: Utils.getUID('node'),\n                    created_by: this.renkan.current_user,\n                    position: {\n                        x: _coords.x,\n                        y: _coords.y\n                    }\n                },\n                _node = this.renkan.project.addNode(_data);\n                this.getRepresentationByModel(_node).openEditor();\n            }\n            paper.view.draw();\n        },\n        defaultDropHandler: function(_data) {\n            var newNode = {};\n            var snippet = \"\";\n            switch(_data[\"text/x-iri-specific-site\"]) {\n                case \"twitter\":\n                    snippet = $('<div>').html(_data[\"text/x-iri-selected-html\"]);\n                    var tweetdiv = snippet.find(\".tweet\");\n                    newNode.title = this.renkan.translate(\"Tweet by \") + tweetdiv.attr(\"data-name\");\n                    newNode.uri = \"http://twitter.com/\" + tweetdiv.attr(\"data-screen-name\") + \"/status/\" + tweetdiv.attr(\"data-tweet-id\");\n                    newNode.image = tweetdiv.find(\".avatar\").attr(\"src\");\n                    newNode.description = tweetdiv.find(\".js-tweet-text:first\").text();\n                    break;\n                case \"google\":\n                    snippet = $('<div>').html(_data[\"text/x-iri-selected-html\"]);\n                    newNode.title = snippet.find(\"h3:first\").text().trim();\n                    newNode.uri = snippet.find(\"h3 a\").attr(\"href\");\n                    newNode.description = snippet.find(\".st:first\").text().trim();\n                    break;\n                default:\n                    if (_data[\"text/x-iri-source-uri\"]) {\n                        newNode.uri = _data[\"text/x-iri-source-uri\"];\n                    }\n            }\n            if (_data[\"text/plain\"] || _data[\"text/x-iri-selected-text\"]) {\n                newNode.description = (_data[\"text/plain\"] || _data[\"text/x-iri-selected-text\"]).replace(/[\\s\\n]+/gm,' ').trim();\n            }\n            if (_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]) {\n                snippet = $('<div>').html(_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]);\n                var _svgimgs = snippet.find(\"image\");\n                if (_svgimgs.length) {\n                    newNode.image = _svgimgs.attr(\"xlink:href\");\n                }\n                var _svgpaths = snippet.find(\"path\");\n                if (_svgpaths.length) {\n                    newNode.clipPath = _svgpaths.attr(\"d\");\n                }\n                var _imgs = snippet.find(\"img\");\n                if (_imgs.length) {\n                    newNode.image = _imgs[0].src;\n                }\n                var _as = snippet.find(\"a\");\n                if (_as.length) {\n                    newNode.uri = _as[0].href;\n                }\n                newNode.title = snippet.find(\"[title]\").attr(\"title\") || newNode.title;\n                newNode.description = snippet.text().replace(/[\\s\\n]+/gm,' ').trim();\n            }\n            if (_data[\"text/uri-list\"]) {\n                newNode.uri = _data[\"text/uri-list\"];\n            }\n            if (_data[\"text/x-moz-url\"] && !newNode.title) {\n                newNode.title = (_data[\"text/x-moz-url\"].split(\"\\n\")[1] || \"\").trim();\n                if (newNode.title === newNode.uri) {\n                    newNode.title = false;\n                }\n            }\n            if (_data[\"text/x-iri-source-title\"] && !newNode.title) {\n                newNode.title = _data[\"text/x-iri-source-title\"];\n            }\n            if (_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]) {\n                snippet = $('<div>').html(_data[\"text/html\"] || _data[\"text/x-iri-selected-html\"]);\n                newNode.image = snippet.find(\"[data-image]\").attr(\"data-image\") || newNode.image;\n                newNode.uri = snippet.find(\"[data-uri]\").attr(\"data-uri\") || newNode.uri;\n                newNode.title = snippet.find(\"[data-title]\").attr(\"data-title\") || newNode.title;\n                newNode.description = snippet.find(\"[data-description]\").attr(\"data-description\") || newNode.description;\n                newNode.clipPath = snippet.find(\"[data-clip-path]\").attr(\"data-clip-path\") || newNode.clipPath;\n            }\n\n            if (!newNode.title) {\n                newNode.title = this.renkan.translate(\"Dragged resource\");\n            }\n            var fields = [\"title\", \"description\", \"uri\", \"image\"];\n            for (var i = 0; i < fields.length; i++) {\n                var f = fields[i];\n                if (_data[\"text/x-iri-\" + f] || _data[f]) {\n                    newNode[f] = _data[\"text/x-iri-\" + f] || _data[f];\n                }\n                if (newNode[f] === \"none\" || newNode[f] === \"null\") {\n                    newNode[f] = undefined;\n                }\n            }\n\n            if(typeof this.renkan.options.drop_enhancer === \"function\"){\n                newNode = this.renkan.options.drop_enhancer(newNode, _data);\n            }\n\n            return newNode;\n\n        },\n        dropData: function(_data, _event) {\n            if (!this.isEditable()) {\n                return;\n            }\n            if (_data[\"text/json\"] || _data[\"application/json\"]) {\n                try {\n                    var jsondata = JSON.parse(_data[\"text/json\"] || _data[\"application/json\"]);\n                    _.extend(_data,jsondata);\n                }\n                catch(e) {}\n            }\n\n            var newNode = (typeof this.renkan.options.drop_handler === \"undefined\")?this.defaultDropHandler(_data):this.renkan.options.drop_handler(_data);\n\n            var _off = this.canvas_$.offset(),\n            _point = new paper.Point([\n                                      _event.pageX - _off.left,\n                                      _event.pageY - _off.top\n                                      ]),\n                                      _coords = this.toModelCoords(_point),\n                                      _nodedata = {\n                id: Utils.getUID('node'),\n                created_by: this.renkan.current_user,\n                uri: newNode.uri || \"\",\n                title: newNode.title || \"\",\n                description: newNode.description || \"\",\n                image: newNode.image || \"\",\n                color: newNode.color || undefined,\n                clip_path: newNode.clipPath || undefined,\n                position: {\n                    x: _coords.x,\n                    y: _coords.y\n                }\n            };\n            var _node = this.renkan.project.addNode(_nodedata),\n            _repr = this.getRepresentationByModel(_node);\n            if (_event.type === \"drop\") {\n                _repr.openEditor();\n            }\n        },\n        fullScreen: function() {\n            var _isFull = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen,\n                _el = this.renkan.$[0],\n                _requestMethods = [\"requestFullScreen\",\"mozRequestFullScreen\",\"webkitRequestFullScreen\"],\n                _cancelMethods = [\"cancelFullScreen\",\"mozCancelFullScreen\",\"webkitCancelFullScreen\"],\n                i;\n            if (_isFull) {\n                for (i = 0; i < _cancelMethods.length; i++) {\n                    if (typeof document[_cancelMethods[i]] === \"function\") {\n                        document[_cancelMethods[i]]();\n                        break;\n                    }\n                }\n                var widthAft = this.$.width();\n                var heightAft = this.$.height();\n\n                if (this.renkan.options.show_top_bar) {\n                    heightAft -= this.$.find(\".Rk-TopBar\").height();\n                }\n                if (this.renkan.options.show_bins && (this.renkan.$.find(\".Rk-Bins\").position().left > 0)) {\n                    widthAft -= this.renkan.$.find(\".Rk-Bins\").width();\n                }\n\n                paper.view.viewSize = new paper.Size([widthAft, heightAft]);\n\n            } else {\n                for (i = 0; i < _requestMethods.length; i++) {\n                    if (typeof _el[_requestMethods[i]] === \"function\") {\n                        _el[_requestMethods[i]]();\n                        break;\n                    }\n                }\n                this.redraw();\n            }\n        },\n        addNodeBtn: function() {\n            if (this.click_mode === Utils._CLICKMODE_ADDNODE) {\n                this.click_mode = false;\n                this.notif_$.hide();\n            } else {\n                this.click_mode = Utils._CLICKMODE_ADDNODE;\n                this.notif_$.text(this.renkan.translate(\"Click on the background canvas to add a node\")).fadeIn();\n            }\n            return false;\n        },\n        addEdgeBtn: function() {\n            if (this.click_mode === Utils._CLICKMODE_STARTEDGE || this.click_mode === Utils._CLICKMODE_ENDEDGE) {\n                this.click_mode = false;\n                this.notif_$.hide();\n            } else {\n                this.click_mode = Utils._CLICKMODE_STARTEDGE;\n                this.notif_$.text(this.renkan.translate(\"Click on a first node to start the edge\")).fadeIn();\n            }\n            return false;\n        },\n        exportProject: function() {\n          var projectJSON = this.renkan.project.toJSON(),\n              downloadLink = document.createElement(\"a\"),\n              projectId = projectJSON.id,\n              fileNameToSaveAs = projectId + \".json\";\n\n          // clean ids\n          delete projectJSON.id;\n          delete projectJSON._id;\n          delete projectJSON.space_id;\n\n          var objId,\n              idsMap = {},\n              hiddenNodes;\n\n          _.each(projectJSON.nodes, function(e,i,l) {\n            objId = e.id || e._id;\n            delete e._id;\n            delete e.id;\n            idsMap[objId] = e['@id'] = Utils.getUUID4();\n          });\n          _.each(projectJSON.edges, function(e,i,l) {\n            delete e._id;\n            delete e.id;\n            e.to = idsMap[e.to];\n            e.from = idsMap[e.from];\n          });\n          _.each(projectJSON.views, function(e,i,l) {\n            delete e._id;\n            delete e.id;\n\n            if(e.hidden_nodes) {\n                hiddenNodes = e.hidden_nodes;\n                e.hidden_nodes = [];\n                _.each(hiddenNodes, function(h,j) {\n                    e.hidden_nodes.push(idsMap[h]);\n                });\n            }\n          });\n          projectJSON.users = [];\n\n          var projectJSONStr = JSON.stringify(projectJSON, null, 2);\n          var blob = new Blob([projectJSONStr], {type: \"application/json;charset=utf-8\"});\n          filesaver(blob,fileNameToSaveAs);\n\n        },\n        parameters: function(_params){\n            if ($.isEmptyObject(_params)){\n                this.view = this.addRepresentation(\"View\", this.renkan.project.get(\"views\").first());\n                this.view.autoScale();\n                return;\n            }\n            if (typeof _params.idView !== 'undefined' && typeof this.renkan.project.get(\"views\").at(_params.idView) !== 'undefined'){\n                this.view = this.addRepresentation(\"View\", this.renkan.project.get(\"views\").at(_params.idView));\n            }\n            if (typeof _params.view !== 'undefined' && _params.view.split(\",\").length >= 3){\n                var viewParams = _params.view.split(\",\");\n                var params = {\n                        \"project\": this.renkan.project,\n                        \"offset\": {\n                            \"x\": parseFloat(viewParams[0]),\n                            \"y\": parseFloat(viewParams[1])\n                        },\n                        \"zoom_level\": parseFloat(viewParams[2])\n                };\n                if (this.view){\n                    this.view.setScale(params.zoom_level, new paper.Point(params.offset));\n                } else{\n                    this.view = this.addRepresentation(\"View\", null);\n                    this.view.params = params;\n                    this.view.init();                    \n                }\n            }\n            if(!this.view){\n                this.view = this.addRepresentation(\"View\", this.renkan.project.get(\"views\").first());\n                this.view.autoScale();\n            }\n            //other parameters must go after because most of them depends on a view that must be initialize before\n            this.unhighlightAll();\n            if (typeof _params.idNode !== 'undefined'){\n                this.highlightModel(this.renkan.project.get(\"nodes\").get(_params.idNode));                 \n            }\n        },\n        foldBins: function() {\n            var foldBinsButton = this.$.find(\".Rk-Fold-Bins\"),\n                bins = this.renkan.$.find(\".Rk-Bins\");\n            var _this = this,\n                sizeBef = _this.canvas_$.width(),\n                sizeAft;\n            if (bins.position().left < 0) {\n                bins.animate({left: 0},250);\n                this.$.animate({left: 300},250,function() {\n                    var w = _this.$.width();\n                    paper.view.viewSize = new paper.Size([w, _this.canvas_$.height()]);\n                });\n                if ((sizeBef -  bins.width()) < bins.height()){\n                    sizeAft = sizeBef;\n                } else {\n                    sizeAft = sizeBef - bins.width();\n                }\n                foldBinsButton.html(\"&laquo;\");\n            } else {\n                bins.animate({left: -300},250);\n                this.$.animate({left: 0},250,function() {\n                    var w = _this.$.width();\n                    paper.view.viewSize = new paper.Size([w, _this.canvas_$.height()]);\n                });\n                sizeAft = sizeBef+300;\n                foldBinsButton.html(\"&raquo;\");\n            }\n            _this.view.resizeZoom(1, 1, (sizeAft/sizeBef));\n        },\n        save: function() { },\n        open: function() { }\n    }).value();\n\n    /* Scene End */\n\n    return Scene;\n\n});\n\ndefine('renderer/viewrepr',['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {\n    \n\n    var Utils = requtils.getUtils();\n\n    /* Rkns.Renderer.View Class */\n\n    /* The representation for the view. */\n\n    var ViewRepr = Utils.inherit(BaseRepresentation);\n\n    _(ViewRepr.prototype).extend({\n        _init: function() {\n            var _this = this;\n            this.$ = $(\".Rk-Render\");\n            this.type = \"View\";\n            this.hiddenNodes = [];\n            this.scale = 1;\n            this.initialScale = 1;\n            this.offset = paper.view.center;\n            this.params = {};\n            \n            if (this.model){\n                this.params = {\n                    \"zoom_level\": _this.model.get(\"zoom_level\"),\n                    \"offset\": _this.model.get(\"offset\"),\n                    \"hidden_nodes\": _this.model.get(\"hidden_nodes\")\n                };\n            }\n                \n            this.init();\n            \n            var bindClick = function(selector, fname) {\n                _this.$.find(selector).click(function(evt) {\n                    _this[fname](evt);\n                    return false;\n                });\n            };\n            \n            bindClick(\".Rk-ZoomOut\", \"zoomOut\");\n            bindClick(\".Rk-ZoomIn\", \"zoomIn\");\n            bindClick(\".Rk-ZoomFit\", \"autoScale\");\n            \n            this.$.find(\".Rk-ZoomSave\").click( function() {\n                var offset = {\n                    \"x\": _this.offset.x,\n                    \"y\": _this.offset.y\n                };\n                //TODO: make the if else the same function\n                if (_this.model && _this.renkan.project.get(\"views\").indexOf(_this.model) > 0){\n                    _this.model.set( { zoom_level:_this.scale, offset:offset, hidden_nodes: _this.hiddenNodes.concat() } );\n                }else{\n                    _this.model = _this.renkan.project.addView( { zoom_level:_this.scale, offset:offset, hidden_nodes: _this.hiddenNodes.concat() } );\n                }\n                _this.params = {\n                        \"zoom_level\": _this.model.get(\"zoom_level\"),\n                        \"offset\": _this.model.get(\"offset\"),\n                        \"hidden_nodes\": _this.model.get(\"hidden_nodes\")\n                };\n                _this.updateUrl();\n            });\n            \n            this.$.find(\".Rk-ZoomSetSaved\").click( function() {\n                _this.setScale(_this.params.zoom_level, new paper.Point(_this.params.offset));\n                _this.showNodes(false);\n                if (_this.options.hide_nodes){\n                    _this.hiddenNodes = (_this.params.hidden_nodes || []).concat();\n                    _this.hideNodes();\n                }\n            });\n            \n            this.$.find(\".Rk-ShowHiddenNodes\").mouseenter( function() {\n                _this.showNodes(true);\n                _this.$.find(\".Rk-ShowHiddenNodes\").mouseleave( function() {\n                    _this.hideNodes();\n                });\n            });\n            this.$.find(\".Rk-ShowHiddenNodes\").click( function() {\n                _this.showNodes(false);\n                _this.$.find(\".Rk-ShowHiddenNodes\").off( \"mouseleave\" ); \n            });\n            if(this.renkan.project.get(\"views\").length > 0 && this.renkan.options.save_view){\n                this.$.find(\".Rk-ZoomSetSaved\").show();\n            }\n        },\n        redraw: function(options) {\n            //console.log(\"view : \", this.model.toJSON());\n        },\n        init: function(){\n            var _this = this;\n            _this.setScale(_this.params.zoom_level, new paper.Point(_this.params.offset));\n            _this.showNodes(false);\n            if (_this.options.hide_nodes){\n                _this.hiddenNodes = (_this.params.hidden_nodes || []).concat();\n                _this.hideNodes();\n            }\n        },\n        addHiddenNode: function(_model){\n            this.hideNode(_model);\n            this.hiddenNodes.push(_model.id);\n            this.updateUrl();\n        },\n        hideNode: function(_model){\n            if (typeof this.renderer.getRepresentationByModel(_model) !== 'undefined'){\n                this.renderer.getRepresentationByModel(_model).hide();\n            }\n        },\n        hideNodes: function(){\n            var _this = this;\n            this.hiddenNodes.forEach(function(_id, index){\n                var node = _this.renkan.project.get(\"nodes\").get(_id);\n                if (typeof node !== 'undefined'){\n                    return _this.hideNode(_this.renkan.project.get(\"nodes\").get(_id));\n                }else{\n                    _this.hiddenNodes.splice(index, 1);\n                }\n            });\n            paper.view.draw();\n        },\n        showNodes: function(ghost){\n            var _this = this;\n            this.hiddenNodes.forEach(function(_id){\n                _this.renderer.getRepresentationByModel(_this.renkan.project.get(\"nodes\").get(_id)).show(ghost);\n            });\n            if (!ghost){\n                this.hiddenNodes = [];\n            }\n            paper.view.draw();\n        },\n        setScale: function(_newScale, _offset) {\n            if ((_newScale/this.initialScale) > Utils._MIN_SCALE && (_newScale/this.initialScale) < Utils._MAX_SCALE) {\n                this.scale = _newScale;\n                if (_offset) {\n                    this.offset = _offset;\n                }\n                this.renderer.redraw();\n                this.updateUrl();\n            }\n        },\n        zoomOut: function() {\n            var _newScale = this.scale * Math.SQRT1_2,\n            _offset = new paper.Point([\n                                       this.renderer.canvas_$.width(),\n                                       this.renderer.canvas_$.height()\n                                       ]).multiply( 0.5 * ( 1 - Math.SQRT1_2 ) ).add(this.offset.multiply( Math.SQRT1_2 ));\n            this.setScale( _newScale, _offset );\n        },\n        zoomIn: function() {\n            var _newScale = this.scale * Math.SQRT2,\n            _offset = new paper.Point([\n                                       this.renderer.canvas_$.width(),\n                                       this.renderer.canvas_$.height()\n                                       ]).multiply( 0.5 * ( 1 - Math.SQRT2 ) ).add(this.offset.multiply( Math.SQRT2 ));\n            this.setScale( _newScale, _offset );\n        },\n        resizeZoom: function(_scaleWidth, _scaleHeight, _ratio) {\n            var _newScale = this.scale * _ratio,\n                _offset = new paper.Point([\n                                       (this.offset.x * _scaleWidth),\n                                       (this.offset.y * _scaleHeight)\n                                       ]);\n            this.setScale( _newScale, _offset );\n        },\n        autoScale: function(force_view) {\n            var nodes = this.renkan.project.get(\"nodes\");\n            if (nodes.length > 1) {\n                var _xx = nodes.map(function(_node) { return _node.get(\"position\").x; }),\n                _yy = nodes.map(function(_node) { return _node.get(\"position\").y; }),\n                _minx = Math.min.apply(Math, _xx),\n                _miny = Math.min.apply(Math, _yy),\n                _maxx = Math.max.apply(Math, _xx),\n                _maxy = Math.max.apply(Math, _yy);\n                var _scale = Math.min( (paper.view.size.width - 2 * this.renkan.options.autoscale_padding) / (_maxx - _minx), (paper.view.size.height - 2 * this.renkan.options.autoscale_padding) / (_maxy - _miny));\n                this.initialScale = _scale;\n                // Override calculated scale if asked\n                if((typeof force_view !== \"undefined\") && parseFloat(force_view.zoom_level)>0 && parseFloat(force_view.offset.x)>0 && parseFloat(force_view.offset.y)>0){\n                    this.setScale(parseFloat(force_view.zoom_level), new paper.Point(parseFloat(force_view.offset.x), parseFloat(force_view.offset.y)));\n                }\n                else{\n                    this.setScale(_scale, paper.view.center.subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale)));\n                }\n            }\n            if (nodes.length === 1) {\n                this.setScale(1, paper.view.center.subtract(new paper.Point([nodes.at(0).get(\"position\").x, nodes.at(0).get(\"position\").y])));\n            }\n        },\n        paperShift: function(_delta) {\n            this.offset = this.offset.add(_delta);\n            this.renderer.redraw();\n        },\n        updateUrl: function(){\n            if(this.options.update_url){\n                var result = {};\n                var parameters = Backbone.history.getFragment().split('?');\n                if (parameters.length > 1){\n                    parameters[1].split(\"&\").forEach(function(part) {\n                        var item = part.split(\"=\");\n                        result[item[0]] = decodeURIComponent(item[1]);\n                    });\n                }\n                result.view = Math.round(this.offset.x*1000)/1000 + ',' + Math.round(this.offset.y*1000)/1000 + ',' + Math.round(this.scale*1000)/1000;\n\n                if (this.renkan.project.get(\"views\").indexOf(this.model) > -1){\n                    result.idView = this.renkan.project.get(\"views\").indexOf(this.model);\n                } else {\n                    if (result.idView){\n                        delete result.idView;\n                    }\n                }\n                this.renkan.router.navigate(\"?\" + decodeURIComponent($.param(result)), {trigger: false, replace: true});\n            }\n        },\n    }).value();\n\n    return ViewRepr;\n\n});\n\n\n//Load modules and use them\nif( typeof require.config === \"function\" ) {\n    require.config({\n        paths: {\n            'jquery':'../lib/jquery/jquery',\n            'underscore':'../lib/lodash/lodash',\n            'filesaver' :'../lib/FileSaver/FileSaver',\n            'requtils':'require-utils',\n            'ckeditor-core':'../lib/ckeditor/ckeditor',\n            'ckeditor-jquery':'../lib/ckeditor/adapters/jquery'\n        },\n        shim: {\n            'ckeditor-jquery':{\n                deps:['jquery','ckeditor-core']\n            }\n        },\n    });\n}\n\nrequire(['renderer/baserepresentation',\n         'renderer/basebutton',\n         'renderer/noderepr',\n         'renderer/edge',\n         'renderer/tempedge',\n         'renderer/baseeditor',\n         'renderer/nodeeditor',\n         'renderer/edgeeditor',\n         'renderer/nodebutton',\n         'renderer/nodeeditbutton',\n         'renderer/noderemovebutton',\n         'renderer/nodehidebutton',\n         'renderer/nodeshowbutton',\n         'renderer/noderevertbutton',\n         'renderer/nodelinkbutton',\n         'renderer/nodeenlargebutton',\n         'renderer/nodeshrinkbutton',\n         'renderer/edgeeditbutton',\n         'renderer/edgeremovebutton',\n         'renderer/edgerevertbutton',\n         'renderer/miniframe',\n         'renderer/scene',\n         'renderer/viewrepr'\n         ], function(BaseRepresentation, BaseButton, NodeRepr, Edge, TempEdge, BaseEditor, NodeEditor, EdgeEditor, NodeButton, NodeEditButton, NodeRemoveButton, NodeHideButton, NodeShowButton, NodeRevertButton, NodeLinkButton, NodeEnlargeButton, NodeShrinkButton, EdgeEditButton, EdgeRemoveButton, EdgeRevertButton, MiniFrame, Scene, ViewRepr){\n\n    \n\n    var Rkns = window.Rkns;\n\n    if(typeof Rkns.Renderer === \"undefined\"){\n        Rkns.Renderer = {};\n    }\n    var Renderer = Rkns.Renderer;\n\n    Renderer._BaseRepresentation = BaseRepresentation;\n    Renderer._BaseButton = BaseButton;\n    Renderer.Node = NodeRepr;\n    Renderer.Edge = Edge;\n    Renderer.View = ViewRepr;\n    Renderer.TempEdge = TempEdge;\n    Renderer._BaseEditor = BaseEditor;\n    Renderer.NodeEditor = NodeEditor;\n    Renderer.EdgeEditor = EdgeEditor;\n    Renderer._NodeButton = NodeButton;\n    Renderer.NodeEditButton = NodeEditButton;\n    Renderer.NodeRemoveButton = NodeRemoveButton;\n    Renderer.NodeHideButton = NodeHideButton;\n    Renderer.NodeShowButton = NodeShowButton;\n    Renderer.NodeRevertButton = NodeRevertButton;\n    Renderer.NodeLinkButton = NodeLinkButton;\n    Renderer.NodeEnlargeButton = NodeEnlargeButton;\n    Renderer.NodeShrinkButton = NodeShrinkButton;\n    Renderer.EdgeEditButton = EdgeEditButton;\n    Renderer.EdgeRemoveButton = EdgeRemoveButton;\n    Renderer.EdgeRevertButton = EdgeRevertButton;\n    Renderer.MiniFrame = MiniFrame;\n    Renderer.Scene = Scene;\n\n    startRenkan();\n});\n\ndefine(\"main-renderer\", function(){});\n\n"]}
\ No newline at end of file