diff --git a/lib/web/auth/ldap/index.js b/lib/web/auth/ldap/index.js index ab1cb4c..8d71c18 100644 --- a/lib/web/auth/ldap/index.js +++ b/lib/web/auth/ldap/index.js @@ -15,7 +15,7 @@ let ldapAuth = module.exports = Router() passport.use(new LDAPStrategy({ server: { url: config.ldap.url || null, - bindDn: config.ldap.bindDn || null, + bindDN: config.ldap.bindDn || null, bindCredentials: config.ldap.bindCredentials || null, searchBase: config.ldap.searchBase || null, searchFilter: config.ldap.searchFilter || null, diff --git a/package.json b/package.json index 442d00a..246147a 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "graceful-fs": "^4.1.11", "handlebars": "^4.0.6", "helmet": "^3.3.0", - "highlight.js": "~9.9.0", + "highlight.js": "~9.12.0", "i18n": "^0.8.3", "imgur": "git+https://github.com/hackmdio/node-imgur.git", "ionicons": "~2.0.1", @@ -76,36 +76,36 @@ "markdown-it-regexp": "^0.4.0", "markdown-it-sub": "^1.0.0", "markdown-it-sup": "^1.0.0", - "markdown-pdf": "^7.0.0", + "markdown-pdf": "^8.0.0", "mathjax": "~2.7.0", "mermaid": "~7.1.0", "mattermost": "^3.4.0", "meta-marked": "^0.4.2", "method-override": "^2.3.7", "minimist": "^1.2.0", - "minio": "^3.1.3", + "minio": "^6.0.0", "moment": "^2.17.1", "morgan": "^1.7.0", "mysql": "^2.12.0", "node-uuid": "^1.4.7", - "octicons": "~3.5.0", - "passport": "^0.3.2", + "octicons": "~4.4.0", + "passport": "^0.4.0", "passport-dropbox-oauth2": "^1.1.0", "passport-facebook": "^2.1.1", "passport-github": "^1.1.0", - "passport-gitlab2": "^2.2.0", + "passport-gitlab2": "^4.0.0", "passport-google-oauth20": "^1.0.0", - "passport-ldapauth": "^0.6.0", + "passport-ldapauth": "^2.0.0", "passport-local": "^1.0.0", "passport-oauth2": "^1.4.0", "passport-twitter": "^1.0.4", "passport-saml": "^0.31.0", "passport.socketio": "^3.7.0", "pdfobject": "^2.0.201604172", - "pg": "^6.1.2", + "pg": "^7.4.3", "pg-hstore": "^2.3.2", "prismjs": "^1.6.0", - "randomcolor": "^0.4.4", + "randomcolor": "^0.5.3", "raphael": "git+https://github.com/dmitrybaranovskiy/raphael", "readline-sync": "^1.4.7", "request": "^2.79.0", @@ -114,24 +114,24 @@ "select2": "^3.5.2-browserify", "sequelize": "^3.28.0", "sequelize-cli": "^2.5.1", - "shortid": "2.2.6", + "shortid": "2.2.8", "socket.io": "~2.0.4", "socket.io-client": "~2.0.4", "spin.js": "^2.3.2", - "sqlite3": "^3.1.8", - "store": "^1.3.20", + "sqlite3": "^4.0.1", + "store": "^2.0.12", "string": "^3.3.3", "tedious": "^1.14.0", "to-markdown": "^3.0.3", "toobusy-js": "^0.5.1", "uuid": "^3.1.0", "uws": "~0.14.1", - "validator": "^6.2.0", + "validator": "^10.4.0", "velocity-animate": "^1.4.0", "visibilityjs": "^1.2.4", "viz.js": "^1.7.0", "winston": "^2.3.0", - "xss": "^0.3.3" + "xss": "^1.0.3" }, "engines": { "node": ">=6.x <10.x" diff --git a/public/js/history.js b/public/js/history.js index 7132281..b4c26b4 100644 --- a/public/js/history.js +++ b/public/js/history.js @@ -1,5 +1,5 @@ /* eslint-env browser, jquery */ -/* global serverurl, Cookies, moment */ +/* global serverurl, moment */ import store from 'store' import S from 'string' @@ -64,13 +64,7 @@ export function saveHistory (notehistory) { } function saveHistoryToStorage (notehistory) { - if (store.enabled) { store.set('notehistory', JSON.stringify(notehistory)) } else { saveHistoryToCookie(notehistory) } -} - -function saveHistoryToCookie (notehistory) { - Cookies.set('notehistory', notehistory, { - expires: 365 - }) + store.set('notehistory', JSON.stringify(notehistory)) } function saveHistoryToServer (notehistory) { @@ -150,35 +144,17 @@ export function writeHistory (title, tags) { ) } -function writeHistoryToCookie (title, tags) { - var notehistory - try { - notehistory = Cookies.getJSON('notehistory') - } catch (err) { +function writeHistoryToStorage (title, tags) { + let data = store.get('notehistory') + let notehistory + if (data && typeof data === 'string') { + notehistory = JSON.parse(data) + } else { notehistory = [] } - if (!notehistory) { notehistory = [] } + const newnotehistory = generateHistory(title, tags, notehistory) - saveHistoryToCookie(newnotehistory) -} - -function writeHistoryToStorage (title, tags) { - if (store.enabled) { - let data = store.get('notehistory') - var notehistory - if (data) { - if (typeof data === 'string') { data = JSON.parse(data) } - notehistory = data - } else { - notehistory = [] - } - if (!notehistory) { notehistory = [] } - - const newnotehistory = generateHistory(title, tags, notehistory) - saveHistoryToStorage(newnotehistory) - } else { - writeHistoryToCookie(title, tags) - } + saveHistoryToStorage(newnotehistory) } if (!Array.isArray) { @@ -236,20 +212,13 @@ function getServerHistory (callback) { }) } -function getCookieHistory (callback) { - callback(Cookies.getJSON('notehistory')) -} - export function getStorageHistory (callback) { - if (store.enabled) { - let data = store.get('notehistory') - if (data) { - if (typeof data === 'string') { data = JSON.parse(data) } - callback(data) - } else { getCookieHistory(callback) } - } else { - getCookieHistory(callback) + let data = store.get('notehistory') + if (data) { + if (typeof data === 'string') { data = JSON.parse(data) } + callback(data) } + callback([]) } export function parseHistory (list, callback) { @@ -275,21 +244,13 @@ export function parseServerToHistory (list, callback) { }) } -function parseCookieToHistory (list, callback) { - const notehistory = Cookies.getJSON('notehistory') - parseToHistory(list, notehistory, callback) -} - export function parseStorageToHistory (list, callback) { - if (store.enabled) { - let data = store.get('notehistory') - if (data) { - if (typeof data === 'string') { data = JSON.parse(data) } - parseToHistory(list, data, callback) - } else { parseCookieToHistory(list, callback) } - } else { - parseCookieToHistory(list, callback) + let data = store.get('notehistory') + if (data) { + if (typeof data === 'string') { data = JSON.parse(data) } + parseToHistory(list, data, callback) } + parseToHistory(list, [], callback) } function parseToHistory (list, notehistory, callback) { diff --git a/public/views/codimd/foot.ejs b/public/views/codimd/foot.ejs index 4d73d05..000ccb6 100644 --- a/public/views/codimd/foot.ejs +++ b/public/views/codimd/foot.ejs @@ -14,7 +14,7 @@ - + diff --git a/public/views/codimd/head.ejs b/public/views/codimd/head.ejs index 8dfef43..1f44625 100644 --- a/public/views/codimd/head.ejs +++ b/public/views/codimd/head.ejs @@ -12,7 +12,7 @@ - + <%- include ../build/index-header %> <%- include ../shared/polyfill %> diff --git a/public/views/html.hbs b/public/views/html.hbs index a300ddd..a87bf81 100644 --- a/public/views/html.hbs +++ b/public/views/html.hbs @@ -18,9 +18,9 @@ - + - +