]> git.mxchange.org Git - friendica.git/commitdiff
Apply suggestions from code review
authorPhilipp <admin+Github@philipp.info>
Sat, 26 Nov 2022 22:34:16 +0000 (23:34 +0100)
committerPhilipp <admin@philipp.info>
Sun, 27 Nov 2022 00:34:58 +0000 (01:34 +0100)
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
src/Model/Photo.php
view/js/filebrowser.js
view/js/main.js
view/theme/frio/js/filebrowser.js
view/theme/frio/js/modal.js

index a139ba715fe1828ff79cc51b056f595568faabfd..12d0c2f92cb1098f3b097f3ec263bc3a4b151858 100644 (file)
@@ -185,7 +185,7 @@ class Photo
        {
                $photos = DBA::toArray(
                        DBA::p(
-                               "SELECT DISTINCT(`album`) AS `albume` FROM `photo` WHERE `uid` = ? AND NOT `photo-type` IN (?, ?)",
+                               "SELECT DISTINCT(`album`) AS `album` FROM `photo` WHERE `uid` = ? AND NOT `photo-type` IN (?, ?)",
                                $uid,
                                static::CONTACT_AVATAR,
                                static::CONTACT_BANNER
index 1b8a4d51fb18737eebe0f56c622dd30098f46a02..a1ed09d24d91b615972c22f4ca33902c07d61422 100644 (file)
@@ -60,11 +60,11 @@ const FileBrowser = {
        init: function (nickname, type) {
                FileBrowser.nickname = nickname;
                FileBrowser.type = type;
-               FileBrowser.event = "fbrowser." + type;
-               if (location['hash'] !== "") {
+               FileBrowser.event = 'fbrowser.' + type;
+               if (location['hash'] !== '') {
                        const h = location['hash'].replace('#', '');
-                       FileBrowser.event = FileBrowser.event + "." + h.split("-")[0];
-                       FileBrowser.id = h.split("-")[1];
+                       FileBrowser.event = FileBrowser.event + '.' + h.split('-')[0];
+                       FileBrowser.id = h.split('-')[1];
                }
 
                console.log('FileBrowser:', nickname, type, FileBrowser.event, FileBrowser.id);
index 3ba8240fedec23ede480d3a46f860b7aeb937a81..782eb4ec56999aa0e2d604e553d2b11480eabab4 100644 (file)
@@ -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.photos.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('photos', name, id);
                return Dialog.show(url);
        },
 
@@ -1086,7 +1086,7 @@ var Dialog = {
         * to the event handler
         */
        doFileBrowser : function (name, id) {
-               var url = Dialog._get_url("attachment",name,id);
+               var url = Dialog._get_url('attachment', name, id);
                return Dialog.show(url);
        },
 
index d7217fdbc67dc438c06ca8ba1a75b40c2b27b2f5..b8e5086450da7875360e2204f0f91dbbcbef6cbd 100644 (file)
@@ -113,7 +113,6 @@ var FileBrowser = {
                                embed = '[url=' + this.dataset.link + '][img=' + this.dataset.img + ']' + this.dataset.alt + '[/img][/url]';
                        }
                        if (FileBrowser.type === 'attachment') {
-                               // attachment links are "baseurl/attach/id"; we need id
                                embed = '[attachment]' + this.dataset.link + '[/attachment]';
                        }
 
index 5e21a0b0bdb9ac9ce1d37c5f247ffcfce6aa2bf4..d54bd40c97bc3f2b78d3df236bd9ef79f156382c 100644 (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 'profile/' + localNickname + '/' + type + '/browser?mode=none&theme=frio#' + hash;
 };
 
 // Does load the filebrowser into the jot modal.