View the DQSD CVS repository here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dqsd/

Update of /cvsroot/dqsd/dqsd/addons/genealogy
In directory usw-pr-cvs1:/tmp/cvs-serv12346/addons/genealogy

Modified Files:
        ancmb.xml genealogy_lib.js genforum.xml 
Log Message:
updated message board searches
added more countries to the country list

Index: ancmb.xml
===================================================================
RCS file: /cvsroot/dqsd/dqsd/addons/genealogy/ancmb.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ancmb.xml   10 Oct 2002 04:48:38 -0000      1.3
--- ancmb.xml   15 Oct 2002 05:50:43 -0000      1.4
***************
*** 1,23 ****
! <search function="ancmb">
    <name>Ancestry.com Message Boards</name>
    <description>
      Search or go to Ancestry.com Message Board web pages.<br/>
!     <div class="helpboxDescLabels">Switches:</div>
      <table class="helpboxDescTable">
-       <tr><td>/search</td><td> - </td><td>Search for term in the message 
boards</td></tr>
        <tr><td>/find</td><td> - </td><td>Find specified message board</td></tr>
      </table>
      <div class="helpboxDescLabels">Examples:</div>
      <table class="helpboxDescTable">
!       <tr><td>ancmb berrien, mi</td><td> - </td><td>Go to the Berrien county, 
Michigan message board</td></tr>
!       <tr><td>ancmb alaska</td><td> - </td><td>Go to the Alaska state message 
board</td></tr>
!       <tr><td>ancmb /s:beardsley</td><td> - </td><td>Search for the term beardsley 
in all message boards</td></tr>
!       <tr><td>ancmb /s:beardsley ny</td><td> - </td><td>Search for the term 
beardsley in all New York state message boards</td></tr>
!       <tr><td>ancmb /s:beardsley clinton, new york</td><td> - </td><td>Search for 
the term beardsley in the Clinton county,  New York state message board</td></tr>
        <tr><td>ancmb /f beardsley</td><td> - </td><td>Search for a forum matching 
term beardsley</td></tr>
      </table>
    </description>
!   
<link>http://boards.ancestry.com/mbexec/board/an/localities.northam.usa.states</link>
!   <category>Genealogy</category>
    <contributor>Brent Beardsley</contributor>
    <form name="ancmbf"
--- 1,52 ----
! <search function="amb">
    <name>Ancestry.com Message Boards</name>
    <description>
      Search or go to Ancestry.com Message Board web pages.<br/>
!     <div class="helpboxDescLabels">Search Type Switches:</div>
      <table class="helpboxDescTable">
        <tr><td>/find</td><td> - </td><td>Find specified message board</td></tr>
+       <tr><td>/search [default]</td><td> - </td><td>Search the message boards, goes 
+to forum if no query specified</td></tr>
+     </table>
+     <div class="helpboxDescLabels">Search Specific Switches:</div>
+     <table class="helpboxDescTable">
+       <tr><td>/author</td><td> - </td><td>Search for messages by specified 
+author</td></tr>
+       <tr><td>/days</td><td> - </td><td>Search for messages within the last 
+specified days</td></tr>
+       <tr><td>/place</td><td> - </td><td>Search for messages in the specified 
+locality</td></tr>
+       <tr><td>/subject</td><td> - </td><td>Search for messages with the specified 
+subject</td></tr>
+       <tr><td>/surname</td><td> - </td><td>Search for messages with the specified 
+surname</td></tr>
+       <tr><td>/type</td><td> - </td><td>Search for messages with the specified 
+message type (see Message Type Switch Values) </td></tr>
+     </table>
+     <div class="helpboxDescLabels">Message Type Switch Values</div>
+     <table class="helpboxDescTable">
+       <tr><td>queries</td></tr>
+       <tr><td>bible</td></tr>
+       <tr><td>biography</td></tr>
+       <tr><td>birth</td></tr>
+       <tr><td>cemetery</td></tr>
+       <tr><td>census</td></tr>
+       <tr><td>death</td></tr>
+       <tr><td>deed</td></tr>
+       <tr><td>immigration</td></tr>
+       <tr><td>lookup</td></tr>
+       <tr><td>marriage</td></tr>
+       <tr><td>military</td></tr>
+       <tr><td>obituary</td></tr>
+       <tr><td>pension</td></tr>
+       <tr><td>will</td></tr>
      </table>
      <div class="helpboxDescLabels">Examples:</div>
      <table class="helpboxDescTable">
!       <tr><td>ancmb /p berrien, mi</td><td> - </td><td>Go to the Berrien county, 
Michigan message board</td></tr>
!       <tr><td>ancmb /p alaska</td><td> - </td><td>Go to the Alaska state message 
board</td></tr>
!       <tr><td>ancmb beardsley</td><td> - </td><td>Search for the term beardsley in 
all message boards</td></tr>
!       <tr><td>ancmb beardsley /p ny</td><td> - </td><td>Search for the term 
beardsley in all New York state message boards</td></tr>
!       <tr><td>ancmb beardsley /p clinton, new york</td><td> - </td><td>Search for 
the term beardsley in the Clinton county,  New York state message board</td></tr>
        <tr><td>ancmb /f beardsley</td><td> - </td><td>Search for a forum matching 
term beardsley</td></tr>
      </table>
    </description>
!   <link>http://boards.ancestry.com/</link>
!   <category>Genealogy
!       <category>Message Boards</category>
!   </category>
    <contributor>Brent Beardsley</contributor>
    <form name="ancmbf"
***************
*** 30,33 ****
--- 59,68 ----
      <input type="hidden" name="query" value="" />
      <input type="hidden" name="filter" value="" />
+     <input type="hidden" name="subject" value="" />
+     <input type="hidden" name="author" value="" />
+     <input type="hidden" name="period" value="0" />
+     <input type="hidden" name="classification" value="" />
+     <input type="hidden" name="surnames" value="" />
+     <input type="hidden" name="fields" value="" />
    </form>
    <form name="ancmbfindf"
***************
*** 44,91 ****
    <script src="addons/genealogy/genealogy_lib.js"></script>
    <script><![CDATA[
!     function ancmb(q)
      {
!       if( nullArgs("ancmb", q) )
          return false;
  
!       var args = parseArgs(q, "find, search");
!       if (args == null)
!       return false;
  
!       if (args.switches.length >= 1) {
!         if (args.switches[0].name == "search") {
!           var state = genealogy_parse_place_state(args.q);
!           var county = 
genealogy_parse_place_county(args.q).toLowerCase().replace(/\s/gim, "");
!           var state_name = 
genealogy_lookup_place_name(state).toLowerCase().replace(/\s/gim, "");
!         var filter = "";
!         if (state_name.length > 0) {
!           filter = "localities.northam.usa.states."+state_name;
!           if (county.length > 0) {
!             filter += (".counties."+county);
            }
          }
!         document.ancmbf.query.value = args.switch_val["search"];
          document.ancmbf.p.value = filter;
          document.ancmbf.filter.value = filter;
          submitForm(ancmbf);
-       } else if (args.switches[0].name == "find") {
-         document.ancmbfindf.query.value = args.q;
-         submitForm(ancmbfindf);
-       } else {
-           nullArgs("ancmb", "?");
-       }
-       } else {
-         // for surnames: 
http://boards.ancestry.com/mbexec?htx=board&r=an&p=surnames.beardsley
-         var search_url = 
"http://boards.ancestry.com/mbexec/board/an/localities.northam.usa.states";;
-         var state = genealogy_parse_place_state(args.q);
-         var county = 
genealogy_parse_place_county(args.q).toLowerCase().replace(/\s/gim, "");
-         var state_name = 
genealogy_lookup_place_name(state).toLowerCase().replace(/\s/gim, "");
-         if (state_name.length > 0) {
-           search_url = 
"http://boards.ancestry.com/mbexec/board/an/localities.northam.usa.states."+state_name;
-         if (county.length > 0) {
-           search_url += (".counties."+county);
-         }
          }
-         openSearchWindow(search_url);
        }
      }
--- 79,186 ----
    <script src="addons/genealogy/genealogy_lib.js"></script>
    <script><![CDATA[
!     function amb(q)
      {
!       if( nullArgs("amb", q) )
          return false;
  
!       if (!genealogy_check_lib_version("1.7"))
!         return false;
  
!       var args = genealogy_parseArgs(q, "author, days, find, place, query, surname, 
subject, type");
!       if (genealogy_hasArg(args, "find")) {
!         alert("find");
!       // find board with name
!       var query = args.switch_val["find"];
!       if (query == "" && genealogy_hasArg(args, "query")) {
!          query = args.switch_val["query"];
!       }
!       if (query == "") {
!          query = args.q;
!       }
!       document.ancmbfindf.query.value = query;
!       submitForm(ancmbfindf);
!       } else {
!       var query = "";
!       if (genealogy_hasArg(args, "query")) {
!         query = args.switch_val["query"];
!       }
!       if (query == "") {
!            query = args.q;
!       }
!       if (query == "") {
!         // goto board
!         if (genealogy_hasArg(args, "place")) {
!               var place_value = args.switch_val["place"];
!               var search_url = 
"http://boards.ancestry.com/mbexec/board/an/localities.northam.usa.states";;
!               var state = genealogy_parse_place_state(place_value);
!               var county = 
genealogy_parse_place_county(place_value).toLowerCase().replace(/\s/gim, "");
!               var state_name = 
genealogy_lookup_place_name(state).toLowerCase().replace(/\s/gim, "");
!               if (state_name.length > 0) {
!                 search_url += "."+state_name;
!                 if (county.length > 0) {
!                   search_url += (".counties."+county);
!                 }
!               }
!               openSearchWindow(search_url);
!         } else if (genealogy_hasArg(args, "surname")) {
!               var surname_value = args.switch_val["surname"];
!               if (surname_value == "") {
!                  surname_value = args.q;
!               }
!               surname_value = surname_value.replace(/\s/g, "-20-");
!               var search_url = 
"http://boards.ancestry.com/mbexec?htx=board&r=an&p=surnames."+surname_value;
!               openSearchWindow(search_url);
!         } else {
!               nullArgs("amb", "?");
!         }
!         } else {
!         // search boards
!         var specified_fields = "surnames";
!           var author = "";
!         if (genealogy_hasArg(args, "author")) {
!           author = args.switch_val["author"];
!         }
!         var subject = "";
!         if (genealogy_hasArg(args, "subject")) {
!             subject = args.switch_val["subject"];
!         }
!         var type = "";
!         if (genealogy_hasArg(args, "type")) {
!           type = args.switch_val["type"].toLowerCase();
!           if (type != "") {
!             specified_fields += ",classification";
            }
          }
!         var days = "0";
!         if (genealogy_hasArg(args, "days")) {
!           days = args.switch_val["days"];
!         }
! 
!           var filter = "";
!         if (genealogy_hasArg(args, "place")) {
!           var place_value = args.switch_val["place"];
!           var state = genealogy_parse_place_state(place_value);
!           var county = 
genealogy_parse_place_county(place_value).toLowerCase().replace(/\s/gim, "");
!           var state_name = 
genealogy_lookup_place_name(state).toLowerCase().replace(/\s/gim, "");
!           if (state_name != "") {
!             filter = "localities.northam.usa.states."+state_name;
!             if (county != "") {
!               filter += (".counties."+county);
!             }
!           }
!         } else if (genealogy_hasArg(args, "surname")) {
!            var surname_value = args.switch_val["surname"].replace(/\s/g, "-20-");
!            filter = "surnames."+ surname_value;
!         }
!         document.ancmbf.query.value = query;
          document.ancmbf.p.value = filter;
          document.ancmbf.filter.value = filter;
+         document.ancmbf.author.value = author;
+         document.ancmbf.subject.value = subject;
+         document.ancmbf.classification.value = type;
+         document.ancmbf.fields.value = specified_fields;
+         document.ancmbf.period.value = days;
          submitForm(ancmbf);
          }
        }
      }

Index: genealogy_lib.js
===================================================================
RCS file: /cvsroot/dqsd/dqsd/addons/genealogy/genealogy_lib.js,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** genealogy_lib.js    5 Oct 2002 05:26:05 -0000       1.6
--- genealogy_lib.js    15 Oct 2002 05:50:43 -0000      1.7
***************
*** 1,4 ****
      var genealogy_debug = 0;
!     var genealogy_lib_version = "1.6";
  
        var genealogy_month_names = new Array("JANUARY", "FEBRUARY", "MARCH", "APRIL", 
"MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER");
--- 1,4 ----
      var genealogy_debug = 0;
!     var genealogy_lib_version = "1.7";
  
        var genealogy_month_names = new Array("JANUARY", "FEBRUARY", "MARCH", "APRIL", 
"MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER");
***************
*** 53,79 ****
  
        var genealogy_countries = new Array(
!       "ARGENTINA", "AUSTRALIA", "BELGIUM", "BRAZIL", "CANADA", "DENMARK", "ENGLAND", 
"FINLAND", "FRANCE", "GERMANY", "GREAT BRITAIN", "ICELAND", "ITALY",
!       "LIECHTENSTEIN", "NETHERLANDS", "NEW ZELAND", "NORWAY", "PAPUA NEW GUINEA", 
"RUSSIA", "SOUTH AFRICA", "SWEDEN",
!       "SWITZERLAND", "UNITED KINGDOM", "ZIMBABWE", "PUERTO RICO", "SCOTLAND"
        );
  
  function genealogy_trim(str)
  {
!    var start = 0;
!    var end = str.length-1;
!    while (str.charAt(start) == ' ') {
!          start++;
!    }
!    if (start >= end)   {
!          return "";
!    }
!    while (str.charAt(end) == ' ') {
!          end--;
!    }
!    if (start != 0 || end != str.length-1) {
!          return str.substring(start, end+1);
!    } else {
!        return str;
!    }
  }
  
--- 53,83 ----
  
        var genealogy_countries = new Array(
!       "ACADIA", "AFGHANISTAN", "ALBANIA", "ALGERIA", "AMERICA", "AMERICAN SAMOA", 
"ANDORRA", "ANGOLA", "ANGUILLA", "ANTARCTICA", "ARGENTINA", "ARMENIA", "ARUBA", 
"AUSTRALIA", "AUSTRIA",
!       "BAHAMAS", "BAHRAIN", "BANGLADESH", "BARBADOS", "BELARUS", "BELGIUM", 
"BELIZE", "BERMUDA", "BHUTAN", "BOLIVIA", "BOSNIA", "BOTSWANA", "BRAZIL", "BULGARIA", 
"BURKINA FASO", "BURMA", "BURUNDI",
!       "CAMBODIA", "CANADA", "CHILE", "CHINA", "COLOMBIA", "COSTA RICA", "CUBA", 
"CYPRUS", "CZECHOSLOVAKIA",
!       "DENMARK", "DEUTSCHLAND", "DJIBOUTI", "DOMINICAN REPUBLIC",
!       "EGYPT", "ENGLAND",
!       "FIJI", "FINLAND", "FRANCE",
!       "GERMANY", "GREAT BRITAIN",
!       "ICELAND", "INDIA", "INDONESIA", "IRAN", "IRAQ", "IRELAND", "ISREAL", "ITALY",
!       "JAMAICA", "JAPAN", "JORDAN", 
!       "KENYA", "KIRIBATI", "KUWAIT", "KYRGYZSTAN", 
!       "LAOS", "LATVIA", "LEBANON", "LESOTHO", "LIBERIA", "LIBYA", "LIECHTENSTEIN", 
"LITHUANIA", "LUXEMBOURG", 
!       "MALAYSIA", "MALTA", "MEXICO", "MOZAMBIQUE", 
!       "NETHERLANDS", "NEPAL", "NEW ZELAND", "NICARAGUA", "NIGERIA", "NORTH KOREA", 
"NORWAY",
!       "PANAMA", "PARAGUAY", "PAKISTAN", "PAPUA NEW GUINEA", "PERU", "PHILLIPINES", 
"POLAND", "PORTUGAL", "PUERTO RICO",
!       "ROMANIA", "RUSSIA", "RWANDA",
!       "SCOTLAND", "SINGAPORE", "SOMALIA", "SOUTH AFRICA", "SOUTH KOREA", "SPAIN", 
"SUDAN", "SWEDEN", "SWITZERLAND",
!       "TAIWAN", "THAILAND", "TURKEY", 
!       "UGANDA", "UKRAINE", "UNITED ARAB EMIRATES", "UNITED KINGDOM", "UNITED 
STATES", "URUGUAY", "UZBEKISTAN",
!       "VANUATU", "VENEZUELA", "VIET NAM", "VIRGIN ISLANDS", 
!       "WALES", 
!       "YEMEN", "YUGOSLAVIA",
!       "ZAIRE", "ZAMBIA", "ZIMBABWE" 
        );
  
  function genealogy_trim(str)
  {
!   return str.replace(/^\s+/, "").replace(/\s+$/, "");
  }
  
***************
*** 159,163 ****
        var place_num= genealogy_lookup_place(place);
        if (place_num >= 0)     {
!               return genealogy_states_abbrev[place_num];
        }
        return "";
--- 163,169 ----
        var place_num= genealogy_lookup_place(place);
        if (place_num >= 0)     {
!               if (place_num < genealogy_states.length) {
!                       return genealogy_states_abbrev[place_num];
!               }
        }
        return "";
***************
*** 168,172 ****
        var place_num= genealogy_lookup_place(place);
        if (place_num >= 0)     {
!               return genealogy_states[place_num];
        }
        return "";
--- 174,182 ----
        var place_num= genealogy_lookup_place(place);
        if (place_num >= 0)     {
!               if (place_num < genealogy_states.length) {
!                   return genealogy_states[place_num];
!               } else if (place_num < genealogy_countries.length) {
!                       return genealogy_countries[place_num-genealogy_states.length];
!               }
        }
        return "";
***************
*** 681,684 ****
--- 691,775 ----
                return false;
        }
+ }
+ 
+ /*
+  * genealogy_parseArgs is similar to parseArgs except that
+  * it isn't split on spaces but instead the /
+  * This means that args.q will be the value before the
+  * first slash and the parameter value is everything after
+  * the arg name until the next slash.  Also the arg name
+  * and value are separated by a space not a : like parseArgs.
+  * This will also allow you to have spaces in the argument value
+  * as well.
+  */
+ function genealogy_parseArgs(q, expectedSwitches, expandSwitches)
+ {
+   // In case the caller does not pass in a value
+   if (typeof expandSwitches == 'undefined')
+     expandSwitches = 1;
+ 
+   // In case the caller uses a delimited (;,<space>) string
+   if (typeof expectedSwitches[0] == 'undefined')
+     expectedSwitches = expectedSwitches.split( /[,;/\s]/ );
+ 
+   var switches = [];
+   var switch_val = [];
+   var args_array = q.split('/');
+   for (var i=0; i < args_array.length; i++)
+   {
+         var one_arg = genealogy_trim(args_array[i]);
+         if (one_arg == "") {
+                 continue;
+         }
+         var argRegExp = /(\S+)(\s+(.*))?/g;
+         var reResult = argRegExp.exec(one_arg);
+         if (reResult == null || reResult[1] == "") {
+                 continue;
+         }
+       var argName = reResult[1];
+         var argValue = genealogy_trim(reResult[2]);
+         var re_res_switch;
+ 
+         for (var j = 0; j < expectedSwitches.length && !re_res_switch; j++)
+       {
+         var expect_regex = new RegExp(
+             '^(' + argName.replace('.', '\\.') +
+              ')' + (expandSwitches ? '' : '$'), 'i');
+ 
+         re_res_switch = expectedSwitches[j].match(expect_regex);
+ 
+         //  If there is a match, adjust the args_array, and save the values.
+         if (re_res_switch) {
+                 argName = expectedSwitches[j];
+           switch_val[argName] = argValue;
+           switches.push( {name:argName.toLowerCase(), value:argValue} );
+               }
+         }
+       re_res_switch = "";
+   }
+   if (q.match(/^\s*\//))
+   {
+       // if it starts with a slash there are no non-switch values
+       q = "";
+   } else {
+       // only the part before the first slash is returned in args.q
+       var firstSlash = q.indexOf('/');
+       if (firstSlash != -1) {
+               q = q.substring(0, firstSlash);
+       }
+       q = genealogy_trim(q);
+   }
+   return { q:q, switches:switches, switch_val:switch_val };
+ }
+ 
+ function genealogy_hasArg(args, argname)
+ {
+       argname = argname.toLowerCase();
+       for (var i=0; i < args.switches.length; i++) {
+               if (args.switches[i].name == argname) {
+                       return true;
+               }
+       }
+       return false;
  }
  

Index: genforum.xml
===================================================================
RCS file: /cvsroot/dqsd/dqsd/addons/genealogy/genforum.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** genforum.xml        22 Aug 2002 20:23:50 -0000      1.2
--- genforum.xml        15 Oct 2002 05:50:43 -0000      1.3
***************
*** 1,34 ****
! <search function="genforum">
!   <COMMENT>
! 
!     This search file was initially created by Dave's Quick Search Deskbar
!     Search Wizard version 0.4 (beta) on 08/15/02 at 14:17:00
! 
!     Even though this XML search will probably load and is a healthy start
!     toward a completed search, please be aware that this search will probably
!     not work as is and will require some human inspection and modification.
! 
!   </COMMENT>
    <name>GenForum</name>
!   <category>Genealogy</category>
    <contributor>Brent Beardsley</contributor>
    <link>http://genforum.genealogy.com/</link>
    <email></email>
    <description>
!     Search GenForum<br/>
      <div class="helpboxDescLabels">Switches:</div>
      <table class="helpboxDescTable">
!       <tr><td>/search [default]</td><td> - </td><td>Search for forum</td></tr>
!       <tr><td>/forum</td><td> - </td><td>Search for words in a particular 
forum</td></tr>
!       <tr><td>/all</td><td> - </td><td>Search for words in all forums</td></tr>
      </table>
      <div class="helpboxDescLabels">Examples:</div>
      <table class="helpboxDescTable">
!       <tr><td>genforum /forum:beardsley william</td></tr>
!       <tr><td>genforum brown</td></tr>
!       <tr><td>genforum /all noel</td></tr>
      </table>
- 
    </description>
    <form name="genforumf"
          method="get"
--- 1,28 ----
! <search function="gfm">
    <name>GenForum</name>
!   <category>Genealogy
!       <category>Message Boards</category>
!   </category>
    <contributor>Brent Beardsley</contributor>
    <link>http://genforum.genealogy.com/</link>
    <email></email>
    <description>
!     Search GenForums at Genealogy.com<br/>
      <div class="helpboxDescLabels">Switches:</div>
      <table class="helpboxDescTable">
!       <tr><td>/find</td><td> - </td><td>Search for a specified forum</td></tr>
!       <tr><td>/search [default]</td><td> - </td><td>Search messages in forum, goes 
to forum if no query is specified</td></tr>
      </table>
      <div class="helpboxDescLabels">Examples:</div>
      <table class="helpboxDescTable">
!       <tr><td>genforum /s beardsley</td><td> - </td><td>Goto Beardsley 
forum</td></tr>
!       <tr><td>genforum /p fulton, ny</td><td> - </td><td>Goto Fulton county, New 
York forum</td></tr>
!       <tr><td>genforum /p ny</td><td> - </td><td>Goto New York forum</td></tr>
!       <tr><td>genforum /f beardsley</td><td> - </td><td>Find forums named 
Beardsley</td></tr>
!       <tr><td>genforum william /s beardsley</td><td> - </td><td>Find all messages 
containing william in the Beardsley forum</td></tr>
!       <tr><td>genforum william /p fulton, ny</td><td> - </td><td>Find all messages 
containing william in the Fulton county, New York forum</td></tr>
      </table>
    </description>
+ 
    <form name="genforumf"
          method="get"
***************
*** 51,103 ****
      <input type="hidden" name="boolean" value="AND" />
    </form>
  
    <script src="addons/genealogy/genealogy_lib.js"></script>
    <script><![CDATA[
!     function genforum(q)
      {
!       if( nullArgs("genforum", q) )
          return;
  
!       var args = parseArgs(q, "all, forum, search");
!       var search_type = "forum";
!       if (args != null) {
!       if (args.switches.length == 1 ) {
!             switch( args.switches[0].name )
!             {
!                 case "all":
!                       search_type = "all";
!                       break;
!                 case "forum":
!                       search_type = "search";
!                       break;
!                 default:
!                       search_type = "forum";
!                       break;
!             }
!         } else if (args.switches.length > 1) {
!               nullArgs("genforum", "?");
!               return;
        }
!       }
!       if (search_type == "all") {
!               document.genforumallf.terms.value = args.q;
!               submitForm(genforumallf);
!       } else if (search_type == "search") {
!               var forum_name = args.switch_val["forum"].toLowerCase();
!               if (forum_name == null || forum_name == "") {
!                       nullArgs("genforum", "?");
!                       return;
                }
!               document.genforumsearchf.forum.value = forum_name;
!               document.genforumsearchf.url.value = "/" + forum_name + "/";
!               document.genforumsearchf.path.value = "/" + forum_name + "/";
!               document.genforumsearchf.terms.value = args.q;
!               submitForm(genforumsearchf);
!       } else {
!               document.genforumf.find.value = args.q;
!               submitForm(genforumf);
        }
-       return;
- 
      }
    ]]></script>
--- 45,114 ----
      <input type="hidden" name="boolean" value="AND" />
    </form>
+   <form name="genforumjumpf"
+         method="get"
+         action="http://genforum.genealogy.com/cgi-bin/jumpto.cgi";>
+     <input type="hidden" name="find" value="" />
+   </form>
  
    <script src="addons/genealogy/genealogy_lib.js"></script>
    <script><![CDATA[
!     function gfm(q)
      {
!       if( nullArgs("gfm", q) )
          return;
  
!       if (!genealogy_check_lib_version("1.7"))
!         return false;
! 
!       var args = genealogy_parseArgs(q, "find, place, surname, search, query");
!       if (genealogy_hasArg(args, "find")) {
!         // find the forum
!         var query = args.switch_val["find"];
!         if (genealogy_hasArg(args, "query")) {
!           query = args.switch_val["query"];
!         }
!         if (query == "") {
!           query = args.q;
!         } 
!       document.genforumf.find.value = query;
!       submitForm(genforumf);
!       } else {
!         var query = "";
!       if (genealogy_hasArg(args, "query")) {
!            query = args.switch_val["query"];
        }
!       if (query == "") {
!           query = args.q;
!       }
!         var forum_name = "";
!         if (genealogy_hasArg(args, "place")) {
!           var place_value = args.switch_val["place"].toLowerCase();
!         var state_abbrev = 
genealogy_lookup_place_abbrev(genealogy_parse_place_state(place_value)).toLowerCase();
!         if (state_abbrev != "") {
!               forum_name = state_abbrev;
!               var county = genealogy_parse_place_county(place_value).replace(/\s/g, 
"").toLowerCase();
!               if (county != "") {
!                 forum_name += "/" + county;
                }
!         }
!         } else if (genealogy_hasArg(args, "surname")) {
!           forum_name = args.switch_val["surname"].replace(/\s/g, "").toLowerCase();
!       }
!       if (query == "") {
!          // goto forum
!          var search_url = "http://genforum.genealogy.com/";;
!          if (forum_name != "") {
!            search_url += forum_name+"/";
!          }
!          openSearchWindow(search_url);
!       } else {
!          // search forum
!          document.genforumsearchf.forum.value = forum_name;
!          document.genforumsearchf.url.value = "/" + forum_name + "/";
!          document.genforumsearchf.path.value = "/" + forum_name + "/";
!          document.genforumsearchf.terms.value = query;
!          submitForm(genforumsearchf);
!       }
        }
      }
    ]]></script>




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
DQSD-CVS mailing list
https://lists.sourceforge.net/lists/listinfo/dqsd-cvs
DQSD CVS repository:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dqsd/

Reply via email to