" $('.labels-container',$(this)).html(errorMessage); }, success: function (data) { $('.labels-spinner', $(this)).addClass("hidden"); $('.labels-container',$(this)).html(data); } }); } }); })(LITHIUM.jQuery); ;(function($) { $(document).ready(function() { var context = $(".custom-social-share-component"); }); })(LITHIUM.jQuery); (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); }) (window, document, "clarity", "script", "5g62gvf1i3" ); var manageConsent = function () { // called from footer siteConsent.manageConsent(); }; var logConsentValues = function () { var currentConsent = siteConsent.getConsent(); console.log(currentConsent); }; var resetCookieCategories = function (catTypeKey, data) { data[catTypeKey].forEach(function (item) { // always expire entire list of non-essentials var str; var c = item.name; var domain = item.domain; var d = new Date(); d.setMonth(-12); str = c.trim() + "=; expires=" + d.toUTCString() + "; path=/"; document.cookie = str; str = c.trim() + "=; expires=" + d.toUTCString() + "; domain=" + domain + "; path=/"; document.cookie = str; // console.log(str) }); }; var resetNonEssentialCookies = function (categoryPreferences) { var myData = localStorage.getItem('non-essential-list'); var isExpired = function (storedData) { var ret = false; var t = new Date().getTime(); var parsedData = JSON.parse(storedData); var LIFE = 1000 * 60 * 30; var expired = function () { return parsedData.ttl >= t + LIFE; } if (!parsedData || parsedData && expired()) { ret = true; } return ret; }; if (isExpired(myData)) { $.ajax({ dataType: "json", url: 'https://techcommunity.microsoft.com/html/assets/Scripts/cookie-list.json?v=6182022', error: function (err) { console.error(err); }, scope: { categoryPreferences: categoryPreferences }, success: function (data) { var categoryPreferences = this.scope.categoryPreferences; var d = new Date(); localStorage.setItem('non-essential-list', JSON.stringify({"ttl": d.getTime(), "data": data})) if (categoryPreferences.Advertising === false) { resetCookieCategories('advertising', data); } if (categoryPreferences.Advertising === true && categoryPreferences.Analytics === true ) { !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '1770559986549030'); // Insert your pixel ID here. fbq('track', 'PageView'); } if (categoryPreferences.SocialMedia === false) { resetCookieCategories('socialmedia', data); } if (categoryPreferences.Analytics === false) { resetCookieCategories('analytics', data); } if (categoryPreferences.Analytics === true) { window.clarity('consent'); } } }); } else { myData = JSON.parse(myData).data;
if (categoryPreferences.Advertising === false) { resetCookieCategories('advertising', myData); } if (categoryPreferences.Advertising === true && categoryPreferences.Analytics === true) { !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '1770559986549030'); // Insert your pixel ID here. fbq('track', 'PageView'); } if (categoryPreferences.SocialMedia === false) { resetCookieCategories('socialmedia', myData); }
if (categoryPreferences.Analytics === false) { resetCookieCategories('analytics', myData); } if (categoryPreferences.Analytics == true) { window.clarity('consent'); } } }; var consentChangedCallback = function (categoryPreferences) { // logs consent to console logConsentValues();
resetNonEssentialCookies(categoryPreferences); };
;(function($) { $(document).ready(function() { var showProperFooterLink = function () { if (siteConsent.isConsentRequired) { $('#shellmenu_2B').removeClass('hidden'); $('#shellmenu_2A').addClass('hidden');
} else { $('#shellmenu_2A').removeClass('hidden'); $('#shellmenu_2B').addClass('hidden'); } };
window.siteConsent = null;
$('body').on('body:siteConsent', function () { window.siteConsent = null; WcpConsent.init('en-US', 'cookie-banner', function (err, _siteConsent) { if (err != undefined) { return error; } else { siteConsent = _siteConsent; resetNonEssentialCookies(siteConsent.getConsent()); } }, consentChangedCallback);
showProperFooterLink(); });
// wait for some cookies to drop setTimeout(function () { if (!window.siteConsent) { $('body').trigger('body:siteConsent'); } else { resetNonEssentialCookies(siteConsent.getConsent()); } }, 3000); }); })(LITHIUM.jQuery);
;(function($) { $(document).ready(function() { var defaultColor="ffffff"; var itemClass="#lia-body .custom-board-search-form .custom-lia-search .SearchForm .lia-search-input-wrapper .search-input"; var styleContent = itemClass + ':-moz-placeholder {color: #' + defaultColor + ';} ' + itemClass + '::-webkit-input-placeholder {color: #' + defaultColor + ';} ' + itemClass + '::-moz-placeholder {color: #' + defaultColor + ';} ' + itemClass + ':-ms-input-placeholder {color: #' + defaultColor + ';}'; var styleBlock = '
'; $('head').append(styleBlock); $('.custom-board-search-form .lia-component-common-widget-search-form .lia-search-input-wrapper .lia-search-input-message').attr("placeholder", "Search this space"); var newColor="919191 !important"; styleContent = itemClass + ':-moz-placeholder {color: #' + newColor + ';} ' + itemClass + '::-webkit-input-placeholder {color: #' + newColor + ';} ' + itemClass + '::-moz-placeholder {color: #' + newColor + ';} ' + itemClass + ':-ms-input-placeholder {color: #' + newColor + ';}'; $('#placeholder-style').text(styleContent); });
})(LITHIUM.jQuery);
;(function($) {
$(document).ready(function() { UTILITIES.carousel_init(); var currentNavigatorLanguage = navigator.language; });
$(document).ready(function() {
var forumTopicPageUnreadStyles = function () { // moderator highlight does not collide with message unread css hook var i; var collection = $('.lia-message-unread'); var len = collection.length;
if ($('body').hasClass('.lia-user-status-anonymous')) { return; } else { for (i = 0; i 0) { $.ajax({ type: 'post', url: '/plugins/custom/microsoft/o365/custom.get-user-rank?tid=1156990724172887006', dataType: 'json', data: { users: user_ids.join(',') }, error: function (err) { console.log(err); }, success: function (data) { var map = data.map(function (item, i, arr) { var sel=".lia-component-reply-list a[data-user-id={0}] img"; sel = sel.replace('{0}', item.id); $(sel).css('border', '3px solid #' + item.color); })
} }); } });
var addRankRings = function() { var i; var avatar; var title; var user; var myColor; var inlineColorStyleEle; var itemWrapperEle; var targetReplies = false;
// empty collection var avatars = []; var len = avatars.length;
//pages var isIdeaPage = $('body').hasClass('IdeaPage'); var isNotesPage = $('body').hasClass('PrivateNotesPage'); var isBlogArticlePage = $('body').hasClass('BlogArticlePage'); var isForumTopicPage = $('body').hasClass('ForumTopicPage'); var notesPageAvatars = function () { var collection = $('.lia-notes-thread-stream-list img'); var len = collection.length; var i; var img;
for (i = 0; i ' + '
' + '
' + '
' + '
'; var modalMarkup = '
' + '
' + '
' + '
'; var cookie = { set: function (cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); var path = "path=/"; document.cookie = cname + "=" + cvalue + "; " + expires + "; " + path; }, get: function (cname) { var name = cname + "="; var ca = document.cookie.split(';'); for (var i = 0; i 768) { if (CONST.surveyEnabled === "true" && CONST.survey_name !== "" && CONST.surveyURL !== "") {
// cookie string cookieVal = cookie.get('survey');
$('body').prepend(markup + modalMarkup); $('.my-modal-survey iframe').attr('src', CONST.surveyURL);
$('.request-survey .primary-action').click(function () { var cookieStr = cookie.get('survey'); var surveyName = CONST.surveyName; var cookieValueArray = []; var newCookieStr;
if (cookieStr === "false") { cookieStr = ""; cookieValueArray.push(surveyName); } else { cookieValueArray = cookieStr.split(','); if (isUnique(surveyName, cookieValueArray)) { cookieValueArray.push(surveyName); } }
newCookieStr = cookieValueArray.join(); cookie.set('survey', newCookieStr, CONST.surveyExpires); // console.log(cookie.get('survey'));
$('.my-modal-survey').removeClass('my-modal-hidden'); $('.my-opacity-layer-survey').removeClass('hidden'); });
$('.request-survey .secondary-action').click(function () { var cookieStr = cookie.get('survey'); var surveyName = CONST.surveyName; var cookieValueArray = []; var newCookieStr;
if (cookieStr === "false") { cookieStr = "" cookieValueArray.push(surveyName); } else { cookieValueArray = cookieStr.split(','); if (isUnique(surveyName, cookieValueArray)) { cookieValueArray.push(surveyName); } }
newCookieStr = cookieValueArray.join(); cookie.set('survey', newCookieStr, CONST.surveyExpires);
$('.request-survey').addClass('hidden out'); });
$('.my-modal-survey .modal-close').click(function () { $('.my-modal-survey').addClass('my-modal-hidden'); $('.my-opacity-layer-survey').addClass('hidden'); $('.request-survey').addClass('hidden out'); });
if (isUnique(CONST.surveyName, cookieVal.split(',')) || cookieVal === "false") { // show sticky $('.request-survey').removeClass('hidden'); setTimeout(function () { $('.request-survey').removeClass('out'); }, 1000) } else { // console.log('cookie: ' + cookieVal); $('.request-survey').addClass('hidden out'); } } } };
addRankRings(); profileUserCardMe(); customerSurvey();
$('.lia-component-message-view-widget-author-avatar, .lia-component-messages-column-message-author-avatar').on('mouseenter mouseleave keydown', function(e) { // used in above locations var myURL; var myData; var card; var hrefStr = $(this).find("a").attr("href"); var hrefString = hrefStr.split("https://techcommunity.microsoft.com/"); var userIdValue = hrefString[5]; var checkExistdiv = $(this).find(".user-profile-card"); var divLength = $(checkExistdiv).length; var profileCard = $(this).find('.user-profile-card').get(0); var isDesktop = $(window).width() > 991;
if (e.type === 'keydown' && (e.keyCode === 40 || e.keyCode === 38 || e.keyCode === 32)) { e.preventDefault(); if (($(profileCard).is(':hidden'))) { $(profileCard).show(); $(this).focus(); } else { $(profileCard).hide(); $(this).focus(); } } else if (e.type === 'mouseenter' && isDesktop) { // large desktop only e.preventDefault(); $(profileCard).show(); $(this).focus(); } else if (e.type === 'mouseleave' && isDesktop) { // large desktop only e.preventDefault(); $(profileCard).hide(); $(this).focus(); } else if (e.type === 'click' && e.target.tagName === 'IMG') { // mobile and tablet get open with click if (!isDesktop) { e.preventDefault();
if (($(profileCard).is(':hidden'))) { $(profileCard).show(); $(this).focus(); } else { $(profileCard).hide(); $(this).focus(); } } else { $(profileCard).hide(); } }
if($(this).find('.UserAvatarWrapper').length === 0){ $(this).addClass('UserAvatarWrapper'); }
if (userIdValue === '-1') { $(this).addClass('my-profile-card'); }
if (divLength == 0) { $(this).append("
"); }
card = $('.user-profile-card', this);
if (!card.hasClass('loading')) { card.addClass('loading');
myURL = 'https://techcommunity.microsoft.com/t5/italy-news-events/gps-weekly-news-26-06-2023/ba-p/3856518'; myData = { 'userId': userIdValue, 'currentPageURL': myURL };
$.ajax({ type: 'post', url: '/plugins/custom/microsoft/o365/fetch-user-profilecard?tid=1156990724172887006', dataType: 'json', data: myData, context: this, beforeSend: function(xhr, opts) { // abort cases if (userIdValue (windowWidth - 25)) { // check the left right edges for placement adjustment = (left + cardWidth) - (windowWidth + 25) + 50; card.css('left', (-1 * adjustment) + 'px'); }
if ((avatarTop + cardHeight + 25) > (viewport.bottom)) { var adjustment = -1 * (cardHeight); card.css('top', adjustment + 'px'); } else { card.css('top', '100%'); }
// existing design no cards for mobile card.addClass('loading'); card.trigger('MSFT.fetchFollowStatus', [evt]); });
// supergroup feeds: this event will close the cards when tabbed out of the card $('.category-recent-conversations-wrapper').on('focus', '.subject-link, .message-subject-link, .user-login a' ,function () { //$('.user-profile-card').hide().; hideProfileCard(); });
// lounge and profile feeds : this event will close the cards when tabbed out of the card $('.custom-message-feed-list-wrapper').on('focus', '.subject-link, .user-login', function (e) { $('.user-profile-card').hide() });
$('#lia-body .lia-content').on('MSFT.fetchFollowStatus', '.UserAvatarWrapper .user-profile-card', function (msftEvt, evt) { var userIdValue; var myURL; var myData; var profileCard = $(this); var userAvatarAnchor = $(this).closest('.UserAvatarWrapper').find('a.UserAvatar') var isDesktop = $(window).width() > 991;
if (!isNaN($(this).attr('data-user-id'))) { userIdValue = parseInt($(this).attr('data-user-id'), 10);
if (evt.type === 'keydown' && (evt.keyCode === 40 || evt.keyCode === 38 || evt.keyCode === 32)) { evt.preventDefault(); if (($(profileCard).is(':hidden'))) { $(profileCard).show(); $(userAvatarAnchor).focus(); UTILITIES.accessibleAlert('pageLevel', 'Opened avatar dropdown menu'); } else { $(profileCard).hide(); UTILITIES.accessibleAlert('pageLevel', 'Closed avatar dropdown'); $(userAvatarAnchor).focus(); } } else if (evt.type === 'mouseenter' && isDesktop) { evt.preventDefault(); $(profileCard).show(); $(userAvatarAnchor).focus(); } else if (evt.type === 'mouseleave' && isDesktop) { evt.preventDefault(); $(profileCard).hide(); $(userAvatarAnchor).focus(); } else if (evt.type === 'click' && evt.target.tagName === 'IMG') { // mobile and tablet get click event if (!isDesktop) { evt.preventDefault();
if (($(profileCard).is(':hidden'))) { $(profileCard).show(); $(userAvatarAnchor).focus(); } else { $(profileCard).hide(); $(userAvatarAnchor).focus(); } } else { $(profileCard).hide(); } }
myURL = DOMPurify.sanitize('https://techcommunity.microsoft.com/t5/italy-news-events/gps-weekly-news-26-06-2023/ba-p/3856518');
myData = { 'userId': userIdValue, 'currentPageURL': myURL };
$.ajax({ type: 'post', url: '/plugins/custom/microsoft/o365/fetch-user-profilecard?tid=1156990724172887006', dataType: 'json', data: myData, context: this, beforeSend: function (xhr, opts) { if (userIdValue = 0) { var parentElements = $(e.target).closest(".lia-mentions-user-list"); if (parentElements.length > 0) { e.preventDefault(); } } });
function hideProfileCard(){ var hasAvatarOpened = $('.user-profile-card').is(':visible'); $('.user-profile-card').hide(); if(hasAvatarOpened){ UTILITIES.accessibleAlert('pageLevel', 'Closed avatar dropdown'); } }
}); })(LITHIUM.jQuery);
;(function($) { $(document).ready(function () { $('.custom-lia-search').click(function (e) { if (!$(e.target).hasClass('lia-button-searchForm-action')) { /* expanded search */ if ($('#community-menu-wrapper-menu:visible').length !== 0) { e.preventDefault(); e.stopPropagation(); $('.community-header-component .lia-autocomplete-input:visible').focus(); //$('.notifications-overlay-mail').show(); $(this).addClass('expanded'); } else { $(this).removeClass('expanded'); $('.notifications-overlay-mail').hide(); } } });
// add skip links navigation to several pages UTILITIES.skipLinksNavigationInit();
UTILITIES2.ExternalLinkDisclaimer("External Link Prompt", "The link you just clicking will take you to a 3rd party owned site. If you click continue any data you share will be in accordance with that sites terms of use and privacy policies.");
$(window).resize(function () { if ($('.community-header-component .custom-lia-search').hasClass('expanded')) { $('.community-header-component .custom-lia-search').removeClass('expanded'); $('.notifications-overlay-mail').hide(); $('.lia-autocomplete-input').val(''); } });
$('.lia-component-common-widget-slide-out-user-menu').click(function (e) {
var messageMarkup = 'Messages{1}'; var notificationMarkup = 'Notifications{0}';
var messagesCount = $('.notify-icon.notif-mail .lia-notifications-messages-aggregate').text().trim(); var notificationsCount = $('.notify-icon.notif-list .lia-notifications-messages-aggregate').text().trim(); var indicatorTemplate=" {0}";
var messagesTemplate=""; var notificationsTemplate=""; if (messagesCount) { messagesTemplate = indicatorTemplate.replace('{0}', messagesCount); } if (notificationsCount) { notificationsTemplate = indicatorTemplate.replace('{0}', notificationsCount); }
if ($('.lia-slide-menu-overlay-open').length == 0 ) { var markup = ""; if($(window).width() 0) { $('.InfoMessage').prepend(''); $('.close-info-message').click(function (e) { e.preventDefault(); $(this).parent().remove(); }) } })(LITHIUM.jQuery);
function storageAvailable(type) { try { var storage = window[type], x = '__storage_test__'; storage.setItem(x, x); storage.removeItem(x); return true; } catch(e) { return false; } }
function profileUserCardMe () { /* adds profile hovercards to current user with wrapper css class allows for custom CSS styles */ var myId = -1; var addCardTemplates = function (myId) { var items = $('.lia-quilt-row-main .UserAvatarWrapper'); var item; var len = items.length; var i; var authorId; var hasHoverCardMarkup; var templateMarkup = '
'; templateMarkup = templateMarkup.replace('{0}', myId)
for (i = 0; i
Source by [author_name]