1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 12:03:21 +01:00

Merge remote-tracking branch 'remotes/marc/ticket/11342' into develop

# By Marc Alexander
# Via Marc Alexander
* remotes/marc/ticket/11342:
  [ticket/11342] Fix "unexpected token" syntax error
  [ticket/11342] Mark active topics read when marking forums read
This commit is contained in:
Nathaniel Guse 2013-02-25 13:17:27 -06:00
commit 9b38c4579e
2 changed files with 20 additions and 4 deletions

View File

@ -37,14 +37,24 @@ phpbb.addAjaxCallback('mark_forums_read', function(res) {
// Mark subforums read
$('a.subforum[class*="unread"]').removeClass('unread').addClass('read');
// Mark topics read if we are watching a category and showing active topics
if ($('#active_topics').length) {
phpbb.ajaxCallbacks['mark_topics_read'].call(this, res, false);
}
// Update mark forums read links
$('[data-ajax="mark_forums_read"]').attr('href', res.U_MARK_FORUMS);
phpbb.closeDarkenWrapper(3000);
});
// This callback will mark all topic icons read
phpbb.addAjaxCallback('mark_topics_read', function(res) {
/**
* This callback will mark all topic icons read
*
* @param update_topic_links bool Wether "Mark topics read" links should be
* updated. Defaults to true.
*/
phpbb.addAjaxCallback('mark_topics_read', function(res, update_topic_links) {
var readTitle = res.NO_UNREAD_POSTS;
var unreadTitle = res.UNREAD_POSTS;
var iconsArray = {
@ -58,6 +68,10 @@ phpbb.addAjaxCallback('mark_topics_read', function(res) {
var classMap = {};
var classNames = [];
if (typeof update_topic_links === 'undefined') {
update_topic_links = true;
}
$.each(iconsArray, function(unreadClass, readClass) {
$.each(iconsState, function(key, value) {
// Only topics can be hot
@ -85,7 +99,9 @@ phpbb.addAjaxCallback('mark_topics_read', function(res) {
$('a').has('span.icon_topic_newest').remove();
// Update mark topics read links
$('[data-ajax="mark_topics_read"]').attr('href', res.U_MARK_TOPICS);
if (update_topic_links) {
$('[data-ajax="mark_topics_read"]').attr('href', res.U_MARK_TOPICS);
}
phpbb.closeDarkenWrapper(3000);
});

View File

@ -130,7 +130,7 @@
<ul class="topiclist">
<li class="header">
<dl class="icon">
<dt><!-- IF S_DISPLAY_ACTIVE -->{L_ACTIVE_TOPICS}<!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH and (topicrow.S_POST_ANNOUNCE or topicrow.S_POST_GLOBAL) -->{L_ANNOUNCEMENTS}<!-- ELSE -->{L_TOPICS}<!-- ENDIF --></dt>
<dt<!-- IF S_DISPLAY_ACTIVE --> id="active_topics"<!-- ENDIF -->><!-- IF S_DISPLAY_ACTIVE -->{L_ACTIVE_TOPICS}<!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH and (topicrow.S_POST_ANNOUNCE or topicrow.S_POST_GLOBAL) -->{L_ANNOUNCEMENTS}<!-- ELSE -->{L_TOPICS}<!-- ENDIF --></dt>
<dd class="posts">{L_REPLIES}</dd>
<dd class="views">{L_VIEWS}</dd>
<dd class="lastpost"><span>{L_LAST_POST}</span></dd>