54 .appendTo(this.$) |
54 .appendTo(this.$) |
55 .click(function() { |
55 .click(function() { |
56 _this.refresh(); |
56 _this.refresh(); |
57 return false; |
57 return false; |
58 }); |
58 }); |
|
59 this.count_$ = Rkns.$('<div>') |
|
60 .addClass("Rk-Bin-Count") |
|
61 .appendTo(this.$); |
59 this.title_$ = Rkns.$('<h2>') |
62 this.title_$ = Rkns.$('<h2>') |
60 .addClass("Rk-Bin-Title") |
63 .addClass("Rk-Bin-Title") |
61 .appendTo(this.$); |
64 .appendTo(this.$); |
62 this.main_$ = Rkns.$('<div>') |
65 this.main_$ = Rkns.$('<div>') |
63 .addClass("Rk-Bin-Main") |
66 .addClass("Rk-Bin-Main") |
108 this.$.mouseup(function() { |
111 this.$.mouseup(function() { |
109 _this.selected_bin_item = undefined; |
112 _this.selected_bin_item = undefined; |
110 _this.$.find(".Rk-Bin-Item.dragging").removeClass("dragging"); |
113 _this.$.find(".Rk-Bin-Item.dragging").removeClass("dragging"); |
111 }); |
114 }); |
112 if (!_opts.search.length) { |
115 if (!_opts.search.length) { |
113 this.$.find(".Rk-Search-Form").detach(); |
116 this.$.find(".Rk-Web-Search-Form").detach(); |
114 } else { |
117 } else { |
115 var _tmpl = Rkns._.template('<li class="<%= className %>" data-key="<%= key %>"><%= title %></li>'), |
118 var _tmpl = Rkns._.template('<li class="<%= className %>" data-key="<%= key %>"><%= title %></li>'), |
116 _select = this.$.find(".Rk-Search-List"), |
119 _select = this.$.find(".Rk-Search-List"), |
117 _input = this.$.find(".Rk-Search-Input") |
120 _input = this.$.find(".Rk-Web-Search-Input") |
118 _form = this.$.find(".Rk-Search-Form"); |
121 _form = this.$.find(".Rk-Web-Search-Form"); |
119 Rkns._(_opts.search).each(function(_search, _key) { |
122 Rkns._(_opts.search).each(function(_search, _key) { |
120 var _searchObj = new _search.type(_this, _search); |
123 var _searchObj = new _search.type(_this, _search); |
121 _this.search_engines.push(_searchObj); |
124 _this.search_engines.push(_searchObj); |
122 }); |
125 }); |
123 _select.html( |
126 _select.html( |
184 _this.renderer.unhighlightAll(); |
187 _this.renderer.unhighlightAll(); |
185 }); |
188 }); |
186 Rkns.$(window).resize(function() { |
189 Rkns.$(window).resize(function() { |
187 _this.resizeBins(); |
190 _this.resizeBins(); |
188 }); |
191 }); |
|
192 |
|
193 this.$.find(".Rk-Bins-Search-Input").on("change keyup paste input", function() { |
|
194 var val = Rkns.$(this).val(); |
|
195 Rkns._(_this.tabs).each(function(tab) { |
|
196 tab.render(val); |
|
197 }); |
|
198 }); |
|
199 this.$.find(".Rk-Bins-Search-Form").submit(function() { |
|
200 return false |
|
201 }); |
189 } |
202 } |
190 |
203 |
191 Rkns.Renkan.prototype.template = Rkns._.template( |
204 Rkns.Renkan.prototype.template = Rkns._.template( |
192 '<div class="Rk-Title"><h1>Hyper Plateau</h1></div><div class="Rk-Bins">' |
205 '<div class="Rk-Title"><h1>Hyper Plateau</h1></div><div class="Rk-Bins">' |
193 + '<form class="Rk-Search-Form"><input class="Rk-Search-Input" type="text" placeholder="Search" />' |
206 + '<form class="Rk-Web-Search-Form Rk-Search-Form"><input class="Rk-Web-Search-Input Rk-Search-Input" type="search" placeholder="Search the Web" />' |
194 + '<div class="Rk-Search-Select"><div class="Rk-Search-Current"></div><ul class="Rk-Search-List"></ul></div>' |
207 + '<div class="Rk-Search-Select"><div class="Rk-Search-Current"></div><ul class="Rk-Search-List"></ul></div>' |
195 + '<input type="submit" value="" class="Rk-Search-Submit" /></form>' |
208 + '<input type="submit" value="" class="Rk-Web-Search-Submit Rk-Search-Submit" /></form>' |
|
209 + '<form class="Rk-Bins-Search-Form Rk-Search-Form"><input class="Rk-Bins-Search-Input Rk-Search-Input" type="search" placeholder="Search in Bins" />' |
|
210 + '<input type="submit" value="" class="Rk-Bins-Search-Submit Rk-Search-Submit" /></form>' |
196 + '<ul class="Rk-Bin-List"></ul></div><div class="Rk-Render Rk-Render-Panel"></div>' |
211 + '<ul class="Rk-Bin-List"></ul></div><div class="Rk-Render Rk-Render-Panel"></div>' |
197 ); |
212 ); |
198 |
213 |
199 |
214 |
200 Rkns.Renkan.prototype.setSearchEngine = function(_key) { |
215 Rkns.Renkan.prototype.setSearchEngine = function(_key) { |
201 this.search_engine = this.search_engines[_key]; |
216 this.search_engine = this.search_engines[_key]; |
202 this.$.find(".Rk-Search-Current").attr("class","Rk-Search-Current " + this.search_engine.getBgClass()); |
217 this.$.find(".Rk-Search-Current").attr("class","Rk-Search-Current " + this.search_engine.getBgClass()); |
203 } |
218 } |
204 |
219 |
205 Rkns.Renkan.prototype.resizeBins = function() { |
220 Rkns.Renkan.prototype.resizeBins = function() { |
206 var _d = + this.$.find(".Rk-Search-Form").outerHeight(); |
221 var _d = + this.$.find(".Rk-Web-Search-Form").outerHeight() + this.$.find(".Rk-Bins-Search-Form").outerHeight(); |
207 this.$.find(".Rk-Bin-Title").each(function() { |
222 this.$.find(".Rk-Bin-Title:visible").each(function() { |
208 _d += Rkns.$(this).outerHeight(); |
223 _d += Rkns.$(this).outerHeight(); |
209 }); |
224 }); |
210 this.$.find(".Rk-Bin-Main").css({ |
225 this.$.find(".Rk-Bin-Main").css({ |
211 height: this.$.find(".Rk-Bins").height() - _d |
226 height: this.$.find(".Rk-Bins").height() - _d |
212 }); |
227 }); |