diff options
author | Dylan William Hardison <dylan@hardison.net> | 2014-04-07 08:41:11 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2014-04-22 22:37:52 +0200 |
commit | eab44b1aad3f243dd69b1d30519b73a1e537fda2 (patch) | |
tree | 45e67469b8c6905a545dc5f2bd8bbe03bd41ea7c /js | |
parent | 36f56bd9112c2e930fb5bdbee3b5c89334de5247 (diff) | |
download | bugzilla-eab44b1aad3f243dd69b1d30519b73a1e537fda2.tar.gz bugzilla-eab44b1aad3f243dd69b1d30519b73a1e537fda2.tar.xz |
Bug 489028 - Record last-visited time of bugs when logged in
r=glob a=justdave
Diffstat (limited to 'js')
-rw-r--r-- | js/bug.js | 46 |
1 files changed, 46 insertions, 0 deletions
@@ -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) + }, + }; +})(); |