PageSourceSearch

https://unionclinic.ru/local/templates/clin_new/assets/js/counter.js

js unionclinic.ru collected 2026-09-28 12:34:00 UTC 1,449 bytes, 42 lines download raw bytes

1function initCounter(selector, date, words)
2{
3    $(selector).countdown(date).on('update.countdown', function(event) {
4        let totalHours = event.offset.totalDays * 24 + event.offset.hours;
5
6        $(this).html(event.strftime(''
7            + '<div class="clock-wrap"><div class="clock-text-wrap"><span>' + totalHours + '</span><b>' + getSuffix(totalHours, words.hours) + '</b></div></div> '
8            + '<div class="clock-wrap"><div class="clock-text-wrap"><span>%M</span><b>' + getSuffix(event.offset.minutes, words.minutes) + '</b></div></div> '));
9        });
10}
11
12function getSuffix(number, arWords)
13{
14    var keys = [2, 0, 1, 1, 1, 2],
15        mod = number % 100,
16        suffixKey = (mod > 7 && mod < 20) ? 2 : keys[Math.min(mod % 10, 5)];
17
18    return arWords[suffixKey];
19}
20
21function setCountersParams(words) {
22    if (typeof(words) !== undefined && ($('.stock-timer').length > 0 || $('.service1-action-timer-wrap').length > 0)) {
23        $('.service1-action-timer').not('.active-timer').each(function() {
24            let date = $(this).data('date');
25
26            if (date.length > 0) {
27                let selector = '.clock' + $(this).data('id');
28
29                $(this).addClass('active-timer');
30                initCounter(selector, date, words);
31            }
32        });
33    }
34}
35
36$(document).ready(function() {
37    setCountersParams(counterWords);
38});
39
40$(document).ajaxSuccess(function() {
41    setCountersParams(counterWords);
42});

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.