summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/bug.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/js/bug.js b/js/bug.js
index fe2e1f53b..abefbb22d 100644
--- a/js/bug.js
+++ b/js/bug.js
@@ -189,3 +189,49 @@ function set_assign_to(use_qa_contact) {
}
}
}
+
+(function(){
+ 'use strict';
+ var JSON = YAHOO.lang.JSON;
+
+ YAHOO.bugzilla.bugUserLastVisit = {
+ update: function(bug_id) {
+ var args = JSON.stringify({
+ version: "1.1",
+ method: 'BugUserLastVisit.update',
+ params: { ids: bug_id },
+ });
+ var callbacks = {
+ failure: function(res) {
+ if (console)
+ console.log("failed to update last visited: "
+ + res.responseText);
+ },
+ };
+
+ YAHOO.util.Connect.setDefaultPostHeader('application/json', true);
+ YAHOO.util.Connect.asyncRequest('POST', 'jsonrpc.cgi', callbacks,
+ args)
+ },
+
+ get: function(done) {
+ var args = JSON.stringify({
+ version: "1.1",
+ method: 'BugUserLastVisit.get',
+ params: { },
+ });
+ var callbacks = {
+ success: function(res) { done(JSON.parse(res.responseText)) },
+ failure: function(res) {
+ if (console)
+ console.log("failed to get last visited: "
+ + res.responseText);
+ },
+ };
+
+ YAHOO.util.Connect.setDefaultPostHeader('application/json', true);
+ YAHOO.util.Connect.asyncRequest('POST', 'jsonrpc.cgi', callbacks,
+ args)
+ },
+ };
+})();