| 
									
										
										
										
											2022-08-04 11:00:21 +03:00
										 |  |  | <!DOCTYPE html> | 
					
						
							|  |  |  | <html> | 
					
						
							|  |  |  | <!--html manifest="pwiki.appcache"--> | 
					
						
							|  |  |  | <head> | 
					
						
							|  |  |  | <title>pWiki</title> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <meta charset="utf-8"> | 
					
						
							|  |  |  | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <link rel="manifest" href="manifest.json"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Bold.ttf"> | 
					
						
							|  |  |  | <link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-BoldItalic.ttf"> | 
					
						
							|  |  |  | <link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-ExtraBold.ttf"> | 
					
						
							|  |  |  | <link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-ExtraBoldItalic.ttf"> | 
					
						
							|  |  |  | <link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Italic.ttf"> | 
					
						
							|  |  |  | <link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Light.ttf"> | 
					
						
							|  |  |  | <link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-LightItalic.ttf"> | 
					
						
							|  |  |  | <link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Regular.ttf"> | 
					
						
							|  |  |  | <link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Semibold.ttf"> | 
					
						
							|  |  |  | <link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-SemiboldItalic.ttf"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <link rel="stylesheet" href="css/fonts.css"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </head> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <style> | 
					
						
							|  |  |  | </style> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-04 19:47:08 +03:00
										 |  |  | <!-- XXX do we need this??? --> | 
					
						
							|  |  |  | <script src="bootstrap.js"></script> | 
					
						
							| 
									
										
										
										
											2022-08-04 14:29:25 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-04 11:00:21 +03:00
										 |  |  | <!--script data-main="pwiki2" src="ext-lib/require.js"></script--> | 
					
						
							|  |  |  | <script src="ext-lib/require.js"></script> | 
					
						
							|  |  |  | <script> | 
					
						
							| 
									
										
										
										
											2022-08-04 19:47:08 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var makeFallbacks =  | 
					
						
							|  |  |  | function(paths, search=['lib']){ | 
					
						
							|  |  |  | 	return Object.entries(paths) | 
					
						
							|  |  |  | 		.map(function([key, path]){ | 
					
						
							|  |  |  | 			// package... | 
					
						
							|  |  |  | 			if(path.endsWith('/')){ | 
					
						
							|  |  |  | 				return [key, path] } | 
					
						
							|  |  |  | 			return [ | 
					
						
							|  |  |  | 				key, | 
					
						
							|  |  |  | 				[ | 
					
						
							|  |  |  | 					path, | 
					
						
							|  |  |  | 					...search | 
					
						
							|  |  |  | 						.map(function(base){ | 
					
						
							|  |  |  | 							return base +'/'+ path.split(/[\\\/]+/g).pop() }), | 
					
						
							|  |  |  | 				] | 
					
						
							|  |  |  | 			] }) | 
					
						
							|  |  |  | 		.reduce(function(res, [key, value]){ | 
					
						
							|  |  |  | 			res[key] = value | 
					
						
							|  |  |  | 			return res }, {}) } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-04 11:00:21 +03:00
										 |  |  | require.config({ | 
					
						
							|  |  |  | 	paths: { | 
					
						
							| 
									
										
										
										
											2022-08-04 19:47:08 +03:00
										 |  |  | 		...makeFallbacks({ | 
					
						
							|  |  |  | 			'ig-doc': 'node_modules/ig-doc/doc', | 
					
						
							|  |  |  | 			'ig-stoppable': 'node_modules/ig-stoppable/stoppable', | 
					
						
							|  |  |  | 			'object-run': 'node_modules/object-run/run', | 
					
						
							|  |  |  | 			'ig-object': 'node_modules/ig-object/object', | 
					
						
							|  |  |  | 		}), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		// packages... | 
					
						
							|  |  |  | 		'ig-types': [ | 
					
						
							|  |  |  | 			'node_modules/ig-types', | 
					
						
							|  |  |  | 			'lib/types', | 
					
						
							|  |  |  | 		], | 
					
						
							| 
									
										
										
										
											2022-08-04 11:00:21 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-04 19:47:08 +03:00
										 |  |  | 		// external stuff... | 
					
						
							|  |  |  | 		...makeFallbacks({ | 
					
						
							|  |  |  | 			'jszip': 'node_modules/jszip/dist/jszip', | 
					
						
							|  |  |  | 			'pouchdb': 'node_modules/pouchdb/dist/pouchdb', | 
					
						
							|  |  |  | 			'showdown': 'node_modules/showdown/dist/showdown', | 
					
						
							|  |  |  | 		}, ['ext-lib']), | 
					
						
							| 
									
										
										
										
											2022-08-04 11:00:21 +03:00
										 |  |  | 	}, | 
					
						
							|  |  |  | 	packages: [ | 
					
						
							|  |  |  | 		'ig-types', | 
					
						
							|  |  |  | 	] | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-06 11:09:25 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | document.pwikiloaded = new Event('pwikiloaded') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-04 19:47:08 +03:00
										 |  |  | // start loading pWiki... | 
					
						
							| 
									
										
										
										
											2022-08-10 11:42:31 +03:00
										 |  |  | require(['./browser'], function(pwiki){  | 
					
						
							| 
									
										
										
										
											2022-08-08 23:04:42 +03:00
										 |  |  | 	pwiki = window.pwiki = pwiki.pwiki  | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-06 11:09:25 +03:00
										 |  |  | 	pwiki.dom = document.querySelector('#pWiki') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-10 11:42:31 +03:00
										 |  |  | 	// handle location.hash/history (both directions) | 
					
						
							| 
									
										
										
										
											2022-08-04 19:47:08 +03:00
										 |  |  | 	window.addEventListener('hashchange', function(evt){ | 
					
						
							|  |  |  | 		evt.preventDefault() | 
					
						
							|  |  |  | 		var [path, hash] = location.hash.slice(1).split('#') | 
					
						
							|  |  |  | 		path = path.trim() == '' ?  | 
					
						
							|  |  |  | 			'/'  | 
					
						
							|  |  |  | 			: path | 
					
						
							| 
									
										
										
										
											2022-08-10 11:42:31 +03:00
										 |  |  | 		pwiki.path = path }) | 
					
						
							|  |  |  | 	pwiki | 
					
						
							|  |  |  | 		.onNavigate(function(){ | 
					
						
							|  |  |  | 			// NOTE: we do not need to directly update location.hash here as | 
					
						
							|  |  |  | 			//		that will push an extra history item... | 
					
						
							|  |  |  | 			history.replaceState({path: pwiki.path}, pwiki.title, '#'+pwiki.path) | 
					
						
							|  |  |  | 			// NOTE: we are intentionally not awaiting for this -- this  | 
					
						
							|  |  |  | 			//		separates the navigate and load events... | 
					
						
							|  |  |  | 			pwiki.refresh() }) | 
					
						
							|  |  |  | 		.onLoad(function(evt){ | 
					
						
							|  |  |  | 			// handle title... | 
					
						
							|  |  |  | 			document.querySelector('title').innerHTML = this.title | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			// XXX when loaded us <elem>.scrollIntoView() to get to hash... | 
					
						
							|  |  |  | 			//		...would also be nice to keep hash within location.hash... | 
					
						
							|  |  |  | 		}) | 
					
						
							| 
									
										
										
										
											2022-08-04 11:00:21 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-04 19:47:08 +03:00
										 |  |  | 	// show current page... | 
					
						
							|  |  |  | 	pwiki.path = location.hash.slice(1) | 
					
						
							|  |  |  | })  | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </script> | 
					
						
							| 
									
										
										
										
											2022-08-04 11:00:21 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-04 19:47:08 +03:00
										 |  |  | <body> | 
					
						
							| 
									
										
										
										
											2022-08-04 11:00:21 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-04 19:47:08 +03:00
										 |  |  | <div id="pWiki" /> | 
					
						
							| 
									
										
										
										
											2022-08-04 11:00:21 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | </body> | 
					
						
							|  |  |  | </html> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <!-- vim:set sw=4 ts=4 : --> |