summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js')
-rw-r--r--public/js/extra.js4
-rw-r--r--public/js/lib/common/constant.ejs4
-rw-r--r--public/js/mathjax-config-extra.js8
3 files changed, 13 insertions, 3 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index ec7d39da..dbb0f458 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -713,11 +713,11 @@ $.fn.sortByDepth = function () {
function toggleTodoEvent (e) {
const startline = $(this).closest('li').attr('data-startline') - 1
const line = window.editor.getLine(startline)
- const matches = line.match(/^[>\s]*[-+*]\s\[([x ])\]/)
+ const matches = line.match(/^[>\s-]*[-+*]\s\[([x ])\]/)
if (matches && matches.length >= 2) {
let checked = null
if (matches[1] === 'x') { checked = true } else if (matches[1] === ' ') { checked = false }
- const replacements = matches[0].match(/(^[>\s]*[-+*]\s\[)([x ])(\])/)
+ const replacements = matches[0].match(/(^[>\s-]*[-+*]\s\[)([x ])(\])/)
window.editor.replaceRange(checked ? ' ' : 'x', {
line: startline,
ch: replacements[1].length
diff --git a/public/js/lib/common/constant.ejs b/public/js/lib/common/constant.ejs
index e4a1cf0a..c0963635 100644
--- a/public/js/lib/common/constant.ejs
+++ b/public/js/lib/common/constant.ejs
@@ -3,6 +3,8 @@ window.urlpath = '<%- urlpath %>'
window.debug = <%- debug %>
window.version = '<%- version %>'
+window.allowedUploadMimeTypes = <%- JSON.stringify(allowedUploadMimeTypes) %>
+
window.GOOGLE_API_KEY = '<%- GOOGLE_API_KEY %>'
window.GOOGLE_CLIENT_ID = '<%- GOOGLE_CLIENT_ID %>'
-window.DROPBOX_APP_KEY = '<%- DROPBOX_APP_KEY %>' \ No newline at end of file
+window.DROPBOX_APP_KEY = '<%- DROPBOX_APP_KEY %>'
diff --git a/public/js/mathjax-config-extra.js b/public/js/mathjax-config-extra.js
new file mode 100644
index 00000000..11ba59c6
--- /dev/null
+++ b/public/js/mathjax-config-extra.js
@@ -0,0 +1,8 @@
+window.MathJax = {
+ messageStyle: 'none',
+ skipStartupTypeset: true,
+ tex2jax: {
+ inlineMath: [['$', '$'], ['\\(', '\\)']],
+ processEscapes: true
+ }
+}