Make automatic pad storage configurable

This commit is contained in:
yflory
2018-08-28 11:42:48 +02:00
parent e8a5244362
commit 9ebb598467
13 changed files with 288 additions and 82 deletions

View File

@@ -9,7 +9,7 @@ define([
var Pages = {};
var urlArgs = Config.requireConf.urlArgs;
var setHTML = function (e, html) {
var setHTML = Pages.setHTML = function (e, html) {
e.innerHTML = html;
return e;
};
@@ -712,11 +712,15 @@ define([
$(input).change(function () { $(mark).focus(); });
return h('label.cp-radio', labelOpts, [
var radio = h('label', labelOpts, [
input,
mark,
label
]);
$(radio).addClass('cp-radio');
return radio;
};
Pages['/user/'] = Pages['/user/index.html'] = function () {

View File

@@ -49,6 +49,12 @@
background-color: @colortheme_checkmark-back2;
border-color: @colortheme_checkmark-back2;
}
&:disabled ~ .cp-checkmark-mark {
background-color: @colortheme_checkmark-disabled;
}
&:disabled ~ .cp-checkmark-label {
color: @colortheme_checkmark-disabled;
}
}
}
&:hover .cp-checkmark-mark {
@@ -64,6 +70,12 @@
display: block;
}
}
&:disabled ~ .cp-checkmark-mark {
background-color: @colortheme_checkmark-disabled;
}
&:disabled ~ .cp-checkmark-label {
color: @colortheme_checkmark-disabled;
}
}
.cp-checkmark-label {
@@ -128,6 +140,12 @@
&:checked ~ .cp-radio-mark {
background-color: @colortheme_checkmark-back2;
}
&:disabled ~ .cp-checkmark-mark {
background-color: @colortheme_checkmark-disabled;
}
&:disabled ~ .cp-checkmark-label {
color: @colortheme_checkmark-disabled;
}
}
}
&:hover .cp-radio-mark {
@@ -143,6 +161,12 @@
display: block;
}
}
&:disabled ~ .cp-checkmark-mark {
background-color: @colortheme_checkmark-disabled;
}
&:disabled ~ .cp-checkmark-label {
color: @colortheme_checkmark-disabled;
}
}
.cp-checkmark-label {

View File

@@ -143,3 +143,4 @@
@colortheme_checkmark-col1: @colortheme_form-color;
@colortheme_checkmark-back2: @colortheme_form-bg-alt;
@colortheme_checkmark-col2: @colortheme_form-color-alt;
@colortheme_checkmark-disabled: #AAA;

View File

@@ -6,6 +6,7 @@
& {
@corner-button-ok: #2c9b00;
@corner-button-cancel: #990000;
@corner-link: #ffff7a;
@keyframes appear {
0% {
@@ -15,6 +16,14 @@
transform: scale(1.0);
}
}
@keyframes minimize {
0% {
transform: scale(1.0);
}
100% {
transform: scale(0.1);
}
}
.cp-corner-container {
position: absolute;
@@ -28,18 +37,51 @@
background-color: @colortheme_logo-1;
color: @colortheme_base;
z-index: 999;
scale: 0.1;
transform-origin: bottom right;
animation: appear 0.8s ease-in-out;
box-shadow: 0 0 10px 0 @colortheme_logo-1;
//transform: scale(0.1);
//transform: scale(1);
.cp-corner-filler {
float: left;
clear: left;
height: 21px;
}
.cp-corner-text {
.cp-corner-minimize, .cp-corner-maximize {
position: absolute;
height: 15px;
width: 20px;
top: 0;
right: 0;
font-size: 12px;
text-align: left;
cursor: pointer;
line-height: 15px;
display: none;
&:hover {
color: darken(@colortheme_base, 15%);
}
}
.cp-corner-minimize {
display: inline;
}
&.cp-minimized {
transition: transform 0.8s ease-in-out;
transform: scale(0.1);
animation: none;
.cp-corner-text, .cp-corner-actions, .cp-corner-footer {
display: none;
}
.cp-corner-maximize {
display: inline;
font-size: 130px;
width: 180px;
height: 200px;
line-height: 200px;
}
}
.cp-corner-actions {
min-height: 30px;
margin: 15px auto;
@@ -48,6 +90,12 @@
.cp-corner-footer {
font-style: italic;
font-size: 0.8em;
a {
color: @corner-link;
&:hover {
color: darken(@corner-link, 20%);
}
}
}
button {

View File

@@ -565,6 +565,14 @@ define(function () {
out.settings_importConfirm = "Are you sure you want to import recent pads from this browser to your user account's CryptDrive?";
out.settings_importDone = "Import completed";
out.settings_autostoreTitle = "Pad storage in CryptDrive";
out.settings_autostoreHint = "<b>Automatic</b> pad storage results in all the pads you visit being stored in your CryptDrive.<br>" +
"<b>Manual (always ask)</b> results in the pads not being stored but a reminder will appear to ask you if you want to store them in CryptDrive.<br>" +
"<b>Manual (never ask)</b> results in the pads not being stored and option to store them will be available but in a hidden way.";
out.settings_autostoreYes = "Automatic";
out.settings_autostoreNo = "Manual (never ask)";
out.settings_autostoreMaybe = "Manual (always ask)";
out.settings_userFeedbackTitle = "Feedback";
out.settings_userFeedbackHint1 = "CryptPad provides some very basic feedback to the server, to let us know how to improve your experience. ";
out.settings_userFeedbackHint2 = "Your pad's content will never be shared with the server.";
@@ -1227,10 +1235,13 @@ define(function () {
out.sharedFolders_share = "Share this URL with other registered users to give them access to the shared folder. Once they open this URL, the shared folder will be added to the root directory of their CryptDrive.";
// Manual pad storage popup
out.manual_notstored = "This pad is not stored in your drive. Do you want to store it now?"; // XXX
out.manual_settings = "You can enable automatic pad storage in your Settings page!"; // XXX
out.manual_store = "Store";
out.manual_hide = "Don't store";
out.autostore_notstored = "This pad is not in your CryptDrive. Do you want to store it now?"; // XXX
out.autostore_settings = "You can enable automatic pad storage in your <a href=\"/settings/\">Settings</a> page!"; // XXX
out.autostore_store = "Store";
out.autostore_hide = "Don't store";
out.autostore_error = "Unexpected error: we were unable to store this pad, please try again.";
out.autostore_saved = "The pad was successfully stored in your CryptDrive!";
out.autostore_forceSave = "Store the file in CryptDrive"; // File upload modal
return out;
});