summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorrr- <rr-@sakuya.pl>2017-02-12 10:40:50 +0100
committerrr- <rr-@sakuya.pl>2017-02-12 10:40:50 +0100
commitaa1f4d3ff8061db07111ab006a82edeac2ef7b18 (patch)
tree115f1c61b55a74f598bc56cffdc1b41067a1a201 /client
parent1caf76b1b2e2aaef507b1936a2c5a66c2df140f5 (diff)
client/posts: add file extensions info to upload
Diffstat (limited to 'client')
-rw-r--r--client/css/post-upload.styl2
-rw-r--r--client/html/file_dropper.tpl4
-rw-r--r--client/js/controls/file_dropper_control.js7
-rw-r--r--client/js/views/post_upload_view.js2
4 files changed, 12 insertions, 3 deletions
diff --git a/client/css/post-upload.styl b/client/css/post-upload.styl
index 4da53a7..147df6b 100644
--- a/client/css/post-upload.styl
+++ b/client/css/post-upload.styl
@@ -22,6 +22,8 @@ $cancel-button-color = tomato
.file-dropper
font-size: 150%
padding: 2em
+ small
+ font-size: 60%
input[type=submit]
margin-top: 1em
diff --git a/client/html/file_dropper.tpl b/client/html/file_dropper.tpl
index 9c66201..9e7715d 100644
--- a/client/html/file_dropper.tpl
+++ b/client/html/file_dropper.tpl
@@ -8,6 +8,10 @@
<% } %>
<br/>
Or just click on this box.
+ <% if (ctx.extraText) { %>
+ <br/>
+ <small><%= ctx.extraText %></small>
+ <% } %>
</label>
<% if (ctx.allowUrls) { %>
<input type='text' name='url' placeholder='Alternatively, paste an URL here.'/>
diff --git a/client/js/controls/file_dropper_control.js b/client/js/controls/file_dropper_control.js
index 113e7ac..7b3c120 100644
--- a/client/js/controls/file_dropper_control.js
+++ b/client/js/controls/file_dropper_control.js
@@ -11,8 +11,9 @@ class FileDropperControl extends events.EventTarget {
this._options = options;
const source = template({
- allowMultiple: this._options.allowMultiple,
- allowUrls: this._options.allowUrls,
+ extraText: options.extraText,
+ allowMultiple: options.allowMultiple,
+ allowUrls: options.allowUrls,
id: 'file-' + Math.random().toString(36).substring(7),
});
@@ -21,7 +22,7 @@ class FileDropperControl extends events.EventTarget {
this._urlConfirmButtonNode = source.querySelector('button');
this._fileInputNode = source.querySelector('input[type=file]');
this._fileInputNode.style.display = 'none';
- this._fileInputNode.multiple = this._options.allowMultiple || false;
+ this._fileInputNode.multiple = options.allowMultiple || false;
this._counter = 0;
this._dropperNode.addEventListener(
diff --git a/client/js/views/post_upload_view.js b/client/js/views/post_upload_view.js
index 144526b..f80135f 100644
--- a/client/js/views/post_upload_view.js
+++ b/client/js/views/post_upload_view.js
@@ -156,6 +156,8 @@ class PostUploadView extends events.EventTarget {
this._contentFileDropper = new FileDropperControl(
this._contentInputNode,
{
+ extraText:
+ 'Allowed extensions: .jpg, .png, .gif, .webm, .mp4, .swf',
allowUrls: true,
allowMultiple: true,
lock: false,