diff --git a/src/Console/Addon.php b/src/Console/Addon.php index 8066853246..e4bdeb052b 100644 --- a/src/Console/Addon.php +++ b/src/Console/Addon.php @@ -60,9 +60,9 @@ HELP; { parent::__construct($argv); - $this->appMode = $appMode; - $this->l10n = $l10n; - $this->dba = $dba; + $this->appMode = $appMode; + $this->l10n = $l10n; + $this->dba = $dba; AddonCore::loadAddons(); } @@ -121,27 +121,28 @@ HELP; $this->out($this->getHelp()); return false; } + foreach (AddonCore::getAvailableList() as $addon) { $addon_name = $addon[0]; - $enabled = AddonCore::isEnabled($addon_name) ? "enabled" : "disabled"; - switch ($subCmd) { - case 'all': - $table->addRow([$addon_name, $enabled]); - break; - case 'enabled': - if (!$enabled) { - continue 2; - } - $table->addRow([$addon_name]); - case 'disabled': - if ($enabled) { - continue 2; - } - $table->addRow([$addon_name]); - break; + $enabled = AddonCore::isEnabled($addon_name); + + if ($subCmd === 'all') { + $table->addRow([$addon_name, $enabled ? 'enabled' : 'disabled']); + + continue; } + if ($subCmd === 'enabled' && $enabled === true) { + $table->addRow([$addon_name]); + continue; + } + + if ($subCmd === 'disabled' && $enabled === false) { + $table->addRow([$addon_name]); + continue; + } } + $this->out($table->getTable()); return 0; diff --git a/src/Module/Media/Photo/Upload.php b/src/Module/Media/Photo/Upload.php index 2032c60143..66dc51e9f8 100644 --- a/src/Module/Media/Photo/Upload.php +++ b/src/Module/Media/Photo/Upload.php @@ -163,7 +163,7 @@ class Upload extends \Friendica\BaseModule } $this->logger->info('upload done'); - $this->return(200, "\n\n" . Images::getBBCodeByResource($resource_id, $owner['nickname'], $preview, $image->getExt()) . "\n\n"); + $this->return(200, Images::getBBCodeByResource($resource_id, $owner['nickname'], $preview, $image->getExt())); } /** diff --git a/static/routes.config.php b/static/routes.config.php index 5ebce2738b..88e642c27a 100644 --- a/static/routes.config.php +++ b/static/routes.config.php @@ -602,6 +602,8 @@ return [ '/{type:users}/{guid}' => [Module\Diaspora\Receive::class, [ R::POST]], ], + '/remote_follow/{nickname}' => [Module\Profile\RemoteFollow::class, [R::GET, R::POST]], + '/security' => [ '/password_too_long' => [Module\Security\PasswordTooLong::class, [R::GET, R::POST]], ], diff --git a/view/js/dropzone-factory.js b/view/js/dropzone-factory.js index bdb2353f1d..dcc0468cb2 100644 --- a/view/js/dropzone-factory.js +++ b/view/js/dropzone-factory.js @@ -23,6 +23,10 @@ var DzFactory = function (max_imagesize) { dictRemoveFile: dzStrings.dictRemoveFile, dictMaxFilesExceeded: dzStrings.dictMaxFilesExceeded, accept: function(file, done) { + const targetTextarea = document.getElementById(textareaElementId); + if (targetTextarea.setRangeText) { + targetTextarea.setRangeText("\n[upload-" + file.name + "]\n", targetTextarea.selectionStart, targetTextarea.selectionEnd, "end"); + } done(); }, init: function() { @@ -30,7 +34,8 @@ var DzFactory = function (max_imagesize) { const targetTextarea = document.getElementById(textareaElementId); if (targetTextarea.setRangeText) { //if setRangeText function is supported by current browser - targetTextarea.setRangeText(serverResponse); + let u = "[upload-" + file.name + "]"; + targetTextarea.setRangeText(serverResponse, targetTextarea.value.indexOf(u), targetTextarea.value.indexOf(u) + u.length, "end"); } else { targetTextarea.focus(); document.execCommand('insertText', false /*no UI*/, serverResponse); diff --git a/view/templates/item/compose.tpl b/view/templates/item/compose.tpl index 4cccc924c3..4c7bdebfdb 100644 --- a/view/templates/item/compose.tpl +++ b/view/templates/item/compose.tpl @@ -92,6 +92,9 @@