Skip to content

Commit

Permalink
Adding a bit of character
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrove committed Apr 12, 2012
1 parent 5f92e0b commit 5bc4e02
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion app/assets/javascripts/backbone/views/channel_tabs.js.coffee
Expand Up @@ -7,7 +7,7 @@ class Kandan.Views.ChannelTabs extends Backbone.View
@

createChannel: (event)->
channelName = prompt("What's the channel name?", "New channel")
channelName = prompt("What's the channel name?", @randomChannelName())
channelName = channelName.replace(/^\s+|\s+$/g, '')
if channelName
channel = new Kandan.Models.Channel({name: channelName})
Expand All @@ -22,3 +22,18 @@ class Kandan.Views.ChannelTabs extends Backbone.View
channelIndex = $(event.target).parents('li').prevAll().length
Kandan.Helpers.Channels.deleteChannelByTabIndex(channelIndex) if channelIndex != 0
return false

randomChannelName: () ->
names = [
"A Dark Place",
"Discotheque",
"Dungeon",
"Garden",
"Lobby",
"Office",
"Palace",
"Park",
"Studio",
"Temple",
"War Room",
"Zork"]

0 comments on commit 5bc4e02

Please sign in to comment.