Alexander Nazarov (nfokz) wrote in changelog,
Alexander Nazarov
nfokz
changelog

[livejournal] r23143: LJSUP-13593: Add new button for lj-like ...

Committer: anazarov
LJSUP-13593: Add new button for lj-like (surfingbird)
U   trunk/htdocs/js/livejournal.js
Modified: trunk/htdocs/js/livejournal.js
===================================================================
--- trunk/htdocs/js/livejournal.js	2012-10-16 07:01:51 UTC (rev 23142)
+++ trunk/htdocs/js/livejournal.js	2012-10-16 07:46:08 UTC (rev 23143)
@@ -455,6 +455,28 @@
 		.insertBefore(link));
 	});
 
+	jQuery('a.surfinbird__like_button', ctx || document).each(function () {
+		if (this.href !== 'http://surfingbird.ru/share') {
+			return;
+		}
+
+		var link = jQuery(this),
+			params = {
+				url: link.attr('data-url'),
+				caption: link.attr('data-text'),
+				layout: 'common'
+			},
+			iframe = jQuery('<iframe frameborder="0" scrollin="no" allowtransparency="true" />')
+				.css({
+					width: '110px',
+					height: '20px'
+				})
+				.attr('src', LiveJournal.constructUrl('http://surfingbird.ru/button', params))
+				.insertBefore(link)
+
+		link.replaceWith(iframe);
+	});
+
 	jQuery('div.lj-like-item-repost > a', ctx || document).each(function() {
 		var link = jQuery(this),
 			url = link.data('url');
@@ -767,4 +789,4 @@
 
 };
 
-LiveJournal.widgetEvents = {};
\ No newline at end of file
+LiveJournal.widgetEvents = {};

Tags: anazarov, js, livejournal, nfokz
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