-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
113 lines (103 loc) · 4.1 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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="assets/css/main.css" media="screen">
<title>搜集优秀的Android开源项目或资源信息</title>
</head>
<body>
<div id="repos">
<h1><a href="" style="width: 100; height: 100%; display: block;"></a>nice-repo</h1>
<div style="text-align: center;">
<input id="searchName" style="width: 500px;"/>
<br>
<button class="sort" data-sort="name" style="width: 200px;">sort by name</button>
</div>
<div class="list">
<table id="nice-repo" style="background: #ECF7FC; margin-bottom: 5px; border-spacing: 0;">
<tr>
<td width="5" style="background: #636363;"> </td>
<td width="745" style="color: #28a8e0; padding: 5px 10px;">
<p style="color: #333;">
您可以按照下面的格式编辑
<a href="https://github.com/dusunboy/android-nice-repo/blob/gh-pages/assets/js/repo.js" style="color:red">repo.js</a>
文件,对本项目进行补充。
<br>
添加新项目前,请先搜索项目是否存在。
</p>
<pre>
{
name: '项目名称',
link: '项目链接',
author: '项目作者'
}
</pre>
</td>
<td class="link-btn" width="50" style="background: #636363; color: #fff; text-align: center; cursor: pointer;">
GO
<span class="link" style="display: none;">https://github.com/dusunboy/android-nice-repo</span>
</td>
</tr>
</table>
<table id="hacker-item" style="background: #ECF7FC; margin-bottom: 5px; border-spacing: 0;">
<tr>
<td width="5" style="background: #5EC9F8;"> </td>
<td width="745" style="color: #28a8e0; padding: 5px 10px;">
<strong class="name"></strong>
<p class="author" style="color: #333; font-size: 12px; line-height: 1.8;"></p>
<span class="link"></span>
</td>
<td class="link-btn" width="50" style="background: #28a8e0; color: #fff; text-align: center; cursor: pointer;">
GO
</td>
</tr>
</table>
</div>
<ul class="pagination"></ul>
</div>
<script src="assets/js/list.min.js"></script>
<script src="assets/js/jquery.min.js"></script>
<script>
$(function () {
$.ajax({
type: "GET",
url: "https://raw.githubusercontent.com/dusunboy/android-nice-repo/gh-pages/assets/js/repo.json",
dataType: "json",
success: function (data) {
listObj = new List('repos', {
valueNames: [ 'name', 'author', 'link', { attr: 'href', name: 'link' }, ],
item: 'hacker-item',
page: 20,
pagination: [{
name: "pagination",
paginationClass: "pagination",
innerWindow: 5,
outerWindow: 3
}],
}, data.reverse());
$('#searchName')
.attr('placeholder', '已为您收集了 '+ data.length +' 个优秀的Android开源项目或资源信息');
}
});
});
$('#searchName').bind('input propertychange', function() {
var searchName = $("#searchName").val();
listObj.search(searchName, ['name', 'author' ]);
init();
});
window.onload = init;
function init(){
var trs = document.getElementsByTagName('tr');
for(var i=0;i<trs.length;i++) {
trs[i].onclick=doClick;
}
}
function doClick(){
var link = $(this).find('.link').html();
window.open(link);
}
</script>
</body>
</html>