# HG changeset patch # User veltr # Date 1345122707 -7200 # Node ID c73bfb5c0af63bdb1fe2080a97d9ebf15d5362f2 # Parent 96476d1fc7c0e587c0ea5df49391efae9d132888 UI Improvements before merge diff -r 96476d1fc7c0 -r c73bfb5c0af6 client/css/renkan.css --- a/client/css/renkan.css Tue Jul 31 18:16:39 2012 +0200 +++ b/client/css/renkan.css Thu Aug 16 15:11:47 2012 +0200 @@ -72,24 +72,23 @@ .Rk-UserColor { display: inline-block; width: 1em; height: 1em; border: 1px solid #666666; margin: -2px 2px; } -/* -.Rk-Button-Edit, .Rk-Button-Remove { - width: 67px; height: 134px; background: url("../img/remove-edit.png"); + +.Rk-ZoomButtons { + position: absolute; left: 0; top: 0; cursor: pointer; } -.Rk-Button-Edit { - background-position: -67px -134px; +.Rk-ZoomIn, .Rk-ZoomOut { + width: 21px; height: 20px; background: url(../img/zoombuttons.png); margin: 5px; } -.Rk-Button-Edit:hover { - background-position: -67px 0; +.Rk-ZoomIn:hover { + background-position: 0 -20px; } -.Rk-Button-Remove { - background-position: 0 -134px; +.Rk-ZoomOut { + background-position: -21px 0; } -.Rk-Button-Remove:hover { - background-position: -67px 0; -} -*/ \ No newline at end of file +.Rk-ZoomOut:hover { + background-position: -21px -20px; +} \ No newline at end of file diff -r 96476d1fc7c0 -r c73bfb5c0af6 client/data/dynamic-data.json --- a/client/data/dynamic-data.json Tue Jul 31 18:16:39 2012 +0200 +++ b/client/data/dynamic-data.json Thu Aug 16 15:11:47 2012 +0200 @@ -1,1 +1,1 @@ -{"title":"Test Graph","users":[{"id":"anonymous","title":"anonymous","uri":"","color":"#0000ff"},{"id":"u-cybunk","title":"Samuel","uri":"http://twitter.com/cybunk","color":"#e00000"},{"id":"u-raphv","title":"Raphael","uri":"http://twitter.com/raphv","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","position":{"x":-25.88895000000003,"y":87.51464999999999}},{"id":"n-002","title":"Savoir","uri":"http://fr.wikipedia.org/wiki/Savoir","created_by":"u-raphv","position":{"x":188.95000000000002,"y":96.14999999999998}},{"id":"n-003","title":"Connaissance","uri":"http://fr.wikipedia.org/wiki/Connaissance","created_by":"u-raphv","position":{"x":289.4208034783762,"y":-126.35817503078205}},{"id":"n-004","title":"graphe","uri":"http://fr.wikipedia.org/wiki/Th%C3%A9orie_des_graphes","created_by":"u-cybunk","position":{"x":-255.49131419301492,"y":14.045175554077602}},{"id":"n-005","title":"nœud","uri":"http://fr.wikipedia.org/wiki/Th%C3%A9orie_des_graphes","created_by":"u-cybunk","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","position":{"x":"-300","y":"-100"}},{"id":"node-2012-07-30-228fe77f55e6c8cb-000c","title":"Tree of Knowledge","uri":"","created_by":"anonymous","position":{"x":16.731250153910498,"y":-33.2191000923462}},{"id":"node-2012-07-30-228fe77f55e6c8cb-0019","title":"Tree (木)","uri":"","created_by":"anonymous","position":{"x":-65.06465000000001,"y":-117.73549999999994}},{"id":"node-2012-07-30-9b22dc180265ecd3-0018","title":"(untitled node)","uri":"","created_by":"anonymous","position":{"x":-209.8383754309492,"y":-95.79672580033416}}],"edges":[{"id":"e-001","title":"(untitled edge)","description":"","uri":"","from":"n-001","to":"n-002","created_by":"u-raphv"},{"id":"e-002","title":"(untitled edge)","description":"","uri":"","from":"n-002","to":"n-003","created_by":"u-raphv"},{"id":"e-003","title":"(untitled edge)","description":"","uri":"","from":"n-001","to":"n-004","created_by":"u-cybunk"},{"id":"e-004","title":"(untitled edge)","description":"","uri":"","from":"n-004","to":"n-005","created_by":"u-cybunk"},{"id":"e-005","title":"(untitled edge)","description":"","uri":"","from":"n-004","to":"n-006","created_by":"u-cybunk"},{"id":"edge-2012-07-30-228fe77f55e6c8cb-0010","title":"(untitled edge)","description":"","uri":"","from":"node-2012-07-30-228fe77f55e6c8cb-000c","to":"n-001","created_by":"anonymous"},{"id":"edge-2012-07-30-228fe77f55e6c8cb-0013","title":"arête sans titre","description":"","uri":"","from":"node-2012-07-30-228fe77f55e6c8cb-000c","to":"n-003","created_by":"anonymous"},{"id":"edge-2012-07-30-228fe77f55e6c8cb-0016","title":"Similarité","description":"","uri":"","from":"n-004","to":"node-2012-07-30-228fe77f55e6c8cb-000c","created_by":"anonymous"},{"id":"edge-2012-07-30-228fe77f55e6c8cb-001d","title":"(untitled edge)","description":"","uri":"","from":"node-2012-07-30-228fe77f55e6c8cb-0019","to":"node-2012-07-30-228fe77f55e6c8cb-000c","created_by":"anonymous"}]} \ No newline at end of file +{"title":"Test Graph","users":[{"id":"anonymous","title":"anonymous","uri":"","color":"#0000ff"},{"id":"u-cybunk","title":"Samuel","uri":"http://twitter.com/cybunk","color":"#e00000"},{"id":"u-raphv","title":"Raphael","uri":"http://twitter.com/raphv","color":"#00a000"}],"nodes":[{"id":"n-001","title":"連環 (Renkan)","description":"Vive Renkan !","uri":"http://ja.wikipedia.org/wiki/%E7%99%BE%E5%AD%A6%E9%80%A3%E7%92%B0","created_by":"u-cybunk","position":{"x":-26.522137994214717,"y":-210.84128058998363}},{"id":"n-002","title":"Savoir","description":"","uri":"http://fr.wikipedia.org/wiki/Savoir","created_by":"u-raphv","position":{"x":51.05688741877592,"y":2.5968600661189982}},{"id":"n-003","title":"Connaissance","description":"","uri":"http://fr.wikipedia.org/wiki/Connaissance","created_by":"u-raphv","position":{"x":289.41278995919333,"y":-148.06006021345246}},{"id":"n-005","title":"nœud","description":"","uri":"http://fr.wikipedia.org/wiki/Th%C3%A9orie_des_graphes","created_by":"u-cybunk","position":{"x":-348.6577736928668,"y":36.915363564739906}},{"id":"n-006","title":"arête","description":"","uri":"http://fr.wikipedia.org/wiki/Th%C3%A9orie_des_graphes","created_by":"u-cybunk","position":{"x":-310.04965494954644,"y":-269.5988072780878}},{"id":"node-2012-07-31-f1c2d0fd52a9d0e2-0016","title":"graphe","description":"","uri":"","created_by":"anonymous","position":{"x":-190.13786466320713,"y":-97.7768211544552}},{"id":"node-2012-07-31-6d574a0c9d5d2931-0026","title":"Test","description":"","uri":"","created_by":"anonymous","position":{"x":156.5765089679022,"y":-297.9314037374282}}],"edges":[{"id":"e-001","title":"(untitled edge)","uri":"","from":"n-001","to":"n-002","created_by":"u-raphv"},{"id":"e-002","title":"(untitled edge)","uri":"","from":"n-002","to":"n-003","created_by":"u-raphv"},{"id":"edge-2012-07-31-f1c2d0fd52a9d0e2-0013","title":"(untitled edge)","uri":"","from":"n-006","to":"n-001","created_by":"anonymous"},{"id":"edge-2012-07-31-f1c2d0fd52a9d0e2-001d","title":"(untitled edge)","uri":"","from":"node-2012-07-31-f1c2d0fd52a9d0e2-0016","to":"n-005","created_by":"anonymous"},{"id":"edge-2012-07-31-f1c2d0fd52a9d0e2-0020","title":"(untitled edge)","uri":"","from":"node-2012-07-31-f1c2d0fd52a9d0e2-0016","to":"n-001","created_by":"anonymous"},{"id":"edge-2012-07-31-f1c2d0fd52a9d0e2-0023","title":"(untitled edge)","uri":"","from":"node-2012-07-31-f1c2d0fd52a9d0e2-0016","to":"n-006","created_by":"anonymous"},{"id":"edge-2012-07-31-6d574a0c9d5d2931-002c","title":"(untitled edge)","uri":"","from":"node-2012-07-31-6d574a0c9d5d2931-0026","to":"n-001","created_by":"anonymous"}]} \ No newline at end of file diff -r 96476d1fc7c0 -r c73bfb5c0af6 client/img/edit.png Binary file client/img/edit.png has changed diff -r 96476d1fc7c0 -r c73bfb5c0af6 client/img/link.png Binary file client/img/link.png has changed diff -r 96476d1fc7c0 -r c73bfb5c0af6 client/img/remove.png Binary file client/img/remove.png has changed diff -r 96476d1fc7c0 -r c73bfb5c0af6 client/img/zoombuttons.png Binary file client/img/zoombuttons.png has changed diff -r 96476d1fc7c0 -r c73bfb5c0af6 client/js/i18n.js --- a/client/js/i18n.js Tue Jul 31 18:16:39 2012 +0200 +++ b/client/js/i18n.js Thu Aug 16 15:11:47 2012 +0200 @@ -7,6 +7,8 @@ edit_description: "Description:", edit_from: "From:", edit_to: "To:", - created_by: "Created by:" + created_by: "Created by:", + zoom_in: "Zoom In", + zoom_out: "Zoom Out" } } diff -r 96476d1fc7c0 -r c73bfb5c0af6 client/js/paper-renderer.js --- a/client/js/paper-renderer.js Tue Jul 31 18:16:39 2012 +0200 +++ b/client/js/paper-renderer.js Thu Aug 16 15:11:47 2012 +0200 @@ -149,6 +149,8 @@ this.edit_button.node_controller = this; this.remove_button = new Rkns.Renderer.NodeRemoveButton(this._renderer, {}); this.remove_button.node_controller = this; + this.link_button = new Rkns.Renderer.NodeLinkButton(this._renderer, {}); + this.link_button.node_controller = this; this.title.paragraphStyle.justification = 'center'; this.title.__controller = this; } @@ -162,6 +164,7 @@ this.circle.strokeColor = this._element.created_by.color; this.edit_button.moveTo(this.paper_coords); this.remove_button.moveTo(this.paper_coords); + this.link_button.moveTo(this.paper_coords); } Rkns.Renderer.Node.prototype.paperShift = function(_delta) { @@ -187,12 +190,14 @@ this.circle.strokeWidth = 3; this.edit_button.show(); this.remove_button.show(); + this.link_button.show(); } Rkns.Renderer.Node.prototype.unselect = function(_newTarget) { - if (!_newTarget || (_newTarget !== this.edit_button && _newTarget !== this.remove_button)) { + if (!_newTarget || (_newTarget !== this.edit_button && _newTarget !== this.remove_button && _newTarget !== this.link_button)) { this.edit_button.hide(); this.remove_button.hide(); + this.link_button.hide(); } this.circle.strokeWidth = 1; } @@ -361,7 +366,7 @@ this.editor_block.fillColor = "#e0e0e0"; this.editor_block.opacity = .8; this.editor_$ = Rkns.$('