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 3: | Line 3: | ||
<script type='text/javascript'> | <script type='text/javascript'> | ||
mw.loader.using('mediawiki.user',function(){ | mw.loader.using('mediawiki.user',function(){ | ||
var Obj1 = new (function(){ | var Obj1 = new (function(){ | ||
var $timer1, | var $timer1, | ||
Line 13: | Line 11: | ||
currentTime +=incrementTime; | currentTime +=incrementTime; | ||
if(currentTime == 10000){ | if(currentTime == 10000){ | ||
var api = new mw.Api(); | |||
api.get( { | |||
action: 'updatetracker', | |||
user: mw.user.getName(), | |||
activity: window.location.pathname.substring(11,window.location.pathname.length), | |||
} ).done ( function ( data ) { | |||
console.log( data ); | |||
} ); | |||
currentTime = 0; | currentTime = 0; | ||
} | } |