| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), { | |||
| 13 | 13 | this.$container.append(this.$table); | |
| 14 | 14 | }, | |
| 15 | 15 | _notify: function (x, y, v) { | |
| 16 | - this.tm.pushStep(this.capsule, { | ||
| 16 | + this.manager.pushStep(this.capsule, { | ||
| 17 | 17 | type: 'notify', | |
| 18 | 18 | x: x, | |
| 19 | 19 | y: y, | |
@@ -22,7 +22,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), { | |||
| 22 | 22 | return this; | |
| 23 | 23 | }, | |
| 24 | 24 | _denotify: function (x, y) { | |
| 25 | - this.tm.pushStep(this.capsule, { | ||
| 25 | + this.manager.pushStep(this.capsule, { | ||
| 26 | 26 | type: 'denotify', | |
| 27 | 27 | x: x, | |
| 28 | 28 | y: y | |
@@ -93,7 +93,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), { | |||
| 93 | 93 | type: type | |
| 94 | 94 | }; | |
| 95 | 95 | $.extend(step, coord); | |
| 96 | - this.tm.pushStep(this.capsule, step); | ||
| 96 | + this.manager.pushStep(this.capsule, step); | ||
| 97 | 97 | }, | |
| 98 | 98 | processStep: function (step, options) { | |
| 99 | 99 | switch (step.type) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,15 +46,15 @@ DirectedGraphTracer.prototype = $.extend(true, Object.create(Tracer.prototype), | |||
| 46 | 46 | this.graph = this.capsule.graph = this.s.graph; | |
| 47 | 47 | }, | |
| 48 | 48 | _setTreeData: function (G, root) { | |
| 49 | - this.tm.pushStep(this.capsule, {type: 'setTreeData', arguments: arguments}); | ||
| 49 | + this.manager.pushStep(this.capsule, {type: 'setTreeData', arguments: arguments}); | ||
| 50 | 50 | return this; | |
| 51 | 51 | }, | |
| 52 | 52 | _visit: function (target, source) { | |
| 53 | - this.tm.pushStep(this.capsule, {type: 'visit', target: target, source: source}); | ||
| 53 | + this.manager.pushStep(this.capsule, {type: 'visit', target: target, source: source}); | ||
| 54 | 54 | return this; | |
| 55 | 55 | }, | |
| 56 | 56 | _leave: function (target, source) { | |
| 57 | - this.tm.pushStep(this.capsule, {type: 'leave', target: target, source: source}); | ||
| 57 | + this.manager.pushStep(this.capsule, {type: 'leave', target: target, source: source}); | ||
| 58 | 58 | return this; | |
| 59 | 59 | }, | |
| 60 | 60 | processStep: function (step, options) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ LogTracer.prototype = $.extend(true, Object.create(Tracer.prototype), { | |||
| 13 | 13 | this.$container.append(this.$wrapper); | |
| 14 | 14 | }, | |
| 15 | 15 | _print: function (msg) { | |
| 16 | - this.tm.pushStep(this.capsule, {type: 'print', msg: msg}); | ||
| 16 | + this.manager.pushStep(this.capsule, {type: 'print', msg: msg}); | ||
| 17 | 17 | return this; | |
| 18 | 18 | }, | |
| 19 | 19 | processStep: function (step, options) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,25 +1,25 @@ | |||
| 1 | 1 | function Tracer(name) { | |
| 2 | 2 | this.module = this.constructor; | |
| 3 | - this.capsule = this.tm.allocate(this); | ||
| 3 | + this.capsule = this.manager.allocate(this); | ||
| 4 | 4 | $.extend(this, this.capsule); | |
| 5 | 5 | this.setName(name); | |
| 6 | 6 | return this.new; | |
| 7 | 7 | } | |
| 8 | 8 | ||
| 9 | 9 | Tracer.prototype = { | |
| 10 | 10 | constructor: Tracer, | |
| 11 | - tm: null, | ||
| 11 | + manager: null, | ||
| 12 | 12 | _setData: function () { | |
| 13 | 13 | var args = Array.prototype.slice.call(arguments); | |
| 14 | - this.tm.pushStep(this.capsule, {type: 'setData', args: TracerUtil.toJSON(args)}); | ||
| 14 | + this.manager.pushStep(this.capsule, {type: 'setData', args: TracerUtil.toJSON(args)}); | ||
| 15 | 15 | return this; | |
| 16 | 16 | }, | |
| 17 | 17 | _clear: function () { | |
| 18 | - this.tm.pushStep(this.capsule, {type: 'clear'}); | ||
| 18 | + this.manager.pushStep(this.capsule, {type: 'clear'}); | ||
| 19 | 19 | return this; | |
| 20 | 20 | }, | |
| 21 | 21 | _wait: function () { | |
| 22 | - this.tm.newStep(); | ||
| 22 | + this.manager.newStep(); | ||
| 23 | 23 | return this; | |
| 24 | 24 | }, | |
| 25 | 25 | processStep: function (step, options) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,15 +30,15 @@ WeightedDirectedGraphTracer.prototype = $.extend(true, Object.create(DirectedGra | |||
| 30 | 30 | }); | |
| 31 | 31 | }, | |
| 32 | 32 | _weight: function (target, weight) { | |
| 33 | - this.tm.pushStep(this.capsule, {type: 'weight', target: target, weight: weight}); | ||
| 33 | + this.manager.pushStep(this.capsule, {type: 'weight', target: target, weight: weight}); | ||
| 34 | 34 | return this; | |
| 35 | 35 | }, | |
| 36 | 36 | _visit: function (target, source, weight) { | |
| 37 | - this.tm.pushStep(this.capsule, {type: 'visit', target: target, source: source, weight: weight}); | ||
| 37 | + this.manager.pushStep(this.capsule, {type: 'visit', target: target, source: source, weight: weight}); | ||
| 38 | 38 | return this; | |
| 39 | 39 | }, | |
| 40 | 40 | _leave: function (target, source, weight) { | |
| 41 | - this.tm.pushStep(this.capsule, {type: 'leave', target: target, source: source, weight: weight}); | ||
| 41 | + this.manager.pushStep(this.capsule, {type: 'leave', target: target, source: source, weight: weight}); | ||
| 42 | 42 | return this; | |
| 43 | 43 | }, | |
| 44 | 44 | processStep: function (step, options) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,12 +35,12 @@ var executeDataAndCode = function () { | |||
| 35 | 35 | e.stopPropagation(); | |
| 36 | 36 | }); | |
| 37 | 37 | ||
| 38 | - var tm = new TracerManager(); | ||
| 39 | - Tracer.prototype.tm = tm; | ||
| 38 | + var tracerManager = new TracerManager(); | ||
| 39 | + Tracer.prototype.manager = tracerManager; | ||
| 40 | 40 | ||
| 41 | 41 | $('#interval').on('change', function () { | |
| 42 | - tm.interval = Number.parseFloat($(this).val() * 1000); | ||
| 43 | - showInfoToast('Tracing interval has been set to ' + tm.interval / 1000 + ' second(s).'); | ||
| 42 | + tracerManager.interval = Number.parseFloat($(this).val() * 1000); | ||
| 43 | + showInfoToast('Tracing interval has been set to ' + tracerManager.interval / 1000 + ' second(s).'); | ||
| 44 | 44 | }); | |
| 45 | 45 | ||
| 46 | 46 | var $module_container = $('.module_container'); | |
@@ -63,7 +63,7 @@ var executeDataAndCode = function () { | |||
| 63 | 63 | dataEditor.on('change', function () { | |
| 64 | 64 | var data = dataEditor.getValue(); | |
| 65 | 65 | if (lastFile) cachedFile[lastFile].data = data; | |
| 66 | - executeData(tm, data); | ||
| 66 | + executeData(tracerManager, data); | ||
| 67 | 67 | }); | |
| 68 | 68 | codeEditor.on('change', function () { | |
| 69 | 69 | var code = codeEditor.getValue(); | |
@@ -305,7 +305,7 @@ var executeDataAndCode = function () { | |||
| 305 | 305 | $sidemenu.css('right', 0); | |
| 306 | 306 | $workspace.css('left', 0); | |
| 307 | 307 | } | |
| 308 | - tm.resize(); | ||
| 308 | + tracerManager.resize(); | ||
| 309 | 309 | }); | |
| 310 | 310 | ||
| 311 | 311 | var showErrorToast = function (err) { | |
@@ -345,26 +345,26 @@ var executeDataAndCode = function () { | |||
| 345 | 345 | $('#btn_trace').click(); | |
| 346 | 346 | var data = dataEditor.getValue(); | |
| 347 | 347 | var code = codeEditor.getValue(); | |
| 348 | - var err = executeDataAndCode(tm, data, code); | ||
| 348 | + var err = executeDataAndCode(tracerManager, data, code); | ||
| 349 | 349 | if (err) { | |
| 350 | 350 | console.error(err); | |
| 351 | 351 | showErrorToast(err); | |
| 352 | 352 | } | |
| 353 | 353 | }); | |
| 354 | 354 | $('#btn_pause').click(function () { | |
| 355 | - if (tm.isPause()) { | ||
| 356 | - tm.resumeStep(); | ||
| 355 | + if (tracerManager.isPause()) { | ||
| 356 | + tracerManager.resumeStep(); | ||
| 357 | 357 | } else { | |
| 358 | - tm.pauseStep(); | ||
| 358 | + tracerManager.pauseStep(); | ||
| 359 | 359 | } | |
| 360 | 360 | }); | |
| 361 | 361 | $('#btn_prev').click(function () { | |
| 362 | - tm.pauseStep(); | ||
| 363 | - tm.prevStep(); | ||
| 362 | + tracerManager.pauseStep(); | ||
| 363 | + tracerManager.prevStep(); | ||
| 364 | 364 | }); | |
| 365 | 365 | $('#btn_next').click(function () { | |
| 366 | - tm.pauseStep(); | ||
| 367 | - tm.nextStep(); | ||
| 366 | + tracerManager.pauseStep(); | ||
| 367 | + tracerManager.nextStep(); | ||
| 368 | 368 | }); | |
| 369 | 369 | ||
| 370 | 370 | $('#btn_desc').click(function () { | |
@@ -381,7 +381,7 @@ var executeDataAndCode = function () { | |||
| 381 | 381 | }); | |
| 382 | 382 | ||
| 383 | 383 | $(window).resize(function () { | |
| 384 | - tm.resize(); | ||
| 384 | + tracerManager.resize(); | ||
| 385 | 385 | }); | |
| 386 | 386 | ||
| 387 | 387 | var dividers = [ | |
@@ -422,7 +422,7 @@ var executeDataAndCode = function () { | |||
| 422 | 422 | $first.css('right', (100 - percent) + '%'); | |
| 423 | 423 | $second.css('left', percent + '%'); | |
| 424 | 424 | x = e.pageX; | |
| 425 | - tm.resize(); | ||
| 425 | + tracerManager.resize(); | ||
| 426 | 426 | $('.files_bar > .wrapper').scroll(); | |
| 427 | 427 | } | |
| 428 | 428 | }); | |
@@ -451,7 +451,7 @@ var executeDataAndCode = function () { | |||
| 451 | 451 | $first.css('bottom', (100 - percent) + '%'); | |
| 452 | 452 | $second.css('top', percent + '%'); | |
| 453 | 453 | y = e.pageY; | |
| 454 | - tm.resize(); | ||
| 454 | + tracerManager.resize(); | ||
| 455 | 455 | } | |
| 456 | 456 | }); | |
| 457 | 457 | $(document).mouseup(function (e) { | |
@@ -464,16 +464,16 @@ var executeDataAndCode = function () { | |||
| 464 | 464 | } | |
| 465 | 465 | ||
| 466 | 466 | $module_container.on('mousedown', '.module_wrapper', function (e) { | |
| 467 | - tm.findOwner(this).mousedown(e); | ||
| 467 | + tracerManager.findOwner(this).mousedown(e); | ||
| 468 | 468 | }); | |
| 469 | 469 | $module_container.on('mousemove', '.module_wrapper', function (e) { | |
| 470 | - tm.findOwner(this).mousemove(e); | ||
| 470 | + tracerManager.findOwner(this).mousemove(e); | ||
| 471 | 471 | }); | |
| 472 | 472 | $(document).mouseup(function (e) { | |
| 473 | - tm.command('mouseup', e); | ||
| 473 | + tracerManager.command('mouseup', e); | ||
| 474 | 474 | }); | |
| 475 | 475 | $module_container.on('DOMMouseScroll mousewheel', '.module_wrapper', function (e) { | |
| 476 | - tm.findOwner(this).mousewheel(e); | ||
| 476 | + tracerManager.findOwner(this).mousewheel(e); | ||
| 477 | 477 | }); | |
| 478 | 478 | ||
| 479 | 479 | // Share scratch paper | |
| Back | FazBrowse Home | New Git URL |
0 commit comments