PageSourceSearch

https://gruntovik.ru/mg-plugins/fovorite/js/fovorite.js?rev=1774968569

js gruntovik.ru collected 2026-09-28 12:02:21 UTC 2,830 bytes, 92 lines download raw bytes

1/*
2* Модуль  fovorite, fovorite подключается на странице вывода плагина.
3*/
4var fovorite=(function(){
5	return{
6		lang:[],
7		/*
8    	* INFO-COMMENT добавление товара в избранные
9    	* @param id товара
10    	* */
11		addFovor:function(id){
12			$.ajax({
13				type:"POST",
14				url:mgBaseDir+"/ajaxrequest",
15				async:false,
16				data:{
17					pluginHandler:'fovorite', // имя папки в которой лежит данный плагин
18					actionerClass:'Pactioner', // класс Pactioner в Pactioner.php - в папке плагина
19					action:'addFovor', // название действия в пользовательском  классе
20					id:id
21				},
22				dataType:"json",
23				cache:false,
24				success:function(data){
25					//console.log(data)
26				}
27			});
28		},
29		/*
30		* INFO-COMMENT удаление товара из избранного
31		* @param id товара
32		**/
33		delFovor:function(id){
34			$.ajax({
35				type:"POST",
36				url:mgBaseDir+"/ajaxrequest",
37				async:false,
38				data:{
39					pluginHandler:'fovorite', // имя папки в которой лежит данный плагин
40					actionerClass:'Pactioner', // класс Pactioner в Pactioner.php - в папке плагина
41					action:'delFovor', // название действия в пользовательском  классе
42					id:id
43				},
44				dataType:"json",
45				cache:false,
46				success:function(data){
47					if(data>0){
48						$('[data-fovor-id="'+id+'"]').remove();
49					}else{
50						$('[data-fovores]').html('<h2 style="--wd:100%;--v:flx;" itemprop="name">В избранном пусто.</h2>');
51					}
52				}
53			});
54		}
55	}
56})(jQuery);
57$(function(){
58	$('body').on('click', '[data-add-fovor]',function(){
59		var $ths=$(this);
60		var add=$.optData($ths.data());
61		switch(add.inFovor){
62			case 1:
63				var c=$('.favorite__iconlink [data-count]').data('count')-1;
64				if(c==0){
65					$('.favorite__iconlink [data-count]').removeClass('productcount_active').data('count',0).html(0);
66				}else{
67					$('.favorite__iconlink [data-count]').data('count',c).html(c);
68				}
69				$ths.removeClass('iconlink_active').data('inFovor',0);
70				fovorite.delFovor(add.addFovor);
71				break;
72			case 0:
73				if($('.favorite__iconlink .productcount_active').length){
74					var c=$('.favorite__iconlink [data-count]').data('count')+1;
75					$('.favorite__iconlink [data-count]').data('count',c).html(c);
76				}else{
77					$('.favorite__iconlink [data-count]').addClass('productcount_active').data('count',1).html(1);
78				}
79				$ths.addClass('iconlink_active').data('inFovor',1);
80				fovorite.addFovor(add.addFovor)
81				break;
82		}
83	});
84});
85/*
86$(document).ready(function(){
87	if($('.push-code').length){
88		if(!grunt.getCook('closePush')){
89			grunt.setCook('closePush',1);
90		}
91	}
92});*/

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.