From 48f4e66a840e80c09c720dd3d95209e9f8879c76 Mon Sep 17 00:00:00 2001 From: Antipkin-A Date: Tue, 7 Dec 2021 17:23:06 +0300 Subject: [PATCH 01/17] Revert "remove old version check" --- lib/documentservice.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/documentservice.php b/lib/documentservice.php index 5bce6304..709268f2 100644 --- a/lib/documentservice.php +++ b/lib/documentservice.php @@ -414,6 +414,10 @@ public function checkDocServiceUrl($urlGenerator, $crypt) { } $version = $commandResponse->version; + $versionF = floatval($version); + if ($versionF > 0.0 && $versionF <= 6.0) { + throw new \Exception($this->trans->t("Not supported version")); + } } catch (\Exception $e) { $logger->logException($e, ["message" => "CommandRequest on check error", "app" => self::$appName]); From 6dc5544ba044ade7159c1bef73fd7d517b06006f Mon Sep 17 00:00:00 2001 From: Antipkin-A Date: Thu, 16 Dec 2021 12:42:01 +0300 Subject: [PATCH 02/17] remove share token from history --- controller/editorcontroller.php | 31 ++++++++++++++----------------- js/editor.js | 7 ++----- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index 7c9e53b9..0834ca49 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -661,16 +661,15 @@ public function save($name, $dir, $url) { * Get versions history for file * * @param integer $fileId - file identifier - * @param string $shareToken - access token * * @return array * * @NoAdminRequired */ - public function history($fileId, $shareToken = null) { + public function history($fileId) { $this->logger->debug("Request history for: $fileId", ["app" => $this->appName]); - if (empty($shareToken) && !$this->config->isUserAllowedToUse()) { + if (!$this->config->isUserAllowedToUse()) { return ["error" => $this->trans->t("Not permitted")]; } @@ -682,7 +681,7 @@ public function history($fileId, $shareToken = null) { $userId = $user->getUID(); } - list ($file, $error, $share) = empty($shareToken) ? $this->getFile($userId, $fileId) : $this->fileUtility->getFileByToken($fileId, $shareToken); + list ($file, $error, $share) = $this->getFile($userId, $fileId); if (isset($error)) { $this->logger->error("History: $fileId $error", ["app" => $this->appName]); @@ -781,16 +780,15 @@ public function history($fileId, $shareToken = null) { * * @param integer $fileId - file identifier * @param integer $version - file version - * @param string $shareToken - access token * * @return array * * @NoAdminRequired */ - public function version($fileId, $version, $shareToken = null) { + public function version($fileId, $version) { $this->logger->debug("Request version for: $fileId ($version)", ["app" => $this->appName]); - if (empty($shareToken) && !$this->config->isUserAllowedToUse()) { + if (!$this->config->isUserAllowedToUse()) { return ["error" => $this->trans->t("Not permitted")]; } @@ -802,7 +800,7 @@ public function version($fileId, $version, $shareToken = null) { $userId = $user->getUID(); } - list ($file, $error, $share) = empty($shareToken) ? $this->getFile($userId, $fileId) : $this->fileUtility->getFileByToken($fileId, $shareToken); + list ($file, $error, $share) = $this->getFile($userId, $fileId); if (isset($error)) { $this->logger->error("History: $fileId $error", ["app" => $this->appName]); @@ -831,14 +829,14 @@ public function version($fileId, $version, $shareToken = null) { $key = $this->fileUtility->getKey($file, true); $versionId = $file->getFileInfo()->getMtime(); - $fileUrl = $this->getUrl($file, $user, $shareToken); + $fileUrl = $this->getUrl($file, $user); } else { $fileVersion = array_values($versions)[$version - 1]; $key = $this->fileUtility->getVersionKey($fileVersion); $versionId = $fileVersion->getRevisionId(); - $fileUrl = $this->getUrl($file, $user, $shareToken, $version); + $fileUrl = $this->getUrl($file, $user, null, $version); } $key = DocumentService::GenerateRevisionId($key); @@ -852,14 +850,14 @@ public function version($fileId, $version, $shareToken = null) { && count($versions) >= $version - 1 && FileVersions::hasChanges($ownerId, $fileId, $versionId)) { - $changesUrl = $this->getUrl($file, $user, $shareToken, $version, true); + $changesUrl = $this->getUrl($file, $user, null, $version, true); $result["changesUrl"] = $changesUrl; $prevVersion = array_values($versions)[$version - 2]; $prevVersionKey = $this->fileUtility->getVersionKey($prevVersion); $prevVersionKey = DocumentService::GenerateRevisionId($prevVersionKey); - $prevVersionUrl = $this->getUrl($file, $user, $shareToken, $version - 1); + $prevVersionUrl = $this->getUrl($file, $user, null, $version - 1); $result["previous"] = [ "key" => $prevVersionKey, @@ -880,17 +878,16 @@ public function version($fileId, $version, $shareToken = null) { * * @param integer $fileId - file identifier * @param integer $version - file version - * @param string $shareToken - access token * * @return array * * @NoAdminRequired * @PublicPage */ - public function restore($fileId, $version, $shareToken = null) { + public function restore($fileId, $version) { $this->logger->debug("Request restore version for: $fileId ($version)", ["app" => $this->appName]); - if (empty($shareToken) && !$this->config->isUserAllowedToUse()) { + if (!$this->config->isUserAllowedToUse()) { return ["error" => $this->trans->t("Not permitted")]; } @@ -902,7 +899,7 @@ public function restore($fileId, $version, $shareToken = null) { $userId = $user->getUID(); } - list ($file, $error, $share) = empty($shareToken) ? $this->getFile($userId, $fileId) : $this->fileUtility->getFileByToken($fileId, $shareToken); + list ($file, $error, $share) = $this->getFile($userId, $fileId); if (isset($error)) { $this->logger->error("Restore: $fileId $error", ["app" => $this->appName]); @@ -927,7 +924,7 @@ public function restore($fileId, $version, $shareToken = null) { } } - return $this->history($fileId, $shareToken); + return $this->history($fileId); } /** diff --git a/js/editor.js b/js/editor.js index 8b310f80..52207306 100644 --- a/js/editor.js +++ b/js/editor.js @@ -182,10 +182,9 @@ }; OCA.Onlyoffice.onRequestHistory = function (version) { - $.get(OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/history?fileId={fileId}&shareToken={shareToken}", + $.get(OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/history?fileId={fileId}", { fileId: OCA.Onlyoffice.fileId || 0, - shareToken: OCA.Onlyoffice.shareToken || "", }), function onSuccess(response) { OCA.Onlyoffice.refreshHistory(response, version); @@ -195,11 +194,10 @@ OCA.Onlyoffice.onRequestHistoryData = function (event) { var version = event.data; - $.get(OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/version?fileId={fileId}&version={version}&shareToken={shareToken}", + $.get(OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/version?fileId={fileId}&version={version}", { fileId: OCA.Onlyoffice.fileId || 0, version: version, - shareToken: OCA.Onlyoffice.shareToken || "", }), function onSuccess(response) { if (response.error) { @@ -221,7 +219,6 @@ data: { fileId: OCA.Onlyoffice.fileId || 0, version: version, - shareToken: OCA.Onlyoffice.shareToken || "", }, success: function onSuccess(response) { OCA.Onlyoffice.refreshHistory(response, version); From 2e5b6a0c973437f19971d4d06960c5fffb90c73a Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Thu, 20 Jan 2022 17:21:14 +0300 Subject: [PATCH 03/17] update submodule --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 47e28a87..9cc2c926 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 47e28a87f5eb0fd90739ff8a6f959e7807d47b0b +Subproject commit 9cc2c926af7542b026cbb89357d5fd901f2d0cf7 From a08cf99b3448fcb463dd4db6344e085b4e2662f2 Mon Sep 17 00:00:00 2001 From: Antipkin-A Date: Mon, 27 Dec 2021 17:30:37 +0300 Subject: [PATCH 04/17] format plural of languages --- l10n/bg_BG.js | 2 +- l10n/bg_BG.json | 2 +- l10n/fr.js | 2 +- l10n/fr.json | 2 +- l10n/ja.js | 2 +- l10n/ja.json | 2 +- l10n/pl.js | 2 +- l10n/pl.json | 2 +- l10n/pt_BR.js | 2 +- l10n/pt_BR.json | 2 +- l10n/ru.js | 2 +- l10n/ru.json | 2 +- l10n/zh_CN.js | 2 +- l10n/zh_CN.json | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/l10n/bg_BG.js b/l10n/bg_BG.js index f3fde2ce..0f5a739e 100644 --- a/l10n/bg_BG.js +++ b/l10n/bg_BG.js @@ -106,4 +106,4 @@ OC.L10N.register( "Create new Form template": "Създайте нов шаблон на формуляр", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Молим да актуализирате ONLYOFFICE Docs към версия 7.0, за да работи с онлайн формуляри за попълване" }, -"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"); +"nplurals=2; plural=(n != 1);"); diff --git a/l10n/bg_BG.json b/l10n/bg_BG.json index 499a1cba..4ce55134 100644 --- a/l10n/bg_BG.json +++ b/l10n/bg_BG.json @@ -103,5 +103,5 @@ "Fill in form in ONLYOFFICE": "Попълнете формуляр в ONLYOFFICE", "Create new Form template": "Създайте нов шаблон на формуляр", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Молим да актуализирате ONLYOFFICE Docs към версия 7.0, за да работи с онлайн формуляри за попълване" -},"pluralForm": "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" +},"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/fr.js b/l10n/fr.js index 7bf4a712..7fb611bc 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -106,4 +106,4 @@ OC.L10N.register( "Create new Form template": "Créer un nouveau modèle de formulaire", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Veuillez mettre à jour ONLYOFFICE Docs vers la version 7.0 pour travailler sur les formulaires à remplir en ligne" }, -"nplurals=2; plural=(n != 1);"); +"nplurals=2; plural=(n > 1);"); diff --git a/l10n/fr.json b/l10n/fr.json index a661aeaa..fd2bb24f 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -103,5 +103,5 @@ "Fill in form in ONLYOFFICE": "Remplir le formulaire dans ONLYOFFICE", "Create new Form template": "Créer un nouveau modèle de formulaire", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Veuillez mettre à jour ONLYOFFICE Docs vers la version 7.0 pour travailler sur les formulaires à remplir en ligne" -}, "pluralForm" :"nplurals=2; plural=(n != 1);" +},"pluralForm" :"nplurals=2; plural=(n > 1);" } \ No newline at end of file diff --git a/l10n/ja.js b/l10n/ja.js index 95fa20cd..53e6909f 100644 --- a/l10n/ja.js +++ b/l10n/ja.js @@ -106,4 +106,4 @@ OC.L10N.register( "Create new Form template": "新しいフォームテンプレートの作成", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "オンラインで入力可能なフォームを作成するには、ONLYOFFICE Docs 7.0版まで更新してください" }, -"nplurals=2; plural=(n != 1);"); +"nplurals=1; plural=0;"); diff --git a/l10n/ja.json b/l10n/ja.json index 11737fa3..ac5ba018 100644 --- a/l10n/ja.json +++ b/l10n/ja.json @@ -103,5 +103,5 @@ "Fill in form in ONLYOFFICE": "ONLYOFFICEでフォームを記入する", "Create new Form template": "新しいフォームテンプレートの作成", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "オンラインで入力可能なフォームを作成するには、ONLYOFFICE Docs 7.0版まで更新してください" -},"pluralForm" :"nplurals=2; plural=(n != 1);" +},"pluralForm" :"nplurals=1; plural=0;" } \ No newline at end of file diff --git a/l10n/pl.js b/l10n/pl.js index 15fd8da1..60dba20a 100644 --- a/l10n/pl.js +++ b/l10n/pl.js @@ -106,4 +106,4 @@ OC.L10N.register( "Create new Form template": "Utwórz nowy szablon formularza", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Zaktualizuj ONLYOFFICE Docs do wersji 7.0, aby działały w formularzach do wypełniania online" }, -"nplurals=2; plural=(n != 1);"); \ No newline at end of file +"nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);"); \ No newline at end of file diff --git a/l10n/pl.json b/l10n/pl.json index 3d1aa869..0c466012 100644 --- a/l10n/pl.json +++ b/l10n/pl.json @@ -103,5 +103,5 @@ "Fill in form in ONLYOFFICE": "Wypełnić formularz w ONLYOFFICE", "Create new Form template": "Utwórz nowy szablon formularza", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Zaktualizuj ONLYOFFICE Docs do wersji 7.0, aby działały w formularzach do wypełniania online" -},"pluralForm" :"nplurals=2; plural=(n != 1);" +},"pluralForm" :"nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);" } \ No newline at end of file diff --git a/l10n/pt_BR.js b/l10n/pt_BR.js index d19c5537..59893168 100644 --- a/l10n/pt_BR.js +++ b/l10n/pt_BR.js @@ -106,4 +106,4 @@ OC.L10N.register( "Create new Form template": "Criar novo modelo de Formulário", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Atualize o ONLYOFFICE Docs para a versão 7.0 para trabalhar em formulários preenchíveis online" }, -"nplurals=2; plural=(n != 1);"); +"nplurals=2; plural=(n > 1);"); diff --git a/l10n/pt_BR.json b/l10n/pt_BR.json index e0565d01..2ecd02e7 100644 --- a/l10n/pt_BR.json +++ b/l10n/pt_BR.json @@ -103,5 +103,5 @@ "Fill in form in ONLYOFFICE": "Preencher formulário no ONLYOFFICE", "Create new Form template": "Criar novo modelo de Formulário", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Atualize o ONLYOFFICE Docs para a versão 7.0 para trabalhar em formulários preenchíveis online" -},"pluralForm" :"nplurals=2; plural=(n != 1);" +},"pluralForm" :"nplurals=2; plural=(n > 1);" } diff --git a/l10n/ru.js b/l10n/ru.js index deafbcaa..29b3ac95 100644 --- a/l10n/ru.js +++ b/l10n/ru.js @@ -106,4 +106,4 @@ OC.L10N.register( "Create new Form template": "Создать новый шаблон формы", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Обновите сервер ONLYOFFICE Docs до версии 7.0 для работы с формами онлайн" }, -"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"); +"nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);"); diff --git a/l10n/ru.json b/l10n/ru.json index adb66976..37abe42c 100644 --- a/l10n/ru.json +++ b/l10n/ru.json @@ -103,5 +103,5 @@ "Fill in form in ONLYOFFICE": "Заполнить форму в ONLYOFFICE", "Create new Form template": "Создать новый шаблон формы", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Обновите сервер ONLYOFFICE Docs до версии 7.0 для работы с формами онлайн" -},"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" +},"pluralForm" :"nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);" } \ No newline at end of file diff --git a/l10n/zh_CN.js b/l10n/zh_CN.js index 1fbcabcb..1b790ff6 100644 --- a/l10n/zh_CN.js +++ b/l10n/zh_CN.js @@ -106,4 +106,4 @@ OC.L10N.register( "Create new Form template": "创建新的表单模板", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "请将ONLYOFFICE Docs更新到7.0版本,以便在线编辑可填写的表单" }, -"nplurals=2; plural=(n != 1);"); +"nplurals=1; plural=0;"); diff --git a/l10n/zh_CN.json b/l10n/zh_CN.json index d57e6970..e6556437 100644 --- a/l10n/zh_CN.json +++ b/l10n/zh_CN.json @@ -103,5 +103,5 @@ "Fill in form in ONLYOFFICE": "在ONLYOFFICE上填写表单", "Create new Form template": "创建新的表单模板", "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "请将ONLYOFFICE Docs更新到7.0版本,以便在线编辑可填写的表单" -},"pluralForm" :"nplurals=2; plural=(n != 1);" +},"pluralForm" :"nplurals=1; plural=0;" } \ No newline at end of file From 3e5c4d64118095e7c9f8cbeef75fccca94d3ce24 Mon Sep 17 00:00:00 2001 From: Antipkin-A Date: Fri, 21 Jan 2022 14:32:37 +0300 Subject: [PATCH 05/17] format string to mimerepair (Fix #368) --- lib/mimerepair.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/mimerepair.php b/lib/mimerepair.php index 018d9fd1..24b148ed 100644 --- a/lib/mimerepair.php +++ b/lib/mimerepair.php @@ -206,20 +206,20 @@ private function generateMimeTypeListContent($aliases, $files, $themes) { $themesJson = \json_encode($themes, JSON_PRETTY_PRINT); $content = <<< MTLC - /** - * This file is automatically generated - * DO NOT EDIT MANUALLY! - * - * You can update the list of MimeType Aliases in config/mimetypealiases.json - * The list of files is fetched from core/img/filetypes - * To regenerate this file run ./occ maintenance:mimetype:update-js - */ - OC.MimeTypeList={ - aliases: $aliasesJson, - files: $filesJson, - themes: $themesJson - }; - MTLC; +/** +* This file is automatically generated +* DO NOT EDIT MANUALLY! +* +* You can update the list of MimeType Aliases in config/mimetypealiases.json +* The list of files is fetched from core/img/filetypes +* To regenerate this file run ./occ maintenance:mimetype:update-js +*/ +OC.MimeTypeList={ + aliases: $aliasesJson, + files: $filesJson, + themes: $themesJson +}; +MTLC; return $content; } From 6e4fddc258be670c184313791e55b994ac7f98c3 Mon Sep 17 00:00:00 2001 From: Antipkin-A Date: Tue, 25 Jan 2022 15:22:50 +0300 Subject: [PATCH 06/17] copyright22 --- appinfo/app.php | 2 +- appinfo/application.php | 2 +- appinfo/routes.php | 2 +- controller/callbackcontroller.php | 2 +- controller/editorapicontroller.php | 2 +- controller/editorcontroller.php | 2 +- controller/federationcontroller.php | 2 +- controller/settingsapicontroller.php | 2 +- controller/settingscontroller.php | 2 +- controller/templatecontroller.php | 2 +- controller/webassetcontroller.php | 2 +- css/editor.css | 2 +- css/main.css | 2 +- css/settings.css | 2 +- css/template.css | 2 +- js/desktop.js | 2 +- js/editor.js | 2 +- js/listener.js | 2 +- js/main.js | 2 +- js/settings.js | 2 +- js/share.js | 2 +- js/template.js | 2 +- lib/adminsettings.php | 2 +- lib/appconfig.php | 2 +- lib/command/documentserver.php | 2 +- lib/crypt.php | 2 +- lib/documentservice.php | 2 +- lib/fileutility.php | 2 +- lib/fileversions.php | 2 +- lib/hookhandler.php | 2 +- lib/hooks.php | 2 +- lib/keymanager.php | 2 +- lib/mimerepair.php | 2 +- lib/notifier.php | 2 +- lib/preview.php | 2 +- lib/templatemanager.php | 2 +- lib/version.php | 2 +- lib/versionmanager.php | 2 +- settings.php | 2 +- templates/editor.php | 2 +- templates/settings.php | 2 +- 41 files changed, 41 insertions(+), 41 deletions(-) diff --git a/appinfo/app.php b/appinfo/app.php index 36ef277f..c2e1e0ef 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -1,7 +1,7 @@ Date: Tue, 8 Feb 2022 13:11:19 +0300 Subject: [PATCH 07/17] unused var (36acb44d95d0e8c432fc5cd8e686bd9da4a7b665) --- controller/editorcontroller.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index 07ff6840..e5662e4d 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -140,11 +140,6 @@ class EditorController extends Controller { */ private $groupManager; - /** - * Mobile regex from https://github.com/ONLYOFFICE/CommunityServer/blob/v9.1.1/web/studio/ASC.Web.Studio/web.appsettings.config#L35 - */ - const USER_AGENT_MOBILE = "/android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i"; - /** * @param string $AppName - application name * @param IRequest $request - request object From 8b6f714be9c2812e5da92c6964d03652dbb744a3 Mon Sep 17 00:00:00 2001 From: Antipkin-A Date: Wed, 9 Feb 2022 18:55:17 +0300 Subject: [PATCH 08/17] Switch to H2 levels, more visible --- css/settings.css | 3 +++ templates/settings.php | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/css/settings.css b/css/settings.css index d24fb2b0..bb6fca93 100644 --- a/css/settings.css +++ b/css/settings.css @@ -44,6 +44,9 @@ #onlyofficeAddrSave { float: left; } +#onlyofficeSave { + margin-bottom: 25px; +} .onlyoffice-demo { margin-left: 90px; } diff --git a/templates/settings.php b/templates/settings.php index d2dbbbaa..8842a9ad 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -28,7 +28,7 @@ "> -

t("Server settings")) ?>

+

t("Server settings")) ?>

@@ -92,7 +92,7 @@

onlyoffice-hide">
-

t("Common settings")) ?>

+

t("Common settings")) ?>


-

+

t("Editor customization settings")) ?> "> -

+

-

+

t("Common templates")) ?> -

+
  • class="onlyoffice-template-item" > From 10481a03307ce69e5eabcac8ac510e7111f207da Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Thu, 10 Feb 2022 17:38:10 +0300 Subject: [PATCH 09/17] error for ds 6.0 (6bb07f5091a5f43dc312a2a300934c031cb365e1) --- js/editor.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/editor.js b/js/editor.js index d222a79d..c07bde6b 100644 --- a/js/editor.js +++ b/js/editor.js @@ -50,6 +50,13 @@ return; } + var docsVersion = DocsAPI.DocEditor.version().split("."); + if (docsVersion[0] < 6 + || docsVersion[0] == 6 && docsVersion[1] == 0) { + OCA.Onlyoffice.showMessage(t(OCA.Onlyoffice.AppName, "Not supported version"), "error", {timeout: -1}); + return; + } + var configUrl = OC.linkToOCS("apps/" + OCA.Onlyoffice.AppName + "/api/v1/config", 2) + (OCA.Onlyoffice.fileId || 0); var params = []; @@ -91,7 +98,7 @@ } if ((config.document.fileType === "docxf" || config.document.fileType === "oform") - && DocsAPI.DocEditor.version().split(".")[0] < 7) { + && docsVersion[0] < 7) { OCA.Onlyoffice.showMessage(t(OCA.Onlyoffice.AppName, "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online"), {type: "error"}); return; } From 95f7cf5b3643d2792593c56e65f8ad77e8777549 Mon Sep 17 00:00:00 2001 From: Antipkin-A Date: Mon, 21 Feb 2022 18:17:53 +0300 Subject: [PATCH 10/17] added selection to template dialog --- css/template.css | 13 +++++++------ js/template.js | 7 ++++--- templates/templatePicker.html | 1 - 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/css/template.css b/css/template.css index 2a57eba4..42369644 100644 --- a/css/template.css +++ b/css/template.css @@ -18,9 +18,14 @@ .onlyoffice-template-container { margin-left: 0px !important; + max-width: 500px; } .onlyoffice-template-container li { - margin-bottom: 10px; + padding-bottom: 5px; +} +.onlyoffice-template-container li:hover, +.onlyoffice-template-item.selected { + background-color: rgb(230, 230, 230); } .onlyoffice-template-item img, .onlyoffice-template-item p, @@ -39,11 +44,7 @@ float: left; margin-top: 3px; } -.onlyoffice-template-item input { - position: absolute; - left: -10000px; -} -.onlyoffice-template-item input:checked + label { +.onlyoffice-template-item.selected label { color: rgb(55, 137, 243); } .onlyoffice-template-download { diff --git a/js/template.js b/js/template.js index 65d06d56..85b31164 100644 --- a/js/template.js +++ b/js/template.js @@ -123,21 +123,22 @@ var item = emptyItem.cloneNode(true); $(item.querySelector("label")).attr("for", "template_picker-" + template["id"]); - item.querySelector("input").id = "template_picker-" + template["id"]; item.querySelector("img").src = "/core/img/filetypes/x-office-" + template["type"] + ".svg"; item.querySelector("p").textContent = template["name"]; item.onclick = function() { + $(".onlyoffice-template-item").removeClass("selected"); + $(item).addClass("selected"); dialog[0].dataset.templateId = template["id"]; } dialog[0].querySelector(".onlyoffice-template-container").appendChild(item); }); $(emptyItem.querySelector("label")).attr("for", "template_picker-0"); - emptyItem.querySelector("input").id = "template_picker-0"; - emptyItem.querySelector("input").checked = true; emptyItem.querySelector("img").src = "/core/img/filetypes/x-office-" + type + ".svg"; emptyItem.querySelector("p").textContent = t(OCA.Onlyoffice.AppName, "Empty"); emptyItem.onclick = function() { + $(".onlyoffice-template-item").removeClass("selected"); + $(emptyItem).addClass("selected"); dialog[0].dataset.templateId = "0"; } } diff --git a/templates/templatePicker.html b/templates/templatePicker.html index 55f6b75c..e1e474e3 100644 --- a/templates/templatePicker.html +++ b/templates/templatePicker.html @@ -1,7 +1,6 @@
    • -