Line 9 | Line 9 |
---|
var readTitle = res.NO_UNREAD_POSTS; var unreadTitle = res.UNREAD_POSTS; var iconsArray = {
|
var readTitle = res.NO_UNREAD_POSTS; var unreadTitle = res.UNREAD_POSTS; var iconsArray = {
|
'forum_unread': 'forum_read', 'forum_unread_subforum': 'forum_read_subforum', 'forum_unread_locked': 'forum_read_locked'
| forum_unread: 'forum_read', forum_unread_subforum: 'forum_read_subforum', forum_unread_locked: 'forum_read_locked'
|
};
$('li.row').find('dl[class*="forum_unread"]').each(function() {
| };
$('li.row').find('dl[class*="forum_unread"]').each(function() {
|
Line 42 | Line 42 |
---|
/** * This callback will mark all topic icons read *
|
/** * This callback will mark all topic icons read *
|
* @param update_topic_links bool Whether "Mark topics read" links should be * updated. Defaults to true.
| * @param {bool} [update_topic_links=true] Whether "Mark topics read" links * should be updated. Defaults to true.
|
*/ phpbb.addAjaxCallback('mark_topics_read', function(res, updateTopicLinks) { var readTitle = res.NO_UNREAD_POSTS; var unreadTitle = res.UNREAD_POSTS; var iconsArray = {
|
*/ phpbb.addAjaxCallback('mark_topics_read', function(res, updateTopicLinks) { var readTitle = res.NO_UNREAD_POSTS; var unreadTitle = res.UNREAD_POSTS; var iconsArray = {
|
'global_unread': 'global_read', 'announce_unread': 'announce_read', 'sticky_unread': 'sticky_read', 'topic_unread': 'topic_read'
| global_unread: 'global_read', announce_unread: 'announce_read', sticky_unread: 'sticky_read', topic_unread: 'topic_read'
|
}; var iconsState = ['', '_hot', '_hot_mine', '_locked', '_locked_mine', '_mine']; var unreadClassSelectors;
| }; var iconsState = ['', '_hot', '_hot_mine', '_locked', '_locked_mine', '_mine']; var unreadClassSelectors;
|
Line 132 | Line 132 |
---|
// Update the unread count. $('strong', '#notification_list_button').html(unreadCount);
|
// Update the unread count. $('strong', '#notification_list_button').html(unreadCount);
|
// Remove the Mark all read link if there are no unread notifications.
| // Remove the Mark all read link and hide notification count if there are no unread notifications.
|
if (!unreadCount) { $('#mark_all_notifications').remove();
|
if (!unreadCount) { $('#mark_all_notifications').remove();
|
| $('#notification_list_button > strong').addClass('hidden');
|
}
// Update page title
|
}
// Update page title
|
$('title').text( (unreadCount ? '(' + unreadCount + ')' : '') + $('title').text().replace(/(\(([0-9])\))/, '') );
| var $title = $('title'); var originalTitle = $title.text().replace(/(\((\d+)\))/, ''); $title.text((unreadCount ? '(' + unreadCount + ')' : '') + originalTitle);
|
};
// This callback finds the post from the delete link, and removes it.
| };
// This callback finds the post from the delete link, and removes it.
|
Line 205 | Line 206 |
---|
// Set min-height to prevent the page from jumping when the content changes var updatePanelHeight = function (height) {
|
// Set min-height to prevent the page from jumping when the content changes var updatePanelHeight = function (height) {
|
var height = (typeof height === 'undefined') ? panel.find('.inner').outerHeight() : height;
| height = (typeof height === 'undefined') ? panel.find('.inner').outerHeight() : height;
|
panel.css('min-height', height); }; updatePanelHeight();
| panel.css('min-height', height); }; updatePanelHeight();
|
Line 242 | Line 243 |
---|
var mostVoted = (res.vote_counts[optionId] === mostVotes); var percent = (!res.total_votes) ? 0 : Math.round((res.vote_counts[optionId] / res.total_votes) * 100); var percentRel = (mostVotes === 0) ? 0 : Math.round((res.vote_counts[optionId] / mostVotes) * 100);
|
var mostVoted = (res.vote_counts[optionId] === mostVotes); var percent = (!res.total_votes) ? 0 : Math.round((res.vote_counts[optionId] / res.total_votes) * 100); var percentRel = (mostVotes === 0) ? 0 : Math.round((res.vote_counts[optionId] / mostVotes) * 100);
|
| var altText;
|
|
|
| altText = $this.attr('data-alt-text'); if (voted) { $this.attr('title', $.trim(altText)); } else { $this.attr('title', ''); };
|
$this.toggleClass('voted', voted); $this.toggleClass('most-votes', mostVoted);
| $this.toggleClass('voted', voted); $this.toggleClass('most-votes', mostVoted);
|
Line 252 | Line 260 |
---|
var newBarClass = (percent === 100) ? 'pollbar5' : 'pollbar' + (Math.floor(percent / 20) + 1);
setTimeout(function () {
|
var newBarClass = (percent === 100) ? 'pollbar5' : 'pollbar' + (Math.floor(percent / 20) + 1);
setTimeout(function () {
|
bar.animate({width: percentRel + '%'}, 500)
| bar.animate({ width: percentRel + '%' }, 500)
|
.removeClass('pollbar1 pollbar2 pollbar3 pollbar4 pollbar5') .addClass(newBarClass) .html(res.vote_counts[optionId]);
| .removeClass('pollbar1 pollbar2 pollbar3 pollbar4 pollbar5') .addClass(newBarClass) .html(res.vote_counts[optionId]);
|
Line 287 | Line 295 |
---|
var panelHeight = panel.height(); var innerHeight = panel.find('.inner').outerHeight();
|
var panelHeight = panel.height(); var innerHeight = panel.find('.inner').outerHeight();
|
if (panelHeight != innerHeight) { panel.css({'min-height': '', 'height': panelHeight}) .animate({height: innerHeight}, time, function () { panel.css({'min-height': innerHeight, 'height': ''});
| if (panelHeight !== innerHeight) { panel.css({ minHeight: '', height: panelHeight }) .animate({ height: innerHeight }, time, function () { panel.css({ minHeight: innerHeight, height: '' });
|
}); } };
| }); } };
|
Line 377 | Line 385 |
---|
* Automatically resize textarea */ $(function() {
|
* Automatically resize textarea */ $(function() {
|
phpbb.resizeTextArea($('textarea:not(#message-box textarea, .no-auto-resize)'), {minHeight: 75, maxHeight: 250}); phpbb.resizeTextArea($('#message-box textarea'));
| var $textarea = $('textarea:not(#message-box textarea, .no-auto-resize)'); phpbb.resizeTextArea($textarea, { minHeight: 75, maxHeight: 250 }); phpbb.resizeTextArea($('textarea', '#message-box'));
|
});
| });
|