-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add original files
- Loading branch information
Showing
10 changed files
with
637 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
(function(window, chrome) { | ||
//Background Scope | ||
var background = {}; | ||
window.background = background; | ||
|
||
//Create window and add listeners | ||
chrome.app.runtime.onLaunched.addListener(function() { | ||
chrome.app.window.create('index.html', { | ||
'state': 'fullscreen', | ||
|
||
'bounds': { | ||
'width': 1366, | ||
'height': 768 | ||
} | ||
}, function(window) { | ||
window.onClosed.addListener(function() { | ||
background.setKeyboard(false); | ||
chrome.power.releaseKeepAwake(); | ||
}); | ||
background.setKeyboard(true); | ||
chrome.power.requestKeepAwake('display'); | ||
}); | ||
}); | ||
|
||
/** | ||
* Enables or disables the on-screen keyboard. | ||
* <p> | ||
* If enable is true, the virtual keyboard of the ChromeOS | ||
* accessibility features will be enabled. If false, this function will | ||
* return the setting to its original value. | ||
* @param {boolean} enable true to enable, or false to reset | ||
* @returns {undefined} | ||
*/ | ||
background.setKeyboard = function(enable) { | ||
if (chrome.accessibilityFeatures) { | ||
if (enable) { | ||
chrome.accessibilityFeatures.virtualKeyboard.set({ | ||
value: enable | ||
}); | ||
} | ||
else { | ||
chrome.accessibilityFeatures.virtualKeyboard.clear({}); | ||
} | ||
} | ||
}; | ||
})(window, chrome); |
Oops, something went wrong.