1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 12:21:45 +02:00

Fixes #4737 Removal of type="text/javascript" and type="text/css"

This commit is contained in:
Cameron
2022-03-31 08:24:34 -07:00
parent 21fa07ec3b
commit 025ff07aab
39 changed files with 98 additions and 118 deletions

View File

@@ -429,7 +429,7 @@ class bbcode_shortcodes extends e_shortcode
<div id='{$formid}' style='width: 221px; position: absolute; left:340px; top:60px; margin-right:auto; margin-left:auto; display:none; z-index: 1000; onclick=\"expandit('{$formid}')\" >
<div style='border:1px solid black; position: absolute; top:30px; width: 221px; '>";
$text .= "<script type='text/javascript'>
$text .= "<script>
//<![CDATA[
var maxtd = 18;
var maxtddiv = -1;

View File

@@ -36,11 +36,11 @@ class sitelinks_alt
if (file_exists(THEME.$js_file))
{
$text = "<script type='text/javascript' src='".THEME_ABS.$js_file."'></script>";
$text = "<script src='".THEME_ABS.$js_file."'></script>";
}
else
{
$text = "<script type='text/javascript' src='".e_JS.$js_file."'></script>";
$text = "<script src='".e_JS.$js_file."'></script>";
}
$text .= "<div class='menuBar' style='width:100%; white-space: nowrap'>";

View File

@@ -306,9 +306,10 @@ global $footer_js;
if (isset($footer_js) && is_array($footer_js))
{
$footer_js = array_unique($footer_js);
foreach ($footer_js as $fname)
{
echo "<script type='text/javascript' src='{$fname}'></script>\n";
echo "<script src='{$fname}'></script>\n";
$js_included[] = $fname;
}
}
@@ -384,7 +385,8 @@ if (abs($_serverTime - $lastSet) > 120)
* Benefit: account for user time corrections and changes in internet delays
* Drawback: each update may cause all server times to display a bit different
*/
echo "<script type='text/javascript'>\n";
echo "<script>\n";
echo " SyncWithServerTime('', '{$_serverPath}', '{$_serverDomain}');\n";
//tdOffset disabled as it can't live together with HTTP_IF_NONE_MATCH (page load speed)
//echo " SyncWithServerTime('{$_serverTime}', '{$_serverPath}', '{$_serverDomain}');\n";

View File

@@ -107,32 +107,7 @@ $js_body_onload = array(); // Legacy array of code to load with page.
//if (stristr($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml"))
// header("Content-type: application/xhtml+xml; charset=utf-8", TRUE);
//else
if(!e107::isCli())
{
header("Content-type: text/html; charset=utf-8");
}
// NEW - HTML5 default
// TODO - more precise controlo over page header depending on the HTML5 mode
if(!defined("XHTML4"))
{
echo "<!doctype html>\n";
$htmlTag = "<html".(defined("TEXTDIRECTION") ? " dir='".TEXTDIRECTION."'" : "").(defined("CORE_LC") ? " lang=\"".CORE_LC."\"" : "").">";
echo (defined('HTMLTAG') ? str_replace('THEME_LAYOUT', THEME_LAYOUT, HTMLTAG) : $htmlTag)."\n";
echo "<head>
<title>".render_title()."</title>
<meta charset='utf-8' />\n";
}
else
{
echo (defined("STANDARDS_MODE") ? "" : "<?xml version='1.0' encoding='utf-8' "."?".">\n")."<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
echo "<html xmlns='http://www.w3.org/1999/xhtml'".(defined("TEXTDIRECTION") ? " dir='".TEXTDIRECTION."'" : "").(defined("XMLNS") ? " ".XMLNS." " : "").(defined("CORE_LC") ? " xml:lang=\"".CORE_LC."\"" : "").">\n";
echo "<head>
<title>".render_title()."</title>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<meta http-equiv='content-style-type' content='text/css' />
";
echo (defined("CORE_LC")) ? "<meta http-equiv='content-language' content='".CORE_LC."' />\n" : "";
}
function render_title()
{
@@ -172,10 +147,24 @@ function render_title()
return implode(' | ', $arr);
}
//
// C: Send start of HTML
//
if(!e107::isCli())
{
header("Content-type: text/html; charset=utf-8");
}
//
// C: Send start of HTML - HTML5 default
echo "<!doctype html>\n";
$htmlTag = "<html".(defined("TEXTDIRECTION") ? " dir='".TEXTDIRECTION."'" : "").(defined("CORE_LC") ? " lang=\"".CORE_LC."\"" : "").">";
echo (defined('HTMLTAG') ? str_replace('THEME_LAYOUT', THEME_LAYOUT, HTMLTAG) : $htmlTag)."\n";
echo "<head>
<title>".render_title()."</title>
<meta charset='utf-8' />\n";
if(!empty($pref['meta_copyright'][e_LANGUAGE])) e107::meta('dcterms.rights',$pref['meta_copyright'][e_LANGUAGE]);
if(!empty($pref['meta_author'][e_LANGUAGE])) e107::meta('author',$pref['meta_author'][e_LANGUAGE]);
if(!empty($pref['sitebutton']))
@@ -435,12 +424,12 @@ if (isset($eplug_js) && $eplug_js)
$eplug_js_unique = array_unique($eplug_js);
foreach($eplug_js_unique as $kjs)
{
echo ($kjs[0] == "<") ? $kjs : "<script type='text/javascript' src='{$kjs}'></script>\n";
echo ($kjs[0] == "<") ? $kjs : "<script type='text/javascript' src='{$kjs}'></script>\n"; // could be a .php file so leave the 'type'.
}
}
else
{
echo "<script type='text/javascript' src='{$eplug_js}'></script>\n";
echo "<script type='text/javascript' src='{$eplug_js}'></script>\n"; // could be a .php file so leave the 'type'.
}
}
@@ -448,12 +437,12 @@ if (isset($eplug_js) && $eplug_js)
//DEPRECATE this as well?
if (isset($theme_js_php) && $theme_js_php)
{
echo "<script type='text/javascript' src='".THEME_ABS."theme-js.php'></script>\n";
echo "<script type='text/javascript' src='".THEME_ABS."theme-js.php'></script>\n"; // .php file so leave the 'type'.
}
else
{
if (file_exists(THEME.'theme.js')) { echo "<script type='text/javascript' src='".THEME_ABS."theme.js'></script>\n"; }
if (is_readable(e_FILE.'user.js') && filesize(e_FILE.'user.js')) { echo "<script type='text/javascript' src='".e_FILE_ABS."user.js'></script>\n"; }
if (file_exists(THEME.'theme.js')) { echo "<script src='".THEME_ABS."theme.js'></script>\n"; }
if (is_readable(e_FILE.'user.js') && filesize(e_FILE.'user.js')) { echo "<script src='".e_FILE_ABS."user.js'></script>\n"; }
if (file_exists(THEME.'theme.vbs')) { echo "<script type='text/vbscript' src='".THEME_ABS."theme.vbs'></script>\n"; }
if (is_readable(e_FILE.'user.vbs') && filesize(e_FILE.'user.vbs')) { echo "<script type='text/vbscript' src='".e_FILE_ABS."user.vbs'></script>\n"; }
}
@@ -468,7 +457,7 @@ if (!USER && ($pref['user_tracking'] == "session") && varset($pref['password_CHA
$js_body_onload[] = "expandit('loginmenuchap');";
$js_body_onload[] = "expandit('nologinmenuchap');";
}
echo "<script type='text/javascript' src='".e_JS."chap_script.js'></script>\n";
echo "<script src='".e_JS."chap_script.js'></script>\n";
$js_body_onload[] = "getChallenge();";
}

View File

@@ -34,7 +34,7 @@ if(!isset($SITEDOWN_TABLE))
<link rel="stylesheet" href="{SITEDOWN_E107_CSS}" type="text/css" media="all" />
<link rel="stylesheet" href="{SITEDOWN_THEME_CSS}" type="text/css" media="all" />
<title>{SITEDOWN_TABLE_PAGENAME}</title>
<style type="text/css">
<style>
.img-responsive { display: inline }
</style>
</head>