From 43f38e564d08137a1ab74578385bbe356a0c7b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Teixeira?= Date: Tue, 9 Jun 2020 10:42:45 +0100 Subject: [PATCH] Bump dependencies --- Gruntfile.js | 3 +-- README.md | 2 +- bower.json | 2 +- dist/jquery.texttailor.min.js | 2 +- jquery.texttailor.js | 4 ++-- package-lock.json | 24 ++++++++---------------- package.json | 10 ++++++++-- 7 files changed, 22 insertions(+), 25 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 8a39230..923824b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,7 +3,7 @@ module.exports = function(grunt) { pkg: grunt.file.readJSON('package.json'), uglify: { options: { - banner: '/*! <%= pkg.title %> - <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> | https://github.com/jpntex/TextTailor.js | Copyright (c) 2019 João Teixeira (@jpntex) | MIT License */\n' + banner: '/*! <%= pkg.title %> - <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> | https://github.com/jpntex/TextTailor.js | Copyright (c) <%= grunt.template.today("yyyy") %> João Teixeira (@jpntex) | MIT License */\n' }, build: { src: 'jquery.texttailor.js', @@ -23,6 +23,5 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.registerTask('default', ['jshint', 'uglify']); }; \ No newline at end of file diff --git a/README.md b/README.md index 8205ef9..a845343 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The parent element needs to have a height (fixed or percentage). ## License ``` -Copyright (c) 2019 João Teixeira +Copyright (c) João Teixeira Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/bower.json b/bower.json index 42e62ac..a59adfe 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "TextTailor.js", - "version": "0.1.0", + "version": "0.1.2", "homepage": "https://github.com/jpntex/TextTailor.js", "authors": [ "João Teixeira " diff --git a/dist/jquery.texttailor.min.js b/dist/jquery.texttailor.min.js index e2c706d..21ae0b9 100644 --- a/dist/jquery.texttailor.min.js +++ b/dist/jquery.texttailor.min.js @@ -1,3 +1,3 @@ -/*! TextTailor.js - 0.1.1 - 2019-08-06 | https://github.com/jpntex/TextTailor.js | Copyright (c) 2019 João Teixeira (@jpntex) | MIT License */ +/*! TextTailor.js - 0.1.2 - 2020-06-09 | https://github.com/jpntex/TextTailor.js | Copyright (c) 2020 João Teixeira (@jpntex) | MIT License */ !function(e,n){"use strict";var s={minFont:1,maxFont:9999,preWrapText:!1,lineHeight:1.45,resizable:!0,debounce:!1,fit:!0,ellipsis:!0,center:!1,justify:!1};function i(t,i){this.el=t,this.options=e.extend({},s,i),this.init()}i.prototype={init:function(){var t=this.options.minFont>this.options.maxFont;e(this.el);if(t&&n.console&&console.log("TextTailor error: minFont needs to be smaller than maxFont!"),this.HTML=this.el.innerHTML,!t){var i,s=this;this.options.resizable&&e(n).on("resize",function(){s.options.debounce?(clearTimeout(i),i=setTimeout(function(){s.start()},200)):s.start()}),this.start()}},start:function(){var t=e(this.el);this.el.innerHTML=this.HTML,t.wrapInner("
"),this.wraped=e(this.el.firstChild),this.wraped.css({"line-height":this.options.lineHeight,tranform:"translateZ(0)",height:"auto"}),this.options.preWrapText&&this.wraped.css("white-space","pre-line"),this.maxHeight=t.height(),this.maxWidth=t.width(),this.fit().ellipsis().center().justify()},fit:function(){if(this.options.fit){var n=this,o=this.wraped,h=0,t=Math.round((this.options.maxFont+this.options.minFont)/2);o.css("fontSize",t);var i=function t(i,s,e){return 30==++h?i:i<=n.options.minFont?n.options.minFont:i>=n.options.maxFont?n.options.maxFont:s===e?s:(o.css("fontSize",i),o[0].scrollHeight=n.maxHeight?i:t(Math.round((e+i)/2),i,e)):(o.css("fontSize",i-1),t(Math.round((s+i)/2),s,i)))}(t,this.options.minFont,this.options.maxFont);o.css("fontSize",i)}return this},ellipsis:function(){if(this.options.ellipsis){var t=this.wraped;if(t.css({overflow:"hidden","text-overflow":"ellipsis"}),t.height()>this.maxHeight){var i=t.html();t.html("O");t.height();for(var s=1,e=i.length;s