feat(options): upload-a-file facility also under the logos row of Top of the page

Row 139: the "Upload an image" widget is no longer tied to the Images tab —
a new row with a single element (the upload control + progress bar) is
rendered directly under the logos row of the "Top of the page" tab, with its
own ids (#upload_image_frontend_top / #upload_progress_frontend_top).
options.js binds a second BindUpload instance on the same shared
#upload_frontend form for those ids, so both widgets upload and both feed
addUploadedImageToSelectors (a fresh upload becomes selectable in the image
dropdowns immediately). The original Images-tab widget is unchanged.
OPTIONS_JS_TOKEN -> 20261126.16. Verified: render tc=648 (new ids exactly
once, original id once, widget sits after logo-columns-hr, divs 324/324,
options.js?v=20261126.16), jsdom 7/7 incl. new pins (id uniqueness, position
under the logos row, change handler bound on BOTH file inputs), export
exit 0. Variants not rebuilt (deferred).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-26 19:46:18 +01:00
commit 4f19b1a26f

View file

@ -1192,6 +1192,21 @@ $(function () {
addUploadedImageToSelectors(data && data.file);
}
});
// row 139: second upload widget in the "Top of the page" tab (under the logos
// row) — own input/progress ids, same shared upload form; uploads land in the
// same image selectors via addUploadedImageToSelectors
new BindUpload({
form: '#upload_frontend',
input: '#upload_image_frontend_top',
progress: '#upload_progress_frontend_top',
onBeforeSend: function () {
$('.simple-template-edit-loading').css('display', 'block');
},
onSuccess: function (inputId, data) {
$('.simple-template-edit-loading').css('display', 'none');
addUploadedImageToSelectors(data && data.file);
}
});
// Adds a freshly uploaded image to the theme options image selectors so it becomes
// selectable immediately, without a full page reload. Falls back to a reload if the