Browse Source

🐞 Fix AMD file paths. Fixes #1088

Same issue as metafizzy/packery#372

👷 build v3.0.1
⬆️ update ev-emitter v1.0.3, fizzy-ui-utils v2.0.2
pull/1122/head v3.0.1
David DeSandro 9 years ago
parent
commit
98ba374a3d
  1. 2
      README.md
  2. 45
      dist/isotope.pkgd.js
  3. 6
      dist/isotope.pkgd.min.js
  4. 11
      gulpfile.js
  5. 2
      js/isotope.js
  6. 2
      package.json
  7. 275
      sandbox/v3-release-gif2.html

2
README.md

@ -13,7 +13,7 @@ See [isotope.metafizzy.co](http://isotope.metafizzy.co) for complete docs and de
### CDN ### CDN
Link directly to [Isotope files on cdnjs](https://cdnjs.com/libraries/jquery.isotope). Link directly to Isotope files on [npmcdn](https://npmcdn.com).
``` html ``` html
<script src="https://npmcdn.com/isotope-layout@3.0/dist/isotope.pkgd.min.js"></script> <script src="https://npmcdn.com/isotope-layout@3.0/dist/isotope.pkgd.min.js"></script>

45
dist/isotope.pkgd.js vendored

@ -1,5 +1,5 @@
/*! /*!
* Isotope PACKAGED v3.0.0 * Isotope PACKAGED v3.0.1
* *
* Licensed GPLv3 for open source use * Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use * or Isotope Commercial License for commercial use
@ -154,7 +154,7 @@ return jQueryBridget;
})); }));
/** /**
* EvEmitter v1.0.2 * EvEmitter v1.0.3
* Lil' event emitter * Lil' event emitter
* MIT License * MIT License
*/ */
@ -163,7 +163,7 @@ return jQueryBridget;
( function( global, factory ) { ( function( global, factory ) {
// universal module definition // universal module definition
/* jshint strict: false */ /* globals define, module */ /* jshint strict: false */ /* globals define, module, window */
if ( typeof define == 'function' && define.amd ) { if ( typeof define == 'function' && define.amd ) {
// AMD - RequireJS // AMD - RequireJS
define( 'ev-emitter/ev-emitter',factory ); define( 'ev-emitter/ev-emitter',factory );
@ -175,7 +175,7 @@ return jQueryBridget;
global.EvEmitter = factory(); global.EvEmitter = factory();
} }
}( this, function() { }( typeof window != 'undefined' ? window : this, function() {
@ -528,7 +528,7 @@ return getSize;
})); }));
/** /**
* Fizzy UI utils v2.0.1 * Fizzy UI utils v2.0.2
* MIT license * MIT license
*/ */
@ -699,7 +699,8 @@ utils.debounceMethod = function( _class, methodName, threshold ) {
// ----- docReady ----- // // ----- docReady ----- //
utils.docReady = function( callback ) { utils.docReady = function( callback ) {
if ( document.readyState == 'complete' ) { var readyState = document.readyState;
if ( readyState == 'complete' || readyState == 'interactive' ) {
callback(); callback();
} else { } else {
document.addEventListener( 'DOMContentLoaded', callback ); document.addEventListener( 'DOMContentLoaded', callback );
@ -2266,7 +2267,7 @@ return Outlayer;
/* jshint strict: false */ /*globals define, module, require */ /* jshint strict: false */ /*globals define, module, require */
if ( typeof define == 'function' && define.amd ) { if ( typeof define == 'function' && define.amd ) {
// AMD // AMD
define( 'isotope/item',[ define( 'isotope/js/item',[
'outlayer/outlayer' 'outlayer/outlayer'
], ],
factory ); factory );
@ -2344,7 +2345,7 @@ return Item;
/* jshint strict: false */ /*globals define, module, require */ /* jshint strict: false */ /*globals define, module, require */
if ( typeof define == 'function' && define.amd ) { if ( typeof define == 'function' && define.amd ) {
// AMD // AMD
define( 'isotope/layout-mode',[ define( 'isotope/js/layout-mode',[
'get-size/get-size', 'get-size/get-size',
'outlayer/outlayer' 'outlayer/outlayer'
], ],
@ -2710,7 +2711,7 @@ return Item;
/* jshint strict: false */ /*globals define, module, require */ /* jshint strict: false */ /*globals define, module, require */
if ( typeof define == 'function' && define.amd ) { if ( typeof define == 'function' && define.amd ) {
// AMD // AMD
define( 'isotope/layout-modes/masonry',[ define( 'isotope/js/layout-modes/masonry',[
'../layout-mode', '../layout-mode',
'masonry/masonry' 'masonry/masonry'
], ],
@ -2783,7 +2784,7 @@ return Item;
/* jshint strict: false */ /*globals define, module, require */ /* jshint strict: false */ /*globals define, module, require */
if ( typeof define == 'function' && define.amd ) { if ( typeof define == 'function' && define.amd ) {
// AMD // AMD
define( 'isotope/layout-modes/fit-rows',[ define( 'isotope/js/layout-modes/fit-rows',[
'../layout-mode' '../layout-mode'
], ],
factory ); factory );
@ -2852,7 +2853,7 @@ return FitRows;
/* jshint strict: false */ /*globals define, module, require */ /* jshint strict: false */ /*globals define, module, require */
if ( typeof define == 'function' && define.amd ) { if ( typeof define == 'function' && define.amd ) {
// AMD // AMD
define( 'isotope/layout-modes/vertical',[ define( 'isotope/js/layout-modes/vertical',[
'../layout-mode' '../layout-mode'
], ],
factory ); factory );
@ -2899,7 +2900,7 @@ return Vertical;
})); }));
/*! /*!
* Isotope v3.0.0 * Isotope v3.0.1
* *
* Licensed GPLv3 for open source use * Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use * or Isotope Commercial License for commercial use
@ -2918,12 +2919,12 @@ return Vertical;
'get-size/get-size', 'get-size/get-size',
'desandro-matches-selector/matches-selector', 'desandro-matches-selector/matches-selector',
'fizzy-ui-utils/utils', 'fizzy-ui-utils/utils',
'./item', 'isotope/js/item',
'./layout-mode', 'isotope/js/layout-mode',
// include default layout modes // include default layout modes
'./layout-modes/masonry', 'isotope/js/layout-modes/masonry',
'./layout-modes/fit-rows', 'isotope/js/layout-modes/fit-rows',
'./layout-modes/vertical' 'isotope/js/layout-modes/vertical'
], ],
function( Outlayer, getSize, matchesSelector, utils, Item, LayoutMode ) { function( Outlayer, getSize, matchesSelector, utils, Item, LayoutMode ) {
return factory( window, Outlayer, getSize, matchesSelector, utils, Item, LayoutMode ); return factory( window, Outlayer, getSize, matchesSelector, utils, Item, LayoutMode );
@ -2936,12 +2937,12 @@ return Vertical;
require('get-size'), require('get-size'),
require('desandro-matches-selector'), require('desandro-matches-selector'),
require('fizzy-ui-utils'), require('fizzy-ui-utils'),
require('./item'), require('isotope/js/item'),
require('./layout-mode'), require('isotope/js/layout-mode'),
// include default layout modes // include default layout modes
require('./layout-modes/masonry'), require('isotope/js/layout-modes/masonry'),
require('./layout-modes/fit-rows'), require('isotope/js/layout-modes/fit-rows'),
require('./layout-modes/vertical') require('isotope/js/layout-modes/vertical')
); );
} else { } else {
// browser global // browser global

6
dist/isotope.pkgd.min.js vendored

File diff suppressed because one or more lines are too long

11
gulpfile.js

@ -56,6 +56,7 @@ function addBanner( str ) {
var rjsOptimize = require('gulp-requirejs-optimize'); var rjsOptimize = require('gulp-requirejs-optimize');
gulp.task( 'requirejs', function() { gulp.task( 'requirejs', function() {
var definitionRE = /define\(\s*'isotope\/isotope'(.|\n)+\],/;
var banner = getBanner(); var banner = getBanner();
// HACK src is not needed // HACK src is not needed
// should refactor rjsOptimize to produce src // should refactor rjsOptimize to produce src
@ -72,8 +73,14 @@ gulp.task( 'requirejs', function() {
jquery: 'empty:' jquery: 'empty:'
} }
}) ) }) )
// remove named module // munge AMD definition
.pipe( replace( "'isotope/isotope',", '' ) ) .pipe( replace( definitionRE, function( definition ) {
// remove named module
return definition.replace( "'isotope/isotope',", '' )
// use explicit file paths, './item' -> 'isotope/js/item'
.replace( /'.\//g, "'isotope/js/" );
}) )
.pipe( replace( "define( 'isotope/", "define( 'isotope/js/" ) )
// add banner // add banner
.pipe( addBanner( banner ) ) .pipe( addBanner( banner ) )
.pipe( rename('isotope.pkgd.js') ) .pipe( rename('isotope.pkgd.js') )

2
js/isotope.js

@ -1,5 +1,5 @@
/*! /*!
* Isotope v3.0.0 * Isotope v3.0.1
* *
* Licensed GPLv3 for open source use * Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use * or Isotope Commercial License for commercial use

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "isotope-layout", "name": "isotope-layout",
"version": "3.0.0", "version": "3.0.1",
"description": "Filter and sort magical layouts", "description": "Filter and sort magical layouts",
"main": "js/isotope.js", "main": "js/isotope.js",
"dependencies": { "dependencies": {

275
sandbox/v3-release-gif2.html

@ -0,0 +1,275 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>v3 release gif</title>
<style>
/* Texta Regular */
@font-face {
font-family: 'Texta';
src: url('../../metafizzy.co/assets/fonts/2D333F_2_0.woff2') format('woff2'),
url('../../metafizzy.co/assets/fonts/2D333F_2_0.woff') format('woff');
}
/* Texta Heavy */
@font-face {
font-family: 'Texta';
font-weight: bold;
font-style: normal;
src: url('../../metafizzy.co/assets/fonts/2D333F_0_0.woff2') format('woff2'),
url('../../metafizzy.co/assets/fonts/2D333F_0_0.woff') format('woff');
}
/* Texta Italic */
@font-face {
font-family: 'Texta';
font-weight: normal;
font-style: italic;
src: url('../../metafizzy.co/assets/fonts/2D333F_1_0.woff2') format('woff2'),
url('../../metafizzy.co/assets/fonts/2D333F_1_0.woff') format('woff');
}
html {
font-size: 17px;
}
body {
color: #EEE;
background: #333;
font-family: Texta;
width: 800px;
margin: 0 auto;
}
.grid {
width: 375px;
}
.grid-item {
position: relative;
float: left;
width: 60px;
height: 60px;
border-radius: 5px;
color: white;
font-size: 1.4rem;
line-height: 1;
margin: 0 5px 5px 0;
}
.grid-item--red { background: #C25; }
.grid-item--gold { background: #EA0; }
.grid-item--blue { background: #19F; }
.grid-item__letter {
position: absolute;
top: 6px;
left: 6px;
}
.grid-item__number {
position: absolute;
bottom: 6px;
right: 6px;
color: #222;
font-weight: bold;
}
/* button
------------------------- */
.button {
display: block;
padding: 10px 12px;
border: none;
background-color: #EEE;
color: #333;
line-height: 1;
font-size: 13px;
}
.button:hover {
background-color: #FFF;
cursor:pointer;
}
.button:active {
background-color: #EEE;
}
.button:focus {
outline: none;
/* outline: 5px auto -webkit-focus-ring-color;*/
/* outline-offset: -2px;*/
background-color: white;
}
.button.is-selected {
background-color: #19F;
color: white;
}
/* button group
------------------------- */
.button-group {
margin-bottom: 20px;
display: -webkit-flex;
display: flex;
}
.button-group .button {
margin-right: 1px;
}
.button-group .button:first-child {
border-radius: 8px 0 0 8px;
}
.button-group .button:last-child {
border-radius: 0 8px 8px 0;
border-right: 1px solid #BBB;
}
</style>
</head>
<body>
<h1>v3 release gif</h1>
<div class="button-group">
<button class="button is-selected" data-arrange='{ "filter": "*", "sortBy": "original-order" }'>Original</button>
<button class="button" data-arrange='{ "filter": ".grid-item--red" }'>Red</button>
<button class="button" data-arrange='{ "filter": ".grid-item--red, .grid-item--gold" }'>Red &amp; Gold</button>
<button class="button" data-arrange='{ "filter": ".grid-item--blue" }'>Blue</button>
<button class="button" data-arrange='{ "sortBy": "number" }'>123</button>
</div>
<div class="grid">
<div class="grid-item grid-item--red">
<span class="grid-item__letter">A</span>
<span class="grid-item__number">8</span>
</div>
<div class="grid-item grid-item--blue">
<span class="grid-item__letter">B</span>
<span class="grid-item__number">12</span>
</div>
<div class="grid-item grid-item--gold">
<span class="grid-item__letter">C</span>
<span class="grid-item__number">15</span>
</div>
<div class="grid-item grid-item--gold">
<span class="grid-item__letter">D</span>
<span class="grid-item__number">10</span>
</div>
<div class="grid-item grid-item--red">
<span class="grid-item__letter">E</span>
<span class="grid-item__number">9</span>
</div>
<div class="grid-item grid-item--blue">
<span class="grid-item__letter">F</span>
<span class="grid-item__number">3</span>
</div>
<div class="grid-item grid-item--red">
<span class="grid-item__letter">G</span>
<span class="grid-item__number">4</span>
</div>
<div class="grid-item grid-item--red">
<span class="grid-item__letter">H</span>
<span class="grid-item__number">12</span>
</div>
<div class="grid-item grid-item--gold">
<span class="grid-item__letter">I</span>
<span class="grid-item__number">16</span>
</div>
<div class="grid-item grid-item--red">
<span class="grid-item__letter">J</span>
<span class="grid-item__number">1</span>
</div>
<div class="grid-item grid-item--blue">
<span class="grid-item__letter">K</span>
<span class="grid-item__number">11</span>
</div>
<div class="grid-item grid-item--blue">
<span class="grid-item__letter">L</span>
<span class="grid-item__number">7</span>
</div>
<div class="grid-item grid-item--red">
<span class="grid-item__letter">M</span>
<span class="grid-item__number">19</span>
</div>
<div class="grid-item grid-item--gold">
<span class="grid-item__letter">N</span>
<span class="grid-item__number">13</span>
</div>
<div class="grid-item grid-item--blue">
<span class="grid-item__letter">O</span>
<span class="grid-item__number">17</span>
</div>
<div class="grid-item grid-item--gold">
<span class="grid-item__letter">P</span>
<span class="grid-item__number">14</span>
</div>
<div class="grid-item grid-item--red">
<span class="grid-item__letter">Q</span>
<span class="grid-item__number">20</span>
</div>
<div class="grid-item grid-item--blue">
<span class="grid-item__letter">R</span>
<span class="grid-item__number">6</span>
</div>
<div class="grid-item grid-item--red">
<span class="grid-item__letter">S</span>
<span class="grid-item__number">2</span>
</div>
<div class="grid-item grid-item--red">
<span class="grid-item__letter">T</span>
<span class="grid-item__number">5</span>
</div>
</div>
<script src="../bower_components/ev-emitter/ev-emitter.js"></script>
<script src="../bower_components/get-size/get-size.js"></script>
<script src="../bower_components/desandro-matches-selector/matches-selector.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>
<script src="../js/layout-mode.js"></script>
<script src="../js/item.js"></script>
<script src="../js/isotope.js"></script>
<script src="../js/layout-modes/fit-rows.js"></script>
<script>
var iso = new Isotope( '.grid', {
layoutMode: 'fitRows',
// transitionDuration: '0.3s',
stagger: 30,
getSortData: {
letter: '.grid-item__letter',
number: '.grid-item__number parseInt'
}
});
var buttonGroup = document.querySelector('.button-group');
buttonGroup.onclick = function() {
var arrangeAttr = event.target.getAttribute('data-arrange');
iso.arrange( JSON.parse( arrangeAttr ) );
// change is-selected class
buttonGroup.querySelector('.is-selected').classList.remove('is-selected');
event.target.classList.add('is-selected');
}
</script>
</body>
</html>
Loading…
Cancel
Save