-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>AppWidget</title>
<script>
window.onmessage = function(e) {
document.getElementById("message").innerHTML += e.data;
pdWindow.document.getElementById("fromBox").innerHTML += "<br>[web messaging] Hello, PD";
}
-
window.addEventListener("pdevent",
- function(e) {
- document.getElementById("message").innerHTML += e.detail.message;
- pdWindow.document.getElementById("fromBox").innerHTML += "<br>[custom event] Hello, PD";
- }, false);
+ function(e) {
+ document.getElementById("message").innerHTML += e.detail.message;
+ pdWindow.document.getElementById("fromBox").innerHTML += "<br>[custom event] Hello, PD";
+ }, false);
</script>
</head>
- <body bgcolor="#99CCFF" text="#FFFFFF" >
- <div id="demo"><h1>AppWidget Sample</h1></div>
- <div id="demo"><h1>This is a Box.</h1></div>
+ <body bgcolor="#99CCFF" text="#FFFFFF">
+ <div id="demo">AppWidget Sample</div>
+ <div id="demo">This is a Box.</div>
<div id="message"></div>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/sample">
- <name>sample</name>
- <icon src="icon.png"/>
- <tizen:application id="kCBp6MjneD.sample" package="kCBp6MjneD" required_version="2.1"/>
- <tizen:app-widget id="kCBp6MjneD.sample.default" primary="true" period="10.0">
- <tizen:box-label>Web Application AppWidget Sample</tizen:box-label>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/appwid">
+<tizen:application id="syWXgC5ZcI.appwid" package="syWXgC5ZcI" required_version="1.0"/>
+<icon src="icon.png"/>
+<name>appwid</name>
+ <tizen:app-widget id="syWXgC5ZcI.appwid.default" primary="true">
+ <tizen:box-label>WEB APPWIDGET</tizen:box-label>
<tizen:box-icon src="icon.png"/>
<tizen:box-content src="box/index.html">
<tizen:box-size>1x1</tizen:box-size>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
- <meta name="viewport" content="initial-scale=1">
+ <meta name="viewport" content="initial-scale=1" />
<title>Test</title>
<script>
function accessParentElement() {
// create custom event
var event = new CustomEvent("pdevent", {
detail: {
- message: "custom event!<br>",
- time: new Date(),
+ message: "custom event!<br>",
+ time: new Date(),
},
bubbles: true,
cancelable: true
window.opener.dispatchEvent(event);
}
</script>
- </head>
- <body bgcolor="#FF9966" text="#FFFFFF">
- <h2>This is a pd.<br>A Pd can control the Box.<h2>
- <input type="button" value="access element" onclick="accessParentElement()">
- <input type="button" value="webmessage" onclick="accessWebMessaging()">
- <input type="button" value="custom event" onclick="accessCustomEvent()">
-
+ </head>
+ <body bgcolor="#FF9966" text="#FFFFFF">
+ This is a PD.<br>A PD can control the Box.<br>
+ <input type="button" value="ColorChange" onclick="accessParentElement()" />
+ <input type="button" value="WebMessage" onclick="accessWebMessaging()" />
+ <input type="button" value="CustomEvent" onclick="accessCustomEvent()" />
<div id="fromBox"></div>
- </body>
+ </body>
</html>