From 7fc5d0b175d55f4415b808f7a82d9e338a5aaa64 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Sat, 4 Apr 2009 23:36:43 +0100 Subject: [PATCH] Document hints.js Adding documentation to hints.js. Also split getAreaOffset and getInputHint out of generate() to make that function easier to read. --- common/content/hints.js | 441 +++++++++++++++++++++++++++------------- 1 file changed, 305 insertions(+), 136 deletions(-) diff --git a/common/content/hints.js b/common/content/hints.js index 0e112c3b..1cb8e72b 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -83,7 +83,11 @@ function Hints() //{{{ Y: Mode("Yank hint description", function (elem) util.copyToClipboard(elem.textContent || "", true), extended) }; - // Used to open multiple hints + /** + * Used to open multiple hints + * + * @param {node} elem the previously selected hint + */ function hintAction_F(elem) { buffer.followLink(elem, liberator.NEW_BACKGROUND_TAB); @@ -94,7 +98,9 @@ function Hints() //{{{ hints.show("F"); } - // reset all important variables + /** + * Reset hints, so that they can be cleanly used again. + */ function reset() { statusline.updateInputBuffer(""); @@ -113,11 +119,164 @@ function Hints() //{{{ activeTimeout = null; } + /** + * Display the current status to the user. + */ function updateStatusline() { statusline.updateInputBuffer((hints.escNumbers ? mappings.getMapLeader() : "") + (hintNumber || "")); } + /** + * Get a hint for "input", "textarea" and "select". + * + * Tries to use