Philip Pryce avatar Philip Pryce committed c7a1b84

Fixing signout bug, removing useless code

Comments (0)

Files changed (2)

javascript/jolt.js

 		}
 	});
 	
+	// Server packet
+	Jolt.packet.register('server', function ()
+	{
+		var event = this.parameters.e;
+	});
+	
 	// Property packet processing
 	Jolt.packet.register('property', function ()
 	{
 		});
 	});
 	
-	// block packet
-	Jolt.packet.register('block', function ()
-	{
-		if (this.parameters.e == 'ok')
-		{
-			var user = this.parameters.u;
-			UI.notifications.show({
-				title: "Block",
-				content: user + " was successfully blocked from the server.",
-				buttons: UI.notifications.DISMISS
-			});
-		}
-	});
-	
 	// ban packet
 	Jolt.packet.register('ban', function ()
 	{
 	// Disconnect from the chat server
 	Jolt.command.register('signout', function ()
 	{
+		UI.storage.clear('authtoken');
+		UI.storage.clear('username');
+		
 		Packet("disconnect");
 	}).add_help('Signs you out from the chat server.').add_usage('/signout');
 	
 			});
 			$('button[name="channellist-signout"]').unbind('click').bind('click', function ()
 			{
+				UI.storage.clear('authtoken');
+				UI.storage.clear('username');
 				Packet("disconnect");
 			});
-			$('button[name="channellist-account"]').unbind('click').bind('click', function (event)
-			{
-				var offset = $(event.target).offset();
-				
-				var options = {
-					titles: ['Your Account', 'Server'],
-					items: {
-						"Your Account": [
-							{ label: "Change Password", fn: function () { alert("todo"); } }
-						],
-						"Server": [
-							{ label: "Disconnect", fn: function () { Packet("disconnect"); } }
-						]
-					},
-					has_pointer: false,
-					top: offset.top + 18,
-					left: offset.left - 2
-				};
-				
-				UI.dropdown.create(options);
-			})
 			if (UI.channellist.interval) { clearInterval(UI.channellist.interval); }
 			UI.channellist.interval = setInterval(UI.channellist.load, 60000);
 		},
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.