1
0
Fork 0

Move FileBrowser to own namespace & Bugfix album usage

This commit is contained in:
Philipp Holzer 2022-11-27 00:28:29 +01:00
commit 051253a745
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
12 changed files with 38 additions and 34 deletions

View file

@ -132,7 +132,7 @@ Dialog.show = function (url, title) {
Dialog._get_url = function (type, name, id) {
var hash = name;
if (id !== undefined) hash = hash + "-" + id;
return 'profile/' + localNickname + '/' + type + '/browser?mode=none&theme=frio#' + hash;
return 'media/' + type + '/browser?mode=none&theme=frio#' + hash;
};
// Does load the filebrowser into the jot modal.
@ -159,14 +159,14 @@ Dialog._load = function (url) {
let filebrowser = document.getElementById("filebrowser");
// Try to fetch the hash form the url.
let match = url.match(/profile\/[a-z]+\/.*(#.*)/);
let match = url.match(/media\/[a-z]+\/.*(#.*)/);
if (!filebrowser || match === null) {
return; //not fbrowser
}
// Initialize the filebrowser.
loadScript("view/js/ajaxupload.js");
loadScript("view/theme/frio/js/filebrowser.js", function () {
loadScript("view/theme/frio/js/module/media/filebrowser.js", function () {
FileBrowser.init(filebrowser.dataset.nickname, filebrowser.dataset.type, match[1]);
});
};

View file

@ -246,7 +246,7 @@ var FileBrowser = {
_getUrl: function (mode, folder) {
let folderValue = folder !== undefined ? folder : FileBrowser.folder;
let folderUrl = folderValue !== undefined ? '/' + encodeURIComponent(folderValue) : '';
return 'profile/' + FileBrowser.nickname + '/' + FileBrowser.type + '/browser' + folderUrl + '?mode=' + mode + "&theme=frio";
return 'media/' + FileBrowser.type + '/browser' + folderUrl + '?mode=' + mode + "&theme=frio";
}
};
// @license-end

View file

@ -5,7 +5,6 @@ They are loaded into the html <head> so that js functions can use them *}}
var updateInterval = {{$update_interval}};
var localUser = {{if $local_user}}{{$local_user}}{{else}}false{{/if}};
var localNickname = {{if $local_nickname}}"{{$local_nickname|escape:'javascript' nofilter}}"{{else}}false{{/if}};
var aStr = {
'delitem' : "{{$delitem|escape:'javascript' nofilter}}",
'blockAuthor' : "{{$blockAuthor|escape:'javascript' nofilter}}",