Skip to content
This repository was archived by the owner on Nov 22, 2021. It is now read-only.

Commit 08ff66b

Browse files
author
Ke, Mingze
committed
Merge branch 'filter' into gh-pages
2 parents d585e2a + 95dfaef commit 08ff66b

File tree

6 files changed

+67
-4
lines changed

6 files changed

+67
-4
lines changed

Diff for: code.js

+20
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,26 @@ Code.init = function (toolbox) {
891891
}(name));
892892
}
893893

894+
var filterBtn = document.querySelectorAll('.filterBtn');
895+
if(Code.getTags()[0]=='smart'){
896+
filterBtn[0].className = 'filterBtn';
897+
filterBtn[1].className = 'filterBtn selected';
898+
}
899+
filterBtn.forEach(function(item,index){
900+
filterBtn[index].onclick = function(){
901+
filterBtn.forEach(function(m,n){
902+
filterBtn[n].className = 'filterBtn';
903+
});
904+
filterBtn[index].className = 'filterBtn selected';
905+
var tagName = this.getAttribute('tag');
906+
if(tagName){
907+
window.history.pushState('tag', 'title', '/?tags=' + tagName);
908+
}else{
909+
window.history.pushState('tag', 'title', '/');
910+
}
911+
};
912+
});
913+
894914
onresize();
895915
};
896916

Diff for: css/style.css

+39
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,45 @@ html[dir="RTL"] .farSide {
1818
text-align: left;
1919
}
2020

21+
#mainTable{
22+
margin-left:42px;
23+
width:calc(100% - 42px);
24+
}
25+
26+
#blockFilter{
27+
width:42px;
28+
background:#333;
29+
position:fixed;
30+
top:110px;
31+
left:0;
32+
}
33+
34+
#blockFilter a{
35+
display:block;
36+
box-sizing:border-box;
37+
width:100%;
38+
height:36px;
39+
line-height:36px;
40+
text-align:center;
41+
color:#999;
42+
border-right-width:0px;
43+
border-right-style:solid;
44+
border-right-color:#f43;
45+
cursor:pointer;
46+
transition:.2s;
47+
}
48+
49+
#blockFilter a.selected{
50+
color:#fff;
51+
border-right-width:4px;
52+
background:#494949;
53+
}
54+
55+
#blockFilter a:hover{
56+
color:#fff;
57+
background:#494949;
58+
}
59+
2160

2261
/* Buttons */
2362

Diff for: msg/en.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var MSG = {
99
exportImage: "Download Image",
1010
userMenuDashboard: "Dashboard",
1111
userMenuTutorials: "Tutorials",
12-
userMenuWebSite: "Support",
12+
userMenuWebSite: "Web Site",
1313
userMenuLogout: "Logout",
1414
blocks: "Blocks",
1515
linkTooltip: "Save and Link to Blocks",

Diff for: msg/zh-hans.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var MSG = {
99
exportImage: "下载图片",
1010
userMenuDashboard: "专案管理",
1111
userMenuTutorials: "教学",
12-
userMenuWebSite: "资讯",
12+
userMenuWebSite: "官方网站",
1313
userMenuLogout: "登出",
1414
blocks: "积木",
1515
linkTooltip: "储存并产生连结",

Diff for: msg/zh-hant.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var MSG = {
99
exportImage: "下載圖片",
1010
userMenuDashboard: "專案管理",
1111
userMenuTutorials: "教學",
12-
userMenuWebSite: "資訊",
12+
userMenuWebSite: "官網",
1313
userMenuLogout: "登出",
1414
blocks: "積木",
1515
linkTooltip: "儲存並產生連結",

Diff for: views/index.handlebars

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
<a href="#close" title="Close" class="close">X</a>
1515
</div>
1616
</div>
17-
<table width="100%" height="100%" class="nav">
17+
<div id="blockFilter">
18+
<a class="filterBtn selected">All</a>
19+
<a class="filterBtn" tag="smart">S</a>
20+
</div>
21+
<table class="nav" id="mainTable" height="100%">
1822
<tr>
1923
<td colspan=2>
2024
<table width="100%">

0 commit comments

Comments
 (0)