Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release/5.2.0 #31

Merged
merged 2 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions env/.htaccess
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
# https://wordpress.org/support/article/htaccess/
<IfModule mod_rewrite.c>
# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</IfModule>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@podlove/web-player-configurator",
"version": "5.1.2",
"version": "5.2.0",
"description": "Podlove Web Player Configurator",
"author": "Alexander Heimbuch <github@heimbu.ch>",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions src/block/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ registerBlockType('podlove-web-player/shortcode', {
type: 'string',
default: 'default',
},

show: {
type: 'string'
},
},

edit: props => (
Expand Down
2 changes: 2 additions & 0 deletions src/block/components/inspector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Custom from './custom'
import Post from './post'
import Publisher from './publisher'
import Settings from './settings'
import Shows from './shows'
import { type } from '../utils'

const { compose } = wp.compose
Expand All @@ -26,6 +27,7 @@ class Inspector extends Component {
<Fragment>
<Settings {...this.props} />
<Publisher {...this.props} />
<Shows {...this.props} />
</Fragment>
)

Expand Down
2 changes: 1 addition & 1 deletion src/block/components/inspector/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Settings extends Component {
this.setState({
configs: keys(data.configs).map(data => ({ value: data, label: data })),
themes: keys(data.themes).map(data => ({ value: data, label: data })),
templates: keys(data.templates).map(data => ({ value: data, label: data }))
templates: keys(data.templates).map(data => ({ value: data, label: data })),
})
}

Expand Down
60 changes: 60 additions & 0 deletions src/block/components/inspector/shows.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import './inspector.scss'
import { keys } from 'lodash'

const { Component } = wp.element
const { compose } = wp.compose
const { withSpokenMessages, SelectControl, PanelBody, PanelRow } = wp.components
const { InspectorControls } = wp.blockEditor
const { __ } = wp.i18n

class Shows extends Component {
constructor(props) {
super(...arguments);
this.props = props;
this.state = {
shows: []
}
}

async componentDidMount() {
const shows = await fetch(window.PODLOVE_WEB_PLAYER.api.shows).then(result => result.json())
console.log(shows)
this.setState({
shows: shows || []
})
}

render() {
const {
setAttributes,
attributes
} = this.props

const { shows } = this.state

if (shows.concat.length === 0) {
return null
}

const select = show => console.log(show) || setAttributes({ show })
const options = [{ id: null, name: __('Select', 'podlove-web-player') }]
.concat(shows || [])
.map(({ slug, name }) => ({ value: slug, label: name }))

return <InspectorControls>
<PanelBody title={__('Shows', 'podlove-web-player')}>
<PanelRow>
<SelectControl
value={attributes.show}
options={options}
onChange={select}
/>
</PanelRow>
</PanelBody>
</InspectorControls>
}
}

export default compose([
withSpokenMessages
])(Shows)
2 changes: 1 addition & 1 deletion src/block/components/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Player extends Component {
const routes = window.PODLOVE_WEB_PLAYER.embed

let episode
const config = [routes.config, attributes.config, 'theme', attributes.theme].join('/')
const config = [routes.config, attributes.config, 'theme', attributes.theme, ...(attributes.show ? ['show', attributes.show] : [])].join('/')
const template = get(this.plugin, ['templates', attributes.template], '')

switch (this.type) {
Expand Down
2 changes: 1 addition & 1 deletion src/block/components/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default compose([
}),
posts: getEntityRecords('postType', 'post', {
per_page: 1,
}),
})
}
}),
withSpokenMessages,
Expand Down
74 changes: 74 additions & 0 deletions src/configurator/assets/episode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import poster from './cover.png'
import fry from './fry.png'
import bender from './bender.png'
import professor from './professor.png'

export default ({ title, duration }) => ({
title,
version: 5,
show: {
title: 'Futurama',
subtitle: `Intergalactic conspiracies and other strange stuff`,
summary: `Hatched from Matt Groening's brain, Futurama follows pizza guy Philip J. Fry, who reawakens in 31st century New New York after a cryonics lab accident.`,
poster,
url: 'http://fillerama.io/',
},

subtitle: `Why am I sticky and naked? Did I miss something fun? In your time, yes, but nowadays shut up! Besides, these are adult stemcells, harvested from perfectly healthy adults whom I killed for their stemcells.`,
summary: `Ah, computer dating. It's like pimping, but you rarely have to use the phrase "upside your head." Who am I making this out to? Okay, I like a challenge. As an interesting side note, as a head without a body, I envy the dead.`,
publicationDate: '2016-02-11T03:13:55+00:00',
duration,

contributors: [
{
id: 'fry',
avatar: fry,
name: 'Philip J. Fry',
group: { id: '1', slug: 'planet-express', title: 'Planet Express' },
},
{
id: 'farnsworth',
avatar: professor,
name: 'Professor Farnsworth',
group: { id: '1', slug: 'planet-express', title: 'Planet Express' },
},
{
id: 'bender',
avatar: bender,
name: 'Bender Bending Rodríguez',
group: { id: '1', slug: 'planet-express', title: 'Planet Express' },
},
],

chapters: [
{ start: '00:00:00', title: 'With gusto.' },
{ start: '00:01:39', title: 'Good news' },
{ start: '00:04:58', title: 'You stole the atom' },
{ start: '00:18:37', title: `Oh, I don't have time for this` },
{ start: '00:33:40', title: 'Her company is big and evil!' },
{ start: '00:35:37', title: 'Have you ever tried just turning off the TV' },
{ start: '01:17:26', title: 'Hello, little man' },
{ start: '01:24:55', title: 'Take me to your leader!' },
],

audio: [
{
url: 'http://techslides.com/demos/samples/sample.m4a',
mimeType: 'audio/mp4',
size: 93260000,
title: 'Audio MP4',
},
{
url: 'http://techslides.com/demos/samples/sample.mp3',
mimeType: 'audio/mp3',
size: 14665000,
title: 'Audio MP3',
},
{
url: 'http://techslides.com/demos/samples/sample.ogg',
mimeType: 'audio/ogg',
size: 94400000,
title: 'Audio Ogg',
},
],
})
5 changes: 5 additions & 0 deletions src/configurator/assets/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import episode from './episode'

export {
episode
}
100 changes: 25 additions & 75 deletions src/configurator/components/Player.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@

<script>
import { mapGetters } from 'vuex'

import poster from '../assets/cover.png'
import fry from '../assets/fry.png'
import bender from '../assets/bender.png'
import professor from '../assets/professor.png'
import { episode } from '../assets'

export default {
props: {
Expand All @@ -34,77 +30,30 @@ export default {

data() {
return {
episode: {
version: 5,
show: {
title: 'Futurama',
subtitle: `Intergalactic conspiracies and other strange stuff`,
summary: `Hatched from Matt Groening's brain, Futurama follows pizza guy Philip J. Fry, who reawakens in 31st century New New York after a cryonics lab accident.`,
poster,
url: 'http://fillerama.io/',
episode: episode({ title: 'Five hours?', duration: '01:30:32' }),
playlist: [
{
title: 'Five hours?',
active: true,
duration: '01:30:32',
config: episode({ title: 'Five hours?', duration: '01:30:32' }),
},


title: 'Five hours?',
subtitle: `Why am I sticky and naked? Did I miss something fun? In your time, yes, but nowadays shut up! Besides, these are adult stemcells, harvested from perfectly healthy adults whom I killed for their stemcells.`,
summary: `Ah, computer dating. It's like pimping, but you rarely have to use the phrase "upside your head." Who am I making this out to? Okay, I like a challenge. As an interesting side note, as a head without a body, I envy the dead.`,
publicationDate: '2016-02-11T03:13:55+00:00',
duration: '01:30:32',


contributors: [
{
id: 'fry',
avatar: fry,
name: 'Philip J. Fry',
group: { id: "1", slug: "planet-express", title: "Planet Express" }
},
{
id: 'farnsworth',
avatar: professor,
name: 'Professor Farnsworth',
group: { id: "1", slug: "planet-express", title: "Planet Express" }
},
{
id: 'bender',
avatar: bender,
name: 'Bender Bending Rodríguez',
group: { id: "1", slug: "planet-express", title: "Planet Express" }
},
],

chapters: [
{ start: '00:00:00', title: 'With gusto.' },
{ start: '00:01:39', title: 'Good news' },
{ start: '00:04:58', title: 'You stole the atom' },
{ start: '00:18:37', title: `Oh, I don't have time for this` },
{ start: '00:33:40', title: 'Her company is big and evil!' },
{ start: '00:35:37', title: 'Have you ever tried just turning off the TV' },
{ start: '01:17:26', title: 'Hello, little man' },
{ start: '01:24:55', title: 'Take me to your leader!' },
],

audio: [
{
url: 'http://techslides.com/demos/samples/sample.m4a',
mimeType: 'audio/mp4',
size: 93260000,
title: 'Audio MP4',
},
{
url: 'http://techslides.com/demos/samples/sample.mp3',
mimeType: 'audio/mp3',
size: 14665000,
title: 'Audio MP3',
},
{
url: 'http://techslides.com/demos/samples/sample.ogg',
mimeType: 'audio/ogg',
size: 94400000,
title: 'Audio Ogg',
},
],
},
{
title: 'These old Doomsday',
duration: '02:10:45',
config: episode({ title: 'These old Doomsday', duration: '02:10:45' }),
},
{
title: 'Blame the wizards!',
duration: '00:45:13',
config: episode({ title: 'Blame the wizards!', duration: '00:45:13' }),
},
{
title: 'Ah, computer dating',
duration: '00:55:10',
config: episode({ title: 'Ah, computer dating', duration: '00:55:10' }),
},
],
}
},

Expand Down Expand Up @@ -132,6 +81,7 @@ export default {
theme: this.theme,
base: '/wp-content/plugins/podlove-web-player/web-player/',
version: 5,
playlist: this.playlist,
})
.then(store => {
this.$emit('ready', store)
Expand Down
5 changes: 5 additions & 0 deletions src/plugin/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ If you encounter any issue with the plugin or want to request a specific feature

== Changelog ==

= 5.2.0 =

- Extract defaults to fix incorrect persisted paths
- Add the ability to use Podlove Publisher shows to display related episodes

= 5.1.2 =

- Fix a bug that causes a warning on pages
Expand Down
Loading