[Reloadevery] Using the reload button instead of the context menu

Omar Khan mromarkhan at rogers.com
Thu Aug 26 23:38:08 EDT 2004


Peace.
An enhancement that uses the Reload toolbar button instead of the possibly over-crowded context
menu.

This places a drop down menu next to the reload button and disables the context menu.
Not tested on Mozilla only on Firefox 0.93

I originally saw the toolbar drop down menu in the extension diggler by
Adam Lock <adamlock at netscape.com>
http://diggler.mozdev.org/

I originally saw how to override the toolbar buttons in the extension
eznav by Devon Jensen
http://downloadstatusbar.mozdev.org/eznav/index.html

CVS diff - u 

Index: reloadevery/src/content/reloadevery/reloadeveryOverlay.js
===================================================================
RCS file: /cvs/reloadevery/src/content/reloadevery/reloadeveryOverlay.js,v
retrieving revision 1.7
diff -u -r1.7 reloadeveryOverlay.js
--- reloadevery/src/content/reloadevery/reloadeveryOverlay.js	12 Aug 2004 20:06:12 -0000	1.7
+++ reloadevery/src/content/reloadevery/reloadeveryOverlay.js	27 Aug 2004 02:37:15 -0000
@@ -101,7 +101,7 @@
 
 
     try{
-       
document.getElementById("contentAreaContextMenu").addEventListener("popupshowing",onReloadEveryPopup,false);
 
+       
document.getElementById("reload-button").addEventListener("popupshowing",onReloadEveryPopup,false);
 
         gURLBar.addEventListener("keypress", onReloadEveryKeyPressInURLBar, false);
     }
     catch(e){
@@ -135,9 +135,9 @@
 function onReloadEveryPopup() {
 
     //log("onReloadEveryPopup()");
-    var cm = gContextMenu;
+    //var cm = gContextMenu;
 
-    document.getElementById("reloadevery_menu").hidden = ( cm.isTextSelected || cm.onLink ||
cm.onImage || cm.onTextInput );
+    //document.getElementById("reloadevery_menu").hidden = ( cm.isTextSelected || cm.onLink ||
cm.onImage || cm.onTextInput );
 
     // Check if this a new window/tab   
     if (getCurTab().reloadEveryEnabled == null){
@@ -378,13 +378,19 @@
     return ({
 
     tab : aTab,
-    QueryInterface : function(aIID){        

-		if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||

-		    aIID.equals(Components.interfaces.nsISupportsWeakReference) ||

-			aIID.equals(Components.interfaces.nsISupports)){

+    QueryInterface : function(aIID){        
+
+		if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
+
+		    aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
+
+			aIID.equals(Components.interfaces.nsISupports)){
+
 			return this;
-        }

-		throw Components.results.NS_NOINTERFACE;

+        }
+
+		throw Components.results.NS_NOINTERFACE;
+
 	},    
     onProgressChange : function (aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress,
                                  aCurTotalProgress, aMaxTotalProgress){
@@ -409,4 +415,5 @@
     onSecurityChange : function(aWebProgress, aRequest, aState){
     }
     });		
-}

+}
+
Index: reloadevery/src/content/reloadevery/reloadeveryOverlay.xul
===================================================================
RCS file: /cvs/reloadevery/src/content/reloadevery/reloadeveryOverlay.xul,v
retrieving revision 1.4
diff -u -r1.4 reloadeveryOverlay.xul
--- reloadevery/src/content/reloadevery/reloadeveryOverlay.xul	9 Feb 2004 22:05:32 -0000	1.4
+++ reloadevery/src/content/reloadevery/reloadeveryOverlay.xul	27 Aug 2004 02:37:16 -0000
@@ -42,9 +42,9 @@
 
 <script src="reloadeveryOverlay.js"/>
 
-
-<popup id="contentAreaContextMenu">
-  <menu id="reloadevery_menu" label="&reloadevery_menu.label;"
accesskey="&reloadevery_menu.accesskey;" insertafter="context-reload">
+<toolbarbutton id="reload-button" type="menu-button">
+<!-- <popup id="contentAreaContextMenu">
+  <menu id="reloadevery_menu" label="&reloadevery_menu.label;"
accesskey="&reloadevery_menu.accesskey;" insertafter="context-reload">-->
     <menupopup id="reloadevery_popup">
       <menuitem id="reloadevery_enable" label="&reloadevery_enable.label;" type="checkbox"
oncommand="onReloadEveryEnable()"/>
       <menuseparator /> 
@@ -60,8 +60,8 @@
       <menuitem id="reloadevery_disable_all_tabs" label="&reloadevery_disable_all_tabs.label;"
oncommand="onReloadEveryDisableAllTabs()"/>
 
     </menupopup>
-  </menu>
-</popup>
-
+  <!-- </menu>
+</popup> -->
+</toolbarbutton>
 
 </overlay>



More information about the Reloadevery mailing list