mirror of
https://github.com/Wanxp/obsidian-douban.git
synced 2026-04-05 01:28:46 +08:00
hotfix v1.5.1
This commit is contained in:
parent
44bc498994
commit
8eb87e85b0
4
main.ts
4
main.ts
@ -50,7 +50,6 @@ export default class DoubanPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDoubanTextForActiveFile(editor: Editor) {
|
async getDoubanTextForActiveFile(editor: Editor) {
|
||||||
this.doubanStatusBar = this.addStatusBarItem();
|
|
||||||
const activeFile = await this.app.workspace.getActiveFile();
|
const activeFile = await this.app.workspace.getActiveFile();
|
||||||
if (activeFile) {
|
if (activeFile) {
|
||||||
const searchTerm = activeFile.basename;
|
const searchTerm = activeFile.basename;
|
||||||
@ -67,6 +66,8 @@ export default class DoubanPlugin extends Plugin {
|
|||||||
async onload() {
|
async onload() {
|
||||||
await this.loadSettings();
|
await this.loadSettings();
|
||||||
|
|
||||||
|
this.doubanStatusBar = this.addStatusBarItem();
|
||||||
|
|
||||||
this.addCommand({
|
this.addCommand({
|
||||||
id: "search-douban-by-current-file-name",
|
id: "search-douban-by-current-file-name",
|
||||||
name: i18nHelper.getMessage("110001"),
|
name: i18nHelper.getMessage("110001"),
|
||||||
@ -102,6 +103,7 @@ export default class DoubanPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showStatus(origin:string, message:string) {
|
showStatus(origin:string, message:string) {
|
||||||
|
|
||||||
this.doubanStatusBar.empty();
|
this.doubanStatusBar.empty();
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.doubanStatusBar.setText(i18nHelper.getMessage(origin).replace('{0}', message));
|
this.doubanStatusBar.setText(i18nHelper.getMessage(origin).replace('{0}', message));
|
||||||
|
|||||||
@ -114,7 +114,7 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
|
|||||||
.then(this.parseSubjectFromHtml)
|
.then(this.parseSubjectFromHtml)
|
||||||
.then(content => this.toEditor(editor, content))
|
.then(content => this.toEditor(editor, content))
|
||||||
// .then(content => content ? editor.replaceSelection(content) : content)
|
// .then(content => content ? editor.replaceSelection(content) : content)
|
||||||
.catch(log.error(i18nHelper.getMessage('130101')))
|
.catch(e => log.error(i18nHelper.getMessage('130101')))
|
||||||
;
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,6 @@ export class DoubanSearchModal extends Modal {
|
|||||||
|
|
||||||
async onClose() {
|
async onClose() {
|
||||||
let {contentEl} = this;
|
let {contentEl} = this;
|
||||||
|
|
||||||
contentEl.empty();
|
contentEl.empty();
|
||||||
if (this.searchTerm) {
|
if (this.searchTerm) {
|
||||||
await this.plugin.search(this.searchTerm, this.editor);
|
await this.plugin.search(this.searchTerm, this.editor);
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public info(e: any): any {
|
public info(e: any): any {
|
||||||
console.log(`Douban Plugin info:` + `${typeof e == 'string' ? e : JSON.stringify(e)}`);
|
// console.log(`Douban Plugin info:` + `${typeof e == 'string' ? e : JSON.stringify(e)}`);
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user