Skip to content

Commit

Permalink
Merge pull request #102 from EragonJ/bug/97
Browse files Browse the repository at this point in the history
fix #97, we would filter out weird symbols in playlist
  • Loading branch information
avihaymenahem committed Aug 25, 2014
2 parents 5432e96 + 47800ef commit 11ea50b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions coffee/_sidebar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Sidebar
if !e or !str
return
else
str = Utils.filterSymbols(str)
Playlists.create(str)
Playlists.getAll((playlists) ->
self.populatePlaylists(playlists)
Expand Down Expand Up @@ -169,13 +170,14 @@ class Sidebar
return new gui.MenuItem(
label: 'Rename ' + $(@).text(),
click: ->
alertify.prompt l10n.get('rename_playlist_popup'), (e, str) ->
if e && str
Playlists.rename(oldPlaylistName, str)
alertify.prompt l10n.get('rename_playlist_popup'), (e, newName) ->
if e && newName
newName = Utils.filterSymbols(newName)
Playlists.rename(oldPlaylistName, newName)
Playlists.getAll((playlists) ->
self.populatePlaylists(playlists)
)
userTracking.event("Playlist", "Rename", str).send()
userTracking.event("Playlist", "Rename", newName).send()
else
return
, oldPlaylistName
Expand Down
3 changes: 3 additions & 0 deletions coffee/_utils.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Utils
@filterSymbols: (name) ->
return name.replace(/[^\w]/gi, '')

0 comments on commit 11ea50b

Please sign in to comment.