Skip to content
This repository has been archived by the owner on May 17, 2020. It is now read-only.

Commit

Permalink
Facebook tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tresni committed Dec 31, 2012
1 parent 8a9266f commit 23e3e7e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
18 changes: 12 additions & 6 deletions jquery.oembed.css
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,21 @@ div.oembedall-container {
text-decoration:none;
}



.oembedall-facebookBody{
.oembedall-facebookBody {
background-color: #fff;


vertical-align: top;
padding: 5px;
}

.oembedall-facebookBody .contents {
display: inline-block;
width: 100%;
}

.oembedall-facebookBody div{ display:inline-block;vertical-align: top;}
.oembedall-facebookBody div img {
float: left;
margin-right: 5px;
}

div.oembedall-lanyard{
-webkit-box-shadow: none;
Expand Down
24 changes: 14 additions & 10 deletions jquery.oembed.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,17 +667,21 @@
new $.fn.oembed.OEmbedProvider("facebook", "rich", ["facebook.com/(people/[^\\/]+/\\d+|[^\\/]+$)"], "https://graph.facebook.com/$2$3/?callback=?"
,{templateRegex:/.*facebook.com\/(people\/[^\/]+\/(\d+).*|([^\/]+$))/,
templateData : function(data){ if(!data.id)return false;
var out = '<div class="oembedall-facebook1"><div class="oembedall-facebook2"><a href="http://www.facebook.com/">facebook</a> '
if(data.link) out += '<a href="'+data.link+'">'+data.name+'</a>';
var out = '<div class="oembedall-facebook1"><div class="oembedall-facebook2"><a href="http://www.facebook.com/">facebook</a> ';
if(data.from) out += '<a href="http://www.facebook.com/'+data.from.id+'">'+data.from.name+'</a>';
else if(data.link) out += '<a href="'+data.link+'">'+data.name+'</a>';
else if(data.username) out += '<a href="http://www.facebook.com/'+data.username+'">'+data.name+'</a>';
else if(data.id) out += '<a href="http://www.facebook.com/'+data.id+'">'+data.name+'</a>';
else out += data.name;
out += '</div><div class="oembedall-facebookBody"><div>';
if(data.picture) out += '<img src="'+data.picture+'" align="left"></div><div>';
if(data.category) out += 'Category <strong>'+data.category+'</strong><br/>';
if(data.website) out += 'Website <strong>'+data.website+'</strong><br/>';
if(data.gender) out += 'Gender <strong>'+data.gender+'</strong><br/>';
out += '</div></div></div>';
else out += '<a href="http://www.facebook.com/'+data.id+'">'+data.name+'</a>';
out += '</div><div class="oembedall-facebookBody"><div class="contents">';
if(data.picture) out += '<a href="'+data.link+'"><img src="'+data.picture+'"></a>';
else out += '<img src="https://graph.facebook.com/'+data.id+'/picture">';
if(data.from) out += '<a href="'+data.link+'">'+data.name+'</a>';
if(data.founded) out += 'Founded: <strong>'+data.founded+'</strong><br>'
if(data.category) out += 'Category: <strong>'+data.category+'</strong><br>';
if(data.website) out += 'Website: <strong><a href="'+data.website+'">'+data.website+'</a></strong><br>';
if(data.gender) out += 'Gender: <strong>'+data.gender+'</strong><br>';
if(data.description) out += data.description + '<br>';
out += '</div></div>';
return out;
}
}),
Expand Down

0 comments on commit 23e3e7e

Please sign in to comment.