PageSourceSearch

https://gfarias.com/web/wp-content/plugins/smart-grid-gallery/assets/js/view-thumbnails.js?ver=1.0.0

js gfarias.com collected 2026-10-10 00:45:28 UTC 4,917 bytes, 114 lines download raw bytes

1"use strict";
2jQuery.each(param_obj, function (index, value) {
3    if (!isNaN(value)) {
4        param_obj[index] = parseInt(value);
5    }
6});
7function OriginCode_Gallery_Video_Thumbnails(id) {
8    var _this = this;
9    _this.body = jQuery('body');
10    _this.container = jQuery('#' + id + '.view-thumbnails');
11    _this.content = _this.container.parent();
12    _this.defaultBlockWidth = param_obj.origincode_gallery_video_thumb_image_width;
13    _this.defaultBlockHeiight = param_obj.origincode_gallery_video_thumb_image_height;
14    _this.loadMoreBtn = _this.content.find('.load_more_button3');
15    _this.loadingIcon = _this.content.find('.loading3');
16    _this.galleryVideoId = _this.content.attr('data-gallery-video-id');
17    _this.contentPerPage = _this.content.attr('data-gallery-video-perpage');
18
19    _this.addEventListeners = function () {
20
21      //  if (parseInt(_this.content.find(".pagenum:last").val()) == parseInt(_this.container.find("#total").val())) {  _this.loadMoreBtn.hide();}
22
23        _this.loadMoreBtn.on('click', _this.loadMoreBtnClick);
24
25    };
26    _this.loadMoreBtnClick = function () {
27        var thumbnailLoadNonce = jQuery(this).attr('data-thumbnail-load-nonce');
28        if (parseInt(_this.content.find(".pagenum:last").val()) < parseInt(_this.container.find("#total").val())) {
29            var pagenum = parseInt(_this.content.find(".pagenum:last").val()) + 1;
30            var perpage = _this.contentPerPage;
31            var galleryVideoId = _this.galleryVideoId;
32            var thumbtext = param_obj.origincode_gallery_video_thumb_view_text;
33            _this.getResult(pagenum, perpage, galleryVideoId, thumbtext, thumbnailLoadNonce);
34        }
35        else {
36            _this.loadMoreBtn.hide();
37        }
38        return false;
39    };
40    _this.getResult = function (pagenum, perpage, galleryVideoId, thumbtext, thumbnailLoadNonce) {
41        if (_this.content.find(".pagenum:last").val() == _this.content.find("#total").val()) {
42            _this.loadMoreBtn.hide();
43        }else{
44            var data = {
45                action: "origincode_origincode_gallery_video_front_end_ajax",
46                task: 'load_videos_thumbnail',
47                page: pagenum,
48                perpage: perpage,
49                galleryVideoId: galleryVideoId,
50                thumbtext: thumbtext,
51                galleryVideoThumbnailLoadNonce: thumbnailLoadNonce
52            };
53            _this.loadingIcon.show();
54            _this.loadMoreBtn.hide();
55            jQuery.post(adminUrl, data, function (response) {
56                    if(response.success) {
57                        var $objnewitems = jQuery(response.success);
58                        _this.container.append($objnewitems);
59                        _this.loadMoreBtn.show();
60                        _this.loadingIcon.hide();
61                        if (_this.content.find(".pagenum:last").val() == _this.content.find("#total").val()) {
62                            _this.loadMoreBtn.hide();
63                        }
64                        galleryVideolightboxInit();
65                        setTimeout(function () {
66                            if (param_obj.origincode_gallery_video_video_natural_size_thumbnail == 'natural') {
67                                _this.naturalImageThumb();
68                            }
69                        }, 200);
70                    } else {
71                        alert("no");
72                    }
73                }
74                , "json");
75        }
76
77    };
78    _this.naturalImageThumb = function () {
79        _this.container.find(".origincode_big_li img").each(function (i, img) {
80            var imgStr = jQuery(this).prop('naturalWidth') / jQuery(this).prop('naturalHeight');
81            var elemStr = _this.defaultBlockWidth / _this.defaultBlockHeiight;
82            if (imgStr <= elemStr) {
83                jQuery(img).css({
84                    position: "relative",
85                    width: '100%',
86                    top: '50%',
87                    transform: 'translateY(-50%)'
88                });
89            } else {
90                jQuery(img).css({
91                    position: "relative",
92                    height: '100%',
93                    left: '50%',
94                    transform: 'translateX(-50%)'
95                });
96            }
97        });
98    };
99    _this.init = function () {
100        _this.addEventListeners();
101        if (param_obj.origincode_gallery_video_video_natural_size_thumbnail == 'natural') {
102            _this.naturalImageThumb();
103        }
104    };
105    this.init();
106}
107var video_galleries = [];
108jQuery(document).ready(function () {
109    jQuery(".origincode_videogallery.view-thumbnails").each(function (i) {
110        var id = jQuery(this).attr('id');
111        video_galleries[i] = new OriginCode_Gallery_Video_Thumbnails(id);
112    });
113});
114

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.