|
|
@ -3,8 +3,9 @@ define([
|
|
|
|
'/common/cryptpad-common.js',
|
|
|
|
'/common/cryptpad-common.js',
|
|
|
|
'/common/cryptget.js',
|
|
|
|
'/common/cryptget.js',
|
|
|
|
'/common/mergeDrive.js',
|
|
|
|
'/common/mergeDrive.js',
|
|
|
|
'/bower_components/file-saver/FileSaver.min.js'
|
|
|
|
'/api/config',
|
|
|
|
], function ($, Cryptpad, Crypt, Merge) {
|
|
|
|
'/bower_components/file-saver/FileSaver.min.js',
|
|
|
|
|
|
|
|
], function ($, Cryptpad, Crypt, Merge, ApiConfig) {
|
|
|
|
var saveAs = window.saveAs;
|
|
|
|
var saveAs = window.saveAs;
|
|
|
|
|
|
|
|
|
|
|
|
var USERNAME_KEY = 'cryptpad.username';
|
|
|
|
var USERNAME_KEY = 'cryptpad.username';
|
|
|
@ -15,6 +16,12 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var $upgrade = $('#upgrade');
|
|
|
|
var $upgrade = $('#upgrade');
|
|
|
|
|
|
|
|
var showUpgrade = function (text) {
|
|
|
|
|
|
|
|
if (ApiConfig.removeDonateButton) { return; }
|
|
|
|
|
|
|
|
if (localStorage.plan) { return; }
|
|
|
|
|
|
|
|
if (!text) { return; }
|
|
|
|
|
|
|
|
$upgrade.text(text).show();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var Messages = Cryptpad.Messages;
|
|
|
|
var Messages = Cryptpad.Messages;
|
|
|
|
|
|
|
|
|
|
|
@ -329,11 +336,9 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Cryptpad.isLoggedIn()) {
|
|
|
|
if (Cryptpad.isLoggedIn()) {
|
|
|
|
if (!Cryptpad.account.plan) {
|
|
|
|
showUpgrade(Messages.upgradeAccount);
|
|
|
|
$upgrade.text(Messages.upgradeAccount).show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$upgrade.text(Messages.supportCryptpad).show();
|
|
|
|
showUpgrade(Messages.supportCryptpad);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|