Commit 1cc54561 authored by Anton Koch's avatar Anton Koch

Merge branch '376-fixing-cell-features---mosys' into 'release_2_0'

fixed cell features (#376)

See merge request !42
parents 5e5d551f 39425f3d
Pipeline #54429 passed with stage
in 8 minutes and 57 seconds
This diff is collapsed.
<template lang="pug">
div
.q-caption {{ cell.configuration._value.component }}
</template>
<script>
export default {
name: 'CellFeatures',
props: ['cell'],
data () {
return {
itemSpecs: {
'CellTitle': [{
inputType: 'textarea',
type: 'Title',
label: 'Title Cell',
help: '',
error: false,
errorMessage: '',
value: '',
path: 'content'
},
{
inputType: 'url',
type: 'Title',
label: 'Link URL',
help: 'Insert any valid URL',
error: false,
errorMessage: 'Needs to be a valid URL',
value: '',
path: 'link'
}],
'CellText': [{
inputType: 'textarea',
type: 'Text',
label: 'Text Cell',
help: '',
error: false,
errorMessage: '',
value: '',
path: 'content'
}],
'CellMedia': [{
inputType: 'url',
type: 'Media',
label: 'Media Cell',
help: 'Insert a URL to: a video file or a Vimeo / YouTube video page',
error: false,
errorMessage: 'Needs to be a valid URL',
value: '',
path: 'content'
},
{
inputType: 'number',
type: 'Video',
label: 'Start',
help: 'Set start point (seconds)',
error: false,
errorMessage: 'Needs to be a valid number',
value: 0,
path: 'start'
},
{
inputType: 'number',
type: 'Video',
label: 'Duration',
help: 'Set duration (seconds)',
error: false,
errorMessage: 'Needs to be a valid number',
value: 0,
path: 'duration'
}],
'CellImage': [{
inputType: 'url',
type: 'Image',
label: 'Image Cell',
help: 'Insert a URL to an image file',
error: false,
errorMessage: 'Needs to be a valid URL',
value: '',
path: 'content'
},
{
inputType: 'url',
type: 'Image',
label: 'Link URL',
help: 'Insert any valid URL',
error: false,
errorMessage: 'Needs to be a valid URL',
value: '',
path: 'link'
}],
'CellInternalLink': [{
inputType: 'url',
type: 'Internal-Link',
label: 'Link Cell',
help: 'Insert a URL to a page in this system',
error: false,
errorMessage: 'Needs to be a valid URL',
value: '',
path: 'content'
}],
'CellIFrame': [{
inputType: 'url',
type: 'IFrame',
label: 'IFrame Cell',
help: 'Insert some URL',
error: false,
errorMessage: 'Needs to be a valid URL',
value: '',
path: 'content'
}],
'CellAnnotationList': [{
inputType: 'text',
type: 'Annotation-List',
label: 'Annotation List Cell',
help: 'Insert a Video UUID',
error: false,
errorMessage: '',
value: '',
path: 'content'
},
{
inputType: 'number',
type: 'Annotation-List',
label: 'Add annotations',
help: 'Allow user to add more annotations (0 or 1)',
error: false,
errorMessage: '',
value: 0,
path: 'allow_annotations'
},
{
inputType: 'number',
type: 'Annotation-List',
label: 'Start',
help: 'Filter from video start point (seconds)',
error: false,
errorMessage: 'Needs to be a valid number',
value: 0,
path: 'start'
},
{
inputType: 'number',
type: 'Annotation-List',
label: 'Duration',
help: 'Filter duration (seconds)',
error: false,
errorMessage: 'Needs to be a valid number',
value: 0,
path: 'duration'
},
{
inputType: 'text',
type: 'Annotation-List',
label: 'Textfilter',
help: 'Filter annotations by search string',
error: false,
errorMessage: '',
value: undefined,
path: 'textfilter'
},
{
inputType: 'text',
type: 'Annotation-List',
label: 'RegExp',
help: 'Filter annotations by regular expression',
error: false,
errorMessage: '',
value: undefined,
path: 'regexp'
},
{
inputType: 'text',
type: 'Annotation-List',
label: 'Display type',
help: 'Either "scroll-list" or "tabs"',
error: false,
errorMessage: '',
value: undefined,
path: 'displayType'
}]
}
}
},
mounted () {
}
}
</script>
<style scoped lang="stylus">
</style>
......@@ -2,6 +2,7 @@
.cell-info(:class="setClass()")
strong.prefix.text-grey-6.q-py-none.q-mr-sm(v-if="prefix") {{ prefix }}
strong.text-grey-3 {{ shortenType(type) }}
q-icon.q-ml-sm.text-primary(name="link", v-if="highlight")
p.faded
span.q-pr-md(v-if="cell.styleClass") Class: .{{ cell.styleClass }}
// span.q-pr-md(v-if="cell.author") Author: {{ cell.author.name }}
......@@ -13,6 +14,7 @@
props: {
cell: Object,
type: String,
highlight: undefined,
prefix: String
},
methods: {
......
......@@ -118,6 +118,7 @@ export default {
this.$root.$on('video-time-changed', this.onMediaTimeChanged)
this.$root.$on('grid-datetime', this.onGridDateTime)
console.log('CELL', this.cell)
},
computed: {
videoUuid () {
......@@ -229,8 +230,8 @@ export default {
this.map = map
}
const
startMillis = this.video.target.selector._valueMillis + (this.cell.start ? this.cell.start * 1000 : 0),
endMillis = startMillis + (this.cell.duration || this.video.target.selector._valueDuration || 0)
startMillis = this.video.target.selector._valueMillis + (this.cell.source._value.start ? this.cell.source._value.start * 1000 : 0),
endMillis = startMillis + (this.cell.source._value.duration * 1000 || this.video.target.selector._valueDuration || 0)
const annotationsQuery = {
'target.id': this.video.target.id,
'target.type': constants.mapTypes.MAP_TYPE_TIMELINE,
......@@ -242,11 +243,11 @@ export default {
}
// let regCheck
if (this.cell.configuration._value.textfilter) {
annotationsQuery['body.value'] = RegExp(`.*${this.cell.configuration._value.textfilter}.*`, 'ig')
if (this.cell.source._value.textfilter) {
annotationsQuery['body.value'] = RegExp(`.*${this.cell.source._value.textfilter}.*`, 'ig')
}
else if (this.cell.configuration._value.regexp) {
let regexp = this.cell.configuration._value.regexp
else if (this.cell.source._value.regexp) {
let regexp = this.cell.source._value.regexp
if (process.env.IS_VIEWER) {
if (RegExp('^/.+/.*$').test(regexp)) {
const parts = regexp.match(RegExp('^/(.+)/(.*)$'))
......
<template lang="pug">
//image
div(:class="{'display-preview': preview, 'display-full': display}")
template(v-if="display")
conditional-link(v-if="link", :url="link")
conditional-link.fit.text-center(v-if="link", :url="link")
// img(:src="imgSrc", :class="{'link': link}")
img(:src="imgSrc")
img(v-else, :src="imgSrc")
template(v-else)
div.q-pa-sm.cell-background(:style="cellBackgroundStyle")
// cell-info(:cell="cell", type="Image Cell")
.absolute-top-left.q-pa-sm
cell-info(:cell="cell", type="Image Cell")
cell-info(:cell="cell", type="Image Cell", :highlight="link")
</template>
......@@ -60,6 +61,10 @@
</script>
<style scoped lang="stylus">
@import '~variables'
.link
border 1px solid $primary
div
width 100%
......
......@@ -75,7 +75,7 @@
}
}
if (this.display) {
if (!this.cell.configuration.start) this.showPlayer = true
if (!this.cell.source.start) this.showPlayer = true
else {
// FIXME: replace timeout with more efficient solution
const _this = this
......@@ -98,9 +98,9 @@
},
methods: {
onCanPlay () {
if (this.cell && this.cell.configuration._value.start) {
if (this.cell && this.cell.source._value.start) {
if (this.player) {
this.player.currentTime(this.cell.configuration._value.start)
this.player.currentTime(this.cell.source._value.start)
this.showPlayer = true
}
}
......@@ -162,7 +162,7 @@
handlePlayerTimeChange (localTime) {
if (!this.visible) return
if (this.cell) {
const { start, duration } = this.cell.configuration._value
const { start, duration } = this.cell.source._value
if (start && localTime < start) return this.player.currentTime(start)
if (duration && localTime > start + duration) {
this.player.pause()
......
......@@ -2,12 +2,12 @@
// title
div.q-pa-sm(:class="{'display-preview': preview, 'display-full': display}")
template(v-if="display")
h1
h1(style="white-space: pre;")
conditional-link(v-if="link", :url="link") {{titleContent}}
template(v-else) {{titleContent}}
template(v-else)
cell-info(:cell="cell", type="Title Cell")
cell-info(:cell="cell", type="Title Cell", :highlight="link")
</template>
......
......@@ -68,7 +68,7 @@
const typeToIconName = {
'image': 'photo',
'iframe': 'picture in picture',
'internal-link': 'link',
// 'internal-link': 'link',
'video': 'local movies',
'text': 'subject',
'title': 'title'
......@@ -121,6 +121,7 @@
errorMessage: 'Needs to be a valid URL',
value: ''
},
/*
{
inputType: 'url',
type: 'Internal-Link',
......@@ -131,6 +132,7 @@
errorMessage: 'Needs to be a valid URL',
value: ''
},
*/
{
inputType: 'url',
type: 'IFrame',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment