/*============ script for welcome user text =============*/
var test;
SP.SOD.executeOrDelayUntilScriptLoaded(Test, 'sp.js', 'SP.ClientContext');
//SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function ()
function Test () {
var KMMastercontext = new SP.ClientContext.get_current();
KMMasterweb = KMMastercontext.get_web();
KMMasteruser = KMMasterweb.get_currentUser();
KMMastercontext.load(KMMasteruser);
KMMastercontext.executeQueryAsync(function () {
test = KMMasteruser.get_title();
$("#lblUsername").html(KMMasteruser.get_title()); $("#lblUsernameMobile").html(KMMasteruser.get_title()); $("#lblUsernameMobile2").html(KMMasteruser.get_title());
}, function (sender, args) {
alert("Failed! Message:" + args.get_message());
});
if (location.protocol == "https:") {
$("#lblUsername").html(test);
$("#lblUsername").wrap("");
$("#O365_SubLink_ShellAboutMe").attr("href", "Pages/PageNotFoundError.aspx");
}
else {
$("#lblUsername").html(test);
$("#lblUsername").wrap("");
$("#O365_SubLink_ShellAboutMe").attr("href", "http://abgulink.com:8080/Person.aspx");
}
}
/*FOr Footer*/
$(document).ready(function () {
if (location.protocol == "https:") {
$("#lblUsername").html(test);
$("#lblUsername").wrap("");
$("#O365_SubLink_ShellAboutMe").attr("href", "Pages/PageNotFoundError.aspx");
}
else
{
$("#lblUsername").html(test);
$("#lblUsername").wrap("");
$("#O365_SubLink_ShellAboutMe").attr("href", "http://abgulink.com:8080/Person.aspx");
}
$('#bottomfooter-content').hide();
$("#bottom-footer").click(function () {
$('#bottomfooter-content').toggle();
// $("html, #s4-workspace").animate({ scrollTop: $(document).height() }, 1100);
$("html, #s4-workspace").animate({ scrollTop: 1500 }, 2000);
if ($('#footer-icon').hasClass('fa-chevron-down')) {
$('#footer-icon').removeClass('fa-chevron-down');
$('#footer-icon').addClass('fa-chevron-up');
}
else {
$('#footer-icon').removeClass('fa-chevron-up');
$('#footer-icon').addClass('fa-chevron-down');
}
});
$(window).resize(function () {
var width = $(window).width();
var height = $(window).height();
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (width < 321 && window.top == window.self && msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
alert('Please do not resize beyond this.');
$('.ResizeOverlay').addClass('main-body-container-overlay-Resize');
}
else if ((width < 320) && window.top == window.self) {
alert('Please do not resize beyond this.');
$('.ResizeOverlay').addClass('main-body-container-overlay-Resize');
}
else {
$('.ResizeOverlay').removeClass('main-body-container-overlay-Resize');
}
var icondwn = $('');
var iconright = $('');
if (width <= 767) {
$('.Utop-nav>li:has(ul)>a').find("img").removeClass("icondwn");
$('.Utop-nav>li:has(ul)>a').find("img").addClass("iconright");
/* if (($('.Utop-nav li:has(ul)>a').has('img').length == 0) && ($('.Utop-nav li>ul>li:has(ul)>a').has('img').length == 0)) {
}*/
}
else {
$('.Utop-nav>li:has(ul)>a').find('img').remove();
$('.Utop-nav li>ul>li:has(ul)>a').find('img').remove();
$('.Utop-nav>li:has(ul)>a').append(icondwn);
$('.Utop-nav li>ul>li:has(ul)>a').append(iconright);
}
});
});
function navIconFix() {
/*
if ( ($('.Utop-nav li:has(ul)>a').has('img').length == 0) && ($('.Utop-nav li>ul>li:has(ul)>a').has('img').length == 0)) {
console.log('a');
$('.Utop-nav>li:has(ul)>a').append(iconright);
$('.Utop-nav li>ul>li:has(ul)>a').append(iconright);
$('.Utop-nav li:has(ul)>a').on("click", function () {
if ($(this).find('img').hasClass('iconright')) {
$(this).find('img').removeClass('iconright');
$(this).find('img').addClass('icondown');
}
else {
$(this).find('img').removeClass('icondown');
$(this).find('img').addClass('iconright');
}
});
}
else {
console.log('eslse');
$('.Utop-nav li:has(ul)>a').find('img').addClass('iconright');
}
*/
}
/*FOr Footer*/
/*2 Feb 2016:- For Mobile Left Nav*/
//$(window).load(function () {
// $('#Temp').addClass('TempToggle');
// $('.bullet').find('a').first().append('')
// $('.bullet').click(function () {
// //$('#Temp').toggleClass('TempToggle', 1000 , 'easeInOutBack');
// if ($('#leftMenuPlusIcon').hasClass('fa-plus')) {
// $('#leftMenuPlusIcon').removeClass('fa-plus');
// $('#leftMenuPlusIcon').addClass('fa-minus');
// }
// else {
// $('#leftMenuPlusIcon').removeClass('fa-minus');
// $('#leftMenuPlusIcon').addClass('fa-plus');
// }
// $('#Temp').toggleClass('TempToggle');
// });
//});
/* 26th May Left Navigation Changes*/
$(window).load(function () {
setTimeout(function () {
$('#LeftMenuMobile').find('ul#Temp').addClass('TempToggle');
$('#LeftMenuMobile').find('li.childLi').each(function () {
var length = $(this).find('ul').find('li').length;
if (length >= 1) {
$(this).children('a').attr('href', 'javascript:void(0);');
if (!$(this).hasClass('current2level')) {
$(this).find('a').first().append('');
}
else if ($(this).hasClass('current2level')) {
$(this).find('a').first().append('');
}
$(this).find('ul').addClass('TempToggle');
}
});
// $('.LeftMenuMobile').findd('li.bullet').find('a').first().append('')
$('#LeftMenuMobile li.bullet').each(function () {
if (!$(this).hasClass('current')) {
$(this).find('a').first().append('');
}
else if ($(this).hasClass('current')) {
$(this).find('a').first().append('');
}
});
$('#LeftMenuMobile li.bullet').not('.current').click(function () {
//$('#Temp').toggleClass('TempToggle', 1000 , 'easeInOutBack');
if ($(this).find('i#leftMenuPlusIcon').hasClass('fa-plus')) {
$('li.bullet').not('.current').find("i#leftMenuPlusIcon").removeClass("fa-minus");
$('li.bullet').not('.current').find("i#leftMenuPlusIcon").addClass("fa-plus");
$('#LeftMenuMobile li.bullet').find('ul#Temp').addClass('TempToggle');
$(this).find('ul#Temp').removeClass('TempToggle');
$(this).find('i#leftMenuPlusIcon').removeClass('fa-plus');
$(this).find('i#leftMenuPlusIcon').addClass('fa-minus');
}
else {
$(this).find('ul#Temp').addClass('TempToggle');
$(this).find('i#leftMenuPlusIcon').removeClass('fa-minus');
$(this).find('i#leftMenuPlusIcon').addClass('fa-plus');
}
$('#LeftMenuMobile').find('li.childLi>a').unbind('click').bind('click', function (e) {
//alert("click");
if ($(this).find('i#leftMenuPlusIcon3').hasClass('fa-plus')) {
$(this).parent().find('ul').removeClass('TempToggle');
$(this).find('i#leftMenuPlusIcon3').removeClass('fa-plus');
$(this).find('i#leftMenuPlusIcon3').addClass('fa-minus');
}
else {
//alert("else");
if (!$(this).parent().hasClass('current2level')) {
$(this).parent().find('ul').addClass('TempToggle');
$(this).find('i#leftMenuPlusIcon3').removeClass('fa-minus');
$(this).find('i#leftMenuPlusIcon3').addClass('fa-plus');
}
}
});
//$(this).find('ul#Temp').toggleClass('TempToggle');
});
}, 3000);
});
$(document).ready(function () {
if (location.protocol == "https:") {
$("#lblUsername").html(test);
$("#lblUsername").wrap("");
$("#O365_SubLink_ShellAboutMe").attr("href", "Pages/PageNotFoundError.aspx");
}
else
{
$("#lblUsername").html(test);
$("#lblUsername").wrap("");
$("#O365_SubLink_ShellAboutMe").attr("href", "http://abgulink.com:8080/Person.aspx");
}
$(".col-business-img").find("img").addClass("img-responsive");
$(".col-cement-img").find("img").addClass("img-responsive");
if (window.location.href.indexOf("UTCLPreviousPolls") > -1) {
$('.heading').find('h1').addClass('blue-border-title');
$('.heading').find('h1').css('margin-left', '0px');
}
if (window.location.href.indexOf("Posts") > -1) {
$('ul.ms-blog-postList').parent().addClass('col-md-11 col-sm-12 col-xs-12 fontsz13');
$('.ms-blog-MainArea td:first-child').addClass('col-md-11');
$('.ms-blog-MainArea tbody').addClass('blogtbl');
$('.ms-blog-MainArea tr').addClass('blogtbl');
$('.ms-blog-MainArea td').addClass('blogtbl');
}
if (window.location.href.indexOf("blogs") > -1) {
$('.ms-blog-MainArea td:first-child').addClass('col-md-11');
$('.ms-blog-MainArea tbody').addClass('blogtbl');
$('.ms-blog-MainArea tr').addClass('blogtbl');
$('.ms-blog-MainArea td').addClass('blogtbl');
}
$('.polls').addClass('fontsz13');
$('.ms-core-listMenu-root li').find('a:contains("Archives")').parent().addClass('lastTab');
//$('.quick-poll-contaner td.leftlink').hide();
});
$(document).ready(function () {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
$('.Utop-nav li').each(function () {
if ($(this).text() == "Classifieds") {
$(this).hide();
}
});
}
});