vault backup: 2023-06-05 21:55:46

This commit is contained in:
baalajimaestro 2023-06-05 21:55:46 +05:30
parent 3670a0bc99
commit a2c2318982
Signed by: baalajimaestro
GPG key ID: F93C394FE9BBAFD5
6 changed files with 48 additions and 23 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
{ {
"id": "obsidian-excalidraw-plugin", "id": "obsidian-excalidraw-plugin",
"name": "Excalidraw", "name": "Excalidraw",
"version": "1.9.2", "version": "1.9.3",
"minAppVersion": "1.1.6", "minAppVersion": "1.1.6",
"description": "An Obsidian plugin to edit and view Excalidraw drawings", "description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian", "author": "Zsolt Viczian",

View file

@ -32266,9 +32266,11 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab {
plugin.saveSettings(); plugin.saveSettings();
}) })
); );
containerEl.createEl("br"); if (plugin.gitManager instanceof SimpleGit) {
containerEl.createEl("h3", { text: "Line author information" }); containerEl.createEl("br");
this.addLineAuthorInfoSettings(); containerEl.createEl("h3", { text: "Line author information" });
this.addLineAuthorInfoSettings();
}
} }
containerEl.createEl("br"); containerEl.createEl("br");
containerEl.createEl("h3", { text: "Miscellaneous" }); containerEl.createEl("h3", { text: "Miscellaneous" });
@ -35836,9 +35838,12 @@ var DiffView = class extends import_obsidian17.ItemView {
super(leaf); super(leaf);
this.plugin = plugin; this.plugin = plugin;
this.gettingDiff = false; this.gettingDiff = false;
this.gitRefreshBind = this.refresh.bind(this);
this.gitViewRefreshBind = this.refresh.bind(this);
this.parser = new DOMParser(); this.parser = new DOMParser();
this.navigation = true; this.navigation = true;
addEventListener("git-refresh", this.refresh.bind(this)); addEventListener("git-refresh", this.gitRefreshBind);
addEventListener("git-view-refresh", this.gitViewRefreshBind);
} }
getViewType() { getViewType() {
return DIFF_VIEW_CONFIG.type; return DIFF_VIEW_CONFIG.type;
@ -35865,7 +35870,8 @@ var DiffView = class extends import_obsidian17.ItemView {
return this.state; return this.state;
} }
onClose() { onClose() {
removeEventListener("git-refresh", this.refresh.bind(this)); removeEventListener("git-refresh", this.gitRefreshBind);
removeEventListener("git-view-refresh", this.gitViewRefreshBind);
return super.onClose(); return super.onClose();
} }
onOpen() { onOpen() {
@ -35884,16 +35890,26 @@ var DiffView = class extends import_obsidian17.ItemView {
); );
this.contentEl.empty(); this.contentEl.empty();
if (!diff2) { if (!diff2) {
const content = await this.app.vault.adapter.read( if (this.plugin.gitManager instanceof SimpleGit && await this.plugin.gitManager.isTracked(
this.plugin.gitManager.getVaultPath(this.state.file) this.state.file
); )) {
const header = `--- /dev/null diff2 = [
`--- ${this.state.file}`,
`+++ ${this.state.file}`,
""
].join("\n");
} else {
const content = await this.app.vault.adapter.read(
this.plugin.gitManager.getVaultPath(this.state.file)
);
const header = `--- /dev/null
+++ ${this.state.file} +++ ${this.state.file}
@@ -0,0 +1,${content.split("\n").length} @@`; @@ -0,0 +1,${content.split("\n").length} @@`;
diff2 = [ diff2 = [
...header.split("\n"), ...header.split("\n"),
...content.split("\n").map((line) => `+${line}`) ...content.split("\n").map((line) => `+${line}`)
].join("\n"); ].join("\n");
}
} }
const diffEl = this.parser.parseFromString(html(diff2), "text/html").querySelector(".d2h-file-diff"); const diffEl = this.parser.parseFromString(html(diff2), "text/html").querySelector(".d2h-file-diff");
this.contentEl.append(diffEl); this.contentEl.append(diffEl);
@ -42815,7 +42831,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
(_a2 = this.settingsTab) == null ? void 0 : _a2.beforeSaveSettings(); (_a2 = this.settingsTab) == null ? void 0 : _a2.beforeSaveSettings();
await this.saveData(this.settings); await this.saveData(this.settings);
} }
async saveLastAuto(date, mode) { saveLastAuto(date, mode) {
if (mode === "backup") { if (mode === "backup") {
this.localStorage.setLastAutoBackup(date.toString()); this.localStorage.setLastAutoBackup(date.toString());
} else if (mode === "pull") { } else if (mode === "pull") {
@ -42824,7 +42840,7 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
this.localStorage.setLastAutoPush(date.toString()); this.localStorage.setLastAutoPush(date.toString());
} }
} }
async loadLastAuto() { loadLastAuto() {
var _a2, _b, _c; var _a2, _b, _c;
return { return {
backup: new Date((_a2 = this.localStorage.getLastAutoBackup()) != null ? _a2 : ""), backup: new Date((_a2 = this.localStorage.getLastAutoBackup()) != null ? _a2 : ""),
@ -43044,13 +43060,17 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
}) { }) {
if (!await this.isAllInitialized()) if (!await this.isAllInitialized())
return false; return false;
const hadConflict = this.localStorage.getConflict() === "true"; let hadConflict = this.localStorage.getConflict() === "true";
let changedFiles; let changedFiles;
let status2; let status2;
let unstagedFiles; let unstagedFiles;
if (this.gitManager instanceof SimpleGit) { if (this.gitManager instanceof SimpleGit) {
this.mayDeleteConflictFile(); this.mayDeleteConflictFile();
status2 = await this.updateCachedStatus(); status2 = await this.updateCachedStatus();
if (status2.conflicted.length == 0) {
this.localStorage.setConflict("false");
hadConflict = false;
}
if (fromAutoBackup && status2.conflicted.length > 0) { if (fromAutoBackup && status2.conflicted.length > 0) {
this.displayError( this.displayError(
`Did not commit, because you have conflicts in ${status2.conflicted.length} ${status2.conflicted.length == 1 ? "file" : "files"}. Please resolve them and commit per command.` `Did not commit, because you have conflicts in ${status2.conflicted.length} ${status2.conflicted.length == 1 ? "file" : "files"}. Please resolve them and commit per command.`
@ -43116,6 +43136,11 @@ var ObsidianGit = class extends import_obsidian30.Plugin {
unstagedFiles unstagedFiles
}); });
} }
if (this.gitManager instanceof SimpleGit) {
if ((await this.updateCachedStatus()).conflicted.length == 0) {
this.localStorage.setConflict("false");
}
}
let roughly = false; let roughly = false;
if (committedFiles === void 0) { if (committedFiles === void 0) {
roughly = true; roughly = true;

View file

@ -5,5 +5,5 @@
"isDesktopOnly": false, "isDesktopOnly": false,
"fundingUrl": "https://ko-fi.com/vinzent", "fundingUrl": "https://ko-fi.com/vinzent",
"js": "main.js", "js": "main.js",
"version": "2.20.1" "version": "2.20.3"
} }

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
{ {
"id": "obsidian-view-mode-by-frontmatter", "id": "obsidian-view-mode-by-frontmatter",
"name": "Force note view mode", "name": "Force note view mode",
"version": "1.1.1", "version": "1.1.2",
"minAppVersion": "0.9.12", "minAppVersion": "0.9.12",
"description": "This plugin allows to force the view mode and editing mode for a note by using front matter", "description": "This plugin allows to force the view mode and editing mode for a note by using front matter",
"author": "Benny Wydooghe", "author": "Benny Wydooghe",