28 |
29 | You've pressed the button {{count}} times.
30 |
31 |
--------------------------------------------------------------------------------
/ToyKit/ToyKit/main.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | # Step 5
4 | Replace the word SDK with the name of your package.
5 |
6 | Then, open ./ToyKit/main.css
7 |
8 | */
9 |
10 | ToyKit = {
11 | name: "SDK",
12 | template: "MeteorToys_SDK",
13 | type: "orb",
14 | onOpen: function () {
15 | console.log("You open me");
16 | },
17 | onClose: function () {
18 | console.log("Coffee is for closers!");
19 | }
20 | };
21 |
22 |
23 | // Do not modify the code below here
24 |
25 | if (Meteor.isClient) {
26 | if (Package["meteortoys:toykit"]) {
27 | // If ToyKit is present,
28 | // Import Meteor Toys API
29 | MeteorToys = Package["meteortoys:toykit"].MeteorToys;
30 | } else {
31 | // Otherwise, warn the user
32 | MeteorToys = {};
33 | console.log("For the " + ToyKit.name + " toy to work, you must install Mongol or");
34 | console.log("the Meteor Toys package. Grab the free edition at http://Meteor.Toys/");
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/ToyKit/client/main.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | # Step 3
4 | Replace the word SDK with the name of your package.
5 |
6 | Then, open ./client/main.css
7 |
8 | */
9 |
10 | Meteor.startup(function() {
11 | // If there is no count, set it to 0
12 | MeteorToys.setDefault("SDK/counter", 0);
13 | });
14 |
15 | Template.MeteorToys_SDK_header.events({
16 | 'click .MeteorToys_SDK_header': function () {
17 | // From ToyKit API
18 | MeteorToys.closeToy();
19 |
20 | // From Package itself
21 | ToyKit.onClose();
22 | },
23 | 'click .MeteorToys_SDK_button': function (e,t) {
24 | // Stop the previous click event from propagating,
25 | // otherwise clicking the button would close the toy
26 | e.stopPropagation();
27 |
28 | // Increment the count of the counter
29 | // Notice that Meteor Toys do not use Session
30 | count = MeteorToys.get("SDK/counter");
31 | MeteorToys.set("SDK/counter", count + 1);
32 | }
33 | });
34 |
35 | Template.MeteorToys_SDK_content.helpers({
36 | 'count': function () {
37 | return MeteorToys.get("SDK/counter");
38 | }
39 | });
--------------------------------------------------------------------------------
/GUIDELINES.md:
--------------------------------------------------------------------------------
1 | ToyKit Acceptance Guidelines
2 | ============================
3 |
4 | ## How does approval work?
5 | It's pretty simple: just send the package code and details to toykit@meteor.toys and I will look over it and let get back to you. Approval will be up to Meteor Toys, and any package may be declined or accepted outside these guidelines.
6 |
7 | ## What kind of packages get approved?
8 | The intention here is to allow other's to create development tools and debug packages for other popular packages. My main request is that you do not replicate core functionality. Otherwise, the rest should be fine.
9 |
10 | ## Why is there an approval system?
11 | This is the best way to ensure that packages work for everyone. If there are breaking changes in a future release, I can improvise and make sure the third-party packages continue working. Additionally, I can feature approved packages on the website for everyone to see.
12 |
13 | ## Misc
14 | Please note that any toy may be rejected for any reason outside of what is specified here. If you are worried that your idea may be rejected, please contact me first and I will be happy to help. Also, think of me as collaborator for your package. I can help you out with the icon design and etc.
--------------------------------------------------------------------------------
/ToyKit/README.md:
--------------------------------------------------------------------------------
1 | Package Name - Read Me Template
2 | ===============================
3 | Describe your package here. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo.
4 |
5 | Please note this is only a suggested template and license, and feel free to modify it as you'd like. For the SDK license and guidelines, check out the