diff --git a/chrome/content/overlay.xul b/chrome/content/overlay.xul index 1665346..5b048f5 100644 --- a/chrome/content/overlay.xul +++ b/chrome/content/overlay.xul @@ -20,6 +20,7 @@ + + @@ -30,6 +31,7 @@ + &jasminum.namepatent.desc; diff --git a/chrome/content/scripts/jasminum.js b/chrome/content/scripts/jasminum.js index 389f639..1436b76 100644 --- a/chrome/content/scripts/jasminum.js +++ b/chrome/content/scripts/jasminum.js @@ -867,7 +867,7 @@ Zotero.Jasminum = { } var bookmark = await Zotero.Jasminum.getBookmark(item); if (!bookmark) { - alert("No Bookmark found!\n书签信息未找到"); + alert("No Bookmark found!\n书签信息未找到"); } await Zotero.Jasminum.addBookmark(item, bookmark); // Use zotfile to add TOC @@ -965,6 +965,27 @@ Zotero.Jasminum = { } } }, + + removeDotM: function () { + var items = ZoteroPane.getSelectedItems(); + Zotero.Jasminum.removeDot(items); + }, + + removeDot: async function (items) { + for (let item of items) { + var attachmentIDs = item.getAttachments(); + for (let id of attachmentIDs) { + var atta = Zotero.Items.get(id); + var newName = atta.attachmentFilename.replace( + /([\u4e00-\u9fa5]), ([\u4e00-\u9fa5])/g, + "$1$2" + ); + await atta.renameAttachmentFile(newName); + atta.setField("title", newName); + atta.saveTx(); + } + } + }, }; window.addEventListener( diff --git a/chrome/locale/en-US/overlay.dtd b/chrome/locale/en-US/overlay.dtd index c2969bb..b74d19b 100644 --- a/chrome/locale/en-US/overlay.dtd +++ b/chrome/locale/en-US/overlay.dtd @@ -18,4 +18,6 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/chrome/locale/zh-CN/overlay.dtd b/chrome/locale/zh-CN/overlay.dtd index beec89e..82e7019 100644 --- a/chrome/locale/zh-CN/overlay.dtd +++ b/chrome/locale/zh-CN/overlay.dtd @@ -18,4 +18,6 @@ - \ No newline at end of file + + + \ No newline at end of file