PageSourceSearch

https://www.anphabe.com/sites/all/modules/mio/mio_modal/js/mio_modal.js?v=1.2

js anphabe.com collected 2026-09-24 08:30:07 UTC 4,382 bytes, 102 lines download raw bytes

1/**
2 * This file must be included on page content popup
3 */
4(function ($) {
5    Drupal.behaviors.mioModal = {
6        attach: function (context, settings) {
7            $(".mio-modal").not('.popup-processed').addClass('popup-processed').each(function () {
8                $(this).on('click', function (e) {
9                    var src = $(this).attr('data-modal-url') || $(this).attr('href');
10                    var separator = src.indexOf('?') > -1 ? '&' : '?';
11                    var modal_action = $(this).attr('data-modal-action') ? $(this).attr('data-modal-action') : "crp";
12                    var modal_height = $(this).attr('data-modal-height') || 100;
13
14                    if ($(this).hasClass('mio-modal-login') && !Drupal.settings.mio_modal.user_login) {
15                        src = '/user/login';
16                        modal_action = 'frp';
17                        separator = '?';
18                    }
19
20                    src += separator + "popup=" + modal_action;
21
22                    if (modal_action === "frp") {
23                        var path = window.location.pathname;
24                        src += "&destination=" + path.substring(1);
25                    }
26
27                    // check popup argument
28                    var iframeSettings = {
29                        'src': src,
30                        'height': modal_height
31                    };
32                    var modalTitle = $(this).attr('data-modal-title') || '';
33                    var modalSize = $(this).attr('data-modal-size') || '';
34
35                    $("#mio-modal .modal-title").text(modalTitle);
36                    $("#mio-modal .modal-dialog").addClass(modalSize);
37                    $("#mio-modal iframe").attr(iframeSettings);
38
39                    if ($(this).attr('data-modal-dismiss-url')) {
40                        var dismiss_title = $(this).attr('data-modal-dismiss-title') || 'Close';
41                        $("#mio-modal .modal-content").append("<div class=\"modal-footer\">\n" +
42                            "<a class='btn btn-secondary click-tracking' data-tracking-action='modal-dismiss' href='" + $(this).attr('data-modal-dismiss-url') + "'>" + dismiss_title + "</a>" +
43                            "</div>"
44                        )
45                        ;
46                    }
47
48                    $("#mio-modal").modal('show');
49                    return false;
50                });
51
52            });
53        }
54    };
55
56    function mioModalInit() {
57        $('body').append("<div class=\"modal fade\" id=\"mio-modal\">\n" +
58            "      <div class=\"modal-dialog \" role=\"document\">\n" +
59            "          <div class=\"modal-content\">\n" +
60            "              <div class=\"modal-header\">\n" +
61            "                  <h5 class=\"modal-title\"></h5>" +
62            "                  <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n" +
63            "                      <span aria-hidden=\"true\">&times;</span>\n" +
64            "                  </button>\n" +
65            "               </div>\n" +
66            "              <iframe width='100%' id='mio-iframe' style='background: url(\"/misc/loading.gif\") center no-repeat;' frameborder='0' height='100' src='' width='100%' scrolling=\"no\"><html><body><img src='/misc/loading.gif' /></body></html></iframe>\n" +
67            "          </div>\n" +
68            "      </div>\n" +
69            "  </div>"
70        );
71    }
72
73    $(document).ready(function () {
74        mioModalInit();
75
76        $("#mio-modal").on('shown.bs.modal', function (e) {
77            //$("#mio-iframe").attr({'width': $('#mio-modal .modal-content').width()});
78        })
79
80        $("#mio-modal").on('hidden.bs.modal', function () {
81            $("#mio-iframe").attr({"height": 100, "src": ""}).css({"height":100});
82            $("#mio-modal .modal-dialog").removeClass('modal-lg').removeClass('modal-sm');
83            $("#mio-modal .modal-footer").remove();
84        });
85
86        $('#mio-iframe').iFrameResize({
87            log: false,
88            checkOrigin: false,
89            warningTimeout: 0
90        });
91
92        // Invoke auto show popup onload
93        $('.mio-modal-auto-show').click();
94
95
96    });
97
98    $(document).on('click', '[data-toggle="lightbox"]', function (event) {
99        event.preventDefault();
100        $(this).ekkoLightbox();
101    });
102})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.