~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-17 04:28:35 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:906
editor.js: Warn before saving if the open file is an old revision.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
    data = editbox.getCode();
16
16
    /* Do NOT refresh the page contents (causes problems for editarea and is
17
17
     * unnecessary). */
18
 
    do_action("putfile", filename,
19
 
              {"path":".", "data":data, "overwrite":"true"},
20
 
              "multipart/form-data", true);
21
 
    disable_save_if_safe();
 
18
    if (current_file.svnstatus != "revision" ||
 
19
        confirm("You are currently viewing an older version of this file. " +
 
20
                "Saving will overwrite the current version. " +
 
21
                "Are you sure you want to continue?"))
 
22
    {
 
23
        do_action("putfile", filename,
 
24
                  {"path":".", "data":data, "overwrite":"true"},
 
25
                  "multipart/form-data", true);
 
26
        disable_save_if_safe();
 
27
    }
22
28
}
23
29
 
24
30
function save_file_as(default_filename)