vault backup: 2026-01-16 17:27:01
This commit is contained in:
+28
-14
@@ -54,7 +54,7 @@ var DebugHelper = class {
|
||||
return () => {
|
||||
};
|
||||
}
|
||||
var qualifiedName = `novel-word-count|${name} (${++this.idCounter})`;
|
||||
const qualifiedName = `novel-word-count|${name} (${++this.idCounter})`;
|
||||
console.time(qualifiedName);
|
||||
return () => console.timeEnd(qualifiedName);
|
||||
}
|
||||
@@ -1958,7 +1958,7 @@ var NovelWordCountPlugin = class extends import_obsidian5.Plugin {
|
||||
await this.updateDisplayedCounts();
|
||||
} catch (err) {
|
||||
this.debugHelper.debug("Error while updating displayed counts");
|
||||
this.debugHelper.error(err);
|
||||
this.debugHelper.debug(err);
|
||||
setTimeout(() => {
|
||||
this.initialize(false);
|
||||
}, 1e3);
|
||||
@@ -1981,19 +1981,31 @@ var NovelWordCountPlugin = class extends import_obsidian5.Plugin {
|
||||
this.debugHelper.debug("File explorer leaf not found; skipping update.");
|
||||
return;
|
||||
}
|
||||
this.setContainerClass(fileExplorerLeaf);
|
||||
const vaultCount = this.fileHelper.getCachedDataForPath(
|
||||
this.savedData.cachedCounts,
|
||||
"/"
|
||||
);
|
||||
document.documentElement.style.setProperty("--novel-word-count-opacity", `${this.settings.labelOpacity}`);
|
||||
const drawers = [this.app.workspace.leftSplit, this.app.workspace.rightSplit];
|
||||
let hasMobileDrawer = false;
|
||||
for (const drawer of drawers) {
|
||||
this.setContainerClass(drawer.containerEl);
|
||||
if (!(drawer == null ? void 0 : drawer.fileCountEl)) {
|
||||
continue;
|
||||
}
|
||||
drawer.fileCountEl.setAttribute(
|
||||
"data-novel-word-count-plugin",
|
||||
this.nodeLabelHelper.getNodeLabel(vaultCount)
|
||||
);
|
||||
hasMobileDrawer = true;
|
||||
}
|
||||
const fileExplorerView = fileExplorerLeaf.view;
|
||||
const fileItems = fileExplorerView.fileItems;
|
||||
if ((_a = fileExplorerView == null ? void 0 : fileExplorerView.headerDom) == null ? void 0 : _a.navButtonsEl) {
|
||||
const counts = this.fileHelper.getCachedDataForPath(
|
||||
this.savedData.cachedCounts,
|
||||
"/"
|
||||
);
|
||||
if (!hasMobileDrawer && ((_a = fileExplorerView == null ? void 0 : fileExplorerView.headerDom) == null ? void 0 : _a.navButtonsEl)) {
|
||||
fileExplorerView.headerDom.navButtonsEl.setAttribute(
|
||||
"data-novel-word-count-plugin",
|
||||
this.nodeLabelHelper.getNodeLabel(counts)
|
||||
this.nodeLabelHelper.getNodeLabel(vaultCount)
|
||||
);
|
||||
document.documentElement.style.setProperty("--novel-word-count-opacity", `${this.settings.labelOpacity}`);
|
||||
}
|
||||
if (file) {
|
||||
const relevantItems = Object.keys(fileItems).filter(
|
||||
@@ -2030,7 +2042,7 @@ var NovelWordCountPlugin = class extends import_obsidian5.Plugin {
|
||||
async getFileExplorerLeaf() {
|
||||
return new Promise((resolve, reject) => {
|
||||
let foundLeaf = null;
|
||||
this.app.workspace.iterateAllLeaves((leaf) => {
|
||||
this.app.workspace.getLeavesOfType("file-explorer").forEach((leaf) => {
|
||||
if (foundLeaf) {
|
||||
return;
|
||||
}
|
||||
@@ -2046,8 +2058,11 @@ var NovelWordCountPlugin = class extends import_obsidian5.Plugin {
|
||||
}
|
||||
});
|
||||
}
|
||||
setContainerClass(leaf) {
|
||||
const container = leaf.view.containerEl;
|
||||
setContainerClass(container) {
|
||||
if (!container) {
|
||||
this.debugHelper.debug("No container was passed to setContainerClass");
|
||||
return;
|
||||
}
|
||||
container.toggleClass(`novel-word-count--active`, true);
|
||||
const notePrefix = `novel-word-count--note-`;
|
||||
const folderPrefix = `novel-word-count--folder-`;
|
||||
@@ -2061,5 +2076,4 @@ var NovelWordCountPlugin = class extends import_obsidian5.Plugin {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* nosourcemap */
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "novel-word-count",
|
||||
"name": "Novel word count",
|
||||
"version": "4.6.0",
|
||||
"version": "4.6.1",
|
||||
"minAppVersion": "0.13.31",
|
||||
"description": "Displays a word count (and more!) for each file, folder and vault in the File Explorer pane.",
|
||||
"author": "Isaac Lyman",
|
||||
|
||||
+45
-56
@@ -1,7 +1,18 @@
|
||||
.novel-word-count--active .nav-header .nav-buttons-container {
|
||||
flex-wrap: wrap !important;
|
||||
.novel-word-count--active .workspace-drawer-header-info div[data-novel-word-count-plugin]::after {
|
||||
content: attr(data-novel-word-count-plugin);
|
||||
display: block;
|
||||
font-size: 0.8em;
|
||||
min-width: 0;
|
||||
opacity: var(--novel-word-count-opacity);
|
||||
overflow: hidden;
|
||||
padding: 2px 0 0 0;
|
||||
position: relative;
|
||||
text-align: left;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
.novel-word-count--active .nav-header .nav-buttons-container::after {
|
||||
.novel-word-count--active .nav-buttons-container[data-novel-word-count-plugin]::after {
|
||||
content: attr(data-novel-word-count-plugin);
|
||||
display: block;
|
||||
font-size: 0.8em;
|
||||
@@ -16,58 +27,12 @@
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.novel-word-count--active .nav-files-container .nav-file-title {
|
||||
align-items: baseline;
|
||||
unicode-bidi: isolate;
|
||||
}
|
||||
.novel-word-count--active .nav-files-container .nav-file-title::after {
|
||||
content: attr(data-novel-word-count-plugin);
|
||||
flex: 1 0 auto;
|
||||
font-size: 0.8em;
|
||||
max-width: calc(100% - 20px);
|
||||
min-width: 0;
|
||||
opacity: var(--novel-word-count-opacity);
|
||||
order: 1;
|
||||
overflow: hidden;
|
||||
padding: 0 4px;
|
||||
position: relative;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
unicode-bidi: isolate;
|
||||
direction: ltr;
|
||||
}
|
||||
.novel-word-count--active .nav-files-container .nav-file-title-content {
|
||||
min-width: 20px;
|
||||
unicode-bidi: isolate;
|
||||
}
|
||||
.novel-word-count--note-right .nav-files-container .nav-file-title-content {
|
||||
flex: 1 1 0;
|
||||
}
|
||||
.novel-word-count--note-right .nav-files-container .nav-file-title::after {
|
||||
flex: none;
|
||||
order: 6;
|
||||
overflow: hidden;
|
||||
}
|
||||
.novel-word-count--note-below .nav-files-container .nav-file-title {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.novel-word-count--note-below .nav-files-container .nav-file-title-content {
|
||||
flex: 100%;
|
||||
}
|
||||
.novel-word-count--note-below .nav-files-container .nav-file-title::after {
|
||||
display: inline-block;
|
||||
margin-top: -2px;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.novel-word-count--active .nav-files-container .nav-file-title,
|
||||
.novel-word-count--active .nav-files-container .nav-folder-title {
|
||||
align-items: baseline;
|
||||
unicode-bidi: isolate;
|
||||
}
|
||||
.novel-word-count--active .nav-files-container .nav-file-title::after,
|
||||
.novel-word-count--active .nav-files-container .nav-folder-title::after {
|
||||
content: attr(data-novel-word-count-plugin);
|
||||
flex: 1 0 auto;
|
||||
@@ -84,25 +49,49 @@
|
||||
unicode-bidi: isolate;
|
||||
direction: ltr;
|
||||
}
|
||||
.novel-word-count--active .nav-files-container .nav-file-title-content,
|
||||
.novel-word-count--active .nav-files-container .nav-folder-title-content {
|
||||
min-width: 20px;
|
||||
unicode-bidi: isolate;
|
||||
}
|
||||
.novel-word-count--folder-right .nav-files-container .nav-folder-title-content {
|
||||
.novel-word-count--active.novel-word-count--note-right .nav-files-container .nav-file-title-content {
|
||||
flex: 1 1 0;
|
||||
}
|
||||
.novel-word-count--folder-right .nav-files-container .nav-folder-title::after {
|
||||
.novel-word-count--active.novel-word-count--note-right .nav-files-container .nav-file-title:after {
|
||||
flex: none;
|
||||
order: 6;
|
||||
overflow: hidden;
|
||||
}
|
||||
.novel-word-count--folder-below .nav-files-container .nav-folder-title {
|
||||
.novel-word-count--active.novel-word-count--note-below .nav-files-container .nav-file-title {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.novel-word-count--folder-below .nav-files-container .nav-folder-title-content {
|
||||
.novel-word-count--active.novel-word-count--note-below .nav-files-container .nav-file-title-content {
|
||||
flex: 100%;
|
||||
}
|
||||
.novel-word-count--folder-below .nav-files-container .nav-folder-title::after {
|
||||
.novel-word-count--active.novel-word-count--note-below .nav-files-container .nav-file-title::after {
|
||||
display: inline-block;
|
||||
margin-top: -2px;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.novel-word-count--active.novel-word-count--folder-right .nav-files-container .nav-folder-title-content {
|
||||
flex: 1 1 0;
|
||||
}
|
||||
.novel-word-count--active.novel-word-count--folder-right .nav-files-container .nav-folder-title::after {
|
||||
flex: none;
|
||||
order: 6;
|
||||
overflow: hidden;
|
||||
}
|
||||
.novel-word-count--active.novel-word-count--folder-below .nav-files-container .nav-folder-title {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.novel-word-count--active.novel-word-count--folder-below .nav-files-container .nav-folder-title-content {
|
||||
flex: 100%;
|
||||
}
|
||||
.novel-word-count--active.novel-word-count--folder-below .nav-files-container .nav-folder-title::after {
|
||||
display: inline-block;
|
||||
margin-top: -2px;
|
||||
max-width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user