summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2016-08-15 11:27:32 +0800
committerWu Cheng-Han2016-08-15 11:27:32 +0800
commitb4ad011dc1cec22b088578ca019f76c0c9ba4612 (patch)
treecc879b775b9538bbfe2a3cbdaa4c23cb1d20ebb8
parenta013c9d3bc0eb98c935e80bdb694c1a1cf7bd4c4 (diff)
Fix toc id naming to avoid overlap with user toc
Diffstat (limited to '')
-rw-r--r--public/js/extra.js8
-rw-r--r--public/js/index.js6
-rw-r--r--public/js/pretty.js6
-rw-r--r--public/views/body.ejs4
-rw-r--r--public/views/html.hbs8
-rw-r--r--public/views/pretty.ejs4
6 files changed, 18 insertions, 18 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index 824b78d1..714e2057 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -495,9 +495,9 @@ function exportToHTML(view) {
var filename = renderFilename(ui.area.markdown) + '.html';
var src = generateCleanHTML(view);
//generate toc
- var toc = $('#toc').clone();
+ var toc = $('#ui-toc').clone();
toc.find('*').removeClass('active');
- var tocAffix = $('#toc-affix').clone();
+ var tocAffix = $('#ui-toc-affix').clone();
tocAffix.find('*').removeClass('active');
//generate html via template
$.get(serverurl + '/css/html.min.css', function (css) {
@@ -508,8 +508,8 @@ function exportToHTML(view) {
title: title,
css: css,
html: src[0].outerHTML,
- toc: toc.html(),
- 'toc-affix': tocAffix.html(),
+ 'ui-toc': toc.html(),
+ 'ui-toc-affix': tocAffix.html(),
lang: (md && md.meta && md.meta.lang) ? 'lang="' + md.meta.lang + '"' : null,
dir: (md && md.meta && md.meta.dir) ? 'dir="' + md.meta.dir + '"' : null
};
diff --git a/public/js/index.js b/public/js/index.js
index a3581cfd..43b7525c 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -3157,7 +3157,7 @@ function updateViewInner() {
}
// only render again when meta changed
if (JSON.stringify(md.meta) != JSON.stringify(lastMeta)) {
- parseMeta(md, ui.area.codemirror, ui.area.markdown, $('#toc'), $('#toc-affix'));
+ parseMeta(md, ui.area.codemirror, ui.area.markdown, $('#ui-toc'), $('#ui-toc-affix'));
rendered = md.render(value);
}
// prevent XSS
@@ -3172,8 +3172,8 @@ function updateViewInner() {
autoLinkify(ui.area.markdown);
deduplicatedHeaderId(ui.area.markdown);
renderTOC(ui.area.markdown);
- generateToc('toc');
- generateToc('toc-affix');
+ generateToc('ui-toc');
+ generateToc('ui-toc-affix');
generateScrollspy();
updateScrollspy();
smoothHashScroll();
diff --git a/public/js/pretty.js b/public/js/pretty.js
index adc8c741..0ca7ee18 100644
--- a/public/js/pretty.js
+++ b/public/js/pretty.js
@@ -21,7 +21,7 @@ if (md.meta.type && md.meta.type === 'slide') {
}
// only render again when meta changed
if (JSON.stringify(md.meta) != JSON.stringify(lastMeta)) {
- parseMeta(md, null, markdown, $('#toc'), $('#toc-affix'));
+ parseMeta(md, null, markdown, $('#ui-toc'), $('#ui-toc-affix'));
rendered = md.render(text);
}
// prevent XSS
@@ -34,8 +34,8 @@ finishView(markdown);
autoLinkify(markdown);
deduplicatedHeaderId(markdown);
renderTOC(markdown);
-generateToc('toc');
-generateToc('toc-affix');
+generateToc('ui-toc');
+generateToc('ui-toc-affix');
smoothHashScroll();
createtime = lastchangeui.time.attr('data-createtime');
lastchangetime = lastchangeui.time.attr('data-updatetime');
diff --git a/public/views/body.ejs b/public/views/body.ejs
index d2010b4a..acf929ad 100644
--- a/public/views/body.ejs
+++ b/public/views/body.ejs
@@ -29,11 +29,11 @@
<a id="tocLabel" class="ui-toc-label btn btn-default" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
<i class="fa fa-bars"></i>
</a>
- <ul id="toc" class="ui-toc-dropdown dropdown-menu" aria-labelledby="tocLabel">
+ <ul id="ui-toc" class="ui-toc-dropdown dropdown-menu" aria-labelledby="tocLabel">
</ul>
</div>
</div>
- <div id="toc-affix" class="ui-affix-toc ui-toc-dropdown unselectable hidden-print" data-spy="affix" style="top:51px;display:none;"></div>
+ <div id="ui-toc-affix" class="ui-affix-toc ui-toc-dropdown unselectable hidden-print" data-spy="affix" style="top:51px;display:none;"></div>
</div>
</div>
<!-- clipboard modal -->
diff --git a/public/views/html.hbs b/public/views/html.hbs
index 08b6f4ff..7213ff9f 100644
--- a/public/views/html.hbs
+++ b/public/views/html.hbs
@@ -39,13 +39,13 @@
<a id="tocLabel" class="ui-toc-label btn btn-default" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
<i class="fa fa-bars"></i>
</a>
- <ul id="toc" class="ui-toc-dropdown dropdown-menu" aria-labelledby="tocLabel">
- {{{toc}}}
+ <ul id="ui-toc" class="ui-toc-dropdown dropdown-menu" aria-labelledby="tocLabel">
+ {{{ui-toc}}}
</ul>
</div>
</div>
- <div id="toc-affix" class="ui-affix-toc ui-toc-dropdown unselectable hidden-print" data-spy="affix" style="top:17px;display:none;" {{{lang}}} {{{dir}}}>
- {{{toc-affix}}}
+ <div id="ui-toc-affix" class="ui-affix-toc ui-toc-dropdown unselectable hidden-print" data-spy="affix" style="top:17px;display:none;" {{{lang}}} {{{dir}}}>
+ {{{ui-toc-affix}}}
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" defer></script>
diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs
index 3afb2a1a..1de3610c 100644
--- a/public/views/pretty.ejs
+++ b/public/views/pretty.ejs
@@ -67,11 +67,11 @@
<a id="tocLabel" class="ui-toc-label btn btn-default" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
<i class="fa fa-bars"></i>
</a>
- <ul id="toc" class="ui-toc-dropdown dropdown-menu" aria-labelledby="tocLabel">
+ <ul id="ui-toc" class="ui-toc-dropdown dropdown-menu" aria-labelledby="tocLabel">
</ul>
</div>
</div>
- <div id="toc-affix" class="ui-affix-toc ui-toc-dropdown unselectable hidden-print" data-spy="affix" style="display:none;"></div>
+ <div id="ui-toc-affix" class="ui-affix-toc ui-toc-dropdown unselectable hidden-print" data-spy="affix" style="display:none;"></div>
<% if(typeof disqus !== 'undefined' && disqus) { %>
<div class="container-fluid" style="max-width: 758px; margin-bottom: 40px;">
<%- include disqus %>