update at 2025-10-08 20:05:39

This commit is contained in:
douboer
2025-10-08 20:05:39 +08:00
parent 3460669602
commit 7b36394427
2 changed files with 2 additions and 22 deletions

View File

@@ -164,7 +164,7 @@ export default class NoteToMpPlugin extends Plugin {
// 发布到小红书 // 发布到小红书
menu.addItem((item) => { menu.addItem((item) => {
item item
.setTitle('发布小红书') .setTitle('发布小红书')
.setIcon('lucide-heart') .setIcon('lucide-heart')
.onClick(async () => { .onClick(async () => {
if (file instanceof TFile) { if (file instanceof TFile) {

View File

@@ -145,29 +145,9 @@ export class WechatPreview {
} }
}; };
if (Platform.isDesktop) { const postBtn = lineDiv.createEl('button', { text: '📝 发布', cls: 'toolbar-button' });
const copyBtn = lineDiv.createEl('button', { text: '📋 复制', cls: 'toolbar-button' });
copyBtn.onclick = async () => {
try {
await this.render.copyArticle();
new Notice('复制成功,请到公众号编辑器粘贴。');
uevent('copy');
} catch (error) {
console.error(error);
new Notice('复制失败: ' + error);
}
};
}
const uploadImgBtn = lineDiv.createEl('button', { text: '📤 上传图片', cls: 'toolbar-button' });
uploadImgBtn.onclick = async () => await this.uploadImages();
const postBtn = lineDiv.createEl('button', { text: '📝 发草稿', cls: 'toolbar-button' });
postBtn.onclick = async () => await this.postArticle(); postBtn.onclick = async () => await this.postArticle();
const imagesBtn = lineDiv.createEl('button', { text: '🖼️ 图片/文字', cls: 'toolbar-button' });
imagesBtn.onclick = async () => await this.postImages();
if (Platform.isDesktop && this.settings.isAuthKeyVaild()) { if (Platform.isDesktop && this.settings.isAuthKeyVaild()) {
const htmlBtn = lineDiv.createEl('button', { text: '💾 导出HTML', cls: 'toolbar-button' }); const htmlBtn = lineDiv.createEl('button', { text: '💾 导出HTML', cls: 'toolbar-button' });
htmlBtn.onclick = async () => await this.exportHTML(); htmlBtn.onclick = async () => await this.exportHTML();