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

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

adding vanilla+authentication+comments+userpics and updates to vanilla+authentication+comments

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 mtSaveUser(f) // Persists a copy of the current user cookie into the browser cookie stash.
29function mtClearUser() // Clears the blog-side user cookie.
30function mtSetCookie(name, value, expires, path, domain, secure) // Sets a browser cookie.
31function mtGetCookie(name) // Retrieves a browser cookie.
32function mtDeleteCookie(name, path, domain, secure) // Deletes a browser cookie.
33function mtBakeUserCookie(u) // Serializes a user object into a string, suitable for storing as a cookie.
34function mtUnbakeUserCookie(s) // Unserializes a user cookie and returns a user object with the restored state.
35
36/* Login Functions *****************************************************************/
37#_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 profile 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 mtSaveUser(f) // Persists a copy of the current user cookie into the browser cookie stash.
42function 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.
43function mtSignInOnClick(sign_in_element) // **Handles the action of the "Sign in" link.
44function mtSetUserOrLogin(u) // **Handles branching between users cookied in app vs not logged in
45function mtSignOut(entry_id) // Handles sign out from the web site. First clears any existing user cookie, then direts to the MT comment script to sign the user out.
46function mtSignOutOnClick() // Handles the action of the "Sign out" link.
47
48/* Commenting *****************************************************************/
49function 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.
50function mtEntryOnUnload() // **
51function mtShowGreeting() // Handles the display of the greeting message, depending on what kind of user is logged in and blog comment policy.
52function mtUserOnLoad() // Function to hide/show/prepopulate fields based upon type of user that has authenticated
53function mtRememberMeOnClick(b) // Called when the 'Remember me' checkbox is changed. If the checkbox is cleared, the cached user cookie is immediately cleared.
54function mtReplyCommentOnClick(parent_id, author) // Handles the action of the 'Reply' links.
55function mtSetCommentParentID() // Sets the parent comment ID when replying to a comment.
56function 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.
57function mtCommentSessionVerify(app_user) // **
58function mtCommentFormOnFocus() // Called when an input field on the comment form receives focus.
59function mtShowCaptcha() // Displays a captcha field for anonymous commenters.
60
61/* Initialize *****************************************************************/
62function mtInit() // Initialize
63
64/* Edit Entry *****************************************************************/
65function mtEditLink(entry_id, author_id) // Used to display an edit link for the given entry.
66
67/* Date Formatting *****************************************************************/
68function 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.
69
70/* END Movable Type Javascript *****************************************************************/
Note: See TracBrowser for help on using the browser.