client/posts: add file extensions info to upload
This commit is contained in:
parent
1caf76b1b2
commit
aa1f4d3ff8
|
@ -22,6 +22,8 @@ $cancel-button-color = tomato
|
||||||
.file-dropper
|
.file-dropper
|
||||||
font-size: 150%
|
font-size: 150%
|
||||||
padding: 2em
|
padding: 2em
|
||||||
|
small
|
||||||
|
font-size: 60%
|
||||||
|
|
||||||
input[type=submit]
|
input[type=submit]
|
||||||
margin-top: 1em
|
margin-top: 1em
|
||||||
|
|
|
@ -8,6 +8,10 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
<br/>
|
<br/>
|
||||||
Or just click on this box.
|
Or just click on this box.
|
||||||
|
<% if (ctx.extraText) { %>
|
||||||
|
<br/>
|
||||||
|
<small><%= ctx.extraText %></small>
|
||||||
|
<% } %>
|
||||||
</label>
|
</label>
|
||||||
<% if (ctx.allowUrls) { %>
|
<% if (ctx.allowUrls) { %>
|
||||||
<input type='text' name='url' placeholder='Alternatively, paste an URL here.'/>
|
<input type='text' name='url' placeholder='Alternatively, paste an URL here.'/>
|
||||||
|
|
|
@ -11,8 +11,9 @@ class FileDropperControl extends events.EventTarget {
|
||||||
|
|
||||||
this._options = options;
|
this._options = options;
|
||||||
const source = template({
|
const source = template({
|
||||||
allowMultiple: this._options.allowMultiple,
|
extraText: options.extraText,
|
||||||
allowUrls: this._options.allowUrls,
|
allowMultiple: options.allowMultiple,
|
||||||
|
allowUrls: options.allowUrls,
|
||||||
id: 'file-' + Math.random().toString(36).substring(7),
|
id: 'file-' + Math.random().toString(36).substring(7),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -21,7 +22,7 @@ class FileDropperControl extends events.EventTarget {
|
||||||
this._urlConfirmButtonNode = source.querySelector('button');
|
this._urlConfirmButtonNode = source.querySelector('button');
|
||||||
this._fileInputNode = source.querySelector('input[type=file]');
|
this._fileInputNode = source.querySelector('input[type=file]');
|
||||||
this._fileInputNode.style.display = 'none';
|
this._fileInputNode.style.display = 'none';
|
||||||
this._fileInputNode.multiple = this._options.allowMultiple || false;
|
this._fileInputNode.multiple = options.allowMultiple || false;
|
||||||
|
|
||||||
this._counter = 0;
|
this._counter = 0;
|
||||||
this._dropperNode.addEventListener(
|
this._dropperNode.addEventListener(
|
||||||
|
|
|
@ -156,6 +156,8 @@ class PostUploadView extends events.EventTarget {
|
||||||
this._contentFileDropper = new FileDropperControl(
|
this._contentFileDropper = new FileDropperControl(
|
||||||
this._contentInputNode,
|
this._contentInputNode,
|
||||||
{
|
{
|
||||||
|
extraText:
|
||||||
|
'Allowed extensions: .jpg, .png, .gif, .webm, .mp4, .swf',
|
||||||
allowUrls: true,
|
allowUrls: true,
|
||||||
allowMultiple: true,
|
allowMultiple: true,
|
||||||
lock: false,
|
lock: false,
|
||||||
|
|
Loading…
Reference in New Issue