Widget:TimerTest2: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
Line 4: | Line 4: | ||
mw.loader.using('mediawiki.user',function(){ | mw.loader.using('mediawiki.user',function(){ | ||
if($.inArray("CMEUser", mw.config.get( 'wgUserGroups' )) != "-1"){ | if($.inArray("CMEUser", mw.config.get( 'wgUserGroups' )) != "-1"){ | ||
window.Timer1 = $.timer(function() { | |||
var api = new mw.Api(); | |||
api.get( { | |||
action: 'updatetracker', | |||
user: mw.user.getName(), | |||
activity: window.location.pathname.substring(11,window.location.pathname.length), | |||
} ) | |||
}); | |||
window.Timer2 = $.timer(function() { | |||
window.Timer1.pause(); | |||
alert('paused'); | |||
}); | |||
Timer1.set({ time : 5000, autostart : true }); | |||
Timer2.set({ time : 5000, autostart : true }); | |||
$(document).keypress(function(){window.Obj2.resetTimer();}); | $(document).keypress(function(){window.Obj2.resetTimer();}); | ||
$(document).click(function(){window.Obj2.resetTimer();}); | $(document).click(function(){window.Obj2.resetTimer();}); |