summaryrefslogtreecommitdiff
path: root/js/catalog.js
blob: 0c41103c80bf156e9c3f0aba9659cf6d0cefcd53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
if (active_page == 'catalog') $(function(){

	$("#selectorzilla").change(function(){
		sheit = this.value;
		$("#sort-"+sheit).trigger("click");
	});

	$("#imgurzilla").change(function(){
		sheit = this.value;
		if (sheit == "small") {
			old = "large";
		} else {
			old = "small";
		}
		$(".grid-li").removeClass("grid-size-"+old);
		$(".grid-li").addClass("grid-size-"+sheit);
	});

	$('#Grid').mixitup({
		onMixEnd: function(){
			if(use_tooltipster) {
				buildTooltipster();
			}
		}
	});

	if(use_tooltipster) {
		buildTooltipster();
	}

});

function buildTooltipster(){
	$(".thread-image").each(function(){
		subject = $(this).attr('data-subject');
		name = $(this).attr('data-name');
		muhdifference = $(this).attr('data-muhdifference');
		last_reply = $(this).attr('data-last-reply');
		last_subject = $(this).attr('data-last-subject');
		last_name = $(this).attr('data-last-name');
		last_difference = $(this).attr('data-last-difference');
		muh_body = '<span="poster-span">';
		
		if (subject) {
			muh_body = muh_body + subject + '&nbsp;por';
		} else {
			muh_body = muh_body + 'Postado por';
		};
		muh_body = muh_body + '&nbsp;<span class="poster-name">' + name + '&nbsp;</span>' + muhdifference + '</span>';

		if (last_reply) {
			muh_body = muh_body + '<br><span class="last-reply-span">';
			if (last_subject) {
				muh_body = muh_body + last_subject + '&nbsp;por';
			} else{
				muh_body = muh_body + 'Última resposta por';
			};
			muh_body = muh_body + '&nbsp;<span class="poster-name">' + last_name + '&nbsp;</span>' + last_difference + '</span>';
		}
		$(this).tooltipster({
			content: $(muh_body)
		});
	});
}