vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r17736: LJINT-363: Comments for side projects

Committer: vsukhanov
LJINT-363: Comments for side projects
A   trunk/cgi-bin/LJ/Widget/LoginMulti.pm
A   trunk/htdocs/gadgets/
A   trunk/htdocs/gadgets/logcom.bml
U   trunk/htdocs/identity/login.bml
A   trunk/ssldocs/gadgets/
A   trunk/ssldocs/gadgets/logcom.bml
A   trunk/templates/CommentForm/FormEmbedable.tmpl
U   trunk/templates/Identity/Login-openid.tmpl
A   trunk/templates/Identity/Login-user.tmpl
U   trunk/templates/Identity/Login.tmpl
Added: trunk/cgi-bin/LJ/Widget/LoginMulti.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/LoginMulti.pm	                        (rev 0)
+++ trunk/cgi-bin/LJ/Widget/LoginMulti.pm	2010-11-22 08:32:15 UTC (rev 17736)
@@ -0,0 +1,145 @@
+package LJ::Widget::LoginMulti;
+
+use strict;
+use base qw(LJ::Widget);
+use Carp qw(croak);
+use LJ::Request;
+use URI;
+
+sub need_res { return 'stc/widgets/login.css' }
+
+sub render_body {
+    my $class = shift;
+    my %opts = @_;
+    my $ret;
+    my @errors = ();
+
+    ## Page with widget
+    my $thispage = $opts{thispage} || "$LJ::SITEROOT/identity/login.bml";
+    $thispage =~ m|^http://| 
+        or die "'thispage' param should be absolute uri";
+
+    ## Handle auth params
+    if (LJ::Request->did_post) {
+        do_login($thispage, \@errors);
+        ## where to go on success?
+        return if LJ::Request->redirected;
+    }
+
+    ## Draw widget
+    my $template = LJ::HTML::Template->new(
+        { use_expr => 1 }, # force HTML::Template::Pro with Expr support
+        filename => "$ENV{'LJHOME'}/templates/Identity/Login.tmpl",
+        die_on_bad_params => 0,
+        strict => 0,
+    ) or die "Can't open template: $!";
+
+    my $current_type = LJ::Request->post_param('type') ||
+                       LJ::Request->get_param('type')  ||
+                       $LJ::IDENTITY_TYPES[0];
+
+    ## to lj.com authorization we need to send data to https endpoint of this page
+    my $action_uri = URI->new($thispage);
+    $action_uri->scheme("https");
+    $action_uri->fragment(undef);
+    $action_uri->query(undef);
+
+    ## 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),
+                   });
+    ## external auth
+    foreach my $type (@LJ::IDENTITY_TYPES) {
+        my $idclass = LJ::Identity->find_class($type);
+        next unless $idclass->enabled;
+
+        my $type_display = {
+            'type' => $type,
+            'ml_tab_heading' => LJ::Lang::ml("/identity/login.bml.tab.$type"),
+        };
+
+        if ($type eq $current_type) {
+            $type_display->{'errors'} = [ map { { 'error' => $_ } } @errors ];
+        }
+        push @types, $type_display;
+    }
+
+    $template->param(
+        'types' => \@types,
+        'current_type' => $current_type,
+    );
+    
+    ## well cooked widget is here
+    return $template->output;
+}
+
+sub do_login {
+    my $thispage = shift;
+    my $errors = shift;
+    my $idtype = LJ::Request->post_param('type');
+
+    ## Special case: perform LJ.com login.
+    if ($idtype eq 'user'){
+        ## Determine user
+        my $username = LJ::Request->post_param('user');
+        unless ($username){
+            push @$errors => LJ::Lang::ml("/htdocs/talkpost_do.bml.error.nousername");
+            return;
+        }
+        ##
+        my $u = LJ::load_user($username);
+        unless ($u){
+            push @$errors => LJ::Lang::ml("/htdocs/talkpost_do.bml.error.badusername2", {
+                                'sitename' => $LJ::SITENAMESHORT,
+                                'aopts'    => "href='$LJ::SITEROOT/lostinfo.bml'",
+                                });
+            return;
+        }
+        ##
+        unless ($u->is_person and $u->is_visible){
+            push @$errors => LJ::Lang::ml("/identity/login.bml.user.denylogin");
+            return;
+        }
+
+
+        ## Verify
+        my $ok = LJ::auth_okay($u, LJ::Request->post_param('password'));
+        unless ($ok){
+            push @$errors => LJ::Lang::ml("/htdocs/talkpost_do.bml.error.badpassword2", {
+                                            'aopts' => "href='$LJ::SITEROOT/lostinfo.bml'",
+                                            });
+            return;
+        }
+
+        ## Init Session
+        my $exptype = (LJ::Request->post_param('remember_me') ? 'long' : 'short');
+        my $ipfixed = 0;
+        $u->make_login_session($exptype, $ipfixed);
+
+        ## 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/!;
+        LJ::Request->redirect($returnto);
+
+        return 1;
+
+    } else {
+        my $idclass = LJ::Identity->find_class($idtype);
+        if ($idclass && $idclass->enabled) {
+            $idclass->attempt_login($errors,
+                'returl_fail' => "$thispage?type=$idtype",
+                'forwhat' => 'login',
+            );
+
+            return 1 if LJ::Request->redirected;
+        } else {
+            push @$errors, 'unknown identity type';
+        }
+    }
+
+}
+
+1;

Added: trunk/htdocs/gadgets/logcom.bml
===================================================================
--- trunk/htdocs/gadgets/logcom.bml	                        (rev 0)
+++ trunk/htdocs/gadgets/logcom.bml	2010-11-22 08:32:15 UTC (rev 17736)
@@ -0,0 +1,65 @@
+<?_code
+{
+    use strict;
+    use vars qw($title);
+    use LJ::Widget::LoginMulti;
+    use LJ::ExternalComments;
+
+    my $thispage = "$LJ::SITEROOT/gadgets/logcom.bml";
+    $thispage .= "?" . LJ::Request->args;
+
+    if (my $remote = LJ::get_remote() and not $GET{viewform}){
+        ## show add comment form
+
+        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;
+        }
+
+        my $entry = LJ::Entry->new($journal, jitemid => $jitemid);
+        return 
+            LJ::Talk::talkform({ 
+                remote   => $remote,
+                journalu => $journal,
+                ditemid  => $entry->ditemid,
+                embedable_form => 1,
+                #replyto  => ,
+                #ditemid  => ,
+            });
+
+    
+    } else {
+        ## display login widget
+        LJ::need_res(qw(
+          stc/lj_base.css
+          stc/partners/login.css
+        ));
+
+        my $ret = "";
+        $ret .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
+        <html>
+        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
+        <head>
+        <title>Log in</title>
+        " . LJ::res_includes() . "
+        <body>"
+        . LJ::Widget::LoginMulti->render(thispage => $thispage)
+        ."</body></html>";
+        return $ret;
+    }
+
+}
+_code?>

Modified: trunk/htdocs/identity/login.bml
===================================================================
--- trunk/htdocs/identity/login.bml	2010-11-19 09:38:59 UTC (rev 17735)
+++ trunk/htdocs/identity/login.bml	2010-11-22 08:32:15 UTC (rev 17736)
@@ -5,6 +5,7 @@
 #line 6
     use strict;
     use vars qw($title);
+    use LJ::Widget::LoginMulti;
 
     # logged-in users don't get to here
     if (LJ::get_remote()) {
@@ -14,57 +15,8 @@
     $title = LJ::Lang::ml('.title');
 
     my $thispage = "$LJ::SITEROOT/identity/login.bml";
-    my @errors;
+    return LJ::Widget::LoginMulti->render(thispage => $thispage);
 
-    if (LJ::Request->did_post) {
-        my $idtype = LJ::Request->post_param('type');
-        my $idclass = LJ::Identity->find_class($idtype);
-
-        if ($idclass && $idclass->enabled) {
-            $idclass->attempt_login(\@errors,
-                'returl_fail' => "$thispage?type=$idtype",
-                'forwhat' => 'login',
-            );
-            return if LJ::Request->redirected;
-        } else {
-            push @errors, 'unknown identity type';
-        }
-    }
-
-    my $template = LJ::HTML::Template->new(
-        { use_expr => 1 }, # force HTML::Template::Pro with Expr support
-        filename => "$ENV{'LJHOME'}/templates/Identity/Login.tmpl",
-        die_on_bad_params => 0,
-        strict => 0,
-    ) or die "Can't open template: $!";
-
-    my $current_type = LJ::Request->post_param('type') ||
-                       LJ::Request->get_param('type')  ||
-                       $LJ::IDENTITY_TYPES[0];
-
-    my @types;
-    foreach my $type (@LJ::IDENTITY_TYPES) {
-        my $idclass = LJ::Identity->find_class($type);
-        next unless $idclass->enabled;
-
-        my $type_display = {
-            'type' => $type,
-            'ml_tab_heading' => LJ::Lang::ml(".tab.$type"),
-        };
-
-        if ($type eq $current_type) {
-            $type_display->{'errors'} = [ map { { 'error' => $_ } } @errors ];
-        }
-
-        push @types, $type_display;
-    }
-
-    $template->param(
-        'types' => \@types,
-        'current_type' => $current_type,
-    );
-
-    return $template->output;
 }
 _code?>
 <=body

Added: trunk/ssldocs/gadgets/logcom.bml
===================================================================
--- trunk/ssldocs/gadgets/logcom.bml	                        (rev 0)
+++ trunk/ssldocs/gadgets/logcom.bml	2010-11-22 08:32:15 UTC (rev 17736)
@@ -0,0 +1,65 @@
+<?_code
+{
+    use strict;
+    use vars qw($title);
+    use LJ::Widget::LoginMulti;
+    use LJ::ExternalComments;
+
+    my $thispage = "$LJ::SITEROOT/gadgets/logcom.bml";
+    $thispage .= "?" . LJ::Request->args;
+
+    if (my $remote = LJ::get_remote() and not $GET{viewform}){
+        ## show add comment form
+
+        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;
+        }
+
+        my $entry = LJ::Entry->new($journal, jitemid => $jitemid);
+        return 
+            LJ::Talk::talkform({ 
+                remote   => $remote,
+                journalu => $journal,
+                ditemid  => $entry->ditemid,
+                embedable_form => 1,
+                #replyto  => ,
+                #ditemid  => ,
+            });
+
+    
+    } else {
+        ## display login widget
+        LJ::need_res(qw(
+          stc/lj_base.css
+          stc/partners/login.css
+        ));
+
+        my $ret = "";
+        $ret .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
+        <html>
+        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
+        <head>
+        <title>Log in</title>
+        " . LJ::res_includes() . "
+        <body>"
+        . LJ::Widget::LoginMulti->render(thispage => $thispage)
+        ."</body></html>";
+        return $ret;
+    }
+
+}
+_code?>

Added: trunk/templates/CommentForm/FormEmbedable.tmpl
===================================================================
--- trunk/templates/CommentForm/FormEmbedable.tmpl	                        (rev 0)
+++ trunk/templates/CommentForm/FormEmbedable.tmpl	2010-11-22 08:32:15 UTC (rev 17736)
@@ -0,0 +1,277 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html lang="en">
+<head>
+    <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>
+</head>
+<body>
+
+	<div class="lj3-form-wrapper">
+		<form class="lj3-form lj3-post-comment lj3-active" id="postform" method="post" action="/talkpost_do.bml">
+			<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>
+                </p>
+				<p class="lj3-input-wrapper">
+					<label for="subject"><TMPL_VAR expr="ml('/talkpost.bml.opt.subject')"></label>
+					<input type="text" class="lj3-input-subject" id="subject" name="subject">
+				</p>
+				<p class="lj3-input-wrapper">
+					<label for="commenttext"><TMPL_VAR expr="ml('/talkpost.bml.opt.message')"></label>
+					<textarea name="body" id="commenttext" class="lj3-input-message" wrap="soft"></textarea>
+				</p>
+				<p class="lj3-submit-wrapper">
+					<input type="submit" value="<TMPL_VAR expr="ml('/talkpost.bml.opt.submit')">" class="lj3-submit" name="submitpost">
+				</p>
+			</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-openid.tmpl
===================================================================
--- trunk/templates/Identity/Login-openid.tmpl	2010-11-19 09:38:59 UTC (rev 17735)
+++ trunk/templates/Identity/Login-openid.tmpl	2010-11-22 08:32:15 UTC (rev 17736)
@@ -1,3 +1,11 @@
-<p class="b-auth-desc"><TMPL_VAR expr="ml('.openid.desc')"></p>
-<p class="b-auth-openid-form"><label for=""><TMPL_VAR expr="ml('.openid.label.url')"></label> <input type="url" name="openid:url" id="" value="http://" class="b-auth-openid-input" /> <button type="submit"><TMPL_VAR expr="ml('.openid.btn.login')"></button></p>
+<p class="b-auth-desc"><TMPL_VAR expr="ml('/identity/login.bml.openid.desc')"></p>
+<p class="b-auth-openid-form">
+	<span class="b-auth-input-wrapper">
+		<label for="openid_url"><TMPL_VAR expr="ml('/identity/login.bml.openid.label.url')"></label>
+		<input type="url" name="openid:url" id="openid_url" value="" class="b-auth-openid-input" />
+		<span><TMPL_VAR expr="ml('/identity/login.bml.openid.label.sample')"></span>
+	</span>
+	<button type="submit"><TMPL_VAR expr="ml('/identity/login.bml.openid.btn.login')"></button>
+</p>
 <TMPL_IF errors><TMPL_LOOP errors><p class="b-auth-error"><span class="i-message i-message-error"><TMPL_VAR error></span></p></TMPL_LOOP></TMPL_IF>
+

Added: trunk/templates/Identity/Login-user.tmpl
===================================================================
--- trunk/templates/Identity/Login-user.tmpl	                        (rev 0)
+++ trunk/templates/Identity/Login-user.tmpl	2010-11-22 08:32:15 UTC (rev 17736)
@@ -0,0 +1,15 @@
+<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" />
+	</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" />
+		<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>
+</p>
+<TMPL_IF errors><TMPL_LOOP errors><p class="b-auth-error"><span class="i-message i-message-error"><TMPL_VAR error></span></p></TMPL_LOOP></TMPL_IF>
+

Modified: trunk/templates/Identity/Login.tmpl
===================================================================
--- trunk/templates/Identity/Login.tmpl	2010-11-19 09:38:59 UTC (rev 17735)
+++ trunk/templates/Identity/Login.tmpl	2010-11-22 08:32:15 UTC (rev 17736)
@@ -15,7 +15,7 @@
         <TMPL_ELSE>
             <li id="tab-<TMPL_VAR type>" class="b-auth-item" style="display:none">
         </TMPL_IF>
-            <form action="" method="post">
+            <form action="<tmpl_var action>" method="post">
                 <TMPL_INCLUDE expr="sprintf('templates/Identity/Login-%s.tmpl', type)">
                 <input type="hidden" name="type" value="<TMPL_VAR type>" />
             </form>

Tags: bml, livejournal, pm, tmpl, vadvs
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