Proyectos de Subversion Moodle

Rev

Rev 1 | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

{"version":3,"file":"imagehelpers.min.js","sources":["../src/imagehelpers.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 <http://www.gnu.org/licenses/>.\n\n/**\n * Tiny media plugin image helpers.\n *\n * @module      tiny_media/imagehelpers\n * @copyright   2024 Meirza <meirza.arson@moodle.com>\n * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport * as Helpers from 'tiny_media/helpers';\nimport {Selectors} from './selectors';\n\n/**\n * Maximum length allowed for the alt attribute.\n */\nexport const MAX_LENGTH_ALT = 750;\n\n/**\n * Renders and inserts the body template for inserting an image 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<void>}\n * @deprecated Since Moodle 5.0 See {@link module:core_editor/tiny/plugins/media/helpers.body}\n */\nexport const bodyImageInsert = async(templateContext, root) => {\n    window.console.warn('This function is deprecated. Please use core_editor/tiny/plugins/media/helpers.body instead.');\n\n    templateContext.bodyTemplate = 'tiny_media/insert_image_modal_insert';\n    templateContext.selector = Selectors.IMAGE.type;\n    return Helpers.body(templateContext, root);\n};\n\n/**\n * Renders and inserts the footer template for inserting an image 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<void>}\n * @deprecated Since Moodle 5.0 See {@link module:core_editor/tiny/plugins/media/helpers.footer}\n */\nexport const footerImageInsert = async(templateContext, root) => {\n    window.console.warn(`This function is deprecated.\n        Please use core_editor/tiny/plugins/media/helpers.footer instead.`);\n\n    templateContext.footerTemplate = 'tiny_media/insert_image_modal_insert_footer';\n    templateContext.selector = Selectors.IMAGE.type;\n    return Helpers.footer(templateContext, root);\n};\n\n/**\n * Renders and inserts the body template for displaying image details in 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<void>}\n * @deprecated Since Moodle 5.0 See {@link module:core_editor/tiny/plugins/media/helpers.body}\n */\nexport const bodyImageDetails = async(templateContext, root) => {\n    window.console.warn(`This function is deprecated.\n        Please use core_editor/tiny/plugins/media/helpers.body instead.`);\n\n    templateContext.bodyTemplate = 'tiny_media/insert_image_modal_details';\n    templateContext.selector = Selectors.IMAGE.type;\n    return Helpers.body(templateContext, root);\n};\n\n/**\n * Renders and inserts the footer template for displaying image details in the modal.\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<void>}\n * @deprecated Since Moodle 5.0 See {@link module:core_editor/tiny/plugins/media/helpers.footer}\n */\nexport const footerImageDetails = async(templateContext, root) => {\n    window.console.warn(`This function is deprecated.\n        Please use core_editor/tiny/plugins/media/helpers.footer instead.`);\n\n    templateContext.footerTemplate = 'tiny_media/insert_image_modal_details_footer';\n    templateContext.selector = Selectors.IMAGE.type;\n    return Helpers.footer(templateContext, root);\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 * @deprecated Since Moodle 5.0 See {@link module:core_editor/tiny/plugins/media/helpers.showElements}\n */\nexport const showElements = (elements, root) => {\n    window.console.warn(`This function is deprecated.\n        Please use core_editor/tiny/plugins/media/helpers.showElements instead.`);\n    Helpers.showElements(elements, root);\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 * @deprecated Since Moodle 5.0 See {@link module:core_editor/tiny/plugins/media/helpers.hideElements}\n */\nexport const hideElements = (elements, root) => {\n    window.console.warn(`This function is deprecated.\n        Please use core_editor/tiny/plugins/media/helpers.hideElements instead.`);\n    Helpers.hideElements(elements, root);\n};\n\n/**\n * Checks if the given value is a percentage value.\n *\n * @param {string} value - The value to check.\n * @returns {boolean} True if the value is a percentage value, false otherwise.\n * @deprecated Since Moodle 5.0 See {@link module:core_editor/tiny/plugins/media/helpers.isPercentageValue}\n */\nexport const isPercentageValue = (value) => {\n    window.console.warn(`This function is deprecated.\n        Please use core_editor/tiny/plugins/media/helpers.isPercentageValue instead.`);\n    return Helpers.isPercentageValue(value);\n};\n"],"names":["async","templateContext","root","window","console","warn","bodyTemplate","selector","Selectors","IMAGE","type","Helpers","body","footerTemplate","footer","elements","showElements","hideElements","value","isPercentageValue"],"mappings":";;;;;;;uCA6B8B,6BAUCA,MAAMC,gBAAiBC,QAClDC,OAAOC,QAAQC,KAAK,gGAEpBJ,gBAAgBK,aAAe,uCAC/BL,gBAAgBM,SAAWC,qBAAUC,MAAMC,KACpCC,QAAQC,KAAKX,gBAAiBC,kCAWRF,MAAMC,gBAAiBC,QACpDC,OAAOC,QAAQC,gHAGfJ,gBAAgBY,eAAiB,8CACjCZ,gBAAgBM,SAAWC,qBAAUC,MAAMC,KACpCC,QAAQG,OAAOb,gBAAiBC,iCAWXF,MAAMC,gBAAiBC,QACnDC,OAAOC,QAAQC,8GAGfJ,gBAAgBK,aAAe,wCAC/BL,gBAAgBM,SAAWC,qBAAUC,MAAMC,KACpCC,QAAQC,KAAKX,gBAAiBC,mCAUPF,MAAMC,gBAAiBC,QACrDC,OAAOC,QAAQC,gHAGfJ,gBAAgBY,eAAiB,+CACjCZ,gBAAgBM,SAAWC,qBAAUC,MAAMC,KACpCC,QAAQG,OAAOb,gBAAiBC,6BAUf,CAACa,SAAUb,QACnCC,OAAOC,QAAQC,sHAEfM,QAAQK,aAAaD,SAAUb,6BAUP,CAACa,SAAUb,QACnCC,OAAOC,QAAQC,sHAEfM,QAAQM,aAAaF,SAAUb,kCAUDgB,QAC9Bf,OAAOC,QAAQC,2HAERM,QAAQQ,kBAAkBD"}