js/script.js
/**
 * #6 #Switcher function for the #channels name in the right app bar
 * @param channelName Text which is set
 */
#6 #Switcher function for the #channels name in the right app bar
@param channelName Text which is set
#6 #Switcher function for the #channels name in the right app bar @param channelName Text which is set
function switchChannel(channelName) {
    console.log("Tuning in to channel", channelName.name);
    currentChannel = channelName;
    document.getElementById('channel-name').innerHTML = channelName.name;
    document.getElementById('channel-location').innerHTML = 'by <a href="http://w3w.co/' + channelName.createdBy +'" target="_blank"><strong>' + channelName.createdBy + '</strong></a>';
    $('#channel-star').removeClass('fas far');
    let starType = channelName.starred ? 'fas' : 'far';
    $('#channel-star').addClass(starType);
    $('#channels li').removeClass('selected');
    $('#channels li:contains(' + channelName.name + ')').addClass('selected');
}
function switchChannel ( channelName ) { console . log ( "Tuning in to channel" , channelName . name ) ; currentChannel = channelName ; document . getElementById ( 'channel-name' ) . innerHTML = channelName . name ; document . getElementById ( 'channel-location' ) . innerHTML = 'by <a href="http://w3w.co/' + channelName . createdBy + '" target="_blank"><strong>' + channelName . createdBy + '</strong></a>' ; $ ( '#channel-star' ) . removeClass ( 'fas far' ) ; let starType = channelName . starred ? 'fas' : 'far' ; $ ( '#channel-star' ) . addClass ( starType ) ; $ ( '#channels li' ) . removeClass ( 'selected' ) ; $ ( '#channels li:contains(' + channelName . name + ')' ) . addClass ( 'selected' ) ; }
#6 #Switcher function for the #channels name in the right app bar
 @param channelName Text which is set
#6 #Switcher function for the #channels name in the right app bar @param channelName Text which is set
//Log the channel switch
 //console.log(currentChannel);
 //Write the new channel to the right app bar
 //#6 change the #channel #location
 /* #6 #liking channels on #click */ //Matches app bar star to channel star
 /* #6 #highlight the selected #channel.
       This is inefficient (jQuery has to search all channel list items), but we'll change it later on */