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 <darshan.upadhyay@collabora.com>
  • Loading branch information
Darshan-upadhyay1110 committed Jul 9, 2024
1 parent f020d39 commit 4f66904
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Config from './services/config.tsx'
import { getUIDefaults, generateCSSVarTokens, getCollaboraTheme } from './helpers/coolParameters.js'
import { enableScrollLock } from './helpers/safariFixer.js'
import PostMessageService from './services/postMessage.tsx'
import { getCapabilities } from './services/capabilities.ts'
import {
callMobileMessage,
isDirectEditing,
Expand Down Expand Up @@ -171,7 +172,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="' + getCapabilities().productName + '"/>'

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

Check warning on line 177 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 178 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 @@ -231,7 +232,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="' + getCapabilities().productName + '"/>'

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

Check failure on line 68 in src/view/Office.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected a space before '/>', but not found

<NcButton v-if="isEmbedded && !hasWidgetEditingEnabled" class="toggle-interactive" @click="toggleEdit">
{{ t('richdocuments', 'Edit') }}
Expand Down

0 comments on commit 4f66904

Please sign in to comment.