minor revisions of examples
[eql:eql.git] / examples / M-modules / webkit / webkit-bridge.htm
1 <html>
2   <body style="font-family: Arial; font-size: small;">
3     <h2 style="color: navy">Simple QtWebKit Bridge Demo</h2>
4     <ol>
5       <li>
6       <p>Call Lisp function, passing a <b>Date</b> and an <b>Array</b></p>
7         <input type="button"
8                value="Call"
9                onclick="var now = new Date();
10                         alert(Lisp.testCall(now, ['hello', 42]));">
11       <li>
12         <p><b>Change value</b> in Lisp (passing a QWebElement)</p>
13         <input type="button"
14                value="Flip"
15                onclick="Lisp.flipValue(document.getElementById('flip'));">
16         <input type="text"
17                id="flip"
18                value="never odd or even"
19                size="25">
20       <li>
21         <p><b>Eval</b> in Lisp</p>
22         <input type="text"
23                id="expression"
24                value="(clone)"
25                size="50"
26                style="font-family: Courier New; font-size: 120%;"
27                onkeypress="var code = window.event.keyCode;
28                            if((code == 13) || (code == 14)) {
29                                var exp = document.getElementById('expression');
30                                exp.value = Lisp.eval(exp.value); }">
31       <li>
32         <p>Set <b>Qt Property</b> of this QWebView</p>
33         <input type="button"
34                value="Zoom"
35                onclick="WebView.zoomFactor = document.getElementById('zoom').value">
36         <input type="text"
37                id="zoom"
38                value="0.9"
39                size="3">
40       <li>
41         <p>Call <b>Qt Slot</b> of this QWebView</p>
42         <input type="button"
43                value="Maximize"
44                onclick="WebView.showMaximized()">
45     </ol>
46     <hr>
47     <p>See also <a href="#1" onclick="Lisp.eval('(inspector)');">Web Inspector</a>
48       <b>Scripts</b> and <b>Console:</b>
49     </p>
50     <p>
51       Script debugging, introspecting web elements / functions and properties of exposed objects
52       <br>(type <em>Lisp</em> and see drop down of <em>QtRuntimeObject</em>)
53     </p>
54     <hr>
55     <p>
56       <a href="#2" onclick="Lisp.deleteLater()" style="color: red">Delete</a> exposed <em>Lisp</em>
57          object (examples 1 to 3 will stop working)
58     </p>
59   </body>
60 </html>