spee.ch/views/partials/publishChannel.handlebars

46 lines
1.8 KiB
Handlebars
Raw Normal View History

2017-09-19 17:47:24 +02:00
<div id="claim-channel-input-area">
2017-09-20 00:39:54 +02:00
<span id="input-error-channel-select" class="info-message info-message--failure"></span>
2017-09-19 21:54:23 +02:00
<p>
2017-09-20 00:39:54 +02:00
<label for="channel-name-select">Channel:</label>
<select type="text" id="channel-name-select" name="channel" value="channel" onclick="check(event)">
2017-09-19 21:54:23 +02:00
{{#if user}}
<option value="@{{user.channelName}}" >@{{user.channelName}}</option>
{{/if}}
<option value="@speech" >Anonymous</option>
<option value="new" >New</option>
</select>
</p>
<div id="channel-create-details" hidden="true">
2017-09-20 00:39:54 +02:00
<span id="input-error-channel-name" class="info-message info-message--failure"></span>
2017-09-19 21:54:23 +02:00
<p>
<label for="channelName">Channel Name: </label>
2017-09-20 00:39:54 +02:00
@<input type="text" id="channel-name-input" class="input-text input-text--primary" placeholder="exampleChannel" value=""; oninput="checkChannelName(event.target.value)">
<span id="input-success-channel-name" class="info-message info-message--success"></span>
2017-09-19 21:54:23 +02:00
<br/>
<label for="password" >Password: </label>
2017-09-20 00:39:54 +02:00
<input type="password" id="password" placeholder="" value="" class="input-text input-text--primary">
2017-09-19 21:54:23 +02:00
<br/>
</p>
<button >create</button>
2017-09-19 17:47:24 +02:00
</div>
</div>
<script type="text/javascript">
// toggle channel creation tool
const createChannelTool = document.getElementById('channel-create-details');
function check(event) {
const selectedOption = event.target.selectedOptions[0].value;
2017-09-20 00:39:54 +02:00
if (selectedOption != 'new') {
2017-09-19 17:47:24 +02:00
createChannelTool.hidden = true;
2017-09-20 00:39:54 +02:00
hideError(document.getElementById('input-error-channel-select'));
} else {
createChannelTool.hidden = false;
2017-09-19 17:47:24 +02:00
}
}
function createChannel() {
}
</script>