Skip to content
Snippets Groups Projects
Verified Commit 23613248 authored by Hugo Renard's avatar Hugo Renard
Browse files

it's a nextcloud app

parent a246f52b
No related branches found
No related tags found
No related merge requests found
# multi-office # Multi Office
...@@ -14,10 +14,4 @@ ...@@ -14,10 +14,4 @@
<dependencies> <dependencies>
<nextcloud min-version="21" max-version="24"/> <nextcloud min-version="21" max-version="24"/>
</dependencies> </dependencies>
<navigations>
<navigation>
<name>Multi Office</name>
<route>multioffice.page.index</route>
</navigation>
</navigations>
</info> </info>
{
"name": "Multi Office",
"description": "Improve Collabora + ONLYOFFICE experience",
"type": "project",
"license": "AGPL",
"authors": [
{
"name": "Indiehosters"
}
],
"require": {},
"require-dev": {}
}
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
} }
.menu-item-extension { .menu-item-extension {
margin-left: auto; margin-left: 1em;
opacity: 0.4; opacity: 0.4;
font-weight: bold; font-weight: bold;
font-size: 0.8em; font-size: 0.8em;
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="32"
width="32"
version="1"
viewBox="0 0 32 32"
id="svg4"
sodipodi:docname="app.svg"
inkscape:version="0.92.1 r">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="789"
inkscape:window-height="480"
id="namedview6"
showgrid="false"
inkscape:zoom="7.375"
inkscape:cx="-8.3389831"
inkscape:cy="16"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="0"
inkscape:current-layer="svg4" />
<path
d="M13.733 0a.915.915 0 0 0-.933.934V3.6c-1.182.304-2.243.794-3.267 1.4L7.6 3.068a.93.93 0 0 0-1.334 0l-3.2 3.2a.93.93 0 0 0 0 1.334L5 9.535c-.607 1.024-1.097 2.085-1.4 3.267H.933a.915.915 0 0 0-.933.934v4.533c0 .53.403.934.933.934H3.6c.303 1.182.793 2.243 1.4 3.267l-1.934 1.935a.93.93 0 0 0 0 1.333l3.2 3.2a.93.93 0 0 0 1.333 0L9.532 27c1.024.61 2.085 1.097 3.266 1.4v2.667c0 .53.402.933.932.933h4.534c.53 0 .933-.403.933-.935V28.4c1.18-.305 2.24-.795 3.265-1.4L24.4 28.93a.93.93 0 0 0 1.332 0l3.2-3.2a.93.93 0 0 0 0-1.333L27 22.465c.607-1.024 1.096-2.085 1.4-3.266h2.665a.915.915 0 0 0 .935-.933v-4.534a.915.915 0 0 0-.934-.933H28.4c-.304-1.182-.792-2.243-1.4-3.267L28.932 7.6a.93.93 0 0 0 0-1.334l-3.2-3.2a.93.93 0 0 0-1.333 0L22.465 5c-1.024-.607-2.084-1.097-3.266-1.4V.933A.915.915 0 0 0 18.267 0zM16 8.87A7.134 7.134 0 0 1 23.13 16 7.134 7.134 0 0 1 16 23.133c-3.936 0-7.13-3.196-7.13-7.132S12.063 8.87 16 8.87z"
display="block"
fill="#fff"
id="path2"
style="fill:#ffffff" />
</svg>
OC.Plugins.register("OCA.Files.NewFileMenu", { document.addEventListener("DOMContentLoaded", () =>
attach: function () { OC.Plugins.register("OCA.Files.NewFileMenu", {
const refreshMenu = () => { attach: function () {
const menu = document.querySelector(".newFileMenu ul"); const refreshMenu = () => {
const menu = document.querySelector(".newFileMenu ul");
const addSeparator = (selector, title) => { const addSeparator = (selector, title) => {
const firtEl = document.querySelector(selector); const firtEl = document.querySelector(selector);
const separator = document.createElement("li"); const separator = document.createElement("li");
separator.classList.add("menu-item-separator"); separator.classList.add("menu-item-separator");
separator.innerHTML = ` separator.innerHTML = `
<div></div> <div></div>
<p>${title}</p> <p>${title}</p>
`; `;
menu.insertBefore(separator, firtEl.parentNode); menu.insertBefore(separator, firtEl.parentNode);
}; };
const addExtension = (selector) => { const addExtension = (selector) => {
const elements = document.querySelectorAll(selector); const elements = document.querySelectorAll(selector);
for (const el of elements) { for (const el of elements) {
const span = document.createElement("span"); const span = document.createElement("span");
span.classList.add("menu-item-extension"); span.classList.add("menu-item-extension");
span.innerText = el.getAttribute("data-templatename").split(".")[1]; span.innerText = el.getAttribute("data-templatename").split(".")[1];
el.appendChild(span); el.appendChild(span);
} }
}; };
addSeparator( addSeparator(
'.newFileMenu .menuitem[data-action*="template-new-onlyoffice"]', '.newFileMenu .menuitem[data-action*="template-new-onlyoffice"]',
"ONLYOFFICE" "ONLYOFFICE"
); );
addSeparator( addSeparator(
'.newFileMenu .menuitem[data-action*="template-new-richdocument"]', '.newFileMenu .menuitem[data-action*="template-new-richdocument"]',
"LIBREOFFICE" "LIBREOFFICE"
); );
addExtension( addExtension(
'.newFileMenu .menuitem[data-action*="template-new-onlyoffice"]' '.newFileMenu .menuitem[data-action*="template-new-onlyoffice"]'
); );
addExtension( addExtension(
'.newFileMenu .menuitem[data-action*="template-new-richdocument"]' '.newFileMenu .menuitem[data-action*="template-new-richdocument"]'
); );
}; };
setTimeout(refreshMenu); setTimeout(refreshMenu);
document.querySelector(".new").addEventListener("click", refreshMenu); document.querySelector(".new").addEventListener("click", refreshMenu);
}, },
}); })
);
<?php
declare(strict_types=1);
namespace OCA\MultiOffice\AppInfo;
use OCP\AppFramework\App;
class Application extends App {
public function __construct() {
parent::__construct('multioffice');
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener('OCA\Files::loadAdditionalScripts', function() {
script('multioffice', 'script');
style('multioffice', 'style');
});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment