Comparing version 2.5.6 to 2.5.7
@@ -0,1 +1,11 @@ | ||
## [2.5.6](https://github.com/dollarshaveclub/shave/compare/2.5.4...2.5.6) (2019-10-21) | ||
## [2.5.4](https://github.com/dollarshaveclub/shave/compare/2.5.3...2.5.4) (2019-06-25) | ||
## [2.5.3](https://github.com/dollarshaveclub/shave/compare/2.5.2...2.5.3) (2019-04-17) | ||
@@ -2,0 +12,0 @@ |
/** | ||
shave - Shave is a javascript plugin that truncates multi-line text within a html element based on set max height | ||
@version v2.5.6 | ||
@version v2.5.7 | ||
@link https://github.com/dollarshaveclub/shave#readme | ||
@@ -8,2 +8,2 @@ @author Jeff Wainwright <yowainwright@gmail.com> (jeffry.in) | ||
**/ | ||
!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";if("undefined"!=typeof window){var e=window.$||window.jQuery||window.Zepto;e&&(e.fn.shave=function(e,t){return function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(void 0===t||isNaN(t))throw Error("maxHeight is required");var i="string"==typeof e?document.querySelectorAll(e):e;if(i){var a=n.character||"…",o=n.classname||"js-shave",r="boolean"!=typeof n.spaces||n.spaces,s='<span class="js-shave-char">'.concat(a,"</span>");"length"in i||(i=[i]);for(var c=0;c<i.length;c+=1){var h=i[c],d=h.style,l=h.querySelector(".".concat(o)),f=void 0===h.textContent?"innerText":"textContent";l&&(h.removeChild(h.querySelector(".js-shave-char")),h[f]=h[f]);var v=h[f],g=r?v.split(" "):v;if(!(g.length<2)){var u=d.height;d.height="auto";var p=d.maxHeight;if(d.maxHeight="none",h.offsetHeight<=t)d.height=u,d.maxHeight=p;else{for(var m=g.length-1,y=0,j=void 0;y<m;)j=y+m+1>>1,h[f]=r?g.slice(0,j).join(" "):g.slice(0,j),h.insertAdjacentHTML("beforeend",s),h.offsetHeight>t?m=j-1:y=j;h[f]=r?g.slice(0,m).join(" "):g.slice(0,m),h.insertAdjacentHTML("beforeend",s);var w=r?" ".concat(g.slice(m).join(" ")):g.slice(m),x=document.createTextNode(w),H=document.createElement("span");H.classList.add(o),H.style.display="none",H.appendChild(x),h.insertAdjacentElement("beforeend",H),d.height=u,d.maxHeight=p}}}}}(this,e,t),this})}}); | ||
!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";if("undefined"!=typeof window){var e=window.$||window.jQuery||window.Zepto;e&&(e.fn.shave=function(e,t){return function(e,t,n){var i=2<arguments.length&&void 0!==n?n:{};if(void 0===t||isNaN(t))throw Error("maxHeight is required");var a="string"==typeof e?document.querySelectorAll(e):e;if(a){var o=i.character||"…",r=i.classname||"js-shave",s="boolean"!=typeof i.spaces||i.spaces,c='<span class="js-shave-char">'.concat(o,"</span>");"length"in a||(a=[a]);for(var h=0;h<a.length;h+=1){var d=a[h],l=d.style,f=d.querySelector(".".concat(r)),v=void 0===d.textContent?"innerText":"textContent";f&&(d.removeChild(d.querySelector(".js-shave-char")),d[v]=d[v]);var g=d[v],u=s?g.split(" "):g;if(!(u.length<2)){var p=l.height;l.height="auto";var m=l.maxHeight;if(l.maxHeight="none",d.offsetHeight<=t)l.height=p,l.maxHeight=m;else{for(var y=u.length-1,j=0,w=void 0;j<y;)w=j+y+1>>1,d[v]=s?u.slice(0,w).join(" "):u.slice(0,w),d.insertAdjacentHTML("beforeend",c),d.offsetHeight>t?y=w-1:j=w;d[v]=s?u.slice(0,y).join(" "):u.slice(0,y),d.insertAdjacentHTML("beforeend",c);var x=s?" ".concat(u.slice(y).join(" ")):u.slice(y),H=document.createTextNode(x),b=document.createElement("span");b.classList.add(r),b.style.display="none",b.appendChild(H),d.insertAdjacentElement("beforeend",b),l.height=p,l.maxHeight=m}}}}}(this,e,t),this})}}); |
/** | ||
shave - Shave is a javascript plugin that truncates multi-line text within a html element based on set max height | ||
@version v2.5.6 | ||
@version v2.5.7 | ||
@link https://github.com/dollarshaveclub/shave#readme | ||
@@ -5,0 +5,0 @@ @author Jeff Wainwright <yowainwright@gmail.com> (jeffry.in) |
/** | ||
shave - Shave is a javascript plugin that truncates multi-line text within a html element based on set max height | ||
@version v2.5.6 | ||
@version v2.5.7 | ||
@link https://github.com/dollarshaveclub/shave#readme | ||
@@ -12,3 +12,3 @@ @author Jeff Wainwright <yowainwright@gmail.com> (jeffry.in) | ||
(global = global || self, global.shave = factory()); | ||
}(this, function () { 'use strict'; | ||
}(this, (function () { 'use strict'; | ||
@@ -84,2 +84,2 @@ function shave(target, maxHeight) { | ||
})); | ||
}))); |
/** | ||
shave - Shave is a javascript plugin that truncates multi-line text within a html element based on set max height | ||
@version v2.5.6 | ||
@version v2.5.7 | ||
@link https://github.com/dollarshaveclub/shave#readme | ||
@@ -5,0 +5,0 @@ @author Jeff Wainwright <yowainwright@gmail.com> (jeffry.in) |
{ | ||
"name": "shave", | ||
"version": "2.5.6", | ||
"version": "2.5.7", | ||
"description": "Shave is a javascript plugin that truncates multi-line text within a html element based on set max height", | ||
@@ -56,8 +56,8 @@ "main": "dist/shave.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.0.0-beta.44", | ||
"@babel/preset-env": "^7.0.0-beta.40", | ||
"@babel/core": "^7.7.0", | ||
"@babel/preset-env": "^7.7.0", | ||
"babel-core": "^7.0.0-bridge.0", | ||
"conventional-changelog-cli": "^2.0.11", | ||
"es-check": "5.0.0", | ||
"eslint": "^6.1.0", | ||
"es-check": "5.1.0", | ||
"eslint": "^6.6.0", | ||
"eslint-config-dollarshaveclub": "^3.1.0", | ||
@@ -69,3 +69,3 @@ "eslint-plugin-import": "^2.18.0", | ||
"node-qunit-phantomjs": "^2.0.0", | ||
"rollup": "^1.19.4", | ||
"rollup": "^1.27.8", | ||
"rollup-plugin-babel": "^4.0.0-beta.0", | ||
@@ -72,0 +72,0 @@ "rollup-plugin-uglify": "^6.0.1", |
@@ -98,3 +98,3 @@ <p align="center"> | ||
shave('selector', maxheight, {classname: 'classname'}); | ||
shave('selector', maxheight, { classname: 'classname' }); | ||
@@ -107,3 +107,3 @@ ``` | ||
shave('selector', maxheight, {character: '✁'}); | ||
shave('selector', maxheight, { character: '✁' }); | ||
@@ -116,3 +116,3 @@ ``` | ||
shave('selector', maxheight, {classname: 'classname', character: '✁' }); | ||
shave('selector', maxheight, { classname: 'classname', character: '✁' }); | ||
@@ -125,3 +125,3 @@ ``` | ||
shave({ spaces: false }); | ||
shave('selector', maxheight, { spaces: false }); | ||
@@ -128,0 +128,0 @@ ``` |
29188