MyBB Community Forums

Full Version: Problem with Verque: some Javascript not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
There are two buttons in the Verque theme that aren't working, Quote and Quote+.

Clicking the Quote button gets this JS error:
Uncaught TypeError: Object [object Object] has no method 'live'
in newreply.php?tid=9&pid=14:20, here:
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {

    jQuery(".catdesc").hide();

    jQuery(".cattitle").live('mouseover mouseout', function(event) { //<--THIS LINE

        var catdesc = jQuery(this).parent().children('.catdesc');

        var content = catdesc.text();

        if (content !== "") {
            if (event.type == 'mouseover') {
                catdesc.fadeIn('slow');
            } else {
                catdesc.stop(true, true).fadeOut('slow');
            }
        }

    });

});
</script> 
It is true that cattitle doesn't exist, either in this page or the calling page. It's found in Verque's forumbit_depth1_cat template. I'm not sure where it's found in Default (or how to find out).

My hope is that we needn't debug JS -- that I can find how Default does it and restore that part. Maybe Verque is missing something in one of its templates, related to cattitle.

Quote+ has a different problem: "Uncaught TypeError: Cannot read property 'src' of null" here:
multiQuote: function(pid)
	{
		var new_post_ids = new Array();
		var quoted = Cookie.get("multiquote");
		var is_new = true;
		if(quoted)
		{
			var post_ids = quoted.split("|");
			post_ids.each(function(post_id) {
				if(post_id != pid && post_id != '')
				{
					new_post_ids[new_post_ids.length] = post_id;
				}
				else if(post_id == pid)
				{
					is_new = false;
				}
			});
		}
		element = $("multiquote_"+pid);
		if(is_new == true)
		{
			element.src = element.src.replace("postbit_multiquote.gif", "postbit_multiquote_on.gif");
			new_post_ids[new_post_ids.length] = pid;
		}
		else
		{
			element.src = element.src.replace("postbit_multiquote_on.gif", "postbit_multiquote.gif"); //<-- THIS LINE
		}
		if($('quickreply_multiquote'))
		{
			if(new_post_ids.length > 0)
			{
				$('quickreply_multiquote').show();
			}
			else
			{
				$('quickreply_multiquote').hide();
			}
		}
		Cookie.set("multiquote", new_post_ids.join("|"));
	},
The difference between this and the behavior with the default theme is that with Default, element = $("multiquote_"+pid); returns img#multiquote_14 , but with Verque, it returns null.

Thanks for any and all.
this Verque theme is using multiple loading of jQuery - that needs to be avoided!

postbit_quote template code should be changed
<a href="newreply.php?tid={$tid}&amp;replyto={$post['pid']}" class="buttonn" alt="{$lang->postbit_quote}" title="{$lang->postbit_quote}" />Quote</a>

multiquote functionality still needs to be checked ..
Edit: it would be better to use this method for the multiquote button
I'd buy you a beer if I could. Worked like a charm! Thank you!