diff options
Diffstat (limited to 'content/js/subject.js')
-rwxr-xr-x | content/js/subject.js | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/content/js/subject.js b/content/js/subject.js index e0e8fa2..c670d79 100755 --- a/content/js/subject.js +++ b/content/js/subject.js @@ -1,9 +1,9 @@ $(document).ready( function(){ - var k = Karma(assetList); + var k = Karma(); - k.ready(function() { - logos; + k.ready(function() { + activities; k.ready(function(){ @@ -50,18 +50,21 @@ $(document).ready( y = $e.pageY; $.each(acts, function() { xy = this; - // here we need to download - if ( (x > xy[1]) && (x < xy[1] + cellsize) && (y < xy[2]) && (y > xy[2] - cellsize) ) { - // find out if year is 2010 or 2011 - if (xy[5] == 'cyan') { - $('#content').load( + // here we need to download or go to activity + if ( (x > xy[1]) && (x < xy[1] + cellsize) && (y < xy[2]) + && (y > xy[2] - cellsize) ) { + if (xy[5].indexOf('cyan')>-1) { //download + $('<div id="temp" />').load( 'http://localhost:8008/cgi-bin/fetch_milestone.py', - {'code':xy[2],'milestone':xy[4]}, + {'code':xy[0],'milestone':xy[4]}, function(responseText, status, xhr) { //refresh when done window.onunload=function(){return true;}; window.location.reload(true); }); + }else{ //go to activity + pth = xy[4]+'/index.html'; + window.location = pth+'?F'; }; }; }); @@ -202,22 +205,12 @@ $(document).ready( }; idx = idx + 1; acts[idx] = [il, x, y, ty, ls, cc, id]; - if (id < 2){ - drawmilestone(acts[idx]); - } else { - // draw logo - alert('draw logo - should not happen'); - ctx.drawImage(k.image[logos[id-1]].media, x, y - cellsize); - if (ix > 0) { - ctx.textAlign = 'center' - ctx.fillStyle = 'black' - ctx.fillText(ix, x + cellsize/2, y+cellsize/4, cellsize); - }; - }; + drawmilestone(acts[idx]); }; }; draw(); + }); }); }); |