mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 07:36:44 +02:00
Use script() for <script>
This commit is contained in:
@@ -28,7 +28,7 @@ class AdminerEditCalendar {
|
||||
$lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));
|
||||
if ($lang != "en" && file_exists(sprintf($this->langPath, $lang))) {
|
||||
printf("<script src='$this->langPath'></script>\n", $lang);
|
||||
echo "<script>jQuery(function () { jQuery.timepicker.setDefaults(jQuery.datepicker.regional['$lang']); });</script>\n";
|
||||
echo script("jQuery(function () { jQuery.timepicker.setDefaults(jQuery.datepicker.regional['$lang']); });");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,11 +37,12 @@ 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>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 })"
|
||||
)) . ";</script>";
|
||||
: (preg_match("~time~", $field["type"]) ? "datetimepicker({ $dateFormat, $timeFormat })"
|
||||
: "datepicker({ $dateFormat })"
|
||||
)) . ";");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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>
|
||||
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 () {
|
||||
@@ -76,7 +76,7 @@ qs('#form').onsubmit = function () {
|
||||
ed.remove();
|
||||
});
|
||||
};
|
||||
</script>";
|
||||
");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -9,12 +9,7 @@
|
||||
class AdminerVersionNoverify {
|
||||
|
||||
function navigation($missing) {
|
||||
?>
|
||||
<script>
|
||||
verifyVersion = function () {
|
||||
};
|
||||
</script>
|
||||
<?php
|
||||
echo script("verifyVersion = function () {};");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -55,9 +55,9 @@ 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>
|
||||
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>";
|
||||
");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user