| author | ymh <ymh.work@gmail.com> |
| Thu, 05 Jan 2017 16:26:07 +0100 | |
| changeset 647 | eaaa1efce396 |
| parent 646 | 61c45e41a515 |
| child 648 | e388117572d8 |
--- a/.hgignore Tue Oct 04 16:40:25 2016 +0200 +++ b/.hgignore Thu Jan 05 16:26:07 2017 +0100 @@ -18,7 +18,8 @@ ^build$ ^client/node_modules$ ^client/dist$ -^client/data/example-cinema\.json$ +^client/data/json/ +^client/data/templates/ ^client/data/dynamic-data\.json$ spring-shell.log ^server/python/django/build$
--- a/client/README.md Tue Oct 04 16:40:25 2016 +0200 +++ b/client/README.md Thu Jan 05 16:26:07 2017 +0100 @@ -195,7 +195,7 @@ ## More configuration -You can configure several things : +You can configure several things here are some examples: * 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. @@ -302,6 +302,73 @@ </script> ``` +All the possible configurations (with some minimal documentation) are found in the `js/defaults.js` file. + + +## Templates configuration + +A significant part of the renkan dialogs and interface are defined in templates and these templates cant be overrided. +The template system uses `underscore` templates ([http://underscorejs.org/#template](http://underscorejs.org/#template)). +The templates are compiled beforehand (c.f. `jst` `bower` task). + +The list of templates is found under the `templates/` directory. + +2 options control the template system `templates` and `node_editor-templates`, examples : + +```js +_renkan = new Rkns.Renkan({ + ... + templates: custom_templates, + node_editor_templates: { + "audio": "nodeeditor_audio" + } + ... +}); +``` + +Example of such settings can be found in the following files : + +- `test/test-readonly-custom-templates.html`, +- `test/test-readonly-custom-templates-youtube.html`, +- `test/test-writable-custom-templates.html`, +- `test/test-writable-custom-templates-youtube.html` + +### `templates` parameter + +This must be a dictionary of JST templates (keys : string and values are JST compiled templates). This dictionnary will be merged with the default templates dictionnary. +its default key list are : +- `templates/colorpicker.html`: color picker template +- `templates/edgeeditor_readonly.html`: template for edges popup in read mode +- `templates/edgeeditor.html`: template for the edge editor in write mode +- `templates/main.html`: mais display template +- `templates/nodeeditor.html`: template for node editor in write mode +- `templates/nodeeditor_readonly.html`: template for nodes popup in read mode with `default` node type +- `templates/nodeeditor_video.html`: template for nodes popup in read mode with `video` node type. This displays a simple video html5 element with the node uri as single video source. +- `templates/scene.html`: The renkan editor and display main template +- `templates/search.html`: Search result for web search bin +- `templates/wikipedia-bin/resulttemplate.html`: template for wikipedia search result (wikipedia bin) +- `templates/ldtjson-bin/annotationtemplate.html`: template for ldt project annotation (ldt bin) +- `templates/ldtjson-bin/segmenttemplate.html`: template for ldt project segment (ldt bin) +- `templates/ldtjson-bin/tagtemplate.html`: template for ldt project tags (ldt bin) +- `templates/list-bin.html`: template for bin result list + + +### `node_editor_templates` parameter + +This dictionnary gives a mapping between node types and the keys for "read-mode" templates for node. +The keys are node types, the value are templates keys (c.f. above `templates` parameter). + +This dictionnary is merged with the default dictionnary and the keys of the result will populate the dropdown list for types in the node editor. + +The value of the default dictionnary is: + +```js +{ + default: "templates/nodeeditor_readonly.html", + video: "templates/nodeeditor_video.html" +} +``` + ## Url Parameters Renkan accepts few Hash parameters allowing you to change the view, navigate in the map, highlight some nodes, etc. (e.g: http://myrenkan.com/renkan1/#?viewIndex=2&idNode=12345) @@ -461,6 +528,7 @@ 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 part of this project. +* `jst` with `jst:compile` and `jst:compile-test`: are compiling the templates in `templates/` and `test/templates` respectively. ## <a name="tests"></a>Tests
--- a/client/bower.json Tue Oct 04 16:40:25 2016 +0200 +++ b/client/bower.json Thu Jan 05 16:26:07 2017 +0100 @@ -26,7 +26,7 @@ "dependencies": { "backbone": "~1.2.3", "backbone-relational": "a7634e7d9deac64e3da455a3fde13b96ae253612", - "ckeditor": "~4.4.7", + "ckeditor": "~4.6", "FileSaver": "*", "jquery": "~2.1.4", "jquery-mousewheel": "~3.1.13", @@ -37,5 +37,13 @@ }, "devDependencies": { "jquery-ui": "~1.11.4" + }, + "exportsOverride": { + "ckeditor": { + ".": ["*.js", "*.css"], + "lang": "lang/", + "plugins": "plugins/", + "skins": "skins/" + } } }
--- a/client/css/renkan.css Tue Oct 04 16:40:25 2016 +0200 +++ b/client/css/renkan.css Thu Jan 05 16:26:07 2017 +0100 @@ -534,6 +534,10 @@ background: #c0c0c0; } +.Rk-Display-Title { + display: inline-flex; +} + .Rk-Display-Title a { text-decoration: none; color: #000000; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/data/example-cinema-src-youtube.json Thu Jan 05 16:26:07 2017 +0100 @@ -0,0 +1,637 @@ +{ + "id": "f4d002b7-d4fd-486c-8898-6c6ceebc3354", + "schema_version": "2", + "title": "Example of Renkan with movies for tests", + "description": "(empty description)", + "uri": null, + "color": null, + "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", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/lyceehulst_3extraits/c8a61ee4-b33c-11e2-802c-00145ea4a2be#id=s_DCA8D184-EFC2-314B-0F6B-84043E8F9984", + "description": "La caméra suit la femme qui marche\nJeu avec la caméra qui se substitue au spectateur", + "position": { + "x": -547.0499881440252, + "y": -221.5401229374163 + }, + "image": "http://ldt.iri.centrepompidou.fr/static/site/ldt/css/imgs/video_sequence.png", + "style": {}, + "created_by": null, + "size": 0, + "shape": "circle" + }, { + "_id": "node-2013-05-13-972beaa77e0e2a65-0009", + "title": "Vue ldt : Alternance blonde - brune", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/space/ldt/indexproject/c8a61ee4-b33c-11e2-802c-00145ea4a2be#view=v_B6D820E4-24AE-93A9-7AED-65E0C9D39126", + "description": "L'alternance des plans renforce l'opposition entre les deux types féminins", + "position": { + "x": 349.5205871443019, + "y": -13.963389709349634 + }, + "image": "http://www.iri.centrepompidou.fr/res/img/ldt.jpg", + "style": { + "color": "#ff7f00" + }, + "created_by": null, + "size": 6, + "shape": "rectangle" + }, { + "_id": "node-2013-04-30-a81adec6694db5f4-0032", + "title": "L'icône féminine", + "uri": "", + "description": "La femme mène l'enquête\nLe film s'inspire du roman \"A long saturday night\" qui raconte une histoire criminelle du point de vue de l’héroïne, une simple secrétaire.", + "position": { + "x": -20.019317897574606, + "y": -283.2440622074009 + }, + "image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBhQSEBUUExMVFRUWFRgXGBgWGBUVFBQXFRUVFBQXFRcYHCYeFxojGRUUHy8gJCcpLCwsFR4xNTAqNSYrLCkBCQoKBQUFDQUFDSkYEhgpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKf/AABEIAKkBKwMBIgACEQEDEQH/xAAbAAACAgMBAAAAAAAAAAAAAAAFBgMEAAECB//EAEMQAAEDAgQCBgUKBAYDAQEAAAEAAgMEEQUSITFBUQYTImFxkTJCgaHBBxQVIzNScrGy0WKC4fAWJDRTY3NDg5LCNf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwDw9NvybAfOn3F/qj+pqUkw9CcT6idzspddhFh4g/BB601reQ8lt4AF8vuCXWdNP+F3LcLtvTX/AIXb23CC++ok36oeSIwWIHZ9yA/40/4Xb23G62OmbuEJ3t6Q3QMT2ger7lvqWkWLfcEu/wCM3/7HG3pDdb/xjJr9SN7elxQMApmgWDfcFtkLeEZ8ggLelsv+03fL6XHyXZ6WS6/Vt0cG7nfyQMApx90eQVPEMN6xtur49wQ2TpTK1rnFjBlNj6X7Lmg6UTTSFrGty/eN/wAkF6SRt2sa0XDhcW4BD3Ya8zShjwO1cCw4omyFwmaXWuQb28QtVLclQXXsDoUAjGqZkbWmSPPfQW4HvVCreBHpABqLc0fxGsjcGgEOIPP+7qjVhr26HtcAQR5XCBdNY2/2Th4Llle2/ovt4K88EACxvfVakidc2tYIIWYhFbXMPYVj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8SEPpv9S//ALG/oCsv/wBZ/wCp/wCbUHncT2SBocMgAIJHd4q+DStfGSS4Zbd3ieIQ6u9D+Zypw+lH4oGGDGSA1sMYGrhrqbeK3hsbiyQ1Jdl1sCePdyWYH6H87viua310HLsaaGxGGLVpy6i59llNV4jUskedA1zdOAF+RPFVcH+xH4110k9RBXqsQMzmNleANzYctBr4BT0M0IdG7I95L3HjYE7DvQKo9Jv4R8Uw0/8ApG+1ASoJnOfEcogEYdZt7OLi1zeJF91doKTry50ubI0kbHtEb+J4ckBov/55/H8QmJ/o+f5oCz8RytDW9gAAADWw5XUZxI/ePxQGRRt3QMHz42PHjbifBdR1I3QHiF0UB19VyK5ZU8yggXMvBAc+dDmt9cEvhTIDBkCifOha5QF+tbzOyjM3ehC0EBbr1x84CFlcIC5qAhHSaYGll8B+oLkobjv2D/D4hAmLFixB/9k=", + "style": { + "color": "#ff7f00" + }, + "created_by": null, + "size": 11, + "shape": "star" + }, { + "_id": "node-2013-04-30-a81adec6694db5f4-002e", + "title": "Problématiques retenues", + "uri": "", + "description": "", + "position": { + "x": -532.0081389762616, + "y": -613.5865894931834 + }, + "image": "", + "style": { + "color": "#ff00fe" + }, + "created_by": null, + "size": -3 + }, { + "_id": "node-2013-04-30-a81adec6694db5f4-0024", + "title": "Extrait du film : le bureau de la secrétaire", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/francoistruffaut_vivementdimanche/c8a61ee4-b33c-11e2-802c-00145ea4a2be/c_52E9CBF0-E128-5F0E-8A25-EE35681843E6#id=s_F86DEBA8-8F9D-2958-4E3C-EE35FF18D473", + "description": "", + "position": { + "x": -309.079489645626, + "y": 311.84296698092794 + }, + "image": "http://avarap44.files.wordpress.com/2012/01/video-logo.jpg", + "style": { + "color": "#ff7f00" + }, + "created_by": null, + "size": 6, + "shape": "diamond" + }, { + "_id": "node-2013-04-30-a81adec6694db5f4-001e", + "title": "Vue ldt : Importance de la musique", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/space/ldt/indexprojectfull/c8a61ee4-b33c-11e2-802c-00145ea4a2be#view=v_F6CB62DE-F9B1-361B-0EB8-65E0C9D3003B", + "description": "En lien avec la dramatisation de la scène.", + "position": { + "x": -1111.0132504067942, + "y": 294.15874530400157 + }, + "image": "http://www.iri.centrepompidou.fr/res/img/ldt.jpg", + "style": { + "color": "#26d8d8" + }, + "created_by": null, + "size": 7, + "shape": "polygon" + }, { + "_id": "node-2013-04-30-a81adec6694db5f4-0016", + "title": "Observation des codes du film noir", + "uri": "", + "description": "Travail d'annotation sur l'interface Lignes de temps", + "position": { + "x": -1382.8484415334635, + "y": -498.023061280594 + }, + "image": "", + "style": {}, + "created_by": null, + "size": 0, + "shape": "svg:M0.5 0 L1 1 L0 1 Z" + }, { + "_id": "node-2013-04-30-a81adec6694db5f4-0014", + "title": "Vue ldt : Importance des jeux d'ombre", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/space/ldt/indexprojectfull/c8a61ee4-b33c-11e2-802c-00145ea4a2be#view=v_9A385A2B-2FA0-AF18-72AB-65E0C9D36555", + "description": "", + "position": { + "x": -1751.1751254634255, + "y": 304.5381731494741 + }, + "image": "http://www.iri.centrepompidou.fr/res/img/ldt.jpg", + "style": { + "color": "#26d8d8" + }, + "created_by": null, + "size": 7, + "shape": "ellipse" + }, { + "_id": "node-2013-04-30-a81adec6694db5f4-0010", + "title": "Extrait Fenêtre sur cour Hitchcock", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/lyceehulst_3extraits/61a44516-bbcc-11e2-9e59-00145ea4a2be/c_54D71D8D-BBCA-14DE-4849-9E97DEB64DFF#id=s_EB846895-D839-0E7C-1FA9-A8603C42F380", + "description": "Test de description", + "position": { + "x": -1410.7435362858853, + "y": -1003.6058336782048 + }, + "image": "https://upload.wikimedia.org/wikipedia/commons/f/f8/Rearwindow_trailer_2.jpg", + "style": { + "color": "#8f5419" + }, + "created_by": null, + "size": 0 + }, { + "_id": "node-2013-04-30-a81adec6694db5f4-000f", + "title": "Extrait Psychose Hitchcock", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/lyceehulst_3extraits/61a44516-bbcc-11e2-9e59-00145ea4a2be/c_6F29C282-B8D8-EC22-8B1C-9E95ED71CCA3#id=s_800825D1-335D-D163-B9F3-9E962E0C977E", + "description": "", + "position": { + "x": -1786.2838981312163, + "y": -232.37513406676942 + }, + "image": "http://avarap44.files.wordpress.com/2012/01/video-logo.jpg", + "style": {}, + "created_by": null, + "size": 4 + }, { + "_id": "node-2013-04-30-a81adec6694db5f4-000c", + "title": "Extrait Le grand sommeil H. Hawks", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/lyceehulst_3extraits/61a44516-bbcc-11e2-9e59-00145ea4a2be/c_54D71D8D-BBCA-14DE-4849-9E97DEB64DFF#id=s_02545015-0F0A-3D64-266B-9E97E4ED2890", + "description": "", + "position": { + "x": -1759.4348517245849, + "y": -737.3376287222228 + }, + "image": "http://avarap44.files.wordpress.com/2012/01/video-logo.jpg", + "style": {}, + "created_by": null, + "size": 3 + }, { + "_id": "node-2013-04-17-d90d0ad681cdac6f-0002", + "title": "Truffaut réalisateur ", + "uri": "http://cinema.encyclopedie.personnalites.bifi.fr/index.php?pk=12833", + "description": "Sources : Bifi", + "position": { + "x": 424.33056693472236, + "y": -611.2418400941077 + }, + "image": "http://cinema.encyclopedie.personnalites.bifi.fr/images/fiche_bio/b005/img0024.jpg", + "style": {}, + "created_by": null, + "size": 6 + }, { + "_id": "node-2013-04-09-95a3e1d59da173c8-0009", + "title": "Pratique cinématographique avec intervenant", + "uri": "", + "description": "", + "position": { + "x": 331.42281879046783, + "y": -1045.1131070372853 + }, + "image": "", + "style": { + "color": "#8f1919" + }, + "created_by": null, + "size": 2 + }, { + "_id": "node-2013-04-06-e1c743b12401d6ec-0006", + "title": "Etude du film en classe", + "uri": "http://www.elettra.fr/programme2013/pistes-truffaut-vivement-dimanche/", + "description": "", + "position": { + "x": -544.0579347270175, + "y": -910.7812080562986 + }, + "image": "http://4.bp.blogspot.com/-Jf278-2wdC0/TzfixttS3QI/AAAAAAAAAHw/pOMxuWvuTTU/s1600/Gaff1919306662.jpg", + "style": { + "color": "#ff00fe" + }, + "created_by": null, + "size": 12 + }, { + "_id": "node-2013-04-06-e1c743b12401d6ec-0002", + "title": "Le film noir", + "uri": "", + "description": "Truffaut grandit avec la Série noire.\nIl adaptera 5 livres de cette collection littéraire :\n- D.Goodis Tirez sur le pianiste (1960)\n- W.Irish La mariée était en noir (1967) et La sirène du Mississipi (1969)\n- H.Farrel Une belle fille comme moi (1972)\n- CH.Williams Vivement dimanche (1983)\n", + "position": { + "x": -1039.5662672539652, + "y": -277.2568859610449 + }, + "image": "http://2.bp.blogspot.com/-qXdBRoEKlac/TwNuUBzE2_I/AAAAAAAAAc4/nuRJymKg6sc/s1600/Vivement%2Bdimanche%2B2.jpg", + "style": { + "color": "#00feff" + }, + "created_by": null, + "size": 11, + "shape": "ellipse" + }, { + "_id": "node-2017-01-03-2de8733c-6b7b-44f3-a4d3-f6f627cf600d-0001", + "title": "<p>test youtube</p>\n", + "uri": "https://youtu.be/e0eJXttPRZI", + "description": "", + "position": { + "x": -421.27673900295343, + "y": 37.76850570323789 + }, + "image": "http://i3.ytimg.com/vi/e0eJXttPRZI/hqdefault.jpg", + "style": { + "dash": false + }, + "created_by": null, + "size": 9, + "shape": "circle", + "type": "youtube" + }], + "edges": [{ + "_id": "edge-2013-05-08-72c911bafdf9932c-0002", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-30-a81adec6694db5f4-0032", + "to": "node-2013-05-08-72c911bafdf9932c-0001", + "style": { + "color": "#ff7f00" + }, + "created_by": null + }, { + "_id": "edge-2013-05-13-972beaa77e0e2a65-000e", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-05-08-72c911bafdf9932c-0001", + "to": "node-2013-04-30-a81adec6694db5f4-0010", + "style": { + "color": "#ff7f00" + }, + "created_by": null + }, { + "_id": "edge-2013-05-13-972beaa77e0e2a65-000c", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-05-13-972beaa77e0e2a65-0009", + "to": "node-2013-04-30-a81adec6694db5f4-0024", + "style": { + "color": "#ff7f00" + }, + "created_by": null + }, { + "_id": "edge-2013-05-13-972beaa77e0e2a65-000b", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-30-a81adec6694db5f4-0024", + "to": "node-2013-05-13-972beaa77e0e2a65-0009", + "style": { + "color": "#ff7f00" + }, + "created_by": null + }, { + "_id": "edge-2013-05-13-972beaa77e0e2a65-000a", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-30-a81adec6694db5f4-0032", + "to": "node-2013-05-13-972beaa77e0e2a65-0009", + "style": { + "color": "#ff7f00" + }, + "created_by": null + }, { + "_id": "edge-2013-05-13-972beaa77e0e2a65-0008", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-30-a81adec6694db5f4-001e", + "to": "node-2013-04-30-a81adec6694db5f4-000f", + "style": { + "color": "#198f19" + }, + "created_by": null + }, { + "_id": "edge-2013-05-13-972beaa77e0e2a65-0007", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-30-a81adec6694db5f4-0014", + "to": "node-2013-04-30-a81adec6694db5f4-000f", + "style": { + "color": "#00a800" + }, + "created_by": null + }, { + "_id": "edge-2013-04-30-a81adec6694db5f4-003a", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-30-a81adec6694db5f4-002e", + "to": "node-2013-04-30-a81adec6694db5f4-0032", + "style": { + "color": "#ff00fe" + }, + "created_by": null + }, { + "_id": "edge-2013-04-30-a81adec6694db5f4-0036", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-06-e1c743b12401d6ec-0006", + "to": "node-2013-04-30-a81adec6694db5f4-002e", + "style": { + "color": "#ff00fe" + }, + "created_by": null + }, { + "_id": "edge-2013-04-30-a81adec6694db5f4-0034", + "title": "Extrait", + "uri": "", + "description": "", + "from": "node-2013-04-30-a81adec6694db5f4-0032", + "to": "node-2013-04-30-a81adec6694db5f4-0024", + "style": { + "color": "#ff7f00" + }, + "created_by": null + }, { + "_id": "edge-2013-04-30-a81adec6694db5f4-002f", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-30-a81adec6694db5f4-002e", + "to": "node-2013-04-06-e1c743b12401d6ec-0002", + "style": { + "color": "#ff00fe" + }, + "created_by": null + }, { + "_id": "edge-2013-04-30-a81adec6694db5f4-001f", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-06-e1c743b12401d6ec-0002", + "to": "node-2013-04-30-a81adec6694db5f4-001e", + "style": { + "color": "#26d8d8" + }, + "created_by": null + }, { + "_id": "edge-2013-04-30-a81adec6694db5f4-001d", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-06-e1c743b12401d6ec-0002", + "to": "node-2013-04-30-a81adec6694db5f4-0016", + "style": { + "color": "#0000a8" + }, + "created_by": null + }, { + "_id": "edge-2013-04-30-a81adec6694db5f4-001c", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-30-a81adec6694db5f4-0016", + "to": "node-2013-04-30-a81adec6694db5f4-000f", + "style": {}, + "created_by": null + }, { + "_id": "edge-2013-04-30-a81adec6694db5f4-001b", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-30-a81adec6694db5f4-0016", + "to": "node-2013-04-30-a81adec6694db5f4-0010", + "style": {}, + "created_by": null + }, { + "_id": "edge-2013-04-30-a81adec6694db5f4-001a", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-30-a81adec6694db5f4-0016", + "to": "node-2013-04-30-a81adec6694db5f4-000c", + "style": {}, + "created_by": null + }, { + "_id": "edge-2013-04-30-a81adec6694db5f4-0015", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-06-e1c743b12401d6ec-0002", + "to": "node-2013-04-30-a81adec6694db5f4-0014", + "style": { + "color": "#26d8d8" + }, + "created_by": null + }, { + "_id": "edge-2013-04-30-a81adec6694db5f4-0008", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-09-95a3e1d59da173c8-0009", + "to": null, + "style": {}, + "created_by": null + }, { + "_id": "edge-2013-04-30-a81adec6694db5f4-0007", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-09-95a3e1d59da173c8-0009", + "to": null, + "style": {}, + "created_by": null + }, { + "_id": "edge-2013-04-17-cd4aac6129e71e47-0001", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-06-e1c743b12401d6ec-0006", + "to": "node-2013-04-17-d90d0ad681cdac6f-0002", + "style": {}, + "created_by": null + }, { + "_id": "edge-2013-04-09-95a3e1d59da173c8-000b", + "title": "", + "uri": "", + "description": "", + "from": "node-2013-04-06-e1c743b12401d6ec-0006", + "to": "node-2013-04-09-95a3e1d59da173c8-0009", + "style": { + "color": "#00feff" + }, + "created_by": null + }], + "users": [ + { + "userId": null, + "color": "#cc9866", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#667dcc", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#7ccc66", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#66ccb1", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#89cc66", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#6683cc", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#92cc66", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#ccba66", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#68cc66", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#66cc93", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#8bcc66", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#9fcc66", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#ccc266", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#66cc85", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#cc9766", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#cc66a9", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#ccaa66", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#9d66cc", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#a7cc66", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#66cc68", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#668ccc", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#66c9cc", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#66ccb5", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#b4cc66", + "username": null, + "anonymous": true + }, + { + "userId": null, + "color": "#bbfdb1", + "username": null, + "anonymous": true + } + ], + "views": [{ + "_id": "view-2014-02-18-628af15b-12ad-457a-8ac0-a28c8998cc3b-0001", + "zoom_level": 0.8275032552816195, + "title": "", + "description": "", + "created_by": null + }, { + "_id": "view-2014-02-18-628af15b-12ad-457a-8ac0-a28c8998cc3b-0002", + "zoom_level": 0.8275032552816195, + "title": "", + "description": "", + "created_by": null, + "hidden_nodes": ["node-2013-04-06-e1c743b12401d6ec-0002", "node-2013-04-06-e1c743b12401d6ec-0006"] + }] +}
--- a/client/data/simple-persist.js Tue Oct 04 16:40:25 2016 +0200 +++ b/client/data/simple-persist.js Thu Jan 05 16:26:07 2017 +0100 @@ -2,37 +2,59 @@ var path = require('path'), fs = require('fs'); -var jsonFile = path.join(__dirname,"example-cinema.json"); -var resetFile = path.join(__dirname,"example-cinema-src.json"); +var jsonFilesBase = path.join(__dirname,"json/example-cinema"); +var resetFilesBase = path.join(__dirname,"example-cinema-src"); + +function getJsonFile(key) { + return jsonFilesBase + (key?("-" + key):"") + ".json"; +} + +function getResetFile(key) { + return resetFilesBase + (key?("-" + key):"") + ".json"; +} + +function createWriteStreamJson(file) { + var dir = path.join(__dirname, 'json'); + if (!fs.existsSync(dir)){ + fs.mkdirSync(dir); + } + return fs.createWriteStream(file); +} exports.middleware = function(req, res, next) { 'use strict'; + + var params = require('url').parse(req.url, true); - if (req.url !== '/simple-persist') { + if (params.pathname !== '/simple-persist') { return next(); } + var key = params.query.key; + + var jsonFile = getJsonFile(key); + var resetFile = getResetFile(key); + res.setHeader('Content-Type', 'application/json; charset=utf-8'); res.statusCode = 200; if(req.method === "PUT" || req.method === "POST") { - req.pipe(fs.createWriteStream(jsonFile)); + req.pipe(createWriteStreamJson(jsonFile)); setTimeout(function () { res.end(JSON.stringify({result: "OK"})); }, 3000); } else { - var params = require('url').parse(req.url), - readStream; - if('reset' in params && params.reset) { + var readStream; + if('reset' in params.query && params.query.reset) { readStream = fs.createReadStream(resetFile); - readStream.pipe(fs.createWriteStream(jsonFile)); + readStream.pipe(createWriteStreamJson(jsonFile)); } else { readStream = fs.createReadStream(jsonFile); readStream.on('error',function() { var srcFile = fs.createReadStream(resetFile); - srcFile.pipe(fs.createWriteStream(jsonFile)); + srcFile.pipe(createWriteStreamJson(jsonFile)); srcFile.pipe(res); }); }
--- a/client/gruntfile.js Tue Oct 04 16:40:25 2016 +0200 +++ b/client/gruntfile.js Thu Jan 05 16:26:07 2017 +0100 @@ -41,7 +41,7 @@ underscore: "empty:", filesaver: "empty:", 'ckeditor-core': "empty:", - 'screenfull': "empty:" + screenfull: "empty:" }, include: [ "jquery-private"], } @@ -54,9 +54,20 @@ //amd: true }, files: { - "dist/js/templates.js": ["templates/**/*.html"] + "dist/js/templates.js": ["templates/**/*.html"], + } + }, + compile_test: { + options: { + namespace: 'renkanJSTTest', + //amd: true + }, + files: { + "data/templates/youtube_template.js": ["test/templates/youtube_template.html"], + "data/templates/audio_template.js": ["test/templates/audio_template.html"] } } + }, uglify: { options: { @@ -221,8 +232,8 @@ tasks: ['cssmin', 'copy:renkan_css'], }, js: { - files: ['js/**/*.js', 'templates/**/*.html'], - tasks: ['jshint', 'requirejs', 'jst', 'concat', 'uglify', 'copy:renkan', 'clean:renderer'], + files: ['js/**/*.js', 'templates/**/*.html', 'test/templates/*.html'], + tasks: ['jshint', 'requirejs', 'jst:compile', 'jst:compile_test', 'concat', 'uglify', 'copy:renkan', 'clean:renderer'], }, lib: { files: ['bower.json'], @@ -340,7 +351,8 @@ 'copy:vendors', 'clean:renkan', 'requirejs', - 'jst', + 'jst:compile', + 'jst:compile_test', 'concat', 'uglify', 'cssmin',
--- a/client/js/defaults.js Tue Oct 04 16:40:25 2016 +0200 +++ b/client/js/defaults.js Thu Jan 05 16:26:07 2017 +0100 @@ -34,6 +34,10 @@ force_resize: false, allow_double_click: true, /* Allows Double Click to create a node on an empty background */ + double_click_open_url: true, + /* In read_only mode open node uri in new window with a double click */ + simple_click_open_url: false, + /* In read_only mode open node uri in new window with a simple click (do not disable the double click) */ zoom_on_scroll: true, /* Allows to use the scrollwheel to zoom */ element_delete_delay: 0,
--- a/client/js/ldtjson-bin.js Tue Oct 04 16:40:25 2016 +0200 +++ b/client/js/ldtjson-bin.js Thu Jan 05 16:26:07 2017 +0100 @@ -17,12 +17,11 @@ var ProjectBin = Ldt.ProjectBin = Rkns.Utils.inherit(Rkns._BaseBin); -ProjectBin.prototype.tagTemplate = renkanJST['templates/ldtjson-bin/tagtemplate.html']; - -ProjectBin.prototype.annotationTemplate = renkanJST['templates/ldtjson-bin/annotationtemplate.html']; ProjectBin.prototype._init = function(_renkan, _opts) { this.renkan = _renkan; + this.tagTemplate = _renkan.options.templates['templates/ldtjson-bin/tagtemplate.html']; + this.annotationTemplate = _renkan.options.templates['templates/ldtjson-bin/annotationtemplate.html']; this.proj_id = _opts.project_id; this.ldt_platform = _opts.ldt_platform || "http://ldt.iri.centrepompidou.fr/"; this.title_$.html(_opts.title); @@ -154,10 +153,10 @@ var ResultsBin = Ldt.ResultsBin = Rkns.Utils.inherit(Rkns._BaseBin); -ResultsBin.prototype.segmentTemplate = renkanJST['templates/ldtjson-bin/segmenttemplate.html']; ResultsBin.prototype._init = function(_renkan, _opts) { this.renkan = _renkan; + this.segmentTemplate = _renkan.options.templates['templates/ldtjson-bin/segmenttemplate.html']; this.ldt_platform = _opts.ldt_platform || "http://ldt.iri.centrepompidou.fr/"; this.max_results = _opts.max_results || 50; this.search = _opts.search;
--- a/client/js/list-bin.js Tue Oct 04 16:40:25 2016 +0200 +++ b/client/js/list-bin.js Thu Jan 05 16:26:07 2017 +0100 @@ -2,10 +2,9 @@ Rkns.ResourceList.Bin = Rkns.Utils.inherit(Rkns._BaseBin); -Rkns.ResourceList.Bin.prototype.resultTemplate = renkanJST['templates/list-bin.html']; - Rkns.ResourceList.Bin.prototype._init = function(_renkan, _opts) { this.renkan = _renkan; + this.resultTemplate = _renkan.options.templates['templates/list-bin.html']; this.title_$.html(_opts.title); if (_opts.list) { this.data = _opts.list;
--- a/client/js/main.js Tue Oct 04 16:40:25 2016 +0200 +++ b/client/js/main.js Thu Jan 05 16:26:07 2017 +0100 @@ -101,7 +101,7 @@ templates: _.defaults(_opts.templates, renkanJST) || renkanJST, node_editor_templates: _.defaults(_opts.node_editor_templates, Rkns.defaults.node_editor_templates) }); - this.template = renkanJST['templates/main.html']; + this.template = this.options.templates['templates/main.html']; var types_templates = {}; _.each(this.options.node_editor_templates, function(value, key) { @@ -152,7 +152,7 @@ }); this.colorPicker = (function() { - var _tmpl = renkanJST['templates/colorpicker.html']; + var _tmpl = _this.options.templates['templates/colorpicker.html']; return '<ul class="Rk-Edit-ColorPicker">' + Rkns.pickerColors.map(function(c) { return _tmpl({ c: c @@ -167,7 +167,7 @@ if (!this.options.search.length) { this.$.find(".Rk-Web-Search-Form").detach(); } else { - var _tmpl = renkanJST['templates/search.html'], + var _tmpl = _this.options.templates['templates/search.html'], _select = this.$.find(".Rk-Search-List"), _input = this.$.find(".Rk-Web-Search-Input"), _form = this.$.find(".Rk-Web-Search-Form");
--- a/client/js/renderer/nodeeditor.js Tue Oct 04 16:40:25 2016 +0200 +++ b/client/js/renderer/nodeeditor.js Thu Jan 05 16:26:07 2017 +0100 @@ -12,7 +12,6 @@ _init: function() { BaseEditor.prototype._init.apply(this); this.template = this.options.templates['templates/nodeeditor.html']; - //this.templates['default']= this.options.templates['templates/nodeeditor.html']; //fusionner avec this.options.node_editor_templates this.readOnlyTemplate = this.options.node_editor_templates; },
--- a/client/js/renderer/scene.js Tue Oct 04 16:40:25 2016 +0200 +++ b/client/js/renderer/scene.js Thu Jan 05 16:26:07 2017 +0100 @@ -158,6 +158,10 @@ _event.preventDefault(); _this.onMouseUp(_event.originalEvent.changedTouches[0], true); }, + click: function(_event) { + _event.preventDefault(); + _this.onClick(_event); + }, dblclick: function(_event) { _event.preventDefault(); if (_renkan.options.allow_double_click) { @@ -1000,6 +1004,28 @@ this.totalScroll = 0; } }, + onClick: function(_event) { + if (!this.isEditable()) { + var _off = this.canvas_$.offset(), + _point = new paper.Point([ + _event.pageX - _off.left, + _event.pageY - _off.top + ]); + var _hitResult = paper.project.hitTest(_point); + if(!this._open_uri_cb && + this.renkan.options.simple_click_open_url && + _hitResult && + typeof _hitResult.item.__representation !== "undefined" && + _hitResult.item.__representation.model.get('uri') && + !this._node_click_open_url + ) { + this._node_click_open_url = setTimeout(function() { + window.open(_hitResult.item.__representation.model.get('uri'), '_blank'); + this._node_click_open_url = null; + }.bind(this), 200); + } + } + }, onDoubleClick: function(_event) { var _off = this.canvas_$.offset(), _point = new paper.Point([ @@ -1009,10 +1035,13 @@ var _hitResult = paper.project.hitTest(_point); if (!this.isEditable()) { - if (_hitResult && typeof _hitResult.item.__representation !== "undefined") { - if (_hitResult.item.__representation.model.get('uri')){ - window.open(_hitResult.item.__representation.model.get('uri'), '_blank'); - } + if (this.renkan.options.double_click_open_url && + _hitResult && + typeof _hitResult.item.__representation !== "undefined" && + _hitResult.item.__representation.model.get('uri') && + !this._node_click_open_url + ) { + window.open(_hitResult.item.__representation.model.get('uri'), '_blank'); } return; }
--- a/client/js/wikipedia-bin.js Tue Oct 04 16:40:25 2016 +0200 +++ b/client/js/wikipedia-bin.js Thu Jan 05 16:26:07 2017 +0100 @@ -34,11 +34,10 @@ 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(_renkan, _opts) { this.renkan = _renkan; this.search = _opts.search; + this.resultTemplate = _renkan.options.templates['templates/wikipedia-bin/resulttemplate.html']; this.lang = _opts.lang || "en"; this.title_icon_$.addClass('Rk-Wikipedia-Title-Icon Rk-Wikipedia-Lang-' + this.lang); this.title_$.html(this.search).addClass("Rk-Wikipedia-Title");
--- a/client/package.json Tue Oct 04 16:40:25 2016 +0200 +++ b/client/package.json Thu Jan 05 16:26:07 2017 +0100 @@ -9,7 +9,7 @@ "devDependencies": { "bower": "^1.5.2", "grunt": "^1.0.0", - "grunt-bower-task": "^0.4.0", + "grunt-bower-task": "^0.4", "grunt-contrib-clean": "^1.0.0", "grunt-contrib-concat": "^1.0.0", "grunt-contrib-connect": "^1.0.1", @@ -18,7 +18,7 @@ "grunt-contrib-jshint": "^1.0.0", "grunt-contrib-jst": "^1.0.0", "grunt-contrib-requirejs": "^1.0.0", - "grunt-contrib-uglify": "^1.0.1", + "grunt-contrib-uglify": "^2.0.0", "grunt-contrib-watch": "^1.0.0", "grunt-text-replace": "^0.4.0", "grunt-umd": "^2.3.5",
--- a/client/templates/nodeeditor_video.html Tue Oct 04 16:40:25 2016 +0200 +++ b/client/templates/nodeeditor_video.html Thu Jan 05 16:26:07 2017 +0100 @@ -7,7 +7,7 @@ <% if (node.uri) { %> <a href="<%-node.uri%>" target="_blank"> <% } %> - <%-node.title%> + <%=node.title%> <% if (node.uri) { %></a><% } %> </span> </h2>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/test/templates/audio_template.html Thu Jan 05 16:26:07 2017 +0100 @@ -0,0 +1,19 @@ +<h2> + <span class="Rk-CloseX">×</span> + <% if (options.show_node_tooltip_color) { %> + <span class="Rk-UserColor" style="background: <%-node.color%>;"></span> + <% } %> + <span class="Rk-Display-Title"> + <% if (node.uri) { %> + <a href="<%-node.uri%>" target="_blank"> + <% } %> + <%=node.title%> + <% if (node.uri) { %></a><% } %> + </span> +</h2> +<% if (node.uri && options.show_node_tooltip_uri) { %> + <audio width="320" height="240" controls> + <source src="<%-node.uri%>" type="video/mp4"> + </audio> +<% } %> + <a href="#?idnode=<%-node._id%>"><%-renkan.translate("Link to the node")%></a>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/test/templates/youtube_template.html Thu Jan 05 16:26:07 2017 +0100 @@ -0,0 +1,25 @@ +<h2> + <span class="Rk-CloseX">×</span> + <% if (options.show_node_tooltip_color) { %> + <span class="Rk-UserColor" style="background: <%-node.color%>;"></span> + <% } %> + <span class="Rk-Display-Title"> + <% if (node.uri) { %> + <a href="<%-node.uri%>" target="_blank"> + <% } %> + <%=node.title%> + <% if (node.uri) { %></a><% } %> + </span> +</h2> +<% if (node.uri && options.show_node_tooltip_uri) { + var youtube_id = get_youtube_id(node.uri); + if(youtube_id) { + %> + <iframe width="255" height="143" src="https://www.youtube.com/embed/<%=youtube_id%>" frameborder="0"></iframe> +<% } + else { %> + <p>The node url is not a youtube video</p> +<% } + } +%> +<a href="#?idnode=<%-node._id%>"><%-renkan.translate("Link to the node")%></a>
--- a/client/test/test-readonly-body-dist-min.html Tue Oct 04 16:40:25 2016 +0200 +++ b/client/test/test-readonly-body-dist-min.html Thu Jan 05 16:26:07 2017 +0100 @@ -22,7 +22,7 @@ static_url: "../" }); Rkns.jsonIO(_renkan, { - url: "../data/example-cinema.json" + url: "../data/json/example-cinema.json" }); }; </script>
--- a/client/test/test-readonly-body-dist.html Tue Oct 04 16:40:25 2016 +0200 +++ b/client/test/test-readonly-body-dist.html Thu Jan 05 16:26:07 2017 +0100 @@ -22,7 +22,7 @@ static_url: "../" }); Rkns.jsonIO(_renkan, { - url: "../data/example-cinema.json" + url: "../data/json/example-cinema.json" }); }; </script>
--- a/client/test/test-readonly-body-no-zoom.html Tue Oct 04 16:40:25 2016 +0200 +++ b/client/test/test-readonly-body-no-zoom.html Thu Jan 05 16:26:07 2017 +0100 @@ -33,7 +33,7 @@ show_zoom: false }); Rkns.jsonIO(_renkan, { - url: "../data/example-cinema.json" + url: "../data/json/example-cinema.json" }); }; </script>
--- a/client/test/test-readonly-body-zoom-save.html Tue Oct 04 16:40:25 2016 +0200 +++ b/client/test/test-readonly-body-zoom-save.html Thu Jan 05 16:26:07 2017 +0100 @@ -34,7 +34,7 @@ default_view: true }); Rkns.jsonIO(_renkan, { - url: "../data/example-cinema.json" + url: "../data/json/example-cinema.json" }); }; </script>
--- a/client/test/test-readonly-body.html Tue Oct 04 16:40:25 2016 +0200 +++ b/client/test/test-readonly-body.html Thu Jan 05 16:26:07 2017 +0100 @@ -32,7 +32,7 @@ static_url: "../" }); Rkns.jsonIO(_renkan, { - url: "../data/example-cinema.json" + url: "../data/json/example-cinema.json" }); }; </script>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/test/test-readonly-custom-templates-youtube.html Thu Jan 05 16:26:07 2017 +0100 @@ -0,0 +1,66 @@ +<!DOCTYPE html> +<html lang="fr"> + <head> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> + <title>RENKAN test in read-only mode : body 100%</title> + <meta name="description" content="" /> + <meta name="author" content="Institut de Recherche et d'Innovation" /> + <script src="../lib/jquery/jquery.js"></script> + <script src="../lib/jquery-mousewheel/jquery.mousewheel.js"></script> + <script src="../lib/lodash/lodash.js"></script> + <script src="../lib/backbone/backbone.js"></script> + <script src="../lib/backbone-relational/backbone-relational.js"></script> + <script src="../lib/paper/paper-full.js"></script> + <script src="../js/main.js"></script> + <script src="../js/dataloader.js"></script> + <script src="../js/router.js"></script> + <script src="../js/models.js"></script> + <script src="../js/defaults.js"></script> + <script src="../js/i18n.js"></script> + <script src="../dist/js/templates.js"></script> + <script src="../js/full-json.js"></script> + <script src="../js/ldtjson-bin.js"></script> + <script src="../js/list-bin.js"></script> + <script src="../js/wikipedia-bin.js"></script> + <script type="text/javascript"> + function get_youtube_id(url) { + var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/; + var match = url.match(regExp); + if (match && match[2].length == 11) { + return match[2]; + } else { + return false; + } + } + </script> + <script src="../data/templates/youtube_template.js"></script> + <script data-main="../js/main-renderer.js" src="../lib/requirejs/require.js"></script> + <script type="text/javascript"> + var custom_templates = { + 'nodeeditor_youtube': this["renkanJSTTest"]["test/templates/youtube_template.html"] + }; + function startRenkan(){ + var _renkan = new Rkns.Renkan({ + editor_mode: false, + show_bins: false, + static_url: "../", + templates: custom_templates, + node_editor_templates: { + "youtube": "nodeeditor_youtube" + } + }); + Rkns.jsonIO(_renkan, { + url: "../data/json/example-cinema-youtube.json" + }); + }; + </script> + <link rel="stylesheet" href="../css/renkan.css" /> + <style type="text/css"> + </style> + </head> + + <body> + <div id="renkan"></div> + </body> +</html>
--- a/client/test/test-readonly-custom-templates.html Tue Oct 04 16:40:25 2016 +0200 +++ b/client/test/test-readonly-custom-templates.html Thu Jan 05 16:26:07 2017 +0100 @@ -23,9 +23,12 @@ <script src="../js/ldtjson-bin.js"></script> <script src="../js/list-bin.js"></script> <script src="../js/wikipedia-bin.js"></script> - <script src="../data/custom_templates.js"></script> + <script src="../data/templates/audio_template.js"></script> <script data-main="../js/main-renderer.js" src="../lib/requirejs/require.js"></script> <script type="text/javascript"> + var custom_templates = { + 'nodeeditor_audio': this["renkanJSTTest"]["test/templates/audio_template.html"] + }; function startRenkan(){ var _renkan = new Rkns.Renkan({ editor_mode: false, @@ -37,7 +40,7 @@ } }); Rkns.jsonIO(_renkan, { - url: "../data/example-cinema.json" + url: "../data/json/example-cinema.json" }); }; </script>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/test/test-readonly-disable-dbl-click.html Thu Jan 05 16:26:07 2017 +0100 @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<html lang="fr"> + <head> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> + <title>RENKAN test in read-only mode : body 100%</title> + <meta name="description" content="" /> + <meta name="author" content="Institut de Recherche et d'Innovation" /> + <script src="../lib/jquery/jquery.js"></script> + <script src="../lib/jquery-mousewheel/jquery.mousewheel.js"></script> + <script src="../lib/lodash/lodash.js"></script> + <script src="../lib/backbone/backbone.js"></script> + <script src="../lib/backbone-relational/backbone-relational.js"></script> + <script src="../lib/paper/paper-full.js"></script> + <script src="../js/main.js"></script> + <script src="../js/dataloader.js"></script> + <script src="../js/router.js"></script> + <script src="../js/models.js"></script> + <script src="../js/defaults.js"></script> + <script src="../js/i18n.js"></script> + <script src="../dist/js/templates.js"></script> + <script src="../js/full-json.js"></script> + <script src="../js/ldtjson-bin.js"></script> + <script src="../js/list-bin.js"></script> + <script src="../js/wikipedia-bin.js"></script> + <script data-main="../js/main-renderer.js" src="../lib/requirejs/require.js"></script> + <script type="text/javascript"> + function startRenkan(){ + var _renkan = new Rkns.Renkan({ + editor_mode: false, + show_bins: false, + static_url: "../", + double_click_open_url: false // disable double clik open uri on node + }); + Rkns.jsonIO(_renkan, { + url: "../data/json/example-cinema.json" + }); + }; + </script> + <link rel="stylesheet" href="../css/renkan.css" /> + <style type="text/css"> + </style> + </head> + + <body> + <div id="renkan"></div> + </body> +</html>
--- a/client/test/test-readonly-div-resize.html Tue Oct 04 16:40:25 2016 +0200 +++ b/client/test/test-readonly-div-resize.html Thu Jan 05 16:26:07 2017 +0100 @@ -32,19 +32,19 @@ static_url: "../" }); Rkns.jsonIO(_renkan, { - url: "../data/example-cinema.json" + url: "../data/json/example-cinema.json" }); }; </script> <link rel="stylesheet" href="../css/renkan.css" /> <style type="text/css"> html { - heigt: 100%; + height: 100%; } body{ margin: 0 auto; width: 100%; - heigt: 100%; + height: 100%; } header { font-size: 14px;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/test/test-readonly-enable-click-open.html Thu Jan 05 16:26:07 2017 +0100 @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<html lang="fr"> + <head> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> + <title>RENKAN test in read-only mode : body 100%</title> + <meta name="description" content="" /> + <meta name="author" content="Institut de Recherche et d'Innovation" /> + <script src="../lib/jquery/jquery.js"></script> + <script src="../lib/jquery-mousewheel/jquery.mousewheel.js"></script> + <script src="../lib/lodash/lodash.js"></script> + <script src="../lib/backbone/backbone.js"></script> + <script src="../lib/backbone-relational/backbone-relational.js"></script> + <script src="../lib/paper/paper-full.js"></script> + <script src="../js/main.js"></script> + <script src="../js/dataloader.js"></script> + <script src="../js/router.js"></script> + <script src="../js/models.js"></script> + <script src="../js/defaults.js"></script> + <script src="../js/i18n.js"></script> + <script src="../dist/js/templates.js"></script> + <script src="../js/full-json.js"></script> + <script src="../js/ldtjson-bin.js"></script> + <script src="../js/list-bin.js"></script> + <script src="../js/wikipedia-bin.js"></script> + <script data-main="../js/main-renderer.js" src="../lib/requirejs/require.js"></script> + <script type="text/javascript"> + function startRenkan(){ + var _renkan = new Rkns.Renkan({ + editor_mode: false, + show_bins: false, + static_url: "../", + simple_click_open_url: true + }); + Rkns.jsonIO(_renkan, { + url: "../data/json/example-cinema.json" + }); + }; + </script> + <link rel="stylesheet" href="../css/renkan.css" /> + <style type="text/css"> + </style> + </head> + + <body> + <div id="renkan"></div> + </body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/test/test-writable-custom-templates-youtube.html Thu Jan 05 16:26:07 2017 +0100 @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html lang="fr"> + <head> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> + <title>Test de Rendu RENKAN</title> + <meta name="description" content="" /> + <meta name="author" content="Institut de Recherche et d'Innovation" /> + <script src="../lib/jquery/jquery.js"></script> + <script src="../lib/jquery-mousewheel/jquery.mousewheel.js"></script> + <script src="../lib/lodash/lodash.js"></script> + <script src="../lib/backbone/backbone.js"></script> + <script src="../lib/backbone-relational/backbone-relational.js"></script> + <script src="../lib/paper/paper-full.js"></script> + <script src="../js/main.js"></script> + <script src="../js/dataloader.js"></script> + <script src="../js/router.js"></script> + <script src="../js/models.js"></script> + <script src="../js/defaults.js"></script> + <script src="../js/i18n.js"></script> + <script src="../dist/js/templates.js"></script> + <script src="../js/full-json.js"></script> + <script src="../js/ldtjson-bin.js"></script> + <script src="../js/list-bin.js"></script> + <script src="../js/wikipedia-bin.js"></script> + <script src="../data/templates/youtube_template.js"></script> + <script data-main="../js/main-renderer.js" src="../lib/requirejs/require.js"></script> + <script type="text/javascript"> + var custom_templates = { + 'nodeeditor_youtube': this["renkanJSTTest"]["test/templates/youtube_template.html"] + }; + function startRenkan(){ + var _renkan = new Rkns.Renkan({ + property_files: [ "../data/properties.json" ], + /*user_id: "u-iri", + language: "fr", + node_fill_color: false*/ + show_bins: false, + static_url: "../", + templates: custom_templates, + node_editor_templates: { + "youtube": "nodeeditor_youtube" + } + }); + Rkns.jsonIO(_renkan, { + url: "/simple-persist?key=youtube" + }); + }; + </script> + <link rel="stylesheet" href="../css/renkan.css" /> + </head> + + <body> + <div id="renkan"></div> + </body> +</html>
--- a/client/test/test-writable-custom-templates.html Tue Oct 04 16:40:25 2016 +0200 +++ b/client/test/test-writable-custom-templates.html Thu Jan 05 16:26:07 2017 +0100 @@ -23,9 +23,12 @@ <script src="../js/ldtjson-bin.js"></script> <script src="../js/list-bin.js"></script> <script src="../js/wikipedia-bin.js"></script> - <script src="../data/custom_templates.js"></script> - <script data-main="../js/main-renderer" src="../lib/requirejs/require.js"></script> + <script src="../data/templates/audio_template.js"></script> + <script data-main="../js/main-renderer.js" src="../lib/requirejs/require.js"></script> <script type="text/javascript"> + var custom_templates = { + 'nodeeditor_audio': this["renkanJSTTest"]["test/templates/audio_template.html"] + }; function startRenkan(){ var _renkan = new Rkns.Renkan({ property_files: [ "../data/properties.json" ],