मीडियाविकि:Geonotice.js
सूचना : भवता/भवत्या कृतानि सम्पादनानि संरक्ष्य तानि परिवर्तनेषु द्रष्टुं गवेषकस्य पृष्ठस्य पुनरारोपणम् (reload) आवश्यकं भवति ।
- Firefox / Safari: Shiftकुड्मलेन सह Reloadकुड्मलं नुदतु ।
- Google Chrome: Ctrl-Shift-R नोदनेन पुनरारोपणं भवति । (⌘-R इति Mac तन्त्रांशप्रयोक्तॄभ्यः)
- Internet Explorer: Ctrlकुड्मलेन सह Refreshकुड्मलं नुदतु, Ctrl-F5 नुदतु वा ।
- Opera: Tools → Preferences इत्यत्र गत्वा कर्तुं शक्नोति ।
var notices = {
AmbassadorsAppleton:
{
begin : '4 March 2012 00:00 UTC',
end: '4 April 2012 00:00 UTC',
corners: [ [44.05,-88.20], [44.45,-88.60] ],
text: 'Wikipedians of Appleton: Are you interested in guiding students through their first 100 edits? <a href="' + mw.util.getUrl( 'Special:EmailUser/Bob the Wikipedian') + '">Contact us</a> if you are interested in becoming a campus ambassador.'
},
AmbassadorsHillsdale:
{
begin : '4 March 2012 00:00 UTC',
end: '4 April 2012 00:00 UTC',
corners: [ [41.72,-84.42], [42.12,-84.82] ],
text: 'Wikipedians of Hillsdale: Are you interested in guiding students through their first 100 edits? <a href="' + mw.util.getUrl( 'Special:EmailUser/Bob the Wikipedian') + '">Contact us</a> if you are interested in becoming a campus ambassador.'
},
AmbassadorsDanville:
{
begin : '4 March 2012 00:00 UTC',
end: '4 April 2012 00:00 UTC',
corners: [ [37.43,-84.57], [37.83,-84.97] ],
text: 'Wikipedians of Danville: Are you interested in guiding students through their first 100 edits? <a href="' + mw.util.getUrl( 'Special:EmailUser/Bob the Wikipedian') + '">Contact us</a> if you are interested in becoming a campus ambassador.'
},
AmbassadorsGreenBay:
{
begin : '4 March 2012 00:00 UTC',
end: '4 April 2012 00:00 UTC',
corners: [ [44.30,-88.20], [44.70,-87.80] ],
text: 'Wikipedians of Green Bay: Are you interested in guiding students through their first 100 edits? <a href="' + mw.util.getUrl( 'Special:EmailUser/Bob the Wikipedian') + '">Contact us</a> if you are interested in becoming a campus ambassador.'
},
AmbassadorsLouisville:
{
begin : '4 March 2012 00:00 UTC',
end: '4 April 2012 00:00 UTC',
corners: [ [38.05,-85.97], [38.45,-85.57] ],
text: 'Wikipedians of Louisville: Are you interested in guiding students through their first 100 edits? <a href="' + mw.util.getUrl( 'Special:EmailUser/Bob the Wikipedian') + '">Contact us</a> if you are interested in becoming a campus ambassador.'
},
AmbassadorsDetroit:
{
begin : '4 March 2012 00:00 UTC',
end: '4 April 2012 00:00 UTC',
corners: [ [42.12,-83.23], [42.52,-82.83] ],
text: 'Wikipedians of Detroit: Are you interested in guiding students through their first 100 edits? <a href="' + mw.util.getUrl( 'Special:EmailUser/Bob the Wikipedian') + '">Contact us</a> if you are interested in becoming a campus ambassador.'
},
RegionalHawaii:
{
begin: '18 February 2011 00:00 UTC',
end: '18 March 2012 00:00 UTC',
corners:[ [29, -179], [18, -154] ],
text: 'Are you interested in encouraging more university professors to use Wikipedia as a teaching tool? Do you enjoy leading, coordinating, and organizing teams? If so, we want you! We are now recruiting for Wikipedia Regional Ambassadors to the multiple regions of the U.S. [[:outreach:Regional_Ambassadors/Apply|Click here for more details.]]'
},
RegionalAlaska:
{
begin: '18 February 2011 00:00 UTC',
end: '18 March 2012 00:00 UTC',
corners:[ [71.833, -188], [51.33, -130] ],
text: 'Are you interested in encouraging more university professors to use Wikipedia as a teaching tool? Do you enjoy leading, coordinating, and organizing teams? If so, we want you! We are now recruiting for Wikipedia Regional Ambassadors to the multiple regions of the U.S. [[:outreach:Regional_Ambassadors/Apply|Click here for more details.]]'
},
RegionalContiguous:
{
begin: '18 February 2011 00:00 UTC',
end: '18 March 2012 00:00 UTC',
corners:[ [49, -124.5], [24.2, -75.05] ],
text: 'Are you interested in encouraging more university professors to use Wikipedia as a teaching tool? Do you enjoy leading, coordinating, and organizing teams? If so, we want you! We are now recruiting for Wikipedia Regional Ambassadors to the multiple regions of the U.S. [[:outreach:Regional_Ambassadors/Apply|Click here for more details.]]'
},
Bangalore:
{ begin : '1 March 2012 00:00 UTC',
end : '11 March 2012 11:00 UTC',
corners : [ [12.77,77.36],[13.12,77.76] ],
text : 'Come along and catch up with fellow Wikimedians at the 43rd <a href="http://wiki.wikimedia.in/WikiMeetups/Bangalore/Bangalore43">Bangalore Wikimeetup</a> on Sunday 11th March at 3 pm.'
},
Coimbatore:
{ begin : '1 March 2012 00:00 UTC',
end : '10 March 2012 11:00 UTC',
corners : [ [10.51,76.57],[11.06,77.47] ],
text : 'Come along and catch up with fellow Wikimedians at the 3rd [[Meta:Meetup/Coimbatore/Coimbatore3|Coimbatore Meetup]] on Saturday 10th March at 11 am.'
},
Delhi:
{ begin : '1 March 2012 00:00 UTC',
end : '11 March 2012 11:00 UTC',
corners : [ [28.42,77.006],[28.771,77.38] ],
text : 'Come along and catch up with fellow Wikimedians at the 7th [[Wikipedia:Meetup/Delhi/Delhi7|Delhi Meetup]] on Sunday 11th March at 3 pm.'
},
UKMarchAprilMeetups:
{
begin: '25 February 2012 23:40 UTC',
end: '28 April 2012 15:00 UTC',
corners:[ [60,-9], [50.2, 1.3] ],
text: 'Interested in having a chat with fellow Wikipedians over lunch or a drink? There are upcoming meetups in [[m:Meetup/London/55|London, 11 March]]; [[m:Meetup/Liverpool 3|Liverpool, 24 March]]; [[m:Meetup/Monmouth/1|Monmouth, 21 April]]; and [[m:Meetup/Manchester/12|Manchester, 28 April]]!'
},
HistoricCoventry:
{
begin: '1 March 2012 18:09 UTC',
end: '31 March 2012 12:00 UTC',
corners:[ [60,-9], [50.2, 1.3] ],
text: 'An editathon will be held at the [[m:w:en:Herbert Art Gallery and Museum|Herbert Art Gallery and Museum]], Coventry, on 31 March, with museum staff on-hand to assist. Places are limited, so [[wmuk:Coventry History Editathon|sign up]] soon!'
}
/*******************************************
* End of list.
* Edit only above!
*tt
* Format is:
*
* ID:
* { begin: 'date',
* end: 'date',
* corners: [ [lat,lon], [lat,lon] ],
* text: 'message'
* }
*
* There should be commas between the notices, but not after the last one.
* Use [[meta:w:en:link|link]] format for internal links, so that they work properly on the other projects where the geonotice is displayed.
*
*******************************************/
};
mw.loader.using(['mediawiki.util']).then(function() {
function geoWikiLinker (str, page, text) {
text = text || page;
return mw.html.element(
'a', {
href: mw.util.getUrl( page ),
title: page
}, text
);
}
if ( Geo !== undefined ) {
var now = new Date(),
id, notice, insertsub, minlat, maxlat, minlon, maxlon,
regexForInternalLinks = /\[\[([^{|}\[\]\n]+)(?:\|(.*?))?\]\]/g;
for (id in notices) {
if (!document.cookie.match('hidegeonotice'+id+'=1')) {
notice = notices[id];
if (!notice || !notice.corners) {
continue;
}
minlat = Math.min(notice.corners[0][0], notice.corners[1][0]);
maxlat = Math.max(notice.corners[0][0], notice.corners[1][0]);
minlon = Math.min(notice.corners[0][1], notice.corners[1][1]);
maxlon = Math.max(notice.corners[0][1], notice.corners[1][1]);
if ( now.getTime() > Date.parse(notice.begin)
&& now.getTime() < Date.parse(notice.end)
&& minlat<Geo.lat && Geo.lat<maxlat
&& minlon<Geo.lon && Geo.lon<maxlon
) {
insertsub = document.getElementById('contentSub');
mw.util.addCSS( [
'#contentSub .geonotice {',
'width:98%;',
'margin:5px auto 0;',
'background:transparent;',
'text-align:left;',
'line-height:1.8em;',
'}',
'#contentSub .geonotice span {',
'font-size:170%;',
'}',
'#contentSub .geonotice small {',
'font-style:italic;',
'}'
].join( ' ' ) );
insertsub.innerHTML +=
'<div class="geonotice plainlinks" id="geonotice'+id+'">'+
'<span>'+notice.text.replace( regexForInternalLinks, geoWikiLinker )+'</span> '+
'<small>['+
'<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>'+
']</small></div>';
}
}
}
}
});