Skip to content

Commit

Permalink
Merge pull request #1688 from nextcloud/enh/import-vcf-from-files
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Aug 21, 2020
2 parents 4291725 + f8a5d29 commit 8de4401
Show file tree
Hide file tree
Showing 27 changed files with 1,182 additions and 1,169 deletions.
Binary file removed img/app.png
Binary file not shown.
4 changes: 4 additions & 0 deletions img/contacts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions img/favicon-mask.svg

This file was deleted.

Binary file removed img/favicon-touch.png
Binary file not shown.
2 changes: 0 additions & 2 deletions img/favicon-touch.svg

This file was deleted.

Binary file removed img/favicon.ico
Binary file not shown.
Binary file removed img/favicon.png
Binary file not shown.
2 changes: 0 additions & 2 deletions img/favicon.svg

This file was deleted.

5 changes: 5 additions & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
namespace OCA\Contacts\AppInfo;

use OCA\Contacts\Dav\PatchPlugin;
use OCA\Contacts\Listener\LoadContactsFilesActions;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCP\AppFramework\App;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\SabrePluginEvent;
Expand Down Expand Up @@ -53,5 +55,8 @@ public function register() {
$server->addPlugin($this->getContainer()->query(PatchPlugin::class));
}
});

// Register files action
$eventDispatcher->addServiceListener(LoadAdditionalScriptsEvent::class, LoadContactsFilesActions::class);
}
}
2 changes: 1 addition & 1 deletion lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function index(): TemplateResponse {
$this->initialStateService->provideInitialState(Application::APP_ID, 'enableSocialSync', $bgSyncEnabledByUser);
$this->initialStateService->provideInitialState(Application::APP_ID, 'contactsinteraction', $this->appManager->isEnabledForUser('contactsinteraction') === true);

Util::addScript(Application::APP_ID, 'contacts');
Util::addScript(Application::APP_ID, 'contacts-main');
Util::addStyle(Application::APP_ID, 'contacts');

return new TemplateResponse(Application::APP_ID, 'main');
Expand Down
1 change: 0 additions & 1 deletion lib/Dav/PatchPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
use Sabre\DAV\ServerPlugin;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\VObject\Component\VCard;
use Sabre\VObject\Reader;

class PatchPlugin extends ServerPlugin {
Expand Down
44 changes: 44 additions & 0 deletions lib/Listener/LoadContactsFilesActions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

declare(strict_types=1);

/**
* @copyright Copyright (c) 2020, John Molakvoæ <[email protected]>
*
* @author John Molakvoæ <[email protected]>
*
* @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/>.
*
*/

namespace OCA\Contacts\Listener;

use OCA\Contacts\AppInfo\Application;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Util;

class LoadContactsFilesActions implements IEventListener {
public function handle(Event $event): void {
if (!($event instanceof LoadAdditionalScriptsEvent)) {
return;
}

Util::addStyle(Application::APP_ID, 'icons');
Util::addScript(Application::APP_ID, 'contacts-files-action');
}
}
Loading

0 comments on commit 8de4401

Please sign in to comment.