Convert existing AJAX functions to new framework
[infodrom.org/service.infodrom.org] / src / InfoCon / stempel / status.wml
index 9e738b6..0da5bd8 100644 (file)
@@ -263,14 +263,11 @@ function edit_task(obj)
        task_title = obj.innerHTML;
        task_oid = obj.parentNode.children[0].children[0].value;
 
-       var input = document.createElement('input');
-       input.value = obj.innerHTML
-       input.style.fontSize = '100%';
-       input.style.width = '100%';
-       input.style.background = 'yellow';
-
+       var input = $('<input>');
+       input.val(obj.innerHTML.replace('&gt;', '>').replace('&lt;', '<').replace('&amp;', '&'));
+       input.css('fontSize', '100%').css('width', '100%').css('background', 'yellow');
        obj.innerHTML = '';
-       obj.appendChild(input);
+       $(obj).append(input);
        input.focus();
     }
 }
@@ -280,7 +277,7 @@ function edit_task_save()
     if (!task_parent) return;
 
     if (task_parent.children[0].value != task_title)
-       ajax_request('save','oid='+task_oid+'&task='+encodeURIComponent(task_parent.children[0].value));
+       $.invoke('Sales/Text', {id: task_oid, text: task_parent.children[0].value});
 
     task_parent.innerHTML = task_parent.children[0].value;
     task_parent = null;