Fix for user script popup

This commit is contained in:
ebolam
2022-10-27 12:01:35 -04:00
parent 147b9be9e5
commit e7744e2272
2 changed files with 16 additions and 16 deletions

View File

@@ -8788,19 +8788,19 @@ def valid_userscripts_to_unload(file):
def get_userscripts_desc(item_full_path, item, valid_selection):
if not valid_selection:
return [None, None]
ob = ["", ""]
ob = [item, "", ""]
description = []
multiline = False
with open(item_full_path) as f:
ob[0] = f.readline().strip().replace("\033", "")
if ob[0][:2] != "--":
ob[0] = file
ob[1] = f.readline().strip().replace("\033", "")
if ob[1][:2] != "--":
ob[1] = file
else:
ob[0] = ob[0][2:]
if ob[0][:2] == "[[":
ob[0] = ob[0][2:]
ob[1] = ob[1][2:]
if ob[1][:2] == "[[":
ob[1] = ob[1][2:]
multiline = True
ob[0] = ob[0].lstrip("-").strip()
ob[1] = ob[1].lstrip("-").strip()
for line in f:
line = line.strip().replace("\033", "")
if multiline:
@@ -8820,9 +8820,9 @@ def get_userscripts_desc(item_full_path, item, valid_selection):
multiline = True
line = line[2:]
description.append(line.strip())
ob[1] = "\n".join(description)
if len(ob[1]) > 250:
ob[1] = ob[1][:247] + "..."
ob[2] = "\n".join(description)
if len(ob[2]) > 250:
ob[2] = ob[2][:247] + "..."
return ob
#==================================================================#

View File

@@ -969,7 +969,7 @@ function redrawPopup() {
let gridIndex = 0;
if (row.showFilename) {
let popup_item = document.createElement("span");
popup_item.style = `grid-area: p${gridIndex};`;
popup_item.style = `overflow-x: hidden; grid-area: p${gridIndex};`;
gridIndex += 1;
popup_item.id = row.path;
@@ -1006,7 +1006,7 @@ function redrawPopup() {
const dataValue = row.data[columnName];
let td = document.createElement("span");
td.style = `grid-area: p${gridIndex};`;
td.style = `overflow-x: hidden; grid-area: p${gridIndex};`;
gridIndex += 1;
dataIndex++;
@@ -1151,7 +1151,7 @@ function popup_items(data) {
if (data.show_filename) {
td = document.createElement("span");
td.textContent = "File Name";
td.style = "grid-area: p"+i+";";
td.style = "overflow-x: hidden; grid-area: p"+i+";";
i+=1;
tr.append(td)
}
@@ -1167,13 +1167,13 @@ function popup_items(data) {
});
}(columnName));
container.classList.add("table-header-container")
container.style = `grid-area: p${i};`;
container.style = 'overflow-x: hidden; grid-area: p${i};';
td.classList.add("table-header-label");
td.textContent = columnName;
// TODO: Better unsorted icon
icon.id = `sort-icon-${columnName.toLowerCase().replaceAll(" ", "-")}`;
icon.id = 'sort-icon-${columnName.toLowerCase().replaceAll(" ", "-")}';
icon.innerText = "filter_list";
icon.classList.add("material-icons-outlined");
icon.classList.add("table-header-sort-icon");