From 83be3465ccd4bdc43cdfc14f253c236e2f44379e Mon Sep 17 00:00:00 2001
From: Yukai Huang
Date: Thu, 13 Oct 2016 13:59:34 +0800
Subject: Fix scrollspy
---
public/views/foot.ejs | 1 +
public/views/pretty.ejs | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
(limited to 'public')
diff --git a/public/views/foot.ejs b/public/views/foot.ejs
index 696fe3b6..4ba18e3a 100644
--- a/public/views/foot.ejs
+++ b/public/views/foot.ejs
@@ -20,6 +20,7 @@
+
<%- include build/index-scripts %>
diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs
index 0cd9e012..b0eb568f 100644
--- a/public/views/pretty.ejs
+++ b/public/views/pretty.ejs
@@ -99,8 +99,9 @@
<% } %>
-
+
+
<%- include build/pretty-scripts %>
--
cgit v1.2.3
From 4713b4f2aacab5bbc6ed557bd3f382df3af962df Mon Sep 17 00:00:00 2001
From: Yukai Huang
Date: Thu, 13 Oct 2016 14:03:02 +0800
Subject: Fix syncscroll
---
public/js/syncscroll.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'public')
diff --git a/public/js/syncscroll.js b/public/js/syncscroll.js
index 511c5000..a9cfb5a0 100644
--- a/public/js/syncscroll.js
+++ b/public/js/syncscroll.js
@@ -109,7 +109,8 @@ md.use(markdownitContainer, 'info', { render: renderContainer });
md.use(markdownitContainer, 'warning', { render: renderContainer });
md.use(markdownitContainer, 'danger', { render: renderContainer });
-var syncscroll = true;
+// FIXME: expose syncscroll to window
+window.syncscroll = true;
var preventSyncScrollToEdit = false;
var preventSyncScrollToView = false;
--
cgit v1.2.3
From 440ad3506c22791fb58c1cc7888518ab93de3662 Mon Sep 17 00:00:00 2001
From: Yukai Huang
Date: Thu, 13 Oct 2016 15:13:03 +0800
Subject: Fix lastchangeui and moment timestamps
---
public/js/extra.js | 14 +++++---------
public/js/index.js | 3 ---
public/js/pretty.js | 1 -
public/js/slide.js | 17 ++---------------
public/views/foot.ejs | 1 +
public/views/pretty.ejs | 1 +
public/views/slide.ejs | 1 +
7 files changed, 10 insertions(+), 28 deletions(-)
(limited to 'public')
diff --git a/public/js/extra.js b/public/js/extra.js
index 24d53fe7..1a1caf8a 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -5,9 +5,9 @@ var saveAs = require('file-saver').saveAs;
require('../vendor/md-toc');
//auto update last change
-var createtime = null;
-var lastchangetime = null;
-var lastchangeui = {
+window.createtime = null;
+window.lastchangetime = null;
+window.lastchangeui = {
status: $(".ui-status-lastchange"),
time: $(".ui-lastchange"),
user: $(".ui-lastchangeuser"),
@@ -30,8 +30,8 @@ function updateLastChange() {
}
setInterval(updateLastChange, 60000);
-var lastchangeuser = null;
-var lastchangeuserprofile = null;
+window.lastchangeuser = null;
+window.lastchangeuserprofile = null;
function updateLastChangeUser() {
if (lastchangeui) {
if (lastchangeuser && lastchangeuserprofile) {
@@ -1070,11 +1070,7 @@ md.use(pdfPlugin);
module.exports = {
md: md,
- createtime: createtime,
- lastchangetime: lastchangetime,
updateLastChange: updateLastChange,
- lastchangeui: lastchangeui,
- lastchangeuser: lastchangeuser,
postProcess: postProcess,
finishView: finishView,
autoLinkify: autoLinkify,
diff --git a/public/js/index.js b/public/js/index.js
index 20a76ff1..82d3cedb 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -38,15 +38,12 @@ var syncScrollToView = syncScroll.syncScrollToView;
require('./pretty');
var extra = require('./extra');
var md = extra.md;
-var createtime = extra.createtime;
var updateLastChange = extra.updateLastChange;
var postProcess = extra.postProcess;
var finishView = extra.finishView;
-var lastchangetime = extra.lastchangetime;
var autoLinkify = extra.autoLinkify;
var generateToc = extra.generateToc;
var smoothHashScroll = extra.smoothHashScroll;
-var lastchangeuser = extra.lastchangeuser;
var deduplicatedHeaderId = extra.deduplicatedHeaderId;
var renderTOC = extra.renderTOC;
var renderTitle = extra.renderTitle;
diff --git a/public/js/pretty.js b/public/js/pretty.js
index 6b551c17..1288225b 100644
--- a/public/js/pretty.js
+++ b/public/js/pretty.js
@@ -7,7 +7,6 @@ var renderTOC = extra.renderTOC;
var generateToc = extra.generateToc;
var smoothHashScroll = extra.smoothHashScroll;
var postProcess = extra.postProcess;
-var lastchangeui = extra.lastchangeui;
var updateLastChange = extra.updateLastChange;
var preventXSS = require('./render').preventXSS;
diff --git a/public/js/slide.js b/public/js/slide.js
index 257c60bb..d90fd436 100644
--- a/public/js/slide.js
+++ b/public/js/slide.js
@@ -22,23 +22,10 @@ var noteurl = commonModule.noteurl;
var extraModule = require('./extra');
var md = extraModule.md;
-var createtime = extraModule.createtime;
var updateLastChange = extraModule.updateLastChange;
-var postProcess = extraModule.postProcess;
var finishView = extraModule.finishView;
-var lastchangetime = extraModule.lastchangetime;
-var lastchangeui = extraModule.lastchangeui;
-var autoLinkify = extraModule.autoLinkify;
-var generateToc = extraModule.generateToc;
-var smoothHashScroll = extraModule.smoothHashScroll;
-var lastchangeuser = extraModule.lastchangeuser;
-var deduplicatedHeaderId = extraModule.deduplicatedHeaderId;
-var renderTOC = extraModule.renderTOC;
-var renderTitle = extraModule.renderTitle;
-var renderFilename = extraModule.renderFilename;
-var scrollToHash = extraModule.scrollToHash;
-
-var render = require('./render');
+
+require('./render');
var body = $(".slides").html();
$(".slides").html(S(body).unescapeHTML().s);
diff --git a/public/views/foot.ejs b/public/views/foot.ejs
index 4ba18e3a..b51920dc 100644
--- a/public/views/foot.ejs
+++ b/public/views/foot.ejs
@@ -18,6 +18,7 @@
<% } %>
+
diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs
index b0eb568f..09b548a8 100644
--- a/public/views/pretty.ejs
+++ b/public/views/pretty.ejs
@@ -100,6 +100,7 @@
<% } %>
+
diff --git a/public/views/slide.ejs b/public/views/slide.ejs
index 79d77086..679bed2d 100644
--- a/public/views/slide.ejs
+++ b/public/views/slide.ejs
@@ -102,6 +102,7 @@
<% } %>
+
<%- include build/slide-scripts %>
--
cgit v1.2.3
From bcb12b9ae7d3562a05d007d6bab1042c1e6319fe Mon Sep 17 00:00:00 2001
From: Yukai Huang
Date: Thu, 13 Oct 2016 15:30:26 +0800
Subject: Remove jquery-scrollspy dependency
scrollspy is bootstrap built-in plugin
---
public/views/foot.ejs | 1 -
public/views/pretty.ejs | 1 -
2 files changed, 2 deletions(-)
(limited to 'public')
diff --git a/public/views/foot.ejs b/public/views/foot.ejs
index b51920dc..983ce3d7 100644
--- a/public/views/foot.ejs
+++ b/public/views/foot.ejs
@@ -21,7 +21,6 @@
-
<%- include build/index-scripts %>
diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs
index 09b548a8..d5814fc1 100644
--- a/public/views/pretty.ejs
+++ b/public/views/pretty.ejs
@@ -102,7 +102,6 @@
-
<%- include build/pretty-scripts %>
--
cgit v1.2.3
From f678d9b81451fba0b196332a2d2d97310f2133ab Mon Sep 17 00:00:00 2001
From: Yukai Huang
Date: Thu, 13 Oct 2016 15:54:17 +0800
Subject: Fix cheatsheet rendering
do not process help-modal markdown-body
---
public/js/pretty.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'public')
diff --git a/public/js/pretty.js b/public/js/pretty.js
index 1288225b..c1c2b4a4 100644
--- a/public/js/pretty.js
+++ b/public/js/pretty.js
@@ -10,7 +10,7 @@ var postProcess = extra.postProcess;
var updateLastChange = extra.updateLastChange;
var preventXSS = require('./render').preventXSS;
-var markdown = $(".markdown-body");
+var markdown = $("#doc.markdown-body");
var text = $('').html(markdown.html()).text();
var lastMeta = md.meta;
md.meta = {};
--
cgit v1.2.3
From f4f2497d23ff26caba7673b5de0bc8f61b69efca Mon Sep 17 00:00:00 2001
From: Yukai Huang
Date: Thu, 13 Oct 2016 15:59:22 +0800
Subject: Expose parseMeta function
---
public/js/extra.js | 3 ++-
public/js/index.js | 1 +
public/js/pretty.js | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
(limited to 'public')
diff --git a/public/js/extra.js b/public/js/extra.js
index 1a1caf8a..e19a35dc 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -1083,5 +1083,6 @@ module.exports = {
scrollToHash: scrollToHash,
owner: owner,
updateLastChangeUser: updateLastChangeUser,
- updateOwner: updateOwner
+ updateOwner: updateOwner,
+ parseMeta: parseMeta
};
diff --git a/public/js/index.js b/public/js/index.js
index 82d3cedb..4d745327 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -52,6 +52,7 @@ var scrollToHash = extra.scrollToHash;
var owner = extra.owner;
var updateLastChangeUser = extra.updateLastChangeUser;
var updateOwner = extra.updateOwner;
+var parseMeta = extra.parseMeta;
var historyModule = require('./history');
var writeHistory = historyModule.writeHistory;
diff --git a/public/js/pretty.js b/public/js/pretty.js
index c1c2b4a4..c5211202 100644
--- a/public/js/pretty.js
+++ b/public/js/pretty.js
@@ -8,6 +8,7 @@ var generateToc = extra.generateToc;
var smoothHashScroll = extra.smoothHashScroll;
var postProcess = extra.postProcess;
var updateLastChange = extra.updateLastChange;
+var parseMeta = extra.parseMeta;
var preventXSS = require('./render').preventXSS;
var markdown = $("#doc.markdown-body");
--
cgit v1.2.3
From d6003649337c2565e04132a58b42f7a520eb5037 Mon Sep 17 00:00:00 2001
From: Yukai Huang
Date: Thu, 13 Oct 2016 16:25:38 +0800
Subject: Fix history deletion
---
public/js/cover.js | 1 +
public/js/history.js | 5 +++--
public/views/index.ejs | 4 +++-
3 files changed, 7 insertions(+), 3 deletions(-)
(limited to 'public')
diff --git a/public/js/cover.js b/public/js/cover.js
index 30a8e5c8..245127d1 100644
--- a/public/js/cover.js
+++ b/public/js/cover.js
@@ -17,6 +17,7 @@ var postHistoryToServer = historyModule.postHistoryToServer;
var deleteServerHistory = historyModule.deleteServerHistory;
var parseServerToHistory = historyModule.parseServerToHistory;
var saveStorageHistoryToServer = historyModule.saveStorageHistoryToServer;
+var clearDuplicatedHistory = historyModule.clearDuplicatedHistory;
var saveAs = require('file-saver').saveAs;
var List = require('list.js');
diff --git a/public/js/history.js b/public/js/history.js
index d5082dd9..8593bbcf 100644
--- a/public/js/history.js
+++ b/public/js/history.js
@@ -10,7 +10,7 @@ var extra = require('./extra');
var renderFilename = extra.renderFilename;
var md = extra.md;
-var migrateHistoryFromTempCallback = null;
+window.migrateHistoryFromTempCallback = null;
migrateHistoryFromTemp();
@@ -417,5 +417,6 @@ module.exports = {
postHistoryToServer: postHistoryToServer,
deleteServerHistory: deleteServerHistory,
parseServerToHistory: parseServerToHistory,
- saveStorageHistoryToServer: saveStorageHistoryToServer
+ saveStorageHistoryToServer: saveStorageHistoryToServer,
+ clearDuplicatedHistory: clearDuplicatedHistory
}
diff --git a/public/views/index.ejs b/public/views/index.ejs
index 0bc3dd50..e2894589 100644
--- a/public/views/index.ejs
+++ b/public/views/index.ejs
@@ -204,7 +204,9 @@
<% } %>
-
+
+
+
<%- include build/cover-scripts %>