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
build/
_dist/
# Ignore any built files if they ever turn up
contented.db
contented.exe

View File

@@ -56,7 +56,11 @@ $.get("/about", function(ret) {
// Load upload widget
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>
</body>

View File

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