# HG changeset patch # User veltr # Date 1345647042 -7200 # Node ID 2fad193bae98ba2e5eab15fb96bf7f2ad126624f # Parent b5ada3bb8e53d013ac1eced9b78385c474aaefaa Added basic LDT project import diff -r b5ada3bb8e53 -r 2fad193bae98 client/css/renkan.css --- a/client/css/renkan.css Tue Aug 21 18:49:41 2012 +0200 +++ b/client/css/renkan.css Wed Aug 22 16:50:42 2012 +0200 @@ -43,6 +43,11 @@ body { font-size: 10px; font-family: Arial, Helvetica, sans-serif; + background: #ffffff; color: #000000; +} + +a { + color: #6060c0; } .Rk-Bins { @@ -77,10 +82,18 @@ display: inline-block; width: 80px; } -.Rk-Editor input[type=text] { +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 { font-size: 12px; width: 225px; } +.Rk-Edit-URI { + font-size: 12px; width: 205px; +} + .Rk-Editor textarea { width: 225px; height: 120px; resize: none; } @@ -130,8 +143,37 @@ overflow: auto; } -.Rk-Twitter-Tweet, .Rk-Wikipedia-Result { - padding: 2px; background: #f8f8f8; border-bottom: 1px solid #cccccc; min-height: 55px; +.Rk-Bin-Item { + cursor: move; +} + +.Rk-Bin-Item:hover { + background: #d0d0d0; +} + +.Rk-Bin-Item.dragging { + background: #fff8f8; color: #660000; +} + +.Rk-Bin-Item.selected { + background: #ffffc0; +} + +.Rk-Bin-Main li { + padding: 2px; background: #f8f8f8; border-bottom: 1px solid #cccccc; + clear: both; +} + +.Rk-Bin-Main h3 { + font-size: 15px; font-style: italic; font-weight: bold; text-align: center; +} + +.Rk-Bin-Main h4 { + font-size: 13px; font-weight: bold; +} + +.Rk-Bin-Main p { + font-size: 12px; } .Rk-Twitter-TwImage { @@ -142,18 +184,42 @@ margin: 2px 0 2px 50px; } -.Rk-Twitter-TwTitle, .Rk-Wikipedia-Title { - font-size: 13px; font-weight: bold; -} - -.Rk-Twitter-TwDate { +p.Rk-Twitter-TwDate { font-size: 11px; font-style: italic; } -.Rk-Twitter-TwText, .Rk-Wikipedia-Snippet { - font-size: 12px; +p.Rk-Twitter-TwActions { + font-size: 11px; +} + +.Rk-Bin-Main .searchmatch { + background: #ffff80; +} + +.Rk-Wikipedia-Icon { + float: left; width: 52px; height: 47px; background: url(../img/wikipedia.png); +} + +.Rk-Wikipedia-Result { + min-height: 51px; } -.Rk-Wikipedia-Result .searchmatch, .Rk-Twitter-TwText .searchmatch { - background: #ffff80; +.Rk-Wikipedia-Result p, .Rk-Wikipedia-Result h4 { + margin-left: 54px; +} + +.Rk-Ldt-Icon { + float: left; width: 49px; background: url(../img/ldt-elements.png); } + +.Rk-Ldt-TagIcon { + height: 19px; +} + +.Rk-Ldt-PointIcon { + height: 29px; background-position: 0 -19px; +} + +.Rk-Ldt-SegmentIcon { + height: 29px; background-position: 0 -48px; +} diff -r b5ada3bb8e53 -r 2fad193bae98 client/data/test-data.json --- a/client/data/test-data.json Tue Aug 21 18:49:41 2012 +0200 +++ b/client/data/test-data.json Wed Aug 22 16:50:42 2012 +0200 @@ -1,112 +1,271 @@ { - "title": "Test Graph", - "creation_date": "2012-07-25T11:00:00.0Z", "users": [ { + "id": "u-anonymous", + "title": "anonymous", + "uri": "", + "description": "", + "color": "#dd00dd" + }, { "id": "u-cybunk", "title": "Samuel", "uri": "http://twitter.com/cybunk", + "description": "", "color": "#e00000" - }, - { + }, { "id": "u-raphv", "title": "Raphael", "uri": "http://twitter.com/raphv", + "description": "", "color": "#00a000" } ], "nodes": [ { - "id": "n-001", - "title": "連環 (Renkan)", - "uri": "http://ja.wikipedia.org/wiki/%E7%99%BE%E5%AD%A6%E9%80%A3%E7%92%B0", - "created_by": "u-cybunk", + "id": "node-2012-08-22-9da6eef6c6391d05-0001", + "title": "Chocs technologiques et tâches de l’université...", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/e328e188-ff2f-11e0-b9e1-00145ea49a02/#id=s_6C326EED-B91A-AEDF-032D-40D9A60AAD7E", + "description": "Bernard Stiegler:\nChocs technologiques et tâches de l’université. L'époque des digital studies\nベルナール・スティグレールによるプレゼンテーション『テクノロジーの衝撃と大学の諸課題――デジタル・スタディーズの時代』 (langue française フランス語)", + "position": { + "x": 35.50145330596697, + "y": -79.8809523809524 + }, + "created_by": "u-cybunk" + }, { + "id": "node-2012-08-22-9da6eef6c6391d05-0002", + "title": "Wiki: ベルナール・スティグレール", + "uri": "http://ja.wikipedia.org/wiki/%E3%83%99%E3%83%AB%E3%83%8A%E3%83%BC%E3%83%AB%E3%83%BB%E3%82%B9%E3%83%86%E3%82%A3%E3%82%B0%E3%83%AC%E3%83%BC%E3%83%AB", + "description": "|image_name = Bernard-Stiegler.jpg\n'''ベルナール・スティグレール'''('''Bernard Stiegler''',[[1952年]][[4月1日]] - )は、[[フランス]]の[[哲学者]]。\n", + "position": { + "x": -196.21861947454883, + "y": -149.00697345010028 + }, + "created_by": "u-raphv" + }, { + "id": "node-2012-08-22-9da6eef6c6391d05-0003", + "title": "Wiki: Bernard Stiegler", + "uri": "http://fr.wikipedia.org/wiki/Bernard_Stiegler", + "description": "Bernard Stiegler, né le 1 | avril | 1952, est un philosophe français qui axe sa réflexion sur les enjeux des mutations actuelles — ... ", "position": { - "x": 0, - "y": 0 - } - }, - { - "id": "n-002", - "title": "Savoir", - "uri": "http://fr.wikipedia.org/wiki/Savoir", - "created_by": "u-raphv", + "x": -203.78187077358191, + "y": -298.3662919065874 + }, + "created_by": "u-raphv" + }, { + "id": "node-2012-08-22-9da6eef6c6391d05-0004", + "title": "Tag: Stiegler", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/search/?search=Stiegler&field=all", + "description": "Tag 'Stiegler'", + "position": { + "x": -82.30326393358813, + "y": -220.3518547582561 + }, + "created_by": "u-raphv" + }, { + "id": "node-2012-08-22-9da6eef6c6391d05-0009", + "title": "Wiki: Humanités numériques", + "uri": "http://fr.wikipedia.org/wiki/Humanit%C3%A9s_num%C3%A9riques", + "description": "une proposition de définition a été élaborée lors du THATCamp des 18 et 19 mai 2010 sous la forme d'un « Manifeste des digital humanities : ... ", "position": { - "x": 200, - "y": 50 - } - }, - { - "id": "n-003", - "title": "Connaissance", - "uri": "http://fr.wikipedia.org/wiki/Connaissance", - "created_by": "u-raphv", + "x": -227.84295519248332, + "y": 91.1816115015538 + }, + "created_by": "u-raphv" + }, { + "id": "node-2012-08-22-9da6eef6c6391d05-000a", + "title": "Wiki: デジタル・ヒューマニティーズ", + "uri": "http://ja.wikipedia.org/wiki/%E3%83%87%E3%82%B8%E3%82%BF%E3%83%AB%E3%83%BB%E3%83%92%E3%83%A5%E3%83%BC%E3%83%9E%E3%83%8B%E3%83%86%E3%82%A3%E3%83%BC%E3%82%BA", + "description": "...(digital humanities)は、コンピューティングと人文科学(humanities)諸分野と間の接点に関して調査、研究、教育、および�\n* Centre for Computing in the Humanities\n", + "position": { + "x": -221.48701615763574, + "y": 242.80740052545508 + }, + "created_by": "u-raphv" + }, { + "id": "node-2012-08-22-9da6eef6c6391d05-000b", + "title": "Digital studies", + "uri": "", + "description": "", "position": { - "x": 300, - "y": -50 - } - }, - { - "id": "n-004", - "title": "graphe", - "uri": "http://fr.wikipedia.org/wiki/Th%C3%A9orie_des_graphes", - "created_by": "u-cybunk", + "x": -55.85113246487888, + "y": 51.55194408866958 + }, + "created_by": "u-raphv" + }, { + "id": "node-2012-08-22-9da6eef6c6391d05-000c", + "title": "Digital Humanities", + "uri": "", + "description": "", + "position": { + "x": -110.57020731070799, + "y": 160.92139209086253 + }, + "created_by": "u-raphv" + }, { + "id": "node-2012-08-22-b778a9fc31296d6b-0008", + "title": "Les rétentions (Tweet)", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/e328e188-ff2f-11e0-b9e1-00145ea49a02/#id=a924b90c-46a1-4f0a-9e13-bcf69f7b5de0-127750274034049024", + "description": "Tweet by Vincent Puig: #tfcem Les rétentions primaires (perception) s'aggrégent et forment des rétentions secondaires (mémoire), gravées sur rétentions tertiaires", + "position": { + "x": 186.15055288633457, + "y": -184.66836073709257 + }, + "created_by": "u-cybunk" + }, { + "id": "node-2012-08-22-b778a9fc31296d6b-0009", + "title": "L'origine de la géométrie (Tweet)", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/e328e188-ff2f-11e0-b9e1-00145ea49a02/#id=5b34ae61-ffb1-4535-a479-007cb0ef57e8-127752118743474177", + "description": "Tweet by Vincent Puig: #tfcem L'origine de la géométrie: l'écriture est processus long de transindividuation. Nos tweets quasi temps réel sont de même nature++", "position": { - "x": -200, - "y": 0 - } - }, - { - "id": "n-005", - "title": "nœud", - "uri": "http://fr.wikipedia.org/wiki/Th%C3%A9orie_des_graphes", - "created_by": "u-cybunk", + "x": 109.36171738186508, + "y": -322.7405203211109 + }, + "created_by": "u-cybunk" + }, { + "id": "node-2012-08-22-b778a9fc31296d6b-000a", + "title": "Polemictweet : un outil Digital Studies (Tweet)", + "uri": "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/e328e188-ff2f-11e0-b9e1-00145ea49a02/#id=4b34e895-221b-467b-a0f2-8ff4ae87cae4-127758736415666177", + "description": "Tweet by Vincent Puig:\n#tfcem Polemictweet : un outil Digital Studies pensé à l'IRI comme rétention tertiaire numérique avec les même armes que l'industrie", "position": { - "x": -350, - "y": 100 - } - }, - { - "id": "n-006", - "title": "lien", - "uri": "http://fr.wikipedia.org/wiki/Th%C3%A9orie_des_graphes", - "created_by": "u-cybunk", + "x": 174.8441677339912, + "y": 69.79052957489553 + }, + "created_by": "u-cybunk" + }, { + "id": "node-2012-08-22-b778a9fc31296d6b-000f", + "title": "Rétention (Définition AI)", + "uri": "http://arsindustrialis.org/vocabulaire-ars-industrialis/r%C3%A9tention", + "description": "Les rétentions sont ce qui est retenu ou recueilli par la conscience. Ce terme est emprunté à Husserl ; mais les rétentions tertiaires sont propres à la philosophie de Bernard Stiegler.\n\nLes rétentions sont des sélections : dans le flux de conscience que vous êtes vous ne pouvez pas tout retenir, ce que vous retenez est ce que vous êtes, mais ce que vous retenez dépend ce que vous avez déjà retenu.\n\nL’espèce humaine, étant originairement constituée par sa prothéticité, dispose d’une troisième mémoire, ni génétique, ni épigénétique : le milieu épiphylogénétique, comme ensemble des rétentions tertiaires formant des dispositifs rétentionels.", "position": { - "x": -300, - "y": -100 - } + "x": 240.98461723225768, + "y": -53.794373087027985 + }, + "created_by": "u-cybunk" + }, { + "id": "node-2012-08-22-5b349e49066c1b01-0001", + "title": "Polemic Tweet", + "uri": "http://polemictweet.com/", + "description": "Polemic Tweet Web Site", + "position": { + "x": 220.27339862010322, + "y": 209.95821750254615 + }, + "created_by": "u-cybunk" } ], "edges": [ { - "id": "e-001", - "from": "n-001", - "to": "n-002", + "id": "edge-2012-08-22-9da6eef6c6391d05-0005", + "title": "is about", + "uri": "", + "description": "", + "from": "node-2012-08-22-9da6eef6c6391d05-0002", + "to": "node-2012-08-22-9da6eef6c6391d05-0004", + "created_by": "u-raphv" + }, { + "id": "edge-2012-08-22-9da6eef6c6391d05-0006", + "title": "is about", + "uri": "", + "description": "", + "from": "node-2012-08-22-9da6eef6c6391d05-0003", + "to": "node-2012-08-22-9da6eef6c6391d05-0004", + "created_by": "u-raphv" + }, { + "id": "edge-2012-08-22-9da6eef6c6391d05-0007", + "title": "speech by", + "uri": "", + "description": "", + "from": "node-2012-08-22-9da6eef6c6391d05-0001", + "to": "node-2012-08-22-9da6eef6c6391d05-0004", "created_by": "u-raphv" - }, - { - "id": "e-002", - "from": "n-002", - "to": "n-003", + }, { + "id": "edge-2012-08-22-b778a9fc31296d6b-0001", + "title": "is about", + "uri": "", + "description": "", + "from": "node-2012-08-22-9da6eef6c6391d05-0001", + "to": "node-2012-08-22-9da6eef6c6391d05-000b", + "created_by": "u-raphv" + }, { + "id": "edge-2012-08-22-b778a9fc31296d6b-0002", + "title": "Are related to", + "uri": "", + "description": "", + "from": "node-2012-08-22-9da6eef6c6391d05-000b", + "to": "node-2012-08-22-9da6eef6c6391d05-000c", + "created_by": "u-raphv" + }, { + "id": "edge-2012-08-22-b778a9fc31296d6b-0003", + "title": "is about", + "uri": "", + "description": "", + "from": "node-2012-08-22-9da6eef6c6391d05-0009", + "to": "node-2012-08-22-9da6eef6c6391d05-000c", + "created_by": "u-raphv" + }, { + "id": "edge-2012-08-22-b778a9fc31296d6b-0004", + "title": "is about", + "uri": "", + "description": "", + "from": "node-2012-08-22-9da6eef6c6391d05-000a", + "to": "node-2012-08-22-9da6eef6c6391d05-000c", "created_by": "u-raphv" - }, - { - "id": "e-003", - "from": "n-001", - "to": "n-004", + }, { + "id": "edge-2012-08-22-b778a9fc31296d6b-000b", + "title": "is about", + "uri": "", + "description": "", + "from": "node-2012-08-22-b778a9fc31296d6b-000a", + "to": "node-2012-08-22-9da6eef6c6391d05-000b", + "created_by": "u-raphv" + }, { + "id": "edge-2012-08-22-b778a9fc31296d6b-000c", + "title": "tweeted during", + "uri": "", + "description": "", + "from": "node-2012-08-22-b778a9fc31296d6b-0009", + "to": "node-2012-08-22-9da6eef6c6391d05-0001", + "created_by": "u-cybunk" + }, { + "id": "edge-2012-08-22-b778a9fc31296d6b-000d", + "title": "tweeted during", + "uri": "", + "description": "", + "from": "node-2012-08-22-b778a9fc31296d6b-0008", + "to": "node-2012-08-22-9da6eef6c6391d05-0001", "created_by": "u-cybunk" - }, - { - "id": "e-004", - "from": "n-004", - "to": "n-005", + }, { + "id": "edge-2012-08-22-b778a9fc31296d6b-000e", + "title": "tweeted during", + "uri": "", + "description": "", + "from": "node-2012-08-22-b778a9fc31296d6b-000a", + "to": "node-2012-08-22-9da6eef6c6391d05-0001", + "created_by": "u-cybunk" + }, { + "id": "edge-2012-08-22-b778a9fc31296d6b-0011", + "title": "is about", + "uri": "", + "description": "", + "from": "node-2012-08-22-b778a9fc31296d6b-0008", + "to": "node-2012-08-22-b778a9fc31296d6b-000f", "created_by": "u-cybunk" - }, - { - "id": "e-005", - "from": "n-004", - "to": "n-006", + }, { + "id": "edge-2012-08-22-b778a9fc31296d6b-0012", + "title": "is about", + "uri": "", + "description": "", + "from": "node-2012-08-22-b778a9fc31296d6b-000a", + "to": "node-2012-08-22-b778a9fc31296d6b-000f", + "created_by": "u-cybunk" + }, { + "id": "edge-2012-08-22-5b349e49066c1b01-0002", + "title": "is about", + "uri": "", + "description": "", + "from": "node-2012-08-22-b778a9fc31296d6b-000a", + "to": "node-2012-08-22-5b349e49066c1b01-0001", "created_by": "u-cybunk" } ] -} +} \ No newline at end of file diff -r b5ada3bb8e53 -r 2fad193bae98 client/img/goto.png Binary file client/img/goto.png has changed diff -r b5ada3bb8e53 -r 2fad193bae98 client/img/ldt-elements.png Binary file client/img/ldt-elements.png has changed diff -r b5ada3bb8e53 -r 2fad193bae98 client/img/wikipedia.png Binary file client/img/wikipedia.png has changed diff -r b5ada3bb8e53 -r 2fad193bae98 client/js/full-json.js --- a/client/js/full-json.js Tue Aug 21 18:49:41 2012 +0200 +++ b/client/js/full-json.js Wed Aug 22 16:50:42 2012 +0200 @@ -23,7 +23,10 @@ }); } - var _thrSave = Rkns._.throttle(_save, 2000); + var _thrSave = Rkns._.throttle( + function() { + setTimeout(_save, 100) + }, 1000); _load(); _proj.on("add:nodes add:edges add:users", function(_model) { _model.on("change remove", function(_model) { diff -r b5ada3bb8e53 -r 2fad193bae98 client/js/ldtjson-bin.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/js/ldtjson-bin.js Wed Aug 22 16:50:42 2012 +0200 @@ -0,0 +1,70 @@ +Rkns.Bins.LdtJson = Rkns.Utils.inherit(Rkns.Bins._Base); + +Rkns.Bins.LdtJson.prototype.tagTemplate = Rkns._.template( + '
<%-description%>
Start: <%=start%>, End: <%=end%>, Duration: <%=duration%>
<%=node.created_by_title%>
' ); @@ -460,6 +481,7 @@ paper.view.draw(); }); this.editor_$.find("input, textarea").bind("keyup change", function() { + _this.editor_$.find(".Rk-Edit-Goto").attr("href",_this.editor_$.find(".Rk-Edit-URI").val()); var _data = { title: _this.editor_$.find(".Rk-Edit-Title").val(), description: _this.editor_$.find(".Rk-Edit-Description").val(), @@ -503,7 +525,7 @@ Rkns.Renderer.EdgeEditor.prototype.template = Rkns._.template( '<%=edge.from_title%>
' + '<%=edge.to_title%>
' + '<%=edge.created_by_title%>
' @@ -850,15 +872,17 @@ ); Rkns.Renderer.Scene.prototype.autoScale = function() { - var _xx = this.renkan.project.get("nodes").map(function(_node) { return _node.get("position").x }), - _yy = this.renkan.project.get("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); - this.scale = Math.min((paper.view.size.width - 2 * this._MARGIN_X) / (_maxx - _minx), (paper.view.size.height - 2 * this._MARGIN_Y) / (_maxy - _miny)); - this.offset = paper.view.center.subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(this.scale)); - this.redraw(); + if (this.renkan.project.get("nodes").length) { + var _xx = this.renkan.project.get("nodes").map(function(_node) { return _node.get("position").x }), + _yy = this.renkan.project.get("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); + this.scale = Math.min((paper.view.size.width - 2 * this._MARGIN_X) / (_maxx - _minx), (paper.view.size.height - 2 * this._MARGIN_Y) / (_maxy - _miny)); + this.offset = paper.view.center.subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(this.scale)); + this.redraw(); + } } Rkns.Renderer.Scene.prototype.toPaperCoords = function(_point) { @@ -918,6 +942,19 @@ }); } +Rkns.Renderer.Scene.prototype.highlightModel = function(_model) { + var _repr = this.getRepresentationByModel(_model); + if (_repr) { + _repr.highlight(); + } +} + +Rkns.Renderer.Scene.prototype.unhighlightAll = function(_model) { + Rkns._(this.representations).each(function(_repr) { + _repr.unhighlight(); + }); +} + Rkns.Renderer.Scene.prototype.redraw = function() { Rkns._(this.representations).each(function(_representation) { _representation.redraw(); diff -r b5ada3bb8e53 -r 2fad193bae98 client/js/twitter-bin.js --- a/client/js/twitter-bin.js Tue Aug 21 18:49:41 2012 +0200 +++ b/client/js/twitter-bin.js Wed Aug 22 16:50:42 2012 +0200 @@ -15,7 +15,7 @@ Rkns.Bins.Twitter.prototype._init = function(_renkan, _opts) { this.search = _opts.search; - this.title_$.html('Twitter: "' + this.search + '"') + this.title_$.html('Twitter: "' + this.search + '"'); var _this = this; Rkns.$.getJSON( "http://search.twitter.com/search.json?q=" + encodeURIComponent(this.search) + "&callback=?", @@ -88,6 +88,7 @@ }); }).join(""); _this.main_$.html(_html); + _renkan.resizeBins(); } ); } diff -r b5ada3bb8e53 -r 2fad193bae98 client/js/wikipedia-bin.js --- a/client/js/wikipedia-bin.js Tue Aug 21 18:49:41 2012 +0200 +++ b/client/js/wikipedia-bin.js Wed Aug 22 16:50:42 2012 +0200 @@ -3,14 +3,14 @@ Rkns.Bins.Wikipedia.prototype.resultTemplate = Rkns._.template( '<%=result.snippet%>