Arrow keys do are not handled by onkeypress on all browsers. Wonderful. Use onkeydown instead.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3170 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
		| @@ -60,6 +60,7 @@ function Response(request, client) { | ||||
| 	var kStatusText = { | ||||
| 		200: 'OK', | ||||
| 		303: 'See other', | ||||
| 		403: 'Forbidden', | ||||
| 		404: 'File not found', | ||||
| 		500: 'Internal server error', | ||||
| 	}; | ||||
| @@ -143,8 +144,15 @@ function handleRequest(request, response) { | ||||
|  | ||||
| 	if (handler) { | ||||
| 		try { | ||||
| 			handler.invoke(request, response); | ||||
| 			var promise = handler.invoke(request, response); | ||||
| 			if (promise) { | ||||
| 				promise.catch(function(error) { | ||||
| 					print(error); | ||||
| 					response.reportError(error); | ||||
| 				}); | ||||
| 			} | ||||
| 		} catch (error) { | ||||
| 			print(error); | ||||
| 			response.reportError(error); | ||||
| 		} | ||||
| 	} else { | ||||
|   | ||||
| @@ -243,6 +243,24 @@ function handler(request, response, packageOwner, packageName, uri) { | ||||
| 						process.terminal.print(error); | ||||
| 					}); | ||||
| 				} | ||||
| 			} else if (uri === "/post") { | ||||
| 				if (isNewSession) { | ||||
| 					response.writeHead(403, {"Content-Type": "text/plain; charset=utf-8"}); | ||||
| 					print("post too soon"); | ||||
| 					response.end("Too soon."); | ||||
| 				} else { | ||||
| 					var payload = JSON.parse(request.body); | ||||
| 					return invoke(process.eventHandlers['onPost'], [payload]).then(function() { | ||||
| 						response.writeHead(200, { | ||||
| 							"Content-Type": "text/plain; charset=utf-8", | ||||
| 							"Content-Length": "0", | ||||
| 							"Cache-Control": "no-cache, no-store, must-revalidate", | ||||
| 							"Pragma": "no-cache", | ||||
| 							"Expires": "0", | ||||
| 						}); | ||||
| 						response.end(""); | ||||
| 					}); | ||||
| 				} | ||||
| 			} else if (uri === "/receive") { | ||||
| 				if (isNewSession) { | ||||
| 					var data = JSON.stringify({ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user