summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--lib/config/default.js1
-rw-r--r--lib/config/environment.js1
-rw-r--r--lib/config/index.js2
-rw-r--r--lib/realtime.js2
-rw-r--r--lib/response.js2
-rw-r--r--locales/de.json6
-rw-r--r--locales/en.json1
-rw-r--r--locales/zh-CN.json3
-rw-r--r--locales/zh-TW.json3
-rw-r--r--public/docs/features.md17
-rw-r--r--public/views/hackmd/body.ejs2
-rw-r--r--public/views/shared/help-modal.ejs6
13 files changed, 30 insertions, 18 deletions
diff --git a/README.md b/README.md
index b820c92e..1e7d79ab 100644
--- a/README.md
+++ b/README.md
@@ -143,6 +143,7 @@ There are some configs you need to change in the files below
| HMD_URL_ADDPORT | `true` or `false` | set to add port on callback url (port 80 or 443 won't applied) (only applied when domain is set) |
| HMD_USECDN | `true` or `false` | set to use CDN resources or not (default is `true`) |
| HMD_ALLOW_ANONYMOUS | `true` or `false` | set to allow anonymous usage (default is `true`) |
+| HMD_ALLOW_ANONYMOUS_EDITS | `true` or `false` | if `allowanonymous` is `true`: allow users to select `freely` permission, allowing guests to edit existing notes (default is `false`) |
| HMD_ALLOW_FREEURL | `true` or `false` | set to allow new note by accessing not exist note url |
| HMD_DEFAULT_PERMISSION | `freely`, `editable`, `limited`, `locked` or `private` | set notes default permission (only applied on signed users) |
| HMD_DB_URL | `mysql://localhost:3306/database` | set the db url |
@@ -212,6 +213,7 @@ There are some configs you need to change in the files below
| urladdport | `true` or `false` | set to add port on callback url (port 80 or 443 won't applied) (only applied when domain is set) |
| usecdn | `true` or `false` | set to use CDN resources or not (default is `true`) |
| allowanonymous | `true` or `false` | set to allow anonymous usage (default is `true`) |
+| allowanonymousedits | `true` or `false` | if `allowanonymous` is `true`: allow users to select `freely` permission, allowing guests to edit existing notes (default is `false`) |
| allowfreeurl | `true` or `false` | set to allow new note by accessing not exist note url |
| defaultpermission | `freely`, `editable`, `limited`, `locked`, `protected` or `private` | set notes default permission (only applied on signed users) |
| dburl | `mysql://localhost:3306/database` | set the db url, if set this variable then below db config won't be applied |
diff --git a/lib/config/default.js b/lib/config/default.js
index 40803476..000c154a 100644
--- a/lib/config/default.js
+++ b/lib/config/default.js
@@ -16,6 +16,7 @@ module.exports = {
protocolusessl: false,
usecdn: true,
allowanonymous: true,
+ allowanonymousedits: false,
allowfreeurl: false,
defaultpermission: 'editable',
dburl: '',
diff --git a/lib/config/environment.js b/lib/config/environment.js
index 5a297382..eedd4913 100644
--- a/lib/config/environment.js
+++ b/lib/config/environment.js
@@ -18,6 +18,7 @@ module.exports = {
alloworigin: toArrayConfig(process.env.HMD_ALLOW_ORIGIN),
usecdn: toBooleanConfig(process.env.HMD_USECDN),
allowanonymous: toBooleanConfig(process.env.HMD_ALLOW_ANONYMOUS),
+ allowanonymousedits: toBooleanConfig(process.env.HMD_ALLOW_ANONYMOUS_EDITS),
allowfreeurl: toBooleanConfig(process.env.HMD_ALLOW_FREEURL),
defaultpermission: process.env.HMD_DEFAULT_PERMISSION,
dburl: process.env.HMD_DB_URL,
diff --git a/lib/config/index.js b/lib/config/index.js
index d44207bf..3d22c3c3 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -49,7 +49,7 @@ if (config.ldap.tlsca) {
// Permission
config.permission = Permission
-if (!config.allowanonymous) {
+if (!config.allowanonymous && !config.allowanonymousedits) {
delete config.permission.freely
}
if (!(config.defaultpermission in config.permission)) {
diff --git a/lib/realtime.js b/lib/realtime.js
index e03e2d0b..c731e5b0 100644
--- a/lib/realtime.js
+++ b/lib/realtime.js
@@ -781,7 +781,7 @@ function connection (socket) {
var note = notes[noteId]
// Only owner can change permission
if (note.owner && note.owner === socket.request.user.id) {
- if (permission === 'freely' && !config.allowanonymous) return
+ if (permission === 'freely' && !config.allowanonymous && !config.allowanonymousedits) return
note.permission = permission
models.Note.update({
permission: permission
diff --git a/lib/response.js b/lib/response.js
index 9f3d5a44..6c64d245 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -60,6 +60,7 @@ function showIndex (req, res, next) {
url: config.serverurl,
useCDN: config.usecdn,
allowAnonymous: config.allowanonymous,
+ allowAnonymousEdits: config.allowanonymousedits,
facebook: config.isFacebookEnable,
twitter: config.isTwitterEnable,
github: config.isGitHubEnable,
@@ -93,6 +94,7 @@ function responseHackMD (res, note) {
title: title,
useCDN: config.usecdn,
allowAnonymous: config.allowanonymous,
+ allowAnonymousEdits: config.allowanonymousedits,
facebook: config.isFacebookEnable,
twitter: config.isTwitterEnable,
github: config.isGitHubEnable,
diff --git a/locales/de.json b/locales/de.json
index de76b590..73ffe0e6 100644
--- a/locales/de.json
+++ b/locales/de.json
@@ -29,6 +29,8 @@
"Import from browser": "Vom Browser importieren",
"Releases": "Versionen",
"Are you sure?": "Sind sie sicher?",
+ "Do you really want to delete this note?": "Möchten Sie diese Notiz wirklich löschen?",
+ "All users will lose their connection.": "Alle Benutzer werden getrennt.",
"Cancel": "Abbrechen",
"Yes, do it!": "Ja, mach es!",
"Choose method": "Methode wählen",
@@ -60,6 +62,7 @@
"Refresh": "Neu laden",
"Contacts": "Kontakte",
"Report an issue": "Fehlerbericht senden",
+ "Meet us on Gitter": "Triff uns auf Gitter",
"Send us email": "Kontakt",
"Documents": "Dokumente",
"Features": "Funktionen",
@@ -100,5 +103,6 @@
"Select From Available Snippets": "Aus verfügbaren Snippets wählen",
"OR": "Oder",
"Export to Snippet": "Zu Snippet exportieren",
- "Select Visibility Level": "Sichtbarkeit bestimmen"
+ "Select Visibility Level": "Sichtbarkeit bestimmen",
+ "Night Theme": "Nachtmodus"
}
diff --git a/locales/en.json b/locales/en.json
index 49e93a83..e6a966d7 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -62,6 +62,7 @@
"Refresh": "Refresh",
"Contacts": "Contacts",
"Report an issue": "Report an issue",
+ "Meet us on Gitter": "Meet us on Gitter",
"Send us email": "Send us email",
"Documents": "Documents",
"Features": "Features",
diff --git a/locales/zh-CN.json b/locales/zh-CN.json
index 97602c82..eeb01291 100644
--- a/locales/zh-CN.json
+++ b/locales/zh-CN.json
@@ -60,6 +60,7 @@
"Refresh": "重新整理",
"Contacts": "联络方式",
"Report an issue": "报告问题",
+ "Meet us on Gitter": "在 Gitter 上联系我们",
"Send us email": "寄信给我们",
"Documents": "文件",
"Features": "功能简介",
@@ -101,4 +102,4 @@
"OR": "或是",
"Export to Snippet": "导出到 Snippet",
"Select Visibility Level": "选择可见层级"
-} \ No newline at end of file
+}
diff --git a/locales/zh-TW.json b/locales/zh-TW.json
index a3bb7774..c55758ab 100644
--- a/locales/zh-TW.json
+++ b/locales/zh-TW.json
@@ -60,6 +60,7 @@
"Refresh": "重新整理",
"Contacts": "聯絡方式",
"Report an issue": "回報問題",
+ "Meet us on Gitter": "透過 Gitter 聯絡我們",
"Send us email": "寄信給我們",
"Documents": "文件",
"Features": "功能簡介",
@@ -101,4 +102,4 @@
"OR": "或是",
"Export to Snippet": "匯出到 Snippet",
"Select Visibility Level": "選擇可見層級"
-} \ No newline at end of file
+}
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/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/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>