Changeset 916
- Timestamp:
- 07/29/08 02:47:24 (16 months ago)
- Location:
- trunk/Vanilla
- Files:
-
- 7 added
- 3 removed
- 7 modified
-
config.yaml (modified) (7 diffs)
-
templates/vanilla+authentication+comments+userpics (added)
-
templates/vanilla+authentication+comments+userpics/comment_preview.mtml (added)
-
templates/vanilla+authentication+comments+userpics/comment_response.mtml (added)
-
templates/vanilla+authentication+comments+userpics/entry.mtml (added)
-
templates/vanilla+authentication+comments+userpics/home.mtml (added)
-
templates/vanilla+authentication+comments+userpics/javascript.mtml (added)
-
templates/vanilla+authentication+comments+userpics/wrapper.mtml (added)
-
templates/vanilla+authentication+comments/comment_detail.mtml (deleted)
-
templates/vanilla+authentication+comments/comment_form.mtml (deleted)
-
templates/vanilla+authentication+comments/comment_preview.mtml (modified) (2 diffs)
-
templates/vanilla+authentication+comments/comment_response.mtml (modified) (1 diff)
-
templates/vanilla+authentication+comments/comments.mtml (deleted)
-
templates/vanilla+authentication+comments/entry.mtml (modified) (2 diffs)
-
templates/vanilla+authentication+comments/javascript.mtml (modified) (6 diffs)
-
templates/vanilla+authentication+comments/wrapper.mtml (modified) (1 diff)
-
templates/vanilla+authentication+userpics/readme_javascript.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Vanilla/config.yaml
r913 r916 10 10 template_sets: 11 11 vanilla: 12 label: 'Vanilla (Homepage & Entries)' 13 base_path: 'templates/vanilla' 14 order: 500 12 label: Vanilla 13 base_path: templates/vanilla 14 order: 501 15 notes: 16 - Lastn entries on Homepage 17 - Entry Detail for each 15 18 templates: 16 19 index: … … 29 32 label: Wrapper 30 33 vanilla_archives: 31 label: 'Vanilla + Archives' 32 base_path: 'templates/vanilla+archives' 33 order: 501 34 label: Vanilla + Archives 35 base_path: templates/vanilla+archives 36 notes: 37 - Base homepage & entries 38 - Archive Index 39 - Archives: Monthly, Author, Category and Category-Monthly 40 - Navigation w/ Category-Monthly links on Category Archives 41 order: 502 34 42 templates: 35 43 index: … … 64 72 label: Wrapper 65 73 vanilla_pages: 66 label: 'Vanilla + Pages & Folders' 67 base_path: 'templates/vanilla+pages' 68 order: 502 74 label: Vanilla + Pages 75 base_path: templates/vanilla+pages 76 notes: 77 - Base homepage & entries 78 - Pages 79 - Navigation including Pages 80 order: 503 69 81 templates: 70 82 index: … … 89 101 label: Wrapper 90 102 vanilla_authentication_userpics: 91 label: 'Vanilla + Authentication & Userpics' 92 base_path: 'templates/vanilla+authentication+userpics' 93 order: 503 94 templates: 95 index: 96 home: 97 label: Homepage 98 outfile: index.html 99 rebuild_me: 1 100 # * Userpics 103 label: Vanilla + Authentication & Userpics 104 base_path: templates/vanilla+authentication+userpics 105 notes: 106 - En/disable userpics in javascript 107 - Use of community "edit profile" script is necessary to add userpics. The "edit profile" page assumes that you are using profiles and thus links to "view profile" screen. If using profiles is not desired, the "view profile" link can be removed from the "Profile Edit" Global System Template. 108 order: 504 109 templates: 110 index: 111 home: 112 label: Homepage 113 outfile: index.html 114 rebuild_me: 1 101 115 javascript: 102 116 label: JavaScript … … 107 121 label: Wrapper 108 122 vanilla_authentication_comments: 109 label: 'Vanilla + Authentication & Comments' 110 base_path: 'templates/vanilla+authentication+comments' 111 order: 504 123 label: Vanilla + Authentication & Comments 124 base_path: templates/vanilla+authentication+comments 125 notes: 126 - foo 127 order: 505 112 128 templates: 113 129 index: … … 126 142 entry_archive: 127 143 archive_type: Individual 128 # * Comments (with Reply links) 129 # * Userpics 144 module: 145 wrapper: 146 label: Wrapper 147 system: 148 comment_preview: 149 label: Comment Preview 150 comment_response: 151 label: Comment Response 152 vanilla_authentication_comments_userpics: 153 label: Vanilla + Authentication & Comments w/ Userpics 154 base_path: templates/vanilla+authentication+comments+userpics 155 notes: 156 - foo 157 order: 506 158 templates: 159 index: 160 home: 161 label: Homepage 162 outfile: index.html 163 rebuild_me: 1 164 javascript: 165 label: JavaScript 166 outfile: mt.js 167 rebuild_me: 1 168 individual: 169 entry: 170 label: Entry 171 mappings: 172 entry_archive: 173 archive_type: Individual 130 174 module: 131 175 wrapper: … … 137 181 label: Comment Response 138 182 139 140 # 2. Authentication141 # * TrackBacks142 # vanilla_trackbacks:143 # label: 'Vanilla - Homepage + Entries'144 # base_path: 'templates/vanilla'145 # order: 100146 # templates:147 183 # 148 149 # 4. Organization 184 # - Organization 150 185 # * Categories 151 186 # * Tags 152 153 # 6. Rating 187 # - Create Entry 188 # * category selector 189 # vanilla: 190 # label: 'Vanilla - Homepage + Entries' 191 # base_path: 'templates/vanilla' 192 # order: 100 193 # templates: 194 # - Profiles + Userpics 195 # * Userpics 196 # * Profiles 197 # vanilla: 198 # label: 'Vanilla - Homepage + Entries' 199 # base_path: 'templates/vanilla' 200 # order: 100 201 # templates: 202 # - Profiles + Friending 203 # * Friending 204 # vanilla: 205 # label: 'Vanilla - Homepage + Entries' 206 # base_path: 'templates/vanilla' 207 # order: 100 208 # templates: 209 # - Rating 154 210 # * 1 155 211 # * 5 Star 156 212 # * -1, 0, 1 157 158 # 7. Create Entry 159 # * category selector 160 161 # 8. Profiles 162 # * Friending 163 164 # 9. YUI Template 165 166 # 3. Rating 167 # * 1 168 # * 5 Star 169 # * -1, 0, 1 170 # vanilla: 171 # label: 'Vanilla - Homepage + Entries' 172 # base_path: 'templates/vanilla' 173 # order: 100 174 # templates: 175 # 176 # 4. Create Entry 177 # * category selector 178 # vanilla: 179 # label: 'Vanilla - Homepage + Entries' 180 # base_path: 'templates/vanilla' 181 # order: 100 182 # templates: 183 # 184 # 5. Profiles 185 # *Friending 186 # vanilla: 187 # label: 'Vanilla - Homepage + Entries' 188 # base_path: 'templates/vanilla' 189 # order: 100 190 # templates: 213 # vanilla: 214 # label: 'Vanilla - Homepage + Entries' 215 # base_path: 'templates/vanilla' 216 # order: 100 217 # templates: 218 # - YUI Template -
trunk/Vanilla/templates/vanilla+authentication+comments/comment_preview.mtml
r891 r916 1 <__trans_section component="commercial"> 2 <$mt:Var name="page_layout" value="layout-wm"$> 3 <mt:SetVarBlock name="page_title"><__trans phrase="Previewing your Comment"></mt:SetVarBlock> 4 <mt:SetVarBlock name="title"><$mt:BlogName encode_html="1"$>: <$mt:Var name="page_title"$></mt:SetVarBlock> 5 <mt:SetVarBlock name="html_head"> 1 <mt:IncludeBlock module="wrapper"> 2 3 <mt:SetVarBlock name="html_head"> 6 4 <script type="text/javascript"> 7 5 /* <![CDATA[ */ … … 10 8 /* ]]> */ 11 9 </script> 12 </mt:SetVarBlock> 13 <$mt:Include module="<__trans phrase="Header">" body_class="mt-comment-preview"$> 10 </mt:SetVarBlock> 14 11 15 <h1 id="page-title"><$mt:Var name="page_title"$></h1>12 <h1><__trans phrase="Previewing your Comment"></h1> 16 13 17 <$mt:Include module="<__trans phrase="Comment Detail">"$> 14 <div id="comments"> 15 16 <ol class="comments-content"> 17 <li> 18 <div class="comment-header"> 19 <$mt:CommentAuthorIdentity$> 20 <mt:IfCommentParent> 21 <__trans phrase="[_1] replied to [_2]<a href="[_3]">comment from [_4]</a>[_5]" params="<$mt:CommentAuthorLink$>%%<mt:CommentParent>%%<$mt:CommentLink$>%%<$mt:CommentAuthor$>%%</mt:CommentParent>"> 22 <mt:Else> 23 <$mt:CommentAuthorLink$> 24 </mt:IfCommentParent> 25 | <a href="<$mt:CommentLink$>"><abbr class="published" title="<$mt:CommentDate format_name="iso8601"$>"><$mt:CommentDate$></abbr></a> 26 </div> 27 <div class="comment-body"> 28 <$mt:CommentBody$> 29 </div> 30 </li> 31 </ol> 18 32 19 <$mt:Include module="<__trans phrase="Comments">"$> 33 <mt:IfCommentsAccepted> 34 <div id="comments-open"> 35 <h2 class="comments-open-header"><__trans phrase="Leave a comment"></h2> 36 <div class="comments-open-content"> 37 <div id="comment-greeting"></div> 38 <form method="post" action="<$mt:CGIPath$><$mt:CommentScript$>" name="comments_form" id="comments-form" onsubmit="return mtCommentOnSubmit(this)"> 39 <input type="hidden" name="static" value="1" /> 40 <input type="hidden" name="entry_id" value="<$mt:EntryID$>" /> 41 <input type="hidden" name="__lang" value="<$mt:BlogLanguage$>" /> 42 <input type="hidden" name="parent_id" value="<$mt:CommentParentID$>" id="comment-parent-id" /> 43 <input type="hidden" name="armor" value="1" /> 44 <input type="hidden" name="preview" value="" /> 45 <input type="hidden" name="sid" value="" /> 46 <div id="comments-open-data"> 47 <label for="comment-author"><__trans phrase="Name"></label> 48 <input id="comment-author" name="author" size="30" value="<mt:If name="comment_preview"><$mt:CommentAuthor encode_html="1"$></mt:If>" onfocus="mtCommentFormOnFocus()" /> 20 49 21 <$mt:Include module="<__trans phrase="Footer">"$> 22 </__trans_section> 50 <label for="comment-email"><__trans phrase="Email Address"></label> 51 <input id="comment-email" name="email" size="30" value="<mt:If name="comment_preview"><$mt:CommentEmail encode_html="1"$></mt:If>" onfocus="mtCommentFormOnFocus()" /> 52 53 <label for="comment-url"><__trans phrase="URL"></label> 54 <input id="comment-url" name="url" size="30" value="<mt:If name="comment_preview"><$mt:CommentURL encode_html="1"$></mt:If>" onfocus="mtCommentFormOnFocus()" /> 55 </div> 56 <div id="comment-form-reply"<mt:IfCommentParent><mt:Else> style="display:none"</mt:IfCommentParent>> 57 <input type="checkbox" id="comment-reply" name="comment_reply" value="<$mt:CommentParentID$>"<mt:IfCommentParent> checked="checked"</mt:IfCommentParent> onclick="mtSetCommentParentID()" /> 58 <label for="comment-reply" id="comment-reply-label"><mt:IfCommentParent><__trans phrase="Replying to comment from [_1]" params="<mt:CommentParent><$mt:CommentAuthor$></mt:CommentParent>"></mt:IfCommentParent></label> 59 </div> 60 <div id="comments-open-text"> 61 <label for="comment-text"><__trans phrase="Comments"> 62 <mt:IfAllowCommentHTML><__trans phrase="(You may use HTML tags for style)"></mt:IfAllowCommentHTML></label> 63 <textarea id="comment-text" name="text" rows="15" cols="50" onfocus="mtCommentFormOnFocus()"><$mt:CommentBody autolink="0" sanitize="0" convert_breaks="0" encode_html="1"$></textarea> 64 </div> 65 <div id="comments-open-captcha"></div> 66 <div id="comments-open-footer"> 67 <input type="submit" accesskey="v" name="preview_button" id="comment-preview" value="<__trans phrase="Preview">" onclick="this.form.preview.value='1';" /> 68 <input type="submit" accesskey="s" name="post" id="comment-submit" value="<__trans phrase="Submit">" /> 69 <input type="button" name="cancel" id="comment-cancel" value="<__trans phrase="Cancel">" onclick="window.location='<$mt:EntryPermalink$>'" /> 70 </div> 71 </form> 72 </div> 73 </div> 74 <script type="text/javascript"> 75 <!-- 76 mtAttachEvent("load", mtEntryOnLoad); 77 mtAttachEvent("unload", mtEntryOnUnload); 78 //--> 79 </script> 80 </mt:IfCommentsAccepted> 81 82 <mt:Comments> 83 <mt:CommentsHeader> 84 <h2 class="comments-header"><__trans phrase="Comments"></h2> 85 <ol class="comments-content"> 86 </mt:CommentsHeader> 87 <li id="comment-<$mt:CommentID$>"> 88 <div class="comment-header"> 89 <$mt:CommentAuthorIdentity$> 90 <mt:IfCommentParent> 91 <__trans phrase="[_1] replied to [_2]<a href="[_3]">comment from [_4]</a>[_5]" params="<$mt:CommentAuthorLink$>%%<mt:CommentParent>%%<$mt:CommentLink$>%%<$mt:CommentAuthor$>%%</mt:CommentParent>"> 92 <mt:Else> 93 <$mt:CommentAuthorLink$> 94 </mt:IfCommentParent> 95 | <a href="<$mt:CommentLink$>"><abbr class="published" title="<$mt:CommentDate format_name="iso8601"$>"><$mt:CommentDate$></abbr></a> 96 <mt:IfCommentsAccepted> 97 | <$mt:CommentReplyToLink$> 98 </mt:IfCommentsAccepted> 99 </div> 100 <div class="comment-body"> 101 <$mt:CommentBody$> 102 </div> 103 </li> 104 <mt:CommentsFooter> 105 </ol> 106 </mt:CommentsFooter> 107 </mt:Comments> 108 109 </div> 110 111 </mt:IncludeBlock> -
trunk/Vanilla/templates/vanilla+authentication+comments/comment_response.mtml
r891 r916 1 <__trans_section component="commercial"> 2 <mt:If name="comment_confirmation"> 3 <$mt:Var name="page_title" value="<__trans phrase="Confirmation...">"$> 4 <$mt:Var name="message" value="<p><__trans phrase="Your comment has been submitted!"></p>"$> 5 <mt:Else name="comment_pending"> 6 <$mt:Var name="page_title" value="<__trans phrase="Thank you for commenting.">"$> 7 <$mt:Var name="message" value="<p><__trans phrase="Your comment has been received and held for approval by the blog owner."></p>"$> 8 <mt:Else name="comment_error"> 9 <$mt:Var name="page_title" value="<__trans phrase="Comment Submission Error">"$> 10 <mt:SetVarBlock name="message"><p><__trans phrase="Your comment submission failed for the following reasons: [_1]" params="<$mt:ErrorMessage$>"></p></mt:SetVarBlock> 11 </mt:If> 12 <mt:SetVarBlock name="title"><$mt:BlogName encode_html="1"$>: <$mt:Var name="page_title"$></mt:SetVarBlock> 1 <mt:IncludeBlock module="wrapper"> 13 2 14 <$mt:Include module="<__trans phrase="Header">"$> 3 <mt:If name="comment_confirmation"> 4 <h1><__trans phrase="Confirmation..."></h1> 5 <p><__trans phrase="Your comment has been submitted!"></p> 6 <mt:Else name="comment_pending"> 7 <h1><__trans phrase="Thank you for commenting."></h1> 8 <p><__trans phrase="Your comment has been received and held for approval by the blog owner."></p> 9 <mt:Else name="comment_error"> 10 <h1><__trans phrase="Comment Submission Error">"</h1> 11 <p><__trans phrase="Your comment submission failed for the following reasons: [_1]" params="<$mt:ErrorMessage$>"></p> 12 </mt:If> 15 13 16 <h1 id="page-title"><$mt:Var name="page_title"$></h1> 17 <$mt:Var name="message"$> 18 <p><__trans phrase="Return to the <a href="[_1]">original entry</a>." params="<mt:If name="comment_error">javascript:history.back()<mt:Else><$mt:EntryLink$></mt:If>"></p> 14 <p><__trans phrase="Return to the <a href="[_1]">original entry</a>." params="<mt:If name="comment_error">javascript:history.back()<mt:Else><$mt:EntryLink$></mt:If>"></p> 19 15 20 <$mt:Include module="<__trans phrase="Footer">"$> 21 </__trans_section> 16 </mt:IncludeBlock> -
trunk/Vanilla/templates/vanilla+authentication+comments/entry.mtml
r891 r916 20 20 <ol class="comments-content"> 21 21 </mt:CommentsHeader> 22 <li >22 <li id="comment-<$mt:CommentID$>"> 23 23 <div class="comment-header"> 24 24 <$mt:CommentAuthorIdentity$> … … 58 58 <div id="comments-open-data"> 59 59 <label for="comment-author"><__trans phrase="Name"></label> 60 <input id="comment-author" name="author" size="30" value=" <mt:If name="comment_preview"><$mt:CommentAuthor encode_html="1"$></mt:If>" onfocus="mtCommentFormOnFocus()" />60 <input id="comment-author" name="author" size="30" value="" onfocus="mtCommentFormOnFocus()" /> 61 61 62 62 <label for="comment-email"><__trans phrase="Email Address"></label> 63 <input id="comment-email" name="email" size="30" value=" <mt:If name="comment_preview"><$mt:CommentEmail encode_html="1"$></mt:If>" onfocus="mtCommentFormOnFocus()" />63 <input id="comment-email" name="email" size="30" value="" onfocus="mtCommentFormOnFocus()" /> 64 64 65 65 <label for="comment-url"><__trans phrase="URL"></label> 66 <input id="comment-url" name="url" size="30" value=" <mt:If name="comment_preview"><$mt:CommentURL encode_html="1"$></mt:If>" onfocus="mtCommentFormOnFocus()" />66 <input id="comment-url" name="url" size="30" value="" onfocus="mtCommentFormOnFocus()" /> 67 67 68 68 <input type="checkbox" id="comment-bake-cookie" name="bakecookie" onclick="mtRememberMeOnClick(this)" value="1" accesskey="r" /> 69 69 <label for="comment-bake-cookie"><__trans phrase="Remember personal info?"></label> 70 70 </div> 71 <div id="comment-form-reply" <mt:IfCommentParent><mt:Else> style="display:none"</mt:IfCommentParent>>72 <input type="checkbox" id="comment-reply" name="comment_reply" value="<$mt:CommentParentID$>" <mt:IfCommentParent> checked="checked"</mt:IfCommentParent>onclick="mtSetCommentParentID()" />73 <label for="comment-reply" id="comment-reply-label">< mt:IfCommentParent><__trans phrase="Replying to comment from [_1]" params="<mt:CommentParent><$mt:CommentAuthor$></mt:CommentParent>"></mt:IfCommentParent></label>71 <div id="comment-form-reply" style="display:none"> 72 <input type="checkbox" id="comment-reply" name="comment_reply" value="<$mt:CommentParentID$>" onclick="mtSetCommentParentID()" /> 73 <label for="comment-reply" id="comment-reply-label"></label> 74 74 </div> 75 75 <div id="comments-open-text"> 76 76 <label for="comment-text"><__trans phrase="Comments"> 77 77 <mt:IfAllowCommentHTML><__trans phrase="(You may use HTML tags for style)"></mt:IfAllowCommentHTML></label> 78 <textarea id="comment-text" name="text" rows="15" cols="50" onfocus="mtCommentFormOnFocus()">< mt:If name="comment_preview"><$mt:CommentBody autolink="0" sanitize="0" convert_breaks="0" encode_html="1"$></mt:If></textarea>78 <textarea id="comment-text" name="text" rows="15" cols="50" onfocus="mtCommentFormOnFocus()"></textarea> 79 79 </div> 80 80 <div id="comments-open-captcha"></div> -
trunk/Vanilla/templates/vanilla+authentication+comments/javascript.mtml
r891 r916 1 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="0"$> 2 8 3 9 /* section *****************************************************************/ … … 10 16 var is_preview; 11 17 var user; 18 19 /* Login Functions *****************************************************************/ 12 20 13 21 <mt:Ignore> … … 65 73 } 66 74 if (u && u.name) { 75 <mt:If name="show_userpic"> 76 if (u.userpic) 77 content += '<img src="' + u.userpic + '" width="50" height="50" />'; 78 </mt:If> 67 79 var url; 68 80 if (u.is_authenticated) { 69 81 if (u.is_author) { 82 <mt:If name="show_userpic"> 83 url = '<$mt:CGIPath$><$mt:CommunityScript$>?__mode=edit&blog_id=<$mt:BlogID$>'; 84 url += '&return_to=' + encodeURIComponent(document.URL); 85 <mt:Else> 70 86 url = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile&blog_id=<$mt:BlogID$>'; 71 87 url += '&static=' + encodeURIComponent( location.href ); 88 </mt:If> 72 89 } else { 73 90 url = u.url; … … 78 95 url = null; 79 96 } 80 var content= '<__trans phrase="You are signed in as " escape="js">';97 content += '<__trans phrase="You are signed in as " escape="js">'; 81 98 if (url) 82 99 content += '<a href="' + url + '">' + u.name + '</a>'; … … 94 111 } 95 112 } 113 114 <mt:IfBlog> 115 <mt:IfRegistrationAllowed> 116 /*** 117 * If request contains a '#_login' or '#_logout' hash, use this to 118 * also delete the blog-side user cookie, since we're coming back from 119 * a login, logout or edit profile operation. 120 */ 121 var clearCookie = ( window.location.hash && window.location.hash.match( /^#_log(in|out)/ ) ) ? true : false; 122 if (clearCookie) { 123 // clear any logged in state 124 mtClearUser(); 125 if (RegExp.$1 == 'in') 126 mtFetchUser(); 127 } else { 128 <mt:Ignore> 129 /*** 130 * Uncondition this call to fetch the current user state (if available) 131 * from MT upon page load if no user cookie is already present. 132 * This is okay if you have a private install, such as an Intranet; 133 * not recommended for public web sites! 134 */ 135 </mt:Ignore> 136 if ( is_preview && !user ) 137 mtFetchUser(); 138 } 139 </mt:IfRegistrationAllowed> 140 </mt:IfBlog> 96 141 97 142 <mt:Ignore> … … 894 939 // END: fast browser onload init 895 940 896 <mt:IfBlog> 897 <mt:IfRegistrationAllowed> 898 /*** 899 * If request contains a '#_login' or '#_logout' hash, use this to 900 * also delete the blog-side user cookie, since we're coming back from 901 * a login, logout or edit profile operation. 902 */ 903 var clearCookie = ( window.location.hash && window.location.hash.match( /^#_log(in|out)/ ) ) ? true : false; 904 if (clearCookie) { 905 // clear any logged in state 906 mtClearUser(); 907 if (RegExp.$1 == 'in') 908 mtFetchUser(); 909 } else { 910 <mt:Ignore> 911 /*** 912 * Uncondition this call to fetch the current user state (if available) 913 * from MT upon page load if no user cookie is already present. 914 * This is okay if you have a private install, such as an Intranet; 915 * not recommended for public web sites! 916 */ 917 </mt:Ignore> 918 if ( is_preview && !user ) 919 mtFetchUser(); 920 } 921 </mt:IfRegistrationAllowed> 922 </mt:IfBlog> 923 924 925 /* Section *****************************************************************/ 941 /* END Movable Type Javascript *****************************************************************/ -
trunk/Vanilla/templates/vanilla+authentication+comments/wrapper.mtml
r891 r916 6 6 <meta http-equiv="Content-Type" content="text/html; charset=<$mt:PublishCharset$>" /> 7 7 <meta name="generator" content="<$mt:ProductName version="1"$>" /> 8 <$mt:Var name="html_head"$> 8 9 <script type="text/javascript" src="<$mt:Link template="JavaScript"$>"></script> 9 10 </head> -
trunk/Vanilla/templates/vanilla+authentication+userpics/readme_javascript.txt
r891 r916 1 1 <$mt:var name="user-auth" value="signin-content"$> 2 // The cookie name to use for storing the blog-side comment session cookie. 3 var mtCookieName = "<$mt:UserSessionCookieName$>"; 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 *****************************************************************/ 10 var is_preview; 11 var 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'). 16 function mtFireEvent(eventName,param) // Calls the event named, if there are handlers for it. 17 function mtFixDate(date) // ** 18 function mtEscapeJS(s) // Simple function that escapes single quote characters for storing in a cookie. 19 function mtUnescapeJS(s) // Simple function that unescapes single quote characters that were stored in a cookie. 20 function mtAttachEvent(eventName,func) // A utility function for assigning/adding handlers to window events. 21 function mtGetXmlHttp() // Returns a XMLHttpRequest object (for Ajax operations). 22 23 /* Cookie *****************************************************************/ 24 var mtCookieName = "<$mt:UserSessionCookieName$>"; // The cookie name to use for storing the blog-side comment session cookie. 4 25 var mtCookieDomain = "<$mt:UserSessionCookieDomain$>"; 5 26 var mtCookiePath = "<$mt:UserSessionCookiePath$>"; 6 27 var mtCookieTimeout = <$mt:UserSessionCookieTimeout$>; 7 var is_preview;8 var user;9 10 var mtFetchedUser = false;11 function mtFetchUser(cb) // Issues a request to the MT comment script to retrieve the currently logged-in user (if any).12 function mtUpdateSignInWidget(u) // A routine that displays various phrases based upon users authenticated status13 function mtGetUser() // Retrieves an object of the currently logged in user's state. If no user is logged in or cookied, this will return null.14 function mtSetUser(u) // Assigns a user object as the actively logged in user; also saves the user information in a browser cookie.15 function mtSaveUser(f) // Persists a copy of the current user cookie into the browser cookie stash.16 function 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.17 function mtSignInOnClick(sign_in_element) //18 function mtSetUserOrLogin(u) //19 function 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.20 function mtSignOutOnClick() // Handles the action of the "Sign out" link.21 22 /* Cookie *****************************************************************/23 24 28 function mtSaveUser(f) // Persists a copy of the current user cookie into the browser cookie stash. 25 29 function mtClearUser() // Clears the blog-side user cookie. … … 30 34 function mtUnbakeUserCookie(s) // Unserializes a user cookie and returns a user object with the restored state. 31 35 32 /* Utility Functions *****************************************************************/ 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. 38 function mtFetchUser(cb) // Issues a request to the MT comment script to retrieve the currently logged-in user (if any). 39 function mtUpdateSignInWidget(u) // A routine that displays various phrases based upon users authenticated status 40 function mtGetUser() // Retrieves an object of the currently logged in user's state. If no user is logged in or cookied, this will return null. 41 function mtSaveUser(f) // Persists a copy of the current user cookie into the browser cookie stash. 42 function 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. 43 function mtSignInOnClick(sign_in_element) // **Handles the action of the "Sign in" link. 44 function mtSetUserOrLogin(u) // **Handles branching between users cookied in app vs not logged in 45 function 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. 46 function mtSignOutOnClick() // Handles the action of the "Sign out" link. 33 47 34 function mtFireEvent(eventName,param) // Calls the event named, if there are handlers for it. 35 function mtFixDate(date) // 36 function mtEscapeJS(s) // Simple function that escapes single quote characters for storing in a cookie. 37 function mtUnescapeJS(s) // Simple function that unescapes single quote characters that were stored in a cookie. 38 function mtAttachEvent(eventName,func) // A utility function for assigning/adding handlers to window events. 48 /* Commenting *****************************************************************/ 49 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. 50 function mtEntryOnUnload() // ** 51 function mtShowGreeting() // Handles the display of the greeting message, depending on what kind of user is logged in and blog comment policy. 52 function mtUserOnLoad() // Function to hide/show/prepopulate fields based upon type of user that has authenticated 53 function mtRememberMeOnClick(b) // Called when the 'Remember me' checkbox is changed. If the checkbox is cleared, the cached user cookie is immediately cleared. 54 function mtReplyCommentOnClick(parent_id, author) // Handles the action of the 'Reply' links. 55 function mtSetCommentParentID() // Sets the parent comment ID when replying to a comment. 56 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. 57 function mtCommentSessionVerify(app_user) // ** 58 function mtCommentFormOnFocus() // Called when an input field on the comment form receives focus. 59 function mtShowCaptcha() // Displays a captcha field for anonymous commenters. 60 61 /* Initialize *****************************************************************/ 62 function mtInit() // Initialize 63 64 /* Edit Entry *****************************************************************/ 65 function mtEditLink(entry_id, author_id) // Used to display an edit link for the given entry. 66 67 /* Date Formatting *****************************************************************/ 68 function 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 *****************************************************************/
