~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:23:56 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:717
Tutorial: Bugfix - Reset Text was not escaped, so bad, horribly bad things
    happened for partial solutions with weird characters.
    Now URLencoded, and the JavaScript unencodes it.
    Also refactored code to print out all the buttons, since one huge format
    string was not good.

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
    var exercisediv = document.getElementById(exerciseid);
129
129
    var exercisebox = exercisediv.getElementsByTagName("textarea")[0];
130
130
    var resettextbox = document.getElementById("input_resettext_" + exerciseid);
131
 
    exercisebox.value = resettextbox.value;
 
131
    var text_urlencoded = resettextbox.value;
 
132
    /* Need to un-urlencode the value */
 
133
    exercisebox.value = decodeURIComponent(text_urlencoded);
132
134
}
133
135
 
134
136
/* savetimers is a dict mapping exerciseIDs to timer IDs.