PageSourceSearch

https://www.patwengraf.com/Media/GeneralMedia/js/general.js?v=1.4

js patwengraf.com collected 2026-09-26 16:24:04 UTC 7,455 bytes, 239 lines download raw bytes

1var addthis_config = {
2  services_exclude: 'email',
3};
4
5$(window).on('load', function () {
6  if (typeof ASZoom != 'undefined') {
7    if (typeof ASCustomZoom !== 'function') {
8      let params = {
9        reference: 'zoom-main',
10        mainImageQueryParameters: '?width=3000&height=3000&mode=max',
11        additionalImageQueryParameters: '?width=200&height=60&mode=max&qlt=70',
12      };
13      if (typeof window['asZoomCallback'] == 'function') {
14        params.afterInit = window['asZoomCallback'];
15      }
16      if (typeof window['asZoomPreCallback'] == 'function') {
17        params.beforeInit = window['asZoomPreCallback'];
18      }
19      new ASZoom(
20        document.querySelectorAll('.as-zoom-main:not([data-hidden])'),
21        params,
22      );
23    }
24  }
25  setTimeout(() => {
26    $('.temp-title').removeAttr('title');
27  }, 10000);
28});
29
30function getParameterByName(name, url = window.location.href) {
31  name = name.replace(/[\[\]]/g, '\\$&');
32  var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
33    results = regex.exec(url);
34  if (!results) return null;
35  if (!results[2]) return '';
36  return decodeURIComponent(results[2].replace(/\+/g, ' '));
37}
38
39function ChangeUrl(page, url) {
40  if (typeof history.pushState != 'undefined') {
41    var obj = { Page: page, Url: url };
42    history.pushState(obj, obj.Page, obj.Url);
43  }
44}
45
46function initInstagram() {
47  $.ajax({
48    type: 'GET',
49    url: '/instagram/getinstagramfeed',
50    success: function (response) {
51      var count = parseInt($('#instafeed').attr('data-count'));
52      if (isNaN(count)) {
53        count = 4;
54      }
55      var instagramImages = response.slice(0, count);
56      var $tamplate = $('#instafeed .item').clone();
57      var imgclass = '';
58      if ($('#instafeed').attr('data-imgclass') !== undefined) {
59        imgclass = $('#instafeed').attr('data-imgclass');
60      }
61      if ($('#instafeed .item').length === 0) {
62        $tamplate = $(
63          "<div class='item'><a target='_blank' class='insta-item'></a></div>",
64        );
65      }
66      $('#instafeed').empty();
67      $.each(instagramImages, function (key, instagramImage) {
68        var $media = $tamplate.clone();
69
70        if (
71          instagramImage.media_type == 'VIDEO' ||
72          (instagramImage.media_type == 'CAROUSEL_ALBUM' &&
73            instagramImage.media_url != null &&
74            instagramImage.media_url.indexOf('video') > 0)
75        ) {
76          var $item = $(
77            "<span class='instaplay'></span><img class='" +
78              imgclass + 
79              "' src='" +
80              instagramImage.thumbnail_url +
81              "' alt='"+(instagramImage.caption != null && instagramImage.caption != ''? instagramImage.caption.slice(0,10):'instagram')+"'/>",
82          );
83        } else {
84          var $item = $(
85            "<img class='" +
86              imgclass +
87              "' src='" +
88              instagramImage.media_url +
89              "' alt='"+(instagramImage.caption != null && instagramImage.caption != ''? instagramImage.caption.slice(0,10):'instagram')+"'/>",
90          );
91        }
92
93        if (instagramImage.caption != null && instagramImage.caption != '') {
94          $media.find('.insta-caption').html(instagramImage.caption);
95        }
96
97        $media.find('.insta-item').html($item);
98
99        if (instagramImage.media_type == 'CAROUSEL_ALBUM') {
100          $media
101            .find('.insta-item')
102            .append($("<span class='instaalbum'></span>"));
103        }
104
105        $media.find('a').attr('href', instagramImage.permalink);
106        $('#instafeed').append($media);
107      });
108      var callback = $('#instafeed').attr('data-callback');
109      if (
110        typeof callback != undefined &&
111        typeof window[callback] === 'function'
112      ) {
113        window[callback]();
114      }
115    },
116  });
117}
118
119function textAreaAdjust($element, bottomPadding) {
120  $element.on('keyup', () => {
121    $element.css('height', '1px');
122    $element.css(
123      'height',
124      `${$element.get(0).scrollHeight + (bottomPadding ? bottomPadding : 0)}px`,
125    );
126  });
127}
128
129if ($('#instafeed').length > 0) {
130  initInstagram();
131}
132
133function replaceOptionIntoButton(options, newList) {
134  let oprionsList = [];
135  options.each(function () {
136    const $this = $(this);
137    const item = $(
138      `<button type="button" data-id="${$this.attr(
139        'value',
140      )}">${$this.text()}</button>`,
141    );
142
143    return oprionsList.push(item);
144  });
145
146  newList.html(oprionsList);
147}
148
149$(window).on('load', function () {
150  if ($('.as-ssl-lazy-list').length > 0) {
151    window.currentPage = 1;
152    window.objCount = +$('.as-ssl-lazy-list').attr('data-objcount');
153    window.ajaxInProcess = false;
154    window.loadedCount = $('.as-ssl-lazy-list .as-lazy-item').length;
155    if (typeof objLazyLeftIds === 'object') {
156      getArtworksByIds();
157    } else {
158      getArtworks();
159    }
160  }
161});
162
163function getArtworks() {
164  if (objCount > loadedCount) {
165    $.ajax({
166      url: '/ObjectsList/FrontEndArtworks',
167      type: 'POST',
168      data: {
169        Page: ++currentPage,
170        CategoryID: $('.as-ssl-lazy-list').attr('data-category'),
171      },
172      success: (res) => {
173        $('.as-ssl-lazy-list').append(res);
174        loadedCount = $('.as-ssl-lazy-list .as-lazy-item').length;
175        if (
176          $('.as-ssl-lazy-list').attr('data-callback') != undefined &&
177          typeof window[$('.as-ssl-lazy-list').attr('data-callback')] ==
178            'function'
179        ) {
180          window[$('.as-ssl-lazy-list').attr('data-callback')]();
181        }
182        getArtworks();
183      },
184    });
185  } else {
186    $('.as-ssl-lazy-loading').remove();
187    if (
188      $('.as-ssl-lazy-list').attr('data-listcallback') != undefined &&
189      typeof window[$('.as-ssl-lazy-list').attr('data-listcallback')] ==
190        'function'
191    ) {
192      window[$('.as-ssl-lazy-list').attr('data-listcallback')]();
193    }
194  }
195}
196function getArtworksByIds() {
197  if (objLazyLeftIds.length > 0) {
198    let ids = objLazyLeftIds.splice(lazyStepSize);
199    const postData = {
200      local: _localeLang,
201      ids: objLazyLeftIds,
202    };
203    objLazyLeftIds = ids;
204    if (typeof _pageClassName !== 'undefined') {
205      postData.className = _pageClassName;
206    }
207    if (typeof _paneName !== 'undefined') {
208      postData.paneName = _paneName;
209    }
210    postData.categoryID = $('.as-ssl-lazy-list').attr('data-category');
211    console.log('objLazyLeftIds', objLazyLeftIds);
212    console.log('postData.ids', postData.ids);
213    $.ajax({
214      url: '/ObjectsList/FrontEndArtworksByIds',
215      type: 'POST',
216      data: postData,
217      success: (res) => {
218        $('.as-ssl-lazy-list').append(res);
219        if (
220          $('.as-ssl-lazy-list').attr('data-callback') != undefined &&
221          typeof window[$('.as-ssl-lazy-list').attr('data-callback')] ==
222            'function'
223        ) {
224          window[$('.as-ssl-lazy-list').attr('data-callback')]();
225        }
226        getArtworksByIds();
227      },
228    });
229  } else {
230    $('.as-ssl-lazy-loading').remove();
231    if (
232      $('.as-ssl-lazy-list').attr('data-listcallback') != undefined &&
233      typeof window[$('.as-ssl-lazy-list').attr('data-listcallback')] ==
234        'function'
235    ) {
236      window[$('.as-ssl-lazy-list').attr('data-listcallback')]();
237    }
238  }
239}

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.