summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWu Cheng-Han2015-12-18 09:40:52 -0600
committerWu Cheng-Han2015-12-18 09:40:52 -0600
commit031c96c72d168a23cca0c609f46e019eced8bc64 (patch)
tree6e10c7dd5c10294aa7230d11626f4f0004b78f91 /lib
parent54b33f181f70786a2df624061e7a2ffb93a3eb73 (diff)
Updated slide mode
Diffstat (limited to 'lib')
-rw-r--r--lib/response.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/response.js b/lib/response.js
index 640e83bf..375fc3f4 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -24,8 +24,8 @@ var Mustache = require('mustache');
var opts = {
userBasePath: process.cwd(),
revealBasePath: path.resolve(require.resolve('reveal.js'), '..', '..'),
- template: fs.readFileSync(path.join('.', '/public/views/templates', 'reveal.html')).toString(),
- templateListing: fs.readFileSync(path.join('.', '/public/views/templates', 'listing.html')).toString(),
+ template: fs.readFileSync(path.join('.', '/public/views/slide', 'reveal.hbs')).toString(),
+ templateListing: fs.readFileSync(path.join('.', '/public/views/slide', 'listing.hbs')).toString(),
theme: 'css/theme/black.css',
highlightTheme: 'zenburn',
separator: '^(\r\n?|\n)---(\r\n?|\n)$',
@@ -404,7 +404,6 @@ function publishNoteActions(req, res, next) {
}
}
-
function showPublishSlide(req, res, next) {
var shortid = req.params.shortid;
if (shortId.isValid(shortid)) {
@@ -425,8 +424,12 @@ function showPublishSlide(req, res, next) {
return;
}
var body = LZString.decompressFromBase64(data.rows[0].content);
+ var title = data.rows[0].title;
+ var decodedTitle = LZString.decompressFromBase64(title);
+ if (decodedTitle) title = decodedTitle;
+ title = Note.generateWebTitle(title);
var text = S(body).escapeHTML().s;
- render(res, text);
+ render(res, title, text);
});
});
});
@@ -436,10 +439,11 @@ function showPublishSlide(req, res, next) {
}
//reveal.js render
-var render = function (res, markdown) {
+var render = function (res, title, markdown) {
var slides = md.slidify(markdown, opts);
res.end(Mustache.to_html(opts.template, {
+ title: title,
theme: opts.theme,
highlightTheme: opts.highlightTheme,
slides: slides,