root/trunk/Vanilla/templates/vanilla+authentication/readme_javascript.txt @ 919

Revision 919, 5.8 kB (checked in by bsmith, 16 months ago)

various updates

Line 
1<$mt:var name="user-auth" value="signin-content"$>
2<mt:Ignore>
3    Set show_userpic to 1 to enable userpics in the signin line
4    - Requires Community Solution
5    - Note: This will update username to link to Community Solution "edit profile" script. This script assumes that you are using profiles and thus links to "view profile" screen. If the template set is not using profiles then the Community Solution "Profile Edit" Global System Template should be updated.
6</mt:Ignore>
7<$mt:var name="show_userpic" value="1"$>
8
9/* Blog Variables *****************************************************************/
10var is_preview;
11var user;
12
13/* Utility Functions *****************************************************************/
14    function mtHide(id) // Simple routine for showing a DOM element (applying a CSS display attribute of 'none').
15    function mtShow(id) // Simple routine for showing a DOM element (applying a CSS display attribute of 'block').
16function mtFireEvent(eventName,param) // Calls the event named, if there are handlers for it.
17function mtFixDate(date) // **
18function mtEscapeJS(s) // Simple function that escapes single quote characters for storing in a cookie.
19function mtUnescapeJS(s) // Simple function that unescapes single quote characters that were stored in a cookie.
20function mtAttachEvent(eventName,func) // A utility function for assigning/adding handlers to window events.
21function mtGetXmlHttp() // Returns a XMLHttpRequest object (for Ajax operations).
22
23/* Cookie *****************************************************************/
24var mtCookieName = "<$mt:UserSessionCookieName$>"; // The cookie name to use for storing the blog-side comment session cookie.
25var mtCookieDomain = "<$mt:UserSessionCookieDomain$>";
26var mtCookiePath = "<$mt:UserSessionCookiePath$>";
27var mtCookieTimeout = <$mt:UserSessionCookieTimeout$>;
28function mtSetCookie(name, value, expires, path, domain, secure) // Sets a browser cookie.
29function mtGetCookie(name) // Retrieves a browser cookie.
30function mtDeleteCookie(name, path, domain, secure) // Deletes a browser cookie.
31function mtBakeUserCookie(u) // Serializes a user object into a string, suitable for storing as a cookie.
32function mtUnbakeUserCookie(s) // Unserializes a user cookie and returns a user object with the restored state.
33
34/* Login Functions *****************************************************************/
35#_login/#_logout // If request contains a '#_login' or '#_logout' hash, use this to also delete the blog-side user cookie, since we're coming back from a login, logout or edit function mtSaveUser(f) // Persists a copy of the current user cookie into the browser cookie stash.
36function mtClearUser() // Clears the blog-side user cookie.
37profile operation.
38function mtFetchUser(cb) // Issues a request to the MT comment script to retrieve the currently logged-in user (if any).
39function mtUpdateSignInWidget(u) // A routine that displays various phrases based upon users authenticated status
40function mtGetUser() // Retrieves an object of the currently logged in user's state. If no user is logged in or cookied, this will return null.
41function mtSignIn() // Handles the action of the "Sign in" link. First clears any existing user cookie, then directs to the MT comment script to sign the user in.
42function mtSignInOnClick(sign_in_element) // **Handles the action of the "Sign in" link.
43function mtSetUserOrLogin(u) // **Handles branching between users cookied in app vs not logged in
44function mtSignOut(entry_id) // Handles sign out from the web site. First clears any existing user cookie, then directs to the MT comment script to sign the user out.
45function mtSignOutOnClick() // Handles the action of the "Sign out" link.
46
47    /* Commenting *****************************************************************/
48    function mtEntryOnLoad() // Called when an entry archive page is loaded. This routine controls which elements of the comment form are shown or hidden, depending on commenter type and blog configuration.
49    function mtEntryOnUnload() // **
50    function mtShowGreeting() // Handles the display of the greeting message, depending on what kind of user is logged in and blog comment policy.
51    function mtUserOnLoad() // Function to hide/show/prepopulate fields based upon type of user that has authenticated
52    function mtRememberMeOnClick(b) // Called when the 'Remember me' checkbox is changed. If the checkbox is cleared, the cached user cookie is immediately cleared.
53    function mtReplyCommentOnClick(parent_id, author) // Handles the action of the 'Reply' links.
54    function mtSetCommentParentID() // Sets the parent comment ID when replying to a comment.
55    function mtCommentOnSubmit(f) // Called when comment form is sent. Required parameter: Form DOM object of comment form. If form has a 'bakecookie' member, it will be used to signal storing the anonymous commenter information to a cookie. If form has a 'armor' member, it will be used to store a token that is checked by the comment script.
56    function mtCommentSessionVerify(app_user) // **
57    function mtCommentFormOnFocus() // Called when an input field on the comment form receives focus.
58    function mtShowCaptcha() // Displays a captcha field for anonymous commenters.
59
60/* Initialize *****************************************************************/
61function mtInit() // Initialize
62
63/* Edit Entry *****************************************************************/
64function mtEditLink(entry_id, author_id) // Used to display an edit link for the given entry.
65
66/* Date Formatting *****************************************************************/
67function mtRelativeDate(ts, fds) // Displays a relative date. 'ts' is a Date object, 'fds' is a string of the date which will be displayed if the given date is older than 1 week.
68
69/* END Movable Type Javascript *****************************************************************/
Note: See TracBrowser for help on using the browser.