PageSourceSearch

https://tadars.com/js/js.js?date=16-10-2020

js tadars.com collected 2026-10-02 03:18:57 UTC 3,458 bytes, 119 lines download raw bytes

1$(function () {
2    if ($('.chosen-container').length > 0) {
3        $('.chosen-container').on('touchstart', function(e){
4            e.stopPropagation(); e.preventDefault();
5            // Trigger the mousedown event.
6            $(this).trigger('mousedown');
7        });
8    }
9    $('.btn-top-srch').click(function (event) {
10        event.preventDefault();
11        var form = $(this).closest('form');
12        var input = form.find('input');
13        if (!form.hasClass('active')) {
14            form.addClass('active');
15            input.focus();
16        } else {
17            if (input.val() != '')
18                form.submit();
19            else
20                closeSearch();
21        }
22    });
23
24    $(document.body).on('click', '.inner-share-btn', function () {
25        hasClass = $(this).parent().hasClass('expanded');
26        $(".social-likes").removeClass('expanded');
27        $(this).parent().toggleClass('expanded', !hasClass);
28        if (!hasClass) {
29            $('.social-likes').socialLikes({
30                url: $(this).parent().data('url'),
31                title: $(this).parent().data('title'),
32                counters: true,
33                singleTitle: 'مشاركة!'
34            });
35        }
36        return false;
37    });
38    $(document).on('popup_opened.social-likes', function(event, service) {
39        //service:facebook or twitter..etc
40        shareBtn(event.target);
41    });
42
43    $(document.body).on('click', '.social-likes .whatsapp', function () {
44        shareBtn(this);
45        shareData = $(this).parent().data();
46        openInNewTab('https://api.whatsapp.com/send?text=' + encodeURIComponent(shareData['title'] + '\n\n' + shareData['url']));
47
48
49        return false;
50    });
51});
52
53function shareBtn(btn) {
54    shareData = $(btn).closest('.share-btns').data();
55    J.api({'ac': 'shareItem', 'id': shareData['id'], 'type': shareData['type']}, shared, '/quran/api');
56}
57function shared(data) {
58    if (!_.isUndefined(data.msg))
59        alert(data.msg)
60    else {
61        $btns = $('.' + data.type + '_' + data.itemId+' .inner-share-btn').attr('data-shares',data.shares);
62    }
63}
64function openInNewTab(url) {
65    var win = window.open(url, '_blank');
66    win.focus();
67}
68function closeSearch() {
69    var $form = $('.navbar-collapse form[role="search"].active')
70    $form.find('input').val('');
71    $form.removeClass('active');
72}
73
74
75function api(dataToPass, fun_to_call, url, type) {
76    J.api(dataToPass, fun_to_call, url, type);
77}
78
79function dd() {
80    J.dd.apply(this, arguments);
81}
82function alert(msg) {
83    notiy(msg, 'topLeft', 'warning');
84}
85
86
87function notiy(txt, position, styleType, animationOpen, animationClose) {
88
89    if (typeof position === 'undefined') {
90        position = 'topLeft';
91    }
92    if (typeof styleType === 'undefined') {
93        styleType = 'information';
94    }
95    if (typeof animationOpen === 'undefined') {
96        animationOpen = 'bounceInLeft';
97    }
98    if (typeof animationClose === 'undefined') {
99        animationClose = 'bounceOutLeft';
100    }
101    noty({
102        text: txt,
103        layout: position,
104        closeWith: ['click'],// ['click', 'button', 'hover', 'backdrop']
105        type: styleType,
106        theme: 'relax',
107        animation: {
108            open: 'animated ' + animationOpen,
109            close: 'animated ' + animationClose,
110            speed: 100
111        },
112        callback: {
113            onClose: function () {
114                $.noty.closeAll();
115            }
116        },
117    });
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.