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

« back to all changes in this revision

Viewing changes to www/media/common/tos.js

  • Committer: mattgiuca
  • Date: 2008-02-15 06:34:19 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:476
Added new module: common/caps.py. This is the Capabilities centre of IVLE.
    It provides a Role class which is a rich enumeration type for Roles.
    The Role class will replace what has previously been simple strings used
    for Roles within the program. It has comparison ability to see if a Role
    is greater than or equal to another.
    This module also provides a set of capability objects which roles can be
    checked against.
dispatch/login: Rather than setting 'rolenm' string in session, now sets
    'role', a Role object.
common/db: _escape allows Role objects, which get converted into strings.
    So the DB now accepts Role objects as values (though we don't make use of
    this currently).
www/apps/tos: svn:ignore

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
 
 
34
27
/** Creates a "dot dot dot" animation to indicate the client is waiting for a
35
28
 * response from the server.
36
29
 * This will keep animating forever.
63
56
     * We need to wait on this page for the server's response.
64
57
     */
65
58
    /* Start by clearing away these buttons. */
66
 
    var tos_acceptbuttons = document.getElementById("tos_acceptbuttons");
 
59
    tos_acceptbuttons = document.getElementById("tos_acceptbuttons");
67
60
    dom_removechildren(tos_acceptbuttons);
68
61
    /* Print a "please wait" message */
69
 
    /* XXX: The current implementation of Ajax is SYNCHRONOUS.
70
 
     * That means we return right away; the animation won't work properly.
71
 
     */
72
62
    tos_acceptbuttons.appendChild(dom_make_text_elem("p",
73
63
        "IVLE is now setting up your environment. Please wait..."));
74
64
    tos_acceptbuttons.appendChild(make_dots_anim());
75
 
    /* Make the Ajax request */
76
 
    var xhr = ajax_call("userservice", "activate_me", USER_DECLARATION,
77
 
        "POST")
78
 
    handle_accept_response(xhr)
79
 
}
80
 
 
81
 
function handle_accept_response(xhr)
82
 
{
83
 
    /* TEMP */
84
 
    var tos_acceptbuttons = document.getElementById("tos_acceptbuttons");
85
 
    dom_removechildren(tos_acceptbuttons);
86
 
    /* Refresh the page; as the user is now (apparently) logged in */
87
 
    window.location.reload()
88
65
}
89
66
 
90
67
function decline_license()