diff --git a/customize.dist/src/less2/include/toolbar-history.less b/customize.dist/src/less2/include/toolbar-history.less index 119a82387..26df06081 100644 --- a/customize.dist/src/less2/include/toolbar-history.less +++ b/customize.dist/src/less2/include/toolbar-history.less @@ -5,15 +5,180 @@ } & { .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-toolbar-history-timeline { + display: flex; + flex-flow: column; + flex: 1; + margin-left: 10px; + margin-right: @fill-width; + } + .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; + .fa:not(:last-child) { + margin-right: 5px; + } + } + } + + &.cp-smallpatch { + .cp-history-snapshot { + border: none !important; + width: 2px !important; + background: @pos-color; + } + .cp-history-timeline-pos { + border: none !important; + width: 2px !important; + background: @pos-color; + &:after { + margin-left: -8px !important; + top: -8px !important; + } + } + } + .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; + .cp-history-snapshot { + position: absolute; + border: 2px solid @cryptpad_text_col; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + } + } + } + } + .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; + } + } + .cp-history-timeline-next { + button:last-child { + margin-right: 0; + } + } + .cp-history-timeline-prev { + button:first-child { + margin-left: 0; + } + } + } + + .cp-history-timeline-pos { + //width: 2px; + border: 2px solid @cryptpad_text_col; + height: 37px; + //background: @pos-color; + position: absolute; + &:after { + content: ''; + border: 9px solid transparent; + border-top-color: @pos-color; + position: absolute; + top: -9px; + margin-left: -1px; + width: 100%; + } + } + +/* .cp-history-filler { flex: 1; } @@ -92,6 +257,7 @@ .fa-spinner { font-size: 66px; } +*/ } } diff --git a/customize.dist/src/less2/include/toolbar.less b/customize.dist/src/less2/include/toolbar.less index 41736d426..b787fb63b 100644 --- a/customize.dist/src/less2/include/toolbar.less +++ b/customize.dist/src/less2/include/toolbar.less @@ -663,6 +663,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 +900,19 @@ } } - .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: 10px 0; + align-items: center; + justify-content: center; + } .cp-toolbar-bottom { background-color: @toolbar-bg-color-light; background-color: var(--toolbar-bg-color-light); diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index e0a12b4e8..288770e69 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -876,6 +876,21 @@ define([ common.createNewPadModal(); }); break; + case 'snapshots': + button = $('