From 1b1bfeb2f6d68fb65254cc0f915649fda0c47501 Mon Sep 17 00:00:00 2001 From: PaperGram <145454517+papergram@users.noreply.github.com> Date: Sun, 18 Aug 2024 08:18:15 +0200 Subject: [PATCH 01/10] update: add xmpp to link_types table --- ..._18_061628_update_link_types_with_xmpp.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 database/migrations/2024_08_18_061628_update_link_types_with_xmpp.php diff --git a/database/migrations/2024_08_18_061628_update_link_types_with_xmpp.php b/database/migrations/2024_08_18_061628_update_link_types_with_xmpp.php new file mode 100644 index 000000000..e3691f5d1 --- /dev/null +++ b/database/migrations/2024_08_18_061628_update_link_types_with_xmpp.php @@ -0,0 +1,34 @@ +TableName)->updateOrInsert([ + 'typename' => 'xmpp', + 'title' => 'xmpp', + 'icon' => 'fa fa-xmpp', + 'description' => 'Add a xmpp address that opens a system dialog' + ]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}; From 616bf620eaa2102f698563a099ecdaf8393541eb Mon Sep 17 00:00:00 2001 From: PaperGram <145454517+papergram@users.noreply.github.com> Date: Sun, 18 Aug 2024 08:43:38 +0200 Subject: [PATCH 02/10] add: blocks xmpp --- blocks/xmpp/config.yml | 4 ++++ blocks/xmpp/form.blade.php | 23 +++++++++++++++++++++++ blocks/xmpp/handler.php | 19 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 blocks/xmpp/config.yml create mode 100644 blocks/xmpp/form.blade.php create mode 100644 blocks/xmpp/handler.php diff --git a/blocks/xmpp/config.yml b/blocks/xmpp/config.yml new file mode 100644 index 000000000..30201506f --- /dev/null +++ b/blocks/xmpp/config.yml @@ -0,0 +1,4 @@ +id: 6 +typename: xmpp +icon: "fa fa-xmpp" +custom_html: false \ No newline at end of file diff --git a/blocks/xmpp/form.blade.php b/blocks/xmpp/form.blade.php new file mode 100644 index 000000000..0db6c9616 --- /dev/null +++ b/blocks/xmpp/form.blade.php @@ -0,0 +1,23 @@ +name)){$buttonName = $button->name;}else{$buttonName = 0;} ?> + + + + + +{{__('messages.Leave blank for default title')}}
+ + + +{{__('messages.Enter your XMPP')}} + + \ No newline at end of file diff --git a/blocks/xmpp/handler.php b/blocks/xmpp/handler.php new file mode 100644 index 000000000..5fc85745a --- /dev/null +++ b/blocks/xmpp/handler.php @@ -0,0 +1,19 @@ + $request->title, + 'button_id' => "9", + 'link' => $request->link, + ]; + + return $linkData; +} \ No newline at end of file From 64a36dc2e51ba6ec47342144f4f2a9c8b37af311 Mon Sep 17 00:00:00 2001 From: PaperGram <145454517+papergram@users.noreply.github.com> Date: Sun, 18 Aug 2024 08:44:34 +0200 Subject: [PATCH 03/10] add: xmpp messages --- app/Models/LinkType.php | 1 + resources/lang/en/messages.php | 3 +++ resources/views/studio/edit-link.blade.php | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/LinkType.php b/app/Models/LinkType.php index 10025bd5a..faeb9a45d 100644 --- a/app/Models/LinkType.php +++ b/app/Models/LinkType.php @@ -63,6 +63,7 @@ public static function get() 'heading', 'spacer', 'text', + 'xmpp', ]; $sorted = $linkTypes->sortBy(function ($item) use ($custom_order) { diff --git a/resources/lang/en/messages.php b/resources/lang/en/messages.php index 4e5b9e9eb..db8b56f2b 100644 --- a/resources/lang/en/messages.php +++ b/resources/lang/en/messages.php @@ -896,6 +896,9 @@ 'block.title.text' => 'Text', 'block.description.text' => 'Add static text to your page that is not clickable.', + 'block.title.xmpp' => 'XMPP address', + 'block.description.xmpp' => 'Add an XMPP address that opens a system dialog.', + /* |-------------------------------------------------------------------------- diff --git a/resources/views/studio/edit-link.blade.php b/resources/views/studio/edit-link.blade.php index 11dd9e27f..bed0f2bbb 100755 --- a/resources/views/studio/edit-link.blade.php +++ b/resources/views/studio/edit-link.blade.php @@ -79,7 +79,7 @@ function submitFormWithParam(paramValue) { @foreach ($LinkTypes as $lt) @php if(block_text_translation_check($lt['title'])) {$title = bt($lt['title']);} else {$title = __('messages.block.title.'.$lt['typename']);} - $description = bt($lt['description']) ?? __('messages.block.description.'.$lt['typename']); + $description = bt($lt['description']) ?? __('messages.block.description.'.$lt['typename']); @endphp
From 9d81a1f028caf84c805b95d6d189532de3cd99b8 Mon Sep 17 00:00:00 2001 From: PaperGram <145454517+papergram@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:03:42 +0200 Subject: [PATCH 04/10] add: xmpp svg icons to assets --- assets/linkstack/icons/xmpp.svg | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 assets/linkstack/icons/xmpp.svg diff --git a/assets/linkstack/icons/xmpp.svg b/assets/linkstack/icons/xmpp.svg new file mode 100644 index 000000000..6b884dff0 --- /dev/null +++ b/assets/linkstack/icons/xmpp.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From fc3f4900df88dc58162f7726b4eafcaee98326c8 Mon Sep 17 00:00:00 2001 From: PaperGram <145454517+papergram@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:04:10 +0200 Subject: [PATCH 05/10] add: xmpp button seeder --- database/seeders/ButtonSeeder.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/database/seeders/ButtonSeeder.php b/database/seeders/ButtonSeeder.php index cfc11dab4..43ad5432f 100755 --- a/database/seeders/ButtonSeeder.php +++ b/database/seeders/ButtonSeeder.php @@ -938,6 +938,14 @@ public function run() "mb" => false, ], + [ + "name" => "xmpp", + "alt" => "XMPP", + "exclude" => false, + "group" => "default", + "mb" => false, + ], + ]; Button::insert($buttons); From df0e410c179c4fa49a2bd6d7924976811b8129d8 Mon Sep 17 00:00:00 2001 From: PaperGram <145454517+papergram@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:04:30 +0200 Subject: [PATCH 06/10] update: block xmpp --- blocks/xmpp/form.blade.php | 4 ++-- blocks/xmpp/handler.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blocks/xmpp/form.blade.php b/blocks/xmpp/form.blade.php index 0db6c9616..ae1ef2b00 100644 --- a/blocks/xmpp/form.blade.php +++ b/blocks/xmpp/form.blade.php @@ -1,13 +1,13 @@ name)){$buttonName = $button->name;}else{$buttonName = 0;} ?> - + {{__('messages.Leave blank for default title')}}
- + {{__('messages.Enter your XMPP')}}
- + - + @if(count($links) > 3)
{{__('messages.Add new Link')}}@endif - +

{{__('messages.Preview')}}

@@ -209,7 +209,7 @@
- +

{{__('messages.Preview')}}

@@ -217,16 +217,16 @@

- +

{{__('messages.Page Icons')}}

- +
@csrf
- + @php if (!function_exists('iconLink')) { function iconLink($icon) { @@ -242,7 +242,7 @@ function iconLink($icon) { } } } - + if (!function_exists('searchIcon')) { function searchIcon($icon) { $iconId = DB::table('links') @@ -257,7 +257,7 @@ function searchIcon($icon) { } } } - + if (!function_exists('iconclicks')) { function iconclicks($icon) { $iconClicks = searchIcon($icon); @@ -269,7 +269,7 @@ function iconclicks($icon) { } } } - + if (!function_exists('icon')) { function icon($name, $label) { echo '
@@ -285,46 +285,46 @@ function icon($name, $label) { } @endphp - - + + {!!icon('mastodon', 'Mastodon')!!} - + {!!icon('instagram', 'Instagram')!!} - + {!!icon('twitter', 'Twitter')!!} - + {!!icon('facebook', 'Facebook')!!} - + {!!icon('github', 'GitHub')!!} - + {!!icon('twitch', 'Twitch')!!} - + {!!icon('linkedin', 'LinkedIn')!!} - + {!!icon('tiktok', 'TikTok')!!} - + {!!icon('discord', 'Discord')!!} - + {!!icon('youtube', 'YouTube')!!} - + {!!icon('snapchat', 'Snapchat')!!} - + {!!icon('reddit', 'Reddit')!!} - + {!!icon('pinterest', 'Pinterest')!!} - + {{-- {!!icon('telegram', 'Telegram')!!} - + {!!icon('whatsapp', 'WhatsApp')!!} --}} - - + + - - + +
- +