Skip to content

Commit

Permalink
Added preference item to toggle Songkick concert listings.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkReeder committed Feb 13, 2012
1 parent fb61fcf commit dac0abc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
Binary file added PSDs/CWS-440x280.psd
Binary file not shown.
Binary file added chrome_extension/images/CWS-440x280.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 29 additions & 3 deletions chrome_extension/js/turntable.fm.extend.js
Expand Up @@ -19,6 +19,7 @@ TFMEX.prefs = {
"showListenerChanges": false,
"tagsClosed": false,
"enableScrobbling":false,
"enableSongkick":true,
"messageTimeout": 10000
};

Expand Down Expand Up @@ -327,6 +328,17 @@ TFMEX.preferencesView = function(cancelEvent,saveEvent) {
]
]
],["div.clB"],
[
"div.tt-ext-pref-section",
["h3.tt-ext-pref-header","Songkick"],["dl.tt-ext-pref-body",
[
"dt","Show concert listings?"
],
[
"dd",["input#tt-ext-enable-songkick",{type:"checkbox","data-tfmex-pref":"enableSongkick",value:1}]
]
]
],["div.clB"],
[
"div.tt-ext-pref-section",
["div.save-changes.centered-button",{event:{click:saveEvent}}]
Expand Down Expand Up @@ -1649,8 +1661,10 @@ $(document).ready(function() {
if(TFMEX.geo.concertProvider === "ticketfly") {
TFMEX.geo.findTicketflyEvents();
} else {
$('#tfmExtended .event-container').addClass('songkick');
TFMEX.geo.findSongkickArtist();
if (TFMEX.prefs["enableSongkick"]) {
$('#tfmExtended .event-container').addClass('songkick');
TFMEX.geo.findSongkickArtist();
}
}
}
}
Expand Down Expand Up @@ -1976,13 +1990,17 @@ $(document).ready(function() {
if (TFMEX.prefs["enableScrobbling"]) {
$markup.find('#tt-ext-enable-scrobbling').prop("checked",true)
}

if (TFMEX.prefs["enableSongkick"]) {
$markup.find('#tt-ext-enable-songkick').prop("checked",true)
}

TFMEX.showOverlay(markup)
},
savePrefs = function() {
var oldEnableScrobblingValue = TFMEX.prefs["enableScrobbling"]

var prefsToSave = ["showChat","filteredChat","showSong","showVote","showDJChanges","showListenerChanges","tagsClosed"],
var prefsToSave = ["showChat","filteredChat","showSong","showVote","showDJChanges","showListenerChanges","tagsClosed","enableSongkick"],
prefValsToSave = ["chatFilters"];
for (var i in prefsToSave) {
var prefName = prefsToSave[i]
Expand Down Expand Up @@ -2020,6 +2038,14 @@ $(document).ready(function() {
dispatchEventToContentScript('tt-ext-need-lastfm-auth');
})
}

if(!TFMEX.prefs["enableSongkick"]) { $('#tfmExtended .event-container').addClass('hidden'); }
if(!JSON.parse(localStorage.TFMEX).enableSongkick && TFMEX.prefs["enableSongkick"]) {
$('#tfmExtended .event-container').addClass('songkick');
$('#tfmExtended .event-container').removeClass('hidden');
TFMEX.geo.findSongkickArtist();
}

//console.debug("savePrefs: setting enable-scrobbling to:",enableScrobbling)
TFMEX.prefs["enableScrobbling"] = enableScrobbling //gets into local storage

Expand Down
2 changes: 1 addition & 1 deletion chrome_extension/manifest.json
@@ -1,6 +1,6 @@
{
"name": "Turntable.fm Extended",
"version": "0.6.5.3",
"version": "0.6.5.4",
"description": "Adds desktop notifications, suggested tracks, last.fm scrobbling, concert listings and other additional features to turntable.fm",
"icons": { "16":"images/turntable-fm-16.png",
"48":"images/turntable-fm-48.png",
Expand Down

0 comments on commit dac0abc

Please sign in to comment.