- Renames and changes default options
authorrougeronj
Thu, 01 Oct 2015 17:16:06 +0200
changeset 560 05a4380227f3
parent 559 ad891b24324a
child 561 5feabdc61980
child 565 49bc7df521df
- Renames and changes default options - Update Readme and some comments
client/README.md
client/js/defaults.js
client/js/renderer/scene.js
client/js/renderer/viewrepr.js
--- 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
--- 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 */
--- 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();
--- 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 {