aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/styles
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2012-12-12 12:46:20 +0100
committerMarc Alexander <admin@m-a-styles.de>2012-12-12 12:46:20 +0100
commit7ce009f2e29045b2bd29dd670c900b79f7f3bd70 (patch)
tree53f44a976eb6fdc0491f0c522688eb616735581d /phpBB/styles
parent9420647c43b300699afe6fe72f09d1746daf64a2 (diff)
downloadforums-7ce009f2e29045b2bd29dd670c900b79f7f3bd70.tar
forums-7ce009f2e29045b2bd29dd670c900b79f7f3bd70.tar.gz
forums-7ce009f2e29045b2bd29dd670c900b79f7f3bd70.tar.bz2
forums-7ce009f2e29045b2bd29dd670c900b79f7f3bd70.tar.xz
forums-7ce009f2e29045b2bd29dd670c900b79f7f3bd70.zip
[ticket/10954] Mark forums read without popup or page refresh
PHPBB3-10954
Diffstat (limited to 'phpBB/styles')
-rw-r--r--phpBB/styles/prosilver/template/ajax.js16
-rw-r--r--phpBB/styles/prosilver/template/index_body.html2
-rw-r--r--phpBB/styles/prosilver/template/viewforum_body.html2
3 files changed, 18 insertions, 2 deletions
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js
index fa31d3268f..4ae4f91d8d 100644
--- a/phpBB/styles/prosilver/template/ajax.js
+++ b/phpBB/styles/prosilver/template/ajax.js
@@ -2,6 +2,22 @@
"use strict";
+// This callback will mark all forum icons read
+phpbb.add_ajax_callback('mark_forums_read', function(res) {
+ var read_title = res.NO_UNREAD_POSTS;
+ var unread_title = res.UNREAD_POSTS;
+
+ $('li.row dl.forum_unread').each(function(e) {
+ $(this).removeClass('forum_unread').addClass('forum_read');
+ $(this).children('dt[title=' + unread_title + ']').attr('title', read_title);
+ });
+
+ $('li.row dl.forum_unread_subforum').each(function(e) {
+ $(this).removeClass('forum_unread_subforum').addClass('forum_read_subforum');
+ $(this).children('dt[title=' + unread_title + ']').attr('title', read_title);
+ });
+});
+
// This callback finds the post from the delete link, and removes it.
phpbb.add_ajax_callback('post_delete', function() {
var el = $(this),
diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html
index 6babbf5997..0682abffed 100644
--- a/phpBB/styles/prosilver/template/index_body.html
+++ b/phpBB/styles/prosilver/template/index_body.html
@@ -8,7 +8,7 @@
<!-- IF S_DISPLAY_SEARCH -->
<li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_LOAD_UNREADS --> &bull; <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
<!-- ENDIF -->
- <!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m" data-ajax="true">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF -->
+ <!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m" data-ajax="mark_forums_read" data-overlay="false">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF -->
</ul>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index a3239602ae..0f2c1a30ec 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -28,7 +28,7 @@
<!-- IF S_HAS_SUBFORUM -->
<!-- IF not S_IS_BOT and U_MARK_FORUMS -->
<ul class="linklist">
- <li class="rightside"><a href="{U_MARK_FORUMS}">{L_MARK_SUBFORUMS_READ}</a></li>
+ <li class="rightside"><a href="{U_MARK_FORUMS}" data-ajax="mark_forums_read" data-overlay="false">{L_MARK_SUBFORUMS_READ}</a></li>
</ul>
<!-- ENDIF -->
<!-- INCLUDE forumlist_body.html -->