mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
load bundled resources into web reader
This commit is contained in:
parent
38fdd7250c
commit
de2e543965
35 changed files with 27 additions and 19 deletions
BIN
android/Omnivore/app/src/main/assets/CrimsonText-Bold.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/CrimsonText-Bold.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/CrimsonText-Italic.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/CrimsonText-Italic.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/CrimsonText-Regular.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/CrimsonText-Regular.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Inter-Black-900.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Inter-Black-900.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Inter-Bold-700.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Inter-Bold-700.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Inter-ExtraBold-800.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Inter-ExtraBold-800.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Inter-ExtraLight-200.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Inter-ExtraLight-200.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Inter-Light-300.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Inter-Light-300.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Inter-Medium-500.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Inter-Medium-500.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Inter-Regular-400.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Inter-Regular-400.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Inter-SemiBold-600.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Inter-SemiBold-600.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Inter-Thin.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Inter-Thin.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Lora-Bold.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Lora-Bold.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Lora-Italic.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Lora-Italic.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Lora-Regular.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Lora-Regular.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Merriweather-Bold.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Merriweather-Bold.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Merriweather-Italic.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Merriweather-Italic.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Merriweather-Regular.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Merriweather-Regular.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/OpenDyslexicAlta-Bold.otf
Normal file
BIN
android/Omnivore/app/src/main/assets/OpenDyslexicAlta-Bold.otf
Normal file
Binary file not shown.
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/OpenDyslexicAlta-Italic.otf
Normal file
BIN
android/Omnivore/app/src/main/assets/OpenDyslexicAlta-Italic.otf
Normal file
Binary file not shown.
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/OpenSans-Bold.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/OpenSans-Bold.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/OpenSans-Italic.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/OpenSans-Italic.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/OpenSans-Regular.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/OpenSans-Regular.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Roboto-Bold.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Roboto-Bold.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Roboto-Italic.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Roboto-Italic.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/Roboto-Regular.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/Roboto-Regular.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/SFMonoRegular.otf
Normal file
BIN
android/Omnivore/app/src/main/assets/SFMonoRegular.otf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/SourceSerifPro-Bold.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/SourceSerifPro-Bold.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/SourceSerifPro-Italic.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/SourceSerifPro-Italic.ttf
Normal file
Binary file not shown.
BIN
android/Omnivore/app/src/main/assets/SourceSerifPro-Regular.ttf
Normal file
BIN
android/Omnivore/app/src/main/assets/SourceSerifPro-Regular.ttf
Normal file
Binary file not shown.
|
|
@ -30,6 +30,6 @@ public data class LinkedItem(
|
|||
}
|
||||
|
||||
fun labelsJSONString(): String {
|
||||
return ""
|
||||
return "[]"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,6 @@
|
|||
package app.omnivore.omnivore.ui.reader
|
||||
|
||||
import android.util.Log
|
||||
import app.omnivore.omnivore.models.LinkedItem
|
||||
|
||||
enum class WebFont(val displayText: String, val rawValue: String) {
|
||||
|
|
@ -42,11 +43,11 @@ data class WebReaderContent(
|
|||
) {
|
||||
fun styledContent(): String {
|
||||
// TODO: Kotlinize these three values (pasted from Swift)
|
||||
val savedAt = "new Date((item.unwrappedSavedAt.timeIntervalSince1970 * 1000)).toISOString()"
|
||||
val createdAt = "new Date((item.unwrappedCreatedAt.timeIntervalSince1970 * 1000)).toISOString()"
|
||||
val publishedAt = if (item.publishDate != null) "new Date((item.publishDate!.timeIntervalSince1970 * 1000)).toISOString()" else "undefined"
|
||||
val savedAt = "new Date(1662571290735.0).toISOString()"
|
||||
val createdAt = "new Date().toISOString()"
|
||||
val publishedAt = "new Date().toISOString()" //if (item.publishDate != null) "new Date((item.publishDate!.timeIntervalSince1970 * 1000)).toISOString()" else "undefined"
|
||||
|
||||
return """
|
||||
val rrrr = """
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
|
@ -59,7 +60,7 @@ data class WebReaderContent(
|
|||
<body>
|
||||
<div id="root" />
|
||||
<div>HIIIIII</div>
|
||||
<div id='_omnivore-htmlContent' style="display: none;">
|
||||
<div id='_omnivore-htmlContent'>
|
||||
${articleContent.htmlContent}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
@ -74,9 +75,9 @@ data class WebReaderContent(
|
|||
id: "${item.id}",
|
||||
linkId: "${item.id}",
|
||||
slug: "${item.slug}",
|
||||
createdAt: $createdAt,
|
||||
savedAt: $savedAt,
|
||||
publishedAt: $publishedAt,
|
||||
createdAt: new Date(1662571290735.0).toISOString(),
|
||||
savedAt: new Date(1662571290981.0).toISOString(),
|
||||
publishedAt: new Date(1662454816000.0).toISOString(),
|
||||
url: `${item.pageURLString}`,
|
||||
title: `${articleContent.title.replace("`", "\\`")}`,
|
||||
content: document.getElementById('_omnivore-htmlContent').innerHTML,
|
||||
|
|
@ -84,8 +85,8 @@ data class WebReaderContent(
|
|||
contentReader: "WEB",
|
||||
readingProgressPercent: ${item.readingProgress},
|
||||
readingProgressAnchorIndex: ${item.readingProgressAnchor},
|
||||
labels: ${item.labelsJSONString()},
|
||||
highlights: ${articleContent.highlightsJSONString},
|
||||
labels: "[]",
|
||||
highlights: "[]",
|
||||
}
|
||||
|
||||
window.fontSize = $textFontSize
|
||||
|
|
@ -102,5 +103,9 @@ data class WebReaderContent(
|
|||
</body>
|
||||
</html>
|
||||
""".trimIndent()
|
||||
|
||||
Log.d("Loggo", rrrr)
|
||||
|
||||
return rrrr
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue