Meteor.logout(); }, 'click .vuln'(events, instance) { if (Session.get("links")) { Router.go("/edit/vuln/"+this._id); } }, }); Template.export.events({ 'change #links'(event, instance) { Session.set("links", $('#links')[0].checked); }, 'click #select_copy'(event, instance) { selectText('selectable'); try { document.execCommand('copy'); } catch (err) { console.log('Oops, unable to copy'); } }, }); Template.edit_project.events({ 'click #save'(event, instance) { oldProject = JSON.stringify(orderObject(this)); Projects.update(this._id, this); Router.go("/"); vulnProject.changed(); }, 'click #delete'(event, instance) {
Template.aliexpressResult.helpers({ 'getAliexpressResult': function() { return ResultAliexpress.find(); }, 'checked':function() { return this.checked ? "checked":""; } }); Template.export.events({ 'click #download': function (e) { //creating a single json object let ebayResult = ResultEbay.find({checked:true},{fields:{productPortal:1,productId:1,productName:1,productPrice:1,productURL:1,_id:0}}).fetch(); let alibabaResult = ResultAlibaba.find({checked:true},{fields:{productPortal:1,productId:1,productName:1,productPrice:1,productURL:1,_id:0}}).fetch(); let aliexpress = ResultAliexpress.find({checked:true},{fields:{productPortal:1,productId:1,productName:1,productPrice:1,productURL:1,_id:0}}).fetch(); let allFinalItems = (ebayResult.concat(alibabaResult)).concat(aliexpress); csv = json2csv(allFinalItems, true, true); e.target.href = "data:text/csv;charset=utf-8," + escape(csv) e.target.download = "reportItems.csv"; } }); Template.selectAll.events({ 'change [type=checkbox]': function (event) { //upon selecting all option all items should be selected if($('#selectAll').is(':checked')){ Meteor.call('selectAll',function(error,res){ if(!error){ console.log("all items all marked now");