From 9b4ead935ed822852dc1185b787a8b2ab00354d5 Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Fri, 28 Jun 2024 17:26:45 +0200 Subject: [PATCH] Removed unused component --- amd/build/util/textfit.min.js | 3 --- amd/build/util/textfit.min.js.map | 1 - 2 files changed, 4 deletions(-) delete mode 100644 amd/build/util/textfit.min.js delete mode 100644 amd/build/util/textfit.min.js.map diff --git a/amd/build/util/textfit.min.js b/amd/build/util/textfit.min.js deleted file mode 100644 index 0d9eaf3..0000000 --- a/amd/build/util/textfit.min.js +++ /dev/null @@ -1,3 +0,0 @@ -define("local_treestudyplan/util/textfit",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.textFit=function(els,options){options||(options={});var settings={};for(var key in defaultSettings)options.hasOwnProperty(key)?settings[key]=options[key]:settings[key]=defaultSettings[key];"function"==typeof els.toArray&&(els=els.toArray());var elType=Object.prototype.toString.call(els);"[object Array]"!==elType&&"[object NodeList]"!==elType&&"[object HTMLCollection]"!==elType&&(els=[els]);for(var i=0;i=2*parseInt(window.getComputedStyle(innerSpan)["font-size"],10)&&(multiLine=!0),multiLine||(el.style["white-space"]="nowrap"),low=settings.minFontSize,high=settings.maxFontSize;for(var size=low;low<=high;){mid=(high+low)/2,innerSpan.style.fontSize=mid+"px";var innerSpanBoundingClientRect=innerSpan.getBoundingClientRect();innerSpanBoundingClientRect.width<=originalWidth&&(settings.widthOnly||innerSpanBoundingClientRect.height<=originalHeight)?(size=mid,low=mid+1):high=mid-1}if(innerSpan.style.fontSize!=size+"px"&&(innerSpan.style.fontSize=size+"px"),settings.alignVert){!function(){if(document.getElementById("textFitStyleSheet"))return;var style=[".textFitAlignVert{","position: absolute;","top: 0; right: 0; bottom: 0; left: 0;","margin: auto;","display: flex;","justify-content: center;","flex-direction: column;","}",".textFitAlignVertFlex{","display: flex;","}",".textFitAlignVertFlex .textFitAlignVert{","position: static;","}"].join(""),css=document.createElement("style");css.type="text/css",css.id="textFitStyleSheet",css.innerHTML=style,document.body.appendChild(css)}();var height=innerSpan.scrollHeight;"static"===window.getComputedStyle(el).position&&(el.style.position="relative"),hasClass(innerSpan,"textFitAlignVert")||(innerSpan.className=innerSpan.className+" textFitAlignVert"),innerSpan.style.height=height+"px",settings.alignVertWithFlexbox&&!hasClass(el,"textFitAlignVertFlex")&&(el.className=el.className+" textFitAlignVertFlex")}}function hasClass(element,cls){return(" "+element.className+" ").indexOf(" "+cls+" ")>-1}})); - -//# sourceMappingURL=textfit.min.js.map \ No newline at end of file diff --git a/amd/build/util/textfit.min.js.map b/amd/build/util/textfit.min.js.map deleted file mode 100644 index 42465b4..0000000 --- a/amd/build/util/textfit.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"textfit.min.js","sources":["../../src/util/textfit.js"],"sourcesContent":["/**\n * textFit v2.3.1\n * Previously known as jQuery.textFit\n * 11/2014 by STRML (strml.github.com)\n * MIT License\n *\n * To use: textFit(document.getElementById('target-div'), options);\n *\n * Will make the *text* content inside a container scale to fit the container\n * The container is required to have a set width and height\n * Uses binary search to fit text with minimal layout calls.\n * Version 2.0 does not use jQuery.\n */\nvar defaultSettings = {\n alignVert: false, // if true, textFit will align vertically using css tables\n alignHoriz: false, // if true, textFit will set text-align: center\n multiLine: false, // if true, textFit will not set white-space: no-wrap\n detectMultiLine: true, // disable to turn off automatic multi-line sensing\n minFontSize: 6,\n maxFontSize: 80,\n reProcess: true, // if true, textFit will re-process already-fit nodes. Set to 'false' for better performance\n widthOnly: false, // if true, textFit will fit text to element width, regardless of text height\n alignVertWithFlexbox: false, // if true, textFit will use flexbox for vertical alignment\n};\n\n/**\n * Create new textFit element(S)\n * @param {*} els element or element list\n * @param {*} options Options (See default settings in textfit.js)\n */\nexport function textFit(els, options) {\n\n if (!options) { options = {}; }\n\n // Extend options.\n var settings = {};\n for(var key in defaultSettings){\n if(options.hasOwnProperty(key)){\n settings[key] = options[key];\n } else {\n settings[key] = defaultSettings[key];\n }\n }\n\n // Convert jQuery objects into arrays\n if (typeof els.toArray === \"function\") {\n els = els.toArray();\n }\n\n // Support passing a single el\n var elType = Object.prototype.toString.call(els);\n if (elType !== '[object Array]' && elType !== '[object NodeList]' &&\n elType !== '[object HTMLCollection]'){\n els = [els];\n }\n\n // Process each el we've passed.\n for(var i = 0; i < els.length; i++){\n processItem(els[i], settings);\n }\n}\n\n/**\n * The meat. Given an el, make the text inside it fit its parent.\n * @param {DOMElement} el Child el.\n * @param {Object} settings Options for fit.\n */\nfunction processItem(el, settings){\n if (!isElement(el) || (!settings.reProcess && el.getAttribute('textFitted'))) {\n return false;\n }\n\n // Set textFitted attribute so we know this was processed.\n if(!settings.reProcess){\n el.setAttribute('textFitted', 1);\n }\n\n var innerSpan, originalHeight, originalHTML, originalWidth;\n var low, mid, high;\n\n // Get element data.\n originalHTML = el.innerHTML;\n originalWidth = innerWidth(el);\n originalHeight = innerHeight(el);\n\n // Don't process if we can't find box dimensions\n if (!originalWidth || (!settings.widthOnly && !originalHeight)) {\n if(!settings.widthOnly) {\n throw new Error('Set a static height and width on the target element ' + el.outerHTML +\n ' before using textFit!');\n } else {\n throw new Error('Set a static width on the target element ' + el.outerHTML +\n ' before using textFit!');\n }\n }\n\n // Add textFitted span inside this container.\n if (originalHTML.indexOf('textFitted') === -1) {\n innerSpan = document.createElement('span');\n innerSpan.className = 'textFitted';\n // Inline block ensure it takes on the size of its contents, even if they are enclosed\n // in other tags like

\n innerSpan.style['display'] = 'inline-block';\n innerSpan.innerHTML = originalHTML;\n el.innerHTML = '';\n el.appendChild(innerSpan);\n } else {\n // Reprocessing.\n innerSpan = el.querySelector('span.textFitted');\n // Remove vertical align if we're reprocessing.\n if (hasClass(innerSpan, 'textFitAlignVert')){\n innerSpan.className = innerSpan.className.replace('textFitAlignVert', '');\n innerSpan.style['height'] = '';\n el.className.replace('textFitAlignVertFlex', '');\n }\n }\n\n // Prepare & set alignment\n if (settings.alignHoriz) {\n el.style['text-align'] = 'center';\n innerSpan.style['text-align'] = 'center';\n }\n\n // Check if this string is multiple lines\n // Not guaranteed to always work if you use wonky line-heights\n var multiLine = settings.multiLine;\n if (settings.detectMultiLine && !multiLine &&\n innerSpan.getBoundingClientRect().height >= parseInt(window.getComputedStyle(innerSpan)['font-size'], 10) * 2){\n multiLine = true;\n }\n\n // If we're not treating this as a multiline string, don't let it wrap.\n if (!multiLine) {\n el.style['white-space'] = 'nowrap';\n }\n\n low = settings.minFontSize;\n high = settings.maxFontSize;\n\n // Binary search for highest best fit\n var size = low;\n while (low <= high) {\n mid = (high + low) / 2;\n innerSpan.style.fontSize = mid + 'px';\n var innerSpanBoundingClientRect = innerSpan.getBoundingClientRect();\n if (\n innerSpanBoundingClientRect.width <= originalWidth\n && (settings.widthOnly || innerSpanBoundingClientRect.height <= originalHeight)\n ) {\n size = mid;\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n // await injection point\n }\n // found, updating font if differs:\n if( innerSpan.style.fontSize != size + 'px' ) { innerSpan.style.fontSize = size + 'px'; }\n\n // Our height is finalized. If we are aligning vertically, set that up.\n if (settings.alignVert) {\n addStyleSheet();\n var height = innerSpan.scrollHeight;\n if (window.getComputedStyle(el)['position'] === \"static\"){\n el.style['position'] = 'relative';\n }\n if (!hasClass(innerSpan, \"textFitAlignVert\")){\n innerSpan.className = innerSpan.className + \" textFitAlignVert\";\n }\n innerSpan.style['height'] = height + \"px\";\n if (settings.alignVertWithFlexbox && !hasClass(el, \"textFitAlignVertFlex\")) {\n el.className = el.className + \" textFitAlignVertFlex\";\n }\n }\n}\n\n/**\n * Calculate height without padding.\n * @param {*} el\n * @returns\n */\nfunction innerHeight(el){\n var style = window.getComputedStyle(el, null);\n return el.getBoundingClientRect().height -\n parseInt(style.getPropertyValue('padding-top'), 10) -\n parseInt(style.getPropertyValue('padding-bottom'), 10);\n}\n\n/**\n * Calculate width without padding.\n * @param {*} el\n * @returns\n */\nfunction innerWidth(el){\n var style = window.getComputedStyle(el, null);\n return el.getBoundingClientRect().width -\n parseInt(style.getPropertyValue('padding-left'), 10) -\n parseInt(style.getPropertyValue('padding-right'), 10);\n}\n\n/**\n * Returns true if it is a DOM element\n * @param {*} o\n * @returns\n */\nfunction isElement(o){\n return (\n typeof HTMLElement === \"object\" ? o instanceof HTMLElement : //DOM2\n o && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName===\"string\"\n );\n}\n\n/**\n * Check if element has a specific class\n * @param {*} element\n * @param {*} cls\n * @returns\n */\nfunction hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n}\n\n// Better than a stylesheet dependency\n/**\n * Add stylesheet to the page for this\n * @returns\n */\nfunction addStyleSheet() {\n if (document.getElementById(\"textFitStyleSheet\")) { return; }\n var style = [\n \".textFitAlignVert{\",\n \"position: absolute;\",\n \"top: 0; right: 0; bottom: 0; left: 0;\",\n \"margin: auto;\",\n \"display: flex;\",\n \"justify-content: center;\",\n \"flex-direction: column;\",\n \"}\",\n \".textFitAlignVertFlex{\",\n \"display: flex;\",\n \"}\",\n \".textFitAlignVertFlex .textFitAlignVert{\",\n \"position: static;\",\n \"}\",].join(\"\");\n\n var css = document.createElement(\"style\");\n css.type = \"text/css\";\n css.id = \"textFitStyleSheet\";\n css.innerHTML = style;\n document.body.appendChild(css);\n}\n"],"names":["els","options","settings","key","defaultSettings","hasOwnProperty","toArray","elType","Object","prototype","toString","call","i","length","processItem","alignVert","alignHoriz","multiLine","detectMultiLine","minFontSize","maxFontSize","reProcess","widthOnly","alignVertWithFlexbox","el","o","HTMLElement","nodeType","nodeName","getAttribute","innerSpan","originalHeight","originalHTML","originalWidth","low","mid","high","setAttribute","innerHTML","style","window","getComputedStyle","getBoundingClientRect","width","parseInt","getPropertyValue","innerWidth","height","innerHeight","Error","outerHTML","indexOf","document","createElement","className","appendChild","hasClass","querySelector","replace","size","fontSize","innerSpanBoundingClientRect","getElementById","join","css","type","id","body","addStyleSheet","scrollHeight","element","cls"],"mappings":"4JA8BwBA,IAAKC,SAEp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