Skip to content

Commit

Permalink
Add 'title' attribute to iframe for accessibility
Browse files Browse the repository at this point in the history
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
  • Loading branch information
Darshan-upadhyay1110 authored and juliusknorr committed Jul 15, 2024
1 parent 6b2bb8f commit b22cb5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const documentsMain = {
+ '</form>'

// iframe that contains the Collabora Online Viewer
const frame = '<iframe data-cy="coolframe" id="loleafletframe" name="loleafletframe_viewer" allowfullscreen allow="clipboard-read *; clipboard-write *" nonce="' + btoa(getRequestToken()) + '" style="width:100%;height:100%;position:absolute;"/>'
const frame = '<iframe data-cy="coolframe" id="loleafletframe" name="loleafletframe_viewer" allowfullscreen allow="clipboard-read *; clipboard-write *" nonce="' + btoa(getRequestToken()) + '" style="width:100%;height:100%;position:absolute;" title="' + loadState('richdocuments', 'productName', 'Nextcloud Office') + '"/>'

$('#revViewer').append(form)

Check warning on line 172 in src/document.js

View workflow job for this annotation

GitHub Actions / NPM lint

The global property or function $ was deprecated in Nextcloud 19.0.0
$('#revViewer').append(frame)

Check warning on line 173 in src/document.js

View workflow job for this annotation

GitHub Actions / NPM lint

The global property or function $ was deprecated in Nextcloud 19.0.0
Expand Down Expand Up @@ -227,7 +227,7 @@ const documentsMain = {
+ '</form>'

// iframe that contains the Collabora Online
const frame = '<iframe data-cy="coolframe" id="loleafletframe" name="loleafletframe" nonce="' + btoa(getRequestToken()) + '" scrolling="no" allowfullscreen allow="clipboard-read *; clipboard-write *" style="width:100%;height:100%;position:absolute;" />'
const frame = '<iframe data-cy="coolframe" id="loleafletframe" name="loleafletframe" nonce="' + btoa(getRequestToken()) + '" scrolling="no" allowfullscreen allow="clipboard-read *; clipboard-write *" style="width:100%;height:100%;position:absolute;" title="' + loadState('richdocuments', 'productName', 'Nextcloud Office') + '"/>'

$('#mainContainer').append(form)
$('#mainContainer').append(frame)
Expand Down
6 changes: 5 additions & 1 deletion src/view/Office.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
allow="clipboard-read *; clipboard-write *"
class="office-viewer__iframe"
:style="{visibility: showIframe ? 'visible' : 'hidden' }"
:src="iframeSrc" />
:src="iframeSrc"
:title="iframeTitle" />

<NcButton v-if="isEmbedded && !hasWidgetEditingEnabled" class="toggle-interactive" @click="toggleEdit">
{{ t('richdocuments', 'Edit') }}
Expand Down Expand Up @@ -211,6 +212,9 @@ export default {
showIframe() {
return this.loading >= LOADING_STATE.FRAME_READY || this.debug
},
iframeTitle() {
return loadState('richdocuments', 'productName', 'Nextcloud Office')
},
showLoadingIndicator() {
return this.loading < LOADING_STATE.FRAME_READY
},
Expand Down

0 comments on commit b22cb5a

Please sign in to comment.