diff options
Diffstat (limited to 'public')
27 files changed, 300 insertions, 155 deletions
diff --git a/public/.eslintrc.js b/public/.eslintrc.js new file mode 100644 index 00000000..dc37b3cb --- /dev/null +++ b/public/.eslintrc.js @@ -0,0 +1,28 @@ +// this config file is used in concert with the root .eslintrc.js in the root dir. +module.exports = { + "env": { + "browser": true + }, + "globals": { + "$": false, + "CodeMirror": false, + "Cookies": false, + "moment": false, + "editor": false, + "ui": false, + "Spinner": false, + "modeType": false, + "Idle": false, + "serverurl": false, + "key": false, + "gapi": false, + "Dropbox": false, + "FilePicker": false, + "ot": false, + "MediaUploader": false, + "hex2rgb": false, + "num_loaded": false, + "Visibility": false, + "inlineAttachment": false + } +}; diff --git a/public/css/github-extract.css b/public/css/github-extract.css index 7f7058a0..f7b15445 100644 --- a/public/css/github-extract.css +++ b/public/css/github-extract.css @@ -119,23 +119,24 @@ color: #ddd; } -.markdown-body h1 .octicon-link, -.markdown-body h2 .octicon-link, -.markdown-body h3 .octicon-link, -.markdown-body h4 .octicon-link, -.markdown-body h5 .octicon-link, -.markdown-body h6 .octicon-link { +.markdown-body h1 .fa-link, +.markdown-body h2 .fa-link, +.markdown-body h3 .fa-link, +.markdown-body h4 .fa-link, +.markdown-body h5 .fa-link, +.markdown-body h6 .fa-link { color: #000; vertical-align: middle; visibility: hidden; + font-size: 16px; } -.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 { +.night .markdown-body h1 .fa-link, +.night .markdown-body h2 .fa-link, +.night .markdown-body h3 .fa-link, +.night .markdown-body h4 .fa-link, +.night .markdown-body h5 .fa-link, +.night .markdown-body h6 .fa-link { color: #fff; } @@ -148,12 +149,12 @@ text-decoration: none; } -.markdown-body h1:hover .anchor .octicon-link, -.markdown-body h2:hover .anchor .octicon-link, -.markdown-body h3:hover .anchor .octicon-link, -.markdown-body h4:hover .anchor .octicon-link, -.markdown-body h5:hover .anchor .octicon-link, -.markdown-body h6:hover .anchor .octicon-link { +.markdown-body h1:hover .anchor .fa-link, +.markdown-body h2:hover .anchor .fa-link, +.markdown-body h3:hover .anchor .fa-link, +.markdown-body h4:hover .anchor .fa-link, +.markdown-body h5:hover .anchor .fa-link, +.markdown-body h6:hover .anchor .fa-link { visibility: visible; } diff --git a/public/docs/features.md b/public/docs/features.md index f684ca62..a4ffb633 100644 --- a/public/docs/features.md +++ b/public/docs/features.md @@ -8,7 +8,7 @@ This means that you can write notes with other people on your **desktop**, **tab You can sign-in via multiple auth providers like **Facebook**, **Twitter**, **GitHub** and many more on the [_homepage_](/). If you experience any _issues_, feel free to report it on [**GitHub**](https://github.com/hackmdio/codimd/issues). -Or meet us on [**Matrix.org**](https://riot.im/app/#/room/#codimd:matrix.org) or [**Gitter**](https://gitter.im/hackmdio/hackmd) for dev-talk and interactive help. +Or meet us on [**Matrix.org**](https://riot.im/app/#/room/#codimd:matrix.org) for dev-talk and interactive help. **Thank you very much!** Workspace @@ -72,9 +72,11 @@ Notes can be embedded as follows: ## [Slide Mode](./slide-example): You can use a special syntax to organize your note into slides. -After that, you can use the **Slide Mode** <i class="fa fa-tv"></i> to make a presentation. +After that, you can use the **[Slide Mode](./slide-example)** <i class="fa fa-tv"></i> to make a presentation. Visit the above link for details. +To switch the editor into slide mode, set the [document type](./yaml-metadata#type) to `slide`. + View === ## Table of Contents: @@ -88,9 +90,23 @@ You can hover and click <i class="fa fa-chain"></i> to anchor on it. Edit: === +## Editor Modes: +You can look in the bottom right section of the editor area, there you'll find a button with `sublime` on it. +When you click it, you can select 3 editor modes: + +- sublime (default) +- emacs +- vim + ## Shortcut Keys: -Just like Sublime text, which is pretty quick and convenient. -> For more infomation, see [here](https://codemirror.net/demo/sublime.html). +The shortcut keys depend on your selected editor mode. By default they are just like Sublime text, which is pretty quick and convenient. +> For more information, see [here](https://codemirror.net/demo/sublime.html). + +For emacs: +> For more information, see [here](https://codemirror.net/demo/emacs.html). + +For vim: +> For more information, see [here](https://codemirror.net/demo/vim.html). ## Auto-Complete: This editor provides full auto-complete hints in markdown. @@ -195,7 +211,7 @@ When you’re a carpenter making a beautiful chest of drawers, you’re not goin ## Externals ### YouTube -{%youtube 1G4isv_Fylg %} +{%youtube aqz-KE-bpKQ %} ### Vimeo {%vimeo 124148255 %} diff --git a/public/docs/release-notes.md b/public/docs/release-notes.md index 66202009..c775b70a 100644 --- a/public/docs/release-notes.md +++ b/public/docs/release-notes.md @@ -1,6 +1,55 @@ Release Notes === +<i class="fa fa-tag"></i> 1.2.1 <i class="fa fa-clock-o"></i> 2018-09-26 00:00 +--- + +### Enhancements +* Update Italian translations +* Update Japanese translations +* Update markdown-pdf +* Add support for unix sockets +* Update "follow us" information to Community channel and translation +* Add Cloudron installation method +* Add guide for Mattermost authentication +* Update various packages +* Add Indonesian language as new translation + +### Fixes +* Fix content types in status router +* Fix some modal colors in night mode +* Fix CSP to allow usage of speaker notes +* Fix some wrong title attributes in the editor toolbar +* Fix some confusion about the default location of images. It's always the local filesystem now +* Fix object handling in avatar generation code +* Finally fix error handling of LZ-String by using self-maintained version +* Fix migration handling +* Fix gitlab API version +* Fix some server crashes caused by PDF creation +* Fix document length limit on post to `/new` +* Fix broken youtube embedding on `/features` page + +### Refactors +* Refactor generation of table of contents +* Refactor "copyright"-section to be a "Powered by" + +### Removes +* Remove unneeded inline styling + +### Deprecations +* NodeJS version 6 +* Mattermost login integration (is replaced by [generic oAuth2 module](https://github.com/hackmdio/codimd/blob/6ce7b20a7f92ccff2f7f870ff5d116d685310cfd/docs/guides/auth/mattermost-self-hosted.md)) + +### Honorable mentions +* [Alex Hesse (Pingu501)](https://github.com/Pingu501) +* [Alexander Wellbrock (w4tsn)](https://github.com/w4tsn) +* [Cédric Couralet (micedre)](https://github.com/micedre) +* [Girish Ramakrishnan (gramakri)](https://github.com/gramakri) +* [maahl](https://github.com/maahl) +* [Max Wu (jackycute)](https://github.com/jackycute) +* [Miranda (ahihi)](https://github.com/ahihi) +* [Ondřej Slabý (maxer456)](https://github.com/maxer456) + <i class="fa fa-tag"></i> 1.2.0 <i class="fa fa-clock-o"></i> 2018-06-28 00:00 --- diff --git a/public/docs/slide-example.md b/public/docs/slide-example.md index 411f31d4..49503669 100644 --- a/public/docs/slide-example.md +++ b/public/docs/slide-example.md @@ -1,4 +1,5 @@ --- +type: slide slideOptions: transition: slide --- @@ -270,7 +271,7 @@ Press `B` or `.` on your keyboard to pause the presentation. This is helpful whe Down below you can find a print icon<i class="fa fa-fw fa-print"></i>. -After you click on it, use the print function of your browser (either CTRL+P or cmd+P) to print the slides as PDF. +After you click on it, use the print function of your browser (either CTRL+P or cmd+P) to print the slides as PDF. [See official reveal.js instructions for details](https://github.com/hakimel/reveal.js#instructions-1) --- diff --git a/public/docs/yaml-metadata.md b/public/docs/yaml-metadata.md index 888345f7..839616a8 100644 --- a/public/docs/yaml-metadata.md +++ b/public/docs/yaml-metadata.md @@ -25,7 +25,7 @@ This option will set the note title which prior than content title. > default: not set **Example** -```xml +```yml title: meta title ``` @@ -36,7 +36,7 @@ This option will set the note description. > default: not set **Example** -```xml +```yml description: meta description ``` @@ -47,7 +47,7 @@ This option will set the tags which prior than content tags. > default: not set **Example** -```xml +```yml tags: features, cool, updated ``` @@ -62,7 +62,7 @@ So you can prevent any search engine index your note by set `noindex, nofollow`. > default: not set **Example** -```xml +```yml robots: noindex, nofollow ``` @@ -75,13 +75,13 @@ https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes > default: not set (which will be en) **Example** -```xml +```yml langs: ja-jp ``` dir --- -This option provide to describe the direction of the text in this note. +This option specifies the direction of the text in this note. You can only use whether `rtl` or `ltr`. Look more at here: http://www.w3.org/International/questions/qa-html-dir @@ -89,7 +89,7 @@ http://www.w3.org/International/questions/qa-html-dir > default: not set (which will be ltr) **Example** -```xml +```yml dir: rtl ``` @@ -102,35 +102,46 @@ You can only use whether `true` or `false`. > default: not set (which will be true) **Example** -```xml +```yml breaks: false ``` GA --- -This option allow you to enable Google Analytics with your ID. +This option allows you to enable Google Analytics with your ID. > default: not set (which won't enable) **Example** -```xml +```yml GA: UA-12345667-8 ``` disqus --- -This option allow you to enable Disqus with your shortname. +This option allows you to enable Disqus with your shortname. > default: not set (which won't enable) **Example** -```xml +```yml disqus: codimd ``` +type +--- +This option allows you to switch the document view to the slide preview, to simplify live editing of presentations. + +> default: not set + +**Example:** +```yml +type: slide +``` + slideOptions --- -This option allow you provide custom options to slide mode. +This option allows you to provide custom options to slide mode. Please below document for more details: https://github.com/hakimel/reveal.js/#configuration @@ -142,7 +153,7 @@ https://github.com/hakimel/reveal.js/tree/master/css/theme > default: not set (which use default slide options) **Example** -```xml +```yml slideOptions: transition: fade theme: white diff --git a/public/js/extra.js b/public/js/extra.js index d6bbb0c6..ed1470be 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -570,7 +570,9 @@ export function postProcess (code) { $(value).html(html) }) // link should open in new window or tab - result.find('a:not([href^="#"]):not([target])').attr('target', '_blank') + // also add noopener to prevent clickjacking + // See details: https://mathiasbynens.github.io/rel-noopener/ + result.find('a:not([href^="#"]):not([target])').attr('target', '_blank').attr('rel', 'noopener') // update continue line numbers const linenumberdivs = result.find('.gutter.linenumber').toArray() for (let i = 0; i < linenumberdivs.length; i++) { @@ -832,7 +834,7 @@ const anchorForId = id => { const anchor = document.createElement('a') anchor.className = 'anchor hidden-xs' anchor.href = `#${id}` - anchor.innerHTML = '<span class="octicon octicon-link"></span>' + anchor.innerHTML = '<i class="fa fa-link"></i>' anchor.title = id return anchor } @@ -1143,6 +1145,19 @@ const pdfPlugin = new Plugin( } ) +const emojijsPlugin = new Plugin( + // regexp to match emoji shortcodes :something: + // We generate an universal regex that guaranteed only contains the + // emojies we have available. This should prevent all false-positives + new RegExp(':(' + window.emojify.emojiNames.map((item) => { return RegExp.escape(item) }).join('|') + '):', 'i'), + + (match, utils) => { + const emoji = match[1].toLowerCase() + const div = $(`<img class="emoji" src="${serverurl}/build/emojify.js/dist/images/basic/${emoji}.png"></img>`) + return div[0].outerHTML + } +) + // yaml meta, from https://github.com/eugeneware/remarkable-meta function get (state, line) { const pos = state.bMarks[line] @@ -1187,6 +1202,7 @@ function metaPlugin (md) { } md.use(metaPlugin) +md.use(emojijsPlugin) md.use(youtubePlugin) md.use(vimeoPlugin) md.use(gistPlugin) diff --git a/public/js/history.js b/public/js/history.js index b4c26b42..6007bef4 100644 --- a/public/js/history.js +++ b/public/js/history.js @@ -218,6 +218,7 @@ export function getStorageHistory (callback) { if (typeof data === 'string') { data = JSON.parse(data) } callback(data) } + // eslint-disable-next-line standard/no-callback-literal callback([]) } diff --git a/public/js/index.js b/public/js/index.js index 1330deac..0c575961 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -17,6 +17,7 @@ import toMarkdown from 'to-markdown' import { saveAs } from 'file-saver' import randomColor from 'randomcolor' import store from 'store' +import hljs from 'highlight.js' import _ from 'lodash' @@ -92,7 +93,7 @@ var cursorMenuThrottle = 50 var cursorActivityDebounce = 50 var cursorAnimatePeriod = 100 var supportContainers = ['success', 'info', 'warning', 'danger'] -var supportCodeModes = ['javascript', 'typescript', 'jsx', 'htmlmixed', 'htmlembedded', 'css', 'xml', 'clike', 'clojure', 'ruby', 'python', 'shell', 'php', 'sql', 'haskell', 'coffeescript', 'yaml', 'pug', 'lua', 'cmake', 'nginx', 'perl', 'sass', 'r', 'dockerfile', 'tiddlywiki', 'mediawiki', 'go', 'gherkin'] +var supportCodeModes = ['javascript', 'typescript', 'jsx', 'htmlmixed', 'htmlembedded', 'css', 'xml', 'clike', 'clojure', 'ruby', 'python', 'shell', 'php', 'sql', 'haskell', 'coffeescript', 'yaml', 'pug', 'lua', 'cmake', 'nginx', 'perl', 'sass', 'r', 'dockerfile', 'tiddlywiki', 'mediawiki', 'go', 'gherkin'].concat(hljs.listLanguages()) var supportCharts = ['sequence', 'flow', 'graphviz', 'mermaid', 'abc'] var supportHeaders = [ { @@ -1479,7 +1480,7 @@ $('#snippetExportModalConfirm').click(function () { file_name: $('#snippetExportModalFileName').val(), code: editor.getValue(), visibility_level: $('#snippetExportModalVisibility').val(), - visibility: $('#snippetExportModalVisibility').val() === 0 ? 'private' : ($('#snippetExportModalVisibility').val() === 10 ? 'internal' : '') + visibility: $('#snippetExportModalVisibility').val() === '0' ? 'private' : ($('#snippetExportModalVisibility').val() === '10' ? 'internal' : 'private') } if (!data.title || !data.file_name || !data.code || !data.visibility_level || !$('#snippetExportModalProjects').val()) return @@ -2510,7 +2511,9 @@ function buildCursor (user) { // editor actions function removeNullByte (cm, change) { var str = change.text.join('\n') + // eslint-disable-next-line no-control-regex if (/\u0000/g.test(str) && change.update) { + // eslint-disable-next-line no-control-regex change.update(change.from, change.to, str.replace(/\u0000/g, '').split('\n')) } } @@ -3045,7 +3048,7 @@ function checkInCode () { function checkAbove (method) { var cursor = editor.getCursor() var text = [] - for (var i = 0; i < cursor.line; i++) { // contain current line + for (var i = 0; i < cursor.line; i++) { // contain current line text.push(editor.getLine(i)) } text = text.join('\n') + '\n' + editor.getLine(cursor.line).slice(0, cursor.ch) diff --git a/public/js/lib/editor/index.js b/public/js/lib/editor/index.js index 0537e927..f05d01b8 100644 --- a/public/js/lib/editor/index.js +++ b/public/js/lib/editor/index.js @@ -492,7 +492,7 @@ export default class Editor { clearInterval(spellcheckTimer) } }, - 100, + 100 ) } } @@ -514,7 +514,7 @@ export default class Editor { } setOverrideBrowserKeymap () { var overrideBrowserKeymap = $( - '.ui-preferences-override-browser-keymap label > input[type="checkbox"]', + '.ui-preferences-override-browser-keymap label > input[type="checkbox"]' ) if (overrideBrowserKeymap.is(':checked')) { Cookies.set('preferences-override-browser-keymap', true, { @@ -529,10 +529,10 @@ export default class Editor { setPreferences () { var overrideBrowserKeymap = $( - '.ui-preferences-override-browser-keymap label > input[type="checkbox"]', + '.ui-preferences-override-browser-keymap label > input[type="checkbox"]' ) var cookieOverrideBrowserKeymap = Cookies.get( - 'preferences-override-browser-keymap', + 'preferences-override-browser-keymap' ) if (cookieOverrideBrowserKeymap && cookieOverrideBrowserKeymap === 'true') { overrideBrowserKeymap.prop('checked', true) diff --git a/public/js/lib/editor/ui-elements.js b/public/js/lib/editor/ui-elements.js index ca06d30c..29a37782 100644 --- a/public/js/lib/editor/ui-elements.js +++ b/public/js/lib/editor/ui-elements.js @@ -67,7 +67,7 @@ export const getUIElements = () => ({ codemirrorScroll: $('.ui-edit-area .CodeMirror .CodeMirror-scroll'), codemirrorSizer: $('.ui-edit-area .CodeMirror .CodeMirror-sizer'), codemirrorSizerInner: $( - '.ui-edit-area .CodeMirror .CodeMirror-sizer > div', + '.ui-edit-area .CodeMirror .CodeMirror-sizer > div' ), markdown: $('.ui-view-area .markdown-body'), resize: { diff --git a/public/js/render.js b/public/js/render.js index 23b8934e..ff5e2bf2 100644 --- a/public/js/render.js +++ b/public/js/render.js @@ -1,6 +1,8 @@ /* eslint-env browser, jquery */ -/* global filterXSS */ // allow some attributes + +var filterXSS = require('xss') + var whiteListAttr = ['id', 'class', 'style'] window.whiteListAttr = whiteListAttr // allow link starts with '.', '/' and custom protocol with '://', exclude link starts with javascript:// @@ -71,5 +73,6 @@ function preventXSS (html) { window.preventXSS = preventXSS module.exports = { - preventXSS: preventXSS + preventXSS: preventXSS, + escapeAttrValue: filterXSS.escapeAttrValue } diff --git a/public/js/reveal-markdown.js b/public/js/reveal-markdown.js index d15b5ebd..ad5bfd04 100644 --- a/public/js/reveal-markdown.js +++ b/public/js/reveal-markdown.js @@ -1,6 +1,6 @@ /* eslint-env browser, jquery */ -import { preventXSS } from './render' +import { preventXSS, escapeAttrValue } from './render' import { md } from './extra' /** @@ -259,7 +259,7 @@ import { md } from './extra' while ((matchesClass = mardownClassRegex.exec(classes))) { var name = matchesClass[1] var value = matchesClass[2] - if (name.substr(0, 5) === 'data-' || window.whiteListAttr.indexOf(name) !== -1) { elementTarget.setAttribute(name, window.filterXSS.escapeAttrValue(value)) } + if (name.substr(0, 5) === 'data-' || window.whiteListAttr.indexOf(name) !== -1) { elementTarget.setAttribute(name, escapeAttrValue(value)) } } return true } diff --git a/public/views/codimd/body.ejs b/public/views/codimd/body.ejs index d4f27a93..dc111909 100644 --- a/public/views/codimd/body.ejs +++ b/public/views/codimd/body.ejs @@ -113,7 +113,7 @@ </div> <div class="modal-body" style="color:black;"> <h5></h5> - <a target="_blank" style="word-break: break-all;"></a> + <a target="_blank" rel="noopener" style="word-break: break-all;"></a> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('OK') %></button> diff --git a/public/views/codimd/foot.ejs b/public/views/codimd/foot.ejs index 000ccb6d..9b1c68d6 100644 --- a/public/views/codimd/foot.ejs +++ b/public/views/codimd/foot.ejs @@ -1,4 +1,4 @@ -<script src="<%= url %>/js/mathjax-config-extra.js"></script> +<script src="<%= serverURL %>/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> @@ -21,7 +21,7 @@ <script src="https://cdnjs.cloudflare.com/ajax/libs/abcjs/3.1.1/abcjs_basic-min.js" integrity="sha256-Sq1r2XXWXQoShQKsS0Wrf5r7fRkErd9Fat9vHYeU68s=" crossorigin="anonymous"></script> <%- include ../build/index-scripts %> <% } else { %> -<script src="<%- url %>/build/MathJax/MathJax.js" defer></script> -<script src="<%- url %>/build/MathJax/config/TeX-AMS-MML_HTMLorMML.js" defer></script> +<script src="<%- serverURL %>/build/MathJax/MathJax.js" defer></script> +<script src="<%- serverURL %>/build/MathJax/config/TeX-AMS-MML_HTMLorMML.js" defer></script> <%- include ../build/index-pack-scripts %> <% } %> diff --git a/public/views/codimd/head.ejs b/public/views/codimd/head.ejs index 1f446253..afa89d13 100644 --- a/public/views/codimd/head.ejs +++ b/public/views/codimd/head.ejs @@ -5,18 +5,17 @@ <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="mobile-web-app-capable" content="yes"> <title><%= title %></title> -<link rel="icon" type="image/png" href="<%- url %>/favicon.png"> -<link rel="apple-touch-icon" href="<%- url %>/apple-touch-icon.png"> +<link rel="icon" type="image/png" href="<%- serverURL %>/favicon.png"> +<link rel="apple-touch-icon" href="<%- serverURL %>/apple-touch-icon.png"> <% if(useCDN) { %> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" /> -<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" /> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fork-awesome/1.1.3/css/fork-awesome.min.css" integrity="sha256-ZhApazu+kejqTYhMF+1DzNKjIzP7KXu6AzyXcC1gMus=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/4.9.0/bootstrap-social.min.css" integrity="sha256-02JtFTurpwBjQJ6q13iJe82/NF0RbZlJroDegK5g87Y=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css" integrity="sha256-3iu9jgsy9TpTwXKb7bNQzqWekRX7pPK+2OLj3R922fo=" crossorigin="anonymous" /> -<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/octicons.min.css" integrity="sha256-4eCms8tUm+iL29tUvmRhNRnz/7lNI4oTtQzqa/uM2dI=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/css/basic/emojify.min.css" integrity="sha256-UOrvMOsSDSrW6szVLe8ZDZezBxh5IoIfgTwdNDgTjiU=" crossorigin="anonymous" /> <%- include ../build/index-header %> <%- include ../shared/polyfill %> <% } else { %> -<link rel="stylesheet" href='<%- url %>/build/emojify.js/dist/css/basic/emojify.min.css'> +<link rel="stylesheet" href='<%- serverURL %>/build/emojify.js/dist/css/basic/emojify.min.css'> <%- include ../build/index-pack-header %> <% } %> diff --git a/public/views/codimd/header.ejs b/public/views/codimd/header.ejs index 8fc050b7..b83838ea 100644 --- a/public/views/codimd/header.ejs +++ b/public/views/codimd/header.ejs @@ -13,7 +13,7 @@ <ul class="dropdown-menu list" role="menu" aria-labelledby="menu"> </ul> </div> - <a class="navbar-brand pull-left" href="<%- url %>/"><i class="fa fa-file-text"></i> CodiMD</a> + <a class="navbar-brand pull-left" href="<%- serverURL %>/"><i class="fa fa-file-text"></i> CodiMD</a> <div class="nav-mobile pull-right visible-xs"> <span class="btn btn-link btn-file ui-upload-image" title="Upload Image" style="display:none;"> <i class="fa fa-camera"></i><input type="file" accept="image/*" name="upload" multiple> @@ -22,26 +22,26 @@ <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu list" role="menu" aria-labelledby="menu"> - <li role="presentation"><a role="menuitem" class="ui-new" tabindex="-1" href="<%- url %>/new" target="_blank"><i class="fa fa-plus fa-fw"></i> <%= __('New') %></a> + <li role="presentation"><a role="menuitem" class="ui-new" tabindex="-1" href="<%- serverURL %>/new" target="_blank" rel="noopener"><i class="fa fa-plus fa-fw"></i> <%= __('New') %></a> </li> - <li role="presentation"><a role="menuitem" class="ui-publish" tabindex="-1" href="#" target="_blank"><i class="fa fa-share-square-o fa-fw"></i> <%= __('Publish') %></a> + <li role="presentation"><a role="menuitem" class="ui-publish" tabindex="-1" href="#" target="_blank" rel="noopener"><i class="fa fa-share-square-o fa-fw"></i> <%= __('Publish') %></a> </li> <li class="divider"></li> <li class="dropdown-header"><%= __('Extra') %></li> <li role="presentation"><a role="menuitem" class="ui-extra-revision" tabindex="-1" data-toggle="modal" data-target="#revisionModal"><i class="fa fa-history fa-fw"></i> <%= __('Revision') %></a> </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 role="presentation"><a role="menuitem" class="ui-extra-slide" tabindex="-1" href="#" target="_blank" rel="noopener"><i class="fa fa-tv fa-fw"></i> <%= __('Slide Mode') %></a> </li> - <% if((typeof github !== 'undefined' && github) || (typeof dropbox !== 'undefined' && dropbox) || (typeof gitlab !== 'undefined' && gitlab && (!gitlab.scope || gitlab.scope === 'api'))) { %> + <% if(enableGitHubGist || enableDropBoxSave || enableGitlabSnippets) { %> <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> </li> - <% if(typeof github !== 'undefined' && github) { %> - <li role="presentation"><a role="menuitem" class="ui-save-gist" tabindex="-1" href="#" target="_blank"><i class="fa fa-github fa-fw"></i> Gist</a> + <% if(enableGitHubGist) { %> + <li role="presentation"><a role="menuitem" class="ui-save-gist" tabindex="-1" href="#" target="_blank" rel="noopener"><i class="fa fa-github fa-fw"></i> Gist</a> </li> <% } %> - <% if(typeof gitlab !== 'undefined' && gitlab && (!gitlab.scope || gitlab.scope === 'api')) { %> + <% if(enableGitlabSnippets) { %> <li role="presentation"><a role="menuitem" class="ui-save-snippet" href="#"><i class="fa fa-gitlab fa-fw"></i> Snippet</a> </li> <% } %> @@ -52,7 +52,7 @@ </li> <li role="presentation"><a role="menuitem" class="ui-import-gist" href="#" data-toggle="modal" data-target="#gistImportModal"><i class="fa fa-github fa-fw"></i> Gist</a> </li> - <% if(typeof gitlab !== 'undefined' && gitlab && (!gitlab.scope || gitlab.scope === 'api')) { %> + <% if(enableGitlabSnippets) { %> <li role="presentation"><a role="menuitem" class="ui-import-snippet" href="#"><i class="fa fa-gitlab fa-fw"></i> Snippet</a> </li> <% } %> @@ -115,12 +115,12 @@ </ul> <ul class="nav navbar-nav navbar-right" style="padding:0;"> <li> - <a href="<%- url %>/new" target="_blank" class="ui-new"> + <a href="<%- serverURL %>/new" target="_blank" rel="noopener" class="ui-new"> <i class="fa fa-plus"></i> <%= __('New') %> </a> </li> <li> - <a href="#" target="_blank" class="ui-publish"> + <a href="#" target="_blank" rel="noopener" class="ui-publish"> <i class="fa fa-share-square-o"></i> <%= __('Publish') %> </a> </li> @@ -132,18 +132,18 @@ <li class="dropdown-header"><%= __('Extra') %></li> <li role="presentation"><a role="menuitem" class="ui-extra-revision" tabindex="-1" data-toggle="modal" data-target="#revisionModal"><i class="fa fa-history fa-fw"></i> <%= __('Revision') %></a> </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 role="presentation"><a role="menuitem" class="ui-extra-slide" tabindex="-1" href="#" target="_blank" rel="noopener"><i class="fa fa-tv fa-fw"></i> <%= __('Slide Mode') %></a> </li> - <% if((typeof github !== 'undefined' && github) || (typeof dropbox !== 'undefined' && dropbox) || (typeof gitlab !== 'undefined' && gitlab && (!gitlab.scope || gitlab.scope === 'api'))) { %> + <% if(enableGitHubGist || enableDropBoxSave || enableGitlabSnippets) { %> <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> </li> - <% if(typeof github !== 'undefined' && github) { %> - <li role="presentation"><a role="menuitem" class="ui-save-gist" tabindex="-1" href="#" target="_blank"><i class="fa fa-github fa-fw"></i> Gist</a> + <% if(enableGitHubGist) { %> + <li role="presentation"><a role="menuitem" class="ui-save-gist" tabindex="-1" href="#" target="_blank" rel="noopener"><i class="fa fa-github fa-fw"></i> Gist</a> </li> <% } %> - <% if(typeof gitlab !== 'undefined' && gitlab && (!gitlab.scope || gitlab.scope === 'api')) { %> + <% if(enableGitlabSnippets) { %> <li role="presentation"><a role="menuitem" class="ui-save-snippet" href="#"><i class="fa fa-gitlab fa-fw"></i> Snippet</a> </li> <% } %> @@ -154,7 +154,7 @@ </li> <li role="presentation"><a role="menuitem" class="ui-import-gist" href="#" data-toggle="modal" data-target="#gistImportModal"><i class="fa fa-github fa-fw"></i> Gist</a> </li> - <% if(typeof gitlab !== 'undefined' && gitlab && (!gitlab.scope || gitlab.scope === 'api')) { %> + <% if(enableGitlabSnippets) { %> <li role="presentation"><a role="menuitem" class="ui-import-snippet" href="#"><i class="fa fa-gitlab fa-fw"></i> Snippet</a> </li> <% } %> diff --git a/public/views/error.ejs b/public/views/error.ejs index 98c3c74e..3ed76c8c 100644 --- a/public/views/error.ejs +++ b/public/views/error.ejs @@ -3,14 +3,14 @@ <head> <%- include codimd/head %> - <link rel="stylesheet" href="<%- url %>/css/center.css"> + <link rel="stylesheet" href="<%- serverURL %>/css/center.css"> </head> <body> <%- include codimd/header %> <div class="container-fluid text-center"> <div class="vertical-center-row"> - <h1><%- code %> <%- detail %> <small><%- msg %></small></h1> + <h1><%- code %> <%- detail %> <small><%- msg %></small></h1> </div> </div> <%- include codimd/footer %> diff --git a/public/views/html.hbs b/public/views/html.hbs index a87bf81a..490d31a4 100644 --- a/public/views/html.hbs +++ b/public/views/html.hbs @@ -16,9 +16,8 @@ <link rel="apple-touch-icon" href="{{{url}}}/apple-touch-icon.png"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" /> - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" /> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fork-awesome/1.1.3/css/fork-awesome.min.css" integrity="sha256-ZhApazu+kejqTYhMF+1DzNKjIzP7KXu6AzyXcC1gMus=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css" integrity="sha256-3iu9jgsy9TpTwXKb7bNQzqWekRX7pPK+2OLj3R922fo=" crossorigin="anonymous" /> - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/octicons.min.css" integrity="sha256-4eCms8tUm+iL29tUvmRhNRnz/7lNI4oTtQzqa/uM2dI=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/themes/prism.min.css" integrity="sha256-vtR0hSWRc3Tb26iuN2oZHt3KRUomwTufNIf5/4oeCyg=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github-gist.min.css" integrity="sha256-tAflq+ymku3Khs+I/WcAneIlafYgDiOQ9stIHH985Wo=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/css/basic/emojify.min.css" integrity="sha256-UOrvMOsSDSrW6szVLe8ZDZezBxh5IoIfgTwdNDgTjiU=" crossorigin="anonymous" /> diff --git a/public/views/includes/scripts.ejs b/public/views/includes/scripts.ejs index df8fbc00..c4f5aa5a 100644 --- a/public/views/includes/scripts.ejs +++ b/public/views/includes/scripts.ejs @@ -1,4 +1,4 @@ <script src="<%= webpackConfig.output.baseUrl %>/config"></script> -<% for (var chunk in htmlWebpackPlugin.files.chunks) { %> -<script src="<%= webpackConfig.output.baseUrl %><%= htmlWebpackPlugin.files.chunks[chunk].entry %>" defer></script> +<% for (var js in htmlWebpackPlugin.files.js) { %> +<script src="<%= webpackConfig.output.baseUrl %><%= htmlWebpackPlugin.files.js[js] %>" defer></script> <% } %> diff --git a/public/views/index/body.ejs b/public/views/index/body.ejs index 53dbf2a2..43582d78 100644 --- a/public/views/index/body.ejs +++ b/public/views/index/body.ejs @@ -12,24 +12,24 @@ <li class="ui-history<% if(signin) { %> active<% } %>"><a href="#"><%= __('History') %></a> </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-primary"><i class="fa fa-plus"></i> <%= __('New guest note') %></a> + <% if (allowAnonymous) { %> + <a type="button" href="<%- serverURL %>/new" class="btn btn-sm btn-primary"><i class="fa fa-plus"></i> <%= __('New guest note') %></a> <% } %> - <% if(facebook || twitter || github || gitlab || mattermost || dropbox || google || ldap || saml || oauth2 || email) { %> + <% if (authProviders.facebook || authProviders.twitter || authProviders.github || authProviders.gitlab || authProviders.mattermost || authProviders.dropbox || authProviders.google || authProviders.ldap || authProviders.saml || authProviders.oauth2 || authProviders.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-primary"><i class="fa fa-plus"></i> <%= __('New note') %></a> + <a type="button" href="<%- serverURL %>/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> </button> <ul class="dropdown-menu" aria-labelledby="profileLabel"> - <li><a href="<%- url %>/features"><i class="fa fa-dot-circle-o fa-fw"></i> <%= __('Features') %></a></li> - <li><a href="<%- url %>/me/export"><i class="fa fa-cloud-download fa-fw"></i> <%= __('Export user data') %></a></li> + <li><a href="<%- serverURL %>/features"><i class="fa fa-dot-circle-o fa-fw"></i> <%= __('Features') %></a></li> + <li><a href="<%- serverURL %>/me/export"><i class="fa fa-cloud-download fa-fw"></i> <%= __('Export user data') %></a></li> <li><a class="ui-delete-user" data-toggle="modal" data-target=".delete-user-modal"><i class="fa fa-trash fa-fw"></i> <%= __('Delete user') %></a></li> - <li><a href="<%- url %>/logout"><i class="fa fa-sign-out fa-fw"></i> <%= __('Sign Out') %></a></li> + <li><a href="<%- serverURL %>/logout"><i class="fa fa-sign-out fa-fw"></i> <%= __('Sign Out') %></a></li> </ul> </span> </div> @@ -50,7 +50,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 || mattermost || dropbox || google || ldap || saml || oauth2 || email) { %> + <% if (authProviders.facebook || authProviders.twitter || authProviders.github || authProviders.gitlab || authProviders.mattermost || authProviders.dropbox || authProviders.google || authProviders.ldap || authProviders.saml || authProviders.oauth2 || authProviders.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> @@ -58,26 +58,26 @@ <span class="ui-or"><%= __('or') %></span> <% } %> <span class="ui-signin"> - <a type="button" href="<%- url %>/features" class="btn btn-lg btn-primary" style="min-width: 200px;"><%= __('Explore all features') %></a> + <a type="button" href="<%- serverURL %>/features" class="btn btn-lg btn-primary" style="min-width: 200px;"><%= __('Explore all features') %></a> <br> <br> - <img src="<%- url %>/screenshot.png" class="screenshot ui-signin"> + <img src="<%- serverURL %>/screenshot.png" class="screenshot ui-signin"> </span> <div class="lead row" style="width: 90%; margin: 0 auto;"> <div class="col-md-4 inner"> - <a href="<%- url %>/features#share-notes"> + <a href="<%- serverURL %>/features#share-notes"> <i class="fa fa-bolt fa-3x"></i> <h4><%= __('Collaborate with URL') %></h4> </a> </div> <div class="col-md-4 inner"> - <a href="<%- url %>/features#mathjax"> + <a href="<%- serverURL %>/features#mathjax"> <i class="fa fa-bar-chart fa-3x"></i> <h4><%= __('Support charts and MathJax') %></h4> </a> </div> <div class="col-md-4 inner"> - <a href="<%- url %>/features#slide-mode"> + <a href="<%- serverURL %>/features#slide-mode"> <i class="fa fa-tv fa-3x"></i> <h4><%= __('Support slide mode') %></h4> </a> @@ -147,12 +147,13 @@ <option value="eo">Esperanto</option> <option value="da">dansk</option> <option value="ko">한국어</option> + <option value="id">Bahasa Indonesia</option> </select> <p> - © 2018 <a href="https://hackmd.io">CodiMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a><% if(privacyStatement) { %> | <a href="<%- url %>/s/privacy" target="_blank"><%= __('Privacy') %></a><% } %><% if(termsOfUse) { %> | <a href="<%- url %>/s/terms-of-use" target="_blank"><%= __('Terms of Use') %></a><% } %> + Powered by <a href="https://codimd.org">CodiMD</a> | <a href="<%- serverURL %>/s/release-notes" target="_blank" rel="noopener"><%= __('Releases') %></a>| <a href="<%- sourceURL %>" target="_blank" rel="noopener"><%= __('Source Code') %></a><% if(privacyStatement) { %> | <a href="<%- serverURL %>/s/privacy" target="_blank" rel="noopener"><%= __('Privacy') %></a><% } %><% if(termsOfUse) { %> | <a href="<%- serverURL %>/s/terms-of-use" target="_blank" rel="noopener"><%= __('Terms of Use') %></a><% } %> </p> <h6 class="social-foot"> - <%- __('Follow us on %s and %s.', '<a href="https://github.com/hackmdio/CodiMD" target="_blank"><i class="fa fa-github"></i> GitHub</a>, <a href="https://riot.im/app/#/room/#codimd:matrix.org" target="_blank"><i class="fa fa-comments"></i> Riot</a>') %> + <%- __('Follow us on %s and %s.', '<a href="https://github.com/hackmdio/CodiMD" target="_blank" rel="noopener"><i class="fa fa-github"></i> GitHub</a>, <a href="https://riot.im/app/#/room/#codimd:matrix.org" target="_blank" rel="noopener"><i class="fa fa-comments"></i> Riot</a>', '<a href="https://translate.codimd.org" target="_blank" rel="noopener"><i class="fa fa-globe"></i> POEditor</a>') %> </h6> </div> </div> @@ -194,7 +195,7 @@ </div> <div class="modal-footer"> <button type="button" class="btn btn-default ui-delete-user-modal-cancel" data-dismiss="modal"><%= __('Cancel') %></button> - <a type="button" class="btn btn-danger" href="<%- url %>/me/delete/<%- deleteToken %>"><%= __('Yes, do it!') %></a> + <a type="button" class="btn btn-danger" href="<%- serverURL %>/me/delete/<%- deleteToken %>"><%= __('Yes, do it!') %></a> </div> </div> </div> diff --git a/public/views/index/head.ejs b/public/views/index/head.ejs index f826d9ee..7a601bdf 100644 --- a/public/views/index/head.ejs +++ b/public/views/index/head.ejs @@ -7,11 +7,11 @@ <meta name="description" content="<%= __('Best way to write and share your knowledge in markdown.') %>"> <meta name="keywords" content="Collaborative, Markdown, Notes"> <title>CodiMD - <%= __('Collaborative markdown notes') %></title> -<link rel="icon" type="image/png" href="<%- url %>/favicon.png"> -<link rel="apple-touch-icon" href="<%- url %>/apple-touch-icon.png"> +<link rel="icon" type="image/png" href="<%- serverURL %>/favicon.png"> +<link rel="apple-touch-icon" href="<%- serverURL %>/apple-touch-icon.png"> <% if(useCDN) { %> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" /> -<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" /> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fork-awesome/1.1.3/css/fork-awesome.min.css" integrity="sha256-ZhApazu+kejqTYhMF+1DzNKjIzP7KXu6AzyXcC1gMus=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/4.9.0/bootstrap-social.min.css" integrity="sha256-02JtFTurpwBjQJ6q13iJe82/NF0RbZlJroDegK5g87Y=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/3.5.4/select2.min.css" integrity="sha256-ijlUKKj3hJCiiT2HWo1kqkI79NTEYpzOsw5Rs3k42dI=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/3.5.4/select2-bootstrap.min.css" integrity="sha256-NAWFcNIZdH+TS1xpWujF/EB/Y8gwBbEOCoaK/eqaer8=" crossorigin="anonymous" /> diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs index 4c2fc0ab..ff4dcc23 100644 --- a/public/views/pretty.ejs +++ b/public/views/pretty.ejs @@ -15,18 +15,17 @@ <meta name="description" content="<%= description %>"> <% } %> <title><%= title %></title> - <link rel="icon" type="image/png" href="<%- url %>/favicon.png"> - <link rel="apple-touch-icon" href="<%- url %>/apple-touch-icon.png"> + <link rel="icon" type="image/png" href="<%- serverURL %>/favicon.png"> + <link rel="apple-touch-icon" href="<%- serverURL %>/apple-touch-icon.png"> <% if(useCDN) { %> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" /> - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" /> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fork-awesome/1.1.3/css/fork-awesome.min.css" integrity="sha256-ZhApazu+kejqTYhMF+1DzNKjIzP7KXu6AzyXcC1gMus=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css" integrity="sha256-3iu9jgsy9TpTwXKb7bNQzqWekRX7pPK+2OLj3R922fo=" crossorigin="anonymous" /> - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/octicons.min.css" integrity="sha256-4eCms8tUm+iL29tUvmRhNRnz/7lNI4oTtQzqa/uM2dI=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/css/basic/emojify.min.css" integrity="sha256-UOrvMOsSDSrW6szVLe8ZDZezBxh5IoIfgTwdNDgTjiU=" crossorigin="anonymous" /> <%- include build/pretty-header %> <%- include shared/polyfill %> <% } else { %> - <link rel="stylesheet" href='<%- url %>/build/emojify.js/dist/css/basic/emojify.min.css'> + <link rel="stylesheet" href='<%- serverURL %>/build/emojify.js/dist/css/basic/emojify.min.css'> <%- include build/pretty-pack-header %> <% } %> </head> @@ -72,7 +71,7 @@ </body> </html> -<script src="<%= url %>/js/mathjax-config-extra.js"></script> +<script src="<%= serverURL %>/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> @@ -91,8 +90,8 @@ <script src="https://cdnjs.cloudflare.com/ajax/libs/abcjs/3.1.1/abcjs_basic-min.js" integrity="sha256-Sq1r2XXWXQoShQKsS0Wrf5r7fRkErd9Fat9vHYeU68s=" crossorigin="anonymous"></script> <%- include build/pretty-scripts %> <% } else { %> -<script src="<%- url %>/build/MathJax/MathJax.js" defer></script> -<script src="<%- url %>/build/MathJax/config/TeX-AMS-MML_HTMLorMML.js" defer></script> +<script src="<%- serverURL %>/build/MathJax/MathJax.js" defer></script> +<script src="<%- serverURL %>/build/MathJax/config/TeX-AMS-MML_HTMLorMML.js" defer></script> <%- include build/pretty-pack-scripts %> <% } %> <%- include shared/ga %> diff --git a/public/views/shared/help-modal.ejs b/public/views/shared/help-modal.ejs index 7d6576df..ec35b0e9 100644 --- a/public/views/shared/help-modal.ejs +++ b/public/views/shared/help-modal.ejs @@ -19,7 +19,7 @@ <br> <a href="https://riot.im/app/#/room/#codimd:matrix.org" target="_blank"><i class="fa fa-hashtag fa-fw"></i> <%= __('Meet us on %s', 'Matrix') %></a> <br> - <a href="https://gitter.im/hackmdio/hackmd" target="_blank"><i class="fa fa-comments fa-fw"></i> <%= __('Meet us on %s', 'Gitter') %></a> + <a href="https://translate.codimd.org" target="_blank"><i class="fa fa-language fa-fw"></i> <%= __('Help us translating on %s', 'POEditor') %></a> </div> </div> <div class="panel panel-default"> diff --git a/public/views/shared/refresh-modal.ejs b/public/views/shared/refresh-modal.ejs index 5be41b2a..2aa652aa 100644 --- a/public/views/shared/refresh-modal.ejs +++ b/public/views/shared/refresh-modal.ejs @@ -14,7 +14,7 @@ </div> <div class="new-version" style="display:none;"> <h5><%= __('New version available!') %></h5> - <a href="<%- url %>/s/release-notes" target="_blank"><%= __('See releases notes here') %></a> + <a href="<%- serverURL %>/s/release-notes" target="_blank" rel="noopener"><%= __('See releases notes here') %></a> <br> <strong><%= __('Refresh to enjoy new features.') %></strong> </div> @@ -28,4 +28,4 @@ </div> </div> </div> -</div>
\ No newline at end of file +</div> diff --git a/public/views/shared/signin-modal.ejs b/public/views/shared/signin-modal.ejs index f0cffad9..d46b8d54 100644 --- a/public/views/shared/signin-modal.ejs +++ b/public/views/shared/signin-modal.ejs @@ -8,56 +8,56 @@ <h4 class="modal-title" id="mySmallModalLabel"><%= __('Choose method') %></h4> </div> <div class="modal-body" style="text-align: center;"> - <% if(facebook) { %> - <a href="<%- url %>/auth/facebook" class="btn btn-lg btn-block btn-social btn-facebook"> + <% if (authProviders.facebook) { %> + <a href="<%- serverURL %>/auth/facebook" class="btn btn-lg btn-block btn-social btn-facebook"> <i class="fa fa-facebook"></i> <%= __('Sign in via %s', 'Facebook') %> </a> <% } %> - <% if(twitter) { %> - <a href="<%- url %>/auth/twitter" class="btn btn-lg btn-block btn-social btn-twitter"> + <% if (authProviders.twitter) { %> + <a href="<%- serverURL %>/auth/twitter" class="btn btn-lg btn-block btn-social btn-twitter"> <i class="fa fa-twitter"></i> <%= __('Sign in via %s', 'Twitter') %> </a> <% } %> - <% if(github) { %> - <a href="<%- url %>/auth/github" class="btn btn-lg btn-block btn-social btn-github"> + <% if (authProviders.github) { %> + <a href="<%- serverURL %>/auth/github" class="btn btn-lg btn-block btn-social btn-github"> <i class="fa fa-github"></i> <%= __('Sign in via %s', 'GitHub') %> </a> <% } %> - <% if(gitlab) { %> - <a href="<%- url %>/auth/gitlab" class="btn btn-lg btn-block btn-social btn-soundcloud"> + <% if (authProviders.gitlab) { %> + <a href="<%- serverURL %>/auth/gitlab" class="btn btn-lg btn-block btn-social btn-soundcloud"> <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"> + <% if (authProviders.mattermost) { %> + <a href="<%- serverURL %>/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"> + <% if (authProviders.dropbox) { %> + <a href="<%- serverURL %>/auth/dropbox" class="btn btn-lg btn-block btn-social btn-dropbox"> <i class="fa fa-dropbox"></i> <%= __('Sign in via %s', 'Dropbox') %> </a> <% } %> - <% if(google) { %> - <a href="<%- url %>/auth/google" class="btn btn-lg btn-block btn-social btn-google"> + <% if (authProviders.google) { %> + <a href="<%- serverURL %>/auth/google" class="btn btn-lg btn-block btn-social btn-google"> <i class="fa fa-google"></i> <%= __('Sign in via %s', 'Google') %> </a> <% } %> - <% if(saml) { %> - <a href="<%- url %>/auth/saml" class="btn btn-lg btn-block btn-social btn-success"> + <% if (authProviders.saml) { %> + <a href="<%- serverURL %>/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(oauth2) { %> - <a href="<%- url %>/auth/oauth2" class="btn btn-lg btn-block btn-social btn-soundcloud"> - <i class="fa fa-mail-forward"></i> <%= __('Sign in via %s', oauth2ProviderName || 'OAuth2') %> + <% if (authProviders.oauth2) { %> + <a href="<%- serverURL %>/auth/oauth2" class="btn btn-lg btn-block btn-social btn-soundcloud"> + <i class="fa fa-mail-forward"></i> <%= __('Sign in via %s', authProviders.oauth2ProviderName || 'OAuth2') %> </a> <% } %> - <% if((facebook || twitter || github || gitlab || mattermost || dropbox || google || saml || oauth2) && ldap) { %> + <% if ((authProviders.facebook || authProviders.twitter || authProviders.github || authProviders.gitlab || authProviders.mattermost || authProviders.dropbox || authProviders.google || authProviders.saml || authProviders.oauth2) && authProviders.ldap) { %> <hr> <% }%> - <% if(ldap) { %> - <h4>Via <% if (ldapProviderName) { %> <%= ldapProviderName %> (LDAP) <% } else { %> LDAP <% } %></h4> + <% if (authProviders.ldap) { %> + <h4>Via <% if (authProviders.ldapProviderName) { %> <%= authProviders.ldapProviderName %> (LDAP) <% } else { %> LDAP <% } %></h4> <form data-toggle="validator" role="form" class="form-horizontal" method="post" enctype="application/x-www-form-urlencoded"> <div class="form-group"> <div class="col-sm-12"> @@ -73,15 +73,34 @@ </div> <div class="form-group"> <div class="col-sm-12"> - <button type="submit" class="btn btn-primary" formaction="<%- url %>/auth/ldap">Sign in</button> + <button type="submit" class="btn btn-primary" formaction="<%- serverURL %>/auth/ldap">Sign in</button> </div> </div> </form> <% } %> - <% if((facebook || twitter || github || gitlab || mattermost || dropbox || google || ldap || oauth2) && email) { %> + <% if ((authProviders.facebook || authProviders.twitter || authProviders.github || authProviders.gitlab || authProviders.mattermost || authProviders.dropbox || authProviders.google || authProviders.ldap || authProviders.oauth2) && authProviders.openID) { %> <hr> <% }%> - <% if(email) { %> + <% if (authProviders.openID) { %> + <h4>OpenID</h4> + <form data-toggle="validator" role="form" class="form-horizontal" method="post" enctype="application/x-www-form-urlencoded"> + <div class="form-group"> + <div class="col-sm-12"> + <input type="text" class="form-control" name="openid_identifier" placeholder="OpenID" required> + <span class="help-block control-label with-errors" style="display: inline;"></span> + </div> + </div> + <div class="form-group"> + <div class="col-sm-12"> + <button type="submit" class="btn btn-primary" formaction="<%- serverURL %>/auth/openid">Sign in</button> + </div> + </div> + </form> + <% } %> + <% if ((authProviders.facebook || authProviders.twitter || authProviders.github || authProviders.gitlab || authProviders.mattermost || authProviders.dropbox || authProviders.google || authProviders.ldap || authProviders.oauth2 || authProviders.openID) && authProviders.email) { %> + <hr> + <% }%> + <% if (authProviders.email) { %> <h4>Via Email</h4> <form data-toggle="validator" role="form" class="form-horizontal" method="post" enctype="application/x-www-form-urlencoded"> <div class="form-group"> @@ -98,8 +117,8 @@ </div> <div class="form-group"> <div class="col-sm-12"> - <button type="submit" class="btn btn-primary" formaction="<%- url %>/login">Sign in</button> - <% if(allowEmailRegister) { %><button type="submit" class="btn btn-default" formaction="<%- url %>/register">Register</button><% }%> + <button type="submit" class="btn btn-primary" formaction="<%- serverURL %>/login">Sign in</button> + <% if (authProviders.allowEmailRegister) { %><button type="submit" class="btn btn-default" formaction="<%- serverURL %>/register">Register</button><% }%> </div> </div> </form> diff --git a/public/views/slide.ejs b/public/views/slide.ejs index c11d2984..9b19af2a 100644 --- a/public/views/slide.ejs +++ b/public/views/slide.ejs @@ -12,40 +12,39 @@ <meta name="description" content="<%= description %>"> <% } %> <title><%= title %></title> - <link rel="icon" type="image/png" href="<%- url %>/favicon.png"> - <link rel="apple-touch-icon" href="<%- url %>/apple-touch-icon.png"> + <link rel="icon" type="image/png" href="<%- serverURL %>/favicon.png"> + <link rel="apple-touch-icon" href="<%- serverURL %>/apple-touch-icon.png"> <% if(useCDN) { %> - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" /> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fork-awesome/1.1.3/css/fork-awesome.min.css" integrity="sha256-ZhApazu+kejqTYhMF+1DzNKjIzP7KXu6AzyXcC1gMus=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css" integrity="sha256-3iu9jgsy9TpTwXKb7bNQzqWekRX7pPK+2OLj3R922fo=" crossorigin="anonymous" /> - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/octicons.min.css" integrity="sha256-4eCms8tUm+iL29tUvmRhNRnz/7lNI4oTtQzqa/uM2dI=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.6.0/css/reveal.min.css" integrity="sha256-ol2N5Xr80jdDqxK0lte3orKGb9Ja3sOnpAUV7TTADmg=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/css/basic/emojify.min.css" integrity="sha256-UOrvMOsSDSrW6szVLe8ZDZezBxh5IoIfgTwdNDgTjiU=" crossorigin="anonymous" /> <%- include build/slide-header %> <%- include shared/polyfill %> <% } else { %> - <link rel="stylesheet" href="<%- url %>/build/reveal.js/css/reveal.css"> - <link rel="stylesheet" href='<%- url %>/build/emojify.js/dist/css/basic/emojify.min.css'> + <link rel="stylesheet" href="<%- serverURL %>/build/reveal.js/css/reveal.css"> + <link rel="stylesheet" href='<%- serverURL %>/build/emojify.js/dist/css/basic/emojify.min.css'> <%- include build/slide-pack-header %> <% } %> <!-- For reveal.js theme --> <% if(typeof theme !== 'undefined' && theme) { %> - <link rel="stylesheet" href="<%- url %>/build/reveal.js/css/theme/<%= theme %>.css" id="theme"> + <link rel="stylesheet" href="<%- serverURL %>/build/reveal.js/css/theme/<%= theme %>.css" id="theme"> <% } else { %> - <link rel="stylesheet" href="<%- url %>/build/reveal.js/css/theme/black.css" id="theme"> + <link rel="stylesheet" href="<%- serverURL %>/build/reveal.js/css/theme/black.css" id="theme"> <% } %> <!-- For syntax highlighting --> - <link rel="stylesheet" href="<%- url %>/build/reveal.js/lib/css/zenburn.css"> + <link rel="stylesheet" href="<%- serverURL %>/build/reveal.js/lib/css/zenburn.css"> <!-- For overwrite reveal.js --> - <link rel="stylesheet" href="<%- url %>/css/slide.css"> + <link rel="stylesheet" href="<%- serverURL %>/css/slide.css"> <!-- Printing and PDF exports --> <script nonce="<%= cspNonce %>"> var link = document.createElement( 'link' ); link.rel = 'stylesheet'; link.type = 'text/css'; - link.href = '<%- url %>/build/reveal.js/' + (window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css'); + link.href = '<%- serverURL %>/build/reveal.js/' + (window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css'); document.getElementsByTagName( 'head' )[0].appendChild( link ); </script> </head> @@ -87,7 +86,7 @@ </div> </div> - <script src="<%= url %>/js/mathjax-config-extra.js"></script> + <script src="<%= serverURL %>/js/mathjax-config-extra.js"></script> <% if(useCDN) { %> <script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.6.0/lib/js/head.min.js" integrity="sha256-+09kLhwACKXFPDvqo4xMMvi4+uXFsRZ2uYGbeN1U8sI=" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.6.0/js/reveal.min.js" integrity="sha256-ixSKHrWAL2k0mqVSRju9+to2/uZSEK9+kJRfdNBolG8=" crossorigin="anonymous"></script> @@ -107,8 +106,8 @@ <script src="https://cdnjs.cloudflare.com/ajax/libs/abcjs/3.1.1/abcjs_basic-min.js" integrity="sha256-Sq1r2XXWXQoShQKsS0Wrf5r7fRkErd9Fat9vHYeU68s=" crossorigin="anonymous"></script> <%- include build/slide-scripts %> <% } else { %> - <script src="<%- url %>/build/MathJax/MathJax.js" defer></script> - <script src="<%- url %>/build/MathJax/config/TeX-AMS-MML_HTMLorMML.js" defer></script> + <script src="<%- serverURL %>/build/MathJax/MathJax.js" defer></script> + <script src="<%- serverURL %>/build/MathJax/config/TeX-AMS-MML_HTMLorMML.js" defer></script> <%- include build/slide-pack-scripts %> <% } %> </body> |