Browse Source
Fix files_versions app LoadSidebar event
Fix files_versions app LoadSidebar event
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>pull/17829/head
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
7 changed files with 149 additions and 30 deletions
-
3apps/files_versions/appinfo/app.php
-
2apps/files_versions/composer/composer/autoload_classmap.php
-
2apps/files_versions/composer/composer/autoload_static.php
-
39apps/files_versions/lib/AppInfo/Application.php
-
43apps/files_versions/lib/Hooks.php
-
45apps/files_versions/lib/Listener/LoadAdditionalListener.php
-
45apps/files_versions/lib/Listener/LoadSidebarListener.php
@ -0,0 +1,45 @@ |
|||
<?php |
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl> |
|||
* |
|||
* @author Roeland Jago Douma <roeland@famdouma.nl> |
|||
* @author John Molakvoæ <skjnldsv@protonmail.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/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Files_Versions\Listener; |
|||
|
|||
use OCA\Files_Versions\AppInfo\Application; |
|||
use OCA\Files\Event\LoadAdditionalScriptsEvent; |
|||
use OCP\EventDispatcher\Event; |
|||
use OCP\EventDispatcher\IEventListener; |
|||
use OCP\Util; |
|||
|
|||
class LoadAdditionalListener implements IEventListener { |
|||
public function handle(Event $event): void { |
|||
if (!($event instanceof LoadAdditionalScriptsEvent)) { |
|||
return; |
|||
} |
|||
|
|||
// TODO: make sure to only include the sidebar script when
|
|||
// we properly split it between files list and sidebar
|
|||
Util::addScript(Application::APP_ID, 'files_versions'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
<?php |
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl> |
|||
* |
|||
* @author Roeland Jago Douma <roeland@famdouma.nl> |
|||
* @author John Molakvoæ <skjnldsv@protonmail.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/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Files_Versions\Listener; |
|||
|
|||
use OCA\Files_Versions\AppInfo\Application; |
|||
use OCA\Files\Event\LoadSidebar; |
|||
use OCP\EventDispatcher\Event; |
|||
use OCP\EventDispatcher\IEventListener; |
|||
use OCP\Util; |
|||
|
|||
class LoadSidebarListener implements IEventListener { |
|||
public function handle(Event $event): void { |
|||
if (!($event instanceof LoadSidebar)) { |
|||
return; |
|||
} |
|||
|
|||
// TODO: make sure to only include the sidebar script when
|
|||
// we properly split it between files list and sidebar
|
|||
Util::addScript(Application::APP_ID, 'files_versions'); |
|||
} |
|||
|
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue