🌐 AI搜索 & 代理 主页
Skip to content

Commit d036d4d

Browse files
authored
Merge pull request #7 from handrews/minimal
Reorganize the project presentation.
2 parents f705ad2 + 7706cd8 commit d036d4d

File tree

1 file changed

+178
-45
lines changed

1 file changed

+178
-45
lines changed

static/javascripts/script.js

Lines changed: 178 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,172 @@
11
(function ($, undefined) {
2-
var featured = ['lua-nginx-module', 'stapxx', 'redoctober'],
3-
exclude = ['circus', 'fpm', 'phantomjs', 'zendesk', 'raven-php', 'go-raft', 'jas', 'twemcache', 'CloudFlare-UI', 'cloudflarejs','cloudflare.github.io', 'instaflare', 'dnschanger_detector', 'cfapp_sample', 'cfapp-canopy'],
4-
customRepos = [{
5-
name : 'stapxx',
6-
html_url : 'http://github.com/agentzh/stapxx',
7-
language : 'Perl',
8-
description : 'Simple macro language extentions to systemtap'
9-
},{
10-
name : 'nginx-systemtap-toolkit',
11-
html_url : 'http://github.com/agentzh/nginx-systemtap-toolkit',
12-
language : 'Perl',
13-
description : 'Real-time analyzing and diagnosing tools for Nginx based on SystemTap'
14-
},{
15-
name : 'lua-nginx-module',
16-
html_url : 'https://github.com/chaoslawful/lua-nginx-module',
17-
language : 'C',
18-
description : 'Embed the Power of Lua into NginX'
19-
},{
20-
name : 'ngx_cache_purge',
21-
html_url : 'https://github.com/FRiCKLE/ngx_cache_purge',
22-
language : 'C',
23-
description : 'nginx module which adds ability to purge content from FastCGI, proxy, SCGI and uWSGI caches.'
24-
}],
25-
categories = {
26-
'JavaScript': {},
27-
'Go': {
28-
'golibs' : null
29-
},
30-
'Nginx and Lua': {
31-
'lua-nginx-module' : null,
32-
'lua-nginx-cache-module': null,
33-
'nginx-systemtap-toolkit': null,
34-
'ngx_cache_purge': null,
35-
'lua-cmsgpack': null,
36-
'lua-resty-logger-socket' : null,
37-
'lua-resty-cookie': null
38-
},
39-
'Postgres': {
40-
'kt_fdw': null,
41-
'SortaSQL': null
42-
},
43-
'Other': {}
2+
// NOTE: featured repos currently not used (commented out- why?)
3+
var featured = ['lua-nginx-module', 'stapxx', 'redoctober'];
4+
5+
// See https://wiki.cfops.it/display/PS/Open+Source for deprecation information
6+
var exclude = [
7+
// These first few sections were already excluded.
8+
// deleted? renamed?
9+
'jas',
10+
'CloudFlare-UI',
11+
12+
// forks
13+
'circus',
14+
'fpm',
15+
'phantomjs',
16+
'zendesk',
17+
'raven-php',
18+
'go-raft',
19+
'twemcache',
20+
21+
// forked and deprecated
22+
'cfapp-canopy',
23+
24+
// empty repo (one-line README only)
25+
'cloudflarejs',
26+
27+
// active, but excluded as not of interest
28+
'cloudflare.github.io',
29+
30+
// deprecated, already excluded
31+
'instaflare',
32+
'dnschanger_detector',
33+
'cfapp_sample',
34+
35+
// The rest are newly tagged as deprecated
36+
// Partnerships
37+
'Cloudflare-CNAME-flattener',
38+
'ModCloudFlareIIS',
39+
'Cloudflare-Tools',
40+
41+
// This is being removed from GitHub entirely
42+
'Cloudflare-Plesk',
43+
44+
// Talks and demos
45+
'cf-dnssec-demo-domain-1',
46+
'cf-dnssec-demo-domain-2',
47+
'gosession2',
48+
49+
// External site
50+
'origin-pull',
51+
52+
// App Store (the old one)
53+
'cf-app',
54+
55+
// Security
56+
'keyless',
57+
58+
// KyotoTycoon
59+
'kyototycoon',
60+
'kyotocabinet',
61+
'kt_fdw',
62+
'gokabinet',
63+
'SortaSQL',
64+
65+
// NGINX & Lua
66+
'lua-upstream-cache-nginx-module',
67+
'lua-resty-kyototycoon',
68+
'lua-resty-limit', // just a README
69+
'ljmm',
70+
'luajit-mm',
71+
72+
// JavaScript
73+
'babel-preset-cf',
74+
'generator-cf-module',
75+
'redox',
76+
'transifex-client',
77+
'deadorbit',
78+
'collapsify',
79+
80+
// Miscellaneous
81+
'spdget',
82+
'vpnc-scripts'];
83+
84+
var includeForks = [
85+
'zlib',
86+
'lua-cmsgpack'
87+
];
88+
89+
var customRepos = [{
90+
name : 'stapxx',
91+
html_url : 'http://github.com/agentzh/stapxx',
92+
language : 'Perl',
93+
description : 'Simple macro language extentions to systemtap'
94+
},{
95+
name : 'nginx-systemtap-toolkit',
96+
html_url : 'http://github.com/agentzh/nginx-systemtap-toolkit',
97+
language : 'Perl',
98+
description : 'Real-time analyzing and diagnosing tools for Nginx based on SystemTap'
99+
},{
100+
name : 'lua-nginx-module',
101+
html_url : 'https://github.com/chaoslawful/lua-nginx-module',
102+
language : 'C',
103+
description : 'Embed the Power of Lua into NginX'
104+
},{
105+
name : 'ngx_cache_purge',
106+
html_url : 'https://github.com/FRiCKLE/ngx_cache_purge',
107+
language : 'C',
108+
description : 'nginx module which adds ability to purge content from FastCGI, proxy, SCGI and uWSGI caches.'
109+
}];
110+
111+
var categories = {
112+
'Integrate': {
113+
'claire': null,
114+
'Cloudflare-CPanel': null,
115+
'Cloudflare-Magento': null,
116+
'Cloudflare-Pivotal-Cloud-Foundry': null,
117+
'Cloudflare-WordPress': null,
118+
'mod_cloudflare': null,
119+
'cloudflare-plugin-frontend': null,
120+
'cloudflare-plugin-backend': null
121+
},
122+
'Automate': {
123+
'cloudflare-go': null,
124+
'node-cloudflare': null,
125+
'python-cloudflare': null,
126+
'salt-cloudflare': null,
127+
'logsclient': null,
128+
'logshare': null,
129+
'wafanalyzer': null,
130+
'doca': null,
131+
'doca-bootstrap-theme': null
44132
},
45-
num = 0;
133+
'Secure': {
134+
'cfssl': null,
135+
'sslconfig': null,
136+
'redoctober': null,
137+
'bpftools': null,
138+
'fourq': null,
139+
'gokeyless': null,
140+
'cfssl_trust': null,
141+
'certmgr': null,
142+
'tls-tris': null
143+
},
144+
'Nginx': {
145+
'lua-nginx-module' : null,
146+
'lua-nginx-cache-module': null,
147+
'nginx-systemtap-toolkit': null,
148+
'stapxx': null,
149+
'ngx_cache_purge': null,
150+
'ngx_brotli_module': null,
151+
'lua-cmsgpack': null,
152+
'lua-aho-corasick': null,
153+
'lua-resty-logger-socket' : null,
154+
'lua-resty-cookie': null,
155+
'lua-resty-json': null
156+
},
157+
'JavaScript': {
158+
'backgridjs.com': null
159+
},
160+
'Go': {
161+
'golibs' : null,
162+
'hellogopher': null,
163+
'goser': null,
164+
'golz4': null
165+
},
166+
'Other': {}
167+
};
168+
169+
var num = 0;
46170

47171
function addRecentlyUpdatedRepo(repo) {
48172
var $item = $('<li>');
@@ -81,10 +205,15 @@
81205
$section.append($('<h2 />',{'class': 'subheadline', 'text': cat}));
82206
$container = $('<div class="repos section columns three" />').appendTo($section);
83207

208+
// The .append(' ') enures a space between the links which allows them
209+
// to wrap on a narrow screen. Previously this sort of worked with breaks
210+
// possible within "Nginx and Lua" but nowhere else. This provides a more
211+
// natural behavior. Given tha larger number of headings, using both
212+
// the space and the existing between-link margin works well.
84213
$('#category-shortcuts').append($('<a />', {
85214
href: '#cat-'+cat,
86215
text: cat
87-
}))
216+
})).append(' ')
88217

89218
$.each(repos, function(i, repo){
90219
if( repo !== null ){
@@ -115,6 +244,10 @@
115244
repos = $.grep(repos, function(value) {
116245
var keep = exclude.indexOf(value.name) === -1,
117246
found = false;
247+
if( value.fork && !(value.name in includeForks) ){
248+
// ignore most forks.
249+
keep = false;
250+
}
118251

119252
// Build up the categories while we're looping through
120253
if( keep ){
@@ -123,7 +256,7 @@
123256
found = true;
124257
items[value.name] = value;
125258
return false;
126-
}else if( value.language == key || (key === 'Nginx and Lua' && value.language === 'Lua') ){
259+
}else if( value.language == key || (key === 'Nginx' && value.language === 'Lua') ){
127260
found = true;
128261
categories[key][value.name] = value;
129262
}

0 commit comments

Comments
 (0)