Skip to content

Commit bab919f

Browse files
authored
Merge pull request #45 from koloml/release/0.3.1
Release: 0.3.1
2 parents e83d70f + 72f901a commit bab919f

18 files changed

+440
-95
lines changed

.editorconfig

+172
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,178 @@ ij_javascript_while_brace_force = never
231231
ij_javascript_while_on_new_line = false
232232
ij_javascript_wrap_comments = false
233233

234+
[{*.ts,*.tsx}]
235+
indent_size = 2
236+
tab_width = 2
237+
ij_continuation_indent_size = 2
238+
ij_typescript_align_imports = false
239+
ij_typescript_align_multiline_array_initializer_expression = false
240+
ij_typescript_align_multiline_binary_operation = false
241+
ij_typescript_align_multiline_chained_methods = false
242+
ij_typescript_align_multiline_extends_list = false
243+
ij_typescript_align_multiline_for = true
244+
ij_typescript_align_multiline_parameters = true
245+
ij_typescript_align_multiline_parameters_in_calls = false
246+
ij_typescript_align_multiline_ternary_operation = false
247+
ij_typescript_align_object_properties = 0
248+
ij_typescript_align_union_types = false
249+
ij_typescript_align_var_statements = 0
250+
ij_typescript_array_initializer_new_line_after_left_brace = false
251+
ij_typescript_array_initializer_right_brace_on_new_line = false
252+
ij_typescript_array_initializer_wrap = off
253+
ij_typescript_assignment_wrap = off
254+
ij_typescript_binary_operation_sign_on_next_line = false
255+
ij_typescript_binary_operation_wrap = off
256+
ij_typescript_blacklist_imports = rxjs/Rx, node_modules/**, **/node_modules/**, @angular/material, @angular/material/typings/**
257+
ij_typescript_blank_lines_after_imports = 1
258+
ij_typescript_blank_lines_around_class = 1
259+
ij_typescript_blank_lines_around_field = 0
260+
ij_typescript_blank_lines_around_function = 1
261+
ij_typescript_blank_lines_around_method = 1
262+
ij_typescript_block_brace_style = end_of_line
263+
ij_typescript_block_comment_add_space = false
264+
ij_typescript_block_comment_at_first_column = true
265+
ij_typescript_call_parameters_new_line_after_left_paren = false
266+
ij_typescript_call_parameters_right_paren_on_new_line = false
267+
ij_typescript_call_parameters_wrap = off
268+
ij_typescript_catch_on_new_line = false
269+
ij_typescript_chained_call_dot_on_new_line = true
270+
ij_typescript_class_brace_style = end_of_line
271+
ij_typescript_comma_on_new_line = false
272+
ij_typescript_do_while_brace_force = never
273+
ij_typescript_else_on_new_line = false
274+
ij_typescript_enforce_trailing_comma = keep
275+
ij_typescript_extends_keyword_wrap = off
276+
ij_typescript_extends_list_wrap = off
277+
ij_typescript_field_prefix = _
278+
ij_typescript_file_name_style = relaxed
279+
ij_typescript_finally_on_new_line = false
280+
ij_typescript_for_brace_force = never
281+
ij_typescript_for_statement_new_line_after_left_paren = false
282+
ij_typescript_for_statement_right_paren_on_new_line = false
283+
ij_typescript_for_statement_wrap = off
284+
ij_typescript_force_quote_style = false
285+
ij_typescript_force_semicolon_style = false
286+
ij_typescript_function_expression_brace_style = end_of_line
287+
ij_typescript_if_brace_force = never
288+
ij_typescript_import_merge_members = global
289+
ij_typescript_import_prefer_absolute_path = global
290+
ij_typescript_import_sort_members = true
291+
ij_typescript_import_sort_module_name = false
292+
ij_typescript_import_use_node_resolution = true
293+
ij_typescript_imports_wrap = on_every_item
294+
ij_typescript_indent_case_from_switch = true
295+
ij_typescript_indent_chained_calls = true
296+
ij_typescript_indent_package_children = 0
297+
ij_typescript_jsx_attribute_value = braces
298+
ij_typescript_keep_blank_lines_in_code = 2
299+
ij_typescript_keep_first_column_comment = true
300+
ij_typescript_keep_indents_on_empty_lines = false
301+
ij_typescript_keep_line_breaks = true
302+
ij_typescript_keep_simple_blocks_in_one_line = false
303+
ij_typescript_keep_simple_methods_in_one_line = false
304+
ij_typescript_line_comment_add_space = true
305+
ij_typescript_line_comment_at_first_column = false
306+
ij_typescript_method_brace_style = end_of_line
307+
ij_typescript_method_call_chain_wrap = off
308+
ij_typescript_method_parameters_new_line_after_left_paren = false
309+
ij_typescript_method_parameters_right_paren_on_new_line = false
310+
ij_typescript_method_parameters_wrap = off
311+
ij_typescript_object_literal_wrap = on_every_item
312+
ij_typescript_object_types_wrap = on_every_item
313+
ij_typescript_parentheses_expression_new_line_after_left_paren = false
314+
ij_typescript_parentheses_expression_right_paren_on_new_line = false
315+
ij_typescript_place_assignment_sign_on_next_line = false
316+
ij_typescript_prefer_as_type_cast = false
317+
ij_typescript_prefer_explicit_types_function_expression_returns = false
318+
ij_typescript_prefer_explicit_types_function_returns = false
319+
ij_typescript_prefer_explicit_types_vars_fields = false
320+
ij_typescript_prefer_parameters_wrap = false
321+
ij_typescript_property_prefix =
322+
ij_typescript_reformat_c_style_comments = false
323+
ij_typescript_space_after_colon = true
324+
ij_typescript_space_after_comma = true
325+
ij_typescript_space_after_dots_in_rest_parameter = false
326+
ij_typescript_space_after_generator_mult = true
327+
ij_typescript_space_after_property_colon = true
328+
ij_typescript_space_after_quest = true
329+
ij_typescript_space_after_type_colon = true
330+
ij_typescript_space_after_unary_not = false
331+
ij_typescript_space_before_async_arrow_lparen = true
332+
ij_typescript_space_before_catch_keyword = true
333+
ij_typescript_space_before_catch_left_brace = true
334+
ij_typescript_space_before_catch_parentheses = true
335+
ij_typescript_space_before_class_lbrace = true
336+
ij_typescript_space_before_class_left_brace = true
337+
ij_typescript_space_before_colon = true
338+
ij_typescript_space_before_comma = false
339+
ij_typescript_space_before_do_left_brace = true
340+
ij_typescript_space_before_else_keyword = true
341+
ij_typescript_space_before_else_left_brace = true
342+
ij_typescript_space_before_finally_keyword = true
343+
ij_typescript_space_before_finally_left_brace = true
344+
ij_typescript_space_before_for_left_brace = true
345+
ij_typescript_space_before_for_parentheses = true
346+
ij_typescript_space_before_for_semicolon = false
347+
ij_typescript_space_before_function_left_parenth = true
348+
ij_typescript_space_before_generator_mult = false
349+
ij_typescript_space_before_if_left_brace = true
350+
ij_typescript_space_before_if_parentheses = true
351+
ij_typescript_space_before_method_call_parentheses = false
352+
ij_typescript_space_before_method_left_brace = true
353+
ij_typescript_space_before_method_parentheses = false
354+
ij_typescript_space_before_property_colon = false
355+
ij_typescript_space_before_quest = true
356+
ij_typescript_space_before_switch_left_brace = true
357+
ij_typescript_space_before_switch_parentheses = true
358+
ij_typescript_space_before_try_left_brace = true
359+
ij_typescript_space_before_type_colon = false
360+
ij_typescript_space_before_unary_not = false
361+
ij_typescript_space_before_while_keyword = true
362+
ij_typescript_space_before_while_left_brace = true
363+
ij_typescript_space_before_while_parentheses = true
364+
ij_typescript_spaces_around_additive_operators = true
365+
ij_typescript_spaces_around_arrow_function_operator = true
366+
ij_typescript_spaces_around_assignment_operators = true
367+
ij_typescript_spaces_around_bitwise_operators = true
368+
ij_typescript_spaces_around_equality_operators = true
369+
ij_typescript_spaces_around_logical_operators = true
370+
ij_typescript_spaces_around_multiplicative_operators = true
371+
ij_typescript_spaces_around_relational_operators = true
372+
ij_typescript_spaces_around_shift_operators = true
373+
ij_typescript_spaces_around_unary_operator = false
374+
ij_typescript_spaces_within_array_initializer_brackets = false
375+
ij_typescript_spaces_within_brackets = false
376+
ij_typescript_spaces_within_catch_parentheses = false
377+
ij_typescript_spaces_within_for_parentheses = false
378+
ij_typescript_spaces_within_if_parentheses = false
379+
ij_typescript_spaces_within_imports = false
380+
ij_typescript_spaces_within_interpolation_expressions = false
381+
ij_typescript_spaces_within_method_call_parentheses = false
382+
ij_typescript_spaces_within_method_parentheses = false
383+
ij_typescript_spaces_within_object_literal_braces = false
384+
ij_typescript_spaces_within_object_type_braces = true
385+
ij_typescript_spaces_within_parentheses = false
386+
ij_typescript_spaces_within_switch_parentheses = false
387+
ij_typescript_spaces_within_type_assertion = false
388+
ij_typescript_spaces_within_union_types = true
389+
ij_typescript_spaces_within_while_parentheses = false
390+
ij_typescript_special_else_if_treatment = true
391+
ij_typescript_ternary_operation_signs_on_next_line = false
392+
ij_typescript_ternary_operation_wrap = off
393+
ij_typescript_union_types_wrap = on_every_item
394+
ij_typescript_use_chained_calls_group_indents = false
395+
ij_typescript_use_double_quotes = true
396+
ij_typescript_use_explicit_js_extension = auto
397+
ij_typescript_use_import_type = auto
398+
ij_typescript_use_path_mapping = always
399+
ij_typescript_use_public_modifier = false
400+
ij_typescript_use_semicolon_after_statement = true
401+
ij_typescript_var_declaration_wrap = normal
402+
ij_typescript_while_brace_force = never
403+
ij_typescript_while_on_new_line = false
404+
ij_typescript_wrap_comments = false
405+
234406
[{*.htm,*.html,*.sht,*.shtm,*.shtml}]
235407
ij_html_add_new_line_before_tags = body, div, p, form, h1, h2, h3
236408
ij_html_align_attributes = true

jsconfig.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
"skipLibCheck": true,
1010
"sourceMap": true,
1111
"strict": true,
12-
"moduleResolution": "bundler"
12+
"moduleResolution": "bundler",
13+
"allowImportingTsExtensions": true
1314
}
14-
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
15-
//
16-
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
17-
// from the referenced tsconfig.json - TypeScript does not merge them in
1815
}

manifest.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Furbooru Tagging Assistant",
33
"description": "Experimental extension with a set of tools to make the tagging faster and easier. Made specifically for Furbooru.",
4-
"version": "0.3.0",
4+
"version": "0.3.1",
55
"browser_specific_settings": {
66
"gecko": {
77
@@ -48,6 +48,7 @@
4848
"*://*.furbooru.org/images/*/tag_changes",
4949
"*://*.furbooru.org/images/*/tag_changes?*",
5050
"*://*.furbooru.org/search?*",
51+
"*://*.furbooru.org/tags",
5152
"*://*.furbooru.org/tags?*",
5253
"*://*.furbooru.org/tags/*",
5354
"*://*.furbooru.org/profiles/*/tag_changes",

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "furbooru-tagging-assistant",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"private": true,
55
"scripts": {
66
"build": "npm run build:popup && npm run build:extension",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<script>
2+
import MenuLink from "$components/ui/menu/MenuItem.svelte";
3+
4+
/**
5+
* @type {boolean}
6+
*/
7+
export let checked;
8+
9+
/**
10+
* @type {string|undefined}
11+
*/
12+
export let name = undefined;
13+
14+
/**
15+
* @type {string|undefined}
16+
*/
17+
export let value = undefined;
18+
19+
/**
20+
* @type {string|null}
21+
*/
22+
export let href = null;
23+
</script>
24+
25+
<MenuLink {href}>
26+
<input type="checkbox" {name} {value} {checked} on:input on:click|stopPropagation>
27+
<slot></slot>
28+
</MenuLink>
29+
30+
<style lang="scss">
31+
:global(.menu-item) input {
32+
width: 16px;
33+
height: 16px;
34+
margin-right: 6px;
35+
flex-shrink: 0;
36+
}
37+
</style>

src/components/ui/menu/MenuRadioItem.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@
3232
width: 16px;
3333
height: 16px;
3434
margin-right: 6px;
35+
flex-shrink: 0;
3536
}
3637
</style>

src/content/tags.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import {wrapTagDropdown} from "$lib/components/TagDropdownWrapper.js";
1+
import {watchTagDropdownsInTagsEditor, wrapTagDropdown} from "$lib/components/TagDropdownWrapper.js";
22

33
for (let tagDropdownElement of document.querySelectorAll('.tag.dropdown')) {
44
wrapTagDropdown(tagDropdownElement);
55
}
6+
7+
watchTagDropdownsInTagsEditor();

src/lib/components/MaintenancePopup.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,13 @@ export class MaintenancePopup extends BaseComponent {
286286

287287
this.#maintenanceSettings
288288
.resolveActiveProfileAsObject()
289-
.then(callback);
289+
.then(profileOrNull => {
290+
if (profileOrNull) {
291+
lastActiveProfileId = profileOrNull.id;
292+
}
293+
294+
callback(profileOrNull);
295+
});
290296

291297
return () => {
292298
unsubscribeFromProfilesChanges();

src/lib/components/TagDropdownWrapper.js

+39
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import {BaseComponent} from "$lib/components/base/BaseComponent.js";
22
import MaintenanceProfile from "$entities/MaintenanceProfile.js";
33
import MaintenanceSettings from "$lib/extension/settings/MaintenanceSettings.js";
4+
import {getComponent} from "$lib/components/base/ComponentUtils.js";
5+
6+
const isTagEditorProcessedKey = Symbol();
47

58
class TagDropdownWrapper extends BaseComponent {
69
/**
@@ -187,5 +190,41 @@ class TagDropdownWrapper extends BaseComponent {
187190
}
188191

189192
export function wrapTagDropdown(element) {
193+
// Skip initialization when tag component is already wrapped
194+
if (getComponent(element)) {
195+
return;
196+
}
197+
190198
new TagDropdownWrapper(element).initialize();
191199
}
200+
201+
export function watchTagDropdownsInTagsEditor() {
202+
// We only need to watch for new editor elements if there is a tag editor present on the page
203+
if (!document.querySelector('#image_tags_and_source')) {
204+
return;
205+
}
206+
207+
document.body.addEventListener('mouseover', event => {
208+
/** @type {HTMLElement} */
209+
const targetElement = event.target;
210+
211+
if (targetElement[isTagEditorProcessedKey]) {
212+
return;
213+
}
214+
215+
/** @type {HTMLElement|null} */
216+
const closestTagEditor = targetElement.closest('#image_tags_and_source');
217+
218+
if (!closestTagEditor || closestTagEditor[isTagEditorProcessedKey]) {
219+
targetElement[isTagEditorProcessedKey] = true;
220+
return;
221+
}
222+
223+
targetElement[isTagEditorProcessedKey] = true;
224+
closestTagEditor[isTagEditorProcessedKey] = true;
225+
226+
for (const tagDropdownElement of closestTagEditor.querySelectorAll('.tag.dropdown')) {
227+
wrapTagDropdown(tagDropdownElement);
228+
}
229+
})
230+
}

0 commit comments

Comments
 (0)