client/js/main.js
changeset 70 47b3125130a2
parent 69 f0873867143a
child 73 cc9deb3b3e13
equal deleted inserted replaced
69:f0873867143a 70:47b3125130a2
   127     		Rkns.$.getJSON(f, function(data) {
   127     		Rkns.$.getJSON(f, function(data) {
   128     			_this.properties = _this.properties.concat(data);
   128     			_this.properties = _this.properties.concat(data);
   129     		});
   129     		});
   130     	});
   130     	});
   131     }
   131     }
   132     if (typeof _opts.bookmarklet_url !== "string") {
       
   133         _opts.bookmarklet_url = "js/bookmarklet.js";
       
   134     }
       
   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;
   136     this.read_only = _opts.read_only;
   140     this.properties = _opts.properties;
   137     this.properties = _opts.properties;
   141     
       
   142     function getAbsoluteURL(url) {
       
   143         var tmp = document.createElement('img');
       
   144         tmp.src = url;
       
   145         var res = tmp.src;
       
   146         tmp.src = null;
       
   147         return res;
       
   148     }
       
   149     
       
   150     this.bookmarklet_url = getAbsoluteURL(_opts.bookmarklet_url);
       
   151     
   138     
   152     this.translate = function(_text) {
   139     this.translate = function(_text) {
   153     	return (Rkns.i18n[_opts.language] || Rkns.i18n[_opts.language.substr(0,2)] || {})[_text] || _text;
   140     	return (Rkns.i18n[_opts.language] || Rkns.i18n[_opts.language.substr(0,2)] || {})[_text] || _text;
   154     }
   141     }
   155     if (typeof _opts.user_id !== "undefined") {
   142     if (typeof _opts.user_id !== "undefined") {
   199         });
   186         });
   200         this.$.find(".Rk-Search-Current").mouseenter(
   187         this.$.find(".Rk-Search-Current").mouseenter(
   201             function() { _select.slideDown(); }
   188             function() { _select.slideDown(); }
   202         );
   189         );
   203         this.$.find(".Rk-Search-Select").mouseleave(
   190         this.$.find(".Rk-Search-Select").mouseleave(
   204             function() { _select.slideUp(); }
   191             function() { _select.hide(); }
   205         );
   192         );
   206         this.setSearchEngine(0);
   193         this.setSearchEngine(0);
   207     }
   194     }
   208     Rkns._(_opts.bins).each(function(_bin) {
   195     Rkns._(_opts.bins).each(function(_bin) {
   209         _this.tabs.push(new _bin.bin(_this, _bin));
   196         _this.tabs.push(new _bin.bin(_this, _bin));