Skip to content

Commit f1e629a

Browse files
committed
lint: format code
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
1 parent e5a75d6 commit f1e629a

2 files changed

Lines changed: 18 additions & 26 deletions

File tree

text2tag/info.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,9 @@
22
"name": "Text2tag",
33
"identifier": "text2tag",
44
"script": "text2tag.qml",
5-
"authors": [
6-
"@Glin76"
7-
],
8-
"platforms": [
9-
"linux",
10-
"macos",
11-
"windows"
12-
],
5+
"authors": ["@Glin76"],
6+
"platforms": ["linux", "macos", "windows"],
137
"version": "0.0.1",
148
"minAppVersion": "25.05.3",
159
"description": "This script creates a menu item and a button that adds a tag with the selected text to the current note."
16-
}
10+
}

text2tag/text2tag.qml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,24 @@ import QtQml 2.0
44
* This script creates a menu item and a button that adds a tag with the selected text to the current note
55
*/
66
QtObject {
7-
8-
function init() {
9-
// create the menu entry
10-
script.registerCustomAction("Text2tag", "Create tag with selected text", "Text 2 tag", "bookmark-new", true, false, true);
11-
}
12-
137
function customActionInvoked(identifier) {
148
switch (identifier) {
15-
case "Text2tag":
16-
var tag = script.getTagByNameBreadcrumbList(script.noteTextEditSelectedText());
17-
var AlreadyTagged = false;
18-
for (var idx in tag.notes) {
19-
if (tag.notes[idx].id == script.currentNote().id) {
20-
AlreadyTagged = true;
21-
}
9+
case "Text2tag":
10+
var tag = script.getTagByNameBreadcrumbList(script.noteTextEditSelectedText());
11+
var AlreadyTagged = false;
12+
for (var idx in tag.notes) {
13+
if (tag.notes[idx].id == script.currentNote().id) {
14+
AlreadyTagged = true;
2215
}
23-
if (!AlreadyTagged) {
24-
script.tagCurrentNote(script.noteTextEditSelectedText());
25-
}
26-
break;
16+
}
17+
if (!AlreadyTagged) {
18+
script.tagCurrentNote(script.noteTextEditSelectedText());
19+
}
20+
break;
2721
}
2822
}
23+
function init() {
24+
// create the menu entry
25+
script.registerCustomAction("Text2tag", "Create tag with selected text", "Text 2 tag", "bookmark-new", true, false, true);
26+
}
2927
}

0 commit comments

Comments
 (0)