forked from IBM/ibm.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
399 lines (323 loc) · 13.7 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
<!DOCTYPE html>
<!-- saved from url=(0043)http://getbootstrap.com/examples/jumbotron/ -->
<html lang="en"><head>
<script src="//cdn.optimizely.com/js/1141215513.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>IBM @ Github</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="./css/style.css" rel="stylesheet">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41146412-2', 'ibm.github.io');
ga('send', 'pageview');
</script>
<link rel="icon" href="http://ibm.github.io/favicon.ico" type="image/vnd.microsoft.icon" />
</head>
<body style="">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="http://www.ibm.com"><img src="images/ibmneg_white_42x20.png" alt="IBM"></a>
<!--a class="navbar-brand" style="float: right" href="http://www.ibm.com/developerworks"><img src="images/dWmark.png" alt="DW"></a-->
<a id="dw-nav" class="navbar-brand" style="float: right" href="http://www.ibm.com/developerworks" title="developerWorks"><span class="dw-logo-IBM">IBM</span> <span class="dw-logo-d">d</span><span class="dw-logo-W">W</span></a>
<div class="navbar-header">
</div>
</div>
</div>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1>IBM Open Source at GitHub</h1>
<div class="leadspace-buttons">
<a href="http://hub.jazz.net/" data-analytics-category="Leadspace buttons" data-analytics-action="JazzHub">
<p class="btn btn-primary btn-lg btn-custom-jazz">Enhance your GitHub experience with <b>Bluemix DevOps Services</b>
</p>
</a>
<a href="https://www.bluemix.net/" data-analytics-category="Leadspace buttons" data-analytics-action="BlueMix">
<p class="btn btn-primary btn-lg btn-custom-bm">Deploy your application to <b>Bluemix cloud platform</b></p>
</a>
<a href="http://developer.ibm.com/open" data-analytics-category="Leadspace buttons" data-analytics-action="developerWorks Open">
<p class="btn btn-primary btn-lg btn-custom-dw">Engage with IBM Open Source <b>developerWorks Open</b>
</p>
</a>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div id="wrapper">
<label for="search" class="col-lg-4 control-label search" style=""><span>Search</span> <input type="search" id="search" class="search-query span3 filter input-medium" placeholder="Our Repos..."></label>
<div id="repos" class="columns collapse-group">
</div>
</div>
</div>
</div>
<hr>
</div>
</div>
</div>
<footer>
<div class="container">
<p>© IBM 2013-2016</p>
</div>
</footer>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="./js/jquery.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/strftime.js"></script>
<script type="text/javascript" src="orgs.js"></script>
<script type="text/javascript">
var updated = [];
var allrepos = [];
// go to http://thissite.example.com/#DEBUG to set DEBUG=true
var DEBUG = (window.location.hash === '#DEBUG');
(function ($, undefined) {
var repoUrls = {
};
function repoUrl(repo) {
return repoUrls[repo.name] || repo.html_url;
}
function repoDescription(repo) {
desc = repo.description;
return desc;
}
function addUpdated()
{
$("#updated").empty();
for (r=0; r < Math.min(4, updated.length); r++)
{
repo = updated[r];
desc = repoDescription(repo);
var $uitem = $("<div>").addClass("updated-card col-sm-5 col-md-4 col-lg-3");
var $item = $("<div>").addClass("card pin " + (repo.language || '').toLowerCase() + " "+repo.name.toLowerCase());
var $link = $("<a>").attr("href", repoUrl(repo)).appendTo($item);
$link.append($("<h4>").text(repo.name));
$link.append($("<h5>").text((repo.language != null) ? repo.language : ""));
$item.append($("<p>").text(desc));
$item.appendTo($uitem);
$uitem.appendTo("#updated");
}
var d = $("#updated").collapse({
toggle: true
});
}
function addAllRepos()
{
$("#allrepos").empty();
for (r=0; r < allrepos.length; r++)
{
repo = allrepos[r];
desc = repoDescription(repo);
var $item = $("<div>").addClass("card pin col-sm-5 col-md-4 col-lg-3 " + (repo.language || '').toLowerCase() + " "+repo.name.toLowerCase());
var $link = $("<a>").attr("href", repoUrl(repo)).appendTo($item);
$link.append($("<h4>").html(repo.name + "<div class='org'><a href='"+repo.owner.html_url+"'>("+repo.owner.login+")"));
$link.append($("<h5>").text((repo.language != null) ? repo.language : ""));
$item.append($("<p>").text(desc));
htag = "#allrepos";
$item.appendTo(htag);
}
$(".nrepos").text("("+allrepos.length+")");
var d = $("#allrepos").collapse({
toggle: true
});
}
function pushRepo(repos, org)
{
var left = repos; var right = allrepos;
var result = [],
il = 0,
ir = 0;
while (il < left.length && ir < right.length){
if (left[il].name.toLowerCase() < right[ir].name.toLowerCase()){
result.push(left[il++]);
} else {
result.push(right[ir++]);
}
}
allrepos = result.concat(left.slice(il)).concat(right.slice(ir));
}
function mergeUpdated(repos)
{
var left = repos; var right = updated;
var result = [],
il = 0,
ir = 0;
while (il < left.length && ir < right.length){
if (left[il].pushed_at > right[ir].pushed_at){
result.push(left[il++]);
} else {
result.push(right[ir++]);
}
}
updated = result.concat(left.slice(il)).concat(right.slice(ir));
}
function addRepos(orgs, repos, page) {
var forks = [];
var org = orgs.name;
repos = repos || [];
page = page || 1;
reposcmd = orgs.type === "repo" ? "" : "/repos";
// These client tokens are for a dummy app, and there is no user specific information that we get, so
// all in all, pretty safe to expose this here.
// there are three supported request types: org, user and repo. Syntax differs.
if((orgs.type !== 'org') && (orgs.type !== 'user') && (orgs.type !== 'repo')) {
console.log('** Unknown type “'+orgs.type+'” for org “'+org+'” — check “orgs.js” for typo.');
return;
}
var uri = "https://api.github.com/"+orgs.type+"s/"+org + reposcmd
+ "?per_page=1000"
+ "&client_id=1bafa09b6086eec7afb4"
+ "&client_secret=7e6422a0a2e24f0d0ecb7521a63990b5758c9cc8";
$.getJSON(uri, function (result) {
if (!Array.isArray(result)) {
result = [].concat(result);
}
if (result && result.length > 0) {
repos = repos.concat(result);
$(function () {
$.each(repos, function (i, repo) {
repo.pushed_at = new Date(repo.pushed_at);
if (repo.fork === true) { // if this is a fork, save the index
forks.push(i);
}
});
// remove forks from the view
$.each(forks, function(i, forkindex) {
var indextoremove = forkindex - i; // account for prior splices
if(DEBUG) console.log('removing forked entry: ' + repos[indextoremove].full_name);
repos.splice(indextoremove,1);
});
// pre sort by how recently the repo was modified
repos.sort(function (a, b) {
if (a.pushed_at < b.pushed_at) return 1;
if (b.pushed_at < a.pushed_at) return -1;
return 0;
});
mergeUpdated(repos);
repos.sort(function (a, b) {
if (a.name.toLowerCase() > b.name.toLowerCase()) {return 1;}
if (b.name.toLowerCase() > a.name.toLowerCase()) {return -1};
return 0;
});
pushRepo(repos, org);
addUpdated();
addAllRepos();
});
}
});
}
$("<div>").addClass("separator").appendTo("#wrapper");
var $sectiontitle = $("<div>").addClass("section-title").appendTo("#wrapper");
var $title = $("<span>").addClass('title').text("recent").appendTo($sectiontitle);
var $item = $("<div id='updated'>").addClass("columns section collapse");
$item.appendTo($sectiontitle);
var $twistie = $("<a data-toggle='collapse' data-target='#updated'>").addClass("twistie showdetails");
$twistie.appendTo($sectiontitle);
$("<div>").addClass("separator gap").appendTo("#wrapper");
var $sectiontitle = $("<div>").addClass("section-title").appendTo("#wrapper");
var $title = $("<span>").addClass('title').text("repos").appendTo($sectiontitle);
var $repos = $("<span>").addClass('nrepos').text("(0)").appendTo($title);
var $item = $("<div id='allrepos'>").addClass("columns section collapse");
$item.appendTo($sectiontitle);
var $twistie = $("<a data-toggle='collapse' data-target='#allrepos'>").addClass("twistie showdetails");
$twistie.appendTo($sectiontitle);
for (var r in orgs)
{
addRepos(orgs[r]);
}
$("<div>").addClass("separator").appendTo("#wrapper");
})(jQuery);
$('#search').keyup(function() {
var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
$rows = $(".card")
$rows.show().filter(function() {
var text = $(this).text().replace(/\s+/g, ' ').toLowerCase();
return !~text.indexOf(val);
}).hide();
// update repo count here
n = $rows.length;
for (r in $rows)
{
row = $rows[r];
style = row.style;
if (style && style.cssText && style.cssText.match("none"))
{
n--;
}
}
$rows = $(".updated-card");
$rows.show().filter(function() {
var text = $(this).text().replace(/\s+/g, ' ').toLowerCase();
return !~text.indexOf(val);
}).hide();
m = 4;
for (r in $rows)
{
row = $rows[r];
style = row.style;
if (style && style.cssText && style.cssText.match("none"))
{
m--;
}
}
$(".nrepos").text("("+(n - m)+")");
// ---------------------------------
// Google Analytics Event Tracking
//
//
// usage: add the following attributes to links you want to track:
// data-analytics-category="" REQUIRED String Typically the object that was interacted with (e.g. button)
// data-analytics-action="" REQUIRED String The type of interaction (e.g. click)
// data-analytics-label="" OPTIONAL String Useful for categorizing events (e.g. nav buttons)
// data-analytics-value="" OPTIONAL Integer Values must be non-negative. Useful to pass counts (e.g. 4 times)
//
// Those are the suggested usages, but you can use the attributes how you want
// see https://developers.google.com/analytics/devguides/collection/analyticsjs/events for more details
//
// EXAMPLE:
// <a href="http://ibm.com" data-analytics-category="Leadspace button" data-analytics-action="To ibm.com">Off you go!</a>
// ---------------------------------
$('body').on('click', 'a[data-analytics-category][data-analytics-action]', function(e){
// No analytics? Bail.
if ( ! window.ga )
return;
// for links to external sources, we need a tiny delay to have a little extra time to send to Google's servers before unload
// 200ms is about right for enough time
if (this.hostname && this.hostname !== location.hostname) {
// Stop the link action
e.preventDefault();
// setTimeout callback is called in the window scope, so cache the url from the link now
var url = this.href;
// in 200ms, off you go
setTimeout(function(){
document.location = url;
},200);
}
var $el = $(this),
data = {'hitType': 'event'}; // make a new data object
// category (required string)
data['eventCategory'] = $el.attr('data-analytics-category');
// action (required string)
data['eventAction'] = $el.attr('data-analytics-action');
// label (optional string)
if ( $el.attr('data-analytics-label') )
data['eventLabel'] = $el.attr('data-analytics-label');
// value (optional int)
if ( $el.attr('data-analytics-value') )
data['eventValue'] = parseInt( $el.attr('data-analytics-value') );
// send the data
ga('send', data);
});
});
</script>
</body></html>