MediaWiki:MapMenu.js: Difference between revisions

Updated with ids for submenu items so Google Translator works. Fixed linkify URL structure.
mNo edit summary
(Updated with ids for submenu items so Google Translator works. Fixed linkify URL structure.)
Line 46: Line 46:
       "[[Namibia Genealogy|Namibia]]",
       "[[Namibia Genealogy|Namibia]]",
       "[[Niger Genealogy|Niger]]",
       "[[Niger Genealogy|Niger]]",
       "<span class=\"fakelink menulink\">Nigeria</span>",
       "<span class=\"fakelink menulink\" id=\"Nigeria\">Nigeria</span>",
       "[[Reunion Island, France Genealogy|Réunion Island]]",
       "[[Reunion Island, France Genealogy|Réunion Island]]",
       "[[Rwanda Genealogy|Rwanda]]",
       "[[Rwanda Genealogy|Rwanda]]",
Line 55: Line 55:
       "[[Sierra Leone Genealogy|Sierra Leone]]",
       "[[Sierra Leone Genealogy|Sierra Leone]]",
       "[[Somalia Genealogy|Somalia]]",
       "[[Somalia Genealogy|Somalia]]",
       "<span class=\"fakelink menulink\">South Africa</span>",
       "<span class=\"fakelink menulink\" id=\"South Africa\">South Africa</span>",
       "[[South Sudan Genealogy|South Sudan]]",
       "[[South Sudan Genealogy|South Sudan]]",
       "[[Sudan Genealogy|Sudan]]",
       "[[Sudan Genealogy|Sudan]]",
Line 102: Line 102:
       "[[Pakistan Genealogy|Pakistan]]",
       "[[Pakistan Genealogy|Pakistan]]",
       "[[State of Palestine Genealogy|Palestine]]",
       "[[State of Palestine Genealogy|Palestine]]",
       "<span class=\"fakelink menulink\">Philippines</span>",
       "<span class=\"fakelink menulink\" id=\"Philippines\">Philippines</span>",
       "[[Qatar Genealogy|Qatar]]",
       "[[Qatar Genealogy|Qatar]]",
       "[[Saudi Arabia Genealogy|Saudi Arabia]]",
       "[[Saudi Arabia Genealogy|Saudi Arabia]]",
Line 127: Line 127:
       "[[Andorra Genealogy|Andorra]]",
       "[[Andorra Genealogy|Andorra]]",
       "[[Armenia Genealogy|Armenia]]",
       "[[Armenia Genealogy|Armenia]]",
       "<span class=\"fakelink menulink\">Austria</span>",
       "<span class=\"fakelink menulink\" id=\"Austria\">Austria</span>",
       "[[Azerbaijan Genealogy|Azerbaijan]]",
       "[[Azerbaijan Genealogy|Azerbaijan]]",
       "[[Belarus Genealogy|Belarus]]",
       "[[Belarus Genealogy|Belarus]]",
       "<span class=\"fakelink menulink\">Belgium</span>",
       "<span class=\"fakelink menulink\" id=\"Belgium\">Belgium</span>",
       "[[Bosnia and Herzegovina Genealogy|Bosnia & Herzegovina]]",
       "[[Bosnia and Herzegovina Genealogy|Bosnia & Herzegovina]]",
       "[[Bulgaria Genealogy|Bulgaria]]",
       "[[Bulgaria Genealogy|Bulgaria]]",
Line 137: Line 137:
       "[[Cyprus Genealogy|Cyprus]]",
       "[[Cyprus Genealogy|Cyprus]]",
       "[[Czech Republic Genealogy|Czech Republic]]",
       "[[Czech Republic Genealogy|Czech Republic]]",
       "<span class=\"fakelink menulink\">Denmark</span>",
       "<span class=\"fakelink menulink\" id=\"Denmark\">Denmark</span>",
       "<span class=\"fakelink menulink\">England</span>",
       "<span class=\"fakelink menulink\" id=\"England\">England</span>",
       "[[Estonia Genealogy|Estonia]]",
       "[[Estonia Genealogy|Estonia]]",
       "[[Faroe Islands Genealogy|Faroe Islands]]",
       "[[Faroe Islands Genealogy|Faroe Islands]]",
       "<span class=\"fakelink menulink\">Finland</span>",
       "<span class=\"fakelink menulink\" id=\"Finland\">Finland</span>",
       "<span class=\"fakelink menulink\">France</span>",
       "<span class=\"fakelink menulink\" id=\"France\">France</span>",
       "[[Georgia (country) Genealogy|Georgia]]",
       "[[Georgia (country) Genealogy|Georgia]]",
       "<span class=\"fakelink menulink\">German Empire</span>",
       "<span class=\"fakelink menulink\" id=\"German Empire\">German Empire</span>",
       "<span class=\"fakelink menulink\">Germany</span>",
       "<span class=\"fakelink menulink\" id=\"Germany\">Germany</span>",
       "[[Gibraltar Genealogy|Gibraltar]]",
       "[[Gibraltar Genealogy|Gibraltar]]",
       "[[Greece Genealogy|Greece]]",
       "[[Greece Genealogy|Greece]]",
       "<span class=\"fakelink menulink\">Hungary</span>",
       "<span class=\"fakelink menulink\" id=\"Hungary\">Hungary</span>",
       "[[Iceland Genealogy|Iceland]]",
       "[[Iceland Genealogy|Iceland]]",
       "<span class=\"fakelink menulink\">Isle of Man</span>",
       "<span class=\"fakelink menulink\" id=\"Isle of Man\">Isle of Man</span>",
       "<span class=\"fakelink menulink\">Ireland</span>",
       "<span class=\"fakelink menulink\" id=\"Ireland\">Ireland</span>",
       "<span class=\"fakelink menulink\">Italy</span>",
       "<span class=\"fakelink menulink\" id=\"Italy\">Italy</span>",
       "[[Jersey Genealogy|Jersey]]",
       "[[Jersey Genealogy|Jersey]]",
       "[[Kosovo Genealogy|Kosovo]]",
       "[[Kosovo Genealogy|Kosovo]]",
       "[[Kyrgyzstan Genealogy|Kyrgyzstan]]",
       "[[Kyrgyzstan Genealogy|Kyrgyzstan]]",
       "[[Latvia Genealogy|Latvia]]",
       "[[Latvia Genealogy|Latvia]]",
       "<span class=\"fakelink menulink\">Liechtenstein</span>",
       "<span class=\"fakelink menulink\" id=\"Liechtenstein\">Liechtenstein</span>",
       "[[Lithuania Genealogy|Lithuania]]",
       "[[Lithuania Genealogy|Lithuania]]",
       "<span class=\"fakelink menulink\">Luxembourg</span>",
       "<span class=\"fakelink menulink\" id=\"Luxembourg\">Luxembourg</span>",
       "[[Malta Genealogy|Malta]]",
       "[[Malta Genealogy|Malta]]",
       "[[Moldova Genealogy|Moldova]]",
       "[[Moldova Genealogy|Moldova]]",
       "[[Monaco Genealogy|Monaco]]",
       "[[Monaco Genealogy|Monaco]]",
       "[[Montenegro Genealogy|Montenegro]]",
       "[[Montenegro Genealogy|Montenegro]]",
       "<span class=\"fakelink menulink\">Netherlands</span>",
       "<span class=\"fakelink menulink\" id=\"Netherlands\">Netherlands</span>",
       "[[North Macedonia Genealogy|North Macedonia]]",
       "[[North Macedonia Genealogy|North Macedonia]]",
       "<span class=\"fakelink menulink\">Northern Ireland</span>",
       "<span class=\"fakelink menulink\" id=\"Northern Ireland\">Northern Ireland</span>",
       "<span class=\"fakelink menulink\">Norway</span>",
       "<span class=\"fakelink menulink\" id=\"Norway\">Norway</span>",
       "<span class=\"fakelink menulink\">Poland</span>",
       "<span class=\"fakelink menulink\" id=\"Poland\">Poland</span>",
       "<span class=\"fakelink menulink\">Portugal</span>",
       "<span class=\"fakelink menulink\" id=\"Portugal\">Portugal</span>",
       "[[Romania Genealogy|Romania]]",
       "[[Romania Genealogy|Romania]]",
       "[[Russia Genealogy|Russia]]",
       "[[Russia Genealogy|Russia]]",
       "[[San Marino Genealogy|San Marino]]",
       "[[San Marino Genealogy|San Marino]]",
       "<span class=\"fakelink menulink\">Scotland</span>",
       "<span class=\"fakelink menulink\" id=\"Scotland\">Scotland</span>",
       "[[Serbia Genealogy|Serbia]]",
       "[[Serbia Genealogy|Serbia]]",
       "<span class=\"fakelink menulink\">Slovakia</span>",
       "<span class=\"fakelink menulink\" id=\"Slovakia\">Slovakia</span>",
       "[[Slovenia Genealogy|Slovenia]]",
       "[[Slovenia Genealogy|Slovenia]]",
       "<span class=\"fakelink menulink\">Spain</span>",
       "<span class=\"fakelink menulink\" id=\"Spain\">Spain</span>",
       "<span class=\"fakelink menulink\">Sweden</span>",
       "<span class=\"fakelink menulink\" id=\"Sweden\">Sweden</span>",
       "<span class=\"fakelink menulink\">Switzerland</span>",
       "<span class=\"fakelink menulink\" id=\"Switzerland\">Switzerland</span>",
       "[[Ukraine Genealogy|Ukraine]]",
       "[[Ukraine Genealogy|Ukraine]]",
       "<span class=\"fakelink menulink\">Wales</span>",
       "<span class=\"fakelink menulink\" id=\"Wales\">Wales</span>",
       "[[Vatican City Genealogy|Vatican City]]"
       "[[Vatican City Genealogy|Vatican City]]"
     ]
     ]
Line 198: Line 198:
       "[[Bonaire Genealogy|Bonaire]]",
       "[[Bonaire Genealogy|Bonaire]]",
       "[[British Virgin Islands Genealogy|British Virgin Islands]]",
       "[[British Virgin Islands Genealogy|British Virgin Islands]]",
       "<span class=\"fakelink menulink\">Canada</span>",
       "<span class=\"fakelink menulink\" id=\"Canada\">Canada</span>",
       "[[Cayman Islands Genealogy|Cayman Islands]]",
       "[[Cayman Islands Genealogy|Cayman Islands]]",
       "<span class=\"fakelink menulink\">Costa Rica</span>",
       "<span class=\"fakelink menulink\" id=\"Costa Rica\">Costa Rica</span>",
       "[[Cuba Genealogy|Cuba]]",
       "[[Cuba Genealogy|Cuba]]",
       "[[Curaçao Genealogy|Curaçao]]",
       "[[Curaçao Genealogy|Curaçao]]",
       "[[Dominica Genealogy|Dominica]]",
       "[[Dominica Genealogy|Dominica]]",
       "<span class=\"fakelink menulink\">Dominican Republic</span>",
       "<span class=\"fakelink menulink\" id=\"Dominican Republic\">Dominican Republic</span>",
       "[[El Salvador Genealogy|El Salvador]]",
       "[[El Salvador Genealogy|El Salvador]]",
       "[[Greenland Genealogy|Greenland]] ",
       "[[Greenland Genealogy|Greenland]] ",
       "[[Grenada Genealogy|Grenada]]",
       "[[Grenada Genealogy|Grenada]]",
       "[[Guadeloupe Genealogy|Guadeloupe]]",
       "[[Guadeloupe Genealogy|Guadeloupe]]",
       "<span class=\"fakelink menulink\">Guatemala</span>",
       "<span class=\"fakelink menulink\" id=\"Guatemala\">Guatemala</span>",
       "[[Haiti Genealogy|Haiti]]",
       "[[Haiti Genealogy|Haiti]]",
       "<span class=\"fakelink menulink\">Honduras</span>",
       "<span class=\"fakelink menulink\" id=\"Honduras\">Honduras</span>",
       "[[Jamaica Genealogy|Jamaica]]",
       "[[Jamaica Genealogy|Jamaica]]",
       "[[Martinique Genealogy|Martinique]]",
       "[[Martinique Genealogy|Martinique]]",
       "<span class=\"fakelink menulink\">Mexico</span>",
       "<span class=\"fakelink menulink\" id=\"Mexico\">Mexico</span>",
       "<span class=\"fakelink menulink\">Montserrat</span>",
       "<span class=\"fakelink menulink\" id=\"Montserrat\">Montserrat</span>",
       "<span class=\"fakelink menulink\">Netherlands Antilles</span>",
       "<span class=\"fakelink menulink\" id=\"Netherlands Antilles\">Netherlands Antilles</span>",
       "[[Nicaragua Genealogy|Nicaragua]]",
       "[[Nicaragua Genealogy|Nicaragua]]",
       "<span class=\"fakelink menulink\">Panama</span>",
       "<span class=\"fakelink menulink\" id=\"Panama\">Panama</span>",
       "<span class=\"fakelink menulink\">Puerto Rico</span>",
       "<span class=\"fakelink menulink\" id=\"Puerto Rico\">Puerto Rico</span>",
       "[[Saba Genealogy|Saba]]",
       "[[Saba Genealogy|Saba]]",
       "[[Saint Barthelemy Genealogy|Saint Barthelemy]]",
       "[[Saint Barthelemy Genealogy|Saint Barthelemy]]",
       "<span class=\"fakelink menulink\">Saint Kitts & Nevis</span>",
       "<span class=\"fakelink menulink\" id=\"Saint Kitts \">Saint Kitts </span>",
       "[[Saint Lucia Genealogy|Saint Lucia]]",
       "[[Saint Lucia Genealogy|Saint Lucia]]",
       "[[Saint Martin Island]]",
       "[[Saint Martin Island]]",
Line 232: Line 232:
       "[[Trinidad and Tobago Genealogy|Trinidad & Tobago]]",
       "[[Trinidad and Tobago Genealogy|Trinidad & Tobago]]",
       "[[Turks and Caicos Islands Genealogy|Turks & Caicos Islands]]",
       "[[Turks and Caicos Islands Genealogy|Turks & Caicos Islands]]",
       "<span class=\"fakelink menulink\">United States</span>",
       "<span class=\"fakelink menulink\" id=\"United States\">United States</span>",
       "[[U.S. Virgin Islands Genealogy|U.S. Virgin Islands]]"
       "[[U.S. Virgin Islands Genealogy|U.S. Virgin Islands]]"
     ]
     ]
Line 241: Line 241:
     "list": [
     "list": [
       "[[American Samoa Genealogy|American Samoa]]",
       "[[American Samoa Genealogy|American Samoa]]",
       "<span class=\"fakelink menulink\">Australia</span>",
       "<span class=\"fakelink menulink\" id=\"Australia\">Australia</span>",
       "[[Christmas Island, Australia Genealogy|Christmas Island]]",
       "[[Christmas Island, Australia Genealogy|Christmas Island]]",
       "[[Cocos (Keeling) Islands Genealogy|Cocos Islands]]",
       "[[Cocos (Keeling) Islands Genealogy|Cocos Islands]]",
Line 248: Line 248:
       "[[Federated States of Micronesia Genealogy|Micronesia]]",
       "[[Federated States of Micronesia Genealogy|Micronesia]]",
       "[[Fiji Genealogy|Fiji]]",
       "[[Fiji Genealogy|Fiji]]",
       "<span class=\"fakelink menulink\">French Polynesia</span>",
       "<span class=\"fakelink menulink\" id=\"French Polynesia\">French Polynesia</span>",
       "[[Guam Genealogy|Guam]]",
       "[[Guam Genealogy|Guam]]",
       "[[Kiribati Genealogy|Kiribati]]",
       "[[Kiribati Genealogy|Kiribati]]",
Line 275: Line 275:
     "title": "South America",
     "title": "South America",
     "list": [
     "list": [
       "<span class=\"fakelink menulink\">Argentina</span>",
       "<span class=\"fakelink menulink\" id=\"Argentina\">Argentina</span>",
       "<span class=\"fakelink menulink\">Bolivia</span>",
       "<span class=\"fakelink menulink\" id=\"Bolivia\">Bolivia</span>",
       "<span class=\"fakelink menulink\">Brazil</span>",
       "<span class=\"fakelink menulink\" id=\"Brazil\">Brazil</span>",
       "<span class=\"fakelink menulink\">Chile</span>",
       "<span class=\"fakelink menulink\" id=\"Chile\">Chile</span>",
       "[[Colombia Genealogy|Colombia]]",
       "[[Colombia Genealogy|Colombia]]",
       "[[Ecuador Genealogy|Ecuador]]",
       "[[Ecuador Genealogy|Ecuador]]",
Line 284: Line 284:
       "[[French Guiana, France Genealogy|French Guiana]]",
       "[[French Guiana, France Genealogy|French Guiana]]",
       "[[Guyana Genealogy|Guyana]]",
       "[[Guyana Genealogy|Guyana]]",
       "<span class=\"fakelink menulink\">Paraguay</span>",
       "<span class=\"fakelink menulink\" id=\"Paraguay\">Paraguay</span>",
       "<span class=\"fakelink menulink\">Peru</span>",
       "<span class=\"fakelink menulink\" id=\"Peru\">Peru</span>",
       "[[Suriname Genealogy|Suriname]]",
       "[[Suriname Genealogy|Suriname]]",
       "<span class=\"fakelink menulink\">Uruguay</span>",
       "<span class=\"fakelink menulink\" id=\"Uruguay\">Uruguay</span>",
       "<span class=\"fakelink menulink\">Venezuela</span>"
       "<span class=\"fakelink menulink\" id=\"Venezuela\">Venezuela</span>",
     ]
     ]
   },
   },
Line 1,971: Line 1,971:
  */
  */
function linkify(str) {
function linkify(str) {
     // e.g. "https://beta.familysearch.org/wiki/en/";
     // e.g. "https://beta.familysearch.org/en/wiki/";
     const lang = mw.config.get('wgContentLanguage');
     const lang = mw.config.get('wgContentLanguage');
     const base = document.location.origin + '/wiki/' + lang + '/';
     const base = document.location.origin + '/' + lang + '/wiki/';
     var n = str.indexOf('[');
     var n = str.indexOf('[');
     // indexOf returns -1 if not found
     // indexOf returns -1 if not found