client/js/main.js
changeset 28 805d85b3f390
parent 26 2fad193bae98
child 34 08a366a35143
--- a/client/js/main.js	Wed Aug 22 16:50:42 2012 +0200
+++ b/client/js/main.js	Tue Aug 28 18:26:13 2012 +0200
@@ -1,6 +1,6 @@
 /* 
  *  Copyright 2012 Institut de recherche et d'innovation 
- *  contributor(s) : Samuel Huron, Raphael Velt
+ *  contributor(s) : Yves-Marie Haussonne, Raphael Velt, Samuel Huron
  *   
  *  contact@iri.centrepompidou.fr
  *  http://www.iri.centrepompidou.fr 
@@ -18,15 +18,8 @@
 
 /* Declaring the Renkan Namespace Rkns and Default values */
 
-Rkns = {
-    _MIN_DRAG_DISTANCE: 2,
-    _NODE_RADIUS: 20,
-    _NODE_FONT_SIZE: 14,
-    _ARROW_LENGTH: 20,
-    _ARROW_WIDTH: 15,
-    _RENDER: 1,
-    _SAVE: 2,
-    _RENDER_AND_SAVE: 3
+if (typeof Rkns !== "object") {
+    Rkns = {}
 }
 
 Rkns.$ = jQuery;
@@ -55,9 +48,6 @@
 /* Point of entry */
 
 Rkns.Renkan = function(_opts) {
-    if (typeof _opts.remotemodel !== "string") {
-        _opts.remotemodel = "FullJson";
-    }
     if (typeof _opts.language !== "string" || typeof Rkns.i18n[_opts.language] == "undefined") {
         _opts.language = "en";
     }
@@ -173,7 +163,7 @@
 Rkns.Renkan.prototype.template = Rkns._.template(
     '<div class="Rk-Bins">'
     + '<form class="Rk-Search-Form"><input class="Rk-Search-Input" type="search" placeholder="Search" /><select class="Rk-Search-Select"></select></form>'
-    + '<ul class="Rk-Bin-List"></ul></div><div class="Rk-Render"></div>'
+    + '<ul class="Rk-Bin-List"></ul></div><div class="Rk-Render Rk-Render-Panel"></div>'
 );
 
 
@@ -218,11 +208,10 @@
             if (typeof _callbefore === "function") {
                 _callbefore.apply(this, Array.prototype.slice.call(arguments, 0));
             }
-            if (typeof _baseClass.prototype._init !== "function") {
-                _baseClass.prototype._init = function() {}
+            _baseClass.apply(this, Array.prototype.slice.call(arguments, 0));
+            if (typeof this._init == "function") {
+                this._init.apply(this, Array.prototype.slice.call(arguments, 0));
             }
-            _baseClass.apply(this, Array.prototype.slice.call(arguments, 0));
-            this._init.apply(this, Array.prototype.slice.call(arguments, 0));
         }
         _class.prototype = new _baseClass();
         return _class;