Skip to content

Commit

Permalink
release: 0.39.21
Browse files Browse the repository at this point in the history
  • Loading branch information
RyotaUshio committed Apr 23, 2024
1 parent 4abadc1 commit 6a97e62
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 30 deletions.
2 changes: 1 addition & 1 deletion manifest-beta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "pdf-plus",
"name": "PDF++",
"version": "0.39.20",
"version": "0.39.21",
"minAppVersion": "1.4.16",
"description": "The most Obsidian-native PDF annotation tool ever.",
"author": "Ryota Ushio",
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "pdf-plus",
"name": "PDF++",
"version": "0.39.20",
"version": "0.39.21",
"minAppVersion": "1.4.16",
"description": "The most Obsidian-native PDF annotation tool ever.",
"author": "Ryota Ushio",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-pdf-plus",
"version": "0.39.20",
"version": "0.39.21",
"description": "The most Obsidian-native PDF annotation tool ever.",
"scripts": {
"dev": "node esbuild.config.mjs",
Expand Down
8 changes: 0 additions & 8 deletions src/lib/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,10 @@ export class PDFPlusCommands extends PDFPlusLibSubmodule {
id: 'copy-link-to-selection',
name: 'Copy link to selection or annotation',
checkCallback: (checking) => this.copyLink(checking, false)
}, {
id: 'copy-auto-paste-link-to-selection',
name: '(Deprecated) Copy & auto-paste link to selection or annotation',
checkCallback: (checking) => this.copyLink(checking, true)
}, {
id: 'rectangular-selection',
name: 'Start rectangular selection',
checkCallback: (checking) => this.copyEmbedLinkToRectangularSelection(checking, false)
}, {
id: 'rectangular-selection-auto-paste',
name: '(Deprecated) Start rectangular selection and auto-paste',
checkCallback: (checking) => this.copyEmbedLinkToRectangularSelection(checking, true)
},
// {
// id: 'create-canvas-card-from-selection',
Expand Down
20 changes: 4 additions & 16 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1386,11 +1386,6 @@ export class PDFPlusSettingTab extends PluginSettingTab {

this.contentEl.createDiv('top-note', async (el) => {
await this.renderMarkdown([
'> [!IMPORTANT]',
'> The **Copy & auto-paste link to selection or annotation** command is planned to be removed in the near future. Instead, use the **Copy link to selection or annotation** command after enabling auto-paste using the **Toggle auto-paste** icon in the left ribbon menu or the **Toggle auto-paste** command.',
'> ',
'> If you don\'t like this change, feel free to let me know via [GitHub Discussions](https://github.com/RyotaUshio/obsidian-pdf-plus/discussions/112).',
'',
'> [!TIP]',
'> - You can easily navigate through the settings by clicking the icons in the header above.',
'> - Some settings below require reopening tabs or reloading the plugin to take effect.',
Expand Down Expand Up @@ -1890,19 +1885,12 @@ export class PDFPlusSettingTab extends PluginSettingTab {
.setName('Set up hotkeys for copying links')
.then((setting) => {
this.renderMarkdown([
'PDF++ offers three commands for quickly copying links via hotkeys.',
'PDF++ offers two commands for quickly copying links via hotkeys.',
'',
'1. **Copy link to selection or annotation:**',
' Copies a link to the text selection or focused annotation in the PDF viewer, which is formatted according to the options specified in the PDF toolbar.',
' <br>If the "Add highlights to file directly" toggle switch in the PDF toolbar is on, it first adds a highlight annotation directly to the PDF file, and then copies the link to the created annotation.',
'2. **Copy & auto-paste link to selection or annotation:**',
' In addition to copying the link, it automatically pastes the copied link at the end of the last active note or the note where you last pasted a link. Note that Canvas is not supported.',
' > [!IMPORTANT]',
' > This command is planned to be removed in the near future. Instead, use the "Copy link to selection or annotation" command after enabling auto-paste using the "Toggle auto-paste" icon in the left ribbon menu or the "Toggle auto-paste" command. If you don\'t like this change, feel free to let me know via [GitHub Discussions](https://github.com/RyotaUshio/obsidian-pdf-plus/discussions/112).',
'',
'The third command is very different from the first two:',
'',
'3. **Copy link to current page view:** Copies a link, clicking which will open the PDF file at the current scroll position and zoom level.',
'2. **Copy link to current page view:** Copies a link, clicking which will open the PDF file at the current scroll position and zoom level.',
'',
'After running this command, you can add the copied link to the PDF file itself: select a range of text, right-click, and then click "Paste copied link to selection".'
], setting.descEl);
Expand Down Expand Up @@ -2113,7 +2101,7 @@ export class PDFPlusSettingTab extends PluginSettingTab {
.setValue(this.plugin.settings.autoFocus)
.onChange((value) => {
this.plugin.toggleAutoFocus(value);
this.redisplay(); // Reflect the change to the auto-paste toggle (you canot activate both of them at the same time)
this.redisplay(); // Reflect the change to the auto-paste toggle (we cannot activate both of them at the same time)
});
});
this.addToggleSetting('autoFocusToggleRibbonIcon', () => this.redisplay())
Expand Down Expand Up @@ -2165,7 +2153,7 @@ export class PDFPlusSettingTab extends PluginSettingTab {
);
this.addToggleSetting('respectCursorPositionWhenAutoPaste')
.setName('Respect current cursor position')
.setDesc('When enabled, the auto-paste command will paste the copied text at the current cursor position if the target note is already opened. If disabled, the text will be always appended to the end of the note.');
.setDesc('When enabled, triggering auto-pasting will paste the copied text at the current cursor position if the target note is already opened. If disabled, the text will be always appended to the end of the note.');

this.addHeading('General', 'auto-general')
.setDesc('General settings that apply to both auto-focus and auto-paste.');
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export function toSingleLine(str: string, removeWhitespaceBetweenCJKChars = fals
return prev + ' ' + next;
});
if (removeWhitespaceBetweenCJKChars) {
str = str.replace(new RegExp(`${cjkRegexp.source}( )${cjkRegexp.source}`, 'g'), '');
str = str.replace(new RegExp(`(${cjkRegexp.source}) (?=${cjkRegexp.source})`, 'g'), '$1');
}
return window.pdfjsViewer.removeNullCharacters(window.pdfjsLib.normalizeUnicode(str));
}
Expand Down

0 comments on commit 6a97e62

Please sign in to comment.