Move mod/fbrowser to src\Modules\Attachment|Photos\Browser

This commit is contained in:
Philipp 2022-11-25 23:43:07 +01:00
parent a95e93c725
commit d0b16b2fc1
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
24 changed files with 483 additions and 233 deletions

View file

@ -82,7 +82,7 @@ $(document).ready(function () {
});
// Insert filebrowser images into the input field (field_fileinput.tpl).
$("body").on("fbrowser.image.input", function (e, filename, embedcode, id, img) {
$("body").on("fbrowser.photos.input", function (e, filename, embedcode, id, img) {
// Select the clicked button by it's attribute.
var elm = $("[image-input='select']");
// Select the input field which belongs to this button.
@ -132,12 +132,12 @@ Dialog.show = function (url, title) {
Dialog._get_url = function (type, name, id) {
var hash = name;
if (id !== undefined) hash = hash + "-" + id;
return "fbrowser/" + type + "/?mode=none&theme=frio#" + hash;
return "profile/" + localNickname + "/" + type + "/browser?mode=none&theme=frio#" + hash;
};
// Does load the filebrowser into the jot modal.
Dialog.showJot = function () {
var type = "image";
var type = "photos";
var name = "main";
var url = Dialog._get_url(type, name);
@ -159,7 +159,7 @@ Dialog._load = function (url) {
let filebrowser = document.getElementById("filebrowser");
// Try to fetch the hash form the url.
let match = url.match(/fbrowser\/[a-z]+\/.*(#.*)/);
let match = url.match(/profile\/[a-z]+\/.*(#.*)/);
if (!filebrowser || match === null) {
return; //not fbrowser
}