Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tianyazhichiC
algorithm-visualizer
提交
6d6faa2b
A
algorithm-visualizer
项目概览
tianyazhichiC
/
algorithm-visualizer
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
algorithm-visualizer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6d6faa2b
编写于
5月 28, 2016
作者:
J
Jason Park
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor
上级
63bad1db
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
12 deletion
+13
-12
js/script.js
js/script.js
+13
-12
未找到文件。
js/script.js
浏览文件 @
6d6faa2b
...
...
@@ -112,7 +112,7 @@ var executeDataAndCode = function () {
}).
fail
(
onFail
);
}).
fail
(
onFail
);
}
set
AlgorithmHas
h
(
category
,
algorithm
,
isScratchPaper
(
category
)
?
null
:
file
);
set
Pat
h
(
category
,
algorithm
,
isScratchPaper
(
category
)
?
null
:
file
);
};
var
checkLoading
=
function
()
{
if
(
loading
)
{
...
...
@@ -262,15 +262,15 @@ var executeDataAndCode = function () {
showDescription
(
data
);
showFiles
(
category
,
algorithm
,
files
,
requestedFile
);
});
set
AlgorithmHas
h
(
category
,
algorithm
);
set
Pat
h
(
category
,
algorithm
);
};
var
list
=
{};
var
anyOpened
=
false
;
$
.
getJSON
(
'
./algorithm/category.json
'
,
function
(
data
)
{
var
algorithmHash
=
getAlgorithmHas
h
();
var
requestedCategory
=
algorithmHas
h
[
'
category
'
],
requestedAlgorithm
=
algorithmHas
h
[
'
algorithm
'
],
requestedFile
=
algorithmHas
h
[
'
file
'
];
var
path
=
getPat
h
();
var
requestedCategory
=
pat
h
[
'
category
'
],
requestedAlgorithm
=
pat
h
[
'
algorithm
'
],
requestedFile
=
pat
h
[
'
file
'
];
var
anyRequested
=
requestedCategory
&&
requestedAlgorithm
;
anyOpened
=
false
;
var
$selectedCategory
=
null
,
$selectedAlgorithm
=
null
;
...
...
@@ -294,7 +294,7 @@ var executeDataAndCode = function () {
.
attr
(
'
data-algorithm
'
,
algorithm
)
.
attr
(
'
data-category
'
,
category
)
.
click
(
function
()
{
loadAlgorithm
(
category
,
algorithm
);
loadAlgorithm
(
category
,
algorithm
,
requestedFile
);
});
$
(
'
#list
'
).
append
(
$algorithm
);
if
(
anyRequested
)
{
...
...
@@ -324,6 +324,7 @@ var executeDataAndCode = function () {
showErrorToast
(
'
Oops! This link appears to be broken.
'
);
$
(
'
#scratch-paper
'
).
click
();
}
requestedFile
=
null
;
});
$
(
'
#powered-by
'
).
click
(
function
()
{
$
(
'
#powered-by-list button
'
).
toggleClass
(
'
collapse
'
);
...
...
@@ -580,12 +581,12 @@ var executeDataAndCode = function () {
window
.
location
.
hash
=
'
#
'
+
newHash
;
};
var
set
AlgorithmHas
h
=
function
(
category
,
algorithm
,
file
)
{
var
algorithmHas
h
=
category
?
category
+
(
algorithm
?
'
/
'
+
algorithm
+
(
file
?
'
/
'
+
file
:
''
)
:
''
)
:
''
;
setHashValue
(
'
algorithm
'
,
algorithmHas
h
);
var
set
Pat
h
=
function
(
category
,
algorithm
,
file
)
{
var
pat
h
=
category
?
category
+
(
algorithm
?
'
/
'
+
algorithm
+
(
file
?
'
/
'
+
file
:
''
)
:
''
)
:
''
;
setHashValue
(
'
algorithm
'
,
pat
h
);
};
var
get
AlgorithmHas
h
=
function
()
{
var
get
Pat
h
=
function
()
{
var
hash
=
getHashValue
(
'
algorithm
'
);
if
(
hash
)
{
var
parts
=
hash
.
split
(
'
/
'
);
...
...
@@ -606,7 +607,7 @@ var executeDataAndCode = function () {
};
$
.
post
(
'
https://api.github.com/gists
'
,
JSON
.
stringify
(
gist
),
function
(
res
)
{
var
data
=
JSON
.
parse
(
res
);
set
AlgorithmHas
h
(
'
scratch
'
,
data
.
id
);
set
Pat
h
(
'
scratch
'
,
data
.
id
);
if
(
callback
)
callback
(
location
.
href
);
});
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录