').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();
}
});
}