diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-05-31 01:39:46 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-05-31 01:44:58 +0200 |
commit | 2d8a9dabb4957ae1158ba000ee211b33bd0a81be (patch) | |
tree | ef1bddf7cae9957f8d4820cff531b62ff6ee1d21 /data/rhlib | |
parent | b21ce54137dd75f42d98b3b15178e8f0ea056a14 (diff) | |
download | bugzilla-triage-2d8a9dabb4957ae1158ba000ee211b33bd0a81be.tar.gz |
First draft of the flags handling for Mozilla bugzilla.
Will fix #103 (when reviewed)
Diffstat (limited to 'data/rhlib')
-rw-r--r-- | data/rhlib/rhbzpage.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/data/rhlib/rhbzpage.js b/data/rhlib/rhbzpage.js index a943eee..7060a37 100644 --- a/data/rhlib/rhbzpage.js +++ b/data/rhlib/rhbzpage.js @@ -56,7 +56,8 @@ var ProfessionalProducts = [ var btSnippet = null; -function RHOnMessageHandler(msg) { + +function RHOnMessageHandler(msg, nextHandler) { switch (msg.cmd) { case "Error": alert("Error " + msg.data); @@ -77,7 +78,15 @@ function RHOnMessageHandler(msg) { queryUpstreamCallback(msg.data, constantData.queryUpstreamBug); break; default: - console.error("Error: unknown RPC call " + msg.toSource()); + if (nextHandler) { + var nextHandler = nextHandlerList.splice(0, 1); + if (nextHandler[0]) { + nextHandler[0](msg, nextHandlerList); + } + } + else { + console.error("Error: unknown RPC call " + msg.toSource()); + } break; } } @@ -136,7 +145,12 @@ function RHcentralCommandDispatch(cmdLabel, cmdParams) { break; // If we don't have it here, call superclass method default: - console.error("Unknown command:\n" + cmdLabel + "\nparameters:\n" + cmdParams); + if (MozCentralCommandDispatch) { + MozCentralCommandDispatch(cmdLabel, cmdParams); + } + else { + console.error("Unknown command:\n" + cmdLabel + "\nparameters:\n" + cmdParams); + } break; } } |