mirror of
https://github.com/heroblackink/ultimate-todoist-sync-for-obsidian.git
synced 2026-07-22 07:40:27 +00:00
Merge pull request #91 from deafmute1/issue90-desktop-uri
Add App URIs for links
This commit is contained in:
commit
4976caab80
4 changed files with 23 additions and 4 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -21,3 +21,7 @@ userData
|
|||
|
||||
# Exclude macOS Finder (System Explorer) View States
|
||||
.DS_Store
|
||||
|
||||
|
||||
# Add js build artifacts
|
||||
*.js
|
||||
6
package-lock.json
generated
6
package-lock.json
generated
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"name": "obsidian-sample-plugin",
|
||||
"name": "ultimate-todoist-sync",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "obsidian-sample-plugin",
|
||||
"name": "ultimate-todoist-sync",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"license": "GNU GPLv3",
|
||||
"dependencies": {
|
||||
"@doist/todoist-api-typescript": "^2.1.2"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ export interface UltimateTodoistSyncSettings {
|
|||
enableFullVaultSync: boolean;
|
||||
statistics: any;
|
||||
debugMode:boolean;
|
||||
useAppURI:boolean;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -34,6 +35,7 @@ export const DEFAULT_SETTINGS: UltimateTodoistSyncSettings = {
|
|||
enableFullVaultSync:false,
|
||||
statistics:{},
|
||||
debugMode:false,
|
||||
useAppURI:true,
|
||||
//mySetting: 'default',
|
||||
//todoistTasksFilePath: 'todoistTasks.json'
|
||||
|
||||
|
|
@ -396,6 +398,19 @@ export class UltimateTodoistSyncSettingTab extends PluginSettingTab {
|
|||
this.plugin.todoistSync.backupTodoistAllResources()
|
||||
})
|
||||
);
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Use Desktop URIs')
|
||||
.setDesc('If enabled produces application URI links (todoist://...) instead of web urls (https://...), which open in the app instead of the browser')
|
||||
.addToggle(component =>
|
||||
component
|
||||
.setValue(this.plugin.settings.useAppURI)
|
||||
.onChange((value)=>{
|
||||
this.plugin.settings.useAppURI = value
|
||||
this.plugin.saveSettings()
|
||||
})
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ export class TodoistSync {
|
|||
|
||||
//todoist id 保存到 任务后面
|
||||
const text_with_out_link = `${linetxt} %%[todoist_id:: ${todoist_id}]%%`;
|
||||
const link = `[link](${newTask.url})`
|
||||
const link = this.plugin.settings.useAppURI ? `[link](todoist://task?id=${newTask.id})` : `[link](${newTask.url})`
|
||||
const text = this.plugin.taskParser.addTodoistLink(text_with_out_link,link)
|
||||
const from = { line: cursor.line, ch: 0 };
|
||||
const to = { line: cursor.line, ch: linetxt.length };
|
||||
|
|
|
|||
Loading…
Reference in a new issue