From 92566ba17f5e921d5bff1f3fb4e4b0d92ca4fd39 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 17 Mar 2021 11:54:58 +0100 Subject: audio select --- frontend/app/views/page/components/tile.form.js | 85 +++++++++++++++---------- 1 file changed, 53 insertions(+), 32 deletions(-) (limited to 'frontend/app/views/page/components/tile.form.js') diff --git a/frontend/app/views/page/components/tile.form.js b/frontend/app/views/page/components/tile.form.js index 3e31758..da72e27 100644 --- a/frontend/app/views/page/components/tile.form.js +++ b/frontend/app/views/page/components/tile.form.js @@ -10,6 +10,7 @@ import { TextInput, NumberInput, ColorInput, Slider, Select, LabelDescription, TextArea, Checkbox, SubmitButton, Loader } from 'app/common' +import { AudioSelect } from 'app/views/audio/components/audio.select' import { preloadImage, preloadVideo } from 'app/utils' import * as tileActions from '../../tile/tile.actions' @@ -169,6 +170,19 @@ class TileForm extends Component { pageList: [], } + constructor(props){ + super(props) + this.handleChange = this.handleChange.bind(this) + this.handleSelect = this.handleSelect.bind(this) + this.handleSettingsChange = this.handleSettingsChange.bind(this) + this.handleSettingsSelect = this.handleSettingsSelect.bind(this) + this.handleAlignment = this.handleAlignment.bind(this) + this.handleImageChange = this.handleImageChange.bind(this) + this.handleVideoChange = this.handleVideoChange.bind(this) + this.handleSubmit = this.handleSubmit.bind(this) + this.handleDelete = this.handleDelete.bind(this) + } + componentDidMount() { const { graph, page, isNew, initialData, sortOrder } = this.props const title = isNew ? 'new tile' : 'editing tile' @@ -184,7 +198,6 @@ class TileForm extends Component { ...PAGE_LIST_TOP_OPTIONS, ...linkPages.map(page => ({ name: page.id, label: page.path })) ] - this.setState({ pageList }) if (isNew) { const newTile = newImage({ id: "new", @@ -384,21 +397,21 @@ class TileForm extends Component { return (

{title}

-
+
@@ -417,18 +430,19 @@ class TileForm extends Component { : ""} {this.renderHyperlinkForm()} + {this.renderAudioForm()} {this.renderMiscForm()}
{!isNew && }
@@ -473,7 +487,7 @@ class TileForm extends Component { required data={temporaryTile.settings} error={errorFields.has('url')} - onChange={this.handleImageChange.bind(this)} + onChange={this.handleImageChange} autoComplete="off" />
@@ -482,7 +496,7 @@ class TileForm extends Component { label="Tiled" name="is_tiled" checked={temporaryTile.settings.is_tiled} - onChange={this.handleSettingsSelect.bind(this)} + onChange={this.handleSettingsSelect} autoComplete="off" /> {temporaryTile.settings.is_tiled && @@ -491,7 +505,7 @@ class TileForm extends Component { selected={temporaryTile.settings.tile_style || 'tile'} options={IMAGE_TILE_STYLES} title='' - onChange={this.handleSettingsSelect.bind(this)} + onChange={this.handleSettingsSelect} /> } @@ -514,7 +528,7 @@ class TileForm extends Component { required data={temporaryTile.settings} error={errorFields.has('url')} - onChange={this.handleVideoChange.bind(this)} + onChange={this.handleVideoChange} autoComplete="off" /> @@ -524,13 +538,13 @@ class TileForm extends Component { selected={temporaryTile.settings.video_style || 'none'} options={VIDEO_STYLES} title='' - onChange={this.handleSettingsSelect.bind(this)} + onChange={this.handleSettingsSelect} /> @@ -539,14 +553,14 @@ class TileForm extends Component { label="Muted" name="muted" checked={temporaryTile.settings.muted} - onChange={this.handleSettingsSelect.bind(this)} + onChange={this.handleSettingsSelect} autoComplete="off" /> @@ -565,7 +579,7 @@ class TileForm extends Component { required data={temporaryTile.settings} error={errorFields.has('content')} - onChange={this.handleSettingsChange.bind(this)} + onChange={this.handleSettingsChange} autoComplete="off" />
@@ -575,7 +589,7 @@ class TileForm extends Component { selected={temporaryTile.settings.font_family || 'sans-serif'} options={TEXT_FONT_FAMILIES} title='' - onChange={this.handleSettingsSelect.bind(this)} + onChange={this.handleSettingsSelect} />
@@ -729,7 +743,7 @@ class TileForm extends Component { placeholder='http://' name="external_link_url" data={temporaryTile.settings} - onChange={this.handleSettingsChange.bind(this)} + onChange={this.handleSettingsChange} autoComplete="off" /> } @@ -738,6 +752,13 @@ class TileForm extends Component { ) } + renderAudioForm() { + return ( +
+
+ ) + } + renderMiscForm() { const { temporaryTile } = this.props return ( @@ -746,7 +767,7 @@ class TileForm extends Component { title='Opacity' name='opacity' value={temporaryTile.settings.opacity} - onChange={this.handleSettingsSelect.bind(this)} + onChange={this.handleSettingsSelect} min={0.0} max={1.0} step={0.01} @@ -755,7 +776,7 @@ class TileForm extends Component { title='Scale' name='scale' value={temporaryTile.settings.scale} - onChange={this.handleSettingsSelect.bind(this)} + onChange={this.handleSettingsSelect} min={0.01} max={10.0} step={0.01} @@ -764,7 +785,7 @@ class TileForm extends Component { title='Rotation' name='rotation' value={temporaryTile.settings.rotation} - onChange={this.handleSettingsSelect.bind(this)} + onChange={this.handleSettingsSelect} min={-180.0} max={180.0} step={1} -- cgit v1.2.3-70-g09d2