Added button for generating channelname in frontpage

This commit is contained in:
Kasper Rynning-Tønnesen
2018-02-21 10:30:10 +01:00
parent 5011a3cf10
commit c7e43762b4
6 changed files with 46 additions and 0 deletions

View File

@@ -466,6 +466,15 @@ li.disabled span {
/*transition: 1s;*/
}
.generate-channel-name {
margin-left: -24px;
padding-right: 5px;
height: 46px;
display: flex;
justify-content: center;
align-items: center;
}
#frontpage_player{
position: fixed;
bottom: 10px;

View File

@@ -303,6 +303,7 @@ var Frontpage = {
$("#main-container").css("background-color", "#2d2d2d");
if(!Helper.mobilecheck()) {
$("#frontpage-viewer-counter").tooltip("remove");
$(".generate-channel-name").tooltip("remove");
$("#offline-mode").tooltip("remove");
}
currently_showing_channels = 1;
@@ -437,6 +438,11 @@ var Frontpage = {
position: "bottom",
tooltip: "Total Viewers"
});
$(".generate-channel-name").tooltip({
delay: 5,
position: "bottom",
tooltip: "Generate name"
});
}
Frontpage.get_frontpage_lists();

View File

@@ -1139,6 +1139,18 @@ $(document).on("click", "#player_bottom_overlay", function(e){
Frontpage.to_channel(chan.toLowerCase(), false);
});
$(document).on("click", ".generate-channel-name", function(e) {
e.preventDefault();
$.ajax({
type: "GET",
url: "/api/generate_name",
success: function(response) {
$(".room_namer").val("");
$(".room-namer").val(response);
}
})
});
$(document).keydown(function(event) {
if(window.location.pathname != "/"){
if(event.keyCode == 91 || event.keyCode == 17){

View File

@@ -17,6 +17,9 @@
spellcheck="false"
maxlength="18"
/>
<a href="#" class="generate-channel-name white-text">
<i class="material-icons">autorenew</i>
</a>
<label for="autocomplete-input" class="noselect label-for-mobile-frontpage">Find or create radio channel</label>
<button class="listen-button btn waves-effect waves-light white-text col s2">Listen</button>
</div>