forked from apache/openwhisk-slackinvite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
145 lines (138 loc) · 5.05 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Slack Invite for OpenWhisk</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
.outer {
width: 500px;
min-width: 320px;
text-align: center;
margin: 10px auto;
font-family: "Helvetica Neue", Helvetica, Arial
}
.inner {
margin: 10px;
}
.splash {
display: block;
margin: 0px auto;
font-family: "Helvetica Neue", Helvetica, Arial
}
.footer {
margin: 10px auto;
text-align: center;
font-size: small;
font-family: "Helvetica Neue", Helvetica, Arial
}
@media screen and (max-width: 360px) and (min-width: 320px)
{
.outer{
max-width: 320px
}
}
</style>
</head>
<body>
<div class="outer">
<div class="splash"><img
src="https://s23.postimg.org/oy3kv2uxn/skitch.png"
alt="OpenWhisk plus Slack" style="height: 60px;"> </div>
<div class="inner">
<h3>Already a Team member?</h3>
<p>click here: <a href="https://openwhisk-team.slack.com/"><b>openwhisk-team.slack.com</b></a></p>
</div>
<div class="inner">
<h3>If not, join us!</h3>
<p>Join the OpenWhisk Community to discuss the project in
real-time.</p>
<ul style="text-align: left">
<li><strong>Talk</strong> to the core devs and the OpenWhisk
community.</li>
<li><strong>Learn</strong> from others and ask questions.</li>
<li><strong>Share</strong> your work and demos.</li>
</ul>
<form class="form-inline">
<div class="form-group"> <label for="exampleInputEmail2">Email:</label>
<input class="form-control" id="inputEmail"
placeholder="[email protected]" required=""
type="email"> </div>
<button type="button" class="btn btn-primary" style="margin:
5px;">Send invitation</button>
<div id="result">
</form>
</div>
<div class="inner">
<p>We are a friendly, respectful and inclusive community!</p>
</div>
<div class="footer"><a href="https://openwhisk-team.slack.com/"> </a>
<p><i>Code for Slack invite (this page) is on github:</i><br>
<i> </i><i><a
href="https://github.com/openwhisk/openwhisk-slackinvite"
target="blank">https://github.com/openwhisk/openwhisk-slackinvite</a></i></p>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
var btn = $("button");
var res = $("#result");
var email = $('#inputEmail');
var actionUrl = "https://545303d4-dd03-4cfc-a553-4253f7929dfd-gws.api-gw.mybluemix.net/openwhisk-team/slackinvite";
function handler() {
$.get(actionUrl, { email: email[0].value })
.done(function (data) {
btn.removeClass("btn-danger");
btn.addClass("btn-success");
btn.html("WOOT. CHECK YOUR EMAIL!");
res.html(data.message);
})
.fail(function (err) {
btn.addClass("btn-danger");
btn.html("Problem with invite");
if(err.responseJSON) console.log(err.responseJSON)
if(err.responseJSON && err.responseJSON.error && err.responseJSON.error.message){
res.html(err.responseJSON.error.message);
} else {
res.html(err.statusText + ":Your invitation didn't work :-( ");
}
});
}
btn.click(handler);
btn.prop("disabled", true);
function validate() {
console.log("validate")
if (email[0].validity.typeMismatch) {
btn.prop("disabled", true);
} else {
btn.prop("disabled", false);
}
}
email.change(validate);
email.keyup(validate);
})
</script>
</body>
</html>