" $('.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.data-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 < len; i++) { $(collection[i]).closest('.MessageView').addClass('unread'); } } }; if ($('body').hasClass('ForumTopicPage')) { forumTopicPageUnreadStyles(); } var getUserIds = function () { var users = $('.lia-component-reply-list .UserAvatar.lia-link-navigation'); var i; var len = users.length; var user_ids = []; var tempStr; var tempId; for (i = 0; i < len; i++) { tempStr = users[i].getAttribute('href'); tempId = tempStr.substr(tempStr.lastIndexOf("https://techcommunity.microsoft.com/") + 1, tempStr.length) $(users[i]).attr('data-user-id', tempId); user_ids.push(tempId) } $('.lia-component-reply-list').trigger('lia-component-reply-list:prep', [user_ids]); }; $('.lia-component-reply-list').on('lia-component-reply-list:prep', function (e, user_ids) { if (user_ids && user_ids.length > 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 < len; i++) { img = collection[i]; if (img.naturalWidth === 0) { $(img).attr( 'src', '/html/assets/default-avatar.png'); } } }; if (isIdeaPage) { avatars = $('.CommentList .UserAvatar img'); len = avatars.length; inlineColorStyleEle=".lia-user-name-link"; itemWrapperEle=".MessageView"; } else if (isNotesPage) { // broken avatars $('.lia-notes-thread-stream-list').on('scroll', function () { var collection = $('.lia-notes-thread-stream-list img'); var len = collection.length; var i; var img; for (i = 0; i < len; i++) { img = collection[i]; if (img.complete && img.naturalWidth === 0) { $(img).attr( 'src', '/html/assets/default-avatar.png'); } } }); $('.inpage-notes-search .lia-button-searchForm-action').click(function () { setTimeout(function () { // it takes a moment if (window.location.href.indexOf('?q=') !== -1) { $('body').addClass('privateNotesSearch'); } else { $('body').removeClass('privateNotesSearch'); } }, 1000); }); notesPageAvatars(); if (window.location.href.indexOf('?q=') !== -1) { $('body').addClass('privateNotesSearch'); } else { $('body').removeClass('privateNotesSearch'); } } else if (isForumTopicPage) { // only topic has info avatars = $('.lia-component-topic-message .UserAvatar img'); len = avatars.length; inlineColorStyleEle=".lia-user-name-link"; itemWrapperEle=".MessageView"; // special case for replies targetReplies = true; } for (i = 0; i < len; i++) { avatar = avatars[i]; title = avatar.title; // traverse upto the wrapper and downto Ele user = $(avatar).closest(itemWrapperEle).find(inlineColorStyleEle) // split the styleAttr and get hex or transparent myColor = user.attr('style') ? user.attr('style').split(':')[1] : 'transparent'; // if lower or mid-level do not display rank-ring if (myColor === '#000000') { $(avatar).css('border', '3px solid transparent'); } else { $(avatar).css('border', '3px solid ' + myColor); } } if (targetReplies) { getUserIds(); } }; var customerSurvey = function () { var CONST = { surveyName: 'Survey', surveyURL: 'https://aka.ms/TechCommunity/Nov/Survey', surveyEnabled: 'false', surveyExpires: '14', surveyCTA: 'Tell us about your experiences in the Microsoft Tech Community', surveyColor: '', surveyImage: '' }; var isHidden; var isUnique = function (item, Arr) { var i; var len = Arr.length; var ret = true; for (i = 0; i < len; i++) { if (item === Arr[i]) { ret = false; break; } } return ret; }; var cookieVal; var markup = '
'; 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 < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1); if (c.indexOf(name) == 0) return c.substring(name.length, c.length); } return "false"; }, clear: function (cname) { cookie.set(cname, "", -1); } }; isHidden = CONST.surveyImage !== '' ? 'has-image' : ''; markup = markup.replace('{0}', CONST.surveyColor) .replace('{1}', CONST.surveyCTA) .replace('{2}', CONST.surveyImage) .replace('{3}', isHidden); if (!$('body').hasClass('UserSsoRegistrationPage') && $('body').hasClass('lia-user-status-registered') && $(window).width() > 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 <= 0) { xhr.abort(); } else if ($('.contents .spinner', this).length == 0) { // already loaded if no spinner xhr.abort(); } }, error: function () { console.log('Unable to retrieve card data.'); }, success: function (data) { if (data.status == 'success') { // $('.contents', this).append(data.profile); $('.contents', this).html(data.profile); if ($('body').hasClass('learn')) { var userBio = $('#' + userIdValue).html(); $('.bottom-half', this).html(userBio); } } }, complete: function() { $('.contents .spinner', this).empty().remove(); $(this).removeClass('loading'); } }); } }); $('#lia-body .lia-content').on('mouseenter mouseleave keydown click', '.UserAvatarWrapper', function (evt) { // positions the card // trigger event that fetches card data shows card var adjustment; var card = $('.user-profile-card', this); var windowWidth = $(window).width(); var left = $(this).offset().left; var cardWidth = card.outerWidth(); var win = $(window); var viewport = { // first check the top bottom edges for placement top : win.scrollTop() }; var avatarTop = $(this).offset().top; var cardHeight = card.outerHeight(); viewport.bottom = viewport.top + win.height(); if ((left + cardWidth) > (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) { // alert user they didn't specify a user and abort xhr.abort(); } else if ($('.contents .spinner', this).length == 0) { // if the spinner is missing, we've already updated this card so just abort xhr.abort(); } }, error: function (err) { console.log('Unable to retrieve card data.'); console.log(err); }, success: function (data) { if (data.status === 'success') { // $('.contents', this).append(data.profile); $('.contents', this).html(data.profile); if ($('body').hasClass('learn')) { var userBio = $('#' + userIdValue).html(); $('.bottom-half', this).html(userBio); } } }, complete: function () { var collection = $(this).find('a, button').not(':hidden'); var me = this; $('.contents .spinner', this).empty().remove(); $(this).removeClass('loading'); for (i = 0; i < collection.length; i++) { if (i === 0) { $(collection[i]).addClass('first') } else if (i === collection.length - 1) { $(collection[i]).addClass('end') } } $(collection).on('keydown', function (e) { var card = me; var self = this; if ($(self).hasClass('first') && e.keyCode === 9 && e.shiftKey === true) { // should always have a wrapper $(card).closest('.UserAvatarWrapper').find('a.UserAvatar').eq(0).focus() $(card).hide(); } }); } }); } }); $('body').on('click', function(e) { var elementClass = $(e.target).attr('class'); if (elementClass != null && elementClass.indexOf("lia-user-avatar-message") >= 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() < 767) { markup = notificationMarkup.replace('{0}', notificationsTemplate); } markup = markup + messageMarkup.replace('{1}', messagesTemplate); $(markup).insertBefore('.lia-component-users-action-view-user-profile-modern') } }) $('.notifications-overlay-mail').click(function (e) { e.preventDefault(); e.stopPropagation(); $('.notifications-overlay-mail').hide(); $('.lia-autocomplete-input').val(''); $('.custom-lia-search').removeClass('expanded') }) $('#lia-body .lia-content').on('click', '.kudo-display-button', function(e) { window.location.href="https://techcommunity.microsoft.com/plugins/common/feature/oauth2sso/sso_login_redirect?lang=en&referer=https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fitaly-news-events%2Fgps-weekly-news-26-06-2023%2Fba-p%2F3856518"; }); }); function updateKudos(action, messageId) { $.ajax({ type: 'post', url: '/plugins/custom/microsoft/o365/custom-update-message-kudos?tid=1156990724172887006', dataType: 'html', data: {messageId: messageId, action: action}, scope: { action: action, id: messageId }, beforeSend: function (xhr, opts) { var scope = this.scope; // screen reader listens for change inside // and messages should always create a change var action = scope.action || ''; var actionObj = { 'add': 'Adding', 'remove': 'Removing' }; UTILITIES.accessibleAlert('pageLevel', actionObj[action] || ''); }, error: function (err) { console.log(err); UTILITIES.accessibleAlert('pageLevel', 'There was error liking message.'); }, success: function (data) { var scope = this.scope; var actionObj = { 'add': 'You liked this post', 'remove': 'You unliked this post' }; var message = actionObj[scope.action] || 'success'; UTILITIES.accessibleAlert('pageLevel', message); }, complete: function() {} }); } if ($('.InfoMessage').length > 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 < len; i++) {
item = items[i];
// authorId = item.children[0].children[0].href;
authorId = $(item).find('a').attr('href');
if (authorId) {
authorId = authorId.substring(authorId.lastIndexOf("https://techcommunity.microsoft.com/") + 1);
authorId = parseInt(authorId);
if (myId === authorId) {
$(item).addClass('my-profile-card');
if ($(item).find('.user-profile-card').length === 0) {
$(item).append(templateMarkup)
}
}
}
}
}
if ($('body').hasClass('lia-user-status-registered')) {
addCardTemplates(myId)
}
}
LITHIUM.PartialRenderProxy({"limuirsComponentRenderedEvent":"LITHIUM:limuirsComponentRendered","relayEvent":"LITHIUM:partialRenderProxyRelay","listenerEvent":"LITHIUM:partialRenderProxy"});
LITHIUM.AjaxSupport({"ajaxOptionsParam":{"event":"LITHIUM:partialRenderProxyRelay","parameters":{"javascript.ignore_combine_and_minify":"true"}},"tokenId":"ajax","elementSelector":document,"action":"partialRenderProxyRelay","feedbackSelector":false,"url":"https://techcommunity.microsoft.com/t5/blogs/v2/blogarticlepage.liabase.basebody.partialrenderproxy:partialrenderproxyrelay?t:ac=blog-id/ItalyNewsEvents/article-id/14","ajaxErrorEventName":"LITHIUM:ajaxError","token":"Se5HP3f7JpXWeMhT9p1t-g7sWl1_bbk3YHsmyyt6Cd8."});
LITHIUM.Auth.API_URL = '/t5/util/authcheckpage';
LITHIUM.Auth.LOGIN_URL_TMPL = '/plugins/common/feature/oauth2sso/sso_login_redirect?lang=en&referer=https%3A%2F%2FREPLACE_TEXT';
LITHIUM.Auth.KEEP_ALIVE_URL = '/t5/status/blankpage?keepalive';
LITHIUM.Auth.KEEP_ALIVE_TIME = 270000;
LITHIUM.Auth.CHECK_SESSION_TOKEN = '1322vp3A_OkfYY5iFLAj01IWZYWSaAf1D52GHN0Nypw.';
LITHIUM.AjaxSupport.useTickets = false;
LITHIUM.Cache.CustomEvent.set([{"elementId":"link_5","stopTriggerEvent":false,"fireEvent":"LITHIUM:selectMessage","triggerEvent":"click","eventContext":{"message":3856518}}]);
LITHIUM.Loader.runJsAttached();
// -->
Source by [author_name]



