summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2014-09-23 03:23:54 +0200
committerDylan William Hardison <dylan@hardison.net>2014-10-02 02:46:13 +0200
commitc034487bf62423265d0832197e0ff490f82330eb (patch)
treed5392377ca4b38c77b45dd62a3fed4c6edcec309
parent98284f0a6fcfaee9aee2c26e0ae0d07692a6ee84 (diff)
downloadbugzilla-c034487bf62423265d0832197e0ff490f82330eb.tar.gz
bugzilla-c034487bf62423265d0832197e0ff490f82330eb.tar.xz
Bug 1023405 - Shortcut for marking bugs as read
-rw-r--r--extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl10
-rw-r--r--extensions/MyDashboard/web/js/query.js15
-rw-r--r--extensions/MyDashboard/web/styles/mydashboard.css3
-rw-r--r--js/bug.js4
-rw-r--r--template/en/default/bug/show-header.html.tmpl2
5 files changed, 27 insertions, 7 deletions
diff --git a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl
index 023de290c..16f363f49 100644
--- a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl
+++ b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl
@@ -12,10 +12,12 @@
title = "My Dashboard"
style_urls = [ "extensions/MyDashboard/web/styles/mydashboard.css",
"extensions/ProdCompSearch/web/styles/prod_comp_search.css" ]
+ yui = ["json", "connection"],
javascript_urls = [ "js/yui3/yui/yui-min.js",
"extensions/MyDashboard/web/js/query.js",
"extensions/MyDashboard/web/js/flags.js",
- "extensions/ProdCompSearch/web/js/prod_comp_search.js" ]
+ "extensions/ProdCompSearch/web/js/prod_comp_search.js",
+ "js/bug.js" ]
%]
[% standard_queries = [] %]
@@ -104,8 +106,10 @@
<div class="query_description"></div>
<span id="query_count_refresh" class="bz_default_hidden">
<span class="items_found" id="query_bugs_found">0 [% terms.bugs %] found</span>
- | <a class="refresh" href="javascript:void(0);" id="query_refresh">Refresh</a>
- | <a class="buglist" href="javascript:void(0);" id="query_buglist">Buglist</a>
+ | <a class="refresh" href="javascript:void(0);" id="query_refresh">Refresh</a>
+ | <a class="markvisited" href="javascript:void(0);" id="query_markvisited">Mark Visited</a>
+ <span class="markvisited bz_default_hidden" id="query_markvisited_text">Mark Visited</span>
+ | <a class="buglist" href="javascript:void(0);" id="query_buglist">Buglist</a>
</span>
<div id="query_pagination_top"></div>
<div id="query_table"></div>
diff --git a/extensions/MyDashboard/web/js/query.js b/extensions/MyDashboard/web/js/query.js
index 82e2a531b..4a6b64157 100644
--- a/extensions/MyDashboard/web/js/query.js
+++ b/extensions/MyDashboard/web/js/query.js
@@ -99,6 +99,8 @@ YUI({
counter = counter + 1;
lastChangesCache = {};
+ Y.one('#query_markvisited').removeClass('bz_default_hidden');
+ Y.one('#query_markvisited_text').addClass('bz_default_hidden');
Y.one('#query_count_refresh').addClass('bz_default_hidden');
bugQueryTable.set('data', []);
bugQueryTable.render("#query_table");
@@ -238,6 +240,19 @@ YUI({
updateQueryTable(selected_value);
});
+ Y.one('#query_markvisited').on('click', function(e) {
+ var data = bugQueryTable.data;
+ var bug_ids = [];
+
+ Y.one('#query_markvisited').addClass('bz_default_hidden');
+ Y.one('#query_markvisited_text').removeClass('bz_default_hidden');
+
+ for (var i = 0, l = data.size(); i < l; i++) {
+ bug_ids.push(data.item(i).get('bug_id'));
+ }
+ YAHOO.bugzilla.bugUserLastVisit.update(bug_ids);
+ });
+
Y.one('#query_buglist').on('click', function(e) {
var data = bugQueryTable.data;
var ids = [];
diff --git a/extensions/MyDashboard/web/styles/mydashboard.css b/extensions/MyDashboard/web/styles/mydashboard.css
index 822c71076..2ce19d96b 100644
--- a/extensions/MyDashboard/web/styles/mydashboard.css
+++ b/extensions/MyDashboard/web/styles/mydashboard.css
@@ -47,7 +47,8 @@
width: 40%;
}
-.items_found, .refresh, .buglist {
+.items_found, .refresh, .buglist, .markvisited {
+
font-size: 80%;
}
diff --git a/js/bug.js b/js/bug.js
index fc7beea17..9237f7241 100644
--- a/js/bug.js
+++ b/js/bug.js
@@ -135,11 +135,11 @@ YAHOO.bugzilla.dupTable = {
var JSON = YAHOO.lang.JSON;
YAHOO.bugzilla.bugUserLastVisit = {
- update: function(bug_id) {
+ update: function(bug_ids) {
var args = JSON.stringify({
version: "1.1",
method: 'BugUserLastVisit.update',
- params: { ids: bug_id },
+ params: { ids: bug_ids },
});
var callbacks = {
failure: function(res) {
diff --git a/template/en/default/bug/show-header.html.tmpl b/template/en/default/bug/show-header.html.tmpl
index 306407a65..062e1aa82 100644
--- a/template/en/default/bug/show-header.html.tmpl
+++ b/template/en/default/bug/show-header.html.tmpl
@@ -68,7 +68,7 @@
initDirtyFieldTracking();
[% IF user.id AND user.is_involved_in_bug(bug) %]
- YAHOO.bugzilla.bugUserLastVisit.update([% bug.bug_id FILTER none %]);
+ YAHOO.bugzilla.bugUserLastVisit.update([ [% bug.bug_id FILTER none %] ]);
[% END %]
});
[% javascript FILTER none %]