Move Browser & Upload to own namespace
This commit is contained in:
parent
051253a745
commit
50316bbb80
20 changed files with 77 additions and 121 deletions
|
|
@ -166,7 +166,7 @@ $(function() {
|
|||
|
||||
/* event from comment textarea button popups */
|
||||
/* insert returned bbcode at cursor position or replace selected text */
|
||||
$('body').on('fbrowser.photos.comment', function(e, filename, bbcode, id) {
|
||||
$('body').on('fbrowser.photo.comment', function(e, filename, bbcode, id) {
|
||||
$.colorbox.close();
|
||||
var textarea = document.getElementById("comment-edit-text-" +id);
|
||||
var start = textarea.selectionStart;
|
||||
|
|
@ -1069,7 +1069,7 @@ var Dialog = {
|
|||
* to the event handler
|
||||
*/
|
||||
doImageBrowser : function (name, id) {
|
||||
var url = Dialog._get_url('photos', name, id);
|
||||
var url = Dialog._get_url('photo', name, id);
|
||||
return Dialog.show(url);
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue