1;(function ( $, window, document, undefined ) { 2 $(document).ready(function() { 3 4 set_iframe_class(); 5 ui_init(); 6 form_events(); 7 referral_links(); 8 }); 9 10 11 function validate_email(email) { 12 var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 13 return re.test(email); 14 } 15 16 function set_iframe_class() { 17 var isInIFrame = (window.location != window.parent.location); 18 if(isInIFrame == true){ 19 $('body').addClass('iframe'); 20 } 21 else { 22 $('body').removeClass('iframe'); 23 } 24 } 25 26 function ui_init() { 27 $('.navigation-animated-buttons').scrollSlacker({ elasticity : 3 }); 28 $('#section-search-inner').scrollSlacker({ elasticity : 5, ignored : [$('#search-icon')] }); 29 $('#demo-header-section-inner').scrollSlacker({ elasticity : 5 }); 30 $('#about-header-section-inner').scrollSlacker({ elasticity : 5 }); 31 $('#support-header-section-inner').scrollSlacker({ elasticity : 5 }); 32 $('#codecanyon-button-wrap').scrollSlacker({ elasticity : 3 }); 33 $('#logo-footer').scrollSlacker({ elasticity : 1 }); 34 35 // main content box 36 $('#section-grid').css({ height : $('#section-grid').height() }); 37 } 38 39 function form_events() { 40 // contact form 41 $('#button-send-email').on('click', function() { 42 var valid = true; 43 44 if (!validate_email($('#input-email').val())) { 45 valid = false; 46 $('#input-email').closest('.form-group').addClass('has-error'); 47 } else { 48 $('#input-email').closest('.form-group').removeClass('has-error'); 49 } 50 51 if ($('#textarea-message').val().length == 0) { 52 valid = false; 53 $('#textarea-message').closest('.form-group').addClass('has-error'); 54 } else { 55 $('#textarea-message').closest('.form-group').removeClass('has-error'); 56 } 57 58 // Validate 59 if (valid) { 60 // Send 61 $(this).prop('disabled', 'disabled'); 62 $(this).html('Sending...'); 63 64 var button = $(this); 65 66 $.post('contact_form.php', { 67 email : $('#input-email').val(), 68 message : $('#textarea-message').val() 69 }).done(function() { 70 button.addClass('btn-success').removeClass('btn-primary'); 71 button.html('Done'); 72 }); 73 74 } 75 76 return false; 77 }); 78 } 79 80 function referral_links() { 81 // referral links 82 $('a').each(function() { 83 var href = $(this).prop('href'); 84 85 if (href.search("codecanyon") > 0) { 86 href += '?ref=nickys'; 87 $(this).prop('href', href); 88 } 89 }); 90 } 91 92})( jQuery, window, document ); 93 94// RESIZABLE DEMO BOX 95 96;(function ( $, window, document, undefined ) { 97 $(document).ready(function() { 98 var dragging = false; 99 var initial_event_x = 0; 100 101 var resizable_container = $('.demo-resizable-container'); 102 var original_width = resizable_container.width(); 103 var current_width = original_width; 104 var event_start_width = original_width; 105 106 $(document).on('mousedown', function(e) { 107 if (!dragging && ($(e.target).hasClass('demo-resizable-container-button') || $(e.target).closest('demo-resizable-container-button').length > 0)) { 108 dragging = true; 109 initial_event_x = e.pageX; 110 event_start_width = resizable_container.width(); 111 } 112 }); 113 114 $(document).on('mousemove', function(e) { 115 if (dragging) { 116 var offsex_x = initial_event_x - e.pageX; 117 var current_width = (event_start_width - offsex_x > original_width) ? original_width : event_start_width - offsex_x; 118 119 resizable_container.css({ 120 width : current_width 121 }); 122 123 $.resizeCallback(e); 124 } 125 }); 126 127 $(document).on('mouseup', function(e) { 128 if (dragging) { 129 dragging = false;
130 } 131 }); 132 }); 133})( jQuery, window, document );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.