mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 05:23:17 +00:00
Merge pull request #1373 from pixelfed/frontend-ui-refactor
Frontend ui refactor
This commit is contained in:
commit
7eb7c764d7
4 changed files with 26 additions and 26 deletions
|
@ -42,7 +42,7 @@ class VideoThumbnail implements ShouldQueue
|
|||
$name = last($path);
|
||||
try {
|
||||
$t = explode('.', $name);
|
||||
$t = $t[0].'_thumb.png';
|
||||
$t = $t[0].'_thumb.jpeg';
|
||||
$i = count($path) - 1;
|
||||
$path[$i] = $t;
|
||||
$save = implode('/', $path);
|
||||
|
|
|
@ -30,7 +30,7 @@ class AccountTransformer extends Fractal\TransformerAbstract
|
|||
'moved' => null,
|
||||
'fields' => null,
|
||||
'bot' => null,
|
||||
'website' => null,
|
||||
'website' => $profile->website,
|
||||
'software' => 'pixelfed',
|
||||
'is_admin' => (bool) $is_admin
|
||||
];
|
||||
|
|
|
@ -319,7 +319,7 @@ class Helpers {
|
|||
$status->scope = $scope;
|
||||
$status->visibility = $scope;
|
||||
$status->save();
|
||||
// self::importNoteAttachment($res, $status);
|
||||
self::importNoteAttachment($res, $status);
|
||||
return $status;
|
||||
});
|
||||
|
||||
|
@ -330,8 +330,6 @@ class Helpers {
|
|||
|
||||
public static function importNoteAttachment($data, Status $status)
|
||||
{
|
||||
return;
|
||||
|
||||
if(self::verifyAttachments($data) == false) {
|
||||
return;
|
||||
}
|
||||
|
@ -348,28 +346,28 @@ class Helpers {
|
|||
if(in_array($type, $allowed) == false || $valid == false) {
|
||||
continue;
|
||||
}
|
||||
// $info = pathinfo($url);
|
||||
$info = pathinfo($url);
|
||||
|
||||
// // pleroma attachment fix
|
||||
// $url = str_replace(' ', '%20', $url);
|
||||
// pleroma attachment fix
|
||||
$url = str_replace(' ', '%20', $url);
|
||||
|
||||
// $img = file_get_contents($url, false, stream_context_create(['ssl' => ["verify_peer"=>true,"verify_peer_name"=>true]]));
|
||||
// $file = '/tmp/'.str_random(32);
|
||||
// file_put_contents($file, $img);
|
||||
// $fdata = new File($file);
|
||||
// $path = Storage::putFile($storagePath, $fdata, 'public');
|
||||
// $media = new Media();
|
||||
// $media->status_id = $status->id;
|
||||
// $media->profile_id = $status->profile_id;
|
||||
// $media->user_id = null;
|
||||
// $media->media_path = $path;
|
||||
// $media->size = $fdata->getSize();
|
||||
// $media->mime = $fdata->getMimeType();
|
||||
// $media->save();
|
||||
$img = file_get_contents($url, false, stream_context_create(['ssl' => ["verify_peer"=>true,"verify_peer_name"=>true]]));
|
||||
$file = '/tmp/pxmi-'.str_random(32);
|
||||
file_put_contents($file, $img);
|
||||
$fdata = new File($file);
|
||||
$path = Storage::putFile($storagePath, $fdata, 'public');
|
||||
$media = new Media();
|
||||
$media->status_id = $status->id;
|
||||
$media->profile_id = $status->profile_id;
|
||||
$media->user_id = null;
|
||||
$media->media_path = $path;
|
||||
$media->size = $fdata->getSize();
|
||||
$media->mime = $fdata->getMimeType();
|
||||
$media->save();
|
||||
|
||||
// ImageThumbnail::dispatch($media);
|
||||
// ImageOptimize::dispatch($media);
|
||||
// unlink($file);
|
||||
ImageThumbnail::dispatch($media);
|
||||
ImageOptimize::dispatch($media);
|
||||
unlink($file);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -728,8 +728,10 @@ export default {
|
|||
type: 'status',
|
||||
item: this.status.id
|
||||
}).then(res => {
|
||||
swal('Success', 'You have successfully deleted this post', 'success');
|
||||
window.location.href = '/';
|
||||
setTimeout(function() {
|
||||
swal('Success', 'You have successfully deleted this post', 'success');
|
||||
window.location.href = '/';
|
||||
}, 2000);
|
||||
}).catch(err => {
|
||||
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue