"मीडियाविकि:Geonotice.js" इत्यस्य संस्करणे भेदः
Content deleted Content added
updated DC text |
per talk |
||
पङ्क्तिः ६३: | पङ्क्तिः ६३: | ||
insertsub = document.getElementById('contentSub'); |
insertsub = document.getElementById('contentSub'); |
||
insertsub.innerHTML += '<div class="plainlinks" id="geonotice'+id+'" style="width:98%; margin:5px auto 0; background:transparent; text-align:right |
insertsub.innerHTML += '<div class="plainlinks" id="geonotice'+id+'" style="width:98%; margin:5px auto 0; background:transparent; font-size:1.5em; text-align:right;">'+notice.text+'<br/><i>[<a href="#" onClick="var date = new Date(); date.setTime(date.getTime()+8640000000);document.cookie = \'hidegeonotice'+id+'=1; expires=\' + date.toGMTString() + \'; path=/\';document.getElementById(\'geonotice'+id+'\').style.visibility = \'hidden\';return false">hide</a>]</i></div>'; |
||
} |
} |
१५:४१, ११ डिसेम्बर् २००९ इत्यस्य संस्करणं
var notices = {
NYCmail:
{ begin: '16 November 2009 00:00 UTC',
corners: [ [42,-76], [40,-72] ],
text: 'You are invited to join the <a href="https://lists.wikimedia.org/mailman/listinfo/wikimedia_nyc">Wikimedia New York City area mailing list</a>!'
},
PAmail:
{ begin: '16 November 2009 00:00 UTC',
corners: [ [40.5,-77], [39.5,-73] ],
text: 'You are invited to join the <a href="https://lists.wikimedia.org/mailman/listinfo/wikimediapa-l">Philadelphia area and Pennsylvania mailing list</a>!'
},
DCjan:
{ begin: '7 December 2009 00:00 UTC',
corners: [ [39.7,-79], [37,-75.5] ],
text: 'You\'re invited to the next <a href="http://en.wikipedia.org/wiki/Wikipedia:Meetup/DC_9" title="Wikipedia:Meetup/DC 9">Washington, D.C. Wikipedia meetup</a> on Saturday, January 9.'
},
FLplan:
{ begin: '7 December 2009 00:00 UTC',
corners: [ [27,-82], [25,-80] ],
text: 'If you would be interested in attending a <a href="http://en.wikipedia.org/wiki/Wikipedia:Meetup/Miami_3">Miami area meetup</a> stop by and leave a comment.'
}
/*******************************************
* End of list.
* Edit only above!
*
* Format is:
*
* ID:
* { begin: 'date',
* corners: [ [lat,lon], [lat,lon] ],
* text: 'message'
* }
*
* There should be a commas between the notices, but not after the last one.
*
*******************************************/
}
if (typeof(geoip) != 'undefined') {
var now = new Date();
for (var id in notices) {
if (!document.cookie.match('hidegeonotice'+id+'=1')) {
var notice = notices[id];
var minlat = Math.min(notice.corners[0][0], notice.corners[1][0]);
var maxlat = Math.max(notice.corners[0][0], notice.corners[1][0]);
var minlon = Math.min(notice.corners[0][1], notice.corners[1][1]);
var maxlon = Math.max(notice.corners[0][1], notice.corners[1][1]);
if ( now.getTime() > Date.parse(notice.begin)
&& minlat<geoip.latitude && geoip.latitude<maxlat
&& minlon<geoip.longitude && geoip.longitude<maxlon
) {
insertsub = document.getElementById('contentSub');
insertsub.innerHTML += '<div class="plainlinks" id="geonotice'+id+'" style="width:98%; margin:5px auto 0; background:transparent; font-size:1.5em; text-align:right;">'+notice.text+'<br/><i>[<a href="#" onClick="var date = new Date(); date.setTime(date.getTime()+8640000000);document.cookie = \'hidegeonotice'+id+'=1; expires=\' + date.toGMTString() + \'; path=/\';document.getElementById(\'geonotice'+id+'\').style.visibility = \'hidden\';return false">hide</a>]</i></div>';
}
}
}
}