alf (red_alf) wrote in changelog,
alf
red_alf
changelog

[livejournal] r19068: LJSUP-8689: Donate button

Committer: afedorov
LJSUP-8689: Donate button

U   trunk/cgi-bin/LJ/S2.pm
U   trunk/cgi-bin/LJ/Talk.pm
Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm	2011-05-17 11:08:07 UTC (rev 19067)
+++ trunk/cgi-bin/LJ/S2.pm	2011-05-18 02:43:50 UTC (rev 19068)
@@ -3986,7 +3986,14 @@
                     "$LJ::SITEROOT/shop/tokens.bml" :
                     "$LJ::SITEROOT/give_tokens.bml?journal=$journal&itemid=$this->{itemid}";
     my $give_count = $entry->prop('give_count') || 0;
-    my $give_button = '<span class="lj-button light">
+    my $give_button = '<script type="text/javascript">
+                        jQuery.extend(DonateButton, {
+                            ml_confirm_message: \''.BML::ml('/give_tokens.bml.confirm.submit.body', { 'give_count' => $LJ::GIVE_TOKENS, 'poster' => $entry->poster->user }).'\',
+                            have_tokens: '.(($remote_balance < $LJ::GIVE_TOKENS) ? 'false' : 'true' ).',
+                            lj_form_auth: "'.LJ::form_auth('raw').'"
+                        })
+                       </script> 
+                       <span class="lj-button light">
                        <span class="lj-button-wrapper">
                        <a class="lj-button-link" href="'.$give_link.'">
                        <span class="lj-button-a"><span class="lj-button-b">'.$LJ::GIVE_TOKENS.' <img src="'.$LJ::IMGPREFIX.'/icons/donate.png" /></span><span class="lj-button-c">'.($give_count ? BML::ml('give_features.given', {'count' => $give_count}) : BML::ml('give_features.give')).'</span></span>

Modified: trunk/cgi-bin/LJ/Talk.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk.pm	2011-05-17 11:08:07 UTC (rev 19067)
+++ trunk/cgi-bin/LJ/Talk.pm	2011-05-18 02:43:50 UTC (rev 19068)
@@ -170,7 +170,14 @@
                         "$LJ::SITEROOT/shop/tokens.bml" :
                         "$LJ::SITEROOT/give_tokens.bml?${jarg}itemid=$itemid";
         my $give_count = $entry->prop('give_count') || 0;
-        my $give_button = '<span class="lj-button light">
+        my $give_button = '<script type="text/javascript">
+                            jQuery.extend(DonateButton, {
+                                ml_confirm_message: \''.BML::ml('/give_tokens.bml.confirm.submit.body', { 'give_count' => $LJ::GIVE_TOKENS, 'poster' => $entry->poster->user }).'\',
+                                have_tokens: '.(($remote_balance < $LJ::GIVE_TOKENS) ? 'false' : 'true' ).',
+                                lj_form_auth: "'.LJ::form_auth('raw').'"
+                            })
+                           </script> 
+                           <span class="lj-button light">
                            <span class="lj-button-wrapper">
                            <a class="lj-button-link" href="'.$give_link.'">
                            <span class="lj-button-a"><span class="lj-button-b">'.$LJ::GIVE_TOKENS.' <img src="'.$LJ::IMGPREFIX.'/icons/donate.png" /></span><span class="lj-button-c">'.($give_count ? BML::ml('give_features.given', {'count' => $give_count}) : BML::ml('give_features.give')).'</span></span>

Tags: livejournal, pm, red_alf
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