~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-14 04:50:29 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:223
util.js: Added "urlencode_path" which is specially designed to encode paths.
         Added convenience function encoded_app_path.
         Ajax call now correctly encodes path.
listing, browser.js: All URLs generated are now correctly encoded (where they
        were sent unencoded before).

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
{
85
85
    /* Get a commit log from the user */
86
86
    var logmsg = prompt("Enter commit log:");
 
87
    if (logmsg == null) return;
87
88
    do_action("svncommit", current_path, {"path":files, "logmsg": logmsg});
88
89
    return false;
89
90
}
162
163
        p = document.createElement("p");
163
164
        sidepanel.appendChild(p);
164
165
        p.appendChild(dom_make_img(
165
 
            make_path(path_join(type_icons_path_large, "multi.png")),
 
166
            encoded_app_path(type_icons_path_large, "multi.png"),
166
167
            null, null, "Multiple files"));
167
168
        p = dom_make_text_elem("h2",
168
169
            selected_files.length.toString() + " files selected");
188
189
            if (file.isdir)
189
190
                p = dom_make_link_elem("p", "Browse",
190
191
                    "Navigate to this directory in the file browser",
191
 
                    make_path(path_join(this_app, current_path, filename)));
 
192
                    encoded_app_path(this_app, current_path, filename));
192
193
            else if (handler_type == "text")
193
194
                p = dom_make_link_elem("p", "Edit", "Edit this file",
194
 
                    make_path(path_join(edit_app, current_path, filename)));
 
195
                    encoded_app_path(edit_app, current_path, filename));
195
196
            else
196
197
                p = dom_make_link_elem("p", "Browse",
197
198
                    "View this file in the file browser",
198
 
                    make_path(path_join(this_app, current_path, filename)));
 
199
                    encoded_app_path(this_app, current_path, filename));
199
200
            sidepanel.appendChild(p);
200
201
        }
201
202
 
207
208
        else
208
209
            p = dom_make_link_elem("p", "View",
209
210
                "View this file",
210
 
                make_path(path_join(serve_app, current_path, filename)));
 
211
                encoded_app_path(serve_app, current_path, filename));
211
212
        if (p)
212
213
            sidepanel.appendChild(p);
213
214
 
214
215
        /* Action: Use the "download" app */
215
216
        p = null;
216
 
        path = make_path(path_join(download_app, current_path, filename));
 
217
        path = encoded_app_path(download_app, current_path, filename);
217
218
        if (file.isdir)
218
219
            p = dom_make_link_elem("p", "Download as zip",
219
220
                "Download this directory as a ZIP file", path);
230
231
    }
231
232
    else
232
233
    {
233
 
        path = make_path(path_join(download_app, current_path) + "?");
 
234
        path = encoded_app_path(download_app, current_path) + "?";
234
235
        for (var i=0; i<selected_files.length; i++)
235
236
            path += "path=" + encodeURIComponent(selected_files[i]) + "&";
236
237
        path = path.substr(0, path.length-1);
503
504
            /* Column 3: Filename */
504
505
            td = dom_make_link_elem("td", filename,
505
506
                "Navigate to " + path_join(path, filename),
506
 
                make_path(path_join(this_app, path, filename))/*,
 
507
                encoded_app_path(this_app, path, filename)/*,
507
508
                "navigate(" + repr(path_join(path, filename)) + ")"*/);
508
509
            td.setAttribute("onclick", selection_string);
509
510
            row.appendChild(td);