// $Id: accessbarpro.user.js 201 2006-12-16 02:24:52Z Chris $ // Access Bar Pro // // Uses the code of: // Access Bar2 // version 0.9-Vasco2 // 2006-04-10 // Vasco // // Uses the code of: // Access Bar // version 0.9 BETA! // 2005-05-02 // Copyright (c) 2005, Mark Pilgrim // Released under the GPL license // http://www.gnu.org/copyleft/gpl.html // // -------------------------------------------------------------------- // // This is a Greasemonkey user script. To install it, you need // Greasemonkey 0.3 or later: http://greasemonkey.mozdev.org/ // Then restart Firefox and revisit this script. // Under Tools, there will be a new menu item to "Install User Script". // Accept the default configuration and install. // // To uninstall, go to Tools/Manage User Scripts, // select "Access Bar", and click Uninstall. // // -------------------------------------------------------------------- // // ==UserScript== // @name Access Bar Pro // @namespace http://refactoror.net/ // @description Show the accesskeys that are defined on a page. // @include * // ==/UserScript== /* BEGIN LICENSE BLOCK Copyright (C) 2005 Mark Pilgrim This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You can download a copy of the GNU General Public License at http://diveintomark.org/projects/greasemonkey/COPYING or get a free printed copy by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. END LICENSE BLOCK */ (function() { var descriptions = new Array(); var desc = ""; foreachNode ( "//*[@accesskey]", function(a) { var desctext; if (a.nodeName == "INPUT" || a.nodeName == "SELECT") { var label = selectNode("//label[@for='" + a.name + "']"); if (label) { desctext = label.title; if (!desctext) { desctext = label.textContent; } } } if (!desctext) { desctext = a.title; } if (!desctext) { desctext = a.textContent; } if (!desctext) { desctext = a.name; } if (!desctext) { desctext = a.id; } if (!desctext) { desctext = a.href; } if (!desctext) { desctext = a.value; } desc = '[' + a.getAttribute('accesskey').toUpperCase() + '] '; if (a.href) { desc += '' + desctext + ''; } else { desc += desctext; } descriptions.push(desc); } ); if (desc == "") return; switch (getSetting("sortOrder", "page")) { case "key": descriptions.sort(); break; // "page" default: } desc = '' + 'X'; if (getSetting("showButtonText", false)) { desc += "Close"; } div = document.createElement("div"); div.id = "accessbar-div-0"; desc = '