diff options
-rw-r--r-- | css/style.scss | 18 | ||||
-rw-r--r-- | lib/EventSource.php | 102 | ||||
-rw-r--r-- | src/components/Editor.vue | 9 |
3 files changed, 9 insertions, 120 deletions
diff --git a/css/style.scss b/css/style.scss index 16507ac64..226342e83 100644 --- a/css/style.scss +++ b/css/style.scss @@ -428,21 +428,3 @@ div[contenteditable=false] { margin-top: 10px; margin-bottom: 20px; } - -// TODO: properly move this to the viewer as an option -.modal-mask { - height: calc(100% - 50px) !important; - top: 50px !important; -} - -#app-sidebar.app-sidebar--full { - position: unset !important; -} - -#viewer-content.modal-mask .modal-wrapper .modal-container { - border-radius: 3px !important; -} - -.modal-container #editor-container { - height: calc(100vh - 88px - 50px) !important; -} diff --git a/lib/EventSource.php b/lib/EventSource.php deleted file mode 100644 index 4fd531803..000000000 --- a/lib/EventSource.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php -/** - * @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\Controller; - -use OCP\IEventSource; - - -class EventSource implements IEventSource { - - /** - * @var bool - */ - private $started = false; - - protected function init(): void { - if ($this->started) { - return; - } - $this->started = true; - - // prevent php output buffering, caching and nginx buffering - while (ob_get_level()) { - ob_end_clean(); - } - header('Cache-Control: no-cache'); - header('X-Accel-Buffering: no'); - header("Content-Type: text/event-stream"); - flush(); - } - - /** - * Sends a message to the client - * - * If only one parameter is given, a typeless message will be sent with that parameter as data - * - * @param string $type - * @param mixed $data - * - * @throws \BadMethodCallException - */ - public function send($type, $data = null) { - $this->validateMessage($type, $data); - $this->init(); - if (is_null($data)) { - $data = $type; - $type = null; - } - - if (!empty($type)) { - echo 'event: ' . $type . PHP_EOL; - } - echo 'data: ' . json_encode($data) . PHP_EOL; - - echo PHP_EOL; - flush(); - } - - /** - * Closes the connection of the event source - * - * It's best to let the client close the stream - */ - public function close() { - $this->send( - '__internal__', 'close' - ); - } - - /** - * Makes sure we have a message we can use - * - * @param string $type - * @param mixed $data - */ - private function validateMessage($type, $data) { - if ($data && !preg_match('/^[A-Za-z0-9_]+$/', $type)) { - throw new \BadMethodCallException('Type needs to be alphanumeric (' . $type . ')'); - } - } -} diff --git a/src/components/Editor.vue b/src/components/Editor.vue index 78edfd905..d3c2f1e1c 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -383,4 +383,13 @@ export default { #files-public-content { width: 100% !important; } + + #viewer-content.modal-mask .modal-wrapper .modal-container { + border-radius: 3px !important; + } + + .modal-container #editor-container { + height: calc(100vh - 88px - 50px) !important; + } + </style> |