diff --git a/customize.dist/src/less2/include/alertify.less b/customize.dist/src/less2/include/alertify.less index c3767f073..344e590b5 100644 --- a/customize.dist/src/less2/include/alertify.less +++ b/customize.dist/src/less2/include/alertify.less @@ -165,7 +165,7 @@ margin-bottom: @alertify_padding-base; margin: 0; overflow: auto; - :last-child { + &:last-child { margin-bottom: 0; } } @@ -197,7 +197,7 @@ background-color: @alertify-light-bg; } &.disabled { - color: #949494; + color: @colortheme_alertify-cancel-border; cursor: not-allowed; } &:not(.alertify-tabs-active) { diff --git a/customize.dist/src/less2/include/forms.less b/customize.dist/src/less2/include/forms.less index db3ad3fbd..0acbd49b4 100644 --- a/customize.dist/src/less2/include/forms.less +++ b/customize.dist/src/less2/include/forms.less @@ -98,6 +98,7 @@ text-decoration: none; cursor: pointer; border-radius: 0; + transition: none; .fa, .cptools { margin-right: 0.2em; @@ -160,6 +161,15 @@ } } + &.btn-light { + border-color: @cryptpad_text_col; + color: @cryptpad_text_col; + background-color: transparent; + &:hover, &:hover, &:focus { + background-color: fade(@cryptpad_text_col, 25%); + } + } + &.cancel, &.btn-cancel { border-color: @colortheme_alertify-cancel-border; color: @colortheme_alertify-cancel-border; diff --git a/customize.dist/src/less2/include/modals-ui-elements.less b/customize.dist/src/less2/include/modals-ui-elements.less index 3855d15a8..27eb233da 100644 --- a/customize.dist/src/less2/include/modals-ui-elements.less +++ b/customize.dist/src/less2/include/modals-ui-elements.less @@ -141,6 +141,69 @@ margin-left: 10px; } + .cp-snapshots-modal { + & > input:last-child { + margin-bottom: 0 !important; + } + } + .cp-snapshots-container { + @snapshot_spacing: 10px; + display: flex; + flex-flow: column; + color: @cryptpad_text_col; + margin-bottom: @snapshot_spacing; + max-height: 245px; + overflow: auto; + outline: none; + .cp-snapshot-spinner { + min-height: 90px; + text-align: center; + } + .cp-snapshot-element { + display: flex; + align-items: center; + padding: 5px 0; + outline: none; + & > i { + margin-left: @snapshot_spacing; + text-align: center; + } + .cp-snapshot-title { + margin-left: @snapshot_spacing; + display: flex; + flex-flow: column; + flex: 1; + min-width: 0; + span { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .cp-snapshot-time { + font-size: 12px; + } + } + .cp-snapshot-buttons { + margin-left: @snapshot_spacing; + display: none; + align-items: flex-start; + margin-bottom: -3px; + .cp-button-confirm { + margin-right: @snapshot_spacing; + } + button { + margin-right: @snapshot_spacing; + } + } + &:hover, &:focus, &:focus-within { + .cp-snapshot-buttons { + display: flex; + } + background-color: #DDD; + } + } + } + // mediatag preview #cp-mediatag-preview-modal { .cp-modal { diff --git a/customize.dist/src/less2/include/toolbar-history.less b/customize.dist/src/less2/include/toolbar-history.less index 7538fb2bc..155265a44 100644 --- a/customize.dist/src/less2/include/toolbar-history.less +++ b/customize.dist/src/less2/include/toolbar-history.less @@ -5,92 +5,256 @@ } & { .cp-toolbar-history { + + @history_lineBg: #FFFFFF; + @history_userBg1: #DDD; + @history_userBg2: #BBB; + @pos-color: @cryptpad_text_col; + @fill-width: 40px; + display: none; - text-align: center; width: 100%; - padding: 10px 0; + padding: 10px 0 0; align-items: center; justify-content: center; + color: @cryptpad_text_col; * { font: @colortheme_app-font; } - .cp-history-filler { - flex: 1; + + + @media screen and (max-width: 870px) { + flex-flow: column; + .cp-toolbar-history-actions { + width: 100%; + .cp-history-actions-first { + margin-right: 0 !important; + } + } + .cp-toolbar-history-timeline { + width: ~"calc(100% - 20px)"; + margin-right: 10px !important; + } } - .cp-toolbar-history-close, - .cp-toolbar-history-revert { - background: white; - color: black; - //margin-top: 5px; - &:hover { - background-color: #e6e6e6; + + @media screen and (max-height: 500px) { + padding-top: 0px; + .cp-history-timeline-line { + display: none !important; + } + .cp-toolbar-history-timeline { + width: 100% !important; + margin: 0 !important; + } + .cp-history-timeline-actions { + margin-left: 0 !important; } } - .cp-toolbar-history-loadmore { - height: 100%; - color: black; - width: 25px; - position: absolute; - left: 0; + + &.cp-history-init { padding: 0; + height: 32px; } - .cp-toolbar-history-version { - position: absolute; - height: 25px; - line-height: 25px; - width: 100%; - text-align: center; - color: black; - } - .cp-toolbar-history-goto { - display: inline-block; - vertical-align: middle; - text-align: center; + + .cp-toolbar-history-timeline { + display: flex; + flex-flow: column; flex: 1; - flex-basis: 80%; - min-width: 0; - max-width: 600px; - input { width: 75px; } + margin-left: 10px; + margin-right: @fill-width; + .cp-history-timeline-time { + font-size: 12px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + flex: 1; + min-width: 0; + text-align: center; + } } - .cp-toolbar-history-goto-input { - padding-left: 5px; - margin-left: 5px; - vertical-align: middle; + .cp-toolbar-history-actions { + display: flex; + justify-content: space-between; + align-items: center; + height: 39px; + align-self: baseline; + margin-right: 5px; + .cp-history-actions-first { + margin-right: @fill-width; + } + button { + margin: 0 5px; + border: 1px solid @cryptpad_text_col; + text-transform: uppercase; + display: inline-flex; + align-items: center; + .fa:not(:last-child) { + margin-right: 5px; + } + &:disabled { + cursor: not-allowed !important; + opacity: 0.6; + &:hover, &:active { + background-color: transparent; + } + } + } } - .cp-toolbar-history-bar { - width: 100%; - background: white; - height: 25px; - margin: auto; - position: relative; + + &.cp-history-drive { + .cp-history-timeline-container { + height: 20px !important; + } + .cp-history-timeline-users { + display: none !important; + } + .cp-history-timeline-legend { + display: none !important; + } + .cp-history-timeline-pos { + height: 18px !important; + } + .cp-toolbar-history-loadmore { + font-size: 10px !important; + } + .cp-history-timeline-actions { + margin-left: 21px !important; + } } - .cp-toolbar-history-pos-container { - width: ~"calc(100% - 2px)"; - height: 25px; - position: relative; + &.cp-smallpatch { + .cp-history-snapshot { + border: none !important; + width: 2px !important; + background: @pos-color; + } + .cp-history-timeline-pos { + border-right: none; + border-left: none; + width: 2px !important; + background: @pos-color; + &:before { + left: -6px; + } + } } - @pos-color: #55FF55; - .cp-toolbar-history-pos { - width: 2px; - height: 25px; - background: @pos-color; - &:after { - content: ''; - border: 6px solid transparent; - border-top-color: @pos-color; - margin-left: -5px; + .cp-history-timeline-line { + display: flex; + .cp-history-timeline-legend { + display: flex; + flex-flow: column; + justify-content: space-around; + align-items: center; + margin-right: 4px; + } + .cp-history-timeline-loadmore { + width: 20px; + display: flex; + align-items: center; + justify-content: center; + button { + padding: 0; + width: 100%; + height: 100%; + background: @history_lineBg; + margin-right: 1px; + .fa-refresh { + font-size: 13px; + } + } + } + .cp-history-timeline-container { + flex: 1; + position: relative; + background-color: @history_lineBg; + height: 39px; + } + .cp-history-timeline-bar { + display: flex; + flex-flow: column; + padding: 1px; + & > span { + height: 18px; + display: flex; + } + .cp-history-timeline-users { + margin-bottom: 1px; + .cp-history-bar-el { + background-color: @history_userBg1; + &:nth-child(2n) { + background-color: @history_userBg2; + } + } + } + .cp-history-timeline-user { + .cp-history-bar-el { + background-color: @history_userBg2; + &:nth-child(2n) { + background-color: @history_userBg1; + } + } + } + .cp-history-snapshots { + position: absolute; + left: 1px; + right: 1px; + top: 1px; + bottom: 1px; + cursor: pointer; + .cp-history-snapshot { + position: absolute; + border: 2px solid @cryptpad_text_col; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + } + } } } - button { - color: @cryptpad_text_col; - background-color: rgba(0,0,0,0.2); - &:hover { - background-color: rgba(0,0,0,0.4); + .cp-history-timeline-actions { + display: flex; + justify-content: space-between; + align-items: center; + margin-left: 40px; + button { + width: 50px; + .fa:first-child:not(:last-child) { + margin-right: 5px; + } + &:disabled { + cursor: not-allowed !important; + opacity: 0.6; + &:hover, &:active { + background-color: transparent; + } + } + } + .cp-history-timeline-next { + button:last-child { + margin-right: 0; + } + } + .cp-history-timeline-prev { + button:first-child { + margin-left: 0; + } } } - .fa-spinner { - font-size: 66px; + + .cp-history-timeline-pos { + //width: 2px; + border: 2px solid @cryptpad_text_col; + height: 37px; + //background: @pos-color; + position: absolute; + &:before { + top: -17px; + font-size: 24px; + position: absolute; + left: ~"calc(50% - 6px)"; + } } + } } diff --git a/customize.dist/src/less2/include/toolbar.less b/customize.dist/src/less2/include/toolbar.less index 41736d426..9adef38ce 100644 --- a/customize.dist/src/less2/include/toolbar.less +++ b/customize.dist/src/less2/include/toolbar.less @@ -483,6 +483,7 @@ height: @toolbar_line-height; box-sizing: border-box; line-height: @toolbar_line-height; + border: 1px solid transparent; } .cp-toolbar-title-readonly { font-size: 14px; @@ -490,7 +491,7 @@ .cp-toolbar-title-value { padding: 5px; line-height: @toolbar_line-height - 10px; - border: 0; + //border: 0; } .cp-toolbar-title-edit, .cp-toolbar-title-save { box-sizing: border-box; @@ -663,6 +664,20 @@ display: inline-flex; align-items: center; } + &.cp-toolbar-unsync { + .cp-toolbar-title-edit, .cp-toolbar-title-save { + display: none !important; + } + .cp-toolbar-title-unsync { + display: inline-flex; + } + .cp-toolbar-title-editable, .cp-toolbar-title-edit { + border: none !important; + } + } + .cp-toolbar-title-unsync { + display: none; + } .cp-toolbar-title-hoverable { display: inline-flex; overflow: hidden; @@ -886,11 +901,45 @@ } } - .cp-toolbar-history { + .cp-toolbar-history, .cp-toolbar-snapshots { background-color: @toolbar-bg-color-light; background-color: var(--toolbar-bg-color-light); color: @cryptpad_text_col; } + .cp-toolbar-snapshots { + display: none; + text-align: center; + width: 100%; + padding: 5px 0; + align-items: center; + justify-content: space-between; + .cp-toolbar-snapshots-info { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + flex: 1; + min-width: 0; + i { + width: 30px; + } + } + @media screen and (max-width: @browser_media-medium-screen) { + flex-flow: column; + .cp-toolbar-snapshots-info { + max-width: 100%; + } + } + .cp-toolbar-snapshots-actions { + button { + margin: 0 5px; + border: 1px solid @cryptpad_text_col; + text-transform: uppercase; + i:not(:last-child) { + margin-right: 5px; + } + } + } + } .cp-toolbar-bottom { background-color: @toolbar-bg-color-light; background-color: var(--toolbar-bg-color-light); diff --git a/www/code/inner.js b/www/code/inner.js index 692bba8bb..1956ab3f4 100644 --- a/www/code/inner.js +++ b/www/code/inner.js @@ -128,7 +128,6 @@ define([ }; var mkHelpMenu = function (framework) { var $codeMirrorContainer = $('#cp-app-code-container'); - $codeMirrorContainer.prepend(framework._.sfCommon.getBurnAfterReadingWarning()); var helpMenu = framework._.sfCommon.createHelpMenu(['text', 'code']); $codeMirrorContainer.prepend(helpMenu.menu); diff --git a/www/common/common-hash.js b/www/common/common-hash.js index f335d011b..0b584d4c3 100644 --- a/www/common/common-hash.js +++ b/www/common/common-hash.js @@ -169,6 +169,17 @@ Version 1 /code/#/1/edit/3Ujt4F2Sjnjbis6CoYWpoQ/usn4+9CqVja8Q7RZOGTfRgqI */ + var getVersionHash = function (hashArr) { + var k; + // Check if we have a ownerKey for this pad + hashArr.some(function (data) { + if (/^hash=/.test(data)) { + k = data.slice(5); + return true; + } + }); + return k ? Crypto.b64AddSlashes(k) : ''; + }; var getOwnerKey = function (hashArr) { var k; // Check if we have a ownerKey for this pad @@ -190,6 +201,7 @@ Version 1 parsed.password = options.indexOf('p') !== -1; parsed.present = options.indexOf('present') !== -1; parsed.embed = options.indexOf('embed') !== -1; + parsed.versionHash = getVersionHash(options); parsed.ownerKey = getOwnerKey(options); }; @@ -201,6 +213,7 @@ Version 1 embed: parsed.embed, present: parsed.present, ownerKey: parsed.ownerKey, + versionHash: parsed.versionHash, password: parsed.password }; }; @@ -220,6 +233,10 @@ Version 1 if (parsed.password || opts.password) { hash += 'p/'; } if (opts.embed) { hash += 'embed/'; } if (opts.present) { hash += 'present/'; } + var versionHash = typeof(opts.versionHash) !== "undefined" ? opts.versionHash : parsed.versionHash; + if (versionHash) { + hash += 'hash=' + Crypto.b64RemoveSlashes(versionHash) + '/'; + } return hash; }; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index e0a12b4e8..a14bb2050 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -758,23 +758,16 @@ define([ button = $(''); break; } - var active = $(".cp-toolbar-history:visible").length !== 0; button = $('