Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Removed iframe-height.js and its implementations (#1063)
Browse files Browse the repository at this point in the history
Co-authored-by: Zack Krida <zackkrida@pm.me>
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 8, 2022
1 parent 701aafc commit 961626c
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 76 deletions.
3 changes: 0 additions & 3 deletions src/layouts/blank.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
<script>
import { computed, defineComponent } from '@nuxtjs/composition-api'
import iframeHeight from '~/mixins/iframe-height'
import { useNavStore } from '~/stores/nav'
import VTranslationStatusBanner from '~/components/VTranslationStatusBanner.vue'
Expand All @@ -20,7 +18,6 @@ import VMigrationNotice from '~/components/VMigrationNotice.vue'
export default defineComponent({
name: 'Blank',
components: { VMigrationNotice, VTranslationStatusBanner },
mixins: [iframeHeight],
setup() {
const navStore = useNavStore()
const isReferredFromCc = computed(() => navStore.isReferredFromCc)
Expand Down
3 changes: 0 additions & 3 deletions src/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import { isMinScreen } from '~/composables/use-media-query'
import { useFilterSidebarVisibility } from '~/composables/use-filter-sidebar-visibility'
import iframeHeight from '~/mixins/iframe-height'
import { useNavStore } from '~/stores/nav'
import VMigrationNotice from '~/components/VMigrationNotice.vue'
Expand All @@ -52,7 +50,6 @@ const embeddedPage = {
VGlobalAudioSection,
},
layout: 'embedded',
mixins: [iframeHeight],
head() {
return this.$nuxtI18nHead({ addSeoAttributes: true, addDirAttribute: true })
},
Expand Down
4 changes: 2 additions & 2 deletions src/locales/po-files/openverse.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Openverse \n"
"Report-Msgid-Bugs-To: https://github.com/wordpress/openverse/issues \n"
"POT-Creation-Date: 2022-03-04T12:13:48+00:00\n"
"POT-Creation-Date: 2022-03-07T19:35:50+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -1121,7 +1121,7 @@ msgid "Couldn't find image with id ###id###"
msgstr ""

#. Do not translate words between ### ###.
#: src/pages/audio/_id.vue:67
#: src/pages/audio/_id.vue:65
msgctxt "error.media-not-found"
msgid "Couldn't find ###mediaType### with id ###id###"
msgstr ""
Expand Down
5 changes: 2 additions & 3 deletions src/middleware/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { sendWindowMessage } from '~/utils/send-message'
import { useNavStore } from '~/stores/nav'

/**
* In embedded mode, the app sends its size and url
* In embedded mode, the app sends its url
* to the outer window to improve the user experience.
*
* The app is in embedded mode by default. To set it to
Expand All @@ -12,8 +12,7 @@ import { useNavStore } from '~/stores/nav'
*
* Messages sent to the outer window have the following format:
* {type: <event type>, value: <event value>}.
* Currently, two event types are used:
* - `resize` sends the height of the window (see `src/mixins/iframe-height.js`)
* Currently, one event type is used:
* - `urlChange` sends the relative path of the URL on every URL change.
*/
export default function ({ query, route, $pinia }) {
Expand Down
60 changes: 0 additions & 60 deletions src/mixins/iframe-height.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/pages/audio/_id.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@
import { mapState } from 'vuex'
import { FETCH_MEDIA_ITEM } from '~/constants/action-types'
import iframeHeight from '~/mixins/iframe-height'
import { AUDIO } from '~/constants/media'
import getAttributionHtml from '~/utils/attribution-html'
import { getFullLicenseName } from '~/utils/license'
import { MEDIA } from '~/constants/store-modules'
const AudioDetailPage = {
name: 'AudioDetailPage',
mixins: [iframeHeight],
data() {
return {
showBackToSearchLink: false,
Expand Down
4 changes: 1 addition & 3 deletions test/iframe-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@
}

let handler

switch (data.type) {
case 'resize':
handler = updateHeight
break
case 'urlChange':
handler = updatePath
break
Expand Down

0 comments on commit 961626c

Please sign in to comment.