Compare commits

2 Commits

Author SHA1 Message Date
806ee9edd2 Add Git file 2026-01-15 23:12:43 +13:00
862f562a83 Some small improvements
3 suggested improvements. - Ignore all local dev files. - Support resizing. - If uploading a single image then go and view it directly.
2026-01-15 23:12:23 +13:00
3 changed files with 25 additions and 13 deletions

7
.gitignore vendored
View File

@@ -1,5 +1,10 @@
cmd/contented/contented # Ignore all files when running locally
cmd/contented/*
# But add back the actual main file
!cmd/contented/main.go
cmd/contented-multi/contented-multi cmd/contented-multi/contented-multi
build/ build/
_dist/ _dist/
# Ignore any built files if they ever turn up
contented.db contented.db
contented.exe

View File

@@ -56,7 +56,11 @@ $.get("/about", function(ret) {
// Load upload widget // Load upload widget
contented.init("#surrogate-area", function(items) { contented.init("#surrogate-area", function(items) {
window.location.href = contented.getMultiPreviewURL(items); if (items.length == 1) {
window.location.href = contented.getDownloadURL(items[0]);
} else {
window.location.href = contented.getMultiPreviewURL(items);
}
}); });
</script> </script>
</body> </body>

View File

@@ -273,17 +273,20 @@
var $element = $(element); var $element = $(element);
var offset = $element.offset(); var offset = $element.offset();
$f.css({ onresize = (_) => {
'position': 'absolute', $f.css({
'left': offset.left + "px", 'position': 'absolute',
'top': offset.top + "px", 'left': offset.left + "px",
'width': $element.width() + "px", 'top': offset.top + "px",
'min-width': $element.width() + "px", 'width': $element.width() + "px",
'max-width': $element.width() + "px", 'min-width': $element.width() + "px",
'height': $element.height() + "px", 'max-width': $element.width() + "px",
'min-height': $element.height() + "px", 'height': $element.height() + "px",
'max-height': $element.height() + "px" 'min-height': $element.height() + "px",
}); 'max-height': $element.height() + "px"
});
};
onresize();
// Drag and drop support // Drag and drop support