jQuery(function(){ $('.radio').change(function() { window.location.hash = "#"+$(this).val(); }); // simpel advanced $('#advanced').hide(); $('#s6l_advanced').show(); $('#s6l_min').hide(); $('#submitBtn2').hide(); if ($("#advanced .s6l_error_message").length > 0) { $('#advanced').show(); $('#s6l_advanced').hide(); $('#s6l_min').show(); } if ($("#s6l_custom input").attr("value")){ $('#advanced').show(); $('#s6l_advanced').hide(); $('#s6l_min').show(); } $("#s6l_min_a").click(function () { $('#advanced').hide(); $('#s6l_advanced').show(); $('#s6l_min').hide(); $('#submitBtn2').hide(); $('#submitBtn1').removeClass('inactive'); }); $("#s6l_advanced_a").click(function () { $('#advanced').show(); $('#s6l_advanced').hide(); $('#s6l_min').show(); $('#submitBtn1').addClass('inactive'); $('#submitBtn2').show(); }); }); // Our plugin will be defined within an immediately // executed method. ( function( $ ){ // Default to the current location. var strLocation = window.location.href; var strHash = window.location.hash; var strPrevLocation = ""; var strPrevHash = ""; // This is how often we will be checkint for // changes on the location. var intIntervalTime = 100; // This method removes the pound from the hash. var fnCleanHash = function( strHash ){ return( strHash.substring( 1, strHash.length ) ); } // This will be the method that we use to check // changes in the window location. var fnCheckLocation = function(){ // Check to see if the location has changed. if (strLocation != window.location.href){ // Store the new and previous locations. strPrevLocation = strLocation; strPrevHash = strHash; strLocation = window.location.href; strHash = window.location.hash; // The location has changed. Trigger a // change event on the location object, // passing in the current and previous // location values. $( window.location ).trigger( "change", { currentHref: strLocation, currentHash: fnCleanHash( strHash ), previousHref: strPrevLocation, previousHash: fnCleanHash( strPrevHash ) } ); } } // Set an interval to check the location changes. setInterval( fnCheckLocation, intIntervalTime ); } )( jQuery ); function replaceAll(txt, replace, with_this) { return txt.replace(new RegExp(replace, 'g'),with_this); } // Bind a change handler to the window location. $( window.location ).bind( "change", function( objEvent, objData ){ function replaceAll(txt, replace, with_this) { if (txt == null) { txt =" "; } return txt.replace(new RegExp(replace, 'g'),with_this); } // switch URL var sn3lurl = "http://sn3l.nl/"; var occhiourl = "http://occh.io/"; var jLog = $( "#log" ); // Add the URL change. if (objData.currentHash == "occh.io") { $("#s6l_result").html(replaceAll($("#s6l_result").html(),sn3lurl, occhiourl)); $("#s6l_statistics").html(replaceAll($("#s6l_statistics").html(),sn3lurl, occhiourl)); $("#s6l_custom").html(replaceAll($("#s6l_custom").html(),sn3lurl, occhiourl)); $("#urlprefix").html(occhiourl); $("#snelbutton").show(); $("#occhiobutton").hide(); } if (objData.currentHash == "sn3l.nl") { $("#s6l_result").html(replaceAll($("#s6l_result").html(),occhiourl,sn3lurl)); $("#s6l_statistics").html(replaceAll($("#s6l_statistics").html(),occhiourl,sn3lurl)); $("#s6l_custom").html(replaceAll($("#s6l_custom").html(),occhiourl,sn3lurl)); $("#urlprefix").html(sn3lurl); $("#snelbutton").hide(); $("#occhiobutton").show(); } } ); function makenew(){ var timestamp = Number(new Date()); var hashstring = window.location.hash; window.location = "?"+timestamp + "&view=" +hashstring.substr(1,128); } jQuery(function(){ window.location.hash = "#occh.io"; $("#showocchio").trigger('click'); });