diff --git a/README.md b/README.md index f6f5b6d85c1af7c0559fc0e1da657d359d2aa37e..8a2e8dfc074f2a4ac74de8ef863c58954cf4b14c 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,8 @@ Note that you will need a Keycloak server along with a client id for the domain - example `nextcloud-file-url="http://localhost:8081/apps/files/?dir="` - `nextcloud-name` (optional): Name of the Nextcloud service - example `nextcloud-name="My Nextcloud"` +- `nextcloud-auth-info` (optional): Additional authentication information text that is shown in the Nextcloud file picker + - example `nextcloud-auth-info="You need special permissions for this function"` - `allow-annotating` (optional): Needs to be set to allow annotating the PDFs - example `allow-annotating` @@ -102,6 +104,8 @@ Note that you will need a Keycloak server along with a client id for the domain - example `nextcloud-file-url="http://localhost:8081/apps/files/?dir="` - `nextcloud-name` (optional): Name of the Nextcloud service - example `nextcloud-name="My Nextcloud"` +- `nextcloud-auth-info` (optional): Additional authentication information text that is shown in the Nextcloud file picker + - example `nextcloud-auth-info="You need special permissions for this function"` - `allow-annotating` (optional): Needs to be set to allow annotating the PDFs - example `allow-annotating` - `show-clipboard` (optional): Needs to be set to allow using the clipboard in the file picker dialog diff --git a/assets/dbp-signature.html.ejs b/assets/dbp-signature.html.ejs index 3e45988a297d48ef4c5f5284346fdf64786223b9..f5a5c4845f34b4e5cf3f883dc17bf10b17a6cb0f 100644 --- a/assets/dbp-signature.html.ejs +++ b/assets/dbp-signature.html.ejs @@ -59,6 +59,7 @@ <body> <<%= name %> + id="app" lang="de" entry-point-url="<%= entryPointURL %>" show-nextcloud-file-picker <%= buildInfo.env !== 'production' ? 'show-clipboard' : '' %> @@ -66,6 +67,7 @@ nextcloud-web-app-password-url="<%= nextcloudWebAppPasswordURL %>" nextcloud-webdav-url="<%= nextcloudWebDavURL %>" nextcloud-name="<%= nextcloudName %>" + nextcloud-auth-info="" nextcloud-file-url="<%= nextcloudFileURL %>" initial-file-handling-state clipboard-files @@ -84,5 +86,25 @@ <!-- Error handling for too old browsers --> <script src="<%= getPrivateUrl('browser-check.js') %>" defer></script> <noscript>Diese Applikation benötigt Javascript / This application requires Javascript</noscript> +<script> + const langTexts = { + "de": { + "nextcloud-auth-info": "Für diese Funktion ist ein TU Graz Bediensteten Account nötig!", + }, + "en": { + "nextcloud-auth-info": "A TU Graz employee account is required for this function!", + }, + } + + window.addEventListener('dbp-lang', function (e) { + const lang = e.detail; + if (!lang) { + return; + } + + const app = document.getElementById("app"); + app.setAttribute("nextcloud-auth-info", langTexts[lang]["nextcloud-auth-info"]); + }); +</script> </body> </html> \ No newline at end of file diff --git a/src/dbp-official-signature-pdf-upload.js b/src/dbp-official-signature-pdf-upload.js index b37a8931662b2e7f9c55da89e3e3a67d7e0d3b34..811bcbad08639b6ae81a3e9c19b1b4728d48fe85 100644 --- a/src/dbp-official-signature-pdf-upload.js +++ b/src/dbp-official-signature-pdf-upload.js @@ -31,6 +31,7 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem this.nextcloudWebDavURL = ""; this.nextcloudName = ""; this.nextcloudFileURL = ""; + this.nextcloudAuthInfo = ""; this.signedFiles = []; this.signedFilesCount = 0; this.signedFilesToDownload = 0; @@ -85,6 +86,7 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem nextcloudWebDavURL: { type: String, attribute: 'nextcloud-webdav-url' }, nextcloudName: { type: String, attribute: 'nextcloud-name' }, nextcloudFileURL: { type: String, attribute: 'nextcloud-file-url' }, + nextcloudAuthInfo: {type: String, attribute: 'nextcloud-auth-info'}, signedFiles: { type: Array, attribute: false }, signedFilesCount: { type: Number, attribute: false }, signedFilesToDownload: { type: Number, attribute: false }, @@ -854,6 +856,7 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem nextcloud-auth-url="${this.nextcloudWebAppPasswordURL}" nextcloud-web-dav-url="${this.nextcloudWebDavURL}" nextcloud-name="${this.nextcloudName}" + nextcloud-auth-info="${this.nextcloudAuthInfo}" nextcloud-file-url="${this.nextcloudFileURL}" decompress-zip lang="${this.lang}" diff --git a/src/dbp-official-signature-pdf-upload.metadata.json b/src/dbp-official-signature-pdf-upload.metadata.json index fc6e45515890b0a32b1ae8d9868a44f6560582b3..e14ba4f7bd1f7276f85129c17e68ad73a696608b 100644 --- a/src/dbp-official-signature-pdf-upload.metadata.json +++ b/src/dbp-official-signature-pdf-upload.metadata.json @@ -14,6 +14,6 @@ "de": "Erlaubt das Hochladen von PDF-Dokumenten, um sie mit einer Amtssignatur zu versehen", "en": "Allows upload of PDF-documents to officially sign them" }, - "subscribe": "lang,entry-point-url,nextcloud-web-app-password-url,nextcloud-webdav-url,nextcloud-name,nextcloud-file-url,show-nextcloud-file-picker,auth,allow-annotating,show-clipboard", + "subscribe": "lang,entry-point-url,nextcloud-web-app-password-url,nextcloud-webdav-url,nextcloud-name,nextcloud-auth-info,nextcloud-file-url,show-nextcloud-file-picker,auth,allow-annotating,show-clipboard", "required_roles": ["ROLE_SCOPE_OFFICIAL-SIGNATURE"] } diff --git a/src/dbp-qualified-signature-pdf-upload.js b/src/dbp-qualified-signature-pdf-upload.js index 5b337e21aca39211ba98eab23bede08082895ec6..7757bddeb4c0848924cce237b369a9e6ed44a154 100644 --- a/src/dbp-qualified-signature-pdf-upload.js +++ b/src/dbp-qualified-signature-pdf-upload.js @@ -32,6 +32,7 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle this.nextcloudWebDavURL = ""; this.nextcloudName = ""; this.nextcloudFileURL = ""; + this.nextcloudAuthInfo = ""; this.externalAuthInProgress = false; this.signedFiles = []; this.signedFilesCount = 0; @@ -88,6 +89,7 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle nextcloudWebDavURL: { type: String, attribute: 'nextcloud-webdav-url' }, nextcloudName: { type: String, attribute: 'nextcloud-name' }, nextcloudFileURL: { type: String, attribute: 'nextcloud-file-url' }, + nextcloudAuthInfo: {type: String, attribute: 'nextcloud-auth-info'}, signedFiles: { type: Array, attribute: false }, signedFilesCount: { type: Number, attribute: false }, signedFilesToDownload: { type: Number, attribute: false }, @@ -996,6 +998,7 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle nextcloud-auth-url="${this.nextcloudWebAppPasswordURL}" nextcloud-web-dav-url="${this.nextcloudWebDavURL}" nextcloud-name="${this.nextcloudName}" + nextcloud-auth-info="${this.nextcloudAuthInfo}" nextcloud-file-url="${this.nextcloudFileURL}" decompress-zip lang="${this.lang}" diff --git a/src/dbp-qualified-signature-pdf-upload.metadata.json b/src/dbp-qualified-signature-pdf-upload.metadata.json index 5ff488dbaa9c90412351c1191a5d23fd4dd1bccc..d88d5dc7f7c4cf5c8c76994f34aa40529141edf3 100644 --- a/src/dbp-qualified-signature-pdf-upload.metadata.json +++ b/src/dbp-qualified-signature-pdf-upload.metadata.json @@ -14,5 +14,5 @@ "de": "Erlaubt das Hochladen von PDF-Dokumenten, um sie mit einer persönlichen elektronischen Signatur zu versehen", "en": "Allows upload of PDF-documents to personally sign them" }, - "subscribe": "lang,entry-point-url,nextcloud-web-app-password-url,nextcloud-webdav-url,nextcloud-name,nextcloud-file-url,show-nextcloud-file-picker,auth,allow-annotating" + "subscribe": "lang,entry-point-url,nextcloud-web-app-password-url,nextcloud-webdav-url,nextcloud-name,nextcloud-auth-info,nextcloud-file-url,show-nextcloud-file-picker,auth,allow-annotating" } diff --git a/vendor/toolkit b/vendor/toolkit index 18901b3baf6a317fd98f6d995ada35f0101f5686..0711b12be3dc814cdbf15a0779e8f2098448835d 160000 --- a/vendor/toolkit +++ b/vendor/toolkit @@ -1 +1 @@ -Subproject commit 18901b3baf6a317fd98f6d995ada35f0101f5686 +Subproject commit 0711b12be3dc814cdbf15a0779e8f2098448835d