~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/media/browser/browser.js

  • Committer: mattgiuca
  • Date: 2008-01-14 01:59:00 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:222
browser.js:
    Edit mode no longer switches to browser mode in a directory.
    Instead, it creates a new file for editing in that directory, and goes to
    the editor environment.

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
    }
206
206
 
207
207
    /* Check if this is a directory listing or file contents */
208
 
    if (response.getResponseHeader("X-IVLE-Return") == "Dir")
 
208
    var isdir = response.getResponseHeader("X-IVLE-Return") == "Dir";
 
209
    if (!editmode && isdir)
209
210
    {
210
211
        var listing = response.responseText;
211
212
        /* The listing SHOULD be valid JSON text. Parse it into an object. */
233
234
        switch (handler_type)
234
235
        {
235
236
        case "text":
236
 
            handle_text(path, response.responseText, would_be_handler_type);
 
237
            if (isdir)
 
238
            {
 
239
                handle_text(path_join(path, "untitled"), "",
 
240
                    would_be_handler_type);
 
241
            }
 
242
            else
 
243
            {
 
244
                handle_text(path, response.responseText,
 
245
                    would_be_handler_type);
 
246
            }
237
247
            break;
238
248
        case "image":
239
249
            /* TODO: Custom image handler */