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

« back to all changes in this revision

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

  • Committer: mattgiuca
  • Date: 2008-07-27 11:44:59 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:955
browser: Restyled "special home" page. Now much more in-line with the existing
    file browser interface.
    Includes changes to JavaScript (the DOM layout).
    Reduced h1s -> h2s, h2s -> h3s (since H1 is the full IVLE heading).
    Added colours, borders and padding to reduce space usage on the page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
{
37
37
    listing = listing.listing;
38
38
    var filetablediv = document.getElementById("filetablediv");
39
 
    var h1;
 
39
    var specialhomediv;
40
40
    var h2;
 
41
    var h3;
41
42
    var ul;
42
43
    var li;
43
44
 
 
45
    /* Wrap all this "special" stuff in a div, for styling purposes */
 
46
    specialhomediv = document.createElement("div");
 
47
    specialhomediv.setAttribute("id", "specialhome");
 
48
    filetablediv.appendChild(specialhomediv);
 
49
 
44
50
    /* SUBJECTS Section
45
51
    /* Create the header row */
46
52
    if (subjects.length > 0)
47
53
    {
48
 
        h1 = dom_make_text_elem("h1", "Subjects");
49
 
        filetablediv.appendChild(h1);
 
54
        h2 = dom_make_text_elem("h2", "Subjects");
 
55
        specialhomediv.appendChild(h2);
50
56
    }
51
57
 
52
58
    /* Create the contents */
55
61
        var subject = subjects[i];
56
62
        var path = subject.subj_short_name;
57
63
        // Header
58
 
        h2 = dom_make_text_elem("h2", subject.subj_name);
59
 
        filetablediv.appendChild(h2);
 
64
        h3 = dom_make_text_elem("h3", subject.subj_name);
 
65
        specialhomediv.appendChild(h3);
60
66
        
61
67
        /* Print the file listing */
62
68
        ul = document.createElement("ul");
66
72
        // Groups
67
73
        /* TODO: List groups */
68
74
            
69
 
        filetablediv.appendChild(ul);
 
75
        specialhomediv.appendChild(ul);
70
76
 
71
77
        /* Remove it from listing */
72
78
        if (subject.subj_short_name in listing)
77
83
 
78
84
    /* STUFF Section -- For the stuff directory */
79
85
    /* Create the header */
80
 
    h1 = dom_make_text_elem("h1", "Stuff");
81
 
    filetablediv.appendChild(h1);
 
86
    h2 = dom_make_text_elem("h2", "Stuff");
 
87
    specialhomediv.appendChild(h2);
82
88
    /* Create the contents */
83
89
    ul = document.createElement("ul");
84
90
    ul.appendChild(make_subject_item("", "stuff",
85
91
          "Your own files not related to a subject"));
86
 
    filetablediv.appendChild(ul);
 
92
    specialhomediv.appendChild(ul);
87
93
    /* Remove stuff from the listing */
88
94
    if ("stuff" in listing)
89
95
        delete listing["stuff"];
90
96
 
91
97
    /* JUNK Section -- All the rest */
92
98
    /* Create the header row */
93
 
    h1 = dom_make_text_elem("h1", "Junk");
94
 
    filetablediv.appendChild(h1);
 
99
    h2 = dom_make_text_elem("h2", "Junk");
 
100
    specialhomediv.appendChild(h2);
95
101
}
96
102
 
97
103
/* Does an series of AJAX requests to find out the properties of this folder