MyBB Community Forums

Full Version: MyAlerts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I suppose so. But what if you were replying to that user and you would be more likely to visit that thread first?
(2012-11-30, 04:35 PM)brad-t Wrote: [ -> ]You should add a post excerpt for when a user quotes you, because this looks weird:

[Image: 1H7gM.png]

Perhaps you could use the preview message function Omar made for PMs for me. I don't remember if he posted it here.

(2012-11-30, 03:36 PM)euantor Wrote: [ -> ]You can kill the animation by editing myalerts.js. Change "slideToggle" to just "toggle" to remove it Smile

Doing this adds a totally different animation for me.

Quote:{1} replied to your thread "<a href="{2}">{3}</a>". There may be more posts after this. ({4})

I don't think this is a good solution. It should be either:

One reply Wrote:{1} replied to your thread "<a href="{2}">{3}</a>". ({4})

2 or more replies Wrote:There are {5} new replies in your thread, "<a href="{2}">{3}</a>".

Good points. Not sure a post excerpt would be good, what about the post title?

Regarding the animation, that's odd. The toggle() function should just open it without any animation at all. I'll look into that.
Actually, now I know why it animates. Change it to just .toggle() with nothing in the parentheses. Apparently a duration causes it to animate. I'm sure that's a fairly recent addition...
Excerpt is more useful IMO because every post within a thread is going to have the same subject, so I think a title is not going to give you much of an idea about its comments. Just IMO.
Yeah, but it'd be hard to get the excerpt length right. I don't want the dropdown being extended massively for the sake of a little more detail. Unless I only show the excerpt in the full alert page.
It could just be a few words, even. e.g.

[Image: oQRfn.png]
Yeah, that could work. I'll look into it for the next version Smile
(2012-11-30, 07:10 PM)euantor Wrote: [ -> ]Actually, now I know why it animates. Change it to just .toggle() with nothing in the parentheses. Apparently a duration causes it to animate. I'm sure that's a fairly recent addition...

now it just skips right to the user cp page Confused
Well, that's odd. Could you post the full content of the js file?
jQuery.noConflict();

jQuery(document).ready(function($)
{
	$('body').on({
		click: function(event)
		{
			event.preventDefault();
			var popup_id = $(this).attr('id') + '_popup';

			$('#' + popup_id).attr('top', $(this).height() + 'px').toggle() {
				var toMarkRead = new Array;
				$('[id^="alert_row_popup_"]').each(function() {
					toMarkRead.push($(this).attr('id').substr(16));
				});

				$.get('xmlhttp.php?action=markRead', {
					my_post_key: my_post_key,
					toMarkRead: toMarkRead
				}, function(data) {

				});
			});
			return false;
		}
	}, '.myalerts_popup_hook');

	$('#getUnreadAlerts').on('click', function(event) {
		event.preventDefault();
		$.get('xmlhttp.php?action=getNewAlerts', function(data) {
			$('#latestAlertsListing').prepend(data);
		});
	});

	$('.deleteAlertButton').on('click', function(event) {
		event.preventDefault();
		var deleteButton = $(this);

		$.getJSON(deleteButton.attr('href'), {accessMethod: 'js'}, function(data) {
			if (data['success'])
			{
				deleteButton.parents('tr').get(0).remove();
				if (data['template'])
				{
					$('#latestAlertsListing').html(data['template']);
				}
			}
			else
			{
				alert(data['error']);
			}
		});
	});

	if (typeof myalerts_autorefresh !== 'undefined' && myalerts_autorefresh > 0)
	{
		window.setInterval(function() {
			$.get('xmlhttp.php?action=getNewAlerts', function(data) {
				$('#latestAlertsListing').prepend(data);
			});
		}, myalerts_autorefresh * 1000);
	}

	if (typeof unreadAlerts !== 'undefined' && unreadAlerts > 0)
	{
		document.title = document.title + ' (' + unreadAlerts + ')';
	}

});