Browse files

Start on a very basic browser app

  • Loading branch information...
1 parent f98aeb7 commit fb65228727efb6f3c8c2bfa3561c8226f7e86c11 @benfrancis benfrancis committed Nov 1, 2011
Showing with 100 additions and 1 deletion.
  1. +60 −0 browser/browser.css
  2. +25 −0 browser/browser.html
  3. +14 −0 browser/browser.js
  4. BIN browser/images/go.png
  5. +1 −1 homescreen.js
View
60 browser/browser.css
@@ -0,0 +1,60 @@
+#browser-html, #browser-body {
+ height: 100%;
+ padding: 0;
+ margin: 0;
+}
+
+#browser-body {
+ margin: 0;
+ display: -moz-box;
+ -moz-box-orient: vertical;
+ width: 100%;
+ height: 100%;
+ background-color: #000;
+}
+
+#browser-tab {
+ -moz-box-flex: 1;
+ display: -moz-box;
+ -moz-box-orient: vertical;
+}
+
+#browser-toolbar {
+ background-color: #666;
+ display: -moz-box;
+ -moz-box-orient: horizontal;
+ width: 100%;
+ height: 30px;
+ margin: 0;
+}
+
+#browser-address {
+ background-color: #333;
+ border-radius: 5px;
+ -moz-box-flex: 1;
+ display: -moz-box;
+ -moz-box-orient: horizontal;
+ height: 20px;
+ margin: 5px;
+ padding: 0;
+}
+
+#browser-url {
+ -moz-box-flex: 1;
+ border: none;
+ border-radius: 5px;
+ height: 16px;
+ padding: 2px 5px;
+}
+
+.browser-button {
+ display: block;
+ padding: 0 4px;
+}
+
+#browser-iframe {
+ -moz-box-flex: 1;
+ width: 100%;
+ border: none;
+ background-color: white;
+}
View
25 browser/browser.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html id="browser-html">
+
+ <head>
+ <meta charset="utf-8">
+ <title>Browser</title>
+ <link rel="stylesheet" href="browser.css" type="text/css" />
+ <script type="text/javascript" src="../apps.js"></script>
+ <script type="text/javascript" src="browser.js"></script>
+ </head>
+
+ <body id="browser-body">
+ <div id="browser-tab">
+ <div id="browser-toolbar">
+ <form id="browser-address">
+ <input type="text" id="browser-url" value="https://wiki.mozilla.org/B2G">
+ <input type="image" src="images/go.png" id="browser-go-button" class="browser-button" alt="Go">
+ </form>
+ </div>
+ <iframe id="browser-iframe" src="https://wiki.mozilla.org/B2G">
+ </iframe>
+ </div>
+ </body>
+
+</html>
View
14 browser/browser.js
@@ -0,0 +1,14 @@
+window.onload = function() {
+ var go = document.getElementById("browser-go-button");
+ go.addEventListener("click", Browser.navigate, false);
+
+}
+
+var Browser = {
+ navigate: function(event) {
+ var url = document.getElementById("browser-url").value;
+ var iframe = document.getElementById("browser-iframe");
+ iframe.setAttribute("src", url);
+ event.preventDefault();
+ }
+}
View
BIN browser/images/go.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2 homescreen.js
@@ -391,7 +391,7 @@ function OnLoad() {
{ label: 'Books', src: 'images/Books.png',
url: 'data:text/html,<font color="blue">Hello' },
{ label: 'Browser', src: 'images/Browser.png',
- url: 'data:text/html,<font color="blue">Hello' },
+ url: 'browser/browser.html' },
{ label: 'Music', src: 'images/Music.png',
url: 'data:text/html,<font color="blue">Hello' }
];

0 comments on commit fb65228

Please sign in to comment.