Compare commits

..

No commits in common. "3d1624532a57c7c74f1db010850253b7004e7fee" and "3f804a388a0ba52ca065836cbc84855a6736f404" have entirely different histories.

4 changed files with 3 additions and 7 deletions

2
Cargo.lock generated
View File

@ -375,7 +375,7 @@ dependencies = [
[[package]]
name = "imgurx"
version = "0.3.0"
version = "0.2.0"
dependencies = [
"quick-xml",
"reqwest",

View File

@ -1,6 +1,6 @@
[package]
name = "imgurx"
version = "0.3.0"
version = "0.2.0"
authors = ["blank X <theblankx@protonmail.com>"]
edition = "2018"

View File

@ -30,9 +30,6 @@ async fn async_main(port: u16) {
let album_path = warp::path!("a" / String)
.and(client.clone())
.and_then(handle_album);
let gallery_path = warp::path!("gallery" / String)
.and(client.clone())
.and_then(handle_album);
let media_path = warp::path!(String).and(client).and_then(handle_media);
let root_handler = warp::path::end().map(|| warp::reply::html(
format!("<html><head><title>ImgurX v{0}</title><style>body {{ background-color: black; color: black; text-align: center; }}\ndiv {{ border: 1px solid #008; background: #eef; padding: 0.5em 1em 0.5em 1em; }}</style></head><body><div><b><a href=\"https://gitlab.com/blankX/imgurx\" style=\"text-decoration: none;\">ImgurX v{0}</a></b><br>An alternative JS-less Imgur frontend</div></body></html>", env!("CARGO_PKG_VERSION"))
@ -44,7 +41,6 @@ async fn async_main(port: u16) {
));
let routes = warp::filters::method::get().and(
album_path
.or(gallery_path)
.or(index_handler)
.or(media_path)
.or(root_handler)

View File

@ -69,7 +69,7 @@ pub fn generate_html(album: Result<Album, Error>) -> (u16, Vec<u8>) {
let elem = BytesStart::owned(b"style".to_vec(), 5);
writer.write_event(Event::Start(elem)).unwrap();
let elem = BytesText::from_plain_str("body { background-color: black; color: white; text-align: center; }\ndiv { border: 1px solid #fcc; background: #fee; padding: 0.5em 1em 0.5em 1em; color: black; }\nimg, video { max-width: 100%; height: auto; object-fit: contain; }");
let elem = BytesText::from_plain_str("body { background-color: black; color: white; text-align: center; }\ndiv { border: 1px solid #fcc; background: #fee; padding: 0.5em 1em 0.5em 1em; color: black; }");
writer.write_event(Event::Text(elem)).unwrap();
let elem = BytesEnd::owned(b"style".to_vec());