Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
烟灰好
edex-ui
提交
d8d1614d
E
edex-ui
项目概览
烟灰好
/
edex-ui
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
edex-ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d8d1614d
编写于
1月 29, 2017
作者:
G
GitSquared
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Keyboard final layout
上级
b79e3b87
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
72 addition
and
17 deletion
+72
-17
resources/keyboards/qwerty.json
resources/keyboards/qwerty.json
+4
-4
resources/sections/keyboard.css
resources/sections/keyboard.css
+40
-8
resources/sections/keyboard.js
resources/sections/keyboard.js
+28
-5
未找到文件。
resources/keyboards/qwerty.json
浏览文件 @
d8d1614d
{
"keyboard_numbers"
:
[
"
1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"0"
,
"←
"
],
"keyboard_qwerty"
:
[
"
Q"
,
"W"
,
"E"
,
"R"
,
"T"
,
"Y"
,
"U"
,
"I"
,
"O"
,
"P
"
],
"keyboard_asdfgh"
:
[
"
A"
,
"S"
,
"D"
,
"F"
,
"G"
,
"H"
,
"J"
,
"K"
,
"L"
,
";
"
],
"keyboard_zxcvhn"
:
[
"
Z"
,
"X"
,
"C"
,
"V"
,
"H"
,
"N"
,
"M"
,
","
,
"."
,
"/
"
],
"keyboard_numbers"
:
[
"
ESC"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"0"
,
"BACK
"
],
"keyboard_qwerty"
:
[
"
TAB"
,
"Q"
,
"W"
,
"E"
,
"R"
,
"T"
,
"Y"
,
"U"
,
"I"
,
"O"
,
"P"
,
"|
"
],
"keyboard_asdfgh"
:
[
"
CAPS"
,
"A"
,
"S"
,
"D"
,
"F"
,
"G"
,
"H"
,
"J"
,
"K"
,
"L"
,
";"
,
"ENTER
"
],
"keyboard_zxcvhn"
:
[
"
SHIFT"
,
"Z"
,
"X"
,
"C"
,
"V"
,
"H"
,
"N"
,
"M"
,
","
,
"."
,
"/"
,
"SHIFT
"
],
"keyboard_spacebar"
:
[
" "
]
}
resources/sections/keyboard.css
浏览文件 @
d8d1614d
section
#keyboard
{
width
:
6
0%
;
width
:
10
0%
;
align-self
:
flex-start
;
border
:
none
;
}
...
...
@@ -14,17 +14,49 @@ section#keyboard tr {
justify-content
:
center
;
flex-wrap
:
nowrap
;
flex-direction
:
row
;
position
:
relative
;
}
section
#keyboard
td
{
font-size
:
35px
;
border
:
2px
solid
#a0a5a3
;
margin
:
5px
;
padding
:
3px
;
height
:
40px
;
width
:
40px
;
font-size
:
23px
;
border
:
none
;
border-radius
:
3px
;
margin
:
6px
;
padding
:
2px
;
margin-left
:
8px
;
margin-right
:
8px
;
height
:
38px
;
width
:
33px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
section
#keyboard
td
:active
{
background-color
:
#bec4c1
;
}
section
#keyboard
td
.function_key
{
width
:
auto
;
font-size
:
17px
;
padding-left
:
10px
;
padding-right
:
10px
;
}
#keyboard_numbers
{
right
:
10px
;
}
#keyboard_qwerty
{
right
:
5px
;
}
#keyboard_asdfgh
{
left
:
25px
;
}
#keyboard_spacebar
td
{
width
:
45%
!important
;
width
:
20%
!important
;
height
:
19px
!important
;
border
:
1px
solid
#a0a5a3
!important
;
}
resources/sections/keyboard.js
浏览文件 @
d8d1614d
...
...
@@ -19,23 +19,46 @@ function loadKeyboard(file) {
fs
.
readFile
(
file
,
{
encoding
:
'
utf-8
'
},
function
(
err
,
data
)
{
if
(
!
err
)
{
var
keyboard
=
JSON
.
parse
(
data
);
var
function_keys
=
[
"
SHIFT
"
,
"
ENTER
"
,
"
CAPS
"
,
"
TAB
"
,
"
ESC
"
,
"
BACK
"
];
keyboard
.
keyboard_numbers
.
forEach
((
value
,
index
)
=>
{
$
(
"
#keyboard_numbers
"
).
append
(
'
<td>
'
+
value
+
'
</td>
'
);
if
(
contains
.
call
(
function_keys
,
value
))
{
$
(
"
#keyboard_numbers
"
).
append
(
'
<td class="function_key">
'
+
value
+
'
</td>
'
);
}
else
{
$
(
"
#keyboard_numbers
"
).
append
(
'
<td>
'
+
value
+
'
</td>
'
);
}
});
keyboard
.
keyboard_qwerty
.
forEach
((
value
,
index
)
=>
{
$
(
"
#keyboard_qwerty
"
).
append
(
'
<td>
'
+
value
+
'
</td>
'
);
if
(
contains
.
call
(
function_keys
,
value
))
{
$
(
"
#keyboard_qwerty
"
).
append
(
'
<td class="function_key">
'
+
value
+
'
</td>
'
);
}
else
{
$
(
"
#keyboard_qwerty
"
).
append
(
'
<td>
'
+
value
+
'
</td>
'
);
}
});
keyboard
.
keyboard_asdfgh
.
forEach
((
value
,
index
)
=>
{
$
(
"
#keyboard_asdfgh
"
).
append
(
'
<td>
'
+
value
+
'
</td>
'
);
if
(
contains
.
call
(
function_keys
,
value
))
{
$
(
"
#keyboard_asdfgh
"
).
append
(
'
<td class="function_key">
'
+
value
+
'
</td>
'
);
}
else
{
$
(
"
#keyboard_asdfgh
"
).
append
(
'
<td>
'
+
value
+
'
</td>
'
);
}
});
keyboard
.
keyboard_zxcvhn
.
forEach
((
value
,
index
)
=>
{
$
(
"
#keyboard_zxcvhn
"
).
append
(
'
<td>
'
+
value
+
'
</td>
'
);
if
(
contains
.
call
(
function_keys
,
value
))
{
$
(
"
#keyboard_zxcvhn
"
).
append
(
'
<td class="function_key">
'
+
value
+
'
</td>
'
);
}
else
{
$
(
"
#keyboard_zxcvhn
"
).
append
(
'
<td>
'
+
value
+
'
</td>
'
);
}
});
keyboard
.
keyboard_spacebar
.
forEach
((
value
,
index
)
=>
{
$
(
"
#keyboard_spacebar
"
).
append
(
'
<td>
'
+
value
+
'
</td>
'
);
if
(
contains
.
call
(
function_keys
,
value
))
{
$
(
"
#keyboard_spacebar
"
).
append
(
'
<td class="function_key">
'
+
value
+
'
</td>
'
);
}
else
{
$
(
"
#keyboard_spacebar
"
).
append
(
'
<td>
'
+
value
+
'
</td>
'
);
}
});
}
else
{
console
.
log
(
"
ERROR:
"
+
err
);
}
});
}
var
contains
=
function
(
needle
){
var
findNaN
=
needle
!==
needle
;
var
indexOf
;
if
(
!
findNaN
&&
typeof
Array
.
prototype
.
indexOf
===
'
function
'
){
indexOf
=
Array
.
prototype
.
indexOf
}
else
{
indexOf
=
function
(
needle
){
var
i
=-
1
,
index
=-
1
;
for
(
i
=
0
;
i
<
this
.
length
;
i
+=
1
){
var
item
=
this
[
i
];
if
((
findNaN
&&
item
!==
item
)
||
item
===
needle
){
index
=
i
;
break
}}
return
index
}}
return
indexOf
.
call
(
this
,
needle
)
>-
1
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录