4 <script src="../../lib/autobahn.min.js"></script>
5 <script src="../../cloudeebus/cloudeebus.js"></script>
6 <script type="text/javascript">
11 "com.intel.media-service-upnp",
12 "com.intel.renderer-service-upnp",
13 "org.freedesktop.DBus",
14 "org.freedesktop.DisplayManager",
15 "org.freedesktop.FileManager1",
16 "org.freedesktop.ModemManager",
17 "org.freedesktop.NetworkManager",
18 "org.freedesktop.Notifications",
19 "org.freedesktop.Tracker1",
22 "org.gnome.ScreenSaver",
27 function evalScript() {
29 "var lambda = function() {" +
30 document.getElementById('script').value +
38 <center><h1>cloudeebus</h1></center>
40 <textarea cols="80" rows=24 id="script">
41 cloudeebus.log = function(msg) {
42 document.getElementById("log").innerHTML += msg + "\n";
47 function connectSuccess() {
48 var bus = cloudeebus.SessionBus();
49 handler = bus.getObject("org.gnome.ScreenSaver", "/org/gnome/ScreenSaver");
50 handler.connectToSignal("org.gnome.ScreenSaver", "ActiveChanged", successCB, errorCB);
51 proxy = bus.getObject("org.gnome.ScreenSaver", "/", lock, errorCB);
55 proxy.SetActive(false, successCB, errorCB);
56 clearInterval(interval);
60 proxy.SetActive(true, lockOk, errorCB);
63 function lockOk(res) {
64 interval = setInterval(unLock,3000);
67 function successCB(res) {
68 cloudeebus.log("got result: " + res + "\n");
71 function errorCB(error) {
72 cloudeebus.log("error: " + error + "\n");
75 cloudeebus.connect("ws://localhost:9000", manifest, connectSuccess, errorCB);
78 <input type="button" value="run script" onclick="evalScript()"/>
79 <input type="button" value="clear log" onclick="document.getElementById('log').innerHTML='';"/>
81 <pre id="log" style="height: 20em; overflow-y: scroll; background-color: #faa;"></pre>