[BACK]Return to index.html CVS log [TXT][DIR] Up to [local] / todotxt / Text-Todo-REST-API / example / htdocs

Annotation of todotxt/Text-Todo-REST-API/example/htdocs/index.html, Revision 1.6

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>