From 20623847c9759c3597e53034caa94e165ee79c10 Mon Sep 17 00:00:00 2001 From: Sebastian Thulin Date: Mon, 2 Dec 2024 17:52:38 +0100 Subject: [PATCH 1/5] feat: adds outline of modal functionality --- .gitignore | 1 + composer.json | 3 +- source/php/App.php | 15 ++++++ source/php/Config/Config.php | 67 +++++++++++++++++++++++++++ source/php/Config/ConfigInterface.php | 6 +++ source/php/Modal.php | 41 ++++++++++++++++ source/views/modal.blade.php | 25 ++++++++++ 7 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 source/php/Modal.php create mode 100644 source/views/modal.blade.php diff --git a/.gitignore b/.gitignore index 2dbbd53..5fb578b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ !.github # ignore node/grunt dependency directories node_modules/ +wp-content/ # ignore vendor vendor/ diff --git a/composer.json b/composer.json index 78da85e..db5c15b 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/source/php/App.php b/source/php/App.php index fc2c9d1..1f38fd2 100644 --- a/source/php/App.php +++ b/source/php/App.php @@ -31,6 +31,9 @@ use BrokenLinkDetector\Cli\FindLinks; use BrokenLinkDetector\Cli\ClassifyLinks; +/* Vendors */ +use ComponentLibrary\Init; + class App { public static $dbTable = 'broken_links_detector'; @@ -216,6 +219,18 @@ public function __construct( $config ); $contextDetectionAsset->addHooks(); + + // Add modal, if enabled + if($config->getIsModalActive()) { + $modal = new \BrokenLinkDetector\Modal( + $wpService, + $config, + new \ComponentLibrary\Init( + [$config->getTemplateDirectory()] + ) + ); + $modal->addHooks(); + } } } diff --git a/source/php/Config/Config.php b/source/php/Config/Config.php index 3208a36..720948c 100644 --- a/source/php/Config/Config.php +++ b/source/php/Config/Config.php @@ -356,6 +356,73 @@ public function getCommandNamespace(): string ); } + /** + * Get the template directory. + * + * @return string + */ + public function getTemplateDirectory(): string + { + return $this->wpService->applyFilters( + $this->createFilterKey(__FUNCTION__), + $this->getPluginPath() . 'source/views' + ); + } + + /** + * Get the active status for the modal. + * + * @return bool + */ + public function getIsModalActive(): bool + { + $isActive = $this->acfService->getField( + 'broken_links_modal_active', + 'option' + ) ?: false; + + return $this->wpService->applyFilters( + $this->createFilterKey(__FUNCTION__), + $isActive ?: false + ); + } + + /** + * Get the title for the modal. + * + * @return string + */ + public function getModalTitle(): string + { + $title = $this->acfService->getField( + 'broken_links_modal_title', + 'option' + ) ?: false; + + return $this->wpService->applyFilters( + $this->createFilterKey(__FUNCTION__), + $title ?: '' + ); + } + + /** + * Get the content for the modal. + * + * @return string + */ + public function getModalContent(): string + { + $content = $this->acfService->getField( + 'broken_links_modal_content', + 'option' + ) ?: false; + + return $this->wpService->applyFilters( + $this->createFilterKey(__FUNCTION__), + $content ?: '' + ); + } + /** * Create a prefix for image conversion filter. * diff --git a/source/php/Config/ConfigInterface.php b/source/php/Config/ConfigInterface.php index 13bd693..398e3d4 100644 --- a/source/php/Config/ConfigInterface.php +++ b/source/php/Config/ConfigInterface.php @@ -46,4 +46,10 @@ public function getContextCheckDomainsToDisable(): array; public function getContextCheckSuccessClass(): string; public function getContextCheckFailedClass(): string; public function getContextCheckTooltipText(): string; + + /* Modal */ + public function getTemplateDirectory(): string; + public function getIsModalActive(): bool; + public function getModalTitle(): string; + public function getModalContent(): string; } \ No newline at end of file diff --git a/source/php/Modal.php b/source/php/Modal.php new file mode 100644 index 0000000..73774ca --- /dev/null +++ b/source/php/Modal.php @@ -0,0 +1,41 @@ +wpService->addAction('wp_footer', [$this, 'renderView']); + } + + /** + * Render the modal view + */ + public function renderView(): string + { + $data = [ + 'title' => 'Title', + 'content' => 'Content', + 'ctaLink' => '{{BLD_CTA_LINK}}', + 'ctaLabel' => $this->wpService->__("Open Anyway", 'broken-link-detector'), + 'close' => $this->wpService->__("Close", 'broken-link-detector'), + ]; + + $blade = $this->componentLibrary->getEngine(); + + try { + echo $blade->makeView('modal', $data, [], [])->render(); + } catch (Throwable $e) { + $blade->errorHandler($e)->print(); + } + return false; + } +} \ No newline at end of file diff --git a/source/views/modal.blade.php b/source/views/modal.blade.php new file mode 100644 index 0000000..c69d8ac --- /dev/null +++ b/source/views/modal.blade.php @@ -0,0 +1,25 @@ + +@modal( + [ + 'closeButtonText' => 'Close', + 'heading' => $title, + 'id' => 'modal-broken-link', + 'size' => 'sm', + 'padding' => 2, + 'borderRadius' => 'lg', + ] +) + {{ $content}} + @slot('bottom') + @button([ + 'href' => $ctaLink, + 'type' => 'filled', + 'text' => $ctaLabel, + 'icon' => 'open_in_new', + 'size' => 'md', + 'color' => 'primary', + 'reverseIcon' => true + ]) + @endbutton + @endslot +@endmodal \ No newline at end of file From acb6b001cb641491fe518f0f8591ff9b6176a98b Mon Sep 17 00:00:00 2001 From: Sebastian Thulin Date: Tue, 3 Dec 2024 08:26:14 +0100 Subject: [PATCH 2/5] fix: add config functions. --- source/php/Config/Config.php | 4 ++-- source/php/Modal.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/php/Config/Config.php b/source/php/Config/Config.php index 720948c..eb7d477 100644 --- a/source/php/Config/Config.php +++ b/source/php/Config/Config.php @@ -379,11 +379,11 @@ public function getIsModalActive(): bool $isActive = $this->acfService->getField( 'broken_links_modal_active', 'option' - ) ?: false; + ) ?: true; return $this->wpService->applyFilters( $this->createFilterKey(__FUNCTION__), - $isActive ?: false + $isActive ?: true ); } diff --git a/source/php/Modal.php b/source/php/Modal.php index 73774ca..f99bd89 100644 --- a/source/php/Modal.php +++ b/source/php/Modal.php @@ -22,8 +22,8 @@ public function addHooks(): void public function renderView(): string { $data = [ - 'title' => 'Title', - 'content' => 'Content', + 'title' => $this->config->getModalTitle(), + 'content' => $this->config->getModalContent(), 'ctaLink' => '{{BLD_CTA_LINK}}', 'ctaLabel' => $this->wpService->__("Open Anyway", 'broken-link-detector'), 'close' => $this->wpService->__("Close", 'broken-link-detector'), From 5e362443906f1e965d65076b957356d9eaabc220 Mon Sep 17 00:00:00 2001 From: Sebastian Thulin Date: Tue, 3 Dec 2024 11:25:40 +0100 Subject: [PATCH 3/5] fix: adjustments & config --- dist/manifest.json | 2 +- source/fields/json/context-detection.json | 95 +++++++++++++++++++++- source/fields/php/context-detection.php | 96 +++++++++++++++++++++- source/js/context-detector.ts | 47 +++++++++-- source/php/App.php | 2 +- source/php/Asset/ContextDetection.php | 4 +- source/php/Config/Config.php | 97 +++++++++++++++-------- source/php/Config/ConfigInterface.php | 7 +- source/php/Modal.php | 4 +- source/views/modal.blade.php | 11 ++- 10 files changed, 311 insertions(+), 54 deletions(-) diff --git a/dist/manifest.json b/dist/manifest.json index eec7bb1..18cdb37 100644 --- a/dist/manifest.json +++ b/dist/manifest.json @@ -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" } \ No newline at end of file diff --git a/source/fields/json/context-detection.json b/source/fields/json/context-detection.json index 47537b5..2ebdae1 100644 --- a/source/fields/json/context-detection.json +++ b/source/fields/json/context-detection.json @@ -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", @@ -58,9 +92,9 @@ "conditional_logic": [ [ { - "field": "field_6718e9eed55b7", + "field": "field_674ed2cff358e", "operator": "==", - "value": "1" + "value": "tooltip" } ] ], @@ -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": [ diff --git a/source/fields/php/context-detection.php b/source/fields/php/context-detection.php index 963177e..74342aa 100644 --- a/source/fields/php/context-detection.php +++ b/source/fields/php/context-detection.php @@ -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', @@ -61,9 +96,9 @@ 'conditional_logic' => array( 0 => array( 0 => array( - 'field' => 'field_6718e9eed55b7', + 'field' => 'field_674ed2cff358e', 'operator' => '==', - 'value' => '1', + 'value' => 'tooltip', ), ), ), @@ -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( diff --git a/source/js/context-detector.ts b/source/js/context-detector.ts index b256f59..96a4717 100644 --- a/source/js/context-detector.ts +++ b/source/js/context-detector.ts @@ -79,13 +79,48 @@ class ClientTypeChecker { this.config.domains.forEach(domain => { const elements = document.querySelectorAll(`a[href*="${domain}"]`); elements.forEach(element => { - element.classList.add('broken-link-detector-link-is-unavabile'); - element.setAttribute("data-tooltip", this.config.tooltip); - element.addEventListener("click", (event) => { - event.preventDefault(); - }); + this.addUnavailableClass(element); + this.preventDefaultOnClick(element); + + if (this.config.isToolTipActive) { + this.addTooltip(element); + } + + if (this.config.isModalActive) { + this.addModalAttributes(element); + } }); }); + + this.reindexModals(); + } + + private addUnavailableClass(element: Element): void { + element.classList.add('broken-link-detector-link-is-unavailable'); + } + + private preventDefaultOnClick(element: Element): void { + element.addEventListener("click", (event) => { + event.preventDefault(); + }); + } + + private addTooltip(element: Element): void { + element.setAttribute("data-tooltip", this.config.tooltip); + } + + private addModalAttributes(element: Element): void { + element.setAttribute("data-open", "modal-broken-link"); + element.addEventListener("click", () => { + const modalButton = document.getElementById("modal-broken-link-button"); + if (modalButton) { + modalButton.setAttribute("href", element.getAttribute("href") || "#linknotfound"); + } + }); + } + + private reindexModals(): void { + document.dispatchEvent(new CustomEvent('reindexModals')); } } @@ -98,6 +133,8 @@ interface brokenLinkContextDetectionData { tooltip: string; successClass: string; failedClass: string; + isToolTipActive: boolean; + isModalActive: boolean; } declare global { diff --git a/source/php/App.php b/source/php/App.php index 1f38fd2..2cda73c 100644 --- a/source/php/App.php +++ b/source/php/App.php @@ -221,7 +221,7 @@ public function __construct( $contextDetectionAsset->addHooks(); // Add modal, if enabled - if($config->getIsModalActive()) { + if($config->getContextCheckIsModalActive()) { $modal = new \BrokenLinkDetector\Modal( $wpService, $config, diff --git a/source/php/Asset/ContextDetection.php b/source/php/Asset/ContextDetection.php index 251203a..1e48433 100644 --- a/source/php/Asset/ContextDetection.php +++ b/source/php/Asset/ContextDetection.php @@ -33,9 +33,11 @@ public function getLocalizeData(): ?array 'checkUrl' => $this->config->getContextCheckUrl(), 'checkTimeout' => $this->config->getContextCheckTimeout(), 'domains' => $this->config->getContextCheckDomainsToDisable(), - 'tooltip' => $this->config->getContextCheckTooltipText(), 'successClass' => $this->config->getContextCheckSuccessClass(), 'failedClass' => $this->config->getContextCheckFailedClass(), + 'isToolTipActive' => $this->config->getContextCheckIsToolTipActive(), + 'tooltip' => $this->config->getContextCheckTooltipText(), + 'isModalActive' => $this->config->getContextCheckIsModalActive(), ]; } } \ No newline at end of file diff --git a/source/php/Config/Config.php b/source/php/Config/Config.php index eb7d477..b3b3c96 100644 --- a/source/php/Config/Config.php +++ b/source/php/Config/Config.php @@ -322,6 +322,26 @@ public function getContextCheckFailedClass() : string { ); } + /** + * Get the active status for the tooltip. + * + * @return bool + */ + public function getContextCheckIsToolTipActive(): bool + { + $notifyByValues = $this->acfService->getField( + 'broken_links_context_notify_by', + 'option' + ) ?: []; + + $isActive = in_array('tooltip', $notifyByValues); + + return $this->wpService->applyFilters( + $this->createFilterKey(__FUNCTION__), + $isActive ?? true + ); + } + /** * Get the tooltip text for the context detection disabled link. * @@ -344,82 +364,91 @@ public function getContextCheckTooltipText(): string } /** - * Get the namespace for the WP CLI command. + * Get the active status for the modal. * - * @return string + * @return bool */ - public function getCommandNamespace(): string + public function getContextCheckIsModalActive(): bool { + $notifyByValues = $this->acfService->getField( + 'broken_links_context_notify_by', + 'option' + ) ?: []; + + $isActive = in_array('modal', $notifyByValues); + return $this->wpService->applyFilters( - $this->createFilterKey(__FUNCTION__), - 'broken-link-detector' + $this->createFilterKey(__FUNCTION__), + $isActive ?? true ); } /** - * Get the template directory. + * Get the title for the modal. * * @return string */ - public function getTemplateDirectory(): string + public function getContextCheckModalTitle(): string { + $title = $this->acfService->getField( + 'broken_links_modal_title', + 'option' + ) ?: $this->wpService->__('Content unavabile', 'broken-link-detector'); + return $this->wpService->applyFilters( - $this->createFilterKey(__FUNCTION__), - $this->getPluginPath() . 'source/views' + $this->createFilterKey(__FUNCTION__), + $title ); } /** - * Get the active status for the modal. + * Get the content for the modal. * - * @return bool + * @return string */ - public function getIsModalActive(): bool + public function getContextCheckModalContent(): string { - $isActive = $this->acfService->getField( - 'broken_links_modal_active', + $content = $this->acfService->getField( + 'broken_links_modal_content', 'option' - ) ?: true; + ) ?: $this->wpService->__(' + This link cannot be accessed on your current network. The system you are trying to reach is only available through a secure, authorized connection. + + 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. + + Please ensure you are connected to the correct network to proceed. + ', 'broken-link-detector' + ); return $this->wpService->applyFilters( $this->createFilterKey(__FUNCTION__), - $isActive ?: true + $this->wpService->wpautop($content) ); } /** - * Get the title for the modal. + * Get the namespace for the WP CLI command. * * @return string */ - public function getModalTitle(): string + public function getCommandNamespace(): string { - $title = $this->acfService->getField( - 'broken_links_modal_title', - 'option' - ) ?: false; - return $this->wpService->applyFilters( - $this->createFilterKey(__FUNCTION__), - $title ?: '' + $this->createFilterKey(__FUNCTION__), + 'broken-link-detector' ); } /** - * Get the content for the modal. + * Get the template directory. * * @return string */ - public function getModalContent(): string + public function getTemplateDirectory(): string { - $content = $this->acfService->getField( - 'broken_links_modal_content', - 'option' - ) ?: false; - return $this->wpService->applyFilters( - $this->createFilterKey(__FUNCTION__), - $content ?: '' + $this->createFilterKey(__FUNCTION__), + $this->getPluginPath() . 'source/views' ); } diff --git a/source/php/Config/ConfigInterface.php b/source/php/Config/ConfigInterface.php index 398e3d4..6174768 100644 --- a/source/php/Config/ConfigInterface.php +++ b/source/php/Config/ConfigInterface.php @@ -49,7 +49,8 @@ public function getContextCheckTooltipText(): string; /* Modal */ public function getTemplateDirectory(): string; - public function getIsModalActive(): bool; - public function getModalTitle(): string; - public function getModalContent(): string; + public function getContextCheckIsModalActive(): bool; + public function getContextCheckIsToolTipActive(): bool; + public function getContextCheckModalTitle(): string; + public function getContextCheckModalContent(): string; } \ No newline at end of file diff --git a/source/php/Modal.php b/source/php/Modal.php index f99bd89..fc96555 100644 --- a/source/php/Modal.php +++ b/source/php/Modal.php @@ -22,8 +22,8 @@ public function addHooks(): void public function renderView(): string { $data = [ - 'title' => $this->config->getModalTitle(), - 'content' => $this->config->getModalContent(), + 'title' => $this->config->getContextCheckModalTitle(), + 'content' => $this->config->getContextCheckModalContent(), 'ctaLink' => '{{BLD_CTA_LINK}}', 'ctaLabel' => $this->wpService->__("Open Anyway", 'broken-link-detector'), 'close' => $this->wpService->__("Close", 'broken-link-detector'), diff --git a/source/views/modal.blade.php b/source/views/modal.blade.php index c69d8ac..1d27814 100644 --- a/source/views/modal.blade.php +++ b/source/views/modal.blade.php @@ -5,20 +5,25 @@ 'heading' => $title, 'id' => 'modal-broken-link', 'size' => 'sm', - 'padding' => 2, + 'padding' => 3, 'borderRadius' => 'lg', + 'attributeList' => [ + 'style' => 'max-width: calc(var(--base, 8px) * 75);' + ] ] ) - {{ $content}} + {!!$content!!} + @slot('bottom') @button([ + 'id' => 'modal-broken-link-button', 'href' => $ctaLink, 'type' => 'filled', 'text' => $ctaLabel, 'icon' => 'open_in_new', 'size' => 'md', 'color' => 'primary', - 'reverseIcon' => true + 'classList' => ['u-width--100'] ]) @endbutton @endslot From 8c127dfd7d978489313b8b9b155f2e9181404427 Mon Sep 17 00:00:00 2001 From: Sebastian Thulin Date: Tue, 3 Dec 2024 11:33:52 +0100 Subject: [PATCH 4/5] fix: field name & translations --- languages/broken-link-detector-sv_SE.mo | Bin 4166 -> 5445 bytes languages/broken-link-detector-sv_SE.po | 75 +++++++++++++++++++++--- source/php/Config/Config.php | 4 +- 3 files changed, 68 insertions(+), 11 deletions(-) diff --git a/languages/broken-link-detector-sv_SE.mo b/languages/broken-link-detector-sv_SE.mo index b618fcdbc498ba27042321385e2890264aead59b..14885675fc9ec799771f259ed12ee5f2b584c192 100644 GIT binary patch delta 2125 zcmZXTON;*YZco+>wAIU~NnD|J1#Aq}gh`+C=XCa|7)xWOls;~av zzrMMoFK%mmyJpErMa$9eqQBm!)E>Cd&x3YlK&fNQeFh(6d}OIotKcy>4Bvyd!!z&} zcplycufVl%0rFFS@>mW3g|dHWnNm+F)llnsk-(F15FUs8)JYy1z7Lnf3)%cdxPtK) za5wxC-UmlmbT51qijbF}9Auyf@o*)4Gn;=0F6DgnVfNu;C>foHB&#lG3 zJpxbgkPMn|D{N=uZ{T{yKfx`qA60U|Rw&lz;AZ$V6o;nZ%kUJG1pk4uet`REjPf$X zizwR-<-A#rj_$n$)T_UE!Ocd>@4(cn_4TI09u| zWexr#M!m*_Sa%%W4Nt(o;W;S9_z|c541a*K{wftG{0@r6e?Up#FDTYugHOO=PQ%!= zNn+AOkkmGzaf$nvmZNW?-%pp!C5SZ1R{j-o|J&$t4G+=pr1zRQA=yb0K1d&;i#W_k zD_;bPdk@n^q+EeCabT^SFLx+S9O$(Nc-cUg`|mYzMw(cC5B(0hrjzXTHl))wQ4SLw zg|?#efwj)-DWijY-Xw`BXlHfZ)nc8m#f{iludVU3F0PE}iL%j2J@KY0D|8SW?c;iA zOWHdfn;>7-#C0~R>tH4bqhKmxMLBl0QdtK&F@!WZ9n^f;#o?=*m3P*fybqln(?dOR zF4LmJhR>xZS;Jb+FrhD-Skz`4yVFeeMC#DWNz*1D7Q?)bTt1NKIi1u{7bH5c+7Dc8- zWh~2dZgAj(b&*Sqdd68VR@W@XO@)zZw+06LwiI1l6^*1^$4H}#E{fc&INnv5%$;50 zw?FR+L8Q{B&LU-_iO@$z9o)WGy)bR8-fQc#LA||s>D9iuAD5k4@yO_oU3%xvCwH}v zEkD!W$YkwjWx3Ogb<}Cv3WEx!g$UHP(@OMor=<&_C$ZX05C^s(^G!cvq(ly<gC8Du~Ao1FVQB)#$DGEzomyC5)J~edGX|h@>q~fU%5)TU8SQ6E| zCF!wVi5wuZ4vX~p#9PO^(k<)Cy|;yX=rNCHR| zU(y^$DS@uS7(ekhb2T-xo34vJA-oU9bbH6pTYVc26Uvs4^Ox>AKDT=18%NWk;i4@6>R65QZ!C9OXbW{!ifZu-g=B7?efE`9Z>L$EmYY-u VdiqGp7CNo=>6H`xbKj2?{|EK^{PF+* delta 867 zcmXxiKTH#07{~GF3beE!r4CX-RWS;IgapF`BT}1BT3m9Fh+A> zzyTK01r~B)F(C{hqin{(D5Hh}Fe!;H`u(-_N#Fat?|awxdEe*mW7oc${gy0WHll;p zOuOlr_29!07oxJv>=s6`2Jd4Pj$s`>#%i3#^Ei(e@D1wu9QNZjYMozLiPy@_!e&|X z=(tRzFoKVYH|!}!89&Dq&S3{`pb{RS5`0A^Ji>G6R21jqNG@wdZdp6l;#K^DDI6ld zCD_JWCMHn}|3LjQkNoU67i~nl>w_2`Q=I|)!`O?N#qm02(T4i*3XYb>vv`T|0=DBj zY{MN)k>9@4d4dgOr)wEh;sxx+MbrkiOY^&^67J(59$-BtIlf*&C#n+nxTs>Is0~h| zHkd7qUt?A!U!~K6In3i8-o^Jk{S(hnr8{I5Rpu16p*)h?{^D({<{>_x!s~#-y(H>8 z;Sr-yg@b7=1x3{Pi)B$sv}l7Sh>Nt#G`%||{U1$qbb5tOr_iZX0fi3KN>j;QnnH(D zG}1U*p~@OJ>z{lFmY}J0{&>Y&P!$e4eqUs^Y^-M>_#FA<_?uBb>UDd)uIJsk5sbug qpacfService->getField( - 'broken_links_modal_title', + 'broken_links_context_modal_title', 'option' ) ?: $this->wpService->__('Content unavabile', 'broken-link-detector'); @@ -409,7 +409,7 @@ public function getContextCheckModalTitle(): string public function getContextCheckModalContent(): string { $content = $this->acfService->getField( - 'broken_links_modal_content', + 'broken_links_context_modal_content', 'option' ) ?: $this->wpService->__(' This link cannot be accessed on your current network. The system you are trying to reach is only available through a secure, authorized connection. From 609830917a4d1349bead4a424f647418a427d35a Mon Sep 17 00:00:00 2001 From: Sebastian Thulin Date: Tue, 3 Dec 2024 12:38:58 +0100 Subject: [PATCH 5/5] fix: spelling error --- dist/manifest.json | 2 +- languages/broken-link-detector-sv_SE.mo | Bin 5445 -> 5451 bytes languages/broken-link-detector-sv_SE.po | 44 +++++++++++----------- source/fields/json/context-detection.json | 6 +-- source/fields/php/context-detection.php | 15 +++++--- source/php/Config/Config.php | 6 +-- source/sass/broken-link-detector.scss | 2 +- 7 files changed, 39 insertions(+), 36 deletions(-) diff --git a/dist/manifest.json b/dist/manifest.json index 18cdb37..d324661 100644 --- a/dist/manifest.json +++ b/dist/manifest.json @@ -1,5 +1,5 @@ { - "css/broken-link-detector.css": "css/broken-link-detector.024cd1a77a7b5c050e6a.css", + "css/broken-link-detector.css": "css/broken-link-detector.40888f073f7fe120bcae.css", "js/context-detector.js": "js/context-detector.09d51a4f92bccb526918.js", "js/editor-highlight.js": "js/editor-highlight.a7ccb59aeba3991ac935.js" } \ No newline at end of file diff --git a/languages/broken-link-detector-sv_SE.mo b/languages/broken-link-detector-sv_SE.mo index 14885675fc9ec799771f259ed12ee5f2b584c192..4fecc9760c0a558ecd236ed135755d5fb6ddb2ed 100644 GIT binary patch delta 775 zcmXZZ&nu--9LMqR{lVj2#@y>yZp`GzrCeh}p2ti}e#!ftj?{sEbxh>2uJ zDcuE1SxAb8jfJuxC9#;H&?L(HbD#Tk&+|Ixd(U&u_k7QO;wUjS>K2;W|17h7%*!_W zie=c0eVBuj$j@eZRp25zxSNR|V2JTCw&EGaG0LQBY{5M2#|RE#G5&DOwGVVA2`GWz zNG`U9if>>p?qUFsGUF2rGCoHwc!_8DfZcdV);}>yR)lN?mB1Qmoh>9s+X=Z|=6eKM z2>ii+eijd#t@_L!`RaxE64`ykd0t9%6>D%iGrqtWQNPL#7gW&RcIIo zaM`7!6TYE72t~~rFoNV_ov3&Z>MFir7xrNpE?^06qBc54RqhH^`gF6#7P!q?ITxMNDQU&--tEcIZn*W8SgO$^C)d`xOI$CME=iPt~T|1o&RBN;Jj%y?(=2!k?M$Rmt|Y^;W_zG!zF~mbpuz?jAPRwu6$NUk?&>$<_paQe821~I6wL-%eJX2PXGX zi!LMwX-18ApZY=to^R zj^rXUsHL03A`Iat?qd+Q+3gAMQP*GO#Jxi;@jL1PK2S>^#TIn48HJ5C4z~DU_&RHt z71Jx}dPrTbO%GN`*Q*ZDwc=IueENUWL;DsxO}|ymNOyFHC(UKU7#<5-DWeW`+8K(O RZnZm->RRjT!@aIw*B>zDP;USL diff --git a/languages/broken-link-detector-sv_SE.po b/languages/broken-link-detector-sv_SE.po index bbb1345..0252c3d 100644 --- a/languages/broken-link-detector-sv_SE.po +++ b/languages/broken-link-detector-sv_SE.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: Broken Link Detector\n" -"POT-Creation-Date: 2024-12-03 11:30+0100\n" -"PO-Revision-Date: 2024-12-03 11:33+0100\n" +"POT-Creation-Date: 2024-12-03 12:37+0100\n" +"PO-Revision-Date: 2024-12-03 12:38+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: sv_SE\n" @@ -23,15 +23,15 @@ msgstr "" "X-Poedit-SearchPathExcluded-2: vendor\n" "X-Poedit-SearchPathExcluded-3: node_modules\n" -#: source/fields/php/context-detection.php:6 +#: source/fields/php/context-detection.php:8 msgid "Context Detect" msgstr "Identifiering av användarkontext" -#: source/fields/php/context-detection.php:10 +#: source/fields/php/context-detection.php:12 msgid "Enable detection of user context" msgstr "Identifiera användarens kontext i nätverket" -#: source/fields/php/context-detection.php:14 +#: source/fields/php/context-detection.php:16 msgid "" "The user detection functionality will disable links that are internal only. " "It also adds a tipbox to them explaining why the link is unreachable." @@ -41,25 +41,25 @@ msgstr "" "tillgängliga om denna resurs är otillgänglig, kommer markeras som icke " "klickbara." -#: source/fields/php/context-detection.php:22 +#: source/fields/php/context-detection.php:24 msgid "Detects user context by fetching a internal resource." msgstr "" "Identifierar användarens kontext i nätverket genom att försöka hämta en " "intern resurs." -#: source/fields/php/context-detection.php:24 +#: source/fields/php/context-detection.php:26 msgid "Enabled" msgstr "Aktiverad" -#: source/fields/php/context-detection.php:25 +#: source/fields/php/context-detection.php:27 msgid "Disabled" msgstr "Avaktiverad" -#: source/fields/php/context-detection.php:30 +#: source/fields/php/context-detection.php:32 msgid "Internal Context Detection Resource" msgstr "Resurs som ska hämtas" -#: source/fields/php/context-detection.php:34 +#: source/fields/php/context-detection.php:36 msgid "" "The internal context checker require you to publish a image on a server " "without public access. The image should be as small as possible, if your " @@ -70,39 +70,39 @@ msgstr "" "vara tillgänglig via http eller https (om din webbplats använder ssl-" "certifikat)." -#: source/fields/php/context-detection.php:51 +#: source/fields/php/context-detection.php:53 msgid "https://internal.resource.admin-network.local/image-1x1.jpg" msgstr "" -#: source/fields/php/context-detection.php:55 +#: source/fields/php/context-detection.php:57 msgid "Inform user by the following methods" msgstr "Informera användaren genom" -#: source/fields/php/context-detection.php:76 +#: source/fields/php/context-detection.php:78 msgid "Tooltip" msgstr "Text på tooltip" -#: source/fields/php/context-detection.php:77 +#: source/fields/php/context-detection.php:79 msgid "Modal" msgstr "Modalfönster" -#: source/fields/php/context-detection.php:90 +#: source/fields/php/context-detection.php:92 msgid "Tooltip Text" msgstr "Text på tooltip" -#: source/fields/php/context-detection.php:94 -msgid "The text that displays in the tooltip, whenever a link is unavabile." +#: source/fields/php/context-detection.php:96 +msgid "The text that displays in the tooltip, whenever a link is unavailable." msgstr "Den text som ska visas när en länk inte är tillgänglig." -#: source/fields/php/context-detection.php:112 source/php/Config/Config.php:360 -msgid "Link unavabile" +#: source/fields/php/context-detection.php:114 source/php/Config/Config.php:360 +msgid "Link unavailable" msgstr "Otillgänglig" -#: source/fields/php/context-detection.php:118 +#: source/fields/php/context-detection.php:120 msgid "Modal Title" msgstr "Titel i modalfönster" -#: source/fields/php/context-detection.php:146 +#: source/fields/php/context-detection.php:148 msgid "Modal Content" msgstr "Innehåll i modalfönster" @@ -198,7 +198,7 @@ msgid "Filter" msgstr "Filter" #: source/php/Config/Config.php:396 -msgid "Content unavabile" +msgid "Content unavailable" msgstr "Länk otillgänglig" #: source/php/Config/Config.php:414 diff --git a/source/fields/json/context-detection.json b/source/fields/json/context-detection.json index 2ebdae1..dd4645f 100644 --- a/source/fields/json/context-detection.json +++ b/source/fields/json/context-detection.json @@ -87,7 +87,7 @@ "name": "broken_links_context_tooltip", "aria-label": "", "type": "text", - "instructions": "The text that displays in the tooltip, whenever a link is unavabile.", + "instructions": "The text that displays in the tooltip, whenever a link is unavailable.", "required": 0, "conditional_logic": [ [ @@ -105,7 +105,7 @@ }, "default_value": "", "maxlength": "", - "placeholder": "Link unavabile", + "placeholder": "Link unavailable", "prepend": "", "append": "" }, @@ -193,4 +193,4 @@ "acfe_meta": "", "acfe_note": "" }] - \ No newline at end of file + diff --git a/source/fields/php/context-detection.php b/source/fields/php/context-detection.php index 74342aa..610d01f 100644 --- a/source/fields/php/context-detection.php +++ b/source/fields/php/context-detection.php @@ -1,7 +1,9 @@ 'group_6718e9e8554ca', 'title' => __('Context Detect', 'api-event-manager'), 'fields' => array( @@ -91,7 +93,7 @@ 'name' => 'broken_links_context_tooltip', 'aria-label' => '', 'type' => 'text', - 'instructions' => __('The text that displays in the tooltip, whenever a link is unavabile.', 'api-event-manager'), + 'instructions' => __('The text that displays in the tooltip, whenever a link is unavailable.', 'api-event-manager'), 'required' => 0, 'conditional_logic' => array( 0 => array( @@ -109,7 +111,7 @@ ), 'default_value' => '', 'maxlength' => '', - 'placeholder' => __('Link unavabile', 'api-event-manager'), + 'placeholder' => __('Link unavailable', 'api-event-manager'), 'prepend' => '', 'append' => '', ), @@ -197,4 +199,5 @@ 'acfe_meta' => '', 'acfe_note' => '', )); - } \ No newline at end of file + +} \ No newline at end of file diff --git a/source/php/Config/Config.php b/source/php/Config/Config.php index 0801c5e..c9988f5 100644 --- a/source/php/Config/Config.php +++ b/source/php/Config/Config.php @@ -318,7 +318,7 @@ public function getContextCheckSuccessClass() : string { public function getContextCheckFailedClass() : string { return $this->wpService->applyFilters( $this->createFilterKey(__FUNCTION__), - 'context-check-unavabile' + 'context-check-unavailable' ); } @@ -357,7 +357,7 @@ public function getContextCheckTooltipText(): string return $this->wpService->applyFilters( $this->createFilterKey(__FUNCTION__), $dbLabel ?: $this->wpService->__( - 'Link unavabile', + 'Link unavailable', 'broken-link-detector' ) ); @@ -393,7 +393,7 @@ public function getContextCheckModalTitle(): string $title = $this->acfService->getField( 'broken_links_context_modal_title', 'option' - ) ?: $this->wpService->__('Content unavabile', 'broken-link-detector'); + ) ?: $this->wpService->__('Content unavailable', 'broken-link-detector'); return $this->wpService->applyFilters( $this->createFilterKey(__FUNCTION__), diff --git a/source/sass/broken-link-detector.scss b/source/sass/broken-link-detector.scss index 5f262a6..a1c69ef 100644 --- a/source/sass/broken-link-detector.scss +++ b/source/sass/broken-link-detector.scss @@ -1,3 +1,3 @@ -.broken-link-detector-link-is-unavabile { +.broken-link-detector-link-is-unavailable { cursor: not-allowed !important; }