Created
March 16, 2016 23:51
-
-
Save jpopesculian/9a292961d4f6f3f9eab4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name="example"> | |
<button id="button">{{buttonName}}</button> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Template.example.helpers({ | |
buttonName: function() { | |
return "Button"; | |
} | |
}); | |
Template.example.events({ | |
'click #button': function(event, template) { | |
Meteor.call('exampleMethod', data, function(error, response) { | |
// do something with response | |
}); | |
} | |
}); | |
Template.example.onCreated(function () { | |
var ready = new ReactiveVar(false); | |
// load reactive vars in here | |
// | |
// reactive vars used in helper functions or Template.autorun | |
// functions get automatically reloaded on reactive var changes | |
}); | |
Template.example.onRendered(function() { | |
// load external js in here probably | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Package.describe({ | |
name: 'example-package', | |
version: '0.0.1', | |
summary: 'example', | |
git: '' | |
}); | |
Package.onUse(function(api) { | |
api.versionsFrom('1.0'); | |
api.use([ | |
'rocketchat:[email protected]', | |
]); | |
api.use([ | |
'templating' | |
], 'client'); | |
Npm.depends({ | |
'opentok': '2.3.0' | |
}); | |
api.addFiles([ | |
'server.js' | |
], 'server'); | |
api.addFiles([ | |
'client.html', | |
'client.js', | |
'tabBar.js' | |
], 'client'); | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var OpenTok = Npm.require('opentok'), | |
apiKey = "key", | |
apiSecret = "secret", | |
openTok = new OpenTok(apiKey, apiSecret); | |
Meteor.methods({ | |
exampleMethod: function(data) { | |
syncMethod = Meteor.wrapAsync(openTok.method); | |
response = syncMethod(method); | |
return response; | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.startup(function() { | |
var settings = { | |
i18nTitle: "Example", | |
icon: "icon-example", | |
id: "example", | |
template: "example", | |
order: 10, | |
}; | |
return RocketChat.callbacks.add('enter-room', function() { | |
return RocketChat.TabBar.addButton( | |
settings, | |
RocketChat.callbacks.priority.MEDIUM, | |
'enter-room-tabbar-example' | |
); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment