summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/css/extra.css31
-rw-r--r--public/css/github-extract.css41
-rw-r--r--public/css/index.css74
-rw-r--r--public/css/markdown.css38
-rw-r--r--public/css/slide.css19
-rw-r--r--[-rwxr-xr-x]public/docs/release-notes.md0
-rw-r--r--public/js/extra.js31
-rw-r--r--public/js/index.js15
-rw-r--r--public/js/lib/appState.js3
-rw-r--r--public/js/lib/editor/index.js6
-rw-r--r--public/js/lib/editor/ui-elements.js1
-rw-r--r--public/js/locale.js3
-rw-r--r--public/js/render.js2
-rw-r--r--[-rwxr-xr-x]public/js/reveal-markdown.js0
-rw-r--r--public/views/hackmd/body.ejs4
-rw-r--r--public/views/hackmd/foot.ejs2
-rw-r--r--public/views/hackmd/header.ejs21
-rw-r--r--public/views/index/body.ejs7
-rw-r--r--public/views/pretty.ejs2
-rw-r--r--public/views/shared/signin-modal.ejs14
-rw-r--r--public/views/slide.ejs12
21 files changed, 276 insertions, 50 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/release-notes.md b/public/docs/release-notes.md
index 2e0a71c6..2e0a71c6 100755..100644
--- a/public/docs/release-notes.md
+++ b/public/docs/release-notes.md
diff --git a/public/js/extra.js b/public/js/extra.js
index a1a9dbb6..75aa29af 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
@@ -1092,7 +1093,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 33c1e0d4..003b32b7 100644
--- a/public/js/lib/editor/index.js
+++ b/public/js/lib/editor/index.js
@@ -171,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/render.js b/public/js/render.js
index e2574b5f..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'] = []
diff --git a/public/js/reveal-markdown.js b/public/js/reveal-markdown.js
index d15b5ebd..d15b5ebd 100755..100644
--- a/public/js/reveal-markdown.js
+++ b/public/js/reveal-markdown.js
diff --git a/public/views/hackmd/body.ejs b/public/views/hackmd/body.ejs
index ad1e748b..91343ef6 100644
--- a/public/views/hackmd/body.ejs
+++ b/public/views/hackmd/body.ejs
@@ -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..16ef5737 100644
--- a/public/views/hackmd/foot.ejs
+++ b/public/views/hackmd/foot.ejs
@@ -11,7 +11,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 911742ac..d7b4458e 100644
--- a/public/views/index/body.ejs
+++ b/public/views/index/body.ejs
@@ -15,7 +15,7 @@
<% if(allowAnonymous) { %>
<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>
@@ -48,7 +48,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>
@@ -130,7 +130,8 @@
</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>
diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs
index 80d2505c..db72fdc4 100644
--- a/public/views/pretty.ejs
+++ b/public/views/pretty.ejs
@@ -84,7 +84,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/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..3572476f 100644
--- a/public/views/slide.ejs
+++ b/public/views/slide.ejs
@@ -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">&thinsp;<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">&thinsp;<i class="fa fa-clock-o fa-fw" style="width: 18px;"></i></span>
+ <span class="ui-no-lastchangeuser">&thinsp;<i class="fa fa-clock-o fa-fw"></i></span>
<% } %>
&nbsp;<span class="text-uppercase ui-status-lastchange"></span>
<span class="ui-lastchange text-uppercase" data-createtime="<%- createtime %>" data-updatetime="<%- updatetime %>"></span>
@@ -82,7 +82,7 @@
</small>
</div>
<% if(typeof disqus !== 'undefined' && disqus) { %>
- <div style="margin-top: 25px; margin-bottom: 15px;">
+ <div class="slides-disqus">
<%- include shared/disqus %>
</div>
<% } %>
@@ -102,7 +102,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>