add upgrade button to all static pages

This commit is contained in:
ansuz
2017-05-30 18:39:41 +02:00
parent 149568689a
commit ebfa228bc0
13 changed files with 81 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ define([
'jquery',
'/customize/application_config.js',
'/common/cryptpad-common.js'
], function ($, Config, Cryptpad) {
], function ($, Config, Cryptpad, ApiConfig) {
window.APP = {
Cryptpad: Cryptpad,
@@ -19,6 +19,8 @@ define([
$sel.find('button').addClass('btn').addClass('btn-secondary');
$sel.show();
var $upgrade = $('#upgrade');
// User admin menu
var $userMenu = $('#user-menu');
var userMenuCfg = {
@@ -31,7 +33,6 @@ define([
$('.cryptpad-dropdown').hide();
});
// main block is hidden in case javascript is disabled
$main.removeClass('hidden');
@@ -57,11 +58,17 @@ define([
});
});
if (!localStorage.plan) {
$upgrade.show().text(Messages.upgradeAccount);
}
$loggedInBlock.removeClass('hidden');
//return;
} else {
$main.find('#userForm').removeClass('hidden');
$('#name').focus();
$upgrade.show().text(Messages.supportCryptpad);
}
var displayCreateButtons = function () {
@@ -88,8 +95,8 @@ define([
var $block = Cryptpad.createDropdown(dropdownConfig);
$block.find('button').addClass('btn').addClass('btn-primary');
$block.appendTo($parent);
};
};
/* Log in UI */
var Login;