forked from MapComplete/MapComplete
		
	Add tests in iframe, fix loading in iframes
This commit is contained in:
		
							parent
							
								
									8bb9f0768c
								
							
						
					
					
						commit
						2572e99b95
					
				
					 3 changed files with 4 additions and 17 deletions
				
			
		| 
						 | 
					@ -123,9 +123,8 @@ export class InitUiElements {
 | 
				
			||||||
        if ((window != window.top && !State.state.featureSwitchWelcomeMessage.data) || State.state.featureSwitchIframe.data) {
 | 
					        if ((window != window.top && !State.state.featureSwitchWelcomeMessage.data) || State.state.featureSwitchIframe.data) {
 | 
				
			||||||
            const currentLocation = State.state.locationControl;
 | 
					            const currentLocation = State.state.locationControl;
 | 
				
			||||||
            const url = `${window.location.origin}${window.location.pathname}?z=${currentLocation.data.zoom}&lat=${currentLocation.data.lat}&lon=${currentLocation.data.lon}`;
 | 
					            const url = `${window.location.origin}${window.location.pathname}?z=${currentLocation.data.zoom}&lat=${currentLocation.data.lat}&lon=${currentLocation.data.lon}`;
 | 
				
			||||||
            const content = new Link(Svg.pop_out_ui().SetClass("iframe-escape"), url, true);
 | 
					            new Link(Svg.pop_out_ui().SetClass("iframe-escape"), url, true)
 | 
				
			||||||
            new FixedUiElement(content.Render()).AttachTo("help-button-mobile")
 | 
					                .AttachTo("messagesbox");
 | 
				
			||||||
            content.AttachTo("messagesbox");
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        State.state.osmConnection.userDetails.map((userDetails: UserDetails) => userDetails?.home)
 | 
					        State.state.osmConnection.userDetails.map((userDetails: UserDetails) => userDetails?.home)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,5 +18,7 @@
 | 
				
			||||||
    <div id="maindiv">'maindiv' not attached</div>
 | 
					    <div id="maindiv">'maindiv' not attached</div>
 | 
				
			||||||
<div id="extradiv">'extradiv' not attached</div>
 | 
					<div id="extradiv">'extradiv' not attached</div>
 | 
				
			||||||
<script src="./test.ts"></script>
 | 
					<script src="./test.ts"></script>
 | 
				
			||||||
 | 
					    <iframe src="http://127.0.0.1:1234/index.html" height="500px" width="600px"></iframe>
 | 
				
			||||||
 | 
					    <iframe src="http://127.0.0.1:1234/index.html?layout=bookcases&fs-userbadge=false&fs-search=false&fs-welcome-message=false&fs-layers=false&fs-geolocation=false" height="500px" width="600px"></iframe>
 | 
				
			||||||
</body>
 | 
					</body>
 | 
				
			||||||
</html>
 | 
					</html>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										14
									
								
								test.ts
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								test.ts
									
										
									
									
									
								
							| 
						 | 
					@ -1,15 +1 @@
 | 
				
			||||||
//*
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import {ImageCarousel} from "./UI/Image/ImageCarousel";
 | 
					 | 
				
			||||||
import {UIEventSource} from "./Logic/UIEventSource";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const images = new UIEventSource<{ url: string, key: string }[]>(
 | 
					 | 
				
			||||||
    [{url: "https://2.bp.blogspot.com/-fQiZkz9Zlzg/T_xe2X2Ia3I/AAAAAAAAA0Q/VPS8Mb8xtIQ/s1600/cat+15.jpg", key: "image:1"},
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            url: "https://www.mapillary.com/map/im/VEOhKqPcJMuT4F2olz_wHQ",
 | 
					 | 
				
			||||||
            key: "mapillary"
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {url: "https://i.imgur.com/mWlghx0.jpg", key: "image:1"}])
 | 
					 | 
				
			||||||
new ImageCarousel(images, new UIEventSource<any>({"image:1":"https://2.bp.blogspot.com/-fQiZkz9Zlzg/T_xe2X2Ia3I/AAAAAAAAA0Q/VPS8Mb8xtIQ/s1600/cat+15.jpg"}))
 | 
					 | 
				
			||||||
    .AttachTo("maindiv")    
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue