Commit d1e537bd authored by Matthieu Le Corre's avatar Matthieu Le Corre

Initial commit

Signed-off-by: Matthieu Le Corre's avatarMatthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
parents
<?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/>.
*
*/
$app = new \OCA\whiteboard\AppInfo\Application() ;
\ No newline at end of file
<?xml version="1.0"?>
<info>
<id>whiteboard</id>
<name>Whiteboard</name>
<summary>A collaborative white board</summary>
<description><![CDATA[ A collaborative white board ]]></description>
<version>0.0.1</version>
<licence>agpl</licence>
<author mail="matthieu.lecorre@univ-nantes.fr" homepage="http://www.univ-nantes.fr">Matthieu Le Corre</author>
<namespace>whiteboard</namespace>
<category>files</category>
<category>office</category>
<website>https://gitlab.univ-nantes.fr/uncloud/whiteboard/</website>
<bugs>https://gitlab.univ-nantes.fr/uncloud/whiteboard/issues</bugs>
<screenshot>https://gitlab.univ-nantes.fr/uncloud/whiteboard/raw/master/screenshot.png</screenshot>
<dependencies>
<nextcloud min-version="18" max-version="18"/>
</dependencies>
</info>
\ No newline at end of file
.icon-whiteboard {
background-image: url("../img/whiteboard.svg");
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="128px" height="128px" viewBox="0 0 128 128" enable-background="new 0 0 128 128" xml:space="preserve">
<circle fill="none" stroke="#000000" stroke-miterlimit="10" cx="64" cy="64" r="60"/>
<path fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" d="M108,79.958c0,10.605-6.717,19.205-15.808,19.04h-60
C24.715,99.163,18,90.563,18,79.958v-33.61c0-10.606,6.715-19.205,15-19.205h60c8.283,0,15,8.599,15,19.205V79.958z"/>
<path fill="none" stroke="#000000" stroke-miterlimit="10" d="M63,108"/>
<path fill="none" stroke="#000000" stroke-miterlimit="10" d="M63,90"/>
<path fill="none" stroke="#000000" stroke-miterlimit="10" d="M54,117"/>
<path fill="none" stroke="#000000" stroke-miterlimit="10" d="M63,108"/>
<path fill="none" stroke="#000000" stroke-miterlimit="10" d="M72,117"/>
<path fill="none" stroke="#000000" stroke-miterlimit="10" d="M63,108"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="36" y1="36" x2="54" y2="36"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="27" y1="45" x2="99" y2="45"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="27" y1="54" x2="99" y2="54"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="27" y1="63" x2="99" y2="63"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="27" y1="81" x2="99" y2="81"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="72" y1="90" x2="90" y2="90"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="27" y1="72" x2="99" y2="72"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="128px" height="128px" viewBox="0 0 128 128" enable-background="new 0 0 128 128" xml:space="preserve">
<circle fill="#00AEEF" cx="64" cy="64" r="60"/>
<path fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" d="M108,79.958c0,10.605-6.717,19.205-15.808,19.04h-60
C24.715,99.163,18,90.563,18,79.958v-33.61c0-10.606,6.715-19.205,15-19.205h60c8.283,0,15,8.599,15,19.205V79.958z"/>
<path fill="none" stroke="#000000" stroke-miterlimit="10" d="M63,108"/>
<path fill="none" stroke="#000000" stroke-miterlimit="10" d="M63,90"/>
<path fill="none" stroke="#000000" stroke-miterlimit="10" d="M54,117"/>
<path fill="none" stroke="#000000" stroke-miterlimit="10" d="M63,108"/>
<path fill="none" stroke="#000000" stroke-miterlimit="10" d="M72,117"/>
<path fill="none" stroke="#000000" stroke-miterlimit="10" d="M63,108"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="36" y1="36" x2="54" y2="36"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="27" y1="45" x2="99" y2="45"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="27" y1="54" x2="99" y2="54"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="27" y1="63" x2="99" y2="63"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="27" y1="81" x2="99" y2="81"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="72" y1="90" x2="90" y2="90"/>
<line fill="none" stroke="#000000" stroke-miterlimit="10" x1="27" y1="72" x2="99" y2="72"/>
</svg>
/**
* @author 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 whiteboard
*/
whiteboardApp = {
// App init
initialise: function() {
this.registerFileActions() ;
},
// register file handler
registerFileActions: function() {
var self = this ;
OCA.Files.fileActions.registerAction({
name: 'Edit',
mime: "application/wbr",
actionHandler: self.editAction,
permissions: OC.PERMISSION_READ,
icon: function () {
return OC.imagePath('core', 'actions/edit');
}
}) ;
OCA.Files.fileActions.setDefault("application/wbr", 'Edit');
},
//edit
editAction: function(filename,context) {
dir = context.dir ;
var ncClient = OC.Files.getClient();
fo = ncClient.getFileInfo(dir + "/" + filename) ;
console.log( fo) ;
}
} ;
whiteboardApp.NewFileMenu = {
attach: function (menu) {
var fileList = menu.fileList;
if (fileList.id !== "files") {
return;
}
menu.addMenuEntry({
id: "whiteboard",
displayName: t('whiteboard', "New whiteboard"),
templateName: t('whiteboard', "New whiteboard.wbr"),
iconClass: "icon-whiteboard",
fileType: "application/wbr",
actionHandler: function (fileName) {
var dir = fileList.getCurrentDirectory();
fileList.createFile(fileName)
.then(function () {
console.log("new whiteboard") ;
});
}
});
}
} ;
OCA.whiteboard = whiteboardApp ;
OC.Plugins.register("OCA.Files.NewFileMenu", whiteboardApp.NewFileMenu);
$(document).ready(function () {
console.log("Whiteboard registered") ;
OCA.whiteboard.initialise() ;
});
<?php
/**
* @author 2019 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\Appinfo ;
use OCP\AppFramework\App;
class Application extends App {
public function __construct(array $urlParams = []) {
parent::__construct('whiteboard', $urlParams);
$container = $this->getContainer();
$server = $container->getServer();
$eventDispatcher = $server->getEventDispatcher();
$this->addPrivateListeners($eventDispatcher) ;
}
protected function addPrivateListeners ($eventDispatcher) {
$eventDispatcher->addListener('OCA\Files::loadAdditionalScripts',
function() {
\OCP\Util::addscript('whiteboard', 'main');
\OCP\Util::addStyle('whiteboard','style') ;
});
}
}
\ No newline at end of file
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