From 33fefab8d4640088d5226958382825fe94704cfa Mon Sep 17 00:00:00 2001 From: "gijskruitbosch%gmail.com" Date: Sun, 20 Jan 2008 12:08:45 +0000 Subject: [PATCH] Bug 410201 - Make /help do something useful on non-browser-apps r=ajvincent@gmail.com (Alex Vincent) Venkman Only. NPOTDB. --- .../locales/en-US/chrome/venkman.properties | 2 ++ .../resources/content/venkman-commands.js | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/extensions/venkman/locales/en-US/chrome/venkman.properties b/extensions/venkman/locales/en-US/chrome/venkman.properties index 19b59ec0ea9..0503c5437c4 100644 --- a/extensions/venkman/locales/en-US/chrome/venkman.properties +++ b/extensions/venkman/locales/en-US/chrome/venkman.properties @@ -332,6 +332,8 @@ msg.files.rec = Files #msg.doc.popuphdr = Popups #msg.doc.keyhdr = Keys +msg.help.hostproblem = You're running Venkman in an application which doesn't have a browser. Therefore, we can't show you this help content. If you install Venkman in Firefox, SeaMonkey or Flock, you can copy this URL into the address bar to show the help: x-jsd:help . You can also use the help command with a parameter to get help information on a specific command. + msg.note.console = This command is available from the console. msg.note.noconsole = This command is NOT available from the console. msg.note.needstack = You must be stopped at a breakpoint to use this command. diff --git a/extensions/venkman/resources/content/venkman-commands.js b/extensions/venkman/resources/content/venkman-commands.js index 2f38ef573c1..f0ea1c9799b 100644 --- a/extensions/venkman/resources/content/venkman-commands.js +++ b/extensions/venkman/resources/content/venkman-commands.js @@ -1180,27 +1180,28 @@ function cmdHelp (e) var ary; if (!e.pattern) { - openTopWin ("x-jsd:help", "venkman-help"); - return true; - } - else - { - ary = console.commandManager.list (e.pattern, CMD_CONSOLE); - - if (ary.length == 0) + if (!console.haveBrowser) { - display (getMsg(MSN_ERR_NO_COMMAND, e.pattern), MT_ERROR); + display(MSG_HELP_HOSTPROBLEM, MT_ERROR); return false; } - - for (var i in ary) - { - display (getMsg(MSN_FMT_USAGE, [ary[i].name, ary[i].usage]), - MT_USAGE); - display (ary[i].help, MT_HELP); - } + openTopWin("x-jsd:help", "venkman-help"); + return true; } + ary = console.commandManager.list(e.pattern, CMD_CONSOLE); + + if (ary.length == 0) + { + display(getMsg(MSN_ERR_NO_COMMAND, e.pattern), MT_ERROR); + return false; + } + + for (var i in ary) + { + display(getMsg(MSN_FMT_USAGE, [ary[i].name, ary[i].usage]), MT_USAGE); + display(ary[i].help, MT_HELP); + } return true; }