diff --git a/CHANGELOG.md b/CHANGELOG.md index db75f9b2..9b947c1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [3.4.2](https://github.com/imgix/imgix.js/compare/v3.4.1...v3.4.2) (2019-12-09) + +* fix: skip over tags that fail validations ([#175](https://github.com/imgix/imgix.js/pull/175)) + ## [3.4.1](https://github.com/imgix/imgix.js/compare/v3.4.0...v3.4.1) (2019-05-24) diff --git a/bower.json b/bower.json index 3bc50015..697da10a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "imgix.js", - "version": "3.4.1", + "version": "3.4.2", "homepage": "http://www.imgix.com/imgix-js", "authors": [ "imgix" diff --git a/dist/imgix.js b/dist/imgix.js index d27b8466..dcb63347 100644 --- a/dist/imgix.js +++ b/dist/imgix.js @@ -8,7 +8,8 @@ var ImgixTag = (function() { this.settings = opts || {}; if (!this.el) { - throw new Error('ImgixTag must be passed a DOM element.'); + console.warn('ImgixTag must be passed a DOM element.'); + return; } if (this.el.hasAttribute('ix-initialized') && !this.settings.force) { @@ -22,9 +23,20 @@ var ImgixTag = (function() { el.getAttribute(this.settings.hostInputAttribute) || this.settings.host; if (this.ixPathVal && !this.ixHostVal) { - throw new Error( + console.warn( 'You must set a value for `imgix.config.host` or specify an `ix-host` attribute to use `ix-path` and `ix-params`.' ); + return; + } + + if (typeof this.ixPathVal === 'string' && this.ixPathVal.length == 0) { + console.warn('`ix-path` cannot accept a value of empty string ""'); + return; + } + + if (typeof this.ixSrcVal === 'string' && this.ixSrcVal.length == 0) { + console.warn('`ix-src` cannot accept a value of empty string ""'); + return; } this.baseParams = this._extractBaseParams(); @@ -212,7 +224,7 @@ var ImgixTag = require('./ImgixTag.js'), util = require('./util.js'), defaultConfig = require('./defaultConfig'); -var VERSION = '3.4.1'; +var VERSION = '3.4.2'; function getMetaTagValue(propertyName) { var metaTag = document.querySelector( diff --git a/dist/imgix.min.js b/dist/imgix.min.js index 737b74ff..f379a82e 100644 --- a/dist/imgix.min.js +++ b/dist/imgix.min.js @@ -1 +1 @@ -(function(){function t(e,i,r){function s(a,u){if(!i[a]){if(!e[a]){var o="function"==typeof require&&require;if(!u&&o)return o(a,!0);if(n)return n(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var f=i[a]={exports:{}};e[a][0].call(f.exports,function(t){var i=e[a][1][t];return s(i||t)},f,f.exports,t,e,i,r)}return i[a].exports}for(var n="function"==typeof require&&require,a=0;a-1){var s=this.ixSrcVal.substr(i+1),n=s.split("&");for(var a=0,u;a-1){var r=this.ixSrcVal.substr(i+1),s=r.split("&");for(var n=0,a;n