tocmd 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7971be4096ca950a4b744941e18cc32daa5bffba
4
+ data.tar.gz: 169fb555254994fb61cc025da210cd8000faa43b
5
+ SHA512:
6
+ metadata.gz: dcbffde44e99b25c6f51857f2713ae9e769a4418887592850e812e2920fb7bf453921ed9d08e419db77c884716e8d26b529e75e6ded86dd50d6d38dd0f4a3254
7
+ data.tar.gz: b816a8131eee01d36b93c6b9c5e4ff55ad3e6a58f935cc6b15c4ba95bd6e77ea356ae62c52bc21ba56c11a830d99b8f77f5d282e28162c558243a717c5c4c632
@@ -1,3 +1,3 @@
1
1
  module Mdpreview
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -94,7 +94,7 @@ function factor(opts ,count,current) {
94
94
 
95
95
  if(opts.is_auto_number == true) {
96
96
  var _previos_text = $(header_obj).text().replace(opts._headers.join('.'),'');
97
- $(header_obj).text( opts._headers.join('.') + '. ' + _previos_text );
97
+ $(header_obj).text(opts._headers.join('.') + '. ' + $(header_obj).text());
98
98
  }
99
99
  }
100
100
 
@@ -1,4 +1,4 @@
1
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
- 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);
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().replace(b._headers.join("."),""),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,38 +1,29 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: tocmd
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - shiren1118
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2014-02-08 00:00:00 Z
11
+ date: 2014-02-08 00:00:00.000000000 Z
19
12
  dependencies: []
20
-
21
13
  description: convert markdown to html with toc plugin
22
- email:
14
+ email:
23
15
  - shiren1118@126.com
24
- executables:
16
+ executables:
25
17
  - tocmd
26
18
  extensions: []
27
-
28
19
  extra_rdoc_files: []
29
-
30
- files:
20
+ files:
21
+ - bin/tocmd
22
+ - lib/mdpreview.rb
31
23
  - lib/mdpreview/markdown_render.rb
32
24
  - lib/mdpreview/translator.rb
33
25
  - lib/mdpreview/version.rb
34
- - lib/mdpreview.rb
35
- - bin/tocmd
26
+ - test/mdptest.rb
36
27
  - vendor/meta.js
37
28
  - vendor/template.html
38
29
  - vendor/toc/css/demo.css
@@ -57,44 +48,33 @@ files:
57
48
  - vendor/toc/js/ztree_toc.min.js
58
49
  - vendor/toc/style/Clearness Dark.css
59
50
  - vendor/toc/style/Clearness.css
60
- - vendor/toc/style/github-bf51422f4bb36427d391e4b75a1daa083c2d840e.css
61
51
  - vendor/toc/style/GitHub.css
62
- - vendor/toc/style/github2-d731afd4f624c99a4b19ad69f3083cd6d02b81d5.css
63
52
  - vendor/toc/style/GitHub2.css
53
+ - vendor/toc/style/github-bf51422f4bb36427d391e4b75a1daa083c2d840e.css
54
+ - vendor/toc/style/github2-d731afd4f624c99a4b19ad69f3083cd6d02b81d5.css
64
55
  - vendor/toc/style/makedownpad.css
65
- - test/mdptest.rb
66
- homepage: ""
56
+ homepage: ''
67
57
  licenses: []
68
-
58
+ metadata: {}
69
59
  post_install_message:
70
60
  rdoc_options: []
71
-
72
- require_paths:
61
+ require_paths:
73
62
  - lib
74
- required_ruby_version: !ruby/object:Gem::Requirement
75
- none: false
76
- requirements:
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
77
65
  - - ">="
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:
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
86
70
  - - ">="
87
- - !ruby/object:Gem::Version
88
- hash: 3
89
- segments:
90
- - 0
91
- version: "0"
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
92
73
  requirements: []
93
-
94
74
  rubyforge_project:
95
- rubygems_version: 1.8.24
75
+ rubygems_version: 2.2.0
96
76
  signing_key:
97
- specification_version: 3
77
+ specification_version: 4
98
78
  summary: convert markdown to html with toc plugin
99
- test_files:
79
+ test_files:
100
80
  - test/mdptest.rb