Compare commits
No commits in common. "3d1624532a57c7c74f1db010850253b7004e7fee" and "3f804a388a0ba52ca065836cbc84855a6736f404" have entirely different histories.
3d1624532a
...
3f804a388a
|
@ -375,7 +375,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "imgurx"
|
name = "imgurx"
|
||||||
version = "0.3.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quick-xml",
|
"quick-xml",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "imgurx"
|
name = "imgurx"
|
||||||
version = "0.3.0"
|
version = "0.2.0"
|
||||||
authors = ["blank X <theblankx@protonmail.com>"]
|
authors = ["blank X <theblankx@protonmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,6 @@ async fn async_main(port: u16) {
|
||||||
let album_path = warp::path!("a" / String)
|
let album_path = warp::path!("a" / String)
|
||||||
.and(client.clone())
|
.and(client.clone())
|
||||||
.and_then(handle_album);
|
.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 media_path = warp::path!(String).and(client).and_then(handle_media);
|
||||||
let root_handler = warp::path::end().map(|| warp::reply::html(
|
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"))
|
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(
|
let routes = warp::filters::method::get().and(
|
||||||
album_path
|
album_path
|
||||||
.or(gallery_path)
|
|
||||||
.or(index_handler)
|
.or(index_handler)
|
||||||
.or(media_path)
|
.or(media_path)
|
||||||
.or(root_handler)
|
.or(root_handler)
|
||||||
|
|
|
@ -69,7 +69,7 @@ pub fn generate_html(album: Result<Album, Error>) -> (u16, Vec<u8>) {
|
||||||
let elem = BytesStart::owned(b"style".to_vec(), 5);
|
let elem = BytesStart::owned(b"style".to_vec(), 5);
|
||||||
writer.write_event(Event::Start(elem)).unwrap();
|
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();
|
writer.write_event(Event::Text(elem)).unwrap();
|
||||||
|
|
||||||
let elem = BytesEnd::owned(b"style".to_vec());
|
let elem = BytesEnd::owned(b"style".to_vec());
|
||||||
|
|
Loading…
Reference in New Issue