Example #1
0
import { Template } from 'meteor/templating';
import { ReactiveDict } from 'meteor/reactive-dict';

import { Rides } from '../both/rides.js'

import './main.html';

Template.hello.onCreated(function helloOnCreated() {
  Meteor.subscribe('rides');
  Meteor.subscribe('myRides');

  this.state = new ReactiveDict()
  this.state.setDefault({
    // selectedRide: {...},
  });
});

Template.hello.helpers({
  rides() {
    // TODO: $exists ?
    return Rides.find({coriders: null});
  },
  isRidesEmpty() {
    // TODO: $exists ?
    return Rides.find({coriders: null}).count() == 0;
  },
  myRides() {
    // TODO: Meteor.user() is sometimes not available by the time this helper executes; that's why this ugly if here
    if (Meteor.user()) {
      return Rides.find({
        coriders: Meteor.user().emails[0].address
Example #2
0
import { Template } from 'meteor/templating';
import { Session } from 'meteor/session';

import './main.html';

Session.setDefault("counter", 0);


Template.hello.helpers({
  counter() {
    return Session.get("counter");
  },
});

Template.hello.events({
  'click button'(event, instance) {
    // increment the counter when button is clicked
    Session.set("counter", Session.get("counter")+1);
  },
});


/* Vue-demo */

import {Vue} from 'meteor/akryum:vue';
import Widget from '/imports/ui/Widget.vue';

Template.vue_demo.rendered = function() {
  var vm = new Vue({
    el: '#vue-demo',
    template: '<div><widget></widget></div>',
Example #3
0
import { Template } from 'meteor/templating';

import './main.html';

Template.hello.helpers({
  raw() {
    return '> < ';
  },
  escaped() {
    return '&gt; &lt;';
  }
});
Example #4
0
import { Mongo } from 'meteor/mongo';

import './main.html';

import { Rides } from '../both/rides.js'

Template.hello.onCreated(function helloOnCreated() {
  this.state = new ReactiveDict()
  this.state.setDefault({
    newRide: {},
    editing: false,
    // rideBeingEdited: {},
  });

  // Meteor.call(
  //   'ping',
  //   {},
  //   (err, res) => {
  //     if (err) {
  //       alert(err);
  //     } else {
  //       alert(res);
  //     }
  //   }
  // );
});

Template.hello.onRendered(function helloOnRendered() {
	this.$('#my-datepicker').datepicker();
});

Template.hello.helpers({
Example #5
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

import './main.html';

Template.hello.onCreated(function helloOnCreated() {
  // counter starts at 0
  this.counter = new ReactiveVar(0);
});

Template.hello.helpers({
  tasks: function() {
      var tasks = Tasks.find().fetch();
      return tasks
  },
});

Template.hello.events({
  'click #dodajTo'(event, instance) {
    // increment the counter when button is clicked
    let taskTitle = $('#title').val()
    console.log(taskTitle)
    Tasks.insert({
        text: taskTitle,
        description: "gunwo"
    })
  },
});
Example #6
0
Template.hello.onCreated(function helloOnCreated() {
  // counter starts at 0
	this.counter = new ReactiveVar(0);
	
	if (typeof web3 !== 'undefined') {
		web3 = new Web3(web3.currentProvider);
	} else {
		// set the provider you want from Web3.providers
		web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8101"));
	}

	
	if(!web3.isConnected()) {
		console.log("NO - not connected");
	} else {
		console.log("YES - Connected to local geth");
		var contractAddress = localStorage.getItem("contract");
		if (contractAddress) {
			web3.eth.defaultAccount = web3.eth.accounts[0];
			carContract = web3.eth.contract([{"constant":false,"inputs":[],"name":"supply","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"model","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[],"name":"getState","outputs":[{"name":"","type":"uint8"}],"type":"function"},{"constant":false,"inputs":[{"name":"_insuranceId","type":"string"},{"name":"_policyNo","type":"string"}],"name":"matriculate","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"producer","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"ccm","outputs":[{"name":"","type":"uint8"}],"type":"function"},{"constant":true,"inputs":[],"name":"details","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":true,"inputs":[],"name":"insuranceId","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":true,"inputs":[],"name":"chassisNo","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[],"name":"exmatriculate","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"sell","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"price","outputs":[{"name":"","type":"uint8"}],"type":"function"},{"constant":false,"inputs":[{"name":"_chassisNo","type":"string"},{"name":"_assemblyLine","type":"string"}],"name":"produce","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"state","outputs":[{"name":"","type":"uint8"}],"type":"function"},{"constant":true,"inputs":[],"name":"matriculated","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"policyNo","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":true,"inputs":[],"name":"creationTime","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"dump","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"holder","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[],"name":"deliver","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"assemblyLine","outputs":[{"name":"","type":"string"}],"type":"function"},{"inputs":[{"name":"_model","type":"string"},{"name":"_ccm","type":"uint8"},{"name":"_price","type":"uint8"},{"name":"_details","type":"string"},{"name":"_producer","type":"address"},{"name":"_owner","type":"address"}],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_producer","type":"address"},{"indexed":false,"name":"_owner","type":"address"},{"indexed":false,"name":"_modell","type":"string"},{"indexed":false,"name":"_ccm","type":"uint8"},{"indexed":false,"name":"_price","type":"uint8"}],"name":"Ordered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_producer","type":"address"},{"indexed":false,"name":"_owner","type":"address"},{"indexed":false,"name":"chassisNo","type":"string"}],"name":"Produced","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_garage","type":"address"}],"name":"Supplied","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_owner","type":"address"}],"name":"Delivered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_owner","type":"address"},{"indexed":false,"name":"_insuranceId","type":"string"},{"indexed":false,"name":"_policyNo","type":"string"}],"name":"Matriculated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_owner","type":"address"},{"indexed":false,"name":"_policyNo","type":"string"}],"name":"Exmatriculated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_oldOwner","type":"address"},{"indexed":false,"name":"_newOwner","type":"address"}],"name":"Sold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_owner","type":"address"}],"name":"Dumped","type":"event"}]);
			//carContract = web3.eth.contract([{"constant":false,"inputs":[{"name":"_msg","type":"string"}],"name":"sendEvent","outputs":[],"type":"function"},{"inputs":[],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_msg","type":"string"},{"indexed":false,"name":"_me","type":"address"}],"name":"Triggered","type":"event"}]);
			contractInstance = carContract.at(contractAddress);

			var event = contractInstance.allEvents().watch(function(error, result){
					console.log("EVENT FIRED");
					console.log(result);
			});				
		}
	}
});
import { Template } from 'meteor/templating';

import './main.html';
import { url, raw, minified } from '../imports/test.html5';

Template.hello.helpers({
  url() {
    return url;
  },
  raw() {
    return raw;
  },
  minified() {
    return minified;
  }
});
Example #8
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

import './main.html';

Template.hello.onCreated(function onCreated() {
  this.pid = new ReactiveVar(null);
})


Template.hello.helpers({
  pid() {
    return Template.instance().pid.get();
  },
});

Template.hello.events({
  'click button'(event, instance) {
    Meteor.call('microservice.test', (err, data) => {
      instance.pid.set(data);
    });
  },
});
Example #9
0
import { Template } from 'meteor/templating';
import { Accounts } from 'meteor/accounts-base';

import './main.html';

Template.hello.events({
  'click button'(event, instance) {
    Accounts.createUser({ email: '*****@*****.**', password: '******' });
  },
});
Example #10
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import './main.html';

Template.hello.helpers({
  displayImage: function() {
    return Images.find();
    // return Images.find({},{fields:{"copies.thumbs":1}}).fetch();
  }
});

Template.hello.events({
  "change #myFileInput": function (event) {
    event.preventDefault();

    FS.Utility.eachFile(event, function(file){
      var fileObj = new FS.File(file);
      fileObj.userId = "jkj31n23n12jk3njkn12k3"; //HERE IS WHERE YOU CAN ADD A CUSTOM FIELD TO THE FS COLLECTION
      Images.insert(fileObj, function(err, result) {
        if(err) {
          throw new Meteor.Error(500, 'There was an error when uploading the image');
        }
      });
    });

  },

  "click .myFileInput": function () {
    //RESETS THE PROGRESS BAR WHEN UPLOADING NEW PHOTO
    var x = document.getElementsByClassName("progress-bar");
    for (var i = 0; i < x.length; i++) {
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

import './main.html';

Template.hello.onCreated(function helloOnCreated() {
  // counter starts at 0
  this.counter = new ReactiveVar(0);
});

Template.hello.helpers({
  counter() {
    return Template.instance().counter.get();
  },
});

Template.hello.events({
  'click #buttonsub'(event, instance) {
      var name=$("#name").val();
              var email=$("#email").val();
              var subject=$("#subject").val();
              var message=$("#message").val();
    Meteor.call("sendmail",name,subject,email,message,function(res){
        alert("Mail Send Successfully");
    })
  },
});
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import { FlowRouter } from 'meteor/kadira:flow-router';
import './main.html';


FlowRouter.route('/:wildcard(.*)', {
  name: 'root',
  action(params) {
    console.log('Route params:', params);
    BlazeLayout.render('hello');
  }
});


Template.hello.events({
  'click .set-params-as-string'() {
    const words = [Fake.word(), Fake.word()];
    FlowRouter.setParams({
      wildcard: words.join('/')
    });
  },
  'click .set-params-as-array'() {
    const words = [Fake.word(), Fake.word()];
    FlowRouter.setParams({
      wildcard: words
    });
  }
});
Example #13
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

import './main.html';

Wallets = new Meteor.Collection('wallets');

Template.hello.onCreated(function helloOnCreated() {
  // counter starts at 0
  this.counter = new ReactiveVar(0);
  Meteor.subscribe("wallets");
});

Template.hello.helpers({
  counter() {
    return Template.instance().counter.get();
  },
  balance() {
   return CoinStack.Math.toBitcoin( Wallets.findOne({}).balance );
  }
});

Template.hello.events({
  'click button'(event, instance) {
    // increment the counter when button is clicked
    instance.counter.set(instance.counter.get() + 1);
  },
});
Example #14
0
import { Template } from 'meteor/templating';
import { Tracker } from 'meteor/tracker';
import { ReactiveVar } from 'meteor/reactive-var';

import './main.html';

const counter = new ReactiveVar(0);

Template.hello.helpers({
  counter() {
    return counter.get();
  },
});

Template.hello.events({
  'click button' () {
    // increment the counter when button is clicked
    counter.set(counter.get() + 1);
  },
});

// Socket io

// Hack https://github.com/socketio/socket.io-client/issues/961
import Response from 'meteor-node-stubs/node_modules/http-browserify/lib/response';
if (!Response.prototype.setEncoding) {
  Response.prototype.setEncoding = function(encoding) {
    // do nothing
  }
}
import {Template} from 'meteor/templating';
import {ReactiveVar} from 'meteor/reactive-var';
import Auth0Lock from 'auth0-lock';

import './main.html';

const AUTH0_CLIENT_ID = null;
const AUTH0_DOMAIN = null;

Template.hello.onCreated(function helloOnCreated () {
  // counter starts at 0
  this.counter = new ReactiveVar(0);
});

Template.hello.onRendered(function helloOnRendered () {
  // counter starts at 0
  Lock = new Auth0Lock(
    AUTH0_CLIENT_ID,
    AUTH0_DOMAIN);
  Lock.show();
});

Template.hello.helpers({
  counter() {
    return Template.instance().counter.get();
  },
});

Template.hello.events({
  'click button'(event, instance) {
    // increment the counter when button is clicked
Example #16
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import { go, timeout, chan, take, put, putAsync } from 'js-csp';
import './main.html';

Template.hello.onCreated(function helloOnCreated() {
    // counter starts at 0
    this.counter = new ReactiveVar(0);
});

chDuck = chan();

go(function*() {
    yield take(chDuck);
    console.log(chDuck.data);
});
Template.hello.helpers({
    counter() {
        return Template.instance().counter.get();
    },
    visible() {
        if (Template.instance().counter.get()) {
            return "visible";
        }
    },
    textfromch1() {
        go(function*() {
            yield take(chDuck);
            return chDuck.data;
        });
    }
Example #17
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

import { Jobs, addRandomJob, jobsMethod } from '/imports/jobs.js';

import './main.html';

// Add method to client
jobsMethod();

Template.hello.onCreated(function helloOnCreated() {
  this.subscribe('jobs');
});

Template.hello.helpers({
  connectionStatus() {
    return Meteor.status().status;
  },
  jobs() {
    return Jobs.find();
  },
  counter() {
    return Jobs.find().count();
  },
});

Template.hello.events({
  'click button.client-add'(event, instance) {
    event.preventDefault();
    addRandomJob();
  },
Example #18
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

import './main.html';

if (Meteor.isClient) {
    Template.hello.helpers({time:new Date()});
}
Example #19
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

import './main.html';

Template.hello.onCreated(function helloOnCreated() {
  // counter starts at 0
  this.counter = new ReactiveVar(0);
});
Example #20
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

import './wordList.html';

Template.hello.onCreated(function helloOnCreated() {
  // counter starts at 0
  this.counter1 = new ReactiveVar(0);
  this.counter2 = new ReactiveVar(0);
  this.counter3 = new ReactiveVar(0);
  this.counter4 = new ReactiveVar(0);
  this.counter5 = new ReactiveVar(0);
});

Template.hello.helpers({
  counter1() {
    return Template.instance().counter1.get();
  },
  counter2() {
    return Template.instance().counter2.get();
  },
  counter3() {
    return Template.instance().counter3.get();
  },
  counter4() {
    return Template.instance().counter4.get();
  },
  counter5() {
    return Template.instance().counter5.get();
  },
});
Example #21
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import pinyin from 'pinyin';
import underscore from 'underscore';

import './main.html';

Template.hello.onCreated(function helloOnCreated() {
  // counter starts at 0
  this.counter = new ReactiveVar();
});

Template.hello.helpers({
  counter() {
    return Template.instance().counter.get();
  },
});

Template.hello.events({
  'click button'(event, instance) {
    Meteor.call("getMyIp", function(e,r){
      instance.counter.set(r)
    });

  },
  'keydown input': function (event) {
        if (event.keyCode === 13) {
            var query = $('.chinese').val();
            if (query)
                console.log(_.flatten(pinyin(query)).join(" "))
        }
Example #22
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

import './main.html';

Template.hello.onCreated(function helloOnCreated() {
  // counter starts at 0
  this.counter = new ReactiveVar(0);
});

Template.hello.helpers({
  counter() {
    return Template.instance().counter.get();
  },
});

Template.hello.events({
  'click button'(event, instance) {
    Meteor.call("TestMethodOnProd","Some text on prod",(err,res)=> {
        console.log("Err ",err)
        console.log("Res ",res)
    });
  },
});
Example #23
0
import {
    Template
} from 'meteor/templating';

import {
    ReactiveVar
} from 'meteor/reactive-var';

import './main.html';

Template.hello.onCreated(function helloOnCreated() {
    // counter starts at 0
    this.counter = new ReactiveVar(0);
});

Template.hello.onCreated(function() {
    var self = this;
    self.autorun(function() {
        self.subscribe('transactions');
    });
});

Template.hello.helpers({
    transactions: function() {
        return Transactions.find();
    }
});

Template.hello.events({

});
Example #24
0
    // return a list of it's key/value pairs
    listFlatten = function( x, result, prefix ) {
        if ( _.isObject( x ) ) {
            _.each( x, function( v, k ) {
                listFlatten( v, result, k )
            } )
        } else {
            result.push( { key: prefix, value: x } )
        }
        return result
    };

    Template.hello.helpers( {
        greeting: function() {
            if ( typeof console !== 'undefined' )
                console.log( "mozdef starting" );
            return "MozDef: The Mozilla Defense Platform";
        }
    } );

    Template.hello.events( {
        'click': function() {
            // template data, if any, is available in 'this'
            Session.set( 'displayMessage', 'Welcome &amp; to mozdef.' )
        }
    } );

    // loads kibana dashboards
    Template.menu.helpers( {
        kibanadashboards: function() {
            Meteor.call( 'loadKibanaDashboards' );
Example #25
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

import './main.html';

Template.body.helpers({
  	resolutions: [
  		{title: "Resolutions #1"},
  		{title: "Resolutions #2"},
  		{title: "Resolutions #3"}
  	]
});

Template.hello.events({
  
});
Example #26
0
Template.hello.onCreated(function helloOnCreated() {
  // counter starts at 0
  this.counter = new ReactiveVar(0);
  var count = 0;
  var images = "";
  
  var showFlickr = function(tag) { 
    images = ""; // cleaning list
    key = formatQuery(tag);
    localStorage.setItem('search', key);  
    count++;
    var url = 'https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=a0ddab17666178023726b34cd67b21e6&tags='+key+'&per_page=12&format=json&nojsoncallback=1';
    console.log("I found this with ", key, count);
    runQuery(url);
  }
  
  formatQuery = function(tag){
    return tag.replace(" ", "+");
  }
  
  runQuery = function(url){
    $.get(url, function (data) {
      console.log(data);
      localStorage.setItem('page', data.photos.page);
      localStorage.setItem('max', data.photos.pages);
      $.each(data.photos.photo, function( index, value ) {
        images = images + "<li id="+index+"><img class='thumbnail' src='http://farm"+value.farm+".staticflickr.com/"+value.server+"/"+value.id+"_"+value.secret+".jpg' /><h6>"+value.title+"</h6></li>"
      });
      $(".fest").html(images);
    });
  }
  
  var runScroll = function(where){
    setTimeout(function() { 
        if (where == "down"){
          var n = $(document).height();
          console.log(n);
          $("html, body").animate({ scrollTop: n}, 50);
        }else if (where == "up"){
          console.log("going to top");
          $('html, body').animate({ scrollTop: 0 }, 50);
        }
     }, 2000);
  }
  
  
  var showMore = function(){
    search = localStorage.getItem('search');
    page = localStorage.getItem('page');
    max = localStorage.getItem('max');
    if (search){
      page++;
      if (page >= max){console.log("no more pages"); return}
      var url = 'https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=a0ddab17666178023726b34cd67b21e6&tags='+search+'&per_page=12&page='+page+'&format=json&nojsoncallback=1';
      console.log(page, url);
      runQuery(url, runScroll("down"));
    }
  }
  
  function isNumeric(n) {
    return !isNaN(parseFloat(n)) && isFinite(n);
  }
  
  var removeIt = function(tag){
    console.log(tag);
    var numbers = {one: 0, two: 1, three:2, four: 3, five: 4, six: 5, seven: 6, eight: 7};
    if (isNumeric(tag)){
      the_number = tag-1;
    }else{
      the_number = numbers[tag];
    }
    
    if(typeof the_number !== "undefined"){
      console.log("remove the", the_number);
      $(".fest li#"+the_number).addClass('remove').remove();
    }else{
      var other_numbers = {first: 0, second: 1, third:2};
      the_number = other_numbers[tag];
      if(typeof the_number !== "undefined"){
        console.log("remove the", the_number);
        $(".fest li#"+the_number).addClass('remove').remove();
      }else{
        console.log("we didn`t get it number what?");
      }
    }
  }  
  
  
  // Let's define a command
  var commands = {
    'hello': function() { console.log('Hello world!'); },
    'stop': function() { annyang.pause(); console.log('pause!'); },
    'go on': function() { annyang.resume(); console.log('go on!'); },
    'show me (recipes with) *tag': showFlickr,
    'show me (a recipe with) *tag': showFlickr,
    'show me (a) *tag': showFlickr,
    'I want (to see recipes with) *tag': showFlickr,
    'I meant (to see recipes with) *tag': showFlickr, 
    'more': showMore,
    'show me more': showMore,
    'go on': showMore,
    'more (*tag)': showMore,
    'go to top': function() { runScroll("up") },
    'go back': function() { runScroll("up") },
    'remove the *tag one': removeIt,
    'remove number *tag': removeIt,
  };

  // Add our commands to annyang
  annyang.addCommands(commands);  
  
  
});
Example #27
0
Template.hello.onCreated(function () {
  // counter starts at 0
  var canvas = d3.select('body').append('svg')
		.attr('width',500)
		.attr('height',500)
		.append('g')
		.attr("transform", "translate(50,50)");
	
	var tree = d3.layout.tree()
		.size([400,400]);
	
	console.log("a;ldkfj");
	d3.json("../../../../../mydata.json", function(data) {
		console.log(data);
		var nodes = tree.nodes(data);
		var links = tree.links(nodes);
		console.log(nodes);
		var node = canvas.selectAll(".node")
			.data(nodes)
			.enter()
			.append("g")
				.attr("class","node")
				.attr("transform", function(d) {return "translate (" + d.x + "," + d.y + ")"; })
		
		node.append("circle")
			.attr("r",5)
			.attr("fill","steelblue");
		
		node.append("text")
			.text(function (d) {return d.name})
		
		var diagnoal = d3.svg.diagonal();
		
		canvas.selectAll(".link")
			.data(links)
			.enter()
			.append("path")
			.attr("class","link")
			.attr("fill","none")
			.attr("stroke","#ADADAD")
			.attr("d",diagnoal);
	});
});
Example #28
0
import { Gaussian } from '../imports/utils/gaussian.js';

import './main.html';

Meteor.startup(() => {
    GoogleMaps.load({ v: '3', key: 'AIzaSyCBMhDltGxEUbOWMlSH1_-r0TulIh414gI', libraries: 'visualization,geometry,places' });
});

Template.hello.onCreated(function helloOnCreated() {
    // counter starts at 0
    this.counter = new ReactiveVar(0);
    this.restaurant_id = new ReactiveVar("");

    Meteor.subscribe('orders');
    Meteor.subscribe('customers');
    Meteor.subscribe('restaurants');
    Meteor.subscribe('chefs');
    Meteor.subscribe('drivers');
    Meteor.subscribe('locations');
    Meteor.subscribe('simulation');


});

Template.summary.onCreated(function summaryOnCreated() {
    Meteor.subscribe('orders');

});


var map = null;
Example #29
0
    vulns: function(name) {
        return vulns(name);
    }
});

Template.export.helpers({
    links_checked: function() {
        if (Session.get("links")) return "checked";
        return "";
    },
});



Template.hello.onCreated(function helloOnCreated() {
  // counter starts at 0
  this.counter = new ReactiveVar(0);
});

Template.hello.helpers({
  counter() {
    return Template.instance().counter.get();
  },
});

Template.hello.events({
  'click button'(event, instance) {
    // increment the counter when button is clicked
    instance.counter.set(instance.counter.get() + 1);
  },
});
Example #30
0
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import { Mongo } from 'meteor/mongo';

import './main.html';
Messages = new Mongo.Collection("messages");
//Register = new Mongo.Collection("users2");
Template.hello.onCreated(function helloOnCreated() {
  // counter starts at 0
  this.counter = new ReactiveVar(0);
});

Template.hello.helpers({
	messages:function()
	{
		return Messages.find();
	}
  // counter() {
  //   return Template.instance().counter.get();
  // },
});

Template.hello.events({
  'submit .chat-form'(event, instance) {
  	event.preventDefault();
  	var mess = event.target.message.value;
  	console.log(mess);
  	insertMess(mess);
  	event.target.message.value = "";
  },
});