temporary fix for TinyMCE and tabs not loading in KnowledgeBase under 23.1/master

Problem is that JavaScript in inline script tags is executed before the egw_ready promise is created
fixing it by using window.setTimeout( , 200) for now
This commit is contained in:
ralf 2023-01-12 18:03:46 -06:00
parent 22ac1a21f1
commit 5d385455d2
3 changed files with 7 additions and 3 deletions

View File

@ -828,6 +828,7 @@ class Db
{ {
fwrite($f,'['.(isset($GLOBALS['egw_setup']) ? $GLOBALS['egw_setup']->ConfigDomain : $GLOBALS['egw_info']['user']['domain']).'] '); fwrite($f,'['.(isset($GLOBALS['egw_setup']) ? $GLOBALS['egw_setup']->ConfigDomain : $GLOBALS['egw_info']['user']['domain']).'] ');
fwrite($f,date('Y-m-d H:i:s ').$Query_String.($inputarr ? "\n".print_r($inputarr,true) : '')."\n"); fwrite($f,date('Y-m-d H:i:s ').$Query_String.($inputarr ? "\n".print_r($inputarr,true) : '')."\n");
fwrite($f, function_backtrace()."\n");
if (!$rs) if (!$rs)
{ {
fwrite($f,"*** Error $this->Errno: $this->Error\n".function_backtrace()."\n"); fwrite($f,"*** Error $this->Errno: $this->Error\n".function_backtrace()."\n");

View File

@ -1046,7 +1046,7 @@ abstract class Framework extends Framework\Extra
} }
// add configuration, link-registry, images, user-data and -preferences for non-popup windows // add configuration, link-registry, images, user-data and -preferences for non-popup windows
// specifying etag in url to force reload, as we send expires header // specifying etag in url to force reload, as we send expires header
if ($GLOBALS['egw_info']['flags']['js_link_registry'] || isset($_GET['cd']) && $_GET['cd'] === 'popup') if ($GLOBALS['egw_info']['flags']['js_link_registry'] || !isset($_GET['cd']) || isset($_GET['cd']) && $_GET['cd'] === 'popup')
{ {
self::includeJS('/api/config.php', array( self::includeJS('/api/config.php', array(
'etag' => md5(json_encode(Config::clientConfigs()).Link::json_registry()), 'etag' => md5(json_encode(Config::clientConfigs()).Link::json_registry()),

View File

@ -469,7 +469,8 @@ class Html
' '
<script type="text/javascript"> <script type="text/javascript">
egw_LAB.wait(function() { window.setTimeout(function() {
window.egw_ready.wait(function() {
var imageUpload = egw.ajaxUrl("EGroupware\\Api\\Etemplate\\Widget\\Vfs::ajax_htmlarea_upload")+"&type=htmlarea"; var imageUpload = egw.ajaxUrl("EGroupware\\Api\\Etemplate\\Widget\\Vfs::ajax_htmlarea_upload")+"&type=htmlarea";
imageUpload = imageUpload.substr(egw.webserverUrl.length+1); imageUpload = imageUpload.substr(egw.webserverUrl.length+1);
@ -503,6 +504,7 @@ var language_code = {
"zh-tw": "zh_TW" "zh-tw": "zh_TW"
}; };
tinymce.init({ tinymce.init({
base_url: egw.webserverUrl + "/vendor/tinymce/tinymce",
selector: name, selector: name,
menubar: parseInt('. $rte_menubar.')? true : false, menubar: parseInt('. $rte_menubar.')? true : false,
branding: false, branding: false,
@ -576,6 +578,7 @@ tinymce.init({
}); });
'.($_executeJSAfterInit?$_executeJSAfterInit:'').' '.($_executeJSAfterInit?$_executeJSAfterInit:'').'
}); });
}, 200);
</script> </script>
'; ';
} }