Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: modal functionaltiy #17

Merged
merged 5 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
!.github
# ignore node/grunt dependency directories
node_modules/
wp-content/

# ignore vendor
vendor/
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"helsingborg-stad/acf-export-manager": ">=1.0.0",
"symfony/polyfill-intl-idn": "1.31.0",
"helsingborg-stad/wpservice": "^2.0",
"helsingborg-stad/acfservice": "^0.8.1"
"helsingborg-stad/acfservice": "^0.8.1",
"helsingborg-stad/component-library": "^4"
},
"require-dev": {
"codedungeon/phpunit-result-printer": "^0.32.0",
Expand Down
2 changes: 1 addition & 1 deletion dist/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"css/broken-link-detector.css": "css/broken-link-detector.024cd1a77a7b5c050e6a.css",
"js/context-detector.js": "js/context-detector.93354089fe4a513a8445.js",
"js/context-detector.js": "js/context-detector.09d51a4f92bccb526918.js",
"js/editor-highlight.js": "js/editor-highlight.a7ccb59aeba3991ac935.js"
}
Binary file modified languages/broken-link-detector-sv_SE.mo
Binary file not shown.
75 changes: 66 additions & 9 deletions languages/broken-link-detector-sv_SE.po
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: Broken Link Detector\n"
"POT-Creation-Date: 2024-11-13 10:53+0100\n"
"PO-Revision-Date: 2024-11-13 11:03+0100\n"
"POT-Creation-Date: 2024-12-03 11:30+0100\n"
"PO-Revision-Date: 2024-12-03 11:33+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: sv_SE\n"
Expand All @@ -15,8 +15,8 @@ msgstr ""
"X-Poedit-WPHeader: broken-link-detector.php\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
"_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.js\n"
"X-Poedit-SearchPathExcluded-1: dist\n"
Expand Down Expand Up @@ -65,27 +65,47 @@ msgid ""
"without public access. The image should be as small as possible, if your "
"site is running on https, this resource must also be served with https."
msgstr ""
"För att identifiera användarens kontext, krävs det att du publicerar en "
"bild på en webbadress som bara kan nås från det interna nätverket. Resursen "
"måste vara tillgänglig via http eller https (om din webbplats använder ssl-"
"För att identifiera användarens kontext, krävs det att du publicerar en bild "
"på en webbadress som bara kan nås från det interna nätverket. Resursen måste "
"vara tillgänglig via http eller https (om din webbplats använder ssl-"
"certifikat)."

#: source/fields/php/context-detection.php:51
msgid "https://internal.resource.admin-network.local/image-1x1.jpg"
msgstr ""

#: source/fields/php/context-detection.php:55
msgid "Inform user by the following methods"
msgstr "Informera användaren genom"

#: source/fields/php/context-detection.php:76
msgid "Tooltip"
msgstr "Text på tooltip"

#: source/fields/php/context-detection.php:77
msgid "Modal"
msgstr "Modalfönster"

#: source/fields/php/context-detection.php:90
msgid "Tooltip Text"
msgstr "Text på tooltip"

#: source/fields/php/context-detection.php:59
#: source/fields/php/context-detection.php:94
msgid "The text that displays in the tooltip, whenever a link is unavabile."
msgstr "Den text som ska visas när en länk inte är tillgänglig."

#: source/fields/php/context-detection.php:77 source/php/Config/Config.php:340
#: source/fields/php/context-detection.php:112 source/php/Config/Config.php:360
msgid "Link unavabile"
msgstr "Otillgänglig"

#: source/fields/php/context-detection.php:118
msgid "Modal Title"
msgstr "Titel i modalfönster"

#: source/fields/php/context-detection.php:146
msgid "Modal Content"
msgstr "Innehåll i modalfönster"

#: source/fields/php/local-domains.php:6
msgid "Local Domain Settings"
msgstr "Inställningar för lokala domäner"
Expand Down Expand Up @@ -177,6 +197,43 @@ msgstr "Alla HTTP Koder"
msgid "Filter"
msgstr "Filter"

#: source/php/Config/Config.php:396
msgid "Content unavabile"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word "unavailable" is misspelled in a couple of places in the code.

msgstr "Länk otillgänglig"

#: source/php/Config/Config.php:414
msgid ""
"\n"
" This link cannot be accessed on your current network. The system you "
"are trying to reach is only available through a secure, authorized "
"connection. \n"
"\n"
" To access it, you need to either be connected to the network in a "
"specific location, such as an office, or use a secure connection method, "
"like a VPN. \n"
"\n"
" Please ensure you are connected to the correct network to proceed.\n"
" "
msgstr ""
"\n"
" Den här länken kan inte nås på ditt nuvarande nätverk. Systemet du "
"försöker nå är endast tillgängligt genom en säker, auktoriserad anslutning.\n"
"\n"
" För att få åtkomst behöver du antingen vara ansluten till nätverket på "
"en specifik plats, som ett kontor, eller använda en säker anslutningsmetod, "
"som en VPN.\n"
"\n"
" Vänligen säkerställ att du är ansluten till rätt nätverk för att "
"fortsätta. "

#: source/php/Modal.php:28
msgid "Open Anyway"
msgstr "Fortsätt ändå"

#: source/php/Modal.php:29
msgid "Close"
msgstr "Stäng"

#. Plugin Name of the plugin/theme
msgid "Broken Link Detector"
msgstr "Brutna länkar (Broken Link Detector)"
Expand Down
95 changes: 93 additions & 2 deletions source/fields/json/context-detection.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,40 @@
"default_value": "",
"placeholder": "https:\/\/internal.resource.admin-network.local\/image-1x1.jpg"
},
{
"key": "field_674ed2cff358e",
"label": "Inform user by the following methods",
"name": "broken_links_context_notify_by",
"aria-label": "",
"type": "checkbox",
"instructions": "",
"required": 0,
"conditional_logic": [
[
{
"field": "field_6718e9eed55b7",
"operator": "==",
"value": "1"
}
]
],
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"tooltip": "Tooltip",
"modal": "Modal"
},
"default_value": [],
"return_format": "value",
"allow_custom": 0,
"layout": "horizontal",
"toggle": 0,
"save_custom": 0,
"custom_choice_button_text": "L\u00e4gg till nytt val"
},
{
"key": "field_6733096f5d072",
"label": "Tooltip Text",
Expand All @@ -58,9 +92,9 @@
"conditional_logic": [
[
{
"field": "field_6718e9eed55b7",
"field": "field_674ed2cff358e",
"operator": "==",
"value": "1"
"value": "tooltip"
}
]
],
Expand All @@ -74,6 +108,63 @@
"placeholder": "Link unavabile",
"prepend": "",
"append": ""
},
{
"key": "field_674ed3fcf358f",
"label": "Modal Title",
"name": "broken_links_context_modal_title",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": [
[
{
"field": "field_674ed2cff358e",
"operator": "==",
"value": "modal"
}
]
],
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
},
{
"key": "field_674ed42ef3590",
"label": "Modal Content",
"name": "broken_links_context_modal_content",
"aria-label": "",
"type": "textarea",
"instructions": "",
"required": 0,
"conditional_logic": [
[
{
"field": "field_674ed2cff358e",
"operator": "==",
"value": "modal"
}
]
],
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"acfe_textarea_code": 0,
"maxlength": "",
"rows": "",
"placeholder": "",
"new_lines": ""
}
],
"location": [
Expand Down
96 changes: 94 additions & 2 deletions source/fields/php/context-detection.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,41 @@
'placeholder' => __('https://internal.resource.admin-network.local/image-1x1.jpg', 'api-event-manager'),
),
2 => array(
'key' => 'field_674ed2cff358e',
'label' => __('Inform user by the following methods', 'api-event-manager'),
'name' => 'broken_links_context_notify_by',
'aria-label' => '',
'type' => 'checkbox',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
0 => array(
0 => array(
'field' => 'field_6718e9eed55b7',
'operator' => '==',
'value' => '1',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
'tooltip' => __('Tooltip', 'api-event-manager'),
'modal' => __('Modal', 'api-event-manager'),
),
'default_value' => array(
),
'return_format' => 'value',
'allow_custom' => 0,
'layout' => 'horizontal',
'toggle' => 0,
'save_custom' => 0,
'custom_choice_button_text' => 'Lägg till nytt val',
),
3 => array(
'key' => 'field_6733096f5d072',
'label' => __('Tooltip Text', 'api-event-manager'),
'name' => 'broken_links_context_tooltip',
Expand All @@ -61,9 +96,9 @@
'conditional_logic' => array(
0 => array(
0 => array(
'field' => 'field_6718e9eed55b7',
'field' => 'field_674ed2cff358e',
'operator' => '==',
'value' => '1',
'value' => 'tooltip',
),
),
),
Expand All @@ -78,6 +113,63 @@
'prepend' => '',
'append' => '',
),
4 => array(
'key' => 'field_674ed3fcf358f',
'label' => __('Modal Title', 'api-event-manager'),
'name' => 'broken_links_context_modal_title',
'aria-label' => '',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
0 => array(
0 => array(
'field' => 'field_674ed2cff358e',
'operator' => '==',
'value' => 'modal',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'maxlength' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
),
5 => array(
'key' => 'field_674ed42ef3590',
'label' => __('Modal Content', 'api-event-manager'),
'name' => 'broken_links_context_modal_content',
'aria-label' => '',
'type' => 'textarea',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
0 => array(
0 => array(
'field' => 'field_674ed2cff358e',
'operator' => '==',
'value' => 'modal',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'acfe_textarea_code' => 0,
'maxlength' => '',
'rows' => '',
'placeholder' => '',
'new_lines' => '',
),
),
'location' => array(
0 => array(
Expand Down
Loading
Loading