-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
2,333 additions
and
2,333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" } | ||
} |
Oops, something went wrong.