1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-13 13:16:36 +02:00

[ticket/13713] Move function to get textarea element to core.js

PHPBB3-13713
This commit is contained in:
Marc Alexander
2021-05-20 20:38:13 +02:00
parent 1b5c521d8f
commit a0d9c7fe85
3 changed files with 29 additions and 25 deletions

View File

@ -1745,6 +1745,31 @@ phpbb.lazyLoadAvatars = function loadAvatars() {
});
};
/**
* Get editor text area element
*
* @param {string} formName Name of form
* @param {string} textareaName Textarea name
*
* @return {HTMLElement|null} Text area element or null if textarea couldn't be found
*/
phpbb.getEditorTextArea = function(formName, textareaName) {
let doc;
// find textarea, make sure browser supports necessary functions
if (document.forms[formName]) {
doc = document;
} else {
doc = opener.document;
}
if (!doc.forms[formName]) {
return;
}
return doc.forms[formName].elements[textareaName];
}
phpbb.recaptcha = {
button: null,
ready: false,