# HG changeset patch # User rougeronj # Date 1443712566 -7200 # Node ID 05a4380227f379b95d661730745677cfaaeca833 # Parent ad891b24324a0dd47246ad72b9bbdd95cf208354 - Renames and changes default options - Update Readme and some comments diff -r ad891b24324a -r 05a4380227f3 client/README.md --- a/client/README.md Thu Oct 01 15:45:20 2015 +0200 +++ b/client/README.md Thu Oct 01 17:16:06 2015 +0200 @@ -308,6 +308,7 @@ Here is an exhaustive list of these parameters: * viewIndex=index: init the renkan with the indexed view. Negative index starts from the end of the list of views (viewIndex=-1 will load the last view). In case the view doesn't exist, the initial view (viewIndex=0) will be loaded. * view=offset-x,offset-y,zoom-level: Load a view with the given zoom and offset parameters +* view=autoscale: force the view to be autoscaled when the renkan loads * idNode=id: highlight a node according to the given node id. ## Drop management diff -r ad891b24324a -r 05a4380227f3 client/js/defaults.js --- a/client/js/defaults.js Thu Oct 01 15:45:20 2015 +0200 +++ b/client/js/defaults.js Thu Oct 01 17:16:06 2015 +0200 @@ -47,10 +47,10 @@ /* show zoom buttons */ save_view: true, /* show buttons to save view */ - views_parameters: true, - /* load parameters (offset + zoom) from the view or use autoscale */ - views_nodes: true, - /* load hidden nodes from the view or show all of them */ + view_force_autoscale: true, + /* Force autoscale when the Renkan is loaded */ + view_show_hiddennodes: true, + /* Show all the node when the Renkan is loaded */ default_index_view: -1, /* URL parsing */ diff -r ad891b24324a -r 05a4380227f3 client/js/renderer/scene.js --- a/client/js/renderer/scene.js Thu Oct 01 15:45:20 2015 +0200 +++ b/client/js/renderer/scene.js Thu Oct 01 17:16:06 2015 +0200 @@ -1223,11 +1223,11 @@ }; this.view.setScale(params.zoom_level, new paper.Point(params.offset)); } - //if view parameters = autoscale or views_parameters options is false, we apply a zoom fit on the view. + //if view parameters = autoscale we apply a zoom fit on the view. if ((typeof _params.view !== 'undefined' && _params.view === "autoscale")){ this.view.autoScale(); } - //if viewsNodes = false or views_nodes options is false, we show all the node by default. + //if viewsNodes = false we show all the node by default. if (typeof _params.viewsNodes !== 'undefined'){ if (_params.viewsNodes === "true"){ this.view.hiddenNodes = (this.view.params.hidden_nodes || []).concat(); diff -r ad891b24324a -r 05a4380227f3 client/js/renderer/viewrepr.js --- a/client/js/renderer/viewrepr.js Thu Oct 01 15:45:20 2015 +0200 +++ b/client/js/renderer/viewrepr.js Thu Oct 01 17:16:06 2015 +0200 @@ -72,13 +72,13 @@ initWithParams: function(){ var _this = this; - if (_this.options.views_parameters){ + if (_this.options.view_force_autoscale){ + this.autoScale(); + } else { _this.setScale(_this.params.zoom_level, new paper.Point(_this.params.offset)); - } else { - this.autoScale(); } - if (_this.options.hide_nodes && _this.options.views_nodes){ + if (_this.options.hide_nodes && !_this.options.view_show_hiddennodes){ _this.hiddenNodes = (_this.params.hidden_nodes || []).concat(); _this.hideNodes(); } else {