diff -r f53a7999ae7b -r 15e048e00002 client/js/main.js --- a/client/js/main.js Fri Jun 14 12:36:32 2013 +0200 +++ b/client/js/main.js Wed Jul 03 13:42:59 2013 +0200 @@ -25,13 +25,17 @@ /* Declaring the Renkan Namespace Rkns and Default values */ -if (typeof Rkns !== "object") { - Rkns = {}; +(function(root) { + +"use strict"; + +if (typeof root.Rkns !== "object") { + root.Rkns = {}; } -Rkns.$ = jQuery; - -Rkns._ = _; +var Rkns = root.Rkns; +var $ = Rkns.$ = root.jQuery; +var _ = Rkns._ = root._; Rkns.VERSION = '0.2'; @@ -44,7 +48,9 @@ "#8f198f", "#a800a8", "#d826d8", "#ff00fe", "#e87ce8", "#ff65fe", "#f7d3f7", "#feccfe", "#000000", "#242424", "#484848", "#6d6d6d", "#919191", "#b6b6b6", "#dadada", "#ffffff"]; -Rkns._BaseBin = function(_renkan, _opts) { +Rkns.__renkans = []; + +var _BaseBin = Rkns._BaseBin = function(_renkan, _opts) { if (typeof _renkan !== "undefined") { this.renkan = _renkan; this.renkan.$.find(".Rk-Bin-Main").hide(); @@ -105,16 +111,18 @@ } }; -Rkns._BaseBin.prototype.destroy = function() { +_BaseBin.prototype.destroy = function() { this.$.detach(); this.renkan.resizeBins(); }; /* Point of entry */ -Rkns.Renkan = function(_opts) { +var Renkan = Rkns.Renkan = function(_opts) { var _this = this; + Rkns.__renkans.push(this); + this.options = _.defaults(_opts, Rkns.defaults); Rkns._(this.options.property_files).each(function(f) { @@ -135,15 +143,26 @@ .addClass("Rk-Main") .html(this.template(this)); - if (this.options.show_editor) { - this.renderer = new Rkns.Renderer.Scene(this); - } - this.tabs = []; this.search_engines = []; this.current_user_list = new Rkns.Models.UsersList(); + this.current_user_list.on("add remove", function() { + if (this.renderer) { + this.renderer.redrawUsers(); + } + }); + + this.colorPicker = (function() { + var _tmpl = _.template('
'); + return '