AutorÃa | Ultima modificación | Ver Log |
{"version":3,"file":"page_title.min.js","sources":["../src/page_title.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 * Helper module for manipulating the current page title\n *\n * @module core/page_title\n * @copyright 2025 Paul Holden <paulh@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */
\n\nlet pageTitleRoot = document.title;\nlet pageTitleSeparator = '|';\n\n/**\n * Set the current page title\n *\n * @param {String} pageTitle\n */\nexport const setPageTitle = (pageTitle) => {\n document.title = pageTitle;\n};\n\n/**\n * Prepend value to the page title root, and set as the current page title\n *\n * @param {String} pageTitlePrepend\n */\nexport const prependPageTitle = (pageTitlePrepend) =>\n setPageTitle(`${pageTitlePrepend} ${pageTitleSeparator} ${pageTitleRoot}`);\n\n/**\n * Set the page title root, to be used later when prepending to the title\n *\n * By default, the page title root is the document title\n *\n * @param {String} titleRoot\n */\nexport const setPageTitleRoot = (titleRoot) => {\n pageTitleRoot = titleRoot;\n};\n\n/**\n * Set the page title separator\n *\n * By default, the page title separator is the pipe character\n *\n * @param {String} titleSeparator\n */\nexport const setPageTitleSeparator = (titleSeparator) => {\n pageTitleSeparator = titleSeparator;\n};\n
"],"names":["pageTitleRoot","document","title","pageTitleSeparator","setPageTitle","pageTitle","pageTitlePrepend","titleRoot","titleSeparator"],"mappings":";;;;;;;;IAuBIA,cAAgBC,SAASC,MACzBC,mBAAqB,UAOZC,aAAgBC,YACzBJ,SAASC,MAAQG,wEAQYC,kBAC7BF,uBAAgBE,6BAAoBH,+BAAsBH,0CAS7BO,YAC7BP,cAAgBO,0CAUkBC,iBAClCL,mBAAqBK"}