mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-02-14 01:08:43 +00:00
Remove space from end of line
This commit is contained in:
parent
6e543913f5
commit
f6286759f3
|
|
@ -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());
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user