oncommand="window.openDialog('chrome://tv2developer/content/about.xul','tv2about','modal,centerscreen,chrome,resizable=no')" />
</popup>
</popupset>
-
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="tv2-swap-button" type="menu-button"
context="tv2developer-contextmenu"
onclick="checkForMiddleClick(this, event);"
onmouseover="TV2Developer.handleStatusText(event);"
onmouseout="TV2Developer.setStatusText('');">
- <menupopup context=""
+ <menupopup context=""
id="tv2developer-popupmenu"
onpopupshowing="TV2Developer.fillMenu(event)"
oncommand="TV2Developer.handleMenu(event); event.stopPropagation();"
onmouseover="TV2Developer.handleStatusText(event);"
onmouseout="TV2Developer.setStatusText('');"
onclick="checkForMiddleClick(this, event);"/>
+
</toolbarbutton>
</toolbarpalette>
+<statusbar id="status-bar">
+ <statusbarpanel class="statusbarpanel-menu-iconic" id="tv2developer_statusbutton" src="chrome://tv2developer/skin/interaktiv.png"/>
+</statusbar>
+
</overlay>
_prefBranch: null,
_hackEnabled: false,
init: function() {
+
+ // the status bar thingy.
+ document.getElementById('statusbarmode').checked = TV2Util.getPref('useStatusBarMode', false);
+
var hacks = document.getElementById('mac-hacks');
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
this._keyBranch = prefs.getBranch('ui.key.');
this.php4sitesFillIn(TV2Util.getPref('php4sites', ''));
document.getElementById('php4auto').selectedIndex =
(TV2Util.hasPref('php4sites') ? 1 : 0);
+
},
/* fill in list */
TV2Util.clearPref('php4sites');
}
}
+
+ // Save the statusbar thing
+ var statusbar = document.getElementById('statusbarmode').checked;
+ TV2Util.setPref('useStatusBarMode', statusbar);
+
},
update: function() {
- var instantApply = this._prefBranch.getBoolPref("instantApply", false);
+ if(this._prefBranch != null) { // sometimes it's null on my mac (adba)
+ var instantApply = this._prefBranch.getBoolPref("instantApply", false);
+ }
if (instantApply) this.save();
}
oncommand="TV2Options.update()"
tooltiptext="&optionsDialog.mac.accesskeys.tooltiptext;"/>
</groupbox>
+ <groupbox id="misc">
+ <checkbox id="statusbarmode" label="&optionsDialog.misc.statusbarmode;"
+ oncommand="TV2Options.update()"
+ tooltiptext="&optionsDialog.misc.statusbarmode.tooltiptext;"/>
+ </groupbox>
+
</prefpane>
</prefwindow>
var TV2Developer = {
_lastAction: null,
-
+ _statusBarIconEnabled: false,
+
+ /* toggle between statusbar/toolbar mode */
+ enableStatusBarIcon: function( enabled ) {
+ this._statusBarIconEnabled = enabled;
+ var statusbutton = document.getElementById('tv2developer_statusbutton');
+ var swapbutton = document.getElementById('tv2-swap-button');
+ var popupmenu = document.getElementById('tv2developer-popupmenu');
+
+ statusbutton.hidden = !enabled;
+ swapbutton.hidden = enabled;
+
+ statusbutton.setAttribute('context', 'tv2developer-contextmenu'); // Add the rightclick menu.
+ if(enabled) {
+ statusbutton.appendChild(popupmenu);
+ } else {
+ swapbutton.appendChild(popupmenu);
+ }
+ },
+
/* method for initialize, reading properties, adding icon at firstrun, added keyshortcuts */
init: function() {
- // init
+ // init
this._lastAction = TV2Util.getPref('lastaction-linktype');
// add shortcuts depending on platform
var shortcuts = document.getElementById('mainKeyset');
}
catch(e) { }
}
+
+ // initializes the statusbar icon.
+ this.enableStatusBarIcon(TV2Util.getPref('useStatusBarMode', false));
},
/* utility function to create shortcut object */
/* shortcut to open menu */
handleKeyShortcut: function(event) {
- document.getElementById('tv2-swap-button').open = true;
+ var popupmenu = document.getElementById('tv2developer-popupmenu');
+ popupmenu.showPopup();
},
/* utility function to go to a link */
<!ENTITY optionsDialog.mac.accesskeys "Slå genvejstaster til i Firefox på Mac">
<!ENTITY optionsDialog.mac.accesskeys.tooltiptext "Ændring af dette felt kræver genstart af Firefox">
+<!ENTITY optionsDialog.misc.statusbarmode "Slås statusbar til">
+<!ENTITY optionsDialog.misc.statusbarmode.tooltiptext "Ændring af dette felt kræver genstart af Firefox">
+
+
<!ENTITY optionsDialog.php4sites.label "Gamle PHP 4 sites">
<!ENTITY optionsDialog.php4sites.tooltiptext "Sites i denne liste vil blive betragtet som PHP 4 sites.">
<!ENTITY optionsDialog.php4sites.defaults "Brug standard PHP 4 sites">
<!ENTITY optionsDialog.mac.accesskeys "Enable accesskeys in Firefox on Mac">
<!ENTITY optionsDialog.mac.accesskeys.tooltiptext "Changing this requires restart of Firefox">
+<!ENTITY optionsDialog.misc.statusbarmode "Enable statusbar mode">
+<!ENTITY optionsDialog.misc.statusbarmode.tooltiptext "Changing this requires restart of Firefox">
+
<!ENTITY optionsDialog.php4sites.label "PHP 4 legacy sites">
<!ENTITY optionsDialog.php4sites.tooltiptext "Sites listed here will be seen as PHP 4 sites.">
<!ENTITY optionsDialog.php4sites.defaults "Use default PHP 4 sites">