Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2019-06-17 12:49:31 +02:00
Родитель 07a650092d
Коммит 51ab3a78ac
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4C614C6ED2CDE6DF
7 изменённых файлов: 185 добавлений и 155 удалений

Просмотреть файл

@ -1,5 +1,26 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>
*
* @author Julius Härtl <jus@bitgrid.net>
*
* @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\Text\AppInfo;

Просмотреть файл

@ -3,9 +3,15 @@
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>text</id>
<name>Text</name>
<summary>Type together</summary>
<description>Collaborative text editor</description>
<version>0.1.0-dev14</version>
<summary>📝 Collaborative document editing</summary>
<description><![CDATA[** 📝 Collaborative document editing!**
- **📝 Focused writing:** No distractions, only the formatting you need.
- **🙋 Work together:** Share and collaborate with friends and colleagues, no matter if they use Nextcloud or not!
- **💾 Open format:** Files are saved as [Markdown](https://en.wikipedia.org/wiki/Markdown), so you can edit them from any other text app too.
- **✊ Strong foundation:** We use [🐈 tiptap](https://tiptap.scrumpy.io) which is based on [🦉 ProseMirror](https://prosemirror.net) – huge thanks to them!
]]></description>
<version>1.0.0-alpha1</version>
<licence>agpl</licence>
<author mail="jus@bitgrid.net">Julius Härtl</author>
<namespace>Text</namespace>

Просмотреть файл

@ -1,12 +1,31 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>
*
* @author Julius Härtl <jus@bitgrid.net>
*
* @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\Text\AppInfo;
return [
'routes' => [
['name' => 'Navigation#navigate', 'url' => '/', 'verb' => 'GET'],
['name' => 'Session#create', 'url' => '/session/create', 'verb' => 'GET'],
['name' => 'Session#fetch', 'url' => '/session/fetch', 'verb' => 'GET'],
['name' => 'Session#sync', 'url' => '/session/sync', 'verb' => 'POST'],
@ -19,6 +38,5 @@ return [
['name' => 'PublicSession#sync', 'url' => '/public/session/sync', 'verb' => 'POST'],
['name' => 'PublicSession#push', 'url' => '/public/session/push', 'verb' => 'POST'],
['name' => 'PublicSession#close', 'url' => '/public/session/close', 'verb' => 'GET'],
]
];

Просмотреть файл

@ -1,36 +1,3 @@
.icon-bold {
background-image: url('./../../img/icons/bold.svg');
}
.icon-italic {
background-image: url('./../../img/icons/italic.svg');
}
.icon-underline {
background-image: url('./../../img/icons/underline.svg');
}
.icon-link {
background-image: url('./../../img/icons/link.svg');
}
.icon-ol {
background-image: url('./../../img/icons/ol.svg');
}
.icon-ul {
background-image: url('./../../img/icons/ul.svg');
}
.icon-hr {
background-image: url('./../../img/icons/hr.svg');
}
.icon-quote {
background-image: url('./../../img/icons/quote.svg');
}
.icon-paragraph {
background-image: url('./../../img/icons/paragraph.svg');
}
.icon-code {
background-image: url('./../../img/icons/code.svg');
}
.icon-image {
background-image: url('./../../img/icons/image.svg');
}
@include icon-black-white('undo', 'text', 1);
@include icon-black-white('redo', 'text', 1);
@include icon-black-white('bold', 'text', 1);

Просмотреть файл

@ -1,5 +1,4 @@
/* Document rendering styles */
.ProseMirror {
margin-top: 44px;
height: 100%;
@ -12,118 +11,125 @@
line-height: 150%;
font-size: 14px;
outline: none;
}
.ProseMirror p:first-child,
.ProseMirror h1:first-child,
.ProseMirror h2:first-child,
.ProseMirror h3:first-child,
.ProseMirror h4:first-child,
.ProseMirror h5:first-child,
.ProseMirror h6:first-child {
margin-top: 10px;
}
p:first-child,
h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child,
h5:first-child,
h6:first-child {
margin-top: 10px;
}
.ProseMirror a {
color: var(--color-primary);
text-decoration: underline;
padding: .5em 0;
}
a {
color: var(--color-primary);
text-decoration: underline;
padding: .5em 0;
}
.ProseMirror p {
margin-bottom: 1em;
line-height: 150%;
}
.ProseMirror em {
font-style: italic;
}
p {
margin-bottom: 1em;
line-height: 150%;
}
.ProseMirror h1 {
font-size: 36px;
}
.ProseMirror h2 {
font-size: 28px;
}
.ProseMirror h3 {
font-size: 24px;
}
.ProseMirror h4 {
font-size: 21px;
}
.ProseMirror h5 {
font-size: 17px;
}
.ProseMirror h6 {
font-size: 14px;
}
.ProseMirror h1,
.ProseMirror h2,
.ProseMirror h3,
.ProseMirror h4,
.ProseMirror h5,
.ProseMirror h6 {
font-weight: 600;
line-height: 120%;
margin-top: 24px;
margin-bottom: 12px;
color: var(--color-main-text);
}
em {
font-style: italic;
}
h1 {
font-size: 36px;
}
h2 {
font-size: 28px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 21px;
}
h5 {
font-size: 17px;
}
h6 {
font-size: 14px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 600;
line-height: 120%;
margin-top: 24px;
margin-bottom: 12px;
color: var(--color-main-text);
}
img {
cursor: default;
max-height: 50vh;
max-width: 100%;
}
hr {
padding: 2px 0;
border: none;
margin: 1em 0;
width: 100%;
}
hr:after {
content: "";
display: block;
height: 1px;
background-color: var(--color-border-dark);
line-height: 2px;
}
pre {
white-space: pre-wrap;
background-color: var(--color-background-dark);
border-radius: var(--border-radius);
padding: 1em 1.3em;
margin-bottom: 1em;
}
p code {
background-color: var(--color-background-dark);
border-radius: var(--border-radius);
padding: .1em .3em;
}
li {
position: relative;
}
ul, ol {
padding-left: 14px;
}
ul li {
list-style-type: disc;
}
blockquote {
padding-left: 1em;
border-left: 4px solid var(--color-primary);
margin-left: 0;
margin-right: 0;
}
.ProseMirror img {
cursor: default;
max-height: 50vh;
max-width: 100%;
}
.ProseMirror-focused .ProseMirror-gapcursor {
display: block;
}
/* Add space around the hr to make clicking it easier */
.ProseMirror hr {
padding: 2px 0;
border: none;
margin: 1em 0;
width: 100%;
}
.ProseMirror hr:after {
content: "";
display: block;
height: 1px;
background-color: var(--color-border-dark);
line-height: 2px;
}
.ProseMirror pre {
white-space: pre-wrap;
background-color: var(--color-background-dark);
border-radius: var(--border-radius);
padding: 1em 1.3em;
margin-bottom: 1em;
}
.ProseMirror p code {
background-color: var(--color-background-dark);
border-radius: var(--border-radius);
padding: .1em .3em;
}
.ProseMirror li {
position: relative;
}
.ProseMirror ul, .ProseMirror ol {
padding-left: 14px;
}
.ProseMirror ul li {
list-style-type: disc;
}
.ProseMirror blockquote {
padding-left: 1em;
border-left: 4px solid var(--color-primary);
margin-left: 0;
margin-right: 0;
}

Просмотреть файл

@ -1,11 +1,31 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>
*
* @author Julius Härtl <jus@bitgrid.net>
*
* @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\Text\AppInfo;
use OCP\AppFramework\App;
class Application extends App {
@ -19,12 +39,6 @@ class Application extends App {
*/
public function __construct(array $params = []) {
parent::__construct(self::APP_NAME, $params);
// register hook for files
\OC::$server->getRootFolder()->listen('\OC\Files', 'preWrite', function() {});
\OC::$server->getRootFolder()->listen('\OC\Files', 'postWrite', function() {});
\OC::$server->getRootFolder()->listen('\OC\Files', 'preDelete', function() {});
\OC::$server->getRootFolder()->listen('\OC\Files', 'postDelete', function() {});
}
}

Просмотреть файл

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>
*
@ -21,9 +22,6 @@
*
*/
declare(strict_types=1);
namespace OCA\Text\Controller;
use OCA\Text\Service\ApiService;