diff -r cf48c6d69717 -r f9019462465a client/js/main.js --- a/client/js/main.js Thu Feb 14 12:25:58 2013 +0100 +++ b/client/js/main.js Thu Feb 14 17:39:52 2013 +0100 @@ -95,12 +95,22 @@ if (typeof _opts.search !== "object" || !_opts.search) { _opts.search = []; } + if (typeof _opts.bins !== "object" || !_opts.bins) { + _opts.bins = []; + } if (typeof _opts.static_url !== "string") { _opts.static_url = ""; } + if (typeof _opts.show_bins !== "boolean") { + _opts.show_bins = !!_opts.search.length || !!_opts.bins.length; + } + if (typeof _opts.read_only !== "boolean") { + _opts.read_only = false; + } this.project = new Rkns.Models.Project(); this.language = _opts.language; this.static_url = _opts.static_url; + this.read_only = _opts.read_only; this.l10n = Rkns.i18n[_opts.language]; if (typeof _opts.user_id !== "undefined") { this.current_user = _opts.user_id; @@ -108,7 +118,7 @@ this.$ = Rkns.$("#" + _opts.container); this.$ .addClass("Rk-Main") - .html(this.template()); + .html(this.template(_opts)); this.renderer = new Rkns.Renderer.Scene(this); this.tabs = []; this.search_engines = []; @@ -173,6 +183,9 @@ _mainDiv.slideDown(); } }).on("mousedown", ".Rk-Bin-Item", function() { + if (_this.read_only) { + return false; + } var _t = Rkns.$(this); _t.addClass("dragging"); _this.selected_bin_item = { @@ -211,13 +224,13 @@ } Rkns.Renkan.prototype.template = Rkns._.template( - '

Hyper Plateau

' + '<% if (show_bins) { %>

Hyper Plateau

' + '
' + '
    ' + '
    ' + '
    ' + '
    ' - + '
    ' + + '
    <% } %>
    ' );