Show More
@@ -167,7 +167,6 b' var IPython = (function (IPython) {' | |||||
167 | if (param !== undefined && param.msg) { |
|
167 | if (param !== undefined && param.msg) { | |
168 | message = param.msg; |
|
168 | message = param.msg; | |
169 | } |
|
169 | } | |
170 | console.log(data); |
|
|||
171 | var len = data.length; |
|
170 | var len = data.length; | |
172 | this.clear_list(); |
|
171 | this.clear_list(); | |
173 | if (len === 0) { |
|
172 | if (len === 0) { | |
@@ -177,17 +176,29 b' var IPython = (function (IPython) {' | |||||
177 | .text(message) |
|
176 | .text(message) | |
178 | ); |
|
177 | ); | |
179 | } |
|
178 | } | |
|
179 | var path = this.notebookPath(); | |||
|
180 | var offset = 0; | |||
|
181 | if (path !== '') { | |||
|
182 | var item = this.new_notebook_item(0); | |||
|
183 | this.add_dir(path, '..', item); | |||
|
184 | offset = 1; | |||
|
185 | } | |||
180 | for (var i=0; i<len; i++) { |
|
186 | for (var i=0; i<len; i++) { | |
181 | var name = data[i].name; |
|
187 | if (data[i].type === 'directory') { | |
182 |
var |
|
188 | var name = data[i].name; | |
183 | var nbname = utils.splitext(name)[0]; |
|
189 | var item = this.new_notebook_item(i+offset); | |
184 | var item = this.new_notebook_item(i); |
|
190 | this.add_dir(path, name, item); | |
185 | this.add_link(path, nbname, item); |
|
|||
186 | name = utils.url_path_join(path, name); |
|
|||
187 | if(this.sessions[name] === undefined){ |
|
|||
188 | this.add_delete_button(item); |
|
|||
189 | } else { |
|
191 | } else { | |
190 | this.add_shutdown_button(item,this.sessions[name]); |
|
192 | var name = data[i].name; | |
|
193 | var nbname = utils.splitext(name)[0]; | |||
|
194 | var item = this.new_notebook_item(i+offset); | |||
|
195 | this.add_link(path, nbname, item); | |||
|
196 | name = utils.url_path_join(path, name); | |||
|
197 | if(this.sessions[name] === undefined){ | |||
|
198 | this.add_delete_button(item); | |||
|
199 | } else { | |||
|
200 | this.add_shutdown_button(item,this.sessions[name]); | |||
|
201 | } | |||
191 | } |
|
202 | } | |
192 | } |
|
203 | } | |
193 | }; |
|
204 | }; | |
@@ -198,6 +209,8 b' var IPython = (function (IPython) {' | |||||
198 | // item.addClass('list_item ui-widget ui-widget-content ui-helper-clearfix'); |
|
209 | // item.addClass('list_item ui-widget ui-widget-content ui-helper-clearfix'); | |
199 | // item.css('border-top-style','none'); |
|
210 | // item.css('border-top-style','none'); | |
200 | item.append($("<div/>").addClass("span12").append( |
|
211 | item.append($("<div/>").addClass("span12").append( | |
|
212 | $('<i/>').addClass('item_icon') | |||
|
213 | ).append( | |||
201 | $("<a/>").addClass("item_link").append( |
|
214 | $("<a/>").addClass("item_link").append( | |
202 | $("<span/>").addClass("item_name") |
|
215 | $("<span/>").addClass("item_name") | |
203 | ) |
|
216 | ) | |
@@ -214,10 +227,28 b' var IPython = (function (IPython) {' | |||||
214 | }; |
|
227 | }; | |
215 |
|
228 | |||
216 |
|
229 | |||
|
230 | NotebookList.prototype.add_dir = function (path, name, item) { | |||
|
231 | item.data('name', name); | |||
|
232 | item.data('path', path); | |||
|
233 | item.find(".item_name").text(name); | |||
|
234 | item.find(".item_icon").addClass('icon-folder-open'); | |||
|
235 | item.find("a.item_link") | |||
|
236 | .attr('href', | |||
|
237 | utils.url_join_encode( | |||
|
238 | this.baseProjectUrl(), | |||
|
239 | "tree", | |||
|
240 | path, | |||
|
241 | name | |||
|
242 | ) | |||
|
243 | ); | |||
|
244 | }; | |||
|
245 | ||||
|
246 | ||||
217 | NotebookList.prototype.add_link = function (path, nbname, item) { |
|
247 | NotebookList.prototype.add_link = function (path, nbname, item) { | |
218 | item.data('nbname', nbname); |
|
248 | item.data('nbname', nbname); | |
219 | item.data('path', path); |
|
249 | item.data('path', path); | |
220 | item.find(".item_name").text(nbname); |
|
250 | item.find(".item_name").text(nbname + '.ipynb'); | |
|
251 | item.find(".item_icon").addClass('icon-book'); | |||
221 | item.find("a.item_link") |
|
252 | item.find("a.item_link") | |
222 | .attr('href', |
|
253 | .attr('href', | |
223 | utils.url_join_encode( |
|
254 | utils.url_join_encode( | |
@@ -232,6 +263,7 b' var IPython = (function (IPython) {' | |||||
232 |
|
263 | |||
233 | NotebookList.prototype.add_name_input = function (nbname, item) { |
|
264 | NotebookList.prototype.add_name_input = function (nbname, item) { | |
234 | item.data('nbname', nbname); |
|
265 | item.data('nbname', nbname); | |
|
266 | item.find(".item_icon").addClass('icon-book'); | |||
235 | item.find(".item_name").empty().append( |
|
267 | item.find(".item_name").empty().append( | |
236 | $('<input/>') |
|
268 | $('<input/>') | |
237 | .addClass("nbname_input") |
|
269 | .addClass("nbname_input") |
General Comments 0
You need to be logged in to leave comments.
Login now