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

« back to all changes in this revision

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

  • Committer: William Grant
  • Date: 2008-07-03 05:00:32 UTC
  • Revision ID: wgrant@ugrad.unimelb.edu.au-20080703050032-5cix63v2u6kf1mi5
www/apps/browser/__init__.py: Display the save widget in actions2 for
    files. This fixes duplication on refreshing the edit page.
www/media/browser/editor.js: Don't create actions2 widgets, as it's now
    done server-side.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    savebutton.removeAttribute("disabled");
22
22
}
23
23
 
24
 
/** Presents the "editor heading" (the part with the save box)
25
 
 * inserting it into a given element at the front.
 
24
/** Presents the "editor heading" inserting it into a given element at
 
25
 *  the front. Note that the save widget is handled by the Python.
26
26
 */
27
27
function present_editorhead(elem, path, handler_type)
28
28
{
29
29
    var div = document.getElementById("actions2");
30
30
 
31
 
    /* Set up minimal interface */
32
 
    var p = dom_make_text_elem("p", "Save as: ");
33
 
    var pathname = document.createElement("input");
34
 
    pathname.setAttribute("type", "text");
35
 
    pathname.setAttribute("size", "30");
36
 
    pathname.setAttribute("id", "save_filename");
37
 
    pathname.setAttribute("value", path);
38
 
    p.appendChild(pathname);
39
 
    var savebutton = document.createElement("input");
40
 
    savebutton.setAttribute("id", "save_button");
41
 
    savebutton.setAttribute("type", "button");
42
 
    savebutton.setAttribute("value", "Saved");
43
 
    // XXX Do not disable for now; there is a problem getting the callback
44
 
    // to edit_text.
45
 
    //savebutton.setAttribute("disabled", "disabled");
46
 
    savebutton.setAttribute("onclick", "save_file()");
47
 
    p.appendChild(savebutton);
48
 
    var t = document.createTextNode(" ");
49
 
    p.appendChild(t);
50
 
    div.appendChild(p);
51
 
 
52
31
    /* Print a warning message if this is not actually a text file.
53
32
     */
54
33
    if (handler_type != "text")