├── .gitignore
├── README.md
├── api.html
├── cooperation.html
├── css
├── base.css
└── jquery.snippet.min.css
├── demo
├── animate_gif.html
├── animate_grivty.html
├── animate_nodes.html
├── animate_spring.html
├── animate_spring_chain.html
├── animate_spring_circle.html
├── animate_spring_layout.html
├── animate_spring_mass.html
├── animate_spring_multi_target.html
├── animate_spring_nodes.html
├── animate_spring_nodes2.html
├── animate_sprite.html
├── animate_sprite2.html
├── animate_stepbystep.html
├── animation_performance.html
├── bundlelink.html
├── canvas-scroll.html
├── contact.html
├── container.html
├── custom_sprite.html
├── cutFruit.html
├── dev.html
├── div-node.html
├── dom.html
├── eagle-eye.html
├── edit.html
├── editor-new.html
├── editor.html
├── effect-split-node.html
├── flow-link.html
├── fmo.html
├── full-screen.html
├── hello-logo.html
├── helloworld.html
├── image_sprite.html
├── img
│ ├── OS_Apple.png
│ ├── bg.jpg
│ ├── cloud.png
│ ├── cur
│ │ ├── closedhand.cur
│ │ └── openhand.cur
│ ├── editor
│ │ ├── 1.png
│ │ ├── 10.png
│ │ ├── 11.png
│ │ ├── 12.png
│ │ ├── 13.png
│ │ ├── 14.png
│ │ ├── 15.png
│ │ ├── 16.png
│ │ ├── 17.png
│ │ ├── 18.png
│ │ ├── 19.png
│ │ ├── 2.png
│ │ ├── 20.png
│ │ ├── 21.png
│ │ ├── 3.png
│ │ ├── 4.png
│ │ ├── 5.png
│ │ ├── 6.png
│ │ ├── 7.png
│ │ ├── 8.png
│ │ └── 9.png
│ ├── effect
│ │ ├── all.png
│ │ └── caizhu.png
│ ├── fruit
│ │ ├── apple.png
│ │ ├── background.jpg
│ │ ├── banana.png
│ │ ├── basaha.png
│ │ ├── boom.png
│ │ ├── developing.png
│ │ ├── dojo.png
│ │ ├── flash.png
│ │ ├── flash_bak.png
│ │ ├── game-over.png
│ │ ├── home-desc.png
│ │ ├── home-mask.png
│ │ ├── logo.png
│ │ ├── lose.png
│ │ ├── new-game.png
│ │ ├── new.png
│ │ ├── ninja.png
│ │ ├── peach.png
│ │ ├── quit.png
│ │ ├── sandia.png
│ │ ├── score.png
│ │ └── xxxf.png
│ ├── game
│ │ ├── 1.png
│ │ ├── 10.png
│ │ ├── 2.png
│ │ ├── 3.png
│ │ ├── 4.png
│ │ ├── 5.png
│ │ ├── 6.png
│ │ ├── 7.png
│ │ ├── 8.png
│ │ ├── 9.png
│ │ ├── ball.png
│ │ ├── map_01.jpg
│ │ ├── sprite.png
│ │ └── vpc-lb.png
│ ├── host.png
│ ├── laptop.png
│ ├── mapslider.png
│ ├── memory.png
│ ├── mind
│ │ └── bg.png
│ ├── ne.png
│ ├── person.png
│ ├── pstn
│ │ ├── antenna.png
│ │ ├── cartridge_system.png
│ │ ├── cloud.png
│ │ ├── host.png
│ │ ├── line.png
│ │ ├── mainframe.png
│ │ ├── modem.png
│ │ ├── msc.png
│ │ ├── phone.png
│ │ ├── router.png
│ │ ├── router2.png
│ │ ├── satellite_antenna.png
│ │ ├── terminal.png
│ │ ├── testing.png
│ │ ├── tw130.png
│ │ └── wdm.png
│ ├── room.jpg
│ ├── statistics
│ │ ├── center.png
│ │ ├── cloud.png
│ │ ├── gather.png
│ │ ├── host.png
│ │ ├── server.png
│ │ ├── wanjet.png
│ │ └── wanjet2.png
│ ├── topo
│ │ ├── blue.png
│ │ ├── cloud.png
│ │ ├── gray.png
│ │ ├── green.png
│ │ ├── rect.png
│ │ ├── rect3.png
│ │ ├── red1.png
│ │ └── red2.png
│ ├── vm.png
│ ├── war
│ │ ├── bg.png
│ │ ├── cat.png
│ │ └── dog.png
│ ├── win7
│ │ ├── desktop.png
│ │ ├── excel.png
│ │ ├── folder.png
│ │ ├── mycomputer.png
│ │ ├── recycle.png
│ │ └── word.png
│ └── zone.png
├── inde.html
├── index.html
├── js
│ ├── jquery.css3.js
│ ├── jtopo-dom.js
│ ├── jtopo-min.js
│ ├── snippet
│ │ └── jquery.snippet.min.js
│ └── toolbar.js
├── layout-circle-auto.html
├── layout-circle.html
├── layout-mix.html
├── layout-star.html
├── layout-tree.html
├── layout.html
├── link.html
├── logo.html
├── map-big.html
├── map-node.html
├── map.html
├── matrix.html
├── mindmap-src.html
├── mindmap.html
├── naotu.html
├── new-architecture.html
├── node-label-position.html
├── node.html
├── painter.html
├── paopao - src.html
├── paopao.html
├── performance_asyn.html
├── performance_test.html
├── pstn.html
├── right-menu.html
├── save-as-png.html
├── save.html
├── scence_event.html
├── serialized.html
├── spring-layout.html
├── stage-mode.html
├── statictis.html
├── temp.html
├── topo-alarm.html
├── topo-bak.html
├── topo-barChart.html
├── topo-container-edit.html
├── topo-container.html
├── topo-desktop.html
├── topo-dom-tree.html
├── topo-edit.html
├── topo-grivty.html
├── topo-grivty2.html
├── topo-grivty3.html
├── topo-layout-mix-1.html
├── topo-layout.html
├── topo-level.html
├── topo-node-alarm.html
├── topo-node.html
├── topo-pieChart.html
├── topo-uml.html
├── topo.html
├── war.html
└── zoom.html
├── donate.html
├── download.html
├── download
├── jtopo-0.3.0-min.js
├── jtopo-0.3.1-min.js
├── jtopo-0.3.2-min.js
├── jtopo-0.3.3-min.js
├── jtopo-0.3.4-min.js
├── jtopo-0.3.5-min.js
├── jtopo-0.3.6-min.js
├── jtopo-0.4.0-min.js
├── jtopo-0.4.1-min.js
├── jtopo-0.4.2-min.js
├── jtopo-0.4.3-min.js
├── jtopo-0.4.4-min.js
├── jtopo-0.4.5-min.js
├── jtopo-0.4.6-min.js
├── jtopo-0.4.7-min.js
├── jtopo-0.4.8-min.js
└── jtopo-0.4.8_01-min.js
├── favicon.ico
├── img
├── bg-footer-noise.jpg
├── bg.jpg
├── bullet.png
├── dark-grey-tile.png
├── demo
│ ├── alarm.png
│ ├── animate2.png
│ ├── container.png
│ ├── eagleeye.png
│ ├── effect.png
│ ├── helloworld.png
│ ├── link.png
│ ├── mindmap.png
│ ├── node.png
│ ├── pstn.png
│ ├── spring-circle.png
│ ├── spring.png
│ ├── statics.png
│ ├── topology - 副本.png
│ ├── topology.png
│ └── win7desktop.png
├── donate_alipay.png
├── donate_wechat.png
├── download.png
├── feature-sprites.png
├── gauze.png
├── html5-logo.png
├── jq-global-nav.png
├── logo-jtopo.png
├── nva_bg_left.jpg
├── nva_bg_mid.jpg
└── nva_bg_right.jpg
├── index.html
├── introduction-in-5-minutes.html
└── js
├── api.js
├── demo.js
├── jquery.js
├── menu.js
└── site.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | ~$*
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # jTopo Api
2 | > 基于jtopo原官方网站的维护,感谢原作者莫言。
3 |
4 | ## jTopo原站点
5 | [jTopo原官方网站](http://www.jtopo.com/),最近无法访问。
6 |
7 | ## jTopo现站点
8 | [jTopo现在维护的网站](http://www.jtopo.cn/),该站点由个人出资维护,方便查询api和基础demo。后期将慢慢在网站上补充文档,同时更新的代码也会上传上去。
9 |
10 | ## 关于jTopo
11 | jTopo的原作者是莫言(网名),原官方网站:[http://www.jtopo.com](http://www.jtopo.com/),
12 | 原作者在官网网站对jTopo的最后一次更新版本号是0.4.8。
13 |
14 | ## 关于本项目
15 | 本项目主要是原JTopo官方网站的快照,
16 | 因为原作者暂时停止了对官网jtopo的更新,同时近期jtopo的官网已无法访问,要查阅api等信息,可到[该站点](http://www.jtopo.cn/)查询。该站点由个人购买服务器和域名维护,如果我有幸帮助到了您,欢迎您在[赞赏](http://www.jtopo.cn/donate.html)页面扫描二维码给予点滴鼓励。万分感谢!
17 |
18 | ## 关于对jTopo的维护
19 | 原作者的最近一次更新是 jtopo-0.4.8,这个版本经过多次迭代,算是比较稳定的一个版本了。
20 | 在此基础上,部分同行网友指出了一些可以优化和改进的地方,同时我在实际业务开发中,遇到了不少要求较高的需求。
21 | 基于这些原因,我对源码进行了增量修改,同时进行了二次封装,方便实际业务的开发。
22 |
23 | 由于原先jTopo的官方文档还不是很完善,加上我做了一些新的功能,所以会在官网快照的基础上,对该站点的几个页面进行补充和修改。以此作为我对jTopo的继续维护。
24 |
25 | ## jTopo项目化案例
26 | [jtopo_topology](https://github.com/xwenyuan/jtopo_topology)
27 |
28 | ## jTopo和其他几种拓扑组件
29 | 我主要调研或使用过下面几种拓扑组件:
30 |
31 | * jTopo
32 | 不依赖任何其他库,执行仅需一个Canvas,轻量,使用方便;
33 | 扩展性强,基于它能做很丰富的二次开发;
34 | 对于复杂一点的需求,文档显得不够详细。我在使用过程中自己完善和补充了一些,以及增量更新了一些代码。
35 | * vis.js
36 | 之前用过,也不错;
37 | 颜值一般,连线不能做出折线的效果,感兴趣的可以自己去修改;
38 | 也是免费的。
39 | * d3.js
40 | 挺强大的,因为生态圈比较广,所以学习曲线较长;
41 | 生态圈比较广,我后面有时间的话准备系统学一下。
42 | * qunee for html5
43 | 也是国人开发,功能强大、颜值高;
44 | 收费的,价钱不便宜。
45 | * 其他一些国外的
46 | 收费的居多。
47 |
48 | ## 感谢
49 | 感谢原作者莫言。
50 | 也感谢对jTopo源码进行过优化和完善的各位网友。
51 |
52 | 如果[jtopo_api](https://github.com/xwenyuan/jtopo_api)和[jtopo_topology](https://github.com/xwenyuan/jtopo_topology)这两个项目能够帮助到你的话,欢迎为我点个star。
53 | 如果路过的你有一些建议和想法,可以在[Issues](https://github.com/xwenyuan/jtopo_api/issues)中留言。
54 | 如果你也想一起维护这个项目,也可以给我留言,我将你加入到Collaborators。
55 |
56 |
--------------------------------------------------------------------------------
/api.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ').html(''
4 | +'
'
5 | +'
'
6 | +'
'
7 | +'
'
8 | +'
'
9 | +'
'
10 | +'
'
11 | +'
'
12 | +'
'
13 | +'
'
14 | +'
'
15 | +'
'
16 | +'
');
17 |
18 | $('#content').prepend(toobarDiv);
19 |
20 | // 工具栏按钮处理
21 | $("input[name='modeRadio']").click(function(){
22 | stage.mode = $("input[name='modeRadio']:checked").val();
23 | });
24 | $('#centerButton').click(function(){
25 | stage.centerAndZoom(); //缩放并居中显示
26 | });
27 | $('#zoomOutButton').click(function(){
28 | stage.zoomOut();
29 | });
30 | $('#zoomInButton').click(function(){
31 | stage.zoomIn();
32 | });
33 | $('#exportButton').click(function(){
34 | stage.saveImageInfo();
35 | });
36 | $('#zoomCheckbox').click(function(){
37 | if($('#zoomCheckbox').attr('checked')){
38 | stage.wheelZoom = 0.85; // 设置鼠标缩放比例
39 | }else{
40 | stage.wheelZoom = null; // 取消鼠标缩放比例
41 | }
42 | });
43 | $('#fullScreenButton').click(function(){
44 | runPrefixMethod(stage.canvas, "RequestFullScreen")
45 | });
46 |
47 | // 查询
48 | $('#findButton').click(function(){
49 | var text = $('#findText').val().trim();
50 | var nodes = stage.find('node[text="'+text+'"]');
51 | if(nodes.length > 0){
52 | var node = nodes[0];
53 | node.selected = true;
54 | var location = node.getCenterLocation();
55 | // 查询到的节点居中显示
56 | stage.setCenter(location.x, location.y);
57 |
58 | function nodeFlash(node, n){
59 | if(n == 0) {
60 | node.selected = false;
61 | return;
62 | };
63 | node.selected = !node.selected;
64 | setTimeout(function(){
65 | nodeFlash(node, n-1);
66 | }, 300);
67 | }
68 |
69 | // 闪烁几下
70 | nodeFlash(node, 6);
71 | }
72 | });
73 | }
74 |
75 | var runPrefixMethod = function(element, method) {
76 | var usablePrefixMethod;
77 | ["webkit", "moz", "ms", "o", ""].forEach(function(prefix) {
78 | if (usablePrefixMethod) return;
79 | if (prefix === "") {
80 | // 无前缀,方法首字母小写
81 | method = method.slice(0,1).toLowerCase() + method.slice(1);
82 | }
83 | var typePrefixMethod = typeof element[prefix + method];
84 | if (typePrefixMethod + "" !== "undefined") {
85 | if (typePrefixMethod === "function") {
86 | usablePrefixMethod = element[prefix + method]();
87 | } else {
88 | usablePrefixMethod = element[prefix + method];
89 | }
90 | }
91 | }
92 | );
93 |
94 | return usablePrefixMethod;
95 | };
96 | /*
97 | runPrefixMethod(this, "RequestFullScreen");
98 | if (typeof window.screenX === "number") {
99 | var eleFull = canvas;
100 | eleFull.addEventListener("click", function() {
101 | if (runPrefixMethod(document, "FullScreen") || runPrefixMethod(document, "IsFullScreen")) {
102 | runPrefixMethod(document, "CancelFullScreen");
103 | this.title = this.title.replace("退出", "");
104 | } else if (runPrefixMethod(this, "RequestFullScreen")) {
105 | this.title = this.title.replace("点击", "点击退出");
106 | }
107 | });
108 | } else {
109 | alert("浏览器不支持");
110 | }*/
111 |
--------------------------------------------------------------------------------
/demo/layout-circle-auto.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
52 |
53 |
56 |
57 |
58 |
59 |
62 |
63 |
68 |
69 |
70 |
71 |
72 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/demo/layout-circle.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
79 |
80 |
83 |
84 |
85 |
86 |
89 |
90 |
95 |
96 |
97 |
98 |
99 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/demo/layout-mix.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
86 |
87 |
90 |
91 |
92 |
93 |
96 |
97 |
102 |
103 |
104 |
105 |
106 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/demo/layout-star.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
86 |
87 |
90 |
91 |
92 |
93 |
96 |
97 |
102 |
103 |
104 |
105 |
106 |
109 |
110 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/demo/layout-tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
79 |
80 |
83 |
84 |
85 |
86 |
89 |
90 |
95 |
96 |
97 |
98 |
99 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/demo/layout.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
61 |
62 |
65 |
66 |
67 |
68 |
71 |
72 |
77 |
78 |
79 |
80 |
81 |
84 |
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/demo/logo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
99 |
100 |
101 |
102 |
103 |
104 |
107 |
108 |
111 |
112 |
113 |
114 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
131 |
132 |
133 |
134 |
135 |
--------------------------------------------------------------------------------
/demo/map-node.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
67 |
68 |
71 |
72 |
73 |
74 |
77 |
78 |
86 |
87 |
88 |
89 |
90 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/demo/matrix.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
88 |
89 |
92 |
93 |
94 |
95 |
98 |
99 |
104 |
105 |
106 |
107 |
108 |
111 |
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/demo/new-architecture.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
80 |
81 |
84 |
85 |
86 |
87 |
90 |
91 |
98 |
99 |
100 |
101 |
102 |
105 |
106 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/demo/node-label-position.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
74 |
75 |
78 |
79 |
80 |
81 |
84 |
85 |
89 |
90 |
91 |
92 |
93 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/demo/painter.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
64 |
65 |
66 |
67 |
68 |
69 |
72 |
73 |
76 |
77 |
78 |
79 |
82 |
83 |
88 |
89 |
90 |
91 |
92 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/demo/performance_test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo 性能测试
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
87 |
88 |
91 |
92 |
93 |
94 |
97 |
98 |
99 |
随机生成1万个节点、5000条连线 (创建数据较多, 期间请耐心等候)
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/demo/save-as-png.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
71 |
72 |
75 |
76 |
77 |
78 |
81 |
82 |
88 |
89 |
90 |
91 |
92 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/demo/save.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
39 |
40 |
43 |
44 |
45 |
46 |
49 |
50 |
55 |
56 |
57 |
58 |
59 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/demo/scence_event.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
76 |
77 |
80 |
81 |
82 |
83 |
86 |
87 |
92 |
93 |
94 |
95 |
96 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/demo/spring-layout.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
73 |
74 |
77 |
78 |
79 |
80 |
83 |
84 |
89 |
90 |
91 |
92 |
93 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/demo/topo-barChart.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
59 |
60 |
63 |
64 |
65 |
66 |
69 |
70 |
75 |
76 |
77 |
78 |
79 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/demo/topo-container-edit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
55 |
56 |
59 |
60 |
61 |
62 |
65 |
66 |
71 |
72 |
73 |
74 |
75 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/demo/topo-container.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
83 |
84 |
87 |
88 |
89 |
90 |
93 |
94 |
99 |
100 |
101 |
102 |
103 |
106 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/demo/topo-desktop.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
72 |
73 |
76 |
77 |
78 |
79 |
82 |
83 |
88 |
89 |
90 |
91 |
92 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/demo/topo-grivty.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
71 |
72 |
75 |
76 |
77 |
78 |
81 |
82 |
87 |
88 |
89 |
90 |
91 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/demo/topo-grivty2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
79 |
80 |
83 |
84 |
85 |
86 |
89 |
90 |
95 |
96 |
97 |
98 |
99 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/demo/topo-grivty3.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
85 |
86 |
89 |
90 |
91 |
92 |
95 |
96 |
101 |
102 |
103 |
104 |
105 |
108 |
109 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/demo/topo-layout-mix-1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
69 |
70 |
73 |
74 |
75 |
76 |
79 |
80 |
85 |
86 |
87 |
88 |
89 |
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/demo/topo-node-alarm.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
60 |
61 |
64 |
65 |
66 |
67 |
70 |
71 |
76 |
77 |
78 |
79 |
80 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/demo/topo-node.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
57 |
58 |
61 |
62 |
63 |
64 |
67 |
68 |
73 |
74 |
75 |
76 |
77 |
80 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/demo/topo-pieChart.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
64 |
65 |
68 |
69 |
70 |
71 |
74 |
75 |
80 |
81 |
82 |
83 |
84 |
87 |
88 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/demo/topo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo 自动布局
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
87 |
88 |
91 |
92 |
93 |
94 |
97 |
98 |
103 |
104 |
105 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/demo/zoom.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
jTopo Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
60 |
61 |
64 |
65 |
66 |
67 |
70 |
71 |
76 |
77 |
78 |
79 |
80 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/donate.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
jTopo 鼓励一下
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
21 |
22 |
我不是原作者,因为原作者不再维护,所以我将和jtopo爱好者们一起在原作者的基础上继续开发和维护.
23 |
为了方便大家的日常使用,提供一个长期稳定的api及demo查询平台,我会个人出资将这个网站维护下去.
24 |
服务器和域名需要资金来支持,如果我们有幸帮助到了您,您可以通过扫描下面二维码小小鼓励我们一下.
25 |
扫描二维码的网友们记得备注一下"jtopo+您的昵称+想给我的留言",我会在下面公示所有收到的赞赏.
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | 赞赏者 |
34 | 赞赏值 |
35 | 留言 |
36 |
37 |
38 | h*g |
39 | ¥10.00 |
40 | |
41 |
42 |
43 | Jovi.qu |
44 | ¥8.00 |
45 | 好好工作,以示鼓励! |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
79 |
80 |
--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/favicon.ico
--------------------------------------------------------------------------------
/img/bg-footer-noise.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/bg-footer-noise.jpg
--------------------------------------------------------------------------------
/img/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/bg.jpg
--------------------------------------------------------------------------------
/img/bullet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/bullet.png
--------------------------------------------------------------------------------
/img/dark-grey-tile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/dark-grey-tile.png
--------------------------------------------------------------------------------
/img/demo/alarm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/alarm.png
--------------------------------------------------------------------------------
/img/demo/animate2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/animate2.png
--------------------------------------------------------------------------------
/img/demo/container.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/container.png
--------------------------------------------------------------------------------
/img/demo/eagleeye.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/eagleeye.png
--------------------------------------------------------------------------------
/img/demo/effect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/effect.png
--------------------------------------------------------------------------------
/img/demo/helloworld.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/helloworld.png
--------------------------------------------------------------------------------
/img/demo/link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/link.png
--------------------------------------------------------------------------------
/img/demo/mindmap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/mindmap.png
--------------------------------------------------------------------------------
/img/demo/node.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/node.png
--------------------------------------------------------------------------------
/img/demo/pstn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/pstn.png
--------------------------------------------------------------------------------
/img/demo/spring-circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/spring-circle.png
--------------------------------------------------------------------------------
/img/demo/spring.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/spring.png
--------------------------------------------------------------------------------
/img/demo/statics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/statics.png
--------------------------------------------------------------------------------
/img/demo/topology - 副本.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/topology - 副本.png
--------------------------------------------------------------------------------
/img/demo/topology.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/topology.png
--------------------------------------------------------------------------------
/img/demo/win7desktop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/demo/win7desktop.png
--------------------------------------------------------------------------------
/img/donate_alipay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/donate_alipay.png
--------------------------------------------------------------------------------
/img/donate_wechat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/donate_wechat.png
--------------------------------------------------------------------------------
/img/download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/download.png
--------------------------------------------------------------------------------
/img/feature-sprites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/feature-sprites.png
--------------------------------------------------------------------------------
/img/gauze.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/gauze.png
--------------------------------------------------------------------------------
/img/html5-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/html5-logo.png
--------------------------------------------------------------------------------
/img/jq-global-nav.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/jq-global-nav.png
--------------------------------------------------------------------------------
/img/logo-jtopo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/logo-jtopo.png
--------------------------------------------------------------------------------
/img/nva_bg_left.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/nva_bg_left.jpg
--------------------------------------------------------------------------------
/img/nva_bg_mid.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/nva_bg_mid.jpg
--------------------------------------------------------------------------------
/img/nva_bg_right.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wenyuan/jtopo_api/9fe28fe5d527018911b8dd35f05e2b8efd97e46b/img/nva_bg_right.jpg
--------------------------------------------------------------------------------
/introduction-in-5-minutes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
jTopo 入门指南
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
30 |
31 |
36 |
37 |
38 |
39 |
42 |
43 |
46 |
47 |
48 |
49 |
50 | -
51 |
Hello World!
52 |
53 | // <script type="text/javascript" src="js/jtopo-min.js"></script> // 引入jtopo
54 | var canvas = document.getElementById('canvas');
55 | var stage = new JTopo.Stage(canvas); // 创建一个舞台对象
56 | var scene = new JTopo.Scene(stage); // 创建一个场景对象
57 |
58 | var node = new JTopo.Node("Hello"); // 创建一个节点
59 | node.setLocation(300,200); // 设置节点坐标
60 | scene.add(node); // 放入到场景中
61 |
62 |
65 |
66 | -
67 |
节点设置
68 |
69 | var node = new JTopo.Node("Hello"); // 创建一个节点
70 | node.setLocation(300,200); // 设置节点坐标
71 | node.rotate = Math.random(); // 旋转角度
72 | node.scaleX = Math.random(); // 水平方向的缩放
73 | node.scaleY = Math.random(); // 垂直方向的缩放
74 | node.alpha = Math.random(); // 透明度
75 | node.setImage('host.png'); // 设置图片
76 |
77 |
80 |
81 | -
82 |
连线
83 |
84 |
85 | var stage = new JTopo.Stage(canvas);
86 | var scene = new JTopo.Scene(stage);
87 |
88 | var nodeFrom = new JTopo.Node("from");
89 | nodeFrom.setLocation(200,200);
90 | scene.add(nodeFrom);
91 |
92 | var nodeTo = new JTopo.Node("To");
93 | nodeTo.setLocation(300,200);
94 | scene.add(nodeTo);
95 |
96 | var link = new JTopo.Link(nodeFrom, nodeTo); // 增加连线
97 | scene.add(link);
98 |
99 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/js/demo.js:
--------------------------------------------------------------------------------
1 |
2 | (function(){
3 | var demos = [
4 | '核心对象',
5 | {text:'Hello world', href:'helloworld.html'},
6 | {text:'节点', href:'node.html'},
7 | {text:'连线', href:'link.html'},
8 | {text:'连线组', href:'bundlelink.html'},
9 | {text:'文字定位', href:'node-label-position.html'},
10 | {text:'容器分组', href:'container.html'},
11 | {text:'性能测试', href:'performance_test.html'},
12 | {text:'动画', href:'animate_stepbystep.html'},
13 | {text:'动画性能测试', href:'animation_performance.html'},
14 | {text:'鹰眼', href:'eagle-eye.html'},
15 | '网络拓扑',
16 | {text:'设备关系', href:'statictis.html'},
17 | {text:'PSTN', href:'pstn.html'},
18 | {text:'矩阵', href:'matrix.html'},
19 | '拓扑图形',
20 | {text:'圆形布局', href:'layout-circle.html'},
21 | {text:'树形布局', href:'layout-tree.html'},
22 | {text:'混合布局', href:'layout-mix.html'},
23 | {text:'树形布局(全自动)', href:'topo.html'},
24 | {text:'告警', href:'topo-alarm.html'},
25 | {text:'在线编辑', href:'edit.html'},
26 | '统计图表',
27 | {text:'饼图', href:'topo-pieChart.html'},
28 | {text:'柱状图', href:'topo-barChart.html'},
29 | //{text:'布局', href:'topo-layout.html'},
30 | //{text:'布局2', href:'topo-layout2.html'},
31 | //{text:'混合布局', href:'topo-layout-mix-2.html'},
32 | //{text:'布局-动态', href:'topo-layout3.html'},
33 | '动画效果',
34 | {text:'重力', href:'animate_grivty.html'},
35 | {text:'美丽星空', href:'animate_spring_mass.html'},
36 | {text:'弹性-简单', href:'animate_spring.html'},
37 | {text:'弹性-弹簧链', href:'animate_spring_chain.html'},
38 | {text:'弹性-多节点', href:'animate_spring_circle.html'},
39 | {text:'弹性-控制点', href:'animate_spring_multi_target.html'},
40 | '其他',
41 | {text:'右键菜单', href:'right-menu.html'},
42 | {text:'在线脑图', href:'naotu.html'},
43 | {text:'切水果', href:'cutFruit.html'},
44 | {text:'泡泡堂', href:'paopao.html'},
45 | {text:'GIS地图', href:'map.html'},
46 | {text:'序列化反序列化', href:'serialized.html'},
47 | {text:'场景切换', href:'scence_event.html'},
48 | {text:'Gif模拟', href:'animate_gif.html'},
49 | {text:'Win7桌面', href:'topo-desktop.html'},
50 | {text:'乌龟绘图', href:'hello-logo.html'},
51 | {text:'联系作者', href:'contact.html'}
52 |
53 | ];
54 |
55 | function drawMenus(menus){
56 | var ul = $('#menu').empty();
57 | var li = null;
58 | var children = null;
59 | $.each(demos, function(i, e){
60 | if(typeof e == 'string'){
61 | li = $('
').appendTo(ul).addClass('cat-item cat-item-1').appendTo(ul);
62 | $('').html(e).appendTo(li);
63 | children = $('').addClass('children').appendTo(li);
64 | }else{
65 | var cli = $('- ').addClass('cat-item cat-item-5').appendTo(children);
66 | $('').attr('href', './' + e.href).html(e.text).appendTo(cli);
67 | }
68 | });
69 | }
70 |
71 | String.prototype.replaceAll = function(reallyDo, replaceWith, ignoreCase) {
72 | if (!RegExp.prototype.isPrototypeOf(reallyDo)) {
73 | return this.replace(new RegExp(reallyDo, (ignoreCase ? "gi": "g")), replaceWith);
74 | } else {
75 | return this.replace(reallyDo, replaceWith);
76 | }};
77 |
78 | $(document).ready(function(){
79 | var canvas = $('#canvas');
80 | if(canvas.length > 0){
81 | canvas.css({
82 | 'background-color': '#EEEEEE',
83 | 'border': '1px solid #444'
84 | });
85 | }
86 |
87 | var content = $('#content');
88 | drawMenus(demos);
89 | var code = $('#code').text();
90 | code = code.replaceAll('>', '>');
91 | code = code.replaceAll('<', '<');
92 | var pre = $('
').appendTo($('#canvas').parent().css('width', '850px')).html(code);
93 | pre.snippet("javascript",{style:"acid",collapse:true});
94 |
95 | window.scroll(0, 110);
96 | });
97 | })();
98 |
99 |
--------------------------------------------------------------------------------
/js/menu.js:
--------------------------------------------------------------------------------
1 | var menus = [
2 | {text:'Welcome', href:'index.html'},
3 | 'Basic',
4 | {text:'Hello Word', href:'helloworld.html'},
5 | {text:'Gif-simulator.html', href:'animate_gif.html'},
6 | {text:'save-as-png', href:'save-as-png.html'},
7 | {text:'animate_sprite', href:'animate_sprite.html'},
8 | {text:'animate_sprite2', href:'animate_sprite2.html'},
9 | {text:'circle_sprite', href:'circle_sprite.html'},
10 | {text:'scence_change', href:'scence_change.html'},
11 | {text:'scence_event', href:'scence_event.html'},
12 | {text:'edit', href:'topo-edit.html'},
13 | 'Animate',
14 | {text:'gravity', href:'animate_grivty.html'},
15 | 'Topo',
16 | {text:'topo', href:'topo.html'},
17 | {text:'Node', href:'topo-node.html'},
18 | {text:'Link', href:'topo-link.html'},
19 | {text:'Layout', href:'topo-layout.html'},
20 | {text:'Container', href:'topo-container.html'},
21 | {text:'UML-Node', href:'topo-uml.html'},
22 | {text:'grivty', href:'topo-grivty.html'},
23 |
24 | 'Chart',
25 | {text:'PieChart-Node', href:'topo-pieChart.html'},
26 | 'Twaver',
27 | {text:'statictis', href:'twaver-statictis.html'},
28 | {text:'PSTN', href:'twaver-pstn.html'},
29 | {text:'Matrix', href:'twaver-matrix.html'},
30 | 'Win7',
31 | {text:'Desktop', href:'topo-desktop.html'}
32 | ];
33 |
34 | function drawMenus(menus){
35 | var ul = $('#Menu_ul');
36 | $.each(menus, function(i, e){
37 | var li = $('
- ').appendTo(ul);
38 | if(typeof e == 'string'){
39 | li.addClass('nav-header').html(e);
40 | }else{
41 | var a = $('').attr('href', e.href).html(e.text);
42 | li.append(a);
43 | if(location.href.indexOf(e.href) != -1){
44 | li.addClass('active');
45 | }
46 | }
47 | });
48 | }
49 |
50 |
51 | String.prototype.replaceAll = function(reallyDo, replaceWith, ignoreCase) {
52 | if (!RegExp.prototype.isPrototypeOf(reallyDo)) {
53 | return this.replace(new RegExp(reallyDo, (ignoreCase ? "gi": "g")), replaceWith);
54 | } else {
55 | return this.replace(reallyDo, replaceWith);
56 | }
57 | };
58 |
59 | $(document).ready(function(){
60 | drawMenus(menus);
61 | $('.brand').html('JCool');
62 | $('.pull-right').html('');
63 |
64 | var code = $('#code').text();
65 | code = code.replaceAll('>', '>');
66 | code = code.replaceAll('<', '<');
67 | $('
').appendTo($('#canvas').parent().css('width', '800px'))
68 | .html(code).snippet("javascript",{style:"acid",collapse:true});
69 | });
70 |
71 |
72 |
--------------------------------------------------------------------------------
/js/site.js:
--------------------------------------------------------------------------------
1 |
2 | (function(){
3 | var menus = [
4 | {title:'首页', href:'index.html'},
5 | {title:'下载', href:'download.html'},
6 | {title:'API 文档', href:'api.html'},
7 | {title:'五分钟入门', href:'introduction-in-5-minutes.html'},
8 | {title:'在线演示', href:'demo/helloworld.html'},
9 | {title:'鼓励一下', href:'donate.html', target:'_blank'}
10 | ];
11 |
12 | function drawMenus(menus){
13 | var ul = $('#nav_menu').empty();
14 | $.each(menus, function(i, e){
15 | var url = e.href;
16 | if(location.href.indexOf('/demo/') != -1){
17 | url = '../'+e.href;
18 | }
19 | var li = $('
- ').addClass('menu-item').appendTo(ul);
20 | var a = $('').attr('href', url).attr('title', e.tip == null ? '':e.tip).html(e.title).appendTo(li);
21 |
22 | if(location.href.indexOf(e.href) != -1){
23 | a.addClass('active');
24 | }
25 | if(e.target){
26 | a.attr('target', e.target);
27 | }
28 | });
29 | }
30 |
31 | $(document).ready(function(){
32 | drawMenus(menus);
33 | });
34 |
35 | })($ || jQuery);
36 |
--------------------------------------------------------------------------------