Aralot (aralot) wrote in changelog,
Aralot
aralot
changelog

[livejournal] r17449: LJSUP-6867

Committer: szhirkov
LJSUP-6867
U   trunk/htdocs/js/talkpost.js
U   trunk/templates/CommentForm/Author-OpenID.tmpl
Modified: trunk/htdocs/js/talkpost.js
===================================================================
--- trunk/htdocs/js/talkpost.js	2010-09-27 02:24:35 UTC (rev 17448)
+++ trunk/htdocs/js/talkpost.js	2010-09-27 04:00:32 UTC (rev 17449)
@@ -8,6 +8,8 @@
     var radio_anon = document.getElementById("talkpostfromanon");
 	var radio_fblo = document.getElementById("talkpostfromfblo");
 	var radio_fbli = document.getElementById("talkpostfromfbli");
+    var radio_twlo = document.getElementById("talkpostfromtwlo");
+    var radio_twli = document.getElementById("talkpostfromtwli");
     var radio_oidlo = document.getElementById("talkpostfromoidlo");
     var radio_oidli = document.getElementById("talkpostfromoidli");
 
@@ -33,6 +35,9 @@
 	var fblo_row = document.getElementById("fblo");
 	var fbli_row = document.getElementById("fbli");
 	var fb_more = document.getElementById("fb_more");
+	var twlo_row = document.getElementById("twlo");
+	var twli_row = document.getElementById("twli");
+	var tw_more = document.getElementById("tw_more");
 
     var remotef = document.getElementById("cookieuser");
     var remote;
@@ -57,6 +62,8 @@
 }
 
 function handleRadios(sel) {
+	var currentRadio;
+	
     password.disabled = check_login.disabled = (sel != 2);
     if (password.disabled) password.value='';
 
@@ -97,34 +104,52 @@
 	// Facebook
 	if (fb_more) {
 		if (sel == 3) {
-			var radio = radio_fblo || radio_fbli;
+			currentRadio = radio_fblo || radio_fbli;
 			
 			showMe(fb_more);
 			toggleTextHighlight(fb_more, true);
 			
-			radio.checked = 1;
+			currentRadio.checked = 1;
 		} else {
 			hideMe(fb_more);
 			toggleTextHighlight(fb_more, false);
 		}
 	}
+	
+	// Twitter
+	if (tw_more) {
+		if (sel == 4) {
+			currentRadio = radio_twlo || radio_twli;
+			
+			showMe(tw_more);
+			toggleTextHighlight(tw_more, true);
+			
+			currentRadio.checked = 1;
+		} else {
+			hideMe(tw_more);
+			toggleTextHighlight(fb_more, false);
+		}
+	}
+	
     // OpenID
     if (oid_more) {
-        if (sel == 4) {
-			var radio = radio_oidli || radio_oidlo;
+        if (sel == 5) {
+			currentRadio = radio_oidli || radio_oidlo;
 			
             showMe(oid_more);
 			toggleTextHighlight(oid_more, true);
             oidurl.focus();
 			
-			radio.checked = 1;
+			currentRadio.checked = 1;
         } else {
             hideMe(oid_more);
 			toggleTextHighlight(oid_more, false);
         }
     }
 
-    if (sel_pickw.disabled = (sel != 1)) sel_pickw.value='';
+    if (sel_pickw.disabled = (sel != 1)) {
+		sel_pickw.value = '';
+	}
 }
 
 function submitHandler() {
@@ -153,8 +178,10 @@
     if (radio_user && radio_user.checked) handleRadios(2);
 	if (radio_fblo && radio_fblo.checked) handleRadios(3);
     if (radio_fbli && radio_fbli.checked) handleRadios(3);
-    if (radio_oidlo && radio_oidlo.checked) handleRadios(4);
-    if (radio_oidli && radio_oidli.checked) handleRadios(4);
+    if (radio_twlo && radio_twlo.checked) handleRadios(4);
+    if (radio_twli && radio_twli.checked) handleRadios(4);
+    if (radio_oidlo && radio_oidlo.checked) handleRadios(5);
+    if (radio_oidli && radio_oidli.checked) handleRadios(5);
 
     if (radio_remote) {
         radio_remote.onclick = function () {
@@ -178,13 +205,21 @@
         radio_fblo.onclick = function () {
             handleRadios(3);
         };
+    if (radio_twli)
+        radio_twli.onclick = function () {
+            handleRadios(4);
+        };
+    if (radio_twlo)
+        radio_twlo.onclick = function () {
+            handleRadios(4);
+        };
     if (radio_oidlo)
         radio_oidlo.onclick = function () {
-            handleRadios(4);
+            handleRadios(5);
         };
     if (radio_oidli)
         radio_oidli.onclick = function () {
-            handleRadios(4);
+            handleRadios(5);
         };
     if (username) {
         username.onkeydown = username.onchange = function () {
@@ -200,16 +235,17 @@
     }
     form.onsubmit = submitHandler;
 
-    document.onload = function () {
+    jQuery(function () {
         if (radio_anon && radio_anon.checked) handleRadios(0);
         if (radio_user && radio_user.checked) otherLJUser();
         if (radio_remote && radio_remote.checked) handleRadios(1);
         if (radio_fblo && radio_fblo.checked) handleRadios(3);
         if (radio_fbli && radio_fbli.checked) handleRadios(3);
-        if (radio_oidlo && radio_oidlo.checked) handleRadios(4);
-        if (radio_oidli && radio_oidli.checked) handleRadios(4);
-    }
-
+        if (radio_twlo && radio_twlo.checked) handleRadios(4);
+        if (radio_twli && radio_twli.checked) handleRadios(4);
+        if (radio_oidlo && radio_oidlo.checked) handleRadios(5);
+        if (radio_oidli && radio_oidli.checked) handleRadios(5);
+    });
 }
 
 // toggle subject icon list

Modified: trunk/templates/CommentForm/Author-OpenID.tmpl
===================================================================
--- trunk/templates/CommentForm/Author-OpenID.tmpl	2010-09-27 02:24:35 UTC (rev 17448)
+++ trunk/templates/CommentForm/Author-OpenID.tmpl	2010-09-27 04:00:32 UTC (rev 17449)
@@ -2,10 +2,10 @@
     <TMPL_IF everyone_can_comment>
         <TMPL_IF is_identity>
             <tr valign='middle' id='oidli' name='oidli'>
-            <td class="b-postform-icon"><img src='<TMPL_VAR lj_imgprefix>/openid-profile.gif' onclick='handleRadios(4);' /></td>
+            <td class="b-postform-icon"><img src='<TMPL_VAR lj_imgprefix>/openid-profile.gif' onclick='handleRadios(5);' /></td>
             <td class="b-postform-radio"><input type='radio' name='usertype' value='openid_cookie' id='talkpostfromoidli' <TMPL_IF whocheck_openid_cookie>checked='checked'</TMPL_IF> /></td>
             <td class="b-postform-data">
-                <label for='talkpostfromoid' onclick='handleRadios(4);return false;' class="i-postform-label"><b>OpenID identity:</b></label>
+                <label for='talkpostfromoid' onclick='handleRadios(5);return false;' class="i-postform-label"><b>OpenID identity:</b></label>
                 <strong><TMPL_VAR remote_display_name></strong>
                 <TMPL_VAR ml_willscreen>
             </td>
@@ -15,7 +15,7 @@
             <td class="b-postform-icon"><img src='<TMPL_VAR lj_imgprefix>/openid-profile.gif' onclick='handleRadios(3);' /></td>
             <td class="b-postform-radio"><input type='radio' name='usertype' value='openid' id='talkpostfromoidlo' <TMPL_IF whocheck_openid>checked='checked'</TMPL_IF> /></td>
             <td class="b-postform-data">
-                <label for='talkpostfromoidlo' onclick='handleRadios(4);return false;' class="i-postform-label"><b>OpenID</b></label>
+                <label for='talkpostfromoidlo' onclick='handleRadios(5);return false;' class="i-postform-label"><b>OpenID</b></label>
                 <TMPL_VAR ml_willscreen>
                 <span id="oid_more" class="i-bubble b-bubble-lite b-postform-openid"><i class="i-bubble-arrow-border"></i><i class="i-bubble-arrow"></i><label for="openid:url"><TMPL_VAR expr="ml('/talkpost.bml.openid.identity.url')">&nbsp;</label><input class='textbox' name='openid:url' maxlength='60' size='42' id='openid:url' value='<TMPL_VAR openid_url_default>' tabindex='1' /> <input type='hidden' name='oiddo_login' id='oidlogincheck' <TMPL_VAR oiddo_login_checked> /> <TMPL_VAR helpicon_openid></span>
             </td>
@@ -30,10 +30,10 @@
                 <td class="b-postform-radio">( )</td>
                 <td class="b-postform-data"><span class='ljdeem'><TMPL_VAR ml_loggedin></font><TMPL_VAR ml_banned></td>
             <TMPL_ELSE>
-                <td class="b-postform-icon"><img src='<TMPL_VAR lj_imgprefix>/openid-profile.gif' onclick='handleRadios(4);' /></td>
+                <td class="b-postform-icon"><img src='<TMPL_VAR lj_imgprefix>/openid-profile.gif' onclick='handleRadios(5);' /></td>
                 <td class="b-postform-radio"><input type='radio' name='usertype' value='openid_cookie' id='talkpostfromoidli' <TMPL_IF whocheck_openid_cookie>checked='checked'</TMPL_IF> /></td>
                 <td class="b-postform-data">
-                    <label for='talkpostfromoid' onclick='handleRadios(4);return false;' class="i-postform-label"><b>OpenID identity:</b></label>
+                    <label for='talkpostfromoid' onclick='handleRadios(5);return false;' class="i-postform-label"><b>OpenID identity:</b></label>
                     <strong><TMPL_VAR remote_display_name></strong>
                     <TMPL_VAR ml_willscreen>
                 </td>
@@ -54,7 +54,7 @@
             <td class="b-postform-icon"><img src='<TMPL_VAR lj_imgprefix>/openid-profile.gif' onclick='handleRadios(3);' /></td>
             <td class="b-postform-radio"><input type='radio' name='usertype' value='openid' id='talkpostfromoidlo' <TMPL_IF whocheck_openid>checked='checked'</TMPL_IF> /></td>
             <td class="b-postform-data">
-                <label for='talkpostfromoidlo' onclick='handleRadios(4);return false;' class="i-postform-label"><b>OpenID</b></label>
+                <label for='talkpostfromoidlo' onclick='handleRadios(5);return false;' class="i-postform-label"><b>OpenID</b></label>
                 <TMPL_VAR ml_willscreen>
                 <span id="oid_more" class="i-bubble b-bubble-lite b-postform-openid"><i class="i-bubble-arrow-border"></i><i class="i-bubble-arrow"></i><label for="openid:url"><TMPL_VAR expr="ml('/talkpost.bml.openid.identity.url')">&nbsp;</label><input class='textbox' name='openid:url' maxlength='60' size='42' id='openid:url' value='<TMPL_VAR openid_url_default>' tabindex='2' /> <input type='hidden' name='oiddo_login' id='oidlogincheck' <TMPL_VAR oiddo_login_checked> /> <TMPL_VAR helpicon_openid></span>
             </td>
@@ -63,12 +63,12 @@
     <TMPL_ELSIF friends_can_comment>
         <TMPL_IF is_identity>
             <tr valign='middle' id='oidli' name='oidli'>
-            <td class="b-postform-icon"><img src='<TMPL_VAR lj_imgprefix>/openid-profile.gif' onclick='handleRadios(4);' /></td>
+            <td class="b-postform-icon"><img src='<TMPL_VAR lj_imgprefix>/openid-profile.gif' onclick='handleRadios(5);' /></td>
 
             <TMPL_IF remote_can_comment>
                 <td class="b-postform-radio"><input type='radio' name='usertype' value='openid_cookie' id='talkpostfromoidli' <TMPL_IF whocheck_openid_cookie>checked='checked'</TMPL_IF> /></td>
                 <td class="b-postform-data">
-                    <b><label for='talkpostfromoid' onclick='handleRadios(4);return false;' class="i-postform-label">OpenID identity:</label></b>
+                    <b><label for='talkpostfromoid' onclick='handleRadios(5);return false;' class="i-postform-label">OpenID identity:</label></b>
                     <strong><TMPL_VAR remote_display_name></strong>
                     <TMPL_VAR ml_willscreen>
                 </td>
@@ -88,7 +88,7 @@
             <td class="b-postform-icon"><img src='<TMPL_VAR lj_imgprefix>/openid-profile.gif' onclick='handleRadios(3);' /></td>
             <td class="b-postform-radio"><input type='radio' name='usertype' value='openid' id='talkpostfromoidlo' <TMPL_IF whocheck_openid>checked='checked'</TMPL_IF> /></td>
             <td class="b-postform-data" class="b-postform-td">
-                <label for='talkpostfromoidlo' onclick='handleRadios(4);return false;' class="i-postform-label"><b>OpenID</b></label>
+                <label for='talkpostfromoidlo' onclick='handleRadios(5);return false;' class="i-postform-label"><b>OpenID</b></label>
                 <TMPL_VAR ml_willscreen>
                 <span id="oid_more" class="i-bubble b-bubble-lite b-postform-openid"><i class="i-bubble-arrow-border"></i><i class="i-bubble-arrow"></i><label for="openid:url"><TMPL_VAR expr="ml('/talkpost.bml.openid.identity.url')">&nbsp;</label><input class='textbox' name='openid:url' maxlength='60' size='42' id='openid:url' value='<TMPL_VAR openid_url_default>' tabindex='3' /> <input type='hidden' name='oiddo_login' id='oidlogincheck' <TMPL_VAR oiddo_login_checked> /> <TMPL_VAR helpicon_openid></span>
             </td>

Tags: aralot, js, livejournal, tmpl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments