Skip to content

Commit

Permalink
Updated line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
paullewis committed Aug 22, 2012
1 parent ccd7567 commit 4d11baf
Show file tree
Hide file tree
Showing 7 changed files with 2,333 additions and 2,333 deletions.
22 changes: 11 additions & 11 deletions frameless-window/background.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create("frameless_window.html",
{ frame: "none", width: 360,
height: 300,
minWidth: 220,
minHeight: 220,
left: 600
}
);
});
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create("frameless_window.html",
{ frame: "none", width: 360,
height: 300,
minWidth: 220,
minHeight: 220,
left: 600
}
);
});

74 changes: 37 additions & 37 deletions frameless-window/frameless_window.html
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<html>

<head>

<title>Frameless Window</title>

<link rel="stylesheet" type="text/css" href="style.css" />
<script src="titlebar.js"></script>
<script src="frameless_window.js"></script>

</head>

<body>

<div id="content">

<div id="inner-content">

Select the titlebar to enable:<br/>
<input type="checkbox" id="top-box">Top Titlebar
<br/>
<input type="checkbox" id="bottom-box">Bottom Titlebar
<br/>
<input type="checkbox" id="left-box">Left Titlebar
<br/>
<input type="checkbox" id="right-box">Right Titlebar
<br/>
<br/>
<button id="close-window-button">Close Window</button>

</div>

</div>

</body>

</html>
<html>

<head>

<title>Frameless Window</title>

<link rel="stylesheet" type="text/css" href="style.css" />
<script src="titlebar.js"></script>
<script src="frameless_window.js"></script>

</head>

<body>

<div id="content">

<div id="inner-content">

Select the titlebar to enable:<br/>
<input type="checkbox" id="top-box">Top Titlebar
<br/>
<input type="checkbox" id="bottom-box">Bottom Titlebar
<br/>
<input type="checkbox" id="left-box">Left Titlebar
<br/>
<input type="checkbox" id="right-box">Right Titlebar
<br/>
<br/>
<button id="close-window-button">Close Window</button>

</div>

</div>

</body>

</html>
122 changes: 61 additions & 61 deletions frameless-window/frameless_window.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
function updateCheckbox() {
var top_checkbox = document.getElementById("top-box");
var bottom_checkbox = document.getElementById("bottom-box");
var left_checkbox = document.getElementById("left-box");
var right_checkbox = document.getElementById("right-box");
if (top_checkbox.checked || bottom_checkbox.checked) {
left_checkbox.disabled = true;
right_checkbox.disabled = true;
} else if (left_checkbox.checked || right_checkbox.checked) {
top_checkbox.disabled = true;
bottom_checkbox.disabled = true;
} else {
left_checkbox.disabled = false;
right_checkbox.disabled = false;
top_checkbox.disabled = false;
bottom_checkbox.disabled = false;
}
}

function initCheckbox(checkboxId, titlebar_name, titlebar_icon_url, titlebar_text) {
var elem = document.getElementById(checkboxId);
if (!elem)
return;
elem.onclick = function() {
if (document.getElementById(checkboxId).checked)
addTitlebar(titlebar_name, titlebar_icon_url, titlebar_text);
else
removeTitlebar(titlebar_name);
focusTitlebars(true);

updateContentStyle();
updateCheckbox();
}
}

window.onfocus = function() {
console.log("focus");
focusTitlebars(true);
}

window.onblur = function() {
console.log("blur");
focusTitlebars(false);
}

window.onresize = function() {
updateContentStyle();
}

window.onload = function() {
initCheckbox("top-box", "top-titlebar", "top-titlebar.png", "Top Titlebar");
initCheckbox("bottom-box", "bottom-titlebar", "bottom-titlebar.png", "Bottom Titlebar");
initCheckbox("left-box", "left-titlebar", "left-titlebar.png", "Left Titlebar");
initCheckbox("right-box", "right-titlebar", "right-titlebar.png", "Right Titlebar");

document.getElementById("close-window-button").onclick = function() {
window.close();
}

updateContentStyle();
}
function updateCheckbox() {
var top_checkbox = document.getElementById("top-box");
var bottom_checkbox = document.getElementById("bottom-box");
var left_checkbox = document.getElementById("left-box");
var right_checkbox = document.getElementById("right-box");
if (top_checkbox.checked || bottom_checkbox.checked) {
left_checkbox.disabled = true;
right_checkbox.disabled = true;
} else if (left_checkbox.checked || right_checkbox.checked) {
top_checkbox.disabled = true;
bottom_checkbox.disabled = true;
} else {
left_checkbox.disabled = false;
right_checkbox.disabled = false;
top_checkbox.disabled = false;
bottom_checkbox.disabled = false;
}
}

function initCheckbox(checkboxId, titlebar_name, titlebar_icon_url, titlebar_text) {
var elem = document.getElementById(checkboxId);
if (!elem)
return;
elem.onclick = function() {
if (document.getElementById(checkboxId).checked)
addTitlebar(titlebar_name, titlebar_icon_url, titlebar_text);
else
removeTitlebar(titlebar_name);
focusTitlebars(true);

updateContentStyle();
updateCheckbox();
}
}

window.onfocus = function() {
console.log("focus");
focusTitlebars(true);
}

window.onblur = function() {
console.log("blur");
focusTitlebars(false);
}

window.onresize = function() {
updateContentStyle();
}

window.onload = function() {
initCheckbox("top-box", "top-titlebar", "top-titlebar.png", "Top Titlebar");
initCheckbox("bottom-box", "bottom-titlebar", "bottom-titlebar.png", "Bottom Titlebar");
initCheckbox("left-box", "left-titlebar", "left-titlebar.png", "Left Titlebar");
initCheckbox("right-box", "right-titlebar", "right-titlebar.png", "Right Titlebar");

document.getElementById("close-window-button").onclick = function() {
window.close();
}

updateContentStyle();
}
26 changes: 13 additions & 13 deletions frameless-window/manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "Frameless Window",
"description": "Chrome platform app.",
"manifest_version": 2,
"version": "0.1",
"app": {
"background": {
"scripts": ["background.js"]
}
},
"permissions": ["experimental"],
"icons": { "128": "icon_128.png" }
}
{
"name": "Frameless Window",
"description": "Chrome platform app.",
"manifest_version": 2,
"version": "0.1",
"app": {
"background": {
"scripts": ["background.js"]
}
},
"permissions": ["experimental"],
"icons": { "128": "icon_128.png" }
}
Loading

0 comments on commit 4d11baf

Please sign in to comment.