# HG changeset patch # User rougeronj # Date 1432309810 -7200 # Node ID 03e8815a012d5b1c1f8c41adbf66638e41903f77 # Parent 04b7d46e9d6780cc11f68219a4dcfcd55f692774# Parent 4732f078d0fecc226b4b790097c58a6cd30c3832 Merge with 4732f078d0fecc226b4b790097c58a6cd30c3832 diff -r 04b7d46e9d67 -r 03e8815a012d .hgtags --- a/.hgtags Fri May 22 17:48:18 2015 +0200 +++ b/.hgtags Fri May 22 17:50:10 2015 +0200 @@ -59,3 +59,4 @@ 1ebaa106b5807415a0f9a70e9ea81452df429030 V00.08.07 276042cb477ce5ae118aa30108781b65715c745a V00.08.07 e529b633c3399d6b3471b76c2638a0a9d1463539 V00.09 +ad484b4b50507b658c8adde9bd2ac615ce831141 V00.09.01 diff -r 04b7d46e9d67 -r 03e8815a012d client/README.md --- a/client/README.md Fri May 22 17:48:18 2015 +0200 +++ b/client/README.md Fri May 22 17:50:10 2015 +0200 @@ -9,21 +9,27 @@ Whatever configuration you have, you need to import those javascript files **in that order**... - - - - - - - +```html + + + + + + + +``` ... and the renkan css file : - +```html + +``` Finally, add the div in you DOM : -
+```html +
+``` Your Renkan should be displayed. Now let's see more specifically the 2 displays possibilities : in body 100% or in a div with set width and height. @@ -34,64 +40,67 @@ Nothing to add, the html is very simple : - -
- - +```html + +
+ +``` ### In a div The renkan div has the css attributes position:absolute/top:0/left:0/bottom:0/right:0, so the parent div has to be in position:relative and define width and height. Here is a simple example including css and partial html : - - - - -
- This is a header -
-
-
-
- - - +```html + + + + +
+ This is a header +
+
+
+
+ + +``` ## Embedding a read only Renkan To embed a read only Renkan, just add this script tag : - - + Rkns.jsonIO(_renkan, { + url: "any_local_or_jsonp_url" + }); + }); + +``` ## Embedding a writable Renkan @@ -101,17 +110,19 @@ To embed a simple writable Renkan, just add this script tag. In the client folder, "data/simple-persist.php" makes a very simple persistent url. The persistent url is supposed to give the json data on GET request at page load, and save datas at PUT request sent by the browser : - + Rkns.jsonIO(_renkan, { + url: "url_of_a_persistent_connection" + }); + }); + +``` ## Search and bins @@ -121,8 +132,130 @@ Search engine can be the current [IRI's Lignes de temps platform](http://ldt.iri.centrepompidou.fr/) and wikipedia in any available language. Here is an example of configuration : - _renkan = new Rkns.Renkan({ - search: [ +```js +_renkan = new Rkns.Renkan({ + search: [ + { + type: "Ldt" + }, + { + type: "Wikipedia", + lang: "fr" + }, + { + type: "Wikipedia", + lang: "ja" + } + ] +}); +Rkns.jsonIO(_renkan, { + url: "data/simple-persist.php" +}); +``` + +You can also define data bins : annotations loaded from IRI's Lignes de temps projects, and any resources which can be drag and dropped into the renkan. +Resources can be simple texts, links or objects with title, description, url and image. Here is an example of configuration : + +```js +_renkan = new Rkns.Renkan({ + search: [ + ... + ], + bins: [ + { + title: "To be or not to be on Lignes de Temps", + type: "Ldt", + ldt_type: "Project", + project_id: "6af4019c-8283-11e2-9678-00145ea4a2be", + ldt_platform: "http://ldt.iri.centrepompidou.fr/" + }, + { + type: "ResourceList", + title: "Ressources", + list: [ + { + url: "http://www.google.com/", + title: "Google", + description: "Search engine", + image: "http://www.google.fr/images/srpr/logo4w.png" + }, + "Polemic Tweet http://www.polemictweet.com", + "Twitter http://www.twitter.com/" + ] + } + ] +}); +Rkns.jsonIO(_renkan, { + url: "data/simple-persist.php" +}); +``` + + +If you embed the renkan in a div, the renkan container css should have overflow:hidden in order to hide bins when the user wants to. + +## More configuration + +You can configure several things : +* the language of your interface, english (default) or french +* you can fill your nodes with black color instead of transparent. +* thanks to an external file, you can define properties for links between node. + +```js +_renkan = new Rkns.Renkan({ + ... + property_files: [ "data/properties.json" ], + node_fill_color: true, + language: "fr" +}); +``` + +Here is an example of properties file : + +```json +[ + { + "label": "Dublin Core Metadata", + "base-uri": "http://purl.org/dc/elements/1.1/", + "properties": [ + { + "uri": "creator", + "label": "created by" + }, { + "uri": "date", + "label": "has date" + }, { + "uri": "subject", + "label": "has subject" + } + ] + }, { + "label": "SKOS Semantic relations", + "base-uri": "http://www.w3.org/2004/02/skos/core#", + "properties": [ + { + "uri": "broader", + "label": "has broader" + }, { + "uri": "narrower", + "label": "has narrower" + }, { + "uri": "related", + "label": "has related" + } + ] + } +] +``` + + +Finally, here is an example of full configuration : + +```html + - + Rkns.jsonIO(_renkan, { + url: "data/simple-persist.php" + }); + }); + +``` ## Drop management @@ -291,45 +310,145 @@ and returns a node object. A node object has title, description, image and uri properties. The \_data object is received from the browser's drop event. Here is an example of drop\_handler function : - _renkan = new Rkns.Renkan({ - ... - drop_handler: function(_data){ - var newNode = {}; - newNode.title = "Overridden title"; - newNode.description = "Overridden description " + _data["text/plain"]; - return newNode; - } - }); - +```js +_renkan = new Rkns.Renkan({ + ... + drop_handler: function(_data){ + var newNode = {}; + newNode.title = "Overridden title"; + newNode.description = "Overridden description " + _data["text/plain"]; + return newNode; + } +}); +``` You can also define a **drop\_enhancer** function that receives the already formed node object and \_data object. This function has to return the overriden node object. Here is an example of drop\_enhancer function : - _renkan = new Rkns.Renkan({ +```js +_renkan = new Rkns.Renkan({ + ... + drop_enhancer: function(newNode, _data){ + newNode.title = "Prefixed title : " + newNode.title; + return newNode; + } +}); +``` + +## Data and api + +### Data + +The data exchanged by Renkan is a json object ths following structure: +(Warning: some fields are optionals, and ) + +```json +{ + "id": "f4d002b7-d4fd-486c-8898-6c6ceebc3354", + "title": "Example of Renkan with movies", + "description": "A long description", + "created": "2013-03-18T11:32:40.253+01:00", + "updated": "2014-02-04T15:12:56.619+01:00", + "nodes": [ + { + "id": "node-2013-05-08-72c911bafdf9932c-0001", + "title": "Une femme mène l'enquête", + "description": "La caméra suit la femme qui marche\nJeu avec la caméra qui se substitue au spectateur", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/lyceehulst_3extraits/c8a61ee4-b33c-11e2-802c-00145ea4a2be#id=s_DCA8D184-EFC2-314B-0F6B-84043E8F9984", + "color": null, + "position": { + "x": -547.0499881440252, + "y": -221.5401229374163 + }, + "image": "http://ldt.iri.centrepompidou.fr/static/site/ldt/css/imgs/video_sequence.png", + "size": 0, + "project_id": "f4d002b7-d4fd-486c-8898-6c6ceebc3354", + "created_by": "de68xf75y6hs5rgjhgghxbm217xk", + "shape": "circle", + "type": "...", + "hidden": false + }, ... - drop_enhancer: function(newNode, _data){ - newNode.title = "Prefixed title : " + newNode.title; - return newNode; + ], + "edges": [ + { + "id": "edge-2013-05-08-72c911bafdf9932c-0002", + "title": "", + "description": "", + "uri": "", + "color": "#ff7f00", + "from": "node-2013-04-30-a81adec6694db5f4-0032", + "to": "node-2013-05-08-72c911bafdf9932c-0001", + "project_id": "f4d002b7-d4fd-486c-8898-6c6ceebc3354", + "created_by": "de68xf75y6hs5rgjhgghxbm217xk" + }, + ... + ], + "users": [ #optional + { + "userId": "user-2015-05-05-72c911bafdf9932c-0001", + "color": "#cc9866", + "username": "user1", + "anonymous": true + }, + ... + ], + "space_id": "17f968e4-2640-4319-aa61-b5b8b527ebb4", #Optional + "views": [ #Optional + { + "zoom_level": 0.8275032552816195, + "offset_x": 832.0104075533723, + "offset_y": 402.8917139487223 } - }); + ] +} +``` + +This data is a direct json serialisation of the data model (cf `client/js/`). + + +### IO module and server communications + +Currently 2 modules are defined to load and save data: + - save-once: data is loaded by ajax at the page initialization and saved each time the save button is clicked (floppy disc icon) + - full-json: data is loaded by ajax at the page initialization and saved each time the data is modified. + +The code of these 2 modules is rather simple and easy to adapt. the various examples in the `test` folder show how to configure them. +Both these 2 modules communicate with the server with a single endpoint. The communication is made with JSON documents and is bidirectional: 'GET' to load the project, 'POST' to send back the modified project. +the dev environement (see [dev](#dev)) offer a simple implementation of such an endpoint for testing support. The code of this endpoint is in the file `client/data/simple-persist.js`. -## Dev + +## Dev + +Renkan offers a dev environment that uses [Grunt](http://gruntjs.com/) for running tasks and [Bower](http://bower.io/) for managing dependencies. + +### Setup + +The only prerequisite is to install [nodejs](https://nodejs.org/) or [iojs](https://iojs.org/en/index.html). Once installed, the complete dev environment can be obtained with the following commands: + +```sh +$ npm i +$ ./node_modules/.bin/bower install +``` + + +### Grunt tasks We offer a environment to develop without having to build all the project manually after each change. We define few grunt task to help us -making it easier. You can launch them by running './node_modules/.bin/grunt task'. -* 'dev': will build th project but let the temporary file like templates.js to let us test the application through the test files -(see 'Tests' part below). Then it will launch a small testing server and watch the modifications of the js/css/html to build the project -again in case of any change. - +making it easier. You can launch them by running `./node_modules/.bin/grunt `. + +* `dev`: will build the project but keep the temporary file like templates.js to let us test the application through the test files (see ['Tests'](#tests) part below). Then it will launch a small web server for testing and watch the modifications of the js/css/html to build the project again in case of any change. The test server runs on port 9001 on your local machine i.e. http://localhost:9001 . The folder served is the `client/` folder. + Tasks for production : -* 'default': will build the project and clean the temporary files (like templates.js) used during development and building. -* 'copy-server': will copy the built project to the server side. - -## Tests +* `default`: will build the project and clean the temporary files (like templates.js) used during development and building. +* `copy-server`: will copy the built project ut put to the server part of this project. + + +## Tests Because of a simple php file enabling persistent connection, you can not test the writables examples by only opening them in your browser. A url like file:///path/to/folder/test-writable-\*.html will not work. -You need to run a localhost server that executes php and go to a url like http://localhost/renkan/test/test-writable-\*.html. +You need to run a localhost server that executes php and go to a url like http://localhost:9001/test/test-writable-\*.html. (cf. [Dev](#dev) above) For read only examples, it appears that for security reasons urls like file:///path/to/folder/test-readonly-\*.html only work on Firefox. -To see those examples with other browsers, you also need to run a localhost server and go to a url like http://localhost/renkan/test/test-readonly-\*.html. +To see those examples with other browsers, you also need to run a localhost server and go to a url like http://localhost:9001/test/test-readonly-\*.html. (cf. [Dev](#dev) above) diff -r 04b7d46e9d67 -r 03e8815a012d client/bower.json --- a/client/bower.json Fri May 22 17:48:18 2015 +0200 +++ b/client/bower.json Fri May 22 17:50:10 2015 +0200 @@ -1,6 +1,6 @@ { "name": "renkan", - "version": "0.8.7", + "version": "0.9.1", "authors": [ "IRI " ], diff -r 04b7d46e9d67 -r 03e8815a012d client/img/show.png Binary file client/img/show.png has changed diff -r 04b7d46e9d67 -r 03e8815a012d client/js/i18n.js --- a/client/js/i18n.js Fri May 22 17:48:18 2015 +0200 +++ b/client/js/i18n.js Fri May 22 17:50:10 2015 +0200 @@ -80,6 +80,7 @@ "Hexagone": "Hexagone", "Ellipse": "Ellipse", "Star": "Étoile", + "Cloud": "Nuage", "Zoom Fit": "Ajuster le Zoom", "Download Project": "Télécharger le projet", "Zoom Save": "Sauver le Zoom", diff -r 04b7d46e9d67 -r 03e8815a012d client/js/renderer/shapebuilder.js --- a/client/js/renderer/shapebuilder.js Fri May 22 17:48:18 2015 +0200 +++ b/client/js/renderer/shapebuilder.js Fri May 22 17:50:10 2015 +0200 @@ -2,6 +2,7 @@ define([], 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 */ var builders = { @@ -57,6 +58,19 @@ return new paper.Path.Star([0, 0], 8, radius*1, radius*0.7); } }, + "cloud": { + getShape: function() { + var path = new paper.Path(cloud_path); + return path; + + }, + getImageShape: function(center, radius) { + var path = new paper.Path(cloud_path); + path.scale(radius); + path.translate(center); + return path; + } + }, "svg": function(path){ return { getShape: function() { diff -r 04b7d46e9d67 -r 03e8815a012d client/package.json --- a/client/package.json Fri May 22 17:48:18 2015 +0200 +++ b/client/package.json Fri May 22 17:50:10 2015 +0200 @@ -1,6 +1,6 @@ { "name": "renkan", - "version": "0.9.0", + "version": "0.9.1", "description": "Renkan client application", "repository": { "type": "hg", diff -r 04b7d46e9d67 -r 03e8815a012d client/templates/nodeeditor.html --- a/client/templates/nodeeditor.html Fri May 22 17:48:18 2015 +0200 +++ b/client/templates/nodeeditor.html Fri May 22 17:50:10 2015 +0200 @@ -86,6 +86,9 @@ +

<% } %> diff -r 04b7d46e9d67 -r 03e8815a012d server/java/build.gradle --- a/server/java/build.gradle Fri May 22 17:48:18 2015 +0200 +++ b/server/java/build.gradle Fri May 22 17:50:10 2015 +0200 @@ -2,7 +2,7 @@ apply plugin: 'maven' group = 'org.iri_research.renkan' - version = '0.9.0' + version = '0.9.1' gradle.projectsEvaluated { diff -r 04b7d46e9d67 -r 03e8815a012d server/java/pom.xml --- a/server/java/pom.xml Fri May 22 17:48:18 2015 +0200 +++ b/server/java/pom.xml Fri May 22 17:50:10 2015 +0200 @@ -5,7 +5,7 @@ org.iri_research.renkan renkan pom - 0.9.0 + 0.9.1 Renkan project diff -r 04b7d46e9d67 -r 03e8815a012d server/python/django/renkanmanager/__init__.py --- a/server/python/django/renkanmanager/__init__.py Fri May 22 17:48:18 2015 +0200 +++ b/server/python/django/renkanmanager/__init__.py Fri May 22 17:50:10 2015 +0200 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -VERSION = (0, 9, 0, "final", 0) +VERSION = (0, 9, 1, "final", 0) def get_version(): diff -r 04b7d46e9d67 -r 03e8815a012d server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/renkan.css --- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/renkan.css Fri May 22 17:48:18 2015 +0200 +++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/renkan.css Fri May 22 17:50:10 2015 +0200 @@ -24,7 +24,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -/*! renkan - v0.9.0 - Copyright © IRI 2015 */ +/*! renkan - v0.9.1 - Copyright © IRI 2015 */ /*! * _____ _ diff -r 04b7d46e9d67 -r 03e8815a012d server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/renkan.min.css --- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/renkan.min.css Fri May 22 17:48:18 2015 +0200 +++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/renkan.min.css Fri May 22 17:50:10 2015 +0200 @@ -24,7 +24,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -/*! renkan - v0.9.0 - Copyright © IRI 2015 */ +/*! renkan - v0.9.1 - Copyright © IRI 2015 */ /*! diff -r 04b7d46e9d67 -r 03e8815a012d server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/space-editor.css --- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/space-editor.css Fri May 22 17:48:18 2015 +0200 +++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/space-editor.css Fri May 22 17:50:10 2015 +0200 @@ -24,7 +24,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -/*! renkan - v0.9.0 - Copyright © IRI 2015 */ +/*! renkan - v0.9.1 - Copyright © IRI 2015 */ html { overflow: visible !important; diff -r 04b7d46e9d67 -r 03e8815a012d server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/space-editor.min.css --- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/space-editor.min.css Fri May 22 17:48:18 2015 +0200 +++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/css/space-editor.min.css Fri May 22 17:50:10 2015 +0200 @@ -24,7 +24,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -/*! renkan - v0.9.0 - Copyright © IRI 2015 */ +/*! renkan - v0.9.1 - 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 diff -r 04b7d46e9d67 -r 03e8815a012d server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.js --- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.js Fri May 22 17:48:18 2015 +0200 +++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.js Fri May 22 17:50:10 2015 +0200 @@ -24,7 +24,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -/*! renkan - v0.9.0 - Copyright © IRI 2015 */ +/*! renkan - v0.9.1 - Copyright © IRI 2015 */ this["renkanJST"] = this["renkanJST"] || {}; diff -r 04b7d46e9d67 -r 03e8815a012d server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.min.js --- a/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.min.js Fri May 22 17:48:18 2015 +0200 +++ b/server/python/django/renkanmanager/static/renkanmanager/lib/renkan/js/renkan.min.js Fri May 22 17:50:10 2015 +0200 @@ -24,7 +24,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -/*! renkan - v0.9.0 - Copyright © IRI 2015 */ +/*! renkan - v0.9.1 - Copyright © IRI 2015 */ this.renkanJST=this.renkanJST||{},this.renkanJST["templates/colorpicker.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='
  • ';return __p},this.renkanJST["templates/edgeeditor.html"]=function(obj){obj||(obj={});{var __t,__p="",__e=_.escape;Array.prototype.join}with(obj)__p+='

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

    \n

    \n \n \n

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

    \n \n \n \n

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

    \n \n \n

    \n")),__p+="\n",options.show_edge_editor_color&&(__p+='\n
    \n '+__e(renkan.translate("Edge color:"))+'\n
    \n \n \n \n '+(null==(__t=renkan.colorPicker)?"":__t)+'\n '+__e(renkan.translate("Choose color"))+"\n
    \n
    \n"),__p+="\n",options.show_edge_editor_direction&&(__p+='\n

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

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

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

    \n

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

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

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

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

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

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

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

    \n"),__p+="\n

    "+__e(edge.description)+"

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

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

    \n

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

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

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

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

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

    \n

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

    \n

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

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

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

    \n

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

    \n

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

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

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

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

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

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

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

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

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

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

        \n \n \n

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

        \n \n \n \n

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

        \n \n \n

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

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

        \n'),__p+=" ",options.show_node_editor_color&&(__p+='\n
        \n \n '+__e(renkan.translate("Node color:"))+'\n
        \n \n \n \n '+(null==(__t=renkan.colorPicker)?"":__t)+'\n '+__e(renkan.translate("Choose color"))+"\n
        \n
        \n"),__p+=" ",options.show_node_editor_image&&(__p+='\n
        \n
        \n \n ',node.clip_path&&(__p+='\n \n \n \n '),__p+="\n
        \n
        \n

        \n \n

        \n \n \n
        \n

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

        \n \n \n

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

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

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

        \n \n \n

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

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

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

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

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

        '+__e(node.description)+"

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

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

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

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

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

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

          \n

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

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

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

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

          "),this.title_$.html(c.title||"(new bin)"),this.renkan.resizeBins(),c.auto_refresh&&window.setInterval(function(){d.refresh()},c.auto_refresh)}};e.prototype.destroy=function(){this.$.detach(),this.renkan.resizeBins()};var f=b.Renkan=function(a){var e=this;if(b.__renkans.push(this),this.options=d.defaults(a,b.defaults,{templates:renkanJST}),this.template=renkanJST["templates/main.html"],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.project=new b.Models.Project,this.setCurrentUser=function(a,b){this.project.addUser({_id:a,title:b}),this.current_user=a,this.renderer.redrawUsers()},"undefined"!=typeof this.options.user_id&&(this.current_user=this.options.user_id),this.$=b.$("#"+this.options.container),this.$.addClass("Rk-Main").html(this.template(this)),this.tabs=[],this.search_engines=[],this.current_user_list=new b.Models.UsersList,this.current_user_list.on("add remove",function(){this.renderer&&this.renderer.redrawUsers()}),this.colorPicker=function(){var a=renkanJST["templates/colorpicker.html"];return'
            '+b.pickerColors.map(function(b){return a({c:b})}).join("")+"
          "}(),this.options.show_editor&&(this.renderer=new b.Renderer.Scene(this)),this.options.search.length){var f=renkanJST["templates/search.html"],g=this.$.find(".Rk-Search-List"),h=this.$.find(".Rk-Web-Search-Input"),i=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))}),g.html(d(this.search_engines).map(function(a,b){return f({key:b,title:a.getSearchTitle(),className:a.getBgClass()})}).join("")),g.find("li").click(function(){var a=b.$(this);e.setSearchEngine(a.attr("data-key")),i.submit()}),i.submit(function(){if(h.val()){var a=e.search_engine;a.search(h.val())}return!1}),this.$.find(".Rk-Search-Current").mouseenter(function(){g.slideDown()}),this.$.find(".Rk-Search-Select").mouseleave(function(){g.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 j=!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(){j=!1}).on("touchmove",".Rk-Bin-Item",function(a){a.preventDefault();var b=a.originalEvent.changedTouches[0],c=e.renderer.canvas_$.offset(),d=e.renderer.canvas_$.width(),f=e.renderer.canvas_$.height();if(b.pageX>=c.left&&b.pageX=c.top&&b.pageY1?a:null);c.source!==k&&(k=c.source,d.each(e.tabs,function(a){a.render(c)}))}}),this.$.find(".Rk-Bins-Search-Form").submit(function(){return!1})};f.prototype.translate=function(a){return b.i18n[this.options.language]&&b.i18n[this.options.language][a]?b.i18n[this.options.language][a]:this.options.language.length>2&&b.i18n[this.options.language.substr(0,2)]&&b.i18n[this.options.language.substr(0,2)][a]?b.i18n[this.options.language.substr(0,2)][a]:a},f.prototype.onStatusChange=function(){this.renderer.onStatusChange()},f.prototype.setSearchEngine=function(a){this.search_engine=this.search_engines[a],this.$.find(".Rk-Search-Current").attr("class","Rk-Search-Current "+this.search_engine.getBgClass());for(var b=this.search_engine.getBgClass().split(" "),c="",d=0;da?"0"+a:a}var b=new Date,c=0,d=b.getUTCFullYear()+"-"+a(b.getUTCMonth()+1)+"-"+a(b.getUTCDate())+"-"+g();return function(a){for(var b=(++c).toString(16),e="undefined"==typeof a?"":a+"-";b.length<4;)b="0"+b;return e+d+"-"+b}}(),getFullURL:function(a){if("undefined"==typeof a||null==a)return"";if(/https?:\/\//.test(a))return a;var b=new Image;b.src=a;var c=b.src;return b.src=null,c},inherit:function(a,b){var c=function(){"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