<commit_before>Template.designShip.rendered = function(){
	// creates an instance of the game which is in ship
	// designer mode
	shipDesigner = start("ShipDesigner",{
	    canvasID : "ShipDesigner",
	    clear: false
	    });
        Session.set("mainInstance",shipDesigner);
        Session.set("shouldNotPaginate",true);
        var id = Session.get('currentItem');
        var currID = InstanceManager.getInstance(shipDesigner).shipDesigner.currentShip._id;
	if(id && Ships.findOne(id) && id !== currID){
	   InstanceManager.getInstance(shipDesigner).shipDesigner.loadShip(Ships.findOne(id));
	}
};

Template.designShip.listData = {
    scope:function() {return {}},
    partEvents: {
	"click": function(event,part){
	    var id = part._id;
	    event.preventDefault();
	    var mainInst = Session.get("mainInstance");
	    InstanceManager.getInstance(mainInst).shipDesigner.addPart(Parts.findOne(id));
	}
    }
};
				     

Template.designShip.destroyed = function(){
    InstanceManager.clear();
    Session.set("shouldNotPaginate",false);
    Session.set("currentPage",1);
};<commit_msg>still commenting ships whatup<commit_after>Template.designShip.rendered = function(){
	// creates an instance of the game which is in ship
	// designer mode
	shipDesigner = start("ShipDesigner",{
	    canvasID : "ShipDesigner",
	    clear: false
	    });
        Session.set("mainInstance",shipDesigner);
        Session.set("shouldNotBrowse",true);
        var id = Session.get('currentItem');
        var currID = InstanceManager.getInstance(shipDesigner).shipDesigner.currentShip._id;
	if(id && Ships.findOne(id) && id !== currID){
	   InstanceManager.getInstance(shipDesigner).shipDesigner.loadShip(Ships.findOne(id));
	}
};

// ship parts are displayed next to designer and can be selected
// with mouse. On click, the part is added to designer.
Template.designShip.listData = {
    scope:function() {return {}},
    partEvents: {
	"click": function(event,part){
	    var id = part._id;
	    event.preventDefault();
	    var mainInst = Session.get("mainInstance");
	    InstanceManager.getInstance(mainInst).shipDesigner.addPart(Parts.findOne(id));
	}
    }
};
				     
// deletes the ship designer game-instance 
Template.designShip.destroyed = function(){
    InstanceManager.clear();
    Session.set("shouldNotBrowse",false);
    Session.set("currentPage",1);
};
{'fraction_non_alphanumeric': 0.1386306001690617, 'fraction_numerical': 0.0008453085376162299, 'mean_word_length': 3.8904958677685952, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4102049', 'n_tokens_mistral': 721, 'n_tokens_neox': 716, 'n_words': 133}