4 <script src="../../lib/autobahn.min.js"></script>
5 <script src="../../cloudeebus/cloudeebus.js"></script>
6 <script type="text/javascript">
7 function evalScript() {
9 "var lambda = function() {" +
10 document.getElementById('script').value +
18 <center><h1>cloudeebus</h1></center>
20 <textarea cols="80" rows=24 id="script">
25 "org.freedesktop.DBus",
26 "org.freedesktop.Notifications"
30 cloudeebus.log = function(msg) {
31 document.getElementById("log").innerHTML += msg + "\n";
34 function errorCB(error) {
35 cloudeebus.log("error: " + error + "\n");
38 function logCB(result) {
39 cloudeebus.log(JSON.stringify(result));
42 function gotNotifProxy(proxy) {
43 proxy.Notify("Cloudeebus",0,"","Cloudeebus says:", "Hello, world !", [], {}, 0);
46 function gotBusProxy(proxy) {
47 proxy.ListNames(logCB, errorCB);
50 function connectSuccess() {
51 cloudeebus.SessionBus().getObject("org.freedesktop.DBus", "/org/freedesktop/DBus", gotBusProxy, errorCB);
52 cloudeebus.SessionBus().getObject("org.freedesktop.Notifications", "/org/freedesktop/Notifications", gotNotifProxy, errorCB);
55 cloudeebus.connect("ws://localhost:9000", manifest, connectSuccess, errorCB);
58 <input type="button" value="run script" onclick="evalScript()"/>
59 <input type="button" value="clear log" onclick="document.getElementById('log').innerHTML='';"/>
61 <pre id="log" style="height: 20em; overflow-x: auto; overflow-y: auto; background-color: #faa;"></pre>