/*
window.onload = function() {
if (window.jQuery) {
// jQuery is loaded
alert("Yeah!");
} else {
// jQuery is not loaded
alert("Doesn't Work");
}
}
*/
//if (dhtml.external && dhtml.external.resize) dhtml.external.resize ('100%', '100%');
/*
$(document).on('click', '.showmore', function () {
$(this).text(function(_, txt) {
return txt == '- toon minder -' ? '- lees meer -' : '- toon minder -';
}).siblings('.complete').toggle("fast");
});
*/
$(document).ready(function() {
$(".complete").hide();
$(".showmore").on("click", function() {
var txt = $(this).prev(".complete").is(':visible') ? 'lees meer' : 'toon minder';
$(this).text(txt);
$(this).prev('.complete').slideToggle(100);
});
});
/* =================================== */
/* Index */
/* =================================== */
$(function() {
$('body').on('click', '.more', function (){
var ID = $(this).attr("id");
if(ID) {
$("#more"+ID).html('
');
$.ajax({
type: "POST",
url: "/index/swk_covers_more.inc.php",
data: "lastmsg="+ ID,
cache: false,
success: function(html){
$(".content_double").append(html);
$("#more"+ID).remove();
},
});
}
return false;
});
});
/* =================================== */
/* Videos */
/* =================================== */
$(function() {
$('body').on('click', '.moreVid', function (){
var ID = $(this).attr("id");
if(ID) {
$("#more"+ID).html('
');
$.ajax({
type: "POST",
url: "/videos/videos_more.inc.php",
data: "lastmsg="+ ID,
cache: false,
success: function(html){
$(".content_moreVids").append(html);
$("#more"+ID).remove();
},
});
}
return false;
});
});
$(document).ready(function() {
$('.img-gallery').magnificPopup({
delegate: 'a',
type: 'image',
closeOnContentClick: false,
closeBtnInside: false,
mainClass: 'mfp-with-zoom mfp-img-mobile',
image: {
verticalFit: true,
titleSrc: function(item) {
return item.el.attr('title');
/* + ' · image source' */
}
},
gallery: {
enabled: true
},
zoom: {
enabled: true,
duration: 300, // don't foget to change the duration also in CSS
opener: function(element) {
return element.find('img');
}
}
});
});
/* =================================== */
/* Nieuwsbrief submit */
/* =================================== */
$(function() {
$('body').on('click', '#email_nwsbrf', function (){
});
});
$('input[id=email_nwsbrf]').each(function() {
var searchtxt = $("input#searchnav").val();
$("input[id=email_nwsbrf], input[id=email_nwsbrf_ss]").css("color","#CCC");
var default_value = this.value;
$("input[id=email_nwsbrf],input[id=email_nwsbrf_ss]").click(function() {
$("input[id=email_nwsbrf],input[id=email_nwsbrf_ss]").css("color","#333");
if(this.value == default_value) { this.value = ''; }
$('#submithidden').show('slow');
$('.regerrNwsbrf').hide();
});
});
$(document).on('click', '.submitNwsbrf', function () {
$('.regerrNwsbrf').hide();
var hasError = hasError;
var email = $(".email_nwsbrf").val();
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
var emailaddressVal = $(".email_nwsbrf").val();
if(emailaddressVal == '') {
hasError = true;
$(".nwsbrferror").html('
Dit is een verplicht veld.
');
}
else if(!emailReg.test(emailaddressVal)) {
hasError = true;
$(".nwsbrferror").html('Dit is geen geldig email adres.
');
}
if (hasError == undefined) {
var dataString = 'email='+ email;
$.ajax({
type: "POST",
url: "/include/process/ins.nieuwsbrief.php",
data: dataString,
success: function (data) {
if(data == 1) { $(".nwsbrferror").html('Hartelijk dank voor jouw inschrijving!'); $(".email_nwsbrf").val(''); }
if(data == 2) { $(".nwsbrferror").html('Je bent aangemeld voor de nieuwsbrief.'); $(".email_nwsbrf").val(''); }
if(data == 3) { $(".nwsbrferror").html('De aanmelding is niet gelukt.'); }
},
error : function(data) { //alert(data);
$(".nwsbrferror").html('De aanmelding is niet gelukt. Probeer het nog een keer of neem contact met ons op.'); }
});
}
});
/* small side reg nwsltter */
$(document).on('click', '.submitNwsbrf_ss', function () {
$('.regerrNwsbrf').hide();
var hasError = hasError;
var email = $(".email_nwsbrf_ss").val();
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
var emailaddressVal = $(".email_nwsbrf_ss").val();
if(emailaddressVal == '') {
hasError = true;
$(".nwsbrferror_ss").html('Dit is een verplicht veld.
');
}
else if(!emailReg.test(emailaddressVal)) {
hasError = true;
$(".nwsbrferror_ss").html('Dit is geen geldig email adres.
');
}
if (hasError == undefined) {
var dataString = 'email='+ email;
$.ajax({
type: "POST",
url: "/include/process/ins.nieuwsbrief.php",
data: dataString,
success: function (data) {
if(data == 1) { $(".nwsbrferror_ss").html('Hartelijk dank voor jouw inschrijving!'); $(".email_nwsbrf_ss").val(''); }
if(data == 2) { $(".nwsbrferror_ss").html('Je bent aangemeld voor de nieuwsbrief.'); $(".email_nwsbrf_ss").val(''); }
if(data == 3) { $(".nwsbrferror_ss").html('De aanmelding is niet gelukt.'); }
},
error : function(data) { //alert(data);
$(".nwsbrferror_ss").html('De aanmelding is niet gelukt. Probeer het nog een keer of neem contact met ons op.'); }
});
}
});
$('input[id=unemail_nwsbrf]').each(function() {
var searchtxt = $("input#searchnav").val();
$("input[id=unemail_nwsbrf]").css("color","#CCC");
var default_value = this.value;
$("input[id=unemail_nwsbrf]").click(function() {
$("input[id=unemail_nwsbrf]").css("color","#333");
if(this.value == default_value) { this.value = ''; }
$('#unsubmithidden').show('slow');
$('.regerrNwsbrf').hide();
});
});
$(document).on('click', '.unsubmitNwsbrf', function () {
$('.unregerrNwsbrf').hide();
var hasError = hasError;
var email = $("#unemail_nwsbrf").val();
var codec = $("#unemail_nwsbrf").attr("data");
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
var emailaddressVal = $("#unemail_nwsbrf").val();
if(emailaddressVal == '') {
hasError = true;
$(".unsubscribe").html(' Dit is een verplicht veld.
');
}
else if(!emailReg.test(emailaddressVal)) {
hasError = true;
$(".unsubscribe").html(' Dit is geen geldig email adres.
');
}
if (hasError == undefined) {
var dataString = 'email='+ email + '&codec=' + codec;
$.ajax({
type: "POST",
url: "/include/process/ins.nieuwsbrief_out.php",
data: dataString,
success: function (data) {
if(data == 1) {
$(".ga_content").hide();
$(".unsubscribe").html('Je bent uitgeschreven van de nieuwsbrief.');
}
if(data == 2) {
$(".unsubscribe").html('De afmelding is niet gelukt.');
}
},
error : function(data) { $(".unsubscribe").html('De afmelding is niet gelukt. Probeer het nog een keer of neem contact op met ons.'); }
});
}
});
/* =================================== */
/* SEARCH AREAS */
/* =================================== */
$(function() {
$('body').on('click', '.search_mobile', function (){
$("#search_mobile_toggle").toggle();
});
});
$('#csubmit').click(function(e) {
e.preventDefault();
var searchtxt = $(".regZkn").val();
//alert(searchtxt);
var dataString = 'search='+ searchtxt;
$.ajax({
type: "GET",
url: "/nieuws/zoeken.php",
data: dataString,
success: function(){
window.location.href = '/nieuws/zoeken.php?search='+searchtxt+'';
if(data == 1) {
}
if(data == 2) { //alert('errrrrrrrrrror');
}
},
error : function(data) { }
});
});
$('input.regZkn').keypress(function (e) {
$(".regZkn").css("color","#333");
var searchtxt = $("input.regZkn").val();
if (e.which == 13) {
var dataString = 'search='+ searchtxt;
$.ajax({
type: "GET",
url: "/nieuws/zoeken.php",
data: dataString,
success: function(){
window.location.href = '/nieuws/zoeken.php?search='+searchtxt+'';
if(data == 1) {
}
if(data == 2) { //alert('errrrrrrrrrror');
}
},
error : function(data) { }
});
}
});
$('#csubmit_vidz').click(function(e) {
e.preventDefault();
var searchtxt = $(".regZknVid").val();
var dataString = 'search='+ searchtxt;
$.ajax({
type: "GET",
url: "/videos/zoeken.php",
data: dataString,
success: function(){
window.location.href = '/videos/zoeken.php?search='+searchtxt+'';
if(data == 1) {
}
if(data == 2) { //alert('errrrrrrrrrror');
}
},
error : function(data) {
}
});
});
$('input.regZknVid').keypress(function (e) {
$(".regZknVid").css("color","#333");
var searchtxt = $(".regZknVid").val();
if (e.which == 13) {
var dataString = 'search='+ searchtxt;
$.ajax({
type: "GET",
url: "/videos/zoeken.php",
data: dataString,
success: function(){
window.location.href = '/videos/zoeken.php?search='+searchtxt+'';
if(data == 1) {
}
if(data == 2) { //alert('errrrrrrrrrror');
}
},
error : function(data) { }
});
}
});
$('#csubmit_ndx').click(function(e) {
e.preventDefault();
var searchtxt = $(".regZknIndx").val();
var dataString = 'search='+ searchtxt;
$.ajax({
type: "GET",
url: "/index/zoeken.php",
data: dataString,
success: function(){
window.location.href = '/index/zoeken.php?search='+searchtxt+'';
if(data == 1) {
}
if(data == 2) { //alert('errrrrrrrrrror');
}
},
error : function(data) {
}
});
});
$('input.regZknIndx').keypress(function (e) {
$(".regZknIndx").css("color","#333");
var searchtxt = $(".regZknIndx").val();
if (e.which == 13) {
var dataString = 'search='+ searchtxt;
$.ajax({
type: "GET",
url: "/index/zoeken.php",
data: dataString,
success: function(){
window.location.href = '/index/zoeken.php?search='+searchtxt+'';
if(data == 1) {
}
if(data == 2) { //alert('errrrrrrrrrror');
}
},
error : function(data) { }
});
}
});
/* =================================== */
/* COUNTERS */
/* =================================== */
if($('.pageCnt').length > 0) {
var cntData = $(".pageCnt").attr('id');
var dataString = 'cntData='+ cntData;
$.ajax({
type: "POST",
url: '/include/process/ins.news_visits.php',
data: dataString,
success : function(data) {
// alert(data);
},
error : function(data) {
// alert(data);
}
});
}
/* =================================== */
/* LEADERBOARD FIXES */
/* =================================== */
$(document).ready(function () {
var img = $('.mydiv').contents().find('img').addClass('img-fluid');
});
/* =================================== */
/* GIVEAWAY */
/* =================================== */
$(document).on('click', '.gas_button', function () {
var topic = $(".gas_button").attr("title");
window.location.href = "mailto:info@slagwerkkrant.nl?subject="+topic+"&body=(Let op: vermeld naast je antwoord ook je adresgegevens en telefoonnummer.)";
});
$('.vid_main').bind('contextmenu',function() { return false; });
$('input').not('.poll_option, .poll_reg').focus(function() {
if (!$(this).data("DefaultText")) $(this).data("DefaultText", $(this).val());
if ($(this).val() != "" && $(this).val() == $(this).data("DefaultText")) $(this).val("");
}).blur(function(){
if ($(this).val() == "") $(this).val($(this).data("DefaultText"));
});
/* blogs */
$('.blogger_inf').live("click",function(e) {
/* $('.content_mid').animate({'opacity': '0.2'}, '50');*/
var blogID = $(this).attr("id");
/*alert(blogID);*/
var blogID = '#' + blogID + '-content';
$(blogID).show('slow');
$(".nbm").animate({'opacity': '0.2'}, '50');
/* $('.content_mid').animate({ 'opacity': '0.2' }, function() {
$(blogID).show('fast');
});*/
e.preventDefault();
});
/* show artist pops */
$(".nam_block").click(function() {
$(".nam_info").hide();
var box = $(this).attr('id');
var boxid = '#' + box + '-content';
$(boxid).show('slow');
});
$('html:not(.nam_info, .nam_block, .blogger_inf)').on('click',function() {
$(".nam_info, .blogger_info").slideUp();
$("#submithidden").hide('fast');
$('.nbm').animate({'opacity': '1'}, 'slow');
});
$(".nam_info, .nam_block, .blogger_info, #email_nwsbrf").click(function(event) { event.stopPropagation(); });
/* videos
$(document).on('click', '.showmore', function() {
//alert('afads');
$(this).text(function(_, txt) {
return txt == '- toon minder -' ? '- lees meer -' : '- toon minder -';
}).siblings('.complete').toggle("fast");
});
*/
/* poll */
$(document).ready(function() {
if ($('#pollform').length){
$('input[type="submit"]').attr('disabled','disabled');
}
});
$(function() {
/* $('#poll_submit').live("click",function() {*/
$("form#pollform :input").change(function() {
$(".pollerror").html('');
$("#p_voornaam, #p_achternaam, #p_email,#p_code").css('background-color','white');
var hasError = hasError;
var captcha_code = $("#captcha_code").val();
var numberOfCheckedRadio = $('input:radio:checked').length;
var totalCheckboxes = $('input:radio').length;
var numberNotChecked = totalCheckboxes - numberOfCheckedRadio;
var typedTextBox = $("input.poll_option:text:not([value=''])").length;
/* alert(typedTextBox); */
var total = typedTextBox + numberOfCheckedRadio;
if(total < 6) {
hasError = true;
$('.pollerror').html('Vul tenminste zes secties in.');
}
/*alert($("input.poll_option:text").length);*/
var voornaam = $("#voornaam").val();
var achternaam = $("#achternaam").val();
var email = $("#email").val();
if(voornaam == '') { hasError = true; $("#p_voornaam").css('background-color','yellow'); }
if(achternaam == '') { hasError = true; $("#p_achternaam").css('background-color','yellow'); }
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
var emailaddressVal = $("#email").val();
if(emailaddressVal == '') {
hasError = true;
$("#p_email").css('background-color','yellow');
}
if(!emailReg.test(emailaddressVal)) {
hasError = true;
$("#p_email").css('background-color','yellow');
}
if($('#enterVerify').val() == $('#verifyNumHidden').val() ) { }
else {
hasError = true;
$("#p_code").css('background-color','yellow');
randomgen();
$('input[type="submit"]').attr('disabled','disabled');
}
if (hasError == undefined) {
/*alert('OK! ' + hasError);*/
$('input[type="submit"]').removeAttr('disabled');
}
});
});
function randomgen() {
var rannumber='';
for(ranNum=1; ranNum<=6; ranNum++){
rannumber+=Math.floor(Math.random()*10).toString();
}
$('#verifyNum').html(rannumber);
$('#verifyNumHidden').val(rannumber);
}
randomgen();
$('div.artistSelect').on('click', function() {
var string = $(this).attr('id');
string = string.split('-'); var artistName = string[0]; var id1 = string[1]; var id2 = string[2];
$('#'+id1+'-'+id2).val(artistName);
comments.val(comments.val() + $(this).attr('title'));
});