1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | OWA.spy = function() { //this.config = OWA.config; return; } OWA.spy.prototype = { properties: new Object, last_start_time: '', last_end_time: 0, init: function(dom_id, url) { jQuery('#'+ dom_id).spy({ 'limit': 10, 'fadeLast': 5, 'ajax': url, 'fadeInSpeed': '500', 'timeout': 5000 //'timestamp': owa_getNow }); }, getStartTime: function() { var d = new Date(); var ts = ''; if (this.last_end_time > 0) { ts = this.last_end_time; this.last_end_time = this.getNow(); } else { ts = this.getNow(); this.last_end_time = ts; } return ts; }, getNow: function() { var d = new Date(); var now; now = Math.round(d.getTime() / 1000); return now; } } function pauseSpy() { spyRunning = 0; var temp_time; last_end_time = temp_time; jQuery('div#_spyTmp').html(""); jQuery('div#spyContainer').prepend('<div class="status">The spy has been paused...</div>'); return false; } function playSpy() { spyRunning = 1; jQuery('div#spyContainer').prepend('<div class="status">The spy has been re-started...</div>'); return false; } function owa_getData() { spy.properties.startTime = spy.getStartTime(); spy.properties.endTime = spy.getNow(); //alert(OWA.util.nsAll(spy.properties)); return OWA.util.nsAll(spy.properties); } |