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

« back to all changes in this revision

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

  • Committer: mattgiuca
  • Date: 2008-01-13 23:38:58 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:213
Fileservice / Files (Python and JS files):
    Added code to handle "nice filetypes" and "nice svn status".
    New JSON value for dir listings, "type_nice" which contains the nice
    filetype calculated by the server.
    The client calculates the nice svn status.
    Added new icons for svn status for added, deleted, missing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        else
66
66
            filetype = "text/plain";
67
67
 
 
68
        if ("type_nice" in file)
 
69
            filetype_nice = file.type_nice;
 
70
        else
 
71
            filetype_nice = "File";
 
72
 
68
73
        p = document.createElement("p");
69
74
        sidepanel.appendChild(p);
70
75
        p.appendChild(dom_make_img(mime_type_to_icon(filetype, true),
71
76
            null, null, filetype));
72
77
        p = dom_make_text_elem("h2", filename);
73
78
        sidepanel.appendChild(p);
74
 
        p = dom_make_text_elem("p", filetype);
 
79
        p = dom_make_text_elem("p", filetype_nice);
75
80
        sidepanel.appendChild(p);
 
81
        if (under_subversion)
 
82
        {
 
83
            p = document.createElement("p");
 
84
            p.appendChild(dom_make_img(svnstatus_to_icon(file.svnstatus),
 
85
                22, 22, svnstatus_to_string(file.svnstatus)));
 
86
            sidepanel.appendChild(p);
 
87
            p = dom_make_text_elem("p", svnstatus_to_string(file.svnstatus));
 
88
            sidepanel.appendChild(p);
 
89
        }
76
90
        if ("size" in file)
77
91
        {
78
92
            p = dom_make_text_elem("p", "Size: " + nice_filesize(file.size));
164
178
        "Paste the copied or cut files to the current directory");
165
179
    sidepanel.appendChild(p);
166
180
 
167
 
    /*
168
 
     <p><a href="">Cut</a></p>
169
 
     <p><a href="">Copy</a></p>
170
 
     */
171
181
    if (under_subversion)
172
182
    {
173
183
        p = dom_make_text_elem("h3", "Subversion");
387
397
            td.setAttribute("class", "thincol");
388
398
            td.setAttribute("onclick", selection_string);
389
399
            td.appendChild(dom_make_img(mime_type_to_icon("text/directory"),
390
 
                22, 22, file.type));
 
400
                22, 22, file.type_nice));
391
401
            row.appendChild(td);
392
402
            td = document.createElement("td");
393
403
            td.setAttribute("class", "thincol");
394
404
            if (under_subversion)
395
405
                td.appendChild(dom_make_img(svnstatus_to_icon(file.svnstatus),
396
 
                    22, 22, file.svnstatus));
 
406
                    22, 22, svnstatus_to_string(file.svnstatus)));
397
407
            row.appendChild(td);
398
408
            /* Column 3: Filename */
399
409
            td = dom_make_link_elem("td", filename,
409
419
            td = document.createElement("td");
410
420
            td.setAttribute("class", "thincol");
411
421
            td.appendChild(dom_make_img(mime_type_to_icon(file.type),
412
 
                22, 22, file.type));
 
422
                22, 22, file.type_nice));
413
423
            row.appendChild(td);
414
424
            td = document.createElement("td");
415
425
            td.setAttribute("class", "thincol");
416
426
            if (under_subversion)
417
427
                td.appendChild(dom_make_img(svnstatus_to_icon(file.svnstatus),
418
 
                    22, 22, file.svnstatus));
 
428
                    22, 22, svnstatus_to_string(file.svnstatus)));
419
429
            row.appendChild(td);
420
430
            /* Column 3: Filename */
421
431
            td = dom_make_text_elem("td", filename);