Skip to content

Commit b79d81a

Browse files
committed
sync status widget WIP
1 parent 7e21867 commit b79d81a

File tree

5 files changed

+123
-55
lines changed

5 files changed

+123
-55
lines changed

package-lock.json

+57-49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@
4949
"image-type": "4.1.0",
5050
"ini": "2.0.0",
5151
"is-animated": "^2.0.1",
52-
"is-svg": "4.2.2",
52+
"is-svg": "4.3.1",
5353
"jimp": "0.16.1",
5454
"jsdom": "16.5.1",
5555
"mime-types": "2.1.29",
5656
"multer": "1.4.2",
5757
"node-abi": "2.21.0",
58-
"open": "8.0.2",
58+
"open": "8.0.3",
5959
"portscanner": "2.2.0",
6060
"rand-token": "1.0.1",
6161
"request": "^2.88.2",
6262
"rimraf": "3.0.2",
6363
"sanitize-filename": "1.6.3",
64-
"sanitize-html": "2.3.2",
64+
"sanitize-html": "2.3.3",
6565
"sax": "1.2.4",
6666
"semver": "7.3.4",
6767
"serve-favicon": "2.5.0",
@@ -83,11 +83,11 @@
8383
"electron-packager": "15.2.0",
8484
"electron-rebuild": "2.3.5",
8585
"esm": "3.2.25",
86-
"jasmine": "3.6.4",
86+
"jasmine": "3.7.0",
8787
"jsdoc": "3.6.6",
8888
"lorem-ipsum": "2.0.3",
8989
"rcedit": "3.0.0",
90-
"webpack": "5.25.0",
90+
"webpack": "5.27.0",
9191
"webpack-cli": "4.5.0"
9292
},
9393
"optionalDependencies": {

src/public/app/layouts/desktop_main_window_layout.js

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import ImagePropertiesWidget from "../widgets/type_property_widgets/image_proper
3333
import NotePropertiesWidget from "../widgets/type_property_widgets/note_properties.js";
3434
import NoteIconWidget from "../widgets/note_icon.js";
3535
import SearchResultWidget from "../widgets/search_result.js";
36+
import SyncStatusWidget from "../widgets/sync_status.js";
3637

3738
const RIGHT_PANE_CSS = `
3839
<style>
@@ -141,6 +142,7 @@ export default class DesktopMainWindowLayout {
141142
.child(new FlexContainer('row').overflowing()
142143
.css('height', '36px')
143144
.child(new GlobalMenuWidget())
145+
.child(new SyncStatusWidget())
144146
.child(new TabRowWidget())
145147
.child(new TitleBarButtonsWidget()))
146148
.child(new StandardTopWidget()

src/public/app/widgets/note_actions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const TPL = `
6363
<span class="caret"></span>
6464
</button>
6565
<div class="dropdown-menu dropdown-menu-right">
66-
<a data-trigger-command="renderActiveNote" class="dropdown-item render-note-button">Re-render note</a>
66+
<a data-trigger-command="renderActiveNote" class="dropdown-item render-note-button"><kbd data-command="renderActiveNote"></kbd> Re-render note</a>
6767
<div class="dropdown-item protect-button">
6868
Protect the note
6969

src/public/app/widgets/sync_status.js

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import BasicWidget from "./basic_widget.js";
2+
import utils from "../services/utils.js";
3+
import syncService from "../services/sync.js";
4+
5+
const TPL = `
6+
<div class="sync-status-wrapper">
7+
<style>
8+
.sync-status-wrapper {
9+
height: 35px;
10+
box-sizing: border-box;
11+
border-bottom: 1px solid var(--main-border-color);
12+
}
13+
14+
.sync-status {
15+
height: 34px;
16+
box-sizing: border-box;
17+
}
18+
19+
.sync-status button {
20+
margin-right: 5px;
21+
margin-left: 5px;
22+
height: 34px;
23+
border: none;
24+
font-size: 180%;
25+
padding-left: 10px;
26+
padding-right: 10px;
27+
}
28+
29+
.sync-status button span {
30+
position: relative;
31+
top: -5px;
32+
}
33+
34+
.sync-status button:hover {
35+
background-color: var(--hover-item-background-color);
36+
}
37+
38+
.sync-status .dropdown-menu {
39+
width: 20em;
40+
}
41+
</style>
42+
43+
<div class="sync-status">
44+
<button type="button" class="btn btn-sm" title="Sync status">
45+
<span class="bx bx-badge-check"></span>
46+
<!-- <span class="bx bx-cloud-upload"></span>-->
47+
<!-- <span class="bx bx-sync bx-spin bx-flip-horizontal"></span>-->
48+
</button>
49+
</div>
50+
</div>
51+
`;
52+
53+
export default class SyncStatusWidget extends BasicWidget {
54+
doRender() {
55+
this.$widget = $(TPL);
56+
this.overflowing();
57+
}
58+
}

0 commit comments

Comments
 (0)