client/js/main.js
changeset 111 fbe12f54453a
parent 110 55454c900296
child 113 fac7354c55d2
equal deleted inserted replaced
110:55454c900296 111:fbe12f54453a
   114         _opts.static_url = "";
   114         _opts.static_url = "";
   115     }
   115     }
   116     if (typeof _opts.show_bins !== "boolean") {
   116     if (typeof _opts.show_bins !== "boolean") {
   117         _opts.show_bins = !!_opts.search.length || !!_opts.bins.length;
   117         _opts.show_bins = !!_opts.search.length || !!_opts.bins.length;
   118     }
   118     }
   119     if (typeof _opts.read_only !== "boolean") {
       
   120         _opts.read_only = false;
       
   121     }
       
   122     if (typeof _opts.properties !== "object") {
   119     if (typeof _opts.properties !== "object") {
   123     	_opts.properties = [];
   120     	_opts.properties = [];
   124     }
   121     }
   125     if (typeof _opts.property_files === "object") {
   122     if (typeof _opts.property_files === "object") {
   126     	Rkns._(_opts.property_files).each(function(f) {
   123     	Rkns._(_opts.property_files).each(function(f) {
   134     }
   131     }
   135     this.project = new Rkns.Models.Project();
   132     this.project = new Rkns.Models.Project();
   136     this.language = _opts.language;
   133     this.language = _opts.language;
   137     this.static_url = _opts.static_url;
   134     this.static_url = _opts.static_url;
   138     this.show_bins = _opts.show_bins;
   135     this.show_bins = _opts.show_bins;
   139     this.read_only = _opts.read_only;
       
   140     this.properties = _opts.properties;
   136     this.properties = _opts.properties;
   141     this.clip_images = _opts.clip_images;
   137     this.clip_images = _opts.clip_images;
       
   138     this.read_only = _opts.read_only || false;
       
   139     this.snapshot_mode = _opts.snapshot_mode || false;
   142     
   140     
   143     this.translate = function(_text) {
   141     this.translate = function(_text) {
   144     	return (Rkns.i18n[_opts.language] || Rkns.i18n[_opts.language.substr(0,2)] || {})[_text] || _text;
   142     	return (Rkns.i18n[_opts.language] || Rkns.i18n[_opts.language.substr(0,2)] || {})[_text] || _text;
   145     }
   143     }
   146     if (typeof _opts.user_id !== "undefined") {
   144     if (typeof _opts.user_id !== "undefined") {
   252     + '<form class="Rk-Bins-Search-Form Rk-Search-Form"><input class="Rk-Bins-Search-Input Rk-Search-Input" type="search" placeholder="<%- translate("Search in Bins") %>" />'
   250     + '<form class="Rk-Bins-Search-Form Rk-Search-Form"><input class="Rk-Bins-Search-Input Rk-Search-Input" type="search" placeholder="<%- translate("Search in Bins") %>" />'
   253     + '<input type="submit" value="" class="Rk-Bins-Search-Submit Rk-Search-Submit" /></form></div>'
   251     + '<input type="submit" value="" class="Rk-Bins-Search-Submit Rk-Search-Submit" /></form></div>'
   254     + '<ul class="Rk-Bin-List"></ul></div><% } %><div class="Rk-Render Rk-Render-<% if (show_bins) { %>Panel<% } else { %>Full<% } %>"></div>'
   252     + '<ul class="Rk-Bin-List"></ul></div><% } %><div class="Rk-Render Rk-Render-<% if (show_bins) { %>Panel<% } else { %>Full<% } %>"></div>'
   255 );
   253 );
   256 
   254 
       
   255 Rkns.Renkan.prototype.onStatusChange = function() {
       
   256 	this.renderer.onStatusChange();
       
   257 }
       
   258 
   257 
   259 
   258 Rkns.Renkan.prototype.setSearchEngine = function(_key) {
   260 Rkns.Renkan.prototype.setSearchEngine = function(_key) {
   259     this.search_engine = this.search_engines[_key];
   261     this.search_engine = this.search_engines[_key];
   260     this.$.find(".Rk-Search-Current").attr("class","Rk-Search-Current " + this.search_engine.getBgClass());
   262     this.$.find(".Rk-Search-Current").attr("class","Rk-Search-Current " + this.search_engine.getBgClass());
   261 }
   263 }