INDEX

Web pages and short URLs

Applications can have their own web pages. The content of the pages is not controlled by Spaceify. Making the pages, however, needs to take into account the remote operation compatibility.

Application web pages are loaded dynamically and this limits somewhat how the web pages can be opened. The DOM window.open method can still be used for opening windows but it has been changed a bit. The changes to the window.open method are documented in the overrides section.

Short URLs are URLs that take directly to applications web page. The short URL is otherwise normal URL but it has applications or spacelets unique name appended to the end. For example, edge.spaceify.net/lights would take to the index.html page of the application with unique name lights.

Because the implementation behind short URLs expects to find index.html, it is a good practice to have index.html in the document root (the www directory). At least the index.html should be used to redirect to the "actual" web page (remember to use window.open for the redirection). Adhering to this avoids unnecessary 404 Not found error web pages.

Below is and of short URL and remote operation safe index web page.

http://edge.spaceify.net/spaceify/lightcontrol
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Light Controller - Redirecting...</title>
	<meta name="description" content="">
	<meta name="author" content="Spaceify Oy">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="refresh" content="0; url=dist/" />

	<link rel="stylesheet" sp_href="dist/assets/roboto/roboto.css">
	<link rel="stylesheet" sp_href="css/skeleton/normalize.css">
	<link rel="stylesheet" sp_href="css/skeleton/skeleton.css">
	<link rel="stylesheet" sp_href="css/index.css">
	<!-- <link rel="icon" type="image/png" sp_href="images/favicon.png"> -->

	<script src="http://edge.spaceify.net/js/spaceify.loader.js"></script>
	<script spe_src="js/spaceify.api.jquery.js"></script>

	<script>
	window.addEventListener("click", function()
		{
		window.open("spaceify/lightcontrol", "dist/index.html", "_parent");
		});
	</script>
</head>
<body>

	<div class="container">
		<div class="row">
			<div class="one-half column" style="margin-top: 10%">
				<h2>Redirecting...</h2>

				Trying to redirect page to <span>control page</span>... Click page to go there now.
			</div>
		</div>
	</div>

</body>
</html>
Close
copyright © Spaceify.org 2014