-
Notifications
You must be signed in to change notification settings - Fork 15
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
1 parent
1c13365
commit 31b95ab
Showing
16 changed files
with
8,777 additions
and
11 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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"title": "", | ||
"libDir": "lib", | ||
"paths": [], | ||
"libraries": [ | ||
"enyo", | ||
"moonstone", | ||
"spotlight", | ||
"layout", | ||
"svg", | ||
"enyo-ilib", | ||
"enyo-webos" | ||
], | ||
"sources": { | ||
"enyo": "https://github.com/enyojs/enyo.git", | ||
"moonstone": "https://github.com/enyojs/moonstone.git", | ||
"spotlight": "https://github.com/enyojs/spotlight.git", | ||
"layout": "https://github.com/enyojs/layout.git", | ||
"svg": "https://github.com/enyojs/svg.git", | ||
"enyo-ilib": "https://github.com/enyojs/enyo-ilib.git", | ||
"enyo-webos": "https://github.com/enyojs/enyo-webos.git" | ||
}, | ||
"targets": { | ||
"enyo": "2.7.0", | ||
"moonstone": "2.7.0", | ||
"spotlight": "2.7.0", | ||
"layout": "2.7.0", | ||
"svg": "2.7.0", | ||
"enyo-ilib": "2.7.0", | ||
"enyo-webos": "2.7.0" | ||
}, | ||
"production": false, | ||
"devMode": true, | ||
"cache": true, | ||
"resetCache": false, | ||
"trustCache": false, | ||
"cacheFile": ".enyocache", | ||
"clean": false, | ||
"sourceMaps": true, | ||
"externals": true, | ||
"strict": false, | ||
"skip": [], | ||
"library": false, | ||
"wip": false, | ||
"outDir": "dist", | ||
"outFile": "index.html", | ||
"lessPlugins": [ | ||
{ | ||
"name": "resolution-independence", | ||
"options": { | ||
"baseSize": 24 | ||
} | ||
} | ||
], | ||
"assetRoots": [], | ||
"lessOnlyLess": false, | ||
"minifyCss": false, | ||
"inlineCss": true, | ||
"outCssFile": "output.css", | ||
"outJsFile": "output.js", | ||
"inlineJs": true, | ||
"templateIndex": "", | ||
"watch": false, | ||
"watchPaths": [], | ||
"polling": false, | ||
"pollingInterval": 100, | ||
"headScripts": [], | ||
"tailScripts": [], | ||
"promisePolyfill": false, | ||
"styleOnly": false, | ||
"lessVars": [] | ||
} |
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,3 @@ | ||
node_modules | ||
.enyocache | ||
dist |
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,3 @@ | ||
[submodule "lib/enyo"] | ||
path = lib/enyo | ||
url = https://github.com/enyojs/enyo.git |
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,12 @@ | ||
{ | ||
"id": "org.webosbrew.custom-screensaver", | ||
"version": "1.0.0", | ||
"vendor": "webosbrew.org", | ||
"title": "Custom Screensaver", | ||
"icon": "assets/icon80.png", | ||
"largeIcon": "assets/icon130.png", | ||
"main": "index.html", | ||
"iconColor": "#ffffff", | ||
"type": "web", | ||
"appDescription": "The last custom webOS Screensaver you will ever need" | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,13 @@ | ||
/** | ||
Define your enyo/Application kind in this file. | ||
*/ | ||
|
||
var | ||
kind = require('enyo/kind'), | ||
Application = require('enyo/Application'), | ||
MainView = require('./views/MainView'); | ||
|
||
module.exports = kind({ | ||
kind: Application, | ||
view: MainView | ||
}); |
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,13 @@ | ||
/** | ||
Instantiate your enyo/Application kind in this file. Note, application | ||
rendering should be deferred until the DOM is ready by wrapping it in a | ||
call to ready(). | ||
*/ | ||
|
||
var | ||
ready = require('enyo/ready'), | ||
App = require('./App'); | ||
|
||
ready(function () { | ||
new App(); | ||
}); |
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,98 @@ | ||
var | ||
kind = require('enyo/kind'), | ||
Panel = require('moonstone/Panel'), | ||
FittableRows = require('layout/FittableRows'), | ||
FittableColumns = require('layout/FittableColumns'), | ||
BodyText = require('moonstone/BodyText'), | ||
Marquee = require('moonstone/Marquee'), | ||
LunaService = require('enyo-webos/LunaService'), | ||
Divider = require('moonstone/Divider'), | ||
Scroller = require('moonstone/Scroller'), | ||
Item = require('moonstone/Item'), | ||
ToggleItem = require('moonstone/ToggleItem'), | ||
Group = require('enyo/Group'); | ||
|
||
var basePath = "/media/developer/apps/usr/palm/applications/org.webosbrew.custom-screensaver"; | ||
var applyPath = basePath + "/assets/apply.sh"; | ||
var linkPath = "/var/lib/webosbrew/init.d/50-custom-screensaver"; | ||
module.exports = kind({ | ||
name: 'MainPanel', | ||
kind: Panel, | ||
title: 'webOS Custom Screensaver', | ||
titleBelow: "webosbrew.org", | ||
headerType: 'medium', | ||
components: [ | ||
{kind: FittableColumns, classes: 'enyo-center', fit: true, components: [ | ||
{kind: Scroller, fit: true, components: [ | ||
{classes: 'moon-hspacing', controlClasses: 'moon-12h', components: [ | ||
{components: [ | ||
// {kind: Divider, content: 'Toggle Items'}, | ||
{kind: ToggleItem, name: "autostart", content: 'Autostart', checked: true, disabled: true, onchange: "autostartToggle"}, | ||
{kind: Item, components: [ | ||
{kind: Marquee.Text, content: 'Apply temporarily'}, | ||
{kind: BodyText, style: 'margin: 10px 0', content: 'This will only enable custom screensaver until a reboot'}, | ||
], ontap: "temporaryApply"}, | ||
{kind: Item, content: 'Test run screensaver', ontap: "testRun"}, | ||
]}, | ||
]}, | ||
]}, | ||
]}, | ||
{components: [ | ||
{kind: Divider, content: 'Result'}, | ||
{kind: BodyText, name: 'result', content: 'Nothing selected...'} | ||
]}, | ||
{kind: LunaService, name: 'statusCheck', service: 'luna://org.webosbrew.hbchannel.service', method: 'exec', onResponse: 'onStatusCheck', onError: 'onStatusCheck'}, | ||
{kind: LunaService, name: 'exec', service: 'luna://org.webosbrew.hbchannel.service', method: 'exec', onResponse: 'onExec', onError: 'onExec'}, | ||
], | ||
|
||
bindings: [], | ||
|
||
create: function () { | ||
this.inherited(arguments); | ||
this.$.statusCheck.send({ | ||
command: 'readlink ' + linkPath, | ||
}); | ||
}, | ||
|
||
testRun: function (command) { | ||
this.exec("luna-send -n 1 'luna://com.webos.service.tvpower/power/turnOnScreenSaver' '{}'"); | ||
}, | ||
|
||
temporaryApply: function (command) { | ||
this.exec(applyPath); | ||
}, | ||
|
||
exec: function (command) { | ||
console.info(command); | ||
this.$.result.set('content', 'Processing...'); | ||
this.$.exec.send({ | ||
command: command, | ||
}); | ||
}, | ||
|
||
onExec: function (sender, evt) { | ||
console.info(evt); | ||
if (evt.returnValue) { | ||
this.$.result.set('content', 'Success!<br />' + evt.stdoutString + evt.stderrString); | ||
} else { | ||
this.$.result.set('content', 'Failed: ' + evt.errorText + ' ' + evt.stdoutString + evt.stderrString); | ||
} | ||
}, | ||
|
||
onStatusCheck: function (sender, evt) { | ||
console.info(sender, evt); | ||
// this.$.result.set('content', JSON.stringify(evt.data)); | ||
this.$.autostart.set('disabled', false); | ||
this.$.autostart.set('checked', evt.stdoutString && evt.stdoutString.trim() == applyPath); | ||
}, | ||
|
||
autostartToggle: function (sender) { | ||
console.info("toggle:", sender); | ||
|
||
if (sender.active) { | ||
this.exec('mkdir -p /var/lib/webosbrew/init.d && ln -sf ' + applyPath + ' ' + linkPath); | ||
} else { | ||
this.exec('rm -rf ' + linkPath); | ||
} | ||
}, | ||
}); |
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,37 @@ | ||
var | ||
kind = require('enyo/kind'), | ||
Panels = require('moonstone/Panels'), | ||
IconButton = require('moonstone/IconButton'), | ||
MainPanel = require('./MainPanel.js'); | ||
|
||
module.exports = kind({ | ||
name: 'myapp.MainView', | ||
classes: 'moon enyo-fit main-view', | ||
components: [ | ||
{ | ||
kind: Panels, | ||
pattern: 'activity', | ||
hasCloseButton: false, | ||
wrap: true, | ||
popOnBack: true, | ||
components: [ | ||
{ | ||
kind: MainPanel, | ||
}, | ||
], | ||
onTransitionFinish: 'transitionFinish', | ||
} | ||
], | ||
create: function () { | ||
this.inherited(arguments); | ||
}, | ||
handlers: { | ||
onRequestPushPanel: 'requestPushPanel', | ||
}, | ||
transitionFinish: function (evt, sender) { | ||
document.title = this.$.panels.getActive().title; | ||
}, | ||
requestPushPanel: function (sender, ev) { | ||
this.$.panels.pushPanel(ev.panel); | ||
}, | ||
}); |
Oops, something went wrong.