]> git.mxchange.org Git - friendica.git/commitdiff
Change filer dialog from color box to modal usage
authorMarek Bachmann <post@mbbit.de>
Tue, 28 Jan 2025 23:48:26 +0000 (23:48 +0000)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 4 Feb 2025 18:20:33 +0000 (13:20 -0500)
src/Content/Conversation.php
src/Module/Filer/SaveTag.php
view/templates/filer_dialog.tpl
view/theme/frio/templates/jot-header.tpl

index bef360380953834ab33e6689094904dec803ae65..3b3610956f1c39a3a8e031cc9d5d963e756f8705 100644 (file)
@@ -326,7 +326,7 @@ class Conversation
                        '$ispublic'  => $this->l10n->t('Visible to <strong>everybody</strong>'),
                        '$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(),
index 20b68d4c519971f28f812a99a285dcaa4d3159c6..4856d7368101118b22388575471587c6c6159567 100644 (file)
@@ -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'),
                ]);
 
index 9d16577acf867cfc702be74821b3bb8b84e6ed35..24cfc4d1963ff310c1d259ec7fbc00d7874774c8 100644 (file)
@@ -7,5 +7,5 @@
 
 {{include file="field_combobox.tpl"}}
 <div class="settings-submit-wrapper">
-       <input id="filer_save" type="button" class="settings-submit" value="{{$submit}}" />
-</div>
+       <input id="filer_save" type="button" class="btn btn-primary" value="{{$submit}}" />
+</div>
\ No newline at end of file
index 9afb2ac55926e56636f236b59b03d95bc4e85c80..08db118eb09dfafdfe72ebc0c4886f28329a4580 100644 (file)
        }
 
        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 () {