Textpattern PHP Cross Reference Content Management Systems

Source: /textpattern/admin-themes/hiveneutral/assets/js/autosize.js - 6 lines - 3626 bytes - Text - Print

   1  /*!
   2      autosize 4.0.2
   3      license: MIT
   4      http://www.jacklmoore.com/autosize
   5  */
   6  !function(e,t){"function"==typeof define&&define.amd?define(["module","exports"],t):"undefined"!=typeof exports?t(module,exports):(t(t={exports:{}},t.exports),e.autosize=t.exports)}(this,function(e,t){"use strict";var n,o,a="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return-1<n.indexOf(e)},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){e=n.indexOf(e);-1<e&&(n.splice(e,1),o.splice(e,1))}}),c=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){c=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(r){var n,o,i,e,d,t;function l(e){var t=r.style.width;r.style.width="0px",r.offsetWidth,r.style.width=t,r.style.overflowY=e}function s(){var e,t;0!==r.scrollHeight&&(e=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(r),t=document.documentElement&&document.documentElement.scrollTop,r.style.height="",r.style.height=r.scrollHeight+n+"px",o=r.clientWidth,e.forEach(function(e){e.node.scrollTop=e.scrollTop}),t&&(document.documentElement.scrollTop=t))}function u(){s();var e=Math.round(parseFloat(r.style.height)),t=window.getComputedStyle(r,null),n="content-box"===t.boxSizing?Math.round(parseFloat(t.height)):r.offsetHeight;if(n<e?"hidden"===t.overflowY&&(l("scroll"),s(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight):"hidden"!==t.overflowY&&(l("hidden"),s(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight),i!==n){i=n;var o=c("autosize:resized");try{r.dispatchEvent(o)}catch(e){}}}r&&r.nodeName&&"TEXTAREA"===r.nodeName&&!a.has(r)&&(i=o=n=null,e=function(){r.clientWidth!==o&&u()},d=function(t){window.removeEventListener("resize",e,!1),r.removeEventListener("input",u,!1),r.removeEventListener("keyup",u,!1),r.removeEventListener("autosize:destroy",d,!1),r.removeEventListener("autosize:update",u,!1),Object.keys(t).forEach(function(e){r.style[e]=t[e]}),a.delete(r)}.bind(r,{height:r.style.height,resize:r.style.resize,overflowY:r.style.overflowY,overflowX:r.style.overflowX,wordWrap:r.style.wordWrap}),r.addEventListener("autosize:destroy",d,!1),"onpropertychange"in r&&"oninput"in r&&r.addEventListener("keyup",u,!1),window.addEventListener("resize",e,!1),r.addEventListener("input",u,!1),r.addEventListener("autosize:update",u,!1),r.style.overflowX="hidden",r.style.wordWrap="break-word",a.set(r,{destroy:d,update:u}),"vertical"===(t=window.getComputedStyle(r,null)).resize?r.style.resize="none":"both"===t.resize&&(r.style.resize="horizontal"),n="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(n)&&(n=0),u())}function i(e){e=a.get(e);e&&e.destroy()}function d(e){e=a.get(e);e&&e.update()}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],d),e}),t.default=l,e.exports=t.default}),function(){"use strict";var e=document.querySelectorAll("textarea:not(.code)");e.length&&autosize(e)}();

title

Description

title

Description

title

Description

title

title

Body