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

« back to all changes in this revision

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

  • Committer: wagrant
  • Date: 2008-08-09 05:16:21 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:997
specialhome: Support group workspaces! Yay! Involved a bit of poking to
             get it all working, but it does.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
            /* Print the file listing */
74
74
            ul = document.createElement("ul");
75
75
            // Stuff
76
 
            ul.appendChild(make_subject_item(subjpath, PERSONALDIR,
 
76
            ul.appendChild(make_subject_item(subjpath,
 
77
                path_join("users", username, subjpath), PERSONALDIR,
77
78
                "Your own files in this subject"));
 
79
 
78
80
            // Groups
79
 
            /* TODO: List groups */
 
81
            var groups = subject.groups;
 
82
            for (var j=0; j<subject.groups.length; j++)
 
83
            {
 
84
                var group = subject.groups[j];
 
85
                ul.appendChild(make_subject_item(subjpath,
 
86
                    path_join("groups", subject.subj_short_name + "_" +
 
87
                              subject.year + "_" + subject.semester + "_" +
 
88
                              group.name),
 
89
                    group.name,
 
90
                    "This group's files in this subject"));
 
91
            }
80
92
            
81
93
            specialhomediv.appendChild(ul);
82
94
 
93
105
        specialhomediv.appendChild(h2);
94
106
        /* Create the contents */
95
107
        ul = document.createElement("ul");
96
 
        ul.appendChild(make_subject_item("", "stuff",
 
108
        ul.appendChild(make_subject_item("",
 
109
              path_join("users", username, "stuff"), "stuff",
97
110
              "Your own files not related to a subject"));
98
111
        specialhomediv.appendChild(ul);
99
112
        /* Remove stuff from the listing */
118
131
/* Does an series of AJAX requests to find out the properties of this folder 
119
132
 * and then updates the folder view
120
133
 */
121
 
function make_subject_item(path, name, description)
 
134
function make_subject_item(path, repopath, name, description)
122
135
{
123
136
    // Create the temporary item
124
137
    var li = document.createElement("li");
182
195
                li.setAttribute("class", "listing-loading");
183
196
 
184
197
                var localpath = path_join(path, name);
185
 
                // The repository doesn't know about PERSONALDIR.
186
 
                if (name == PERSONALDIR) name = '';
187
 
                var repopath = path_join('users', username, path, name);
188
198
 
189
199
                if (create_if_needed(repopath))
190
200
                {