PageSourceSearch

https://isramed.org/javascript/main.js?v=1.12

js isramed.org collected 2026-10-04 13:24:07 UTC 13,374 bytes, 390 lines download raw bytes

1$.cookie.raw = true;
2var ucpage = encodeURIComponent(document.location.href);
3
4$(function () {
5
6  // ToolTips
7  $('[data-toggle="tooltip"]').tooltip();
8
9  // Subscribe
10  $('#subscribeform')
11    .bootstrapValidator({
12      feedbackIcons: {
13        valid: 'fa fa-check',
14        invalid: 'fa fa-times',
15        validating: 'fa fa-refresh'
16      }
17    })
18    .on('success.form.bv', function (e) {
19      e.preventDefault();
20      var data = $('#subscribeform').serializeArray();
21      data = $.map(data, function (o) {
22        if (o.name == 'country') return { name: 'country', value: $('#country option:selected').text() };
23        else return o;
24      });
25      $('#subscribeform .alert').hide();
26      $.post('/cms/ajax/subscribe.php', data,
27        function (res) {
28          var result = res.split('|');
29          $('#subsmess' + result[0]).html(result[1]).slideDown('fast');
30          $('#subscribeform input[type="text"], #subscribeform input[type="email"]').val('');
31          $('#subscribeform').data('bootstrapValidator').resetForm();
32        });
33
34    });
35
36
37  // Timer Dialog
38  // setTimeout(function(){
39  //   if(!$.cookie('calldialog')){
40  //     freecall('timer');
41  //     $.cookie('calldialog', 1);
42  //   }
43  // }, 35000);
44
45
46  /*$('#subscribeform')
47    .bootstrapValidator({
48      feedbackIcons: {
49          valid: 'fa fa-check',
50          invalid: 'fa fa-times',
51          validating: 'fa fa-refresh'
52        }
53    })
54    .on('success.form.bv', function(e) {
55        //e.preventDefault();
56        //$('#subscribeform').submit();
57      });*/
58
59  $('.pdialog').on('click', function () {
60    var tit = $(this).data('title');
61    var page = $(this).data('page');
62    $('<div id="pageDialog" title="' + tit + '"/>').appendTo('body')
63      .load(langPrefix() + '/include/page/dialog.page.inc.php', { page: page }, function () {
64        $(this).dialog({
65          modal: true,
66          resizable: false,
67          width: $(window).width() > 750 ? 700 : $(window).width() - 50,
68          height: $(window).height() > 550 ? 500 : $(window).height() - 50,
69          position: {
70            my: "center",
71            at: "center",
72            of: window
73          },
74          close: function () { $(this).dialog('destroy'); $('#pageDialog').remove(); },
75          buttons: [
76            { text: jslang.close, click: function () { $(this).dialog('destroy'); $('#pageDialog').remove(); } }
77          ]
78        });
79      });
80
81  });
82
83
84  /*********** BeforeUnload Dialog ************/
85  $.cookie('ucpage', ucpage);
86
87  $(window).on('beforeunload', function (evt) {
88    /*evt = evt || window.event;
89    evt.returnValue = false;*/
90    //return false;
91    //if($.cookie('ucpage') == ucpage) return;
92    //return "Вы действительно хотите уйти с сайта?";
93    /*bootbox.confirm({
94        //size: 'small',
95        message: "Внимание! Если Вы не нашли ответы на все вопросы, которые Вас интересуют, то в этом случае, наш врач, владеющий русским языком, может позвонить Вам и провести консультацию, а также ответить на  вопросы по-поводу лечения и диагностики в Израиле. Эта услуга бесплатна.",
96        callback: function(result){ freecall(); }
97    });*/
98  });
99
100  $(window).click(function () {
101    $(window).off('beforeunload');
102  });
103
104
105  /*********** Bid Form ************/
106  if ($('#bidForm').length) {
107
108    $('#files').multiuploader({
109      lang: 'ru',
110      ajaxToUpload: '/cms/ajax/documentUpload.php',
111      numFilesToUp: 10,
112      docs: true,
113      docsWidth: 300
114    });
115
116    $('#bidForm')
117      .bootstrapValidator({
118        feedbackIcons: {
119          valid: 'fa fa-check',
120          invalid: 'fa fa-times',
121          validating: 'fa fa-refresh'
122        }
123      })
124      .on('success.form.bv', function (e) {
125        e.preventDefault();
126        var data = $('#bidForm').serializeArray();
127        //console.log(data);
128        $('#bidForm .alert').hide();
129        $.post('/cms/ajax/sendbid.php', data,
130          function (res) {
131            var result = res.split('|');
132            //console.log(res);
133            $('#bidmess' + result[0]).html(result[1]).slideDown('fast');
134            $('#bidForm input[type="text"], #bidForm input[type="email"], #bidForm select, #bidForm textarea').val('');
135            $('#files').empty();
136            $('#bidForm').data('bootstrapValidator').resetForm();
137            $('#files').multiuploader({
138              lang: 'ru',
139              ajaxToUpload: '/cms/ajax/documentUpload.php',
140              numFilesToUp: 10,
141              docs: true,
142              docsWidth: 300
143            });
144          });
145
146      });
147  }
148
149
150  /*********** Call Form ************/
151  $('.header-item.calllink a').on('click', function () {
152    $.get('/include/block/call.form.inc.php?v=1', {}, function (res) {
153      callFormDialog(res);
154    });
155  });
156
157
158  $(window, document).scroll(function () { scrolCol(); });
159
160  $(window).resize(function () { resSide(); scrolCol(); });
161
162});
163
164function freecall(name) {
165  name = name || 'call'
166  $.get('/include/block/' + name + '.form.inc.php?v=1', {}, function (res) {
167    callFormDialog(res);
168  });
169}
170
171function callFormDialog(mess) {
172  bootbox.dialog({
173    message: mess,
174    title: 'Бесплатный звонок из медцентра',
175    animate: false
176  });
177
178  $('#callForm')
179    .bootstrapValidator({
180      feedbackIcons: {
181        valid: 'fa fa-check',
182        invalid: 'fa fa-times',
183        validating: 'fa fa-refresh'
184      }
185    })
186    .on('success.form.bv', function (e) {
187      e.preventDefault();
188      var data = $('#callForm').serializeArray();
189      $('#callForm .alert').hide();
190      $.post('/cms/ajax/sendcall.php', data,
191        function (res) {
192          var result = res.split('|');
193          $('#callmess' + result[0]).html(result[1]).slideDown('fast');
194          if (result[0] == 1) $('#callSendBtn').hide();
195        });
196    });
197
198}
199
200
201
202function resSide() {
203  $('.side').css({ position: 'relative', bottom: 'auto', top: 'auto', width: 'auto' });
204}
205
206function scrolCol() {
207  var winHt = $(window).height();
208
209  var docHt = $('#blog').outerHeight(true); // - высота блока контента
210  var colHt = $('.side').outerHeight(true); // - высота левого столбца
211
212  // определяем больший и меньший блок - меньший будем пиннить
213  var $bigest = $('#blog');
214  var $smaller = $('.side');
215
216  // если есть горизонтальная прокрутка или весь контент влазит в экран - убираем pinner
217  if ($(window).width() < 991 || docHt < winHt) {
218    $smaller.css({ position: 'relative', bottom: 'auto', top: 'auto' });
219    return;
220  };
221
222  var $scrollFromTop = $(window).scrollTop();
223  var $toppos = $bigest.offset().top - 70;
224  var $botpos = $bigest.offset().top + $bigest.outerHeight(true);
225  var $pinHeight = $smaller.outerHeight(true) + 130;
226  var $pinbotpos = $toppos + $pinHeight;
227
228  // плавающий блок достиг верхней кромки экрана
229  if ($scrollFromTop > $toppos) {
230    // если нижняя грань плавающего блока уплыла за нижнюю кромку большего блока
231    if ($scrollFromTop + $pinHeight > $botpos)
232      $smaller.css({ position: 'absolute', bottom: 0, top: 'auto', width: $smaller.outerWidth() + 'px' });
233    // плавающий блок прилипляем кверху экрана
234    else
235      $smaller.css({ position: 'fixed', bottom: 'auto', top: '100px', width: $smaller.outerWidth() + 'px' });
236  }
237  // пока не дошли до верхней кромки
238  else {
239    $smaller.css({ position: 'relative', bottom: 'auto', top: 'auto' });
240  }
241
242}
243
244function langPrefix() {
245  var pathArr = window.location.pathname.split('/')[1];
246  var pref;
247  switch (pathArr) {
248    case 'en': pref = '/en'; break;
249    case 'ru': pref = '/ru'; break;
250    case 'he': pref = '/he'; break;
251    default: pref = '';
252  }
253  return pref;
254}
255
256function shareToMail(tit, image) {
257  $('<div id="mailDialog" title="' + tit + '"/>').appendTo('body')
258    .load(langPrefix() + '/include/block/dialog.mail.inc.php', function () {
259      $(this).dialog({
260        modal: true,
261        resizable: false,
262        width: $(window).width() > 550 ? 500 : $(window).width() - 100,
263        close: function () { $(this).dialog('destroy'); $('#mailDialog').remove(); },
264        buttons: [
265          { text: jslang.close, click: function () { $(this).dialog('destroy'); $('#mailDialog').remove(); } },
266          { text: jslang.send, click: function () { checkFields(image); } }
267        ]
268      });
269    });
270}
271
272function checkFields(image) {
273  var mailto = $('#mailto').val();
274  var mailfrom = $('#mailfrom').val();
275  var mailbody = $('#mailbody').val();
276  $.post(langPrefix() + '/cms/ajax/cardtomail.php',
277    { mailto: mailto, mailfrom: mailfrom, action: 'check' },
278    function (res) {
279      if (res == 'ok') return mailSend(image);
280      var err = $('<div class="alert alert-danger">' + res + '</div>');
281      $('#mailDialog').append(err);
282    });
283}
284
285function changeSubsAct(act, el) {
286  $('#action').val(act);
287  el.closest('.input-group-btn').find('button').children('span').text(el.text());
288}
289
290function mailSend(image) {
291  var mailto = $('#mailto').val();
292  var mailfrom = $('#mailfrom').val();
293  var mailbody = $('#mailbody').val();
294  $('#mailDialog').dialog('destroy');
295  $('#mailDialog').remove();
296  $.post(langPrefix() + '/cms/ajax/cardtomail.php',
297    { mailto: mailto, mailfrom: mailfrom, mailbody: mailbody, image: image, action: 'send' },
298    function (res) {
299      if (res == 'ok')
300        var dElem = $('<div id="postMail" title="' + jslang.sendCardTitle + '"><h4>' + jslang.sendCardOk + '</h4></div>');
301      else
302        var dElem = $('<div id="postMail" title="' + jslang.sendCardTitle + '"><div class="alert alert-danger">' + res + '</div></div>');
303
304      dElem.appendTo('body')
305        .dialog({
306          modal: true,
307          resizable: false,
308          close: function () { $(this).dialog('destroy'); $('#postMail').remove(); },
309          buttons: [
310            { text: jslang.close, click: function () { $(this).dialog('destroy'); $('#postMail').remove(); } }
311          ]
312        });
313
314    });
315}
316
317function shareToFB(link, picture, caption, description) {
318  var obj = {
319    /*method: 'share',
320    href: 'http://'+link+'/'
321    link: 'http://'+link,
322    picture: 'http://'+picture,
323    name: 'jCard',
324    caption: caption,
325    description: description*/
326    method: 'share_open_graph',
327    action_type: 'og.shares',
328    action_properties: JSON.stringify({
329      object: 'https://' + link + '/'
330    })
331  };
332  function callback() { return false; }
333  //FB.ui(obj, callback);
334
335  window.open('https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2F' + link + '&t=' + caption, 'fbwindow', 'height=350, width=550, top=' + ($(window).height() / 2 - 175) + ', left=' + $(window).width() / 2 + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
336
337}
338
339function shareToG(hl, link) {
340  window.open('https://plus.google.com/share?hl=' + hl + '&url=http%3A%2F%2F' + link, 'googlewindow', 'height=350, width=550, top=' + ($(window).height() / 2 - 175) + ', left=' + $(window).width() / 2 + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
341}
342
343function shareToOk(link) {
344  window.open('https://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl=http%3A%2F%2F' + link, 'okwindow', 'height=350, width=550, top=' + ($(window).height() / 2 - 175) + ', left=' + $(window).width() / 2 + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
345}
346
347function shareToVk(link) {
348  window.open('https://vkontakte.ru/share.php?url=http%3A%2F%2F' + link, 'okwindow', 'height=350, width=550, top=' + ($(window).height() / 2 - 175) + ', left=' + $(window).width() / 2 + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
349}
350
351function shareToLj(title, imglink, image, link) {
352  var ljText = '<div style="text-align:center"><a href="https://' + imglink + '"><img src="https://' + image + '" width="600"></a>\n<a href="http://' + link + '">' + title + '</a></div>';
353  window.open('https://www.livejournal.com/update.bml?subject=' + encodeURIComponent(title) + '&event=' + encodeURIComponent(ljText));
354}
355
356
357$('#mobilecall')
358  .bootstrapValidator({
359    feedbackIcons: {
360      valid: 'fa fa-check',
361      invalid: 'fa fa-times',
362      validating: 'fa fa-refresh'
363    }
364  })
365  .on('success.form.bv', function (e) {
366    e.preventDefault();
367    var $form = $('#mobilecall');
368    var data = $form.serializeArray();
369    $form.find('.alert').hide();
370
371    $.post('/cms/ajax/recall.php', data, function (res) {
372      var result = res.split('|');
373      $('#callmess' + result[0])
374        .html(result[1])
375        .slideDown('fast', function () {
376          setTimeout(() => {
377            $(this).slideUp('fast');
378            $('#callSendBtn').show();
379            $form[0].reset();
380            $form.data('bootstrapValidator').resetForm(true);
381          }, 5000);
382        });
383
384      if (result[0] == 1) $('#callSendBtn').hide();
385    });
386  });
387
388$('.mobile-search__link').on('click', function (e) {
389  $(this).parent().toggleClass('open');
390});

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.