מדיה ויקי:Gadget-patrolAlarm.js: הבדלים בין גרסאות בדף
ניסיון לפתירת בעיית כיוונית |
מ 38 גרסאות של הדף wikipedia:he:מדיה_ויקי:Gadget-patrolAlarm.js יובאו |
||
| (4 גרסאות ביניים של משתמש אחר אחד אינן מוצגות) | |||
| שורה 4: | שורה 4: | ||
var cookiename = 'patrollers_alarmclock', | var cookiename = 'patrollers_alarmclock', | ||
distressLimit = window.wgPatrolDistressLimit || | distressLimit = window.wgPatrolDistressLimit || 75, | ||
frequency = window.wgPatrolDistressRestSeconds || 120, | frequency = window.wgPatrolDistressRestSeconds || 120, | ||
keys = {distress: 'inDistress', lastTest: 'lastTestedPatrols', lastVisitRC: 'lastVisitRC'}; | keys = {distress: 'inDistress', lastTest: 'lastTestedPatrols', lastVisitRC: 'lastVisitRC'}; | ||
function tsToDate(rc) { | function tsToDate(rc) { | ||
// timestamp looks like so: "2011-05-05T18:56:27Z" | |||
var | var dar = rc.timestamp.split(/[^\d]/) | ||
.map(function(s) { | |||
return parseInt(s, 10); | |||
}); | |||
var month = dar[1] - 1; // "Date" expexts months in the range of 0..11, timestamp is more conventional. | |||
return new Date(dar[0],month,dar[2],dar[3],dar[4],dar[5]); | return new Date(dar[0],month,dar[2],dar[3],dar[4],dar[5]); | ||
} | } | ||
| שורה 58: | שורה 62: | ||
li | li | ||
.css({backgroundColor:'#F9C557', cursor:'pointer'}) | .css({backgroundColor:'#F9C557', cursor:'pointer'}) | ||
.attr({title: "מצוקת ניטור חמורה.\ | .attr({title: "מצוקת ניטור חמורה.\n.כל המצילים מתבקשים לחוף גורדון"}) | ||
.click(function(e){ | .click(function(e){ | ||
if (e.button == 0) | if (e.button == 0) | ||
| שורה 108: | שורה 112: | ||
} | } | ||
if (wgCanonicalSpecialPageName == 'Recentchanges') { // mark cookie with last visit and exit. | if ( mw.config.get( 'wgCanonicalSpecialPageName' ) == 'Recentchanges') { // mark cookie with last visit and exit. | ||
cookieVal(keys.lastVisitRC, new Date().valueOf()); | cookieVal(keys.lastVisitRC, new Date().valueOf()); | ||
distress(false); | distress(false); | ||