Skip to content

Commit

Permalink
added overlay on chat
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismatthieu committed Jul 10, 2011
1 parent beda770 commit c2e5ab8
Show file tree
Hide file tree
Showing 5 changed files with 233 additions and 2 deletions.
Binary file modified .DS_Store
Binary file not shown.
130 changes: 128 additions & 2 deletions githubchat.rb
Expand Up @@ -6,8 +6,8 @@

use Rack::Session::Cookie
use OmniAuth::Builder do
provider :github, '74a1475d7f5564343099', 'f8310520720f56e931f086d519c435d800c6997a' #github chat
# provider :github, '25abed0273f2d33bd9a5', '5e1f21c1830c3c1a2816df2b1a1d798779763ce8' #testing
# provider :github, '74a1475d7f5564343099', 'f8310520720f56e931f086d519c435d800c6997a' #github chat
provider :github, '25abed0273f2d33bd9a5', '5e1f21c1830c3c1a2816df2b1a1d798779763ce8' #testing port 4567 or 9393
end

get '/' do
Expand Down Expand Up @@ -77,10 +77,136 @@
end


get '/phono/:user/:repo/:id' do
user = params[:user]
repo = params[:repo]
id = params[:id]

html = '<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="http://s.phono.com/releases/0.2/jquery.phono.js"></script>
<script type="text/javascript">
var phono;
var call;
$(document).ready(function(){
phono = $.phono({
apiKey: "f12dc371538cb43b6c594d",
onReady: function() {
if( ! this.audio.permission() ){
this.audio.showPermissionBox();
}
$("a.callme").addClass("phono-ready").text("Start");
},
phone: {
onConnect: function(event) {
},
onDisconnect: function(event) {
$(document).trigger("callHangUp");
}
}
});
$("a.callme").click(function(){
$(".digit-hldr").slideDown();
$(this).hide();
$("a.hangup").show().css("display","block");
makeCall();
return false;
});
$("a.hangup").click(function(){
$(document).trigger("callHangUp");
return false;
});
$(document).bind("callHangUp", function(){
(call) ? call.hangup() : call = null;
$(".digit-hldr").slideUp();
$("a.hangup").hide();
$("a.callme").show();
});
})
function makeCall() {
numberToDial = "app:9996134567";
call = phono.phone.dial(numberToDial, {
headers: [
{
name:"web",
value:"true"
},
{
name:"code",
value: "' + user + repo + id + '"
}
],
tones: false,
onAnswer: function(event) {
},
onHangup: function() {
$(document).trigger("callHangUp");
},
onDisconnect: function() {
$(document).trigger("callHangUp");
}
});
}
</script>
</head>
<body>'

html << '<center><img src="/phono.png"><br/><div id="phono">
<a class="callme" href="#">Loading...</a>
<a class="hangup" href="#">hangup</a>
</div></center></body></html>'

html

end

get '/:user/:repo/issues/:id' do
user = params[:user]
repo = params[:repo]
id = params[:id]


html='<html id="mainHTML">
<head>
<title>GitHub Chat</title>
<link href = "/style.css" type = text/css rel = stylesheet>
</head>
<body>
<div>
<iframe name="mainWebFrame" id="mainWebFrame" src="http://github.com/' + user + '/' + repo + '/issues/' + id + '" TITLE="GitHub" height="100%" width="100%" frameborder="0"
marginwidth="0" marginheight="0" vspace="0" hspace="0">
</iframe>
</div>
<div>
<iframe id="mainChatFrame" name="mainChatFrame" src="/phono/' + user + '/' + repo + '/' + id + '"
style="width: 300px; height: 250px; ">
</iframe>
</div>
</body>
</html>'

html

end

get 'old/:user/:repo/issues/:id' do
user = params[:user]
repo = params[:repo]
id = params[:id]

html = '<html>
<head>
Expand Down
20 changes: 20 additions & 0 deletions index.html
@@ -0,0 +1,20 @@
<html id="mainHTML">
<head>
<title>Raply</title>
<link href = "style.css" type = text/css rel = stylesheet>

</head>
<body>
<div>
<iframe name="mainWebFrame" id="mainWebFrame" src="http://google.com" TITLE="URL" height="100%" width="100%" frameborder="0"
marginwidth="0" marginheight="0" vspace="0" hspace="0">
</iframe>
</div>
<div>
<iframe id="mainChatFrame" name="mainChatFrame" src="http://yahoo.com"
style="width: 300px; height: 250px; ">
</iframe>
</div>

</body>
</html>
Binary file added public/phono.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions public/style.css
@@ -0,0 +1,85 @@
#mainHTML {
overflow:hidden;
margin:0;
}
#MWHBody {
width: 100%;
height: 100%;
padding:0;
margin:0;
border:0;
overflow: hidden;
}
#mainChatDiv {
z-index: 2;
width: 100%;
height: 100%;
padding:0;
margin:0;
border:0;
}
#mainTabDiv {
z-index: 2;
width: 100%;
height: 100%;
padding:0;
margin:0;
border:0;
}
#mainWebFrame {
width: 100%;
height: 100%;
padding:0;
margin:0;
border:0;
z-index: 0;
}
#MWHChat {
position: absolute;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
padding:0;
margin:0;
border:0;
z-index:1100;
visibility: hidden;
overflow: hidden;
background-color: transparent;
background-image: url("http://maywehelp.com/esbn/back.jpg");
}
#mainChatFrame{
position:absolute;
right: 25px;
bottom: 0px;
width: 250px;
height: 250px;
z-index: 1200;
overflow: hidden;
padding:0;
margin:0;
border:1;
border-right: 0px;
border-top: 0px;
border-left: 0px;
border-bottom: 0px;
background-color: transparent;
}
#mainTabFrame{
position:absolute;
width: 20px;
height: 100%;
left: 0px;
top: 0px;
z-index: 1200;
overflow: hidden;
padding:0;
margin:0;
border:0;
border-right: 0px;
border-top: 0px;
border-left: 0px;
border-bottom: 0px;
background-color: transparent;
}

0 comments on commit c2e5ab8

Please sign in to comment.