Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #383 from alexander-heimbuch/fix/github-releases
Browse files Browse the repository at this point in the history
Fix/GitHub releases
  • Loading branch information
alexander-heimbuch authored Jun 2, 2017
2 parents afd04ff + 4794704 commit 69cd82e
Show file tree
Hide file tree
Showing 16 changed files with 330 additions and 166 deletions.
9 changes: 7 additions & 2 deletions scripts/deploy-release.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/bin/sh
echo "Publishing to Github Releases"
publish-release --token $GITHUB_TOKEN --owner $CIRCLE_PROJECT_USERNAME --repo $CIRCLE_PROJECT_REPONAME --tag $CIRCLE_TAG --assets dist/* --name "Podlove Web Player" --notes " "

ASSETS_DIRECTORY=dist/*.*

FILES=$(ls -m $ASSETS_DIRECTORY | sed -e "s/, /,/g")

# echo "Publishing to Github Releases"
publish-release --token $GITHUB_TOKEN --owner $CIRCLE_PROJECT_USERNAME --repo $CIRCLE_PROJECT_REPONAME --tag $CIRCLE_TAG --assets $FILES --name "Podlove Web Player" --notes " "
4 changes: 4 additions & 0 deletions src/components/shared/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,9 @@
background: $background-color;
}
}
&.labeled {
font-size: 0.8em;
}
}
</style>
63 changes: 21 additions & 42 deletions src/components/tabs/settings/Settings.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<template>
<div class="settings">
<div class="seperator">
<h4 class="label">
<div class="seperator input-element">
<h4 class="title label">
<span class="title">{{ $t('SETTINGS.VOLUME') }}</span>
<span class="volume">{{decimalToPercent(volume)}}%</span>
<span class="volume">{{ toPercent(volume) }}%</span>
</h4>
<div class="input-slider">
<ButtonComponent class="slider-button" :click="changeVolume(volume, -5)" :style="buttonStyle(theme)">-</ButtonComponent>
<ButtonComponent class="slider-button" :click="changeVolume(volume, 5)" :style="buttonStyle(theme)">+</ButtonComponent>
<ButtonComponent class="slider-button" :click="changeVolume(-5, volume)" :style="buttonStyle(theme)">-</ButtonComponent>
<ButtonComponent class="slider-button" :click="changeVolume(5, volume)" :style="buttonStyle(theme)">+</ButtonComponent>
<SliderComponent class="input-slider" min="0" max="1" :value="volume" step="0.001" :onInput="setVolume" :thumbColor="theme.tabs.slider.thumb"></SliderComponent>
</div>
</div>
<div class="seperator">
<h4 class="label">
<div class="seperator input-element">
<h4 class="title label">
<span class="title">{{ $t('SETTINGS.SPEED') }}</span>
<span class="rate">{{decimalToPercent(rate)}}%</span>
<span class="rate">{{ toPercent(rate) }}%</span>
</h4>
<div class="input-slider">
<ButtonComponent class="slider-button" :click="changeRate(rate, -5)" :style="buttonStyle(theme)">-</ButtonComponent>
<ButtonComponent class="slider-button" :click="changeRate(rate, 5)" :style="buttonStyle(theme)">+</ButtonComponent>
<ButtonComponent class="slider-button" :click="changeRate(-5, rate)" :style="buttonStyle(theme)">-</ButtonComponent>
<ButtonComponent class="slider-button" :click="changeRate(5, rate)" :style="buttonStyle(theme)">+</ButtonComponent>
<SliderComponent class="input-slider" min="0.5" max="4" :value="rate" step="0.001" :onInput="setRate" :thumbColor="theme.tabs.slider.thumb"></SliderComponent>
</div>
</div>
Expand All @@ -31,48 +31,28 @@
<script>
import store from 'store'
import { compose, curry } from 'lodash/fp'
import { toPercent, roundUp } from 'utils/math'
import SliderComponent from 'shared/Slider.vue'
import ButtonComponent from 'shared/Button.vue'
// Template Functions
const exportStore = () => {
return `data:text/json;charset=utf-8,${encodeURIComponent(JSON.stringify(store.store.getState()))}`;
}
const decimalToPercent = input => {
input = parseFloat(input) * 100
return Math.round(input)
}
const buttonStyle = (theme) => ({
color: theme.tabs.button.text,
background: theme.tabs.button.background
})
const setVolume = volume => {
store.dispatch(store.actions.setVolume(volume))
}
const setRate = rate => {
store.dispatch(store.actions.setRate(rate))
}
const roundUp = (base, number) => {
number = Math.ceil(number)
// State Changers
const setVolume = compose(store.dispatch.bind(store), store.actions.setVolume)
const changeVolume = (offset, rate) => () => compose(setVolume, roundUp(offset))(rate)
if (number % base === 0) {
return number + base
}
return number + (base - number % base)
}
const changeRate = (rate, offset) => () => {
store.dispatch(store.actions.setRate(roundUp(offset, (rate * 100)) / 100))
}
const changeVolume = (volume, offset) => () => {
store.dispatch(store.actions.setVolume(roundUp(offset, (volume * 100)) / 100))
}
const setRate = compose(store.dispatch.bind(store), store.actions.setRate)
const changeRate = (offset, rate) => () => compose(setRate, roundUp(offset))(rate)
export default {
data() {
Expand All @@ -90,7 +70,7 @@
changeRate,
changeVolume,
buttonStyle,
decimalToPercent
toPercent
},
components: {
SliderComponent,
Expand All @@ -107,7 +87,6 @@
.settings {
width: 100%;
padding: $padding;
.range {
display: flex;
Expand All @@ -117,7 +96,7 @@
}
.footer {
margin-top: $margin;
margin: $margin;
text-align: right;
}
Expand Down
9 changes: 5 additions & 4 deletions src/components/tabs/share/Share.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<template>
<div class="share">
<ShareLinkComponent class="seperator" v-if="reference.origin"></ShareLinkComponent>
<ShareEmbedComponent v-if="reference.config && reference.share"></ShareEmbedComponent>
<ShareEmbedComponent class="seperator" v-if="reference.config && reference.share"></ShareEmbedComponent>
<ShareDownloadComponent v-if="share.download.files.length > 0"></ShareDownloadComponent>
</div>
</template>

<script>
import ShareLinkComponent from './ShareLink.vue'
import ShareEmbedComponent from './ShareEmbed.vue'
import ShareDownloadComponent from './ShareDownload.vue'
export default {
data() {
return {
share: this.$select('share'),
reference: this.$select('reference'),
playtime: this.$select('playtime'),
duration: this.$select('duration'),
theme: this.$select('theme')
}
},
components: {
ShareLinkComponent,
ShareEmbedComponent
ShareEmbedComponent,
ShareDownloadComponent
}
}
</script>
67 changes: 67 additions & 0 deletions src/components/tabs/share/ShareDownload.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<template>
<div class="input-element">
<h4 class="title">{{ $t('SHARE.DOWNLOAD') }}</h4>
<div class="input-row input-group">
<input type="text" class="input-text" disabled :value="activeAudioFile(share.download.files)" />
<a class="button input-button truncate"
:href="activeAudioFile(share.download.files)"
:style="buttonStyle(theme)">
{{ $t('SHARE.ACTIONS.DOWNLOAD') }}
</a>
</div>
<div class="input-row" v-if="share.download.files.length > 1">
<div></div>
<div>
<label class="input-label">{{ $t('SHARE.LABELS.TYPE') }}</label>
<select class="input-select" v-on:change="switchAudioType">
<option v-for="option in share.download.files" v-bind:value="option.file" :selected="activeAudioType(share.download.files) === option.type">
{{ option.type }}
</option>
</select>
</div>
</div>
</div>
</template>

<script>
import { compose, find, get } from 'lodash/fp'
import store from 'store'
import ButtonComponent from 'shared/Button.vue'
import { addQueryParameter } from 'utils/url'
const buttonStyle = (theme) => ({
color: theme.tabs.button.text,
background: theme.tabs.button.background
})
const activeAudioFile = compose(get('file'), find({active: true}))
const activeAudioType = compose(get('type'), find({active: true}))
const switchAudioType = (input) => {
store.dispatch(store.actions.switchDownloadFile(input.target.value))
}
export default {
data() {
return {
share: this.$select('share'),
theme: this.$select('theme')
}
},
methods: {
buttonStyle,
activeAudioFile,
activeAudioType,
switchAudioType
},
components: {
ButtonComponent
}
}
</script>

<style lang="scss">
@import 'inputs';
</style>
20 changes: 5 additions & 15 deletions src/components/tabs/share/ShareEmbed.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="embed">
<div class="embed input-element">
<h4 class="title">{{ $t('SHARE.EMBED') }}</h4>
<div class="input-row input-group">
<input type="text" class="input-text" disabled :value="clipboardContent(reference, share.embed, playtime)" />
Expand All @@ -8,17 +8,17 @@
:data-clipboard-text="clipboardContent(reference, share.embed, playtime)"
v-clipboard
:style="buttonStyle(theme)">
{{ $t('SHARE.COPY') }}
{{ $t('SHARE.ACTIONS.COPY') }}
</ButtonComponent>
</div>
<div class="input-row">
<div class="share-config--time">
<label class="input-label"><input type="checkbox" class="embed--checkbox" :value="share.embed.start" v-on:change="toggleEmbedStart(playtime)"/> {{ $t('SHARE.START') }}</label>
<label class="input-label"><input type="checkbox" class="input-checkbox" :value="share.embed.start" v-on:change="toggleEmbedStart(playtime)"/> {{ $t('SHARE.LABELS.START') }}</label>
<input type="text" class="input-text" :value="secondsToTime(share.embed.starttime)" v-on:input="setStarttime"/>
</div>
<div class="share-config--size">
<label class="input-label">{{ $t('SHARE.SIZE') }}</label>
<select class="share-input" v-model="share.embed.size" v-on:change="setEmbedSize(share.embed.size)">
<label class="input-label">{{ $t('SHARE.LABELS.SIZE') }}</label>
<select class="input-select" v-model="share.embed.size" v-on:change="setEmbedSize(share.embed.size)">
<option v-for="option in share.embed.availableSizes" v-bind:value="option">
{{ option }}
</option>
Expand Down Expand Up @@ -113,17 +113,7 @@
@import 'utils';
@import 'inputs';
$embed-width: 40px;
$embed-height: 35px;
$size-button-width: 80px;
.embed {
padding: $padding;
.share-config--time, .share-config--size {
line-height: 1em;
}
@media screen and (max-width: $width-m) {
.share-config--time, .share-config--size {
.input-label {
Expand Down
45 changes: 22 additions & 23 deletions src/components/tabs/share/ShareLink.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<template>
<div class="link">
<h4 class="title">{{ $t('SHARE.LINK') }}</h4>
<div class="input-row input-group">
<input type="text" class="input-text" disabled :value="clipboardContent(reference, share.link, playtime)" />
<ButtonComponent
class="input-button truncate"
:data-clipboard-text="clipboardContent(reference, share.link, playtime)"
v-clipboard
:style="buttonStyle(theme)">
{{ $t('SHARE.COPY') }}
</ButtonComponent>
</div>
<div class="input-row">
<div>
<label class="input-label"><input type="checkbox" :value="share.link.start" v-on:change="toggleStart(playtime)"/> {{ $t('SHARE.START') }}</label>
<input type="text" class="input-text" :value="secondsToTime(share.link.starttime)" v-on:input="setStarttime"/>
</div>
<div class="input-element">
<h4 class="title">{{ $t('SHARE.LINK') }}</h4>
<div class="input-row input-group">
<input type="text" class="input-text" disabled :value="clipboardContent(reference, share.link, playtime)" />
<ButtonComponent
class="input-button truncate"
:data-clipboard-text="clipboardContent(reference, share.link, playtime)"
v-clipboard
:style="buttonStyle(theme)">
{{ $t('SHARE.ACTIONS.COPY') }}
</ButtonComponent>
</div>
<div class="input-row">
<div>
<label class="input-label"><input type="checkbox" class="input-checkbox" :value="share.link.start" v-on:change="toggleStart(playtime)"/> {{ $t('SHARE.LABELS.START') }}</label>
<input type="text" class="input-text" :value="secondsToTime(share.link.starttime)" v-on:input="setStarttime"/>
</div>
</div>
</div>
</template>

Expand Down Expand Up @@ -68,12 +68,11 @@
export default {
data() {
return {
share: this.$select('share'),
reference: this.$select('reference'),
playtime: this.$select('playtime'),
duration: this.$select('duration'),
theme: this.$select('theme'),
translate: this.$select('l10n')
share: this.$select('share'),
reference: this.$select('reference'),
playtime: this.$select('playtime'),
duration: this.$select('duration'),
theme: this.$select('theme')
}
},
methods: {
Expand Down
13 changes: 10 additions & 3 deletions src/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
"TITLE": "Teilen",
"LINK": "Link",
"EMBED": "Einbetten",
"START": "Start:",
"SIZE": "Größe:",
"COPY": "kopieren"
"DOWNLOAD": "Download",
"LABELS": {
"TYPE": "Type:",
"START": "Start:",
"SIZE": "Größe:"
},
"ACTIONS": {
"COPY": "kopieren",
"DOWNLOAD": "download"
}
},
"SETTINGS": {
"TITLE": "Einstellung",
Expand Down
13 changes: 10 additions & 3 deletions src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
"TITLE": "Share",
"LINK": "Link",
"EMBED": "Embed",
"START": "Start:",
"SIZE": "Size:",
"COPY": "copy"
"DOWNLOAD": "Download",
"LABELS": {
"TYPE": "Type:",
"START": "Start:",
"SIZE": "Size:"
},
"ACTIONS": {
"COPY": "copy",
"DOWNLOAD": "download"
}
},
"SETTINGS": {
"TITLE": "Settings",
Expand Down
Loading

0 comments on commit 69cd82e

Please sign in to comment.