jsbin/views/user.html
Remy Sharp 1e5734e557 fix: smaller line numbers
Plus trying out fullstory
2017-04-13 10:39:56 +01:00

37 lines
947 B
HTML

var jsbin = {
'root': '{{root}}',
'shareRoot': '{{shareRoot}}',
'runner': '{{runner}}',
'static': '{{static}}',
'version': '{{version}}',
user: {{{user}}},
};
(function () {
if (jsbin.user && jsbin.user.name) {
if (window.FS) {
FS.identify(jsbin.user.name, {
displayName: jsbin.user.name,
reviewsWritten_int: 14,
});
}
$('.loggedout').hide();
var menu = $('.loggedin').show();
var html = $('#profile-template').text();
var $html = $(html.replace(/({.*?})/g, function (all, match) {
var key = match.slice(1, -1).trim(); // ditch the wrappers
return jsbin.user[key] || '';
}));
if (jsbin.user.pro) {
document.documentElement.className += ' pro';
$html.find('.gopro').remove();
} else {
$html.find('.pro').remove();
}
$('#control .loggedin').append($html);
} else {
$('.loggedin').hide();
$('.loggedout').show();
}
})();