Annotation of todotxt/Text-Todo-REST-API/example/htdocs/index.html, Revision 1.5
1.2 andrew 1: <html><head>
1.4 andrew 2: <title>todo.txt - ajax client</title>
1.3 andrew 3: <link rel="stylesheet" href="todo.css">
1.5 ! andrew 4: <!-- <script src="http://o.aolcdn.com/dojo/1.4/dojo/dojo.xd.js"></script> -->
! 5: <script src="dojo/1.4/dojo/dojo.xd.js"></script>
1.2 andrew 6: <script type='text/javascript'>
1.4 andrew 7: var base_url = '/~andrew/user-bin/todo.cgi';
8:
9: function loadIntoNode(data, xhr){
10: if(xhr.args.node){
11: xhr.args.node.innerHTML = data;
12: }
13: }
1.2 andrew 14: function getFiles() {
1.4 andrew 15: dojo.byId('files').innerHTML = "Getting Files . . .";
16: dojo.xhrGet({
17: url: base_url,
18: node: dojo.byId("files"),
19: load: loadIntoNode
20: });
21:
1.2 andrew 22: }
23: function getList(list) {
1.4 andrew 24: dojo.byId('list').innerHTML = "Getting List . . .";
25: dojo.xhrGet({
26: url: base_url + '/' + list + '.txt',
27: node: dojo.byId("list"),
28: load: loadIntoNode
29: });
1.2 andrew 30: }
31: function getEntry(list, entry) {
32: document.getElementById('entry').innerHTML = "Getting Entry . . .";
1.4 andrew 33: dojo.xhrGet({
34: url: base_url + '/' + list + '/entry/' + entry + '.md5',
35: node: dojo.byId("entry"),
36: load: loadIntoNode
37: });
1.2 andrew 38: }
39: </script>
40: </head>
41: <body onLoad="getFiles();getList('todo');getEntry('todo',5)">
1.4 andrew 42:
1.5 ! andrew 43: <!-- $AFresh1: index.html,v 1.4 2010/01/31 02:31:47 andrew Exp $ -->
1.2 andrew 44: <div id='files'></div>
1.3 andrew 45: <pre><div id='list'></div></pre>
1.2 andrew 46: <div id='entry'></div>
1.1 andrew 47: </body></html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>