Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
0ac55bd0e1
|
|||
|
17cfddfd5c
|
|||
|
3a492c1592
|
|||
|
975a94dfe8
|
|||
| 748729dfa3 | |||
|
2cb0a5b313
|
@@ -14,8 +14,8 @@ A plugin for [Obsidian](https://obsidian.md/) that enables you to create Markdow
|
|||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. **Manual Installation**
|
1. **Manual Installation**
|
||||||
- Download the plugin files (`main.ts`, `settings.ts`, `styles.css`) and build them using your preferred TypeScript build process.
|
- Download the latest release of the plugin from the [GitHub Releases](https://github.com/maksim77/obsidian-jira/releases) page.
|
||||||
- Place the compiled files in your Obsidian vault's `.obsidian/plugins/your-plugin-folder/` directory.
|
- Place the downloaded file into a subfolder within your Obsidian vault’s .obsidian/plugins/ directory.
|
||||||
|
|
||||||
2. **Via Community Plugins**
|
2. **Via Community Plugins**
|
||||||
- (Not yet available in the community plugins list.)
|
- (Not yet available in the community plugins list.)
|
||||||
@@ -52,7 +52,7 @@ You can explore the available data fields by performing a `curl` request to your
|
|||||||
curl -u your-username:password https://jira.example.com/rest/api/2/issue/PROJ-123
|
curl -u your-username:password https://jira.example.com/rest/api/2/issue/PROJ-123
|
||||||
```
|
```
|
||||||
|
|
||||||
The template uses [Nunjucks](https://mozilla.github.io/nunjucks/) syntax. Example:
|
The template uses [Nunjucks](https://mozilla.github.io/nunjucks/) syntax.
|
||||||
|
|
||||||
### Example template
|
### Example template
|
||||||
```nunjucks
|
```nunjucks
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "jira-issue-notes",
|
"id": "jira-issue-notes",
|
||||||
"name": "Jira Issue Notes",
|
"name": "Jira Issue Notes",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"minAppVersion": "0.15.0",
|
"minAppVersion": "0.15.0",
|
||||||
"description": "Plugin for fetching and managing Jira issues directly from your notes",
|
"description": "Plugin for fetching and managing Jira issues directly from your notes",
|
||||||
"author": "Maxim Syomochkin",
|
"author": "Maxim Syomochkin",
|
||||||
|
|||||||
10
package-lock.json
generated
10
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian-sample-plugin",
|
"name": "jira-issue-notes",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "obsidian-sample-plugin",
|
"name": "jira-issue-notes",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"node-fetch": "^3.3.2",
|
"node-fetch": "^3.3.2",
|
||||||
@@ -20,7 +20,6 @@
|
|||||||
"builtin-modules": "3.3.0",
|
"builtin-modules": "3.3.0",
|
||||||
"esbuild": "0.17.3",
|
"esbuild": "0.17.3",
|
||||||
"obsidian": "latest",
|
"obsidian": "latest",
|
||||||
"punycode": "^2.3.1",
|
|
||||||
"tslib": "2.4.0",
|
"tslib": "2.4.0",
|
||||||
"typescript": "4.7.4"
|
"typescript": "4.7.4"
|
||||||
}
|
}
|
||||||
@@ -2171,6 +2170,7 @@
|
|||||||
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
|
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jira-issue-notes",
|
"name": "jira-issue-notes",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "Plugin for fetching and managing Jira issues directly from your notes.",
|
"description": "Plugin for fetching and managing Jira issues directly from your notes.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -19,7 +19,6 @@
|
|||||||
"builtin-modules": "3.3.0",
|
"builtin-modules": "3.3.0",
|
||||||
"esbuild": "0.17.3",
|
"esbuild": "0.17.3",
|
||||||
"obsidian": "latest",
|
"obsidian": "latest",
|
||||||
"punycode": "^2.3.1",
|
|
||||||
"tslib": "2.4.0",
|
"tslib": "2.4.0",
|
||||||
"typescript": "4.7.4"
|
"typescript": "4.7.4"
|
||||||
},
|
},
|
||||||
|
|||||||
166
src/settings.ts
166
src/settings.ts
@@ -62,35 +62,19 @@ export class JiraSettingTab extends PluginSettingTab {
|
|||||||
|
|
||||||
const toggleBtn = document.createElement("button");
|
const toggleBtn = document.createElement("button");
|
||||||
toggleBtn.type = "button";
|
toggleBtn.type = "button";
|
||||||
toggleBtn.style.marginLeft = "8px";
|
toggleBtn.classList.add("jira-password-toggle");
|
||||||
toggleBtn.style.background = "none";
|
|
||||||
toggleBtn.style.border = "none";
|
|
||||||
toggleBtn.style.cursor = "pointer";
|
|
||||||
let visible = false;
|
let visible = false;
|
||||||
|
|
||||||
const eyeIcon = `
|
const icon = createEyeIcon();
|
||||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
toggleBtn.appendChild(icon);
|
||||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
||||||
<path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7z"/>
|
|
||||||
<circle cx="12" cy="12" r="3"/>
|
|
||||||
</svg>
|
|
||||||
`;
|
|
||||||
const eyeOffIcon = `
|
|
||||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
||||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
||||||
<path d="M17.94 17.94A10.94 10.94 0 0 1 12 19c-7 0-11-7-11-7a21.81 21.81 0 0 1 5.06-6.06"/>
|
|
||||||
<path d="M1 1l22 22"/>
|
|
||||||
<path d="M9.53 9.53A3 3 0 0 0 12 15a3 3 0 0 0 2.47-5.47"/>
|
|
||||||
<path d="M14.47 14.47A3 3 0 0 1 12 9a3 3 0 0 1-2.47 5.47"/>
|
|
||||||
</svg>
|
|
||||||
`;
|
|
||||||
|
|
||||||
toggleBtn.innerHTML = eyeIcon;
|
|
||||||
|
|
||||||
toggleBtn.onclick = () => {
|
toggleBtn.onclick = () => {
|
||||||
visible = !visible;
|
visible = !visible;
|
||||||
text.inputEl.type = visible ? "text" : "password";
|
text.inputEl.type = visible ? "text" : "password";
|
||||||
toggleBtn.innerHTML = visible ? eyeOffIcon : eyeIcon;
|
toggleBtn.replaceChild(
|
||||||
|
visible ? createEyeOffIcon() : createEyeIcon(),
|
||||||
|
toggleBtn.firstChild!
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
text.inputEl.parentElement?.appendChild(toggleBtn);
|
text.inputEl.parentElement?.appendChild(toggleBtn);
|
||||||
@@ -137,20 +121,9 @@ export class JiraSettingTab extends PluginSettingTab {
|
|||||||
|
|
||||||
const removeBtn = document.createElement("button");
|
const removeBtn = document.createElement("button");
|
||||||
removeBtn.type = "button";
|
removeBtn.type = "button";
|
||||||
removeBtn.innerHTML = `
|
removeBtn.classList.add("jira-issue-remove-btn");
|
||||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none"
|
|
||||||
stroke="red" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
||||||
<polyline points="3 6 5 6 21 6"></polyline>
|
|
||||||
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"></path>
|
|
||||||
<line x1="10" y1="11" x2="10" y2="17"></line>
|
|
||||||
<line x1="14" y1="11" x2="14" y2="17"></line>
|
|
||||||
</svg>
|
|
||||||
`;
|
|
||||||
removeBtn.style.background = "none";
|
|
||||||
removeBtn.style.border = "none";
|
|
||||||
removeBtn.style.cursor = "pointer";
|
|
||||||
removeBtn.style.marginLeft = "8px";
|
|
||||||
removeBtn.title = "Remove";
|
removeBtn.title = "Remove";
|
||||||
|
removeBtn.appendChild(createTrashIcon());
|
||||||
|
|
||||||
removeBtn.onclick = async () => {
|
removeBtn.onclick = async () => {
|
||||||
this.plugin.settings.issues.splice(idx, 1);
|
this.plugin.settings.issues.splice(idx, 1);
|
||||||
@@ -188,3 +161,124 @@ export class JiraSettingTab extends PluginSettingTab {
|
|||||||
containerEl.appendChild(details);
|
containerEl.appendChild(details);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createEyeIcon(): SVGSVGElement {
|
||||||
|
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
||||||
|
svg.setAttribute("width", "18");
|
||||||
|
svg.setAttribute("height", "18");
|
||||||
|
svg.setAttribute("viewBox", "0 0 24 24");
|
||||||
|
svg.setAttribute("fill", "none");
|
||||||
|
svg.setAttribute("stroke", "currentColor");
|
||||||
|
svg.setAttribute("stroke-width", "2");
|
||||||
|
svg.setAttribute("stroke-linecap", "round");
|
||||||
|
svg.setAttribute("stroke-linejoin", "round");
|
||||||
|
|
||||||
|
const path1 = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"path"
|
||||||
|
);
|
||||||
|
path1.setAttribute("d", "M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7z");
|
||||||
|
const circle = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"circle"
|
||||||
|
);
|
||||||
|
circle.setAttribute("cx", "12");
|
||||||
|
circle.setAttribute("cy", "12");
|
||||||
|
circle.setAttribute("r", "3");
|
||||||
|
|
||||||
|
svg.appendChild(path1);
|
||||||
|
svg.appendChild(circle);
|
||||||
|
return svg;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Функция для создания SVG-иконки "глаз зачёркнутый"
|
||||||
|
function createEyeOffIcon(): SVGSVGElement {
|
||||||
|
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
||||||
|
svg.setAttribute("width", "18");
|
||||||
|
svg.setAttribute("height", "18");
|
||||||
|
svg.setAttribute("viewBox", "0 0 24 24");
|
||||||
|
svg.setAttribute("fill", "none");
|
||||||
|
svg.setAttribute("stroke", "currentColor");
|
||||||
|
svg.setAttribute("stroke-width", "2");
|
||||||
|
svg.setAttribute("stroke-linecap", "round");
|
||||||
|
svg.setAttribute("stroke-linejoin", "round");
|
||||||
|
|
||||||
|
const path1 = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"path"
|
||||||
|
);
|
||||||
|
path1.setAttribute(
|
||||||
|
"d",
|
||||||
|
"M17.94 17.94A10.94 10.94 0 0 1 12 19c-7 0-11-7-11-7a21.81 21.81 0 0 1 5.06-6.06"
|
||||||
|
);
|
||||||
|
const path2 = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"path"
|
||||||
|
);
|
||||||
|
path2.setAttribute("d", "M1 1l22 22");
|
||||||
|
const path3 = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"path"
|
||||||
|
);
|
||||||
|
path3.setAttribute("d", "M9.53 9.53A3 3 0 0 0 12 15a3 3 0 0 0 2.47-5.47");
|
||||||
|
const path4 = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"path"
|
||||||
|
);
|
||||||
|
path4.setAttribute("d", "M14.47 14.47A3 3 0 0 1 12 9a3 3 0 0 1-2.47 5.47");
|
||||||
|
|
||||||
|
svg.appendChild(path1);
|
||||||
|
svg.appendChild(path2);
|
||||||
|
svg.appendChild(path3);
|
||||||
|
svg.appendChild(path4);
|
||||||
|
return svg;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Функция для создания SVG-иконки "корзина" (удаление)
|
||||||
|
function createTrashIcon(): SVGSVGElement {
|
||||||
|
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
||||||
|
svg.setAttribute("width", "16");
|
||||||
|
svg.setAttribute("height", "16");
|
||||||
|
svg.setAttribute("viewBox", "0 0 24 24");
|
||||||
|
svg.setAttribute("fill", "none");
|
||||||
|
svg.setAttribute("stroke", "red");
|
||||||
|
svg.setAttribute("stroke-width", "2");
|
||||||
|
svg.setAttribute("stroke-linecap", "round");
|
||||||
|
svg.setAttribute("stroke-linejoin", "round");
|
||||||
|
|
||||||
|
const polyline = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"polyline"
|
||||||
|
);
|
||||||
|
polyline.setAttribute("points", "3 6 5 6 21 6");
|
||||||
|
const path1 = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"path"
|
||||||
|
);
|
||||||
|
path1.setAttribute(
|
||||||
|
"d",
|
||||||
|
"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"
|
||||||
|
);
|
||||||
|
const line1 = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"line"
|
||||||
|
);
|
||||||
|
line1.setAttribute("x1", "10");
|
||||||
|
line1.setAttribute("y1", "11");
|
||||||
|
line1.setAttribute("x2", "10");
|
||||||
|
line1.setAttribute("y2", "17");
|
||||||
|
const line2 = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"line"
|
||||||
|
);
|
||||||
|
line2.setAttribute("x1", "14");
|
||||||
|
line2.setAttribute("y1", "11");
|
||||||
|
line2.setAttribute("x2", "14");
|
||||||
|
line2.setAttribute("y2", "17");
|
||||||
|
|
||||||
|
svg.appendChild(polyline);
|
||||||
|
svg.appendChild(path1);
|
||||||
|
svg.appendChild(line1);
|
||||||
|
svg.appendChild(line2);
|
||||||
|
return svg;
|
||||||
|
}
|
||||||
|
|||||||
18
styles.css
18
styles.css
@@ -15,3 +15,21 @@
|
|||||||
background: var(--background-modifier-hover);
|
background: var(--background-modifier-hover);
|
||||||
border-color: var(--interactive-accent);
|
border-color: var(--interactive-accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.jira-password-toggle {
|
||||||
|
margin-left: 8px;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
vertical-align: middle;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jira-issue-remove-btn {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-left: 8px;
|
||||||
|
vertical-align: middle;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"1.0.0": "0.15.0"
|
"1.0.0": "0.15.0",
|
||||||
|
"1.0.1": "0.15.0"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user