mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	moved event alert to serverside, now node controls the registration alert. added some transition animation to page changes
This commit is contained in:
		| @@ -18,6 +18,8 @@ var ajaxify = {}; | ||||
| 				current_state = url; | ||||
|  | ||||
| 				window.history.pushState({}, url, "/" + url); | ||||
| 				 | ||||
| 				jQuery('#content').fadeOut(100, function() { | ||||
| 					content.innerHTML = templates[tpl_url]; | ||||
| 					exec_body_scripts(content); | ||||
|  | ||||
| @@ -25,6 +27,10 @@ var ajaxify = {}; | ||||
| 					if (callback) { | ||||
| 						callback(); | ||||
| 					} | ||||
| 					 | ||||
| 					jQuery('#content').fadeIn(200); | ||||
| 				}); | ||||
| 				 | ||||
| 			} | ||||
| 			 | ||||
| 			return true; | ||||
| @@ -42,6 +48,7 @@ var ajaxify = {}; | ||||
|  | ||||
| 		if (ajaxify.go(url)) { | ||||
| 			ev.preventDefault(); | ||||
| 			return false; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -13,6 +13,10 @@ var socket, | ||||
| 			socket.on('event:connect', function(data) { | ||||
| 				 | ||||
| 			}); | ||||
|  | ||||
| 			socket.on('event:alert', function(data) { | ||||
| 				app.alert(data); | ||||
| 			}); | ||||
| 		}, | ||||
| 		async: false | ||||
|  | ||||
|   | ||||
| @@ -54,14 +54,7 @@ | ||||
|  | ||||
| 	socket.on('user.create', function(data) { | ||||
| 		//console.log('user create: ' + data.status); | ||||
| 		ajaxify.go('/', function() { | ||||
| 			app.alert({ | ||||
| 				title: 'Thank you for registering', | ||||
| 				message: 'You have successfully registered - welcome to nodebb!', | ||||
| 				type: 'notify', | ||||
| 				timeout: 2000 | ||||
| 			}); | ||||
| 		}); | ||||
| 		ajaxify.go('/'); | ||||
| 		 | ||||
| 	}); | ||||
| 	socket.on('user.exists', function(data) { | ||||
|   | ||||
| @@ -65,6 +65,13 @@ var RDB = require('./redis.js'); | ||||
| 				io.sockets.emit('user.latest', {username: username}); | ||||
|  | ||||
| 				global.socket.emit('user.create', {'status': 1}); | ||||
|  | ||||
| 				global.socket.emit('event:alert', { | ||||
| 					title: 'Thank you for registering', | ||||
| 					message: 'You have successfully registered - welcome to nodebb!', | ||||
| 					type: 'notify', | ||||
| 					timeout: 2000 | ||||
| 				}); | ||||
| 			}); | ||||
| 		}); | ||||
| 	}; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user