diff options
Diffstat (limited to 'public')
-rw-r--r-- | public/css/extra.css | 31 | ||||
-rw-r--r-- | public/css/github-extract.css | 41 | ||||
-rw-r--r-- | public/css/index.css | 74 | ||||
-rw-r--r-- | public/css/markdown.css | 38 | ||||
-rw-r--r-- | public/docs/features.md | 17 | ||||
-rw-r--r-- | public/docs/release-notes.md | 55 | ||||
-rw-r--r-- | public/js/extra.js | 9 | ||||
-rw-r--r-- | public/js/index.js | 15 | ||||
-rw-r--r-- | public/js/lib/appState.js | 3 | ||||
-rw-r--r-- | public/js/lib/editor/ui-elements.js | 1 | ||||
-rw-r--r-- | public/views/hackmd/body.ejs | 2 | ||||
-rw-r--r-- | public/views/hackmd/header.ejs | 5 | ||||
-rw-r--r-- | public/views/index/body.ejs | 3 | ||||
-rw-r--r-- | public/views/shared/help-modal.ejs | 6 |
14 files changed, 272 insertions, 28 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/docs/features.md b/public/docs/features.md index a894c087..01340fd7 100644 --- a/public/docs/features.md +++ b/public/docs/features.md @@ -3,13 +3,12 @@ Features Introduction === -<i class="fa fa-file-text"></i> **HackMD** is a realtime, multiplatform collaborative markdown note editor. +<i class="fa fa-file-text"></i> **HackMD** is a realtime, multi-platform collaborative markdown note editor. This means that you can write notes with other people on your **desktop**, **tablet** or even on the **phone**. -You can sign-in via **Facebook**, **Twitter**, **GitHub**, or **Dropbox** in the [_homepage_](/). +You can sign-in via multiple auth providers like **Facebook**, **Twitter**, **GitHub** and many more on the [_homepage_](/). -Note that this service is still in an early stage, and thus still has some [_issues_](https://github.com/hackmdio/hackmd/issues?q=is%3Aopen+is%3Aissue+label%3Abug). -Please report new issues in [GitHub](https://github.com/hackmdio/hackmd/issues/new). -If you need instant help, please send us a [Facebook message](https://www.messenger.com/t/hackmdio). +If you experience any _issues_, feel free to report it on [**GitHub**](https://github.com/hackmdio/hackmd/issues). +Or meet us on [**Gitter**](https://gitter.im/hackmdio/hackmd) for dev-talk and interactive help. **Thank you very much!** Workspace @@ -137,7 +136,7 @@ alert(s); function $initHighlight(block, cls) { try { if (cls.search(/\bno\-highlight\b/) != -1) - return process(block, true, 0x0F) + + return process(block, true, 0x0F) + ' class=""'; } catch (e) { /* handle exception */ @@ -157,7 +156,7 @@ alert(s); function $initHighlight(block, cls) { try { if (cls.search(/\bno\-highlight\b/) != -1) - return process(block, true, 0x0F) + + return process(block, true, 0x0F) + ' class=""'; } catch (e) { /* handle exception */ @@ -259,7 +258,7 @@ cond(no)->op2 digraph hierarchy { nodesep=1.0 // increases the separation between nodes - + node [color=Red,fontname=Courier,shape=box] //All nodes will this shape and colour edge [color=Blue, style=dashed] //All the lines look like this @@ -386,7 +385,7 @@ Subscript: H~2~O > Blockquotes can also be nested... >> ...by using additional greater-than signs right next to each other... -> > > ...or with spaces between arrows. +> > > ...or with spaces between arrows. ### Lists diff --git a/public/docs/release-notes.md b/public/docs/release-notes.md index 2e0a71c6..70510b19 100644 --- a/public/docs/release-notes.md +++ b/public/docs/release-notes.md @@ -1,6 +1,59 @@ Release Notes === +<i class="fa fa-tag"></i> 1.0.1-ce <i class="fa fa-clock-o"></i> 2018-01-19 15:00 +--- + +### Security +* Fix Dropbox client secret leak + +### Enhancements +* Improve version handling +* It's 2018! + +### Fixes +* Fix image alt-tag rendering +* Fix Dropbox appkey + +<i class="fa fa-tag"></i> 1.0.0-ce <i class="fa fa-clock-o"></i> 2018-01-18 12:00 +--- +### License +* Switch from MIT to AGPL + +### Enhancements +* Improve language support +* Allow themes for reveal +* Add dark theme for editor and view +* Add danish translation +* Add simplified chinese translation +* Provide new permission table +* Make HSTS configurable +* Make PDF export configurable +* Add Mattermost auth support +* Add SAML support + +### Fixes +* Fix regex for speaker notes +* Fix S3 endpoint support +* Fix German translation +* Fix English translation +* Fix broken profile images +* Fix XSS attacks +* Fix history order +* Fix missing boolean settings +* Fix LDAP auth +* Fix too long notes droping content +* Fix mermaid compatiblity with new version +* Fix SSL CA path parsing + +### Refactor +* Refactor main page +* Refactor status pages +* Refactor config handling +* Refactor auth backend +* Refactor code styling +* Refactor middleware to modules + <i class="fa fa-tag"></i> 0.5.1 `Doppio` <i class="fa fa-clock-o"></i> 2017-03-23 00:20 --- ### Enhancements @@ -636,4 +689,4 @@ Release Notes + Preview html + Realtime collaborate + Cross-platformed -+ Recently used history
\ No newline at end of file ++ Recently used history diff --git a/public/js/extra.js b/public/js/extra.js index 13b8924c..ec7d39da 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -156,7 +156,11 @@ export function renderTags (view) { } function slugifyWithUTF8 (text) { - let newText = S(text.toLowerCase()).trim().stripTags().dasherize().s + // remove html tags and trim spaces + let newText = S(text).trim().stripTags().s + // replace all spaces in between to dashes + newText = newText.replace(/\s+/g, '-') + // slugify string to make it valid for attribute newText = newText.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, '') return newText } @@ -1003,9 +1007,10 @@ md.use(markdownitContainer, 'info', { render: renderContainer }) md.use(markdownitContainer, 'warning', { render: renderContainer }) md.use(markdownitContainer, 'danger', { render: renderContainer }) +let defaultImageRender = md.renderer.rules.image md.renderer.rules.image = function (tokens, idx, options, env, self) { tokens[idx].attrJoin('class', 'raw') - return self.renderToken(...arguments) + return defaultImageRender(...arguments) } md.renderer.rules.list_item_open = function (tokens, idx, options, env, self) { tokens[idx].attrJoin('class', 'raw') 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/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/views/hackmd/body.ejs b/public/views/hackmd/body.ejs index 91343ef6..49604379 100644 --- a/public/views/hackmd/body.ejs +++ b/public/views/hackmd/body.ejs @@ -15,7 +15,7 @@ <a id="permissionLabel" class="ui-permission-label text-uppercase" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> </a> <ul class="dropdown-menu" aria-labelledby="permissionLabel"> - <li class="ui-permission-freely"<% if(!allowAnonymous) { %> style="display: none;"<% } %>><a><i class="fa fa-leaf fa-fw"></i> Freely - Anyone can edit</a></li> + <li class="ui-permission-freely"<% if(!allowAnonymous && !allowAnonymousEdits) { %> style="display: none;"<% } %>><a><i class="fa fa-leaf fa-fw"></i> Freely - Anyone can edit</a></li> <li class="ui-permission-editable"><a><i class="fa fa-shield fa-fw"></i> Editable - Signed-in people can edit</a></li> <li class="ui-permission-limited"><a><i class="fa fa-id-card fa-fw"></i> Limited - Signed-in people can edit (forbid guests)</a></li> <li class="ui-permission-locked"><a><i class="fa fa-lock fa-fw"></i> Locked - Only owner can edit</a></li> diff --git a/public/views/hackmd/header.ejs b/public/views/hackmd/header.ejs index 80df2c77..b87f21fa 100644 --- a/public/views/hackmd/header.ejs +++ b/public/views/hackmd/header.ejs @@ -96,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> diff --git a/public/views/index/body.ejs b/public/views/index/body.ejs index d7b4458e..82d83f02 100644 --- a/public/views/index/body.ejs +++ b/public/views/index/body.ejs @@ -39,6 +39,7 @@ <div id="home" class="section"<% if(signin) { %> style="display:none;"<% } %>> <div class="inner cover"> <h1 class="cover-heading"><i class="fa fa-file-text"></i> HackMD</h1> + <p class="lead"><strong>Community Edition</strong></p> <p class="lead"> <%= __('Best way to write and share your knowledge in markdown.') %> </p> @@ -126,7 +127,7 @@ <iframe src="//ghbtns.com/github-btn.html?user=hackmdio&repo=hackmd&type=star&count=true" frameborder="0" scrolling="0" width="104px" height="20px"></iframe> </h6> <p> - © 2017 <a href="https://www.facebook.com/hackmdio" target="_blank"><i class="fa fa-facebook-square"></i> HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a> + © 2018 <a href="https://www.facebook.com/hackmdio" target="_blank"><i class="fa fa-facebook-square"></i> HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a> </p> <select class="ui-locale"> <option value="en">English</option> diff --git a/public/views/shared/help-modal.ejs b/public/views/shared/help-modal.ejs index b1ea681d..f5dc55c2 100644 --- a/public/views/shared/help-modal.ejs +++ b/public/views/shared/help-modal.ejs @@ -15,9 +15,9 @@ <h3 class="panel-title"><%= __('Contacts') %></h3> </div> <div class="panel-body"> - <a href="https://github.com/hackmdio/hackmd/issues" target="_blank"><i class="fa fa-tag fa-fw"></i> <%= __('Report an issue') %></a> + <a href="https://github.com/hackmdio/hackmd/issues" target="_blank"><i class="fa fa-tag fa-fw"></i> <%= __('Report an issue') %></a> <br> - <a href="mailto:hackmdio@gmail.com"><i class="fa fa-envelope fa-fw"></i> <%= __('Send us email') %></a> + <a href="https://gitter.im/hackmdio/hackmd" target="_blank"><i class="fa fa-comments fa-fw"></i> <%= __('Meet us on Gitter') %></a> </div> </div> <div class="panel panel-default"> @@ -144,4 +144,4 @@ letter-spacing: 0.025em; line-height: 1.25; } -</style>
\ No newline at end of file +</style> |