4 |
5 | ---
6 |
7 | [](https://github.com/LukyVj/gitShare/releases/tag/1.4)
8 |
9 | gitShare is a small but efficient Chrome extension, that allows to share any github project directly on Twitter or Facebook.
10 |
11 | ## Install
12 | - Clone this repo or grab the last [release](https://github.com/LukyVj/gitShare/releases/tag/1.4)
13 | - Go to `chrome://extensions/`
14 | - If it's not already done, check the checkbox "Developer mode"
15 | - Click on "Load unpacked extension"
16 | - Open the the `gitShare/extension` folder
17 | - And it's done !
18 |
19 |
20 | ## Now what ?
21 | Now just browse github, and each time you'll be in a github repository, you will see this new "Share" button !
22 |
23 | The share buttons looks like this :
24 |
25 | 
26 |
27 | ## Example
28 | 
29 |
30 | ## How to actually share ?
31 | I did a video to show you how it works :
32 | 
33 |
34 | ## Final words
35 | This extenstion exists because : __Sharing is caring__.
36 |
37 | And as web-people, we should support projects that we do like / use.
38 |
39 | ---
40 |
41 | ## Help
42 | I'm a huge fan of open source projects, communities and team work, that's why I encourage you to [fork](https://github.com/LukyVj/gitShare#fork-destination-box) this project, and improve it or make it for an other browser.
43 |
44 | ## The extension for everyone
45 |
46 | - [@JohJakob](https://github.com/JohJakob) created a [Safari version](https://github.com/JohJakob/gitShare-Safari) of the extension.
47 | - ... Yours ? ...
48 |
49 | ## Resources
50 | You can find different versions of the logo on the `assets/` folder.
51 |
52 | ## Credits
53 | Original [octopus icon](https://thenounproject.com/search/?q=octopus&i=901) by [Carol Costa](https://thenounproject.com/carol/), from the Noun Project.
54 |
55 |
--------------------------------------------------------------------------------
/assets/githsare_logo_svg.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/assets/icon128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LukyVj/gitShare/04d4bcc9ba1de93b9ab57373e8015781c7440903/assets/icon128.png
--------------------------------------------------------------------------------
/assets/icon16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LukyVj/gitShare/04d4bcc9ba1de93b9ab57373e8015781c7440903/assets/icon16.png
--------------------------------------------------------------------------------
/assets/icon256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LukyVj/gitShare/04d4bcc9ba1de93b9ab57373e8015781c7440903/assets/icon256.png
--------------------------------------------------------------------------------
/assets/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LukyVj/gitShare/04d4bcc9ba1de93b9ab57373e8015781c7440903/assets/icon48.png
--------------------------------------------------------------------------------
/extension/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifest_version": 2,
3 |
4 | "name": "Github share",
5 | "description": "This extension adds a small Twitter & Facebook share buttons on top of the github repo you're currently looking at.",
6 | "version": "1.4",
7 |
8 | "permissions": ["tabs", "*://*.github.com/*"],
9 | "content_scripts": [
10 | {
11 | "matches": ["*://*.github.com/*"],
12 | "js": ["share.js"]
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/extension/share.js:
--------------------------------------------------------------------------------
1 | var b = document.body;
2 | var h = document.querySelector('.pagehead.repohead .pagehead-actions');
3 | var p_d = document.querySelector('.repository-description');
4 | var fbUrl = 'http://github.com'+document.location.pathname;
5 |
6 | var fbSDK = "";
7 | var initSdk = document.createElement('script');
8 | initSdk.innerHTML = "window.fbAsyncInit = function() { FB.init({ appId : '1510342319283371', xfbml : true, version : 'v2.5' }); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = \"https://connect.facebook.net/en_US/sdk.js\"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));";
9 |
10 | var d = '%20';
11 | if(p_d){
12 | var d = p_d.innerText + '%20';
13 | var d = '%20' + d;
14 | }
15 |
16 | var sh_link_tt = "https://twitter.com/intent/tweet?text=" + document.title + "%20-" + d + document.location;
17 | var sh_link_fb = "https://www.facebook.com/sharer/sharer.php?u=" + fbUrl;
18 |
19 | h.innerHTML += '