Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r17849: LJINT-362 (comments for side projects)

Committer: ailyin
LJINT-362 (comments for side projects)
U   trunk/bin/upgrading/proplists.dat
U   trunk/cgi-bin/LJ/HTML/Template.pm
U   trunk/cgi-bin/LJ/Identity.pm
U   trunk/cgi-bin/LJ/Talk/Author/Anonymous.pm
U   trunk/cgi-bin/LJ/Talk/Author/OpenID.pm
U   trunk/cgi-bin/LJ/Talk/Author/User.pm
U   trunk/cgi-bin/LJ/Talk/Author.pm
U   trunk/cgi-bin/LJ/Talk.pm
U   trunk/cgi-bin/LJ/Widget/LoginMulti.pm
U   trunk/cgi-bin/weblib.pl
U   trunk/htdocs/gadgets/logcom.bml
U   trunk/htdocs/talkpost_do.bml
U   trunk/templates/CommentForm/FormEmbedable.tmpl
U   trunk/templates/Identity/Login-user.tmpl
U   trunk/templates/Identity/Login.tmpl
Modified: trunk/bin/upgrading/proplists.dat
===================================================================
--- trunk/bin/upgrading/proplists.dat	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/bin/upgrading/proplists.dat	2010-12-02 07:00:33 UTC (rev 17849)
@@ -1598,3 +1598,8 @@
   cldversion: 8
   prettyname: System limit of friending notification delay
 
+logproplist.external_url:
+  datatype: char
+  des: URL of this entry on an external site
+  prettyname: External URL
+  sortorder: 107

Modified: trunk/cgi-bin/LJ/HTML/Template.pm
===================================================================
--- trunk/cgi-bin/LJ/HTML/Template.pm	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/cgi-bin/LJ/HTML/Template.pm	2010-12-02 07:00:33 UTC (rev 17849)
@@ -14,6 +14,8 @@
         'lj_sitename'   => $LJ::SITENAMESHORT,
         'lj_sslroot'    => $LJ::SSLROOT,
         'lj_jsprefix'   => $LJ::JSPREFIX,
+        'lj_res_includes_basic' => LJ::res_includes({ 'only_needed' => 1 }),
+        'lj_res_includes'       => LJ::res_includes(),
     );
 
     if ($opts->{'use_expr'}) {

Modified: trunk/cgi-bin/LJ/Identity.pm
===================================================================
--- trunk/cgi-bin/LJ/Identity.pm	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/cgi-bin/LJ/Identity.pm	2010-12-02 07:00:33 UTC (rev 17849)
@@ -208,6 +208,12 @@
                   "jid=$journalid&" .
                   "pendcid=$pendcid";
         $returl_fail = $returl . '&failed=1';
+    } elsif ($forwhat =~ /^external-(\d+)-(\d+)$/) {
+        my ($journalid, $jitemid) = ($1, $2);
+        my $journal = LJ::load_userid($journalid);
+        my $entry = LJ::Entry->new($journal, 'jitemid' => $jitemid);
+
+        $returl = $returl_fail = $entry->prop('external_url');
     } else {
         # the warning will sit in error logs, and the exception
         # will be handled

Modified: trunk/cgi-bin/LJ/Talk/Author/Anonymous.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk/Author/Anonymous.pm	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/cgi-bin/LJ/Talk/Author/Anonymous.pm	2010-12-02 07:00:33 UTC (rev 17849)
@@ -23,6 +23,14 @@
     return $usertype eq 'anonymous';
 }
 
+sub usertype_default {
+    my ( $class, $remote ) = @_;
+
+    return if $remote;
+
+    return 'anonymous';
+}
+
 sub handle_user_input {
     # we don't care; the poster is anonymous, which means "undef" as
     # the user posting

Modified: trunk/cgi-bin/LJ/Talk/Author/OpenID.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk/Author/OpenID.pm	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/cgi-bin/LJ/Talk/Author/OpenID.pm	2010-12-02 07:00:33 UTC (rev 17849)
@@ -47,6 +47,16 @@
     return $usertype =~ /^(?:openid|openid_cookie)$/;
 }
 
+sub usertype_default {
+    my ( $class, $remote ) = @_;
+
+    return unless $remote
+               && $remote->is_identity
+               && $remote->identity->short_code eq 'openid';
+
+    return 'openid_cookie';
+}
+
 sub handle_user_input {
     my ($class, $form, $remote, $need_captcha, $errret, $init) = @_;
 

Modified: trunk/cgi-bin/LJ/Talk/Author/User.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk/Author/User.pm	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/cgi-bin/LJ/Talk/Author/User.pm	2010-12-02 07:00:33 UTC (rev 17849)
@@ -64,6 +64,14 @@
     return $usertype =~ /^(?:user|cookieuser)$/;
 }
 
+sub usertype_default {
+    my ( $class, $remote ) = @_;
+
+    return unless $remote && $remote->is_personal;
+
+    return 'cookieuser';
+}
+
 sub handle_user_input {
     my ($class, $form, $remote, $need_captcha, $errret, $init) = @_;
 

Modified: trunk/cgi-bin/LJ/Talk/Author.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk/Author.pm	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/cgi-bin/LJ/Talk/Author.pm	2010-12-02 07:00:33 UTC (rev 17849)
@@ -101,6 +101,13 @@
 field value in the commenting form corresponds to this author class.
 Used by get_handler.
 
+=head3 usertype_default($remote)
+
+Return a string with the default 'usertype' field value, provided
+that the remote user corresponds to this author class and does not
+need any further authorization to comment. Return a value that evaluates
+to false otherwise.
+
 =head3 handle_user_input(...)
 
  my $up = $author_class->handle_user_input(

Modified: trunk/cgi-bin/LJ/Talk.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk.pm	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/cgi-bin/LJ/Talk.pm	2010-12-02 07:00:33 UTC (rev 17849)
@@ -1543,13 +1543,15 @@
             $journalu );
     }
 
-    my @author_options;
+    my ( @author_options, $usertype_default );
     foreach my $author_class (LJ::Talk::Author->all) {
         next unless $author_class->enabled;
 
         my $params = $author_class->display_params($opts);
         $params->{'short_code'} = $author_class->short_code;
         push @author_options, $params;
+
+        $usertype_default ||= $author_class->usertype_default($remote);
     }
 
     # from registered user or anonymous?
@@ -1844,11 +1846,14 @@
 
         'basesubject'           => $basesubject,
         'author_options'        => \@author_options,
+        'usertype_default'      => $usertype_default,
 
         'extra_rows'            => LJ::run_hook('extra_talkform_rows', {
             'entry'     => $entry,
             'editid'    => $editid,
-        }),
+        }) || undef,
+
+        'logout_url'            => $opts->{'logout_url'},
     );
 
     return $template->output;

Modified: trunk/cgi-bin/LJ/Widget/LoginMulti.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/LoginMulti.pm	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/cgi-bin/LJ/Widget/LoginMulti.pm	2010-12-02 07:00:33 UTC (rev 17849)
@@ -16,12 +16,13 @@
 
     ## Page with widget
     my $thispage = $opts{thispage} || "$LJ::SITEROOT/identity/login.bml";
-    $thispage =~ m|^http://| 
+    my $forwhat = $opts{'forwhat'} || 'login';
+    $thispage =~ m|^http://|
         or die "'thispage' param should be absolute uri";
 
     ## Handle auth params
     if (LJ::Request->did_post) {
-        do_login($thispage, \@errors);
+        do_login($thispage, $forwhat, \@errors);
         ## where to go on success?
         return if LJ::Request->redirected;
     }
@@ -46,10 +47,15 @@
 
     ## Auth types.
     ## User type (LJ.com) is always enabled.
-    my @types = ({ type => 'user', 
-                   ml_tab_heading => LJ::Lang::ml("/identity/login.bml.tab.user"),
-                   action => $action_uri->as_string . "?ret=" . LJ::eurl($thispage),
-                   });
+    my @types;
+
+    if ($opts{'lj_auth'}) {
+        push @types, {
+            type => 'user',
+            ml_tab_heading => LJ::Lang::ml("/identity/login.bml.tab.user"),
+        };
+    }
+
     ## external auth
     foreach my $type (@LJ::IDENTITY_TYPES) {
         my $idclass = LJ::Identity->find_class($type);
@@ -71,18 +77,19 @@
         'current_type' => $current_type,
         'returnto' => $thispage,
     );
-    
+
     ## well cooked widget is here
     return $template->output;
 }
 
 sub do_login {
     my $thispage = shift;
+    my $forwhat = shift;
     my $errors = shift;
     my $idtype = LJ::Request->post_param('type');
 
     ## Special case: perform LJ.com login.
-    if ($idtype eq 'user'){
+    if ($idtype eq 'user') {
         ## Determine user
         my $username = LJ::Request->post_param('user');
         unless ($username){
@@ -121,8 +128,11 @@
 
         ## Where to go?
         my $returnto = LJ::Request->post_param("returnto") || $thispage;
-        $returnto = "https://www.livejournal.com/login.bml"
-            unless $returnto =~ m!^https?://\Q$LJ::DOMAIN_WEB\E/!;
+        unless ( $returnto =~ m!^https?://\Q$LJ::DOMAIN_WEB\E/! ) {
+            my $returl_fail;
+            ($returnto, $returl_fail)
+                = LJ::Identity->unpack_forwhat($forwhat);
+        }
         LJ::Request->redirect($returnto);
 
         return 1;
@@ -132,13 +142,16 @@
         if ($idclass && $idclass->enabled) {
             ## Where to go?
             my $returnto = LJ::Request->post_param("returnto") || $thispage;
-            $returnto = "https://www.livejournal.com/login.bml"
-                unless $returnto =~ m!^https?://\Q$LJ::DOMAIN_WEB\E/!;
+            my $returl_fail = "$thispage?type=$idtype";
+            unless ( $returnto =~ m!^https?://\Q$LJ::DOMAIN_WEB\E/! ) {
+                ($returnto, $returl_fail)
+                    = LJ::Identity->unpack_forwhat($forwhat);
+            }
 
             $idclass->attempt_login($errors,
                 'returl' => $returnto,
-                'returl_fail' => "$thispage?type=$idtype",
-                'forwhat' => 'login',
+                'returl_fail' => $returl_fail,
+                'forwhat' => $forwhat,
             );
 
             return 1 if LJ::Request->redirected;

Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/cgi-bin/weblib.pl	2010-12-02 07:00:33 UTC (rev 17849)
@@ -1409,7 +1409,6 @@
         }
     }
 
-
     foreach my $key (@LJ::NEEDED_RES) {
         my $path;
         my $mtime = _file_modtime($key, $now);

Modified: trunk/htdocs/gadgets/logcom.bml
===================================================================
--- trunk/htdocs/gadgets/logcom.bml	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/htdocs/gadgets/logcom.bml	2010-12-02 07:00:33 UTC (rev 17849)
@@ -5,42 +5,66 @@
     use LJ::Widget::LoginMulti;
     use LJ::ExternalComments;
 
+    LJ::need_res(qw( js/partners/placeholder.js
+                     js/jquery.js
+                     stc/lj_base.css
+                     stc/partners/login.css ));
+
     my $thispage = "$LJ::SITEROOT/gadgets/logcom.bml";
     $thispage .= "?" . LJ::Request->args;
 
+    my $url     = $GET{url};
+    my $rskey   = $GET{rsk};
+
+    ## convert remote-site key to lj.com's community
+    my $username = LJ::ExternalComments->key_to_username($rskey);
+    return "unknown key" unless $username;
+
+    my $journal = LJ::load_user($username);
+    return "unknown user" unless $journal;
+
+    ## convert article's uri on partners site to entryid on LJ.com
+    my $jitemid = LJ::ExternalComments->url_to_jitemid($journal, $url);
+    unless ($jitemid){
+        ## create new empty entry for this url
+        $jitemid = LJ::ExternalComments->create_entry_for_url($journal, $url);
+        return "Can't create new entry" unless $jitemid;
+    }
+
     if (my $remote = LJ::get_remote() and not $GET{viewform}){
         ## show add comment form
+        LJ::need_res(qw( stc/partners/login.css ));
 
-        my $url     = $GET{url};
-        my $rskey   = $GET{rsk};
+        my $replyto = LJ::Request->get_param('replyto');
+        
+        if ($replyto) {
+            my $parent  = LJ::Comment->new( $journal, 'dtalkid' => $replyto );
+            $replyto    = 0
+                unless $parent->valid;
+        }
 
-        ## convert remote-site key to lj.com's community
-        my $username = LJ::ExternalComments->key_to_username($rskey);
-        return "unknown key" unless $username;
+        my $entry = LJ::Entry->new($journal, jitemid => $jitemid);
 
-        my $journal = LJ::load_user($username);
-        return "unknown user" unless $journal;
-
-        ## convert article's uri on partners site to entryid on LJ.com
-        my $jitemid = LJ::ExternalComments->url_to_jitemid($journal, $url);
-        unless ($jitemid){
-            ## create new empty entry for this url
-            $jitemid = LJ::ExternalComments->create_entry_for_url($journal, $url);
-            return "Can't create new entry" unless $jitemid;
+        my $remote_sessid;
+        if ($remote) {
+            $remote_sessid = $remote->session->id;
         }
 
-        my $entry = LJ::Entry->new($journal, jitemid => $jitemid);
-        return 
-            LJ::Talk::talkform({ 
+        my $logout_url = "$LJ::SITEROOT/gadgets/logout.bml?" .
+                         'returnto=' . LJ::eurl($thispage) . '&' .
+                         'sessid=' . $remote_sessid;
+
+        return
+            LJ::Talk::talkform({
                 remote   => $remote,
                 journalu => $journal,
                 ditemid  => $entry->ditemid,
                 embedable_form => 1,
-                #replyto  => ,
-                #ditemid  => ,
+                replyto  => int ($replyto / 256),
+                logout_url => $logout_url,
             });
 
-    
+
     } else {
         ## display login widget
         LJ::need_res(qw(
@@ -48,6 +72,8 @@
           stc/partners/login.css
         ));
 
+        my $forwhat = 'external-' . $journal->userid . '-' . $jitemid;
+
         my $ret = "";
         $ret .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
         <html>
@@ -56,7 +82,7 @@
         <title>Log in</title>
         " . LJ::res_includes() . "
         <body>"
-        . LJ::Widget::LoginMulti->render(thispage => $thispage)
+        . LJ::Widget::LoginMulti->render(thispage => $url, forwhat => $forwhat, lj_auth => 1,)
         ."</body></html>";
         return $ret;
     }

Modified: trunk/htdocs/talkpost_do.bml
===================================================================
--- trunk/htdocs/talkpost_do.bml	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/htdocs/talkpost_do.bml	2010-12-02 07:00:33 UTC (rev 17849)
@@ -198,7 +198,10 @@
     my $stylemine = $POST{'stylemine'} ? 'style=mine' : '';
 
     my $commentlink;
-    if ($POST{'viewing_thread'} eq '') {
+    if ($POST{'is_form_embedded'}) {
+        $commentlink = $entry->prop('external_url')
+                     . '?view=' . $dtalkid . '#t' . $dtalkid;
+    } elsif ($POST{'viewing_thread'} eq '') {
         $commentlink = LJ::Talk::talkargs($talkurl, "view=$dtalkid", $stylemine) . "#t$dtalkid";
     } else {
         $commentlink = LJ::Talk::talkargs($talkurl, "thread=$POST{viewing_thread}", $stylemine) . "#t$dtalkid";

Modified: trunk/templates/CommentForm/FormEmbedable.tmpl
===================================================================
--- trunk/templates/CommentForm/FormEmbedable.tmpl	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/templates/CommentForm/FormEmbedable.tmpl	2010-12-02 07:00:33 UTC (rev 17849)
@@ -4,20 +4,19 @@
     <meta charset="UTF-8">
     <title>index :: Дерево комментариев</title>
 
-    <link rel="stylesheet" type="text/css" href="http://stat.lj-6-m.bulyon.local/??lj_base.css,esn.css,contextualhover.css,partners/login.css?v=1290088714" />
-    <!--[if IE]><link rel="stylesheet" type="text/css" href="http://stat.lj-6-m.bulyon.local/??ie.css?v=1289903077" /><![endif]-->
-
-    <script src="js/jquery.ljcomments.js" type="text/javascript"></script>
-    <script src="js/script.js" type="text/javascript"></script>
+    <TMPL_VAR lj_res_includes>
 </head>
 <body>
-
 	<div class="lj3-form-wrapper">
-		<form class="lj3-form lj3-post-comment lj3-active" id="postform" method="post" action="/talkpost_do.bml">
+		<form class="lj3-form lj3-post-comment lj3-active" id="postform" method="post" action="/talkpost_do.bml" target="_top">
+            <TMPL_VAR form_intro>
+            <input type="hidden" name="usertype" value="<TMPL_VAR usertype_default>">
+            <input type="hidden" name="is_form_embedded" value="1">
+            <input type="hidden" name="cookieuser" value="<TMPL_VAR remote_username>">
 			<fieldset>
 				<p class="lj3-identity">
-                    От <strong><a href="javascript:void(0);"><TMPL_VAR remote_username></a></strong>
-                    <span class="lj3-logout">(<a href="/gadgets/logout.bml?returnto=/gadgets/logcom.bml">Выйти</a>)</span>
+                    От <strong><a href="javascript:void(0);"><TMPL_VAR remote_display_name></a></strong>
+                    <span class="lj3-logout">(<a href="<TMPL_VAR logout_url>">Выйти</a>)</span>
                 </p>
 				<p class="lj3-input-wrapper">
 					<label for="subject"><TMPL_VAR expr="ml('/talkpost.bml.opt.subject')"></label>
@@ -33,245 +32,5 @@
 			</fieldset>
 		</form>
 	</div>
-
-
-<div style="display:none;">
-
-
-
-
-<TMPL_IF warnscreened>
-    <div class='ljwarnscreened'><TMPL_VAR expr="ml('/talkpost.bml.warnscreened')"></div>
-</TMPL_IF>
-
-<a href="/gadgets/logout.bml">logout</a>
-<form method='post' action='<TMPL_VAR lj_siteroot>/talkpost_do.bml' id='postform'>
-<TMPL_VAR form_intro>
-
-<TMPL_IF errors>
-    <ul>
-        <TMPL_LOOP errors>
-            <li><TMPL_VAR error></li>
-        </TMPL_LOOP>
-    </ul>
-    <hr/>
-</TMPL_IF>
-
-<TMPL_VAR tosagree>
-
-<TMPL_VAR create_link>
-
-<table>
-<tr>
-    <td align='right' valign='top'><TMPL_VAR expr="ml('/talkpost.bml.opt.from')"></td>
-    <td> <TMPL_IF 0> Internal for "From" options </TMPL_IF>
-        <table class="b-postform-from">
-            <TMPL_IF editid>
-                <tr valign='middle' id='ljuser_row'>
-                    <TMPL_IF remote_banned>
-                        <td align='center'><img src='<TMPL_VAR lj_imgprefix>/userinfo.gif' /></td>
-                        <td align='center'>( )</td>
-                        <td align='left'><span class='ljdeem'><TMPL_VAR ml_loggedin></font><TMPL_VAR ml_banned></td>
-                    <TMPL_ELSE>
-                        <td align='center'><img src='<TMPL_VAR lj_imgprefix>/userinfo.gif'  onclick='handleRadios(1);' /></td>
-                        <td align='left'><label for='talkpostfromremote'><TMPL_VAR ml_loggedin></label>
-                        <input type='hidden' name='usertype' value='cookieuser' />
-                        <input type='hidden' name='cookieuser' value='<TMPL_VAR remote_username>' id='cookieuser' />
-                        </td>
-                    </TMPL_IF>
-                </tr>
-            <TMPL_ELSE>
-                <TMPL_LOOP author_options>
-                    <TMPL_INCLUDE expr="sprintf('templates/CommentForm/Author-%s.tmpl', short_code)">
-                </TMPL_LOOP>
-            </TMPL_IF>
-        </table>
-    </td>
-</tr>
-
-<tr valign='top'>
-    <td align='right'><TMPL_VAR expr="ml('/talkpost.bml.opt.subject')"></td>
-    <td>
-        <input class='textbox' type='text' size='50' maxlength='100' name='subject' id='subject' value="<TMPL_VAR basesubject>" onKeyPress='subjectNoHTML(event);' tabindex='10' />
-
-        <TMPL_IF 0> subject icon </TMPL_IF>
-            <input type='hidden' id='subjectIconField' name='subjecticon' value='<TMPL_VAR subjicon>'>
-            <script type='text/javascript' language='Javascript'>
-            <!--
-                if (document.getElementById) {
-                    <TMPL_IF subjicon_none>
-                        document.write("<img src='<TMPL_VAR lj_imgprefix>/talk/none.gif' border='0' width='15' height='15' valign='middle' id='subjectIconImage' style='cursor:pointer;cursor:hand' align='absmiddle' onclick='subjectIconListToggle();' title='Click to change the subject icon' />");
-                    <TMPL_ELSE>
-                        document.write("<img src='<TMPL_VAR lj_imgprefix>/talk/<TMPL_VAR subjicon_current_img>' border='0' width='<TMPL_VAR subjicon_current_w>' height='<TMPL_VAR subjicon_current_h>' valign='middle' id='subjectIconImage' onclick='subjectIconListToggle();' style='cursor:pointer;cursor:hand' />");
-                    </TMPL_IF>
-
-                    <TMPL_IF 0> spit out a pretty table of all the possible subjecticons </TMPL_IF>
-                    document.write("<blockquote style='display:none;' id='subjectIconList'>");
-                    document.write("<table border='0' cellspacing='5' cellpadding='0' style='border: 1px solid #AAAAAA'>");
-
-                    <TMPL_LOOP subjicon_types>
-                        document.write("<tr>");
-
-                        <TMPL_IF __first__> <TMPL_IF 0> make an option if they don't want an image </TMPL_IF>
-                            document.write("<td valign='middle' align='center'>");
-                            document.write("<img src='<TMPL_VAR lj_imgprefix>/talk/none.gif' border='0' width='15' height='15' valign='middle' id='none' onclick='subjectIconChange(this);' style='cursor:pointer;cursor:hand' title='No subject icon' />")
-                            document.write("</td>");
-                        </TMPL_IF>
-
-                        <TMPL_LOOP subjicons>
-                            document.write("<td valign='middle' align='center'>");
-                            document.write("<img src='<TMPL_VAR lj_imgprefix>/talk/<TMPL_VAR subjicon_img>' border='0' width='<TMPL_VAR subjicon_w>' height='<TMPL_VAR subjicon_h>' valign='middle' id='<TMPL_VAR subjicon_id>' onclick='subjectIconChange(this);' style='cursor:pointer;cursor:hand' />");
-                            document.write("</td>");
-                        </TMPL_LOOP>
-
-                        document.write("</tr>");
-                    </TMPL_LOOP>
-
-                    <TMPL_IF 0> end that table, bar! </TMPL_IF>
-                    document.write("</table>");
-                    document.write("</blockquote>");
-                }
-            //-->
-            </script>
-        <TMPL_IF 0> end subject icon </TMPL_IF>
-
-        <div id='ljnohtmlsubj' class='ljdeem'><span style='font-size: 8pt; font-style: italic;'><TMPL_VAR expr="ml('/talkpost.bml.nosubjecthtml')"></span></div>
-
-        <TMPL_IF text_hint>
-            <div id="subjectCaptionText"><TMPL_VAR text_hint></div>
-        </TMPL_IF>
-
-        <div id='userpics'>
-            <TMPL_IF show_userpics>
-                <script type="text/javascript">
-                    var userpicmap=<TMPL_VAR userpicmap>;
-                    var defaultpicurl="<TMPL_VAR defaultpicurl>";
-                </script>
-                <TMPL_VAR ml_picturetouse>
-                <select name="prop_picture_keyword" tabindex="11">
-                    <TMPL_LOOP userpics>
-                        <option value="<TMPL_VAR userpic_keyword>" <TMPL_IF userpic_selected>selected="selected"</TMPL_IF>><TMPL_VAR userpic_title></option>
-                    </TMPL_LOOP>
-                </select>
-                <TMPL_VAR helpicon_userpics>
-            </TMPL_IF>
-
-            &nbsp;&nbsp;<input type="checkbox" name="prop_opt_preformatted" id="prop_opt_preformatted" value="1"<TMPL_IF opt_preformatted_selected> checked="checked"</TMPL_IF> tabindex="12" /><label for='prop_opt_preformatted'>&nbsp;<TMPL_VAR expr="ml('/talkpost.bml.opt.noautoformat')">&nbsp;</label><TMPL_VAR helpicon_noautoformat>
-
-            <TMPL_IF show_quick_quote>
-                <script type='text/javascript' language='JavaScript'>
-                <!--
-                var helped = 0; var pasted = 0;
-                function quote () {
-                    var text = '';
-
-                    if (document.getSelection) {
-                        text = document.getSelection();
-                    } else if (document.selection) {
-                        text = document.selection.createRange().text;
-                    } else if (window.getSelection) {
-                        text = window.getSelection();
-                    }
-
-                    // Fix for Safari
-                    if (typeof(text) == 'object') text = text.toString();
-                    if (text == '') {
-                        if (helped != 1 && pasted != 1) {
-                            helped = 1; alert("If you'd like to quote a portion of the original message, highlight it then press 'Quote'");
-                        }
-                        return false;
-                    } else {
-                        pasted = 1;
-                    }
-
-                    var element = text.search(/\\n/) == -1 ? 'q' : 'blockquote';
-                    var textarea = document.getElementById('commenttext');
-                    textarea.focus();
-                    textarea.value = textarea.value + "<" + element + ">" + text + "</" + element + ">";
-                    textarea.caretPos = textarea.value;
-                    textarea.focus();
-                    return false;
-                }
-                if (document.getElementById && (document.getSelection || document.selection || window.getSelection)) {
-                    // Opera clears the paste buffer before mouse events, useless here
-                        if (navigator.userAgent.indexOf("Opera") == -1) {
-                            document.write('&nbsp;&nbsp;<input type="button" value="Quote" onmousedown="quote();" onclick="quote();" tabindex="13" />');
-                        }
-                }
-                //-->
-                </script>
-            </TMPL_IF>
-        </div>
-    </td>
-</tr>
-
-<TMPL_IF 0> textarea for their message body </TMPL_IF>
-<tr valign='top'>
-    <td align='right'><TMPL_VAR expr="ml('/talkpost.bml.opt.message')"></td>
-    <td style='width: 90%'>
-        <textarea class='textbox' rows='10' cols='75' wrap='soft' name='body' id='commenttext' tabindex='20'><TMPL_VAR comment_body></textarea>
-    </td>
-</tr>
-
-<TMPL_VAR extra_rows>
-
-<tr>
-    <td></td>
-    <td>
-        <TMPL_IF captcha_html>
-            <TMPL_VAR captcha_html>
-            <br />
-        </TMPL_IF>
-
-        <br />
-        <script language="JavaScript" type='text/javascript'>
-            <!--
-            function checkLength() {
-                if (!document.getElementById) return true;
-                var textbox = document.getElementById('commenttext');
-                if (!textbox) return true;
-                if (textbox.value.length > <TMPL_VAR comment_length_cap>) {
-                    alert('Sorry, but your comment of ' + textbox.value.length + ' characters exceeds the maximum character length of <TMPL_VAR comment_length_cap>.  Please try shortening it and then post again.');
-                    return false;
-                }
-                return true;
-            }
-            // -->
-        </script>
-
-        <input type='submit' name='submitpost' onclick='return checkLength() && sendForm("postform", "username")' tabindex='30'
-            <TMPL_IF editid>
-                value="<TMPL_VAR expr="ml('/talkpost.bml.opt.edit')">"
-            <TMPL_ELSE>
-                value="<TMPL_VAR expr="ml('/talkpost.bml.opt.submit')">"
-            </TMPL_IF>
-        />
-        &nbsp;
-        <input type='submit' name='submitpreview' onclick='return checkLength() && sendForm("postform", "username")'
-            value="<TMPL_VAR expr="ml('talk.btn.preview')">" tabindex="50" />
-
-        <TMPL_IF show_spellcheck>
-            <input type='checkbox' name='do_spellcheck' value='1' id='spellcheck' tabindex='51' />
-            <label for='spellcheck'><TMPL_VAR expr="ml('talk.spellcheck')"></label>
-        </TMPL_IF>
-
-        <TMPL_IF show_logips>
-            <p class="b-bubble b-bubble-alert b-bubble-noarrow b-bubble-intext"><i class="i-bubble-arrow-border"></i><i class="i-bubble-arrow"></i><TMPL_VAR ml_logcommentips>&nbsp;<TMPL_VAR helpicon_iplogging></p>
-        </TMPL_IF>
-    </td>
-</tr>
-</table>
-
-<TMPL_IF 0> Some JavaScript to help the UI out </TMPL_IF>
-<script type='text/javascript' language='JavaScript'>
-    var usermismatchtext = "<TMPL_VAR ml_usermismatch>";
-</script>
-<script type='text/javascript' language='JavaScript' src='<TMPL_VAR lj_jsprefix>/talkpost.js'></script>
-
-</form>
-
-
-</div>
-
 </body>
 </html>

Modified: trunk/templates/Identity/Login-user.tmpl
===================================================================
--- trunk/templates/Identity/Login-user.tmpl	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/templates/Identity/Login-user.tmpl	2010-12-02 07:00:33 UTC (rev 17849)
@@ -1,12 +1,12 @@
 <p class="b-auth-desc"><TMPL_VAR expr="ml('/identity/login.bml.user.desc')"></p>
 <p class="b-auth-user-form">
 	<span class="b-auth-input-wrapper">
-		<label for=""><TMPL_VAR expr="ml('/identity/login.bml.user.label.name')"></label>
-		<input type="text" name="user" id="" value="" class="b-auth-user-input" />
+		<label for="ljusername"><TMPL_VAR expr="ml('/identity/login.bml.user.label.name')"></label>
+		<input type="text" name="user" id="ljusername" value="" class="b-auth-user-input" />
 	</span>
 	<span class="b-auth-input-wrapper">
-		<label for=""><TMPL_VAR expr="ml('/identity/login.bml.user.label.pass')"></label>
-		<input type="pass" name="password" id="" value="" class="b-auth-user-input" />
+		<label for="ljuserpassword"><TMPL_VAR expr="ml('/identity/login.bml.user.label.pass')"></label>
+		<input type="password" name="password" id="ljuserpassword" value="" class="b-auth-user-input" />
 		<a href="<TMPL_VAR expr="ml('/identity/login.bml.user.help.link')">"><TMPL_VAR expr="ml('/identity/login.bml.user.help')"></a>
 	</span>
 	<button type="submit"><TMPL_VAR expr="ml('/identity/login.bml.user.btn.login')"></button>

Modified: trunk/templates/Identity/Login.tmpl
===================================================================
--- trunk/templates/Identity/Login.tmpl	2010-12-02 06:03:45 UTC (rev 17848)
+++ trunk/templates/Identity/Login.tmpl	2010-12-02 07:00:33 UTC (rev 17849)
@@ -15,7 +15,7 @@
         <TMPL_ELSE>
             <li id="tab-<TMPL_VAR type>" class="b-auth-item" style="display:none">
         </TMPL_IF>
-            <form action="<tmpl_var action>" method="post">
+			<form action="<tmpl_var action>" method="post" target="_top">
                 <TMPL_INCLUDE expr="sprintf('templates/Identity/Login-%s.tmpl', type)">
                 <input type="hidden" name="type" value="<TMPL_VAR type>" />
                 <input type="hidden" name="returnto" value="<TMPL_VAR returnto>" />

Tags: andy, bml, dat, livejournal, pl, pm, 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