Changeset 1351
- Timestamp:
- 02/04/08 23:07:47 (22 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/release-29/default_templates/javascript.mtml
r1118 r1351 2 2 function hideDocumentElement(id) { 3 3 var el = document.getElementById(id); 4 if (el) el.style.display = 'none'; 4 if (el) 5 el.style.display = 'none'; 5 6 } 6 7 7 8 function showDocumentElement(id) { 8 9 var el = document.getElementById(id); 9 if (el) el.style.display = 'block'; 10 } 11 10 if (el) 11 el.style.display = 'block'; 12 } 13 14 var captcha_timer; 12 15 function showAnonymousForm() { 13 16 showDocumentElement('comments-form'); … … 17 20 } 18 21 <MTIfNonEmpty tag="MTCaptchaFields"> 19 var captcha_timer;20 22 function delayShowCaptcha() { 21 23 clearInterval(captcha_timer); 22 24 var div = document.getElementById('comments-open-captcha'); 23 if (div) {25 if (div) 24 26 div.innerHTML = '<$MTCaptchaFields$>'; 25 }26 27 } 27 28 </MTIfNonEmpty> … … 76 77 </MTIfRegistrationAllowed> 77 78 78 if (document.comments_form) { 79 if (!commenter_name && (document.comments_form.email != undefined) && 79 var cf = document.comments_form; 80 if (cf) { 81 if (!commenter_name && (cf.email != undefined) && 80 82 (mtcmtmail = getCookie("mtcmtmail"))) 81 document.comments_form.email.value = mtcmtmail;82 if (!commenter_name && ( document.comments_form.author != undefined) &&83 cf.email.value = mtcmtmail; 84 if (!commenter_name && (cf.author != undefined) && 83 85 (mtcmtauth = getCookie("mtcmtauth"))) 84 document.comments_form.author.value = mtcmtauth;85 if ( document.comments_form.url != undefined &&86 cf.author.value = mtcmtauth; 87 if (cf.url != undefined && 86 88 (mtcmthome = getCookie("mtcmthome"))) 87 document.comments_form.url.value = mtcmthome;88 if ( document.comments_form["bakecookie"]) {89 cf.url.value = mtcmthome; 90 if (cf["bakecookie"]) { 89 91 if (mtcmtauth || mtcmthome) { 90 document.comments_form.bakecookie.checked = true;92 cf.bakecookie.checked = true; 91 93 } else { 92 document.comments_form.bakecookie.checked = false;94 cf.bakecookie.checked = false; 93 95 } 94 96 } … … 136 138 137 139 <MTIfRegistrationAllowed> 138 if ('<$MTCGIHost exclude_port="1"$>' != '<$MTBlogHost exclude_port="1"$>') { 139 document.write('<script src="<$MTCGIPath$><$MTCommentScript$>?__mode=cmtr_name_js&blog_id=<$MTBlogID$>"></script>'); 140 } else { 141 commenter_name = getCookie('commenter_name'); 142 ids = getCookie('commenter_id').split(':'); 143 commenter_id = ids[0]; 144 commenter_blog_ids = ids[1]; 145 commenter_url = getCookie('commenter_url'); 146 } 140 <MTsetvarblock name="cgi_host"><$MTCGIHost exclude_port="1"></MTsetvarblock> 141 <MTIf tag="MTBlogHost" exclude_port="1" eq="cgi_host"> 142 commenter_name = getCookie('commenter_name'); 143 ids = getCookie('commenter_id').split(':'); 144 commenter_id = ids[0]; 145 commenter_blog_ids = ids[1]; 146 commenter_url = getCookie('commenter_url'); 147 <MTelse> 148 document.write('<script src="<$MTCGIPath$><$MTCommentScript$>?__mode=cmtr_name_js&blog_id=<$MTBlogID$>"></script>'); 149 </MTIf> 147 150 </MTIfRegistrationAllowed> 148 151
