Skip to content

Commit fe747c0

Browse files
code updates as per reviews
1 parent 4810415 commit fe747c0

File tree

7 files changed

+24
-18
lines changed

7 files changed

+24
-18
lines changed

manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"id": "circuit-sketcher",
33
"name": "Circuit Sketcher",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"minAppVersion": "0.15.0",
6-
"description": "A plugin for drawing circuits on a canvas, based on circuit-sketcher-core.",
6+
"description": "Draw circuits on a canvas using circuit-sketcher-core.",
77
"author": "Code Forge Temple",
88
"authorUrl": "https://github.com/code-forge-temple",
99
"isDesktopOnly": true

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "circuit-sketcher-obsidian-plugin",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"main": "main.js",
55
"author": "Code Forge Temple",
66
"license": "GPL",
@@ -44,4 +44,4 @@
4444
"webpack-cli": "^5.1.4",
4545
"webpack-preprocessor-loader": "^1.3.0"
4646
}
47-
}
47+
}

src/CircuitSketcherSettingTab.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ export class CircuitSketcherSettingTab extends PluginSettingTab {
2222
containerEl.empty();
2323

2424
new Setting(containerEl)
25-
.setName("Circuit Sketcher Library")
26-
.setDesc("The Circuit Sketcher plugin will allow you to save any circuit element custom design you create and make it available throughout any .circuit-sketcher file.");
25+
.setName("Library")
26+
.setDesc("The Circuit Sketcher library will allow you to save any circuit element custom design you create and make it available throughout any .circuit-sketcher file.");
2727

2828
new Setting(containerEl)
29-
.setName("Library Path")
30-
.setDesc("The Circuit Sketcher plugin library will be stored at: vault_root/.lib.circuit-sketcher")
29+
.setName("Library path")
30+
.setDesc("The Circuit Sketcher library will be stored at: vault_root/.lib.circuit-sketcher")
3131
.addText(text => text.setValue(this.plugin.settings.libraryPath).setDisabled(true));
3232
}
3333
}

src/CircuitSketcherView.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export class CircuitSketcherView extends TextFileView {
3636
}
3737

3838
getDisplayText () {
39+
const activeFile = this.app.workspace.getActiveFile();
40+
41+
if (activeFile) {
42+
return `${activeFile.basename}`;
43+
}
44+
3945
return "Circuit Sketcher";
4046
}
4147

src/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ export default class CircuitSketcherPlugin extends Plugin {
4747
// Add a command to create a new `.circuit-sketcher` file
4848
this.addCommand({
4949
id: "circuit-sketcher-create-new",
50-
name: "Create New Circuit File",
50+
name: "Create new file",
5151
callback: this.createNewCircuitSketcher,
5252
});
5353

5454

55-
this.addRibbonIcon('circuit', 'Create New Circuit Sketcher File', this.createNewCircuitSketcher);
55+
this.addRibbonIcon('circuit', 'Create new Circuit Sketcher file', this.createNewCircuitSketcher);
5656
}
5757

5858
async onunload () {
5959
}
6060

6161
public fileName: string = "";
6262
private async createNewCircuitSketcher () {
63-
const newFileName = await this.generateUniqueFileName("New Circuit Sketcher File", FILE_EXTENSION);
63+
const newFileName = await this.generateUniqueFileName("Untitled", FILE_EXTENSION);
6464
const file = await this.app.vault.create(newFileName, "");
6565
const leaf = this.app.workspace.getLeaf(false);
6666

@@ -75,7 +75,7 @@ export default class CircuitSketcherPlugin extends Plugin {
7575

7676
while (await this.app.vault.adapter.exists(fileName)) {
7777
index += 1;
78-
fileName = `${baseName} (${index}).${extension}`;
78+
fileName = `${baseName} ${index}.${extension}`;
7979
}
8080

8181
return fileName;

webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ module.exports = {
3131
loader: "webpack-preprocessor-loader",
3232
options: {
3333
params: {
34-
dev: ENVIRONMENT === "development", // for preprocessor commands defined with `#!if dev` and `#!endif`
34+
dev: ENVIRONMENT === "development", // for preprocessor commands defined with `#!if dev` and `#!endif` (multiple lines)
3535
},
3636
directives: {
37-
dev: ENVIRONMENT === "development", // for preprocessor command `#!dev`
37+
dev: ENVIRONMENT === "development", // for preprocessor command `#!dev` (single line)
3838
},
3939
},
4040
},

0 commit comments

Comments
 (0)