[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.1 and 1.9

version 1.1, 2010/01/18 04:19:04 version 1.9, 2010/02/16 03:45:17
Line 1 
Line 1 
 <html><head><title></title></head><body>  <html><head>
           <!-- $AFresh1: index.html,v 1.8 2010/02/13 22:32:18 andrew Exp $ -->
           <title>todo.txt - ajax client</title>
           <link rel="stylesheet" href="todo.css">
   
           <script src="scriptaculous/lib/prototype.js"></script>
           <script src="scriptaculous/src/scriptaculous.js?load=effects,controls"></script>
   <script type='text/javascript'>
   
   var TODO = function () {
       var base_url = '/~andrew/user-bin/todo.cgi',
   
       updateList = function (list, transport) {
           var i,
             todo = transport.responseJSON,
             url = '';
   
           $('list').update('');
   
           for (i=0; i <= todo.length; i++) {
               $('list').insert({
                   bottom: new Element('div', {
                       id: todo[i].md5,
                       }).update(todo[i].text),
               });
   
               url = base_url + '/' + list + '/entry/' + todo[i].md5;
   
               new Ajax.InPlaceEditor(todo[i].md5, url + '.json', {
                   cols: 80,
                   loadTextURL: url + '.txt',
                   //getText: function () {},
               });
           }
       };
   
       return {
           getFiles: function () {
               $('files').update("Getting Files . . .");
   
               new Ajax.Updater('files', base_url, {
                   method: 'get',
               });
           },
   
           getTags: function (list) {
                var url = base_url + '/' + list + '/tags';
                $('tags').update("Getting Tags. . .");
   
                new Ajax.Request(url + '.json', {
                   method: 'get',
                   onSuccess: function (transport) {
                       var data = transport.responseJSON,
                       k,
                       html = '';
                       for (k in data) {
                           if (data.hasOwnProperty(k)) {
                               html += k + ": " + data[k] + "<br/>\n";
                           }
                       }
                       $("tags").innerHTML = html;
                   },
               });
           },
   
           getList: function (list) {
               var url = base_url + '/' + list;
               $('list').update("Getting List . . .");
   
               new Ajax.Request(url + '.json', {
                   method: 'get',
                   onSuccess: function (transport) {
                       updateList(list, transport)
                   },
               });
   
           },
       };
   }();
   
   </script>
   </head>
   
   <body onLoad="TODO.getList('todo');TODO.getTags('todo');TODO.getFiles()">
       <h1>Files:</h1><div id='files'></div>
       <h1>Tags:</h1> <div id='tags'></div>
       <h1>List:</h1> <div id='list'></div>
 </body></html>  </body></html>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.9

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