typo and Mac OS detect

This commit is contained in:
unstop
2014-07-27 12:04:27 +08:00
parent ccb3eceb56
commit 45f76942ef
2 changed files with 40 additions and 9 deletions

View File

@@ -2,23 +2,24 @@ doctype html
html
head
meta(charset="utf-8")
title commitCal
title CommitCal
link(rel='icon', href='/favicon.png', type='image/png')
link(rel='stylesheet', href='/styles/index.css', type='text/css', media='screen')
meta(name='viewport', content='width=device-width, initial-scale=1')
body
.header
.container
h1.title.highlight commitCal
h3 View your commit history in Calendar
h1.title.highlight CommitCal
h3 View your commit history in calendar
p.star
iframe(src="http://ghbtns.com/github-btn.html?user=HackPlan&repo=github-commit-ical&type=watch&size=large", allowtransparency="true", frameborder="0", scrolling="0", width="72", height="30")
.body
.container.clearfix
form(onsubmit="subscribe()")
form.clearfix(onsubmit="return subscribe()")
input#username(type="text", placeholder="Enter your GitHub username")
button(type="submit") Subscribe to Calendar
#subscription.clearfix(style="display:none")
#subscription_url
.footer
.container.copyright.clearfix
.left
@@ -27,9 +28,21 @@ html
p A
a(href="http://hackplan.com") Hackplan
| Project
script.
function subscribe() {
username = document.getElementById('username').value;
window.open("webcal://commit-calendar.newsbee.io/" + username);
if (!username) {
return false;
}
url = "commit-calendar.newsbee.io/" + username;
if (window.navigator.platform.toUpperCase().indexOf('MAC') >= 0){
window.open("webcal://" + url);
}else{
link = document.getElementById('subscription_url')
link.innerHTML = "http://" + url;
subscription = document.getElementById('subscription')
subscription.style.display = "block";
}
return false;
}

View File

@@ -102,7 +102,7 @@ input[type=text], input[type=password], textarea {
}
button{
button, .button{
display: inline-block;
margin-bottom: 0;
font-weight: bold;
@@ -126,12 +126,30 @@ button{
}
.container{
#subscription{
margin-top: 1em;
background: #5B9DD1;
border-radius: 3px;
padding: 0.5em 1em;
color: #fff;
}
#subscription_url{
line-height: 2em;
float: left;
}
#sub_link{
width: auto;
background: #2173B6;
border-color: #1E73B6;
padding: 3px 10px;
}
input{
width: 57%;
float: left;
box-sizing: border-box;
}
button {
button, .button {
width: 40%;
float: right;
box-sizing: border-box;