mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-15 03:36:33 +03:00
Refactor exportToCSV js function
This commit is contained in:
parent
981d332610
commit
392cab1b1c
@ -237,15 +237,13 @@ function exportToCSV() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Replace line breaks with spaces
|
||||
query = query.replace(/\n/g, " ");
|
||||
setCurrentTab("table_query");
|
||||
|
||||
query = window.encodeURI(query)
|
||||
// Replace line breaks with spaces and properly encode query
|
||||
query = window.encodeURI(query.replace(/\n/g, " "));
|
||||
|
||||
var url = "http://" + window.location.host + "/query?format=csv&query=" + query;
|
||||
var win = window.open(url, '_blank');
|
||||
|
||||
setCurrentTab("table_query");
|
||||
win.focus();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user