Table of Contents Plus - Version 1211

Version Description

  • Released: 17 November 2012
  • New: allow %PAGE_TITLE% to be used in the TOC title. Note that this also works in the widget title too. When used, this variable will be replaced with the current page's title. Thanks to Peter for the request.
  • New: new option to hide the TOC initially. Thanks to Jonas, Jonathan, and Doc Germanicus for requesting it.
  • New: added ability to customise visited TOC link colour.
  • New: option to restrict generation to a URL path match. For example, you can restrict to wiki pages that fall under http://domain/wiki/ by entering /wiki/ into the field. The setting can be found in the advanced options. Thanks to Tux and Justine Smithies for suggesting it.
  • Make regular expressions less greedy. That means you can have multiple headings on a single line whereas before you needed to ensure each heading was on their own line. Thanks to drdamour for raising and providing a fix.
  • Also make regular expressions match across multiple lines. This means you can have your single heading split across many lines.
  • Better accessibility: when using smooth scrolling, allow for focus to follow the target, eg tabbing through will continue from the content block you clicked through to.
  • Better performance: as requested by a few, javascript files have been consolidated into one and both javascript and CSS files are now minified.
  • 'Auto' is now the default width which means it'll take up the needed amount of space up to 100%. The previous default was a fixed width of 275px.
  • Added the ability to exclude entire branches when using [sitemap_pages] and [sitemap_categories] using the exclude_tree attribute. Thanks to Benny Powers for requesting it.
  • Wrap index numbers around span tags to enable easier CSS customisation. The spans are have two classes: toc_number and toc_depth_X where X is between 1 and 6. Thanks to Matthias Krok for requesting it.
  • Moved the 'preserve theme bullets' option into the advanced section.
  • Updated and simplified the translation file.
  • Fixed: [sitemap_categories] using the wrong label when none was specified. Thanks to brandt-net for raising it. The labels for both [sitemap_pages] and [sitemap_categories] may be removed in a future update as you can insert the title within your content.
Download this release

Release Info

Developer conjur3r
Plugin Icon 128x128 Table of Contents Plus
Version 1211
Comparing to
See all releases

Code changes from version 1208 to 1211

Files changed (8) hide show
  1. admin.css +9 -0
  2. front.js +24 -113
  3. jquery.c.min.js +0 -10
  4. jquery.smooth-scroll.min.js +0 -19
  5. languages/toc+.pot +234 -222
  6. readme.txt +29 -9
  7. screen.css +1 -65
  8. toc.php +128 -70
admin.css CHANGED
@@ -125,6 +125,12 @@ table#theme_custom img:hover {
125
  div#farbtastic_colour_wheel {
126
  margin-left: 20px;
127
  }
 
 
 
 
 
 
128
  #shortcode_table th {
129
  background: #f5f5f5;
130
  padding: 0.5em;
@@ -133,4 +139,7 @@ div#farbtastic_colour_wheel {
133
  vertical-align: top;
134
  border-bottom: #f5f5f5 1px solid;
135
  padding: 1em 0 1em 0;
 
 
 
136
  }
125
  div#farbtastic_colour_wheel {
126
  margin-left: 20px;
127
  }
128
+ #tab3 h3:not(:first-child) {
129
+ margin-top: 2em;
130
+ }
131
+ #shortcode_table th:first-child {
132
+ width: 150px;
133
+ }
134
  #shortcode_table th {
135
  background: #f5f5f5;
136
  padding: 0.5em;
139
  vertical-align: top;
140
  border-bottom: #f5f5f5 1px solid;
141
  padding: 1em 0 1em 0;
142
+ }
143
+ #shortcode_table ul {
144
+ margin: 0;
145
  }
front.js CHANGED
@@ -1,114 +1,25 @@
1
- jQuery(document).ready(function($) {
2
 
3
- if ( $.smoothScroll ) {
4
- var target = hostname = pathname = qs = hash = null;
5
-
6
- $('body a').click(function(event) {
7
- // 1.6 moved some attributes to the .prop method
8
- if ( minVersion('1.6') ) {
9
- hostname = $(this).prop('hostname');
10
- pathname = $(this).prop('pathname');
11
- qs = $(this).prop('search');
12
- hash = $(this).prop('hash');
13
- }
14
- else {
15
- hostname = $(this).attr('hostname');
16
- pathname = $(this).attr('pathname');
17
- qs = $(this).attr('search');
18
- hash = $(this).attr('hash');
19
- }
20
-
21
- // ie strips out the preceeding / from pathname
22
- if ( pathname.length > 0 ) {
23
- if ( pathname.charAt(0) != '/' ) {
24
- pathname = '/' + pathname;
25
- }
26
- }
27
-
28
- if ( (window.location.hostname == hostname) && (window.location.pathname == pathname) && (window.location.search == qs) && (hash !== '') ) {
29
- // escape jquery selector chars, but keep the #
30
- var hash_selector = hash.replace(/([ !"$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g, '\\$1');
31
- // check if element exists with id=__
32
- if ( $( hash_selector ).length > 0 )
33
- target = hash;
34
- else {
35
- // must be an anchor (a name=__)
36
- anchor = hash;
37
- anchor = anchor.replace('#', '');
38
- target = 'a[name="' + anchor + '"]';
39
- // verify it exists
40
- if ( $(target).length == 0 )
41
- target = '';
42
- }
43
-
44
- // check offset setting
45
- var offset = -30;
46
- if (typeof tocplus != 'undefined')
47
- if (typeof tocplus.smooth_scroll_offset != 'undefined')
48
- offset = -1 * tocplus.smooth_scroll_offset;
49
-
50
- if ( target ) {
51
- event.preventDefault();
52
- $.smoothScroll({
53
- scrollTarget: target,
54
- offset: offset
55
- });
56
- }
57
- }
58
- });
59
- }
60
-
61
- if ( typeof tocplus != 'undefined' ) {
62
- $.fn.shrinkTOCWidth = function() {
63
- $(this).css({
64
- width: 'auto',
65
- display: 'table'
66
- });
67
- if ( $.browser.msie && parseInt($.browser.version) == 7 )
68
- $(this).css('width', '');
69
- }
70
-
71
- if ( $.cookie )
72
- var visibility_text = ($.cookie('tocplus_hidetoc')) ? tocplus.visibility_show : tocplus.visibility_hide ;
73
- else
74
- var visibility_text = tocplus.visibility_hide;
75
-
76
-
77
- $('#toc_container p.toc_title').append(' <span class="toc_toggle">[<a href="#">' + visibility_text + '</a>]</span>');
78
- if ( visibility_text == tocplus.visibility_show ) {
79
- $('ul.toc_list').hide();
80
- $('#toc_container').shrinkTOCWidth();
81
- }
82
-
83
- $('span.toc_toggle a').click(function(event) {
84
- event.preventDefault();
85
- switch( $(this).html() ) {
86
- case $('<div/>').html(tocplus.visibility_hide).text():
87
- $(this).html(tocplus.visibility_show);
88
- if ( $.cookie ) $.cookie('tocplus_hidetoc', '1', { expires: 30, path: '/' });
89
- $('ul.toc_list').hide('fast');
90
- $('#toc_container').shrinkTOCWidth();
91
- break;
92
-
93
- case $('<div/>').html(tocplus.visibility_show).text(): // do next
94
- default:
95
- $(this).html(tocplus.visibility_hide);
96
- if ( $.cookie ) $.cookie('tocplus_hidetoc', null, { path: '/' });
97
- $('#toc_container').css('width', tocplus.width);
98
- $('ul.toc_list').show('fast');
99
- }
100
- });
101
- }
102
-
103
- function minVersion(version) {
104
- var $vrs = window.jQuery.fn.jquery.split('.'),
105
- min = version.split('.');
106
- for (var i=0, len=$vrs.length; i<len; i++) {
107
- if (min[i] && $vrs[i] < min[i]) {
108
- return false;
109
- }
110
- }
111
- return true;
112
- }
113
-
114
- });
 
1
 
2
+ (function(c){function k(b){return b.replace(/^\//,"").replace(/(index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")}var l=k(location.pathname),m=function(b){var d=[],a=false,e=b.dir&&b.dir=="left"?"scrollLeft":"scrollTop";this.each(function(){if(!(this==document||this==window)){var f=c(this);if(f[e]()>0)d.push(this);else{f[e](1);a=f[e]()>0;f[e](0);a&&d.push(this)}}});if(b.el==="first"&&d.length)d=[d.shift()];return d};c.fn.extend({scrollable:function(b){return this.pushStack(m.call(this,{dir:b}))},firstScrollable:function(b){return this.pushStack(m.call(this,{el:"first",dir:b}))},smoothScroll:function(b){b=b||{};var d=c.extend({},c.fn.smoothScroll.defaults,b);this.die("click.smoothscroll").live("click.smoothscroll",function(a){var e=c(this),f=location.hostname===this.hostname||!this.hostname,g=d.scrollTarget||(k(this.pathname)||l)===l,i=this.hash,h=true;if(!d.scrollTarget&&(!f||!g||!i))h=false;else{f=d.exclude;g=0;for(var j=f.length;h&&g<j;)if(e.is(f[g++]))h=false;f=d.excludeWithin;g=0;for(j=f.length;h&&g<j;)if(e.closest(f[g++]).length)h=false}if(h){d.scrollTarget=b.scrollTarget||i;d.link=this;a.preventDefault();c.smoothScroll(d)}});return this}});c.smoothScroll=function(b,d){var a,e,f,g=0;e="offset";var i="scrollTop",h={};if(typeof b==="number"){a=c.fn.smoothScroll.defaults;f=b}else{a=c.extend({},c.fn.smoothScroll.defaults,b||{});if(a.scrollElement){e="position";a.scrollElement.css("position")=="static"&&a.scrollElement.css("position","relative")}f=d||c(a.scrollTarget)[e]()&&c(a.scrollTarget)[e]()[a.direction]||0}a=c.extend({link:null},a);i=a.direction=="left"?"scrollLeft":i;if(a.scrollElement){e=a.scrollElement;g=e[i]()}else e=c("html, body").firstScrollable();h[i]=f+g+a.offset;e.animate(h,{duration:a.speed,easing:a.easing,complete:function(){a.afterScroll&&c.isFunction(a.afterScroll)&&a.afterScroll.call(a.link,a)}})};c.smoothScroll.version="1.4";c.fn.smoothScroll.defaults={exclude:[],excludeWithin:[],offset:0,direction:"top",scrollElement:null,scrollTarget:null,afterScroll:null,easing:"swing",speed:400}})(jQuery);jQuery.cookie=function(a,b,c){if(arguments.length>1&&String(b)!=="[object Object]"){c=jQuery.extend({},c);if(b===null||b===undefined){c.expires=-1}if(typeof c.expires==="number"){var d=c.expires,e=c.expires=new Date;e.setDate(e.getDate()+d)}b=String(b);return document.cookie=[encodeURIComponent(a),"=",c.raw?b:encodeURIComponent(b),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}c=b||{};var f,g=c.raw?function(a){return a}:decodeURIComponent;return(f=(new RegExp("(?:^|; )"+encodeURIComponent(a)+"=([^;]*)")).exec(document.cookie))?g(f[1]):null}
3
+ jQuery(document).ready(function($){if(typeof tocplus!='undefined'){$.fn.shrinkTOCWidth=function(){$(this).css({width:'auto',display:'table'});if($.browser.msie&&parseInt($.browser.version)==7)
4
+ $(this).css('width','');}
5
+ if(tocplus.smooth_scroll==1){var target=hostname=pathname=qs=hash=null;$('body a').click(function(event){if(minVersion('1.6')){hostname=$(this).prop('hostname');pathname=$(this).prop('pathname');qs=$(this).prop('search');hash=$(this).prop('hash');}
6
+ else{hostname=$(this).attr('hostname');pathname=$(this).attr('pathname');qs=$(this).attr('search');hash=$(this).attr('hash');}
7
+ if(pathname.length>0){if(pathname.charAt(0)!='/'){pathname='/'+pathname;}}
8
+ if((window.location.hostname==hostname)&&(window.location.pathname==pathname)&&(window.location.search==qs)&&(hash!=='')){var hash_selector=hash.replace(/([ !"$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g,'\\$1');if($(hash_selector).length>0)
9
+ target=hash;else{anchor=hash;anchor=anchor.replace('#','');target='a[name="'+anchor+'"]';if($(target).length==0)
10
+ target='';}
11
+ var offset=-30;if(typeof tocplus.smooth_scroll_offset!='undefined')
12
+ offset=-1*tocplus.smooth_scroll_offset;if(target){$.smoothScroll({scrollTarget:target,offset:offset});}}});}
13
+ if(typeof tocplus.visibility_show!='undefined'){var invert=(typeof tocplus.visibility_hide_by_default!='undefined')?true:false;if($.cookie)
14
+ var visibility_text=($.cookie('tocplus_hidetoc'))?tocplus.visibility_show:tocplus.visibility_hide;else
15
+ var visibility_text=tocplus.visibility_hide;if(invert)
16
+ visibility_text=(visibility_text==tocplus.visibility_hide)?tocplus.visibility_show:tocplus.visibility_hide;$('#toc_container p.toc_title').append(' <span class="toc_toggle">[<a href="#">'+visibility_text+'</a>]</span>');if(visibility_text==tocplus.visibility_show){$('ul.toc_list').hide();$('#toc_container').shrinkTOCWidth();}
17
+ $('span.toc_toggle a').click(function(event){event.preventDefault();switch($(this).html()){case $('<div/>').html(tocplus.visibility_hide).text():$(this).html(tocplus.visibility_show);if($.cookie){if(invert)
18
+ $.cookie('tocplus_hidetoc',null,{path:'/'});else
19
+ $.cookie('tocplus_hidetoc','1',{expires:30,path:'/'});}
20
+ $('ul.toc_list').hide('fast');$('#toc_container').shrinkTOCWidth();break;case $('<div/>').html(tocplus.visibility_show).text():default:$(this).html(tocplus.visibility_hide);if($.cookie){if(invert)
21
+ $.cookie('tocplus_hidetoc','1',{expires:30,path:'/'});else
22
+ $.cookie('tocplus_hidetoc',null,{path:'/'});}
23
+ $('#toc_container').css('width',tocplus.width);$('ul.toc_list').show('fast');}});}}
24
+ function minVersion(version){var $vrs=window.jQuery.fn.jquery.split('.'),min=version.split('.');for(var i=0,len=$vrs.length;i<len;i++){if(min[i]&&$vrs[i]<min[i]){return false;}}
25
+ return true;}});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
jquery.c.min.js DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * jQuery Cookie plugin
3
- *
4
- * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
5
- * Dual licensed under the MIT and GPL licenses:
6
- * http://www.opensource.org/licenses/mit-license.php
7
- * http://www.gnu.org/licenses/gpl.html
8
- *
9
- */
10
- jQuery.cookie=function(a,b,c){if(arguments.length>1&&String(b)!=="[object Object]"){c=jQuery.extend({},c);if(b===null||b===undefined){c.expires=-1}if(typeof c.expires==="number"){var d=c.expires,e=c.expires=new Date;e.setDate(e.getDate()+d)}b=String(b);return document.cookie=[encodeURIComponent(a),"=",c.raw?b:encodeURIComponent(b),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}c=b||{};var f,g=c.raw?function(a){return a}:decodeURIComponent;return(f=(new RegExp("(?:^|; )"+encodeURIComponent(a)+"=([^;]*)")).exec(document.cookie))?g(f[1]):null}
 
 
 
 
 
 
 
 
 
 
jquery.smooth-scroll.min.js DELETED
@@ -1,19 +0,0 @@
1
- /*!
2
- * jQuery Smooth Scroll Plugin v1.4
3
- *
4
- * Date: Mon Apr 25 00:02:30 2011 EDT
5
- * Requires: jQuery v1.3+
6
- *
7
- * Copyright 2010, Karl Swedberg
8
- * Dual licensed under the MIT and GPL licenses (just like jQuery):
9
- * http://www.opensource.org/licenses/mit-license.php
10
- * http://www.gnu.org/licenses/gpl.html
11
- *
12
- *
13
- *
14
- *
15
- */
16
- (function(c){function k(b){return b.replace(/^\//,"").replace(/(index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")}var l=k(location.pathname),m=function(b){var d=[],a=false,e=b.dir&&b.dir=="left"?"scrollLeft":"scrollTop";this.each(function(){if(!(this==document||this==window)){var f=c(this);if(f[e]()>0)d.push(this);else{f[e](1);a=f[e]()>0;f[e](0);a&&d.push(this)}}});if(b.el==="first"&&d.length)d=[d.shift()];return d};c.fn.extend({scrollable:function(b){return this.pushStack(m.call(this,{dir:b}))},
17
- firstScrollable:function(b){return this.pushStack(m.call(this,{el:"first",dir:b}))},smoothScroll:function(b){b=b||{};var d=c.extend({},c.fn.smoothScroll.defaults,b);this.die("click.smoothscroll").live("click.smoothscroll",function(a){var e=c(this),f=location.hostname===this.hostname||!this.hostname,g=d.scrollTarget||(k(this.pathname)||l)===l,i=this.hash,h=true;if(!d.scrollTarget&&(!f||!g||!i))h=false;else{f=d.exclude;g=0;for(var j=f.length;h&&g<j;)if(e.is(f[g++]))h=false;f=d.excludeWithin;g=0;for(j=
18
- f.length;h&&g<j;)if(e.closest(f[g++]).length)h=false}if(h){d.scrollTarget=b.scrollTarget||i;d.link=this;a.preventDefault();c.smoothScroll(d)}});return this}});c.smoothScroll=function(b,d){var a,e,f,g=0;e="offset";var i="scrollTop",h={};if(typeof b==="number"){a=c.fn.smoothScroll.defaults;f=b}else{a=c.extend({},c.fn.smoothScroll.defaults,b||{});if(a.scrollElement){e="position";a.scrollElement.css("position")=="static"&&a.scrollElement.css("position","relative")}f=d||c(a.scrollTarget)[e]()&&c(a.scrollTarget)[e]()[a.direction]||
19
- 0}a=c.extend({link:null},a);i=a.direction=="left"?"scrollLeft":i;if(a.scrollElement){e=a.scrollElement;g=e[i]()}else e=c("html, body").firstScrollable();h[i]=f+g+a.offset;e.animate(h,{duration:a.speed,easing:a.easing,complete:function(){a.afterScroll&&c.isFunction(a.afterScroll)&&a.afterScroll.call(a.link,a)}})};c.smoothScroll.version="1.4";c.fn.smoothScroll.defaults={exclude:[],excludeWithin:[],offset:0,direction:"top",scrollElement:null,scrollTarget:null,afterScroll:null,easing:"swing",speed:400}})(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/toc+.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/table-of-contents-plus\n"
7
- "POT-Creation-Date: 2012-08-01 13:02:20+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -12,283 +12,289 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: toc.php:169
16
  msgid "Settings"
17
  msgstr ""
18
 
19
- #: toc.php:339 toc.php:340
20
  msgid "TOC"
21
  msgstr ""
22
 
23
- #: toc.php:474
24
  msgid "Options saved."
25
  msgstr ""
26
 
27
- #: toc.php:476
28
  msgid "Save failed."
29
  msgstr ""
30
 
31
- #: toc.php:488
32
  msgid "Main Options"
33
  msgstr ""
34
 
35
- #: toc.php:489
36
  msgid "Sitemap"
37
  msgstr ""
38
 
39
- #: toc.php:490
40
  msgid "Help"
41
  msgstr ""
42
 
43
- #: toc.php:498
44
  msgid "Position"
45
  msgstr ""
46
 
47
- #: toc.php:501
48
  msgid "Before first heading (default)"
49
  msgstr ""
50
 
51
- #: toc.php:502
52
  msgid "Top"
53
  msgstr ""
54
 
55
- #: toc.php:503
56
  msgid "Bottom"
57
  msgstr ""
58
 
59
- #: toc.php:508
60
  msgid "Show when"
61
  msgstr ""
62
 
63
- #: toc.php:518
 
64
  msgid "or more headings are present"
65
  msgstr ""
66
 
67
- #: toc.php:522
68
  msgid "Auto insert for the following content types"
69
  msgstr ""
70
 
71
- #: toc.php:535
 
72
  msgid "Heading text"
73
  msgstr ""
74
 
75
- #: toc.php:537
76
  msgid "Show title on top of the table of contents"
77
  msgstr ""
78
 
79
- #: toc.php:540
80
  msgid "Eg: Contents, Table of Contents, Page Contents"
81
  msgstr ""
82
 
83
- #: toc.php:542
84
  msgid "Allow the user to toggle the visibility of the table of contents"
85
  msgstr ""
86
 
87
- #: toc.php:547
88
  msgid "Show text"
89
  msgstr ""
90
 
91
- #: toc.php:549
 
 
92
  msgid "Eg: show"
93
  msgstr ""
94
 
95
- #: toc.php:552
96
  msgid "Hide text"
97
  msgstr ""
98
 
99
- #: toc.php:554
 
 
100
  msgid "Eg: hide"
101
  msgstr ""
102
 
103
- #: toc.php:563
 
 
 
 
104
  msgid "Show hierarchy"
105
  msgstr ""
106
 
107
- #: toc.php:567
108
  msgid "Number list items"
109
  msgstr ""
110
 
111
- #: toc.php:571
112
  msgid "Enable smooth scroll effect"
113
  msgstr ""
114
 
115
- #: toc.php:572
116
  msgid "Scroll rather than jump to the anchor link"
117
  msgstr ""
118
 
119
- #: toc.php:577
120
  msgid "Appearance"
121
  msgstr ""
122
 
123
- #: toc.php:581
124
  msgid "Width"
125
  msgstr ""
126
 
127
- #: toc.php:584
128
  msgid "Fixed width"
129
  msgstr ""
130
 
131
- #: toc.php:588
132
- msgid "(default)"
133
- msgstr ""
134
-
135
- #: toc.php:595
136
  msgid "Relative"
137
  msgstr ""
138
 
139
- #: toc.php:596
140
- msgid "Auto"
141
  msgstr ""
142
 
143
- #: toc.php:604
 
144
  msgid "Other"
145
  msgstr ""
146
 
147
- #: toc.php:605
148
  msgid "User defined"
149
  msgstr ""
150
 
151
- #: toc.php:609
152
- msgid "Please enter a number and"
 
153
  msgstr ""
154
 
155
- #: toc.php:609
156
- msgid "select its units, eg: 100px, 10em"
157
- msgstr ""
158
-
159
- #: toc.php:620
160
  msgid "Wrapping"
161
  msgstr ""
162
 
163
- #: toc.php:623
164
  msgid "None (default)"
165
  msgstr ""
166
 
167
- #: toc.php:624
168
  msgid "Left"
169
  msgstr ""
170
 
171
- #: toc.php:625
172
  msgid "Right"
173
  msgstr ""
174
 
175
- #: toc.php:630
176
  msgid "Font size"
177
  msgstr ""
178
 
179
- #: toc.php:641
 
180
  msgid "Presentation"
181
  msgstr ""
182
 
183
- #: toc.php:644
184
  msgid "Grey (default)"
185
  msgstr ""
186
 
187
- #: toc.php:649
188
  msgid "Light blue"
189
  msgstr ""
190
 
191
- #: toc.php:654
192
  msgid "White"
193
  msgstr ""
194
 
195
- #: toc.php:659
196
  msgid "Black"
197
  msgstr ""
198
 
199
- #: toc.php:664
200
  msgid "Transparent"
201
  msgstr ""
202
 
203
- #: toc.php:669
204
  msgid "Custom"
205
  msgstr ""
206
 
207
- #: toc.php:679
208
  msgid "Background"
209
  msgstr ""
210
 
211
- #: toc.php:683
212
  msgid "Border"
213
  msgstr ""
214
 
215
- #: toc.php:687 toc.php:1498
216
  msgid "Title"
217
  msgstr ""
218
 
219
- #: toc.php:691
220
  msgid "Links"
221
  msgstr ""
222
 
223
- #: toc.php:695
224
  msgid "Links (hover)"
225
  msgstr ""
226
 
227
- #: toc.php:710
228
- msgid "Leaving the value as"
229
  msgstr ""
230
 
231
- #: toc.php:710
232
- msgid "will inherit your theme's styles"
233
  msgstr ""
234
 
235
- #: toc.php:715
236
- msgid "Preserve theme bullets"
237
- msgstr ""
238
-
239
- #: toc.php:716
240
- msgid ""
241
- "If your theme includes background images for unordered list elements, enable "
242
- "this to support them"
243
- msgstr ""
244
-
245
- #: toc.php:721
246
  msgid "Advanced"
247
  msgstr ""
248
 
249
- #: toc.php:721 toc.php:816
250
  msgid "show"
251
  msgstr ""
252
 
253
- #: toc.php:723
254
  msgid "Power options"
255
  msgstr ""
256
 
257
- #: toc.php:727
258
  msgid "Include homepage"
259
  msgstr ""
260
 
261
- #: toc.php:728
262
  msgid "Show the table of contents for qualifying items on the homepage"
263
  msgstr ""
264
 
265
- #: toc.php:731
266
  msgid "Exclude CSS file"
267
  msgstr ""
268
 
269
- #: toc.php:732
270
  msgid ""
271
  "Prevent the loading of this plugin's CSS styles. When selected, the "
272
  "presentation options from above will also be ignored."
273
  msgstr ""
274
 
275
- #: toc.php:735
 
 
 
 
 
 
 
 
 
 
276
  msgid "Heading levels"
277
  msgstr ""
278
 
279
- #: toc.php:737
280
- msgid "Include (or exclude) the following heading levels"
 
281
  msgstr ""
282
 
283
- #: toc.php:743
284
  msgid "heading "
285
  msgstr ""
286
 
287
- #: toc.php:749
288
  msgid "Smooth scroll top offset"
289
  msgstr ""
290
 
291
- #: toc.php:752
292
  msgid ""
293
  "If you have a consistent menu across the top of your site, you can adjust "
294
  "the top offset to stop the headings from appearing underneath the top menu. "
@@ -296,11 +302,27 @@ msgid ""
296
  "after you have enabled smooth scrolling from above."
297
  msgstr ""
298
 
299
- #: toc.php:756
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  msgid "Default anchor prefix"
301
  msgstr ""
302
 
303
- #: toc.php:759
304
  msgid ""
305
  "Anchor targets are restricted to alphanumeric characters as per HTML "
306
  "specification (see readme for more detail). The default anchor prefix will "
@@ -308,122 +330,113 @@ msgid ""
308
  "instead."
309
  msgstr ""
310
 
311
- #: toc.php:760
312
  msgid ""
313
  "This option normally applies to content written in character sets other than "
314
  "ASCII."
315
  msgstr ""
316
 
317
- #: toc.php:761
 
318
  msgid "Eg: i, toc_index, index, _"
319
  msgstr ""
320
 
321
- #: toc.php:767
 
322
  msgid "Usage"
323
  msgstr ""
324
 
325
- #: toc.php:768
326
  msgid ""
327
  "If you would like to fully customise the position of the table of contents, "
328
- "you can use the"
329
- msgstr ""
330
-
331
- #: toc.php:768
332
- msgid ""
333
- "shortcode by placing it at the desired position of your post, page or custom "
334
- "post type. This method allows you to generate the table of contents despite "
335
- "having auto insertion disabled for its content type. Please visit the help "
336
- "tab for further information about this shortcode."
337
- msgstr ""
338
-
339
- #: toc.php:776
340
- msgid "At its simplest, placing"
341
  msgstr ""
342
 
343
- #: toc.php:776
344
  msgid ""
345
- "into a page will automatically create a sitemap of all pages and categories. "
346
- "This also works in a text widget."
347
  msgstr ""
348
 
349
- #: toc.php:780
350
  msgid "Show page listing"
351
  msgstr ""
352
 
353
- #: toc.php:784
354
  msgid "Show category listing"
355
  msgstr ""
356
 
357
- #: toc.php:788
358
  msgid "Heading type"
359
  msgstr ""
360
 
361
- #: toc.php:789
 
 
362
  msgid "Use"
363
  msgstr ""
364
 
365
- #: toc.php:798
 
 
366
  msgid "to print out the titles"
367
  msgstr ""
368
 
369
- #: toc.php:802
370
  msgid "Pages label"
371
  msgstr ""
372
 
373
- #: toc.php:804
374
  msgid "Eg: Pages, Page List"
375
  msgstr ""
376
 
377
- #: toc.php:808
378
  msgid "Categories label"
379
  msgstr ""
380
 
381
- #: toc.php:810
382
  msgid "Eg: Categories, Category List"
383
  msgstr ""
384
 
385
- #: toc.php:816
386
  msgid "Advanced usage"
387
  msgstr ""
388
 
389
- #: toc.php:818
390
- msgid "lets you print out a listing of only pages. Similarly"
391
- msgstr ""
392
-
393
- #: toc.php:818
394
  msgid ""
395
- "can be used to print out a category listing. They both can accept a number "
396
- "of attributes so visit the help tab for more information."
 
397
  msgstr ""
398
 
399
- #: toc.php:819
400
  msgid "Examples"
401
  msgstr ""
402
 
403
- #: toc.php:821
404
  msgid "hides the heading from a category listing"
405
  msgstr ""
406
 
407
- #: toc.php:822
408
- msgid "Uses h6 to display"
409
- msgstr ""
410
-
411
- #: toc.php:822
412
- msgid "on a page listing excluding pages with IDs 1 and 15."
413
  msgstr ""
414
 
415
- #: toc.php:830
416
  msgid "Where's my table of contents?"
417
  msgstr ""
418
 
419
- #: toc.php:831
420
  msgid ""
421
  "If you're reading this, then chances are you have successfully installed and "
422
  "enabled the plugin and you're just wondering why the index isn't appearing "
423
  "right? Try the following:"
424
  msgstr ""
425
 
426
- #: toc.php:833
427
  msgid ""
428
  "In most cases, the post, page or custom post type has less than the minimum "
429
  "number of headings. By default, this is set to four so make sure you have at "
@@ -431,97 +444,98 @@ msgid ""
431
  "you can find it under 'Main Options' &gt; 'Show when'."
432
  msgstr ""
433
 
434
- #: toc.php:834
435
  msgid ""
436
  "Is auto insertion enabled for your content type? By default, only pages are "
437
  "enabled."
438
  msgstr ""
439
 
440
- #: toc.php:835
441
- msgid "Have you got"
442
- msgstr ""
443
-
444
- #: toc.php:835
445
  msgid ""
446
- "somewhere within the content? This will disable the index for the current "
447
- "post, page or custom post type."
448
- msgstr ""
449
-
450
- #: toc.php:836
451
- msgid "If you are using the TOC+ widget, check if you have the"
452
  msgstr ""
453
 
454
- #: toc.php:836 toc.php:1504
455
- msgid "Show the table of contents only in the sidebar"
 
 
 
 
456
  msgstr ""
457
 
458
- #: toc.php:836
459
  msgid ""
460
- "enabled as this will limit its display to only the sidebar. You can check by "
461
- "going into Appearance &gt; Widgets."
462
  msgstr ""
463
 
464
- #: toc.php:839
465
  msgid "How do I stop the table of contents from appearing on a single page?"
466
  msgstr ""
467
 
468
- #: toc.php:840
469
- msgid "Place the following"
470
- msgstr ""
471
-
472
- #: toc.php:840
473
  msgid ""
474
- "anywhere on the page to suppress the table of contents. This is known as a "
475
- "shortcode and works for posts, pages and custom post types that make use of "
476
- "the_content()"
477
  msgstr ""
478
 
479
- #: toc.php:842
480
  msgid ""
481
  "I've set wrapping to left or right but the headings don't wrap around the "
482
  "table of contents"
483
  msgstr ""
484
 
485
- #: toc.php:843
486
  msgid ""
487
  "This normally occurs when there is a CSS clear directive in or around the "
488
- "heading specified by the theme author. This directive tells the user agent "
489
- "to reset the previous wrapping specifications."
 
490
  msgstr ""
491
 
492
- #: toc.php:844
493
  msgid ""
494
  "You can adjust your theme's CSS or try moving the table of contents position "
495
  "to the top of the page. If you didn't build your theme, I'd highly suggest "
496
- "you try the"
497
  msgstr ""
498
 
499
- #: toc.php:844
500
- msgid "if you wish to make CSS changes."
 
 
 
501
  msgstr ""
502
 
503
- #: toc.php:846
504
- msgid "Why are some headings not included in the table of contents?"
505
  msgstr ""
506
 
507
- #: toc.php:847
508
  msgid ""
509
- "First, make sure the title text that isn't appearing in the table of "
510
- "contents is actually marked up as a heading (eg heading 1 through to 6). "
511
- "After verifying that it really is a heading, make sure that there are no "
512
- "linebreaks or enters from the start to the end of the heading HTML tags. "
513
- "Eg, it should not be like the following:"
514
  msgstr ""
515
 
516
- #: toc.php:853
517
- msgid "Rather, it should be something like:"
518
  msgstr ""
519
 
520
- #: toc.php:858
521
- msgid "The sitemap uses a strange font disimilar to the rest of the site"
 
 
 
522
  msgstr ""
523
 
524
- #: toc.php:859
 
 
 
 
525
  msgid ""
526
  "No extra styles are created for the sitemap, instead it inherits any styles "
527
  "you used when adding the shortcode. If you copy and pasted, you probably "
@@ -529,121 +543,119 @@ msgid ""
529
  "case."
530
  msgstr ""
531
 
532
- #: toc.php:860
533
  msgid ""
534
  "In most cases, try to have the shortcode on its own line with nothing before "
535
  "or after the square brackets."
536
  msgstr ""
537
 
538
- #: toc.php:862
539
  msgid "What were those shortcodes and attributes again?"
540
  msgstr ""
541
 
542
- #: toc.php:863
543
  msgid ""
544
  "When attributes are left out for the shortcodes below, they will fallback to "
545
  "the settings you defined under Settings &gt; TOC+."
546
  msgstr ""
547
 
548
- #: toc.php:867
549
  msgid "Shortcode"
550
  msgstr ""
551
 
552
- #: toc.php:868
553
  msgid "Description"
554
  msgstr ""
555
 
556
- #: toc.php:869
557
  msgid "Attributes"
558
  msgstr ""
559
 
560
- #: toc.php:875
561
  msgid ""
562
  "Lets you generate the table of contents at the preferred position. Also "
563
  "useful for sites that only require a TOC on a small handful of pages."
564
  msgstr ""
565
 
566
- #: toc.php:878
567
  msgid "text, title of the table of contents"
568
  msgstr ""
569
 
570
- #: toc.php:879
571
  msgid "true/false, shows or hides the title"
572
  msgstr ""
573
 
574
- #: toc.php:880
575
  msgid "text, either \"left\" or \"right\""
576
  msgstr ""
577
 
578
- #: toc.php:881
579
  msgid ""
580
  "numbers, this lets you select the heading levels you want included in the "
581
  "table of contents. Separate multiple levels with a comma. Example: include "
582
  "headings 3, 4 and 5 but exclude the others with"
583
  msgstr ""
584
 
585
- #: toc.php:887
586
  msgid ""
587
  "Allows you to disable the table of contents for the current post, page, or "
588
  "custom post type."
589
  msgstr ""
590
 
591
- #: toc.php:892
592
  msgid ""
593
  "Produces a listing of all pages and categories for your site. You can use "
594
  "this on any post, page or even in a text widget."
595
  msgstr ""
596
 
597
- #: toc.php:897
598
  msgid "Lets you print out a listing of only pages."
599
  msgstr ""
600
 
601
- #: toc.php:900
602
  msgid "number between 1 and 6, defines which html heading to use"
603
  msgstr ""
604
 
605
- #: toc.php:901
606
  msgid "text, title of the list"
607
  msgstr ""
608
 
609
- #: toc.php:902
610
  msgid "true/false, shows or hides the list heading"
611
  msgstr ""
612
 
613
- #: toc.php:903
614
  msgid "IDs of the pages or categories you wish to exclude"
615
  msgstr ""
616
 
617
- #: toc.php:909
618
- msgid "Similar to"
 
619
  msgstr ""
620
 
621
- #: toc.php:909
622
- msgid "but for categories."
623
  msgstr ""
624
 
625
- #: toc.php:915
626
  msgid "I have another question..."
627
  msgstr ""
628
 
629
- #: toc.php:916
630
- msgid "Visit the"
631
- msgstr ""
632
-
633
- #: toc.php:916
634
- msgid "plugin homepage"
635
- msgstr ""
636
-
637
- #: toc.php:916
638
  msgid ""
639
- "to ask your question - who knows, maybe your question has already been "
640
- "answered. I'd really like to hear your suggestions if you have any."
 
641
  msgstr ""
642
 
643
- #: toc.php:922
644
  msgid "Update Options"
645
  msgstr ""
646
 
647
- #: toc.php:1413
648
  msgid "Display the table of contents in the sidebar with this widget"
649
  msgstr ""
 
 
 
 
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/table-of-contents-plus\n"
7
+ "POT-Creation-Date: 2012-11-17 03:02:57+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: toc.php:171
16
  msgid "Settings"
17
  msgstr ""
18
 
19
+ #: toc.php:341 toc.php:342
20
  msgid "TOC"
21
  msgstr ""
22
 
23
+ #: toc.php:486
24
  msgid "Options saved."
25
  msgstr ""
26
 
27
+ #: toc.php:488
28
  msgid "Save failed."
29
  msgstr ""
30
 
31
+ #: toc.php:500
32
  msgid "Main Options"
33
  msgstr ""
34
 
35
+ #: toc.php:501
36
  msgid "Sitemap"
37
  msgstr ""
38
 
39
+ #: toc.php:502
40
  msgid "Help"
41
  msgstr ""
42
 
43
+ #: toc.php:510
44
  msgid "Position"
45
  msgstr ""
46
 
47
+ #: toc.php:513
48
  msgid "Before first heading (default)"
49
  msgstr ""
50
 
51
+ #: toc.php:514
52
  msgid "Top"
53
  msgstr ""
54
 
55
+ #: toc.php:515
56
  msgid "Bottom"
57
  msgstr ""
58
 
59
+ #: toc.php:520
60
  msgid "Show when"
61
  msgstr ""
62
 
63
+ #. translators: text follows drop down list of numbers
64
+ #: toc.php:532
65
  msgid "or more headings are present"
66
  msgstr ""
67
 
68
+ #: toc.php:536
69
  msgid "Auto insert for the following content types"
70
  msgstr ""
71
 
72
+ #. translators: this is the title of the table of contents
73
+ #: toc.php:551
74
  msgid "Heading text"
75
  msgstr ""
76
 
77
+ #: toc.php:553
78
  msgid "Show title on top of the table of contents"
79
  msgstr ""
80
 
81
+ #: toc.php:556
82
  msgid "Eg: Contents, Table of Contents, Page Contents"
83
  msgstr ""
84
 
85
+ #: toc.php:558
86
  msgid "Allow the user to toggle the visibility of the table of contents"
87
  msgstr ""
88
 
89
+ #: toc.php:563
90
  msgid "Show text"
91
  msgstr ""
92
 
93
+ #. translators: example text to display when you want to expand the table of
94
+ #. contents
95
+ #: toc.php:567
96
  msgid "Eg: show"
97
  msgstr ""
98
 
99
+ #: toc.php:570
100
  msgid "Hide text"
101
  msgstr ""
102
 
103
+ #. translators: example text to display when you want to collapse the table of
104
+ #. contents
105
+ #: toc.php:574
106
  msgid "Eg: hide"
107
  msgstr ""
108
 
109
+ #: toc.php:578
110
+ msgid "Hide the table of contents initially"
111
+ msgstr ""
112
+
113
+ #: toc.php:584
114
  msgid "Show hierarchy"
115
  msgstr ""
116
 
117
+ #: toc.php:588
118
  msgid "Number list items"
119
  msgstr ""
120
 
121
+ #: toc.php:592
122
  msgid "Enable smooth scroll effect"
123
  msgstr ""
124
 
125
+ #: toc.php:593
126
  msgid "Scroll rather than jump to the anchor link"
127
  msgstr ""
128
 
129
+ #: toc.php:598
130
  msgid "Appearance"
131
  msgstr ""
132
 
133
+ #: toc.php:602
134
  msgid "Width"
135
  msgstr ""
136
 
137
+ #: toc.php:605
138
  msgid "Fixed width"
139
  msgstr ""
140
 
141
+ #: toc.php:616
 
 
 
 
142
  msgid "Relative"
143
  msgstr ""
144
 
145
+ #: toc.php:617
146
+ msgid "Auto (default)"
147
  msgstr ""
148
 
149
+ #. translators: other width
150
+ #: toc.php:627
151
  msgid "Other"
152
  msgstr ""
153
 
154
+ #: toc.php:628
155
  msgid "User defined"
156
  msgstr ""
157
 
158
+ #. translators: ignore %s as it's some HTML label tags
159
+ #: toc.php:634
160
+ msgid "Please enter a number and %s select its units, eg: 100px, 10em"
161
  msgstr ""
162
 
163
+ #: toc.php:645
 
 
 
 
164
  msgid "Wrapping"
165
  msgstr ""
166
 
167
+ #: toc.php:648
168
  msgid "None (default)"
169
  msgstr ""
170
 
171
+ #: toc.php:649
172
  msgid "Left"
173
  msgstr ""
174
 
175
+ #: toc.php:650
176
  msgid "Right"
177
  msgstr ""
178
 
179
+ #: toc.php:655
180
  msgid "Font size"
181
  msgstr ""
182
 
183
+ #. translators: appearance / colour / look and feel options
184
+ #: toc.php:668
185
  msgid "Presentation"
186
  msgstr ""
187
 
188
+ #: toc.php:671
189
  msgid "Grey (default)"
190
  msgstr ""
191
 
192
+ #: toc.php:676
193
  msgid "Light blue"
194
  msgstr ""
195
 
196
+ #: toc.php:681
197
  msgid "White"
198
  msgstr ""
199
 
200
+ #: toc.php:686
201
  msgid "Black"
202
  msgstr ""
203
 
204
+ #: toc.php:691
205
  msgid "Transparent"
206
  msgstr ""
207
 
208
+ #: toc.php:696
209
  msgid "Custom"
210
  msgstr ""
211
 
212
+ #: toc.php:706
213
  msgid "Background"
214
  msgstr ""
215
 
216
+ #: toc.php:710
217
  msgid "Border"
218
  msgstr ""
219
 
220
+ #: toc.php:714 toc.php:1556
221
  msgid "Title"
222
  msgstr ""
223
 
224
+ #: toc.php:718
225
  msgid "Links"
226
  msgstr ""
227
 
228
+ #: toc.php:722
229
  msgid "Links (hover)"
230
  msgstr ""
231
 
232
+ #: toc.php:726
233
+ msgid "Links (visited)"
234
  msgstr ""
235
 
236
+ #: toc.php:733
237
+ msgid "Leaving the value as %s will inherit your theme's styles"
238
  msgstr ""
239
 
240
+ #: toc.php:740
 
 
 
 
 
 
 
 
 
 
241
  msgid "Advanced"
242
  msgstr ""
243
 
244
+ #: toc.php:740 toc.php:857
245
  msgid "show"
246
  msgstr ""
247
 
248
+ #: toc.php:742
249
  msgid "Power options"
250
  msgstr ""
251
 
252
+ #: toc.php:746
253
  msgid "Include homepage"
254
  msgstr ""
255
 
256
+ #: toc.php:747
257
  msgid "Show the table of contents for qualifying items on the homepage"
258
  msgstr ""
259
 
260
+ #: toc.php:750
261
  msgid "Exclude CSS file"
262
  msgstr ""
263
 
264
+ #: toc.php:751
265
  msgid ""
266
  "Prevent the loading of this plugin's CSS styles. When selected, the "
267
  "presentation options from above will also be ignored."
268
  msgstr ""
269
 
270
+ #: toc.php:754
271
+ msgid "Preserve theme bullets"
272
+ msgstr ""
273
+
274
+ #: toc.php:755
275
+ msgid ""
276
+ "If your theme includes background images for unordered list elements, enable "
277
+ "this to support them"
278
+ msgstr ""
279
+
280
+ #: toc.php:758
281
  msgid "Heading levels"
282
  msgstr ""
283
 
284
+ #: toc.php:760
285
+ msgid ""
286
+ "Include the following heading levels. Deselecting a heading will exclude it."
287
  msgstr ""
288
 
289
+ #: toc.php:766
290
  msgid "heading "
291
  msgstr ""
292
 
293
+ #: toc.php:772
294
  msgid "Smooth scroll top offset"
295
  msgstr ""
296
 
297
+ #: toc.php:775
298
  msgid ""
299
  "If you have a consistent menu across the top of your site, you can adjust "
300
  "the top offset to stop the headings from appearing underneath the top menu. "
302
  "after you have enabled smooth scrolling from above."
303
  msgstr ""
304
 
305
+ #: toc.php:779
306
+ msgid "Restrict path"
307
+ msgstr ""
308
+
309
+ #: toc.php:782
310
+ msgid ""
311
+ "Restrict generation of the table of contents to pages that match the "
312
+ "required path. This path is from the root of your site and always begins "
313
+ "with a forward slash."
314
+ msgstr ""
315
+
316
+ #. translators: example URL path restriction
317
+ #: toc.php:785
318
+ msgid "Eg: /wiki/, /corporate/annual-reports/"
319
+ msgstr ""
320
+
321
+ #: toc.php:789
322
  msgid "Default anchor prefix"
323
  msgstr ""
324
 
325
+ #: toc.php:792
326
  msgid ""
327
  "Anchor targets are restricted to alphanumeric characters as per HTML "
328
  "specification (see readme for more detail). The default anchor prefix will "
330
  "instead."
331
  msgstr ""
332
 
333
+ #: toc.php:793
334
  msgid ""
335
  "This option normally applies to content written in character sets other than "
336
  "ASCII."
337
  msgstr ""
338
 
339
+ #. translators: example anchor prefixes when no ascii characters match
340
+ #: toc.php:796
341
  msgid "Eg: i, toc_index, index, _"
342
  msgstr ""
343
 
344
+ #. translators: advanced usage
345
+ #: toc.php:804
346
  msgid "Usage"
347
  msgstr ""
348
 
349
+ #: toc.php:805
350
  msgid ""
351
  "If you would like to fully customise the position of the table of contents, "
352
+ "you can use the %s shortcode by placing it at the desired position of your "
353
+ "post, page or custom post type. This method allows you to generate the table "
354
+ "of contents despite having auto insertion disabled for its content type. "
355
+ "Please visit the help tab for further information about this shortcode."
 
 
 
 
 
 
 
 
 
356
  msgstr ""
357
 
358
+ #: toc.php:813
359
  msgid ""
360
+ "At its simplest, placing %s into a page will automatically create a sitemap "
361
+ "of all pages and categories. This also works in a text widget."
362
  msgstr ""
363
 
364
+ #: toc.php:817
365
  msgid "Show page listing"
366
  msgstr ""
367
 
368
+ #: toc.php:821
369
  msgid "Show category listing"
370
  msgstr ""
371
 
372
+ #: toc.php:825
373
  msgid "Heading type"
374
  msgstr ""
375
 
376
+ #. translators: the full line is supposed to read - Use [1-6 drop down list] to
377
+ #. print out the titles
378
+ #: toc.php:828
379
  msgid "Use"
380
  msgstr ""
381
 
382
+ #. translators: the full line is supposed to read - Use [h1-h6 drop down list]
383
+ #. to print out the titles
384
+ #: toc.php:839
385
  msgid "to print out the titles"
386
  msgstr ""
387
 
388
+ #: toc.php:843
389
  msgid "Pages label"
390
  msgstr ""
391
 
392
+ #: toc.php:845
393
  msgid "Eg: Pages, Page List"
394
  msgstr ""
395
 
396
+ #: toc.php:849
397
  msgid "Categories label"
398
  msgstr ""
399
 
400
+ #: toc.php:851
401
  msgid "Eg: Categories, Category List"
402
  msgstr ""
403
 
404
+ #: toc.php:857
405
  msgid "Advanced usage"
406
  msgstr ""
407
 
408
+ #: toc.php:859
 
 
 
 
409
  msgid ""
410
+ "lets you print out a listing of only pages. Similarly %s can be used to "
411
+ "print out a category listing. They both can accept a number of attributes so "
412
+ "visit the help tab for more information."
413
  msgstr ""
414
 
415
+ #: toc.php:860
416
  msgid "Examples"
417
  msgstr ""
418
 
419
+ #: toc.php:862
420
  msgid "hides the heading from a category listing"
421
  msgstr ""
422
 
423
+ #: toc.php:863
424
+ msgid ""
425
+ "Uses h6 to display %s on a page listing excluding pages with IDs 1 and 15"
 
 
 
426
  msgstr ""
427
 
428
+ #: toc.php:871
429
  msgid "Where's my table of contents?"
430
  msgstr ""
431
 
432
+ #: toc.php:872
433
  msgid ""
434
  "If you're reading this, then chances are you have successfully installed and "
435
  "enabled the plugin and you're just wondering why the index isn't appearing "
436
  "right? Try the following:"
437
  msgstr ""
438
 
439
+ #: toc.php:874
440
  msgid ""
441
  "In most cases, the post, page or custom post type has less than the minimum "
442
  "number of headings. By default, this is set to four so make sure you have at "
444
  "you can find it under 'Main Options' &gt; 'Show when'."
445
  msgstr ""
446
 
447
+ #: toc.php:875
448
  msgid ""
449
  "Is auto insertion enabled for your content type? By default, only pages are "
450
  "enabled."
451
  msgstr ""
452
 
453
+ #: toc.php:876
 
 
 
 
454
  msgid ""
455
+ "Have you got <code>[no_toc]</code> somewhere within the content? This will "
456
+ "disable the index for the current post, page or custom post type."
 
 
 
 
457
  msgstr ""
458
 
459
+ #: toc.php:877
460
+ msgid ""
461
+ "If you are using the TOC+ widget, check if you have the <em>\"Show the table "
462
+ "of contents only in the sidebar\"</em> enabled as this will limit its "
463
+ "display to only the sidebar. You can check by going into Appearance &gt; "
464
+ "Widgets."
465
  msgstr ""
466
 
467
+ #: toc.php:878
468
  msgid ""
469
+ "You may have restricted generation to a URL path match. The setting can be "
470
+ "found in the advanced section under Main Options."
471
  msgstr ""
472
 
473
+ #: toc.php:881
474
  msgid "How do I stop the table of contents from appearing on a single page?"
475
  msgstr ""
476
 
477
+ #: toc.php:882
 
 
 
 
478
  msgid ""
479
+ "Place the following <code>[no_toc]</code> anywhere on the page to suppress "
480
+ "the table of contents. This is known as a shortcode and works for posts, "
481
+ "pages and custom post types that make use of the_content()"
482
  msgstr ""
483
 
484
+ #: toc.php:884
485
  msgid ""
486
  "I've set wrapping to left or right but the headings don't wrap around the "
487
  "table of contents"
488
  msgstr ""
489
 
490
+ #: toc.php:885
491
  msgid ""
492
  "This normally occurs when there is a CSS clear directive in or around the "
493
+ "heading originating from the theme (Twenty Eleven and Twenty Twelve are two "
494
+ "themes which do this). This directive tells the user agent to reset the "
495
+ "previous wrapping specifications."
496
  msgstr ""
497
 
498
+ #: toc.php:886
499
  msgid ""
500
  "You can adjust your theme's CSS or try moving the table of contents position "
501
  "to the top of the page. If you didn't build your theme, I'd highly suggest "
502
+ "you try the %s if you wish to make CSS changes."
503
  msgstr ""
504
 
505
+ #. translators: CSS code follows after this line
506
+ #: toc.php:889
507
+ msgid ""
508
+ "Try adding the following CSS to allow the wrapping to occur around the table "
509
+ "of contents:"
510
  msgstr ""
511
 
512
+ #: toc.php:894
513
+ msgid "How do I include the name of the page in the table of contents title?"
514
  msgstr ""
515
 
516
+ #: toc.php:895
517
  msgid ""
518
+ "As the title of the page changes depending on the page you're viewing, you "
519
+ "can use the following special variable to automatically insert the title of "
520
+ "the page into the table of contents heading:"
 
 
521
  msgstr ""
522
 
523
+ #: toc.php:897
524
+ msgid "You can use it as is or place text either side of the variable."
525
  msgstr ""
526
 
527
+ #: toc.php:898
528
+ msgid ""
529
+ "As an example: if your page is named <em>Great Expectations</em> and your "
530
+ "table of contents title is set to <em>Contents for %PAGE_NAME%</em>, the "
531
+ "final title would read <em>Contents for Great Expectations</em>"
532
  msgstr ""
533
 
534
+ #: toc.php:900
535
+ msgid "The sitemap uses a strange font dissimilar to the rest of the site"
536
+ msgstr ""
537
+
538
+ #: toc.php:901
539
  msgid ""
540
  "No extra styles are created for the sitemap, instead it inherits any styles "
541
  "you used when adding the shortcode. If you copy and pasted, you probably "
543
  "case."
544
  msgstr ""
545
 
546
+ #: toc.php:902
547
  msgid ""
548
  "In most cases, try to have the shortcode on its own line with nothing before "
549
  "or after the square brackets."
550
  msgstr ""
551
 
552
+ #: toc.php:904
553
  msgid "What were those shortcodes and attributes again?"
554
  msgstr ""
555
 
556
+ #: toc.php:905
557
  msgid ""
558
  "When attributes are left out for the shortcodes below, they will fallback to "
559
  "the settings you defined under Settings &gt; TOC+."
560
  msgstr ""
561
 
562
+ #: toc.php:909
563
  msgid "Shortcode"
564
  msgstr ""
565
 
566
+ #: toc.php:910
567
  msgid "Description"
568
  msgstr ""
569
 
570
+ #: toc.php:911
571
  msgid "Attributes"
572
  msgstr ""
573
 
574
+ #: toc.php:917
575
  msgid ""
576
  "Lets you generate the table of contents at the preferred position. Also "
577
  "useful for sites that only require a TOC on a small handful of pages."
578
  msgstr ""
579
 
580
+ #: toc.php:920
581
  msgid "text, title of the table of contents"
582
  msgstr ""
583
 
584
+ #: toc.php:921
585
  msgid "true/false, shows or hides the title"
586
  msgstr ""
587
 
588
+ #: toc.php:922
589
  msgid "text, either \"left\" or \"right\""
590
  msgstr ""
591
 
592
+ #: toc.php:923
593
  msgid ""
594
  "numbers, this lets you select the heading levels you want included in the "
595
  "table of contents. Separate multiple levels with a comma. Example: include "
596
  "headings 3, 4 and 5 but exclude the others with"
597
  msgstr ""
598
 
599
+ #: toc.php:929
600
  msgid ""
601
  "Allows you to disable the table of contents for the current post, page, or "
602
  "custom post type."
603
  msgstr ""
604
 
605
+ #: toc.php:934
606
  msgid ""
607
  "Produces a listing of all pages and categories for your site. You can use "
608
  "this on any post, page or even in a text widget."
609
  msgstr ""
610
 
611
+ #: toc.php:939
612
  msgid "Lets you print out a listing of only pages."
613
  msgstr ""
614
 
615
+ #: toc.php:942
616
  msgid "number between 1 and 6, defines which html heading to use"
617
  msgstr ""
618
 
619
+ #: toc.php:943
620
  msgid "text, title of the list"
621
  msgstr ""
622
 
623
+ #: toc.php:944
624
  msgid "true/false, shows or hides the list heading"
625
  msgstr ""
626
 
627
+ #: toc.php:945
628
  msgid "IDs of the pages or categories you wish to exclude"
629
  msgstr ""
630
 
631
+ #: toc.php:946
632
+ msgid ""
633
+ "ID of the page or category you wish to exclude including its all descendants"
634
  msgstr ""
635
 
636
+ #: toc.php:952
637
+ msgid "Similar to [sitemap_pages] but for categories."
638
  msgstr ""
639
 
640
+ #: toc.php:958
641
  msgid "I have another question..."
642
  msgstr ""
643
 
644
+ #: toc.php:959
 
 
 
 
 
 
 
 
645
  msgid ""
646
+ "Visit the %1$splugin homepage%2$s to ask your question - who knows, maybe "
647
+ "your question has already been answered. I'd really like to hear your "
648
+ "suggestions if you have any."
649
  msgstr ""
650
 
651
+ #: toc.php:965
652
  msgid "Update Options"
653
  msgstr ""
654
 
655
+ #: toc.php:1470
656
  msgid "Display the table of contents in the sidebar with this widget"
657
  msgstr ""
658
+
659
+ #: toc.php:1562
660
+ msgid "Show the table of contents only in the sidebar"
661
+ msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: table of contents, indexes, toc, sitemap, cms, options, list, page listing, category listing
5
  Requires at least: 3.0
6
  Tested up to: 3.5
7
- Stable tag: 1208
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -13,21 +13,23 @@ A powerful yet user friendly plugin that automatically creates a table of conten
13
 
14
  == Description ==
15
 
16
- A powerful yet user friendly plugin that automatically creates a context specific index or table of contents (TOC) for long pages (and custom post types). More than just a table of contents plugin, this plugin can also output a sitemap listing pages and/or categories.
17
 
18
  Built from the ground up and with Wikipedia in mind, the table of contents by default appears before the first heading on a page. This allows the author to insert lead-in content that may summarise or introduce the rest of the page. It also uses a unique numbering scheme that doesn't get lost through CSS differences across themes.
19
 
20
- This plugin is a great companion for content rich sites such as content management system oriented configurations. That said, bloggers also have the same benefits when writing long structured articles.
21
 
22
- Includes an administration options panel where you can customise settings like display position, define the minimum number of headings before an index is displayed, appearance, etc. Using shortcodes, you can override default behaviour such as special exclusions on a specific page or even to hide the table of contents altogether.
 
 
23
 
24
  Custom post types are supported, however, auto insertion works only when the_content() has been used by the custom post type. Each post type will appear in the options panel, so enable the ones you want.
25
 
26
  = Available Languages =
27
  * Australian English (default)
28
- * Simplified Chinese - [icedream](http://www.tesfans.org/)
29
-
30
- Translations are more than welcome.
31
 
32
  If you have questions or suggestions, please place them at [http://dublue.com/plugins/toc/](http://dublue.com/plugins/toc/)
33
 
@@ -76,6 +78,7 @@ Lets you print out a listing of only pages. The following attributes are accepte
76
  * "label": text, title of the list
77
  * "no_label": true/false, shows or hides the list heading
78
  * "exclude": IDs of the pages or categories you wish to exclude
 
79
 
80
  = [sitemap_categories] =
81
  Same as `[sitemap_pages]` but for categories.
@@ -83,6 +86,23 @@ Same as `[sitemap_pages]` but for categories.
83
 
84
  == Changelog ==
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  = 1208 =
87
  * Released: 2 August 2012
88
  * New: advanced option to prevent the output of this plugin's CSS. This option allows the site owner to incorporate styles in one of their existing style sheets. Thanks to [Ivan](http://dublue.com/plugins/toc/comment-page-1/#comment-226) and [Swashata](http://dublue.com/plugins/toc/comment-page-3/#comment-3312) for suggesting it.
@@ -179,9 +199,9 @@ Same as `[sitemap_pages]` but for categories.
179
 
180
  == Frequently Asked Questions ==
181
 
182
- Check out the FAQs / Scenarios at [http://dublue.com/plugins/toc/](http://dublue.com/plugins/toc/)
183
 
184
 
185
  == Upgrade Notice ==
186
 
187
- Update folder with the latest files. Any previous options will be saved.
4
  Tags: table of contents, indexes, toc, sitemap, cms, options, list, page listing, category listing
5
  Requires at least: 3.0
6
  Tested up to: 3.5
7
+ Stable tag: 1211
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
13
 
14
  == Description ==
15
 
16
+ A powerful yet user friendly plugin that automatically creates a context specific index or table of contents (TOC) for long pages (and custom post types). More than just a table of contents plugin, this plugin can also output a sitemap listing pages and/or categories across your entire site.
17
 
18
  Built from the ground up and with Wikipedia in mind, the table of contents by default appears before the first heading on a page. This allows the author to insert lead-in content that may summarise or introduce the rest of the page. It also uses a unique numbering scheme that doesn't get lost through CSS differences across themes.
19
 
20
+ This plugin is a great companion for content rich sites such as content management system oriented configurations. That said, bloggers also have the same benefits when writing long structured articles. [Discover how Google](http://dublue.com/2012/05/12/another-benefit-to-structure-your-web-pages/) uses this index to provide 'Jump To' links to your content.
21
 
22
+ Includes an administration options panel where you can customise settings like display position, define the minimum number of headings before an index is displayed, other appearance, and more. For power users, expand the advanced options to further tweak its behaviour - eg: exclude undesired heading levels like h5 and h6 from being included; disable the output of the included CSS file; adjust the top offset and more. Using shortcodes, you can override default behaviour such as special exclusions on a specific page or even to hide the table of contents altogether.
23
+
24
+ Prefer to include the index in the sidebar? Go to Appearance > Widgets and drag the TOC+ to your desired sidebar and position.
25
 
26
  Custom post types are supported, however, auto insertion works only when the_content() has been used by the custom post type. Each post type will appear in the options panel, so enable the ones you want.
27
 
28
  = Available Languages =
29
  * Australian English (default)
30
+ * Simplified Chinese - [icedream](http://www.tesfans.org/)
31
+
32
+ Translations are more than welcome. If you have any advice in making it easier to translate, please let me know.
33
 
34
  If you have questions or suggestions, please place them at [http://dublue.com/plugins/toc/](http://dublue.com/plugins/toc/)
35
 
78
  * "label": text, title of the list
79
  * "no_label": true/false, shows or hides the list heading
80
  * "exclude": IDs of the pages or categories you wish to exclude
81
+ * "exclude_tree": ID of the page or category you wish to exclude including its all descendants
82
 
83
  = [sitemap_categories] =
84
  Same as `[sitemap_pages]` but for categories.
86
 
87
  == Changelog ==
88
 
89
+ = 1211 =
90
+ * Released: 17 November 2012
91
+ * New: allow %PAGE_TITLE% to be used in the TOC title. Note that this also works in the widget title too. When used, this variable will be replaced with the current page's title. Thanks to [Peter](http://dublue.com/plugins/toc/comment-page-3/#comment-4782) for the request.
92
+ * New: new option to hide the TOC initially. Thanks to [Jonas](http://dublue.com/plugins/toc/comment-page-2/#comment-852), [Jonathan](http://dublue.com/plugins/toc/comment-page-2/#comment-2161), and [Doc Germanicus](http://dublue.com/plugins/toc/comment-page-4/#comment-5048) for requesting it.
93
+ * New: added ability to customise visited TOC link colour.
94
+ * New: option to restrict generation to a URL path match. For example, you can restrict to wiki pages that fall under http://domain/wiki/ by entering /wiki/ into the field. The setting can be found in the advanced options. Thanks to [Tux](http://dublue.com/plugins/toc/comment-page-3/#comment-4466) and [Justine Smithies](http://dublue.com/plugins/toc/comment-page-3/#comment-5000) for suggesting it.
95
+ * Make regular expressions less greedy. That means you can have multiple headings on a single line whereas before you needed to ensure each heading was on their own line. Thanks to [drdamour](http://wordpress.org/support/topic/widget-isnt-showing-up) for raising and providing a fix.
96
+ * Also make regular expressions match across multiple lines. This means you can have your single heading split across many lines.
97
+ * Better accessibility: when using smooth scrolling, allow for focus to follow the target, eg tabbing through will continue from the content block you clicked through to.
98
+ * Better performance: as requested by a few, javascript files have been consolidated into one and both javascript and CSS files are now minified.
99
+ * 'Auto' is now the default width which means it'll take up the needed amount of space up to 100%. The previous default was a fixed width of 275px.
100
+ * Added the ability to exclude entire branches when using [sitemap_pages] and [sitemap_categories] using the exclude_tree attribute. Thanks to [Benny Powers](http://dublue.com/plugins/toc/comment-page-3/#comment-3607) for requesting it.
101
+ * Wrap index numbers around span tags to enable easier CSS customisation. The spans are have two classes: toc_number and toc_depth_X where X is between 1 and 6. Thanks to [Matthias Krok](http://dublue.com/plugins/toc/comment-page-3/#comment-3922) for requesting it.
102
+ * Moved the 'preserve theme bullets' option into the advanced section.
103
+ * Updated and simplified the translation file.
104
+ * Fixed: [sitemap_categories] using the wrong label when none was specified. Thanks to [brandt-net](http://wordpress.org/support/topic/plugin-table-of-contents-plus-sitemap-setting-categories-label-of-sitemap_categories-not-shown) for raising it. The labels for both [sitemap_pages] and [sitemap_categories] may be removed in a future update as you can insert the title within your content.
105
+
106
  = 1208 =
107
  * Released: 2 August 2012
108
  * New: advanced option to prevent the output of this plugin's CSS. This option allows the site owner to incorporate styles in one of their existing style sheets. Thanks to [Ivan](http://dublue.com/plugins/toc/comment-page-1/#comment-226) and [Swashata](http://dublue.com/plugins/toc/comment-page-3/#comment-3312) for suggesting it.
199
 
200
  == Frequently Asked Questions ==
201
 
202
+ Check out the FAQs / Scenarios at [http://dublue.com/plugins/toc/#Scenarios_FAQs](http://dublue.com/plugins/toc/#Scenarios_FAQs)
203
 
204
 
205
  == Upgrade Notice ==
206
 
207
+ Update folder with the latest files. All previous options will be saved.
screen.css CHANGED
@@ -1,65 +1 @@
1
- #toc_container ul, #toc_container li {
2
- margin: 0;
3
- padding: 0;
4
- }
5
- #toc_container.no_bullets ul, #toc_container.no_bullets li,
6
- .toc_widget_list, .toc_widget_list li {
7
- background: none;
8
- list-style-type: none;
9
- }
10
- #toc_container.have_bullets li {
11
- padding-left: 12px;
12
- }
13
- #toc_container ul ul {
14
- margin-left: 1.5em;
15
- }
16
- #toc_container {
17
- background: #f9f9f9;
18
- border: 1px solid #aaa;
19
- padding: 10px;
20
- margin-bottom: 1em;
21
- width: 275px;
22
- font-size: 95%;
23
- }
24
- #toc_container.toc_light_blue {
25
- background: #edf6ff;
26
- }
27
- #toc_container.toc_white {
28
- background: #fff;
29
- }
30
- #toc_container.toc_black {
31
- background: #000;
32
- }
33
- #toc_container.toc_transparent {
34
- background: none transparent;
35
- }
36
- #toc_container p.toc_title {
37
- text-align: center;
38
- font-weight: bold;
39
- margin: 0;
40
- padding: 0;
41
- }
42
- #toc_container.toc_black p.toc_title {
43
- color: #aaa;
44
- }
45
- #toc_container span.toc_toggle {
46
- font-weight: normal;
47
- font-size: 90%;
48
- }
49
- #toc_container p.toc_title + ul.toc_list {
50
- margin-top: 1em;
51
- }
52
- .toc_wrap_left {
53
- float: left;
54
- margin-right: 10px;
55
- }
56
- .toc_wrap_right {
57
- float: right;
58
- margin-left: 10px;
59
- }
60
- #toc_container a {
61
- text-decoration: none;
62
- }
63
- #toc_container a:hover {
64
- text-decoration: underline;
65
- }
1
+ #toc_container ul,#toc_container li{margin:0;padding:0}#toc_container.no_bullets ul,#toc_container.no_bullets li,.toc_widget_list,.toc_widget_list li{background:none;list-style-type:none}#toc_container.have_bullets li{padding-left:12px}#toc_container ul ul{margin-left:1.5em}#toc_container{background:#f9f9f9;border:1px solid #aaa;padding:10px;margin-bottom:1em;width:auto;display:table;font-size:95%}#toc_container.toc_light_blue{background:#edf6ff}#toc_container.toc_white{background:#fff}#toc_container.toc_black{background:#000}#toc_container.toc_transparent{background:none transparent}#toc_container p.toc_title{text-align:center;font-weight:bold;margin:0;padding:0}#toc_container.toc_black p.toc_title{color:#aaa}#toc_container span.toc_toggle{font-weight:normal;font-size:90%}#toc_container p.toc_title + ul.toc_list{margin-top:1em}.toc_wrap_left{float:left;margin-right:10px}.toc_wrap_right{float:right;margin-left:10px}#toc_container a{text-decoration:none}#toc_container a:hover{text-decoration:underline}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
toc.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://dublue.com/plugins/toc/
5
  Description: A powerful yet user friendly plugin that automatically creates a table of contents. Can also output a sitemap listing all pages and categories.
6
  Author: Michael Tran
7
  Author URI: http://dublue.com/
8
- Version: 1208
9
  License: GPL2
10
  */
11
 
@@ -94,7 +94,8 @@ if ( !class_exists( 'toc' ) ) :
94
  'visibility' => true,
95
  'visibility_show' => 'show',
96
  'visibility_hide' => 'hide',
97
- 'width' => '275px',
 
98
  'width_custom' => '275',
99
  'width_custom_units' => 'px',
100
  'wrapping' => TOC_WRAPPING_NONE,
@@ -111,6 +112,7 @@ if ( !class_exists( 'toc' ) ) :
111
  'include_homepage' => false,
112
  'exclude_css' => false,
113
  'heading_levels' => array('1', '2', '3', '4', '5', '6'),
 
114
  'sitemap_show_page_listing' => true,
115
  'sitemap_show_category_listing' => true,
116
  'sitemap_heading_type' => 3,
@@ -269,18 +271,19 @@ if ( !class_exists( 'toc' ) ) :
269
  'heading' => $this->options['sitemap_heading_type'],
270
  'label' => htmlentities( $this->options['sitemap_pages'], ENT_COMPAT, 'UTF-8' ),
271
  'no_label' => false,
272
- 'exclude' => ''
 
273
  ), $atts )
274
  );
275
-
276
  if ( $heading < 1 || $heading > 6 ) // h1 to h6 are valid
277
  $heading = $this->options['sitemap_heading_type'];
278
-
279
  $html = '<div class="toc_sitemap">';
280
  if ( !$no_label ) $html .= '<h' . $heading . ' class="toc_sitemap_pages">' . $label . '</h' . $heading . '>';
281
  $html .=
282
  '<ul class="toc_sitemap_pages_list">' .
283
- wp_list_pages( array('title_li' => '', 'echo' => false, 'exclude' => $exclude ) ) .
284
  '</ul>' .
285
  '</div>'
286
  ;
@@ -293,9 +296,10 @@ if ( !class_exists( 'toc' ) ) :
293
  {
294
  extract( shortcode_atts( array(
295
  'heading' => $this->options['sitemap_heading_type'],
296
- 'label' => htmlentities( $this->options['sitemap_pages'], ENT_COMPAT, 'UTF-8' ),
297
  'no_label' => false,
298
- 'exclude' => ''
 
299
  ), $atts )
300
  );
301
 
@@ -306,7 +310,7 @@ if ( !class_exists( 'toc' ) ) :
306
  if ( !$no_label ) $html .= '<h' . $heading . ' class="toc_sitemap_categories">' . $label . '</h' . $heading . '>';
307
  $html .=
308
  '<ul class="toc_sitemap_categories_list">' .
309
- wp_list_categories( array('title_li' => '', 'echo' => false, 'exclude' => $exclude ) ) .
310
  '</ul>' .
311
  '</div>'
312
  ;
@@ -319,8 +323,6 @@ if ( !class_exists( 'toc' ) ) :
319
  {
320
  load_plugin_textdomain( 'toc+', false, dirname(plugin_basename(__FILE__)) . '/languages/' );
321
  wp_register_style( 'toc-screen', $this->path . '/screen.css' );
322
- wp_register_script( 'smooth-scroll', $this->path . '/jquery.smooth-scroll.min.js', array('jquery') );
323
- wp_register_script( 'cookie', $this->path . '/jquery.c.min.js', array('jquery') );
324
  wp_register_script( 'toc-front', $this->path . '/front.js', array('jquery') );
325
  }
326
 
@@ -419,8 +421,15 @@ if ( !class_exists( 'toc' ) ) :
419
  $custom_title_colour = $this->hex_value( trim($_POST['custom_title_colour']), TOC_DEFAULT_TITLE_COLOUR );
420
  $custom_links_colour = $this->hex_value( trim($_POST['custom_links_colour']), TOC_DEFAULT_LINKS_COLOUR );
421
  $custom_links_hover_colour = $this->hex_value( trim($_POST['custom_links_hover_colour']), TOC_DEFAULT_LINKS_HOVER_COLOUR );
422
- //$custom_links_visited_colour = $this->hex_value( trim($_POST['custom_links_visited_colour']), TOC_DEFAULT_LINKS_VISITED_COLOUR );
423
-
 
 
 
 
 
 
 
424
  $this->options = array(
425
  'fragment_prefix' => trim($_POST['fragment_prefix']),
426
  'position' => intval($_POST['position']),
@@ -435,6 +444,7 @@ if ( !class_exists( 'toc' ) ) :
435
  'visibility' => (isset($_POST['visibility']) && $_POST['visibility']) ? true : false,
436
  'visibility_show' => stripslashes( trim($_POST['visibility_show']) ),
437
  'visibility_hide' => stripslashes( trim($_POST['visibility_hide']) ),
 
438
  'width' => trim($_POST['width']),
439
  'width_custom' => floatval($_POST['width_custom']),
440
  'width_custom_units' => trim($_POST['width_custom_units']),
@@ -447,10 +457,12 @@ if ( !class_exists( 'toc' ) ) :
447
  'custom_title_colour' => $custom_title_colour,
448
  'custom_links_colour' => $custom_links_colour,
449
  'custom_links_hover_colour' => $custom_links_hover_colour,
 
450
  'bullet_spacing' => (isset($_POST['bullet_spacing']) && $_POST['bullet_spacing']) ? true : false,
451
  'include_homepage' => (isset($_POST['include_homepage']) && $_POST['include_homepage']) ? true : false,
452
  'exclude_css' => (isset($_POST['exclude_css']) && $_POST['exclude_css']) ? true : false,
453
  'heading_levels' => @(array)$_POST['heading_levels'],
 
454
  'sitemap_show_page_listing' => (isset($_POST['sitemap_show_page_listing']) && $_POST['sitemap_show_page_listing']) ? true : false,
455
  'sitemap_show_category_listing' => (isset($_POST['sitemap_show_category_listing']) && $_POST['sitemap_show_category_listing']) ? true : false,
456
  'sitemap_heading_type' => intval($_POST['sitemap_heading_type']),
@@ -515,7 +527,9 @@ if ( !class_exists( 'toc' ) ) :
515
  echo '>' . $i . '</option>' . "\n";
516
  }
517
  ?>
518
- </select> <?php _e('or more headings are present', 'toc+'); ?>
 
 
519
  </td>
520
  </tr>
521
  <tr>
@@ -532,7 +546,9 @@ if ( !class_exists( 'toc' ) ) :
532
  ?>
533
  </tr>
534
  <tr>
535
- <th><label for="show_heading_text"><?php _e('Heading text', 'toc+'); ?></label></th>
 
 
536
  <td>
537
  <input type="checkbox" value="1" id="show_heading_text" name="show_heading_text"<?php if ( $this->options['show_heading_text'] ) echo ' checked="checked"'; ?> /><label for="show_heading_text"> <?php _e('Show title on top of the table of contents', 'toc+'); ?></label><br />
538
  <div class="more_toc_options<?php if ( !$this->options['show_heading_text'] ) echo ' disabled'; ?>">
@@ -546,15 +562,20 @@ if ( !class_exists( 'toc' ) ) :
546
  <tr>
547
  <th><label for="visibility_show"><?php _e('Show text', 'toc+'); ?></label></th>
548
  <td><input type="text" class="" value="<?php echo htmlentities( $this->options['visibility_show'], ENT_COMPAT, 'UTF-8' ); ?>" id="visibility_show" name="visibility_show" />
549
- <span class="description"><label for="visibility_show"><?php _e('Eg: show', 'toc+'); ?></label></span></td>
 
 
550
  </tr>
551
  <tr>
552
  <th><label for="visibility_hide"><?php _e('Hide text', 'toc+'); ?></label></th>
553
  <td><input type="text" class="" value="<?php echo htmlentities( $this->options['visibility_hide'], ENT_COMPAT, 'UTF-8' ); ?>" id="visibility_hide" name="visibility_hide" />
554
- <span class="description"><label for="visibility_hide"><?php _e('Eg: hide', 'toc+'); ?></label></span></td>
 
 
555
  </tr>
556
  </tbody>
557
  </table>
 
558
  </div>
559
  </div>
560
  </td>
@@ -585,7 +606,7 @@ if ( !class_exists( 'toc' ) ) :
585
  <option value="200px"<?php if ( '200px' == $this->options['width'] ) echo ' selected="selected"'; ?>>200px</option>
586
  <option value="225px"<?php if ( '225px' == $this->options['width'] ) echo ' selected="selected"'; ?>>225px</option>
587
  <option value="250px"<?php if ( '250px' == $this->options['width'] ) echo ' selected="selected"'; ?>>250px</option>
588
- <option value="275px"<?php if ( '275px' == $this->options['width'] ) echo ' selected="selected"'; ?>>275px <?php _e('(default)', 'toc+'); ?></option>
589
  <option value="300px"<?php if ( '300px' == $this->options['width'] ) echo ' selected="selected"'; ?>>300px</option>
590
  <option value="325px"<?php if ( '325px' == $this->options['width'] ) echo ' selected="selected"'; ?>>325px</option>
591
  <option value="350px"<?php if ( '350px' == $this->options['width'] ) echo ' selected="selected"'; ?>>350px</option>
@@ -593,7 +614,7 @@ if ( !class_exists( 'toc' ) ) :
593
  <option value="400px"<?php if ( '400px' == $this->options['width'] ) echo ' selected="selected"'; ?>>400px</option>
594
  </optgroup>
595
  <optgroup label="<?php _e('Relative', 'toc+'); ?>">
596
- <option value="Auto"<?php if ( 'Auto' == $this->options['width'] ) echo ' selected="selected"'; ?>><?php _e('Auto', 'toc+'); ?></option>
597
  <option value="25%"<?php if ( '25%' == $this->options['width'] ) echo ' selected="selected"'; ?>>25%</option>
598
  <option value="33%"<?php if ( '33%' == $this->options['width'] ) echo ' selected="selected"'; ?>>33%</option>
599
  <option value="50%"<?php if ( '50%' == $this->options['width'] ) echo ' selected="selected"'; ?>>50%</option>
@@ -601,12 +622,16 @@ if ( !class_exists( 'toc' ) ) :
601
  <option value="75%"<?php if ( '75%' == $this->options['width'] ) echo ' selected="selected"'; ?>>75%</option>
602
  <option value="100%"<?php if ( '100%' == $this->options['width'] ) echo ' selected="selected"'; ?>>100%</option>
603
  </optgroup>
604
- <optgroup label="<?php _e('Other', 'toc+'); ?>">
 
 
605
  <option value="User defined"<?php if ( 'User defined' == $this->options['width'] ) echo ' selected="selected"'; ?>><?php _e('User defined', 'toc+'); ?></option>
606
  </optgroup>
607
  </select>
608
  <div class="more_toc_options<?php if ( 'User defined' != $this->options['width'] ) echo ' disabled'; ?>">
609
- <label for="width_custom"><?php _e('Please enter a number and', 'toc+'); ?></label><label for="width_custom_units"> <?php _e('select its units, eg: 100px, 10em', 'toc+'); ?></label><br />
 
 
610
  <input type="text" class="regular-text" value="<?php echo floatval($this->options['width_custom']); ?>" id="width_custom" name="width_custom" />
611
  <select name="width_custom_units" id="width_custom_units">
612
  <option value="px"<?php if ( 'px' == $this->options['width_custom_units'] ) echo ' selected="selected"'; ?>>px</option>
@@ -638,7 +663,9 @@ if ( !class_exists( 'toc' ) ) :
638
  </td>
639
  </tr>
640
  <tr>
641
- <th><?php _e('Presentation', 'toc+'); ?></th>
 
 
642
  <td>
643
  <div class="toc_theme_option">
644
  <input type="radio" name="theme" id="theme_<?php echo TOC_THEME_GREY; ?>" value="<?php echo TOC_THEME_GREY; ?>"<?php if ( $this->options['theme'] == TOC_THEME_GREY ) echo ' checked="checked"'; ?> /><label for="theme_<?php echo TOC_THEME_GREY; ?>"> <?php _e('Grey (default)', 'toc+'); ?><br />
@@ -695,26 +722,18 @@ if ( !class_exists( 'toc' ) ) :
695
  <th><label for="custom_links_hover_colour"><?php _e('Links (hover)', 'toc+'); ?></label></th>
696
  <td><input type="text" class="custom_colour_option" value="<?php echo htmlentities( $this->options['custom_links_hover_colour'] ); ?>" id="custom_links_hover_colour" name="custom_links_hover_colour" /> <img src="<?php echo $this->path; ?>/images/colour-wheel.png" alt="" /></td>
697
  </tr>
698
- <?php
699
- /* visited links not applied when smooth scrolling enabled, leaving out for now
700
  <tr>
701
  <th><label for="custom_links_visited_colour"><?php _e('Links (visited)', 'toc+'); ?></label></th>
702
  <td><input type="text" class="custom_colour_option" value="<?php echo htmlentities( $this->options['custom_links_visited_colour'] ); ?>" id="custom_links_visited_colour" name="custom_links_visited_colour" /> <img src="<?php echo $this->path; ?>/images/colour-wheel.png" alt="" /></td>
703
  </tr>
704
- */
705
- ?>
706
  </tbody>
707
  </table>
708
  <div id="farbtastic_colour_wheel"></div>
709
  <div class="clear"></div>
710
- <p><?php _e('Leaving the value as', 'toc+'); echo ' <code>#</code> '; _e("will inherit your theme's styles", 'toc+'); ?></p>
711
  </div>
712
  </td>
713
  </tr>
714
- <tr>
715
- <th><label for="bullet_spacing"><?php _e('Preserve theme bullets', 'toc+'); ?></label></th>
716
- <td><input type="checkbox" value="1" id="bullet_spacing" name="bullet_spacing"<?php if ( $this->options['bullet_spacing'] ) echo ' checked="checked"'; ?> /><label for="bullet_spacing"> <?php _e('If your theme includes background images for unordered list elements, enable this to support them', 'toc+'); ?></label></td>
717
- </tr>
718
  </tbody>
719
  </table>
720
 
@@ -731,10 +750,14 @@ if ( !class_exists( 'toc' ) ) :
731
  <th><label for="exclude_css"><?php _e('Exclude CSS file', 'toc+'); ?></label></th>
732
  <td><input type="checkbox" value="1" id="exclude_css" name="exclude_css"<?php if ( $this->options['exclude_css'] ) echo ' checked="checked"'; ?> /><label for="exclude_css"> <?php _e("Prevent the loading of this plugin's CSS styles. When selected, the presentation options from above will also be ignored.", 'toc+'); ?></label></td>
733
  </tr>
 
 
 
 
734
  <tr>
735
  <th><?php _e('Heading levels', 'toc+'); ?></th>
736
  <td>
737
- <p><?php _e('Include (or exclude) the following heading levels', 'toc+'); ?></p>
738
  <?php
739
  // show heading 1 to 6 options
740
  for ($i = 1; $i <= 6; $i++) {
@@ -752,20 +775,34 @@ if ( !class_exists( 'toc' ) ) :
752
  <label for="smooth_scroll_offset"><?php _e('If you have a consistent menu across the top of your site, you can adjust the top offset to stop the headings from appearing underneath the top menu. A setting of 30 accommodates the WordPress admin bar. This setting appears after you have enabled smooth scrolling from above.', 'toc+'); ?></label>
753
  </td>
754
  </tr>
 
 
 
 
 
 
 
 
 
 
755
  <tr>
756
  <th><label for="fragment_prefix"><?php _e('Default anchor prefix', 'toc+'); ?></label></th>
757
  <td>
758
  <input type="text" class="regular-text" value="<?php echo htmlentities( $this->options['fragment_prefix'] ); ?>" id="fragment_prefix" name="fragment_prefix" /><br />
759
  <label for="fragment_prefix"><?php _e('Anchor targets are restricted to alphanumeric characters as per HTML specification (see readme for more detail). The default anchor prefix will be used when no characters qualify. When left blank, a number will be used instead.', 'toc+'); ?><br />
760
  <?php _e('This option normally applies to content written in character sets other than ASCII.', 'toc+'); ?><br />
761
- <span class="description"><?php _e('Eg: i, toc_index, index, _', 'toc+'); ?></span></label>
 
 
762
  </td>
763
  </tr>
764
  </tbody>
765
  </table>
766
 
767
- <h4><?php _e('Usage', 'toc+'); ?></h4>
768
- <p><?php _e('If you would like to fully customise the position of the table of contents, you can use the', 'toc+'); ?> <code>[toc]</code> <?php _e('shortcode by placing it at the desired position of your post, page or custom post type. This method allows you to generate the table of contents despite having auto insertion disabled for its content type. Please visit the help tab for further information about this shortcode.', 'toc+'); ?></p>
 
 
769
  </div>
770
 
771
 
@@ -773,7 +810,7 @@ if ( !class_exists( 'toc' ) ) :
773
  <div id="tab2" class="tab_content">
774
 
775
 
776
- <p><?php _e('At its simplest, placing', 'toc+'); ?> <code>[sitemap]</code> <?php _e('into a page will automatically create a sitemap of all pages and categories. This also works in a text widget.', 'toc+'); ?></p>
777
  <table class="form-table">
778
  <tbody>
779
  <tr>
@@ -786,7 +823,9 @@ if ( !class_exists( 'toc' ) ) :
786
  </tr>
787
  <tr>
788
  <th><label for="sitemap_heading_type"><?php _e('Heading type', 'toc+'); ?></label></th>
789
- <td><label for="sitemap_heading_type"><?php _e('Use', 'toc+'); ?> h</label><select name="sitemap_heading_type" id="sitemap_heading_type">
 
 
790
  <?php
791
  // h1 to h6
792
  for ($i = 1; $i <= 6; $i++) {
@@ -795,7 +834,9 @@ if ( !class_exists( 'toc' ) ) :
795
  echo '>' . $i . '</option>' . "\n";
796
  }
797
  ?>
798
- </select> <?php _e('to print out the titles', 'toc+'); ?>
 
 
799
  </td>
800
  </tr>
801
  <tr>
@@ -815,11 +856,11 @@ if ( !class_exists( 'toc' ) ) :
815
 
816
  <h3><?php _e('Advanced usage', 'toc+'); ?> <span class="show_hide">(<a href="#sitemap_advanced_usage"><?php _e('show', 'toc+'); ?></a>)</span></h3>
817
  <div id="sitemap_advanced_usage">
818
- <p><code>[sitemap_pages]</code> <?php _e('lets you print out a listing of only pages. Similarly', 'toc+'); ?>, <code>[sitemap_categories]</code> <?php _e('can be used to print out a category listing. They both can accept a number of attributes so visit the help tab for more information.', 'toc+'); ?></p>
819
  <p><?php _e('Examples', 'toc+'); ?></p>
820
  <ol>
821
  <li><code>[sitemap_categories no_label="true"]</code> <?php _e('hides the heading from a category listing', 'toc+'); ?></li>
822
- <li><code>[sitemap_pages heading="6" label="This is an awesome listing" exclude="1,15"]</code> <?php _e('Uses h6 to display', 'toc+'); ?> <em>This is an awesome listing</em> <?php _e('on a page listing excluding pages with IDs 1 and 15.', 'toc+'); ?></li>
823
  </ol>
824
  </div>
825
 
@@ -832,30 +873,31 @@ if ( !class_exists( 'toc' ) ) :
832
  <ol>
833
  <li><?php _e("In most cases, the post, page or custom post type has less than the minimum number of headings. By default, this is set to four so make sure you have at least four headings within your content. If you want to change this value, you can find it under 'Main Options' &gt; 'Show when'.", 'toc+'); ?></li>
834
  <li><?php _e('Is auto insertion enabled for your content type? By default, only pages are enabled.', 'toc+'); ?></li>
835
- <li><?php _e('Have you got', 'toc+'); ?> <code>[no_toc]</code> <?php _e('somewhere within the content? This will disable the index for the current post, page or custom post type.', 'toc+'); ?></li>
836
- <li><?php _e('If you are using the TOC+ widget, check if you have the', 'toc+'); ?> <em>"<?php _e('Show the table of contents only in the sidebar', 'toc+'); ?>"</em> <?php _e('enabled as this will limit its display to only the sidebar. You can check by going into Appearance &gt; Widgets.', 'toc+'); ?></li>
 
837
  </ol>
838
 
839
  <h3><?php _e('How do I stop the table of contents from appearing on a single page?', 'toc+'); ?></h3>
840
- <p><?php _e('Place the following', 'toc+'); ?> <code>[no_toc]</code> <?php _e('anywhere on the page to suppress the table of contents. This is known as a shortcode and works for posts, pages and custom post types that make use of the_content()', 'toc+'); ?></p>
841
 
842
  <h3><?php _e("I've set wrapping to left or right but the headings don't wrap around the table of contents", 'toc+'); ?></h3>
843
- <p><?php _e('This normally occurs when there is a CSS clear directive in or around the heading specified by the theme author. This directive tells the user agent to reset the previous wrapping specifications.', 'toc+'); ?></p>
844
- <p><?php _e("You can adjust your theme's CSS or try moving the table of contents position to the top of the page. If you didn't build your theme, I'd highly suggest you try the", 'toc+'); ?> <a href="http://wordpress.org/extend/plugins/safecss/">Custom CSS plugin</a> <?php _e('if you wish to make CSS changes.', 'toc+'); ?></p>
 
 
 
 
 
 
845
 
846
- <h3><?php _e('Why are some headings not included in the table of contents?', 'toc+'); ?></h3>
847
- <p><?php _e("First, make sure the title text that isn't appearing in the table of contents is actually marked up as a heading (eg heading 1 through to 6). After verifying that it really is a heading, make sure that there are no linebreaks or enters from the start to the end of the heading HTML tags. Eg, it should not be like the following:", 'toc+'); ?></p>
848
- <pre>
849
- &lt;h3&gt;This is
850
- a really
851
- good heading&lt;/h3&gt;
852
- </pre>
853
- <p><?php _e('Rather, it should be something like:', 'toc+'); ?></p>
854
- <pre>
855
- &lt;h3&gt;This is a really good heading&lt;/h3&gt;
856
- </pre>
857
 
858
- <h3><?php _e('The sitemap uses a strange font disimilar to the rest of the site', 'toc+'); ?></h3>
859
  <p><?php _e("No extra styles are created for the sitemap, instead it inherits any styles you used when adding the shortcode. If you copy and pasted, you probably also copied the 'code' tags surrounding it so remove them if this is the case.", 'toc+'); ?></p>
860
  <p><?php _e('In most cases, try to have the shortcode on its own line with nothing before or after the square brackets.', 'toc+'); ?></p>
861
 
@@ -901,19 +943,20 @@ good heading&lt;/h3&gt;
901
  <li><strong>label</strong>: <?php _e('text, title of the list', 'toc+'); ?></li>
902
  <li><strong>no_label</strong>: <?php _e('true/false, shows or hides the list heading', 'toc+'); ?></li>
903
  <li><strong>exclude</strong>: <?php _e('IDs of the pages or categories you wish to exclude', 'toc+'); ?></li>
 
904
  </ul>
905
  </td>
906
  </tr>
907
  <tr>
908
  <td>[sitemap_categories]</td>
909
- <td><?php _e('Similar to', 'toc+'); ?> [sitemap_pages] <?php _e('but for categories.', 'toc+'); ?></td>
910
  <td>&nbsp;</td>
911
  </tr>
912
  </tbody>
913
  </table>
914
 
915
  <h3><?php _e('I have another question...', 'toc+'); ?></h3>
916
- <p><?php _e('Visit the', 'toc+'); ?> <a href="http://dublue.com/plugins/toc/"><?php _e('plugin homepage', 'toc+'); ?></a> <?php _e("to ask your question - who knows, maybe your question has already been answered. I'd really like to hear your suggestions if you have any.", 'toc+'); ?></p>
917
 
918
  </div>
919
  </div>
@@ -937,7 +980,7 @@ good heading&lt;/h3&gt;
937
  {
938
  if (
939
  $this->options['theme'] == TOC_THEME_CUSTOM ||
940
- $this->options['width'] != '275px' ||
941
  ( '95%' != $this->options['font_size'] . $this->options['font_size_units'] )
942
  ) :
943
  ?>
@@ -949,15 +992,13 @@ div#toc_container {
949
  <?php
950
  endif;
951
 
952
- if ( $this->options['width'] != '275px' ) {
953
  echo ' width: ';
954
  if ( $this->options['width'] != 'User defined' )
955
  echo $this->options['width'];
956
  else
957
  echo $this->options['width_custom'] . $this->options['width_custom_units'];
958
  echo ";\n";
959
- if ( $this->options['width'] == 'Auto' )
960
- echo ' display: table;' . "\n";
961
  }
962
 
963
  if ( '95%' != $this->options['font_size'] . $this->options['font_size_units'] ) {
@@ -1015,13 +1056,13 @@ div#toc_container ul.toc_list a:visited {
1015
  {
1016
  $js_vars = array();
1017
 
1018
- if ( $this->options['smooth_scroll'] ) wp_enqueue_script( 'smooth-scroll' );
1019
  wp_enqueue_script( 'toc-front' );
1020
  if ( $this->options['show_heading_text'] && $this->options['visibility'] ) {
1021
  $width = ( $this->options['width'] != 'User defined' ) ? $this->options['width'] : $this->options['width_custom'] . $this->options['width_custom_units'];
1022
- wp_enqueue_script( 'cookie' );
1023
  $js_vars['visibility_show'] = esc_js($this->options['visibility_show']);
1024
  $js_vars['visibility_hide'] = esc_js($this->options['visibility_hide']);
 
1025
  $js_vars['width'] = esc_js($width);
1026
  }
1027
  if ( $this->options['smooth_scroll_offset'] != TOC_SMOOTH_SCROLL_OFFSET )
@@ -1047,6 +1088,9 @@ div#toc_container ul.toc_list a:visited {
1047
  if ( $title ) {
1048
  $return = trim( strip_tags($title) );
1049
 
 
 
 
1050
  // remove &amp;
1051
  $return = str_replace( '&amp;', '', $return );
1052
 
@@ -1118,12 +1162,13 @@ div#toc_container ul.toc_list a:visited {
1118
  $html .= '<a href="#' . $this->url_anchor_target( $matches[$i][0] ) . '">';
1119
  if ( $this->options['ordered_list'] ) {
1120
  // attach leading numbers when lower in hierarchy
 
1121
  for ($j = $numbered_items_min; $j < $current_depth; $j++) {
1122
  $number = ($numbered_items[$j]) ? $numbered_items[$j] : 0;
1123
  $html .= $number . '.';
1124
  }
1125
 
1126
- $html .= ($numbered_items[$current_depth] + 1) . ' ';
1127
  $numbered_items[$current_depth]++;
1128
  }
1129
  $html .= strip_tags($matches[$i][0]) . '</a>';
@@ -1217,7 +1262,7 @@ div#toc_container ul.toc_list a:visited {
1217
  if ( is_array($find) && is_array($replace) && $content ) {
1218
  // get all headings
1219
  // the html spec allows for a maximum of 6 heading depths
1220
- if ( preg_match_all('/(<h([1-6]{1})[^>]*>).*<\/h\2>/', $content, $matches, PREG_SET_ORDER) >= $this->options['start'] ) {
1221
 
1222
  // remove undesired headings (if any) as defined by heading_levels
1223
  if ( count($this->options['heading_levels']) != 6 ) {
@@ -1286,8 +1331,16 @@ div#toc_container ul.toc_list a:visited {
1286
  if (
1287
  ( in_array(get_post_type($post), $this->options['auto_insert_post_types']) && $this->show_toc && !is_search() && !is_archive() && !is_front_page() ) ||
1288
  ( $this->options['include_homepage'] && is_front_page() )
1289
- )
1290
- return true;
 
 
 
 
 
 
 
 
1291
  else
1292
  return false;
1293
  }
@@ -1365,7 +1418,11 @@ div#toc_container ul.toc_list a:visited {
1365
 
1366
  // add container, toc title and list items
1367
  $html = '<div id="toc_container" class="' . $css_classes . '">';
1368
- if ( $this->options['show_heading_text'] ) $html .= '<p class="toc_title">' . htmlentities( $this->options['heading_text'], ENT_COMPAT, 'UTF-8' ) . '</p>';
 
 
 
 
1369
  $html .= '<ul class="toc_list">' . $items . '</ul></div>' . "\n";
1370
 
1371
  if ( $custom_toc_position !== false ) {
@@ -1440,6 +1497,7 @@ if ( !class_exists( 'toc_widget' ) ) :
1440
 
1441
  $items = $tic->extract_headings( $find, $replace, $post->post_content );
1442
  $title = apply_filters('widget_title', $instance['title'] );
 
1443
  $hide_inline = $toc_options['show_toc_in_widget_only'];
1444
 
1445
  if ( $items ) {
5
  Description: A powerful yet user friendly plugin that automatically creates a table of contents. Can also output a sitemap listing all pages and categories.
6
  Author: Michael Tran
7
  Author URI: http://dublue.com/
8
+ Version: 1211
9
  License: GPL2
10
  */
11
 
94
  'visibility' => true,
95
  'visibility_show' => 'show',
96
  'visibility_hide' => 'hide',
97
+ 'visibility_hide_by_default' => false,
98
+ 'width' => 'Auto',
99
  'width_custom' => '275',
100
  'width_custom_units' => 'px',
101
  'wrapping' => TOC_WRAPPING_NONE,
112
  'include_homepage' => false,
113
  'exclude_css' => false,
114
  'heading_levels' => array('1', '2', '3', '4', '5', '6'),
115
+ 'restrict_path' => '',
116
  'sitemap_show_page_listing' => true,
117
  'sitemap_show_category_listing' => true,
118
  'sitemap_heading_type' => 3,
271
  'heading' => $this->options['sitemap_heading_type'],
272
  'label' => htmlentities( $this->options['sitemap_pages'], ENT_COMPAT, 'UTF-8' ),
273
  'no_label' => false,
274
+ 'exclude' => '',
275
+ 'exclude_tree' => '',
276
  ), $atts )
277
  );
278
+
279
  if ( $heading < 1 || $heading > 6 ) // h1 to h6 are valid
280
  $heading = $this->options['sitemap_heading_type'];
281
+
282
  $html = '<div class="toc_sitemap">';
283
  if ( !$no_label ) $html .= '<h' . $heading . ' class="toc_sitemap_pages">' . $label . '</h' . $heading . '>';
284
  $html .=
285
  '<ul class="toc_sitemap_pages_list">' .
286
+ wp_list_pages( array('title_li' => '', 'echo' => false, 'exclude' => $exclude, 'exclude_tree' => $exclude_tree ) ) .
287
  '</ul>' .
288
  '</div>'
289
  ;
296
  {
297
  extract( shortcode_atts( array(
298
  'heading' => $this->options['sitemap_heading_type'],
299
+ 'label' => htmlentities( $this->options['sitemap_categories'], ENT_COMPAT, 'UTF-8' ),
300
  'no_label' => false,
301
+ 'exclude' => '',
302
+ 'exclude_tree' => '',
303
  ), $atts )
304
  );
305
 
310
  if ( !$no_label ) $html .= '<h' . $heading . ' class="toc_sitemap_categories">' . $label . '</h' . $heading . '>';
311
  $html .=
312
  '<ul class="toc_sitemap_categories_list">' .
313
+ wp_list_categories( array('title_li' => '', 'echo' => false, 'exclude' => $exclude, 'exclude_tree' => $exclude_tree ) ) .
314
  '</ul>' .
315
  '</div>'
316
  ;
323
  {
324
  load_plugin_textdomain( 'toc+', false, dirname(plugin_basename(__FILE__)) . '/languages/' );
325
  wp_register_style( 'toc-screen', $this->path . '/screen.css' );
 
 
326
  wp_register_script( 'toc-front', $this->path . '/front.js', array('jquery') );
327
  }
328
 
421
  $custom_title_colour = $this->hex_value( trim($_POST['custom_title_colour']), TOC_DEFAULT_TITLE_COLOUR );
422
  $custom_links_colour = $this->hex_value( trim($_POST['custom_links_colour']), TOC_DEFAULT_LINKS_COLOUR );
423
  $custom_links_hover_colour = $this->hex_value( trim($_POST['custom_links_hover_colour']), TOC_DEFAULT_LINKS_HOVER_COLOUR );
424
+ $custom_links_visited_colour = $this->hex_value( trim($_POST['custom_links_visited_colour']), TOC_DEFAULT_LINKS_VISITED_COLOUR );
425
+
426
+ if ( $restrict_path = trim($_POST['restrict_path']) ) {
427
+ if ( strpos($restrict_path, '/') !== 0 ) {
428
+ // restrict path did not start with a / so unset it
429
+ $restrict_path = '';
430
+ }
431
+ }
432
+
433
  $this->options = array(
434
  'fragment_prefix' => trim($_POST['fragment_prefix']),
435
  'position' => intval($_POST['position']),
444
  'visibility' => (isset($_POST['visibility']) && $_POST['visibility']) ? true : false,
445
  'visibility_show' => stripslashes( trim($_POST['visibility_show']) ),
446
  'visibility_hide' => stripslashes( trim($_POST['visibility_hide']) ),
447
+ 'visibility_hide_by_default' => (isset($_POST['visibility_hide_by_default']) && $_POST['visibility_hide_by_default']) ? true : false,
448
  'width' => trim($_POST['width']),
449
  'width_custom' => floatval($_POST['width_custom']),
450
  'width_custom_units' => trim($_POST['width_custom_units']),
457
  'custom_title_colour' => $custom_title_colour,
458
  'custom_links_colour' => $custom_links_colour,
459
  'custom_links_hover_colour' => $custom_links_hover_colour,
460
+ 'custom_links_visited_colour' => $custom_links_visited_colour,
461
  'bullet_spacing' => (isset($_POST['bullet_spacing']) && $_POST['bullet_spacing']) ? true : false,
462
  'include_homepage' => (isset($_POST['include_homepage']) && $_POST['include_homepage']) ? true : false,
463
  'exclude_css' => (isset($_POST['exclude_css']) && $_POST['exclude_css']) ? true : false,
464
  'heading_levels' => @(array)$_POST['heading_levels'],
465
+ 'restrict_path' => $restrict_path,
466
  'sitemap_show_page_listing' => (isset($_POST['sitemap_show_page_listing']) && $_POST['sitemap_show_page_listing']) ? true : false,
467
  'sitemap_show_category_listing' => (isset($_POST['sitemap_show_category_listing']) && $_POST['sitemap_show_category_listing']) ? true : false,
468
  'sitemap_heading_type' => intval($_POST['sitemap_heading_type']),
527
  echo '>' . $i . '</option>' . "\n";
528
  }
529
  ?>
530
+ </select> <?php
531
+ /* translators: text follows drop down list of numbers */
532
+ _e('or more headings are present', 'toc+'); ?>
533
  </td>
534
  </tr>
535
  <tr>
546
  ?>
547
  </tr>
548
  <tr>
549
+ <th><label for="show_heading_text"><?php
550
+ /* translators: this is the title of the table of contents */
551
+ _e('Heading text', 'toc+'); ?></label></th>
552
  <td>
553
  <input type="checkbox" value="1" id="show_heading_text" name="show_heading_text"<?php if ( $this->options['show_heading_text'] ) echo ' checked="checked"'; ?> /><label for="show_heading_text"> <?php _e('Show title on top of the table of contents', 'toc+'); ?></label><br />
554
  <div class="more_toc_options<?php if ( !$this->options['show_heading_text'] ) echo ' disabled'; ?>">
562
  <tr>
563
  <th><label for="visibility_show"><?php _e('Show text', 'toc+'); ?></label></th>
564
  <td><input type="text" class="" value="<?php echo htmlentities( $this->options['visibility_show'], ENT_COMPAT, 'UTF-8' ); ?>" id="visibility_show" name="visibility_show" />
565
+ <span class="description"><label for="visibility_show"><?php
566
+ /* translators: example text to display when you want to expand the table of contents */
567
+ _e('Eg: show', 'toc+'); ?></label></span></td>
568
  </tr>
569
  <tr>
570
  <th><label for="visibility_hide"><?php _e('Hide text', 'toc+'); ?></label></th>
571
  <td><input type="text" class="" value="<?php echo htmlentities( $this->options['visibility_hide'], ENT_COMPAT, 'UTF-8' ); ?>" id="visibility_hide" name="visibility_hide" />
572
+ <span class="description"><label for="visibility_hide"><?php
573
+ /* translators: example text to display when you want to collapse the table of contents */
574
+ _e('Eg: hide', 'toc+'); ?></label></span></td>
575
  </tr>
576
  </tbody>
577
  </table>
578
+ <input type="checkbox" value="1" id="visibility_hide_by_default" name="visibility_hide_by_default"<?php if ( $this->options['visibility_hide_by_default'] ) echo ' checked="checked"'; ?> /><label for="visibility_hide_by_default"> <?php _e( 'Hide the table of contents initially', 'toc+'); ?></label>
579
  </div>
580
  </div>
581
  </td>
606
  <option value="200px"<?php if ( '200px' == $this->options['width'] ) echo ' selected="selected"'; ?>>200px</option>
607
  <option value="225px"<?php if ( '225px' == $this->options['width'] ) echo ' selected="selected"'; ?>>225px</option>
608
  <option value="250px"<?php if ( '250px' == $this->options['width'] ) echo ' selected="selected"'; ?>>250px</option>
609
+ <option value="275px"<?php if ( '275px' == $this->options['width'] ) echo ' selected="selected"'; ?>>275px</option>
610
  <option value="300px"<?php if ( '300px' == $this->options['width'] ) echo ' selected="selected"'; ?>>300px</option>
611
  <option value="325px"<?php if ( '325px' == $this->options['width'] ) echo ' selected="selected"'; ?>>325px</option>
612
  <option value="350px"<?php if ( '350px' == $this->options['width'] ) echo ' selected="selected"'; ?>>350px</option>
614
  <option value="400px"<?php if ( '400px' == $this->options['width'] ) echo ' selected="selected"'; ?>>400px</option>
615
  </optgroup>
616
  <optgroup label="<?php _e('Relative', 'toc+'); ?>">
617
+ <option value="Auto"<?php if ( 'Auto' == $this->options['width'] ) echo ' selected="selected"'; ?>><?php _e('Auto (default)', 'toc+'); ?></option>
618
  <option value="25%"<?php if ( '25%' == $this->options['width'] ) echo ' selected="selected"'; ?>>25%</option>
619
  <option value="33%"<?php if ( '33%' == $this->options['width'] ) echo ' selected="selected"'; ?>>33%</option>
620
  <option value="50%"<?php if ( '50%' == $this->options['width'] ) echo ' selected="selected"'; ?>>50%</option>
622
  <option value="75%"<?php if ( '75%' == $this->options['width'] ) echo ' selected="selected"'; ?>>75%</option>
623
  <option value="100%"<?php if ( '100%' == $this->options['width'] ) echo ' selected="selected"'; ?>>100%</option>
624
  </optgroup>
625
+ <optgroup label="<?php
626
+ /* translators: other width */
627
+ _e('Other', 'toc+'); ?>">
628
  <option value="User defined"<?php if ( 'User defined' == $this->options['width'] ) echo ' selected="selected"'; ?>><?php _e('User defined', 'toc+'); ?></option>
629
  </optgroup>
630
  </select>
631
  <div class="more_toc_options<?php if ( 'User defined' != $this->options['width'] ) echo ' disabled'; ?>">
632
+ <label for="width_custom"><?php
633
+ /* translators: ignore %s as it's some HTML label tags */
634
+ printf( __('Please enter a number and %s select its units, eg: 100px, 10em', 'toc+'), '</label><label for="width_custom_units">' ); ?></label><br />
635
  <input type="text" class="regular-text" value="<?php echo floatval($this->options['width_custom']); ?>" id="width_custom" name="width_custom" />
636
  <select name="width_custom_units" id="width_custom_units">
637
  <option value="px"<?php if ( 'px' == $this->options['width_custom_units'] ) echo ' selected="selected"'; ?>>px</option>
663
  </td>
664
  </tr>
665
  <tr>
666
+ <th><?php
667
+ /* translators: appearance / colour / look and feel options */
668
+ _e('Presentation', 'toc+'); ?></th>
669
  <td>
670
  <div class="toc_theme_option">
671
  <input type="radio" name="theme" id="theme_<?php echo TOC_THEME_GREY; ?>" value="<?php echo TOC_THEME_GREY; ?>"<?php if ( $this->options['theme'] == TOC_THEME_GREY ) echo ' checked="checked"'; ?> /><label for="theme_<?php echo TOC_THEME_GREY; ?>"> <?php _e('Grey (default)', 'toc+'); ?><br />
722
  <th><label for="custom_links_hover_colour"><?php _e('Links (hover)', 'toc+'); ?></label></th>
723
  <td><input type="text" class="custom_colour_option" value="<?php echo htmlentities( $this->options['custom_links_hover_colour'] ); ?>" id="custom_links_hover_colour" name="custom_links_hover_colour" /> <img src="<?php echo $this->path; ?>/images/colour-wheel.png" alt="" /></td>
724
  </tr>
 
 
725
  <tr>
726
  <th><label for="custom_links_visited_colour"><?php _e('Links (visited)', 'toc+'); ?></label></th>
727
  <td><input type="text" class="custom_colour_option" value="<?php echo htmlentities( $this->options['custom_links_visited_colour'] ); ?>" id="custom_links_visited_colour" name="custom_links_visited_colour" /> <img src="<?php echo $this->path; ?>/images/colour-wheel.png" alt="" /></td>
728
  </tr>
 
 
729
  </tbody>
730
  </table>
731
  <div id="farbtastic_colour_wheel"></div>
732
  <div class="clear"></div>
733
+ <p><?php printf(__("Leaving the value as %s will inherit your theme's styles", 'toc+'), '<code>#</code>'); ?></p>
734
  </div>
735
  </td>
736
  </tr>
 
 
 
 
737
  </tbody>
738
  </table>
739
 
750
  <th><label for="exclude_css"><?php _e('Exclude CSS file', 'toc+'); ?></label></th>
751
  <td><input type="checkbox" value="1" id="exclude_css" name="exclude_css"<?php if ( $this->options['exclude_css'] ) echo ' checked="checked"'; ?> /><label for="exclude_css"> <?php _e("Prevent the loading of this plugin's CSS styles. When selected, the presentation options from above will also be ignored.", 'toc+'); ?></label></td>
752
  </tr>
753
+ <tr>
754
+ <th><label for="bullet_spacing"><?php _e('Preserve theme bullets', 'toc+'); ?></label></th>
755
+ <td><input type="checkbox" value="1" id="bullet_spacing" name="bullet_spacing"<?php if ( $this->options['bullet_spacing'] ) echo ' checked="checked"'; ?> /><label for="bullet_spacing"> <?php _e('If your theme includes background images for unordered list elements, enable this to support them', 'toc+'); ?></label></td>
756
+ </tr>
757
  <tr>
758
  <th><?php _e('Heading levels', 'toc+'); ?></th>
759
  <td>
760
+ <p><?php _e('Include the following heading levels. Deselecting a heading will exclude it.', 'toc+'); ?></p>
761
  <?php
762
  // show heading 1 to 6 options
763
  for ($i = 1; $i <= 6; $i++) {
775
  <label for="smooth_scroll_offset"><?php _e('If you have a consistent menu across the top of your site, you can adjust the top offset to stop the headings from appearing underneath the top menu. A setting of 30 accommodates the WordPress admin bar. This setting appears after you have enabled smooth scrolling from above.', 'toc+'); ?></label>
776
  </td>
777
  </tr>
778
+ <tr>
779
+ <th><label for="restrict_path"><?php _e('Restrict path', 'toc+'); ?></label></th>
780
+ <td>
781
+ <input type="text" class="regular-text" value="<?php echo htmlentities( $this->options['restrict_path'] ); ?>" id="restrict_path" name="restrict_path" /><br />
782
+ <label for="restrict_path"><?php _e('Restrict generation of the table of contents to pages that match the required path. This path is from the root of your site and always begins with a forward slash.', 'toc+'); ?><br />
783
+ <span class="description"><?php
784
+ /* translators: example URL path restriction */
785
+ _e('Eg: /wiki/, /corporate/annual-reports/', 'toc+'); ?></span></label>
786
+ </td>
787
+ </tr>
788
  <tr>
789
  <th><label for="fragment_prefix"><?php _e('Default anchor prefix', 'toc+'); ?></label></th>
790
  <td>
791
  <input type="text" class="regular-text" value="<?php echo htmlentities( $this->options['fragment_prefix'] ); ?>" id="fragment_prefix" name="fragment_prefix" /><br />
792
  <label for="fragment_prefix"><?php _e('Anchor targets are restricted to alphanumeric characters as per HTML specification (see readme for more detail). The default anchor prefix will be used when no characters qualify. When left blank, a number will be used instead.', 'toc+'); ?><br />
793
  <?php _e('This option normally applies to content written in character sets other than ASCII.', 'toc+'); ?><br />
794
+ <span class="description"><?php
795
+ /* translators: example anchor prefixes when no ascii characters match */
796
+ _e('Eg: i, toc_index, index, _', 'toc+'); ?></span></label>
797
  </td>
798
  </tr>
799
  </tbody>
800
  </table>
801
 
802
+ <h4><?php
803
+ /* translators: advanced usage */
804
+ _e('Usage', 'toc+'); ?></h4>
805
+ <p><?php printf(__('If you would like to fully customise the position of the table of contents, you can use the %s shortcode by placing it at the desired position of your post, page or custom post type. This method allows you to generate the table of contents despite having auto insertion disabled for its content type. Please visit the help tab for further information about this shortcode.', 'toc+'), '<code>[toc]</code>'); ?></p>
806
  </div>
807
 
808
 
810
  <div id="tab2" class="tab_content">
811
 
812
 
813
+ <p><?php printf(__('At its simplest, placing %s into a page will automatically create a sitemap of all pages and categories. This also works in a text widget.', 'toc+'), '<code>[sitemap]</code>'); ?></p>
814
  <table class="form-table">
815
  <tbody>
816
  <tr>
823
  </tr>
824
  <tr>
825
  <th><label for="sitemap_heading_type"><?php _e('Heading type', 'toc+'); ?></label></th>
826
+ <td><label for="sitemap_heading_type"><?php
827
+ /* translators: the full line is supposed to read - Use [1-6 drop down list] to print out the titles */
828
+ _e('Use', 'toc+'); ?> h</label><select name="sitemap_heading_type" id="sitemap_heading_type">
829
  <?php
830
  // h1 to h6
831
  for ($i = 1; $i <= 6; $i++) {
834
  echo '>' . $i . '</option>' . "\n";
835
  }
836
  ?>
837
+ </select> <?php
838
+ /* translators: the full line is supposed to read - Use [h1-h6 drop down list] to print out the titles */
839
+ _e('to print out the titles', 'toc+'); ?>
840
  </td>
841
  </tr>
842
  <tr>
856
 
857
  <h3><?php _e('Advanced usage', 'toc+'); ?> <span class="show_hide">(<a href="#sitemap_advanced_usage"><?php _e('show', 'toc+'); ?></a>)</span></h3>
858
  <div id="sitemap_advanced_usage">
859
+ <p><code>[sitemap_pages]</code> <?php printf(__('lets you print out a listing of only pages. Similarly %s can be used to print out a category listing. They both can accept a number of attributes so visit the help tab for more information.', 'toc+'), '<code>[sitemap_categories]</code>'); ?></p>
860
  <p><?php _e('Examples', 'toc+'); ?></p>
861
  <ol>
862
  <li><code>[sitemap_categories no_label="true"]</code> <?php _e('hides the heading from a category listing', 'toc+'); ?></li>
863
+ <li><code>[sitemap_pages heading="6" label="This is an awesome listing" exclude="1,15"]</code> <?php printf(__('Uses h6 to display %s on a page listing excluding pages with IDs 1 and 15', 'toc+'), '<em>This is an awesome listing</em>'); ?></li>
864
  </ol>
865
  </div>
866
 
873
  <ol>
874
  <li><?php _e("In most cases, the post, page or custom post type has less than the minimum number of headings. By default, this is set to four so make sure you have at least four headings within your content. If you want to change this value, you can find it under 'Main Options' &gt; 'Show when'.", 'toc+'); ?></li>
875
  <li><?php _e('Is auto insertion enabled for your content type? By default, only pages are enabled.', 'toc+'); ?></li>
876
+ <li><?php _e('Have you got <code>[no_toc]</code> somewhere within the content? This will disable the index for the current post, page or custom post type.', 'toc+'); ?></li>
877
+ <li><?php _e('If you are using the TOC+ widget, check if you have the <em>"Show the table of contents only in the sidebar"</em> enabled as this will limit its display to only the sidebar. You can check by going into Appearance &gt; Widgets.', 'toc+'); ?></li>
878
+ <li><?php _e('You may have restricted generation to a URL path match. The setting can be found in the advanced section under Main Options.', 'toc+'); ?></li>
879
  </ol>
880
 
881
  <h3><?php _e('How do I stop the table of contents from appearing on a single page?', 'toc+'); ?></h3>
882
+ <p><?php _e('Place the following <code>[no_toc]</code> anywhere on the page to suppress the table of contents. This is known as a shortcode and works for posts, pages and custom post types that make use of the_content()', 'toc+'); ?></p>
883
 
884
  <h3><?php _e("I've set wrapping to left or right but the headings don't wrap around the table of contents", 'toc+'); ?></h3>
885
+ <p><?php _e('This normally occurs when there is a CSS clear directive in or around the heading originating from the theme (Twenty Eleven and Twenty Twelve are two themes which do this). This directive tells the user agent to reset the previous wrapping specifications.', 'toc+'); ?></p>
886
+ <p><?php printf(__("You can adjust your theme's CSS or try moving the table of contents position to the top of the page. If you didn't build your theme, I'd highly suggest you try the %s if you wish to make CSS changes.", 'toc+'), '<a href="http://wordpress.org/extend/plugins/safecss/">Custom CSS plugin</a>'); ?></p>
887
+ <p><?php
888
+ /* translators: CSS code follows after this line */
889
+ _e('Try adding the following CSS to allow the wrapping to occur around the table of contents:', 'toc+'); ?></p>
890
+ <code>
891
+ h1, h2, h3, h4, h5, h6 { clear: none; }
892
+ </code>
893
 
894
+ <h3><?php _e('How do I include the name of the page in the table of contents title?', 'toc+'); ?></h3>
895
+ <p><?php _e("As the title of the page changes depending on the page you're viewing, you can use the following special variable to automatically insert the title of the page into the table of contents heading:", 'toc+'); ?></p>
896
+ <code>%PAGE_NAME%</code>
897
+ <p><?php _e('You can use it as is or place text either side of the variable.', 'toc+'); ?></p>
898
+ <p><?php _e('As an example: if your page is named <em>Great Expectations</em> and your table of contents title is set to <em>Contents for %PAGE_NAME%</em>, the final title would read <em>Contents for Great Expectations</em>', 'toc+'); ?></p>
 
 
 
 
 
 
899
 
900
+ <h3><?php _e('The sitemap uses a strange font dissimilar to the rest of the site', 'toc+'); ?></h3>
901
  <p><?php _e("No extra styles are created for the sitemap, instead it inherits any styles you used when adding the shortcode. If you copy and pasted, you probably also copied the 'code' tags surrounding it so remove them if this is the case.", 'toc+'); ?></p>
902
  <p><?php _e('In most cases, try to have the shortcode on its own line with nothing before or after the square brackets.', 'toc+'); ?></p>
903
 
943
  <li><strong>label</strong>: <?php _e('text, title of the list', 'toc+'); ?></li>
944
  <li><strong>no_label</strong>: <?php _e('true/false, shows or hides the list heading', 'toc+'); ?></li>
945
  <li><strong>exclude</strong>: <?php _e('IDs of the pages or categories you wish to exclude', 'toc+'); ?></li>
946
+ <li><strong>exclude_tree</strong>: <?php _e('ID of the page or category you wish to exclude including its all descendants', 'toc+'); ?></li>
947
  </ul>
948
  </td>
949
  </tr>
950
  <tr>
951
  <td>[sitemap_categories]</td>
952
+ <td><?php _e('Similar to [sitemap_pages] but for categories.', 'toc+'); ?></td>
953
  <td>&nbsp;</td>
954
  </tr>
955
  </tbody>
956
  </table>
957
 
958
  <h3><?php _e('I have another question...', 'toc+'); ?></h3>
959
+ <p><?php printf(__('Visit the %1$splugin homepage%2$s to ask your question - who knows, maybe your question has already been answered. I\'d really like to hear your suggestions if you have any.', 'toc+'), '<a href="http://dublue.com/plugins/toc/">', '</a>'); ?></p>
960
 
961
  </div>
962
  </div>
980
  {
981
  if (
982
  $this->options['theme'] == TOC_THEME_CUSTOM ||
983
+ $this->options['width'] != 'Auto' ||
984
  ( '95%' != $this->options['font_size'] . $this->options['font_size_units'] )
985
  ) :
986
  ?>
992
  <?php
993
  endif;
994
 
995
+ if ( $this->options['width'] != 'Auto' ) {
996
  echo ' width: ';
997
  if ( $this->options['width'] != 'User defined' )
998
  echo $this->options['width'];
999
  else
1000
  echo $this->options['width_custom'] . $this->options['width_custom_units'];
1001
  echo ";\n";
 
 
1002
  }
1003
 
1004
  if ( '95%' != $this->options['font_size'] . $this->options['font_size_units'] ) {
1056
  {
1057
  $js_vars = array();
1058
 
1059
+ if ( $this->options['smooth_scroll'] ) $js_vars['smooth_scroll'] = true;
1060
  wp_enqueue_script( 'toc-front' );
1061
  if ( $this->options['show_heading_text'] && $this->options['visibility'] ) {
1062
  $width = ( $this->options['width'] != 'User defined' ) ? $this->options['width'] : $this->options['width_custom'] . $this->options['width_custom_units'];
 
1063
  $js_vars['visibility_show'] = esc_js($this->options['visibility_show']);
1064
  $js_vars['visibility_hide'] = esc_js($this->options['visibility_hide']);
1065
+ if ( $this->options['visibility_hide_by_default'] ) $js_vars['visibility_hide_by_default'] = true;
1066
  $js_vars['width'] = esc_js($width);
1067
  }
1068
  if ( $this->options['smooth_scroll_offset'] != TOC_SMOOTH_SCROLL_OFFSET )
1088
  if ( $title ) {
1089
  $return = trim( strip_tags($title) );
1090
 
1091
+ // replace newlines with spaces (eg when headings are split over multiple lines)
1092
+ $return = str_replace( array("\r", "\n", "\n\r", "\r\n"), ' ', $return );
1093
+
1094
  // remove &amp;
1095
  $return = str_replace( '&amp;', '', $return );
1096
 
1162
  $html .= '<a href="#' . $this->url_anchor_target( $matches[$i][0] ) . '">';
1163
  if ( $this->options['ordered_list'] ) {
1164
  // attach leading numbers when lower in hierarchy
1165
+ $html .= '<span class="toc_number toc_depth_' . ($current_depth - $numbered_items_min + 1) . '">';
1166
  for ($j = $numbered_items_min; $j < $current_depth; $j++) {
1167
  $number = ($numbered_items[$j]) ? $numbered_items[$j] : 0;
1168
  $html .= $number . '.';
1169
  }
1170
 
1171
+ $html .= ($numbered_items[$current_depth] + 1) . '</span> ';
1172
  $numbered_items[$current_depth]++;
1173
  }
1174
  $html .= strip_tags($matches[$i][0]) . '</a>';
1262
  if ( is_array($find) && is_array($replace) && $content ) {
1263
  // get all headings
1264
  // the html spec allows for a maximum of 6 heading depths
1265
+ if ( preg_match_all('/(<h([1-6]{1})[^>]*>).*<\/h\2>/msuU', $content, $matches, PREG_SET_ORDER) >= $this->options['start'] ) {
1266
 
1267
  // remove undesired headings (if any) as defined by heading_levels
1268
  if ( count($this->options['heading_levels']) != 6 ) {
1331
  if (
1332
  ( in_array(get_post_type($post), $this->options['auto_insert_post_types']) && $this->show_toc && !is_search() && !is_archive() && !is_front_page() ) ||
1333
  ( $this->options['include_homepage'] && is_front_page() )
1334
+ ) {
1335
+ if ( $this->options['restrict_path'] ) {
1336
+ if ( strpos($_SERVER['REQUEST_URI'], $this->options['restrict_path']) === 0 )
1337
+ return true;
1338
+ else
1339
+ return false;
1340
+ }
1341
+ else
1342
+ return true;
1343
+ }
1344
  else
1345
  return false;
1346
  }
1418
 
1419
  // add container, toc title and list items
1420
  $html = '<div id="toc_container" class="' . $css_classes . '">';
1421
+ if ( $this->options['show_heading_text'] ) {
1422
+ $toc_title = $this->options['heading_text'];
1423
+ if ( strpos($toc_title, '%PAGE_TITLE%') !== false ) $toc_title = str_replace( '%PAGE_TITLE%', get_the_title(), $toc_title );
1424
+ $html .= '<p class="toc_title">' . htmlentities( $toc_title, ENT_COMPAT, 'UTF-8' ) . '</p>';
1425
+ }
1426
  $html .= '<ul class="toc_list">' . $items . '</ul></div>' . "\n";
1427
 
1428
  if ( $custom_toc_position !== false ) {
1497
 
1498
  $items = $tic->extract_headings( $find, $replace, $post->post_content );
1499
  $title = apply_filters('widget_title', $instance['title'] );
1500
+ if ( strpos($title, '%PAGE_TITLE%') !== false ) $title = str_replace( '%PAGE_TITLE%', get_the_title(), $title );
1501
  $hide_inline = $toc_options['show_toc_in_widget_only'];
1502
 
1503
  if ( $items ) {