diff options
-rwxr-xr-x | bin/setup | 3 | ||||
-rw-r--r-- | package.json | 66 | ||||
-rw-r--r-- | public/js/extra.js | 12 |
3 files changed, 40 insertions, 41 deletions
@@ -47,8 +47,7 @@ if [ ! -f config.json ]; then fi echo "Installing packages..." -yarn install --pure-lockfile -yarn install --production=false --pure-lockfile +yarn install --production=true --pure-lockfile cat << EOF diff --git a/package.json b/package.json index 63dfc6cb..a558a4dc 100644 --- a/package.json +++ b/package.json @@ -25,11 +25,8 @@ "azure-storage": "^2.7.0", "base64url": "^3.0.0", "body-parser": "^1.15.2", - "bootstrap": "^3.4.0", - "bootstrap-validator": "^0.11.8", "chance": "^1.0.4", "cheerio": "^0.22.0", - "codemirror": "git+https://github.com/hedgedoc/CodeMirror.git", "compression": "^1.6.2", "connect-flash": "^0.1.1", "connect-session-sequelize": "^7.0.0", @@ -38,32 +35,16 @@ "deep-freeze": "^0.0.1", "diff-match-patch": "git+https://github.com/hackmdio/diff-match-patch.git", "ejs": "^3.0.0", - "emojify.js": "^1.1.0", - "escape-html": "^1.0.3", "express": ">=4.14", "express-session": "^1.14.2", - "file-saver": "^2.0.0", "file-type": "^16.1.0", - "flowchart.js": "^1.6.4", - "fork-awesome": "^1.1.3", "formidable": "^1.0.17", - "gist-embed": "^2.6.0", "graceful-fs": "^4.1.11", "handlebars": "^4.5.2", "helmet": "^4.5.0", - "highlight.js": "^10.0.0", "i18n": "^0.13.0", - "ionicons": "^2.0.1", "is-svg": "^4.3.1", - "jquery": "^3.5.1", - "jquery-mousewheel": "^3.1.13", - "jquery-ui": "^1.12.1", - "js-cookie": "^2.1.3", - "js-sequence-diagrams": "git+https://github.com/hedgedoc/js-sequence-diagrams.git", - "js-yaml": "^3.13.1", "jsdom-nogyp": "^0.8.3", - "keymaster": "^1.6.2", - "list.js": "^2.0.0", "lodash": "^4.17.20", "lutim": "^1.0.2", "lz-string": "git+https://github.com/hackmdio/lz-string.git", @@ -81,9 +62,7 @@ "markdown-it-regexp": "^0.4.0", "markdown-it-sub": "^1.0.0", "markdown-it-sup": "^1.0.0", - "mathjax": "^2.7.6", "mattermost": "^3.4.0", - "mermaid": "^8.5.1", "meta-marked": "git+https://github.com/hedgedoc/meta-marked", "method-override": "^3.0.0", "minimist": "^1.2.0", @@ -107,36 +86,25 @@ "pdfobject": "^2.0.201604172", "pg": "^8.2.1", "pg-hstore": "^2.3.3", - "prismjs": "^1.21.0", "prom-client": "^13.1.0", "prometheus-api-metrics": "^3.2.0", "randomcolor": "^0.6.0", - "raphael": "^2.3.0", "readline-sync": "^1.4.7", - "reveal.js": "^3.9.2", "rimraf": "^3.0.2", "scrypt-kdf": "^2.0.1", - "select2": "^3.5.2-browserify", "sequelize": "^5.21.1", "shortid": "2.2.16", "socket.io": "^2.1.1", - "socket.io-client": "^2.1.1", - "spin.js": "^4.0.0", "sqlite3": "^5.0.0", "store": "^2.0.12", "string": "^3.3.3", "tedious": "^6.6.0", "toobusy-js": "^0.5.1", - "turndown": "^7.0.0", "umzug": "^2.3.0", "uuid": "^8.0.0", "validator": "^13.0.0", - "velocity-animate": "^1.4.0", - "visibilityjs": "^2.0.0", - "viz.js": "^1.7.0", "winston": "^3.1.0", "ws": "^7.4.4", - "wurl": "^2.5.3", "xss": "^1.0.3" }, "resolutions": { @@ -177,8 +145,13 @@ "babel-polyfill": "6.26.0", "babel-preset-env": "1.7.0", "babel-runtime": "6.26.0", + "bootstrap": "^3.4.0", + "bootstrap-validator": "^0.11.8", + "codemirror": "git+https://github.com/hedgedoc/CodeMirror.git", "copy-webpack-plugin": "6.4.1", "css-loader": "5.2.4", + "emojify.js": "^1.1.0", + "escape-html": "^1.0.3", "eslint": "7.25.0", "eslint-config-standard": "16.0.2", "eslint-plugin-import": "2.22.1", @@ -187,23 +160,50 @@ "eslint-plugin-standard": "4.1.0", "expose-loader": "1.0.3", "file-loader": "6.2.0", + "file-saver": "^2.0.0", + "flowchart.js": "^1.6.4", + "fork-awesome": "^1.1.3", + "gist-embed": "^2.6.0", + "highlight.js": "^10.0.0", "html-webpack-plugin": "4.5.2", "imports-loader": "1.2.0", + "ionicons": "^2.0.1", + "jquery": "^3.5.1", + "jquery-mousewheel": "^3.1.13", + "jquery-ui": "^1.12.1", + "js-cookie": "^2.1.3", + "js-sequence-diagrams": "git+https://github.com/hedgedoc/js-sequence-diagrams.git", + "js-yaml": "^3.13.1", "jsonlint": "1.6.3", + "keymaster": "^1.6.2", "less": "4.1.1", "less-loader": "7.3.0", + "list.js": "^2.0.0", + "mathjax": "^2.7.6", + "mermaid": "^8.5.1", "mini-css-extract-plugin": "1.6.0", "mocha": "8.3.2", "mock-require": "3.0.3", "optimize-css-assets-webpack-plugin": "5.0.4", + "prismjs": "^1.21.0", + "raphael": "^2.3.0", "remark-cli": "9.0.0", "remark-preset-lint-markdown-style-guide": "4.0.0", + "reveal.js": "^3.9.2", "script-loader": "0.7.2", + "select2": "^3.5.2-browserify", + "socket.io-client": "^2.1.1", + "spin.js": "^4.0.0", "string-loader": "0.0.1", + "turndown": "^7.0.0", "url-loader": "4.1.1", + "velocity-animate": "^1.4.0", + "visibilityjs": "^2.0.0", + "viz.js": "^1.7.0", "webpack": "4.46.0", "webpack-cli": "4.6.0", - "webpack-merge": "5.7.3" + "webpack-merge": "5.7.3", + "wurl": "^2.5.3" }, "optionalDependencies": { "bufferutil": "^4.0.0", diff --git a/public/js/extra.js b/public/js/extra.js index 7f06ebda..c71475b5 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -266,9 +266,9 @@ export function finishView (view) { li.innerHTML = html let disabled = 'disabled' if (typeof editor !== 'undefined' && window.havePermission()) { disabled = '' } - if (/^\s*\[[x ]\]\s*/.test(html)) { - li.innerHTML = html.replace(/^\s*\[ \]\s*/, `<input type="checkbox" class="task-list-item-checkbox "${disabled}><label></label>`) - .replace(/^\s*\[x\]\s*/, `<input type="checkbox" class="task-list-item-checkbox" checked ${disabled}><label></label>`) + if (/^\s*\[[xX ]]\s*/.test(html)) { + li.innerHTML = html.replace(/^\s*\[ ]\s*/, `<input type="checkbox" class="task-list-item-checkbox" ${disabled}><label></label>`) + .replace(/^\s*\[[xX]]\s*/, `<input type="checkbox" class="task-list-item-checkbox" checked ${disabled}><label></label>`) if (li.tagName.toLowerCase() !== 'li') { li.parentElement.setAttribute('class', 'task-list-item') } else { @@ -705,11 +705,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-]*(?:[-+*]|\d+[.)])\s\[([xX ])]/) 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 ])(\])/) + if (matches[1].toLowerCase() === 'x') { checked = true } else if (matches[1] === ' ') { checked = false } + const replacements = matches[0].match(/(^[>\s-]*(?:[-+*]|\d+[.)])\s\[)([xX ])(])/) window.editor.replaceRange(checked ? ' ' : 'x', { line: startline, ch: replacements[1].length |