summaryrefslogtreecommitdiff
path: root/js/catalog.js
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2014-04-30 00:13:04 +0200
committerczaks <marcin@6irc.net>2014-04-30 00:14:25 +0200
commit2adf7d99db1ef22ef37e517e64f511495e6c83c4 (patch)
tree1d387f37320ba3a2c2336858be2aafe51c1f5236 /js/catalog.js
parentbb5446a93d05185cc78cc4b61edc99d3035e295e (diff)
integrate favelog into catalog theme; needs more work, code cleanup etc.
Diffstat (limited to 'js/catalog.js')
-rw-r--r--js/catalog.js64
1 files changed, 64 insertions, 0 deletions
diff --git a/js/catalog.js b/js/catalog.js
new file mode 100644
index 00000000..5497cb4a
--- /dev/null
+++ b/js/catalog.js
@@ -0,0 +1,64 @@
+$().ready(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)
+ });
+ });
+} \ No newline at end of file