upgrade renkan
authorymh <ymh.work@gmail.com>
Fri, 25 Oct 2013 16:55:55 +0200
changeset 39 ab880baf9486
parent 38 c28831a74f93
child 41 349716e61e18
upgrade renkan
web/js/renkan.js
--- a/web/js/renkan.js	Fri Oct 25 16:29:48 2013 +0200
+++ b/web/js/renkan.js	Fri Oct 25 16:55:55 2013 +0200
@@ -1,11 +1,11 @@
 /* 
-    _____            _               
-   |  __ \          | |              
-   | |__) |___ _ __ | | ____ _ _ __  
-   |  _  // _ \ '_ \| |/ / _` | '_ \ 
-   | | \ \  __/ | | |   < (_| | | | |
-   |_|  \_\___|_| |_|_|\_\__,_|_| |_|
-
+ *    _____            _               
+ *   |  __ \          | |              
+ *   | |__) |___ _ __ | | ____ _ _ __  
+ *   |  _  // _ \ '_ \| |/ / _` | '_ \ 
+ *   | | \ \  __/ | | |   < (_| | | | |
+ *   |_|  \_\___|_| |_|_|\_\__,_|_| |_|
+ *
  *  Copyright 2012-2013 Institut de recherche et d'innovation 
  *  contributor(s) : Yves-Marie Haussonne, Raphael Velt, Samuel Huron
  *   
@@ -36,7 +36,7 @@
 var $ = Rkns.$ = root.jQuery;
 var _ = Rkns._ = root._;
 
-Rkns.VERSION = '0.2.1';
+Rkns.VERSION = '0.2.3';
 
 Rkns.pickerColors = ["#8f1919", "#a80000", "#d82626", "#ff0000", "#e87c7c", "#ff6565", "#f7d3d3", "#fecccc",
     "#8f5419", "#a85400", "#d87f26", "#ff7f00", "#e8b27c", "#ffb265", "#f7e5d3", "#fee5cc",
@@ -544,9 +544,9 @@
                 title: this.get("title"),
                 uri: this.get("uri"),
                 description: this.get("description"),
-                color: this.get("color"),
+                color: this.get("color")
             };
-        },
+        }
     });
     
     // NODE
@@ -576,7 +576,7 @@
                 size: this.get("size"),
                 "clip-path": this.get("clip-path")
             };
-        },
+        }
     });
     
     // EDGE
@@ -597,7 +597,7 @@
             type: Backbone.HasOne,
             key: "to",
             relatedModel: Node
-          },
+          }
         ],
         prepare: function(options) {
             var project = options.project;
@@ -617,7 +617,7 @@
                 color: this.get("color"),
                 created_by: this.get("created_by") ? this.get("created_by").get("_id") : null
             };
-        },
+        }
     });
         
     // PROJECT
@@ -631,7 +631,7 @@
             reverseRelation: {
                 key: 'project',
                 includeInJSON: '_id'
-            },
+            }
           },
           {
             type: Backbone.HasMany,
@@ -640,7 +640,7 @@
             reverseRelation: {
                 key: 'project',
                 includeInJSON: '_id'
-            },
+            }
           },
           {
             type: Backbone.HasMany,
@@ -649,7 +649,7 @@
             reverseRelation: {
                 key: 'project',
                 includeInJSON: '_id'
-            },
+            }
           }
         ],
         addUser: function(_props, _options) {
@@ -679,13 +679,19 @@
         validate: function(options) {
             var _project = this;
             _(options.users).each(function(_item) {
-                _item.project = _project;
+                if(_item) {
+                    _item.project = _project;
+                }
             });
             _(options.nodes).each(function(_item) {
-                _item.project = _project;
+                if(_item) {
+                    _item.project = _project;
+                }
             });
             _(options.edges).each(function(_item) {
-                _item.project = _project;
+                if(_item) {
+                    _item.project = _project;
+                }
             });
         },
         // Add event handler to remove edges when a node is removed
@@ -702,7 +708,7 @@
     });
     
     var RosterUser = Models.RosterUser = Backbone.Model.extend({
-        type: "roster_user",               
+        type: "roster_user",
         idAttribute : "_id",
         
         constructor: function(options) {
@@ -743,7 +749,7 @@
                 project: (this.get("project") != null)?this.get("project").get("id"):null,
                 site_id: this.get("site_id")
             };
-        },
+        }
     });
     
     var UsersList = Models.UsersList = Backbone.Collection.extend({
@@ -1041,7 +1047,7 @@
          * Called by Rkns.Renderer.NodeEditor and Rkns.Renderer.EdgeEditor */
     drawEditBox = function(_options, _coords, _path, _xmargin, _selector) {
         _selector.css({
-            width: ( _options.tooltip_width - 2* _options.tooltip_padding ),
+            width: ( _options.tooltip_width - 2* _options.tooltip_padding )
         });
         var _height = _selector.outerHeight() + 2* _options.tooltip_padding,
             _isLeft = (_coords.x < paper.view.center.x ? 1 : -1),
@@ -1627,7 +1633,7 @@
     if (this.options.editor_mode) {
         this.normal_buttons = [
             new EdgeEditButton(this.renderer, null),
-            new EdgeRemoveButton(this.renderer, null),
+            new EdgeRemoveButton(this.renderer, null)
         ];
         this.pending_delete_buttons = [
             new EdgeRevertButton(this.renderer, null)
@@ -3943,7 +3949,7 @@
         _this = this,
         count = 0;
     _(this.data.objects).each(function(_segment) {
-        var _description = _segment.abstract,
+        var _description = _segment['abstract'],
             _title = _segment.title;
         if (!search.isempty && !search.test(_title) && !search.test(_description)) {
             return;