PageSourceSearch

https://s.mihnati.com/c/js/sock.js?ver=20260929135133

js mihnati.com collected 2026-10-02 02:32:50 UTC 8,166 bytes, 207 lines download raw bytes

1var sockPlugin = function (id, multi, cat, limit) {
2    this.id = id;
3    this.multi = multi;
4    if (this.id == undefined) {
5        console.log('undefined id');
6        return false;
7    }
8
9    //document.write(getOptions(id, socTit, socComp, socSki, nosCompanies, schools));
10    var html = getOptions(id, socTit, socComp, socSki, nosCompanies, schools);
11    $('#'+id).parent().append(html);
12    var selector = '.socSug' + id + ' > ul.Sdrop > ';
13    $('#' + this.id).parent('div').addClass('suggest');
14    $("#sugDrp_autoComplete" + id + " li").keydown(function (e) {
15        total = $("#sugDrp_autoComplete" + id + ' div.Sbtn').length;
16        if (e.keyCode == 40) {
17            $("#sugDrp_autoComplete" + id + " div.Sbtn").removeClass("active");
18            if (act == total) {
19                act = 0;
20                //console.log(total+'---'+act);
21                $("#sugDrp_autoComplete" + id + " div.Sbtn").eq(act).focus().addClass("active");
22            } else {
23                $("#sugDrp_autoComplete" + id + " div.Sbtn").eq(act + 1).focus().addClass("active");
24                act = act + 1;
25            }
26            return false;
27        } else if (e.keyCode == 38) {
28            $("#sugDrp_autoComplete" + id + " div.Sbtn").removeClass("active");
29            if (act == 0) {
30                act = total;
31                //console.log(total+'---'+act);
32                $("#sugDrp_autoComplete" + id + " div.Sbtn").eq(act - 1).focus().addClass("active");
33            } else {
34                $("#sugDrp_autoComplete" + id + " div.Sbtn").eq(act - 1).focus().addClass("active");
35                act = act - 1;
36            }
37            return false;
38        } else if (e.keyCode == 13) {
39            $("#sugDrp_autoComplete" + id + " div.Sbtn.active").trigger("click");
40        } else if (e.keyCode == 9) {
41            $("#sugDrp_autoComplete" + id).hide();
42
43        }
44
45    });
46    $('#' + this.id).keydown(function (e) {
47        if (e.keyCode == 40) {
48            act = 0;
49            total = $("#sugDrp_autoComplete" + id + " div.Sbtn").length;
50            if ($("#sugDrp_autoComplete" + id).is(":visible")) {
51                $("input").blur();
52                $("#sugDrp_autoComplete" + id + " div.Sbtn").removeClass("active");
53                $("#sugDrp_autoComplete" + id + " div.Sbtn:first").focus().addClass("active");
54
55            }
56            return false;
57        } else if (e.keyCode == 38) {
58            total = $('.Sbtn').size();
59            act = total;
60            if ($("#sugDrp_autoComplete" + id).is(":visible")) {
61                $("input").blur();
62                $("#sugDrp_autoComplete" + id + " div.Sbtn").removeClass("active");
63                $("#sugDrp_autoComplete" + id + " div.Sbtn:last").focus().addClass("active");
64            }
65        }
66    });
67    $('#' + this.id).blur(function () {
68        setTimeout(function () {
69            if ($("#sugDrp_autoComplete" + id + " div.Sbtn.active").length == 0) {
70                $("#sugDrp_autoComplete" + id).hide();
71            }
72        }, 300);
73    });
74    $('#' + this.id).keyup(function () {
75        sockSendMsg($('#' + this.id).val(), this.multi, cat, id, limit);
76    });
77    if (this.multi == 0) {
78        $("#sugDrp_autoComplete" + id + ' .sugTouple').on('click', '.Sbtn', function () {
79            $('#' + id).val($(this).text().replace(/,/g, ''));
80            setTimeout(function () {
81                $('#' + id).focus();
82            }, 300);
83            $('.socSug').hide();
84        });
85    } else {
86        $("#sugDrp_autoComplete" + id + ' .sugTouple').on('click', '.Sbtn', function () {
87            sockRmTypeKw(id, $(this).text());
88            $('#' + id).focus();
89            $('.socSug').hide();
90        });
91    }
92}
93
94/*$('#search,#searchKeywords').keyup(function () {
95 sockSendMsg($('#'+this.id).val(),0);
96 });*/
97var sockSendMsg = function (kw, multi, cat, id, limit) {
98    if (kw == "") {
99        $('.socSug').hide();
100        $('#cvjbtitle [data-toggle="tooltip"]').tooltip(); // for cv search
101
102        $('.skill').html('');
103        return;
104    }
105
106
107    var msg = {
108
109        message: (multi == 0 ? kw : sockGetKeyword(kw, limit)),
110        webid: webId,
111        type: 'job',
112        cat: cat,
113        id: id
114    };
115    ajxM(msg);
116}
117var build = function (data) {
118    if (data != undefined && data != '') {
119        var searches = ['title', 'company', 'skill', 'nosCompanies', 'school'];
120        var msg = JSON.parse(data);
121        var umsg = msg.message;
122        var callingId = msg.id;
123        var kwLen = 0;
124        var selector = '#sugDrp_autoComplete' + callingId + ' > ul.Sdrop > ';
125        if (msg.name != undefined && msg.name != '')
126            var kwLen = msg.name.length;
127        $('.socSug').hide();
128        $.each(searches, function (key, val) {
129            data = umsg[val];
130            $(selector + 'li.jb_' + val).html('');
131
132            if (data != undefined && data != '') {
133                $(selector + 'li.cat_' + val).show();
134                $.each(data, function (index, value) {
135                    var searchedKw = value.substr(value.toLowerCase().indexOf(msg.name.toLowerCase()), kwLen);
136                    var newVal = value.replace(searchedKw, '<strong>' + searchedKw + '</strong>');
137                    var h = '<li class="sugTouple" title="' + value + '" onclick="suggestedValues(\'' + val + '\', \'' + value + '\');"><div tabindex="-1" class="Sbtn" style="width:100%">' + newVal + '</div></li>';
138                    $('#sugDrp_autoComplete' + callingId + ' li.jb_' + val).append(h);
139                });
140                $('#sugDrp_autoComplete' + callingId).show();
141                $('#cvjbtitle [data-toggle="tooltip"]').tooltip("destroy"); //for cv search
142            } else {
143                $(selector + 'li.cat_' + val).hide();
144            }
145        });
146    }
147};
148
149var websocket = null; // WebSocket disabled — using AJAX fallback (ajxM)
150var server = function () {};
151var ajxM = function (msg) {
152    $.post(seeker_url + 'services/job/autoComp', msg, 'json').done(function (response) {
153        build(response);
154    }).fail(function () {
155        //$('.m_'+id).toggle();
156    });
157};
158/*$('.sugTouple').on('click','.Sbtn',function(){
159 $('#searchKeywords').val($(this).text());
160 $('#sugDrp_autoComplete').hide();
161 
162 $('#cvjbtitle [data-toggle="tooltip"]').tooltip(); //for cv search
163 
164 });*/
165var sockGetSepar = function () {
166    return ", ";
167}
168var sockRmTypeKw = function (id, selVal) {
169    var kw = $("#" + id).val();
170    var searches = kw.split(sockGetSepar());
171    if (searches.length == 1) {
172        $("#" + id).val(selVal + sockGetSepar());
173    } else {
174        searches[searches.length - 1] = selVal;
175        $("#" + id).val(searches.join(sockGetSepar()) + sockGetSepar());
176    }
177}
178var sockGetKeyword = function (kw) {
179    var searches = kw.split(sockGetSepar());
180    var kw2Send = kw;
181    if (searches.length == 1)
182        kw2Send = searches[0];
183    else
184        kw2Send = searches[searches.length - 1];
185    return kw2Send;
186}
187
188var getOptions = function (id, tit, comp, ski, nosCompanies, schools) {
189    return '<div class="sugCont  slideDown socSug" id="sugDrp_autoComplete' + id + '" ><ul class="Sdrop">' +
190            '<li class="category cat_title">' + tit + '</li>' +
191            '<li class="sugTouple jb_title"></li>' +
192            '<li class="category cat_company">' + comp + '</li>' +
193            '<li class="sugTouple jb_company"></li>' +
194            '<li class="category cat_skill">' + ski + '</li>' +
195            '<li class="sugTouple jb_skill"></li>' +
196            '<li class="category cat_nosCompanies">' + nosCompanies + '</li>' +
197            '<li class="sugTouple jb_nosCompanies"></li>' +
198            '<li class="category cat_school">' + schools + '</li>' +
199            '<li class="sugTouple jb_school"></li>' +
200            '</ul>' +
201            '</div>';
202}
203
204var suggestedValues = function (sugType, sugValue) {
205    $('#suggested_type').val(sugType);
206    $('#suggested_value').val(sugValue.replace(/,/g, ''));
207}

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.