Remove space from end of line

This commit is contained in:
Dennis Eichhorn 2018-02-03 11:52:30 +01:00
parent 6e543913f5
commit f6286759f3
3 changed files with 7 additions and 7 deletions

View File

@ -185,7 +185,7 @@ class Controller extends ModuleAbstract implements WebInterface
$doc = EditorDocMapper::get((int) $request->getData('id')); $doc = EditorDocMapper::get((int) $request->getData('id'));
$accountId = $request->getHeader()->getAccount(); $accountId = $request->getHeader()->getAccount();
if ($doc->getCreatedBy()->getId() !== $accountId if ($doc->getCreatedBy()->getId() !== $accountId
&& !$this->app->accountManager->get($accountId)->hasPermission( && !$this->app->accountManager->get($accountId)->hasPermission(
PermissionType::READ, $this->app->orgId, $this->app->appName, self::MODULE_ID, PermissionState::DOC, $doc->getId()) 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->setPlain((string) ($request->getData('plain') ?? ''));
$doc->setContent((string) ($request->getData('plain') ?? '')); $doc->setContent((string) ($request->getData('plain') ?? ''));
$doc->setCreatedBy($request->getHeader()->getAccount()); $doc->setCreatedBy($request->getHeader()->getAccount());
EditorDocMapper::create($doc); EditorDocMapper::create($doc);
$response->set('editor', $doc->jsonSerialize()); $response->set('editor', $doc->jsonSerialize());

View File

@ -31,8 +31,8 @@
const activeEl = document.activeElement; const activeEl = document.activeElement;
const activeElTagName = activeEl ? activeEl.tagName.toLowerCase() : null; const activeElTagName = activeEl ? activeEl.tagName.toLowerCase() : null;
if ((activeElTagName === 'textarea' || activeElTagName === 'input') if ((activeElTagName === 'textarea' || activeElTagName === 'input')
&& /^(?:text|search|password|tel|url)$/i.test(activeEl.type) && /^(?:text|search|password|tel|url)$/i.test(activeEl.type)
&& (typeof activeEl.selectionStart === 'number') && (typeof activeEl.selectionStart === 'number')
) { ) {
text = activeEl.value.slice(activeEl.selectionStart, activeEl.selectionEnd); text = activeEl.value.slice(activeEl.selectionStart, activeEl.selectionEnd);

View File

@ -221,7 +221,7 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
$this->path = $path; $this->path = $path;
} }
public function toArray() : array public function toArray() : array
{ {
return [ return [
'id' => $this->id, 'id' => $this->id,
@ -233,12 +233,12 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
]; ];
} }
public function __toString() public function __toString()
{ {
return json_encode($this->toArray()); return json_encode($this->toArray());
} }
public function jsonSerialize() public function jsonSerialize()
{ {
return $this->toArray(); return $this->toArray();
} }