PageSourceSearch

https://aelys.fr/modules/linkpopup//views/js/front.js

js aelys.fr collected 2026-10-07 15:21:23 UTC 4,876 bytes, 119 lines download raw bytes

1/**
2 * 2007-2016 PrestaShop
3 *
4 * NOTICE OF LICENSE
5 *
6 * This source file is subject to the Academic Free License (AFL 3.0)
7 * that is bundled with this package in the file LICENSE.txt.
8 * It is also available through the world-wide-web at this URL:
9 * http://opensource.org/licenses/afl-3.0.php
10 * If you did not receive a copy of the license and are unable to
11 * obtain it through the world-wide-web, please send an email
12 * to [email protected] so we can send you a copy immediately.
13 *
14 * DISCLAIMER
15 *
16 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
17 * versions in the future. If you wish to customize PrestaShop for your
18 * needs please refer to http://www.prestashop.com for more information.
19 *
20 *  @author    SeoSA <[email protected]>
21 *  @copyright 2012-2017 SeoSA
22 *  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
23 *  International Registered Trademark & Property of PrestaShop SA
24 */
25
26if (typeof $.fn.live == 'undefined') {
27    $.fn.live = $.fn.on;
28}
29
30$(document).ready(function () {
31    $('.lp_type_click').live('click', function (e) {
32        e.preventDefault();
33        var content_link_popup = $(this).closest('.link_popup').find('.content_link_popup');
34        var script = content_link_popup.find('script');
35        if (script.length) {
36             script.replaceWith('<section>' + script.html() + '</section>');
37        }
38        if (content_link_popup.is(':visible'))
39            content_link_popup.stop( true, true).fadeOut(500);
40        else
41            content_link_popup.stop( true, true).fadeIn(500);
42        content_link_popup.setContentLinkPopup();
43    });
44
45    // $('.lp_type_hover').live({
46    //     mouseenter: function () {
47    //         var content_link_popup = $(this).closest('.link_popup').find('.content_link_popup');
48    //         var script = content_link_popup.find('script');
49    //         if (script.length)
50    //             script.replaceWith('<section>'+script.html()+ '</section>');
51    //         content_link_popup.stop( true, true).fadeIn(500);
52    //         content_link_popup.setContentLinkPopup();
53    //     },
54    //     mouseleave: function () {
55    //         var content_link_popup = $(this).closest('.link_popup').find('.content_link_popup');
56    //         var script = content_link_popup.find('script');
57    //         if (script.length)
58    //             script.replaceWith('<section>'+script.html()+ '</section>');
59    //         content_link_popup.stop( true, true).fadeOut(500);
60    //         content_link_popup.setContentLinkPopup();
61    //     }
62    // });
63
64
65    $(document).on('mouseenter','.lp_type_hover', function (){
66        var content_link_popup = $(this).closest('.link_popup').find('.content_link_popup');
67        var script = content_link_popup.find('script');
68        if (script.length)
69            script.replaceWith('<section>'+script.html()+ '</section>');
70        content_link_popup.stop( true, true).fadeIn(500);
71        content_link_popup.setContentLinkPopup();
72    });
73
74    $(document).on('mouseleave','.lp_type_hover', function () {
75        var content_link_popup = $(this).closest('.link_popup').find('.content_link_popup');
76        var script = content_link_popup.find('script');
77        if (script.length)
78            script.replaceWith('<section>'+script.html()+ '</section>');
79        content_link_popup.stop( true, true).fadeOut(500);
80        content_link_popup.setContentLinkPopup();
81    });
82});
83
84$.fn.setContentLinkPopup = function ()
85{
86    var offset_from_link = 30;
87    var angle = 'angle_bottom';
88    var dWidth = $(window).width();
89    var dHeight = $(document).height();
90    var offset_b = $(this).closest('.link_popup').offset();
91    offset_b.top = offset_b.top - $(document).scrollTop();
92    offset_b.left = offset_b.left - $(document).scrollLeft();
93    var bWidth = $(this).closest('.link_popup').width();
94    var bHeight = $(this).closest('.link_popup').height();
95    var cWidth = $(this).width() + offset_from_link;
96    var cHeight = $(this).height() + offset_from_link;
97    var cOffset = {};
98    if (offset_b.top < cHeight)
99    {
100        cOffset['top'] = bHeight + offset_from_link;
101        angle = 'angle_top';
102    }
103    else
104    {
105        cOffset['top'] = -cHeight;
106        angle = 'angle_bottom';
107    }
108    cOffset['left'] = 20;
109    if (cOffset['left'] > offset_b.left)
110        cOffset['left'] = offset_b.left;
111    if ((offset_b.left - cOffset['left'] + cWidth) > dWidth)
112        cOffset['left'] = cOffset['left'] + (offset_b.left - cOffset['left'] + cWidth) - dWidth;
113    $(this).removeClass('angle_top').removeClass('angle_bottom');
114    $(this).addClass(angle);
115    $(this).css({
116        top: cOffset['top'] + 'px',
117        left: '-' + cOffset['left'] + 'px'
118    });
119};

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.