mirror of
https://github.com/geohot/qira
synced 2025-03-20 14:03:19 +03:00
39 lines
970 B
JavaScript
39 lines
970 B
JavaScript
![]() |
//Change = new Meteor.Collection("change");
|
||
|
//Program = new Meteor.Collection("program");
|
||
|
|
||
|
Template.idump.ischange = function() {
|
||
|
var clnum = Session.get("clnum");
|
||
|
if (this.clnum == clnum) return "highlight";
|
||
|
else return "";
|
||
|
};
|
||
|
|
||
|
Template.idump.isiaddr = function() {
|
||
|
var iaddr = Session.get("iaddr");
|
||
|
if (this.address == iaddr) return "highlight";
|
||
|
else return "";
|
||
|
}
|
||
|
|
||
|
Template.idump.instructions = function() {
|
||
|
var clnum = Session.get("clnum");
|
||
|
var changes = Change.find({clnum: {$gt: clnum-4, $lt: clnum+8}, type: "I"}, {sort: {clnum:1}});
|
||
|
return changes;
|
||
|
};
|
||
|
|
||
|
Template.idump.program_instruction = function() {
|
||
|
var progdat = Program.findOne({address: this.address});
|
||
|
return progdat;
|
||
|
};
|
||
|
|
||
|
Template.idump.hexaddress = function() {
|
||
|
return hex(this.address);
|
||
|
};
|
||
|
|
||
|
Template.idump.events({
|
||
|
'click .change': function() {
|
||
|
Session.set('clnum', this.clnum);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
Deps.autorun(function(){ Meteor.subscribe('instructions', Session.get("clnum")); });
|
||
|
|