diff options
author | Dylan William Hardison <dylan@hardison.net> | 2014-05-20 08:19:51 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2014-05-28 16:52:47 +0200 |
commit | b6b83df873a1509797235738e00f9e6307eca876 (patch) | |
tree | 2599c58a67bf67499d5c2d64c2854f8c7a4ef1e2 /js | |
parent | 038e6854b32ae3155018188d80f306599a1e9644 (diff) | |
download | bugzilla-b6b83df873a1509797235738e00f9e6307eca876.tar.gz bugzilla-b6b83df873a1509797235738e00f9e6307eca876.tar.xz |
Bug 1000917 - Backport upstream bug 489028 to bmo/4.2 to allow user last visit searching
Diffstat (limited to 'js')
-rw-r--r-- | js/bug.js | 46 |
1 files changed, 46 insertions, 0 deletions
@@ -129,3 +129,49 @@ YAHOO.bugzilla.dupTable = { [dt, data.product_name]); } }; + +(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) + }, + }; +})(); |