diff options
author | Samrat Man Singh <samratmansingh@gmail.com> | 2012-07-07 08:28:26 +0545 |
---|---|---|
committer | Samrat Man Singh <samratmansingh@gmail.com> | 2012-07-07 08:28:26 +0545 |
commit | 705357519b7345422a003d8970d1f396579d91b2 (patch) | |
tree | ed3cf3a3bfbc65252417ac9125d55080a45cb192 /syte-pelican/static/js/components/links.js | |
parent | 3ba3e785dc4d84a069622d9138761ff7967c7316 (diff) | |
download | pelican-themes-705357519b7345422a003d8970d1f396579d91b2.tar.gz |
Add syte-pelican, a theme based on Syte
Diffstat (limited to 'syte-pelican/static/js/components/links.js')
-rw-r--r-- | syte-pelican/static/js/components/links.js | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/syte-pelican/static/js/components/links.js b/syte-pelican/static/js/components/links.js new file mode 100644 index 0000000..0671f6a --- /dev/null +++ b/syte-pelican/static/js/components/links.js @@ -0,0 +1,67 @@ + +function setupLinks() { + + $('a').click(function(e) { + e.preventDefault(); + e.stopPropagation(); + + var url = $.url(this.href.replace('/#!', '')); + + if (this.id == 'home-link' && window.location.pathname == '/') { + $('#github-profile').remove(); + $('#dribbble-profile').remove(); + $('#twitter-profile').remove(); + $('#instagram-profile').remove(); + $('.modal-backdrop').remove(); + adjustSelection('home-link'); + } + else if(this.id == 'instagram-link' && instagram_integration_enabled) { + $('#github-profile').remove(); + $('#dribbble-profile').remove(); + $('#twitter-profile').remove(); + $('.modal-backdrop').remove(); + adjustSelection('instagram-link'); + + setupInstagram(this); + } + else if (twitter_integration_enabled && (url.attr('host') == 'twitter.com' || url.attr('host') == 'www.twitter.com')) { + + $('#github-profile').remove(); + $('#dribbble-profile').remove(); + $('#instagram-profile').remove(); + $('.modal-backdrop').remove(); + adjustSelection('twitter-link'); + + setupTwitter(url, this); + } + else if (github_integration_enabled && (url.attr('host') == 'github.com' || url.attr('host') == 'www.github.com')) { + + $('#twitter-profile').remove(); + $('#dribbble-profile').remove(); + $('#instagram-profile').remove(); + $('.modal-backdrop').remove(); + adjustSelection('github-link'); + + setupGithub(url, this); + } + else if (dribbble_integration_enabled && (url.attr('host') == 'dribbble.com' || url.attr('host') == 'www.dribbble.com')) { + + $('#twitter-profile').remove(); + $('#github-profile').remove(); + $('#instagram-profile').remove(); + $('.modal-backdrop').remove(); + adjustSelection('dribbble-link'); + + setupDribbble(url, this); + } + else { + window.location = this.href; + } + }); +} + +function adjustSelection(el) { + $('.main-nav').children('li').removeClass('sel'); + $('#' + el).parent().addClass('sel'); +} + |