Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Meteor.js support #54

Merged
merged 3 commits into from
Mar 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions meteor/export.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*global Switchery:true*/ // Meteor creates a file-scope global for exporting. This comment prevents a potential JSHint warning.
Switchery = window.Switchery;
delete window.Switchery;
10 changes: 10 additions & 0 deletions meteor/tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

Tinytest.add('Switchery integration', function (test) {

var checkbox = document.createElement('input');
checkbox.className = 'js-switch';
var switchy = new Switchery(checkbox);

test.instanceOf(switchy, Switchery, 'instantiation OK');
});
24 changes: 24 additions & 0 deletions package.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// package metadata file for Meteor.js
'use strict';

var packageName = 'abpetkov:switchery'; // https://atmospherejs.com/mediatainment/switchery
var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing.

Package.describe({
name: packageName,
summary: 'Switchery (official) - turns your default HTML checkbox inputs into beautiful iOS 7 style switches.',
version: "0.0.1", //packageJson.version,
git: 'https://github.com/abpetkov/switchery'
});

Package.onUse(function(api) {
api.versionsFrom(['METEOR@0.9.0', 'METEOR@1.0']);
api.export('Switchery');
api.addFiles(['dist/switchery.js', 'dist/switchery.css', 'meteor/export.js'], where);
});

Package.onTest(function(api) {
api.use(packageName, where);
api.use('tinytest', where);
api.addFiles('meteor/tests.js', where); // testing specific files
});
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"devDependencies": {
"uglify-js": "~2.4.8",
"component": "^1.0.0",
"uglifycss": "0.0.7"
"uglifycss": "0.0.7",
"grunt-exec": "latest",
"spacejam": "latest"
}
}