2023-08-05 00:15:18 -06:00
|
|
|
function toggleCss(key, css, enable) {
|
|
|
|
var style = document.getElementById(key);
|
|
|
|
if (enable && !style) {
|
|
|
|
style = document.createElement('style');
|
|
|
|
style.id = key;
|
|
|
|
style.type = 'text/css';
|
|
|
|
document.head.appendChild(style);
|
|
|
|
}
|
|
|
|
if (style && !enable) {
|
|
|
|
document.head.removeChild(style);
|
|
|
|
}
|
|
|
|
if (style) {
|
|
|
|
style.innerHTML == '';
|
|
|
|
style.appendChild(document.createTextNode(css));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-20 22:36:07 -07:00
|
|
|
function setupExtraNetworksForTab(tabname) {
|
|
|
|
gradioApp().querySelector('#' + tabname + '_extra_tabs').classList.add('extra-networks');
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-21 07:20:24 -07:00
|
|
|
var tabs = gradioApp().querySelector('#' + tabname + '_extra_tabs > div');
|
2023-07-16 02:38:59 -06:00
|
|
|
var searchDiv = gradioApp().getElementById(tabname + '_extra_search');
|
|
|
|
var search = searchDiv.querySelector('textarea');
|
2023-06-01 22:08:45 -06:00
|
|
|
var sort = gradioApp().getElementById(tabname + '_extra_sort');
|
|
|
|
var sortOrder = gradioApp().getElementById(tabname + '_extra_sortorder');
|
2023-01-21 07:20:24 -07:00
|
|
|
var refresh = gradioApp().getElementById(tabname + '_extra_refresh');
|
2023-08-05 00:15:18 -06:00
|
|
|
var showDirsDiv = gradioApp().getElementById(tabname + '_extra_show_dirs');
|
|
|
|
var showDirs = gradioApp().querySelector('#' + tabname + '_extra_show_dirs input');
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-06-01 22:12:08 -06:00
|
|
|
sort.dataset.sortkey = 'sortDefault';
|
2023-07-16 02:38:59 -06:00
|
|
|
tabs.appendChild(searchDiv);
|
2023-06-01 22:08:45 -06:00
|
|
|
tabs.appendChild(sort);
|
|
|
|
tabs.appendChild(sortOrder);
|
2023-01-21 07:20:24 -07:00
|
|
|
tabs.appendChild(refresh);
|
2023-08-05 00:15:18 -06:00
|
|
|
tabs.appendChild(showDirsDiv);
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-05-08 02:33:45 -06:00
|
|
|
var applyFilter = function() {
|
2023-04-30 13:08:52 -06:00
|
|
|
var searchTerm = search.value.toLowerCase();
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-21 07:20:24 -07:00
|
|
|
gradioApp().querySelectorAll('#' + tabname + '_extra_tabs div.card').forEach(function(elem) {
|
2023-05-08 02:33:45 -06:00
|
|
|
var searchOnly = elem.querySelector('.search_only');
|
2023-04-30 13:08:52 -06:00
|
|
|
var text = elem.querySelector('.name').textContent.toLowerCase() + " " + elem.querySelector('.search_term').textContent.toLowerCase();
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-05-08 02:33:45 -06:00
|
|
|
var visible = text.indexOf(searchTerm) != -1;
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-05-08 02:33:45 -06:00
|
|
|
if (searchOnly && searchTerm.length < 4) {
|
|
|
|
visible = false;
|
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-05-08 02:33:45 -06:00
|
|
|
elem.style.display = visible ? "" : "none";
|
2023-01-21 07:20:24 -07:00
|
|
|
});
|
2023-05-08 02:33:45 -06:00
|
|
|
};
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-06-01 22:08:45 -06:00
|
|
|
var applySort = function() {
|
|
|
|
var reverse = sortOrder.classList.contains("sortReverse");
|
2023-06-01 22:12:08 -06:00
|
|
|
var sortKey = sort.querySelector("input").value.toLowerCase().replace("sort", "").replaceAll(" ", "_").replace(/_+$/, "").trim();
|
|
|
|
sortKey = sortKey ? "sort" + sortKey.charAt(0).toUpperCase() + sortKey.slice(1) : "";
|
|
|
|
var sortKeyStore = sortKey ? sortKey + (reverse ? "Reverse" : "") : "";
|
|
|
|
if (!sortKey || sortKeyStore == sort.dataset.sortkey) {
|
2023-06-01 22:08:45 -06:00
|
|
|
return;
|
2023-06-01 22:12:08 -06:00
|
|
|
}
|
2023-06-01 22:08:45 -06:00
|
|
|
|
|
|
|
sort.dataset.sortkey = sortKeyStore;
|
|
|
|
|
2023-06-01 22:12:08 -06:00
|
|
|
var cards = gradioApp().querySelectorAll('#' + tabname + '_extra_tabs div.card');
|
2023-06-01 22:08:45 -06:00
|
|
|
cards.forEach(function(card) {
|
|
|
|
card.originalParentElement = card.parentElement;
|
2023-06-01 22:12:08 -06:00
|
|
|
});
|
2023-06-01 22:08:45 -06:00
|
|
|
var sortedCards = Array.from(cards);
|
|
|
|
sortedCards.sort(function(cardA, cardB) {
|
|
|
|
var a = cardA.dataset[sortKey];
|
|
|
|
var b = cardB.dataset[sortKey];
|
2023-06-01 22:12:08 -06:00
|
|
|
if (!isNaN(a) && !isNaN(b)) {
|
2023-06-01 22:08:45 -06:00
|
|
|
return parseInt(a) - parseInt(b);
|
2023-06-01 22:12:08 -06:00
|
|
|
}
|
2023-06-01 22:08:45 -06:00
|
|
|
|
|
|
|
return (a < b ? -1 : (a > b ? 1 : 0));
|
2023-06-01 22:12:08 -06:00
|
|
|
});
|
|
|
|
if (reverse) {
|
2023-06-01 22:08:45 -06:00
|
|
|
sortedCards.reverse();
|
2023-06-01 22:12:08 -06:00
|
|
|
}
|
2023-06-01 22:08:45 -06:00
|
|
|
cards.forEach(function(card) {
|
|
|
|
card.remove();
|
2023-06-01 22:12:08 -06:00
|
|
|
});
|
2023-06-01 22:08:45 -06:00
|
|
|
sortedCards.forEach(function(card) {
|
|
|
|
card.originalParentElement.appendChild(card);
|
2023-06-01 22:12:08 -06:00
|
|
|
});
|
|
|
|
};
|
2023-06-01 22:08:45 -06:00
|
|
|
|
2023-05-08 02:33:45 -06:00
|
|
|
search.addEventListener("input", applyFilter);
|
|
|
|
applyFilter();
|
2023-06-01 22:08:45 -06:00
|
|
|
["change", "blur", "click"].forEach(function(evt) {
|
|
|
|
sort.querySelector("input").addEventListener(evt, applySort);
|
2023-06-01 22:12:08 -06:00
|
|
|
});
|
2023-06-01 22:08:45 -06:00
|
|
|
sortOrder.addEventListener("click", function() {
|
|
|
|
sortOrder.classList.toggle("sortReverse");
|
|
|
|
applySort();
|
|
|
|
});
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-05-08 02:33:45 -06:00
|
|
|
extraNetworksApplyFilter[tabname] = applyFilter;
|
2023-08-05 00:15:18 -06:00
|
|
|
|
|
|
|
var showDirsUpdate = function() {
|
|
|
|
var css = '#' + tabname + '_extra_tabs .extra-network-subdirs { display: none; }';
|
|
|
|
toggleCss(tabname + '_extra_show_dirs_style', css, !showDirs.checked);
|
|
|
|
localSet('extra-networks-show-dirs', showDirs.checked ? 1 : 0);
|
|
|
|
};
|
|
|
|
showDirs.checked = localGet('extra-networks-show-dirs', 1) == 1;
|
|
|
|
showDirs.addEventListener("change", showDirsUpdate);
|
|
|
|
showDirsUpdate();
|
2023-05-08 02:33:45 -06:00
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-05-08 02:33:45 -06:00
|
|
|
function applyExtraNetworkFilter(tabname) {
|
|
|
|
setTimeout(extraNetworksApplyFilter[tabname], 1);
|
2023-01-20 22:36:07 -07:00
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-05-08 02:33:45 -06:00
|
|
|
var extraNetworksApplyFilter = {};
|
2023-01-20 23:48:38 -07:00
|
|
|
var activePromptTextarea = {};
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-20 22:36:07 -07:00
|
|
|
function setupExtraNetworks() {
|
|
|
|
setupExtraNetworksForTab('txt2img');
|
|
|
|
setupExtraNetworksForTab('img2img');
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-20 23:48:38 -07:00
|
|
|
function registerPrompt(tabname, id) {
|
2023-01-20 22:36:07 -07:00
|
|
|
var textarea = gradioApp().querySelector("#" + id + " > label > textarea");
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-20 23:48:38 -07:00
|
|
|
if (!activePromptTextarea[tabname]) {
|
|
|
|
activePromptTextarea[tabname] = textarea;
|
2023-01-20 22:36:07 -07:00
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-20 22:36:07 -07:00
|
|
|
textarea.addEventListener("focus", function() {
|
2023-01-20 23:48:38 -07:00
|
|
|
activePromptTextarea[tabname] = textarea;
|
2023-01-20 22:36:07 -07:00
|
|
|
});
|
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-20 23:48:38 -07:00
|
|
|
registerPrompt('txt2img', 'txt2img_prompt');
|
|
|
|
registerPrompt('txt2img', 'txt2img_neg_prompt');
|
|
|
|
registerPrompt('img2img', 'img2img_prompt');
|
|
|
|
registerPrompt('img2img', 'img2img_neg_prompt');
|
2023-01-20 22:36:07 -07:00
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-20 22:36:07 -07:00
|
|
|
onUiLoaded(setupExtraNetworks);
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-07-15 15:56:53 -06:00
|
|
|
var re_extranet = /<([^:]+:[^:]+):[\d.]+>(.*)/;
|
2023-05-18 00:59:10 -06:00
|
|
|
var re_extranet_g = /\s+<([^:]+:[^:]+):[\d.]+>/g;
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-28 13:31:48 -07:00
|
|
|
function tryToRemoveExtraNetworkFromPrompt(textarea, text) {
|
|
|
|
var m = text.match(re_extranet);
|
|
|
|
var replaced = false;
|
2023-05-16 20:20:11 -06:00
|
|
|
var newTextareaText;
|
|
|
|
if (m) {
|
2023-07-15 15:56:53 -06:00
|
|
|
var extraTextAfterNet = m[2];
|
2023-05-16 20:20:11 -06:00
|
|
|
var partToSearch = m[1];
|
2023-07-15 15:56:53 -06:00
|
|
|
var foundAtPosition = -1;
|
|
|
|
newTextareaText = textarea.value.replaceAll(re_extranet_g, function(found, net, pos) {
|
2023-05-16 20:20:11 -06:00
|
|
|
m = found.match(re_extranet);
|
|
|
|
if (m[1] == partToSearch) {
|
|
|
|
replaced = true;
|
2023-07-15 15:56:53 -06:00
|
|
|
foundAtPosition = pos;
|
2023-05-16 20:20:11 -06:00
|
|
|
return "";
|
|
|
|
}
|
|
|
|
return found;
|
|
|
|
});
|
2023-07-15 15:56:53 -06:00
|
|
|
|
|
|
|
if (foundAtPosition >= 0 && newTextareaText.substr(foundAtPosition, extraTextAfterNet.length) == extraTextAfterNet) {
|
|
|
|
newTextareaText = newTextareaText.substr(0, foundAtPosition) + newTextareaText.substr(foundAtPosition + extraTextAfterNet.length);
|
|
|
|
}
|
2023-05-16 20:20:11 -06:00
|
|
|
} else {
|
|
|
|
newTextareaText = textarea.value.replaceAll(new RegExp(text, "g"), function(found) {
|
|
|
|
if (found == text) {
|
|
|
|
replaced = true;
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
return found;
|
|
|
|
});
|
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-28 13:31:48 -07:00
|
|
|
if (replaced) {
|
|
|
|
textarea.value = newTextareaText;
|
|
|
|
return true;
|
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-28 13:31:48 -07:00
|
|
|
return false;
|
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-20 23:48:38 -07:00
|
|
|
function cardClicked(tabname, textToAdd, allowNegativePrompt) {
|
|
|
|
var textarea = allowNegativePrompt ? activePromptTextarea[tabname] : gradioApp().querySelector("#" + tabname + "_prompt > label > textarea");
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-28 13:31:48 -07:00
|
|
|
if (!tryToRemoveExtraNetworkFromPrompt(textarea, textToAdd)) {
|
2023-03-11 04:18:18 -07:00
|
|
|
textarea.value = textarea.value + opts.extra_networks_add_text_separator + textToAdd;
|
2023-01-28 13:31:48 -07:00
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-20 22:36:07 -07:00
|
|
|
updateInput(textarea);
|
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-20 22:36:07 -07:00
|
|
|
function saveCardPreview(event, tabname, filename) {
|
2023-01-20 23:48:38 -07:00
|
|
|
var textarea = gradioApp().querySelector("#" + tabname + '_preview_filename > label > textarea');
|
|
|
|
var button = gradioApp().getElementById(tabname + '_save_preview');
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-20 22:36:07 -07:00
|
|
|
textarea.value = filename;
|
|
|
|
updateInput(textarea);
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-20 22:36:07 -07:00
|
|
|
button.click();
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-20 22:36:07 -07:00
|
|
|
event.stopPropagation();
|
|
|
|
event.preventDefault();
|
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-29 01:34:58 -07:00
|
|
|
function extraNetworksSearchButton(tabs_id, event) {
|
2023-07-17 01:15:52 -06:00
|
|
|
var searchTextarea = gradioApp().querySelector("#" + tabs_id + ' > label > textarea');
|
2023-04-30 13:08:52 -06:00
|
|
|
var button = event.target;
|
|
|
|
var text = button.classList.contains("search-all") ? "" : button.textContent.trim();
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-01-29 01:34:58 -07:00
|
|
|
searchTextarea.value = text;
|
|
|
|
updateInput(searchTextarea);
|
2023-03-14 00:10:26 -06:00
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-03-14 00:10:26 -06:00
|
|
|
var globalPopup = null;
|
|
|
|
var globalPopupInner = null;
|
2023-07-15 12:05:33 -06:00
|
|
|
function closePopup() {
|
2023-07-15 11:39:04 -06:00
|
|
|
if (!globalPopup) return;
|
|
|
|
|
|
|
|
globalPopup.style.display = "none";
|
|
|
|
}
|
2023-03-14 00:10:26 -06:00
|
|
|
function popup(contents) {
|
|
|
|
if (!globalPopup) {
|
|
|
|
globalPopup = document.createElement('div');
|
2023-07-15 11:39:04 -06:00
|
|
|
globalPopup.onclick = closePopup;
|
2023-03-14 00:10:26 -06:00
|
|
|
globalPopup.classList.add('global-popup');
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-03-14 00:10:26 -06:00
|
|
|
var close = document.createElement('div');
|
|
|
|
close.classList.add('global-popup-close');
|
2023-07-15 11:39:04 -06:00
|
|
|
close.onclick = closePopup;
|
2023-03-14 00:10:26 -06:00
|
|
|
close.title = "Close";
|
|
|
|
globalPopup.appendChild(close);
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-03-14 00:10:26 -06:00
|
|
|
globalPopupInner = document.createElement('div');
|
|
|
|
globalPopupInner.onclick = function(event) {
|
|
|
|
event.stopPropagation(); return false;
|
|
|
|
};
|
|
|
|
globalPopupInner.classList.add('global-popup-inner');
|
|
|
|
globalPopup.appendChild(globalPopupInner);
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-07-17 09:56:14 -06:00
|
|
|
gradioApp().querySelector('.main').appendChild(globalPopup);
|
2023-03-14 00:10:26 -06:00
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-03-14 00:10:26 -06:00
|
|
|
globalPopupInner.innerHTML = '';
|
|
|
|
globalPopupInner.appendChild(contents);
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-03-14 00:10:26 -06:00
|
|
|
globalPopup.style.display = "flex";
|
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-08-27 00:39:37 -06:00
|
|
|
var storedPopupIds = {};
|
|
|
|
function popupId(id) {
|
2023-08-27 01:11:14 -06:00
|
|
|
if (!storedPopupIds[id]) {
|
2023-08-27 00:39:37 -06:00
|
|
|
storedPopupIds[id] = gradioApp().getElementById(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
popup(storedPopupIds[id]);
|
|
|
|
}
|
|
|
|
|
2023-03-25 03:10:03 -06:00
|
|
|
function extraNetworksShowMetadata(text) {
|
2023-04-30 13:08:52 -06:00
|
|
|
var elem = document.createElement('pre');
|
2023-03-14 00:10:26 -06:00
|
|
|
elem.classList.add('popup-metadata');
|
|
|
|
elem.textContent = text;
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-03-14 00:10:26 -06:00
|
|
|
popup(elem);
|
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-03-25 01:11:04 -06:00
|
|
|
function requestGet(url, data, handler, errorHandler) {
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
var args = Object.keys(data).map(function(k) {
|
|
|
|
return encodeURIComponent(k) + '=' + encodeURIComponent(data[k]);
|
|
|
|
}).join('&');
|
|
|
|
xhr.open("GET", url + "?" + args, true);
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-03-25 01:11:04 -06:00
|
|
|
xhr.onreadystatechange = function() {
|
|
|
|
if (xhr.readyState === 4) {
|
|
|
|
if (xhr.status === 200) {
|
|
|
|
try {
|
|
|
|
var js = JSON.parse(xhr.responseText);
|
|
|
|
handler(js);
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error);
|
|
|
|
errorHandler();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
errorHandler();
|
2023-05-17 06:46:58 -06:00
|
|
|
}
|
2023-03-25 01:11:04 -06:00
|
|
|
}
|
|
|
|
};
|
|
|
|
var js = JSON.stringify(data);
|
|
|
|
xhr.send(js);
|
|
|
|
}
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-03-25 03:10:03 -06:00
|
|
|
function extraNetworksRequestMetadata(event, extraPage, cardName) {
|
2023-04-30 13:08:52 -06:00
|
|
|
var showError = function() {
|
|
|
|
extraNetworksShowMetadata("there was an error getting metadata");
|
|
|
|
};
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-03-25 01:11:04 -06:00
|
|
|
requestGet("./sd_extra_networks/metadata", {page: extraPage, item: cardName}, function(data) {
|
|
|
|
if (data && data.metadata) {
|
|
|
|
extraNetworksShowMetadata(data.metadata);
|
|
|
|
} else {
|
|
|
|
showError();
|
|
|
|
}
|
|
|
|
}, showError);
|
2023-05-17 06:46:58 -06:00
|
|
|
|
2023-03-25 03:10:03 -06:00
|
|
|
event.stopPropagation();
|
2023-03-25 01:11:04 -06:00
|
|
|
}
|
2023-07-15 11:39:04 -06:00
|
|
|
|
2023-07-15 12:05:33 -06:00
|
|
|
var extraPageUserMetadataEditors = {};
|
2023-07-15 11:39:04 -06:00
|
|
|
|
|
|
|
function extraNetworksEditUserMetadata(event, tabname, extraPage, cardName) {
|
|
|
|
var id = tabname + '_' + extraPage + '_edit_user_metadata';
|
|
|
|
|
2023-07-15 12:05:33 -06:00
|
|
|
var editor = extraPageUserMetadataEditors[id];
|
|
|
|
if (!editor) {
|
2023-07-15 11:39:04 -06:00
|
|
|
editor = {};
|
|
|
|
editor.page = gradioApp().getElementById(id);
|
|
|
|
editor.nameTextarea = gradioApp().querySelector("#" + id + "_name" + ' textarea');
|
|
|
|
editor.button = gradioApp().querySelector("#" + id + "_button");
|
|
|
|
extraPageUserMetadataEditors[id] = editor;
|
|
|
|
}
|
|
|
|
|
|
|
|
editor.nameTextarea.value = cardName;
|
|
|
|
updateInput(editor.nameTextarea);
|
|
|
|
|
|
|
|
editor.button.click();
|
|
|
|
|
|
|
|
popup(editor.page);
|
|
|
|
|
|
|
|
event.stopPropagation();
|
|
|
|
}
|
2023-07-15 15:56:53 -06:00
|
|
|
|
2023-07-15 23:38:23 -06:00
|
|
|
function extraNetworksRefreshSingleCard(page, tabname, name) {
|
|
|
|
requestGet("./sd_extra_networks/get-single-card", {page: page, tabname: tabname, name: name}, function(data) {
|
|
|
|
if (data && data.html) {
|
|
|
|
var card = gradioApp().querySelector('.card[data-name=' + JSON.stringify(name) + ']'); // likely using the wrong stringify function
|
|
|
|
|
|
|
|
var newDiv = document.createElement('DIV');
|
|
|
|
newDiv.innerHTML = data.html;
|
|
|
|
var newCard = newDiv.firstElementChild;
|
|
|
|
|
2023-08-14 10:27:04 -06:00
|
|
|
newCard.style.display = '';
|
2023-07-15 23:38:23 -06:00
|
|
|
card.parentElement.insertBefore(newCard, card);
|
|
|
|
card.parentElement.removeChild(card);
|
|
|
|
}
|
|
|
|
});
|
2023-07-15 15:56:53 -06:00
|
|
|
}
|