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

« back to all changes in this revision

Viewing changes to www/media/tutorial/tutorial.js

  • Committer: mattgiuca
  • Date: 2008-03-28 07:32:15 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:718
Tutorial: Minor fixes wrt addition of reset button.
    * Swapped Reset and Save button so Save is on the far left.
        (I find it is a different, more passive action than the other 3, so it
        belongs on its own. Also it's grey most of the time so it looks better
        separated).
    * Reset button now activates the Save button (as it has modified the text
        box), in the same way that directly editing the text does.
    * Added a bit of padding under the text box, because there was none before
        and it looked bad.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
 * box with the hidden "reset button backup" field, containing the original
117
117
 * partial fragment.
118
118
 * exerciseid: "id" of the exercise's div element.
 
119
 * filename: Filename of the exercise's XML file (used to identify the exercise
 
120
 *     when interacting with the server).
119
121
 */
120
 
function resetexercise(exerciseid)
 
122
function resetexercise(exerciseid, filename)
121
123
{
122
124
    conf_msg = "This will delete your solution to this exercise, and reset "
123
125
        + "it back to the default partial solution.\n\n"
131
133
    var text_urlencoded = resettextbox.value;
132
134
    /* Need to un-urlencode the value */
133
135
    exercisebox.value = decodeURIComponent(text_urlencoded);
 
136
    /* We changed the text, so make Save button available, and autosave after
 
137
     * 10 seconds. */
 
138
    set_saved_status(exerciseid, filename, "Save");
134
139
}
135
140
 
136
141
/* savetimers is a dict mapping exerciseIDs to timer IDs.