function slug(str) { str = str.toLowerCase(); str = str.replace(/[^a-z0-9]+/g, '_'); str = str.replace(/^-|-$/g, ''); return str; } function loadPodcasts() { $("#podcasts").html(''); $.getJSON("https://api.soundcloud.com/playlists/?client_id=730d4377bcd3b1a38cebb106b1b16b92", function (data) { $.each(data.tracks, function (i, track) { artwork_url = track.artwork_url; comment_count = track.comment_count; created_at = track.created_at; download_count = track.download_count; favoritings_count = track.favoritings_count; playback_count = track.playback_count title = track.title; permalink = track.permalink; id = track.id; uri = track.uri; $('#podcasts').append('
'+title+'
') }); bindPodcast(); }); } function bindPodcast() { $('.podcast').click( function (e) { var podcast = this var uri = $(this).attr("data-href"); var scHeight = $(podcast).height()-20; console.log(scHeight); $('div.sc.thumbnail').show(); $('div.podcast>iframe').remove(); $('div.sc.thumbnail', this).hide(); var apiURL = "https://soundcloud.com/oembed?"; $.getJSON( apiURL, { url: uri, maxheight: scHeight, inverse: true, show_comments: false, hide_related: true, format: "json", auto_play: true }) .done(function( data ) { $(podcast).append(data.html); }); }); } function pageloaded(pagename) { $(window).load(function () { var activeSection = $("#main").data("section"); $('li.nav-'+activeSection).addClass('active'); try { window[pagename](); console.log(pagename); } catch(err) { // Handle error(s) here } }); } function podcasts() { loadPodcasts(); } function ticket() { $('.spinbox').spinbox({value:1, step: 1, min: 1, max: 12, hold: false }); $(".buyticket").click(function() { var tid = $(this).attr("id"); var qid = tid.replace('e','#s'); var tqty = $(qid).spinbox('value'); var event_id = $(this).attr('data-event-id'); if (tqty>0){ $.get("/core/dbr.core.cart.asp", { id: tid, event_id: event_id, qty: tqty }, function(data){ console.log(data); $("#basket").load("/core/dbr.core.basket.asp"); $("#basket").show(); }); }; }); } function gigs(){ events(); } function events() { $.getJSON("https://api.bandsintown.com/artists//events.json?api_version=2.0&app_id=DATABEATS&callback=?", function (data) { var html = ''; $.each(data, function (i, event) { var d = moment.utc(event.datetime); html += '
'; html += '
'; html += '
'; html += '
'; html += '
'; html += '' + d.format('MMMM') + ', '; html += '' + d.format('YYYY') + ''; html += '
'; html += '
'; html += '' + d.format('DD') + ''; html += '' + d.format('dddd HH:mm') + ''; html += '
'; html += '
'; html += '
'; html += '
'; html += '

' + event.title + '

'; if (event.artists.length > 1) { html += '

w/ '; for (var i = 1; i < event.artists.length; i++) { if (i > 1) html += ', '; html += event.artists[i].name; } html += '

'; } html += '

'; html += event.venue.name + '
'; html += event.formatted_location; html += '

'; html += 'RSVP'; html += '
'; html += '
'; html += '
'; }); $('#tour-dates').append(html); }); } function vieworders() { $('.btn-resend').click(function (e) { $resetbutton = $(this); var vpstxid = $(this).attr('data-txid'); e.preventDefault(); $resetbutton .text('EMAIL SENT'); $.get("/core/core.send.tickets.email.asp", { id: vpstxid }, function(data){ $resetbutton .removeClass('btn-resend').addClass('disabled') }); }); $('.btn-download').click(function (e) { var pid = $(this).attr('data-pid'); var cid = $(this).attr('data-order-id'); $downloadbutton = $(this); $(this).html(' PROCESSING'); $.post("/core/startziptxt.asp", { id: cid, pid: pid }); $.post("/core/checkziptxt.asp", { id: cid, pid: pid }); var refreshId = setInterval(function() { $.post("/core/checkziptxt.asp", { id: cid, pid: pid }, function(data){ if (data == "ZIP"){ clearInterval(refreshId); $($downloadbutton).hide().after('
DOWNLOADING
'); document.location.href='/core/streamziptxt.asp?id='+cid+'&pid='+pid; } }); }, 3000); return false; }); $('.btn-download-file').click(function (e) { $downloadbutton = $(this); var fid = $(this).attr('data-fid'); var tid = $(this).attr('data-tid'); var cid = $(this).attr('data-order-id'); var expanded = $(this).attr('data-expanded'); document.location.href='/core/streamfiletxt.asp?id='+cid+'&t='+tid+'&f='+fid+'&e='+expanded; $($downloadbutton).hide().after('
DOWNLOADING
'); return false; }); $('#modal-login').modal('show'); function removeDuplicateRows($table){ function getVisibleRowText($row){ return $row.find('td.compare').text().toLowerCase(); } $table.find('tr').each(function(index, row){ var $row = $(row); $row.nextAll('tr').each(function(index, next){ var $next = $(next); if(getVisibleRowText($next) == getVisibleRowText($row)) $next.remove(); }) }); } // removeDuplicateRows($('table#downloadvault')); var items = {}; $('#allstores div.panel-order').each(function() { items[$(this).attr('data-storename')] = true; }); var stores = new Array(); for(var i in items) { stores.push(i); } for(var i in stores) { $('').appendTo('#storesfilter'); } $('#storesfilter').on( 'change', function() { // get filter value from option value var filterstore = this.value; // use filterFn if matches value if (filterstore.trim() == "") { $('#allstores div.panel-order').show(); } else { $("#allstores div.panel-order").hide().filter('[data-storename="'+filterstore+'"]').show(); } }); // $('#downloadvault').DataTable({ // "columnDefs": [ // { // "targets": [ 0 ], // "visible": false, // "searchable": false // } // ] // ,"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]] // ,"order": [[ 0, "desc" ]] // ,"iDisplayLength": 50 // }); } function shipping() { $('#modal-login').modal('show'); } function billing() { $('#modal-login').modal('show'); } function search() { // $.getScript('https://static.databeats.com/js/jquery.highlight.js', function () { // $(".highlight").css({ backgroundColor: "#FFFF88" }); // var searchterm = $('.hero').data('query'); // $("body").highlight(searchterm); // }); if ($('#products-artwork .artwork-view').length > 12) { var lenRelease = $('#products-artwork .artwork-view').length-12; $('#products-artwork .artwork-view').each(function (index) { if (index > 11) { $(this).addClass('js-hidden').hide(); } }); $('#products-artwork').addClass('items-hidden').after(''); $('.btn-toggle-products').on('click', function () { if ($('#products-artwork').hasClass('items-hidden')) { $('#products-artwork .js-hidden').fadeIn(); $(this).html('Show less matching releases '); } else { $('#products-artwork .js-hidden').fadeOut(); $(this).html('Show all matching releases (' + lenRelease + ' more) '); } $('#products-artwork').toggleClass('items-hidden'); }); } if ($('#tracks-artwork tbody tr').length > 8) { var lenTracks = $('#tracks-artwork tbody tr').length-8; $('#tracks-artwork tbody tr').each(function (index) { if (index > 7) { $(this).addClass('js-hidden').hide(); } }); $('#tracks-artwork').addClass('items-hidden').after(''); $('.btn-toggle-tracks').on('click', function () { if ($('#tracks-artwork').hasClass('items-hidden')) { $('#tracks-artwork .js-hidden').fadeIn(); $(this).html('Show less matching tracks '); } else { $('#tracks-artwork .js-hidden').fadeOut(); $(this).html('Show all matching tracks (' + lenTracks + ' more) '); } $('#tracks-artwork').toggleClass('items-hidden'); }); } if ($('#news-artwork .artwork-view').length > 8) { var lenNews = $('#news-artwork .artwork-view').length-8; $('#news-artwork .artwork-view').each(function (index) { if (index > 7) { $(this).addClass('js-hidden').hide(); } }); $('#news-artwork').addClass('items-hidden').after(''); $('.btn-toggle-news').on('click', function () { if ($('#news-artwork').hasClass('items-hidden')) { $('#news-artwork .js-hidden').fadeIn(); $(this).html('Show less matching news '); } else { $('#news-artwork .js-hidden').fadeOut(); $(this).html('Show all matching news (' + lenNews + ' more) '); } $('#news-artwork').toggleClass('items-hidden'); }); } $('.search-results-collapse').on('hide.bs.collapse', function () { $(this).parent().find('.btn-toggle').html(''); }); $('.search-results-collapse').on('show.bs.collapse', function () { $(this).parent().find('.btn-toggle').html(''); }); } function music (){ var scwidget = SC.Widget('soundcloud-iframe'); var mcwidget = Mixcloud.PlayerWidget(document.getElementById('mixcloud-iframe')); scwidget.bind(SC.Widget.Events.READY, function () { scwidget.bind(SC.Widget.Events.PLAY, function () { mcwidget.pause(); }); }); mcwidget.ready.then(function () { mcwidget.events.play.on(mcPlayListener); console.log(mcwidget); }); function mcPlayListener() { scwidget.pause(); } } function news(){ FB.XFBML.parse(); } function dndex() { $("#home-releases .artwork-view").each(function() { var $this = $(this); $this.addClass("col-md-3 col-sm-4 col-xs-6"); $('.owl-carousel').addClass('disabled'); }); } function newsarchive(){ setBoxHeight(); $(window).resize(setBoxHeight); } function setBoxHeight() { $('.thumbnail-item-heading').height('auto'); var boxHeight = 0; $('.thumbnail-item-heading').each(function () { if ($(this).height() > boxHeight) { boxHeight = $(this).height(); } }); $('.thumbnail-item-heading').each(function () { if ($(this).height() < boxHeight) { $(this).height(boxHeight); } }); } function photos() { function loadPhotoset() { //$.getJSON("http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=a6c39a7814a851976120de7ca05d84be&photoset_id=&format=json&jsoncallback=?", $.getJSON("https://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=a6c39a7814a851976120de7ca05d84be&photoset_id=" + pid + "&format=json&jsoncallback=?", function (data) { var photosetID = ""; var title = ""; $('#photoset-heading').text('Photoset: ' + data.photoset.title); $.each(data.photoset.photo, function (i, photo) { photoid = photo.id; farm = photo.farm; server = photo.server; secret = photo.secret; phototitle = photo.title; /* title = set.title._content; */ thumb = 'http://farm' + farm + '.staticflickr.com/' + server + '/' + photoid + '_' + secret + '_n.jpg' largeimg = 'http://farm' + farm + '.staticflickr.com/' + server + '/' + photoid + '_' + secret + '_b.jpg' var img = new Image(); $(img).attr('src', thumb).addClass('imagegallery'); //$("#photosets").append(img); $("#photosets").append('
'); //$(img).wrap( //$('').attr('href', largeimg).wrap('
'+img+'
') //); }); $("a.lightbox").fancybox({ 'transitionIn': 'elastic', 'transitionOut': 'elastic', 'speedIn': 600, 'speedOut': 200, 'overlayShow': 'true', 'overlayColor': '#000', 'overlayOpacity': 0.65, 'showNavArrows': 'true' }); }); } var pid = ''; $(function () { $('.photoset').on("click", function () { var photosetID = $(this).attr('title'); url = '/photos/' + photosetID; document.location.href = url; return false; }); $.getJSON("https://api.flickr.com/services/rest/?method=flickr.photosets.getList&api_key=a6c39a7814a851976120de7ca05d84be&user_id=&format=json&jsoncallback=?", function (data) { var photosetID = ""; var title = ""; $.each(data.photosets.photoset, function (i, set) { photosetID = set.id; farm = set.farm; server = set.server; primary = set.primary; secret = set.secret; title = set.title._content; thumb = 'http://farm' + farm + '.static.flickr.com/' + server + '/' + primary + '_' + secret + '_m.jpg' url = '/photos/' + photosetID + "/" + title; $('
').appendTo('#albums').attr('title', photosetID + '-' + slug(title)).append('
' + title + '
'); }); pid = $("#photos").attr("data-photoset");; if (pid == '') { //pid = $('.photoset').first().data('set-id'); pid = data.photosets.photoset[0].id; } loadPhotoset(); }); }); } function product() { $(".owl-carousel").each(function() { var $this = $(this); if ($this.find('div.thumbnail-item').length > 1) { $this.owlCarousel({ loop: true, margin: 0, autoPlay: true, stopOnHover: true, nav : true, rewindNav : false, dots : false, slideBy : 'page', lazyLoad: true, navText : ['',''], navContainer : $this.parent().find(".owl-controls"), responsive: { 0: { items: 1, stagePadding: 15, }, 600: { items: 2 }, 1000: { items: 3 } } }); } else { $this.addClass("col-md-4 col-sm-4 col-xs-6").removeClass("owl-carousel"); $this.show(); } }); var maxHeight = 0; // assuming each div has a class of project $('div.artwork-view').each(function(){ if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } }); $('div.artwork-view').height(maxHeight); var fields = "?fields=share{comment_count},og_object{engagement}"; var access_token = "&access_token=176231275725915%7Ced7e7b678f5be6ae76b127a174bf5fce"; var metaurl = document.location.href; if ($(".btn-select-size input").length == 1) { $("input[name='product-sizes']").prop("checked",true).change(); $("input[name='product-sizes']").parent().addClass("active"); }; $( "table.product-formats" ).first().clone().appendTo( ".panel-tracklist .panel-footer" ); $("a.buytrack").on('click', function(e){ /* $(this).css("backgroundPosition", "-198px 0px"); */ $(this).html("In Cart").addClass('disabled'); $(this).parent().removeClass('button'); $(this).parent().addClass('incart-small'); $(this).prop('disabled', true); $.get("/scripts/v4/core/core.cart.asp", { id: $(this).attr("id") }, function(data) { $("#basket").show(); $("#basket").load("/scripts/v4/core/core.basket.asp"); }); e.preventDefault(); }); $("button.buyrelease").on('click', function(e){ $this = $(this); $(this).prop('disabled', true); product = $this.attr("data-product-id"); pid = $this.attr("id"); fid = $this.attr("data-format"); variation = product.split("x"); tid = variation[1]; $('.selected-stock[data-product-id="'+pid+'"]').html(' '); $("input[name='product-sizes']").prop("checked",false); $("input[name='product-sizes']").parent().removeClass("active"); $.get("/scripts/v4/core/core.cart.asp", { id: product, cartid: null }, function(data){ var datarray = data.split(","); if (datarray[1] == "FAIL") { $this.html("Out of stock").addClass('btn-nostock'); // humane.log("id: "+product+" NOT ADDED ", { timeout: 8000, waitForMove: true, clickToClose: true, addnCls: 'cart-add' }); } else { if (datarray[0]>0) { if( fid==1 ) { $this.html(" In your basket").addClass('incart'); } else if ( fid==4) { $this.html(" Select size"); } else { $this.prop('disabled',false); $this.html(" Add another?").addClass('btn-addmore'); }; // humane.log("format: " + fid + " . id: "+product+" . new stock: "+datarray[0]+" " +datarray[1], { timeout: 8000, waitForMove: true, clickToClose: true, addnCls: 'cart-add' }); } else { // humane.log("id: "+product+" . new stock: "+datarray[0]+" " +datarray[1], { timeout: 8000, waitForMove: true, clickToClose: true, addnCls: 'cart-add' }); if ( fid==4) { $this.html(" Select size"); $('input#s'+tid).parent().remove(); } else { $this.prop('disabled',true); $this.html("Out of stock").addClass('btn-nostock'); }; }; }; $("#basket").show(); $("#basket").load("/scripts/v4/core/core.basket.asp"); }); e.preventDefault(); }); $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { // newly activated tab FB.XFBML.parse(); }) if ($("#comments").hasClass('in')) { // newly activated tab FB.XFBML.parse(); }; $(".panel-tracklist .panel-footer table tr.download").hide(); $('td.buy.MP3').show().removeClass('hide'); $('tr.MP3').show(); $('.format-toggle').each(function () { if ($(this).parent().hasClass('active')) { var formatClass = $(this).data('format'); $(formatClass).show(); } }); $('.format-toggle').click(function (e) { e.preventDefault(); var formatClass = $(this).data('format'); $('td.price,td.buy').hide().removeClass('hide'); $(".panel-tracklist .panel-footer table tr").hide(); $(formatClass).show(); $('.format-toggle').parent().removeClass('active'); $(this).parent().addClass('active'); }); $("a.jp-button").on("click",function(e) { e.preventDefault(); var track = $(this).closest("td.icon").data("sample"); var id = $(this).closest('tr').attr('id'); // table row ID if ($(this).hasClass('jp-play')) { playSample(track, id); $("a.jp-button").addClass('jp-play').removeClass('jp-pause'); $(this).removeClass('jp-play').addClass('jp-pause') } else if ($(this).hasClass('jp-pause')) { $("#jquery_jplayer_audio_1").jPlayer("destroy"); $(this).addClass('jp-play').removeClass('jp-pause'); }; }); function playSample(track,id){ $("#jquery_jplayer_audio_1").jPlayer("destroy"); $("#jquery_jplayer_audio_1").jPlayer( { ready: function () { $(this).jPlayer("setMedia", { mp3: track }).jPlayer("play"); // Attempts to Auto-Play the media }, cssSelectorAncestor: '.'+id, supplied: "mp3", swfPath: "/custom/js" }); } $('.minibuy').hide(); $(".tracks").hide(); $("#tracks").show(); $(".toggleformat").click(function () { var trackformat = $(this).attr("alt"); $(".tracks").hide(); $("#"+trackformat+"tracks").show(); $.get("/core/set-format-session.asp", { format: trackformat }) return false; }); MagicZoomPlus.refresh(); MagicZoomPlus.options = { 'onready': function(id, isUpdated) { console.log('Zoom is ready'); } }; } function products() { var $container = $('#products-artwork'); $('div.mix').height('auto'); $('div.mix'+mixFilter).show(); var maxHeight = 0; // assuming each div has a class of project $('div.mix').each(function(){ if ($(this).height() > maxHeight) { maxHeight = $(this).height(); console.log($(this).data('title') + ' - '+ $(this).height()); } }); $('div.mix').height(maxHeight); $('.btn-list-view').click(function(event){ event.preventDefault(); $('.btn-toggle-all-tracks').removeClass("hidden"); $('#products-artwork .product').removeClass('artwork-view col-md-4 col-sm-4 mix').addClass('list-view col-xs-12 mix'); $('div.mix').height('auto'); }); $('.btn-grid-view').click(function(event){ event.preventDefault(); $('.product-tracklist').each(function() { $(this).collapse('hide'); }); $('.product-controls').each(function() { $(this).hide(); }); $('.btn-toggle-all-tracks').addClass("hidden"); $('#products-artwork .product').removeClass('list-view col-xs-12 mix').addClass('artwork-view col-md-4 col-sm-4 mix'); $('div.mix').height('auto'); var maxHeight = 0; // assuming each div has a class of project $('div.mix').each(function(){ if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } }); $('div.mix').height(maxHeight); }); $('.btn-toggle-all-tracks').click(function(event){ event.preventDefault(); $(this).toggleClass('in'); if ($(this).hasClass('in')){ $(this).button('expand'); } else { $(this).button('reset'); }; $('.product-tracklist').each(function() { $(this).collapse('toggle'); }); }); $('.product-tracklist').on('hidden.bs.collapse', function(){ togglebutton = $(this).parent().find(".btn-toggletrack"); $(togglebutton).button("reset"); $(this).parent().find(".product-controls").toggleClass("hidden"); } ); $('.product-tracklist').on('shown.bs.collapse',function(){ togglebutton = $(this).parent().find(".btn-toggletrack"); $(togglebutton).button("expand"); $(this).parent().find(".product-controls").toggleClass("hidden"); }); } function databeats() { $('.owl-carousel').filter(function (index) { return $(this).children().length < 1; }).parent().remove(); $('hr').each(function() { while($(this).prop('tagName') == $(this).next().prop('tagName')) $(this).next().remove(); }); $(".thumbs .owl-carousel").each(function() { var $this = $(this); if ($this.find('div.thumbnail-item-small').length > 1) { $this.owlCarousel({ loop: true, margin: 0, autoPlay: true, stopOnHover: true, nav : true, rewindNav : false, dots : false, lazyLoad: true, slideBy: 'page', navText : ['',''], navContainer : $this.parent().find(".owl-controls"), responsive: { 0: { items: 1 }, 600: { items: 3 }, 1000: { items: 3, stagePadding: 0 } } }); } else { $this.show(); } }); $(".thumbs .owl-carousel").each(function() { var $this = $(this); if ($this.find('div.tall-thumbnail-item').length > 1) { $this.owlCarousel({ loop: true, margin: 0, autoPlay: true, stopOnHover: true, nav : true, rewindNav : false, dots : false, lazyLoad: true, slideBy: 'page', navText : ['',''], navContainer : $this.parent().find(".owl-controls"), responsive: { 0: { items: 2, stagePadding: 15, }, 600: { items: 4, }, 1000: { items: 6, } } }); } else { $this.show(); } }); $(".artwork .owl-carousel").each(function() { var $this = $(this); if ($this.find('div.artwork-view').length > 1) { $this.owlCarousel({ loop: true, margin: 0, autoPlay: true, stopOnHover: true, nav : true, rewindNav : false, dots : false, lazyLoad: true, slideBy: 'page', navText : ['',''], navContainer : $this.parent().find(".owl-controls"), responsive: { 0: { items: 1 }, 600: { items: 3 }, 1000: { items: 3 } } }); // Custom Navigation Events } else { $this.addClass("col-md-4 col-sm-6 col-xs-12").removeClass("owl-carousel"); $this.show(); } }); $(".events .owl-carousel").each(function() { var $this = $(this); if ($this.find('div.events-list-item').length > 1) { $this.owlCarousel({ loop: true, margin: 0, autoPlay: true, stopOnHover: true, nav : true, rewindNav : false, dots : false, navText : ['',''], navContainer : $this.parent().find(".owl-controls"), responsive: { 0: { items: 1 }, 600: { items: 1 }, 1000: { items: 1 } } }); // Custom Navigation Events } else { $this.show(); } }); $(".featured .owl-carousel").each(function() { var $this = $(this); if ($this.find('div.featured-item').length > 1) { $this.owlCarousel({ loop: true, margin: 0, autoPlay: true, stopOnHover: true, nav : true, rewindNav : false, dots : false, navText : ['',''], navContainer : $this.parent().find(".owl-controls"), responsive: { 0: { items: 1 }, 600: { items: 1 }, 1000: { items: 1 } } }); // Custom Navigation Events } else { $this.show(); } }); } function checkout() { $("#remove-voucher").click(function(e) { $.get("/core/core.voucher.remove.asp", function(data){ window.location.href = '/checkout' }) }); $("#btn-voucherapply").click(function(e) { e.preventDefault() var vouchercode = $("input#voucher-code").val().toUpperCase(); $.get("/scripts/v4/core/core.apply.voucher.asp", { id: vouchercode, c: null}, function(data){ if (data != "1"){ $('input#voucher-code').val('invalid code') e.preventDefault() } else { window.location.href = '/checkout' } }); }); $(".paypal").hide(); $(".creditcard").show(); $(".payment_type").live('click', function() { if($(this).val()==="paypal"){ $(".paypal").show(); $(".creditcard").hide(); } else { $(".paypal").hide(); $(".creditcard").show(); } }); } function resetpassword (){ $("#update-password").on('click', function(e){ var cid = $(this).attr('data-cid'); var cpassword = $('#new-password').val(); var eid = $(this).attr('data-eid'); $.post("/core/dbr.core.update.password.asp",{ cid: cid, cpassword: cpassword, id: eid }, function(data) { if (data != "0") { console.log('updated'); window.location.href = '/vieworders'; } }); return false; }); } function contact () { $(function () { $("#contact-form").validate( { highlight: function(label) { $(label).closest('.form-group').addClass('has-error'); }, success: function(label) { label.closest('.form-group').removeClass('has-error'); } }); // Post form $("#contact-form").submit(function (event) { if (!$("#contact-form").valid()) { return false; } // prevent default posting of form event.preventDefault(); // setup some local variables var $form = $(this), // let's select and cache all the fields $inputs = $form.find("input, select, button, textarea"), // serialize the data in the form serializedData = $form.serialize(); // let's disable the inputs for the duration of the ajax request $inputs.attr("disabled", "disabled"); // fire off the request to /form.php $.ajax({ url: "/scripts/v4/core/form.contact.asp", type: "post", data: serializedData, // callback handler that will be called on success success: function (response, textStatus, jqXHR) { // log a message to the console $.get("/scripts/v4/core/form.success.htm", function (data) { $("#contact-form").fadeOut('normal', function () { $('#result').append(data).fadeIn('normal'); }); }); //$('#form-container').load('success.htm'); console.log("Hooray, it worked!"); console.log(response); console.log(textStatus); console.log(jqXHR); }, // callback handler that will be called on error error: function (jqXHR, textStatus, errorThrown) { // log the error to the console $.get("/scripts/v4/core/form.error.htm", function (data) { $("#contact-form").fadeOut('normal', function () { $('#result').append(data).fadeIn('normal', function () { $('#retry').click(function (e) { e.preventDefault(); $('#result').fadeOut('normal', function () { $('#result').html(''); $('#contact-form').fadeIn(); }); }); }); }); }); console.log("The following error occured: " + textStatus, errorThrown); }, // callback handler that will be called on completion // which means, either on success or error complete: function () { // enable the inputs $inputs.removeAttr("disabled"); } }); }); }); } function account () { $('.minibuy').hide(); $(".tracks").hide(); $("#tracks").show(); $(".toggleformat").click(function () { var trackformat = $(this).attr("alt"); $(".tracks").hide(); $("#"+trackformat+"tracks").show(); $.get("/core/set-format-session.asp", { format: trackformat }) return false; }); // $(document).bind('soundcloud:onPlayerReady', function(event, data) // { // $('#soundcloud-display').css( "height","385" ); // $('.product-img-display').hide(); // }); $('.action-button ').click(function (e) { e.preventDefault(); var od = $(this).attr('alt'); var actionhref = $(this).attr('href'); if (actionhref != "#") { $('#orderactions').remove(); $('.hiddenorder').show(); $('#'+od).addClass('hiddenorder').hide().after('
loading ...
'); $('#orderactions').load(actionhref); $('html,body').animate({ scrollTop: ($("#orderactions").offset().top-15)},'slow'); } }); $('.action-view-files ').click(function (e) { e.preventDefault(); var od = $(this).attr('alt'); var actionhref = $(this).attr('href'); if (actionhref != "#") { $('#orderactions').remove(); $('.hiddenorder').show(); $('#'+od).addClass('hiddenorder').hide().after('
loading ...
'); $('#orderactions').load(actionhref); $('html,body').animate({ scrollTop: ($("#orderactions").offset().top-15)},'slow'); } }); $('a.closeme').click(function (e) { e.preventDefault(); orderdetails = $(this).attr('href'); $('.hiddenorder').show(); $('#orderactions').remove(); }); $('a.print').click(function (e) { $( "#ticketdetails" ).print(); return( false ); }); $('a.email-ticket').click(function (e) { e.preventDefault(); var vpstxid = $(this).attr('alt') $.get("/core/core.send.tickets.email.asp", { id: vpstxid }, function(data){ $('a.email-ticket').text('EMAIL SENT'); $('a.email-ticket').removeClass('email-ticket').addClass('disabled') }); }); $('.download').click(function (e) { var pid = $(this).attr('data-pid') var cid = $(this).attr('data-order-id') $downloadbutton = $(this) $(this).text(' PROCESSING'); $.post("/core/startzip.asp", { id: cid, pid: pid }); $.post("/core/checkziptxt.asp", { id: cid, pid: pid }); var refreshId = setInterval(function() { $.post("/core/checkziptxt.asp", { id: cid, pid: pid }, function(data){ if (data == "ZIP"){ clearInterval(refreshId); $($downloadbutton).text('  DOWNLOADING').removeClass("btn-primary").addClass('btn-success'); document.location.href='/core/streamzip.asp?id='+cid+'&pid='+pid; } }); }, 3000); return false; }); $('.file').click(function (e) { var fid = $(this).attr('alt') var tid = $(this).attr('title') var cid = $(this).attr('rel') document.location.href='/core/streamfile.asp?id='+cid+'&t='+tid+'&f='+fid; $(this).text(' DOWNLOADING').removeClass("btn-primary").addClass('btn-success'); return false; }); $('.expandzip').click(function (e) { var fid = $(this).attr('alt') var tid = $(this).attr('title') var cid = $(this).attr('rel') document.location.href='/core/streamfile.asp?id='+cid+'&t='+tid+'&f='+fid+'&e=true'; $(this).text(' DOWNLOADING').removeClass("btn-primary").addClass('btn-success'); return false; }); } function showMoreCheck(button) { $(button).collapse().show(); var element = $(button).attr('data-target'); var saved = $(element).css(['top', 'overflow', 'height']); $(element).css({ top : 0, height : 0, overflow : 'scroll' }); var actualHeight = $(element).prop('scrollHeight'); var heightcheck = (actualHeight>saved['height'].replace(/[^-\d\.]/g, '')); $(element).css(saved); if (heightcheck) { $(button).hide() }; return heightcheck; } function tv(){ var addthis_config = addthis_config||{}; addthis_config.pubid = 'ra-543bb2be6668f85e'; $.getScript( "https://s7.addthis.com/js/300/addthis_widget.js#domready=1") .done(function( script, textStatus ) { if(addthis.layers && typeof addthis.layers.refresh === 'function'){ addthis.layers.refresh(); } }) .fail(function( jqxhr, settings, exception ) { consold.log(exception); }); $("#yt-toggle-more").on("click", function(){ $(this).text($(this).text() == "Show more" ? "Show less" : "Show more"); }); var y_tube = $("#playlist").youtube_video({ playlist: 'false', channel: 'false', user: 'false', videos: false, api_key: 'AIzaSyDYjq8C-J3AWzTWv-nLZll-rkMkV5a7PtE', max_results: 10, pagination: true, continuous: true, first_video: 0, show_playlist: 'auto', playlist_type: 'vertical', show_channel_in_playlist:false, show_channel_in_title: false, width: false, show_annotations: false, now_playing_text: 'Now Playing', load_more_text: 'Load More', autoplay: false, force_hd: false, hide_youtube_logo: false, play_control: true, time_indicator: 'full', volume_control: true, share_control: false, fwd_bck_control: true, youtube_link_control: true, fullscreen_control: true, playlist_toggle_control:true, volume: false, show_controls_on_load: true, show_controls_on_pause: true, show_controls_on_play: true, player_vars: {}, colors: { 'controls_bg': 'rgba(0, 0, 0, 0.6)', 'playlist_overlay': 'rgba(0, 0, 0, 0.6)', 'load_more_bg': 'rgba(0, 0, 0, 0.6)' }, on_done_loading: function(items) { var videolist = [], extra_stats = []; var videos = items; for (var i in videos) { videolist[i] = videos[i].snippet.resourceId.videoId; } // i is the index/key, not the item var stats_list = videolist.join(); var staturl = 'https://www.googleapis.com/youtube/v3/videos?part=snippet%2C+statistics%2C+contentDetails&id='+stats_list+'&fields=items(id%2Csnippet(title%2CpublishedAt)%2Cstatistics(viewCount,likeCount,dislikeCount,commentCount)%2CcontentDetails(duration))&maxResults=10&key=AIzaSyAGzsds5MsbqG9Z10uhfkh0yVf9Rv9IO38&'; $.getJSON(staturl, function(yt) { for (var i in yt.items) { extra_stats[i] = yt.items[i]; } var playlist_divs = $('.yesp-playlist>.yesp-playlist-video').each( function( index, element ){ $(this).data("statistics", extra_stats[index].statistics ); var publishedAt = extra_stats[index].snippet.publishedAt; var viewCount = extra_stats[index].statistics.viewCount; var likeCount = extra_stats[index].statistics.likeCount; var dislikeCount = extra_stats[index].statistics.dislikeCount; var commentCount = extra_stats[index].statistics.commentCount; var duration = extra_stats[index].contentDetails.duration; var overlord = $(element).find("div.yesp-playlist-title").append('

 '+viewCount+' views'); }); }); },on_load: function(video) { var stats = $("div").find('div.yesp-playlist-video[data-index="'+video.position+'"]').data("statistics"); var videoId = video.resourceId.videoId; var title = video.title; var description = video.description; var publishedAt = moment(video.publishedAt).format('LL'); var viewCount = stats.viewCount; var likeCount = stats.likeCount; var dislikeCount = stats.dislikeCount; var commentCount = stats.commentCount; var eventUrl = '/videos/'+videoId var sharingUrl = document.location.protocol+'//'+document.domain+eventUrl; history.pushState(videoId, video, eventUrl); $('div#yt-subscribe').hide(); $('#addthis-sharing').attr('data-url',sharingUrl).attr('data-title',title); $('#yt-fb-comments').attr('data-href',sharingUrl); if(addthis.layers && typeof addthis.layers.refresh === 'function'){ addthis.layers.refresh(); }; try{ FB.XFBML.parse(); }catch(ex){}; $('#yt-video-title').html(title ); $('#yt-view-count').html( viewCount + ' Views' ); $('#yt-video-like').html( likeCount ); $('#yt-video-dislike').html( dislikeCount ); $('#yt-video-description').html( description ); showMoreCheck('#yt-toggle-more'); $('#yt-video-published').html( 'Published on ' + publishedAt ); $('[data-toggle="tooltip"]').tooltip(); } }); }