$(document).ready(function() { activatePreview(); $('body').on('click', '#but-preview-download', start_preview_download); /* // Subscribe to message from instant message top.getHubProxy().on('msg', proxyMsg); // Unsubscribe to message from instant message $(window).on('beforeunload', function() { top.getHubProxy().off('msg', proxyMsg); }); */ }); function activatePreview() { return; $('.preview-v3-box').show(); } function start_preview_download() { show_wait_screen(); var previewerName = $('.previewers option:selected').val(); $.get('/Content/commit.php?preview_commit=&set_customer=', function(content_package) { save_preview_package(content_package, previewerName); }).fail(function() { alert('Error occurred'); }).always(function() { hide_wait_screen(); }); } function save_preview_package(content, previewerName) { $.get('/PreviewApplication/savepreview.php?hash=379937e6c00d9dd2f8af92ba4ed2d3a6&content='+content+'&productkey=Preview_User___7dc6bf925fbf1ad3a962e61860751486&previewname='+previewerName).fail(function() { alert('Error occurred'); }).always(function() { }); }