You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by ni...@apache.org on 2002/06/20 12:13:28 UTC

cvs commit: xml-forrest/src/resources/forrestbar install.js

nicolaken    2002/06/20 03:13:28

  Added:       src/resources/forrestbar/content/forrestbar/images
                        code-off.png code.png download-off.png download.png
                        news-off.png news.png
               src/resources/forrestbar/content/forrestbar contents.rdf
                        forrestbar.css forrestbarOverlay.js
                        forrestbarOverlay.xul
               src/resources/forrestbar install.js
  Log:
  Added a forrest toolbar for Mozilla 1.0.
  
  to build it: build forrestbar
  
  To install it doubleclick on the forrestbar.xpi package in the build dir.
  To install a new version, do the same.
  To uninstall, do it by hand (Mozilla still doesn't have an uninstall system :-/)
  
  Revision  Changes    Path
  1.1                  xml-forrest/src/resources/forrestbar/content/forrestbar/images/code-off.png
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/forrestbar/content/forrestbar/images/code.png
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/forrestbar/content/forrestbar/images/download-off.png
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/forrestbar/content/forrestbar/images/download.png
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/forrestbar/content/forrestbar/images/news-off.png
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/forrestbar/content/forrestbar/images/news.png
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/forrestbar/content/forrestbar/contents.rdf
  
  Index: contents.rdf
  ===================================================================
  <?xml version="1.0"?>
  <RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
     <RDF:Seq about="urn:mozilla:package:root">
        <RDF:li resource="urn:mozilla:package:forrestbar" />
     </RDF:Seq>
  
     <RDF:Description about="urn:mozilla:package:forrestbar" chrome:displayName="Forrest Toolbar" chrome:author="Nicola Ken Barozzi - nicolaken at apache dot org" chrome:name="forrestbar">
     </RDF:Description>
  
     <RDF:Seq about="urn:mozilla:overlays">
        <RDF:li resource="chrome://navigator/content/navigator.xul" />
     </RDF:Seq>
  
     <RDF:Seq about="chrome://navigator/content/navigator.xul">
        <RDF:li>chrome://forrestbar/content/forrestbarOverlay.xul</RDF:li>
     </RDF:Seq>
  </RDF:RDF>
  
  
  
  
  1.1                  xml-forrest/src/resources/forrestbar/content/forrestbar/forrestbar.css
  
  Index: forrestbar.css
  ===================================================================
  *.forrestbar {
  	font-family: tahoma,verdana;
  	font-size: 10px;
  	padding: 0px;
  	margin: 0px;
  }
  
  text.forrestbar {
  	margin: 0px 3px 0px 3px;
  	font-size: 12px;
  }
  
  textbox.forrestbar {
  	font-size: 12px;
  	padding: 2px;
  }
  
  image.forrestbar {
  	border: 1px solid black;
  	margin: 0px 0px 0px 3px;
  }
  
  image#forrestbar-logo {
   	list-style-image: url("images/apache.png");
  }
  
  button.forrestbar {
  	 padding: 1px 0px 1px 10px;
  }
  
  button#forrestbar-search {
  	list-style-image: url("images/search-off.png");
  }
  button#forrestbar-search:hover {
  	list-style-image: url("images/search.png");
  }
  
  button#forrestbar-news {
  	list-style-image: url("images/news-off.png");
  }
  button#forrestbar-news:hover {
  	list-style-image: url("images/news.png");
  }
  
  button#forrestbar-code {
  	list-style-image: url("images/code-off.png");
  }
  button#forrestbar-code:hover {
  	list-style-image: url("images/code.png");
  }
  
  button#forrestbar-download {
  	list-style-image: url("images/download-off.png");
  }
  button#forrestbar-download:hover {
  	list-style-image: url("images/download.png");
  }
  
  button#forrestbar-tools {
  	list-style-image: url("images/tools-off.png");
  }
  button#forrestbar-tools:hover {
  	list-style-image: url("images/tools.png");
  }
  
  button#forrestbar-asksam {
  	list-style-image: url("images/asksam-off.png");
  }
  button#forrestbar-asksam:hover {
  	list-style-image: url("images/asksam.png");
  }
  
  
  
  1.1                  xml-forrest/src/resources/forrestbar/content/forrestbar/forrestbarOverlay.js
  
  Index: forrestbarOverlay.js
  ===================================================================
  
  function startforrestbar()
  {
  	//alert("function init");
  	if(document.getElementById("forrestbar").getAttribute("hidden") == "false")
  	{
  		removeEventListener ("load",startforrestbar, true); // Keep the event from firing a hundred more times.
  	}
  }
  
  addEventListener("load", startforrestbar, true); // Run the startup function when the window loads
  	
  function navigate(url) {
  	window._content.document.location.href = url;
  }
  
  
  /**************************/
  
  function search(searchID)
  {
  	var searchItem = document.getElementById(searchID);
  	navigate('http://www.google.com/search?q=' + searchItem.value);
  }
  
  function navProject(searchID) {
  	var searchItem = document.getElementById(searchID);
  	navigate(searchItem.selectedItem.value);
  }
  
  function navNews() {
  	navigate('http://xml.apache.org/news.html');
  }
  
  function navDownload() {
  	navigate('http://xml.apache.org/dist/');
  }
  
  function navCode() {
  	navigate('http://xml.apache.org/cvs.html');
  }
  
  function navTools() {
  	navigate('http://nagoya.apache.org/');
  }
  
  function navAskSam() {
  	navigate('mailto:forrest-user@xml.apache.org');
  }
  
  
  
  
  
  1.1                  xml-forrest/src/resources/forrestbar/content/forrestbar/forrestbarOverlay.xul
  
  Index: forrestbarOverlay.xul
  ===================================================================
  <?xml version="1.0"?>
  <?xml-stylesheet href="forrestbar.css" type="text/css"?>
  
  <overlay id="forrestbarOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  
  <script type="text/javascript" src="forrestbarOverlay.js"/>
  
  <menupopup id="view_toolbars_popup">
  	<menuitem id="viewforrestbar" position="4" checked="true" class="menuitem-iconic" type="checkbox" label="Forrest Toolbar" oncommand="goToggleToolbar('forrestbar','viewforrestbar');startforrestbar();"/>
  </menupopup>
  
  
  <toolbox id="navigator-toolbox">
    <toolbar id="forrestbar" persist="hidden" hidden="false" grippytooltiptext="Forrestbar">
    
     <image class="forrestbar" id="forrestbar-logo"/>
     <text class="forrestbar" value="Apache"/>
  
     <textbox class="forrestbar" id="forrestbar-input" onselect="search('forrestbar-input');" hidden="false"/>
     <button class="forrestbar" id="forrestbar-search" label="Search" onclick="search('forrestbar-input');" hidden="false"/>
  
     <menulist value="Projects"
               id="forrestbar-projects" oncommand="navProject('forrestbar-projects');" hidden="false">
      <menupopup>
        <menuitem label="Jakarta" value="http://jakarta.apache.org/" />    
        <menuitem label="XML" value="http://xml.apache.org/" />
        <menuitem label="others here" value="http://www.apache.org/" />
      </menupopup>
     </menulist>
         
     <button class="forrestbar" id="forrestbar-news"     label="News" onclick="navNews();" hidden="false"/>
     <button class="forrestbar" id="forrestbar-download" label="Download" onclick="navDownload();" hidden="false"/>
     <button class="forrestbar" id="forrestbar-code"     label="Code"  onclick="navCode();" hidden="false"/>
     <button class="forrestbar" id="forrestbar-tools"    label="Tools"  onclick="navTools();" hidden="false"/>
     <button class="forrestbar" id="forrestbar-asksam"   label="AskSam"   onclick="navAskSam();" hidden="false"/>
    
    </toolbar>
  </toolbox>
  
  
  </overlay>
  
  
  
  1.1                  xml-forrest/src/resources/forrestbar/install.js
  
  Index: install.js
  ===================================================================
  var err = initInstall("ForrestBar", "forrestbar", ""); 
  //alert("initInstall");
  addFile("forrestbar", "forrestbar.jar", getFolder("Chrome"),"");
  //alert("addFile");	
  registerChrome(CONTENT | DELAYED_CHROME, getFolder("Chrome","forrestbar.jar"), "content/forrestbar/");
  //alert("registerChrome");
  if (err==SUCCESS){  
    //alert("SUCCESS");
    performInstall();
  } else {
    cancelInstall(err);
  }