From b567e67bf573ae11c56bccd93bf6e8f0d6234996 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Fri, 13 Aug 2021 13:45:24 +0200 Subject: [PATCH 01/29] Introduce controller for loading the web-extension js bundle --- appinfo/application.php | 9 ++++ appinfo/routes.php | 1 + controller/webassetcontroller.php | 86 +++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 controller/webassetcontroller.php diff --git a/appinfo/application.php b/appinfo/application.php index bd7f5341..911484d5 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -32,6 +32,7 @@ use OCA\Onlyoffice\Controller\SettingsApiController; use OCA\Onlyoffice\Controller\SettingsController; use OCA\Onlyoffice\Controller\TemplateController; +use OCA\Onlyoffice\Controller\WebAssetController; use OCA\Onlyoffice\Crypt; use OCA\Onlyoffice\Hookhandler; use OCA\Onlyoffice\Hooks; @@ -221,6 +222,14 @@ function () { ); }); + $container->registerService("WebAssetController", function ($c) { + return new WebAssetController( + $c->query("AppName"), + $c->query("Request"), + $c->query("Logger") + ); + }); + Hooks::connectHooks(); } diff --git a/appinfo/routes.php b/appinfo/routes.php index 176106ff..c9b5a7ab 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -41,6 +41,7 @@ ["name" => "template#add_template", "url" => "/ajax/template", "verb" => "POST"], ["name" => "template#get_templates", "url" => "/ajax/template", "verb" => "GET"], ["name" => "template#delete_template", "url" => "/ajax/template", "verb" => "DELETE"], + ["name" => "webasset#get", "url" => "/js/onlyoffice.js", "verb" => "GET"], ], "ocs" => [ ["name" => "federation#key", "url" => "/api/v1/key", "verb" => "POST"], diff --git a/controller/webassetcontroller.php b/controller/webassetcontroller.php new file mode 100644 index 00000000..004efc80 --- /dev/null +++ b/controller/webassetcontroller.php @@ -0,0 +1,86 @@ +logger = $logger; + } + + /** + * Loads the onlyoffice.js file for integration into ownCloud Web + * + * @PublicPage + * @NoCSRFRequired + * + * @return Response + */ + public function get(): Response { + $basePath = \dirname(__DIR__,1); + $filePath = \realpath( $basePath . '/js/web/onlyoffice.js'); + try { + return new DataDisplayResponse(\file_get_contents($filePath), Http::STATUS_OK, [ + 'Content-Type' => $this->getMimeType($filePath), + 'Content-Length' => \filesize($filePath), + 'Cache-Control' => 'max-age=0, no-cache, no-store, must-revalidate', + 'Pragma' => 'no-cache', + 'Expires' => 'Tue, 24 Sep 1985 22:15:00 GMT', + 'X-Frame-Options' => 'DENY' + ]); + } catch(\Exception $e) { + $this->logger->logException($e, ['app' => $this->appName]); + return new DataResponse(["message" => $e->getMessage()], Http::STATUS_NOT_FOUND); + } + } + + private function getMimeType(string $filename): string { + $mimeTypes = Mimetypes::getInstance(); + return $mimeTypes->fromFilename($filename); + } +} From f896da533f65a2a87d347691ce10d33be2317c2c Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Fri, 13 Aug 2021 16:41:09 +0200 Subject: [PATCH 02/29] Update README.md to reflect the new config for ownCloud Web --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cd9696d9..213a72d0 100644 --- a/README.md +++ b/README.md @@ -123,11 +123,13 @@ To register the connector, use these lines: "external_apps": [ { "id": "onlyoffice", - "path": "http(s):///custom/onlyoffice/js/web/onlyoffice.js", + "path": "http(s):///index.php/apps/onlyoffice/js/onlyoffice.js", } ] ``` +Depending on your webserver configuration you can drop the `index.php` segment from the url path. + ## How it works The ONLYOFFICE integration follows the API documented [here](https://api.onlyoffice.com/editors/basic): From 25e5773aa42e03b070679e24d1493615c4212c1c Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Fri, 13 Aug 2021 16:45:45 +0200 Subject: [PATCH 03/29] Remove unused import --- controller/webassetcontroller.php | 1 - 1 file changed, 1 deletion(-) diff --git a/controller/webassetcontroller.php b/controller/webassetcontroller.php index 004efc80..40c9605f 100644 --- a/controller/webassetcontroller.php +++ b/controller/webassetcontroller.php @@ -23,7 +23,6 @@ use OC\AppFramework\Http; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataDisplayResponse; -use OCP\AppFramework\Http\DataDownloadResponse; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\Response; use OCP\ILogger; From 3cb150240717cf381e11b13ffb40024131f66f78 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 31 Aug 2021 11:58:43 +0300 Subject: [PATCH 04/29] change downloadAs resource --- js/main.js | 2 +- l10n/bg_BG.js | 4 ++-- l10n/bg_BG.json | 4 ++-- l10n/de.js | 4 ++-- l10n/de.json | 4 ++-- l10n/de_DE.js | 4 ++-- l10n/de_DE.json | 4 ++-- l10n/es.js | 4 ++-- l10n/es.json | 4 ++-- l10n/fr.js | 4 ++-- l10n/fr.json | 4 ++-- l10n/it.js | 4 ++-- l10n/it.json | 4 ++-- l10n/ja.js | 4 ++-- l10n/ja.json | 4 ++-- l10n/pl.js | 4 ++-- l10n/pl.json | 4 ++-- l10n/pt_BR.js | 4 ++-- l10n/pt_BR.json | 4 ++-- l10n/ru.js | 4 ++-- l10n/ru.json | 4 ++-- l10n/sv.js | 4 ++-- l10n/sv.json | 4 ++-- l10n/zh_CN.js | 4 ++-- l10n/zh_CN.json | 4 ++-- 25 files changed, 49 insertions(+), 49 deletions(-) diff --git a/js/main.js b/js/main.js index bd9c9d27..0b42e1ce 100644 --- a/js/main.js +++ b/js/main.js @@ -202,7 +202,7 @@ dialog_title: t("onlyoffice", "Download as") }); - $(dialog[0].querySelectorAll("p")).text(fileName + " " + t(OCA.Onlyoffice.AppName, "Convert into")); + $(dialog[0].querySelectorAll("p")).text(t(OCA.Onlyoffice.AppName, "Choose a format to convert {fileName}", {fileName: fileName})); var extension = OCA.Onlyoffice.GetFileExtension(fileName); var selectNode = dialog[0].querySelectorAll("select")[0]; diff --git a/l10n/bg_BG.js b/l10n/bg_BG.js index e93ea482..c68d1ec9 100644 --- a/l10n/bg_BG.js +++ b/l10n/bg_BG.js @@ -94,10 +94,10 @@ OC.L10N.register( "File has been converted. Its content might look different.": "Файлът бе преобразуван. Съдържанието му може да изглежда различно.", "Download as": "Изтегли като", "Download": "Изтегли", - "Convert into": "Конвертирай в", "Origin format": "Формат на произход", "Failed to send notification": "Неуспешно изпращане на известие", "Notification sent successfully": "Успешно изпратено известие", - "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s, споменат във %2\$s: \"%3\$s\"." + "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s, споменат във %2\$s: \"%3\$s\".", + "Choose a format to convert {fileName}": "Изберете формат за конвертиране {fileName}" }, "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"); diff --git a/l10n/bg_BG.json b/l10n/bg_BG.json index 49b62066..d3e2ceca 100644 --- a/l10n/bg_BG.json +++ b/l10n/bg_BG.json @@ -92,10 +92,10 @@ "File has been converted. Its content might look different.": "Файлът бе преобразуван. Съдържанието му може да изглежда различно.", "Download as": "Изтегли като", "Download": "Изтегли", - "Convert into": "Конвертирай в", "Origin format": "Формат на произход", "Failed to send notification": "Неуспешно изпращане на известие", "Notification sent successfully": "Успешно изпратено известие", - "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s, споменат във %2$s: \"%3$s\"." + "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s, споменат във %2$s: \"%3$s\".", + "Choose a format to convert {fileName}": "Изберете формат за конвертиране {fileName}" },"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);" } \ No newline at end of file diff --git a/l10n/de.js b/l10n/de.js index c79ac0fe..40697b93 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -94,10 +94,10 @@ OC.L10N.register( "File has been converted. Its content might look different.": "Die Datei wurde konvertiert. Der Inhalt könnte anders aussehen.", "Download as": "Herunterladen als", "Download": "Herunterladen", - "Convert into": "Konvertieren in", "Origin format": "Ursprüngliches Format", "Failed to send notification": "Fehler beim Senden einer Benachrichtigung", "Notification sent successfully": "Benachrichtigung erfolgreich gesendet", - "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s hat in %2\$s erwähnt: \"%3\$s\"." + "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s hat in %2\$s erwähnt: \"%3\$s\".", + "Choose a format to convert {fileName}": "Wählen Sie das Format für {fileName} aus" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de.json b/l10n/de.json index 5cef54ce..f397741e 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -92,10 +92,10 @@ "File has been converted. Its content might look different.": "Die Datei wurde konvertiert. Der Inhalt könnte anders aussehen.", "Download as": "Herunterladen als", "Download": "Herunterladen", - "Convert into": "Konvertieren in", "Origin format": "Ursprüngliches Format", "Failed to send notification": "Fehler beim Senden einer Benachrichtigung", "Notification sent successfully": "Benachrichtigung erfolgreich gesendet", - "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s hat in %2$s erwähnt: \"%3$s\"." + "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s hat in %2$s erwähnt: \"%3$s\".", + "Choose a format to convert {fileName}": "Wählen Sie das Format für {fileName} aus" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/de_DE.js b/l10n/de_DE.js index f69ddcc1..5a2d8ff9 100644 --- a/l10n/de_DE.js +++ b/l10n/de_DE.js @@ -94,10 +94,10 @@ OC.L10N.register( "File has been converted. Its content might look different.": "Die Datei wurde konvertiert. Der Inhalt könnte anders aussehen.", "Download as": "Herunterladen als", "Download": "Herunterladen", - "Convert into": "Konvertieren in", "Origin format": "Ursprüngliches Format", "Failed to send notification": "Fehler beim Senden einer Benachrichtigung", "Notification sent successfully": "Benachrichtigung erfolgreich gesendet", - "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s hat in %2\$s erwähnt: \"%3\$s\"." + "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s hat in %2\$s erwähnt: \"%3\$s\".", + "Choose a format to convert {fileName}": "Wählen Sie das Format für {fileName} aus" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de_DE.json b/l10n/de_DE.json index 43af5e1a..55e7d1e3 100644 --- a/l10n/de_DE.json +++ b/l10n/de_DE.json @@ -92,10 +92,10 @@ "File has been converted. Its content might look different.": "Die Datei wurde konvertiert. Der Inhalt könnte anders aussehen.", "Download as": "Herunterladen als", "Download": "Herunterladen", - "Convert into": "Konvertieren in", "Origin format": "Ursprüngliches Format", "Failed to send notification": "Fehler beim Senden einer Benachrichtigung", "Notification sent successfully": "Benachrichtigung erfolgreich gesendet", - "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s hat in %2$s erwähnt: \"%3$s\"." + "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s hat in %2$s erwähnt: \"%3$s\".", + "Choose a format to convert {fileName}": "Wählen Sie das Format für {fileName} aus" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/es.js b/l10n/es.js index c946884d..6b4248f5 100644 --- a/l10n/es.js +++ b/l10n/es.js @@ -94,10 +94,10 @@ OC.L10N.register( "File has been converted. Its content might look different.": "El archivo se ha convertido. Su contenido puede ser distinto.", "Download as": "Descargar como", "Download": "Descargar", - "Convert into": "Convertir en", "Origin format": "Formato original", "Failed to send notification": "Error al enviar la notificación", "Notification sent successfully": "Notificación enviada correctamente", - "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s ha mencionado en %2\$s: \"%3\$s\"." + "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s ha mencionado en %2\$s: \"%3\$s\".", + "Choose a format to convert {fileName}": "Elija un formato para convertir {fileName}" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/es.json b/l10n/es.json index d038b026..528c37a1 100644 --- a/l10n/es.json +++ b/l10n/es.json @@ -92,10 +92,10 @@ "File has been converted. Its content might look different.": "El archivo se ha convertido. Su contenido puede ser distinto.", "Download as": "Descargar como", "Download": "Descargar", - "Convert into": "Convertir en", "Origin format": "Formato original", "Failed to send notification": "Error al enviar la notificación", "Notification sent successfully": "Notificación enviada correctamente", - "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s ha mencionado en %2$s: \"%3$s\"." + "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s ha mencionado en %2$s: \"%3$s\".", + "Choose a format to convert {fileName}": "Elija un formato para convertir {fileName}" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/fr.js b/l10n/fr.js index c6d5a65b..627bd99d 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -94,10 +94,10 @@ OC.L10N.register( "File has been converted. Its content might look different.": "Le fichier a été converti. Son contenu peut s'afficher différemment.", "Download as": "Télécharger sous", "Download": "Télécharger", - "Convert into": "Convertir en", "Origin format": "Format d’origin", "Failed to send notification": "Échec de l’envoi de la notification", "Notification sent successfully": "Notification a été envoyée avec succès", - "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s a mentionné dans %2\$s: \"%3\$s\"." + "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s a mentionné dans %2\$s: \"%3\$s\".", + "Choose a format to convert {fileName}": "Choisissez un format à convertir {fileName}" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/fr.json b/l10n/fr.json index aeeff886..43ec20d4 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -92,10 +92,10 @@ "File has been converted. Its content might look different.": "Le fichier a été converti. Son contenu peut s'afficher différemment.", "Download as": "Télécharger sous", "Download": "Télécharger", - "Convert into": "Convertir en", "Origin format": "Format d’origin", "Failed to send notification": "Échec de l’envoi de la notification", "Notification sent successfully": "Notification a été envoyée avec succès", - "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s a mentionné dans %2$s: \"%3$s\"." + "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s a mentionné dans %2$s: \"%3$s\".", + "Choose a format to convert {fileName}": "Choisissez un format à convertir {fileName}" },"pluralForm" :"nplurals=2; plural=(n != 1);" } diff --git a/l10n/it.js b/l10n/it.js index eec375e4..0b99c0ed 100644 --- a/l10n/it.js +++ b/l10n/it.js @@ -94,10 +94,10 @@ OC.L10N.register( "File has been converted. Its content might look different.": "Il file è stato convertito. Il suo contenuto potrebbe avere un aspetto diverso.", "Download as": "Scaricare come", "Download": "Scaricare", - "Convert into": "Convertire in", "Origin format": "Formato di origine", "Failed to send notification": "Invio di notifica non riuscito", "Notification sent successfully": "Notifica è stata inviata con successo", - "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s ha menzionato in %2\$s: \"%3\$s\"." + "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s ha menzionato in %2\$s: \"%3\$s\".", + "Choose a format to convert {fileName}": "Scegli un formato per convertire {fileName}" }, "nplurals=2; plural=(n != 1);"); \ No newline at end of file diff --git a/l10n/it.json b/l10n/it.json index c7f9b3eb..8e48af69 100644 --- a/l10n/it.json +++ b/l10n/it.json @@ -92,10 +92,10 @@ "File has been converted. Its content might look different.": "Il file è stato convertito. Il suo contenuto potrebbe avere un aspetto diverso.", "Download as": "Scaricare come", "Download": "Scaricare", - "Convert into": "Convertire in", "Origin format": "Formato di origine", "Failed to send notification": "Invio di notifica non riuscito", "Notification sent successfully": "Notifica è stata inviata con successo", - "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s ha menzionato in %2$s: \"%3$s\"." + "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s ha menzionato in %2$s: \"%3$s\".", + "Choose a format to convert {fileName}": "Scegli un formato per convertire {fileName}" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/ja.js b/l10n/ja.js index c0e45664..30941070 100644 --- a/l10n/ja.js +++ b/l10n/ja.js @@ -94,10 +94,10 @@ OC.L10N.register( "File has been converted. Its content might look different.": "ファイルが変換されました。 その内容は異なって見えるかもしれません。", "Download as": "別の形式でダウンロード", "Download": "ダウンロード", - "Convert into": "に変換する", "Origin format": "オリジンの形式", "Failed to send notification": "通知を送信できませんでした", "Notification sent successfully": "通知を送信しました", - "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s は %2\$s: \"%3\$s\"に記載されました。" + "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s は %2\$s: \"%3\$s\"に記載されました。", + "Choose a format to convert {fileName}": "{fileName}を変換する形式を選択してください" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/ja.json b/l10n/ja.json index b2862fc4..d7699980 100644 --- a/l10n/ja.json +++ b/l10n/ja.json @@ -92,10 +92,10 @@ "File has been converted. Its content might look different.": "ファイルが変換されました。 その内容は異なって見えるかもしれません。", "Download as": "別の形式でダウンロード", "Download": "ダウンロード", - "Convert into": "に変換する", "Origin format": "オリジンの形式", "Failed to send notification": "通知を送信できませんでした", "Notification sent successfully": "通知を送信しました", - "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s は %2$s: \"%3$s\"に記載されました。" + "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s は %2$s: \"%3$s\"に記載されました。", + "Choose a format to convert {fileName}": "{fileName}を変換する形式を選択してください" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/pl.js b/l10n/pl.js index 6491caa8..0f8247b4 100644 --- a/l10n/pl.js +++ b/l10n/pl.js @@ -94,10 +94,10 @@ OC.L10N.register( "File has been converted. Its content might look different.": "Plik został przekonwertowany. Jego zawartość może wyglądać inaczej.", "Download as": "Pobierz jako", "Download": "Pobierz", - "Convert into": "Konwertuj do", "Origin format": "Oryginalny format", "Failed to send notification": "Nie udało się wysłać powiadomienia", "Notification sent successfully": "Powiadomienie zostało wysłane", - "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s dodał(a) w %2\$s następujący komentarz: \"%3\$s\"." + "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s dodał(a) w %2\$s następujący komentarz: \"%3\$s\".", + "Choose a format to convert {fileName}": "Wybierz format, do którego chcesz przekonwertować {fileName}" }, "nplurals=2; plural=(n != 1);"); \ No newline at end of file diff --git a/l10n/pl.json b/l10n/pl.json index 1487e386..c53675a4 100644 --- a/l10n/pl.json +++ b/l10n/pl.json @@ -92,10 +92,10 @@ "File has been converted. Its content might look different.": "Plik został przekonwertowany. Jego zawartość może wyglądać inaczej.", "Download as": "Pobierz jako", "Download": "Pobierz", - "Convert into": "Konwertuj do", "Origin format": "Oryginalny format", "Failed to send notification": "Nie udało się wysłać powiadomienia", "Notification sent successfully": "Powiadomienie zostało wysłane", - "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s dodał(a) w %2$s następujący komentarz: \"%3$s\"." + "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s dodał(a) w %2$s następujący komentarz: \"%3$s\".", + "Choose a format to convert {fileName}": "Wybierz format, do którego chcesz przekonwertować {fileName}" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/pt_BR.js b/l10n/pt_BR.js index d68fc338..ba88c97f 100644 --- a/l10n/pt_BR.js +++ b/l10n/pt_BR.js @@ -94,10 +94,10 @@ OC.L10N.register( "File has been converted. Its content might look different.": "O arquivo foi convertido. Seu conteúdo pode ser diferente.", "Download as": "Baixar", "Download": "Baixar como", - "Convert into": "Converter em", "Origin format": "Formato de origem", "Failed to send notification": "Falha ao enviar notificação", "Notification sent successfully": "Notificação enviada com sucesso", - "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s mencionado em %2\$s: \"%3\$s\"." + "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s mencionado em %2\$s: \"%3\$s\".", + "Choose a format to convert {fileName}": "Escolha um formato para converter {fileName}" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/pt_BR.json b/l10n/pt_BR.json index 7e8f8c9f..40beca80 100644 --- a/l10n/pt_BR.json +++ b/l10n/pt_BR.json @@ -92,10 +92,10 @@ "File has been converted. Its content might look different.": "O arquivo foi convertido. Seu conteúdo pode ser diferente.", "Download as": "Baixar", "Download": "Baixar como", - "Convert into": "Converter em", "Origin format": "Formato de origem", "Failed to send notification": "Falha ao enviar notificação", "Notification sent successfully": "Notificação enviada com sucesso", - "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s mencionado em %2$s: \"%3$s\"." + "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s mencionado em %2$s: \"%3$s\".", + "Choose a format to convert {fileName}": "Escolha um formato para converter {fileName}" },"pluralForm" :"nplurals=2; plural=(n != 1);" } diff --git a/l10n/ru.js b/l10n/ru.js index f62e55b9..029c8f38 100644 --- a/l10n/ru.js +++ b/l10n/ru.js @@ -94,10 +94,10 @@ OC.L10N.register( "File has been converted. Its content might look different.": "Файл был сконвертирован. Его форматирование могло измениться.", "Download as": "Скачать как", "Download": "Скачать", - "Convert into": "Конвертировать в", "Origin format": "Оригинальный формат", "Failed to send notification": "Ошибка отправки оповещения", "Notification sent successfully": "Оповещение успешно отправлено", - "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s упомянул в %2\$s: \"%3\$s\"." + "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s упомянул в %2\$s: \"%3\$s\".", + "Choose a format to convert {fileName}": "Выберите формат для {fileName}" }, "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"); diff --git a/l10n/ru.json b/l10n/ru.json index c2ccca0b..7cbe7894 100644 --- a/l10n/ru.json +++ b/l10n/ru.json @@ -92,10 +92,10 @@ "File has been converted. Its content might look different.": "Файл был сконвертирован. Его форматирование могло измениться.", "Download as": "Скачать как", "Download": "Скачать", - "Convert into": "Конвертировать в", "Origin format": "Оригинальный формат", "Failed to send notification": "Ошибка отправки оповещения", "Notification sent successfully": "Оповещение успешно отправлено", - "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s упомянул в %2$s: \"%3$s\"." + "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s упомянул в %2$s: \"%3$s\".", + "Choose a format to convert {fileName}": "Выберите формат для {fileName}" },"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);" } \ No newline at end of file diff --git a/l10n/sv.js b/l10n/sv.js index 3f7c2352..241f9a84 100644 --- a/l10n/sv.js +++ b/l10n/sv.js @@ -94,10 +94,10 @@ OC.L10N.register( "File has been converted. Its content might look different.": "Filen har konverterats. Dess innehåll kan se annorlunda ut.", "Download as": "Ladda ned som", "Download": "Ladda ned", - "Convert into": "Konvertera till", "Origin format": "Ursprungsformat", "Failed to send notification": "Det gick inte att skicka aviseringen", "Notification sent successfully": "Aviseringen har skickats", - "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s har nämnt i %2\$s: \"%3\$s\"." + "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s har nämnt i %2\$s: \"%3\$s\".", + "Choose a format to convert {fileName}": "Välj det filformat som {fileName} ska konverteras till." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/sv.json b/l10n/sv.json index 4f2561ab..1345c951 100644 --- a/l10n/sv.json +++ b/l10n/sv.json @@ -92,10 +92,10 @@ "File has been converted. Its content might look different.": "Filen har konverterats. Dess innehåll kan se annorlunda ut.", "Download as": "Ladda ned som", "Download": "Ladda ned", - "Convert into": "Konvertera till", "Origin format": "Ursprungsformat", "Failed to send notification": "Det gick inte att skicka aviseringen", "Notification sent successfully": "Aviseringen har skickats", - "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s har nämnt i %2$s: \"%3$s\"." + "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s har nämnt i %2$s: \"%3$s\".", + "Choose a format to convert {fileName}": "Välj det filformat som {fileName} ska konverteras till." },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/zh_CN.js b/l10n/zh_CN.js index b59a7c21..fcedd10b 100644 --- a/l10n/zh_CN.js +++ b/l10n/zh_CN.js @@ -94,10 +94,10 @@ OC.L10N.register( "File has been converted. Its content might look different.": "文件已被转换。其内容可能看起来有所不同。", "Download as": "下载为", "Download": "下载", - "Convert into": "转换为", "Origin format": "原产地格式", "Failed to send notification": "发送通知失败", "Notification sent successfully": "通知发送成功", - "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s 提到 %2\$s: \"%3\$s\"." + "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s 提到 %2\$s: \"%3\$s\".", + "Choose a format to convert {fileName}": "选择要转换{fileName}的格式" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/zh_CN.json b/l10n/zh_CN.json index 62c6685e..8e4e748b 100644 --- a/l10n/zh_CN.json +++ b/l10n/zh_CN.json @@ -92,10 +92,10 @@ "File has been converted. Its content might look different.": "文件已被转换。其内容可能看起来有所不同。", "Download as": "下载为", "Download": "下载", - "Convert into": "转换为", "Origin format": "原产地格式", "Failed to send notification": "发送通知失败", "Notification sent successfully": "通知发送成功", - "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s 提到 %2$s: \"%3$s\"." + "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s 提到 %2$s: \"%3$s\".", + "Choose a format to convert {fileName}": "选择要转换{fileName}的格式" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file From c431c2b530866768ebc6d377069682395f486697 Mon Sep 17 00:00:00 2001 From: svetlana maleeva Date: Tue, 31 Aug 2021 15:30:04 +0300 Subject: [PATCH 05/29] Update download links, prices link and helpcenter links --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 213a72d0..e32a4b00 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ ONLYOFFICE Document Server and ownCloud can be installed either on different com You can install free Community version of ONLYOFFICE Docs or scalable Enterprise Edition with pro features. -To install free Community version, use [Docker](https://github.com/onlyoffice/Docker-DocumentServer) (recommended) or follow [these instructions](https://helpcenter.onlyoffice.com/server/linux/document/linux-installation.aspx) for Debian, Ubuntu, or derivatives. +To install free Community version, use [Docker](https://github.com/onlyoffice/Docker-DocumentServer) (recommended) or follow [these instructions](https://helpcenter.onlyoffice.com/installation/docs-community-install-ubuntu.aspx) for Debian, Ubuntu, or derivatives. -To install Enterprise Edition, follow instructions [here](https://helpcenter.onlyoffice.com/server/integration-edition/index.aspx). +To install Enterprise Edition, follow instructions [here](https://helpcenter.onlyoffice.com/installation/docs-enterprise-index.aspx). Community Edition vs Enterprise Edition comparison can be found [here](#onlyoffice-docs-editions). -To use ONLYOFFICE behind a proxy, please refer to [this article](https://helpcenter.onlyoffice.com/server/document/document-server-proxy.aspx). +To use ONLYOFFICE behind a proxy, please refer to [this article](https://helpcenter.onlyoffice.com/installation/docs-community-proxy.aspx). You can also use our **[Docker installation](https://github.com/ONLYOFFICE/docker-onlyoffice-owncloud)** to install pre-configured Document Server (free version) and ownCloud with a couple of commands. @@ -198,13 +198,13 @@ The table below will help you to make the right choice. | Pricing and licensing | Community Edition | Enterprise Edition | | ------------- | ------------- | ------------- | -| | [Get it now](https://www.onlyoffice.com/download.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | [Start Free Trial](https://www.onlyoffice.com/enterprise-edition-free.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | -| Cost | FREE | [Go to the pricing page](https://www.onlyoffice.com/enterprise-edition.aspx??utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | +| | [Get it now](https://www.onlyoffice.com/download-docs.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud#docs-community) | [Start Free Trial](https://www.onlyoffice.com/download-docs.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud#docs-enterprise) | +| Cost | FREE | [Go to the pricing page](https://www.onlyoffice.com/docs-enterprise-prices.aspx??utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | | Simultaneous connections | up to 20 maximum | As in chosen pricing plan | | Number of users | up to 20 recommended | As in chosen pricing plan | | License | GNU AGPL v.3 | Proprietary | | **Support** | **Community Edition** | **Enterprise Edition** | -| Documentation | [Help Center](https://helpcenter.onlyoffice.com/server/docker/opensource/index.aspx) | [Help Center](https://helpcenter.onlyoffice.com/server/integration-edition/index.aspx) | +| Documentation | [Help Center](https://helpcenter.onlyoffice.com/installation/docs-community-index.aspx) | [Help Center](https://helpcenter.onlyoffice.com/installation/docs-enterprise-index.aspx) | | Standard support | [GitHub](https://github.com/ONLYOFFICE/DocumentServer/issues) or paid | One year support included | | Premium support | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | | **Services** | **Community Edition** | **Enterprise Edition** | @@ -252,7 +252,7 @@ The table below will help you to make the right choice. | Transitions | + | + | | Presenter mode | + | + | | Notes | + | + | -| | [Get it now](https://www.onlyoffice.com/download.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | [Start Free Trial](https://www.onlyoffice.com/enterprise-edition-free.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | +| | [Get it now](https://www.onlyoffice.com/download-docs.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud#docs-community) | [Start Free Trial](https://www.onlyoffice.com/download-docs.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud#docs-enterprise) | \* It's possible to add documents for comparison from your local drive, from URL and from ownCloud storage. From 1bfc81e80c707708c785a02d7786f218c1a2d5ad Mon Sep 17 00:00:00 2001 From: Antipkin-A Date: Tue, 7 Sep 2021 11:42:48 +0300 Subject: [PATCH 06/29] open share link directly (Fix #334) --- CHANGELOG.md | 3 +++ js/main.js | 26 ++++++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23addfdc..be7a05b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## Changed +- open share link directly + ## 7.1.1 ## Added - support ownCloud Web diff --git a/js/main.js b/js/main.js index 0b42e1ce..3b15668b 100644 --- a/js/main.js +++ b/js/main.js @@ -434,16 +434,26 @@ return; } - var button = document.createElement("a"); - button.href = OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/s/" + encodeURIComponent($("#sharingToken").val())); - button.className = "onlyoffice-public-open button"; - button.innerText = t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE") + var editorUrl = OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/s/" + encodeURIComponent($("#sharingToken").val())); - if (!OCA.Onlyoffice.setting.sameTab) { - button.target = "_blank"; - } + if (oc_appswebroots.richdocuments + || oc_appswebroots.files_pdfviewer && extension === "pdf" + || oc_appswebroots.files_texteditor && extension === "txt") { + + var button = document.createElement("a"); + button.href = editorUrl; + button.className = "onlyoffice-public-open button"; + button.innerText = t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE") - $("#preview").prepend(button); + if (!OCA.Onlyoffice.setting.sameTab) { + button.target = "_blank"; + } + + $("#preview").prepend(button); + } else { + var $iframe = $("