User:DarkStarHarry/common.js

importScript('User:Writ_Keeper/Scripts/commonHistory.js'); //importScript('User:Lupin/popups.js'); //var book_source_URL = "http://www.amazon.com/gp/search?ie=UTF8&field-isbn=MAGICNUMBER&tag=wikipedia08-20"; //importScript('User:DarkStarHarry/externISBN.js'); importScript('User:DarkStarHarry/externMapCoords.js'); importScript('User:Ohconfucius/dashes.js'); //importScript('User:DarkStarHarry/replaceGeoHack.js'); /*function replaceGeoHack{ var coord_filter = /&params=([\d.+-]+)_([\d.+-]*)_?([\d.+-]*)_?([NS])_([\d.+-]+)_([\d.+-]*)_?([\d.+-]*)_?([EOW])(\b[^&]*)/; var existingMap = "http://stable.toolserver.org/geohack/geohack.php"; var newMap = "http://maps.google.com/maps?ll={lat},{long}"; var lat,lon; var links = document.getElementsByTagName('A'); var RawRegex = /[0-9_-.NEWS]{6,}/ var link; for(var i=0; (link=links[i]); i++){ var j = link.href.indexOf(existingMap) if(link.href.indexOf(existingMap) == 0 ) { // && var matches = RawRegex.exec(link.href); var first = matches[0]; lat=(1.0*RegExp.$1) + ((RegExp.$2||0)/60.0) + ((RegExp.$3||0)/3600.0); if(RegExp.$4=='S') lat*=-1; lon=(1.0*RegExp.$5) + ((RegExp.$6||0)/60.0) + ((RegExp.$7||0)/3600.0); if(RegExp.$8=='W') lon*=-1; link.href=newMap.replace('{lat}', lat).replace('{long}', lon); }	} } $(replaceGeoHack);