From 51ab3a78acf133b55822337228bb778fb5039914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 17 Jun 2019 12:49:31 +0200 Subject: [PATCH] Cleanup appinfo and css MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- appinfo/app.php | 21 ++ appinfo/info.xml | 12 +- appinfo/routes.php | 24 ++- css/icons.scss | 33 ---- css/prosemirror.scss | 218 +++++++++++---------- lib/AppInfo/Application.php | 28 ++- lib/Controller/PublicSessionController.php | 4 +- 7 files changed, 185 insertions(+), 155 deletions(-) diff --git a/appinfo/app.php b/appinfo/app.php index 935ac66aa..85ed0d5af 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -1,5 +1,26 @@ + * + * @author Julius Härtl + * + * @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 . + * + */ namespace OCA\Text\AppInfo; diff --git a/appinfo/info.xml b/appinfo/info.xml index d43c005e6..a82cb35bb 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -3,9 +3,15 @@ xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd"> text Text - Type together - Collaborative text editor - 0.1.0-dev14 + 📝 Collaborative document editing + + 1.0.0-alpha1 agpl Julius Härtl Text diff --git a/appinfo/routes.php b/appinfo/routes.php index 4243816c2..299d1181a 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -1,12 +1,31 @@ + * + * @author Julius Härtl + * + * @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 . + * + */ 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'], - ] ]; diff --git a/css/icons.scss b/css/icons.scss index c1c62ac15..155944aee 100644 --- a/css/icons.scss +++ b/css/icons.scss @@ -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); diff --git a/css/prosemirror.scss b/css/prosemirror.scss index 3072cdccb..36833ded5 100644 --- a/css/prosemirror.scss +++ b/css/prosemirror.scss @@ -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; -} diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 9281a67cf..93ba04806 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -1,11 +1,31 @@ + * + * @author Julius Härtl + * + * @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 . + * + */ 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() {}); } } diff --git a/lib/Controller/PublicSessionController.php b/lib/Controller/PublicSessionController.php index 4aff8d83b..015f5c0a7 100644 --- a/lib/Controller/PublicSessionController.php +++ b/lib/Controller/PublicSessionController.php @@ -1,4 +1,5 @@ * @@ -21,9 +22,6 @@ * */ -declare(strict_types=1); - - namespace OCA\Text\Controller; use OCA\Text\Service\ApiService;