diff --git a/lib/editor/tiny/plugins/media/amd/build/helpers.min.js.map b/lib/editor/tiny/plugins/media/amd/build/helpers.min.js.map index 99b5e24df3c..65023c24f37 100644 --- a/lib/editor/tiny/plugins/media/amd/build/helpers.min.js.map +++ b/lib/editor/tiny/plugins/media/amd/build/helpers.min.js.map @@ -1 +1 @@ -{"version":3,"file":"helpers.min.js","sources":["../src/helpers.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Tiny media plugin helpers for image and embed.\n *\n * @module tiny_media/helpers\n * @copyright 2024 Stevani Andolo \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Templates from 'core/templates';\nimport Selectors from './selectors';\nimport Config from 'core/config';\n\n/**\n * Renders and inserts the body template for inserting an media into the modal.\n *\n * @param {object} templateContext - The context for rendering the template.\n * @param {HTMLElement} root - The root element where the template will be inserted.\n * @returns {Promise}\n */\nexport const body = async(templateContext, root) => {\n return Templates.renderForPromise(templateContext.bodyTemplate, {...templateContext})\n .then(({html, js}) => {\n Templates.replaceNodeContents(root.querySelector(Selectors[templateContext.selector].elements.bodyTemplate), html, js);\n return;\n })\n .catch(error => {\n window.console.log(error);\n });\n};\n\n/**\n * Renders and inserts the footer template for inserting an media into the modal.\n *\n * @param {object} templateContext - The context for rendering the template.\n * @param {HTMLElement} root - The root element where the template will be inserted.\n * @returns {Promise}\n */\nexport const footer = async(templateContext, root) => {\n return Templates.renderForPromise(templateContext.footerTemplate, {...templateContext})\n .then(({html, js}) => {\n Templates.replaceNodeContents(root.querySelector(Selectors[templateContext.selector].elements.footerTemplate), html, js);\n return;\n })\n .catch(error => {\n window.console.log(error);\n });\n};\n\n/**\n * Set extra properties on an instance using incoming data.\n *\n * @param {object} instance\n * @param {object} data\n * @return {object} Modified instance\n */\nexport const setPropertiesFromData = async(instance, data) => {\n for (const property in data) {\n if (typeof data[property] !== 'function') {\n instance[property] = data[property];\n }\n }\n return instance;\n};\n\n/**\n * Check if given string is a valid URL.\n *\n * @param {String} urlString URL the link will point to.\n * @returns {boolean} True is valid, otherwise false.\n */\nexport const isValidUrl = urlString => {\n const urlPattern = new RegExp('^(https?:\\\\/\\\\/)?' + // Protocol.\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|' + // Domain name.\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3})|localhost)' + // OR ip (v4) address, localhost.\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*'); // Port and path.\n return !!urlPattern.test(urlString);\n};\n\n/**\n * Hide the element(s).\n *\n * @param {string|string[]} elements - The CSS selector for the elements to toggle.\n * @param {object} root - The CSS selector for the elements to toggle.\n */\nexport const hideElements = (elements, root) => {\n if (elements instanceof Array) {\n elements.forEach((elementSelector) => {\n const element = root.querySelector(elementSelector);\n if (element) {\n element.classList.add('d-none');\n }\n });\n } else {\n const element = root.querySelector(elements);\n if (element) {\n element.classList.add('d-none');\n }\n }\n};\n\n/**\n * Show the element(s).\n *\n * @param {string|string[]} elements - The CSS selector for the elements to toggle.\n * @param {object} root - The CSS selector for the elements to toggle.\n */\nexport const showElements = (elements, root) => {\n if (elements instanceof Array) {\n elements.forEach((elementSelector) => {\n const element = root.querySelector(elementSelector);\n if (element) {\n element.classList.remove('d-none');\n }\n });\n } else {\n const element = root.querySelector(elements);\n if (element) {\n element.classList.remove('d-none');\n }\n }\n};\n\n/**\n * Displays the upload loader and disables UI elements while loading a file.\n *\n * @param {html} root Modal element\n * @param {string} selector String of type IMAGE/EMBED\n */\nexport const startMediaLoading = (root, selector) => {\n showElements(Selectors[selector].elements.loaderIcon, root);\n const elementsToHide = [\n Selectors[selector].elements.insertMedia,\n Selectors[selector].elements.urlWarning,\n Selectors[selector].elements.modalFooter,\n ];\n hideElements(elementsToHide, root);\n};\n\n/**\n * Hide the upload loader and enable UI elements when loaded.\n *\n * @param {html} root Modal element\n * @param {string} selector String of type IMAGE/EMBED\n */\nexport const stopMediaLoading = (root, selector) => {\n hideElements(Selectors[selector].elements.loaderIcon, root);\n const elementsToShow = [\n Selectors[selector].elements.insertMedia,\n Selectors[selector].elements.modalFooter,\n ];\n showElements(elementsToShow, root);\n};\n\n/**\n * Return true or false if the url is external.\n *\n * @param {string} url\n * @returns\n */\nexport const isExternalUrl = (url) => {\n const regex = new RegExp(`${Config.wwwroot}`);\n\n // True if the URL is from external, otherwise false.\n return regex.test(url) === false;\n};\n\n/**\n * Set the string for the URL label element.\n *\n * @param {object} props - The label text to set.\n */\nexport const setFilenameLabel = (props) => {\n const urlLabelEle = props.root.querySelector(props.fileNameSelector);\n if (urlLabelEle) {\n urlLabelEle.innerHTML = props.label;\n urlLabelEle.setAttribute(\"title\", props.label);\n }\n};\n\n/**\n * This function checks whether an image URL is local (within the same website's domain) or external (from an external source).\n * Depending on the result, it dynamically updates the visibility and content of HTML elements in a user interface.\n * If the image is local then we only show it's filename.\n * If the image is external then it will show full URL and it can be updated.\n *\n * @param {object} props\n */\nexport const sourceTypeChecked = (props) => {\n if (props.fetchedTitle) {\n props.label = props.fetchedTitle;\n } else {\n if (!isExternalUrl(props.source)) {\n // Split the URL by '/' to get an array of segments.\n const segments = props.source.split('/');\n // Get the last segment, which should be the filename.\n const filename = segments.pop().split('?')[0];\n // Show the file name.\n props.label = decodeURI(filename);\n } else {\n props.label = decodeURI(props.source);\n }\n }\n setFilenameLabel(props);\n};\n\n/**\n * Get filename from the name label.\n *\n * @param {string} fileLabel\n * @returns {string}\n */\nexport const getFileName = (fileLabel) => {\n if (fileLabel.includes('/')) {\n const split = fileLabel.split('/');\n let fileName = split[split.length - 1];\n fileName = fileName.split('.');\n if (fileName.length > 1) {\n return decodeURI(fileName.slice(0, (fileName.length - 1)).join('.'));\n } else {\n return decodeURI(fileName[0]);\n }\n } else {\n return decodeURI(fileLabel.split('.')[0]);\n }\n};\n\n/**\n * Return true or false if % is found.\n *\n * @param {string} value\n * @returns {boolean}\n */\nexport const isPercentageValue = (value) => {\n return value.match(/\\d+%/);\n};\n"],"names":["async","templateContext","root","Templates","renderForPromise","bodyTemplate","then","_ref","html","js","replaceNodeContents","querySelector","Selectors","selector","elements","catch","error","window","console","log","footerTemplate","_ref2","instance","data","property","urlString","RegExp","test","hideElements","Array","forEach","elementSelector","element","classList","add","showElements","remove","loaderIcon","elementsToHide","insertMedia","urlWarning","modalFooter","elementsToShow","isExternalUrl","url","Config","wwwroot","setFilenameLabel","props","urlLabelEle","fileNameSelector","innerHTML","label","setAttribute","fetchedTitle","source","decodeURI","filename","split","pop","fileLabel","includes","fileName","length","slice","join","value","match"],"mappings":";;;;;;;ogBAkCoBA,MAAMC,gBAAiBC,OAChCC,mBAAUC,iBAAiBH,gBAAgBI,aAAc,IAAIJ,kBACnEK,MAAKC,WAACC,KAACA,KAADC,GAAOA,4BACAC,oBAAoBR,KAAKS,cAAcC,mBAAUX,gBAAgBY,UAAUC,SAAST,cAAeG,KAAMC,OAGtHM,OAAMC,QACHC,OAAOC,QAAQC,IAAIH,0BAWLhB,MAAMC,gBAAiBC,OAClCC,mBAAUC,iBAAiBH,gBAAgBmB,eAAgB,IAAInB,kBACrEK,MAAKe,YAACb,KAACA,KAADC,GAAOA,6BACAC,oBAAoBR,KAAKS,cAAcC,mBAAUX,gBAAgBY,UAAUC,SAASM,gBAAiBZ,KAAMC,OAGxHM,OAAMC,QACHC,OAAOC,QAAQC,IAAIH,yCAWUhB,MAAMsB,SAAUC,YAC5C,MAAMC,YAAYD,KACW,mBAAnBA,KAAKC,YACZF,SAASE,UAAYD,KAAKC,kBA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AK,GAE3CV,MAAMI,MAAQI,UAAUC,UAKhCV,iBAAiBC,6BASOY,eACpBA,UAAUC,SAAS,KAAM,OACnBH,MAAQE,UAAUF,MAAM,SAC1BI,SAAWJ,MAAMA,MAAMK,OAAS,UACpCD,SAAWA,SAASJ,MAAM,KACtBI,SAASC,OAAS,EACXP,UAAUM,SAASE,MAAM,EAAIF,SAASC,OAAS,GAAIE,KAAK,MAExDT,UAAUM,SAAS,WAGvBN,UAAUI,UAAUF,MAAM,KAAK,gCAUZQ,OACvBA,MAAMC,MAAM"} \ No newline at end of file +{"version":3,"file":"helpers.min.js","sources":["../src/helpers.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Tiny media plugin helpers for image and embed.\n *\n * @module tiny_media/helpers\n * @copyright 2024 Stevani Andolo \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Templates from 'core/templates';\nimport Selectors from './selectors';\nimport Config from 'core/config';\n\n/**\n * Renders and inserts the body template for inserting an media into the modal.\n *\n * @param {object} templateContext - The context for rendering the template.\n * @param {HTMLElement} root - The root element where the template will be inserted.\n * @returns {Promise}\n */\nexport const body = async(templateContext, root) => {\n return Templates.renderForPromise(templateContext.bodyTemplate, {...templateContext})\n .then(({html, js}) => {\n Templates.replaceNodeContents(root.querySelector(Selectors[templateContext.selector].elements.bodyTemplate), html, js);\n return;\n })\n .catch(error => {\n window.console.log(error);\n });\n};\n\n/**\n * Renders and inserts the footer template for inserting an media into the modal.\n *\n * @param {object} templateContext - The context for rendering the template.\n * @param {HTMLElement} root - The root element where the template will be inserted.\n * @returns {Promise}\n */\nexport const footer = async(templateContext, root) => {\n return Templates.renderForPromise(templateContext.footerTemplate, {...templateContext})\n .then(({html, js}) => {\n Templates.replaceNodeContents(root.querySelector(Selectors[templateContext.selector].elements.footerTemplate), html, js);\n return;\n })\n .catch(error => {\n window.console.log(error);\n });\n};\n\n/**\n * Set extra properties on an instance using incoming data.\n *\n * @param {object} instance\n * @param {object} data\n * @return {object} Modified instance\n */\nexport const setPropertiesFromData = async(instance, data) => {\n for (const property in data) {\n if (typeof data[property] !== 'function') {\n instance[property] = data[property];\n }\n }\n return instance;\n};\n\n/**\n * Check if given string is a valid URL.\n *\n * @param {String} urlString URL the link will point to.\n * @returns {boolean} True is valid, otherwise false.\n */\nexport const isValidUrl = urlString => {\n const urlPattern = new RegExp('^(https?:\\\\/\\\\/)?' + // Protocol.\n '((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|' + // Domain name.\n '((\\\\d{1,3}\\\\.){3}\\\\d{1,3})|localhost)' + // OR ip (v4) address, localhost.\n '(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*'); // Port and path.\n return !!urlPattern.test(urlString);\n};\n\n/**\n * Hide the element(s).\n *\n * @param {string|string[]} elements - The CSS selector for the elements to toggle.\n * @param {object} root - The CSS selector for the elements to toggle.\n */\nexport const hideElements = (elements, root) => {\n if (elements instanceof Array) {\n elements.forEach((elementSelector) => {\n const element = root.querySelector(elementSelector);\n if (element) {\n element.classList.add('d-none');\n }\n });\n } else {\n const element = root.querySelector(elements);\n if (element) {\n element.classList.add('d-none');\n }\n }\n};\n\n/**\n * Show the element(s).\n *\n * @param {string|string[]} elements - The CSS selector for the elements to toggle.\n * @param {object} root - The CSS selector for the elements to toggle.\n */\nexport const showElements = (elements, root) => {\n if (elements instanceof Array) {\n elements.forEach((elementSelector) => {\n const element = root.querySelector(elementSelector);\n if (element) {\n element.classList.remove('d-none');\n }\n });\n } else {\n const element = root.querySelector(elements);\n if (element) {\n element.classList.remove('d-none');\n }\n }\n};\n\n/**\n * Displays the upload loader and disables UI elements while loading a file.\n *\n * @param {html} root Modal element\n * @param {string} selector String of type IMAGE/EMBED\n */\nexport const startMediaLoading = (root, selector) => {\n showElements(Selectors[selector].elements.loaderIcon, root);\n const elementsToHide = [\n Selectors[selector].elements.insertMedia,\n Selectors[selector].elements.urlWarning,\n Selectors[selector].elements.modalFooter,\n ];\n hideElements(elementsToHide, root);\n};\n\n/**\n * Hide the upload loader and enable UI elements when loaded.\n *\n * @param {html} root Modal element\n * @param {string} selector String of type IMAGE/EMBED\n */\nexport const stopMediaLoading = (root, selector) => {\n hideElements(Selectors[selector].elements.loaderIcon, root);\n const elementsToShow = [\n Selectors[selector].elements.insertMedia,\n Selectors[selector].elements.modalFooter,\n ];\n showElements(elementsToShow, root);\n};\n\n/**\n * Return true or false if the url is external.\n *\n * @param {string} url\n * @returns {boolean} True if the URL is external, otherwise false.\n */\nexport const isExternalUrl = (url) => {\n const regex = new RegExp(`${Config.wwwroot}`);\n\n // True if the URL is from external, otherwise false.\n return regex.test(url) === false;\n};\n\n/**\n * Set the string for the URL label element.\n *\n * @param {object} props - The label text to set.\n */\nexport const setFilenameLabel = (props) => {\n const urlLabelEle = props.root.querySelector(props.fileNameSelector);\n if (urlLabelEle) {\n urlLabelEle.innerHTML = props.label;\n urlLabelEle.setAttribute(\"title\", props.label);\n }\n};\n\n/**\n * This function checks whether an image URL is local (within the same website's domain) or external (from an external source).\n * Depending on the result, it dynamically updates the visibility and content of HTML elements in a user interface.\n * If the image is local then we only show it's filename.\n * If the image is external then it will show full URL and it can be updated.\n *\n * @param {object} props\n */\nexport const sourceTypeChecked = (props) => {\n if (props.fetchedTitle) {\n props.label = props.fetchedTitle;\n } else {\n if (!isExternalUrl(props.source)) {\n // Split the URL by '/' to get an array of segments.\n const segments = props.source.split('/');\n // Get the last segment, which should be the filename.\n const filename = segments.pop().split('?')[0];\n // Show the file name.\n props.label = decodeURI(filename);\n } else {\n props.label = decodeURI(props.source);\n }\n }\n setFilenameLabel(props);\n};\n\n/**\n * Get filename from the name label.\n *\n * @param {string} fileLabel\n * @returns {string}\n */\nexport const getFileName = (fileLabel) => {\n if (fileLabel.includes('/')) {\n const split = fileLabel.split('/');\n let fileName = split[split.length - 1];\n fileName = fileName.split('.');\n if (fileName.length > 1) {\n return decodeURI(fileName.slice(0, (fileName.length - 1)).join('.'));\n } else {\n return decodeURI(fileName[0]);\n }\n } else {\n return decodeURI(fileLabel.split('.')[0]);\n }\n};\n\n/**\n * Return true or false if % is found.\n *\n * @param {string} value\n * @returns {boolean}\n */\nexport const isPercentageValue = (value) => {\n return value.match(/\\d+%/);\n};\n"],"names":["async","templateContext","root","Templates","renderForPromise","bodyTemplate","then","_ref","html","js","replaceNodeContents","querySelector","Selectors","selector","elements","catch","error","window","console","log","footerTemplate","_ref2","instance","data","property","urlString","RegExp","test","hideElements","Array","forEach","elementSelector","element","classList","add","showElements","remove","loaderIcon","elementsToHide","insertMedia","urlWarning","modalFooter","elementsToShow","isExternalUrl","url","Config","wwwroot","setFilenameLabel","props","urlLabelEle","fileNameSelector","innerHTML","label","setAttribute","fetchedTitle","source","decodeURI","filename","split","pop","fileLabel","includes","fileName","length","slice","join","value","match"],"mappings":";;;;;;;ogBAkCoBA,MAAMC,gBAAiBC,OAChCC,mBAAUC,iBAAiBH,gBAAgBI,aAAc,IAAIJ,kBACnEK,MAAKC,WAACC,KAACA,KAADC,GAAOA,4BACAC,oBAAoBR,KAAKS,cAAcC,mBAAUX,gBAAgBY,UAAUC,SAAST,cAAeG,KAAMC,OAGtHM,OAAMC,QACHC,OAAOC,QAAQC,IAAIH,0BAWLhB,MAAMC,gBAAiBC,OAClCC,mBAAUC,iBAAiBH,gBAAgBmB,eAAgB,IAAInB,kBACrEK,MAAKe,YAACb,KAACA,KAADC,GAAOA,6BACAC,oBAAoBR,KAAKS,cAAcC,mBAAUX,gBAAgBY,UA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,WAC1BA,MAAMM,aACNN,MAAMI,MAAQJ,MAAMM,qBAEfX,cAAcK,MAAMO,QAQrBP,MAAMI,MAAQI,UAAUR,MAAMO,YARA,OAIxBE,SAFWT,MAAMO,OAAOG,MAAM,KAEVC,MAAMD,MAAM,KAAK,GAE3CV,MAAMI,MAAQI,UAAUC,UAKhCV,iBAAiBC,6BASOY,eACpBA,UAAUC,SAAS,KAAM,OACnBH,MAAQE,UAAUF,MAAM,SAC1BI,SAAWJ,MAAMA,MAAMK,OAAS,UACpCD,SAAWA,SAASJ,MAAM,KACtBI,SAASC,OAAS,EACXP,UAAUM,SAASE,MAAM,EAAIF,SAASC,OAAS,GAAIE,KAAK,MAExDT,UAAUM,SAAS,WAGvBN,UAAUI,UAAUF,MAAM,KAAK,gCAUZQ,OACvBA,MAAMC,MAAM"} \ No newline at end of file diff --git a/lib/editor/tiny/plugins/media/amd/build/mediabase.min.js.map b/lib/editor/tiny/plugins/media/amd/build/mediabase.min.js.map index fde060c4582..f8f8b9263c0 100644 --- a/lib/editor/tiny/plugins/media/amd/build/mediabase.min.js.map +++ b/lib/editor/tiny/plugins/media/amd/build/mediabase.min.js.map @@ -1 +1 @@ -{"version":3,"file":"mediabase.min.js","sources":["../src/mediabase.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Tiny media plugin class helpers for image and embed.\n *\n * @module tiny_media/mediabase\n * @copyright 2024 Stevani Andolo \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {\n isPercentageValue,\n hideElements,\n showElements,\n} from './helpers';\nimport Selectors from './selectors';\n\nexport class MediaBase {\n\n /**\n * Handles the selection of media size options and updates the form inputs accordingly.\n *\n * @param {string} option - The selected media size option (\"original\" or \"custom\").\n */\n sizeChecked = async(option) => {\n const widthInput = this.root.querySelector(Selectors[this.selectorType].elements.width);\n const heightInput = this.root.querySelector(Selectors[this.selectorType].elements.height);\n if (option === \"original\") {\n this.sizeOriginalChecked();\n widthInput.value = this.mediaDimensions.width;\n heightInput.value = this.mediaDimensions.height;\n } else if (option === \"custom\") {\n this.sizeCustomChecked();\n widthInput.value = this.currentWidth;\n heightInput.value = this.currentHeight;\n\n // If the current size is equal to the original size and selectorType = IMAGE,\n // then check the Keep proportion checkbox.\n if (\n this.selectorType === Selectors.IMAGE.type &&\n this.currentWidth === this.mediaDimensions.width &&\n this.currentHeight === this.mediaDimensions.height\n ) {\n const constrainField = this.root.querySelector(Selectors[this.selectorType].elements.constrain);\n constrainField.checked = true;\n }\n }\n this.autoAdjustSize();\n };\n\n /**\n * Handles the selection of the \"Original Size\" option and updates the form elements accordingly.\n */\n sizeOriginalChecked() {\n this.root.querySelector(Selectors[this.selectorType].elements.sizeOriginal).checked = true;\n this.root.querySelector(Selectors[this.selectorType].elements.sizeCustom).checked = false;\n hideElements(Selectors[this.selectorType].elements.properties, this.root);\n }\n\n /**\n * Handles the selection of the \"Custom Size\" option and updates the form elements accordingly.\n */\n sizeCustomChecked() {\n this.root.querySelector(Selectors[this.selectorType].elements.sizeOriginal).checked = false;\n this.root.querySelector(Selectors[this.selectorType].elements.sizeCustom).checked = true;\n showElements(Selectors[this.selectorType].elements.properties, this.root);\n }\n\n /**\n * Auto adjust the media width/height.\n * It is put here so image.js and/or friends can extend this class and call this for media proportion.\n *\n * @param {boolean} forceHeight Whether set by height or not\n * @returns\n */\n autoAdjustSize = (forceHeight = false) => {\n // If we do not know the media size, do not do anything.\n if (!this.mediaDimensions) {\n return;\n }\n\n const widthField = this.root.querySelector(Selectors[this.selectorType].elements.width);\n const heightField = this.root.querySelector(Selectors[this.selectorType].elements.height);\n\n const normalizeFieldData = (fieldData) => {\n fieldData.isPercentageValue = isPercentageValue(fieldData.field.value);\n if (fieldData.isPercentageValue) {\n fieldData.percentValue = parseInt(fieldData.field.value, 10);\n fieldData.pixelSize = this.mediaDimensions[fieldData.type] / 100 * fieldData.percentValue;\n } else {\n fieldData.pixelSize = parseInt(fieldData.field.value, 10);\n fieldData.percentValue = fieldData.pixelSize / this.mediaDimensions[fieldData.type] * 100;\n }\n\n return fieldData;\n };\n\n const getKeyField = () => {\n const getValue = () => {\n if (forceHeight) {\n return {\n field: heightField,\n type: 'height',\n };\n } else {\n return {\n field: widthField,\n type: 'width',\n };\n }\n };\n\n const currentValue = getValue();\n if (currentValue.field.value === '') {\n currentValue.field.value = this.mediaDimensions[currentValue.type];\n }\n\n return normalizeFieldData(currentValue);\n };\n\n const getRelativeField = () => {\n if (forceHeight) {\n return normalizeFieldData({\n field: widthField,\n type: 'width',\n });\n } else {\n return normalizeFieldData({\n field: heightField,\n type: 'height',\n });\n }\n };\n\n // Now update with the new values.\n const constrainField = this.root.querySelector(Selectors[this.selectorType].elements.constrain); // Only image.\n if ((constrainField && constrainField.checked) || this.mediaType === 'video') {\n const keyField = getKeyField();\n const relativeField = getRelativeField();\n // We are keeping the media in proportion.\n // Calculate the size for the relative field.\n if (keyField.isPercentageValue) {\n // In proportion, so the percentages are the same.\n relativeField.field.value = keyField.field.value;\n relativeField.percentValue = keyField.percentValue;\n } else {\n relativeField.pixelSize = Math.round(\n keyField.pixelSize / this.mediaDimensions[keyField.type] * this.mediaDimensions[relativeField.type]\n );\n relativeField.field.value = relativeField.pixelSize;\n }\n }\n\n if (this.selectorType === Selectors.IMAGE.type) {\n // Store the custom width and height to reuse.\n this.currentWidth = Number(widthField.value) !== this.mediaDimensions.width ? widthField.value : this.currentWidth;\n this.currentHeight = Number(heightField.value) !== this.mediaDimensions.height ? heightField.value : this.currentHeight;\n }\n };\n}\n"],"names":["async","widthInput","this","root","querySelector","Selectors","selectorType","elements","width","heightInput","height","option","sizeOriginalChecked","value","mediaDimensions","sizeCustomChecked","currentWidth","currentHeight","IMAGE","type","constrain","checked","autoAdjustSize","forceHeight","_this","widthField","heightField","normalizeFieldData","fieldData","isPercentageValue","field","percentValue","parseInt","pixelSize","getKeyField","currentValue","getRelativeField","constrainField","mediaType","keyField","relativeField","Math","round","Number","sizeOriginal","sizeCustom","properties"],"mappings":"kgBAoCkBA,MAAAA,eACJC,WAAaC,KAAKC,KAAKC,cAAcC,mBAAUH,KAAKI,cAAcC,SAASC,OAC3EC,YAAcP,KAAKC,KAAKC,cAAcC,mBAAUH,KAAKI,cAAcC,SAASG,WACnE,aAAXC,YACKC,sBACLX,WAAWY,MAAQX,KAAKY,gBAAgBN,MACxCC,YAAYI,MAAQX,KAAKY,gBAAgBJ,YACtC,GAAe,WAAXC,cACFI,oBACLd,WAAWY,MAAQX,KAAKc,aACxBP,YAAYI,MAAQX,KAAKe,cAKrBf,KAAKI,eAAiBD,mBAAUa,MAAMC,MACtCjB,KAAKc,eAAiBd,KAAKY,gBAAgBN,OAC3CN,KAAKe,gBAAkBf,KAAKY,gBAAgBJ,QAC9C,CACyBR,KAAKC,KAAKC,cAAcC,mBAAUH,KAAKI,cAAcC,SAASa,WACtEC,SAAU,OAG5BC,2DA4BQ,eAACC,wEAETC,MAAKV,6BAIJW,WAAaD,MAAKrB,KAAKC,cAAcC,mBAAUmB,MAAKlB,cAAcC,SAASC,OAC3EkB,YAAcF,MAAKrB,KAAKC,cAAcC,mBAAUmB,MAAKlB,cAAcC,SAASG,QAE5EiB,mBAAsBC,YACxBA,UAAUC,mBAAoB,8BAAkBD,UAAUE,MAAMjB,OAC5De,UAAUC,mBACVD,UAAUG,aAAeC,SAASJ,UAAUE,MAAMjB,MAAO,IACzDe,UAAUK,UAAYT,MAAKV,gBAAgBc,UAAUT,MAAQ,IAAMS,UAAUG,eAE7EH,UAAUK,UAAYD,SAASJ,UAAUE,MAAMj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,KAAKC,cAAcC,mBAAUH,KAAKI,cAAcC,SAASqC,cAAcvB,SAAU,OACjFlB,KAAKC,cAAcC,mBAAUH,KAAKI,cAAcC,SAASsC,YAAYxB,SAAU,4BACvEhB,mBAAUH,KAAKI,cAAcC,SAASuC,WAAY5C,KAAKC"} \ No newline at end of file +{"version":3,"file":"mediabase.min.js","sources":["../src/mediabase.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Tiny media plugin class helpers for image and embed.\n *\n * @module tiny_media/mediabase\n * @copyright 2024 Stevani Andolo \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {\n isPercentageValue,\n hideElements,\n showElements,\n} from './helpers';\nimport Selectors from './selectors';\n\nexport class MediaBase {\n\n /**\n * Handles the selection of media size options and updates the form inputs accordingly.\n *\n * @param {string} option - The selected media size option (\"original\" or \"custom\").\n */\n sizeChecked = async(option) => {\n const widthInput = this.root.querySelector(Selectors[this.selectorType].elements.width);\n const heightInput = this.root.querySelector(Selectors[this.selectorType].elements.height);\n if (option === \"original\") {\n this.sizeOriginalChecked();\n widthInput.value = this.mediaDimensions.width;\n heightInput.value = this.mediaDimensions.height;\n } else if (option === \"custom\") {\n this.sizeCustomChecked();\n widthInput.value = this.currentWidth;\n heightInput.value = this.currentHeight;\n\n // If the current size is equal to the original size and selectorType = IMAGE,\n // then check the Keep proportion checkbox.\n if (\n this.selectorType === Selectors.IMAGE.type &&\n this.currentWidth === this.mediaDimensions.width &&\n this.currentHeight === this.mediaDimensions.height\n ) {\n const constrainField = this.root.querySelector(Selectors[this.selectorType].elements.constrain);\n constrainField.checked = true;\n }\n }\n this.autoAdjustSize();\n };\n\n /**\n * Handles the selection of the \"Original Size\" option and updates the form elements accordingly.\n */\n sizeOriginalChecked() {\n this.root.querySelector(Selectors[this.selectorType].elements.sizeOriginal).checked = true;\n this.root.querySelector(Selectors[this.selectorType].elements.sizeCustom).checked = false;\n hideElements(Selectors[this.selectorType].elements.properties, this.root);\n }\n\n /**\n * Handles the selection of the \"Custom Size\" option and updates the form elements accordingly.\n */\n sizeCustomChecked() {\n this.root.querySelector(Selectors[this.selectorType].elements.sizeOriginal).checked = false;\n this.root.querySelector(Selectors[this.selectorType].elements.sizeCustom).checked = true;\n showElements(Selectors[this.selectorType].elements.properties, this.root);\n }\n\n /**\n * Auto adjust the media width/height.\n * It is put here so image.js and/or friends can extend this class and call this for media proportion.\n *\n * @param {boolean} forceHeight Whether set by height or not\n */\n autoAdjustSize = (forceHeight = false) => {\n // If we do not know the media size, do not do anything.\n if (!this.mediaDimensions) {\n return;\n }\n\n const widthField = this.root.querySelector(Selectors[this.selectorType].elements.width);\n const heightField = this.root.querySelector(Selectors[this.selectorType].elements.height);\n\n const normalizeFieldData = (fieldData) => {\n fieldData.isPercentageValue = isPercentageValue(fieldData.field.value);\n if (fieldData.isPercentageValue) {\n fieldData.percentValue = parseInt(fieldData.field.value, 10);\n fieldData.pixelSize = this.mediaDimensions[fieldData.type] / 100 * fieldData.percentValue;\n } else {\n fieldData.pixelSize = parseInt(fieldData.field.value, 10);\n fieldData.percentValue = fieldData.pixelSize / this.mediaDimensions[fieldData.type] * 100;\n }\n\n return fieldData;\n };\n\n const getKeyField = () => {\n const getValue = () => {\n if (forceHeight) {\n return {\n field: heightField,\n type: 'height',\n };\n } else {\n return {\n field: widthField,\n type: 'width',\n };\n }\n };\n\n const currentValue = getValue();\n if (currentValue.field.value === '') {\n currentValue.field.value = this.mediaDimensions[currentValue.type];\n }\n\n return normalizeFieldData(currentValue);\n };\n\n const getRelativeField = () => {\n if (forceHeight) {\n return normalizeFieldData({\n field: widthField,\n type: 'width',\n });\n } else {\n return normalizeFieldData({\n field: heightField,\n type: 'height',\n });\n }\n };\n\n // Now update with the new values.\n const constrainField = this.root.querySelector(Selectors[this.selectorType].elements.constrain); // Only image.\n if ((constrainField && constrainField.checked) || this.mediaType === 'video') {\n const keyField = getKeyField();\n const relativeField = getRelativeField();\n // We are keeping the media in proportion.\n // Calculate the size for the relative field.\n if (keyField.isPercentageValue) {\n // In proportion, so the percentages are the same.\n relativeField.field.value = keyField.field.value;\n relativeField.percentValue = keyField.percentValue;\n } else {\n relativeField.pixelSize = Math.round(\n keyField.pixelSize / this.mediaDimensions[keyField.type] * this.mediaDimensions[relativeField.type]\n );\n relativeField.field.value = relativeField.pixelSize;\n }\n }\n\n if (this.selectorType === Selectors.IMAGE.type) {\n // Store the custom width and height to reuse.\n this.currentWidth = Number(widthField.value) !== this.mediaDimensions.width ? widthField.value : this.currentWidth;\n this.currentHeight = Number(heightField.value) !== this.mediaDimensions.height ? heightField.value : this.currentHeight;\n }\n };\n}\n"],"names":["async","widthInput","this","root","querySelector","Selectors","selectorType","elements","width","heightInput","height","option","sizeOriginalChecked","value","mediaDimensions","sizeCustomChecked","currentWidth","currentHeight","IMAGE","type","constrain","checked","autoAdjustSize","forceHeight","_this","widthField","heightField","normalizeFieldData","fieldData","isPercentageValue","field","percentValue","parseInt","pixelSize","getKeyField","currentValue","getRelativeField","constrainField","mediaType","keyField","relativeField","Math","round","Number","sizeOriginal","sizeCustom","properties"],"mappings":"kgBAoCkBA,MAAAA,eACJC,WAAaC,KAAKC,KAAKC,cAAcC,mBAAUH,KAAKI,cAAcC,SAASC,OAC3EC,YAAcP,KAAKC,KAAKC,cAAcC,mBAAUH,KAAKI,cAAcC,SAASG,WACnE,aAAXC,YACKC,sBACLX,WAAWY,MAAQX,KAAKY,gBAAgBN,MACxCC,YAAYI,MAAQX,KAAKY,gBAAgBJ,YACtC,GAAe,WAAXC,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AGlBG,SAASV,mBAETW,cAAcV,MAAMjB,MAAQ0B,SAAST,MAAMjB,MAC3C2B,cAAcT,aAAeQ,SAASR,eAEtCS,cAAcP,UAAYQ,KAAKC,MAC3BH,SAASN,UAAYT,MAAKV,gBAAgByB,SAASpB,MAAQK,MAAKV,gBAAgB0B,cAAcrB,OAElGqB,cAAcV,MAAMjB,MAAQ2B,cAAcP,WAI9CT,MAAKlB,eAAiBD,mBAAUa,MAAMC,OAEtCK,MAAKR,aAAe2B,OAAOlB,WAAWZ,SAAWW,MAAKV,gBAAgBN,MAAQiB,WAAWZ,MAAQW,MAAKR,aACtGQ,MAAKP,cAAgB0B,OAAOjB,YAAYb,SAAWW,MAAKV,gBAAgBJ,OAASgB,YAAYb,MAAQW,MAAKP,kBAtGlHL,2BACST,KAAKC,cAAcC,mBAAUH,KAAKI,cAAcC,SAASqC,cAAcvB,SAAU,OACjFlB,KAAKC,cAAcC,mBAAUH,KAAKI,cAAcC,SAASsC,YAAYxB,SAAU,4BACvEhB,mBAAUH,KAAKI,cAAcC,SAASuC,WAAY5C,KAAKC,MAMxEY,yBACSZ,KAAKC,cAAcC,mBAAUH,KAAKI,cAAcC,SAASqC,cAAcvB,SAAU,OACjFlB,KAAKC,cAAcC,mBAAUH,KAAKI,cAAcC,SAASsC,YAAYxB,SAAU,4BACvEhB,mBAAUH,KAAKI,cAAcC,SAASuC,WAAY5C,KAAKC"} \ No newline at end of file diff --git a/lib/editor/tiny/plugins/media/amd/src/helpers.js b/lib/editor/tiny/plugins/media/amd/src/helpers.js index b966dfdb8ae..9768a907c97 100644 --- a/lib/editor/tiny/plugins/media/amd/src/helpers.js +++ b/lib/editor/tiny/plugins/media/amd/src/helpers.js @@ -170,7 +170,7 @@ export const stopMediaLoading = (root, selector) => { * Return true or false if the url is external. * * @param {string} url - * @returns + * @returns {boolean} True if the URL is external, otherwise false. */ export const isExternalUrl = (url) => { const regex = new RegExp(`${Config.wwwroot}`); diff --git a/lib/editor/tiny/plugins/media/amd/src/mediabase.js b/lib/editor/tiny/plugins/media/amd/src/mediabase.js index 43e7730fa98..72000a33647 100644 --- a/lib/editor/tiny/plugins/media/amd/src/mediabase.js +++ b/lib/editor/tiny/plugins/media/amd/src/mediabase.js @@ -83,7 +83,6 @@ export class MediaBase { * It is put here so image.js and/or friends can extend this class and call this for media proportion. * * @param {boolean} forceHeight Whether set by height or not - * @returns */ autoAdjustSize = (forceHeight = false) => { // If we do not know the media size, do not do anything.