mirror of
https://github.com/jsbin/jsbin.git
synced 2026-01-25 15:38:56 +00:00
21 lines
581 B
HTML
21 lines
581 B
HTML
var jsbin = {};
|
|
jsbin.user = {{{user}}};
|
|
|
|
if (jsbin.user && jsbin.user.name) {
|
|
$('.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();
|
|
}
|
|
var $menu = menu.append($html);
|
|
} else {
|
|
$('.loggedout').show();
|
|
} |