mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-12-25 08:58:58 -05:00
Added styling for github follow button, improved javascripts for adding GitHub and Twitter sidebars
This commit is contained in:
parent
d37c1babc7
commit
5528f9acec
@ -11,7 +11,6 @@
|
|||||||
width: image-width($img);
|
width: image-width($img);
|
||||||
height: image-height($img);
|
height: image-height($img);
|
||||||
position: absolute; left: 3px;
|
position: absolute; left: 3px;
|
||||||
top: 3px;
|
|
||||||
}
|
}
|
||||||
} @else if $icon {
|
} @else if $icon {
|
||||||
padding-left: icon-sprite-width($icon) + 6px;
|
padding-left: icon-sprite-width($icon) + 6px;
|
||||||
@ -19,7 +18,6 @@
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
@extend .icon-#{$icon};
|
@extend .icon-#{$icon};
|
||||||
position: absolute; left: 3px;
|
position: absolute; left: 3px;
|
||||||
top: 3px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -67,12 +65,18 @@
|
|||||||
.googleplus-share {
|
.googleplus-share {
|
||||||
@extend .simple-social-button;
|
@extend .simple-social-button;
|
||||||
@include social-button-bg('googleplus', #db583b);
|
@include social-button-bg('googleplus', #db583b);
|
||||||
|
&:before { top: 5px; }
|
||||||
}
|
}
|
||||||
.facebook-share {
|
.facebook-share {
|
||||||
@extend .simple-social-button;
|
@extend .simple-social-button;
|
||||||
@include social-button-bg('facebook', #4e5a9b);
|
@include social-button-bg('facebook', #4e5a9b);
|
||||||
|
&:before { top: 3px; }
|
||||||
}
|
}
|
||||||
.twitter-share, .sidebar a.twitter-follow-button {
|
.twitter-share, .sidebar a.twitter-follow-button {
|
||||||
@extend .simple-social-button;
|
@extend .simple-social-button;
|
||||||
@include social-button-bg('twitter');
|
@include social-button-bg('twitter');
|
||||||
}
|
}
|
||||||
|
.sidebar .github-follow {
|
||||||
|
@extend .simple-social-button;
|
||||||
|
@include social-button-bg('github');
|
||||||
|
}
|
||||||
|
@ -5,3 +5,9 @@
|
|||||||
{% include twitter_sharing.html %}
|
{% include twitter_sharing.html %}
|
||||||
{% endunless %}
|
{% endunless %}
|
||||||
{% include custom/after_footer.html %}
|
{% include custom/after_footer.html %}
|
||||||
|
{% if site.github_user %}
|
||||||
|
<script src="{{ root_url }}/javascripts/github.js" type="text/javascript"></script>
|
||||||
|
{% endif %}
|
||||||
|
{% if site.twitter_user %}
|
||||||
|
<script src="{{ root_url }}/javascripts/twitter.js" type="text/javascript"> </script>
|
||||||
|
{% endif %}
|
||||||
|
@ -1,30 +1,11 @@
|
|||||||
{% if site.github_user %}
|
{% if site.github_user %}
|
||||||
<section>
|
<section>
|
||||||
<h1>GitHub Repos</h1>
|
<h1>On GitHub</h1>
|
||||||
<ul id="gh_repos">
|
<ul id="gh_repos" data-user="{{site.github_user}}" data-count="{{site.github_repo_count}}" data-skip="{{site.github_skip_forks}}">
|
||||||
<li class="loading">Status updating...</li>
|
<li class="loading">Status updating...</li>
|
||||||
</ul>
|
</ul>
|
||||||
{% if site.github_show_profile_link %}
|
{% if site.github_show_profile_link %}
|
||||||
<a href="https://github.com/{{site.github_user}}">@{{site.github_user}}</a> on GitHub
|
<a class="github-follow" href="https://github.com/{{site.github_user}}">Follow @{{site.github_user}}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function(){
|
|
||||||
if (!window.jXHR){
|
|
||||||
var jxhr = document.createElement('script');
|
|
||||||
jxhr.type = 'text/javascript';
|
|
||||||
jxhr.src = '{{ root_url}}/javascripts/libs/jXHR.js';
|
|
||||||
var s = document.getElementsByTagName('script')[0];
|
|
||||||
s.parentNode.insertBefore(jxhr, s);
|
|
||||||
}
|
|
||||||
|
|
||||||
github.showRepos({
|
|
||||||
user: '{{site.github_user}}'
|
|
||||||
, count: {{site.github_repo_count}}
|
|
||||||
, skip_forks: {{site.github_skip_forks}}
|
|
||||||
, target: '#gh_repos'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<script src="{{ root_url }}/javascripts/github.js" type="text/javascript"></script>
|
|
||||||
</section>
|
</section>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,19 +1,9 @@
|
|||||||
{% if site.twitter_user %}
|
{% if site.twitter_user %}
|
||||||
<section>
|
<section>
|
||||||
<h1>Latest Tweets</h1>
|
<h1>Latest Tweets</h1>
|
||||||
<ul id="tweets">
|
<ul id="tweets" data-user="{{site.twitter_user}}" data-count="{{site.twitter_tweet_count}}" data-replies="{{site.twitter_show_replies}}">
|
||||||
<li class="loading">Status updating...</li>
|
<li class="loading">Status updating...</li>
|
||||||
</ul>
|
</ul>
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function(){
|
|
||||||
twitter.getFeed({
|
|
||||||
user: "{{site.twitter_user}}"
|
|
||||||
, count: {{site.twitter_tweet_count}}
|
|
||||||
, replies: {{site.twitter_show_replies}}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<script src="{{ root_url }}/javascripts/twitter.js" type="text/javascript"> </script>
|
|
||||||
{% if site.twitter_follow_button %}
|
{% if site.twitter_follow_button %}
|
||||||
<a href="http://twitter.com/{{ site.twitter_user }}" class="twitter-follow-button" data-show-count="{{ site.twitter_show_follower_count }}">Follow @{{ site.twitter_user }}</a>
|
<a href="http://twitter.com/{{ site.twitter_user }}" class="twitter-follow-button" data-show-count="{{ site.twitter_show_follower_count }}">Follow @{{ site.twitter_user }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 568 B |
BIN
.themes/classic/source/images/icon/github.png
Normal file
BIN
.themes/classic/source/images/icon/github.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 398 B |
@ -1,18 +1,18 @@
|
|||||||
var github = (function(){
|
var github = (function(){
|
||||||
function render(target, repos){
|
function render(target, data){
|
||||||
var i = 0, fragment = '', t = $(target)[0];
|
var i = 0, repos = '';
|
||||||
|
|
||||||
for(i = 0; i < repos.length; i++) {
|
for(i = 0; i < data.length; i++) {
|
||||||
fragment += '<li><a href="'+repos[i].html_url+'">'+repos[i].name+'</a><p>'+repos[i].description+'</p></li>';
|
repos += '<li><a href="'+data[i].html_url+'">'+data[i].name+'</a><p>'+data[i].description+'</p></li>';
|
||||||
}
|
}
|
||||||
t.innerHTML = fragment;
|
target.html(repos);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
showRepos: function(options){
|
showRepos: function(options){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "https://api.github.com/users/"+options.user+"/repos?callback=?"
|
url: "https://api.github.com/users/"+options.user+"/repos?callback=?"
|
||||||
, dataType: 'jsonp'
|
, dataType: 'jsonp'
|
||||||
, error: function (err) { $(options.target + ' li.loading').addClass('error').text("Error loading feed"); }
|
, error: function (err) { options.target.find('.loading').addClass('error').text("Error loading feed"); }
|
||||||
, success: function(data) {
|
, success: function(data) {
|
||||||
var repos = [];
|
var repos = [];
|
||||||
if (!data.data) { return; }
|
if (!data.data) { return; }
|
||||||
@ -35,3 +35,14 @@ var github = (function(){
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
g = $('#gh_repos');
|
||||||
|
|
||||||
|
github.showRepos({
|
||||||
|
user: g.attr('data-user')
|
||||||
|
, count: parseInt(g.attr('data-count'))
|
||||||
|
, skip_forks: g.attr('data-skip') == 'true'
|
||||||
|
, target: g
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@ -72,7 +72,8 @@ var twitter = (function(){
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
getFeed: function(options){
|
getFeed: function(options){
|
||||||
count = parseInt(options.count, 10);
|
count = options.count;
|
||||||
|
console.log(options);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "http://api.twitter.com/1/statuses/user_timeline/" + options.user + ".json?trim_user=true&count=" + (count + 20) + "&include_entities=1&exclude_replies=" + (options.replies ? "0" : "1") + "&callback=?"
|
url: "http://api.twitter.com/1/statuses/user_timeline/" + options.user + ".json?trim_user=true&count=" + (count + 20) + "&include_entities=1&exclude_replies=" + (options.replies ? "0" : "1") + "&callback=?"
|
||||||
, dataType: 'jsonp'
|
, dataType: 'jsonp'
|
||||||
@ -82,3 +83,12 @@ var twitter = (function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
t = $('#tweets');
|
||||||
|
twitter.getFeed({
|
||||||
|
user: t.attr('data-user')
|
||||||
|
, count: parseInt(t.attr('data-count'), 10)
|
||||||
|
, replies: t.attr('data-replies') == 'true'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user