Permalink
Browse files

add sponsor

  • Loading branch information...
1 parent 4495d82 commit 0ad07be82a8c1443bf4e8600ab6b20c606575e05 @flyerhzm committed Nov 4, 2012
Showing with 35 additions and 2 deletions.
  1. +9 −2 _layouts/default.html
  2. +14 −0 javascripts/referal.js
  3. +12 −0 stylesheets/screen.css
View
@@ -8,8 +8,6 @@
<link rel="stylesheet" type="text/css" href="/stylesheets/screen.css">
<link rel="stylesheet" type="text/css" href="/stylesheets/GitHubWidget.css">
<link href="http://feeds.feedburner.com/richard-huang" rel="alternate" title="RSS" type="application/rss+xml" />
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script type="text/javascript" src="/javascripts/GitHubWidget.js"></script>
</head>
<body>
@@ -61,6 +59,11 @@ <h2 class="widget-title">About</h2>
<div id="carrington-github" class="widget">
<iframe src="http://githubbadge.appspot.com/badge/flyerhzm" style="border: 0;height: 142px;width: 200px;overflow: hidden;" frameBorder=0></iframe>
</div>
+ <div id="carrington-referrals" class="widget">
+ <div class="referrals">
+ <h2 class="widget-title">Sponsors</h2>
+ </div>
+ </div>
<div id="primary-sidebar">
<div class="widget">
<h2 class="widget-title">Categories</h2>
@@ -111,6 +114,10 @@ <h2 class="widget-title">Archives</h2>
</div>
<a href="https://github.com/flyerhzm"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
+ <script type="text/javascript" src="/javascripts/GitHubWidget.js"></script>
+ <script type="text/javascript" src="/javascripts/referal.js"></script>
+
<!-- begin olark code -->
<script data-cfasync="false" type='text/javascript'>/*{literal}<![CDATA[*/
window.olark||(function(c){var f=window,d=document,l=f.location.protocol=="https:"?"https:":"http:",z=c.name,r="load";var nt=function(){f[z]=function(){(a.s=a.s||[]).push(arguments)};var a=f[z]._={},q=c.methods.length;while(q--){(function(n){f[z][n]=function(){f[z]("call",n,arguments)}})(c.methods[q])}a.l=c.loader;a.i=nt;a.p={0:+new Date};a.P=function(u){a.p[u]=new Date-a.p[0]};function s(){a.P(r);f[z](r)}f.addEventListener?f.addEventListener(r,s,false):f.attachEvent("on"+r,s);var ld=function(){function p(hd){hd="head";return["<",hd,"></",hd,"><",i,' onl' + 'oad="var d=',g,";d.getElementsByTagName('head')[0].",j,"(d.",h,"('script')).",k,"='",l,"//",a.l,"'",'"',"></",i,">"].join("")}var i="body",m=d[i];if(!m){return setTimeout(ld,100)}a.P(1);var j="appendChild",h="createElement",k="src",n=d[h]("div"),v=n[j](d[h](z)),b=d[h]("iframe"),g="document",e="domain",o;n.style.display="none";m.insertBefore(n,m.firstChild).id=z;b.frameBorder="0";b.id=z+"-loader";if(/MSIE[ ]+6/.test(navigator.userAgent)){b.src="javascript:false"}b.allowTransparency="true";v[j](b);try{b.contentWindow[g].open()}catch(w){c[e]=d[e];o="javascript:var d="+g+".open();d.domain='"+d.domain+"';";b[k]=o+"void(0);"}try{var t=b.contentWindow[g];t.write(p());t.close()}catch(x){b[k]=o+'d.write("'+p().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}a.P(2)};ld()};nt()})({loader: "static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]});
@@ -0,0 +1,14 @@
+$(function() {
+ return $.getJSON("http://referral.herokuapp.com/websites/9/refs?name=web&jsoncallback=?", function(refs) {
+ var $referrals;
+ $referrals = $(".referrals");
+ return $.each(refs, function(i, ref) {
+ var $img, $link, $referral, $text;
+ $img = $("<img/>").attr("src", ref.image_url);
+ $link = $("<a/>").attr("href", "http://referral.herokuapp.com/websites/9/refs/" + ref.id + "?name=web").text(ref.title);
+ $text = $("<p/>").text(ref.description);
+ $referral = $("<div/>").addClass("referral");
+ return $referral.append($img).append($link).append($text).appendTo($referrals);
+ });
+ });
+});
@@ -848,6 +848,18 @@ h2.widget-title,
margin-left: 26px;
}
+.referral {
+ margin-bottom: 10px;
+ clear: both;
+}
+.referral img {
+ float: left;
+ margin: 5px;
+}
+.referral a {
+ font-weight: bold;
+}
+
/* Misc
=================================== */

0 comments on commit 0ad07be

Please sign in to comment.