From f6286759f34f030c34e8a712a8bede8d58089735 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 3 Feb 2018 11:52:30 +0100 Subject: [PATCH] Remove space from end of line --- Controller.php | 4 ++-- Models/Editor.js | 4 ++-- Models/EditorDoc.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Controller.php b/Controller.php index 749f01f..5d19ab3 100644 --- a/Controller.php +++ b/Controller.php @@ -185,7 +185,7 @@ class Controller extends ModuleAbstract implements WebInterface $doc = EditorDocMapper::get((int) $request->getData('id')); $accountId = $request->getHeader()->getAccount(); - + if ($doc->getCreatedBy()->getId() !== $accountId && !$this->app->accountManager->get($accountId)->hasPermission( PermissionType::READ, $this->app->orgId, $this->app->appName, self::MODULE_ID, PermissionState::DOC, $doc->getId()) @@ -243,7 +243,7 @@ class Controller extends ModuleAbstract implements WebInterface $doc->setPlain((string) ($request->getData('plain') ?? '')); $doc->setContent((string) ($request->getData('plain') ?? '')); $doc->setCreatedBy($request->getHeader()->getAccount()); - + EditorDocMapper::create($doc); $response->set('editor', $doc->jsonSerialize()); diff --git a/Models/Editor.js b/Models/Editor.js index b75f441..939b660 100644 --- a/Models/Editor.js +++ b/Models/Editor.js @@ -31,8 +31,8 @@ const activeEl = document.activeElement; const activeElTagName = activeEl ? activeEl.tagName.toLowerCase() : null; - if ((activeElTagName === 'textarea' || activeElTagName === 'input') - && /^(?:text|search|password|tel|url)$/i.test(activeEl.type) + if ((activeElTagName === 'textarea' || activeElTagName === 'input') + && /^(?:text|search|password|tel|url)$/i.test(activeEl.type) && (typeof activeEl.selectionStart === 'number') ) { text = activeEl.value.slice(activeEl.selectionStart, activeEl.selectionEnd); diff --git a/Models/EditorDoc.php b/Models/EditorDoc.php index dee35a5..2ffc217 100644 --- a/Models/EditorDoc.php +++ b/Models/EditorDoc.php @@ -221,7 +221,7 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable $this->path = $path; } - public function toArray() : array + public function toArray() : array { return [ 'id' => $this->id, @@ -233,12 +233,12 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable ]; } - public function __toString() + public function __toString() { return json_encode($this->toArray()); } - public function jsonSerialize() + public function jsonSerialize() { return $this->toArray(); }