|
Lines 41-47
$(document).ready(function() {
Link Here
|
| 41 |
var filename = $(this).val(); |
41 |
var filename = $(this).val(); |
| 42 |
if ( ! /(?:\.csv|\.ods)$/.test(filename)) { |
42 |
if ( ! /(?:\.csv|\.ods)$/.test(filename)) { |
| 43 |
$(this).css("background-color","yellow"); |
43 |
$(this).css("background-color","yellow"); |
| 44 |
alert(_("Please select a CSV (.csv) or ODS (.ods) spreadsheet file.")); |
44 |
alert(__("Please select a CSV (.csv) or ODS (.ods) spreadsheet file.")); |
| 45 |
$(this).val(""); |
45 |
$(this).val(""); |
| 46 |
$(this).css("background-color","white"); |
46 |
$(this).css("background-color","white"); |
| 47 |
} |
47 |
} |
|
Lines 56-64
$(document).ready(function() {
Link Here
|
| 56 |
var id = $(this).attr('id'); |
56 |
var id = $(this).attr('id'); |
| 57 |
var obj = $('#' + id + ' input:file'); |
57 |
var obj = $('#' + id + ' input:file'); |
| 58 |
if (/(?:\.csv|\.ods)$/.test(obj.val())) { |
58 |
if (/(?:\.csv|\.ods)$/.test(obj.val())) { |
| 59 |
if (confirm(_("Do you really want to import the authority type fields and subfields? This will overwrite the current configuration. For safety reasons please use the export option to make a backup"))) { |
59 |
if (confirm(__("Do you really want to import the authority type fields and subfields? This will overwrite the current configuration. For safety reasons please use the export option to make a backup"))) { |
| 60 |
var authtypecode = $('#' + id + ' input:hidden[name=authtypecode]').val(); |
60 |
var authtypecode = $('#' + id + ' input:hidden[name=authtypecode]').val(); |
| 61 |
$('#importing_' + authtypecode).find("span").html(_("Importing to authority type: %s. Importing from file: %s").format("<strong>" + authtypecode + "</strong>", "<i>" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "</i>")); |
61 |
$('#importing_' + authtypecode).find("span").html(__("Importing to authority type: %s. Importing from file: %s").format("<strong>" + authtypecode + "</strong>", "<i>" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "</i>")); |
| 62 |
if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) { |
62 |
if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) { |
| 63 |
var timestamp = new Date().getTime(); |
63 |
var timestamp = new Date().getTime(); |
| 64 |
$('#importing_' + authtypecode).find("img").attr('src', '[% interface | html %]/[% theme | html %]/img/loading-small.gif' + '?' +timestamp); |
64 |
$('#importing_' + authtypecode).find("img").attr('src', '[% interface | html %]/[% theme | html %]/img/loading-small.gif' + '?' +timestamp); |
|
Lines 73-79
$(document).ready(function() {
Link Here
|
| 73 |
} |
73 |
} |
| 74 |
} |
74 |
} |
| 75 |
obj.css("background-color","yellow"); |
75 |
obj.css("background-color","yellow"); |
| 76 |
alert(_("Please select a CSV (.csv) or ODS (.ods) spreadsheet file.")); |
76 |
alert(__("Please select a CSV (.csv) or ODS (.ods) spreadsheet file.")); |
| 77 |
obj.val(""); |
77 |
obj.val(""); |
| 78 |
bj.css("background-color","white"); |
78 |
bj.css("background-color","white"); |
| 79 |
return false; |
79 |
return false; |