4 <!-- Do not load autobahn or cloudeebus if already provided by Crosswalk browser extensions. -->
5 <script type="text/javascript">
6 typeof cloudeebus != 'undefined' ||
7 document.write(unescape('%3Cscript src=%27../../lib/autobahn.min.js%27%3E %3C/script%3E %3Cscript src=%27../../cloudeebus/cloudeebus.js%27%3E%3C/script%3E'));
9 <script type="text/javascript">
10 function evalScript() {
12 "var lambda = function() {" +
13 document.getElementById('script').value +
21 <center><h1>cloudeebus</h1></center>
23 <textarea style="width:80%" rows="32" id="script">
28 "org.freedesktop.DBus",
29 "org.freedesktop.Notifications"
33 cloudeebus.log = function(msg) {
34 document.getElementById("log").innerHTML += msg + "\n";
37 function errorCB(error) {
38 cloudeebus.log("error: " + error + "\n");
41 function logCB(result) {
42 cloudeebus.log(JSON.stringify(result));
45 function gotNotifProxy(proxy) {
46 for (var ifproxy in proxy.interfaceProxies)
47 cloudeebus.log(ifproxy);
48 proxy.getInterface("org.freedesktop.Notifications").Notify("Cloudeebus",0,"","Cloudeebus says:", "Hello, world !", [], {}, 0);
51 function gotBusProxy(proxy) {
52 proxy.ListNames().then(logCB, errorCB);
55 function connectSuccess() {
56 cloudeebus.SessionBus().getObject("org.freedesktop.DBus", "/org/freedesktop/DBus", gotBusProxy, errorCB);
57 cloudeebus.SessionBus().getObject("org.freedesktop.Notifications", "/org/freedesktop/Notifications", gotNotifProxy, errorCB);
60 cloudeebus.connect("ws://localhost:9000", manifest, connectSuccess, errorCB);
63 <input type="button" value="run script" onclick="evalScript()"/>
64 <input type="button" value="clear log" onclick="document.getElementById('log').innerHTML='';"/>
66 <pre id="log" style="height: 20em; overflow-x: auto; overflow-y: auto; background-color: #faa;"></pre>