diff --git a/customize.dist/src/less2/include/creation.less b/customize.dist/src/less2/include/creation.less index d82c47adf..4bc5f2d80 100644 --- a/customize.dist/src/less2/include/creation.less +++ b/customize.dist/src/less2/include/creation.less @@ -1,35 +1,146 @@ @import (once) "./colortheme-all.less"; +@import (once) "./tools.less"; .creation_main() { - #cp-creation { - position: fixed; - z-index: 10000000; // #loading - top: 0px; - bottom: 0px; - left: 0px; - right: 0px; + .tippy-popper { + z-index: 100000001 !important; + } + #cp-creation-container { + //position: fixed; + z-index: 100000000; // #loading * 10 + //top: 0px; + //bottom: 0px; + //left: 0px; + //right: 0px; background: @colortheme_loading-bg; color: @colortheme_loading-color; + display: flex; + align-items: center; + width: 100%; + height: 100%; + overflow: auto; + @media screen and (max-height: 600px), screen and (max-width: 500px) { + align-items: baseline; + } + } + #cp-creation { text-align: center; - font-size: 1.5em; - .cp-loading-container { - margin-top: 50vh; - transform: translateY(-50%); + font: @colortheme_app-font; + width: 100%; + & > div { + width: 60vw; + max-width: 100%; + margin: 40px auto; + text-align: left; + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; + h2, p { + width: 100%; + } + h2 { + display: flex; + justify-content: space-between; + .cp-creation-help { + display: none; + } + } + @media screen and (max-width: 500px) { + width: ~"calc(100% - 30px)"; + } + @media screen and (max-height: 600px), screen and (max-width: 500px) { + h2 .cp-creation-help { + display: inline; + } + p { + display: none; + } + } + @media screen and (min-height: 601px) { + @media screen and (min-width: 501px) { + p { + display: block !important; + } + } + } } - .cp-loading-cryptofist { - margin-left: auto; - margin-right: auto; - height: 300px; - margin-bottom: 2em; - @media screen and (max-height: @browser_media-short-screen) { - display: none; + + .cp-creation-create{ + button { + .tools_unselectable(); + padding: 15px; + background: darken(@colortheme_loading-bg, 10%); + color: @colortheme_loading-color; + margin: 3px 10px; + border: none; + cursor: pointer; + &:hover { + background: darken(@colortheme_loading-bg, 5%); + } + } + } + + input[type="radio"] { + display: none; + &:checked { + & + label { + font-weight: bold; + background-color: lighten(@colortheme_loading-bg, 20%); + cursor: default; + border: 1px solid #c1158e; + &:hover { + background-color: lighten(@colortheme_loading-bg, 20%); + } + } } } - .cp-loading-spinner-container { - position: relative; - height: 100px; - > div { - height: 100px; + input[type="radio"] + label { + .tools_unselectable(); + padding: 15px; + display: inline-flex; + align-items: center; + justify-content: center; + width: 200px; + height: 50px; + padding: 5px; + margin: 0 20px; + border: 1px solid @colortheme_loading-color; + cursor: pointer; + &:hover { + background-color: lighten(@colortheme_loading-bg, 10%); + } + } + .cp-creation-expire { + #cp-creation-expire-true { + display: none; + &:checked { + & + label { + height: 100px; + .cp-creation-expire-picker { + display: inline; + } + } + } + } + label[for="cp-creation-expire-true"] { + flex-wrap: wrap; + .cp-creation-expire-picker { + display: none; + } + input { + width: 70px; + } + select { + width: 100px; + } + input, select { + border: none; + height: 30px; + background: @colortheme_loading-bg; + color: @colortheme_loading-color; + border-radius: 3px; + } } } } diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 90ce1871e..d39d09326 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -787,5 +787,24 @@ define(function () { out.feedback_privacy = "We care about your privacy, and at the same time we want CryptPad to be very easy to use. We use this file to figure out which UI features matter to our users, by requesting it along with a parameter specifying which action was taken."; out.feedback_optout = "If you would like to opt out, visit your user settings page, where you'll find a checkbox to enable or disable user feedback"; + // Creation page + out.creation_404 = "This pad not longer exists. Use the following form to create a new pad"; + out.creation_ownedTitle = "Type of pad"; + out.creation_ownedTrue = "Owned pad"; + out.creation_ownedFalse = "Open pad"; + out.creation_owned1 = "An owned pad is a pad that you can delete from the server whenever you want. Once it is deleted, no one else can access it, even if it is stored in their CryptDrive."; + out.creation_owned2 = "An open pad doesn't have any owner and thus, it can't be deleted from the server unless it has reached its expiration time."; + out.creation_expireTitle = "Life time"; + out.creation_expireTrue = "Add a life time"; + out.creation_expireFalse = "Unlimited"; + out.creation_expireHours = "Hours"; + out.creation_expireDays = "Days"; + out.creation_expireMonths = "Months"; + out.creation_expire1 = "By default, a pad stored by a registered users will never be removed from the server, unless it is requested by its owner."; + out.creation_expire2 = "If you prefer, you can set a life time to make sure the pad will be permanently deleted from the server and unavailable after the specified date."; + out.creation_createTitle = "Create a pad"; + out.creation_createFromTemplate = "From template"; + out.creation_createFromScratch = "From scratch"; + return out; }); diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index e9487859f..cfdb221a8 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -6,11 +6,12 @@ define([ '/common/common-language.js', '/common/common-interface.js', '/common/common-feedback.js', + '/common/hyperscript.js', '/common/media-tag.js', '/customize/messages.js', 'css!/common/tippy.css', -], function ($, Config, Util, Hash, Language, UI, Feedback, MediaTag, Messages) { +], function ($, Config, Util, Hash, Language, UI, Feedback, h, MediaTag, Messages) { var UIElements = {}; // Configure MediaTags to use our local viewer @@ -1119,33 +1120,124 @@ define([ }); }; - UIElements.getPadCreationScreen = function (common, Toolbar, cb) { + UIElements.getPadCreationScreen = function (common, cb) { if (!common.isLoggedIn()) { return void cb(); } var sframeChan = common.getSframeChannel(); var metadataMgr = common.getMetadataMgr(); + var type = metadataMgr.getMetadataLazy().type; var $body = $('body'); - var $creation = $('