~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 05:22:27 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:224
util.js: Removed urlencoding support from "encoded_app_path" (now called
        "app_path"). This was causing double-encoding, as all URLs are already
        encoded by dom_make_link_elem.
    Now encoding is done exactly once, URLs are correct.

Show diffs side-by-side

added added

removed removed

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