Initial NC21 support

This commit is contained in:
Matias De lellis
2021-03-18 14:16:50 -03:00
parent 94060078e0
commit 124d13063b
4 changed files with 26 additions and 47 deletions

View File

@@ -1,5 +1,11 @@
# Changelog # Changelog
## [0.6.4]: 2021-03-18
- Initial Nextcloud 21 support.
- Add new api for uploading attachments. For now only used in the Android
client.
- Update Portuguese (Brazil) thanks to flaviove.
## [0.6.3]: 2020-10-31 ## [0.6.3]: 2020-10-31
- Fix thumbnail when pretty url is disabled. Issue #48 - Fix thumbnail when pretty url is disabled. Issue #48
- Update French translation thanks to Thovi98 - Update French translation thanks to Thovi98

View File

@@ -1,26 +0,0 @@
<?php
/*
* @copyright 2016-2020 Matias De lellis <mati86dl@gmail.com>
*
* @author 2016 Matias De lellis <mati86dl@gmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* 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 the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
use OCA\QuickNotes\AppInfo\Application;
$app = new Application();
$app->register();

View File

@@ -5,7 +5,7 @@
<name>Quick notes</name> <name>Quick notes</name>
<summary>Quick notes with a basic rich text</summary> <summary>Quick notes with a basic rich text</summary>
<description>Quick notes with a basic rich text</description> <description>Quick notes with a basic rich text</description>
<version>0.6.3</version> <version>0.6.4</version>
<licence>agpl</licence> <licence>agpl</licence>
<author>Matias De lellis</author> <author>Matias De lellis</author>
<namespace>QuickNotes</namespace> <namespace>QuickNotes</namespace>
@@ -20,6 +20,6 @@
<screenshot>https://raw.githubusercontent.com/matiasdelellis/quicknotes/master/doc/quicknotes-attachments.jpeg</screenshot> <screenshot>https://raw.githubusercontent.com/matiasdelellis/quicknotes/master/doc/quicknotes-attachments.jpeg</screenshot>
<screenshot>https://raw.githubusercontent.com/matiasdelellis/quicknotes/master/doc/quicknotes-shared-note.jpeg</screenshot> <screenshot>https://raw.githubusercontent.com/matiasdelellis/quicknotes/master/doc/quicknotes-shared-note.jpeg</screenshot>
<dependencies> <dependencies>
<nextcloud min-version="18" max-version="20"/> <nextcloud min-version="20" max-version="20"/>
</dependencies> </dependencies>
</info> </info>

View File

@@ -1,6 +1,6 @@
<?php declare(strict_types=1); <?php declare(strict_types=1);
/* /*
* @copyright 2016-2020 Matias De lellis <mati86dl@gmail.com> * @copyright 2016-2021 Matias De lellis <mati86dl@gmail.com>
* *
* @author 2016 Matias De lellis <mati86dl@gmail.com> * @author 2016 Matias De lellis <mati86dl@gmail.com>
* *
@@ -23,13 +23,16 @@
namespace OCA\QuickNotes\AppInfo; namespace OCA\QuickNotes\AppInfo;
use OCP\AppFramework\App; use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\IL10N; use OCP\IL10N;
use OCP\IURLGenerator; use OCP\IURLGenerator;
use OCP\IServerContainer; use OCP\IServerContainer;
class Application extends App { class Application extends App implements IBootstrap {
/** @var string */ /** @var string */
public const APP_ID = 'quicknotes'; public const APP_ID = 'quicknotes';
@@ -41,31 +44,27 @@ class Application extends App {
parent::__construct(self::APP_ID, $urlParams); parent::__construct(self::APP_ID, $urlParams);
} }
public function register(): void { public function register(IRegistrationContext $context): void {
$this->registerNavigationEntry(); $context->registerCapability(Capabilities::class);
$this->registerCapabilities();
} }
private function registerNavigationEntry(): void { public function boot(IBootContext $context): void {
$container = $this->getContainer(); $server = $context->getServerContainer();
$server = $container->getServer(); $this->registerNavigationEntry($server);
}
$server->getNavigationManager()->add(static function () use ($container) { private function registerNavigationEntry(IServerContainer $server): void {
$urlGenerator = $container->query(IURLGenerator::class); $server->getNavigationManager()->add(static function () use ($server) {
$l10n = $container->query(IL10N::class); $urlGenerator = $server->getURLGenerator();
$l10n = $server->getL10N(self::APP_ID);
return [ return [
'id' => 'quicknotes', 'id' => self::APP_ID,
'order' => 10, 'order' => 10,
'href' => $urlGenerator->linkToRoute('quicknotes.page.index'), 'href' => $urlGenerator->linkToRoute('quicknotes.page.index'),
'icon' => $urlGenerator->imagePath('quicknotes', 'app.svg'), 'icon' => $urlGenerator->imagePath(self::APP_ID, 'app.svg'),
'name' => $l10n->t('Quick notes'), 'name' => $l10n->t('Quick notes')
]; ];
}); });
} }
private function registerCapabilities(): void {
$container = $this->getContainer();
$container->registerCapability(Capabilities::class);
}
} }