Commit 1cdd4790 authored by Matthieu Le Corre's avatar Matthieu Le Corre

Add mimetype registration

Signed-off-by: Matthieu Le Corre's avatarMatthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
parent dd92f507
......@@ -4,7 +4,7 @@
<name>Whiteboard</name>
<summary>A collaborative white board</summary>
<description><![CDATA[ A collaborative white board ]]></description>
<version>0.0.1</version>
<version>0.0.2</version>
<licence>agpl</licence>
<author mail="matthieu.lecorre@univ-nantes.fr" homepage="http://www.univ-nantes.fr">Matthieu Le Corre</author>
<namespace>whiteboard</namespace>
......@@ -16,4 +16,9 @@
<dependencies>
<nextcloud min-version="18" max-version="18"/>
</dependencies>
<repair-steps>
<install>
<step>OCA\whiteboard\Migration\RegisterMimeType</step>
</install>
</repair-steps>
</info>
\ No newline at end of file
......@@ -10,8 +10,9 @@
display: block;
}
tr[data-mime='application/whiteboard'] div.thumbnail,
.icon-whiteboard {
background-image: url("../img/wbr.svg");
background-image: url("../img/wbr.svg") !important ;
}
.icon-save {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
/**
* @author 2020 Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
* @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\whiteboard\Migration;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
use OCP\ILogger;
class RegisterMimeType implements IRepairStep {
protected $logger;
private $customMimetypeMapping;
public function __construct(ILogger $logger) {
$this->logger = $logger;
}
public function getName() {
return 'Register MIME type for whiteboard';
}
public function run(IOutput $output) {
$this->logger->info('Registering the mimetype...');
$mimetypeMapping = array(
"wbr" => array("application/whiteboard")
) ;
$mimetypeMappingFile = \OC::$configDir . 'mimetypemapping.json';
if (file_exists($mimetypeMappingFile)) {
$existingMimetypeMapping = json_decode(file_get_contents($mimetypeMappingFile), true);
$mimetypeMapping = array_merge($existingMimetypeMapping, $mimetypeMapping);
}
file_put_contents($mimetypeMappingFile, json_encode($mimetypeMapping, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
$this->logger->info('The mimetype was successfully registered.');
}
}
\ No newline at end of file
<?php
/**
* @author 2019 Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
* @author 2020 Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
* @license GNU AGPL version 3 or any later version
*
......
......@@ -22,7 +22,7 @@ import ApplicationPrototype from './prototype.js'
const APP_NAME = 'whiteboard'
const APP_EXT = 'wbr'
const APP_MIME = 'application/wbr'
const APP_MIME = 'application/whiteboard'
__webpack_nonce__ = btoa(OC.requestToken) // eslint-disable-line
__webpack_public_path__ = OC.linkTo(APP_NAME, 'js/') // eslint-disable-line
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment