diff options
| author | Shyam Sunder | 2018-09-13 15:48:13 -0400 |
|---|---|---|
| committer | Marcin Kurczewski | 2018-09-24 11:36:13 +0200 |
| commit | 2235a72d2fa0f8216a868698d31cd8774444d7a5 (patch) | |
| tree | fd828c52c6d341d40dae2892345b21237c348419 /client | |
| parent | c8fe0fcdff0ba0c84183da2b07a5e02b1af0cc69 (diff) | |
server+client: added sound flag to video posts
Diffstat (limited to 'client')
| -rw-r--r-- | client/html/post_edit_sidebar.tpl | 5 | ||||
| -rw-r--r-- | client/html/post_readonly_sidebar.tpl | 3 | ||||
| -rw-r--r-- | client/js/controls/post_edit_sidebar_control.js | 16 |
3 files changed, 21 insertions, 3 deletions
diff --git a/client/html/post_edit_sidebar.tpl b/client/html/post_edit_sidebar.tpl index 4c05561..a66a375 100644 --- a/client/html/post_edit_sidebar.tpl +++ b/client/html/post_edit_sidebar.tpl @@ -50,6 +50,11 @@ name: 'loop', checked: ctx.post.flags.includes('loop'), }) %> + <%= ctx.makeCheckbox({ + text: 'Sound', + name: 'sound', + checked: ctx.post.flags.includes('sound'), + }) %> </section> <% } %> diff --git a/client/html/post_readonly_sidebar.tpl b/client/html/post_readonly_sidebar.tpl index 54208ef..401ce20 100644 --- a/client/html/post_readonly_sidebar.tpl +++ b/client/html/post_readonly_sidebar.tpl @@ -14,6 +14,9 @@ }[ctx.post.mimeType] %> </a> (<%- ctx.post.canvasWidth %>x<%- ctx.post.canvasHeight %>) + <% if (ctx.post.flags.includes('sound')) { %> + <i class='fa fa-volume-up'></i> + <% } %> </section> <section class='upload-info'> diff --git a/client/js/controls/post_edit_sidebar_control.js b/client/js/controls/post_edit_sidebar_control.js index dd8b66d..a5af449 100644 --- a/client/js/controls/post_edit_sidebar_control.js +++ b/client/js/controls/post_edit_sidebar_control.js @@ -331,9 +331,7 @@ class PostEditSidebarControl extends events.EventTarget { .value.toLowerCase() : undefined, - flags: this._loopVideoInputNode ? - (this._loopVideoInputNode.checked ? ['loop'] : []) : - undefined, + flags: this._videoFlags, tags: this._tagInputNode ? misc.splitByWhitespace(this._tagInputNode.value) : @@ -375,6 +373,18 @@ class PostEditSidebarControl extends events.EventTarget { return this._formNode.querySelector('.flags input[name=loop]'); } + get _soundVideoInputNode() { + return this._formNode.querySelector('.flags input[name=sound]'); + } + + get _videoFlags() { + if (!this._loopVideoInputNode) return undefined; + let ret = []; + if (this._loopVideoInputNode.checked) ret.push('loop'); + if (this._soundVideoInputNode.checked) ret.push('sound'); + return ret; + } + get _relationsInputNode() { return this._formNode.querySelector('.relations input'); } |