added session 75 and changed about

This commit is contained in:
Kiritan Flux 2018-09-11 12:59:44 +02:00
parent 67d2a1ed53
commit 44d1d89fa5
184 changed files with 57277 additions and 51455 deletions

View file

@ -2,42 +2,42 @@
_Filter & sort magical layouts_
See [isotope.metafizzy.co](http://isotope.metafizzy.co) for complete docs and demos.
See [isotope.metafizzy.co](https://isotope.metafizzy.co) for complete docs and demos.
## Install
### Download
+ [isotope.pkgd.js](https://npmcdn.com/isotope-layout@3/dist/isotope.pkgd.js) un-minified, or
+ [isotope.pkgd.min.js](https://npmcdn.com/isotope-layout@3/dist/isotope.pkgd.min.js) minified
+ [isotope.pkgd.js](https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.js) un-minified, or
+ [isotope.pkgd.min.js](https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js) minified
### CDN
Link directly to Isotope files on [npmcdn](https://npmcdn.com).
Link directly to Isotope files on [unpkg](https://unpkg.com).
``` html
<script src="https://npmcdn.com/isotope-layout@3.0/dist/isotope.pkgd.min.js"></script>
<script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js"></script>
<!-- or -->
<script src="https://npmcdn.com/isotope-layout@3.0/dist/isotope.pkgd.js"></script>
<script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.js"></script>
```
### Package managers
npm: `npm install isotope-layout --save`
Bower: `bower install isotope --save`
Bower: `bower install isotope-layout --save`
## License
### Commercial license
If you want to use Isotope to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary. Purchase an Isotope Commercial License at [isotope.metafizzy.co](http://isotope.metafizzy.co/#commercial-license)
If you want to use Isotope to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary. Purchase an Isotope Commercial License at [isotope.metafizzy.co](https://isotope.metafizzy.co/#commercial-license)
### Open source license
If you are creating an open source application under a license compatible with the [GNU GPL license v3](https://www.gnu.org/licenses/gpl-3.0.html), you may use Isotope under the terms of the GPLv3.
[Read more about Isotope's license](http://isotope.metafizzy.co/license.html).
[Read more about Isotope's license](https://isotope.metafizzy.co/license.html).
## Initialize
@ -82,4 +82,4 @@ Add a `data-isotope` attribute to your element. Options can be set in JSON in th
* * *
By [Metafizzy](http://metafizzy.co), 20102016
By [Metafizzy 🌈🐻](https://metafizzy.co), 20102018

View file

@ -1,18 +1,18 @@
{
"name": "isotope",
"name": "isotope-layout",
"description": "Filter and sort magical layouts",
"main": "js/isotope.js",
"dependencies": {
"desandro-matches-selector": "^2.0.0",
"fizzy-ui-utils": "^2.0.0",
"fizzy-ui-utils": "^2.0.4",
"get-size": "^2.0.0",
"masonry": "^4.1.0",
"masonry-layout": "^4.1.0",
"outlayer": "^2.1.0"
},
"devDependencies": {
"jquery": "2 < 4",
"jquery": "^3.3.1",
"jquery-bridget": "^2",
"qunit": "^1.15"
"qunit": "^2.6.0"
},
"ignore": [
"test/",
@ -25,7 +25,7 @@
"test",
"tests"
],
"homepage": "http://isotope.metafizzy.co",
"homepage": "https://isotope.metafizzy.co",
"authors": [
"David DeSandro"
],

View file

@ -1,29 +1,28 @@
/*!
* Isotope PACKAGED v3.0.1
* Isotope PACKAGED v3.0.6
*
* Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use
*
* http://isotope.metafizzy.co
* Copyright 2016 Metafizzy
* https://isotope.metafizzy.co
* Copyright 2010-2018 Metafizzy
*/
/**
* Bridget makes jQuery widgets
* v2.0.0
* v2.0.1
* MIT license
*/
/* jshint browser: true, strict: true, undef: true, unused: true */
( function( window, factory ) {
'use strict';
/* globals define: false, module: false, require: false */
// universal module definition
/*jshint strict: false */ /* globals define, module, require */
if ( typeof define == 'function' && define.amd ) {
// AMD
define( 'jquery-bridget/jquery-bridget',[ 'jquery' ], function( jQuery ) {
factory( window, jQuery );
return factory( window, jQuery );
});
} else if ( typeof module == 'object' && module.exports ) {
// CommonJS
@ -154,7 +153,7 @@ return jQueryBridget;
}));
/**
* EvEmitter v1.0.3
* EvEmitter v1.1.0
* Lil' event emitter
* MIT License
*/
@ -234,13 +233,14 @@ proto.emitEvent = function( eventName, args ) {
if ( !listeners || !listeners.length ) {
return;
}
var i = 0;
var listener = listeners[i];
// copy over to avoid interference if .off() in listener
listeners = listeners.slice(0);
args = args || [];
// once stuff
var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
while ( listener ) {
for ( var i=0; i < listeners.length; i++ ) {
var listener = listeners[i]
var isOnce = onceListeners && onceListeners[ listener ];
if ( isOnce ) {
// remove listener
@ -251,35 +251,34 @@ proto.emitEvent = function( eventName, args ) {
}
// trigger listener
listener.apply( this, args );
// get next listener
i += isOnce ? 0 : 1;
listener = listeners[i];
}
return this;
};
proto.allOff = function() {
delete this._events;
delete this._onceEvents;
};
return EvEmitter;
}));
/*!
* getSize v2.0.2
* getSize v2.0.3
* measure size of elements
* MIT license
*/
/*jshint browser: true, strict: true, undef: true, unused: true */
/*global define: false, module: false, console: false */
/* jshint browser: true, strict: true, undef: true, unused: true */
/* globals console: false */
( function( window, factory ) {
'use strict';
/* jshint strict: false */ /* globals define, module */
if ( typeof define == 'function' && define.amd ) {
// AMD
define( 'get-size/get-size',[],function() {
return factory();
});
define( 'get-size/get-size',factory );
} else if ( typeof module == 'object' && module.exports ) {
// CommonJS
module.exports = factory();
@ -354,7 +353,7 @@ function getStyle( elem ) {
if ( !style ) {
logError( 'Style returned ' + style +
'. Are you running this code in a hidden iframe on Firefox? ' +
'See http://bit.ly/getsizebug1' );
'See https://bit.ly/getsizebug1' );
}
return style;
}
@ -380,8 +379,8 @@ function setup() {
// -------------------------- box sizing -------------------------- //
/**
* WebKit measures the outer-width on style.width on border-box elems
* IE & Firefox<29 measures the inner-width
* Chrome & Safari measure the outer-width on style.width on border-box elems
* IE11 & Firefox<29 measures the inner-width
*/
var div = document.createElement('div');
div.style.width = '200px';
@ -393,10 +392,11 @@ function setup() {
var body = document.body || document.documentElement;
body.appendChild( div );
var style = getStyle( div );
// round value for browser zoom. desandro/masonry#928
isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;
getSize.isBoxSizeOuter = isBoxSizeOuter;
getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize( style.width ) == 200;
body.removeChild( div );
}
// -------------------------- getSize -------------------------- //
@ -474,7 +474,7 @@ return getSize;
});
/**
* matchesSelector v2.0.1
* matchesSelector v2.0.2
* matchesSelector( element, '.selector' )
* MIT license
*/
@ -500,7 +500,7 @@ return getSize;
'use strict';
var matchesMethod = ( function() {
var ElemProto = Element.prototype;
var ElemProto = window.Element.prototype;
// check for the standard method name first
if ( ElemProto.matches ) {
return 'matches';
@ -528,7 +528,7 @@ return getSize;
}));
/**
* Fizzy UI utils v2.0.2
* Fizzy UI utils v2.0.7
* MIT license
*/
@ -583,22 +583,27 @@ utils.modulo = function( num, div ) {
// ----- makeArray ----- //
var arraySlice = Array.prototype.slice;
// turn element or nodeList into an array
utils.makeArray = function( obj ) {
var ary = [];
if ( Array.isArray( obj ) ) {
// use object if already an array
ary = obj;
} else if ( obj && typeof obj.length == 'number' ) {
// convert nodeList to array
for ( var i=0; i < obj.length; i++ ) {
ary.push( obj[i] );
}
} else {
// array of single index
ary.push( obj );
return obj;
}
return ary;
// return empty array if undefined or null. #6
if ( obj === null || obj === undefined ) {
return [];
}
var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
if ( isArrayLike ) {
// convert nodeList to array
return arraySlice.call( obj );
}
// array of single index
return [ obj ];
};
// ----- removeFrom ----- //
@ -613,7 +618,7 @@ utils.removeFrom = function( ary, obj ) {
// ----- getParent ----- //
utils.getParent = function( elem, selector ) {
while ( elem != document.body ) {
while ( elem.parentNode && elem != document.body ) {
elem = elem.parentNode;
if ( matchesSelector( elem, selector ) ) {
return elem;
@ -677,22 +682,21 @@ utils.filterFindElements = function( elems, selector ) {
// ----- debounceMethod ----- //
utils.debounceMethod = function( _class, methodName, threshold ) {
threshold = threshold || 100;
// original method
var method = _class.prototype[ methodName ];
var timeoutName = methodName + 'Timeout';
_class.prototype[ methodName ] = function() {
var timeout = this[ timeoutName ];
if ( timeout ) {
clearTimeout( timeout );
}
var args = arguments;
clearTimeout( timeout );
var args = arguments;
var _this = this;
this[ timeoutName ] = setTimeout( function() {
method.apply( _this, args );
delete _this[ timeoutName ];
}, threshold || 100 );
}, threshold );
};
};
@ -701,7 +705,8 @@ utils.debounceMethod = function( _class, methodName, threshold ) {
utils.docReady = function( callback ) {
var readyState = document.readyState;
if ( readyState == 'complete' || readyState == 'interactive' ) {
callback();
// do async to allow for other scripts to run. metafizzy/flickity#441
setTimeout( callback );
} else {
document.addEventListener( 'DOMContentLoaded', callback );
}
@ -749,7 +754,7 @@ utils.htmlInit = function( WidgetClass, namespace ) {
}
// initialize
var instance = new WidgetClass( elem, options );
// make available via $().data('layoutname')
// make available via $().data('namespace')
if ( jQuery ) {
jQuery.data( elem, namespace, instance );
}
@ -899,13 +904,16 @@ proto.getPosition = function() {
var isOriginTop = this.layout._getOption('originTop');
var xValue = style[ isOriginLeft ? 'left' : 'right' ];
var yValue = style[ isOriginTop ? 'top' : 'bottom' ];
var x = parseFloat( xValue );
var y = parseFloat( yValue );
// convert percent to pixels
var layoutSize = this.layout.size;
var x = xValue.indexOf('%') != -1 ?
( parseFloat( xValue ) / 100 ) * layoutSize.width : parseInt( xValue, 10 );
var y = yValue.indexOf('%') != -1 ?
( parseFloat( yValue ) / 100 ) * layoutSize.height : parseInt( yValue, 10 );
if ( xValue.indexOf('%') != -1 ) {
x = ( x / 100 ) * layoutSize.width;
}
if ( yValue.indexOf('%') != -1 ) {
y = ( y / 100 ) * layoutSize.height;
}
// clean up 'auto' or other non-integer values
x = isNaN( x ) ? 0 : x;
y = isNaN( y ) ? 0 : y;
@ -968,9 +976,7 @@ proto._transitionTo = function( x, y ) {
var curX = this.position.x;
var curY = this.position.y;
var compareX = parseInt( x, 10 );
var compareY = parseInt( y, 10 );
var didNotMove = compareX === this.position.x && compareY === this.position.y;
var didNotMove = x == this.position.x && y == this.position.y;
// save end position
this.setPosition( x, y );
@ -1013,8 +1019,8 @@ proto.goTo = function( x, y ) {
proto.moveTo = proto._transitionTo;
proto.setPosition = function( x, y ) {
this.position.x = parseInt( x, 10 );
this.position.y = parseInt( y, 10 );
this.position.x = parseFloat( x );
this.position.y = parseFloat( y );
};
// ----- transition ----- //
@ -1319,7 +1325,7 @@ return Item;
}));
/*!
* Outlayer v2.1.0
* Outlayer v2.1.1
* the brains and guts of a layout library
* MIT license
*/
@ -2267,7 +2273,7 @@ return Outlayer;
/* jshint strict: false */ /*globals define, module, require */
if ( typeof define == 'function' && define.amd ) {
// AMD
define( 'isotope/js/item',[
define( 'isotope-layout/js/item',[
'outlayer/outlayer'
],
factory );
@ -2345,7 +2351,7 @@ return Item;
/* jshint strict: false */ /*globals define, module, require */
if ( typeof define == 'function' && define.amd ) {
// AMD
define( 'isotope/js/layout-mode',[
define( 'isotope-layout/js/layout-mode',[
'get-size/get-size',
'outlayer/outlayer'
],
@ -2495,9 +2501,9 @@ return Item;
}));
/*!
* Masonry v4.1.0
* Masonry v4.2.1
* Cascading grid layout library
* http://masonry.desandro.com
* https://masonry.desandro.com
* MIT License
* by David DeSandro
*/
@ -2507,7 +2513,7 @@ return Item;
/* jshint strict: false */ /*globals define, module, require */
if ( typeof define == 'function' && define.amd ) {
// AMD
define( 'masonry/masonry',[
define( 'masonry-layout/masonry',[
'outlayer/outlayer',
'get-size/get-size'
],
@ -2537,7 +2543,9 @@ return Item;
// isFitWidth -> fitWidth
Masonry.compatOptions.fitWidth = 'isFitWidth';
Masonry.prototype._resetLayout = function() {
var proto = Masonry.prototype;
proto._resetLayout = function() {
this.getSize();
this._getMeasurement( 'columnWidth', 'outerWidth' );
this._getMeasurement( 'gutter', 'outerWidth' );
@ -2550,9 +2558,10 @@ return Item;
}
this.maxY = 0;
this.horizontalColIndex = 0;
};
Masonry.prototype.measureColumns = function() {
proto.measureColumns = function() {
this.getContainerWidth();
// if columnWidth is 0, default to outerWidth of first item
if ( !this.columnWidth ) {
@ -2577,7 +2586,7 @@ return Item;
this.cols = Math.max( cols, 1 );
};
Masonry.prototype.getContainerWidth = function() {
proto.getContainerWidth = function() {
// container is parent if fit width
var isFitWidth = this._getOption('fitWidth');
var container = isFitWidth ? this.element.parentNode : this.element;
@ -2587,7 +2596,7 @@ return Item;
this.containerWidth = size && size.innerWidth;
};
Masonry.prototype._getItemLayoutPosition = function( item ) {
proto._getItemLayoutPosition = function( item ) {
item.getSize();
// how many columns does this brick span
var remainder = item.size.outerWidth % this.columnWidth;
@ -2595,33 +2604,41 @@ return Item;
// round if off by 1 pixel, otherwise use ceil
var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth );
colSpan = Math.min( colSpan, this.cols );
var colGroup = this._getColGroup( colSpan );
// get the minimum Y value from the columns
var minimumY = Math.min.apply( Math, colGroup );
var shortColIndex = colGroup.indexOf( minimumY );
// use horizontal or top column position
var colPosMethod = this.options.horizontalOrder ?
'_getHorizontalColPosition' : '_getTopColPosition';
var colPosition = this[ colPosMethod ]( colSpan, item );
// position the brick
var position = {
x: this.columnWidth * shortColIndex,
y: minimumY
x: this.columnWidth * colPosition.col,
y: colPosition.y
};
// apply setHeight to necessary columns
var setHeight = minimumY + item.size.outerHeight;
var setSpan = this.cols + 1 - colGroup.length;
for ( var i = 0; i < setSpan; i++ ) {
this.colYs[ shortColIndex + i ] = setHeight;
var setHeight = colPosition.y + item.size.outerHeight;
var setMax = colSpan + colPosition.col;
for ( var i = colPosition.col; i < setMax; i++ ) {
this.colYs[i] = setHeight;
}
return position;
};
proto._getTopColPosition = function( colSpan ) {
var colGroup = this._getTopColGroup( colSpan );
// get the minimum Y value from the columns
var minimumY = Math.min.apply( Math, colGroup );
return {
col: colGroup.indexOf( minimumY ),
y: minimumY,
};
};
/**
* @param {Number} colSpan - number of columns the element spans
* @returns {Array} colGroup
*/
Masonry.prototype._getColGroup = function( colSpan ) {
proto._getTopColGroup = function( colSpan ) {
if ( colSpan < 2 ) {
// if brick spans only one column, use all the column Ys
return this.colYs;
@ -2632,15 +2649,38 @@ return Item;
var groupCount = this.cols + 1 - colSpan;
// for each group potential horizontal position
for ( var i = 0; i < groupCount; i++ ) {
// make an array of colY values for that one group
var groupColYs = this.colYs.slice( i, i + colSpan );
// and get the max value of the array
colGroup[i] = Math.max.apply( Math, groupColYs );
colGroup[i] = this._getColGroupY( i, colSpan );
}
return colGroup;
};
Masonry.prototype._manageStamp = function( stamp ) {
proto._getColGroupY = function( col, colSpan ) {
if ( colSpan < 2 ) {
return this.colYs[ col ];
}
// make an array of colY values for that one group
var groupColYs = this.colYs.slice( col, col + colSpan );
// and get the max value of the array
return Math.max.apply( Math, groupColYs );
};
// get column position based on horizontal index. #873
proto._getHorizontalColPosition = function( colSpan, item ) {
var col = this.horizontalColIndex % this.cols;
var isOver = colSpan > 1 && col + colSpan > this.cols;
// shift to next row if item can't fit on current row
col = isOver ? 0 : col;
// don't let zero-size items take up space
var hasSize = item.size.outerWidth && item.size.outerHeight;
this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex;
return {
col: col,
y: this._getColGroupY( col, colSpan ),
};
};
proto._manageStamp = function( stamp ) {
var stampSize = getSize( stamp );
var offset = this._getElementOffset( stamp );
// get the columns that this stamp affects
@ -2663,7 +2703,7 @@ return Item;
}
};
Masonry.prototype._getContainerSize = function() {
proto._getContainerSize = function() {
this.maxY = Math.max.apply( Math, this.colYs );
var size = {
height: this.maxY
@ -2676,7 +2716,7 @@ return Item;
return size;
};
Masonry.prototype._getContainerFitWidth = function() {
proto._getContainerFitWidth = function() {
var unusedCols = 0;
// count unused columns
var i = this.cols;
@ -2690,7 +2730,7 @@ return Item;
return ( this.cols - unusedCols ) * this.columnWidth - this.gutter;
};
Masonry.prototype.needsResizeLayout = function() {
proto.needsResizeLayout = function() {
var previousWidth = this.containerWidth;
this.getContainerWidth();
return previousWidth != this.containerWidth;
@ -2703,7 +2743,7 @@ return Item;
/*!
* Masonry layout mode
* sub-classes Masonry
* http://masonry.desandro.com
* https://masonry.desandro.com
*/
( function( window, factory ) {
@ -2711,9 +2751,9 @@ return Item;
/* jshint strict: false */ /*globals define, module, require */
if ( typeof define == 'function' && define.amd ) {
// AMD
define( 'isotope/js/layout-modes/masonry',[
define( 'isotope-layout/js/layout-modes/masonry',[
'../layout-mode',
'masonry/masonry'
'masonry-layout/masonry'
],
factory );
} else if ( typeof module == 'object' && module.exports ) {
@ -2784,7 +2824,7 @@ return Item;
/* jshint strict: false */ /*globals define, module, require */
if ( typeof define == 'function' && define.amd ) {
// AMD
define( 'isotope/js/layout-modes/fit-rows',[
define( 'isotope-layout/js/layout-modes/fit-rows',[
'../layout-mode'
],
factory );
@ -2853,7 +2893,7 @@ return FitRows;
/* jshint strict: false */ /*globals define, module, require */
if ( typeof define == 'function' && define.amd ) {
// AMD
define( 'isotope/js/layout-modes/vertical',[
define( 'isotope-layout/js/layout-modes/vertical',[
'../layout-mode'
],
factory );
@ -2900,13 +2940,13 @@ return Vertical;
}));
/*!
* Isotope v3.0.1
* Isotope v3.0.6
*
* Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use
*
* http://isotope.metafizzy.co
* Copyright 2016 Metafizzy
* https://isotope.metafizzy.co
* Copyright 2010-2018 Metafizzy
*/
( function( window, factory ) {
@ -2919,12 +2959,12 @@ return Vertical;
'get-size/get-size',
'desandro-matches-selector/matches-selector',
'fizzy-ui-utils/utils',
'isotope/js/item',
'isotope/js/layout-mode',
'isotope-layout/js/item',
'isotope-layout/js/layout-mode',
// include default layout modes
'isotope/js/layout-modes/masonry',
'isotope/js/layout-modes/fit-rows',
'isotope/js/layout-modes/vertical'
'isotope-layout/js/layout-modes/masonry',
'isotope-layout/js/layout-modes/fit-rows',
'isotope-layout/js/layout-modes/vertical'
],
function( Outlayer, getSize, matchesSelector, utils, Item, LayoutMode ) {
return factory( window, Outlayer, getSize, matchesSelector, utils, Item, LayoutMode );
@ -2937,12 +2977,12 @@ return Vertical;
require('get-size'),
require('desandro-matches-selector'),
require('fizzy-ui-utils'),
require('isotope/js/item'),
require('isotope/js/layout-mode'),
require('isotope-layout/js/item'),
require('isotope-layout/js/layout-mode'),
// include default layout modes
require('isotope/js/layout-modes/masonry'),
require('isotope/js/layout-modes/fit-rows'),
require('isotope/js/layout-modes/vertical')
require('isotope-layout/js/layout-modes/masonry'),
require('isotope-layout/js/layout-modes/fit-rows'),
require('isotope-layout/js/layout-modes/vertical')
);
} else {
// browser global
@ -3303,20 +3343,28 @@ var trim = String.prototype.trim ?
// sort filteredItem order
proto._sort = function() {
var sortByOpt = this.options.sortBy;
if ( !sortByOpt ) {
if ( !this.options.sortBy ) {
return;
}
// concat all sortBy and sortHistory
var sortBys = [].concat.apply( sortByOpt, this.sortHistory );
// sort magic
var itemSorter = getItemSorter( sortBys, this.options.sortAscending );
this.filteredItems.sort( itemSorter );
// keep track of sortBy History
if ( sortByOpt != this.sortHistory[0] ) {
// add to front, oldest goes in last
this.sortHistory.unshift( sortByOpt );
var sortBys = utils.makeArray( this.options.sortBy );
if ( !this._getIsSameSortBy( sortBys ) ) {
// concat all sortBy and sortHistory, add to front, oldest goes in last
this.sortHistory = sortBys.concat( this.sortHistory );
}
// sort magic
var itemSorter = getItemSorter( this.sortHistory, this.options.sortAscending );
this.filteredItems.sort( itemSorter );
};
// check if sortBys is same as start of sortHistory
proto._getIsSameSortBy = function( sortBys ) {
for ( var i=0; i < sortBys.length; i++ ) {
if ( sortBys[i] != this.sortHistory[i] ) {
return false;
}
}
return true;
};
// returns a function used for sorting

File diff suppressed because one or more lines are too long

View file

@ -56,7 +56,7 @@ function addBanner( str ) {
var rjsOptimize = require('gulp-requirejs-optimize');
gulp.task( 'requirejs', function() {
var definitionRE = /define\(\s*'isotope\/isotope'(.|\n)+\],/;
var definitionRE = /define\(\s*'isotope\-layout\/\js\/isotope'(.|\n)+\],/;
var banner = getBanner();
// HACK src is not needed
// should refactor rjsOptimize to produce src
@ -66,21 +66,20 @@ gulp.task( 'requirejs', function() {
optimize: 'none',
include: [
'jquery-bridget/jquery-bridget',
'isotope/isotope'
'isotope-layout/js/isotope'
],
paths: {
isotope: '../js/',
'isotope-layout': '../',
jquery: 'empty:'
}
}) )
// munge AMD definition
.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/" );
return definition.replace( "'isotope-layout/js/isotope',", '' )
// use explicit file paths, './item' -> 'isotope-layout/js/item'
.replace( /'.\//g, "'isotope-layout/js/" );
}) )
.pipe( replace( "define( 'isotope/", "define( 'isotope/js/" ) )
// add banner
.pipe( addBanner( banner ) )
.pipe( rename('isotope.pkgd.js') )
@ -121,17 +120,12 @@ gulp.task( 'version', function() {
gutil.log( 'ticking version to ' + chalk.green( version ) );
gulp.src('js/isotope.js')
.pipe( replace( /Packery v\d\.\d+\.\d+/, 'Isotope v' + version ) )
.pipe( replace( /Isotope v\d\.\d+\.\d+/, 'Isotope v' + version ) )
.pipe( gulp.dest('js') );
gulp.src( [ 'package.json' ] )
.pipe( replace( /"version": "\d\.\d+\.\d+"/, '"version": "' + version + '"' ) )
.pipe( gulp.dest('.') );
// replace CDN links in README
var minorVersion = version.match( /^\d\.\d+/ )[0];
gulp.src('README.md')
.pipe( replace( /isotope-layout@\d\.\d+/g, 'isotope-layout@' + minorVersion ))
.pipe( gulp.dest('.') );
});
// ----- default ----- //

View file

@ -1,11 +1,11 @@
/*!
* Isotope v3.0.1
* Isotope v3.0.6
*
* Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use
*
* http://isotope.metafizzy.co
* Copyright 2016 Metafizzy
* https://isotope.metafizzy.co
* Copyright 2010-2018 Metafizzy
*/
( function( window, factory ) {
@ -402,20 +402,28 @@ var trim = String.prototype.trim ?
// sort filteredItem order
proto._sort = function() {
var sortByOpt = this.options.sortBy;
if ( !sortByOpt ) {
if ( !this.options.sortBy ) {
return;
}
// concat all sortBy and sortHistory
var sortBys = [].concat.apply( sortByOpt, this.sortHistory );
// sort magic
var itemSorter = getItemSorter( sortBys, this.options.sortAscending );
this.filteredItems.sort( itemSorter );
// keep track of sortBy History
if ( sortByOpt != this.sortHistory[0] ) {
// add to front, oldest goes in last
this.sortHistory.unshift( sortByOpt );
var sortBys = utils.makeArray( this.options.sortBy );
if ( !this._getIsSameSortBy( sortBys ) ) {
// concat all sortBy and sortHistory, add to front, oldest goes in last
this.sortHistory = sortBys.concat( this.sortHistory );
}
// sort magic
var itemSorter = getItemSorter( this.sortHistory, this.options.sortAscending );
this.filteredItems.sort( itemSorter );
};
// check if sortBys is same as start of sortHistory
proto._getIsSameSortBy = function( sortBys ) {
for ( var i=0; i < sortBys.length; i++ ) {
if ( sortBys[i] != this.sortHistory[i] ) {
return false;
}
}
return true;
};
// returns a function used for sorting

View file

@ -1,7 +1,7 @@
/*!
* Masonry layout mode
* sub-classes Masonry
* http://masonry.desandro.com
* https://masonry.desandro.com
*/
( function( window, factory ) {
@ -11,7 +11,7 @@
// AMD
define( [
'../layout-mode',
'masonry/masonry'
'masonry-layout/masonry'
],
factory );
} else if ( typeof module == 'object' && module.exports ) {