Rename import.js variables to use camel case
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
5f65bca639
commit
26be62d063
16
js/import.js
16
js/import.js
@ -13,9 +13,9 @@ function changePluginOpts () {
|
||||
$('#format_specific_opts').find('div.format_specific_options').each(function () {
|
||||
$(this).hide();
|
||||
});
|
||||
var selected_plugin_name = $('#plugins').find('option:selected').val();
|
||||
$('#' + selected_plugin_name + '_options').fadeIn('slow');
|
||||
if (selected_plugin_name === 'csv') {
|
||||
var selectedPluginName = $('#plugins').find('option:selected').val();
|
||||
$('#' + selectedPluginName + '_options').fadeIn('slow');
|
||||
if (selectedPluginName === 'csv') {
|
||||
$('#import_notification').text(Messages.strImportCSV);
|
||||
} else {
|
||||
$('#import_notification').text('');
|
||||
@ -27,16 +27,16 @@ function changePluginOpts () {
|
||||
* in the plugin dropdown list according to the format of the selected file
|
||||
*/
|
||||
function matchFile (fname) {
|
||||
var fname_array = fname.toLowerCase().split('.');
|
||||
var len = fname_array.length;
|
||||
var fnameArray = fname.toLowerCase().split('.');
|
||||
var len = fnameArray.length;
|
||||
if (len !== 0) {
|
||||
var extension = fname_array[len - 1];
|
||||
var extension = fnameArray[len - 1];
|
||||
if (extension === 'gz' || extension === 'bz2' || extension === 'zip') {
|
||||
len--;
|
||||
}
|
||||
// Only toggle if the format of the file can be imported
|
||||
if ($('select[name=\'format\'] option').filterByValue(fname_array[len - 1]).length === 1) {
|
||||
$('select[name=\'format\'] option').filterByValue(fname_array[len - 1]).prop('selected', true);
|
||||
if ($('select[name=\'format\'] option').filterByValue(fnameArray[len - 1]).length === 1) {
|
||||
$('select[name=\'format\'] option').filterByValue(fnameArray[len - 1]).prop('selected', true);
|
||||
changePluginOpts();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user