Commit 35c2c3fcaf1c0c77cb3731f93319107382ec06de
alert user about no drafts in markdown-editor mode
mix irving committed on 6/27/2018, 12:33:52 AMParent: 999c774d09af674766d49b3cd7636a575006b27a
Files changed
app/page/blogNew.js | changed |
app/page/blogNew.mcss | changed |
translations/en.js | changed |
app/page/blogNew.js | ||
---|---|---|
@@ -98,8 +98,9 @@ | ||
98 | 98 | 'ev-input': e => meta.summary.set(e.target.value), |
99 | 99 | placeholder: strings.blogNew.field.summary |
100 | 100 | }) |
101 | 101 | ]), |
102 | + h('div.warning', strings.blogNew.markdownWarning), | |
102 | 103 | composer |
103 | 104 | ]) |
104 | 105 | ]) |
105 | 106 | ]) |
@@ -133,8 +134,9 @@ | ||
133 | 134 | body: hasBody ? composer.innerHTML : null |
134 | 135 | } |
135 | 136 | api.drafts.sync.set(DRAFT_LOCATION, draft) |
136 | 137 | } |
138 | + | |
137 | 139 | function throttledSaveDraft ({ composer, meta, api }) { |
138 | 140 | return throttle(() => saveDraft({ composer, meta, api }), 2000) |
139 | 141 | } |
140 | 142 |
app/page/blogNew.mcss | ||
---|---|---|
@@ -94,8 +94,12 @@ | ||
94 | 94 | |
95 | 95 | -channel {} |
96 | 96 | } |
97 | 97 | |
98 | + div.warning { | |
99 | + display: none | |
100 | + } | |
101 | + | |
98 | 102 | div.editor.Markdown { |
99 | 103 | $markdownBlog |
100 | 104 | |
101 | 105 | background-color: #fff |
@@ -129,13 +133,23 @@ | ||
129 | 133 | Page -blogNew -markdown { |
130 | 134 | div.content { |
131 | 135 | div.container { |
132 | 136 | div.field { |
137 | + -summary { | |
138 | + margin-bottom: 2rem | |
139 | + } | |
140 | + | |
133 | 141 | -attachment { |
134 | 142 | input { display: none } |
135 | 143 | } |
136 | 144 | } |
137 | 145 | |
146 | + div.warning { | |
147 | + display: initial | |
148 | + font-weight: bold | |
149 | + margin: 1rem | |
150 | + } | |
151 | + | |
138 | 152 | div.editor.Markdown { |
139 | 153 | display: none |
140 | 154 | /* $markdownBlog */ |
141 | 155 | |
@@ -163,8 +177,13 @@ | ||
163 | 177 | border: none |
164 | 178 | border-radius: 0 |
165 | 179 | margin-top: .5rem |
166 | 180 | } |
181 | + | |
182 | + section.actions { | |
183 | + input { display: initial } | |
184 | + div.Button { display: flex } | |
185 | + } | |
167 | 186 | } |
168 | 187 | } |
169 | 188 | } |
170 | 189 |
translations/en.js | ||
---|---|---|
@@ -44,9 +44,10 @@ | ||
44 | 44 | actions: { |
45 | 45 | edit: 'Edit', |
46 | 46 | preview: 'Preview', |
47 | 47 | writeBlog: 'Write your blog here' |
48 | - } | |
48 | + }, | |
49 | + markdownWarning: 'Markdown editor: auto-saving of drafts is not currently supported. You can change your editor in settings' | |
49 | 50 | }, |
50 | 51 | channel: 'Channel', |
51 | 52 | loading: 'Loading...', |
52 | 53 | optionalField: 'optional', |
Built with git-ssb-web