]> git.mxchange.org Git - friendica.git/blobdiff - view/js/filebrowser.js
Merge pull request #12086 from nupplaphil/feat/move_cal
[friendica.git] / view / js / filebrowser.js
index fc852dcd7564f1f68ba49c47a19d749323bfcd9c..e5bd2730c40a9faa52f097d8a1cbea7fe7b2269d 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Filebrowser - Friendica Communications Server
  *
- * Copyright (c) 2010-2015 the Friendica Project
+ * Copyright (c) 2010-2021, the Friendica project
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -77,8 +77,7 @@ var FileBrowser = {
 
                $(".folders a, .path a").on("click", function(e){
                        e.preventDefault();
-                       var url = baseurl + "/fbrowser/" + FileBrowser.type + "/" + this.dataset.folder + "?mode=minimal" + location['hash'];
-                       location.href = url;
+                       location.href = baseurl + "/fbrowser/" + FileBrowser.type + "/" + encodeURIComponent(this.dataset.folder) + "?mode=minimal" + location['hash'];
                });
 
                $(".photo-album-photo-link").on('click', function(e){
@@ -86,7 +85,7 @@ var FileBrowser = {
 
                        var embed = "";
                        if (FileBrowser.type == "image") {
-                               embed = "[url="+this.dataset.link+"][img]"+this.dataset.img+"[/img][/url]";
+                               embed = "[url="+this.dataset.link+"][img="+this.dataset.img+"]"+this.dataset.alt+"[/img][/url]";
                        }
                        if (FileBrowser.type=="file") {
                                // attachment links are "baseurl/attach/id"; we need id
@@ -104,7 +103,7 @@ var FileBrowser = {
                if ($("#upload-image").length)
                        var image_uploader = new window.AjaxUpload(
                                'upload-image',
-                               { action: 'wall_upload/'+FileBrowser.nickname+'?response=json',
+                               { action: 'profile/' + FileBrowser.nickname + '/photos/upload?response=json',
                                        name: 'userfile',
                                        responseType: 'json',
                                        onSubmit: function(file,ext) { $('#profile-rotator').show(); $(".error").addClass('hidden'); },
@@ -124,8 +123,9 @@ var FileBrowser = {
                if ($("#upload-file").length)
                        var file_uploader = new window.AjaxUpload(
                                'upload-file',
-                               { action: 'wall_attach/'+FileBrowser.nickname+'?response=json',
+                               { action: 'profile/' + FileBrowser.nickname + '/attachment/upload?response=json',
                                        name: 'userfile',
+                                       responseType: 'json',
                                        onSubmit: function(file,ext) { $('#profile-rotator').show(); $(".error").addClass('hidden'); },
                                        onComplete: function(file,response) {
                                                if (response['error']!= undefined) {