Changeset 2
- Timestamp:
- 06/21/05 15:20:39 (3 years ago)
- Files:
-
- uppity/trunk/chrome/uppity/content/uppity/about.xul (modified) (1 diff)
- uppity/trunk/chrome/uppity/content/uppity/contents.rdf (modified) (1 diff)
- uppity/trunk/chrome/uppity/content/uppity/uppity-about.js (added)
- uppity/trunk/chrome/uppity/content/uppity/uppity-options.xul (added)
- uppity/trunk/chrome/uppity/content/uppity/uppity-overlay.xul (modified) (1 diff)
- uppity/trunk/chrome/uppity/content/uppity/uppity.js (moved) (moved from uppity/trunk/chrome/uppity/content/uppity/uppity-overlay.js) (2 diffs)
- uppity/trunk/chrome/uppity/skin/classic/uppity/sb-icon.png (added)
- uppity/trunk/install.rdf (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
uppity/trunk/chrome/uppity/content/uppity/about.xul
r1 r2 15 15 <vbox> 16 16 <text value="Uppity" style="font-weight: bold; font-size: x-large;"/> 17 <text value="ver. 1. 0"/>17 <text value="ver. 1.1"/> 18 18 <separator class="thin"/> 19 19 <text value="Created By:" style="font-weight: bold;"/> uppity/trunk/chrome/uppity/content/uppity/contents.rdf
r1 r2 19 19 20 20 <RDF:Description RDF:about="urn:mozilla:package:uppity" 21 chrome:displayName="Uppity 0.0.1"21 chrome:displayName="Uppity" 22 22 chrome:author="" 23 23 chrome:authorURL="" uppity/trunk/chrome/uppity/content/uppity/uppity-overlay.xul
r1 r2 1 1 <?xml version="1.0"?> 2 2 <?xml-stylesheet href="chrome://uppity/skin/uppity-overlay.css" type="text/css"?> 3 <overlay id="uppity-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 3 4 4 <overlay id="uppityOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 5 6 <script type="application/x-javascript" src="chrome://uppity/content/uppity-overlay.js"></script> 7 8 <!-- 9 <popup id="contentAreaContextMenu"> 10 <menuitem id="uppity-command-context" label="Hello, world!" accesskey="H" 11 insertafter="context-stop" oncommand="hello();"/> 12 </popup> 13 14 15 <menupopup id="menu_ToolsPopup"> 16 <menuitem insertafter="devToolsSeparator" label="Hello, world!" 17 accesskey="H" oncommand="hello();" /> 18 </menupopup> 19 --> 5 <script type="application/x-javascript" src="chrome://uppity/content/uppity.js"></script> 20 6 21 7 <toolbarpalette id="BrowserToolbarPalette"> 22 <toolbarbutton id="tb-uppity" oncommand="uppity ()"8 <toolbarbutton id="tb-uppity" oncommand="uppity.goUp()" 23 9 class="toolbarbutton-1" 24 label="Uppity" tooltiptext="Go Up 1 Level" />25 <!-- label="&vnkButton.label;" tooltiptext="&vnkButton.label;"/> -->10 label="Uppity" tooltiptext="Go Up 1 Level" 11 /> 26 12 </toolbarpalette> 27 13 14 <statusbar id="status-bar"> 15 <statusbarpanel id="status-bar-uppity" insertafter="livemark-button"> 16 <image id="status-bar-uppity-image" width="16" height="16" 17 src="chrome://uppity/skin/sb-icon.png" 18 onclick="uppity.goUp();" 19 /> 20 </statusbarpanel> 21 </statusbar> 22 23 <script type="application/x-javascript"> 24 <![CDATA[ 25 window.addEventListener("load", function() { 26 var sb=document.getElementById('status-bar-uppity'); 27 //sb.style.display='none'; 28 }, false); // end window.addEventListener("load"...) 29 ]]> 30 </script> 31 28 32 </overlay> uppity/trunk/chrome/uppity/content/uppity/uppity.js
r1 r2 1 var uppity={ 1 2 //this is directly adapted from a bookmarklet I wrote some time ago 2 3 //so the variables are all terse. a later version should see a 3 4 //revamp of this code but I'm proud to finally have written my first 4 5 //firefox extension from scratch! 5 6 function uppity() { 6 goUp:function() { 7 7 var l=getBrowser().contentWindow.location, 8 8 L=false, h=l.href, S='/', s=l.protocol+S+S, … … 22 22 } 23 23 if (L) l.assign(L); 24 } 24 }, 25 26 getPref:function(type, name) { 27 var pref = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); 28 try { 29 switch(type) { 30 case 'bool': return pref.getBoolPref(name); 31 case 'int': return pref.getIntPref(name); 32 case 'string': 33 default: return pref.getCharPref(name); 34 } 35 } catch (e) { this.dumpErr(e) } 36 return ''; 37 }, 38 39 setPref:function(type, name, value) { 40 var pref = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); 41 try { 42 switch (type) { 43 case 'bool': pref.setBoolPref(name, value); break; 44 case 'int': pref.setIntPref(name, value); break; 45 case 'string': 46 default: pref.setCharPref(name, value); break; 47 } 48 } catch (e) { this.dumpErr(e) } 49 }, 50 51 loadOptions:function() { 52 try { 53 window.document.getElementById('uppity-sb-icon').checked=this.getPref('bool', 'uppity.sb-icon'); 54 } catch (e) { this.dumpErr(e) } 55 return true; 56 }, 57 58 saveOptions:function() { 59 try { 60 setPref('bool', 'uppity.sb-icon' 61 (bool)window.document.getElementById('uppity-sb-icon').checked=this 62 ); 63 } catch (e) { this.dumpErr(e) } 64 return true; 65 }, 66 67 dumpErr:function(e) { 68 var s='Error in mpwgen:\n'; 69 s+='Line: '+e.lineNumber+'\n'; 70 s+=e.name+': '+e.message+'\n'; 71 //s+='Stack:\n'+e.stack+'\n\n'; 72 dump(s); 73 }, 74 75 }//close var uppity uppity/trunk/install.rdf
r1 r2 4 4 <em:id>{16cbd87c-eb99-4f5c-9825-83cf13ab7ff8}</em:id> 5 5 <em:name>Uppity</em:name> 6 <em:version>1. 0</em:version>6 <em:version>1.1</em:version> 7 7 <em:description>Navigate up one level (directory).</em:description> 8 8 <em:creator>Anthony Lieuallen</em:creator> … … 11 11 <em:iconURL>chrome://uppity/skin/em-icon.png</em:iconURL> 12 12 <em:aboutURL>chrome://uppity/content/about.xul</em:aboutURL> 13 <em:optionsURL>chrome://uppity/content/uppity-options.xul</em:optionsURL> 14 13 15 <em:file> 14 16 <Description about="urn:mozilla:extension:file:uppity">