summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorDylan William Hardison [:dylan] <dylan@mozilla.com>2014-06-03 09:57:28 +0200
committerByron Jones <glob@mozilla.com>2014-06-03 09:57:28 +0200
commit1fbae4ef5a9cca5d889a6fed3b930c1c9d641d6e (patch)
tree7145c2d59544d11556cf1817227e7c725d22be10 /js
parentc725b6c20ae8157a3a13674755b2de5148a1fe26 (diff)
downloadbugzilla-1fbae4ef5a9cca5d889a6fed3b930c1c9d641d6e.tar.gz
bugzilla-1fbae4ef5a9cca5d889a6fed3b930c1c9d641d6e.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.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/js/bug.js b/js/bug.js
index 06ef03da1..fc7beea17 100644
--- a/js/bug.js
+++ b/js/bug.js
@@ -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)
+ },
+ };
+})();