Fix error TS2345 reported by TypeScript
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
36924ffb77
commit
6c1adad296
@ -184,14 +184,14 @@ AJAX.registerOnload('database/central_columns.js', function () {
|
||||
);
|
||||
} else {
|
||||
$('#f_' + rownum + ' td input[id=checkbox_row_' + rownum + ']').val($('#f_' + rownum + ' input[name=col_name]').val()).html();
|
||||
$('#f_' + rownum + ' td[name=col_name] span').text($('#f_' + rownum + ' input[name=col_name]').val()).html();
|
||||
$('#f_' + rownum + ' td[name=col_type] span').text($('#f_' + rownum + ' select[name=col_type]').val()).html();
|
||||
$('#f_' + rownum + ' td[name=col_length] span').text($('#f_' + rownum + ' input[name=col_length]').val()).html();
|
||||
$('#f_' + rownum + ' td[name=collation] span').text($('#f_' + rownum + ' select[name=collation]').val()).html();
|
||||
$('#f_' + rownum + ' td[name=col_attribute] span').text($('#f_' + rownum + ' select[name=col_attribute]').val()).html();
|
||||
$('#f_' + rownum + ' td[name=col_name] span').text(($('#f_' + rownum + ' input[name=col_name]').val() as string)).html();
|
||||
$('#f_' + rownum + ' td[name=col_type] span').text(($('#f_' + rownum + ' select[name=col_type]').val() as string)).html();
|
||||
$('#f_' + rownum + ' td[name=col_length] span').text(($('#f_' + rownum + ' input[name=col_length]').val() as string)).html();
|
||||
$('#f_' + rownum + ' td[name=collation] span').text(($('#f_' + rownum + ' select[name=collation]').val() as string)).html();
|
||||
$('#f_' + rownum + ' td[name=col_attribute] span').text(($('#f_' + rownum + ' select[name=col_attribute]').val() as string)).html();
|
||||
$('#f_' + rownum + ' td[name=col_isNull] span').text($('#f_' + rownum + ' input[name=col_isNull]').is(':checked') ? 'Yes' : 'No').html();
|
||||
$('#f_' + rownum + ' td[name=col_extra] span').text($('#f_' + rownum + ' input[name=col_extra]').is(':checked') ? 'auto_increment' : '').html();
|
||||
$('#f_' + rownum + ' td[name=col_default] span').text($('#f_' + rownum + ' :input[name=col_default]').val()).html();
|
||||
$('#f_' + rownum + ' td[name=col_default] span').text(($('#f_' + rownum + ' :input[name=col_default]').val() as string)).html();
|
||||
}
|
||||
|
||||
$('#save_' + rownum).hide();
|
||||
|
||||
@ -159,6 +159,7 @@ AJAX.registerOnload('database/multi_table_query.js', function () {
|
||||
});
|
||||
});
|
||||
|
||||
// @ts-ignore
|
||||
$('#sql_results').html($resultsDom);
|
||||
$('#slide-handle').trigger('click');// Collapse search criteria area
|
||||
}
|
||||
|
||||
@ -101,8 +101,8 @@ const mouseMove = function (e) {
|
||||
$curClick.attr('data-top', newY);
|
||||
|
||||
if (onGrid) {
|
||||
newX = parseInt(newX / gridSize) * gridSize;
|
||||
newY = parseInt(newY / gridSize) * gridSize;
|
||||
newX = parseInt((newX / gridSize).toString()) * gridSize;
|
||||
newY = parseInt((newY / gridSize).toString()) * gridSize;
|
||||
}
|
||||
|
||||
if (newX < 0) {
|
||||
@ -634,8 +634,8 @@ const addOtherDbTables = function () {
|
||||
.append($selectDb).append($selectTable);
|
||||
var modal = DesignerMove.displayModal($form, window.Messages.strAddTables, '#designerGoModal');
|
||||
$('#designerModalGoButton').on('click', function () {
|
||||
var db = $('#add_table_from').val();
|
||||
var table = $('#add_table').val();
|
||||
var db = ($('#add_table_from').val() as string);
|
||||
var table = ($('#add_table').val() as string);
|
||||
|
||||
// Check if table already imported or not.
|
||||
var $table = $('[id="' + encodeURIComponent(db) + '.' + encodeURIComponent(table) + '"]');
|
||||
@ -922,7 +922,7 @@ const deletePages = function () {
|
||||
var modal = DesignerMove.displayModal(data.message, window.Messages.strDeletePage, '#designerGoModal');
|
||||
$('#designerModalGoButton').on('click', function () {
|
||||
var $form = $('#edit_delete_pages');
|
||||
var selected = $form.find('select[name="selected_page"]').val();
|
||||
var selected = ($form.find('select[name="selected_page"]').val() as string);
|
||||
if (selected === '0') {
|
||||
ajaxShowMessage(window.Messages.strSelectPage, 2000);
|
||||
|
||||
|
||||
@ -262,7 +262,7 @@ var DragDropImport = {
|
||||
icon + '"> ');
|
||||
|
||||
// Decrease liveUploadCount by one
|
||||
$('.pma_import_count').html(--DragDropImport.liveUploadCount);
|
||||
$('.pma_import_count').html((--DragDropImport.liveUploadCount).toString());
|
||||
if (! DragDropImport.liveUploadCount) {
|
||||
$('.pma_sql_import_status h2 .close').fadeIn();
|
||||
}
|
||||
@ -314,7 +314,7 @@ var DragDropImport = {
|
||||
|
||||
if (ext !== '') {
|
||||
// Increment liveUploadCount by one
|
||||
$('.pma_import_count').html(++DragDropImport.liveUploadCount);
|
||||
$('.pma_import_count').html((++DragDropImport.liveUploadCount).toString());
|
||||
$('.pma_sql_import_status h2 .close').fadeOut();
|
||||
|
||||
$('.pma_sql_import_status div li[data-hash="' + hash + '"]')
|
||||
@ -339,7 +339,7 @@ var DragDropImport = {
|
||||
fd.append('sql_compatibility', 'NONE');
|
||||
fd.append('sql_no_auto_value_on_zero', 'something');
|
||||
fd.append('ajax_request', 'true');
|
||||
fd.append('hash', hash);
|
||||
fd.append('hash', hash.toString());
|
||||
|
||||
// init uploading
|
||||
DragDropImport.sendFileToServer(fd, hash);
|
||||
|
||||
@ -294,7 +294,7 @@ AJAX.registerOnload('gis_data_editor.js', function () {
|
||||
var prefix = name.substring(0, name.length - 11);
|
||||
// Find the number of points
|
||||
var $noOfPointsInput = $('input[name=\'' + prefix + '[no_of_points]' + '\']');
|
||||
var noOfPoints = parseInt($noOfPointsInput.val(), 10);
|
||||
var noOfPoints = parseInt(($noOfPointsInput.val() as string), 10);
|
||||
// Add the new data point
|
||||
var html = addDataPoint(noOfPoints, prefix);
|
||||
$a.before(html);
|
||||
@ -314,7 +314,7 @@ AJAX.registerOnload('gis_data_editor.js', function () {
|
||||
|
||||
// Find the number of lines
|
||||
var $noOfLinesInput = $('input[name=\'' + prefix + '[no_of_lines]' + '\']');
|
||||
var noOfLines = parseInt($noOfLinesInput.val(), 10);
|
||||
var noOfLines = parseInt(($noOfLinesInput.val() as string), 10);
|
||||
|
||||
// Add the new linesting of inner ring based on the type
|
||||
var html = '<br>';
|
||||
@ -349,7 +349,7 @@ AJAX.registerOnload('gis_data_editor.js', function () {
|
||||
var prefix = name.substring(0, name.length - 13);
|
||||
// Find the number of polygons
|
||||
var $noOfPolygonsInput = $('input[name=\'' + prefix + '[no_of_polygons]' + '\']');
|
||||
var noOfPolygons = parseInt($noOfPolygonsInput.val(), 10);
|
||||
var noOfPolygons = parseInt(($noOfPolygonsInput.val() as string), 10);
|
||||
|
||||
// Add the new polygon
|
||||
var html = window.Messages.strPolygon + ' ' + (noOfPolygons + 1) + ':<br>';
|
||||
@ -378,7 +378,7 @@ AJAX.registerOnload('gis_data_editor.js', function () {
|
||||
var prefix = 'gis_data[GEOMETRYCOLLECTION]';
|
||||
// Find the number of geoms
|
||||
var $noOfGeomsInput = $('input[name=\'' + prefix + '[geom_count]' + '\']');
|
||||
var noOfGeoms = parseInt($noOfGeomsInput.val(), 10);
|
||||
var noOfGeoms = parseInt(($noOfGeomsInput.val() as string), 10);
|
||||
|
||||
var html1 = window.Messages.strGeometry + ' ' + (noOfGeoms + 1) + ':<br>';
|
||||
var $geomType = $('select[name=\'gis_data[' + (noOfGeoms - 1) + '][gis_type]\']').clone();
|
||||
|
||||
@ -240,13 +240,13 @@ AJAX.registerOnload('import.js', function () {
|
||||
} else if (percent > 9 || complete > 2000000) {
|
||||
// Calculate estimated time
|
||||
var usedTime = now - importStart;
|
||||
var seconds = parseInt(((total - complete) / complete) * usedTime / 1000);
|
||||
var seconds = parseInt((((total - complete) / complete) * usedTime / 1000).toString());
|
||||
var speed = window.sprintf(
|
||||
window.Messages.uploadProgressPerSecond,
|
||||
Functions.formatBytes(complete / usedTime * 1000, 1, window.Messages.strDecimalSeparator)
|
||||
);
|
||||
|
||||
var minutes = parseInt(seconds / 60);
|
||||
var minutes = parseInt((seconds / 60).toString());
|
||||
seconds %= 60;
|
||||
var estimatedTime;
|
||||
if (minutes > 0) {
|
||||
|
||||
@ -48,7 +48,7 @@ import $ from 'jquery';
|
||||
return function (format, value) {
|
||||
var val = value;
|
||||
if (typeof val === 'number') {
|
||||
val = parseFloat(val) || 0;
|
||||
val = parseFloat(val.toString()) || 0;
|
||||
|
||||
return formatByte(val, i);
|
||||
} else {
|
||||
|
||||
@ -775,14 +775,14 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
|
||||
|
||||
if (data.transformations !== undefined) {
|
||||
$.each(data.transformations, function (cellIndex, value) {
|
||||
var $thisField = $(g.t).find('.to_be_saved').eq(cellIndex);
|
||||
var $thisField = $(g.t).find('.to_be_saved').eq(Number(cellIndex));
|
||||
$thisField.find('span').html(value);
|
||||
});
|
||||
}
|
||||
|
||||
if (data.relations !== undefined) {
|
||||
$.each(data.relations, function (cellIndex, value) {
|
||||
var $thisField = $(g.t).find('.to_be_saved').eq(cellIndex);
|
||||
var $thisField = $(g.t).find('.to_be_saved').eq(Number(cellIndex));
|
||||
$thisField.find('span').html(value);
|
||||
});
|
||||
}
|
||||
@ -1278,7 +1278,7 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
|
||||
}
|
||||
|
||||
fullWhereClause.push(whereClause);
|
||||
var conditionArray = JSON.parse($tr.find('.condition_array').val());
|
||||
var conditionArray = JSON.parse(($tr.find('.condition_array').val() as string));
|
||||
|
||||
/**
|
||||
* multi edit variables, for current row
|
||||
|
||||
@ -150,8 +150,8 @@ const ajaxShowMessage = function (message = null, timeout = null, type = null) {
|
||||
*
|
||||
* @param {JQuery} $thisMessageBox Element that holds the notification
|
||||
*/
|
||||
const ajaxRemoveMessage = function ($thisMessageBox: JQuery): void {
|
||||
if ($thisMessageBox !== undefined && $thisMessageBox instanceof $) {
|
||||
const ajaxRemoveMessage = function ($thisMessageBox: JQuery | boolean): void {
|
||||
if ($thisMessageBox !== undefined && typeof $thisMessageBox !== 'boolean' && $thisMessageBox instanceof $) {
|
||||
$thisMessageBox
|
||||
.stop(true, true)
|
||||
.fadeOut('medium');
|
||||
|
||||
@ -548,7 +548,7 @@ function setupValidation () {
|
||||
|
||||
// disable textarea spellcheck
|
||||
if (tagName === 'TEXTAREA') {
|
||||
$el.attr('spellcheck', false);
|
||||
$el.attr('spellcheck', 'false');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -517,6 +517,7 @@ var ConsoleInput = {
|
||||
mode: 'text/x-sql',
|
||||
lineWrapping: true,
|
||||
extraKeys: { 'Ctrl-Space': 'autocomplete' },
|
||||
// @ts-ignore
|
||||
hintOptions: { 'completeSingle': false, 'completeOnSingleClick': true },
|
||||
gutters: ['CodeMirror-lint-markers'],
|
||||
lint: {
|
||||
@ -539,6 +540,7 @@ var ConsoleInput = {
|
||||
mode: 'text/x-sql',
|
||||
lineWrapping: true,
|
||||
extraKeys: { 'Ctrl-Space': 'autocomplete' },
|
||||
// @ts-ignore
|
||||
hintOptions: { 'completeSingle': false, 'completeOnSingleClick': true },
|
||||
gutters: ['CodeMirror-lint-markers'],
|
||||
lint: {
|
||||
@ -833,7 +835,7 @@ var ConsoleMessages = {
|
||||
ConsoleMessages.messageEventBinds($newMessage);
|
||||
$newMessage.find('span.text.query_time span')
|
||||
.text(now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds())
|
||||
.parent().attr('title', now);
|
||||
.parent().attr('title', now.toString());
|
||||
|
||||
return {
|
||||
'message_id': msgId,
|
||||
|
||||
@ -2488,7 +2488,7 @@ function onloadEnumSetEditor (): void {
|
||||
|
||||
// Show the dialog
|
||||
var width = parseInt(
|
||||
(parseInt($('html').css('font-size'), 10) / 13) * 340,
|
||||
((parseInt($('html').css('font-size'), 10) / 13) * 340).toString(),
|
||||
10
|
||||
);
|
||||
if (! width) {
|
||||
@ -2598,7 +2598,7 @@ function onloadEnumSetEditor (): void {
|
||||
'</div>';
|
||||
|
||||
var width = parseInt(
|
||||
(parseInt($('html').css('font-size'), 10) / 13) * 500,
|
||||
((parseInt($('html').css('font-size'), 10) / 13) * 500).toString(),
|
||||
10
|
||||
);
|
||||
if (! width) {
|
||||
@ -2982,7 +2982,7 @@ function toggleButton ($obj) {
|
||||
/**
|
||||
* @var w Width of the central part of the switch
|
||||
*/
|
||||
var w = parseInt(($('img', $obj).height() / 16) * 22, 10);
|
||||
var w = parseInt((($('img', $obj).height() / 16) * 22).toString(), 10);
|
||||
// Resize the central part of the switch on the top
|
||||
// layer to match the background
|
||||
$($obj).find('table td').eq(1).children('div').width(w);
|
||||
@ -2994,7 +2994,7 @@ function toggleButton ($obj) {
|
||||
*/
|
||||
var imgw = $('img', $obj).width();
|
||||
var tblw = $('table', $obj).width();
|
||||
var offset = parseInt(((imgw - tblw) / 2), 10);
|
||||
var offset = parseInt((((imgw - tblw) / 2).toString()), 10);
|
||||
// Move the background to match the layout of the top layer
|
||||
$obj.find('img').css(right, offset);
|
||||
/**
|
||||
@ -3570,7 +3570,7 @@ function getFilterTextEventHandler () {
|
||||
$(checkboxesSel).trigger('change');
|
||||
}, 300);
|
||||
|
||||
$('#filter-rows-count').html(count);
|
||||
$('#filter-rows-count').html(count.toString());
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -23,8 +23,6 @@ export default function checkNumberOfFields () {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
return true;
|
||||
|
||||
@ -145,7 +145,7 @@ function addColumnToIndex (sourceArray, arrayIndex, indexChoice, colIndex): void
|
||||
Indexes.removeColumnFromIndex(colIndex);
|
||||
}
|
||||
|
||||
var indexName = $('input[name="index[Key_name]"]').val();
|
||||
var indexName = ($('input[name="index[Key_name]"]').val() as string);
|
||||
var indexComment = $('input[name="index[Index_comment]"]').val();
|
||||
var keyBlockSize = $('input[name="index[Key_block_size]"]').val();
|
||||
var parser = $('input[name="index[Parser]"]').val();
|
||||
@ -192,6 +192,7 @@ function addColumnToIndex (sourceArray, arrayIndex, indexChoice, colIndex): void
|
||||
}
|
||||
|
||||
var $text = $('<small>').text(displayName);
|
||||
// @ts-ignore
|
||||
$name.html($text);
|
||||
});
|
||||
|
||||
@ -501,7 +502,10 @@ function indexTypeSelectionDialog (sourceArray, indexChoice, colIndex): void {
|
||||
|
||||
$('#addIndexModal').modal('show');
|
||||
$('#addIndexModalLabel').first().text(window.Messages.strAddIndex);
|
||||
$('#addIndexModal').find('.modal-body').first().html($dialogContent);
|
||||
$('#addIndexModal').find('.modal-body').first()
|
||||
// @ts-ignore
|
||||
.html($dialogContent);
|
||||
|
||||
$('#composite_index').on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$dialogContent.append(Indexes.getCompositeIndexList(sourceArray, colIndex));
|
||||
@ -697,7 +701,7 @@ function on () {
|
||||
var colIndexRegEx = /\d+/.exec($(this).attr('name'));
|
||||
const colIndex = colIndexRegEx[0];
|
||||
// Choice of selected index.
|
||||
var indexChoiceRegEx = /[a-z]+/.exec($(this).val());
|
||||
var indexChoiceRegEx = /[a-z]+/.exec(($(this).val() as string));
|
||||
const indexChoice = indexChoiceRegEx[0];
|
||||
// Array containing corresponding indexes.
|
||||
var sourceArray = null;
|
||||
|
||||
@ -84,6 +84,7 @@ function filterStateRestore (): void {
|
||||
.children('div.list_container')
|
||||
.find('li.fast_filter input.searchClause');
|
||||
// restore table filters
|
||||
|
||||
$tableFilters.each(function () {
|
||||
$obj = $(this).closest('div.list_container');
|
||||
// aPath associated with this filter
|
||||
@ -98,7 +99,7 @@ function filterStateRestore (): void {
|
||||
if (! $obj.is(':visible')) {
|
||||
Navigation.filterStateUpdate(filterName, '');
|
||||
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (! $obj.data('fastFilter')) {
|
||||
@ -1279,7 +1280,7 @@ FastFilter.Filter.prototype.request = function (): void {
|
||||
if (self.$this.find('> ul > li > form.fast_filter').first().find('input[name=searchClause]').length === 0) {
|
||||
var $input = ($('#pma_navigation_tree').find('li.fast_filter.db_fast_filter input.searchClause') as JQuery<HTMLInputElement>);
|
||||
if ($input.length && $input.val() !== $input[0].defaultValue) {
|
||||
params += CommonParams.get('arg_separator') + 'searchClause=' + encodeURIComponent($input.val());
|
||||
params += CommonParams.get('arg_separator') + 'searchClause=' + encodeURIComponent(($input.val() as string));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1370,6 +1371,7 @@ function showFullName ($containerELem): void {
|
||||
|
||||
$fullNameLayer.removeClass('hide');
|
||||
$fullNameLayer.css({ left: thisOffset.left, top: thisOffset.top });
|
||||
// @ts-ignore
|
||||
$fullNameLayer.html($this.clone());
|
||||
setTimeout(function () {
|
||||
if (! $fullNameLayer.hasClass('hovering')) {
|
||||
|
||||
@ -21,6 +21,7 @@ function showSettings (selector) {
|
||||
});
|
||||
|
||||
$('#pageSettingsModal').modal('show');
|
||||
// @ts-ignore
|
||||
$('#pageSettingsModal').find('.modal-body').first().html($(selector));
|
||||
$(selector).css('display', 'block');
|
||||
}
|
||||
|
||||
@ -738,7 +738,7 @@ AJAX.registerOnload('normalization.js', function () {
|
||||
});
|
||||
|
||||
if (repeatingCols !== '') {
|
||||
var newColName = $('#extra input[type=checkbox]:checked').first().val();
|
||||
var newColName = ($('#extra input[type=checkbox]:checked').first().val() as string);
|
||||
repeatingCols = repeatingCols.slice(0, -2);
|
||||
var confirmStr = window.sprintf(window.Messages.strMoveRepeatingGroup, escapeHtml(repeatingCols), escapeHtml(CommonParams.get('table')));
|
||||
confirmStr += '<input type="text" name="repeatGroupTable" placeholder="' + window.Messages.strNewTablePlaceholder + '">' +
|
||||
|
||||
@ -27,7 +27,7 @@ const DropDatabases = {
|
||||
// loop over all checked checkboxes, except the .checkall_box checkbox
|
||||
$form.find('input:checkbox:checked:not(.checkall_box)').each(function () {
|
||||
$(this).closest('tr').addClass('removeMe');
|
||||
selectedDbs[selectedDbs.length] = 'DROP DATABASE `' + escapeHtml($(this).val()) + '`;';
|
||||
selectedDbs[selectedDbs.length] = 'DROP DATABASE `' + escapeHtml(($(this).val() as string)) + '`;';
|
||||
});
|
||||
|
||||
if (! selectedDbs.length) {
|
||||
|
||||
@ -165,12 +165,13 @@ AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
$('#loadingMonitorIcon').remove();
|
||||
// Codemirror is loaded on demand so we might need to initialize it
|
||||
if (! window.codeMirrorEditor) {
|
||||
var $elm = $('#sqlquery');
|
||||
var $elm = ($('#sqlquery') as JQuery<HTMLTextAreaElement>);
|
||||
if ($elm.length > 0 && typeof window.CodeMirror !== 'undefined') {
|
||||
window.codeMirrorEditor = window.CodeMirror.fromTextArea(
|
||||
$elm[0],
|
||||
{
|
||||
lineNumbers: true,
|
||||
// @ts-ignore
|
||||
matchBrackets: true,
|
||||
indentUnit: 4,
|
||||
mode: 'text/x-mysql',
|
||||
@ -745,7 +746,7 @@ AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
};
|
||||
|
||||
reader.onload = function (e) {
|
||||
var data = e.target.result;
|
||||
var data = (e.target.result as string);
|
||||
var json = null;
|
||||
// Try loading config
|
||||
try {
|
||||
@ -1072,7 +1073,7 @@ AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
}
|
||||
|
||||
if ($('input[name="useDivisor"]').prop('checked')) {
|
||||
serie.valueDivisor = parseInt($('input[name="valueDivisor"]').val(), 10);
|
||||
serie.valueDivisor = parseInt(($('input[name="valueDivisor"]').val() as string), 10);
|
||||
}
|
||||
|
||||
if ($('input[name="useUnit"]').prop('checked')) {
|
||||
@ -1573,8 +1574,8 @@ AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
}
|
||||
|
||||
function loadLog (type, min, max) {
|
||||
var dateStart = Date.parse($('#logAnalyseDialog').find('input[name="dateStart"]').datepicker('getDate')) || min;
|
||||
var dateEnd = Date.parse($('#logAnalyseDialog').find('input[name="dateEnd"]').datepicker('getDate')) || max;
|
||||
var dateStart = Date.parse($('#logAnalyseDialog').find('input[name="dateStart"]').datepicker('getDate').toString()) || min;
|
||||
var dateEnd = Date.parse($('#logAnalyseDialog').find('input[name="dateEnd"]').datepicker('getDate').toString()) || max;
|
||||
|
||||
loadLogStatistics({
|
||||
src: type,
|
||||
@ -1621,7 +1622,7 @@ AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
if (oldChartData === null) {
|
||||
diff = chartData.x - runtime.xmax;
|
||||
} else {
|
||||
diff = parseInt(chartData.x - oldChartData.x, 10);
|
||||
diff = parseInt((chartData.x - oldChartData.x).toString(), 10);
|
||||
}
|
||||
|
||||
runtime.xmin += diff;
|
||||
@ -2169,6 +2170,7 @@ AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
var $tRow;
|
||||
var $tCell;
|
||||
|
||||
// @ts-ignore
|
||||
$('#logTable').html($table);
|
||||
|
||||
var tempPushKey = function (key) {
|
||||
|
||||
@ -68,7 +68,9 @@ AJAX.registerOnload('server/variables.js', function () {
|
||||
$valueCell.html($valueCell.data('content'));
|
||||
}
|
||||
|
||||
$cell.removeClass('edit').html($myEditLink);
|
||||
$cell.removeClass('edit')
|
||||
// @ts-ignore
|
||||
.html($myEditLink);
|
||||
});
|
||||
|
||||
return false;
|
||||
@ -76,7 +78,9 @@ AJAX.registerOnload('server/variables.js', function () {
|
||||
|
||||
$myCancelLink.on('click', function () {
|
||||
$valueCell.html($valueCell.data('content'));
|
||||
$cell.removeClass('edit').html($myEditLink);
|
||||
$cell.removeClass('edit')
|
||||
// @ts-ignore
|
||||
.html($myEditLink);
|
||||
|
||||
return false;
|
||||
});
|
||||
@ -98,12 +102,14 @@ AJAX.registerOnload('server/variables.js', function () {
|
||||
);
|
||||
// Save and replace content
|
||||
$cell
|
||||
// @ts-ignore
|
||||
.html($links)
|
||||
.children()
|
||||
.css('display', 'flex');
|
||||
|
||||
$valueCell
|
||||
.data('content', $valueCell.html())
|
||||
// @ts-ignore
|
||||
.html($editor)
|
||||
.find('input')
|
||||
.trigger('focus')
|
||||
@ -117,7 +123,10 @@ AJAX.registerOnload('server/variables.js', function () {
|
||||
|
||||
ajaxRemoveMessage($msgbox);
|
||||
} else {
|
||||
$cell.removeClass('edit').html($myEditLink);
|
||||
$cell.removeClass('edit')
|
||||
// @ts-ignore
|
||||
.html($myEditLink);
|
||||
|
||||
ajaxShowMessage(data.error);
|
||||
}
|
||||
});
|
||||
|
||||
@ -73,7 +73,7 @@ function showThisQuery (db, table, query): void {
|
||||
window.localStorage.showThisQuery = 1;
|
||||
window.localStorage.showThisQueryObject = JSON.stringify(showThisQueryObject);
|
||||
} else {
|
||||
window.Cookies.set('showThisQuery', 1, { path: CommonParams.get('rootPath') });
|
||||
window.Cookies.set('showThisQuery', '1', { path: CommonParams.get('rootPath') });
|
||||
window.Cookies.set('showThisQueryObject', JSON.stringify(showThisQueryObject), { path: CommonParams.get('rootPath') });
|
||||
}
|
||||
}
|
||||
@ -1048,7 +1048,10 @@ AJAX.registerOnload('sql.js', function () {
|
||||
var $dialogContent = $(dialogContent);
|
||||
var modal = $('#simulateDmlModal');
|
||||
modal.modal('show');
|
||||
modal.find('.modal-body').first().html($dialogContent);
|
||||
modal.find('.modal-body').first()
|
||||
// @ts-ignore
|
||||
.html($dialogContent);
|
||||
|
||||
modal.on('shown.bs.modal', function () {
|
||||
highlightSql(modal);
|
||||
});
|
||||
|
||||
@ -192,7 +192,7 @@ function drawChart () {
|
||||
}
|
||||
|
||||
function getSelectedSeries () {
|
||||
var val = $('#chartSeriesSelect').val() || [];
|
||||
var val = ($('#chartSeriesSelect').val() as string[]) || [];
|
||||
var ret = [];
|
||||
$.each(val, function (i, v) {
|
||||
ret.push(parseInt(v, 10));
|
||||
@ -203,7 +203,7 @@ function getSelectedSeries () {
|
||||
|
||||
function onXAxisChange () {
|
||||
var $xAxisSelect = $('#chartXAxisSelect');
|
||||
currentSettings.mainAxis = parseInt($xAxisSelect.val(), 10);
|
||||
currentSettings.mainAxis = parseInt(($xAxisSelect.val() as string), 10);
|
||||
if (dateTimeCols.indexOf(currentSettings.mainAxis) !== -1) {
|
||||
document.getElementById('timelineChartType').classList.remove('d-none');
|
||||
} else {
|
||||
@ -304,8 +304,8 @@ AJAX.registerOnload('table/chart.js', function () {
|
||||
$seriesColumn.prop('disabled', false);
|
||||
$valueColumn.prop('disabled', false);
|
||||
$chartSeries.prop('disabled', true);
|
||||
currentSettings.seriesColumn = parseInt($seriesColumn.val(), 10);
|
||||
currentSettings.valueColumn = parseInt($valueColumn.val(), 10);
|
||||
currentSettings.seriesColumn = parseInt(($seriesColumn.val() as string), 10);
|
||||
currentSettings.valueColumn = parseInt(($valueColumn.val() as string), 10);
|
||||
} else {
|
||||
$seriesColumn.prop('disabled', true);
|
||||
$valueColumn.prop('disabled', true);
|
||||
@ -357,13 +357,13 @@ AJAX.registerOnload('table/chart.js', function () {
|
||||
|
||||
// handle changing the series column
|
||||
$('#chartSeriesColumnSelect').on('change', function () {
|
||||
currentSettings.seriesColumn = parseInt($(this).val(), 10);
|
||||
currentSettings.seriesColumn = parseInt(($(this).val() as string), 10);
|
||||
drawChart();
|
||||
});
|
||||
|
||||
// handle changing the value column
|
||||
$('#chartValueColumnSelect').on('change', function () {
|
||||
currentSettings.valueColumn = parseInt($(this).val(), 10);
|
||||
currentSettings.valueColumn = parseInt(($(this).val() as string), 10);
|
||||
drawChart();
|
||||
});
|
||||
|
||||
@ -424,7 +424,7 @@ AJAX.registerOnload('table/chart.js', function () {
|
||||
yaxisLabel: $('#yAxisLabelInput').val(),
|
||||
title: $('#chartTitleInput').val(),
|
||||
stackSeries: false,
|
||||
mainAxis: parseInt($('#chartXAxisSelect').val(), 10),
|
||||
mainAxis: parseInt(($('#chartXAxisSelect').val() as string), 10),
|
||||
selectedSeries: getSelectedSeries(),
|
||||
seriesColumn: null
|
||||
};
|
||||
|
||||
@ -247,9 +247,9 @@ AJAX.registerOnload('table/relation.js', function () {
|
||||
var $currRow = $anchor.parents('tr');
|
||||
|
||||
var dropQuery = escapeHtml(
|
||||
$currRow.children('td')
|
||||
($currRow.children('td')
|
||||
.children('.drop_foreign_key_msg')
|
||||
.val()
|
||||
.val() as string)
|
||||
);
|
||||
|
||||
var question = window.sprintf(window.Messages.strDoYouReally, dropQuery);
|
||||
|
||||
@ -303,7 +303,7 @@ AJAX.registerOnload('table/select.js', function () {
|
||||
dataType = TableSelect.checkIfDataTypeNumericOrDate(dataType);
|
||||
|
||||
// Get the operator.
|
||||
var operator = $(this).val();
|
||||
var operator = ($(this).val() as string);
|
||||
|
||||
if ((operator === 'BETWEEN' || operator === 'NOT BETWEEN') && dataType) {
|
||||
var $msgbox = ajaxShowMessage();
|
||||
|
||||
@ -260,7 +260,7 @@ AJAX.registerOnload('table/structure.js', function () {
|
||||
event.preventDefault();
|
||||
|
||||
var $this = $(this);
|
||||
var currTableName = $this.closest('form').find('input[name=table]').val();
|
||||
var currTableName = ($this.closest('form').find('input[name=table]').val() as string);
|
||||
var currColumnName = $this.parents('tr').children('th').children('label').text().trim();
|
||||
|
||||
var addClause = '';
|
||||
@ -305,7 +305,7 @@ AJAX.registerOnload('table/structure.js', function () {
|
||||
var columns = [];
|
||||
|
||||
$('#tablestructure').find('tbody tr').each(function () {
|
||||
var colName = $(this).find('input:checkbox').eq(0).val();
|
||||
var colName = ($(this).find('input:checkbox').eq(0).val() as string);
|
||||
var hiddenInput = $('<input>')
|
||||
.prop({
|
||||
name: 'move_columns[]',
|
||||
|
||||
@ -16,7 +16,7 @@ AJAX.registerOnload('transformations/image_upload.js', function () {
|
||||
var reader = new FileReader();
|
||||
var $input = $(this);
|
||||
reader.onload = function (e) {
|
||||
$input.prevAll('img').attr('src', e.target.result);
|
||||
$input.prevAll('img').attr('src', (e.target.result as string));
|
||||
};
|
||||
|
||||
reader.readAsDataURL(fileInput.files[0]);
|
||||
|
||||
@ -7,9 +7,10 @@ import { AJAX } from '../modules/ajax.ts';
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
AJAX.registerOnload('transformations/json_editor.js', function () {
|
||||
$('textarea.transform_json_editor').each(function () {
|
||||
($('textarea.transform_json_editor') as JQuery<HTMLTextAreaElement>).each(function () {
|
||||
window.CodeMirror.fromTextArea(this, {
|
||||
lineNumbers: true,
|
||||
// @ts-ignore
|
||||
matchBrackets: true,
|
||||
indentUnit: 4,
|
||||
mode: 'application/json',
|
||||
|
||||
@ -8,7 +8,7 @@ import { Functions } from '../modules/functions.ts';
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
AJAX.registerOnload('transformations/sql_editor.js', function () {
|
||||
$('textarea.transform_sql_editor').each(function () {
|
||||
($('textarea.transform_sql_editor') as JQuery<HTMLTextAreaElement>).each(function () {
|
||||
Functions.getSqlEditor($(this), {}, 'both');
|
||||
});
|
||||
});
|
||||
|
||||
@ -7,7 +7,7 @@ import { AJAX } from '../modules/ajax.ts';
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
AJAX.registerOnload('transformations/xml_editor.js', function () {
|
||||
$('textarea.transform_xml_editor').each(function () {
|
||||
($('textarea.transform_xml_editor') as JQuery<HTMLTextAreaElement>).each(function () {
|
||||
window.CodeMirror.fromTextArea(this, {
|
||||
lineNumbers: true,
|
||||
indentUnit: 4,
|
||||
|
||||
@ -10,7 +10,6 @@ const rootPath = path.resolve(__dirname, '');
|
||||
const publicPath = path.resolve(__dirname, 'public');
|
||||
|
||||
const typeScriptErrorsToIgnore = [
|
||||
2345, // TS2345: Argument of type '%s' is not assignable to parameter of type '%s'.
|
||||
5096, // TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.
|
||||
];
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user