diff options
| author | rr- | 2017-02-21 19:09:18 +0100 |
|---|---|---|
| committer | rr- | 2017-02-21 19:09:18 +0100 |
| commit | 5467ca6b7e259f489927c51ad5ab00ef4835e1c2 (patch) | |
| tree | 67dc00966416af6f2f68c8d2890f735190cc54c4 /client | |
| parent | d00d282bff15d37cff7818d39663ad07b3cbee43 (diff) | |
client/posts: improve placeholder in file dropper
The default one was too long to fit in the sidebar
Diffstat (limited to 'client')
| -rw-r--r-- | client/html/file_dropper.tpl | 2 | ||||
| -rw-r--r-- | client/js/controls/file_dropper_control.js | 2 | ||||
| -rw-r--r-- | client/js/controls/post_edit_sidebar_control.js | 5 |
3 files changed, 7 insertions, 2 deletions
diff --git a/client/html/file_dropper.tpl b/client/html/file_dropper.tpl index 3da2f4f..3123cd0 100644 --- a/client/html/file_dropper.tpl +++ b/client/html/file_dropper.tpl @@ -15,7 +15,7 @@ </label> <% if (ctx.allowUrls) { %> <div class='url-holder'> - <input type='text' name='url' placeholder='Alternatively, paste an URL here.'/> + <input type='text' name='url' placeholder='<%- ctx.urlPlaceholder %>'/> <% if (ctx.lock) { %> <button>Confirm</button> <% } else { %> diff --git a/client/js/controls/file_dropper_control.js b/client/js/controls/file_dropper_control.js index 407fa9d..f725ee0 100644 --- a/client/js/controls/file_dropper_control.js +++ b/client/js/controls/file_dropper_control.js @@ -18,6 +18,8 @@ class FileDropperControl extends events.EventTarget { allowUrls: options.allowUrls, lock: options.lock, id: 'file-' + Math.random().toString(36).substring(7), + urlPlaceholder: + options.urlPlaceholder || 'Alternatively, paste an URL here.', }); this._dropperNode = source.querySelector('.file-dropper'); diff --git a/client/js/controls/post_edit_sidebar_control.js b/client/js/controls/post_edit_sidebar_control.js index f1cfe93..3da2fa4 100644 --- a/client/js/controls/post_edit_sidebar_control.js +++ b/client/js/controls/post_edit_sidebar_control.js @@ -72,7 +72,10 @@ class PostEditSidebarControl extends events.EventTarget { if (this._contentInputNode) { this._contentFileDropper = new FileDropperControl( - this._contentInputNode, {allowUrls: true, lock: true}); + this._contentInputNode, { + allowUrls: true, + lock: true, + urlPlaceholder: '...or paste an URL here.'}); this._contentFileDropper.addEventListener('fileadd', e => { this._newPostContent = e.detail.files[0]; }); |