Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b877522b
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b877522b
编写于
3月 05, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use lodash throttle
上级
f517f691
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
26 deletion
+19
-26
extensions/markdown/package.json
extensions/markdown/package.json
+3
-1
extensions/markdown/preview-src/index.ts
extensions/markdown/preview-src/index.ts
+1
-24
extensions/markdown/preview-src/tsconfig.json
extensions/markdown/preview-src/tsconfig.json
+1
-1
extensions/markdown/yarn.lock
extensions/markdown/yarn.lock
+14
-0
未找到文件。
extensions/markdown/package.json
浏览文件 @
b877522b
...
...
@@ -283,12 +283,14 @@
},
"devDependencies"
:
{
"@types/highlight.js"
:
"9.1.10"
,
"@types/lodash.throttle"
:
"^4.1.3"
,
"@types/markdown-it"
:
"0.0.2"
,
"@types/node"
:
"7.0.43"
,
"lodash.throttle"
:
"^4.1.1"
,
"ts-loader"
:
"^4.0.1"
,
"typescript"
:
"^2.7.2"
,
"vscode"
:
"^1.1.10"
,
"webpack"
:
"^4.1.0"
,
"webpack-cli"
:
"^2.0.10"
}
}
}
\ No newline at end of file
extensions/markdown/preview-src/index.ts
浏览文件 @
b877522b
...
...
@@ -8,30 +8,7 @@ import { postCommand, postMessage } from './messaging';
import
{
onceDocumentLoaded
}
from
'
./events
'
;
import
{
getEditorLineNumberForPageOffset
,
scrollToRevealSourceLine
}
from
'
./scroll-sync
'
;
import
{
ActiveLineMarker
}
from
'
./activeLineMarker
'
;
// From https://remysharp.com/2010/07/21/throttling-function-calls
function
throttle
(
fn
:
(
x
:
any
)
=>
any
,
threshhold
:
any
,
scope
?:
any
)
{
threshhold
=
threshhold
||
(
threshhold
=
250
);
var
last
:
any
,
deferTimer
:
any
;
return
function
(
this
:
any
,
...
x
:
any
[])
{
var
context
=
scope
||
this
;
var
now
=
+
new
Date
,
args
=
arguments
;
if
(
last
&&
now
<
last
+
threshhold
)
{
// hold on to it
clearTimeout
(
deferTimer
);
deferTimer
=
setTimeout
(
function
()
{
last
=
now
;
fn
.
apply
(
context
,
args
);
},
threshhold
+
last
-
now
);
}
else
{
last
=
now
;
fn
.
apply
(
context
,
args
);
}
};
}
import
throttle
=
require
(
'
lodash.throttle
'
);
var
scrollDisabled
=
true
;
const
marker
=
new
ActiveLineMarker
();
...
...
extensions/markdown/preview-src/tsconfig.json
浏览文件 @
b877522b
{
"compilerOptions"
:
{
"outDir"
:
"./dist/"
,
"module"
:
"
es6
"
,
"module"
:
"
commonjs
"
,
"target"
:
"es6"
,
"jsx"
:
"react"
,
"sourceMap"
:
true
,
...
...
extensions/markdown/yarn.lock
浏览文件 @
b877522b
...
...
@@ -10,6 +10,16 @@
version "9.1.10"
resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-9.1.10.tgz#b621f809cd9573b80992b90cffc5788208e3069c"
"@types/lodash.throttle@^4.1.3":
version "4.1.3"
resolved "https://registry.yarnpkg.com/@types/lodash.throttle/-/lodash.throttle-4.1.3.tgz#8bfa4fec519d09ebce56c815bcbff3e55c604db9"
dependencies:
"@types/lodash" "*"
"@types/lodash@*":
version "4.14.104"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.104.tgz#53ee2357fa2e6e68379341d92eb2ecea4b11bb80"
"@types/markdown-it@0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-0.0.2.tgz#5d9ad19e6e6508cdd2f2596df86fd0aade598660"
...
...
@@ -3277,6 +3287,10 @@ lodash.templatesettings@^3.0.0:
lodash._reinterpolate "^3.0.0"
lodash.escape "^3.0.0"
lodash.throttle@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
lodash@^4.11.1, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0:
version "4.17.5"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录