Kaynağa Gözat

Merge pull request #85 from Vindexus/save-filename

Added a prompt for filename when downloading.
Robert Autenrieth 8 yıl önce
ebeveyn
işleme
55f3e7e4ab
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6
    1
      generator/js/ui.js

+ 6
- 1
generator/js/ui.js Dosyayı Görüntüle

@@ -162,11 +162,16 @@ function ui_save_file() {
162 162
 
163 163
     var a = $("#file-save-link")[0];
164 164
     a.href = url;
165
-    a.download = "rpg_cards.json";
165
+    a.download = prompt("Filename: (blank for default)", ui_save_file.filename)
166
+    if(!a.download || a.download == 'null') {
167
+        return
168
+    }
169
+    ui_save_file.filename = a.download
166 170
     a.click();
167 171
 
168 172
     setTimeout(function () { URL.revokeObjectURL(url); }, 500);
169 173
 }
174
+ui_save_file.filename = 'rpg_cards.json'
170 175
 
171 176
 function ui_update_selected_card() {
172 177
     var card = ui_selected_card();

Loading…
İptal
Kaydet