Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PlatformSampler sample that shows the detected platform user agen…
…t string and enyo.platform object Add platform detection for Firefox (desktop) and Firefox on Android Enyo-DCO-1.0-Signed-Off-By: Ben Combee (ben.combee@palm.com)
- Loading branch information
Ben Combee
committed
Oct 22, 2012
1 parent
ca91b43
commit d27ac15
Showing
5 changed files
with
62 additions
and
2 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,11 @@ | ||
.platform-sample { | ||
padding: 15px; | ||
} | ||
.platform-sample-divider { | ||
color: #F49200; | ||
text-transform: uppercase; | ||
font-family: Segoe UI, Prelude Medium, Helvetica, Verdana, sans-serif; | ||
font-size: 14px; | ||
font-weight: bold; | ||
margin-bottom: 8px; | ||
} |
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,21 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Platform Sample</title> | ||
<!-- --> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | ||
<!-- --> | ||
<script src="../enyo.js" type="text/javascript"></script> | ||
<script src="../../lib/layout/package.js" type="text/javascript"></script> | ||
<script src="../../lib/onyx/package.js" type="text/javascript"></script> | ||
<!-- --> | ||
<link href="PlatformSample.css" rel="stylesheet"> | ||
<script src="PlatformSample.js" type="text/javascript"></script> | ||
<!-- --> | ||
</head> | ||
<body> | ||
<script type="text/javascript"> | ||
new enyo.sample.PlatformSample().renderInto(document.body); | ||
</script> | ||
</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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
enyo.kind({ | ||
name: "enyo.sample.PlatformSample", | ||
kind: "FittableRows", | ||
classes: "enyo-fit platform-sample", | ||
components: [ | ||
{classes: "platform-sample-divider", content: "Enyo Platform Detection"}, | ||
{kind: "onyx.Groupbox", components: [ | ||
{kind: "onyx.GroupboxHeader", content: "User-Agent String"}, | ||
{name: "uaString", content: "", style: "padding: 8px;"} | ||
]}, | ||
{tag: "br"}, | ||
{kind: "onyx.Groupbox", components: [ | ||
{kind: "onyx.GroupboxHeader", content: "enyo.platform"}, | ||
{name: "enyoPlatformJSON", content: "", style: "padding: 8px;"} | ||
]} | ||
], | ||
create: function() { | ||
this.inherited(arguments); | ||
this.$.uaString.setContent(navigator.userAgent); | ||
this.$.enyoPlatformJSON.setContent(JSON.stringify(enyo.platform)); | ||
} | ||
}); |
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
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