diff options
Diffstat (limited to 'public')
-rw-r--r-- | public/css/extra.css | 31 | ||||
-rw-r--r-- | public/css/github-extract.css | 41 | ||||
-rw-r--r-- | public/css/index.css | 74 | ||||
-rw-r--r-- | public/css/markdown.css | 38 | ||||
-rw-r--r-- | public/css/slide.css | 19 | ||||
-rw-r--r-- | public/docs/features.md | 32 | ||||
-rw-r--r--[-rwxr-xr-x] | public/docs/release-notes.md | 55 | ||||
-rw-r--r-- | public/js/extra.js | 43 | ||||
-rw-r--r-- | public/js/index.js | 15 | ||||
-rw-r--r-- | public/js/lib/appState.js | 3 | ||||
-rw-r--r-- | public/js/lib/editor/index.js | 8 | ||||
-rw-r--r-- | public/js/lib/editor/ui-elements.js | 1 | ||||
-rw-r--r-- | public/js/locale.js | 3 | ||||
-rw-r--r-- | public/js/mathjax-config-extra.js | 8 | ||||
-rw-r--r-- | public/js/render.js | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | public/js/reveal-markdown.js | 2 | ||||
-rw-r--r-- | public/js/slide.js | 3 | ||||
-rw-r--r-- | public/views/hackmd/body.ejs | 6 | ||||
-rw-r--r-- | public/views/hackmd/foot.ejs | 6 | ||||
-rw-r--r-- | public/views/hackmd/header.ejs | 21 | ||||
-rw-r--r-- | public/views/index/body.ejs | 16 | ||||
-rw-r--r-- | public/views/pretty.ejs | 6 | ||||
-rw-r--r-- | public/views/shared/help-modal.ejs | 6 | ||||
-rw-r--r-- | public/views/shared/signin-modal.ejs | 14 | ||||
-rw-r--r-- | public/views/slide.ejs | 18 |
25 files changed, 385 insertions, 88 deletions
diff --git a/public/css/extra.css b/public/css/extra.css index 169a1a5a..1b132901 100644 --- a/public/css/extra.css +++ b/public/css/extra.css @@ -179,6 +179,11 @@ border-left: 1px solid black; } +.night .ui-toc-dropdown .nav>li>a:focus, .night .ui-toc-dropdown .nav>li>a:hover{ + color: white; + border-left-color: white; +} + .ui-toc-dropdown[dir='rtl'] .nav>li>a:focus,.ui-toc-dropdown[dir='rtl'] .nav>li>a:hover { padding-right: 19px; border-left: none; @@ -192,6 +197,10 @@ background-color: transparent; border-left: 2px solid black; } +.night .ui-toc-dropdown .nav>.active:focus>a,.night .ui-toc-dropdown .nav>.active:hover>a,.night .ui-toc-dropdown .nav>.active>a { + color: white; + border-left: 2px solid white; +} .ui-toc-dropdown[dir='rtl'] .nav>.active:focus>a,.ui-toc-dropdown[dir='rtl'] .nav>.active:hover>a,.ui-toc-dropdown[dir='rtl'] .nav>.active>a { padding-right: 18px; @@ -216,6 +225,10 @@ font-weight: 400; } +.night .ui-toc-dropdown .nav > li > a{ + color: #aaa; +} + .ui-toc-dropdown[dir='rtl'] .nav .nav>li>a { padding-right: 30px; } @@ -350,13 +363,23 @@ small .dropdown a:focus, small .dropdown a:hover { } .unselectable { - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: none; -o-user-select: none; user-select: none; } +.night .navbar{ + background: #333; + border-bottom-color: #333; + color: #eee; +} + +.night .navbar a{ + color: #eee; +} + @media print { div, table, img, pre, blockquote { page-break-inside: avoid !important; @@ -364,4 +387,4 @@ small .dropdown a:focus, small .dropdown a:hover { a[href]:after { font-size: 12px !important; } -}
\ No newline at end of file +} diff --git a/public/css/github-extract.css b/public/css/github-extract.css index 4d2650d4..7f7058a0 100644 --- a/public/css/github-extract.css +++ b/public/css/github-extract.css @@ -68,6 +68,9 @@ color: #777; border-left: 0.25em solid #ddd; } +.night .markdown-body blockquote{ + color: #bcbcbc; +} .markdown-body blockquote>:first-child { margin-top: 0; @@ -107,6 +110,15 @@ line-height: 1.25; } +.night .markdown-body h1, +.night .markdown-body h2, +.night .markdown-body h3, +.night .markdown-body h4, +.night .markdown-body h5, +.night .markdown-body h6 { + color: #ddd; +} + .markdown-body h1 .octicon-link, .markdown-body h2 .octicon-link, .markdown-body h3 .octicon-link, @@ -118,6 +130,15 @@ visibility: hidden; } +.night .markdown-body h1 .octicon-link, +.night .markdown-body h2 .octicon-link, +.night .markdown-body h3 .octicon-link, +.night .markdown-body h4 .octicon-link, +.night .markdown-body h5 .octicon-link, +.night .markdown-body h6 .octicon-link { + color: #fff; +} + .markdown-body h1:hover .anchor, .markdown-body h2:hover .anchor, .markdown-body h3:hover .anchor, @@ -180,6 +201,8 @@ color: #777 } + + .markdown-body ul, .markdown-body ol { padding-left: 2em @@ -246,11 +269,19 @@ background-color: #fff; border-top: 1px solid #ccc; } +.night .markdown-body table tr { + background-color: #5f5f5f; +} .markdown-body table tr:nth-child(2n) { background-color: #f8f8f8; } +.night .markdown-body table tr:nth-child(2n){ + + background-color: #4f4f4f; +} + .markdown-body img { max-width: 100%; box-sizing: content-box; @@ -370,6 +401,14 @@ border-radius: 3px; } +.night .markdown-body code, +.night .markdown-body tt { + + color: #eee; + background-color: rgba(230, 230, 230, 0.36); + +} + .markdown-body code::before, .markdown-body code::after, .markdown-body tt::before, @@ -512,4 +551,4 @@ margin: 0.31em 0 0.2em -1.3em !important; vertical-align: middle; cursor: default !important; -}
\ No newline at end of file +} diff --git a/public/css/index.css b/public/css/index.css index 8f483aa7..b00eba41 100644 --- a/public/css/index.css +++ b/public/css/index.css @@ -10,6 +10,16 @@ body { padding-top: 51px; /*overflow: hidden;*/ } + +.night a, +.night .open-files-container li.selected a { + color: #5EB7E0; +} + +body.night{ + background: #333 !important; +} + .CodeMirror { font-family: "Source Code Pro", Consolas, monaco, monospace; letter-spacing: 0.025em; @@ -117,6 +127,11 @@ body { margin-left: 0; margin-right: 0; } + +.night .ui-content{ + background-color: #333; +} + .ui-edit-area { height: 100%; /*padding-left: 15px;*/ @@ -144,6 +159,12 @@ body { .ui-edit-area .ui-sync-toggle:active { box-shadow: inset 0 3px 5px rgba(0,0,0,.125), 2px 0px 2px #e7e7e7; } + +.night .ui-edit-area .ui-resizable-handle.ui-resizable-e{ + background: #3c3c3c; + box-shadow: 3px 0px 6px #353535; +} + .ui-view-area { /*overflow-y: scroll;*/ -webkit-overflow-scrolling: touch; @@ -154,6 +175,13 @@ body { padding-right: 15px; } } + +.night .ui-view-area{ + background: #333; + color: #ededed; +} + + .ui-scrollable { height: 100%; overflow-x: hidden; @@ -238,12 +266,32 @@ body { .navbar-nav > li > a { cursor: pointer; } + +.night .navbar-default .navbar-nav > li > a:focus, +.night .navbar-default .navbar-nav > li > a:hover, +.night .navbar-default .navbar-brand:focus, +.night .navbar-default .navbar-brand:hover{ + color: #fff; +} + +.night .navbar-default .navbar-nav > .open > a, +.night .navbar-default .navbar-nav > .open > a:focus, +.night .navbar-default .navbar-nav > .open > a:hover { + color: white; + background: #000; + +} .dropdown-menu > li > a { cursor: pointer; text-overflow: ellipsis; max-width: calc(100vw - 30px); overflow: hidden; } + +.night .dropdown-menu{ + background: #222; +} + .dropdown-menu.CodeMirror-other-cursor { transition: none; } @@ -276,8 +324,8 @@ div[contenteditable]:empty:not(:focus):before{ max-height: 40vh; overflow: auto; } -.dropdown-menu.list::-webkit-scrollbar { - display: none; +.dropdown-menu.list::-webkit-scrollbar { + display: none; } .dropdown-menu .emoji { margin-bottom: 0 !important; @@ -292,6 +340,16 @@ div[contenteditable]:empty:not(:focus):before{ background: inherit; } +.night .navbar .btn-default{ + background-color: #333; + border-color: #565656; + color: #eee; +} + +.night .btn.btn-default.ui-view.active{ + background: #202020; +} + .btn-file { position: relative; overflow: hidden; @@ -312,6 +370,12 @@ div[contenteditable]:empty:not(:focus):before{ display: block; } +.night .btn.focus, +.night .btn:focus, +.night .btn:hover{ + color: #fff; +} + .info-label { width: 36%; text-align: right; @@ -481,8 +545,8 @@ div[contenteditable]:empty:not(:focus):before{ border: 1px solid #2893ef; } -.status-bar .indent-width-input::-webkit-inner-spin-button, -.status-bar .indent-width-input::-webkit-outer-spin-button { +.status-bar .indent-width-input::-webkit-inner-spin-button, +.status-bar .indent-width-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } @@ -524,4 +588,4 @@ div[contenteditable]:empty:not(:focus):before{ .CodeMirror { height: auto !important; } -}
\ No newline at end of file +} diff --git a/public/css/markdown.css b/public/css/markdown.css index ad3a655f..6741729d 100644 --- a/public/css/markdown.css +++ b/public/css/markdown.css @@ -69,6 +69,12 @@ border-collapse: inherit !important; } +.night .markdown-body .gist table tr:nth-child(2n){ + + background-color: #ddd; + +} + .markdown-body code[data-gist-id] { background: none; padding: 0; @@ -93,6 +99,7 @@ .markdown-body code[data-gist-id] table tr { background: unset; + } /*fixed style for rtl in pre and code*/ @@ -121,6 +128,16 @@ white-space: inherit; } +.night .markdown-body pre.graphviz .graph > polygon{ + fill: #333; +} + +.night .markdown-body pre.mermaid .titleText, +.night .markdown-body pre.mermaid text, +.night .markdown-body pre.mermaid .sectionTitle{ + fill: white; +} + .markdown-body pre.flow-chart > code, .markdown-body pre.sequence-diagram > code, .markdown-body pre.graphviz > code, @@ -138,6 +155,27 @@ height: 100%; } +.night .markdown-body .abc path{ + fill: #eee; +} + +.night .markdown-body .abc path.note_selected{ + fill: ##4DD0E1; +} + +.night tspan{ + fill: #fefefe; +} + +.night pre rect{ + fill: transparent; +} + +.night pre.flow-chart rect, +.night pre.flow-chart path{ + stroke: white; +} + .markdown-body pre > code.wrap { white-space: pre-wrap; /* Since CSS 2.1 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ diff --git a/public/css/slide.css b/public/css/slide.css index 74bc03c8..a8591108 100644 --- a/public/css/slide.css +++ b/public/css/slide.css @@ -258,6 +258,10 @@ pre.abc > svg { transform-style: preserve-3d; } +.slides, #meta { + display: none; +} + .reveal .slides > section, .reveal .slides > section > section { transform-style: flat; @@ -283,12 +287,25 @@ pre.abc > svg { padding: 25px 15px; } +.footer .gray-font { + color: #777; +} + .footer > * { margin-left: auto; margin-right: auto; max-width: 758px; } +.footer .ui-no-lastchangeuser { + width: 18px; +} + +.footer .slides-disqus { + margin-top: 25px; + margin-bottom: 15px; +} + html, body { height: 100%; width: 100%; @@ -330,4 +347,4 @@ html, body { .print-pdf .footer { display: none; -}
\ No newline at end of file +} diff --git a/public/docs/features.md b/public/docs/features.md index b64b988e..01340fd7 100644 --- a/public/docs/features.md +++ b/public/docs/features.md @@ -3,13 +3,12 @@ Features Introduction === -<i class="fa fa-file-text"></i> **HackMD** is a realtime, multiplatform collaborative markdown note editor. +<i class="fa fa-file-text"></i> **HackMD** is a realtime, multi-platform collaborative markdown note editor. This means that you can write notes with other people on your **desktop**, **tablet** or even on the **phone**. -You can sign-in via **Facebook**, **Twitter**, **GitHub**, or **Dropbox** in the [_homepage_](/). +You can sign-in via multiple auth providers like **Facebook**, **Twitter**, **GitHub** and many more on the [_homepage_](/). -Note that this service is still in an early stage, and thus still has some [_issues_](https://github.com/hackmdio/hackmd/issues?q=is%3Aopen+is%3Aissue+label%3Abug). -Please report new issues in [GitHub](https://github.com/hackmdio/hackmd/issues/new). -If you need instant help, please send us a [Facebook message](https://www.messenger.com/t/hackmdio). +If you experience any _issues_, feel free to report it on [**GitHub**](https://github.com/hackmdio/hackmd/issues). +Or meet us on [**Gitter**](https://gitter.im/hackmdio/hackmd) for dev-talk and interactive help. **Thank you very much!** Workspace @@ -47,12 +46,15 @@ or import content from your **clipboard** <i class="fa fa-clipboard"></i>, and t It is possible to change the access permission to a note through the little button on the top right of the view. There are four possible options: -<i class="fa fa-leaf fa-fw"></i> **Freely**: Anyone can edit this note. -<i class="fa fa-pencil fa-fw"></i> **Editable**: A signed-in user can edit this note. -<i class="fa fa-id-card fa-fw"></i> **Limited**: People have to sign-in to view and edit this note. -<i class="fa fa-lock fa-fw"></i> **Locked**: Anyone can view this note but only the owner can edit it. -<i class="fa fa-umbrella fa-fw"></i> **Protected**: People have to sign-in to view this note but only owner can edit. -<i class="fa fa-hand-stop-o fa-fw"></i> **Private**: Only the owner can view and edit this note. +| |Owner read/write|Signed-in read|Signed-in write|Guest read|Guest write| +|:-----------------------------|:--------------:|:------------:|:-------------:|:--------:|:---------:| +|<span class="text-nowrap"><i class="fa fa-leaf fa-fw"></i> **Freely**</span> |✔|✔|✔|✔|✔| +|<span class="text-nowrap"><i class="fa fa-pencil fa-fw"></i> **Editable**</span> |✔|✔|✔|✔|✖| +|<span class="text-nowrap"><i class="fa fa-id-card fa-fw"></i> **Limited**</span> |✔|✔|✔|✖|✖| +|<span class="text-nowrap"><i class="fa fa-lock fa-fw"></i> **Locked**</span> |✔|✔|✖|✔|✖| +|<span class="text-nowrap"><i class="fa fa-umbrella fa-fw"></i> **Protected**</span> |✔|✔|✖|✖|✖| +|<span class="text-nowrap"><i class="fa fa-hand-stop-o fa-fw"></i> **Private**</span> |✔|✖|✖|✖|✖| + **Only the owner of the note can change the note's permissions.** @@ -134,7 +136,7 @@ alert(s); function $initHighlight(block, cls) { try { if (cls.search(/\bno\-highlight\b/) != -1) - return process(block, true, 0x0F) + + return process(block, true, 0x0F) + ' class=""'; } catch (e) { /* handle exception */ @@ -154,7 +156,7 @@ alert(s); function $initHighlight(block, cls) { try { if (cls.search(/\bno\-highlight\b/) != -1) - return process(block, true, 0x0F) + + return process(block, true, 0x0F) + ' class=""'; } catch (e) { /* handle exception */ @@ -256,7 +258,7 @@ cond(no)->op2 digraph hierarchy { nodesep=1.0 // increases the separation between nodes - + node [color=Red,fontname=Courier,shape=box] //All nodes will this shape and colour edge [color=Blue, style=dashed] //All the lines look like this @@ -383,7 +385,7 @@ Subscript: H~2~O > Blockquotes can also be nested... >> ...by using additional greater-than signs right next to each other... -> > > ...or with spaces between arrows. +> > > ...or with spaces between arrows. ### Lists diff --git a/public/docs/release-notes.md b/public/docs/release-notes.md index 2e0a71c6..70510b19 100755..100644 --- a/public/docs/release-notes.md +++ b/public/docs/release-notes.md @@ -1,6 +1,59 @@ Release Notes === +<i class="fa fa-tag"></i> 1.0.1-ce <i class="fa fa-clock-o"></i> 2018-01-19 15:00 +--- + +### Security +* Fix Dropbox client secret leak + +### Enhancements +* Improve version handling +* It's 2018! + +### Fixes +* Fix image alt-tag rendering +* Fix Dropbox appkey + +<i class="fa fa-tag"></i> 1.0.0-ce <i class="fa fa-clock-o"></i> 2018-01-18 12:00 +--- +### License +* Switch from MIT to AGPL + +### Enhancements +* Improve language support +* Allow themes for reveal +* Add dark theme for editor and view +* Add danish translation +* Add simplified chinese translation +* Provide new permission table +* Make HSTS configurable +* Make PDF export configurable +* Add Mattermost auth support +* Add SAML support + +### Fixes +* Fix regex for speaker notes +* Fix S3 endpoint support +* Fix German translation +* Fix English translation +* Fix broken profile images +* Fix XSS attacks +* Fix history order +* Fix missing boolean settings +* Fix LDAP auth +* Fix too long notes droping content +* Fix mermaid compatiblity with new version +* Fix SSL CA path parsing + +### Refactor +* Refactor main page +* Refactor status pages +* Refactor config handling +* Refactor auth backend +* Refactor code styling +* Refactor middleware to modules + <i class="fa fa-tag"></i> 0.5.1 `Doppio` <i class="fa fa-clock-o"></i> 2017-03-23 00:20 --- ### Enhancements @@ -636,4 +689,4 @@ Release Notes + Preview html + Realtime collaborate + Cross-platformed -+ Recently used history
\ No newline at end of file ++ Recently used history diff --git a/public/js/extra.js b/public/js/extra.js index bf388139..ec7d39da 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -156,7 +156,11 @@ export function renderTags (view) { } function slugifyWithUTF8 (text) { - let newText = S(text.toLowerCase()).trim().stripTags().dasherize().s + // remove html tags and trim spaces + let newText = S(text).trim().stripTags().s + // replace all spaces in between to dashes + newText = newText.replace(/\s+/g, '-') + // slugify string to make it valid for attribute newText = newText.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, '') return newText } @@ -373,22 +377,19 @@ export function finishView (view) { var $value = $(value) const $ele = $(value).closest('pre') - let mermaidError = null - window.mermaid.parseError = (err, hash) => { - mermaidError = err + window.mermaid.mermaidAPI.parse($value.text()) + $ele.addClass('mermaid') + $ele.html($value.text()) + window.mermaid.init(undefined, $ele) + } catch (err) { + var errormessage = err + if (err.str) { + errormessage = err.str } - if (window.mermaidAPI.parse($value.text())) { - $ele.addClass('mermaid') - $ele.html($value.text()) - window.mermaid.init(undefined, $ele) - } else { - throw new Error(mermaidError) - } - } catch (err) { $value.unwrap() - $value.parent().append('<div class="alert alert-warning">' + err + '</div>') - console.warn(err) + $value.parent().append('<div class="alert alert-warning">' + errormessage + '</div>') + console.warn(errormessage) } }) // abc.js @@ -559,6 +560,15 @@ export function finishView (view) { // only static transform should be here export function postProcess (code) { const result = $(`<div>${code}</div>`) + // process style tags + result.find('style').each((key, value) => { + let html = $(value).html() + // unescape > symbel inside the style tags + html = html.replace(/>/g, '>') + // remove css @import to prevent XSS + html = html.replace(/@import url\(([^)]*)\);?/gi, '') + $(value).html(html) + }) // link should open in new window or tab result.find('a:not([href^="#"]):not([target])').attr('target', '_blank') // update continue line numbers @@ -997,9 +1007,10 @@ md.use(markdownitContainer, 'info', { render: renderContainer }) md.use(markdownitContainer, 'warning', { render: renderContainer }) md.use(markdownitContainer, 'danger', { render: renderContainer }) +let defaultImageRender = md.renderer.rules.image md.renderer.rules.image = function (tokens, idx, options, env, self) { tokens[idx].attrJoin('class', 'raw') - return self.renderToken(...arguments) + return defaultImageRender(...arguments) } md.renderer.rules.list_item_open = function (tokens, idx, options, env, self) { tokens[idx].attrJoin('class', 'raw') @@ -1083,7 +1094,7 @@ const gistPlugin = new Plugin( (match, utils) => { const gistid = match[1] - const code = `<code data-gist-id="${gistid}"/>` + const code = `<code data-gist-id="${gistid}"></code>` return code } ) diff --git a/public/js/index.js b/public/js/index.js index b336af90..5ff716fd 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1633,6 +1633,10 @@ ui.toolbar.view.click(function () { ui.toolbar.both.click(function () { changeMode(modeType.both) }) + +ui.toolbar.night.click(function () { + toggleNightMode() +}) // permission // freely ui.infobar.permission.freely.click(function () { @@ -1666,6 +1670,17 @@ $('.ui-delete-modal-confirm').click(function () { socket.emit('delete') }) +function toggleNightMode () { + var $body = $('body') + var isActive = ui.toolbar.night.hasClass('active') + if (isActive) { + $body.removeClass('night') + appState.nightMode = false + } else { + $body.addClass('night') + appState.nightMode = true + } +} function emitPermission (_permission) { if (_permission !== permission) { socket.emit('permission', _permission) diff --git a/public/js/lib/appState.js b/public/js/lib/appState.js index fb8030e1..87aaf737 100644 --- a/public/js/lib/appState.js +++ b/public/js/lib/appState.js @@ -2,7 +2,8 @@ import modeType from './modeType' let state = { syncscroll: true, - currentMode: modeType.view + currentMode: modeType.view, + nightMode: false } export default state diff --git a/public/js/lib/editor/index.js b/public/js/lib/editor/index.js index 2991998b..003b32b7 100644 --- a/public/js/lib/editor/index.js +++ b/public/js/lib/editor/index.js @@ -74,6 +74,8 @@ export default class Editor { }, 'Cmd-Left': 'goLineLeftSmart', 'Cmd-Right': 'goLineRight', + 'Home': 'goLineLeftSmart', + 'End': 'goLineRight', 'Ctrl-C': function (cm) { if (!isMac && cm.getOption('keyMap').substr(0, 3) === 'vim') { document.execCommand('copy') @@ -169,13 +171,13 @@ export default class Editor { this.statusLength.text('Length ' + docLength) if (docLength > (config.docmaxlength * 0.95)) { this.statusLength.css('color', 'red') - this.statusLength.attr('title', 'Your almost reach note max length limit.') + this.statusLength.attr('title', 'You have almost reached the limit for this document.') } else if (docLength > (config.docmaxlength * 0.8)) { this.statusLength.css('color', 'orange') - this.statusLength.attr('title', 'You nearly fill the note, consider to make more pieces.') + this.statusLength.attr('title', 'This document is nearly full, consider splitting it or creating a new one.') } else { this.statusLength.css('color', 'white') - this.statusLength.attr('title', 'You could write up to ' + config.docmaxlength + ' characters in this note.') + this.statusLength.attr('title', 'You can write up to ' + config.docmaxlength + ' characters in this document.') } } diff --git a/public/js/lib/editor/ui-elements.js b/public/js/lib/editor/ui-elements.js index 0d330d77..88a1e3ca 100644 --- a/public/js/lib/editor/ui-elements.js +++ b/public/js/lib/editor/ui-elements.js @@ -37,6 +37,7 @@ export const getUIElements = () => ({ edit: $('.ui-edit'), view: $('.ui-view'), both: $('.ui-both'), + night: $('.ui-night'), uploadImage: $('.ui-upload-image') }, infobar: { diff --git a/public/js/locale.js b/public/js/locale.js index 2a2c1814..71c0f99f 100644 --- a/public/js/locale.js +++ b/public/js/locale.js @@ -11,6 +11,9 @@ $('.ui-locale option').each(function () { }) if (Cookies.get('locale')) { lang = Cookies.get('locale') + if (lang === 'zh') { + lang = 'zh-TW' + } } else if (supportLangs.indexOf(userLang) !== -1) { lang = supportLangs[supportLangs.indexOf(userLang)] } else if (supportLangs.indexOf(userLangCode) !== -1) { 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 + } +} diff --git a/public/js/render.js b/public/js/render.js index 88a05bde..46489247 100644 --- a/public/js/render.js +++ b/public/js/render.js @@ -18,7 +18,7 @@ whiteList['style'] = [] // allow kbd tag whiteList['kbd'] = [] // allow ifram tag with some safe attributes -whiteList['iframe'] = ['allowfullscreen', 'name', 'referrerpolicy', 'sandbox', 'src', 'srcdoc', 'width', 'height'] +whiteList['iframe'] = ['allowfullscreen', 'name', 'referrerpolicy', 'sandbox', 'src', 'width', 'height'] // allow summary tag whiteList['summary'] = [] @@ -27,7 +27,7 @@ var filterXSSOptions = { whiteList: whiteList, escapeHtml: function (html) { // allow html comment in multiple lines - return html.replace(/<(.*?)>/g, '<$1>') + return html.replace(/<(?!!--)/g, '<').replace(/-->/g, '__HTML_COMMENT_END__').replace(/>/g, '>').replace(/__HTML_COMMENT_END__/g, '-->') }, onIgnoreTag: function (tag, html, options) { // allow comment tag diff --git a/public/js/reveal-markdown.js b/public/js/reveal-markdown.js index 94f6fb91..d15b5ebd 100755..100644 --- a/public/js/reveal-markdown.js +++ b/public/js/reveal-markdown.js @@ -320,7 +320,7 @@ import { md } from './extra' var notes = section.querySelector('aside.notes') var markdown = getMarkdownFromSlide(section) - + markdown = markdown.replace(/</g, '<').replace(/>/g, '>') var rendered = md.render(markdown) rendered = preventXSS(rendered) var result = window.postProcess(rendered) diff --git a/public/js/slide.js b/public/js/slide.js index 293ebfe2..59a352ec 100644 --- a/public/js/slide.js +++ b/public/js/slide.js @@ -4,9 +4,10 @@ require('../css/extra.css') require('../css/site.css') +import { preventXSS } from './render' import { md, updateLastChange, removeDOMEvents, finishView } from './extra' -const body = $('.slides').text() +const body = preventXSS($('.slides').text()) window.createtime = window.lastchangeui.time.attr('data-createtime') window.lastchangetime = window.lastchangeui.time.attr('data-updatetime') diff --git a/public/views/hackmd/body.ejs b/public/views/hackmd/body.ejs index ad1e748b..49604379 100644 --- a/public/views/hackmd/body.ejs +++ b/public/views/hackmd/body.ejs @@ -15,7 +15,7 @@ <a id="permissionLabel" class="ui-permission-label text-uppercase" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> </a> <ul class="dropdown-menu" aria-labelledby="permissionLabel"> - <li class="ui-permission-freely"<% if(!allowAnonymous) { %> style="display: none;"<% } %>><a><i class="fa fa-leaf fa-fw"></i> Freely - Anyone can edit</a></li> + <li class="ui-permission-freely"<% if(!allowAnonymous && !allowAnonymousEdits) { %> style="display: none;"<% } %>><a><i class="fa fa-leaf fa-fw"></i> Freely - Anyone can edit</a></li> <li class="ui-permission-editable"><a><i class="fa fa-shield fa-fw"></i> Editable - Signed-in people can edit</a></li> <li class="ui-permission-limited"><a><i class="fa fa-id-card fa-fw"></i> Limited - Signed-in people can edit (forbid guests)</a></li> <li class="ui-permission-locked"><a><i class="fa fa-lock fa-fw"></i> Locked - Only owner can edit</a></li> @@ -234,8 +234,8 @@ <h4 class="modal-title" id="myModalLabel"><%= __('Are you sure?') %></h4> </div> <div class="modal-body" style="color:black;"> - <h5 class="ui-delete-modal-msg">Do you really want to delete this note?</h5> - <strong class="ui-delete-modal-item">All users will lost their connection.</strong> + <h5 class="ui-delete-modal-msg"><%= __('Do you really want to delete this note?') %></h5> + <strong class="ui-delete-modal-item"><%= __('All users will lose their connection.') %></strong> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('Cancel') %></button> diff --git a/public/views/hackmd/foot.ejs b/public/views/hackmd/foot.ejs index 6a1f3b99..fc971132 100644 --- a/public/views/hackmd/foot.ejs +++ b/public/views/hackmd/foot.ejs @@ -1,6 +1,4 @@ -<script type="text/x-mathjax-config"> - MathJax.Hub.Config({ messageStyle: "none", skipStartupTypeset: true ,tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true }}); -</script> +<script src="<%= url %>/js/mathjax-config-extra.js"></script> <% if(useCDN) { %> <script src="https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.3.2/spin.min.js" integrity="sha256-PieqE0QdEDMppwXrTzSZQr6tWFX3W5KkyRVyF1zN3eg=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> @@ -11,7 +9,7 @@ <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" integrity="sha256-yYfngbEKv4RENfGDvNUqJTqGFcKf31NJEe9OTnnMH3Y=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-immzXfCGLhnx3Zfi9F/dUcqxEM8K3o3oTFy9Bh6HCwg=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment-with-locales.min.js" integrity="sha256-vvT7Ok9u6GbfnBPXnbM6FVDEO8E1kTdgHOFZOAXrktA=" crossorigin="anonymous" defer></script> -<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/7.0.0/mermaid.min.js" integrity="sha256-1uR+pqxH5fN/rOZcZTb9c5+bR3OIYEKzu2sI11Dnj9A=" crossorigin="anonymous" defer></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/7.1.0/mermaid.min.js" integrity="sha256-M3OC0Q6g4/+Q4j73OvnsnA+lMkdAE5KgupRHqTiPbnI=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/js/emojify.min.js" integrity="sha256-VAB5tAlKBvgaxw8oJ1crWMVbdmBVl4mP/2M8MNRl+4E=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.2/lodash.min.js" integrity="sha256-Cv5v4i4SuYvwRYzIONifZjoc99CkwfncROMSWat1cVA=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.2/socket.io.min.js" integrity="sha256-WKvqiY0jZHWQZIohYEmr9KUC5rEaYEOFTq+ByllJK8w=" crossorigin="anonymous" defer></script> diff --git a/public/views/hackmd/header.ejs b/public/views/hackmd/header.ejs index 87d2b065..b87f21fa 100644 --- a/public/views/hackmd/header.ejs +++ b/public/views/hackmd/header.ejs @@ -32,6 +32,7 @@ </li> <li role="presentation"><a role="menuitem" class="ui-extra-slide" tabindex="-1" href="#" target="_blank"><i class="fa fa-tv fa-fw"></i> <%= __('Slide Mode') %></a> </li> + <% if((typeof github !== 'undefined' && github) || (typeof dropbox !== 'undefined' && dropbox) || (typeof google !== 'undefined' && google) || (typeof gitlab !== 'undefined' && gitlab && (!gitlab.scope || gitlab.scope === 'api'))) { %> <li class="divider"></li> <li class="dropdown-header"><%= __('Export') %></li> <li role="presentation"><a role="menuitem" class="ui-save-dropbox" tabindex="-1" href="#" target="_self"><i class="fa fa-dropbox fa-fw"></i> Dropbox</a> @@ -46,6 +47,7 @@ <li role="presentation"><a role="menuitem" class="ui-save-snippet" href="#"><i class="fa fa-gitlab fa-fw"></i> Snippet</a> </li> <% } %> + <% } %> <li class="divider"></li> <li class="dropdown-header"><%= __('Import') %></li> <li role="presentation"><a role="menuitem" class="ui-import-dropbox" tabindex="-1" href="#" target="_self"><i class="fa fa-dropbox fa-fw"></i> Dropbox</a> @@ -68,8 +70,10 @@ </li> <li role="presentation"><a role="menuitem" class="ui-download-raw-html" tabindex="-1" href="#" target="_self"><i class="fa fa-file-code-o fa-fw"></i> <%= __('Raw HTML') %></a> </li> - <li role="presentation"><a role="menuitem" class="ui-download-pdf-beta" tabindex="-1" href="#" target="_self"><i class="fa fa-file-pdf-o fa-fw"></i> PDF (Beta)</a> - </li> + <% if(typeof allowpdfexport !== 'undefined' && allowpdfexport) {%> + <li role="presentation"><a role="menuitem" class="ui-download-pdf-beta" tabindex="-1" href="#" target="_self"><i class="fa fa-file-pdf-o fa-fw"></i> PDF (Beta)</a> + </li> + <% } %> <li class="divider"></li> <li role="presentation"><a role="menuitem" class="ui-help" href="#" data-toggle="modal" data-target=".help-modal"><i class="fa fa-question-circle fa-fw"></i> Help</a> </li> @@ -92,6 +96,11 @@ <input type="radio" name="mode" autocomplete="off"><i class="fa fa-pencil"></i> </label> </div> + <div class="btn-group" data-toggle="buttons"> + <label class="btn ui-night" title="<%= __('Night Theme') %>"> + <input type="checkbox" name="night"><i class="fa fa-moon-o"></i> + </label> + </div> <span class="btn btn-link btn-file ui-help" title="<%= __('Help') %>" data-toggle="modal" data-target=".help-modal"> <i class="fa fa-question-circle"></i> </span> @@ -129,6 +138,7 @@ </li> <li role="presentation"><a role="menuitem" class="ui-extra-slide" tabindex="-1" href="#" target="_blank"><i class="fa fa-tv fa-fw"></i> <%= __('Slide Mode') %></a> </li> + <% if((typeof github !== 'undefined' && github) || (typeof dropbox !== 'undefined' && dropbox) || (typeof google !== 'undefined' && google) || (typeof gitlab !== 'undefined' && gitlab && (!gitlab.scope || gitlab.scope === 'api'))) { %> <li class="divider"></li> <li class="dropdown-header"><%= __('Export') %></li> <li role="presentation"><a role="menuitem" class="ui-save-dropbox" tabindex="-1" href="#" target="_self"><i class="fa fa-dropbox fa-fw"></i> Dropbox</a> @@ -143,6 +153,7 @@ <li role="presentation"><a role="menuitem" class="ui-save-snippet" href="#"><i class="fa fa-gitlab fa-fw"></i> Snippet</a> </li> <% } %> + <% } %> <li class="divider"></li> <li class="dropdown-header"><%= __('Import') %></li> <li role="presentation"><a role="menuitem" class="ui-import-dropbox" tabindex="-1" href="#" target="_self"><i class="fa fa-dropbox fa-fw"></i> Dropbox</a> @@ -165,8 +176,10 @@ </li> <li role="presentation"><a role="menuitem" class="ui-download-raw-html" tabindex="-1" href="#" target="_self"><i class="fa fa-file-code-o fa-fw"></i> <%= __('Raw HTML') %></a> </li> - <li role="presentation"><a role="menuitem" class="ui-download-pdf-beta" tabindex="-1" href="#" target="_self"><i class="fa fa-file-pdf-o fa-fw"></i> PDF (Beta)</a> - </li> + <% if(typeof allowpdfexport !== 'undefined' && allowpdfexport) {%> + <li role="presentation"><a role="menuitem" class="ui-download-pdf-beta" tabindex="-1" href="#" target="_self"><i class="fa fa-file-pdf-o fa-fw"></i> PDF (Beta)</a> + </li> + <% } %> </ul> </li> </ul> diff --git a/public/views/index/body.ejs b/public/views/index/body.ejs index 84300539..82d83f02 100644 --- a/public/views/index/body.ejs +++ b/public/views/index/body.ejs @@ -13,14 +13,14 @@ </li> <div class="ui-signin" style="float: right; margin-top: 8px;<% if(signin) { %> display: none;<% } %>"> <% if(allowAnonymous) { %> - <a type="button" href="<%- url %>/new" class="btn btn-sm btn-link"><i class="fa fa-plus"></i> <%= __('New guest note') %></a> + <a type="button" href="<%- url %>/new" class="btn btn-sm btn-primary"><i class="fa fa-plus"></i> <%= __('New guest note') %></a> <% } %> - <% if(facebook || twitter || github || gitlab || dropbox || google || ldap || email) { %> + <% if(facebook || twitter || github || gitlab || mattermost || dropbox || google || ldap || saml || email) { %> <button class="btn btn-sm btn-success ui-signin" data-toggle="modal" data-target=".signin-modal"><%= __('Sign In') %></button> <% } %> </div> <div class="ui-signout" style="float: right; margin-top: 8px;<% if(!signin) { %> display: none;<% } %>"> - <a type="button" href="<%- url %>/new" class="btn btn-sm btn-link"><i class="fa fa-plus"></i> <%= __('New note') %></a> + <a type="button" href="<%- url %>/new" class="btn btn-sm btn-primary"><i class="fa fa-plus"></i> <%= __('New note') %></a> <span class="ui-profile dropdown pull-right"> <button id="profileLabel" class="btn btn-sm btn-link ui-profile-label" style="padding-right: 0;" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <img class="ui-avatar" width="20" height="20"><span class="hidden-xs hidden-sm"> <span class="ui-name"></span></span> <i class="fa fa-caret-down"></i> @@ -39,6 +39,7 @@ <div id="home" class="section"<% if(signin) { %> style="display:none;"<% } %>> <div class="inner cover"> <h1 class="cover-heading"><i class="fa fa-file-text"></i> HackMD</h1> + <p class="lead"><strong>Community Edition</strong></p> <p class="lead"> <%= __('Best way to write and share your knowledge in markdown.') %> </p> @@ -48,7 +49,7 @@ <% if (errorMessage && errorMessage.length > 0) { %> <div class="alert alert-danger" style="max-width: 400px; margin: 0 auto;"><%= errorMessage %></div> <% } %> - <% if(facebook || twitter || github || gitlab || dropbox || google || ldap || email) { %> + <% if(facebook || twitter || github || gitlab || mattermost || dropbox || google || ldap || saml || email) { %> <span class="ui-signin"> <br> <a type="button" class="btn btn-lg btn-success ui-signin" data-toggle="modal" data-target=".signin-modal" style="min-width: 200px;"><%= __('Sign In') %></a> @@ -126,11 +127,12 @@ <iframe src="//ghbtns.com/github-btn.html?user=hackmdio&repo=hackmd&type=star&count=true" frameborder="0" scrolling="0" width="104px" height="20px"></iframe> </h6> <p> - © 2017 <a href="https://www.facebook.com/hackmdio" target="_blank"><i class="fa fa-facebook-square"></i> HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a> + © 2018 <a href="https://www.facebook.com/hackmdio" target="_blank"><i class="fa fa-facebook-square"></i> HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a> </p> <select class="ui-locale"> <option value="en">English</option> - <option value="zh">中文</option> + <option value="zh-CN">简体中文</option> + <option value="zh-TW">繁體中文</option> <option value="fr">Français</option> <option value="de">Deutsch</option> <option value="ja">日本語</option> @@ -175,4 +177,4 @@ </div> </div> </div> -<%- include ../shared/signin-modal %>
\ No newline at end of file +<%- include ../shared/signin-modal %> diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs index 80d2505c..91d9c36c 100644 --- a/public/views/pretty.ejs +++ b/public/views/pretty.ejs @@ -72,9 +72,7 @@ </body> </html> -<script type="text/x-mathjax-config"> - MathJax.Hub.Config({ messageStyle: "none", skipStartupTypeset: true ,tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true }}); -</script> +<script src="<%= url %>/js/mathjax-config-extra.js"></script> <% if(useCDN) { %> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/velocity/1.4.0/velocity.min.js" integrity="sha256-bhm0lgEt6ITaZCDzZpkr/VXVrLa5RP4u9v2AYsbzSUk=" crossorigin="anonymous" defer></script> @@ -84,7 +82,7 @@ <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" integrity="sha256-yYfngbEKv4RENfGDvNUqJTqGFcKf31NJEe9OTnnMH3Y=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-immzXfCGLhnx3Zfi9F/dUcqxEM8K3o3oTFy9Bh6HCwg=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment-with-locales.min.js" integrity="sha256-vvT7Ok9u6GbfnBPXnbM6FVDEO8E1kTdgHOFZOAXrktA=" crossorigin="anonymous" defer></script> -<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/7.0.0/mermaid.min.js" integrity="sha256-1uR+pqxH5fN/rOZcZTb9c5+bR3OIYEKzu2sI11Dnj9A=" crossorigin="anonymous" defer></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/7.1.0/mermaid.min.js" integrity="sha256-M3OC0Q6g4/+Q4j73OvnsnA+lMkdAE5KgupRHqTiPbnI=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/js/emojify.min.js" integrity="sha256-VAB5tAlKBvgaxw8oJ1crWMVbdmBVl4mP/2M8MNRl+4E=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.6/handlebars.min.js" integrity="sha256-1O3BtOwnPyyRzOszK6P+gqaRoXHV6JXj8HkjZmPYhCI=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js" integrity="sha256-KbfTjB0WZ8vvXngdpJGY3Yp3xKk+tttbqClO11anCIU=" crossorigin="anonymous" defer></script> diff --git a/public/views/shared/help-modal.ejs b/public/views/shared/help-modal.ejs index b1ea681d..f5dc55c2 100644 --- a/public/views/shared/help-modal.ejs +++ b/public/views/shared/help-modal.ejs @@ -15,9 +15,9 @@ <h3 class="panel-title"><%= __('Contacts') %></h3> </div> <div class="panel-body"> - <a href="https://github.com/hackmdio/hackmd/issues" target="_blank"><i class="fa fa-tag fa-fw"></i> <%= __('Report an issue') %></a> + <a href="https://github.com/hackmdio/hackmd/issues" target="_blank"><i class="fa fa-tag fa-fw"></i> <%= __('Report an issue') %></a> <br> - <a href="mailto:hackmdio@gmail.com"><i class="fa fa-envelope fa-fw"></i> <%= __('Send us email') %></a> + <a href="https://gitter.im/hackmdio/hackmd" target="_blank"><i class="fa fa-comments fa-fw"></i> <%= __('Meet us on Gitter') %></a> </div> </div> <div class="panel panel-default"> @@ -144,4 +144,4 @@ letter-spacing: 0.025em; line-height: 1.25; } -</style>
\ No newline at end of file +</style> diff --git a/public/views/shared/signin-modal.ejs b/public/views/shared/signin-modal.ejs index a8af62e7..7b44cfb0 100644 --- a/public/views/shared/signin-modal.ejs +++ b/public/views/shared/signin-modal.ejs @@ -28,6 +28,11 @@ <i class="fa fa-gitlab"></i> <%= __('Sign in via %s', 'GitLab') %> </a> <% } %> + <% if(mattermost) { %> + <a href="<%- url %>/auth/mattermost" class="btn btn-lg btn-block btn-social btn-soundcloud"> + <i class="fa fa-mattermost"></i> <%= __('Sign in via %s', 'Mattermost') %> + </a> + <% } %> <% if(dropbox) { %> <a href="<%- url %>/auth/dropbox" class="btn btn-lg btn-block btn-social btn-dropbox"> <i class="fa fa-dropbox"></i> <%= __('Sign in via %s', 'Dropbox') %> @@ -38,7 +43,12 @@ <i class="fa fa-google"></i> <%= __('Sign in via %s', 'Google') %> </a> <% } %> - <% if((facebook || twitter || github || gitlab || dropbox || google) && ldap) { %> + <% if(saml) { %> + <a href="<%- url %>/auth/saml" class="btn btn-lg btn-block btn-social btn-success"> + <i class="fa fa-users"></i> <%= __('Sign in via %s', 'SAML') %> + </a> + <% } %> + <% if((facebook || twitter || github || gitlab || mattermost || dropbox || google || saml) && ldap) { %> <hr> <% }%> <% if(ldap) { %> @@ -63,7 +73,7 @@ </div> </form> <% } %> - <% if((facebook || twitter || github || gitlab || dropbox || google || ldap) && email) { %> + <% if((facebook || twitter || github || gitlab || mattermost || dropbox || google || ldap) && email) { %> <hr> <% }%> <% if(email) { %> diff --git a/public/views/slide.ejs b/public/views/slide.ejs index 7ff5016e..942add4f 100644 --- a/public/views/slide.ejs +++ b/public/views/slide.ejs @@ -41,7 +41,7 @@ <link rel="stylesheet" href="<%- url %>/css/slide.css"> <!-- Printing and PDF exports --> - <script> + <script nonce="<%= cspNonce %>"> var link = document.createElement( 'link' ); link.rel = 'stylesheet'; link.type = 'text/css'; @@ -54,19 +54,19 @@ <body> <div class="container"> <div class="reveal"> - <div class="slides" style="display: none;"><%= body %></div> + <div class="slides"><%= body %></div> </div> - <div id="meta" style="display: none;"><%= meta %></div> + <div id="meta"><%= meta %></div> <div class="footer"> - <div class="unselectable hidden-print" style="color: #777;"> + <div class="unselectable hidden-print gray-font"> <small> <span> <% if(lastchangeuserprofile) { %> <span class="ui-lastchangeuser"> <i class="ui-user-icon small" style="background-image: url(<%- lastchangeuserprofile.photo %>);" data-toggle="tooltip" data-placement="right" title="<%- lastchangeuserprofile.name %>"></i></span> <% } else { %> - <span class="ui-no-lastchangeuser"> <i class="fa fa-clock-o fa-fw" style="width: 18px;"></i></span> + <span class="ui-no-lastchangeuser"> <i class="fa fa-clock-o fa-fw"></i></span> <% } %> <span class="text-uppercase ui-status-lastchange"></span> <span class="ui-lastchange text-uppercase" data-createtime="<%- createtime %>" data-updatetime="<%- updatetime %>"></span> @@ -82,16 +82,14 @@ </small> </div> <% if(typeof disqus !== 'undefined' && disqus) { %> - <div style="margin-top: 25px; margin-bottom: 15px;"> + <div class="slides-disqus"> <%- include shared/disqus %> </div> <% } %> </div> </div> - <script type="text/x-mathjax-config"> - MathJax.Hub.Config({ messageStyle: "none", skipStartupTypeset: true ,tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true }}); - </script> + <script src="<%= url %>/js/mathjax-config-extra.js"></script> <% if(useCDN) { %> <script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.3.0/lib/js/head.min.js" integrity="sha256-+09kLhwACKXFPDvqo4xMMvi4+uXFsRZ2uYGbeN1U8sI=" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.3.0/js/reveal.min.js" integrity="sha256-lvaInSKflJWLPqf5N5oHr/UZFwXKD6gckerdwoHqECY=" crossorigin="anonymous"></script> @@ -102,7 +100,7 @@ <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" integrity="sha256-yYfngbEKv4RENfGDvNUqJTqGFcKf31NJEe9OTnnMH3Y=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-immzXfCGLhnx3Zfi9F/dUcqxEM8K3o3oTFy9Bh6HCwg=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment-with-locales.min.js" integrity="sha256-vvT7Ok9u6GbfnBPXnbM6FVDEO8E1kTdgHOFZOAXrktA=" crossorigin="anonymous" defer></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/7.0.0/mermaid.min.js" integrity="sha256-1uR+pqxH5fN/rOZcZTb9c5+bR3OIYEKzu2sI11Dnj9A=" crossorigin="anonymous" defer></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/7.1.0/mermaid.min.js" integrity="sha256-M3OC0Q6g4/+Q4j73OvnsnA+lMkdAE5KgupRHqTiPbnI=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/js/emojify.min.js" integrity="sha256-VAB5tAlKBvgaxw8oJ1crWMVbdmBVl4mP/2M8MNRl+4E=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.6/handlebars.min.js" integrity="sha256-1O3BtOwnPyyRzOszK6P+gqaRoXHV6JXj8HkjZmPYhCI=" crossorigin="anonymous" defer></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js" integrity="sha256-KbfTjB0WZ8vvXngdpJGY3Yp3xKk+tttbqClO11anCIU=" crossorigin="anonymous" defer></script> |