Skip to content

Commit 0ecc95f

Browse files
Loading blinking message is added
1 parent 18592e5 commit 0ecc95f

File tree

3 files changed

+83
-45
lines changed

3 files changed

+83
-45
lines changed

css/editor.css

Lines changed: 62 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,75 @@
11
ul {
2-
list-style-type: none;
3-
padding-inline-start: 2em;
2+
list-style-type: none;
3+
padding-inline-start: 2em;
44
}
55

66
.collapsed-list {
7-
display: none;
7+
display: none;
88
}
9+
910
.single::before {
10-
user-select: none;
11-
content: "\25B6";
12-
color: transparent;
13-
display: inline-block;
14-
margin-right: 6px;
11+
user-select: none;
12+
content: "\25B6";
13+
color: transparent;
14+
display: inline-block;
15+
margin-right: 6px;
1516
}
1617

1718
.collapsed::before {
18-
cursor: pointer;
19-
-webkit-user-select: none;
20-
/* Safari 3.1+ */
21-
-moz-user-select: none;
22-
/* Firefox 2+ */
23-
-ms-user-select: none;
24-
/* IE 10+ */
25-
user-select: none;
26-
content: "\25B6";
27-
display: inline-block;
28-
margin-right: 6px;
19+
cursor: pointer;
20+
-webkit-user-select: none;
21+
/* Safari 3.1+ */
22+
-moz-user-select: none;
23+
/* Firefox 2+ */
24+
-ms-user-select: none;
25+
/* IE 10+ */
26+
user-select: none;
27+
content: "\25B6";
28+
display: inline-block;
29+
margin-right: 6px;
2930
}
3031

3132
.expanded::before {
32-
cursor: pointer;
33-
content: "\25B6";
34-
-webkit-user-select: none;
35-
/* Safari 3.1+ */
36-
-moz-user-select: none;
37-
/* Firefox 2+ */
38-
-ms-user-select: none;
39-
/* IE 10+ */
40-
user-select: none;
41-
display: inline-block;
42-
margin-right: 6px;
43-
-ms-transform: rotate(90deg);
44-
/* IE 9 */
45-
-webkit-transform: rotate(90deg);
46-
/* Safari */
47-
transform: rotate(90deg);
33+
cursor: pointer;
34+
content: "\25B6";
35+
-webkit-user-select: none;
36+
/* Safari 3.1+ */
37+
-moz-user-select: none;
38+
/* Firefox 2+ */
39+
-ms-user-select: none;
40+
/* IE 10+ */
41+
user-select: none;
42+
display: inline-block;
43+
margin-right: 6px;
44+
-ms-transform: rotate(90deg);
45+
/* IE 9 */
46+
-webkit-transform: rotate(90deg);
47+
/* Safari */
48+
transform: rotate(90deg);
49+
}
50+
51+
.loading {
52+
animation: loadingAnimation 5s infinite;
53+
}
54+
55+
@keyframes loadingAnimation {
56+
0% {
57+
color: inherit;
58+
}
59+
60+
25% {
61+
color: transparent;
62+
}
63+
64+
50% {
65+
color: inherit;
66+
}
67+
68+
75% {
69+
color: transparent;
70+
}
71+
72+
100% {
73+
color: inherit;
74+
}
4875
}

js/editor.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function onWindowMessageHandler (event) {
2323
}
2424
case 'listModules': {
2525
clearModules();
26+
loadingOff();
2627
listModules(message);
2728
break;
2829
}
@@ -41,6 +42,7 @@ function onBrowseWorkspaceHandler () {
4142

4243
function onLoadModulesHandler () {
4344
const sourceLocation = document.getElementById("workspaceLocation").value;
45+
loadingOn();
4446
vscode.postMessage({
4547
command: 'loadModules',
4648
source: sourceLocation
@@ -186,3 +188,12 @@ function buildNode (cboxNode) {
186188
};
187189
return module;
188190
}
191+
192+
function loadingOn () {
193+
$("div#moduleList").before('<div id="loadingWindow"><span class="loading">Loading modules ...</span></div>');
194+
}
195+
196+
function loadingOff () {
197+
$("div#loadingWindow").remove();
198+
199+
}

src/editor.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ export function handleMessages(extCtx: vscode.ExtensionContext, webPanel: vscode
4242
}
4343
}
4444

45+
function postLocation(fileUri: vscode.Uri[] | undefined, webPanel: vscode.WebviewPanel, command: string) {
46+
if (fileUri && fileUri[0]) {
47+
// vscode.window.showInformationMessage('Selected root ' + fileUri[0].fsPath);
48+
webPanel.webview.postMessage({
49+
command: command,
50+
data: fileUri[0].fsPath
51+
});
52+
}
53+
}
54+
4555
export function getWebviewContent(panel: vscode.WebviewPanel, extCtx: vscode.ExtensionContext): string {
4656
const jQueryOnDiskPath = vscode.Uri.file(path.join(extCtx.extensionPath, '/js/jquery.js'));
4757
const jQuerySrc: vscode.Uri = panel.webview.asWebviewUri(jQueryOnDiskPath);
@@ -84,13 +94,3 @@ export function getWebviewContent(panel: vscode.WebviewPanel, extCtx: vscode.Ext
8494
</html>
8595
`;
8696
}
87-
88-
function postLocation(fileUri: vscode.Uri[] | undefined, webPanel: vscode.WebviewPanel, command: string) {
89-
if (fileUri && fileUri[0]) {
90-
// vscode.window.showInformationMessage('Selected root ' + fileUri[0].fsPath);
91-
webPanel.webview.postMessage({
92-
command: command,
93-
data: fileUri[0].fsPath
94-
});
95-
}
96-
}

0 commit comments

Comments
 (0)