var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opens = _____WB$wombat$assign$function_____("opens"); function zip_files( order_guid, use_fc ) { // if the file collection we're using is null, that // means we're using a selection. if ( use_fc == null ) { var dl_count = $( ".nc_download_cb:checked" ).length; if ( dl_count == 0 ) { alert( neucart_dp_nothing_selected ); return; } else if ( dl_count > neucart_zip_limit ) { var msg = neucart_dp_toomany_selected.replace( "{1}", neucart_zip_limit ); alert( msg ); return; } } var files_to_zip = ''; var arr_guids = Array(); if ( use_fc == null ) { $( ".nc_download_cb:checked" ).each( function( index ) { if ( files_to_zip.length > 0 ) files_to_zip += "|"; var guid = $(this).attr( 'id' ).substr( 3 ); files_to_zip += guid; arr_guids.push( guid ); } ); } else { files_to_zip = use_fc; arr_guids = use_fc.split( "|" ); } neucart_dp_in_progress = true; change_download_links( true, arr_guids, use_fc != null ); $.get( "includes/ajax/getdownloads.php", { action: 'get_zipped', guid: order_guid, guids: files_to_zip }, function ( data ) { // no constants here. this is the only place. here are some return codes: // -1: guid parameter is empty // -2: no rows in result set // -3: root directory not set in database // -4: file doesn't exist. // -5: mkdir failed var emsg = ""; var zip_name = ""; // all the errors here. switch( data ) { case "-1": emsg = neucart_dp_param_missing; break; case "-2": emsg = neucart_dp_no_file; break; case "-3": emsg = neucart_dp_no_root_dir; break; case "-4": emsg = neucart_dp_file_loc_missing; break; case "-5": emsg = neucart_dp_failed_create_url; break; case "-6": emsg = neucart_dp_no_zip_left; break; default: if ( data.indexOf( "true|" ) == 0 ) zip_name = data.substring( 5 ); else emsg = neucart_dp_general_error; break; } // no error? if ( zip_name.length > 0 ) { // full path excluding id var path = 'downloadfile.php?guid='; var url = path + zip_name + '&guids=' + files_to_zip; window.location= url; change_download_links( false, arr_guids, use_fc != null ); cleanup_all_fc_links(); } else { change_download_links( false, arr_guids, use_fc != null ); alert( emsg ); } neucart_dp_in_progress = false; } ); } function get_file_collection_items( order_guid, alink ) { if ( neucart_dp_in_progress ) return; neucart_dp_in_progress = true; var td = $( alink ).parent(); var files_to_zip = ''; $( td ).children( ".download_link" ).each( function( index ) { if ( files_to_zip.length > 0 ) files_to_zip += "|"; var guid = $(this).attr( 'id' ).substr( 5 ); files_to_zip += guid; } ); if ( files_to_zip == '' ) { neucart_dp_in_progress = false; // don't show anything. this shouldn't be possible because we hide it // after a user downloads stuff. $( alink ).hide(); return; } zip_files( order_guid, files_to_zip ); $( alink ).hide(); neucart_dp_in_progress = false; } function change_download_links( downloading, arr, collection_clicked ) { if ( downloading ) { if ( !collection_clicked ) $( "#neucart_wait_bar" ).show(); //zip $( "#download_as_zip a" ).hide();//zip $.each( arr, function( i, guid ){ $( "#link_" + guid ).hide(); $( "#wait_bar_" + guid ).show(); }); } else // done { $( "#download_as_zip a" ).show(); if ( !collection_clicked ) $( "#neucart_wait_bar" ).hide(); $.each( arr, function( i, guid ){ var fn = $( "#coll_id_" + guid ).html(); fn = fn == null ? '' : fn + ": "; var linkId = "#link_" + guid; $( linkId ).html( fn + neucart_dp_initiated ); $( linkId ).removeClass( "download_link" ); $( linkId ).show(); $( "#wait_bar_" + guid ).hide(); }); } } function nc_dl_check_all( ckd ) { if ( ckd ) $( ".nc_download_cb" ).slice( 0, neucart_zip_limit ).attr( "checked", ckd ); else // always unselect everything $( ".nc_download_cb" ).attr( "checked", ckd ); } function cleanup_one_fc_link( orig ) { if ( orig == null ) return; var td = $( orig ).parent(); var c = $( td ).children( ".download_link" ).length; if ( c == 0 ) $( td ).children( ".file_collection_link" ).hide(); } function cleanup_all_fc_links() { var fcls = $( ".file_collection_link" ); $.each( fcls, function( i, fcl ) { cleanup_one_fc_link( fcl ); }); } function download_product( prodGuid ) { if ( neucart_dp_in_progress ) return; var fn = $( "#coll_id_" + prodGuid ).html(); fn = fn == null ? '' : fn + ": "; var link = "#link_" + prodGuid; $( link ).html( '' ); $.get( "includes/ajax/getdownloads.php", { action: "getdownload", guid: prodGuid }, function( data ) { // no constants here. this is the only place. here are some return codes: // -1: guid parameter is empty // -2: no rows in result set // -3: root directory not set in database // -4: file doesn't exist. // -5: mkdir failed var emsg = ""; // all the errors here. switch( data ) { case "-1": emsg = neucart_dp_param_missing; break; case "-2": emsg = neucart_dp_no_file; break; case "-3": emsg = neucart_dp_no_root_dir; break; case "-4": emsg = neucart_dp_file_loc_missing; break; case "-5": emsg = neucart_dp_failed_create_url; break; case "0": // go below break; default: emsg = neucart_dp_general_error; break; } // no error? if ( data == "0" ) { $( link ).html( fn + neucart_dp_initiated ); // full path excluding id var path = 'downloadfile.php?guid='; var url = path + prodGuid; window.location= url; $( link ).removeClass( "download_link" ); cleanup_one_fc_link( link ); } else { $( link ).html( emsg ); } } ); } } /* FILE ARCHIVED ON 16:18:08 Oct 24, 2016 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 00:55:48 Nov 23, 2025. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /* playback timings (ms): captures_list: 0.68 exclusion.robots: 0.023 exclusion.robots.policy: 0.009 esindex: 0.012 cdx.remote: 7.986 LoadShardBlock: 106.71 (3) PetaboxLoader3.datanode: 141.765 (5) PetaboxLoader3.resolve: 611.987 (3) load_resource: 687.588 (2) */