Allow default anonymous uploads
This commit is contained in:
parent
881cfe026c
commit
9533de5c8c
3 changed files with 19 additions and 5 deletions
|
@ -53,6 +53,9 @@ $cancel-button-color = tomato
|
|||
.pause-remain-on-error
|
||||
margin-left: 1em
|
||||
|
||||
.upload-all-anonymous
|
||||
margin-left: 1em
|
||||
|
||||
form>.messages
|
||||
margin-top: 1em
|
||||
|
||||
|
|
|
@ -29,6 +29,14 @@
|
|||
}) %>
|
||||
</span>
|
||||
|
||||
<span class='upload-all-anonymous'>
|
||||
<%= ctx.makeCheckbox({
|
||||
text: 'Upload anonymously',
|
||||
name: 'upload-all-anonymous',
|
||||
checked: false,
|
||||
}) %>
|
||||
</span>
|
||||
|
||||
<%= ctx.makeTextInput({placeholder: 'Common tags', id: 'common-tags', name: 'common-tags', style: 'margin-top:1em;'}) %>
|
||||
|
||||
<input type='button' value='Cancel' class='cancel'/>
|
||||
|
|
|
@ -313,12 +313,11 @@ class PostUploadView extends events.EventTarget {
|
|||
uploadable.safety = safetyNode.value;
|
||||
}
|
||||
|
||||
const anonymousNode = rowNode.querySelector(
|
||||
".anonymous input:checked"
|
||||
);
|
||||
if (anonymousNode) {
|
||||
uploadable.anonymous = true;
|
||||
let anonymous = this._uploadAllAnonymous?.checked;
|
||||
if (!anonymous) {
|
||||
anonymous = rowNode.querySelector(".anonymous input:checked");
|
||||
}
|
||||
uploadable.anonymous = anonymous;
|
||||
|
||||
uploadable.tags = [];
|
||||
if (this._commonTagsInputNode) {
|
||||
|
@ -460,6 +459,10 @@ class PostUploadView extends events.EventTarget {
|
|||
);
|
||||
}
|
||||
|
||||
get _uploadAllAnonymous() {
|
||||
return this._hostNode.querySelector("form [name=upload-all-anonymous]");
|
||||
}
|
||||
|
||||
get _submitButtonNode() {
|
||||
return this._hostNode.querySelector("form [type=submit]");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue