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

Diff for /todotxt/Text-Todo-REST-API/example/htdocs/index.html between version 1.6 and 1.7

version 1.6, 2010/01/31 03:40:21 version 1.7, 2010/02/02 06:11:31
Line 1 
Line 1 
 <html><head>  <html><head>
 <!-- $AFresh1: index.html,v 1.5 2010/01/31 03:12:02 andrew Exp $ -->          <!-- $AFresh1: index.html,v 1.6 2010/01/31 03:40:21 andrew Exp $ -->
 <title>todo.txt - ajax client</title>          <title>todo.txt - ajax client</title>
 <link rel="stylesheet" href="todo.css">          <link rel="stylesheet" href="todo.css">
 <!-- <script src="http://o.aolcdn.com/dojo/1.4/dojo/dojo.xd.js"></script> -->          <script src="scriptaculous/lib/prototype.js"></script>
 <script src="dojo/1.4/dojo/dojo.xd.js"></script>          <script src="scriptaculous/src/scriptaculous.js?load=effects,controls"></script>
 <script type='text/javascript'>  <script type='text/javascript'>
 var base_url = '/~andrew/user-bin/todo.cgi';  var base_url = '/~andrew/user-bin/todo.cgi';
   
 function loadIntoNode(data, xhr){  function getFiles() {
   if(xhr.args.node){      $('files').update("Getting Files . . .");
     xhr.args.node.innerHTML = data;      new Ajax.Updater('files', base_url, {
   }          method: 'get',
           //insertion: Insertion.Top
       });
 }  }
   
 function getFiles() {  function updateList(list, transport) {
   dojo.byId('files').innerHTML = "Getting Files . . .";      var todo = transport.responseJSON;
   dojo.xhrGet({  
     url: base_url,  
     node: dojo.byId("files"),  
     load: loadIntoNode  
   });  
   
       $('list').update('');
       for (var i=0; i <= todo.length; i++) {
           $('list').insert({ bottom: new Element('div', { id: todo[i].md5 }) });
           $(todo[i].md5).update(todo[i].text);
   
           var entry_url = base_url + '/' + list + '/' + todo[i].md5;
   
           new Ajax.InPlaceEditor(todo[i].md5, entry_url + '.txt', {
               loadTextURL: entry_url + '.txt',
           });
       }
 }  }
   
 function getList(list) {  function getList(list) {
   dojo.byId('list').innerHTML = "Getting List . . .";      $('list').update("Getting List . . .");
   dojo.xhrGet({      var list_url = base_url + '/' + list;
     url: base_url + '/' + list + '.txt',  
     node: dojo.byId("list"),      new Ajax.Request(list_url + '.json', {
     load: loadIntoNode          method: 'get',
   });          onSuccess: function(transport) { updateList(list, transport) },
       });
 }  }
 function getEntry(list, entry) {  
   document.getElementById('entry').innerHTML = "Getting Entry . . .";  
   dojo.xhrGet({  
     url: base_url + '/' + list + '/' + entry + '.md5',  
     node: dojo.byId("entry"),  
     load: loadIntoNode  
   });  
 }  
 </script>  </script>
 </head>  </head>
   
 <body onLoad="getFiles();getList('todo');getEntry('todo',5)">  <body onLoad="getFiles();getList('todo')">
 <div id='files'></div>      <h1>Files:</h1><div id='files'></div>
 <div id='entry'></div>      <h1>List:</h1> <div id='list'></div>
 <pre><div id='list'></div></pre>  
 </body></html>  </body></html>

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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