[Slashdotjp-dev 893] [410] Add feature: sending title for badge.js

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 1月 11日 (金) 16:48:34 JST


Revision: 410
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=410
Author:   tach
Date:     2008-01-11 16:48:34 +0900 (Fri, 11 Jan 2008)

Log Message:
-----------
Add feature: sending title for badge.js

Modified Paths:
--------------
    slashjp/trunk/debian/changelog
    slashjp/trunk/themes/slashcode/htdocs/badge.js
    slashjp/trunk/themes/slashcode/htdocs/badge.pl


-------------- next part --------------
Modified: slashjp/trunk/debian/changelog
===================================================================
--- slashjp/trunk/debian/changelog	2008-01-07 08:31:09 UTC (rev 409)
+++ slashjp/trunk/debian/changelog	2008-01-11 07:48:34 UTC (rev 410)
@@ -2,8 +2,9 @@
 
   * Fix to use correct db object at
     plugins/Moderation/process_moderation.pl line 144
+  * Add feature: sending title for badge.js
 
- -- Taku YASUI <tach****@debia*****>  Mon, 31 Dec 2007 16:44:52 +0900
+ -- Taku YASUI <tach****@debia*****>  Fri, 11 Jan 2008 16:47:42 +0900
 
 slash (2.5.0.188-5) unstable; urgency=low
 

Modified: slashjp/trunk/themes/slashcode/htdocs/badge.js
===================================================================
--- slashjp/trunk/themes/slashcode/htdocs/badge.js	2008-01-07 08:31:09 UTC (rev 409)
+++ slashjp/trunk/themes/slashcode/htdocs/badge.js	2008-01-11 07:48:34 UTC (rev 410)
@@ -2,13 +2,14 @@
   function() {
     var url = encodeURIComponent(window.[% sitename %]_url || window.location.href);
     var sty = window.[% sitename %]_badge_style || 'h0';
+    var title = window.[% sitename %]_title || document.title;
     var dx=130, dy=25;
     if ( sty[0]=='v' ) {
       dx=52;
       dy=80;
     }
     
-    var iframe = '<iframe src="http://[% basedomain %]/badge.pl?style=' + sty + '&url=' + url + '"' +
+    var iframe = '<iframe src="http://[% basedomain %]/badge.pl?style=' + sty + '&url=' + url + '&amp;title=' + title + '"' +
                   ' height="' + dy + '" width="' + dx + '" scrolling="no" frameborder="0"></iframe>'
     document.write(iframe);
   }

Modified: slashjp/trunk/themes/slashcode/htdocs/badge.pl
===================================================================
--- slashjp/trunk/themes/slashcode/htdocs/badge.pl	2008-01-07 08:31:09 UTC (rev 409)
+++ slashjp/trunk/themes/slashcode/htdocs/badge.pl	2008-01-11 07:48:34 UTC (rev 410)
@@ -102,6 +102,7 @@
 sub display {
 	my ($form, $slashdb, $user, $constants) = @_;
 	my $url = $form->{url};
+	my $title = $form->{title} ? $form->{title} : '';
 	my $style = 'v0';
 	
 	if ($form->{style} =~ m/^([hv][01])/i) {
@@ -124,6 +125,7 @@
 	slashDisplay('main', {
 		style => $style,
 		url => $url,
+		title => $title,
 		fireHoseId => $fh_id,
 		voted => $voted
 	}, {Page => 'badge'});


Slashdotjp-dev メーリングリストの案内
Back to archive index