Add void return type when annotaded

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2023-04-01 12:52:24 -03:00
parent 8ba9322c03
commit 205d11fc9c
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
26 changed files with 146 additions and 413 deletions

View File

@ -53,9 +53,8 @@ var DesignerOfflineDB = (function () {
/**
* @param {Function} callback
* @return {void}
*/
designerDB.open = function (callback) {
designerDB.open = function (callback): void {
var version = 1;
var request = window.indexedDB.open('pma_designer', version);
@ -94,9 +93,8 @@ var DesignerOfflineDB = (function () {
* @param {String} table
* @param {String} id
* @param {Function} callback
* @return {void}
*/
designerDB.loadObject = function (table, id, callback) {
designerDB.loadObject = function (table, id, callback): void {
if (datastore === null) {
ajaxShowMessage(window.Messages.strIndexedDBNotWorking, null, 'error');
return;
@ -115,9 +113,8 @@ var DesignerOfflineDB = (function () {
/**
* @param {String} table
* @param {Function} callback
* @return {void}
*/
designerDB.loadAllObjects = function (table, callback) {
designerDB.loadAllObjects = function (table, callback): void {
if (datastore === null) {
ajaxShowMessage(window.Messages.strIndexedDBNotWorking, null, 'error');
return;
@ -146,9 +143,8 @@ var DesignerOfflineDB = (function () {
/**
* @param {String} table
* @param {Function} callback
* @return {void}
*/
designerDB.loadFirstObject = function (table, callback) {
designerDB.loadFirstObject = function (table, callback): void {
if (datastore === null) {
ajaxShowMessage(window.Messages.strIndexedDBNotWorking, null, 'error');
return;
@ -177,9 +173,8 @@ var DesignerOfflineDB = (function () {
* @param {String} table
* @param {Object} obj
* @param {Function} callback
* @return {void}
*/
designerDB.addObject = function (table, obj, callback) {
designerDB.addObject = function (table, obj, callback): void {
if (datastore === null) {
ajaxShowMessage(window.Messages.strIndexedDBNotWorking, null, 'error');
return;
@ -201,9 +196,8 @@ var DesignerOfflineDB = (function () {
* @param {String} table
* @param {String} id
* @param {Function} callback
* @return {void}
*/
designerDB.deleteObject = function (table, id, callback) {
designerDB.deleteObject = function (table, id, callback): void {
if (datastore === null) {
ajaxShowMessage(window.Messages.strIndexedDBNotWorking, null, 'error');
return;
@ -223,9 +217,8 @@ var DesignerOfflineDB = (function () {
/**
* @param {Error} e
* @return {void}
*/
designerDB.onerror = function (e) {
designerDB.onerror = function (e): void {
// eslint-disable-next-line no-console
console.log(e);
};

View File

@ -139,9 +139,8 @@ DesignerHistory.display = function (init, finit) {
*
*
* @param {number} index index of DesignerHistory.historyArray where change is to be made
* @return {void}
*/
DesignerHistory.andOr = function (index) {
DesignerHistory.andOr = function (index): void {
if (DesignerHistory.historyArray[index].getAndOr()) {
DesignerHistory.historyArray[index].setAndOr(0);
} else {
@ -156,9 +155,8 @@ DesignerHistory.andOr = function (index) {
* Deletes entry in DesignerHistory.historyArray
*
* @param {number} index of DesignerHistory.historyArray[] which is to be deleted
* @return {void}
*/
DesignerHistory.historyDelete = function (index) {
DesignerHistory.historyDelete = function (index): void {
var fromArrayLength = window.fromArray.length;
for (var k = 0; k < fromArrayLength; k++) {
if (window.fromArray[k] === DesignerHistory.historyArray[index].getTab()) {
@ -174,9 +172,8 @@ DesignerHistory.historyDelete = function (index) {
/**
* @param {string} elementId
* @return {void}
*/
DesignerHistory.changeStyle = function (elementId) {
DesignerHistory.changeStyle = function (elementId): void {
var element = document.getElementById(elementId);
element.style.left = '530px';
element.style.top = '130px';
@ -190,9 +187,8 @@ DesignerHistory.changeStyle = function (elementId) {
* To show where,rename,aggregate,having forms to edit a object
*
* @param {number} index index of DesignerHistory.historyArray where change is to be made
* @return {void}
*/
DesignerHistory.historyEdit = function (index) {
DesignerHistory.historyEdit = function (index): void {
gIndex = index;
var type = DesignerHistory.historyArray[index].getType();
if (type === 'Where') {
@ -218,9 +214,8 @@ DesignerHistory.historyEdit = function (index) {
* checks for the type of object and then sets the new value
*
* @param {string} type of DesignerHistory.historyArray where change is to be made
* @return {void}
*/
DesignerHistory.edit = function (type) {
DesignerHistory.edit = function (type): void {
if (type === 'Rename') {
if (document.getElementById('e_rename').value !== '') {
DesignerHistory.historyArray[gIndex].getObj().setRenameTo(document.getElementById('e_rename').value);

View File

@ -258,9 +258,8 @@ DesignerMove.resizeOsnTab = function () {
* @param {number} y2
* @param {HTMLElement} osnTab
* @param {string} colorTarget
* @return {void}
*/
DesignerMove.drawLine0 = function (x1, x2, y1, y2, osnTab, colorTarget) {
DesignerMove.drawLine0 = function (x1, x2, y1, y2, osnTab, colorTarget): void {
DesignerMove.line0(
x1 + directionEffect * osnTab.offsetLeft,
y1 - osnTab.offsetTop,

View File

@ -59,10 +59,8 @@ var DragDropImport = {
*
* @param {string} hash, hash for specific file upload
* @param {number} percent (float), file upload percentage
*
* @return {void}
*/
setProgress: function (hash, percent) {
setProgress: function (hash, percent): void {
$('.pma_sql_import_status div li[data-hash="' + hash + '"]')
.children('progress').val(percent);
},
@ -71,10 +69,8 @@ var DragDropImport = {
*
* @param {object} formData FormData object for a specific file
* @param {string} hash hash of the current file upload
*
* @return {void}
*/
sendFileToServer: function (formData, hash) {
sendFileToServer: function (formData, hash): void {
var jqXHR = $.ajax({
xhr: function () {
var xhrobj = $.ajaxSettings.xhr();
@ -145,10 +141,8 @@ var DragDropImport = {
* Triggered when an object is dragged into the PMA UI
*
* @param {MouseEvent} event obj
*
* @return {void}
*/
dragEnter: function (event) {
dragEnter: function (event): void {
// We don't want to prevent users from using
// browser's default drag-drop feature on some page(s)
if ($('.noDragDrop').length !== 0) {
@ -186,10 +180,8 @@ var DragDropImport = {
* Triggered when dragged file is being dragged over PMA UI
*
* @param {MouseEvent} event obj
*
* @return {void}
*/
dragOver: function (event) {
dragOver: function (event): void {
// We don't want to prevent users from using
// browser's default drag-drop feature on some page(s)
if ($('.noDragDrop').length !== 0) {
@ -207,10 +199,8 @@ var DragDropImport = {
* Triggered when dragged objects are left
*
* @param {MouseEvent} event obj
*
* @return {void}
*/
dragLeave: function (event) {
dragLeave: function (event): void {
// We don't want to prevent users from using
// browser's default drag-drop feature on some page(s)
if ($('.noDragDrop').length !== 0) {
@ -229,10 +219,8 @@ var DragDropImport = {
* @param {string} hash unique hash for a certain upload
* @param {boolean} aborted true if upload was aborted
* @param {boolean} status status of sql upload, as sent by server
*
* @return {void}
*/
importFinished: function (hash, aborted, status) {
importFinished: function (hash, aborted, status): void {
$('.pma_sql_import_status div li[data-hash="' + hash + '"]')
.children('progress').hide();
var icon = 'icon ic_s_success';
@ -272,10 +260,8 @@ var DragDropImport = {
* From this function, the AJAX Upload operation is initiated
*
* @param event object
*
* @return {void}
*/
drop: function (event) {
drop: function (event): void {
// We don't want to prevent users from using
// browser's default drag-drop feature on some page(s)
if ($('.noDragDrop').length !== 0) {
@ -355,10 +341,7 @@ var DragDropImport = {
};
/**
* Called when some user drags, dragover, leave
* a file to the PMA UI
* @param {object}, Event data
* @return {void}
* Called when some user drags, dragover, leave a file to the PMA UI
*/
$(document).on('dragenter', DragDropImport.dragEnter);
$(document).on('dragover', DragDropImport.dragOver);

View File

@ -26,9 +26,8 @@ var ErrorReport = {
*
* @param {object} data
* @param {any} exception
* @return {void}
*/
errorDataHandler: function (data, exception) {
errorDataHandler: function (data, exception): void {
if (data.success !== true) {
ajaxShowMessage(data.error, false);
return;
@ -78,10 +77,8 @@ var ErrorReport = {
* Shows the modal dialog previewing the report
*
* @param exception object error report info
*
* @return {void}
*/
showReportDialog: function (exception) {
showReportDialog: function (exception): void {
const reportData = ErrorReport.getReportData(exception);
const sendErrorReport = function () {
@ -119,10 +116,8 @@ var ErrorReport = {
},
/**
* Shows the small notification that asks for user permission
*
* @return {void}
*/
showErrorNotification: function () {
showErrorNotification: function (): void {
var key = Math.random().toString(36).substring(2, 12);
while (key in ErrorReport.keyDict) {
key = Math.random().toString(36).substring(2, 12);
@ -161,9 +156,8 @@ var ErrorReport = {
* Removes the notification if it was displayed before
*
* @param {Event} e
* @return {void}
*/
removeErrorNotification: function (e) {
removeErrorNotification: function (e): void {
if (e) {
// don't remove the hash fragment by navigating to #
e.preventDefault();
@ -193,10 +187,8 @@ var ErrorReport = {
},
/**
* Shows the modal dialog previewing the report
*
* @return {void}
*/
createReportDialog: function () {
createReportDialog: function (): void {
ErrorReport.removeErrorNotification();
ErrorReport.showReportDialog(ErrorReport.lastException);
},
@ -263,10 +255,8 @@ var ErrorReport = {
},
/**
* Automatically wraps the callback in AJAX.registerOnload
*
* @return {void}
*/
wrapAjaxOnloadCallback: function () {
wrapAjaxOnloadCallback: function (): void {
var oldOnload = AJAX.registerOnload;
AJAX.registerOnload = function (file, func) {
var wrappedFunction = ErrorReport.wrapFunction(func);
@ -275,10 +265,8 @@ var ErrorReport = {
},
/**
* Automatically wraps the callback in $.fn.on
*
* @return {void}
*/
wrapJqueryOnCallback: function () {
wrapJqueryOnCallback: function (): void {
var oldOn = $.fn.on;
$.fn.on = function () {
for (var i = 1; i <= 3; i++) {
@ -292,10 +280,8 @@ var ErrorReport = {
},
/**
* Wraps the callback in AJAX.registerOnload automatically
*
* @return {void}
*/
setUpErrorReporting: function () {
setUpErrorReporting: function (): void {
ErrorReport.wrapAjaxOnloadCallback();
ErrorReport.wrapJqueryOnCallback();
}

View File

@ -787,10 +787,8 @@ Export.checkTimeOut = function (timeLimit) {
* Handler for Alias dialog box
*
* @param event object the event object
*
* @return {void}
*/
Export.createAliasModal = function (event) {
Export.createAliasModal = function (event): void {
event.preventDefault();
var modal = $('#renameExportModal');
modal.modal('show');

View File

@ -141,10 +141,8 @@ const ajaxShowMessage = function (message = null, timeout = null, type = null) {
* Removes the message shown for an Ajax operation when it's completed
*
* @param {JQuery} $thisMessageBox Element that holds the notification
*
* @return {void}
*/
const ajaxRemoveMessage = function ($thisMessageBox) {
const ajaxRemoveMessage = function ($thisMessageBox): void {
if ($thisMessageBox !== undefined && $thisMessageBox instanceof $) {
$thisMessageBox
.stop(true, true)

View File

@ -120,10 +120,8 @@ const AJAX = {
* file that registered to the onload event of that file.
*
* @param {string} file The filename for which to fire the event
*
* @return {void}
*/
fireOnload: function (file) {
fireOnload: function (file): void {
var eventName = 'onload_' + AJAX.hash(file);
$(document).trigger(eventName);
if (this.debug) {
@ -139,10 +137,8 @@ const AJAX = {
* file that registered to the teardown event of that file.
*
* @param {string} file The filename for which to fire the event
*
* @return {void}
*/
fireTeardown: function (file) {
fireTeardown: function (file): void {
var eventName = 'teardown_' + AJAX.hash(file);
$(document).triggerHandler(eventName);
if (this.debug) {
@ -157,10 +153,8 @@ const AJAX = {
* function to handle lock page mechanism
*
* @param event the event object
*
* @return {void}
*/
lockPageHandler: function (event) {
lockPageHandler: function (event): void {
// don't consider checkbox event
if (typeof event.target !== 'undefined') {
if (event.target.type === 'checkbox') {
@ -214,10 +208,8 @@ const AJAX = {
},
/**
* resets the lock
*
* @return {void}
*/
resetLock: function () {
resetLock: function (): void {
AJAX.lockedTargets = {};
$('#lock_page_icon').html('');
},
@ -365,10 +357,8 @@ const AJAX = {
* is called in the jQuery context.
*
* @param {object} data Event data
*
* @return {void}
*/
loginResponseHandler: function (data) {
loginResponseHandler: function (data): void {
if (typeof data === 'undefined' || data === null) {
return;
}
@ -471,10 +461,8 @@ const AJAX = {
* is called in the jQuery context.
*
* @param {object} data Event data
*
* @return {void}
*/
responseHandler: function (data) {
responseHandler: function (data): void {
if (typeof data === 'undefined' || data === null) {
return;
}
@ -664,10 +652,8 @@ const AJAX = {
*
* @param {string} file The filename
* @param {boolean} fire Whether this file will be registering onload/teardown events
*
* @return {void}
*/
add: function (file, fire) {
add: function (file, fire): void {
this.scripts.push(file);
if (fire) {
// Record whether to fire any events for the file
@ -680,10 +666,8 @@ const AJAX = {
*
* @param {string[]} files An array of filenames and flags
* @param {Function} callback
*
* @return {void}
*/
load: function (files, callback) {
load: function (files, callback): void {
var self = this;
var i;
// Clear loaded scripts if they are from another version of phpMyAdmin.
@ -724,10 +708,8 @@ const AJAX = {
*
* @param {string} script
* @param {Function?} callback
*
* @return {void}
*/
done: function (script, callback) {
done: function (script, callback): void {
if ($.inArray(script, this.scriptsToBeFired)) {
AJAX.fireOnload(script);
}
@ -749,10 +731,8 @@ const AJAX = {
*
* @param {string} name
* @param {Function} callback
*
* @return {void}
*/
appendScript: function (name, callback) {
appendScript: function (name, callback): void {
var head = document.head || document.getElementsByTagName('head')[0];
var script = document.createElement('script');
var self = this;
@ -771,10 +751,8 @@ const AJAX = {
* and rebinds all forms and links to the request handler
*
* @param {Function} callback The callback to call after resetting
*
* @return {void}
*/
reset: function (callback) {
reset: function (callback): void {
for (var i in this.scriptsToBeFired) {
AJAX.fireTeardown(this.scriptsToBeFired[i]);
}

View File

@ -40,10 +40,8 @@ function getFieldType (field) {
*
* @param {Element} field
* @param {boolean} display
*
* @return {void}
*/
function setRestoreDefaultBtn (field, display) {
function setRestoreDefaultBtn (field, display): void {
var $el = $(field).closest('td').find('.restore-default img');
$el[display ? 'show' : 'hide']();
}
@ -52,10 +50,8 @@ function setRestoreDefaultBtn (field, display) {
* Marks field depending on its value (system default or custom)
*
* @param {Element | JQuery<Element>} field
*
* @return {void}
*/
function markField (field) {
function markField (field): void {
var $field = $(field);
var type = getFieldType($field);
var isDefault = checkFieldDefault($field, type);
@ -571,10 +567,8 @@ function adjustPrefsNotification () {
* Restores field's default value
*
* @param {string} fieldId
*
* @return {void}
*/
function restoreField (fieldId) {
function restoreField (fieldId): void {
var $field = $('#' + fieldId);
if ($field.length === 0 || window.defaultValues[fieldId] === undefined) {
return;

View File

@ -56,10 +56,8 @@ var Console = {
/**
* Used for console initialize, reinit is ok, just some variable assignment
*
* @return {void}
*/
initialize: function () {
initialize: function (): void {
if ($('#pma_console').length === 0) {
return;
}
@ -229,10 +227,8 @@ var Console = {
*
* @param {string} queryString
* @param {object} options
*
* @return {void}
*/
execute: function (queryString, options) {
execute: function (queryString, options): void {
if (typeof (queryString) !== 'string' || ! /[a-z]|[A-Z]/.test(queryString)) {
return;
}
@ -275,10 +271,8 @@ var Console = {
},
/**
* Change console to collapse mode
*
* @return {void}
*/
collapse: function () {
collapse: function (): void {
Config.set('Mode', 'collapse');
var pmaConsoleHeight = Math.max(92, Config.Height);
@ -292,9 +286,8 @@ var Console = {
* Show console
*
* @param {boolean} inputFocus If true, focus the input line after show()
* @return {void}
*/
show: function (inputFocus) {
show: function (inputFocus): void {
Config.set('Mode', 'show');
var pmaConsoleHeight = Math.max(92, Config.Height);
@ -314,20 +307,16 @@ var Console = {
* Change console to SQL information mode
* this mode shows current SQL query
* This mode is the default mode
*
* @return {void}
*/
info: function () {
info: function (): void {
// Under construction
Console.collapse();
},
/**
* Toggle console mode between collapse/show
* Used for toggle buttons and shortcuts
*
* @return {void}
*/
toggle: function () {
toggle: function (): void {
if (Config.Mode === 'show') {
Console.collapse();
} else {
@ -336,10 +325,8 @@ var Console = {
},
/**
* Scroll console to bottom
*
* @return {void}
*/
scrollBottom: function () {
scrollBottom: function (): void {
Console.$consoleContent.scrollTop(Console.$consoleContent.prop('scrollHeight'));
},
/**
@ -347,10 +334,8 @@ var Console = {
*
* @param {string | JQuery<Element>} cardSelector Selector, select string will be "#pma_console " + cardSelector
* this param also can be JQuery object, if you need.
*
* @return {void}
*/
showCard: function (cardSelector) {
showCard: function (cardSelector): void {
var $card = null;
if (typeof (cardSelector) !== 'string') {
if (cardSelector.length > 0) {
@ -375,9 +360,8 @@ var Console = {
* Scroll console to bottom
*
* @param {object} $targetCard Target card JQuery object, if it's empty, function will hide all cards
* @return {void}
*/
hideCard: function ($targetCard) {
hideCard: function ($targetCard): void {
if (! $targetCard) {
$('#pma_console').find('.mid_layer').fadeOut(140);
$('#pma_console').find('.card').removeClass('show');
@ -406,10 +390,8 @@ var ConsoleResizer = {
* Mousedown event handler for bind to resizer
*
* @param {MouseEvent} event
*
* @return {void}
*/
mouseDown: function (event) {
mouseDown: function (event): void {
if (Config.Mode !== 'show') {
return;
}
@ -426,10 +408,8 @@ var ConsoleResizer = {
* Mousemove event handler for bind to resizer
*
* @param {MouseEvent} event
*
* @return {void}
*/
mouseMove: function (event) {
mouseMove: function (event): void {
if (event.pageY < 35) {
event.pageY = 35;
}
@ -451,10 +431,8 @@ var ConsoleResizer = {
},
/**
* Mouseup event handler for bind to resizer
*
* @return {void}
*/
mouseUp: function () {
mouseUp: function (): void {
Config.set('Height', ConsoleResizer.resultHeight);
Console.show();
$(document).off('mousemove');
@ -463,10 +441,8 @@ var ConsoleResizer = {
},
/**
* Used for console resizer initialize
*
* @return {void}
*/
initialize: function () {
initialize: function (): void {
$('#pma_console').find('.toolbar').off('mousedown');
$('#pma_console').find('.toolbar').on('mousedown', ConsoleResizer.mouseDown);
}
@ -498,10 +474,8 @@ var ConsoleInput = {
historyPreserveCurrent: null,
/**
* Used for console input initialize
*
* @return {void}
*/
initialize: function () {
initialize: function (): void {
// _cm object can't be reinitialize
if (ConsoleInput.inputs !== null) {
return;
@ -620,10 +594,8 @@ var ConsoleInput = {
* configuration.
*
* @param {KeyboardEvent} event
*
* @return {void}
*/
keyDown: function (event) {
keyDown: function (event): void {
// Execute command
if (Config.EnterExecutes) {
// Enter, but not in combination with Shift (which writes a new line).
@ -647,10 +619,8 @@ var ConsoleInput = {
},
/**
* Used for send text to Console.execute()
*
* @return {void}
*/
execute: function () {
execute: function (): void {
if (ConsoleInput.codeMirror) {
Console.execute(ConsoleInput.inputs.console.getValue());
} else {
@ -661,25 +631,20 @@ var ConsoleInput = {
* Used for clear the input
*
* @param {string} target, default target is console input
* @return {void}
*/
clear: function (target) {
clear: function (target): void {
ConsoleInput.setText('', target);
},
/**
* Used for set focus to input
*
* @return {void}
*/
focus: function () {
focus: function (): void {
ConsoleInput.inputs.console.focus();
},
/**
* Used for blur input
*
* @return {void}
*/
blur: function () {
blur: function (): void {
if (ConsoleInput.codeMirror) {
ConsoleInput.inputs.console.getInputField().blur();
} else {
@ -691,9 +656,8 @@ var ConsoleInput = {
*
* @param {string} text
* @param {string} target
* @return {void}
*/
setText: function (text, target) {
setText: function (text, target): void {
if (ConsoleInput.codeMirror) {
switch (target) {
case 'bookmark':
@ -746,20 +710,16 @@ var ConsoleInput = {
var ConsoleMessages = {
/**
* Used for clear the messages
*
* @return {void}
*/
clear: function () {
clear: function (): void {
$('#pma_console').find('.content .console_message_container .message:not(.welcome)').addClass('hide');
$('#pma_console').find('.content .console_message_container .message.failed').remove();
$('#pma_console').find('.content .console_message_container .message.expanded').find('.action.collapse').trigger('click');
},
/**
* Used for show history messages
*
* @return {void}
*/
showHistory: function () {
showHistory: function (): void {
$('#pma_console').find('.content .console_message_container .message.hide').removeClass('hide');
},
/**
@ -783,9 +743,8 @@ var ConsoleMessages = {
* combination executes the query (Ctrl+Enter or Enter).
*
* @param {boolean} enterExecutes Only Enter has to be pressed to execute query.
* @return {void}
*/
showInstructions: function (enterExecutes) {
showInstructions: function (enterExecutes): void {
var enter = +enterExecutes || 0; // conversion to int
var $welcomeMsg = $('#pma_console').find('.content .console_message_container .message.welcome span');
$welcomeMsg.children('[id^=instructions]').hide();
@ -1015,10 +974,8 @@ var ConsoleMessages = {
},
/**
* Used for console messages initialize
*
* @return {void}
*/
initialize: function () {
initialize: function (): void {
ConsoleMessages.messageEventBinds($('#pma_console').find('.message:not(.binded)'));
if (Config.StartHistory) {
ConsoleMessages.showHistory();
@ -1068,10 +1025,8 @@ var ConsoleBookmarks = {
/**
* Used for console bookmarks initialize
* message events are already binded by ConsoleMsg.messageEventBinds
*
* @return {void}
*/
initialize: function () {
initialize: function (): void {
if ($('#pma_bookmarks').length === 0) {
return;
}

View File

@ -47,9 +47,8 @@ export const Config = {
/**
* @param {Object} data
* @return {void}
*/
init: function (data) {
init: function (data): void {
this.StartHistory = !! data.StartHistory;
this.AlwaysExpand = !! data.AlwaysExpand;
this.CurrentQuery = data.CurrentQuery !== undefined ? !! data.CurrentQuery : true;
@ -65,19 +64,16 @@ export const Config = {
/**
* @param {'StartHistory'|'AlwaysExpand'|'CurrentQuery'|'EnterExecutes'|'DarkTheme'|'Mode'|'Height'|'GroupQueries'|'OrderBy'|'Order'} key
* @param {boolean|string|number} value
* @return {void}
*/
set: function (key, value) {
set: function (key, value): void {
this[key] = value;
setConfigValue('Console/' + key, value);
},
/**
* Used for update console config
*
* @return {void}
*/
update: function () {
update: function (): void {
this.set('AlwaysExpand', !! document.getElementById('consoleOptionsAlwaysExpandCheckbox').checked);
this.set('StartHistory', !! document.getElementById('consoleOptionsStartHistoryCheckbox').checked);
this.set('CurrentQuery', !! document.getElementById('consoleOptionsCurrentQueryCheckbox').checked);

View File

@ -1,8 +1,7 @@
/**
* Conditionally included if framing is not allowed.
* @return {void}
*/
const crossFramingProtection = () => {
const crossFramingProtection = (): void => {
if (window.allowThirdPartyFraming) {
return;
}

View File

@ -1304,10 +1304,8 @@ function updateCode ($base, htmlValue, rawValue) {
* Requests SQL for previewing before executing.
*
* @param {JQuery<HTMLElement>} $form Form containing query data
*
* @return {void}
*/
function previewSql ($form) {
function previewSql ($form): void {
var formUrl = $form.attr('action');
var sep = CommonParams.get('arg_separator');
var formData = $form.serialize() +
@ -1350,10 +1348,8 @@ function previewSql ($form) {
* @param {string} sqlData Sql query to preview
* @param {string} url Url to be sent to callback
* @param {onSubmitCallback} callback On submit callback function
*
* @return {void}
*/
function confirmPreviewSql (sqlData, url, callback) {
function confirmPreviewSql (sqlData, url, callback): void {
$('#previewSqlConfirmModal').modal('show');
$('#previewSqlConfirmModalLabel').first().html(window.Messages.strPreviewSQL);
$('#previewSqlConfirmCode').first().text(sqlData);
@ -1756,10 +1752,7 @@ function sortTable (textSelector) {
});
}
/**
* @return {void}
*/
function teardownCreateTableEvents () {
function teardownCreateTableEvents (): void {
$(document).off('submit', 'form.create_table_form.ajax');
$(document).off('click', 'form.create_table_form.ajax input[name=submit_num_fields]');
$(document).off('keyup', 'form.create_table_form.ajax input');
@ -1768,9 +1761,8 @@ function teardownCreateTableEvents () {
/**
* Used on /database/operations, /database/structure and /database/tracking
* @return {void}
*/
function onloadCreateTableEvents () {
function onloadCreateTableEvents (): void {
/**
* Attach event handler for submission of create table form (save)
*/
@ -1988,10 +1980,7 @@ function checkPassword ($theForm) {
return true;
}
/**
* @return {void}
*/
function onloadChangePasswordEvents () {
function onloadChangePasswordEvents (): void {
/* Handler for hostname type */
$(document).on('change', '#select_pred_hostname', function () {
var hostname = $('#pma_hostname');
@ -2135,10 +2124,7 @@ function onloadChangePasswordEvents () {
});
}
/**
* @return {void}
*/
function teardownEnumSetEditorMessage () {
function teardownEnumSetEditorMessage (): void {
$(document).off('change', 'select.column_type');
$(document).off('change', 'select.default_type');
$(document).off('change', 'select.virtuality');
@ -2149,9 +2135,8 @@ function teardownEnumSetEditorMessage () {
/**
* Toggle the hiding/showing of the "Open in ENUM/SET editor" message when
* the page loads and when the selected data type changes
* @return {void}
*/
function onloadEnumSetEditorMessage () {
function onloadEnumSetEditorMessage (): void {
// is called here for normal page loads and also when opening
// the Create table dialog
Functions.verifyColumnsProperties();
@ -2265,10 +2250,7 @@ function autoPopulate (inputId, offset) {
}
}
/**
* @return {void}
*/
function teardownEnumSetEditor () {
function teardownEnumSetEditor (): void {
$(document).off('click', 'a.open_enum_editor');
$(document).off('click', 'input.add_value');
$(document).off('click', '#enum_editor td.drop');
@ -2277,9 +2259,8 @@ function teardownEnumSetEditor () {
/**
* Opens the ENUM/SET editor and controls its functions
* @return {void}
*/
function onloadEnumSetEditor () {
function onloadEnumSetEditor (): void {
$(document).on('click', 'a.open_enum_editor', function () {
// Get the name of the column that is being edited
var colname = $(this).closest('tr').find('input').first().val();
@ -2929,10 +2910,7 @@ function toggleButton ($obj) {
});
}
/**
* @return {void}
*/
function initializeToggleButtons () {
function initializeToggleButtons (): void {
$('div.toggleAjax').each(function () {
var $button = $(this).show();
$button.find('img').each(function () {
@ -2965,18 +2943,12 @@ function getPageSelectorEventHandler () {
};
}
/**
* @return {void}
*/
function teardownRecentFavoriteTables () {
function teardownRecentFavoriteTables (): void {
$('#update_recent_tables').off('ready');
$('#sync_favorite_tables').off('ready');
}
/**
* @return {void}
*/
function onloadRecentFavoriteTables () {
function onloadRecentFavoriteTables (): void {
var $updateRecentTables = $('#update_recent_tables');
if ($updateRecentTables.length) {
$.get(
@ -3104,9 +3076,8 @@ function slidingMessage (msg, $object) {
/**
* Attach CodeMirror editor to SQL edit area.
* @return {void}
*/
function onloadCodeMirrorEditor () {
function onloadCodeMirrorEditor (): void {
var $elm = $('#sqlquery');
if ($elm.siblings().filter('.CodeMirror').length > 0) {
return;
@ -3124,10 +3095,7 @@ function onloadCodeMirrorEditor () {
highlightSql($('body'));
}
/**
* @return {void}
*/
function teardownCodeMirrorEditor () {
function teardownCodeMirrorEditor (): void {
if (window.codeMirrorEditor) {
$('#sqlquery').text(window.codeMirrorEditor.getValue());
window.codeMirrorEditor.toTextArea();
@ -3135,10 +3103,7 @@ function teardownCodeMirrorEditor () {
}
}
/**
* @return {void}
*/
function onloadLockPage () {
function onloadLockPage (): void {
// initializes all lock-page elements lock-id and
// val-hash data property
$('#page_content form.lock-page textarea, ' +

View File

@ -13,10 +13,8 @@ import { CommonParams } from '../common.ts';
*
* @param {string} key Configuration key.
* @param {object} value Configuration value.
*
* @return {void}
*/
export function setConfigValue (key, value) {
export function setConfigValue (key, value): void {
// Updating value in local storage.
var serialized = JSON.stringify(value);
localStorage.setItem(key, serialized);
@ -54,10 +52,8 @@ export function setConfigValue (key, value) {
* @param {boolean} cached Configuration type.
* @param {Function} successCallback The callback to call after the value is successfully received
* @param {Function} failureCallback The callback to call when the value can not be received
*
* @return {void}
*/
export function getConfigValue (key, cached, successCallback, failureCallback) {
export function getConfigValue (key, cached, successCallback, failureCallback): void {
var isCached = (typeof cached !== 'undefined') ? cached : true;
var value = localStorage.getItem(key);
if (isCached && value !== undefined && value !== null) {

View File

@ -7,10 +7,8 @@ import getJsConfirmCommonParam from './getJsConfirmCommonParam.ts';
/**
* @param {JQuery<HTMLElement>} $this
*
* @return {void}
*/
export default function handleCreateViewModal ($this) {
export default function handleCreateViewModal ($this): void {
var $msg = ajaxShowMessage();
var sep = CommonParams.get('arg_separator');
var params = getJsConfirmCommonParam(this, $this.getPostData());

View File

@ -6,10 +6,8 @@ import { CommonParams } from '../common.ts';
*
* @param {any} url Undefined to refresh to the same page
* String to go to a different page, e.g: 'index.php'
*
* @return {void}
*/
export default function refreshMainContent (url) {
export default function refreshMainContent (url): void {
var newUrl = url;
if (! newUrl) {
newUrl = $('#selflink').find('a').attr('href') || window.location.pathname;

View File

@ -48,10 +48,7 @@ let fulltextColumns = [];
*/
let spatialColumns = [];
/**
* @return {void}
*/
Indexes.resetColumnLists = () => {
Indexes.resetColumnLists = (): void => {
primaryColumns = [];
uniqueColumns = [];
indexColumns = [];
@ -96,10 +93,8 @@ Indexes.getIndexArray = function (indexChoice) {
*
* @param {any[]} sourceArray Array containing index columns
* @param {string} indexChoice Choice of index
*
* @return {void}
*/
Indexes.setIndexFormParameters = function (sourceArray, indexChoice) {
Indexes.setIndexFormParameters = function (sourceArray, indexChoice): void {
if (indexChoice === 'index') {
$('input[name="indexes"]').val(JSON.stringify(sourceArray));
} else {
@ -111,10 +106,8 @@ Indexes.setIndexFormParameters = function (sourceArray, indexChoice) {
* Removes a column from an Index.
*
* @param {string} colIndex Index of column in form
*
* @return {void}
*/
Indexes.removeColumnFromIndex = function (colIndex) {
Indexes.removeColumnFromIndex = function (colIndex): void {
// Get previous index details.
var previousIndex = $('select[name="field_key[' + colIndex + ']"]')
.attr('data-index');
@ -152,10 +145,8 @@ Indexes.removeColumnFromIndex = function (colIndex) {
* @param {string} arrayIndex Index of an INDEX in array
* @param {string} indexChoice Choice of Index
* @param {string} colIndex Index of column on form
*
* @return {void}
*/
Indexes.addColumnToIndex = function (sourceArray, arrayIndex, indexChoice, colIndex) {
Indexes.addColumnToIndex = function (sourceArray, arrayIndex, indexChoice, colIndex): void {
if (colIndex >= 0) {
// Remove column from other indexes (if any).
Indexes.removeColumnFromIndex(colIndex);
@ -303,10 +294,8 @@ var addIndexGo = function (sourceArray, arrayIndex, index, colIndex) {
* @param {string} colIndex Index of column on form
* @param {object} index Index detail object
* @param {boolean} showDialog Whether to show index creation dialog or not
*
* @return {void}
*/
Indexes.showAddIndexDialog = function (sourceArray, arrayIndex, targetColumns, colIndex, index, showDialog) {
Indexes.showAddIndexDialog = function (sourceArray, arrayIndex, targetColumns, colIndex, index, showDialog): void {
var showDialogLocal = typeof showDialog !== 'undefined' ? showDialog : true;
// Prepare post-data.
var $table = $('input[name="table"]');
@ -428,10 +417,8 @@ var removeIndexOnChangeEvent = function () {
* @param {any[]} sourceArray Array holding a particular type of indexes
* @param {string} indexChoice Choice of index
* @param {string} colIndex Index of new column on form
*
* @return {void}
*/
Indexes.indexTypeSelectionDialog = function (sourceArray, indexChoice, colIndex) {
Indexes.indexTypeSelectionDialog = function (sourceArray, indexChoice, colIndex): void {
var $singleColumnRadio = $('<input type="radio" id="single_column" name="index_choice"' +
' checked="checked">' +
'<label for="single_column">' + window.Messages.strCreateSingleColumnIndex + '</label>');

View File

@ -15,10 +15,8 @@ const Navigation = {};
/**
* updates the tree state in sessionStorage
*
* @return {void}
*/
Navigation.treeStateUpdate = function () {
Navigation.treeStateUpdate = function (): void {
// update if session storage is supported
if (isStorageSupported('sessionStorage')) {
var storage = window.sessionStorage;
@ -43,10 +41,8 @@ Navigation.treeStateUpdate = function () {
*
* @param {string} filterName
* @param {string} filterValue
*
* @return {void}
*/
Navigation.filterStateUpdate = function (filterName, filterValue) {
Navigation.filterStateUpdate = function (filterName, filterValue): void {
if (isStorageSupported('sessionStorage')) {
var storage = window.sessionStorage;
try {
@ -63,10 +59,8 @@ Navigation.filterStateUpdate = function (filterName, filterValue) {
/**
* restores the filter state on navigation reload
*
* @return {void}
*/
Navigation.filterStateRestore = function () {
Navigation.filterStateRestore = function (): void {
if (isStorageSupported('sessionStorage')
&& typeof window.sessionStorage.navTreeSearchFilters !== 'undefined'
) {
@ -128,10 +122,8 @@ Navigation.filterStateRestore = function () {
* @param isNode
* @param $expandElem expander
* @param callback callback function
*
* @return {void}
*/
Navigation.loadChildNodes = function (isNode, $expandElem, callback) {
Navigation.loadChildNodes = function (isNode, $expandElem, callback): void {
var $destination = null;
var params = null;
@ -217,10 +209,8 @@ Navigation.loadChildNodes = function (isNode, $expandElem, callback) {
* Collapses a node in navigation tree.
*
* @param $expandElem expander
*
* @return {void}
*/
Navigation.collapseTreeNode = function ($expandElem) {
Navigation.collapseTreeNode = function ($expandElem): void {
var $children = $expandElem.closest('li').children('div.list_container');
var $icon = $expandElem.find('img');
if ($expandElem.hasClass('loaded')) {
@ -283,10 +273,8 @@ Navigation.traverseForPaths = function () {
*
* @param $expandElem expander
* @param callback callback function
*
* @return {void}
*/
Navigation.expandTreeNode = function ($expandElem, callback) {
Navigation.expandTreeNode = function ($expandElem, callback): void {
var $children = $expandElem.closest('li').children('div.list_container');
var $icon = $expandElem.find('img');
if ($expandElem.hasClass('loaded')) {
@ -359,10 +347,8 @@ Navigation.scrollToView = function ($element, $forceToTop) {
/**
* Expand the navigation and highlight the current database or table/view
*
* @return {void}
*/
Navigation.showCurrent = function () {
Navigation.showCurrent = function (): void {
var db = CommonParams.get('db');
var table = CommonParams.get('table');
@ -569,10 +555,8 @@ Navigation.showCurrent = function () {
/**
* Disable navigation panel settings
*
* @return {void}
*/
Navigation.disableSettings = function () {
Navigation.disableSettings = function (): void {
$('#pma_navigation_settings_icon').addClass('hide');
$('#pma_navigation_settings').remove();
};
@ -582,10 +566,8 @@ Navigation.disableSettings = function () {
* If not, set it up
*
* @param {string} selflink
*
* @return {void}
*/
Navigation.ensureSettings = function (selflink) {
Navigation.ensureSettings = function (selflink): void {
$('#pma_navigation_settings_icon').removeClass('hide');
if (! $('#pma_navigation_settings').length) {
@ -613,10 +595,8 @@ Navigation.ensureSettings = function (selflink) {
*
* @param {Function} callback the callback function
* @param {object} paths stored navigation paths
*
* @return {void}
*/
Navigation.reload = function (callback = null, paths = null) {
Navigation.reload = function (callback = null, paths = null): void {
var params = {
'reload': true,
'no_debug': true,
@ -673,10 +653,8 @@ Navigation.selectCurrentDatabase = function () {
*
* @param {object} $this A jQuery object that points to the element that
* initiated the action of changing the page
*
* @return {void}
*/
Navigation.treePagination = function ($this) {
Navigation.treePagination = function ($this): void {
var $msgbox = ajaxShowMessage();
var isDbSelector = $this.closest('div.pageselector').is('.dbselector');
var url = 'index.php?route=/navigation';
@ -757,10 +735,8 @@ Navigation.ResizeHandler = function () {
* Adjusts the width of the navigation panel to the specified value
*
* @param {number} position Navigation width in pixels
*
* @return {void}
*/
this.setWidth = function (position) {
this.setWidth = function (position): void {
var pos = position;
if (typeof pos !== 'number') {
pos = 240;
@ -869,10 +845,8 @@ Navigation.ResizeHandler = function () {
* Event handler for initiating a resize of the panel
*
* @param {object} event Event data (contains a reference to Navigation.ResizeHandler)
*
* @return {void}
*/
this.mousedown = function (event) {
this.mousedown = function (event): void {
event.preventDefault();
$(document)
.on('mousemove', { 'resize_handler': event.data.resize_handler }, event.data.resize_handler.mousemove)
@ -883,10 +857,8 @@ Navigation.ResizeHandler = function () {
* Event handler for terminating a resize of the panel
*
* @param {object} event Event data (contains a reference to Navigation.ResizeHandler)
*
* @return {void}
*/
this.mouseup = function (event) {
this.mouseup = function (event): void {
$('body').css('cursor', '');
setConfigValue('NavigationWidth', event.data.resize_handler.getPos(event));
$('#topmenu').menuResizer('resize');
@ -898,10 +870,8 @@ Navigation.ResizeHandler = function () {
* Event handler for updating the panel during a resize operation
*
* @param {object} event Event data (contains a reference to Navigation.ResizeHandler)
*
* @return {void}
*/
this.mousemove = function (event) {
this.mousemove = function (event): void {
event.preventDefault();
if (event.data && event.data.resize_handler) {
var pos = event.data.resize_handler.getPos(event);
@ -912,10 +882,8 @@ Navigation.ResizeHandler = function () {
* Event handler for collapsing the panel
*
* @param {object} event Event data (contains a reference to Navigation.ResizeHandler)
*
* @return {void}
*/
this.collapse = function (event) {
this.collapse = function (event): void {
event.preventDefault();
var panelWidth = event.data.resize_handler.panelWidth;
var width = $('#pma_navigation').width();
@ -928,10 +896,8 @@ Navigation.ResizeHandler = function () {
};
/**
* Event handler for resizing the navigation tree height on window resize
*
* @return {void}
*/
this.treeResize = function () {
this.treeResize = function (): void {
var $nav = $('#pma_navigation');
var $navTree = $('#pma_navigation_tree');
var $navHeader = $('#pma_navigation_header');
@ -953,10 +919,8 @@ Navigation.ResizeHandler = function () {
};
/**
* Init handlers for the tree resizers
*
* @return {void}
*/
this.treeInit = function () {
this.treeInit = function (): void {
const isLoadedOnMobile = $(window).width() < 768;
// Hide the pma_navigation initially when loaded on mobile
if (isLoadedOnMobile) {
@ -1000,10 +964,8 @@ Navigation.FastFilter = {
* @param {object} $this A jQuery object pointing to the list container
* which is the nearest parent of the fast filter
* @param {string} searchClause The query string for the filter
*
* @return {void}
*/
Filter: function ($this, searchClause) {
Filter: function ($this, searchClause): void {
/**
* @var {object} $this A jQuery object pointing to the list container
* which is the nearest parent of the fast filter
@ -1207,10 +1169,8 @@ Navigation.FastFilter = {
* Handles a change in the search clause
*
* @param {string} searchClause The query string for the filter
*
* @return {void}
*/
Navigation.FastFilter.Filter.prototype.update = function (searchClause) {
Navigation.FastFilter.Filter.prototype.update = function (searchClause): void {
if (this.searchClause !== searchClause) {
this.searchClause = searchClause;
this.request();
@ -1219,10 +1179,8 @@ Navigation.FastFilter.Filter.prototype.update = function (searchClause) {
/**
* After a delay of 250mS, initiates a request to retrieve search results
* Multiple calls to this function will always abort the previous request
*
* @return {void}
*/
Navigation.FastFilter.Filter.prototype.request = function () {
Navigation.FastFilter.Filter.prototype.request = function (): void {
var self = this;
if (self.$this.find('li.fast_filter').find('img.throbber').length === 0) {
self.$this.find('li.fast_filter').append(
@ -1265,10 +1223,8 @@ Navigation.FastFilter.Filter.prototype.request = function () {
* Replaces the contents of the navigation branch with the search results
*
* @param {string} list The search results
*
* @return {void}
*/
Navigation.FastFilter.Filter.prototype.swap = function (list) {
Navigation.FastFilter.Filter.prototype.swap = function (list): void {
this.$this
.html($(list).html())
.children()
@ -1282,10 +1238,8 @@ Navigation.FastFilter.Filter.prototype.swap = function (list) {
* Restores the navigation to the original state after the fast filter is cleared
*
* @param {boolean} focus Whether to also focus the input box of the fast filter
*
* @return {void}
*/
Navigation.FastFilter.Filter.prototype.restore = function (focus) {
Navigation.FastFilter.Filter.prototype.restore = function (focus): void {
if (this.$this.children('ul').first().hasClass('search_results')) {
this.$this.html(this.$clone.html()).children().show();
this.$this.data('fastFilter', this);
@ -1302,10 +1256,8 @@ Navigation.FastFilter.Filter.prototype.restore = function (focus) {
* Show full name when cursor hover and name not shown completely
*
* @param {object} $containerELem Container element
*
* @return {void}
*/
Navigation.showFullName = function ($containerELem) {
Navigation.showFullName = function ($containerELem): void {
$containerELem.find('.hover_show_full').on('mouseenter', function () {
/** mouseenter */
var $this = $(this);
@ -1343,9 +1295,8 @@ Navigation.showFullName = function ($containerELem) {
/**
* @param {boolean} update
* @return {void}
*/
Navigation.update = update => {
Navigation.update = (update): void => {
if (update && $('#pma_navigation_tree').hasClass('synced')) {
Navigation.showCurrent();
}

View File

@ -34,19 +34,13 @@ function showNaviSettings () {
}
const PageSettings = {
/**
* @return {void}
*/
off: () => {
off: (): void => {
$('#page_settings_icon').css('display', 'none');
$('#page_settings_icon').off('click');
$('#pma_navigation_settings_icon').off('click');
},
/**
* @return {void}
*/
on: () => {
on: (): void => {
if ($('#page_settings_modal').length) {
$('#page_settings_icon').css('display', 'inline');
$('#page_settings_icon').on('click', showPageSettings);

View File

@ -7,10 +7,8 @@ import $ from 'jquery';
* @param {string} item the item (see https://api.jqueryui.com/tooltip/#option-items)
* @param myContent content of the tooltip
* @param {Object} additionalOptions to override the default options
*
* @return {void}
*/
export default function tooltip ($elements, item, myContent, additionalOptions = {}) {
export default function tooltip ($elements, item, myContent, additionalOptions = {}): void {
if ($('#no_hint').length > 0) {
return;
}

View File

@ -29,10 +29,8 @@ var processList = {
/**
* Handles killing of a process
*
* @return {void}
*/
init: function () {
init: function (): void {
processList.setRefreshLabel();
if (processList.refreshUrl === null) {
processList.refreshUrl = 'index.php?route=/server/status/processes/refresh';
@ -48,10 +46,8 @@ var processList = {
* Handles killing of a process
*
* @param {object} event the event object
*
* @return {void}
*/
killProcessHandler: function (event) {
killProcessHandler: function (event): void {
event.preventDefault();
var argSep = CommonParams.get('arg_separator');
var params = $(this).getPostData();
@ -84,9 +80,8 @@ var processList = {
/**
* Handles Auto Refreshing
* @return {void}
*/
refresh: function () {
refresh: function (): void {
// abort any previous pending requests
// this is necessary, it may go into
// multiple loops causing unnecessary
@ -116,10 +111,8 @@ var processList = {
/**
* Stop current request and clears timeout
*
* @return {void}
*/
abortRefresh: function () {
abortRefresh: function (): void {
if (processList.refreshRequest !== null) {
processList.refreshRequest.abort();
processList.refreshRequest = null;
@ -130,10 +123,8 @@ var processList = {
/**
* Set label of refresh button
* change between play & pause
*
* @return {void}
*/
setRefreshLabel: function () {
setRefreshLabel: function (): void {
var img = 'play';
var label = window.Messages.strStartRefresh;
if (processList.autoRefresh) {

View File

@ -49,9 +49,8 @@ Sql.urlEncode = function (str) {
* Saves SQL query in local storage or cookie
*
* @param {string} query SQL query
* @return {void}
*/
Sql.autoSave = function (query) {
Sql.autoSave = function (query): void {
if (query) {
var key = Sql.getAutoSavedKey();
if (isStorageSupported('localStorage')) {
@ -68,9 +67,8 @@ Sql.autoSave = function (query) {
* @param {string} db database name
* @param {string} table table name
* @param {string} query SQL query
* @return {void}
*/
Sql.showThisQuery = function (db, table, query) {
Sql.showThisQuery = function (db, table, query): void {
var showThisQueryObject = {
'db': db,
'table': table,
@ -118,9 +116,8 @@ Sql.setShowThisQuery = function () {
* Saves SQL query with sort in local storage or cookie
*
* @param {string} query SQL query
* @return {void}
*/
Sql.autoSaveWithSort = function (query) {
Sql.autoSaveWithSort = function (query): void {
if (query) {
if (isStorageSupported('localStorage')) {
window.localStorage.setItem('autoSavedSqlSort', query);
@ -132,10 +129,8 @@ Sql.autoSaveWithSort = function (query) {
/**
* Clear saved SQL query with sort in local storage or cookie
*
* @return {void}
*/
Sql.clearAutoSavedSort = function () {
Sql.clearAutoSavedSort = function (): void {
if (isStorageSupported('localStorage')) {
window.localStorage.removeItem('autoSavedSqlSort');
} else {
@ -201,10 +196,8 @@ const onlyOnceElements = [];
/**
* Handles 'Simulate query' button on SQL query box.
*
* @return {void}
*/
const handleSimulateQueryButton = function () {
const handleSimulateQueryButton = function (): void {
const updateRegExp = new RegExp('^\\s*UPDATE\\s+((`[^`]+`)|([A-Za-z0-9_$]+))\\s+SET\\s', 'i');
const deleteRegExp = new RegExp('^\\s*DELETE\\s+FROM\\s', 'i');
let query = '';
@ -252,9 +245,8 @@ const selectContent = function (element) {
/**
* Sets current value for query box.
* @param {string} query
* @return {void}
*/
const setQuery = function (query) {
const setQuery = function (query): void {
if (window.codeMirrorEditor) {
window.codeMirrorEditor.setValue(query);
window.codeMirrorEditor.focus();

View File

@ -216,9 +216,8 @@ window.verifyAfterSearchFieldChange = verifyAfterSearchFieldChange;
* Validate the an input contains multiple int values
* @param {jQuery} jqueryInput the Jquery object
* @param {boolean} returnValueIfFine the value to return if the validator passes
* @return {void}
*/
function validateMultipleIntField (jqueryInput, returnValueIfFine) {
function validateMultipleIntField (jqueryInput, returnValueIfFine): void {
// removing previous rules
jqueryInput.rules('remove');
@ -236,9 +235,8 @@ function validateMultipleIntField (jqueryInput, returnValueIfFine) {
* Validate the an input contains an int value
* @param {jQuery} jqueryInput the Jquery object
* @param {boolean} returnValueIfIsNumber the value to return if the validator passes
* @return {void}
*/
function validateIntField (jqueryInput, returnValueIfIsNumber) {
function validateIntField (jqueryInput, returnValueIfIsNumber): void {
var mini = parseInt(jqueryInput.data('min'));
var maxi = parseInt(jqueryInput.data('max'));
// removing previous rules
@ -278,9 +276,8 @@ function validateIntField (jqueryInput, returnValueIfIsNumber) {
* Validate the an input contains an float value
* @param {jQuery} jqueryInput the Jquery object
* @param {boolean} returnValueIfIsNumber the value to return if the validator passes
* @return {void}
*/
function validateFloatField (jqueryInput, returnValueIfIsNumber) {
function validateFloatField (jqueryInput, returnValueIfIsNumber): void {
// removing previous rules
jqueryInput.rules('remove');

View File

@ -29,10 +29,8 @@ AJAX.registerTeardown('table/operations.js', function () {
*
* @param {JQuery} linkObject
* @param {'TRUNCATE'|'DELETE'} action
*
* @return {void}
*/
var confirmAndPost = function (linkObject, action) {
var confirmAndPost = function (linkObject, action): void {
/**
* @var {String} question String containing the question to be asked for confirmation
*/

View File

@ -27,9 +27,8 @@ TableRelation.showHideClauses = function ($thisDropdown) {
* @param $dropdown
* @param values
* @param selectedValue
* @return {void}
*/
TableRelation.setDropdownValues = function ($dropdown, values, selectedValue) {
TableRelation.setDropdownValues = function ($dropdown, values, selectedValue): void {
$dropdown.empty();
var optionsAsString = '';
// add an empty string to the beginning for empty selection
@ -44,9 +43,8 @@ TableRelation.setDropdownValues = function ($dropdown, values, selectedValue) {
* Retrieves and populates dropdowns to the left based on the selected value
*
* @param $dropdown the dropdown whose value got changed
* @return {void}
*/
TableRelation.getDropdownValues = function ($dropdown) {
TableRelation.getDropdownValues = function ($dropdown): void {
var foreignDb = null;
var foreignTable = null;
var $databaseDd;

View File

@ -28,10 +28,8 @@ const base64ToUint8Array = string => {
/**
* @param {JQuery<HTMLElement>} $input
*
* @return {void}
*/
const handleCreation = $input => {
const handleCreation = ($input): void => {
const $form = $input.parents('form');
$form.find('input[type=submit]').hide();
@ -71,10 +69,8 @@ const handleCreation = $input => {
/**
* @param {JQuery<HTMLElement>} $input
*
* @return {void}
*/
const handleRequest = $input => {
const handleRequest = ($input): void => {
const $form = $input.parents('form');
$form.find('input[type=submit]').hide();