Created
September 30, 2015 14:09
-
-
Save amobiz/0c74f9c72bde9afd1780 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
//<![CDATA[ | |
/* Add GitHub Ribbons */ | |
(function(options) { | |
var el, href, pos; | |
if (location.pathname==='/') { | |
href = options.home; | |
} | |
else { | |
el = document.querySelector('*[data-forkme]'); | |
if (el) { | |
href = el.getAttribute('data-forkme'); | |
} | |
} | |
pos = options.position || 'right'; | |
if (href) { | |
el = document.createElement('div'); | |
el.innerHTML = '<a href="' + href + '"><img style="display: block; position: fixed; top: 0; ' + pos + ': 0; border: 0; background:none; border-radius:0; box-shadow:none; padding:0; z-index: 9999;" src="' + options.src + '" alt="Fork me on GitHub" data-canonical-src="' + options.canonicalSrc + '"></a>'; | |
el.style.cssText = 'padding:0; margin:0; background-color:none;'; | |
document.body.appendChild(el); | |
} | |
})({ | |
home: 'https://github.com/amobiz', | |
src: 'https://camo.githubusercontent.com/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67', | |
canonicalSrc: 'https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png', | |
position: 'right' | |
}); | |
//]]> | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment