Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
烟灰好
edex-ui
提交
6aae8778
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
6aae8778
编写于
6月 11, 2018
作者:
G
GitSquared
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💥
'); DROP TABLES 'commits' -- __injectCSS(); //
上级
ea199bd0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
15 deletion
+25
-15
src/_renderer.js
src/_renderer.js
+20
-0
src/classes/filesystem.class.js
src/classes/filesystem.class.js
+4
-14
src/ui.html
src/ui.html
+1
-1
未找到文件。
src/_renderer.js
浏览文件 @
6aae8778
...
...
@@ -2,6 +2,24 @@
window
.
eval
=
global
.
eval
=
function
()
{
throw
new
Error
(
"
eval() is disabled for security reasons.
"
);
};
// Security helper :)
window
.
_escapeHtml
=
(
text
)
=>
{
let
map
=
{
'
&
'
:
'
&
'
,
'
<
'
:
'
<
'
,
'
>
'
:
'
>
'
,
'
"
'
:
'
"
'
,
"
'
"
:
'
'
'
};
return
text
.
replace
(
/
[
&<>"'
]
/g
,
m
=>
{
return
map
[
m
];});
};
window
.
_purifyCSS
=
(
str
)
=>
{
let
map
=
{
'
<
'
:
'
<
'
,
'
>
'
:
'
>
'
};
return
str
.
replace
(
/
[
&<>"'
]
/g
,
m
=>
{
return
map
[
m
];});
};
// Initiate basic error handling
window
.
onerror
=
(
msg
,
path
,
line
,
col
,
error
)
=>
{
...
...
@@ -56,6 +74,8 @@ window._loadTheme = (theme) => {
body {
font-family: var(--font_main), sans-serif;
}
${
window
.
_purifyCSS
(
theme
.
injectCSS
||
""
)}
</style>`
;
window
.
theme
=
theme
;
...
...
src/classes/filesystem.class.js
浏览文件 @
6aae8778
...
...
@@ -107,25 +107,25 @@ class FilesystemDisplay {
this
.
_tmp
.
dirs
.
forEach
(
e
=>
{
this
.
cwd
.
push
({
name
:
this
.
_escapeHtml
(
e
),
name
:
window
.
_escapeHtml
(
e
),
type
:
"
dir
"
});
});
this
.
_tmp
.
symlinks
.
forEach
(
e
=>
{
this
.
cwd
.
push
({
name
:
this
.
_escapeHtml
(
e
),
name
:
window
.
_escapeHtml
(
e
),
type
:
"
symlink
"
});
});
this
.
_tmp
.
files
.
forEach
(
e
=>
{
if
(
tcwd
===
themesDir
&&
e
.
endsWith
(
"
.json
"
))
{
this
.
cwd
.
push
({
name
:
this
.
_escapeHtml
(
e
),
name
:
window
.
_escapeHtml
(
e
),
type
:
"
edex-theme
"
});
}
else
{
this
.
cwd
.
push
({
name
:
this
.
_escapeHtml
(
e
),
name
:
window
.
_escapeHtml
(
e
),
type
:
"
file
"
});
}
...
...
@@ -204,14 +204,4 @@ class FilesystemDisplay {
this
.
space_bar
.
bar
.
value
=
Math
.
round
(
this
.
fsBlock
.
use
);
};
}
_escapeHtml
(
text
)
{
let
map
=
{
'
&
'
:
'
&
'
,
'
<
'
:
'
<
'
,
'
>
'
:
'
>
'
,
'
"
'
:
'
"
'
,
"
'
"
:
'
'
'
};
return
text
.
replace
(
/
[
&<>"'
]
/g
,
m
=>
{
return
map
[
m
];});
}
}
src/ui.html
浏览文件 @
6aae8778
...
...
@@ -2,7 +2,7 @@
<html>
<head>
<meta
charset=
"utf-8"
/>
<meta
http-equiv=
"Content-Security-Policy"
content=
"default-src file: 'unsafe-inline'; connect-src ws:"
>
<meta
http-equiv=
"Content-Security-Policy"
content=
"default-src file: 'unsafe-inline';
img-src data:;
connect-src ws:"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
eDEX-UI
</title>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录