diff --git a/meteor/README.md b/meteor/README.md new file mode 100644 index 0000000..5a5ce8f --- /dev/null +++ b/meteor/README.md @@ -0,0 +1,27 @@ +[](https://travis-ci.org/MeteorPackaging/javascript-detect-element-resize) + +Packaging [javascript-detect-element-resize](https://github.com/sdecima/javascript-detect-element-resize) for [Meteor.js](http://meteor.com). + + +# Meteor + +If you're new to Meteor, here's what the excitement is all about - +[watch the first two minutes](https://www.youtube.com/watch?v=fsi0aJ9yr2o); you'll be hooked by 1:28. + +That screencast is from 2012. In the meantime, Meteor has become a mature JavaScript-everywhere web +development framework. Read more at [Why Meteor](http://www.meteorpedia.com/read/Why_Meteor). + + +# Issues + +If you encounter an issue while using this package, please CC @gadicc when you file it in this repo. + + +# DONE + +* Instantiation test + + +# TODO + +* Tests ensuring correct event handling on template re-rendering diff --git a/meteor/package.js b/meteor/package.js new file mode 100644 index 0000000..70ba394 --- /dev/null +++ b/meteor/package.js @@ -0,0 +1,39 @@ +// package metadata file for Meteor.js +'use strict'; + +// https://atmospherejs.com/sdecima/javascript-detect-element-resize +var packageName = 'sdecima:javascript-detect-element-resize'; +var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing. + +var packageJson = JSON.parse(Npm.require("fs").readFileSync('package.json')); + +Package.describe({ + name: packageName, + summary: 'Official. Efficient cross-browser, event-based, element resize detection', + version: packageJson.version, + git: 'https://github.com/sdecima/javascript-detect-element-resize' +}); + +Package.onUse(function (api) { + api.versionsFrom(['METEOR@0.9.0', 'METEOR@1.0']); + + /* + * The library doesn't require jQuery; in theory we should only run the jQuery code if + * jQuery is detected, but since jquery is a core Meteor package (for now), we always + * attach it + */ + api.use('jquery', 'client'); + + api.addFiles([ + 'detect-element-resize.js', + 'jquery.resize.js' + ], where + ); +}); + +Package.onTest(function (api) { + api.use(packageName, where); + api.use('tinytest', where); + + api.addFiles('meteor/test.js', where); +}); diff --git a/meteor/publish.sh b/meteor/publish.sh new file mode 100755 index 0000000..77f86d1 --- /dev/null +++ b/meteor/publish.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [[ `pwd` == *meteor ]] ; then cd .. ; fi +ln -s meteor/package.js package.js 2>/dev/null +meteor publish +rm -f .versions versions.json package.js + diff --git a/meteor/test.js b/meteor/test.js new file mode 100644 index 0000000..6e79284 --- /dev/null +++ b/meteor/test.js @@ -0,0 +1,6 @@ +'use strict'; + +Tinytest.add('javascript-detect-element-resize', function (test) { + test.instanceOf(addResizeListener, Function); + test.instanceOf(removeResizeListener, Function); +});