PageSourceSearch

https://www.virtualfoto.it/themes/warehouse/modules/ph_simpleblog/views/js/ph_simpleblog-17.js

js virtualfoto.it collected 2026-09-24 11:43:38 UTC 4,801 bytes, 186 lines download raw bytes

1function markAlreadyLikedPost(guest, id_simpleblog_post)
2{
3	if ($.cookie('guest_' + guest + '_' + id_simpleblog_post) == "voted") 
4	{
5		$('.simpleblog-like-button').addClass('voted');
6	}
7};
8
9$(window).on('load', initProductPageGallery);
10
11$(window).on('load', initMasonryList);
12
13$(function() {
14	if($('#module-ph_simpleblog-single').length > 0)
15	{
16		if (typeof fancybox !== 'undefined') {
17			$('.simpleblog__post a.fancybox').fancybox();
18		}
19
20
21		markAlreadyLikedPost($('#module-ph_simpleblog-single .simpleblog-like-button').data('guest'), $('.simpleblog-single .simpleblog-like-button').data('post'));
22
23		$(document).on('click', '.simpleblog__share .btn', function(){
24			type = $(this).attr('data-type');
25			if (type.length)
26			{
27				switch(type)
28				{
29					case 'twitter':
30						window.open('https://twitter.com/intent/tweet?text=' + ph_sharing_name + ' ' + encodeURIComponent(ph_sharing_url), 'sharertwt', 'toolbar=0,status=0,width=640,height=445');
31						break;
32					case 'facebook':
33						window.open('http://www.facebook.com/sharer.php?u=' + ph_sharing_url, 'sharer', 'toolbar=0,status=0,width=660,height=445');
34						break;
35					case 'pinterest':
36						window.open('http://www.pinterest.com/pin/create/button/?media=' + ph_sharing_img + '&url=' + ph_sharing_url, 'sharerpinterest', 'toolbar=0,status=0,width=660,height=445');
37						break;
38				}
39			}
40		});
41
42		$(document).on('click', '.simpleblog-like-button', function(e)
43		{
44			e.preventDefault();
45			var id_simpleblog_post = $(this).data('post');
46			var id_guest = $(this).data('guest');
47			var element = $(this);
48
49			if ($.cookie('guest_' + id_guest + '_' + id_simpleblog_post) == "voted") 
50			{
51				$.cookie('guest_' + id_guest + '_' + id_simpleblog_post, '');
52				var request = $.ajax({
53				  	type: "POST",
54				  	url: ph_simpleblog_ajax,
55				  	data: { 
56					  	action: 'removeRating',
57						id_simpleblog_post : id_simpleblog_post,
58						secure_key: ph_simpleblog_token,
59						ajax: true
60					},
61					success: function(result)
62					{             
63				    	var data = $.parseJSON(result);
64						if (data.status == 'success') 
65						{		
66							element.removeClass('voted').find('span.likes-count').text(data.message);
67						} 
68						else 
69						{
70							alert(data.message);
71						}
72					}
73				});
74			}
75			else
76			{
77				$.cookie('guest_' + id_guest + '_' + id_simpleblog_post, 'voted');
78				var request = $.ajax({
79				  	type: "POST",
80				  	url: ph_simpleblog_ajax,
81				  	data: { 
82					  	action: 'addRating',
83						id_simpleblog_post : id_simpleblog_post,
84						secure_key: ph_simpleblog_token,
85						ajax: true
86					},
87					success: function(result)
88					{         
89				    	var data = $.parseJSON(result);
90						if (data.status == 'success') 
91						{		
92							element.addClass('voted').find('span.likes-count').text(data.message);
93						} 
94						else 
95						{
96							alert(data.message);
97						}
98					}
99				});
100			}
101		});
102	}
103
104	
105	if (typeof fancybox !== 'undefined') {
106		$('.simpleblog-post-item a.post-gallery-link').fancybox();
107
108		$("a.simpleblog__post-featured").fancybox({
109		    maxWidth    : 1440,
110		    fitToView   : false,
111		    autoSize    : false,
112		    closeClick  : false,
113		    width		: 640,
114			height		: 385,
115		    openEffect  : 'none',
116		    closeEffect : 'none',
117		    iframe: {
118				preload: false
119			},
120		    helpers : {
121		        overlay : {
122		            css : {
123		                'background' : 'rgba(0, 0, 0, 0.90)'
124		            }
125		        }
126		    }
127		});
128	}
129
130	$(document).on('click', '.reply-simpleblog-button', function() {
131	    $([document.documentElement, document.body]).animate({
132	        scrollTop: $('.simpleblog__addComment').offset().top
133	    }, 1000);
134	    
135	    $('.simpleblog_answer_info').addClass('d-block');
136	    $('.simpleblog__cancelReplay').addClass('d-block');
137	    $('input[name="id_parent"]').val($(this).data('id-comment'));
138	});
139	$(document).on('click', '.simpleblog__cancelReplay', function(e) {
140			e.preventDefault();
141			$('.simpleblog_answer_info').removeClass('d-block');
142	    $('.simpleblog__cancelReplay').removeClass('d-block');
143	    
144	    $('.simpleblog_answer_info').addClass('simpleblog_answer_info_active');
145	    $('input[name="id_parent"]').val(0);
146	});
147});
148
149
150function initProductPageGallery() {
151	if (typeof fancybox !== 'undefined') {
152
153	$(".blog-fancybox").fancybox({
154		helpers : {
155	        overlay : {
156	            locked: false
157	        }
158	    }
159	});
160}
161
162	var $gallery = $('.post-gallery__gallery-js');
163
164
165	$gallery.one( 'layoutComplete', function() {
166		$gallery.addClass('initialized');
167	});
168
169	$gallery.masonry({
170		itemSelector: '.gallery-js__elem'
171	});
172
173}
174
175function initMasonryList() {
176
177	var $list = $('.blog-masonry-list');
178
179	$list.one('layoutComplete', function() {
180		$list.addClass('initialized');
181	});
182
183	$list.masonry({
184		itemSelector: '.simpleblog__listing__post'
185	});
186}

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.