HEX
Server: Apache
System: Linux webm005.cluster121.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: adventp (418412)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/adventp/www/wp-content/themes/brooklyn/unite/core/admin/assets/js/unite-license.js
/* <![CDATA[ */
;(function($){
	
	"use strict";
	
    $(document).ready(function(){

        function connect( request ) {

            Swal.fire({
                title: 'Connecting Brooklyn Servers',
                backdrop : false,
                onBeforeOpen: function() {

                    Swal.showLoading();

                    $.ajax({
                        type: 'POST',
                        url: ajaxurl,
                        data: {
                            action: request,
                            envato_purchase: $('#envato_purchase_code').val()
                        },
                        success: function (res) {

                            if( typeof res.result !== "undefined" ) {

                                if( res.result === 'access_denied' ) {

                                    Swal.fire({
                                        backdrop : false,
                                        type: 'error',
                                        title: res.reason,
                                        customClass: {
                                            confirmButton: 'ut-ui-button ut-ui-button-blue'
                                        },
                                        timer: 3000
                                    });

                                }

                                if( res.result === 'access_success' ) {

                                    Swal.fire({
                                        backdrop : false,
                                        type: 'success',
                                        title: 'License successfully registered!',
                                        showConfirmButton: false,
                                        timer: 3000
                                    }).then( function (result) {

                                        location.reload(true);

                                    });

                                }

                                if( res.result === 'connection_issue' ) {

                                    Swal.fire({
                                        backdrop : false,
                                        type: 'info',
                                        title: res.reason,
                                        customClass: {
                                            confirmButton: 'ut-ui-button ut-ui-button-blue'
                                        }
                                    });

                                }

                                if( res.result === 'revoke_success' ) {

                                    Swal.fire({
                                        backdrop : false,
                                        type: 'success',
                                        title: 'License removed from Installation!',
                                        showConfirmButton: false,
                                        timer: 3000
                                    }).then( function (result) {

                                        location.reload(true);

                                    });

                                }

                            }

                        }

                    });

                }

            });

        }

        $('#ut-register-license').on('click', function ( event ) {

            if( !$('#envato_purchase_code').val().length ) {

                Swal.fire({
                    backdrop : false,
                    type: 'info',
                    title: 'Missing Purchasecode',
                    text: 'Please enter your purchasecode!',
                    customClass: {
                        confirmButton: 'ut-ui-button ut-ui-button-blue'
                    }
                });

            } else {

                connect('ut_check_license');

            }

            event.preventDefault();
            event.stopImmediatePropagation();

        });

        $('#ut-deregister-license').on('click', function ( event ) {

            connect('ut_deregister_license');
            event.preventDefault();

        });

        function check_confirmation() {

            if( $('#ut-data-confirmation').prop('checked') ) {

                $('#ut-register-license').attr("disabled", false );

            } else {

                $('#ut-register-license').attr("disabled", true );

            }

        }

        $('#ut-data-confirmation').on('click', function ( event ) {

            check_confirmation();

        });
        
    });
	
})(jQuery);
 /* ]]> */