?? GreyFile — Mystic File Browser

Current path: home/webdevt/cryptoimpot.fr/public/dist/js/



?? Go up: /home/webdevt/cryptoimpot.fr/public/dist

?? Viewing: main.js

/*
 * jQuery File Upload Plugin JS Example
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2010, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * https://opensource.org/licenses/MIT
 */

/* global $, window */

$(function () {
    'use strict';

    // Initialize the jQuery File Upload widget:
    $('#fileupload').fileupload({
        // Uncomment the following to send cross-domain cookies:
        //xhrFields: {withCredentials: true},
        url: 'http://ledgio.localhost:8888/upload.php'
    });

    // Enable iframe cross-domain access via redirect option:
    $('#fileupload').fileupload(
            'option',
            'redirect',
            window.location.href.replace(
                    /\/[^\/]*$/,
                    '/cors/result.html?%s'
                    )
            );

    if (window.location.hostname === 'blueimp.github.io') {
        // Demo settings:
        $('#fileupload').fileupload('option', {
            url: '//jquery-file-upload.appspot.com/',
            // Enable image resizing, except for Android and Opera,
            // which actually support image resizing, but fail to
            // send Blob objects via XHR requests:
            disableImageResize: /Android(?!.*Chrome)|Opera/
                    .test(window.navigator.userAgent),
            maxFileSize: 999000,
            acceptFileTypes: /(\.|\/)(doc|csv)$/i
        });
        // Upload server status check for browsers with CORS support:
        if ($.support.cors) {
            $.ajax({
                url: '//jquery-file-upload.appspot.com/',
                type: 'HEAD'
            }).fail(function () {
                $('<div class="alert alert-danger"/>')
                        .text('Upload server currently unavailable - ' +
                                new Date())
                        .appendTo('#fileupload');
            });
        }
    } else {
        // Load existing files:
        $('#fileupload').addClass('fileupload-processing');
        $.ajax({
            // Uncomment the following to send cross-domain cookies:
            //xhrFields: {withCredentials: true},
            url: $('#fileupload').fileupload('option', 'url'),
            dataType: 'json',
            context: $('#fileupload')[0]
        }).always(function () {
            $(this).removeClass('fileupload-processing');
        }).done(function (result) {
            $(this).fileupload('option', 'done')
                    .call(this, $.Event('done'), {result: result});


        });
    }

    $('#uploadfile-finish').click(function () {
        /*$.ajax({
         type: "POST",
         url: '<?= $baseUrl ?>/service.php',
         data: JSON.stringify({
         statusUpload: 'finish'
         }),
         dataType: "json",
         success: function (data) {
         console.log(data);
         
         if (data == 1) {
         $('#calcul-button').show();
         }
         },
         error: function (xhr) {
         console.log("Error: " + xhr.statusText);
         }
         });*/
        var data = {}
        data["id"] = 1;
        data["domain"] = 2;
        data["name"] = 3;

        $.ajax({
            type: "POST",
            contentType: "application/json",
            url: '<?= $baseUrl ?>/service.php',
            data: JSON.stringify(data),
            dataType: 'json',
            timeout: 600000,
            success: function (data) {

                console.log("SUCCESS: ", data);
            },
            error: function (e) {

                console.log("ERROR: ", e);
            }
        });
    });

    setInterval(function () {
        $.ajax({
            url: '<?= $baseUrl ?>/getcalculationstatus.php',
            success: function (data) {
                console.log(data);

                if (data == 1) {
                    $('#calcul-button').show();
                }
            },
            error: function (xhr) {
                console.log("Error: " + xhr.statusText);
            }
        });

    }, 2000);

});


??

??