1function fav(data) { 2 3 this.data = {}; 4 if (data) 5 this.data = data; 6 7 this.selector = ".favBtn"; 8 this.text_add = "UsuÅ ze schowka"; 9 this.text_delete = "Dodaj do schowka"; 10 this.icon_add = "fa fa-folder-o"; 11 this.icon_delete = 'fa fa-folder-open-o'; 12 13 14 this.set = function (data) { 15 16 var self = this; 17 18 $.each(data, function (key, value) { 19 self[key] = value; 20 }); 21 22 }; 23 24 this.setup = function () { 25 26 var self = this; 27 28 this.set(this.data); 29 30 jQuery(self.selector).click(function () { 31 32 var obj_type = $(this).data('type'); 33 var obj_id = $(this).data('id'); 34 var obj_click = $(this); 35 36 jQuery.ajax({ 37 type: "POST", 38 url: Address() + 'indexdynamic/fav/', 39 data: { 40 'obj_type': obj_type, 41 'obj_id': obj_id 42 }, 43 async: true, 44 dataType: "json", 45 success: function (data) { 46 47 obj_click.find("i").removeClass(); 48 if (data.action == 'add') { 49 obj_click.find("i").addClass(self.icon_add) 50 obj_click.find("span").html(self.text_add) 51 52 toastr.success('Dodano do ulubionych') 53 } else { 54 obj_click.find("i").addClass(self.icon_delete) 55 obj_click.find("span").html(self.text_delete) 56 57 toastr.success('UsuniÄto z ulubionych') 58 } 59 60 $('.favBtn[data-type='+data.type+'][data-id='+data.id+']').each(function(){ 61 var obj = $(this); 62 63 obj.find("i").removeClass(); 64 if (data.action == 'add') { 65 obj.find("i").addClass(self.icon_add) 66 obj.find("span").html(self.text_add) 67 } else { 68 obj.find("i").addClass(self.icon_delete) 69 obj.find("span").html(self.text_delete) 70 } 71 72 73 }); 74 75 $('.favCount').html(data.fav_count); 76 77 }, 78 error: function (data) { 79 toastr.error('Aby doddaÄ do ulubionych musisz siÄ zalogowaÄ') 80 } 81 }); 82 }); 83 84 } 85 86 this.setup(); 87}
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.