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 style="width:80%" rows="32" 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 for (var ifproxy in proxy.interfaceProxies)
44 cloudeebus.log(ifproxy);
45 proxy.getInterface("org.freedesktop.Notifications").Notify("Cloudeebus",0,"","Cloudeebus says:", "Hello, world !", [], {}, 0);
48 function gotBusProxy(proxy) {
49 proxy.ListNames().then(logCB, errorCB);
52 function connectSuccess() {
53 cloudeebus.SessionBus().getObject("org.freedesktop.DBus", "/org/freedesktop/DBus", gotBusProxy, errorCB);
54 cloudeebus.SessionBus().getObject("org.freedesktop.Notifications", "/org/freedesktop/Notifications", gotNotifProxy, errorCB);
57 cloudeebus.connect("ws://localhost:9000", manifest, connectSuccess, errorCB);
60 <input type="button" value="run script" onclick="evalScript()"/>
61 <input type="button" value="clear log" onclick="document.getElementById('log').innerHTML='';"/>
63 <pre id="log" style="height: 20em; overflow-x: auto; overflow-y: auto; background-color: #faa;"></pre>