* change front helper class to output better js code.

This commit is contained in:
Catouse
2018-05-08 14:00:10 +08:00
parent c6f29e2242
commit de33978595
+6 -5
View File
@@ -564,7 +564,7 @@ class baseHTML
static public function selectAll($scope = "", $type = "button", $checked = false, $class = '')
{
$string = <<<EOT
<script type="text/javascript">
<script>
function selectAll(checker, scope, type)
{
if(scope)
@@ -752,7 +752,7 @@ class baseJS
$hasLimit = ($ieParam and stripos($ieParam, 'ie') !== false);
if($hasLimit) echo "<!--[if $ieParam]>\n";
echo "<script src='$url{$mark}v={$config->version}' type='text/javascript'></script>\n";
echo "<script src='$url{$mark}v={$config->version}'></script>\n";
if($hasLimit) echo "<![endif]-->\n";
}
@@ -768,7 +768,7 @@ class baseJS
static public function start($full = true)
{
if($full) return "<html><meta charset='utf-8'/><style>body{background:white}</style><script>";
return "<script language='Javascript'>";
return "<script>";
}
/**
@@ -1062,6 +1062,7 @@ EOT;
$jsConfig->runMode = $runMode;
$jsConfig->timeout = isset($config->timeout) ? $config->timeout : '';
$jsConfig->pingInterval = isset($config->pingInterval) ? $config->pingInterval : '';
$jsConfig->debug = $config->debug;
$jsLang = new stdclass();
$jsLang->submitting = isset($lang->loading) ? $lang->loading : '';
@@ -1069,8 +1070,8 @@ EOT;
$jsLang->timeout = isset($lang->timeout) ? $lang->timeout : '';
$js = self::start(false);
$js .= 'var config=' . json_encode($jsConfig) . ";\n";
$js .= 'var lang=' . json_encode($jsLang) . ";\n";
$js .= 'window.config=' . json_encode($jsConfig) . ";\n";
$js .= 'window.lang=' . json_encode($jsLang) . ";\n";
$js .= self::end();
echo $js;
}