~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-07-15 09:18:02 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:877
pulldown_subj/__init__.py: Added "enrol_user" function which pulls down a user
    and also enrols them in the database.
Added script enrolallusers.py which scriptulously performs automatic
enrolments of all users in the system, similar to remakeallusers.

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
 
    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
 
    }
 
18
    do_action("putfile", filename,
 
19
              {"path":".", "data":data, "overwrite":"true"},
 
20
              "multipart/form-data", true);
 
21
    disable_save_if_safe();
28
22
}
29
23
 
30
24
function save_file_as(default_filename)
83
77
function initialise_codepress()
84
78
{
85
79
    editbox.addChangeHandler(edit_text);
86
 
    editbox.addSaveHandler(function() {document.getElementById("save_button").click()});
87
80
     
88
81
    /* We can only safely disable the save button on the first load.
89
82
     * Syntax highlighting changes will also get this function called.
120
113
    language = language ? language : "text";
121
114
    document.getElementById("highlighting_select").value = language;
122
115
 
123
 
    txt_elem.className = "codepress autocomplete-off " + language;
 
116
    txt_elem.className = "codepress " + language;
124
117
    txt_elem.setAttribute("onchange", "edit_text()");
125
118
    /* TODO: Make CSS height: 100% work */
126
119
    txt_elem.setAttribute("rows", "35");
142
135
            'text/css': 'css',
143
136
            'text/plain': 'text',
144
137
            'text/html': 'html',
145
 
            'application/xml': 'html',
146
138
            'application/xhtml+xml': 'html'}[mime];
147
139
}