1//ian 2//var $volume = Modernizr.touch ? 6 : 4; 3var myPhotoSwipe = null; 4var openPage = null; 5 6function volumeButtonHover() { 7 8 /*if ($("html").hasClass("touch")){ 9 $('a.volume').click(function (e) { 10 if ($volume > 0) { 11 $volume = 0; 12 } else { 13 $volume = 6; 14 } 15 $(".volume").removeClass('step_1 step_2 step_3 step_4 step_5 step_6'); 16 $(".volume").addClass("step_" + $volume); 17 bbs.setVolume($volume); 18 e.preventDefault(); 19 //$("#amount").val($("#slider-vertical").slider("value")); 20 }); 21 } else { 22 var using = false; 23 $('a.volume').click( 24 function () { 25 $("#slider-container").toggle(); 26 } 27 ); 28 }*/ 29 30 $("#slider-container").mouseenter(function () { 31 using = true; 32 }); 33 34 $('#slider-container').mouseleave(function () { 35 //if (!using) { 36 // $("#slider-container").hide(); 37 // } 38 }); 39 40 41 42 43 $("#slider-container").mouseleave(function () { 44 // using = false; 45 // $("#slider-container").hide(); 46 }); 47 48 /*$("#slider-vertical").slider({ 49 orientation: "vertical", 50 range: "min", 51 min: 0, 52 max: 6, 53 value: 4, 54 stop: function (event, ui) { 55 $("#slider-container").delay(100).fadeToggle(); 56 $volume = ui.value; 57 //console.log($volume); 58 }, 59 slide: function (event, ui) { 60 $(".volume").removeClass('step_1 step_2 step_3 step_4 step_5 step_6'); 61 $(".volume").addClass("step_" + ui.value); 62 $volume = ui.value; 63 bbs.setVolume($volume); 64 } 65 }).click(function () { 66 $("#slider-container").hide(); 67 }); ; 68 $("#amount").val($("#slider-vertical").slider("value"));*/ 69} 70 71//ian 72function positionPage() { 73 var windowHeight = $(window).height(); 74 // $("body").css({ "display": "block", "overflow": "hidden", "height":"100%", "border": "thick solid blue" }); 75 $('.Page').css({ "height": windowHeight - $("#header").height() + 'px' }); 76 //console.log("windowHeight: " + $(window).height() + " body: " + $("body").height() + " pageContainer: " + $('.pageContainer').height() + " bgContainer: " + $('.bgContainer').height()); 77 //$('.pageContainer').css({ "height": windowHeight + 'px' }); 78 // $(".bgContainer").css({ "display": "block", "overflow": "hidden", "border": "thick solid red" }); 79 /* $("#slider-container").css("left", $("div#header .right a.volume").offset().left);*/ 80 81 $('.pageContainer').css({ "height": windowHeight - $("#header").height() + 'px' }); 82 if ($('.Page .main:visible').css("position") != "absolute") { 83 $('.Page .main').css("margin-top", ((windowHeight - $('.main:visible').height() - 200) / 2) + "px"); 84 } else { 85 $(".raphaelCanvas:visible").css({ 86 "top": ((windowHeight - $('.raphaelCanvas:visible').height()) / 2) + "px" 87 }); 88 $(".Page .main:visible").css({ 89 "top": ((windowHeight - $('.main:visible').height() - 100) / 2) + "px" 90 }); 91 $(".playmePage .main:visible").css({ "bottom": "auto", "top": ((windowHeight / 2) + 50) + "px" }); 92 } 93 $('.Page').css({ 94 "height": windowHeight + 'px' 95 }); 96 if ($('.Page #bg-klokken:visible').css("position") != "absolute") { 97 $('.Page #bg-klokken').css("margin-top", ((windowHeight - $('#bg-klokken:visible').height() - 200) / 2) + "px"); 98 } else { 99 100 $(".raphaelCanvas:visible").css({ 101 "top": ((windowHeight - $('.raphaelCanvas:visible').height()) / 2) + "px" 102 }); 103 console.log("positionPage klokken"); 104 $(".Page #bg-klokken:visible").css({"top": ((windowHeight - $('.main:visible').height() - 100) / 2) + "px"}); 105 $(".playmePage #bg-klokken:visible").css({ "bottom": "auto", "top": ((windowHeight / 2) + 50) + "px" }); 106 } 107 $('.Page #bg-klokken:visible').hide().show(); 108} 109function showFullAjaxLoader(usePlay) { 110 if (usePlay) { 111 $("#loaderOverlayBG2").height($("body").height()); 112 $("#loaderOverlayBG2").width($("body").width()); 113 $("#loaderOverlayBG2").show(); 114 } else { 115 $("#loaderOverlayBG").height($("body").height()); 116 $("#loaderOverlayBG").width($("body").width()); 117 $("#loaderOverlayBG").show(); 118 } 119} 120function hideFullAjaxLoader() { 121 $("#loaderOverlayBG").hide(); 122 $("#loaderOverlayBG2").hide(); 123} 124 125$(document).ready(function () { 126 127 ///My Code 128 129 130 131 132 $("#tools_click").click(function () {
133 $("#tools_more").css('display', 'block'); 134 $("#tools_more").animate({ 135 marginLeft: '338px', 136 opacity: 1 137 }) 138 }); 139 $("#tools_click").mouseover(function () { 140 $(this).css('background', 'url(Content/img/myTools_menu_over.png) no-repeat'); 141 $(this).css('cursor', 'pointer'); 142 143 }); 144 $("#tools_click").mouseout(function () { 145 $(this).css('background', ''); 146 $(this).css('cursor', 'pointer'); 147 148 }); 149 $(".crowd1").click(function () { 150 $("#tools_more").animate({ 151 marginLeft: '0px' 152 153 }, function () { 154 $("#tools_more").animate({ 155 opacity: 0 156 157 }); 158 }); 159 160 }); 161 162 163 164 ///My Code 165 166 167 //ian 168 $('.homePage').removeClass('hiddenbox'); //show this page first 169 openPage = $('.homePage'); $('.homePage'); 170 171 volumeButtonHover(); 172 $(window).resize(function () { 173 positionPage(); 174 }); 175 positionPage(); 176 //myPhotoSwipe = $(".gallery a").photoSwipe({ enableMouseWheel: true, enableKeyboard: true, imageScaleMethod: 'fitNoUpscale' }); 177 //end ian 178 179 $('form').submit(function (e) { e.preventDefault(); return false; }); //prevent refresh on submit 180 181 $('.goto_crowdPage').click(function (e) { swapPage($(this).closest('.Page'), $('div.crowdPage'), false); e.preventDefault(); }); 182 183 // $('input.goto_playmePage').click(function () { swapPage($(this).closest('.Page'), $('.playmePage'), false); }); 184 185 $('.goto_homePage').click(function (e) { swapPage($(this).closest('.Page'), $('.homePage'), true); e.preventDefault(); }); 186 187 $('.goto_index').click(function (e) { 188 swapPage( 189 $(".pageContainer").children().not(".hiddenbox"), 190 $('.homePage'), true); 191 e.preventDefault(); 192 193 }); 194 195 $('.goto_submitPage').click(function (e) { swapPage($(this).closest('.Page'), $('.submitPage'), false); e.preventDefault(); }); 196 197 $('.goto_thanksPage').click(function (e) { 198 //validate 199 $(".Page.submitPage .conditions_container").removeClass("error"); 200 $(".Page.submitPage .email_container").removeClass("error"); 201 if (!hasValue($("#email")) || !echeck($("#email").val())) { 202 $(".Page.submitPage .email_container").addClass("error"); 203 return false; 204 } 205 if (!hasValue($("#tos"))) { 206 $(".Page.submitPage .conditions_container").addClass("error"); 207 return false; 208 } 209 var firstname = $(".playmePage .firstname").val(); 210 var lastname = $(".playmePage .lastname").val(); 211 212 var email = $("#email").val(); 213 var country = $("#countries").val(); 214 var tos = $("#tos").checked ? true : false; 215 var optin = $("#optin").checked ? true : false; 216 showFullAjaxLoader(); 217 $.ajax({
218 type: "POST", 219 url: "/Entry/Create/", 220 data: { Voornaam: firstname, Naam: lastname, Email: email, Country: country, OptIn1: optin, OptIn2: tos, Language: "EN" }, 221 dataType: "json", 222 success: function (msg) { 223 hideFullAjaxLoader(); 224 if (msg.statusMessage === "ok") { 225 //$("#ShortCode").val(msg.data.Short); 226 $("#ShortCode").val(myPlayID); 227 228 swapPage($('.submitPage'), $('.thanksPage'), false); 229 hideFullAjaxLoader(); 230 } else { 231 alert(msg.statusMessage); 232 hideFullAjaxLoader(); 233 } 234 }, 235 error: function (XMLHttpRequest, textStatus, errorThrown) { 236 alert(textStatus); 237 hideFullAjaxLoader(); 238 } 239 }); 240 241 e.preventDefault(); 242 }); 243 244 $('.goto_conditionsPage').click(function (e) { swapPage($(this).closest('.Page'), $('.conditionsPage'), false); e.preventDefault(); }); 245 246 //PANE 247 $('.goto_homePage_pane').click(function (e) { 248 if (!$('.homePage:visible').length) { swapPage(openPage, $('div.homePage'), true); } 249 $('.crowdPane').slideUp(200, function () { $('div#panes').addClass('hiddenbox'); }); 250 $('#footer li.crowd').animate({ opacity: 1 }, 400); 251 e.preventDefault(); 252 }); 253 $('.goto_crowdPage_pane').click(function (e) { 254 if (!$('.crowdPage:visible').length) { swapPage(openPage, $('div.crowdPage'), false); } 255 $('.crowdPane').slideUp(200, function () { $('div#panes').addClass('hiddenbox'); }); 256 $('#footer li.crowd').animate({ opacity: 1 }, 400); 257 e.preventDefault(); 258 }); 259 260 //FOOTER 261 //////////////////////////////////////////////////////////////////// 262 // hide panes 263 $('.pane').addClass('hiddenbox'); 264 265 $("#footer li").hover( 266 function () { 267 $('a', this).stop().animate({ marginTop: "-15px", paddingTop: "26px" }, { duration: 100 }); 268 }, 269 function () { 270 $('a', this).stop().animate({ marginTop: "0", paddingTop: "11px" }, { duration: 100 }); 271 } 272 ); 273 274 275 276 $("#footer li img").hover( 277 function () { 278 $(this).stop().animate({ marginTop: "-15px" }, { duration: 100 }); 279 }, 280 function () { 281 $(this).stop().animate({ marginTop: "0" }, { duration: 100 }); 282 } 283 ); 284 285 286 287 288 289 $(".info").click(function () { 290 $("#footer li:first").trigger("click"); 291 }); 292 $('#footer li').on('click', function (e) { 293 294 var $this = $(this), 295 hoveredElement = $this.attr('class'), //ex. track 296 pane = "." + hoveredElement + "Pane"; //ex. .trackPane 297 298 $('div#panes').removeClass('hiddenbox'); 299 $this.css({ opacity: 1, visibility: "visible" }).animate({ opacity: 0 }, 100); 300 301 $(pane + ' div.bottomImgContainer').hide(); 302 $(pane).slideDown(400, function () { $(pane + ' div.bottomImgContainer').slideDown(100); }); 303 304 $(pane).siblings().slideUp(400); 305 $this.siblings().animate({ opacity: 1 }, 400); 306 e.preventDefault(); 307 }); 308 309 310 $('.close').on('click', function (e) { 311 var $this = $(this), 312 313 currentPane = $this.closest('.pane'), 314 currentClass = $this.attr('class'); 315 currentNav = currentClass.substr(currentClass.length - 5); 316 317 var openPane = 'div.' + currentNav + "Pane div.bottomImgContainer"; 318 //console.log(openPane); 319 320 //slide down logo 321 $(openPane).slideUp(50, function () { 322 //slide down pane 323 currentPane.slideUp(400, function () { 324 $('div#panes').addClass('hiddenbox'); 325 }); 326 //fade in menu item 327 //$('#footer li.' + currentNav).css('opacity', '1'); 328 $('#footer li.' + currentNav).animate({ opacity: 1 }, 300); 329 }); 330 e.preventDefault(); 331 }); 332 333 334 $('#panes').on('click', function (e) { 335 // $(".pane").slideUp(400).addClass("hiddenbox"); 336 });
337 338 339 // for closing home page popup if clicked outside the popup 340 $(document).mouseup(function (e) { 341 var container = $(".pane, #footer li"); 342 343 if (!container.is(e.target) // if the target of the click isn't the container... 344 && container.has(e.target).length === 0) // ... nor a descendant of the container 345 { 346 $(".pane:visible .close").trigger("click"); 347 } 348 }); 349 350 //homepage form 351 $(".homePage input, .playmePage input").on('focus', function () { $(this).parent("form").addClass("focus"); }); 352 $(".homePage input, .playmePage input").on('blur', function () { $(this).parent("form").removeClass("focus"); }); 353 354 355 356 //dropdown 357 if ($("html").hasClass("touch")) //if (Modernizr.touch) { 358 { 359 $(document).bind('swiperight', function () { 360 if (!$('.homePage:visible').length) { 361 swapPage(openPage, $('div.homePage'), false); 362 } 363 }); 364 365 $(document).bind('swipeleft', function () { 366 if (!$('div.crowdPage:visible').length) { 367 swapPage(openPage, $('div.crowdPage'), true); 368 } 369 }); 370 } 371 $(window).resize(function () { 372 resize(); 373 }); 374 resize(); 375 376 var BrowserType; 377 378 if (navigator.userAgent.indexOf("Edge") > -1 && navigator.appVersion.indexOf('Edge') > -1) { 379 BrowserType = 'Edge'; 380 } 381 else if (navigator.userAgent.indexOf("Opera") != -1 || navigator.userAgent.indexOf('OPR') != -1) { 382 BrowserType = 'Opera'; 383 } 384 else if (navigator.userAgent.indexOf("Chrome") != -1) { 385 BrowserType = 'Chrome'; 386 } 387 else if (navigator.userAgent.indexOf("Safari") != -1) { 388 BrowserType = 'Safari'; 389 } 390 else if (navigator.userAgent.indexOf("Firefox") != -1) { 391 BrowserType = 'Firefox'; 392 } 393 else if ((navigator.userAgent.indexOf("MSIE") != -1) || (!!document.documentMode == true)) //IF IE > 10 394 { 395 BrowserType = 'IE'; 396 } 397 else { 398 BrowserType = 'unknown'; 399 } 400 401 if (BrowserType != 'Opera') { 402 // select element styling 403 $('select.select').each(function () { 404 var title = $(this).attr('title'); 405 if ($('option:selected', this).val() !== '') { title = $('option:selected', this).text(); } 406 $(this) 407 .css({ 'z-index': 10, 'opacity': 0, '-khtml-appearance': 'none' }) 408 .after('<span class="select">' + title + '</span>') 409 .change(function () { 410 val = $('option:selected', this).text(); 411 $(this).next().text(val); 412 }); 413 }); 414 } 415 //if (!$.browser.opera) { 416 // // select element styling 417 // $('select.select').each(function () { 418 // var title = $(this).attr('title'); 419 // if ($('option:selected', this).val() !== '') { title = $('option:selected', this).text(); } 420 // $(this) 421 // .css({ 'z-index': 10, 'opacity': 0, '-khtml-appearance': 'none' }) 422 // .after('<span class="select">' + title + '</span>') 423 // .change(function () { 424 // val = $('option:selected', this).text(); 425 // $(this).next().text(val); 426 // }); 427 // }); 428 //} 429 430}); 431//ian 432function resize() { 433 var middle = ($(window).width() - 980) / 2; 434 $('.pageContainer').css({ 435 'position': 'absolute', 436 'left': middle + 'px' 437 438 }); 439} 440//ian 441function swapPage($toClose, $toOpen, direction) { 442 // $toClose = $(this).closest('.Page'); 443 // $toOpen = $('.homePage'); 444 if ($toOpen.selector != "div.crowdPage") {clearBollekes(); } 445 if ($toOpen.selector != "div.playmePage" && bbs!==null) { bbs.pause(); } 446 var incoming = "-1000px"; 447 var outgoing = "1000px"; 448 if (direction) { 449 incoming = "1000px"; 450 outgoing = "-1000px"; 451 } 452 $toClose.css({'position': 'absolute','left': '0px' }); 453 $toClose.animate( 454 {'left': outgoing}, 455 250, 456 function () { } 457 ); 458 $toOpen.css({'position': 'absolute','left': incoming}); 459 $toOpen.removeClass('hiddenbox'); 460 //if ($toOpen.selector == "div.crowdPage") { laadBollekes(); } 461 //positionPage(); 462 $toOpen.animate( 463 {'left': '0px'}, 464 250, 465 function () { 466 $toClose.addClass('hiddenbox'); 467 $toClose.css({ 'position': 'absolute', 'left': '0px'}); 468 if ($toOpen.selector == "div.crowdPage") { laadBollekes(false);} 469 if ($toOpen.selector == "div.submitPage") {$(".conditions_container").removeClass("error");$(".email_container").removeClass("error"); } 470 positionPage(); 471 } 472 ); 473 openPage = $toOpen; 474} 475//HIDE ADRESS BAR 476//////////////////////////////////////////////////////////////////// 477// When ready...
478//window.addEventListener("load", function () { 479$(function () { 480 // Set a timeout... 481 setTimeout(function () { 482 // Hide the address bar! 483 window.scrollTo(0, 1); 484 }, 0); 485}); 486var bollekesTimeout; 487function laadBollekes(random) { 488 //showFullAjaxLoader(); 489 if ($(".Page.crowdPage").is(':visible')) { 490 $("#totalParticipants").text("..."); 491 $.ajax({ 492 type: "POST", 493 url: "/Entry/Index/", 494 data: { random: random }, 495 dataType: "json", 496 success: function (msg) { 497 hideFullAjaxLoader(); 498 if (msg.statusMessage === "ok") { 499 //function formatNumber(num, dec, thou, pnt, curr1, curr2, n1, n2) 500 $("#totalParticipants").text(formatNumber(msg.data.totalPlays, 0, '.', '', '', '', '', '')); 501 tekenBollekes(msg.data.entries); 502 bollekesTimeout = setTimeout("laadBollekes(true)", 15000); 503 } else { 504 alert(msg.statusMessage); 505 hideFullAjaxLoader(); 506 } 507 }, 508 error: function (XMLHttpRequest, textStatus, errorThrown) { 509 alert(textStatus); 510 hideFullAjaxLoader(); 511 } 512 }); 513 } 514} 515 516 517/**** shares ****/ 518$(function () { 519 $('a.volume').click(function (e) { 520 $(this).toggleClass('not-mute'); 521 e.preventDefault(); 522 }); 523 $("a.facebook, .facebook > a").click(function () { 524 //@ViewBag.Language 525 var shareU = sURL; 526 if (myPlayID !== null && myPlayID.length > 0){ shareU = myPlayID;} 527 $(this).attr("href", "https://www.facebook.com/sharer/sharer.php?u=" + encodeURI(shareU)); 528 return true; 529 //@ViewBag.Language 530 }); 531 $("a.twitter, .twitter > a").click(function () { 532 //@ViewBag.Language 533 var shareU = sURL; 534 if (myPlayID !== null && myPlayID.length > 0){ shareU = myPlayID;} 535 //var tweet = "@ViewBag.Tweet"; 536 var myTweet = tweet.replace("%%%", shareU); 537 $(this).attr("href", "https://twitter.com/share?source=tweetbutton&url=c.track.be&text=" + encodeURI(myTweet) + ""); 538 return true; 539 //$(this).attr("title", "@ViewBag.TwitTitle"); 540 }); 541}); 542/**** end shares ****/
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.