# HG changeset patch # User veltr # Date 1366984214 -7200 # Node ID 504ae70e799e8b94a9326627d6fe45a8c6a84645 # Parent 3508fa894b90e8c0dd521d52e448e56f71144adc Renkan corrections for Cinegift Read mode diff -r 3508fa894b90 -r 504ae70e799e integ/iri/css/iri-cadeaux.css --- a/integ/iri/css/iri-cadeaux.css Thu Apr 25 19:17:13 2013 +0200 +++ b/integ/iri/css/iri-cadeaux.css Fri Apr 26 15:50:14 2013 +0200 @@ -136,7 +136,7 @@ } h2.cinecard_title { - line-height: 30px; font-size: 28px; color: #434343; margin-top: 20px; + line-height: 20px; font-size: 28px; color: #434343; margin-top: 25px; padding-left: 115px; text-shadow: 0 1px 0 #fff; } @@ -164,3 +164,31 @@ #renkan_container { z-index: 1005; position: absolute; top: 75px; left: 0; right: 0; bottom: 0; overflow: hidden; } + +.Rk-Editor { + bottom: 0; +} + +.Rk-ZoomButtons { + position: absolute; bottom: 15px; left: 15px; width: 30px; height: 60px; + -webkit-box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.1); + box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.1); +} +.Rk-ZoomIn, .Rk-ZoomOut { + margin: 0; + width: 30px; + height: 30px; + background: url(../img/zoom.png) center top no-repeat; +} +.Rk-ZoomIn:hover, .Rk-ZoomOut:hover { + background-color: #191919; +} +.Rk-ZoomIn { + background-color: #929292; + background-position: center 8px; +} +.Rk-ZoomOut { + background-color: #fff; + background-position: center -22px; +} diff -r 3508fa894b90 -r 504ae70e799e integ/iri/js/iri-lecture-cinecard.js --- a/integ/iri/js/iri-lecture-cinecard.js Thu Apr 25 19:17:13 2013 +0200 +++ b/integ/iri/js/iri-lecture-cinecard.js Fri Apr 26 15:50:14 2013 +0200 @@ -9,7 +9,7 @@ $(".cinecard_title").text(movieli.find(".gift_movie_title").text()); $(".cinecard_sender label").text(movieli.find(".gift_user label").text()); $(".cinecard_sender p").text(movieli.find(".gift_user p").text()); - $(".cinecard_wrap").show(); + $(".cinecard_wrap").fadeIn(); //Renkan initialization var _renkan = new Rkns.Renkan({ @@ -23,10 +23,14 @@ show_node_circles: false, clip_node_images: false, node_size_base: 40, + autoscale_padding: 100, default_user_color: "#808080", buttons_background: "#101010", static_url: renkan_base, - label_untitled_nodes: false + label_untitled_nodes: false, + show_node_tooltip_image: false, + show_node_tooltip_color: false, + show_edge_tooltip_color: false }); Rkns.jsonIO(_renkan, { diff -r 3508fa894b90 -r 504ae70e799e integ/renkan/js/defaults.js --- a/integ/renkan/js/defaults.js Thu Apr 25 19:17:13 2013 +0200 +++ b/integ/renkan/js/defaults.js Fri Apr 26 15:50:14 2013 +0200 @@ -29,6 +29,8 @@ allow_double_click: true, /* Allows Double Click to create a node on an empty background */ element_delete_delay: 5000, + /* Delay between clicking on the bin on an element and really deleting it */ + autoscale_padding: 50, /* MINI-MAP OPTIONS */ @@ -36,6 +38,7 @@ /* Show a small map at the bottom right */ minimap_width: 160, minimap_height: 120, + minimap_padding: 20, minimap_background_color: "#ffffff", minimap_border_color: "#cccccc", minimap_highlight_color: "#ffff00", @@ -86,6 +89,40 @@ tooltip_top_color: "#f0f0f0", tooltip_bottom_color: "#d0d0d0", tooltip_border_color: "#808080", - tooltip_border_width: 1 + tooltip_border_width: 1, + + /* NODE EDITOR OPTIONS */ + + show_node_editor_uri: true, + show_node_editor_description: true, + show_node_editor_size: true, + show_node_editor_color: true, + show_node_editor_image: true, + show_node_editor_creator: true, + + /* NODE TOOLTIP OPTIONS */ + + show_node_tooltip_uri: true, + show_node_tooltip_description: true, + show_node_tooltip_color: true, + show_node_tooltip_image: true, + show_node_tooltip_creator: true, + + /* EDGE EDITOR OPTIONS */ + + show_edge_editor_uri: true, + show_edge_editor_color: true, + show_edge_editor_direction: true, + show_edge_editor_nodes: true, + show_edge_editor_creator: true, + + /* EDGE TOOLTIP OPTIONS */ + + show_edge_tooltip_uri: true, + show_edge_tooltip_color: true, + show_edge_tooltip_nodes: true, + show_edge_tooltip_creator: true + + /* */ }; diff -r 3508fa894b90 -r 504ae70e799e integ/renkan/js/paper-renderer.js --- a/integ/renkan/js/paper-renderer.js Thu Apr 25 19:17:13 2013 +0200 +++ b/integ/renkan/js/paper-renderer.js Fri Apr 26 15:50:14 2013 +0200 @@ -1,5 +1,4 @@ Rkns.Renderer = { - _MINIMAP_MARGIN: 20, _MIN_DRAG_DISTANCE: 2, _NODE_BUTTON_WIDTH: 40, _EDGE_BUTTON_INNER: 2, @@ -11,7 +10,6 @@ _NODE_SIZE_STEP: Math.LN2/4, _MIN_SCALE: 1/20, _MAX_SCALE: 20, - _AUTOSCALE_MARGIN: 50, _MOUSEMOVE_RATE: 80, _DOUBLETAP_DELAY: 800, _DOUBLETAP_DISTANCE: 20*20, @@ -838,24 +836,24 @@ Rkns.Renderer.NodeEditor.prototype.template = Rkns._.template( '
<%-renkan.translate("Size:")%>-<%-node.size%>+
' - + '<%-renkan.translate("Size:")%>-<%-node.size%>+
<% } %>' + + '<% if (options.show_node_editor_color) { %><%-renkan.translate("Created by:")%> <%- Rkns.Renderer.shortenText(node.created_by_title, 25) %>
<% } %>' + + '<% } %>' + + '<% if (options.show_node_editor_creator && node.has_creator) { %><%-renkan.translate("Created by:")%> <%- Rkns.Renderer.shortenText(node.created_by_title, 25) %>
<% } %>' ); Rkns.Renderer.NodeEditor.prototype.readOnlyTemplate = Rkns._.template( - '<%-node.description%>
' - + '<% if (node.image) { %><%-renkan.translate("Created by:")%><%- Rkns.Renderer.shortenText(node.created_by_title, 25) %>
<% } %>' + + '<% if (node.uri && options.show_node_tooltip_uri) { %><% } %>' + + '<% if (options.show_node_tooltip_description) { %><%-node.description%>
<% } %>' + + '<% if (node.image && options.show_node_tooltip_image) { %><%-renkan.translate("Created by:")%><%- Rkns.Renderer.shortenText(node.created_by_title, 25) %>
<% } %>' ); Rkns.Renderer.NodeEditor.prototype.draw = function() { @@ -879,7 +877,8 @@ created_by_title: _created_by.get("title"), size: (_size > 0 ? "+" : "") + _size }, - renkan: this.renkan + renkan: this.renkan, + options: this.options })); this.redraw(); var _this = this, @@ -895,16 +894,19 @@ var onFieldChange = Rkns._(function() { Rkns._(function() { if (_this.renderer.isEditable()) { - var _uri = _this.editor_$.find(".Rk-Edit-URI").val(), - _image = _this.editor_$.find(".Rk-Edit-Image").val(); - _this.editor_$.find(".Rk-Edit-ImgPreview").attr("src", _image || _image_placeholder); - _this.editor_$.find(".Rk-Edit-Goto").attr("href",_uri); var _data = { - title: _this.editor_$.find(".Rk-Edit-Title").val(), - description: _this.editor_$.find(".Rk-Edit-Description").val(), - uri: _uri, - image: _image + title: _this.editor_$.find(".Rk-Edit-Title").val() }; + if (_this.options.show_node_editor_url) { + _data.uri = _this.editor_$.find(".Rk-Edit-URI").val(); + } + if (_this.options.show_node_editor_image) { + _data.image = _this.editor_$.find(".Rk-Edit-Image").val(); + _this.editor_$.find(".Rk-Edit-ImgPreview").attr("src", _data.image || _image_placeholder); + } + if (_this.options.show_node_editor_description) { + _data.description = _this.editor_$.find(".Rk-Edit-Description").val(); + } _model.set(_data); _this.redraw(); } else { @@ -1015,28 +1017,28 @@ Rkns.Renderer.EdgeEditor.prototype.template = Rkns._.template( '<%- renkan.translate("Change edge direction") %>
<% } %>' + + '<% if (options.show_edge_editor_nodes) { %><%-renkan.translate("From:")%><%- Rkns.Renderer.shortenText(edge.from_title, 25) %>
' + + '<%-renkan.translate("To:")%><%- Rkns.Renderer.shortenText(edge.to_title, 25) %>
<% } %>' + + '<% if (options.show_edge_editor_creator && edge.has_creator) { %><%-renkan.translate("Created by:")%><%- Rkns.Renderer.shortenText(edge.created_by_title, 25) %>
<% } %>' ); Rkns.Renderer.EdgeEditor.prototype.readOnlyTemplate = Rkns._.template( - '<%-edge.description%>
' - + '<%-renkan.translate("From:")%><%- Rkns.Renderer.shortenText(edge.from_title, 25) %>
' - + '<%-renkan.translate("To:")%><%- Rkns.Renderer.shortenText(edge.to_title, 25) %>
' - + '<% if (edge.has_creator) { %><%-renkan.translate("Created by:")%><%- Rkns.Renderer.shortenText(edge.created_by_title, 25) %>
<% } %>' + + '<% if (options.show_edge_tooltip_nodes) { %><%-renkan.translate("From:")%><%- Rkns.Renderer.shortenText(edge.from_title, 25) %>
' + + '<%-renkan.translate("To:")%><%- Rkns.Renderer.shortenText(edge.to_title, 25) %>
<% } %>' + + '<% if (options.show_edge_tooltip_creator && edge.has_creator) { %><%-renkan.translate("Created by:")%><%- Rkns.Renderer.shortenText(edge.created_by_title, 25) %>
<% } %>' ); Rkns.Renderer.EdgeEditor.prototype.draw = function() { @@ -1062,7 +1064,7 @@ created_by_title: _created_by.get("title") }, renkan: this.renkan, - properties: this.options.properties + options: this.options, })); this.redraw(); var _this = this, @@ -1077,11 +1079,13 @@ var onFieldChange = Rkns._(function() { Rkns._(function() { if (_this.renderer.isEditable()) { - _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(), - uri: _this.editor_$.find(".Rk-Edit-URI").val() + title: _this.editor_$.find(".Rk-Edit-Title").val() }; + if (_this.options.show_edge_editor_uri) { + _data.uri = _this.editor_$.find(".Rk-Edit-URI").val(); + } + _this.editor_$.find(".Rk-Edit-Goto").attr("href",_data.uri); _model.set(_data); paper.view.draw(); } else { @@ -2001,7 +2005,7 @@ _miny = Math.min.apply(Math, _yy), _maxx = Math.max.apply(Math, _xx), _maxy = Math.max.apply(Math, _yy); - var _scale = Math.max(Rkns.Renderer._MIN_SCALE, Math.min(Rkns.Renderer._MAX_SCALE, (paper.view.size.width - 2 * Rkns.Renderer._AUTOSCALE_MARGIN) / (_maxx - _minx), (paper.view.size.height - 2 * Rkns.Renderer._AUTOSCALE_MARGIN) / (_maxy - _miny))); + var _scale = Math.max(Rkns.Renderer._MIN_SCALE, Math.min(Rkns.Renderer._MAX_SCALE, (paper.view.size.width - 2 * this.renkan.options.autoscale_padding) / (_maxx - _minx), (paper.view.size.height - 2 * this.renkan.options.autoscale_padding) / (_maxy - _miny))); this.setScale(_scale, paper.view.center.subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale))); } if (nodes.length === 1) { @@ -2027,8 +2031,8 @@ var _scale = Math.min( this.scale * .8 * this.renkan.options.minimap_width / paper.view.bounds.width, this.scale * .8 * this.renkan.options.minimap_height / paper.view.bounds.height, - ( this.renkan.options.minimap_width - 2 * Rkns.Renderer._MINIMAP_MARGIN ) / (_maxx - _minx), - ( this.renkan.options.minimap_height - 2 * Rkns.Renderer._MINIMAP_MARGIN ) / (_maxy - _miny) + ( this.renkan.options.minimap_width - 2 * this.renkan.options.minimap_padding ) / (_maxx - _minx), + ( this.renkan.options.minimap_height - 2 * this.renkan.options.minimap_padding ) / (_maxy - _miny) ); this.minimap.offset = this.minimap.size.divide(2).subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale)); this.minimap.scale = _scale;