From: jkkn Date: Fri, 2 Nov 2007 14:53:29 +0000 (+0000) Subject: added f-keys X-Git-Url: https://git.jkkn.net/?a=commitdiff_plain;h=f946594a31165eb0feefc1f05ed716fdbba33ed8;p=tv2developer added f-keys --- diff --git a/content/tv2developer.js b/content/tv2developer.js index 670766a..b3c6ced 100755 --- a/content/tv2developer.js +++ b/content/tv2developer.js @@ -42,8 +42,8 @@ var TV2Developer = { // We take this from ui.key.chromeAccess (no other way it seems, jkkn) // Use 0 for disabled, 1 for Shift, 2 for Ctrl, 4 for Alt, 8 for Meta // (values can be combined, e.g. 5 for Alt+Shift) -// var altKey = []; // ALT on windows, CONTROL on mac -/* var chromeAccess = + var altKey = []; // ALT on windows, CONTROL on mac + var chromeAccess = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService) .getBranch('ui.key.').getIntPref('chromeAccess'); if (chromeAccess & 1) altKey.push('shift'); @@ -51,12 +51,12 @@ var TV2Developer = { if (chromeAccess & 4) altKey.push('alt'); if (chromeAccess & 8) altKey.push('meta'); if (altKey.length > 0) { - altKey = altKey.join(',');*/ - var altKey = 'alt'; - this._addShortcut(shortcuts, 'tv2-key-open', altKey, '1', 'TV2Developer.handleKeyShortcut(event)'); - this._addShortcut(shortcuts, 'tv2-key-repeat', altKey, '2', 'TV2Developer.handleButton(event)'); - this._addShortcut(shortcuts, 'tv2-key-quick', altKey, '3', 'TV2Developer.openQuickbox(event)'); -// } + altKey = altKey.join(','); + this._addShortcut(shortcuts, 'tv2-key-open-1', altKey, '1', 'VK_F1', 'TV2Developer.handleKeyShortcut(event)'); + this._addShortcut(shortcuts, 'tv2-key-repeat-1', altKey, '2', 'VK_F2', 'TV2Developer.handleButton(event)'); + this._addShortcut(shortcuts, 'tv2-key-quick-1', altKey, '3', 'VK_F3', 'TV2Developer.openQuickbox(event)'); + } + // first run, add icon if (this.getPref('firstRun')) { this.setPref('firstRun', false); @@ -87,13 +87,20 @@ var TV2Developer = { }, /* utility function to create shortcut object */ - _addShortcut: function(parent, id, modifiers, key, oncommand) { + _addShortcut: function(parent, id, modifiers, key, fkeycode, oncommand) { var newKey = document.createElement('key'); newKey.setAttribute('id', id); newKey.setAttribute('modifiers', modifiers); newKey.setAttribute('key', key); newKey.setAttribute('oncommand', oncommand); parent.appendChild(newKey); + // also add F-key shortcut + newKey = document.createElement('key'); + newKey.setAttribute('id', id+'-fkey'); + newKey.setAttribute('modifiers', 'accel'); + newKey.setAttribute('keycode', fkeycode); + newKey.setAttribute('oncommand', oncommand); + parent.appendChild(newKey); }, /* string methods for localizations */ diff --git a/version b/version index 04e84f8..c4c2d2b 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.6.10 +0.6.16 diff --git a/webroot/index.html b/webroot/index.html index 683d9ff..6867d39 100644 --- a/webroot/index.html +++ b/webroot/index.html @@ -31,7 +31,7 @@
  • Åbn siden op i Tangos requeue værktøj (evt. udfra Tango_URL hvis siden har sat denne).
  • Se alle database forespørgsler på siden ved at køre DB_PDO_Logging værktøjet på siden.
  • Browserens cache tømmes desuden automatisk. -
  • Quick link dialog, hvor man hurtig kan navigere hen til et tv2.dk site - genvej ALT+3
  • +
  • Quick link dialog, hvor man hurtig kan navigere hen til et tv2.dk site - genvej ALT+3, (Eller, Windows:CTRL+F3, Mac:Command+F3)
  • Feature liste på i2-images og i2-files: