File Load Dialog Updates

This commit is contained in:
ebolam
2022-08-31 13:06:56 -04:00
parent b9d64f3d7d
commit 8c769a9f77
2 changed files with 8 additions and 4 deletions

View File

@@ -7237,7 +7237,7 @@ def UI_2_load_story_list(data):
file_popup("Select Story to Load", "./stories", "load_story", upload=True, jailed=True, folder_only=False, renameable=True,
deleteable=True, show_breadcrumbs=True, item_check=valid_story,
valid_only=True, hide_extention=True, extra_parameter_function=get_story_length,
column_names=['Story Name', 'Action Count'],
column_names=['Story Name', 'Action Count'], show_filename=False,
column_widths=['auto', '100px'],
sort="Modified", desc=True)
@@ -7246,10 +7246,11 @@ def get_story_length(item_full_path, item, valid_selection):
return [""]
with open(item_full_path, "r") as f:
js = json.load(f)
title = js['story_name'] if 'story_name' in js else ".".join(item.split(".")[:-1])
if 'file_version' not in js:
return [len(js['actions'])]
return [title, len(js['actions'])]
if js['file_version'] == 1:
return [len(js['actions'])]
return [title, len(js['actions'])]
return [0 if js['actions']['action_count'] == -1 else js['actions']['action_count'] ]

View File

@@ -634,7 +634,7 @@ function load_popup(data) {
}
function popup_items(data) {
//console.log(data);
console.log(data);
var popup_list = document.getElementById('popup_list');
//first, let's clear out our existing data
while (popup_list.firstChild) {
@@ -647,6 +647,9 @@ function popup_items(data) {
for (i=0; i < data.column_widths.length; i++) {
style = style + " p"+i;
}
if (data.show_filename) {
style = style + " p"+i;
}
style = style + '"; grid-template-columns: 50px';
for (column_width of data.column_widths) {
style = style + " "+column_width;