System Center Virtual Machine Manager
','</SCRIPT>');
if($('#custom-message-list-item-' + msgId + ' .message-replies').length){
$('#custom-message-list-item-' + msgId + ' .message-replies').prepend(sanitize);
} else {
$('#custom-message-list-item-' + msgId + ' .scroll-anchor').after('');
$('#custom-message-list-item-' + msgId + ' .message-replies').append(sanitize);
}
textBox.val('');
document.getElementById('reply-to-' + msgId).scrollIntoView();
$(this).css("display", "none");
$('.cancel-button',$(this).parent()).css("display", "none");
} else {
$(this).before('' + data.message + '
');
}
},
complete: function() {
$('.spinner', $(this).parent()).empty().remove();
}
});
}
});
$('.message-add-reply .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();
});
$('.message-add-reply .message-textarea').focus(function(){
$('.cancel-button',$(this).parent().parent()).css("display", "block");
$('.reply-button',$(this).parent().parent()).css("display", "block");
});
});
})(LITHIUM.jQuery);
$.getScript( "/html/assets/bootstrap-suggest.js", function() {
var users = [];
var endpoint_url = '/gxcuf89792/plugins/custom/microsoft/o365/custom.user-search';
$('textarea').suggest('@', {
data: users,
filter: {limit: 10},
map: function(user) {
if(user.org_name && user.org_name.length > 0) {
user.org_name = '(' + user.org_name + ')';
}
var avatar_img_class = "user-avatar-message";
var avatar_img_style = "";
if (user.rank_name == "MVP" || user.rank_name == "Community Manager" || user.rank_name == "Microsoft") {
avatar_img_class += " user-rank-ring";
avatar_img_style = "border-color: #" + user.rank_color + "; border-style: solid; border-width: 3px;";
}
var avatar = '';
return {
value: user.login_id,
text: avatar + ''+user.username+'
' + user.org_name + '
',
u_id: user.id,
username: user.username,
url: user.url
}
},
onlookup: function(e, item) {
users = [];
users.length = 0;
;(function($) {
$.ajax({
type: 'post',
url: endpoint_url,
dataType: 'json',
data: {q: item},
async: false,
beforeSend: function(xhr, opts) {},
error: function () {},
success: function (data) {
for(var i = 0;i < data.users.length;i++) {
users.push({username: data.users[i].login, login_id: data.users[i].login_id, rank_name: data.users[i].rank_name, rank_color: data.users[i].rank_color, id: data.users[i].id, url: data.users[i].url, avatar: data.users[i].avatar, default_avatar: data.users[i].default_avatar, org_name: data.users[i].org_name});
}
return;
},
complete: function() {}
});
})(LITHIUM.jQuery);
this.options.data = users;
this.$dropdown.find('.dropdown-menu').empty();
for (var i = 0;i < this.options.data.length;i++) {
if ($item = this.__mapItem(this.options.data[i]))
this.$dropdown.find('.dropdown-menu').append($item);
}
this.$items = this.$dropdown.find('li:has(a)');
this.show();
}
});
});(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-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($) {
/* 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 = 'SystemCenterVirtualMachineManager';
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/System-Center-Virtual-Machine/bd-p/SystemCenterVirtualMachineManager'
},
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/System-Center-Virtual-Machine/bd-p/SystemCenterVirtualMachineManager'
},
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%2FSystem-Center-Virtual-Machine%2Fbd-p%2FSystemCenterVirtualMachineManager';
});
});
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","7","1","4","2","8","9","1","5","_","1","5","1","2","9","1","8","5","9","8","6","5","4",".","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 = 'FRdjwmB0iKrVPue5u0f4He2MZXGV5hXDF7BgJq9dwUg.';
LITHIUM.AjaxSupport.useTickets = false;
LITHIUM.Loader.runJsAttached();
// -->