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

« back to all changes in this revision

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

  • Committer: wagrant
  • Date: 2008-07-09 03:01:14 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:836
Split the editor's Save and Save As functionality. This makes things
look cleaner, and will let us more easily add overwrite checking, among
other niceties.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
    }
10
10
}
11
11
 
12
 
function save_file()
 
12
function save_file(filename)
13
13
{
14
 
    var filename = document.getElementById("save_filename").value;
15
14
    data = editbox.getCode();
16
15
    /* Do NOT refresh the page contents (causes problems for editarea and is
17
16
     * unnecessary). */
21
20
    disable_save_if_safe();
22
21
}
23
22
 
 
23
function save_file_as(default_filename)
 
24
{
 
25
    filename = prompt('Path to save to:', default_filename);
 
26
    /* TODO: Confirm overwriting. */
 
27
    save_file(filename);
 
28
}
 
29
 
24
30
function edit_text()
25
31
{
26
32
    var savebutton = document.getElementById("save_button");