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

« back to all changes in this revision

Viewing changes to ivle/webapp/tos/media/tos.js

  • Committer: Matt Giuca
  • Date: 2009-02-24 02:02:03 UTC
  • mto: This revision was merged to the branch mainline in revision 1119.
  • Revision ID: matt.giuca@gmail.com-20090224020203-aqdcjnsj6y7wl32o
Added a new look to the IVLE header bar. Mmmm... Web 2.0.
Added top-level directory image-source, containing SVG and script files for
    generating the images.
ivle/webapp/coremedia/images: Added 'chrome' directory containing the rendered
    images.
Modified ivle/webapp/base/ivle-headings.html and
    ivle/webapp/coremedia/ivle.css to support the new images.
    Note that the H1 and H2 at the top of the page are no longer displayed
    (and their custom styles have been removed). There is a heading image
    instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 * activate their account).
25
25
 */
26
26
 
 
27
/* The user must send this declaration message to ensure they acknowledge the
 
28
 * TOS.
 
29
 * (This is the exact same string as in userservice).
 
30
 */
 
31
USER_DECLARATION = {"declaration":
 
32
                        "I accept the IVLE Terms of Service"};
 
33
 
27
34
/** Creates a "dot dot dot" animation to indicate the client is waiting for a
28
35
 * response from the server.
29
36
 * This will keep animating forever.
56
63
     * We need to wait on this page for the server's response.
57
64
     */
58
65
    /* Start by clearing away these buttons. */
59
 
    tos_acceptbuttons = document.getElementById("tos_acceptbuttons");
 
66
    var tos_acceptbuttons = document.getElementById("tos_acceptbuttons");
60
67
    dom_removechildren(tos_acceptbuttons);
61
68
    /* Print a "please wait" message */
62
69
    tos_acceptbuttons.appendChild(dom_make_text_elem("p",
63
70
        "IVLE is now setting up your environment. Please wait..."));
64
71
    tos_acceptbuttons.appendChild(make_dots_anim());
 
72
    /* Make the Ajax request */
 
73
    ajax_call(handle_accept_response, "userservice", "activate_me",
 
74
        USER_DECLARATION, "POST")
 
75
}
 
76
 
 
77
function handle_accept_response(xhr)
 
78
{
 
79
    /* TEMP */
 
80
    var tos_acceptbuttons = document.getElementById("tos_acceptbuttons");
 
81
    dom_removechildren(tos_acceptbuttons);
 
82
 
 
83
    try
 
84
    {
 
85
        response = JSON.parse(xhr.responseText);
 
86
    }
 
87
    catch (e)
 
88
    {
 
89
        response = {'response': 'parse-failure'};
 
90
    }
 
91
 
 
92
    if (response.response == 'usrmgt-failure')
 
93
    {
 
94
    tos_acceptbuttons.appendChild(dom_make_text_elem("p",
 
95
        "Error connecting to User Management server. Please try again later.")); 
 
96
    }
 
97
    else if (response.response == 'parse-failure')
 
98
    {
 
99
    tos_acceptbuttons.appendChild(dom_make_text_elem("p",
 
100
        "Error connecting to server. Please try again later. "));
 
101
    }
 
102
    else
 
103
    {
 
104
        /* Refresh the page; as the user is now (apparently) logged in */
 
105
        window.location.href = parse_url(window.location.href).args["url"];
 
106
    }
65
107
}
66
108
 
67
109
function decline_license()
68
110
{
69
111
    /* Redirect to the logout page */
70
 
    window.location.href = app_path("logout");
 
112
    window.location.href = app_path("+logout");
71
113
}