Delete type="text/javascript" from <script> as it is the default in HTML5

This commit is contained in:
Jakub Vrana
2018-01-11 14:10:46 +01:00
parent 741b76fbd4
commit dc85ba2d86
26 changed files with 50 additions and 51 deletions

View File

@@ -16,7 +16,7 @@ class AdminerEditCalendar {
* @param string text to append before first calendar usage
* @param string path to language file, %s stands for language code
*/
function __construct($prepend = "<script type='text/javascript' src='jquery-ui/jquery.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' type='text/css' href='jquery-ui/jquery-ui.css'>\n", $langPath = "jquery-ui/i18n/jquery.ui.datepicker-%s.js") {
function __construct($prepend = "<script src='jquery-ui/jquery.js'></script>\n<script src='jquery-ui/jquery-ui.js'></script>\n<script src='jquery-ui/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' type='text/css' href='jquery-ui/jquery-ui.css'>\n", $langPath = "jquery-ui/i18n/jquery.ui.datepicker-%s.js") {
$this->prepend = $prepend;
$this->langPath = $langPath;
}
@@ -27,8 +27,8 @@ class AdminerEditCalendar {
$lang = get_lang();
$lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));
if ($lang != "en" && file_exists(sprintf($this->langPath, $lang))) {
printf("<script type='text/javascript' src='$this->langPath'></script>\n", $lang);
echo "<script type='text/javascript'>jQuery(function () { jQuery.timepicker.setDefaults(jQuery.datepicker.regional['$lang']); });</script>\n";
printf("<script src='$this->langPath'></script>\n", $lang);
echo "<script>jQuery(function () { jQuery.timepicker.setDefaults(jQuery.datepicker.regional['$lang']); });</script>\n";
}
}
}
@@ -37,7 +37,7 @@ class AdminerEditCalendar {
if (preg_match("~date|time~", $field["type"])) {
$dateFormat = "changeYear: true, dateFormat: 'yy-mm-dd'"; //! yy-mm-dd regional
$timeFormat = "showSecond: true, timeFormat: 'HH:mm:ss.lcZ', timeInput: true";
return "<input id='fields-" . h($field["field"]) . "' value='" . h($value) . "'" . (@+$field["length"] ? " maxlength='" . (+$field["length"]) . "'" : "") . "$attrs><script type='text/javascript'>jQuery('#fields-" . js_escape($field["field"]) . "')."
return "<input id='fields-" . h($field["field"]) . "' value='" . h($value) . "'" . (@+$field["length"] ? " maxlength='" . (+$field["length"]) . "'" : "") . "$attrs><script>jQuery('#fields-" . js_escape($field["field"]) . "')."
. ($field["type"] == "time" ? "timepicker({ $timeFormat })"
: (preg_match("~time~", $field["type"]) ? "datetimepicker({ $dateFormat, $timeFormat })"
: "datepicker({ $dateFormat })"

View File

@@ -14,7 +14,7 @@ class AdminerLoginSqlite {
function loginForm() {
?>
<script type="text/javascript">
<script>
addEventListener('load', function () {
var driver = qs('name="auth[driver]"');
if (isTag(driver, 'select')) {

View File

@@ -23,7 +23,7 @@ foreach ($tables as $table => $status) {
}
?>
</ul>
<script type="text/javascript">
<script>
var tablesFilterTimeout = null;
var tablesFilterValue = '';

View File

@@ -28,8 +28,8 @@ class AdminerTinymce {
}
}
?>
<script type="text/javascript" src="<?php echo h($this->path); ?>"></script>
<script type="text/javascript">
<script src="<?php echo h($this->path); ?>"></script>
<script>
tinyMCE.init({
mode: 'none',
theme: 'advanced',
@@ -68,7 +68,7 @@ tinyMCE.init({
function editInput($table, $field, $attrs, $value) {
if (preg_match("~text~", $field["type"]) && preg_match("~_html~", $field["field"])) {
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script type='text/javascript'>
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script>
tinyMCE.remove(tinyMCE.get('fields-" . js_escape($field["field"]) . "') || { });
tinyMCE.execCommand('mceAddControl', true, 'fields-" . js_escape($field["field"]) . "');
qs('#form').onsubmit = function () {

View File

@@ -10,7 +10,7 @@ class AdminerVersionNoverify {
function navigation($missing) {
?>
<script type="text/javascript">
<script>
verifyVersion = function () {
};
</script>

View File

@@ -22,7 +22,7 @@ class AdminerWymeditor {
function head() {
foreach ($this->scripts as $script) {
echo "<script type='text/javascript' src='" . h($script) . "'></script>\n";
echo "<script src='" . h($script) . "'></script>\n";
}
}
@@ -55,7 +55,7 @@ class AdminerWymeditor {
$lang = get_lang();
$lang = ($lang == "zh" || $lang == "zh-tw" ? "zh_cn" : $lang);
}
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script type='text/javascript'>
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script>
jQuery('#fields-" . js_escape($field["field"]) . "').wymeditor({ updateSelector: '#form [type=\"submit\"]', lang: '$lang'" . ($this->options ? ", $this->options" : "") . " });
</script>";
}