From 21dfb9327f8acb95a5e81c4261fc00392b67e8c6 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 27 Apr 2015 17:46:49 -0400 Subject: fix flickity version --- site/db.json | 70 +++---- site/public/assets/javascripts/_env.js | 3 +- .../assets/javascripts/vendor/flickity.pkgd.js | 215 +++++++++++---------- themes/okadmin/public/js/app.js | 1 - 4 files changed, 139 insertions(+), 150 deletions(-) diff --git a/site/db.json b/site/db.json index 591706f..3d55602 100644 --- a/site/db.json +++ b/site/db.json @@ -5,9 +5,9 @@ "content": [], "advertising": [ { - "id": "diesel-spring-summer-2015", - "title": "Diesel Spring/Summer 2015", - "menu": "Diesel S/S 2015", + "id": "diesel-s-s-2015", + "title": "Diesel S/S 2015", + "menu": "Diesel Spring/Summer 2015", "description": "FOR SPRING 2015, FORMICHETTI ESTABLISHES THE KEY PIECES THAT HAVE COME TO REFLECT DIESEL’S NEW ERA AND CHARACTERIZE ITS DNA, AND THE FACES WHO BEST REFLECT THE PAST, PRESENT, AND FUTURE OF THE BRAND. IN A REVOLUTIONARY CAMPAIGN BY NICK KNIGHT, FORMICHETTI HIGHLIGHTS HIS PERSONAL HEROES, WHICH INCLUDE NEW FACES AND THE ARTISTS, INNOVATORS, MUSES, AND FRIENDS WHO INSPIRE HIM, AS WELL AS A FEW HEROES FROM PAST CAMPAIGNS. COMBINING CLASSIC PORTRAITURE WITH FUTURISTIC, DIGITAL ELEMENTS, THE CAMPAIGN WILL JUXTAPOSE THE INDIVIDUALS WHO MAKE UP DIESEL’SCOMMUNITY WITH THE “HERO” PIECES THAT BEST DEFINE THE STATEMENT OF THE BRAND TODAY.", "video": { "url": "", @@ -24,19 +24,25 @@ "thumb": "http://i.vimeocdn.com/video/497493142_640.jpg" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fe22fd077-ca52-42a1-ab9c-e0508bf4408e.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F1b55cd3c-eb7d-4ed6-bfe9-2bc53960987d.jpg", "caption": "" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F1afaa719-c18f-4155-a42f-3e7fc10247c3.jpg", + "type": "vimeo", + "token": "125927621", + "title": "the Vampyre of Time and Memory", + "thumb": "http://i.vimeocdn.com/video/516197938_640.jpg" + }, + { + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F86a3edfe-bdbb-44ac-9e50-e167c16c89b9.jpg", "caption": "" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F1b55cd3c-eb7d-4ed6-bfe9-2bc53960987d.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F1afaa719-c18f-4155-a42f-3e7fc10247c3.jpg", "caption": "" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fe402bfbb-b101-4b42-afcb-818f7b616db9.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F38cb4454-34a4-44af-8243-53da4d2b7c47.jpg", "caption": "" }, { @@ -44,28 +50,28 @@ "caption": "" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F38cb4454-34a4-44af-8243-53da4d2b7c47.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F5bdc8f95-b18f-407a-b2f3-33df1025bf8a.jpg", "caption": "" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F86a3edfe-bdbb-44ac-9e50-e167c16c89b9.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fe22fd077-ca52-42a1-ab9c-e0508bf4408e.jpg", "caption": "" }, { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F5bdc8f95-b18f-407a-b2f3-33df1025bf8a.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fe402bfbb-b101-4b42-afcb-818f7b616db9.jpg", "caption": "" } ], "thumbnail": { - "uri": "", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F479667e9-a89d-4c19-935a-b78f3aaf64e6.jpg", "caption": "" }, "__index": "0" }, { - "id": "diesel-fall-winter-2014", - "title": "Diesel Fall/Winter 2014", - "menu": "Diesel F/W 2014", + "id": "diesel-f-w-14", + "title": "Diesel F/W 14", + "menu": "Diesel Fall/Winter 2014", "description": "FOR FALL/WINTER 2014, IN AN ACT OF DEFIANT ANONYMITY, DIESEL IS STRIPPING AWAY THE IDENTITIES OF ITS MODELS AND CAMPAIGN STARS, DEMOCRATIZING THE CONCEPT – THERE IS NO SINGULAR IDEA OF WHO THE DIESEL PERSON SHOULD BE. SHOT BY NICK KNIGHT, THE CREATIVE IS INSPIRED BY THE THEME “PICASSO MEETS AVEDON,” REPRESENTING THE NEXT DIMENSION OF DIESEL, INTRODUCING THE SECOND PHASE OF THE BRAND AFTER #DIESELREBOOT.", "video": { "url": "", @@ -76,44 +82,12 @@ }, "media": [ { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F38ea6ad0-f689-491f-857a-12d4fa0d4748.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F12184bdd-0aff-43db-882c-8efcb1e583de.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fb61bd44f-d074-4a20-a641-fc11957e8cd5.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F2a0b26ae-cc35-406e-923b-e60409e53eb8.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fd2a68db8-018b-4fdf-8f69-c2e4d0aff76a.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F0b24ebbd-07e8-446e-83db-60484f0f3dd9.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F1f8c6b75-c694-4d31-a790-b042b75b3606.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F907a0fbd-1455-4f3d-b28e-ebcba658f2d3.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F17ee7deb-dee5-497a-a8a6-dfe3f9c3105d.jpg", + "uri": "https://ltho.s3.amazonaws.com/twohustlers%2Fefd9dcf8-03c1-42c3-b6cc-3472acf908e4.jpg", "caption": "" } ], "thumbnail": { - "uri": "https://ltho.s3.amazonaws.com/twohustlers%2F94c3bb9d-7d11-43f7-be86-5348a677845f.jpg", + "uri": "", "caption": "" }, "__index": "1" diff --git a/site/public/assets/javascripts/_env.js b/site/public/assets/javascripts/_env.js index aae60b9..60f6528 100644 --- a/site/public/assets/javascripts/_env.js +++ b/site/public/assets/javascripts/_env.js @@ -431,13 +431,14 @@ function build_gallery () { }) gallery.on("cellSelect", function(){ + console.log("DUH") $caption.html( $(gallery.selectedElement).data("caption") ) videos.forEach(function(player){ player.api('pause') }) }) gallery.on("settle", function(){ - gallery && $caption.html( $(gallery.selectedElement).data("caption") ) + $caption.html( $(gallery.selectedElement).data("caption") ) }) gallery.on("staticClick", function(e){ // console.log(e) diff --git a/site/public/assets/javascripts/vendor/flickity.pkgd.js b/site/public/assets/javascripts/vendor/flickity.pkgd.js index 6389014..0471fa5 100644 --- a/site/public/assets/javascripts/vendor/flickity.pkgd.js +++ b/site/public/assets/javascripts/vendor/flickity.pkgd.js @@ -1,6 +1,10 @@ /*! - * Flickity PACKAGED v0.2.3 + * Flickity PACKAGED v1.0.1 * Touch, responsive, flickable galleries + * + * Licensed GPLv3 for open source use + * or Flickity Commercial License for commercial use + * * http://flickity.metafizzy.co * Copyright 2015 Metafizzy */ @@ -1176,7 +1180,7 @@ if ( typeof define === 'function' && define.amd ) { })( window ); /** - * matchesSelector v1.0.2 + * matchesSelector v1.0.3 * matchesSelector( element, '.selector' ) * MIT license */ @@ -1189,6 +1193,10 @@ if ( typeof define === 'function' && define.amd ) { var matchesMethod = ( function() { + // check for the standard method name first + if ( ElemProto.matches ) { + return 'matches'; + } // check un-prefixed if ( ElemProto.matchesSelector ) { return 'matchesSelector'; @@ -1280,7 +1288,7 @@ if ( typeof define === 'function' && define.amd ) { })( Element.prototype ); /** - * Fizzy UI utils v0.1.1 + * Fizzy UI utils v1.0.1 * MIT license */ @@ -1380,7 +1388,7 @@ utils.indexOf = Array.prototype.indexOf ? function( ary, obj ) { // ----- removeFrom ----- // -utils.removeFrom = function( obj, ary ) { +utils.removeFrom = function( ary, obj ) { var index = utils.indexOf( ary, obj ); if ( index != -1 ) { ary.splice( index, 1 ); @@ -1499,14 +1507,12 @@ utils.debounceMethod = function( _class, methodName, threshold ) { // ----- htmlInit ----- // -var jQuery = window.jQuery; - // http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/ -function toDashed( str ) { +utils.toDashed = function( str ) { return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) { return $1 + '-' + $2; }).toLowerCase(); -} +}; var console = window.console; /** @@ -1516,7 +1522,7 @@ var console = window.console; */ utils.htmlInit = function( WidgetClass, namespace ) { docReady( function() { - var dashedNamespace = toDashed( namespace ); + var dashedNamespace = utils.toDashed( namespace ); var elems = document.querySelectorAll( '.js-' + dashedNamespace ); var dataAttr = 'data-' + dashedNamespace + '-options'; @@ -1538,6 +1544,7 @@ utils.htmlInit = function( WidgetClass, namespace ) { // initialize var instance = new WidgetClass( elem, options ); // make available via $().data('layoutname') + var jQuery = window.jQuery; if ( jQuery ) { jQuery.data( elem, namespace, instance ); } @@ -1893,8 +1900,12 @@ return proto; })); /*! - * Flickity v0.2.3 + * Flickity v1.0.1 * Touch, responsive, flickable galleries + * + * Licensed GPLv3 for open source use + * or Flickity Commercial License for commercial use + * * http://flickity.metafizzy.co * Copyright 2015 Metafizzy */ @@ -1999,7 +2010,8 @@ Flickity.defaults = { // initialIndex: 0, percentPosition: true, resize: true, - selectedAttraction: 0.025 + selectedAttraction: 0.025, + setGallerySize: true // watchCSS: false, // wrapAround: false }; @@ -2075,7 +2087,6 @@ Flickity.prototype.activate = function() { this.getSize(); // get cells from children this.reloadCells(); - this.setContainerSize(); if ( this.options.accessibility ) { // allow element to focusable @@ -2109,7 +2120,7 @@ Flickity.prototype.reloadCells = function() { this.cells = this._makeCells( this.slider.children ); this.positionCells(); this._getWrapShiftCells(); - this.setContainerSize(); + this.setGallerySize(); }; /** @@ -2215,8 +2226,10 @@ Flickity.prototype.setCellAlign = function() { this.cellAlign = shorthand ? shorthand[ this.originSide ] : this.options.cellAlign; }; -Flickity.prototype.setContainerSize = function() { - this.viewport.style.height = this.maxCellHeight + 'px'; +Flickity.prototype.setGallerySize = function() { + if ( this.options.setGallerySize ) { + this.viewport.style.height = this.maxCellHeight + 'px'; + } }; Flickity.prototype._getWrapShiftCells = function() { @@ -2267,13 +2280,21 @@ Flickity.prototype._containCells = function() { var lastCell = this.getLastCell(); var contentWidth = this.slideableWidth - lastCell.size[ endMargin ]; var endLimit = contentWidth - this.size.innerWidth * ( 1 - this.cellAlign ); + // content is less than gallery size + var isContentSmaller = contentWidth < this.size.innerWidth; // contain each cell target for ( var i=0, len = this.cells.length; i < len; i++ ) { var cell = this.cells[i]; // reset default target cell.setDefaultTarget(); - cell.target = Math.max( cell.target, this.cursorPosition + firstCellStartMargin ); - cell.target = Math.min( cell.target, endLimit ); + if ( isContentSmaller ) { + // all cells fit inside gallery + cell.target = contentWidth * this.cellAlign; + } else { + // contain to bounds + cell.target = Math.max( cell.target, this.cursorPosition + firstCellStartMargin ); + cell.target = Math.min( cell.target, endLimit ); + } } }; @@ -2293,7 +2314,7 @@ Flickity.prototype.dispatchEvent = function( type, event, args ) { if ( event ) { // create jQuery event var $event = jQuery.Event( event ); - $event.type = type + '.flickity'; + $event.type = type; this.$element.trigger( $event, args ); } else { // just trigger with type if no event available @@ -2330,7 +2351,7 @@ Flickity.prototype.select = function( index, isWrap ) { this.selectedIndex = index; this.setSelectedCell(); this.startAnimation(); - this.dispatchEvent('select'); + this.dispatchEvent('cellSelect'); } }; @@ -2448,7 +2469,7 @@ Flickity.prototype.resize = function() { } this.positionCells(); this._getWrapShiftCells(); - this.setContainerSize(); + this.setGallerySize(); this.positionSliderAtSelected(); }; @@ -2554,6 +2575,9 @@ Flickity.prototype.destroy = function() { eventie.unbind( window, 'resize', this ); } this.emit('destroy'); + if ( jQuery && this.$element ) { + jQuery.removeData( this.element, 'flickity' ); + } delete this.element.flickityGUID; delete instances[ this.guid ]; }; @@ -2599,7 +2623,7 @@ return Flickity; })); /*! - * Unipointer v0.1.0 + * Unipointer v1.1.0 * base class for doing one thing with pointer event * MIT license */ @@ -2736,7 +2760,7 @@ Unipointer.prototype._pointerDown = function( event, pointer ) { Unipointer.prototype.pointerDown = function( event, pointer ) { this._bindPostStartEvents( event ); - this.emitEvent( 'pointerDown', [ this, event, pointer ] ); + this.emitEvent( 'pointerDown', [ event, pointer ] ); }; // hash of events to be bound after start event @@ -2813,7 +2837,7 @@ Unipointer.prototype._pointerMove = function( event, pointer ) { // public Unipointer.prototype.pointerMove = function( event, pointer ) { - this.emitEvent( 'pointerMove', [ this, event, pointer ] ); + this.emitEvent( 'pointerMove', [ event, pointer ] ); }; // ----- end event ----- // @@ -2850,7 +2874,7 @@ Unipointer.prototype._pointerUp = function( event, pointer ) { // public Unipointer.prototype.pointerUp = function( event, pointer ) { - this.emitEvent( 'pointerUp', [ this, event, pointer ] ); + this.emitEvent( 'pointerUp', [ event, pointer ] ); }; // ----- pointer done ----- // @@ -2896,7 +2920,7 @@ Unipointer.prototype._pointerCancel = function( event, pointer ) { // public Unipointer.prototype.pointerCancel = function( event, pointer ) { - this.emitEvent( 'pointerCancel', [ this, event, pointer ] ); + this.emitEvent( 'pointerCancel', [ event, pointer ] ); }; // ----- ----- // @@ -2916,7 +2940,7 @@ return Unipointer; })); /*! - * Unidragger v0.2.0 + * Unidragger v1.1.3 * Draggable base class * MIT license */ @@ -3050,13 +3074,6 @@ var disableImgOndragstart = !isIE8 ? noop : function( handle ) { // ----- start event ----- // -var allowTouchstartNodes = Unidragger.allowTouchstartNodes = { - INPUT: true, - A: true, - BUTTON: true, - SELECT: true -}; - /** * pointer start * @param {Event} event @@ -3071,7 +3088,7 @@ Unidragger.prototype.pointerDown = function( event, pointer ) { } // bind move and end events this._bindPostStartEvents( event ); - this.emitEvent( 'pointerDown', [ this, event, pointer ] ); + this.emitEvent( 'pointerDown', [ event, pointer ] ); }; // base pointer down logic @@ -3079,11 +3096,10 @@ Unidragger.prototype._dragPointerDown = function( event, pointer ) { // track to see when dragging starts this.pointerDownPoint = Unipointer.getPointerPoint( pointer ); + // prevent default, unless touchstart or - if ( !isTouchstartNode && targetNodeName != 'SELECT' ) { + if ( !isTouchstart && targetNodeName != 'SELECT' ) { preventDefaultEvent( event ); } }; @@ -3097,7 +3113,7 @@ Unidragger.prototype._dragPointerDown = function( event, pointer ) { */ Unidragger.prototype.pointerMove = function( event, pointer ) { var moveVector = this._dragPointerMove( event, pointer ); - this.emitEvent( 'pointerMove', [ this, event, pointer, moveVector ] ); + this.emitEvent( 'pointerMove', [ event, pointer, moveVector ] ); this._dragMove( event, pointer, moveVector ); }; @@ -3129,7 +3145,7 @@ Unidragger.prototype.hasDragStarted = function( moveVector ) { * @param {Event or Touch} pointer */ Unidragger.prototype.pointerUp = function( event, pointer ) { - this.emitEvent( 'pointerUp', [ this, event, pointer ] ); + this.emitEvent( 'pointerUp', [ event, pointer ] ); this._dragPointerUp( event, pointer ); }; @@ -3155,7 +3171,7 @@ Unidragger.prototype._dragStart = function( event, pointer ) { }; Unidragger.prototype.dragStart = function( event, pointer ) { - this.emitEvent( 'dragStart', [ this, event, pointer ] ); + this.emitEvent( 'dragStart', [ event, pointer ] ); }; // dragMove @@ -3169,7 +3185,8 @@ Unidragger.prototype._dragMove = function( event, pointer, moveVector ) { }; Unidragger.prototype.dragMove = function( event, pointer, moveVector ) { - this.emitEvent( 'dragMove', [ this, event, pointer, moveVector ] ); + preventDefaultEvent( event ); + this.emitEvent( 'dragMove', [ event, pointer, moveVector ] ); }; // dragEnd @@ -3186,7 +3203,7 @@ Unidragger.prototype._dragEnd = function( event, pointer ) { }; Unidragger.prototype.dragEnd = function( event, pointer ) { - this.emitEvent( 'dragEnd', [ this, event, pointer ] ); + this.emitEvent( 'dragEnd', [ event, pointer ] ); }; // ----- onclick ----- // @@ -3202,15 +3219,16 @@ Unidragger.prototype.onclick = function( event ) { // triggered after pointer down & up with no/tiny movement Unidragger.prototype._staticClick = function( event, pointer ) { - // allow click in text input - if ( event.target.nodeName == 'INPUT' && event.target.type == 'text' ) { + // allow click in s and