Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated readme

  • Loading branch information...
commit 3e9a5de9ca1d69c9ca3947ff7e41741d27c4bc18 1 parent 8316e94
@chrismatthieu authored
Showing with 41 additions and 11 deletions.
  1. +18 −0 README.rdoc
  2. +20 −8 contentscript.js
  3. +3 −3 manifest.json
View
18 README.rdoc
@@ -0,0 +1,18 @@
+== GitHub Chat
+
+This is a Chrome Extension for adding chat to an issues page on Github.
+
+== Installation Instructions
+
+- Open Chrome browser
+- Navigate to chrome://extensions/
+- Click on (+) Developer Mode
+- Click on Load unpacked extension
+- Navigate to your local instance of this code
+
+== Usage Instructions
+
+- Navigate to any repo's issues page i.e. https://github.com/nodester/nodester/issues
+- You should see a new Chat button next to the New Issue button.
+- Clicking Chat should open a new window with Chats.io directed to a chat room of the Repo name. This is a global chatroom for all of the repo's activity.
+
View
28 contentscript.js
@@ -1,13 +1,10 @@
-// var regex = /[01]?[- .]?\(?[2-9]\d{2}\)?[- .]?\d{3}[- .]?\d{4}/g;
-// var regex = /1?[- .]?\(?[2-9]\d{2}\)?[- .]?\d{3}[- .]?\d{4}/g;
-// var regex = /[>\s]1?[- \.]?\(?[2-9]\d{2}\)?[- \.]?\d{3}[- \.]?\d{4}[<\s]/g;
-// var regex = /[>\s]1?[- \.]?\(?[2-9]\d{2}\)?[- \.]?\d{3}[- \.]?\d{4}/g;
-var regex = /[\s]1?[- \.]?\(?[2-9]\d{2}\)?[- \.]?\d{3}[- \.]?\d{4}/g;
+var regex = /<span><span class=\"icon\"><\/span>New Issue<\/span><\/a>/g;
var page;
var hits;
+var repo;
// Test the text of the body element against our regular expression.
-if (regex.test(document.body.innerText)) {
+if (regex.test(document.documentElement.innerHTML)) {
// The regular expression produced a match, so notify the background page.
// page = document.body.innerHTML;
@@ -16,8 +13,23 @@ if (regex.test(document.body.innerText)) {
hits = page.match(regex);
for (var i = 0; i < hits.length; i += 1) {
- // page = page.replace(hits[i], '<a href="http://phonophone.heroku.com?phone=' + trimString(hits[i]) + '">' + hits[i] + '</a>');
- page = page.replace(hits[i], '<a href="#" onclick="javascript:window.open(\'http://phonophone.heroku.com?phone=' + trimString(hits[i]) + '\' , \'popup_id\', \'scrollbars,resizable,width=350,height=400\')">' + hits[i] + '</a>');
+
+ // find the repo name i.e. GitHub.repoName = "nodester"
+ var re1='(GitHub\\.repoName)'; // Fully Qualified Domain Name 1
+ var re2='.*?'; // Non-greedy match on filler
+ var re3='((?:[a-z][a-z0-9_]*))'; // Variable Name 1
+
+ var p = new RegExp(re1+re2+re3,["i"]);
+ var m = p.exec(page);
+ if (m != null)
+ {
+ var fqdn1=m[1];
+ repo=m[2];
+ }
+
+
+
+ page = page.replace(hits[i], '<span><span class="icon"></span>New Issue</span></a></li><li class><a href="#" onclick="javascript:window.open(\'http://chats.io/' + repo + '\', \'popup_id\', \'scrollbars,resizable,width=600,height=500\')" class="minibutton btn-new-issue "><span><span class="icon"></span>Chat</span></a>');
// console.log('found: ' + trimString(hits[i]))
}
View
6 manifest.json
@@ -1,7 +1,7 @@
{
- "name" : "Phono",
- "version" : "0.1.3",
- "description" : "Phono is a browser-based webphone by Voxeo. More info available at http://phono.com",
+ "name" : "GitHub Chat",
+ "version" : "0.1.0",
+ "description" : "Chat and conference with your peers on GitHub",
"background_page" : "background.html",
"browser_action" : {
"default_icon" : "logo-32.png"
Please sign in to comment.
Something went wrong with that request. Please try again.