Notepad Web Development

Feed icon

Posts Tagged ‘UWA Template’

Netvibes UWA Widget Template

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html 	xmlns="http://www.w3.org/1999/xhtml"
		xmlns:widget="http://www.netvibes.com/ns/"  >
  <head>

    <meta name="author"      content="Stephen Griffin" />
    <meta name="website"     content="http://notepadwebdevelopment.com" />
    <meta name="description" content="Template for developing Netvibes UWA widgets" />
    <meta name="apiVersion"  content="1.0" />
    <meta name="autoRefresh" content="20" />
    <meta name="debugMode"   content="true" />

    <link rel="stylesheet" type="text/css" href="http://www.netvibes.com/themes/uwa/style.css" />
    <script type="text/javascript" src="http://www.netvibes.com/js/UWA/load.js.php?env=Standalone"></script>

    <title>UWA Template</title>
    <link rel="icon" type="image/png" href="http://www.notepadwebdevelopment.com/favicon.ico" />

	<widget:preferences>
		<!--preference type="text" name="testPref" label="Test Pref" defaultValue="Test prefernce value here" /-->
	</widget:preferences>

	<style type="text/css">
	  h1 		{ color: #333; }
	</style>

	<script type="text/javascript">
		// Create a pseudo-namespace
		var MyWidget = {};

		// Properties
		MyWidget.foo = 'http://www.google.com/';

		// Methods
		MyWidget.test = function(message) {
		  alert(message);
		}

		// Entry point
		widget.onLoad = function() {

		  widget.setBody('<h1>Loaded!</h1><p><a href="'+MyWidget.foo+'">'+MyWidget.foo+'</a></p>');
		}
	</script>
  </head>

  <body>

	<h1>Loading...</h1>

  </body>
</html>

Adapted from http://dev.netvibes.com/doc/uwa/documentation/uwa_monopage