Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gzupanda
code-server
提交
d6d24966
C
code-server
项目概览
gzupanda
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
d6d24966
编写于
8月 04, 2020
作者:
A
Asher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move vscode JS to a separate file
Mostly to match everything else.
上级
751a5ea3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
59 addition
and
51 deletion
+59
-51
ci/build/build-code-server.sh
ci/build/build-code-server.sh
+3
-2
ci/dev/watch.ts
ci/dev/watch.ts
+2
-1
src/browser/pages/vscode.html
src/browser/pages/vscode.html
+1
-48
src/browser/pages/vscode.ts
src/browser/pages/vscode.ts
+53
-0
未找到文件。
ci/build/build-code-server.sh
浏览文件 @
d6d24966
...
...
@@ -21,9 +21,10 @@ main() {
--public-url
"."
\
--out-dir
dist
\
$(
[[
$MINIFY
]]
||
echo
--no-minify
)
\
src/browser/login.ts
\
src/browser/register.ts
\
src/browser/serviceWorker.ts
src/browser/serviceWorker.ts
\
src/browser/pages/login.ts
\
src/browser/pages/vscode.ts
}
main
"
$@
"
ci/dev/watch.ts
浏览文件 @
d6d24966
...
...
@@ -165,9 +165,10 @@ class Watcher {
private
createBundler
(
out
=
"
dist
"
):
Bundler
{
return
new
Bundler
(
[
path
.
join
(
this
.
rootPath
,
"
src/browser/login.ts
"
),
path
.
join
(
this
.
rootPath
,
"
src/browser/register.ts
"
),
path
.
join
(
this
.
rootPath
,
"
src/browser/serviceWorker.ts
"
),
path
.
join
(
this
.
rootPath
,
"
src/browser/pages/login.ts
"
),
path
.
join
(
this
.
rootPath
,
"
src/browser/pages/vscode.ts
"
),
],
{
outDir
:
path
.
join
(
this
.
rootPath
,
out
),
...
...
src/browser/pages/vscode.html
浏览文件 @
d6d24966
...
...
@@ -43,47 +43,7 @@
<body
aria-label=
""
></body>
<!-- Startup (do not modify order of script tags!) -->
<script>
let
nlsConfig
try
{
nlsConfig
=
JSON
.
parse
(
document
.
getElementById
(
"
vscode-remote-nls-configuration
"
).
getAttribute
(
"
data-settings
"
))
if
(
nlsConfig
.
_resolvedLanguagePackCoreLocation
)
{
const
bundles
=
Object
.
create
(
null
)
nlsConfig
.
loadBundle
=
(
bundle
,
language
,
cb
)
=>
{
let
result
=
bundles
[
bundle
]
if
(
result
)
{
return
cb
(
undefined
,
result
)
}
// FIXME: Only works if path separators are /.
const
path
=
nlsConfig
.
_resolvedLanguagePackCoreLocation
+
"
/
"
+
bundle
.
replace
(
/
\/
/g
,
"
!
"
)
+
"
.nls.json
"
fetch
(
`{{BASE}}/resource/?path=
${
encodeURIComponent
(
path
)}
`
)
.
then
((
response
)
=>
response
.
json
())
.
then
((
json
)
=>
{
bundles
[
bundle
]
=
json
cb
(
undefined
,
json
)
})
.
catch
(
cb
)
}
}
}
catch
(
error
)
{
/* Probably fine. */
}
self
.
require
=
{
baseUrl
:
"
{{CS_STATIC_BASE}}/lib/vscode/out
"
,
paths
:
{
"
vscode-textmate
"
:
`../node_modules/vscode-textmate/release/main`
,
"
vscode-oniguruma
"
:
`../node_modules/vscode-oniguruma/release/main`
,
xterm
:
`../node_modules/xterm/lib/xterm.js`
,
"
xterm-addon-search
"
:
`../node_modules/xterm-addon-search/lib/xterm-addon-search.js`
,
"
xterm-addon-unicode11
"
:
`../node_modules/xterm-addon-unicode11/lib/xterm-addon-unicode11.js`
,
"
xterm-addon-webgl
"
:
`../node_modules/xterm-addon-webgl/lib/xterm-addon-webgl.js`
,
"
semver-umd
"
:
`../node_modules/semver-umd/lib/semver-umd.js`
,
"
iconv-lite-umd
"
:
`../node_modules/iconv-lite-umd/lib/iconv-lite-umd.js`
,
jschardet
:
`../node_modules/jschardet/dist/jschardet.min.js`
,
},
"
vs/nls
"
:
nlsConfig
,
}
</script>
<script
data-cfasync=
"false"
src=
"{{CS_STATIC_BASE}}/dist/pages/vscode.js"
></script>
<script
data-cfasync=
"false"
src=
"{{CS_STATIC_BASE}}/dist/register.js"
></script>
<script
data-cfasync=
"false"
src=
"{{CS_STATIC_BASE}}/lib/vscode/out/vs/loader.js"
></script>
<!-- PROD_ONLY
...
...
@@ -93,11 +53,4 @@
<script>
require
([
"
vs/code/browser/workbench/workbench
"
],
function
()
{})
</script>
<script>
try
{
document
.
body
.
style
.
background
=
JSON
.
parse
(
localStorage
.
getItem
(
"
colorThemeData
"
)).
colorMap
[
"
editor.background
"
]
}
catch
(
error
)
{
// Oh well.
}
</script>
</html>
src/browser/pages/vscode.ts
0 → 100644
浏览文件 @
d6d24966
import
{
getOptions
}
from
"
../../common/util
"
const
options
=
getOptions
()
// TODO: Add proper types.
/* eslint-disable @typescript-eslint/no-explicit-any */
let
nlsConfig
:
any
try
{
nlsConfig
=
JSON
.
parse
(
document
.
getElementById
(
"
vscode-remote-nls-configuration
"
)
!
.
getAttribute
(
"
data-settings
"
)
!
)
if
(
nlsConfig
.
_resolvedLanguagePackCoreLocation
)
{
const
bundles
=
Object
.
create
(
null
)
nlsConfig
.
loadBundle
=
(
bundle
:
any
,
_language
:
any
,
cb
:
any
):
void
=>
{
const
result
=
bundles
[
bundle
]
if
(
result
)
{
return
cb
(
undefined
,
result
)
}
// FIXME: Only works if path separators are /.
const
path
=
nlsConfig
.
_resolvedLanguagePackCoreLocation
+
"
/
"
+
bundle
.
replace
(
/
\/
/g
,
"
!
"
)
+
"
.nls.json
"
fetch
(
`{{BASE}}/resource/?path=
${
encodeURIComponent
(
path
)}
`
)
.
then
((
response
)
=>
response
.
json
())
.
then
((
json
)
=>
{
bundles
[
bundle
]
=
json
cb
(
undefined
,
json
)
})
.
catch
(
cb
)
}
}
}
catch
(
error
)
{
/* Probably fine. */
}
;(
self
.
require
as
any
)
=
{
baseUrl
:
`
${
options
.
csStaticBase
}
/lib/vscode/out`
,
paths
:
{
"
vscode-textmate
"
:
`../node_modules/vscode-textmate/release/main`
,
"
vscode-oniguruma
"
:
`../node_modules/vscode-oniguruma/release/main`
,
xterm
:
`../node_modules/xterm/lib/xterm.js`
,
"
xterm-addon-search
"
:
`../node_modules/xterm-addon-search/lib/xterm-addon-search.js`
,
"
xterm-addon-unicode11
"
:
`../node_modules/xterm-addon-unicode11/lib/xterm-addon-unicode11.js`
,
"
xterm-addon-webgl
"
:
`../node_modules/xterm-addon-webgl/lib/xterm-addon-webgl.js`
,
"
semver-umd
"
:
`../node_modules/semver-umd/lib/semver-umd.js`
,
"
iconv-lite-umd
"
:
`../node_modules/iconv-lite-umd/lib/iconv-lite-umd.js`
,
jschardet
:
`../node_modules/jschardet/dist/jschardet.min.js`
,
},
"
vs/nls
"
:
nlsConfig
,
}
try
{
document
.
body
.
style
.
background
=
JSON
.
parse
(
localStorage
.
getItem
(
"
colorThemeData
"
)
!
).
colorMap
[
"
editor.background
"
]
}
catch
(
error
)
{
// Oh well.
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录