little fixes
This commit is contained in:
		
							
								
								
									
										26
									
								
								main.js
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								main.js
									
									
									
									
									
								
							| @ -17,4 +17,28 @@ var sidebar = new Sidebar(create_game_container, setting_container, control_cont | ||||
| window.addEventListener("resize", function() { | ||||
|     var tilesize = getComputedStyle(document.body).getPropertyValue("--tile-size"); | ||||
|     grid.on_screen_orientation_change(tilesize, tilesize); | ||||
| }) | ||||
| }); | ||||
|  | ||||
| window.addEventListener('notificationclick', function(event) { | ||||
|     event.waitUntil(async function() { | ||||
|         const allClients = await clients.matchAll({ | ||||
|             includeUncontrolled: true | ||||
|         }); | ||||
|  | ||||
|         var instance = None; | ||||
|  | ||||
|  | ||||
|         // Let's see if we already have a window open: | ||||
|         for (const client of allClients) { | ||||
|             client.focus(); | ||||
|             instance = client; | ||||
|             break; | ||||
|         } | ||||
|  | ||||
|         // If we didn't find an existing window, | ||||
|         // open a new one: | ||||
|         if (!instance) { | ||||
|             instance = await clients.openWindow(rel_home); | ||||
|         } | ||||
|     }()); | ||||
| }); | ||||
|  | ||||
| @ -1,2 +1,4 @@ | ||||
| var home = "https://the-cake-is-a-lie.net/website/ultimate_tictactoe/"; | ||||
| var rel_home = "/website/ultimate_tictactoe"; | ||||
| var server_url = "the-cake-is-a-lie.net"; | ||||
| var server_port = "5555"; | ||||
		Reference in New Issue
	
	Block a user