style: layout improvements
This commit is contained in:
parent
50648190cc
commit
c1199c18ab
74
main.ts
74
main.ts
|
@ -159,23 +159,20 @@ export class BulkRenameSettingsTab extends PluginSettingTab {
|
|||
if (!isViewTypeFolder(this.plugin.settings)) {
|
||||
return;
|
||||
}
|
||||
new Setting(this.containerEl)
|
||||
.setName('Folder location')
|
||||
.setDesc('Find files within the folder')
|
||||
.addSearch((cb) => {
|
||||
new FolderSuggest(this.app, cb.inputEl, this.plugin);
|
||||
cb.setPlaceholder('Example: folder1/')
|
||||
.setValue(this.plugin.settings.folderName)
|
||||
.onChange((newFolder) => {
|
||||
this.plugin.settings.folderName = newFolder;
|
||||
this.plugin.saveSettings();
|
||||
this.getFilesByFolder();
|
||||
});
|
||||
// @ts-ignore
|
||||
cb.containerEl.addClass('bulk_rename');
|
||||
cb.inputEl.addClass('bulk_input');
|
||||
cb.inputEl.onblur = this.reRenderPreview;
|
||||
});
|
||||
new Setting(this.containerEl).setName('Folder location').addSearch((cb) => {
|
||||
new FolderSuggest(this.app, cb.inputEl, this.plugin);
|
||||
cb.setPlaceholder('Example: folder1/')
|
||||
.setValue(this.plugin.settings.folderName)
|
||||
.onChange((newFolder) => {
|
||||
this.plugin.settings.folderName = newFolder;
|
||||
this.plugin.saveSettings();
|
||||
this.getFilesByFolder();
|
||||
});
|
||||
// @ts-ignore
|
||||
cb.containerEl.addClass('bulk_rename');
|
||||
cb.inputEl.addClass('bulk_input');
|
||||
cb.inputEl.onblur = this.reRenderPreview;
|
||||
});
|
||||
}
|
||||
|
||||
renderTagNames() {
|
||||
|
@ -183,31 +180,28 @@ export class BulkRenameSettingsTab extends PluginSettingTab {
|
|||
return;
|
||||
}
|
||||
|
||||
new Setting(this.containerEl)
|
||||
.setName('Tag names ')
|
||||
.setDesc('all files with the tags will be found')
|
||||
.addSearch((cb) => {
|
||||
cb.inputEl.addEventListener('keydown', (event) => {
|
||||
if (event.key !== 'Enter') {
|
||||
return;
|
||||
}
|
||||
const target = event.target as HTMLInputElement;
|
||||
new Setting(this.containerEl).setName('Tag names ').addSearch((cb) => {
|
||||
cb.inputEl.addEventListener('keydown', (event) => {
|
||||
if (event.key !== 'Enter') {
|
||||
return;
|
||||
}
|
||||
const target = event.target as HTMLInputElement;
|
||||
|
||||
this.plugin.settings.tags = target.value.replace(/ /g, '').split(',');
|
||||
this.plugin.saveSettings();
|
||||
});
|
||||
cb.setPlaceholder('Example: #tag, #tag2')
|
||||
.setValue(this.plugin.settings.tags.join(','))
|
||||
.onChange((newFolder) => {
|
||||
this.plugin.settings.tags = newFolder.replace(/ /g, '').split(',');
|
||||
this.plugin.saveSettings();
|
||||
this.getFilesByTags();
|
||||
});
|
||||
// @ts-ignore
|
||||
cb.containerEl.addClass('bulk_rename');
|
||||
cb.inputEl.addClass('bulk_input');
|
||||
cb.inputEl.onblur = this.reRenderPreview;
|
||||
this.plugin.settings.tags = target.value.replace(/ /g, '').split(',');
|
||||
this.plugin.saveSettings();
|
||||
});
|
||||
cb.setPlaceholder('Example: #tag, #tag2')
|
||||
.setValue(this.plugin.settings.tags.join(','))
|
||||
.onChange((newFolder) => {
|
||||
this.plugin.settings.tags = newFolder.replace(/ /g, '').split(',');
|
||||
this.plugin.saveSettings();
|
||||
this.getFilesByTags();
|
||||
});
|
||||
// @ts-ignore
|
||||
cb.containerEl.addClass('bulk_rename');
|
||||
cb.inputEl.addClass('bulk_input');
|
||||
cb.inputEl.onblur = this.reRenderPreview;
|
||||
});
|
||||
}
|
||||
|
||||
renderRegExpInput() {
|
||||
|
|
|
@ -29,7 +29,7 @@ export const getObsidianFilesByRegExp = (
|
|||
const abstractFiles = app.vault.getAllLoadedFiles();
|
||||
|
||||
const matchedFileNames = abstractFiles.filter((file) => {
|
||||
if (file instanceof TFile && XRegExp.match(file.path, regExp)) {
|
||||
if (file instanceof TFile && XRegExp.exec(file.path, regExp)) {
|
||||
return true;
|
||||
}
|
||||
}) as TFile[];
|
||||
|
|
|
@ -45,7 +45,11 @@
|
|||
.replaceRenderSymbols {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
padding-top: 1rem;
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
|
||||
.setting-item-control.replaceRenderSymbols .bulk_input {
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
.setting-item-control .bulk_preview_textarea {
|
||||
|
@ -74,7 +78,6 @@
|
|||
width: 100%;
|
||||
resize: none;
|
||||
min-width: auto;
|
||||
min-height: auto;
|
||||
}
|
||||
|
||||
.setting-item-control .bulk_input:first-child {
|
||||
|
|
Loading…
Reference in New Issue