forked from vasili4/central
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-1.html
118 lines (86 loc) · 4.97 KB
/
build-1.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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="javascripts/oauth.js" type="text/javascript"></script>
<script src="javascripts/mustache.js" type="text/javascript"></script>
<script src="javascripts/utilities.js" type="text/javascript"></script>
<script src="javascripts/tabletop.js" type="text/javascript"></script>
<script src="javascripts/underscore-min.js" type="text/javascript"></script>
<script src="javascripts/base64.js" type="text/javascript"></script>
<script src="javascripts/github.js" type="text/javascript"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>Simple API</title>
</head>
<body>
<div id="container">
<div class="inner">
<header>
<h1><a href="index.html">Simple API</a></h1>
<h2>This is a simple API. <a href="about.html">Learn more...</a></h2>
</header>
<section id="main_content">
<h1>Select Account / Organization</h1>
<p>You will be forking this API to your Github account, you can either put under your primary account or select from any of the organizations you are a member of.</p>
<p>You can ony fork a repo once to any account or organization, so if you wish to use a template more than once, create a new organization for it before continueing.</p>
<Form action="build-2.html" method="get" style="background-color: #E8E8E8;">
<input type="hidden" name="repo" id="repo" value="" />
<input type="hidden" name="oAuth_Token" id="oAuth_Token" value="" />
<p align="center"><strong>Choose which account / organization would you like to fork API under?</strong> <select id="account" name="account"></select></p>
<p align="center"><input type="submit" name="go" value="Continue Forking API" /></p>
</form>
<div id="displayMe"></div>
<script type="text/javascript">
function callback(url){
return function(){
location.href=url;
}
}
$repo = getUrlVar('repo');
$cleanrepo = $repo.replace("api-","");
document.getElementById("repo").value = $repo;
// Replace with your oAuth.io token, this will only work under the Simple API @ Github domain
OAuth.initialize('afPUMVzeX4oG31HVPlLM7kTQEHQ');
OAuth.callback('github', function(err, result) {
$oAuth_Token = result.access_token;
document.getElementById("oAuth_Token").value = $oAuth_Token;
var github = new Github({
token: $oAuth_Token,
auth: "oauth"
});
var repo = github.getRepo('simple-api', 'central');
var $User = "";
var $UserLogin = "";
$DisplayMe = "";
var user = github.getUser();
user.show('', function(err, thisuser) {
$User = thisuser;
$UserLogin = $User['login'];
$("#account").append("<option>" + $UserLogin + "</option>");
user.orgs(function(err, $orgs) {
$.each($orgs, function(s, $org) {
$("#account").append("<option>" + $org.login + "</option>");
});
});
});
});
</script>
</section>
<footer>
Simple-api is maintained by <a href="https://github.com/simple-api">simple-api</a><br>
This page was generated by <a href="http://pages.github.com">GitHub Pages</a>. Tactile theme by <a href="https://twitter.com/jasonlong">Jason Long</a>.
</footer>
</div>
</div>
</body>
</html>