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

« back to all changes in this revision

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

  • Committer: mattgiuca
  • Date: 2008-01-15 06:17:23 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:233
Added a shaky implementation of EditArea as the text editor.
Installed the EditArea files in media/common.
FileBrowser app includes EditArea.
editor.js calls the appropriate methods to set up an EditArea and the Save
button saves its contents.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
function save_file()
4
4
{
5
5
    filename = document.getElementById("save_filename").value;
6
 
    data = document.getElementById("editbox").value;
 
6
    data = editAreaLoader.getValue("editbox");
7
7
    do_action("putfile", filename, {"path":".", "data":data});
8
8
    saved_status.data = "Saved.";
9
9
}
63
63
    txt_elem.setAttribute("onchange", "edit_text()");
64
64
    /* TODO: Make CSS height: 100% work */
65
65
    txt_elem.setAttribute("rows", "20");
 
66
 
 
67
    /* Load EditArea into the editbox */
 
68
    editAreaLoader.init({
 
69
        id : "editbox",
 
70
        syntax: "python",
 
71
        start_highlight: true
 
72
    });
66
73
}
67
74