Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [20120126-16:54:49.506620] error: Uncaught TypeError: Object enyo.Dashboard has
- no method 'renderInto', Dashboard.html:9
- ===================
- Dashboard.html:
- <!doctype html>
- <html>
- <head>
- <title>Dashboard</title>
- <script src="enyo/framework/enyo.js" type="text/javascript"></script>
- </head>
- <body>
- <script type="text/javascript">
- enyo.create({kind: "Dashboard"}).renderInto(document.body);
- </script>
- </body>
- </html>
- ==============
- Dashboard.js (kind: "Dashboard"):
- // TODO: Disable lock when docked
- enyo.kind({
- name: "Dashboard",
- kind: "HFlexBox",
- components: [
- { name: "setDisplayProperty", kind: "PalmService", service: "palm://com.palm.display/control/", method: "setProperty" },
- { name: "getDisplayProperties", kind: "PalmService", service: "palm://com.palm.display/control/", method: "getProperty", onSuccess: "gotDisplayProperties", onResponse: "gotDisplayProperties" },
- { w: "fill", content: "Disable Screen Lock: ", domStyles: {padding: "8px" } },
- { kind: "ToggleButton", onChange: "buttonToggle" },
- ],
- create: function()
- {
- this.log();
- this.inherited(arguments);
- this.$.getDisplayProperties.call( { properties: ['timeout'] } );
- enyo.application.app = this;
- },
- gotDisplayProperties: function(inSender, inResponse)
- {
- this.OriginalTimeout = inResponse.timeout;
- if(this.OriginalTimeout >= 86400)
- this.OriginalTimeout = 3000;
- this.log("display timeout=", this.OriginalTimeout);
- },
- buttonToggle: function(inSender, inState)
- {
- this.log("Toggled to state " + inState);
- this.setScreenLock(!inState);
- },
- setScreenLock: function(on)
- {
- this.log(on);
- if(on) {
- this.$.setDisplayProperty.call( { timeout: this.OriginalTimeout });
- } else {
- this.$.getDisplayProperties.call( { properties: ['timeout'] } );
- this.$.setDisplayProperty.call( { timeout: 86400 });
- }
- },
- cleanup: function()
- {
- this.$.setDisplayProperty.call( { timeout: this.OriginalTimeout } );
- }
- });
- ==========================
- Media.js (my main pane):
- enyo.kind({
- name: "Media",
- kind: enyo.VFlexBox,
- components: [
- {kind: "ApplicationEvents", onUnload: "cleanup"},
- {name: "mainPane", flex: 1, kind: "Pane", onclick: "paneClick", transitionKind: "enyo.transitions.Simple", components: [
- {kind:"VFlexBox", components: [
- {kind: "PageHeader", components: [
- {kind: "VFlexBox", flex: 1, components: [
- {content: "WJGM Radio (Enyo)"},
- {content: "WJGM 105.1 FM Jacksonville FL, The Gospel", style: "font-size: 14px"}
- ]},
- ]},
- {kind: "Button", caption: "Play High Stream", onclick: "audioView"},
- {kind: "Button", caption: "Play Lo Stream", onclick: "audioViewLo"},
- /* Don't need toaster yet
- {kind: "Button", caption: "Help", onclick: "showToaster"},
- {kind: "Toaster", flyInFrom: "right", components: [
- {content: "Are you sure?"},
- {layoutKind: "HFlexLayout", pack: "center", components: [
- {kind: "Button", caption: "OK", onclick: "confirmClick"},
- {kind: "Button", caption: "Cancel", onclick: "cancelClick"}
- ]}
- ]},
- */
- {kind: "AppMenu", components: [
- {kind: "EditMenu"},
- {caption: "Preferences ...", onclick: "showPrefs"},
- {caption: "Help ...", onclick: "showHelp"},
- ]}
- ]},
- {name: "audioView", kind: "AudioView", onBack:"backHandler"},
- {name: "audioViewLo", kind: "AudioViewLo", onBack:"backHandler"},
- {name: "helpView", kind: "HelpView", onBack: "backHandler"},
- {name: "prefsView", kind: "PrefsView", onBack: "backHandler"},
- ]}
- ],
- create: function() {
- this.inherited(arguments);
- this.log();
- enyo.windows.openDashboard ("Dashboard.html", "Dashboard", {}, {});
- },
- cleanup: function() {
- enyo.application.app.cleanup();
- this.log("Cleanup called");
- },
- audioView: function(){
- this.$.mainPane.selectViewByName("audioView");
- },
- audioViewLo: function(){
- this.$.mainPane.selectViewByName("audioViewLo");
- },
- showHelp: function() {
- this.$.mainPane.selectViewByName("helpView");
- },
- showPrefs: function() {
- this.$.mainPane.selectViewByName("prefsView");
- },
- backHandler: function(inSender, e) {
- this.$.mainPane.back();
- }
- /* No need for toaster yet
- showToaster: function() {
- this.$.toaster.open();
- },
- confirmClick: function() {
- this.$.mainPane.selectViewByName("helpView");
- // process confirmation
- this.doConfirm();
- // then close dialog
- this.$.toaster.close();
- },
- cancelClick: function() {
- this.$.toaster.close();
- }
- */
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement