diff --git a/config/config.ini.example b/config/config.ini.example index 04b2127..71f409e 100644 --- a/config/config.ini.example +++ b/config/config.ini.example @@ -141,6 +141,9 @@ toc.label = "Table of Contents" ; TOC inital state toc.state = "close" +; TOC style +toc.style = "default" + ; Set the theme here views.root = "themes/twentysixteen" diff --git a/content/data/configList.json b/content/data/configList.json index d06cd6e..9628568 100644 --- a/content/data/configList.json +++ b/content/data/configList.json @@ -1 +1 @@ -["site.url","timezone","date.format","language","blog.title","blog.tagline","blog.description","blog.copyright","permalink.type","static.frontpage","blog.enable","social.twitter","social.facebook","breadcrumb.home","comment.system","fb.appid","fb.num","fb.color","disqus.shortname","google.wmt.id","google.analytics.id","google.gtag.id","google.reCaptcha","google.reCaptcha.public","google.reCaptcha.private","posts.perpage","category.perpage","tag.perpage","archive.perpage","search.perpage","profile.perpage","type.perpage","json.count","category.info","related.count","recent.count","popular.count","tagcloud.count","teaser.type","read.more","teaser.char","description.char","rss.count","rss.char","views.counter","sitemap.priority.base","sitemap.priority.post","sitemap.priority.static","sitemap.priority.category","sitemap.priority.tag","sitemap.priority.archiveDay","sitemap.priority.archiveMonth","sitemap.priority.archiveYear","sitemap.priority.author","sitemap.priority.type","prerelease","cache.expiration","cache.off","generation.time","cache.timestamp","multi.site","toc.label","toc.state","views.root","views.layout"] \ No newline at end of file +["site.url","timezone","date.format","language","blog.title","blog.tagline","blog.description","blog.copyright","permalink.type","static.frontpage","blog.enable","social.twitter","social.facebook","breadcrumb.home","comment.system","fb.appid","fb.num","fb.color","disqus.shortname","google.wmt.id","google.analytics.id","google.gtag.id","google.reCaptcha","google.reCaptcha.public","google.reCaptcha.private","posts.perpage","category.perpage","tag.perpage","archive.perpage","search.perpage","profile.perpage","type.perpage","json.count","category.info","related.count","recent.count","popular.count","tagcloud.count","teaser.type","read.more","teaser.char","description.char","rss.count","rss.char","views.counter","sitemap.priority.base","sitemap.priority.post","sitemap.priority.static","sitemap.priority.category","sitemap.priority.tag","sitemap.priority.archiveDay","sitemap.priority.archiveMonth","sitemap.priority.archiveYear","sitemap.priority.author","sitemap.priority.type","prerelease","cache.expiration","cache.off","generation.time","cache.timestamp","multi.site","toc.label","toc.state","toc.style","views.root","views.layout"] \ No newline at end of file diff --git a/system/admin/views/config-widget.html.php b/system/admin/views/config-widget.html.php index ec5c5d6..a1b11eb 100644 --- a/system/admin/views/config-widget.html.php +++ b/system/admin/views/config-widget.html.php @@ -85,6 +85,25 @@ +
+ +
+
+
+ checked> + +
+
+ checked> + +
+
+
+


diff --git a/system/includes/functions.php b/system/includes/functions.php index 2818e1b..83812ff 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -528,6 +528,12 @@ function get_posts($posts, $page = 1, $perpage = 0) if (empty($label)) { $label = 'Table of Contents'; } + $style = config('toc.style'); + if ($style == 'default' || empty($style)) { + $style = ''; + } else { + $style = ''; + } $load = << document.addEventListener("DOMContentLoaded", function() { @@ -541,7 +547,7 @@ function get_posts($posts, $page = 1, $perpage = 0) }); EOF; - $post->body = $toc['0'] . '' . $toc['1']; + $post->body = $toc['0'] . '' . $toc['1']; } // Convert image tags to figures @@ -618,6 +624,12 @@ function get_pages($pages, $page = 1, $perpage = 0) if (empty($label)) { $label = 'Table of Contents'; } + $style = config('toc.style'); + if ($style == 'default' || empty($style)) { + $style = ''; + } else { + $style = ''; + } $load = << document.addEventListener("DOMContentLoaded", function() { @@ -631,7 +643,7 @@ function get_pages($pages, $page = 1, $perpage = 0) }); EOF; - $post->body = $toc['0'] . '' . $toc['1']; + $post->body = $toc['0'] . '' . $toc['1']; } if (config('views.counter') == 'true') { @@ -714,6 +726,12 @@ function get_subpages($sub_pages, $page = 1, $perpage = 0) if (empty($label)) { $label = 'Table of Contents'; } + $style = config('toc.style'); + if ($style == 'default' || empty($style)) { + $style = ''; + } else { + $style = ''; + } $load = << document.addEventListener("DOMContentLoaded", function() { @@ -727,7 +745,7 @@ function get_subpages($sub_pages, $page = 1, $perpage = 0) }); EOF; - $post->body = $toc['0'] . '' . $toc['1']; + $post->body = $toc['0'] . '' . $toc['1']; } if (config('views.counter') == 'true') { @@ -1017,6 +1035,12 @@ function read_category_info($category) if (empty($label)) { $label = 'Table of Contents'; } + $style = config('toc.style'); + if ($style == 'default' || empty($style)) { + $style = ''; + } else { + $style = ''; + } $load = << document.addEventListener("DOMContentLoaded", function() { @@ -1030,7 +1054,7 @@ function read_category_info($category) }); EOF; - $desc->body = $toc['0'] . '' . $toc['1']; + $desc->body = $toc['0'] . '' . $toc['1']; } $desc->description = get_content_tag("d", $content, get_description($desc->body)); @@ -1270,6 +1294,12 @@ function get_author($name) if (empty($label)) { $label = 'Table of Contents'; } + $style = config('toc.style'); + if ($style == 'default' || empty($style)) { + $style = ''; + } else { + $style = ''; + } $load = << document.addEventListener("DOMContentLoaded", function() { @@ -1283,7 +1313,7 @@ function get_author($name) }); EOF; - $author->about = $toc['0'] . '' . $toc['1']; + $author->about = $toc['0'] . '' . $toc['1']; } $author->body = $author->about; @@ -1345,6 +1375,12 @@ function get_frontpage() if (empty($label)) { $label = 'Table of Contents'; } + $style = config('toc.style'); + if ($style == 'default' || empty($style)) { + $style = ''; + } else { + $style = ''; + } $load = << document.addEventListener("DOMContentLoaded", function() { @@ -1358,7 +1394,7 @@ function get_frontpage() }); EOF; - $front->body = $toc['0'] . '' . $toc['1']; + $front->body = $toc['0'] . '' . $toc['1']; } } else { $front->title = 'Welcome'; diff --git a/system/resources/css/toc.css b/system/resources/css/toc.css new file mode 100644 index 0000000..81edcaa --- /dev/null +++ b/system/resources/css/toc.css @@ -0,0 +1,48 @@ +summary { + display: list-item; + cursor: pointer; +} + +.toc-wrapper { + background: #f9f9f9; + border: 1px solid #aaa; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); + box-shadow: 0 1px 1px rgba(0,0,0,.05); + margin-bottom: 1.5em; + padding: 10px; + position: relative; + width: auto; + font-size: 90%; +} + +.toc-wrapper .inner { + margin-top:5px; +} + +.toc-wrapper .inner a { + border: none; + box-shadow:none; +} + +.toc .h3-toc { + margin-left: .20in; +} + +.toc .h4-toc { + margin-left: .35in; +} + +.toc .h5-toc { + margin-left: .50in; +} + +.toc .h6-toc { + margin-left: .65in; +} + +.toc-link a.anchor { + border:none; + margin-left: 5px; + box-shadow:none; +} \ No newline at end of file diff --git a/themes/blog/css/styles.css b/themes/blog/css/styles.css index 399f3c5..5429919 100644 --- a/themes/blog/css/styles.css +++ b/themes/blog/css/styles.css @@ -629,49 +629,3 @@ ul.month { margin:0 0 0 10px; float:right; } - -summary { - display: list-item; - cursor: pointer; -} - -.toc-wrapper { - background: #f9f9f9; - border: 1px solid #aaa; - border-radius: 4px; - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); - box-shadow: 0 1px 1px rgba(0,0,0,.05); - margin-bottom: 1.5em; - padding: 10px; - position: relative; - width: auto; - font-size: 90%; -} - -.toc-wrapper .inner { - margin-top:5px; -} - -.toc-wrapper .inner a { - border: none; - box-shadow:none; -} - -.toc .h3-toc { - margin-left: .20in; -} -.toc .h4-toc { - margin-left: .35in; -} -.toc .h5-toc { - margin-left: .50in; -} -.toc .h6-toc { - margin-left: .65in; -} - -.toc-link a.anchor { - border:none; - margin-left: 5px; - box-shadow:none; -} \ No newline at end of file diff --git a/themes/clean/css/style.css b/themes/clean/css/style.css index 6d24a86..2e8ef50 100644 --- a/themes/clean/css/style.css +++ b/themes/clean/css/style.css @@ -950,49 +950,3 @@ ul.archivegroup { list-style: none; background:none; } - -summary { - display: list-item; - cursor: pointer; -} - -.toc-wrapper { - background: #f9f9f9; - border: 1px solid #aaa; - border-radius: 4px; - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); - box-shadow: 0 1px 1px rgba(0,0,0,.05); - margin-bottom: 1.5em; - padding: 10px; - position: relative; - width: auto; - font-size: 90%; -} - -.toc-wrapper .inner { - margin-top:5px; -} - -.toc-wrapper .inner a { - border: none; - box-shadow:none; -} - -.toc .h3-toc { - margin-left: .20in; -} -.toc .h4-toc { - margin-left: .35in; -} -.toc .h5-toc { - margin-left: .50in; -} -.toc .h6-toc { - margin-left: .65in; -} - -.toc-link a.anchor { - border:none; - margin-left: 5px; - box-shadow:none; -} \ No newline at end of file diff --git a/themes/doks/css/style.css b/themes/doks/css/style.css index a005104..fda6a10 100644 --- a/themes/doks/css/style.css +++ b/themes/doks/css/style.css @@ -3533,49 +3533,3 @@ body.dark .docs-bar .menu-icon .navicon::before, body.dark .docs-bar .menu-icon .float-right { float:right; } - -summary { - display: list-item; - cursor: pointer; -} - -.toc-wrapper { - background: #f9f9f9; - border: 1px solid #aaa; - border-radius: 4px; - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); - box-shadow: 0 1px 1px rgba(0,0,0,.05); - margin-bottom: 1.5em; - padding: 10px; - position: relative; - width: auto; - font-size: 90%; -} - -.toc-wrapper .inner { - margin-top:5px; -} - -.toc-wrapper .inner a { - border: none; - box-shadow:none; -} - -.toc .h3-toc { - margin-left: .20in; -} -.toc .h4-toc { - margin-left: .35in; -} -.toc .h5-toc { - margin-left: .50in; -} -.toc .h6-toc { - margin-left: .65in; -} - -.toc-link a.anchor { - border:none; - margin-left: 5px; - box-shadow:none; -} \ No newline at end of file diff --git a/themes/logs/css/style.css b/themes/logs/css/style.css index 4611365..937c94e 100644 --- a/themes/logs/css/style.css +++ b/themes/logs/css/style.css @@ -980,49 +980,3 @@ ul.archivegroup { .archivegroup li.expanded, .archivegroup li.collapsed { list-style: none; } - -summary { - display: list-item; - cursor: pointer; -} - -.toc-wrapper { - background: #f9f9f9; - border: 1px solid #aaa; - border-radius: 4px; - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); - box-shadow: 0 1px 1px rgba(0,0,0,.05); - margin-bottom: 1.5em; - padding: 10px; - position: relative; - width: auto; - font-size: 90%; -} - -.toc-wrapper .inner { - margin-top:5px; -} - -.toc-wrapper .inner a { - border: none; - box-shadow:none; -} - -.toc .h3-toc { - margin-left: .20in; -} -.toc .h4-toc { - margin-left: .35in; -} -.toc .h5-toc { - margin-left: .50in; -} -.toc .h6-toc { - margin-left: .65in; -} - -.toc-link a.anchor { - border:none; - margin-left: 5px; - box-shadow:none; -} \ No newline at end of file diff --git a/themes/readable/css/style.css b/themes/readable/css/style.css index cf4aca9..9474775 100644 --- a/themes/readable/css/style.css +++ b/themes/readable/css/style.css @@ -1031,49 +1031,3 @@ ul.archivegroup { .archivegroup li.expanded, .archivegroup li.collapsed { list-style: none; } - -summary { - display: list-item; - cursor: pointer; -} - -.toc-wrapper { - background: #f9f9f9; - border: 1px solid #aaa; - border-radius: 4px; - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); - box-shadow: 0 1px 1px rgba(0,0,0,.05); - margin-bottom: 1.5em; - padding: 10px; - position: relative; - width: auto; - font-size: 90%; -} - -.toc-wrapper .inner { - margin-top:5px; -} - -.toc-wrapper .inner a { - border: none; - box-shadow:none; -} - -.toc .h3-toc { - margin-left: .20in; -} -.toc .h4-toc { - margin-left: .35in; -} -.toc .h5-toc { - margin-left: .50in; -} -.toc .h6-toc { - margin-left: .65in; -} - -.toc-link a.anchor { - border:none; - margin-left: 5px; - box-shadow:none; -} \ No newline at end of file diff --git a/themes/twentyfifteen/css/style.css b/themes/twentyfifteen/css/style.css index 1b1c9a0..6d9cfb8 100644 --- a/themes/twentyfifteen/css/style.css +++ b/themes/twentyfifteen/css/style.css @@ -6140,49 +6140,3 @@ ul.month { .feed-link a { height:100%; } - -summary { - display: list-item; - cursor: pointer; -} - -.toc-wrapper { - background: #f9f9f9; - border: 1px solid #aaa; - border-radius: 4px; - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); - box-shadow: 0 1px 1px rgba(0,0,0,.05); - margin-bottom: 1.5em; - padding: 10px; - position: relative; - width: auto; - font-size: 90%; -} - -.toc-wrapper .inner { - margin-top:5px; -} - -.toc-wrapper .inner a { - border: none; - box-shadow:none; -} - -.toc .h3-toc { - margin-left: .20in; -} -.toc .h4-toc { - margin-left: .35in; -} -.toc .h5-toc { - margin-left: .50in; -} -.toc .h6-toc { - margin-left: .65in; -} - -.toc-link a.anchor { - border:none; - margin-left: 5px; - box-shadow:none; -} \ No newline at end of file diff --git a/themes/twentyfifteen/css/style_v2.css b/themes/twentyfifteen/css/style_v2.css index dd9e2f1..845d427 100644 --- a/themes/twentyfifteen/css/style_v2.css +++ b/themes/twentyfifteen/css/style_v2.css @@ -6147,49 +6147,3 @@ ul.month { .feed-link a { height:100%; } - -summary { - display: list-item; - cursor: pointer; -} - -.toc-wrapper { - background: #f9f9f9; - border: 1px solid #aaa; - border-radius: 4px; - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); - box-shadow: 0 1px 1px rgba(0,0,0,.05); - margin-bottom: 1.5em; - padding: 10px; - position: relative; - width: auto; - font-size: 90%; -} - -.toc-wrapper .inner { - margin-top:5px; -} - -.toc-wrapper .inner a { - border: none; - box-shadow:none; -} - -.toc .h3-toc { - margin-left: .20in; -} -.toc .h4-toc { - margin-left: .35in; -} -.toc .h5-toc { - margin-left: .50in; -} -.toc .h6-toc { - margin-left: .65in; -} - -.toc-link a.anchor { - border:none; - margin-left: 5px; - box-shadow:none; -} \ No newline at end of file diff --git a/themes/twentysixteen/css/style.css b/themes/twentysixteen/css/style.css index 0bcf421..ef2c6bd 100644 --- a/themes/twentysixteen/css/style.css +++ b/themes/twentysixteen/css/style.css @@ -4066,49 +4066,3 @@ ul.month { margin:0 0 0 10px; float:right; } - -summary { - display: list-item; - cursor: pointer; -} - -.toc-wrapper { - background: #f9f9f9; - border: 1px solid #aaa; - border-radius: 4px; - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); - box-shadow: 0 1px 1px rgba(0,0,0,.05); - margin-bottom: 1.5em; - padding: 10px; - position: relative; - width: auto; - font-size: 90%; -} - -.toc-wrapper .inner { - margin-top:5px; -} - -.toc-wrapper .inner a { - border: none; - box-shadow:none; -} - -.toc .h3-toc { - margin-left: .20in; -} -.toc .h4-toc { - margin-left: .35in; -} -.toc .h5-toc { - margin-left: .50in; -} -.toc .h6-toc { - margin-left: .65in; -} - -.toc-link a.anchor { - border:none; - margin-left: 5px; - box-shadow:none; -} \ No newline at end of file