From 01f852a87c82a8afffbc66eab39b78926e25b6e0 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Tue, 28 Jan 2025 23:48:26 +0000 Subject: [PATCH 1/2] Change filer dialog from color box to modal usage --- src/Content/Conversation.php | 2 +- src/Module/Filer/SaveTag.php | 2 +- view/templates/filer_dialog.tpl | 4 ++-- view/theme/frio/templates/jot-header.tpl | 30 ++++++++++++++---------- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index bef3603809..3b3610956f 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -326,7 +326,7 @@ class Conversation '$ispublic' => $this->l10n->t('Visible to everybody'), '$linkurl' => $this->l10n->t('Please enter a image/video/audio/webpage URL:'), '$term' => $this->l10n->t('Tag term:'), - '$fileas' => $this->l10n->t('Save to Folder:'), + '$fileas' => $this->l10n->t('Save to Folder'), '$whereareu' => $this->l10n->t('Where are you right now?'), '$delitems' => $this->l10n->t("Delete item\x28s\x29?"), '$is_mobile' => $this->mode->isMobile(), diff --git a/src/Module/Filer/SaveTag.php b/src/Module/Filer/SaveTag.php index 20b68d4c51..4856d73681 100644 --- a/src/Module/Filer/SaveTag.php +++ b/src/Module/Filer/SaveTag.php @@ -56,7 +56,7 @@ class SaveTag extends BaseModule $tpl = Renderer::getMarkupTemplate("filer_dialog.tpl"); echo Renderer::replaceMacros($tpl, [ - '$field' => ['term', $this->t("Save to Folder:"), '', '', $filetags, $this->t('- select -')], + '$field' => ['term', $this->t("Folder:"), '', '', $filetags, $this->t('- select -')], '$submit' => $this->t('Save'), ]); diff --git a/view/templates/filer_dialog.tpl b/view/templates/filer_dialog.tpl index 9d16577acf..24cfc4d196 100644 --- a/view/templates/filer_dialog.tpl +++ b/view/templates/filer_dialog.tpl @@ -7,5 +7,5 @@ {{include file="field_combobox.tpl"}}
- -
+ + \ No newline at end of file diff --git a/view/theme/frio/templates/jot-header.tpl b/view/theme/frio/templates/jot-header.tpl index 9afb2ac559..08db118eb0 100644 --- a/view/theme/frio/templates/jot-header.tpl +++ b/view/theme/frio/templates/jot-header.tpl @@ -296,27 +296,33 @@ } function itemFiler(id) { - const bordercolor = $("input").css("border-color"); + var modal = $('#modal').modal(); $.get('filer/', function (data) { - $.colorbox({html: data}); - $("#id_term").keypress(function () { - $(this).css("border-color", bordercolor); - }) - $("#select_term").change(function () { - $("#id_term").css("border-color", bordercolor); - }) + modal + .find('#modal-body') + .append(data); + + modal + .find('#modal-header h4') + .append("{{$fileas}}"); + + // Ensure focus after the modal is fully visible + modal.on('shown.bs.modal', function () { + $('#id_term').trigger('focus'); + }); $("#filer_save").click(function (e) { e.preventDefault(); - const reply = $("#id_term").val(); - if (reply && reply.length) { + const term = $("#id_term").val(); + if (term && term.length) { commentBusy = true; formModified = true; $('body').css('cursor', 'wait'); - $.get('filer/' + id + '?term=' + reply) + $.get('filer/' + id + '?term=' + term) .done(function () { - $.colorbox.close(); + $('#modal-body').empty(); + $('#modal').modal('hide'); resetFormModifiedFlag(); }) .always(function () { From 23f66d1708324b6a2330a65179c192e50856bcb1 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 4 Feb 2025 13:20:41 -0500 Subject: [PATCH 2/2] Updated main translation file --- view/lang/C/messages.po | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 0d1e5864e8..358aef9e2f 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2025.02-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-04 04:54+0000\n" +"POT-Creation-Date: 2025-02-04 13:20-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1243,8 +1243,8 @@ msgstr "" msgid "Tag term:" msgstr "" -#: src/Content/Conversation.php:329 src/Module/Filer/SaveTag.php:59 -msgid "Save to Folder:" +#: src/Content/Conversation.php:329 +msgid "Save to Folder" msgstr "" #: src/Content/Conversation.php:330 @@ -7024,6 +7024,10 @@ msgstr "" msgid "Item was not removed" msgstr "" +#: src/Module/Filer/SaveTag.php:59 +msgid "Folder:" +msgstr "" + #: src/Module/Filer/SaveTag.php:59 msgid "- select -" msgstr "" @@ -8179,8 +8183,8 @@ msgstr "" msgid "User \"%s\" deleted" msgstr "" -#: src/Module/Moderation/Users/Active.php:156 -#: src/Module/Moderation/Users/Index.php:167 +#: src/Module/Moderation/Users/Active.php:157 +#: src/Module/Moderation/Users/Index.php:168 #, php-format msgid "User \"%s\" blocked" msgstr "" @@ -8197,8 +8201,8 @@ msgstr[1] "" msgid "Blocked Users" msgstr "" -#: src/Module/Moderation/Users/Blocked.php:154 -#: src/Module/Moderation/Users/Index.php:172 +#: src/Module/Moderation/Users/Blocked.php:155 +#: src/Module/Moderation/Users/Index.php:174 #, php-format msgid "User \"%s\" unblocked" msgstr ""