Skip to content

Commit 4da7890

Browse files
committed
Compiler generation page Tue Nov 22 2016 01:44:34 GMT+0800 (CST)
1 parent e2648e0 commit 4da7890

File tree

7 files changed

+46
-30
lines changed

7 files changed

+46
-30
lines changed

c/find.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<link rel="stylesheet" type="text/css" href="../css/index.css">
1111
</head>
1212
<body>
13-
<a href="https://github.com/jaywcjlove/" target="_blank" class="github-corner"> <svg viewBox="0 0 250 250"><!-- kenny wang <wowohoo@qq.com> https://github.com/jaywcjlove --> <title>logo</title> <desc>Linux Command Logo. https://github.com/jaywcjlove</desc><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg> </a>
13+
<a href="https://github.com/jaywcjlove/linux-command" target="_blank" class="github-corner"> <svg viewBox="0 0 250 250"><!-- kenny wang <wowohoo@qq.com> https://github.com/jaywcjlove --> <title>logo</title> <desc>Linux Command Logo. https://github.com/jaywcjlove</desc><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg> </a>
1414
<div class="header header_list">
1515
<div class="logo">
1616
<a href="/">

c/fs/cat.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<link rel="stylesheet" type="text/css" href="../../css/index.css">
1111
</head>
1212
<body>
13-
<a href="https://github.com/jaywcjlove/" target="_blank" class="github-corner"> <svg viewBox="0 0 250 250"><!-- kenny wang <wowohoo@qq.com> https://github.com/jaywcjlove --> <title>logo</title> <desc>Linux Command Logo. https://github.com/jaywcjlove</desc><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg> </a>
13+
<a href="https://github.com/jaywcjlove/linux-command" target="_blank" class="github-corner"> <svg viewBox="0 0 250 250"><!-- kenny wang <wowohoo@qq.com> https://github.com/jaywcjlove --> <title>logo</title> <desc>Linux Command Logo. https://github.com/jaywcjlove</desc><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg> </a>
1414
<div class="header header_list">
1515
<div class="logo">
1616
<a href="/">

c/mv.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<link rel="stylesheet" type="text/css" href="../css/index.css">
1111
</head>
1212
<body>
13-
<a href="https://github.com/jaywcjlove/" target="_blank" class="github-corner"> <svg viewBox="0 0 250 250"><!-- kenny wang <wowohoo@qq.com> https://github.com/jaywcjlove --> <title>logo</title> <desc>Linux Command Logo. https://github.com/jaywcjlove</desc><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg> </a>
13+
<a href="https://github.com/jaywcjlove/linux-command" target="_blank" class="github-corner"> <svg viewBox="0 0 250 250"><!-- kenny wang <wowohoo@qq.com> https://github.com/jaywcjlove --> <title>logo</title> <desc>Linux Command Logo. https://github.com/jaywcjlove</desc><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg> </a>
1414
<div class="header header_list">
1515
<div class="logo">
1616
<a href="/">

css/index.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

js/index.js

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
this.elm_btn = $$('search_btn');
77
this.elm_info = $$('commands_info');
88
this.elm_result = $$('result');
9+
this.elm_search_result = $$('search_list_result');
910

1011
// 获取根路径
1112
this.root_path = (function(){
@@ -15,7 +16,8 @@
1516
})();
1617

1718
this.query = ''; //
18-
this.page_size = 10; //每页显示10条
19+
this.query_size = 5; //搜索框结果显示5条
20+
this.page_size = 20; //每页显示20条
1921

2022
this.elm_info.innerHTML = this.commands.length;
2123

@@ -69,41 +71,48 @@
6971
return typeof returns === "undefined" ? "" : returns;
7072
})
7173
},
72-
createKeyworldsHTML:function(json,keywolds){
74+
createKeyworldsHTML:function(json,keywolds,islist){
7375
var name = json.n,des = json.d,self = this,
74-
reg = new RegExp("("+keywolds+")","ig");
76+
reg = new RegExp("("+keywolds+")","ig"),
77+
str = '';
7578
if(keywolds){
7679
name = json.n.replace(reg,'<i class="kw">'+"$1"+"</i>");
7780
des = json.d.replace(reg,'<i class="kw">'+"$1"+"</i>") || '';
7881
}
7982

80-
return this.simple('<a href="'+this.root_path+'/c$url$.html"><strong>$name$</strong> - $des$</a>',{
83+
str = islist ? '<a href="'+this.root_path+'/c$url$.html"><strong>$name$</strong> - $des$</a><p></p>' : '<a href="'+this.root_path+'/c$url$.html"><strong>$name$</strong> - $des$</a>';
84+
return this.simple(str,{
8185
name:name,
8286
url:json.p,
8387
des:des
84-
})
85-
88+
});
8689
},
87-
createListHTML:function(){
88-
var arr = this.commands,self = this,page_size = this.page_size,i=0;
90+
searchResult:function(islist){
91+
var arr = this.commands,self = this,i=0,
92+
page_size = islist?this.page_size:this.query_size,
93+
arrResultHTML = [];
8994
if(arr&&arr.length&&toString.call(arr).indexOf('Array')>-1){
90-
self.elm_result.innerHTML='';
91-
var relese = 0;
9295
for (; i < page_size; i++) {
9396
if(!arr[i]) break;
94-
var myLi = document.createElement("LI");
95-
if(self.isSreachIndexOF(arr[i].n,self.query)
96-
|| self.isSreachIndexOF(arr[i].d,self.query)
97+
if(self.isSreachIndexOF(arr[i].n,self.query)
98+
|| self.isSreachIndexOF(arr[i].d,self.query)
9799
){
98-
relese += 1
99-
myLi.innerHTML = self.createKeyworldsHTML(arr[i],self.query)
100-
self.elm_result.appendChild(myLi);
100+
arrResultHTML.push(self.createKeyworldsHTML(arr[i],self.query,islist));
101101
}
102102
}
103-
if(relese ===0){
104-
myLi.innerHTML = this.query?'<span>没有搜索到任何内容,请尝试输入其它字符!</span>':'<span>请尝试输入一些字符,进行搜素!</span>';
105-
self.elm_result.innerHTML = myLi.outerHTML;
106-
}
103+
}
104+
105+
var elm = islist?this.elm_search_result:this.elm_result;
106+
elm.innerHTML='';
107+
for (var i = 0; i < arrResultHTML.length; i++) {
108+
var myLi = document.createElement("LI");
109+
myLi.innerHTML = arrResultHTML[i];
110+
elm.appendChild(myLi);
111+
}
112+
if(arrResultHTML.length === 0){
113+
var myLi = document.createElement("LI");
114+
myLi.innerHTML = '<span>'+this.query?'请尝试输入一些字符,进行搜素!'+'</span>':'没有搜索到任何内容,请尝试输入其它字符!';
115+
elm.appendChild(myLi);
107116
}
108117
},
109118
init:function(){
@@ -112,25 +121,32 @@
112121
var timer = null
113122
this.elm_query.value = kw;
114123
this.query = kw;
124+
if(this.elm_search_result) self.searchResult(true);
115125
this.bindEvent(this.elm_query,'input',function(e){
116126
self.query = e.target.value;
117127
self.pushState()
118-
self.createListHTML();
128+
self.searchResult();
119129
self.elm_result.style.display = self.query?'block':'none';
120130
})
121131
this.bindEvent(this.elm_btn,'click',function(e){
122-
self.createListHTML();
132+
console.log("---->")
133+
if(self.elm_search_result){
134+
self.searchResult(true);
135+
}
136+
else{
137+
window.location.href = self.root_path + '/list.html#!kw='+self.query;
138+
}
123139
})
124140
this.bindEvent(this.elm_query,'focus',function(e){
125-
self.createListHTML();
141+
self.searchResult();
126142
self.elm_result.style.display = 'block';
127143
})
128144
this.bindEvent(this.elm_query,'blur',function(e){
129145
timer = setTimeout(function(){
130146
self.elm_result.style.display = 'none';
131147
},600)
132148
})
133-
if(kw) self.createListHTML();
149+
if(kw) self.searchResult();
134150
}
135151
}
136152

list.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)