diff options
Diffstat (limited to 'public')
-rw-r--r-- | public/css/slide.css | 19 | ||||
-rw-r--r-- | public/docs/features.md | 15 | ||||
-rw-r--r-- | public/js/extra.js | 25 | ||||
-rw-r--r-- | public/js/locale.js | 3 | ||||
-rw-r--r-- | public/js/render.js | 2 | ||||
-rw-r--r-- | public/views/hackmd/body.ejs | 4 | ||||
-rw-r--r-- | public/views/hackmd/foot.ejs | 2 | ||||
-rw-r--r-- | public/views/hackmd/header.ejs | 16 | ||||
-rw-r--r-- | public/views/index/body.ejs | 7 | ||||
-rw-r--r-- | public/views/pretty.ejs | 2 | ||||
-rw-r--r-- | public/views/shared/signin-modal.ejs | 14 | ||||
-rw-r--r-- | public/views/slide.ejs | 12 |
12 files changed, 80 insertions, 41 deletions
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..a894c087 100644 --- a/public/docs/features.md +++ b/public/docs/features.md @@ -47,12 +47,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.** diff --git a/public/js/extra.js b/public/js/extra.js index a1a9dbb6..13b8924c 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -373,22 +373,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 +1089,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/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/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..80df2c77 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> @@ -129,6 +133,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 +148,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 +171,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"> <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,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> |