public
Description: A Last.fm scrobbling addon for Songbird
Homepage: http://getsongbird.com/
Clone URL: git://github.com/ianloic/songbird-lastfm.git
fix the signup link
ianloic (author)
Wed Jul 02 14:41:27 -0700 2008
commit  1697cc24141a54a5f82d89f53d69e5aa2a348b21
tree    137456afa8e0e02ed2ca6c3d2c225e2541045397
parent  e88dc2fc1a39949023849014b7ffffcd68478cb4
...
4
5
6
 
7
8
9
...
47
48
49
 
 
50
51
52
...
109
110
111
 
 
 
 
112
113
114
 
 
115
116
 
 
117
118
 
 
 
 
119
120
121
...
173
174
175
176
177
178
 
 
 
179
180
 
181
182
183
...
4
5
6
7
8
9
10
...
48
49
50
51
52
53
54
55
...
112
113
114
115
116
117
118
119
120
 
121
122
123
 
124
125
126
 
127
128
129
130
131
132
133
...
185
186
187
 
 
 
188
189
190
191
192
193
194
195
196
0
@@ -4,6 +4,7 @@ const ICON_DISABLED = 'chrome://lastfm/skin/disabled.png';
0
 const ICON_LOGGED_IN = 'chrome://lastfm/skin/as.png';
0
 const ICON_ERROR = 'chrome://lastfm/skin/error.png';
0
 
0
+const URL_SIGNUP = 'http://www.last.fm/join/';
0
 
0
 // Make a namespace.
0
 if (typeof Lastfm == 'undefined') {
0
@@ -47,6 +48,8 @@ Lastfm.onLoad = function() {
0
   this._loginError = document.getElementById('lastfmLoginError');
0
   // login button
0
   this._loginButton = document.getElementById('lastfmLoginButton');
0
+ // signup link
0
+ this._signup = document.getElementById('lastfmSignup');
0
 
0
   // the logging-in page of the deck
0
   this._loggingIn = document.getElementById('lastfmLoggingIn');
0
@@ -109,13 +112,22 @@ Lastfm.onLoad = function() {
0
   this._logoutButton.addEventListener('command',
0
       function(event) { Lastfm.onLogoutClick(event); }, false);
0
 
0
+ // wire up the signup link
0
+ this._signup.addEventListener('click',
0
+ function(event) { Lastfm.loadURI(URL_SIGNUP, event); }, false);
0
+
0
   // wire up UI events for the profile links
0
   this._image.addEventListener('click',
0
- function(event) { Lastfm.onProfileClick(event); }, false);
0
+ function(event) { Lastfm.loadURI(Lastfm._service.profileurl, event); },
0
+ false);
0
   this._realname.addEventListener('click',
0
- function(event) { Lastfm.onProfileClick(event); }, false);
0
+ function(event) { Lastfm.loadURI(Lastfm._service.profileurl, event); },
0
+ false);
0
   this._tracks.addEventListener('click',
0
- function(event) { Lastfm.onChartsClick(event); }, false);
0
+ function(event) {
0
+ Lastfm.loadURI('http://www.last.fm/user/' +
0
+ Lastfm._service.username + '/charts/', event);
0
+ }, false);
0
 
0
   // ui event for the should-scrobble checkbox
0
   this._scrobble.addEventListener('command',
0
@@ -173,11 +185,12 @@ Lastfm.onLogoutClick = function(event) {
0
   this._service.logout();
0
 }
0
 
0
-// profile click event handler
0
-Lastfm.onProfileClick = function(event) {
0
- gBrowser.loadURI(this._service.profileurl, null, null, event, '_blank');
0
+// load an URL from an event in the panel
0
+Lastfm.loadURI= function(uri, event) {
0
+ gBrowser.loadURI(uri, null, null, event, '_blank');
0
   this._panel.hidePopup();
0
 }
0
+
0
 // charts click handler
0
 Lastfm.onChartsClick = function(event) {
0
   http://www.last.fm/user/ianloictest/charts/

Comments

    No one has commented yet.