מדיה ויקי:Common.js/coords.js
הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.
- פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
- גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
- אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
- אופרה: ללחוץ על Ctrl-F5.
function coords() {
function p(x,y) {
var ar = ['coord', y, x, 'display=title', 'type:landmark'];
prompt('העתק את תוכן השורה והדבק בדף', '{{' + ar.join('|') + '}}');
}
if (/google.*maps/i.test(location.href))
return GEvent.addListener(gApplication.getMap(), "singlerightclick",
function(point, element, overlay) {
latlng = this.fromContainerPixelToLatLng(point);
p(latlng.lng(), latlng.lat());
});
if (/amudanan/i.test(location.href)) {
$("#selectCoordinateSystem").val("WGS84LL");
$("#divMap").mousedown(
function(e){
if(e.which>1)
p($("#lblLat").html(), $("#lblLon").html())
});
}
}
(function ()
{
if (typeof(jQuery)!="undefined")
{window.$ = jQuery;coords();return;}
var s=document.createElement('script');
s.setAttribute('src',"https://he.wikipedia.org/w/load.php?modules=jquery&only=scripts");
s.onload=coords;
document.getElementsByTagName('body')[0].appendChild(s);
})();