Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (118 sloc) 3.18 KB
<html>
<head>
<link rel="stylesheet" href="github.css" type="text/css" media="screen" title="tab-slider" charset="utf-8">
<style type="text/css" media="screen">
code {
display: block;
background-color: #ccc;
padding: 10px;
border: 1px solid #000;
margin-bottom: 30px;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
<script src="github.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function($) {
$('#example-1').github({
user:'jquery',
tpl: '<li><a href="%url%">%name%</a></li>'
});
$('#example-2').github({
user:'jquery',
tpl:'<li><a href="%url%">%name%</a> <span>Forks: %forks% | Watchers: %watchers%</span><p>%description%</p></li>'
});
$('#example-3').github({
user:'felixge',
forks:true,
tpl: '<li><a href="%url%">%name%</a></li>'
});
$('#example-4').github({
user:'felixge',
filters:["node", "fab", "cakephp"],
tpl: '<li><a href="%url%">%name%</a></li>'
});
$('#example-5').github({
api: 'watched',
max: 3,
user:'jadb',
tpl: '<li><a href="%url%">%name%</a></li>'
});
$('#example-6').github({
api: 'forked',
user:'felixge',
tpl: '<li><a href="%url%">%name%</a></li>'
});
$('#example-7').github({
api: 'commits',
user:'jadb',
repo: 'jquery-github'
});
});
</script>
</head>
<body>
<h2>jQuery's un-styled public repositories</h2>
<code>
$('#example-1').github({
user:'jquery',
tpl: '&lt;li&gt;&lt;a href="%url%"&gt;%name%&lt;/a&gt;&lt;/li&gt;'
});
</code>
<ul id="example-1"></ul>
<h2>jQuery's styled public repositories</h2>
<code>
$('#example-2').github({
user:'jquery',
tpl:'&lt;li&gt;&lt;a href="%url%"&gt;%name%&lt;/a&gt; &lt;span&gt;Forks: %forks% | Watchers: %watchers%&lt;/span&gt;&lt;p&gt;%description%&lt;/p&gt;&lt;/li&gt;'
});
</code>
<ol id="example-2"></ol>
<h2>felixge's repos (forked ones included)</h2>
<code>
$('#example-3').github({
user:'felixge',
forks:true,
tpl: '&lt;li&gt;&lt;a href="%url%"&gt;%name%&lt;/a&gt;&lt;/li&gt;'
});
</code>
<ol id="example-3"></ol>
<h2>felixge's repos (filters: node, fab and cakephp)</h2>
<code>
$('#example-4').github({
user:'felixge',
filters:["node", "fab", "cakephp"],
tpl: '&lt;li&gt;&lt;a href="%url%"&gt;%name%&lt;/a&gt;&lt;/li&gt;'
});
</code>
<ol id="example-4"></ol>
<h2>jadb's watched repos (max set to 3)</h2>
<code>
$('#example-5').github({
api: 'watched',
max: 3,
user:'jadb',
tpl: '&lt;li&gt;&lt;a href="%url%"&gt;%name%&lt;/a&gt;&lt;/li&gt;'
});
</code>
<ol id="example-5"></ol>
<h2>felixge's forked repos</h2>
<code>
$('#example-6').github({
api: 'forked',
user:'felixge',
tpl: '&lt;li&gt;&lt;a href="%url%"&gt;%name%&lt;/a&gt;&lt;/li&gt;'
});
</code>
<ol id="example-6"></ol>
<h2>jquery-github repo's commits</h2>
<code>
$('#example-7').github({
api: 'commits',
user:'jadb',
repo: 'jquery-github'
});
</code>
<ol id="example-7"></ol>
</body>
</html>