Changeset 916

Show
Ignore:
Timestamp:
07/29/08 02:47:24 (16 months ago)
Author:
bsmith
Message:

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

Location:
trunk/Vanilla
Files:
7 added
3 removed
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/Vanilla/config.yaml

    r913 r916  
    1010template_sets: 
    1111    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 
    1518        templates: 
    1619            index: 
     
    2932                    label: Wrapper 
    3033    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 
    3442        templates: 
    3543            index: 
     
    6472                    label: Wrapper 
    6573    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 
    6981        templates: 
    7082            index: 
     
    89101                    label: Wrapper 
    90102    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 
    101115                javascript: 
    102116                    label: JavaScript 
     
    107121                    label: Wrapper 
    108122    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 
    112128        templates: 
    113129            index: 
     
    126142                        entry_archive: 
    127143                            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 
    130174            module: 
    131175                wrapper: 
     
    137181                    label: Comment Response 
    138182 
    139  
    140 # 2. Authentication 
    141 #     * TrackBacks 
    142 #     vanilla_trackbacks: 
    143 #         label: 'Vanilla - Homepage + Entries' 
    144 #         base_path: 'templates/vanilla' 
    145 #         order: 100 
    146 #         templates: 
    147183#  
    148  
    149 # 4. Organization 
     184# - Organization 
    150185#     * Categories 
    151186#     * 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 
    154210#     * 1 
    155211#     * 5 Star 
    156212#     * -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"> 
    64    <script type="text/javascript"> 
    75    /* <![CDATA[ */ 
     
    108    /* ]]> */ 
    119    </script> 
    12 </mt:SetVarBlock> 
    13 <$mt:Include module="<__trans phrase="Header">" body_class="mt-comment-preview"$> 
     10    </mt:SetVarBlock> 
    1411 
    15 <h1 id="page-title"><$mt:Var name="page_title"$></h1> 
     12    <h1><__trans phrase="Previewing your Comment"></h1> 
    1613 
    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> 
    1832 
    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()" /> 
    2049 
    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"> 
    132 
    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> 
    1513 
    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> 
    1915 
    20 <$mt:Include module="<__trans phrase="Footer">"$> 
    21 </__trans_section> 
     16</mt:IncludeBlock> 
  • trunk/Vanilla/templates/vanilla+authentication+comments/entry.mtml

    r891 r916  
    2020        <ol class="comments-content"> 
    2121            </mt:CommentsHeader> 
    22             <li> 
     22            <li id="comment-<$mt:CommentID$>"> 
    2323                <div class="comment-header"> 
    2424                    <$mt:CommentAuthorIdentity$> 
     
    5858                    <div id="comments-open-data"> 
    5959                        <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()" /> 
    6161 
    6262                        <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()" /> 
    6464 
    6565                        <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()" /> 
    6767 
    6868                        <input type="checkbox" id="comment-bake-cookie" name="bakecookie" onclick="mtRememberMeOnClick(this)" value="1" accesskey="r" /> 
    6969                        <label for="comment-bake-cookie"><__trans phrase="Remember personal info?"></label> 
    7070                    </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> 
    7474                    </div> 
    7575                    <div id="comments-open-text"> 
    7676                        <label for="comment-text"><__trans phrase="Comments"> 
    7777                        <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> 
    7979                    </div> 
    8080                    <div id="comments-open-captcha"></div> 
  • trunk/Vanilla/templates/vanilla+authentication+comments/javascript.mtml

    r891 r916  
    11<$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"$> 
    28 
    39/* section *****************************************************************/ 
     
    1016var is_preview; 
    1117var user; 
     18 
     19/* Login Functions *****************************************************************/ 
    1220 
    1321<mt:Ignore> 
     
    6573    } 
    6674    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> 
    6779        var url; 
    6880        if (u.is_authenticated) { 
    6981            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> 
    7086                url = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile&blog_id=<$mt:BlogID$>'; 
    7187                url += '&static=' + encodeURIComponent( location.href ); 
     88</mt:If> 
    7289            } else { 
    7390                url = u.url; 
     
    7895            url = null; 
    7996        } 
    80         var content = '<__trans phrase="You are signed in as " escape="js">'; 
     97        content += '<__trans phrase="You are signed in as " escape="js">'; 
    8198        if (url) 
    8299            content += '<a href="' + url + '">' + u.name + '</a>'; 
     
    94111    } 
    95112} 
     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 */ 
     121var clearCookie = ( window.location.hash && window.location.hash.match( /^#_log(in|out)/ ) ) ? true : false; 
     122if (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> 
    96141 
    97142<mt:Ignore> 
     
    894939// END: fast browser onload init 
    895940 
    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  
    66    <meta http-equiv="Content-Type" content="text/html; charset=<$mt:PublishCharset$>" /> 
    77    <meta name="generator" content="<$mt:ProductName version="1"$>" /> 
     8    <$mt:Var name="html_head"$> 
    89    <script type="text/javascript" src="<$mt:Link template="JavaScript"$>"></script> 
    910</head> 
  • trunk/Vanilla/templates/vanilla+authentication+userpics/readme_javascript.txt

    r891 r916  
    11<$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 *****************************************************************/ 
     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. 
    425var mtCookieDomain = "<$mt:UserSessionCookieDomain$>"; 
    526var mtCookiePath = "<$mt:UserSessionCookiePath$>"; 
    627var 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 status 
    13 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  
    2428function mtSaveUser(f) // Persists a copy of the current user cookie into the browser cookie stash. 
    2529function mtClearUser() // Clears the blog-side user cookie. 
     
    3034function mtUnbakeUserCookie(s) // Unserializes a user cookie and returns a user object with the restored state. 
    3135 
    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. 
     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. 
    3347 
    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 *****************************************************************/ 
     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 *****************************************************************/