From b830853c84530d821a6341d85c38e8e74e44d7b9 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Sat, 20 Jul 2013 17:56:44 -0400 Subject: [PATCH] add better RequireJS support ref #296 ref desandro/requirejs-bower-homework#1 --- .jshintrc | 2 +- bower.json | 6 +++--- examples/require-js.html | 41 ++++++++++++++++++++++++++++++++++++++++ examples/require-js.js | 21 ++++++++++++++++++++ masonry.js | 6 +++--- 5 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 examples/require-js.html create mode 100644 examples/require-js.js diff --git a/.jshintrc b/.jshintrc index c686ef2c..0e3157cc 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,6 +1,6 @@ { "browser": true, - "devel": true, + "devel": false, "strict": true, "undef": true, "unused": true, diff --git a/bower.json b/bower.json index ee43ef01..fa0f1027 100644 --- a/bower.json +++ b/bower.json @@ -1,11 +1,11 @@ { "name": "masonry", - "version": "3.0.3", + "version": "3.1.0", "description": "Cascading grid layout library", "main": "masonry.js", "dependencies": { - "get-size": "desandro/get-size", - "outlayer": "metafizzy/outlayer#>=0.4.0" + "get-size": "desandro/get-size#>=1.1.4 <2.0", + "outlayer": ">=1.1.0 <2.0" }, "devDependencies": { "doc-ready": "desandro/doc-ready", diff --git a/examples/require-js.html b/examples/require-js.html new file mode 100644 index 00000000..6156c5ac --- /dev/null +++ b/examples/require-js.html @@ -0,0 +1,41 @@ + + + + + + require js + + + + + + + +

require js

+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + diff --git a/examples/require-js.js b/examples/require-js.js new file mode 100644 index 00000000..252c1262 --- /dev/null +++ b/examples/require-js.js @@ -0,0 +1,21 @@ +/*global requirejs: false*/ + +requirejs.config({ + baseUrl: '../bower_components' + // OR + // paths: { + // eventie: '../bower_components/eventie', + // 'doc-ready': '../bower_components/doc-ready', + // eventEmitter: '../bower_components/eventEmitter', + // 'get-style-property': '../bower_components/get-style-property', + // 'get-size': '../bower_components/get-size', + // 'matches-selector': '../bower_components/matches-selector', + // outlayer: '../bower_components/outlayer' + // } +}); + +requirejs( [ '../masonry' ], function( Masonry ) { + + new Masonry( document.querySelector('#basic') ); + +}); diff --git a/masonry.js b/masonry.js index 39e42089..c831e9b4 100644 --- a/masonry.js +++ b/masonry.js @@ -1,5 +1,5 @@ /*! - * Masonry v3.0.3 + * Masonry v3.1.0 * Cascading grid layout library * http://masonry.desandro.com * MIT License @@ -196,8 +196,8 @@ function masonryDefinition( Outlayer, getSize ) { if ( typeof define === 'function' && define.amd ) { // AMD define( [ - 'outlayer', - 'get-size' + 'outlayer/outlayer', + 'get-size/get-size' ], masonryDefinition ); } else {