jQuery(document).ready(function($){
	$('#compile').click(function(){
	    $.confirm({
	    	theme: 'supervan',
	        title: 'Are you sure you want to compile this result?',
	        buttons: {
	            confirm: {
	                text: 'Compile',
	                btnClass: 'btn-blue',
	                action: function () { 
	                    window.location = $('#compile').data('url');
	                }
	            },
	            cancel: function () {
	                //close
	            },
	        },
	        onContentReady: function () {
	            // bind to events
	            var jc = this;
	            this.$content.find('form').on('submit', function (e) {
	                // if the user submits the form by pressing enter in the field.
	                e.preventDefault();
	                jc.$$formSubmit.trigger('click'); // reference the button and click it
	            });
	        }
	    });
	})
})