$(function () { function getUrlParameter(name) { name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); var results = regex.exec(location.search); return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); }; //console.log("we are here!"); var externalsignin = getUrlParameter('externalsignin'); //console.log("externalsignin=" + externalsignin); //We don't need this any more //if (externalsignin == 1) //{ // //show external links // //$("#Google").show(); // ////$("#https://login.windows.net/461ab39f-1956-46d8-bd8f-6b59e1a181ee/").show(); // //$("#submit-signin-local").hide(); // //$("#Username").hide(); // //$("#Password").hide(); // $("form").each(function () { // var action = $(this).attr("action"); // console.log("form action=" + action); // if ((action.indexOf("/SignIn?") >= 0)) // //$(this).parent().closest('div').hide(); // $(this).parents("div").eq(0).hide(); // else // //$(this).parent().closest('div').show(); // $(this).parents("div").eq(0).show(); // }); //} $("a").each(function () { //console.log("anchor url=" + $(this).attr("href")); var anchorUrl = $(this).attr("href"); if ((anchorUrl.indexOf("/Register") >= 0)) { $(this).parents("li").eq(0).hide(); //Hiding the register button } }) if (externalsignin != 1) { if (window.location.href.indexOf('SignIn') >= 0) { //hide external links //$("#submit-signin-local").show(); //$("#Username").show(); //$("#Password").show(); //$("#Google").hide(); ////$("#https://login.windows.net/461ab39f-1956-46d8-bd8f-6b59e1a181ee/").hide(); $("form").each(function () { var action = $(this).attr("action"); //console.log("form action=" + action); if ((action.indexOf("/SignIn") >= 0) || (action.indexOf("/search") >= 0)) //$(this).parent().closest('div').show(); $(this).parents("div").eq(0).show(); else //$(this).parent().closest('div').hide(); $(this).parents("div").eq(0).hide(); }); } } else { $("span").each(function () { //console.log("span text=" + $(this).text()); var spanText = $(this).text(); if ((spanText.indexOf("Sign in with a local account") >= 0)) { $(this).text("City-Provided Login"); //Changing the text for local login } }) } })