tocmd 0.0.9 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/mdpreview/translator.rb
CHANGED
|
@@ -226,7 +226,7 @@ class Mdpreview::Translator
|
|
|
226
226
|
</html>
|
|
227
227
|
<script type="text/javascript" src="#{@editor_path}/toc/js/jquery-1.4.4.min.js"></script>
|
|
228
228
|
<script type="text/javascript" src="#{@editor_path}/toc/js/jquery.ztree.all-3.5.min.js"></script>
|
|
229
|
-
<script type="text/javascript" src="#{@editor_path}/toc/js/
|
|
229
|
+
<script type="text/javascript" src="#{@editor_path}/toc/js/ztree_toc.min.js"></script>
|
|
230
230
|
<SCRIPT type="text/javascript" >
|
|
231
231
|
<!--
|
|
232
232
|
$(document).ready(function(){
|
data/lib/mdpreview/version.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! ztree_toc - v0.2.
|
|
1
|
+
/*! ztree_toc - v0.2.2 - 2014-02-08
|
|
2
2
|
* https://github.com/i5ting/jQuery.zTree_Toc.js
|
|
3
3
|
* Copyright (c) 2014 alfred.sang; Licensed MIT */
|
|
4
4
|
function encode_id_with_array(opts,arr) {
|
|
@@ -93,7 +93,8 @@ function factor(opts ,count,current) {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
if(opts.is_auto_number == true) {
|
|
96
|
-
$(header_obj).text(opts._headers.join('.')
|
|
96
|
+
var _previos_text = $(header_obj).text().replace(opts._headers.join('.'),'');
|
|
97
|
+
$(header_obj).text( opts._headers.join('.') + '. ' + _previos_text );
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! ztree_toc - v0.2.
|
|
1
|
+
/*! ztree_toc - v0.2.2 - 2014-02-08
|
|
2
2
|
* https://github.com/i5ting/jQuery.zTree_Toc.js
|
|
3
3
|
* Copyright (c) 2014 alfred.sang; Licensed MIT */
|
|
4
4
|
function encode_id_with_array(a,b){for(var c=0,d=0;d<b.length;d++)c+=factor(a,b.length-d,b[d]);return c}function get_parent_id_with_array(a,b){for(var c=[],d=0;d<b.length;d++)c.push(b[d]);c.pop();for(var e=0,d=0;d<c.length;d++)e+=factor(a,c.length-d,c[d]);return e}function factor(opts,count,current){if(1==count)return current;for(var str="",i=count-1;i>0;i--)str+=current*opts.step+"*";return eval(str+"1")}!function(a){function b(b){a(b.documment_selector).find(":header").each(function(){var c=parseInt(this.nodeName.substring(1),10);d(b,this,c),e(b,a(this))})}function c(b){var c=a(b._zTree);c=a.fn.zTree.init(c,b.ztreeSetting,b._header_nodes).expandAll(b.is_expand_all),a(b._zTree).css(b.ztreeStyle)}function d(b,c,d){if(b._headers.length==d)b._headers[d-1]++;else if(b._headers.length>d)b._headers=b._headers.slice(0,d),b._headers[d-1]++;else if(b._headers.length<d)for(var e=0;e<d-b._headers.length;e++)b._headers.push(1);1==b.is_auto_number&&a(c).text(b._headers.join(".")+". "+a(c).text())}function e(b,c){var d=encode_id_with_array(b,b._headers),e=get_parent_id_with_array(b,b._headers);a(c).attr("id",d),h(a(c).text()),b._header_offsets.push(a(c).offset().top-b.highlight_offset),h("h offset ="+(a(c).offset().top-b.highlight_offset)),b._header_nodes.push({id:d,pId:e,name:a(c).text()||"null",open:!0,url:"#"+d,target:"_self"})}function f(b){var c,d=function(){c&&clearTimeout(c),c=setTimeout(function(){var c=a(window).scrollTop();b.debug&&console.log("top="+c);for(var d=0,e=b._header_offsets.length;e>d;d++)if(b._header_offsets[d]>=c+5){console.log("opts._header_offsets["+d+"] = "+b._header_offsets[d]),a("a").removeClass("curSelectedNode"),a("#tree_"+(d+1)+"_a").addClass("curSelectedNode");break}},b.refresh_scroll_time)};b.highlight_on_scroll&&(a(window).bind("scroll",d),d())}function g(b){b.highlight_offset=a(b.documment_selector).offset().top}function h(a){}a.fn.ztree_toc=function(d){var e=a.extend({},a.fn.ztree_toc.defaults,d);return this.each(function(){e._zTree=a(this),g(e),b(e),c(e),f(e)})},a.fn.ztree_toc.defaults={_zTree:null,_headers:[],_header_offsets:[],_header_nodes:[{id:1,pId:0,name:"Table of Content",open:!0}],debug:!0,highlight_offset:0,highlight_on_scroll:!0,refresh_scroll_time:50,documment_selector:"body",is_posion_top:!1,is_auto_number:!1,is_expand_all:!0,is_highlight_selected_line:!0,step:100,ztreeStyle:{width:"260px",overflow:"auto",position:"fixed","z-index":2147483647,border:"0px none",left:"0px",bottom:"0px"},ztreeSetting:{view:{dblClickExpand:!1,showLine:!0,showIcon:!1,selectedMulti:!1},data:{simpleData:{enable:!0,idKey:"id",pIdKey:"pId"}},callback:{beforeClick:function(b,c){a("a").removeClass("curSelectedNode"),1==c.id&&console.log("click root table of content"),1==a.fn.ztree_toc.defaults.is_highlight_selected_line&&a("#"+c.id).css("color","red").fadeOut("slow",function(){a(this).show().css("color","black")})},onRightClick:function(a,b,c){1==c.id&&console.log("right_click root table of content")}}}}}(jQuery);
|
metadata
CHANGED
|
@@ -1,29 +1,38 @@
|
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tocmd
|
|
3
|
-
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 27
|
|
5
|
+
prerelease:
|
|
6
|
+
segments:
|
|
7
|
+
- 0
|
|
8
|
+
- 1
|
|
9
|
+
- 0
|
|
10
|
+
version: 0.1.0
|
|
5
11
|
platform: ruby
|
|
6
|
-
authors:
|
|
12
|
+
authors:
|
|
7
13
|
- shiren1118
|
|
8
14
|
autorequire:
|
|
9
15
|
bindir: bin
|
|
10
16
|
cert_chain: []
|
|
11
|
-
|
|
17
|
+
|
|
18
|
+
date: 2014-02-08 00:00:00 Z
|
|
12
19
|
dependencies: []
|
|
20
|
+
|
|
13
21
|
description: convert markdown to html with toc plugin
|
|
14
|
-
email:
|
|
22
|
+
email:
|
|
15
23
|
- shiren1118@126.com
|
|
16
|
-
executables:
|
|
24
|
+
executables:
|
|
17
25
|
- tocmd
|
|
18
26
|
extensions: []
|
|
27
|
+
|
|
19
28
|
extra_rdoc_files: []
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- lib/mdpreview.rb
|
|
29
|
+
|
|
30
|
+
files:
|
|
23
31
|
- lib/mdpreview/markdown_render.rb
|
|
24
32
|
- lib/mdpreview/translator.rb
|
|
25
33
|
- lib/mdpreview/version.rb
|
|
26
|
-
-
|
|
34
|
+
- lib/mdpreview.rb
|
|
35
|
+
- bin/tocmd
|
|
27
36
|
- vendor/meta.js
|
|
28
37
|
- vendor/template.html
|
|
29
38
|
- vendor/toc/css/demo.css
|
|
@@ -44,37 +53,48 @@ files:
|
|
|
44
53
|
- vendor/toc/css/zTreeStyle/zTreeStyle.css
|
|
45
54
|
- vendor/toc/js/jquery-1.4.4.min.js
|
|
46
55
|
- vendor/toc/js/jquery.ztree.all-3.5.min.js
|
|
47
|
-
- vendor/toc/js/
|
|
48
|
-
- vendor/toc/js/
|
|
56
|
+
- vendor/toc/js/ztree_toc.js
|
|
57
|
+
- vendor/toc/js/ztree_toc.min.js
|
|
49
58
|
- vendor/toc/style/Clearness Dark.css
|
|
50
59
|
- vendor/toc/style/Clearness.css
|
|
51
|
-
- vendor/toc/style/GitHub.css
|
|
52
|
-
- vendor/toc/style/GitHub2.css
|
|
53
60
|
- vendor/toc/style/github-bf51422f4bb36427d391e4b75a1daa083c2d840e.css
|
|
61
|
+
- vendor/toc/style/GitHub.css
|
|
54
62
|
- vendor/toc/style/github2-d731afd4f624c99a4b19ad69f3083cd6d02b81d5.css
|
|
63
|
+
- vendor/toc/style/GitHub2.css
|
|
55
64
|
- vendor/toc/style/makedownpad.css
|
|
56
|
-
|
|
65
|
+
- test/mdptest.rb
|
|
66
|
+
homepage: ""
|
|
57
67
|
licenses: []
|
|
58
|
-
|
|
68
|
+
|
|
59
69
|
post_install_message:
|
|
60
70
|
rdoc_options: []
|
|
61
|
-
|
|
71
|
+
|
|
72
|
+
require_paths:
|
|
62
73
|
- lib
|
|
63
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
|
64
|
-
|
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
75
|
+
none: false
|
|
76
|
+
requirements:
|
|
65
77
|
- - ">="
|
|
66
|
-
- !ruby/object:Gem::Version
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
hash: 3
|
|
80
|
+
segments:
|
|
81
|
+
- 0
|
|
82
|
+
version: "0"
|
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
|
+
none: false
|
|
85
|
+
requirements:
|
|
70
86
|
- - ">="
|
|
71
|
-
- !ruby/object:Gem::Version
|
|
72
|
-
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
hash: 3
|
|
89
|
+
segments:
|
|
90
|
+
- 0
|
|
91
|
+
version: "0"
|
|
73
92
|
requirements: []
|
|
93
|
+
|
|
74
94
|
rubyforge_project:
|
|
75
|
-
rubygems_version:
|
|
95
|
+
rubygems_version: 1.8.24
|
|
76
96
|
signing_key:
|
|
77
|
-
specification_version:
|
|
97
|
+
specification_version: 3
|
|
78
98
|
summary: convert markdown to html with toc plugin
|
|
79
|
-
test_files:
|
|
99
|
+
test_files:
|
|
80
100
|
- test/mdptest.rb
|
checksums.yaml
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
SHA1:
|
|
3
|
-
metadata.gz: 3e83c31950b40f1c55248ccb60c5454b5ceb5a75
|
|
4
|
-
data.tar.gz: f212313e28a0917ec249580df4cf93fd6e6d52ca
|
|
5
|
-
SHA512:
|
|
6
|
-
metadata.gz: 89089f917c9bbf99ecb9e5bbd4439fb8d54de6c04941949ca1772c18c8263204422d1ac52940a3a664c1a7c1925c1246cb2c8636a54d23e3c7f32458f0eda5be
|
|
7
|
-
data.tar.gz: 1c1e3a70cb348e29a79bc1ee05115f4e3b0436227304bbf436649cca10cce936479ee9e233641bfdce5ebdeaa0b8372cb68f6631f65b0d7e81e39914ee3cb97c
|