Move Browser & Upload to own namespace

This commit is contained in:
Philipp 2022-11-27 01:25:59 +01:00
parent 051253a745
commit 50316bbb80
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
20 changed files with 77 additions and 121 deletions

View file

@ -84,7 +84,7 @@ const FileBrowser = {
e.preventDefault();
let embed = '';
if (FileBrowser.type === "photos") {
if (FileBrowser.type === "photo") {
embed = '[url=' + this.dataset.link + '][img=' + this.dataset.img + ']' + this.dataset.alt + '[/img][/url]';
}
if (FileBrowser.type === "attachment") {
@ -99,12 +99,11 @@ const FileBrowser = {
});
if ($('#upload-photos').length)
{
if ($('#upload-photo').length) {
new window.AjaxUpload(
'upload-photos',
'upload-photo',
{
action: 'profile/' + FileBrowser.nickname + '/photos/upload?response=json',
action: 'media/photo/upload?response=json',
name: 'userfile',
responseType: 'json',
onSubmit: function (file, ext) {
@ -125,12 +124,11 @@ const FileBrowser = {
);
}
if ($('#upload-attachment').length)
{
if ($('#upload-attachment').length) {
new window.AjaxUpload(
'upload-attachment',
{
action: 'profile/' + FileBrowser.nickname + '/attachment/upload?response=json',
action: 'media/attachment/upload?response=json',
name: 'userfile',
responseType: 'json',
onSubmit: function (file, ext) {
@ -148,8 +146,8 @@ const FileBrowser = {
location.reload();
}
}
);
}
);
}
},
_getUrl: function (mode, hash, folder) {