Skip to content
Snippets Groups Projects
functions.js 2.87 KiB
Newer Older
  • Learn to ignore specific revisions
  • Florian Azizian's avatar
    Florian Azizian committed
    function actionSeda(path,type) {
        var resPath = path.split('|');
    
    Alexandre Morin's avatar
    Alexandre Morin committed
    
    
    Florian Azizian's avatar
    Florian Azizian committed
        if (type == 'zip' || type == 'sendMessage') {
            resPath[0] += '&messageTitle=' + $('messageTitle').value;
        }
    
        new Ajax.Request(resPath[0],
            {
                method: 'post',
                parameters: {
                    url: resPath[0]
                },
                onSuccess: function (answer) {
                    eval("response = " + answer.responseText);
                    if (response.status == 0) {
                        if (type == "validateMessage") {
                            $("cancel").click();
                            location.reload();
    
    Alexandre Morin's avatar
    Alexandre Morin committed
                        } else {
    
    Florian Azizian's avatar
    Florian Azizian committed
                            $('messageTitle').disabled = true;
    
                            if (type == 'zip') {
                                window.open(resPath[1]);
    
                                if ($("cancel").style.display != 'none') {
                                    $("validSend").style.display = 'block';
                                }
                            } else if (type == 'sendMessage') {
                                new Ajax.Request(resPath[1],
                                    {
                                        method:'post',
                                        parameters: { url : resPath[1]
                                        },
                                        onSuccess: function(answer) {
                                            eval("response = "+answer.responseText);
                                            if(response.status == 0){
                                                $("valid").style.display = 'block';
                                                $("validSend").style.display = 'none';
                                                $("cancel").style.display = 'none';
                                                $("sendMessage").style.display = 'none';
    
                                                alert(response.content);
                                            } else {
                                                alert(response.error);
                                            }
                                        }
                                    }
                                );
                            }
    
    Alexandre Morin's avatar
    Alexandre Morin committed
                        }
    
    Florian Azizian's avatar
    Florian Azizian committed
                    } else {
                        alert(response.error);
    
    Alexandre Morin's avatar
    Alexandre Morin committed
                    }
    
    function actionValidation(path, aUrlBasket) {
    
    Florian Azizian's avatar
    Florian Azizian committed
        new Ajax.Request(path,
    
    Florian Azizian's avatar
    Florian Azizian committed
                parameters: { url : path},
    
                onSuccess: function(answer) {
                    eval("response = "+answer.responseText);
                    if(response.status == 0){
    
                        //alert(response.content);
    
                    } else {
                        alert(response.error);
                    }
    
                    triggerAngular('#/basketList/users/' + aUrlBasket['userId'] + '/groups/' + aUrlBasket['groupIdSer'] + '/baskets/' + aUrlBasket['basketId']);