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
+const URL_SIGNUP = 'http://www.last.fm/join/';
0
if (typeof Lastfm == 'undefined') {
0
@@ -47,6 +48,8 @@ Lastfm.onLoad = function() {
0
this._loginError = document.getElementById('lastfmLoginError');
0
this._loginButton = document.getElementById('lastfmLoginButton');
0
+ this._signup = document.getElementById('lastfmSignup');
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
+ // wire up the signup link
0
+ this._signup.addEventListener('click',
0
+ function(event) { Lastfm.loadURI(URL_SIGNUP, event); }, false);
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
this._realname.addEventListener('click',
0
- function(event) { Lastfm.onProfileClick(event); }, false);
0
+ function(event) { Lastfm.loadURI(Lastfm._service.profileurl, event); },
0
this._tracks.addEventListener('click',
0
- function(event) { Lastfm.onChartsClick(event); }, false);
0
+ Lastfm.loadURI('http://www.last.fm/user/' +
0
+ Lastfm._service.username + '/charts/', event);
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
-// 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
// charts click handler
0
Lastfm.onChartsClick = function(event) {
0
http://www.last.fm/user/ianloictest/charts/
Comments
No one has commented yet.