Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-overflow-tracking

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-overflow-tracking - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

bundle/js/overflow-tracking.js

@@ -1,1 +0,1 @@

!function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="/bundle/",t(0)}([function(e,t,o){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function n(e){return e&&e.__esModule?e:{default:e}}var i=o(6),l=n(i),d=o(8),a=r(d);angular.module(a.moduleName,[]).directive(a.directiveName,l.default)},,,,,,function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function n(e,t,o){var r=window.getComputedStyle(e,null);return"hidden"!==r.getPropertyValue("overflow")&&(e.style.overflow="hidden"),0===parseInt(r.getPropertyValue("height"))&&console.warn("height === 0 for "+e.className,e),o?new s.default(e,t,o):new s.default(e,t)}function i(e){var t=getComputedStyle(e,null).getPropertyValue("background-color");return"rgba(0, 0, 0, 0)"===t&&e.parentNode?i(e.parentNode):e.parentNode?t:(console.warn("not define background-image"),"rgba(255,255,255,1)")}function l(e){var t=document.createElement("span");t.innerHTML="t",t.style.display="inline-block",e.appendChild(t);var o=t.getBoundingClientRect().height;return e.removeChild(t),o}function d(e,t,o){!o||o<0&&o>1?o=.2:null,t=t||"hor";var r=l(e),n=window.getComputedStyle(e,null);"hidden"!==n.getPropertyValue("overflow")&&(e.style.overflow="hidden"),"static"===n.getPropertyValue("position")&&(e.style.position="relative");var d=document.createElement("div");d.className="ot-gradient",d.style.position="absolute";var a=i(e);if(console.log(a),"hor"===t){var s=n.getPropertyValue("padding-bottom");d.style.bottom=s,d.style.right="0px",d.style.height=r+"px",d.style.width=Math.ceil(e.offsetWidth*o)+"px",d.style.backgroundImage="linear-gradient(to left, "+a+" 0%,"+a+" 60%,rgba(0,0,0,0) 100%)"}else d.style.bottom="0px",d.style.right="0px",d.style.left="0px",d.style.height=Math.ceil(e.offsetHeight*o)+"px",d.style.backgroundImage="linear-gradient(to top, "+a+" 0%,"+a+" 60%,rgba(0,0,0,0) 100%)";return e.appendChild(d),{el:d,destroy:function(){this.el.parentNode.removeChild(this.el)}}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(7),s=r(a),c=o(8);t.default=function(){"ngInject";return{scope:{addedWord:"@",container:"@",resize:"@",position:"@",size:"@"},restrict:"A",controller:function(e,t,o,r){r(function(){var r=o[c.directiveName];switch(r){case"html":var i;i=e.container?n(t[0],t[0].querySelector(e.container),e.addedWord):n(t[0],t[0],e.addedWord);var l;e.resize=+e.resize||0;var a=function(){clearTimeout(l),l=setTimeout(function(){i.refresh()},e.resize)};e.resize&&window.addEventListener("resize",a),e.$on("$destroy",function(){i.destroy(),window.removeEventListener("resize",a)});break;case"gradient":"ver"!==e.position?e.position="hor":null,e.size?d(t[0],e.position,+e.size):d(t[0],e.position)}t.addClass("is-tracking")})}}}},function(e,t){"use strict";function o(e,t,o){function r(){l.deleteUnnecessaryHtml(e,t),l.addedNode&&l.addNode(e,t,l.addedNode)}function n(){t.innerHTML="",i(),r()}function i(){for(var e=0;e<l.originalHtml.childNodes.length;e++)t.appendChild(l.originalHtml.childNodes[e].cloneNode(!0))}var l=this;this.addedNode=!!o&&document.createTextNode(" "+o),t=t||e,this.originalHtml=t.cloneNode(!0),this.trackingElem=e,this.container=t,this.destroy=function(){t.innerHTML="",i()},this.refresh=function(){n()},r()}Object.defineProperty(t,"__esModule",{value:!0}),o.prototype.deleteLastWord=function(e){return e.replace(/\s*\S+\s*$/,"")},o.prototype.deletingLastWords=function(e){for(;this.trackingElem.scrollHeight-this.trackingElem.offsetHeight>0&&e.textContent;)e.textContent=this.deleteLastWord(e.textContent);return e.textContent},o.prototype.cutTextByLastWord=function(e){var t=e.lastChild;if(t)switch(t.nodeType){case 1:t.childNodes.length?this.cutTextByLastWord(t):t.parentNode.removeChild(t);break;case 3:if(t.textContent.replace(/\s*/,"")){var o=this.deletingLastWords(t);""===o&&1===e.childNodes.length&&e.parentNode.removeChild(e)}else t.parentNode.removeChild(t);break;case 8:t.parentNode.removeChild(t)}},o.prototype.cutTextByLastWordStatic=function(e){var t=e.lastChild;if(t)switch(t.nodeType){case 1:t.childNodes.length?this.cutTextByLastWordStatic(t):t.parentNode.removeChild(t);break;case 3:if(t.textContent.replace(/\s*/,"")){var o=this.deleteLastWord(t.textContent);t.textContent=o,""===o&&1===e.childNodes.length&&e.parentNode.removeChild(e)}else t.parentNode.removeChild(t);break;case 8:t.parentNode.removeChild(t)}},o.prototype.deleteUnnecessaryHtml=function(e,t){for(;e.scrollHeight-e.offsetHeight>0&&t.lastChild;)this.cutTextByLastWord(t);t.lastChild?e.classList.remove("is-empty"):e.classList.add("is-empty")},o.prototype.toString=function(){return this.trackingElem.textContent},o.prototype.valueOf=function(){return this.trackingElem.textContent.length},o.prototype.addNode=function(e,t,o){for(t.appendChild(o);e.scrollHeight-e.offsetHeight>0&&t.childNodes.length>1;)t.removeChild(o),this.cutTextByLastWordStatic(t),t.appendChild(o);e.scrollHeight-e.offsetHeight>0&&1===t.childNodes.length&&t.removeChild(o)};var r={enumerable:!1,configurable:!1,writable:!1};for(var n in o.prototype)"function"==typeof o.prototype[n]&&Object.defineProperty(o.prototype,n,r);t.default=o},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.moduleName="overflow-tracking",t.directiveName="overflowTracking"}]);
!function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="/bundle/",t(0)}([function(e,t,o){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function n(e){return e&&e.__esModule?e:{default:e}}var i=o(6),l=n(i),d=o(8),a=r(d);angular.module(a.moduleName,[]).directive(a.directiveName,l.default)},,,,,,function(e,t,o){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function n(e,t,o){var r=window.getComputedStyle(e,null);return"hidden"!==r.getPropertyValue("overflow")&&(e.style.overflow="hidden"),0===parseInt(r.getPropertyValue("height"))&&console.warn("height === 0 for "+e.className,e),o?new s.default(e,t,o):new s.default(e,t)}function i(e){var t=getComputedStyle(e,null).getPropertyValue("background-color");return"rgba(0, 0, 0, 0)"===t&&e.parentNode?i(e.parentNode):e.parentNode?t:(console.warn("not define background-image"),"rgba(255,255,255,1)")}function l(e){var t=document.createElement("span");t.innerHTML="t",t.style.display="inline-block",e.appendChild(t);var o=t.getBoundingClientRect().height;return e.removeChild(t),o}function d(e,t,o){!o||o<0&&o>1?o=.2:null,t=t||"hor";var r=l(e),n=window.getComputedStyle(e,null);"hidden"!==n.getPropertyValue("overflow")&&(e.style.overflow="hidden"),"static"===n.getPropertyValue("position")&&(e.style.position="relative");var d=document.createElement("div");d.className="ot-gradient",d.style.position="absolute";var a=i(e);if(console.log(a),"hor"===t){var s=n.getPropertyValue("padding-bottom");d.style.bottom=s,d.style.right="0px",d.style.height=r+"px",d.style.width=Math.ceil(e.offsetWidth*o)+"px",d.style.backgroundImage="linear-gradient(to left, "+a+" 0%,"+a+" 60%,rgba(0,0,0,0) 100%)"}else d.style.bottom="0px",d.style.right="0px",d.style.left="0px",d.style.height=Math.ceil(e.offsetHeight*o)+"px",d.style.backgroundImage="linear-gradient(to top, "+a+" 0%,"+a+" 60%,rgba(0,0,0,0) 100%)";return e.appendChild(d),{el:d,destroy:function(){this.el.parentNode.removeChild(this.el)}}}Object.defineProperty(t,"__esModule",{value:!0});var a=o(7),s=r(a),c=o(8);t.default=function(){return{scope:{addedWord:"@",container:"@",resize:"@",position:"@",size:"@"},restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(e,t,o,r){"ngInject";r(function(){var r=o[c.directiveName];switch(r){case"html":var i;i=e.container?n(t[0],t[0].querySelector(e.container),e.addedWord):n(t[0],t[0],e.addedWord);var l;e.resize=+e.resize||0;var a=function(){clearTimeout(l),l=setTimeout(function(){i.refresh()},e.resize)};e.resize&&window.addEventListener("resize",a),e.$on("$destroy",function(){i.destroy(),window.removeEventListener("resize",a)});break;case"gradient":"ver"!==e.position?e.position="hor":null,e.size?d(t[0],e.position,+e.size):d(t[0],e.position)}t.addClass("is-tracking")})}]}}},function(e,t){"use strict";function o(e,t,o){function r(){l.deleteUnnecessaryHtml(e,t),l.addedNode&&l.addNode(e,t,l.addedNode)}function n(){t.innerHTML="",i(),r()}function i(){for(var e=0;e<l.originalHtml.childNodes.length;e++)t.appendChild(l.originalHtml.childNodes[e].cloneNode(!0))}var l=this;this.addedNode=!!o&&document.createTextNode(" "+o),t=t||e,this.originalHtml=t.cloneNode(!0),this.trackingElem=e,this.container=t,this.destroy=function(){t.innerHTML="",i()},this.refresh=function(){n()},r()}Object.defineProperty(t,"__esModule",{value:!0}),o.prototype.deleteLastWord=function(e){return e.replace(/\s*\S+\s*$/,"")},o.prototype.deletingLastWords=function(e){for(;this.trackingElem.scrollHeight-this.trackingElem.offsetHeight>0&&e.textContent;)e.textContent=this.deleteLastWord(e.textContent);return e.textContent},o.prototype.cutTextByLastWord=function(e){var t=e.lastChild;if(t)switch(t.nodeType){case 1:t.childNodes.length?this.cutTextByLastWord(t):t.parentNode.removeChild(t);break;case 3:if(t.textContent.replace(/\s*/,"")){var o=this.deletingLastWords(t);""===o&&1===e.childNodes.length&&e.parentNode.removeChild(e)}else t.parentNode.removeChild(t);break;case 8:t.parentNode.removeChild(t)}},o.prototype.cutTextByLastWordStatic=function(e){var t=e.lastChild;if(t)switch(t.nodeType){case 1:t.childNodes.length?this.cutTextByLastWordStatic(t):t.parentNode.removeChild(t);break;case 3:if(t.textContent.replace(/\s*/,"")){var o=this.deleteLastWord(t.textContent);t.textContent=o,""===o&&1===e.childNodes.length&&e.parentNode.removeChild(e)}else t.parentNode.removeChild(t);break;case 8:t.parentNode.removeChild(t)}},o.prototype.deleteUnnecessaryHtml=function(e,t){for(;e.scrollHeight-e.offsetHeight>0&&t.lastChild;)this.cutTextByLastWord(t);t.lastChild?e.classList.remove("is-empty"):e.classList.add("is-empty")},o.prototype.toString=function(){return this.trackingElem.textContent},o.prototype.valueOf=function(){return this.trackingElem.textContent.length},o.prototype.addNode=function(e,t,o){for(t.appendChild(o);e.scrollHeight-e.offsetHeight>0&&t.childNodes.length>1;)t.removeChild(o),this.cutTextByLastWordStatic(t),t.appendChild(o);e.scrollHeight-e.offsetHeight>0&&1===t.childNodes.length&&t.removeChild(o)};var r={enumerable:!1,configurable:!1,writable:!1};for(var n in o.prototype)"function"==typeof o.prototype[n]&&Object.defineProperty(o.prototype,n,r);t.default=o},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.moduleName="overflow-tracking",t.directiveName="overflowTracking"}]);

@@ -86,3 +86,2 @@ import HtmlOverflowTracking from '../classes/HtmlOverflowTracking.cls';

export default ()=>{
'ngInject';
return {

@@ -100,2 +99,3 @@ scope:{

controller:function($scope, $element, $attrs,$timeout){
'ngInject';
$timeout(function(){

@@ -102,0 +102,0 @@ var mode = $attrs[directiveName];

{
"name": "angular-overflow-tracking",
"version": "0.0.3",
"version": "0.0.4",
"description": "directive tracks the container overflows",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -71,3 +71,3 @@ 'use strict';

host: 'localhost',
port: 3000,
port: 3002,
server: { baseDir: [__dirname] }

@@ -74,0 +74,0 @@ }),

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc