noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
Functions
todo_list.js File Reference

this file contains all the javascript needed by the todo_list. it requires prototype.js. The calling page must have the gDossier More...

Go to the source code of this file.

Functions

function add_todo ()
function todo_list_remove (p_ctl)
function todo_list_show (p_id)
function todo_list_show_error (request_json)
function todo_list_show_success (req)

Detailed Description

this file contains all the javascript needed by the todo_list. it requires prototype.js. The calling page must have the gDossier

Definition in file todo_list.js.


Function Documentation

function add_todo ( )

Definition at line 88 of file todo_list.js.

References offsetX, offsetY, posX, style, and value.

{
    $('add_todo_list').style.top=posY+offsetY+"px";
    $('add_todo_list').style.left=posX+offsetX+"px";

    $('add_todo_list').style.display='block';
    $('p_title').value='';

    $('p_date_todo').value='';
    $('p_desc').value='';
    $('tl_id').value=0;
}
function todo_list_remove (   p_ctl)

Definition at line 100 of file todo_list.js.

References hide, and value.

{
    if ( confirm('Effacer ?') == false )
    {
        return;
    }
    $("tr"+p_ctl).hide();
    var gDossier=$('gDossier').value;

    var action=new Ajax.Request(
                   'ajax_todo_list.php',
                   {
                   method:'get',
                   parameters:
                   {'del':
                   1,'id':
                   p_ctl,'gDossier':
                           gDossier
                       }
                   }
               );
    return false;

}
function todo_list_show (   p_id)

Definition at line 28 of file todo_list.js.

References alert(), offsetX, offsetY, posX, style, todo_list_show_error(), todo_list_show_success(), and value.

{
    var gDossier=$('gDossier').value;
    $('add_todo_list').style.top=(posY+offsetY)+'px';
    $('add_todo_list').style.left=(posX+offsetX-200)+'px';

    try
    {
        var action=new Ajax.Request(
                       'ajax_todo_list.php',
                       {
                   method:'get',
                   parameters:
                   {'show':
                   1,'id':
                   p_id,'gDossier':
                               gDossier
                           },
                   onFailure:todo_list_show_error,
                   onSuccess:todo_list_show_success
                       }
                   );
    }
    catch (e)
    {
        alert(" Envoi ajax non possible" + e.message);
    }
    return false;
}
function todo_list_show_error (   request_json)

Definition at line 84 of file todo_list.js.

References alert().

Referenced by todo_list_show().

{
    alert ('failure');
}
function todo_list_show_success (   req)

Definition at line 57 of file todo_list.js.

References alert(), getNodeText(), style, and value.

Referenced by todo_list_show().

{
    try
    {
        var answer=req.responseXML;
        var tl_id=answer.getElementsByTagName('tl_id');
        var tl_title=answer.getElementsByTagName('tl_title');
        var tl_desc=answer.getElementsByTagName('tl_desc');
        var tl_date=answer.getElementsByTagName('tl_date');

        if ( tl_id.length == 0 )
        {
            var rec=req.responseText;
            alert ('erreur :'+rec);
        }

        $('p_title').value=getNodeText(tl_title[0]);
        $('p_date_todo').value=getNodeText(tl_date[0]);
        $('p_desc').value=getNodeText(tl_desc[0]);
        $('tl_id').value=getNodeText(tl_id[0]);
        $('add_todo_list').style.display='block';
    }
    catch (e)
    {
        alert(e.message);
    }
}
 All Data Structures Namespaces Files Functions Variables Enumerations