Microsoft Tech Summit Announcements
','</SCRIPT>');
$('#message-list-id-' + msgId + ' .post-reply').remove();
$('#message-list-id-' + msgId + ' .post').after('');
$('#message-list-id-' + msgId + ' .post-reply').append(sanitize);
textBox.val('');
$(this).css("display", "none");
$('.cancel-button',$(this).parent()).css("display", "none");
} else {
$(this).before('' + data.message + '
');
}
},
complete: function() {
$('.spinner', $(this).parent()).empty().remove();
}
});
}
});
$('.add-reply-wrapper .cancel-button').click(function(){
var textBox = $('textarea',$(this).parent());
$.trim(textBox.val(''));
$(this).css("display", "none");
$('.reply-button',$(this).parent()).css("display", "none");
$('.error', $(this).parent()).empty().remove();
});
}
});
}
function getPopularConversations(mode, page) {
if(page == undefined || page == null) { page = 1; }
var categoryId = "TechSummit";
var messageContainer = $('#messages-recent-category-' + mode);
console.log("getPopularConversations function");
$.ajax({
type: 'post',
url: "/gxcuf89792/plugins/custom/microsoft/o365/custom-popular-conversations-messages",
dataType: 'html',
data: {'board': mode, 'categoryId': categoryId, 'page': page},
context: messageContainer,
beforeSend: function(xhr, opts) {
$(this).html('');
$(this).show();
},
error: function () {
var errorMarkup = 'There was an error loading messages.
';
$(this).html(errorMarkup);
switch(mode) {
case 'all':
allRecentConversationsLoaded = false;
break;
case 'favorite':
favoriteConversationsLoaded = false;
break;
}
},
success: function (data) {
$('.spinner', this).empty().remove();
$(this).html(data);
switch(mode) {
case 'all':
allRecentConversationsLoaded = true;
break;
case 'favorite':
favoriteConversationsLoaded = true;
break;
}
$(".pagination-MicrosoftIgnite-popular .pagination-pageNumber a").click(function(e){
e.preventDefault();
currentPageNumber = getPageNumber(this);
getPopularConversations("all", currentPageNumber)
});
$('.recent-conversations-messages-wrapper').on("click", ".reply-body", function () {
document.location = $(this).attr('href');
});
$('.message-add-reply .message-textarea').focus(function(){
$('.cancel-button',$(this).parent().parent()).css("display", "block");
$('.reply-button',$(this).parent().parent()).css("display", "block");
});
$('.CategoryPage .message-add-reply .reply-button').click(function() {
var msgId = $(this).attr('msg-id');
var textBox = $('textarea',$(this).parent());
var replyText = $.trim(textBox.val());
var replyHiddenText = $.trim(textBox.attr('data-hidden'));
if (replyText.length == 0) {
//validation error, report to client.
if($('.error', $(this).parent()).length == 0){
$(this).before('Your reply cannot be empty.
');
}
} else {
if(replyHiddenText.length != 0) {
var users = replyHiddenText.split(',');
for(var i = 0;i < users.length;i++) {
var user = users[i].split('*|*');
if(user.length > 1) {
var user_name = user[0];
var user_url = user[1];
var has_id_start = user_name.indexOf('(');
var user_login = user_name;
if(has_id_start > 0) {
user_login = user_name.substring(0, has_id_start);
}
var user_content = '' + user_login + '';
replyText = replyText.replace(user_name, user_content);
}
}
}
console.log("replyText: " + replyText);
$.ajax({
type: 'post',
url: '/plugins/custom/microsoft/o365/forum-page-add-reply?tid=-4114205252710127911',
data: {msgId: msgId, replyText: replyText},
dataType: 'json',
context: this,
error: function () {
$('.error', $(this).parent()).empty().remove();
$(this).before('An unknown error occurred while attempting to post your reply.
');
},
beforeSend: function() {
$(this).parent().prepend('');
},
success: function (data) {
var sanitize;
$('.error', $(this).parent()).empty().remove();
if (data.status == 'success') {
sanitize = data.payload.replace('','</SCRIPT>');
$('#message-list-id-' + msgId + ' .post-reply').remove();
$('#message-list-id-' + msgId + ' .post').after('');
$('#message-list-id-' + msgId + ' .post-reply').append(sanitize);
textBox.val('');
$(this).css("display", "none");
$('.cancel-button',$(this).parent()).css("display", "none");
} else {
$(this).before('' + data.message + '
');
}
},
complete: function() {
$('.spinner', $(this).parent()).empty().remove();
}
});
}
});
$('.add-reply-wrapper .cancel-button').click(function(){
var textBox = $('textarea',$(this).parent());
$.trim(textBox.val(''));
$(this).css("display", "none");
$('.reply-button',$(this).parent()).css("display", "none");
$('.error', $(this).parent()).empty().remove();
});
}
});
}
})(LITHIUM.jQuery);
;(function($) {
$(document).ready(function() {
$('.top-contributor-wrapper .UserAvatar > img').each(function(e) {
$(this).attr('src', $(this).attr('src').replace("/avatar-display-size/message", "/avatar-display-size/profile"));
});
});
})(LITHIUM.jQuery);
;(function($) {
$(document).ready(function() {
var s = document.createElement('script');
s.src = "//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-58c9bc2b1cff027e";
document.getElementsByTagName("head")[0].appendChild(s);
});
})(LITHIUM.jQuery);
;(function($) {
$(document).ready(function() {
var defaultColor = 'ffffff';
var itemClass = '#lia-body .custom-category-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-category-search-form .lia-component-common-widget-search-form .lia-search-input-wrapper .lia-search-input-message').attr("placeholder", "Search this community");
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($) {
/* Microsoft customization: Adding cookie related JS functions */
tech = window.tech || {};
(function (namespace) {
namespace.cookieBanner = cookieBanner;
var proto = cookieBanner.prototype;
//proto.consentCookieName = "cookie-banner";
// constructor
function cookieBanner() {};
// initialize the cookie consent api values
proto.init = function (cookieValues){
try {
if (proto.Error == null && cookieValues != null) {
proto.IsConsentRequired = cookieValues.IsConsentRequired;
proto.CookieName = cookieValues.CookieName;
proto.Css = cookieValues.Css[0];
proto.Domain = cookieValues.Domain;
proto.Js = cookieValues.Js[0];
proto.Locale = cookieValues.Locale;
proto.Markup = cookieValues.Markup;
proto.Error = cookieValues.Error;
proto.MinimumConsentDate = new Date(cookieValues.MinimumConsentDate).getTime();
}
}
catch(error) {
}
};
// Loads the Cookie API JS
// cache:false, causes the timestamp parameters to be added on the js, where the service is not accepting currently
proto.LoadJSCookieAPI = function (url, options) {
// Allow user to set any option except for dataType, cache, and url
options = $.extend(options || {}, {
dataType: "script",
cache: true,
url: url
});
return jQuery.ajax(options);
};
// Adds function BI cookies
proto.addBICookies = function () {
// Allow BI cookies
(function (a, b, c, d) {
a = '//tags.tiqcdn.com/utag/msft/lex-openedx/prod/utag.js';
b = document;
c = 'script';
d = b.createElement(c);
d.src = a;
d.type = 'text/java' + c;
d.async = true;
a = b.getElementsByTagName(c)[0];
a.parentNode.insertBefore(d, a);
})();
};
// set the time that consent is given
proto.setConsentTime = function (){
var d = new Date();
proto.setCookie("cookie-banner", d.getTime(), 13 * 30);
};
// sets the cookie given name, value and expiration days
// it sets the cookie for all the sub pages of the site
proto.setCookie = 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;
};
// gets the cookie value given the cookie name
proto.getCookie = 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";
};
proto.setOtherCookies = function() {
// add the fb cookie
!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', '261115950980540'); // Insert your pixel ID here.
fbq('track', 'PageView');
};
proto.setLithiumVisitorCookies = function () {
setcookie("VISITOR_BEACON", localStorage.getItem("VISITOR_BEACON"), 3650);
setcookie("LithiumVisitor", localStorage.getItem("LithiumVisitor"), 3650);
};
function setcookie (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;
};
}
(tech));
var cookieNotice = new tech.cookieBanner();
$(document).ready(function() {
var currentNavigatorLanguage = navigator.language;
$.ajax({
url: "https://uhf.microsoft.com/en-us/shell/api/mscc?sitename=msccdoc&domain=microsoft.com&country=euregion&mscc_eudomain=true",
cache: true,
success:
function(data) {
document.getElementById("cookie-markup").style.display = "none";
var minConsentDate = new Date(data.MinimumConsentDate).getTime();
if (data.IsConsentRequired){
var isConsentValid = false;
try {
var tempMSCCVal = cookieNotice.getCookie("MSCC");
if(tempMSCCVal > minConsentDate){
isConsentValid = true;
}
var css_link = document.createElement("link");
css_link.href = data.Css;
css_link.rel = "stylesheet";
css_link.type = "text/css";
$("head").append(css_link);
cookieNotice.LoadJSCookieAPI( data.Js ).done(function() {
if (mscc && mscc.hasConsent()) {
// console.log('adding non essential cookies');
cookieNotice.addBICookies();
cookieNotice.setOtherCookies();
cookieNotice.setLithiumVisitorCookies();
} else if (mscc) {
// console.log('showing cookie banner');
checkClickedLinks();
var cookieMarkup = data.Markup;
$("#cookie-markup").prepend(cookieMarkup);
document.getElementById("cookie-markup").style.display = "block";
document.getElementById("msccBanner").style.display = "block";
}
});
} catch(Error){}
}
},
error:
function (xhr, status, error) {
console.log(error);
}
});
});
var checkClickedLinks = function () {
var allLinks = document.links;
// Bind the event handler to each link individually
for (var i = 0, n = allLinks.length; i < n; i++) {
//allLinks[i].addEventListener('click', function (event) {});
allLinks[i].onclick = function () {
console.log('link clicked!');
mscc.setConsent();
mscc.on('consent', cookieNotice.addBICookies);
mscc.on('consent', setConsentTime);
};
}
};
var setConsentTime = function (){
console.log('line 183: setConsentTime');
var d = new Date();
setCookie("cookie-banner", d.getTime(), 13 * 30);
}
// sets the cookie given name, value and expiration days
// it sets the cookie for all the sub pages of the site
var setCookie = function (cname, cvalue, exdays) {
console.log('line 191: setCookie');
console.log('line 192: '+ 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;
};
var delete_cookie = function(name) {
document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
};
var getCookie = 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";
};
$(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 makeLabelsClickable = function () {
$('.ForumTopicPage .LabelsList').each(function(i) {
$('.LabelsList').eq(i).click(function (e) {
var boardId = 'TechSummit';
if (boardId != "MicrosoftIgniteContent2017") {
var URL_TEMPLATE = "/t5/forums/filteredbylabelpage/board-id/{0}/label-name/{1}";
var newURL;
var labelStr = (e.target.tagName === 'SPAN' && $.inArray('label-link', e.target.classList) !== -1) ?
e.target.innerText : 'unknown';
if (boardId !== '' && labelStr !== 'unknown') {
newURL = URL_TEMPLATE.replace('{0}', boardId).replace('{1}', encodeURIComponent(labelStr));
window.location = newURL;
} else {
return false;
}
}
});
});
};
var addRankRings = function() {
var avatars = $('#messageList .UserAvatar img');
var len = avatars.length;
var i;
var avatar;
var title;
var user;
var myColor;
if (!$('body').hasClass('ForumPage')) {
for (i = 0; i < len; i++) {
avatar = avatars[i];
title = avatar.title;
user = $(avatars[i].parentElement.parentElement.parentElement.nextElementSibling).find('.UserName a');
myColor = user.attr('style').split(':')[1];
// if lower or mid-level do not display rank-ring
if (myColor === '#000000') {
$(avatar).addClass('noAvatar');
} else {
$(avatar).css('border', '3px solid ' + myColor);
}
}
}
};
addRankRings();
makeLabelsClickable();
// mousenter on space level message list
$('#lia-body .lia-content .lia-component-messages-column-message-author-avatar').on('mouseenter', function() {
$(this).addClass('UserAvatarWrapper');
var hrefString = $(this).find("a").attr("href");
hrefString = hrefString.split('/');
var userIdValue = hrefString[5];
var checkExistdiv = $(this).find(".user-profile-card");
var divLength = $(checkExistdiv).length;
if (divLength == 0) {
$(this).append("");
}
var card = $('.user-profile-card', this);
if (!card.hasClass('loading')) {
card.addClass('loading');
//card.trigger('MSFT.fetchFollowStatus');
$.ajax({
type: 'post',
url: '/gxcuf89792/plugins/custom/microsoft/o365/fetch-user-profilecard?tid=-4114205252710127911',
dataType: 'json',
data: {
'userId': userIdValue,
'currentPageURL': '\/t5/Microsoft-Tech-Summit/ct-p/TechSummit'
},
context: this,
beforeSend: function(xhr, opts) {
if (userIdValue <= 0) {
xhr.abort();
} else if ($('.contents .spinner', this).length == 0) {
xhr.abort();
}
},
error: function () {
console.log('Unable to retrieve card data.');
},
success: function (data) {
if (data.status == 'success') {
$('.contents', this).append(data.profile);
}
},
complete: function() {
$('.contents .spinner', this).empty().remove();
$(this).removeClass('loading');
}
});
}
});
$('#lia-body .lia-content').on('mouseenter', '.UserAvatarWrapper', function() {
var card = $('.user-profile-card', this);
if (!card.hasClass('loading')) {
card.addClass('loading');
card.trigger('MSFT.fetchFollowStatus');
}
var windowWidth = $(window).width();
var left = $(this).offset().left;
var cardWidth = card.outerWidth();
if ((left + cardWidth) > (windowWidth - 25)) {
var adjustment = (left + cardWidth) - (windowWidth + 25) + 50;
card.css('left', (-1 * adjustment) + 'px');
}
var win = $(window);
var viewport = {
top : win.scrollTop()
};
viewport.bottom = viewport.top + win.height();
var avatarTop = $(this).offset().top;
var cardHeight = card.outerHeight();
if ((avatarTop + cardHeight + 25) > (viewport.bottom)) {
var adjustment = -1 * (cardHeight);
card.css('top', adjustment + 'px');
} else {
card.css('top', '100%');
}
});
$('#lia-body .lia-content').on('MSFT.fetchFollowStatus', '.UserAvatarWrapper .user-profile-card', function() {
if (!isNaN($(this).attr('data-user-id'))) {
var userId = parseInt($(this).attr('data-user-id'), 10);
$.ajax({
type: 'post',
url: '/gxcuf89792/plugins/custom/microsoft/o365/fetch-user-profilecard?tid=-4114205252710127911',
dataType: 'json',
data: {
'userId': userId,
'currentPageURL': '\/t5/Microsoft-Tech-Summit/ct-p/TechSummit'
},
context: this,
beforeSend: function(xhr, opts) {
if (userId <= 0) {
xhr.abort();
} else if ($('.contents .spinner', this).length == 0) {
xhr.abort();
}
},
error: function () {
console.log('Unable to retrieve card data.');
},
success: function (data) {
if (data.status == 'success') {
$('.contents', this).append(data.profile);
}
},
complete: function() {
$('.contents .spinner', this).empty().remove();
$(this).removeClass('loading');
}
});
}
});
$('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();
}
}
});
});
})(LITHIUM.jQuery);
;(function($) {
$(document).ready(function () {
$('#lia-body .lia-content').on('click', '.kudo-display-button', function(e) {
window.location.href = '/plugins/common/feature/oauth2sso/sso_login_redirect?referer=https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FMicrosoft-Tech-Summit%2Fct-p%2FTechSummit';
});
});
function addKudos(messageId) {
updateKudos('add', messageId);
}
function removeKudos(messageId) {
updateKudos('remove', messageId);
}
function updateKudos(action, messageId) {
$.ajax({
type: 'post',
url: '/gxcuf89792/plugins/custom/microsoft/o365/custom-update-message-kudos',
dataType: 'html',
data: {messageId: messageId, action: action},
context: this,
beforeSend: function(xhr, opts) {},
error: function () {console.log("error");},
success: function (data) {},
complete: function() {}
});
}
})(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;
}
}
new Image().src = ["/","b","e","a","c","o","n","/","2","3","5","6","7","9","8","2","2","6","1","_","1","5","1","2","9","1","2","9","0","9","3","2","7",".","g","i","f"].join("");
LITHIUM.Auth.API_URL = '/t5/util/authcheckpage';
LITHIUM.Auth.LOGIN_URL_TMPL = '/plugins/common/feature/oauth2sso/sso_login_redirect?referer=https%3A%2F%2FREPLACE_TEXT';
LITHIUM.Auth.KEEP_ALIVE_URL = '/t5/status/blankpage?keepalive';
LITHIUM.Auth.KEEP_ALIVE_TIME = 300000;
LITHIUM.Auth.CHECK_SESSION_TOKEN = 'rJSviOByD_5kXTFP1aIz29MfauYrsEwPPBFqFumubKM.';
LITHIUM.AjaxSupport.useTickets = false;
LITHIUM.Loader.runJsAttached();
// -->