forked from zedeus/nitter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge squashed feature-notes zedeus#653
Signed-off-by: r3g_5z <[email protected]>
- Loading branch information
1 parent
075ab51
commit db207df
Showing
14 changed files
with
452 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
import asyncdispatch, tables, asyncfutures, options | ||
import jester, karax/vdom | ||
import ".."/[types, api] | ||
import ../views/[notes, tweet, general] | ||
import router_utils | ||
|
||
export api, notes, vdom, tweet, general, router_utils | ||
|
||
proc createNotesRouter*(cfg: Config) = | ||
router notes: | ||
get "/i/notes/@id": | ||
let article = await getGraphArticle(@"id") | ||
|
||
if article == nil: | ||
resp Http404 | ||
|
||
var tweetFutures: seq[Future[Conversation]] | ||
for e in article.entities: | ||
if e.entityType == ArticleEntityType.tweet: | ||
tweetFutures.add getTweet(e.tweetId) | ||
|
||
let convs = await tweetFutures.all | ||
|
||
var tweets = initTable[int64, Tweet]() | ||
for c in convs: | ||
if c != nil and c.tweet != nil: | ||
tweets[c.tweet.id] = c.tweet | ||
|
||
let | ||
path = getPath() | ||
prefs = cookiePrefs() | ||
note = renderNote(article, tweets, path, prefs) | ||
resp renderMain(note, request, cfg, prefs, titleText=article.title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
@import 'inputs'; | ||
@import 'timeline'; | ||
@import 'search'; | ||
@import 'note'; | ||
|
||
body { | ||
// colors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
.note { | ||
width: 600px; | ||
margin: 0 auto; | ||
background-color: var(--bg_panel); | ||
font-family: sans-serif; | ||
|
||
img.cover { | ||
margin: 0; | ||
width: 100%; | ||
} | ||
|
||
article { | ||
padding: 20px; | ||
|
||
&>h1 { | ||
display: inherit; | ||
font-size: 2.5rem; | ||
margin: 30px 0; | ||
} | ||
|
||
&>p, | ||
li { | ||
font-size: 18px; | ||
} | ||
|
||
&>p { | ||
line-height: 1.5em; | ||
margin: 30px 0; | ||
word-wrap: break-word; | ||
white-space: break-spaces; | ||
} | ||
|
||
&>span.image { | ||
text-align: center; | ||
width: 100%; | ||
|
||
img, | ||
video { | ||
max-width: 100%; | ||
border-radius: 20px; | ||
margin: 0 auto; | ||
} | ||
} | ||
|
||
img.twemoji { | ||
width: 18px; | ||
height: 18px; | ||
} | ||
|
||
&>ul>li, | ||
&>ol>li { | ||
line-height: 2em; | ||
} | ||
|
||
&>iframe { | ||
width: 100%; | ||
height: 400px; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.