Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Styled singleton sample

  • Loading branch information...
commit 1a7cf1952ab42d866725592fa79fc2b893601a6c 1 parent 16b9105
@paullewis paullewis authored
View
BIN  singleton/icon_128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  singleton/icon_16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
11 singleton/main.js
@@ -6,7 +6,16 @@ chrome.experimental.app.onLaunched.addListener(function() {
singletonWindow.chrome.app.window.focus();
} else {
console.log('Creating singleton window');
- chrome.app.window.create('singleton.html', {}, function(w) {
+ chrome.app.window.create('singleton.html', {
+ width: 500,
+ height: 309,
+
+ maxWidth: 500,
+ maxHeight: 309,
+
+ minWidth: 500,
+ minHeight: 309
+ }, function(w) {
singletonWindow = w;
});
}
View
4 singleton/manifest.json
@@ -2,6 +2,10 @@
"manifest_version": 2,
"name": "Singleton Window",
"version": "1",
+ "icons": {
+ "16": "icon_16.png",
+ "128": "icon_128.png"
+ },
"app": {
"background": {
"scripts": ["main.js"]
View
16 singleton/singleton.html
@@ -1,9 +1,13 @@
+<!DOCTYPE html>
<html>
- <head>
- <title>Singleton</title>
- </head>
- <body>
- <p>I am a singleton window. I was created at <span id="created-at"></span>.</p>
+<head>
+ <meta charset="utf-8">
+ <title>Singleton Window</title>
+
+ <link href="styles/main.css" rel="stylesheet">
+</head>
+<body>
+ <p>I was created at <span id="created-at"></span>.</p>
<script src="singleton.js"></script>
- </body>
+</body>
</html>
View
5 singleton/singleton.js
@@ -1 +1,4 @@
-document.getElementById('created-at').textContent = new Date();
+var creationTime = new Date(),
+ creationMessage = creationTime.toLocaleString();
+
+document.getElementById('created-at').textContent = creationMessage;
View
BIN  singleton/singleton.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
19 singleton/styles/main.css
@@ -0,0 +1,19 @@
+body {
+ background: url("../singleton.png") no-repeat;
+}
+
+p {
+ text-align: center;
+ width: 100%;
+ line-height: 120%;
+ padding-top: 205px;
+ font-size: 20px;
+ font-family: Arial, sans-serif;
+ color: #666;
+ letter-spacing: -0.03em;
+}
+
+span {
+ color: #333;
+ font-weight: bold;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.