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

« back to all changes in this revision

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

  • Committer: me at id
  • Date: 2009-01-15 02:55:57 UTC
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:branches%2Fstorm:1149
ivle.fileservice_lib.action.get_login: Always give credentials as strs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
        p.appendChild(document.createTextNode("Change password"))
107
107
        changepassword.appendChild(p);
108
108
        p = document.createElement("p");
109
 
        p.appendChild(document.createTextNode("Please type your new password "
110
 
            + "twice, to make sure you remember it."))
 
109
        
 
110
        p.appendChild(document.createTextNode("Please type your old password, "
 
111
                + "and new password twice, for verification."));
111
112
        changepassword.appendChild(p);
112
113
 
113
114
        table = document.createElement("table");
115
116
 
116
117
        tr = document.createElement("tr");
117
118
        td = document.createElement("td");
 
119
        td.appendChild(document.createTextNode("Old password:"))
 
120
        tr.appendChild(td);
 
121
        td = document.createElement("td");
 
122
        inputbox = document.createElement("input");
 
123
        inputbox.setAttribute("type", "password");
 
124
        inputbox.setAttribute("name", "oldpass");
 
125
        inputbox.setAttribute("id", "oldpass");
 
126
        inputbox.setAttribute("size", "40");
 
127
        td.appendChild(inputbox)
 
128
        tr.appendChild(td);
 
129
        tbody.appendChild(tr);
 
130
 
 
131
        tr = document.createElement("tr");
 
132
        td = document.createElement("td");
118
133
        td.appendChild(document.createTextNode("New password:"))
119
134
        tr.appendChild(td);
120
135
        td = document.createElement("td");
197
212
    /* Textbox (input) elements */
198
213
    try
199
214
    {
 
215
        var oldpass = document.getElementById("oldpass");
200
216
        var newpass = document.getElementById("newpass");
201
217
        var repeatpass = document.getElementById("repeatpass");
202
218
    }
209
225
    var email = document.getElementById("email");
210
226
 
211
227
    /* Check */
 
228
    oldpassval = oldpass == null ? null : oldpass.value;
212
229
    newpassval = newpass == null ? null : newpass.value;
213
230
    repeatpassval = repeatpass == null ? null : repeatpass.value;
214
231
    nickval = nick.value;
255
272
            dom_removechildren(usernick);
256
273
            usernick.appendChild(document.createTextNode(nickval));
257
274
        }
 
275
        else if (xhr.getResponseHeader("X-IVLE-Action-Error"))
 
276
        {
 
277
            set_result(decodeURIComponent(xhr.getResponseHeader(
 
278
                                     "X-IVLE-Action-Error").toString()), true);        
 
279
        }
258
280
        else
259
281
        {
260
282
            set_result("There was a problem updating the details."
261
 
                + " Your changes have not been saved.");
 
283
                + " Your changes have not been saved.", true);
262
284
        }
263
285
    }
264
286
    data = {
265
287
        "login": user_data.login,
266
288
        "nick": nickval,
267
289
        "email": emailval,
 
290
        "oldpass": oldpassval,
268
291
    }
269
292
    if (newpassval != null && newpassval != "")
270
293
        data['password'] = newpassval;