Closed #51 - anonymous uploads; simplified JS
This commit is contained in:
parent
36caef3831
commit
b7084d61ae
3 changed files with 13 additions and 13 deletions
|
@ -89,18 +89,12 @@ $(function()
|
|||
|
||||
var postDom = posts.first();
|
||||
var url = postDom.find('form').attr('action') + '?json';
|
||||
var sourceFile = postDom.data('file');
|
||||
var sourceUrl = postDom.data('url');
|
||||
var tags = postDom.find('[name=tags]').val();
|
||||
var safety = postDom.find('[name=safety]:checked').val();
|
||||
var source = postDom.find('[name=source]').val();
|
||||
var fd = new FormData();
|
||||
fd.append('file', sourceFile);
|
||||
fd.append('url', sourceUrl);
|
||||
fd.append('tags', tags);
|
||||
fd.append('safety', safety);
|
||||
fd.append('source', source);
|
||||
fd.append('submit', 1);
|
||||
console.log(postDom.find('form').get(0));
|
||||
var fd = new FormData(postDom.find('form').get(0));
|
||||
|
||||
fd.append('file', postDom.data('file'));
|
||||
fd.append('url', postDom.data('url'));
|
||||
|
||||
|
||||
var ajaxData =
|
||||
{
|
||||
|
|
|
@ -318,7 +318,7 @@ class PostController
|
|||
$dbPost->upload_date = time();
|
||||
$dbPost->image_width = $imageWidth;
|
||||
$dbPost->image_height = $imageHeight;
|
||||
if ($this->context->loggedIn)
|
||||
if ($this->context->loggedIn and !InputHelper::get('anonymous'))
|
||||
$dbPost->uploader = $this->context->user;
|
||||
$dbPost->ownFavoritee = [];
|
||||
$dbPost->sharedTag = $dbTags;
|
||||
|
|
|
@ -101,6 +101,12 @@
|
|||
<?php $checked = true ?>
|
||||
</label>
|
||||
<?php endforeach ?>
|
||||
<input type="hidden" name="anonymous" value="0"/>
|
||||
<label>
|
||||
<input type="checkbox" name="anonymous" value="1"/>
|
||||
Upload anonymously
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tags">
|
||||
|
|
Loading…
Reference in a new issue