Sha256: 728873e7050681a4e5a821bc527e7b357fdfff8c4456181f8081cbb5bd03115d
Contents?: true
Size: 1.51 KB
Versions: 15
Compression:
Stored size: 1.51 KB
Contents
<script> function add_todo() { item = $('#todo_to_add').val(); $('#todo_to_add').val(''); $.ajax({ url: '/admin/todo', type: 'post', dataType: 'html', data: 'todo[name]=' + item, success: function(data) { $('#todo').html(data); } }); } function todo_clicked(todo_id) { var mode = ''; if ($('#todo_link_'+todo_id).hasClass("strike")) { mode = 'undone'; } else { mode = 'done'; } $.ajax({ url: '/admin/todo/mark/' + todo_id + '/' + mode, type: 'post', success: function() { if (mode=='done') { $('#todo_link_'+todo_id).addClass("strike"); } else { $('#todo_link_'+todo_id).removeClass("strike"); } } }); } function setup_todos() { $('form[name=todo_search_form]').submit(function () { $.ajax({ url: '/admin/todo/search', type: 'post', dataType: 'html', data: 'for=' + $('input[name=todo_search]').val(), success: function(data) { $('#todo').html(data); } }); return false; }); $('#todo .paginate a').click(function (){ $.ajax({ url: this.href, type: 'get', dataType: 'html', success: function(data) { $('#todo').html(data); }}); return false; }); } </script>
Version data entries
15 entries across 15 versions & 1 rubygems