Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tempe-techie committed Sep 15, 2024
1 parent ca26701 commit bcbc970
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions components/chat/ChatQuote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@

<!-- post text -->
<div v-if="post.body" @click="openPostDetails">
<p class="card-text text-break" v-if="parsedText.length > postLengthLimit && !showFullText">
<p class="card-text text-break quote-text" v-if="parsedText.length > postLengthLimit && !showFullText">
<span v-html="parsedText.substring(0, postLengthLimit) + ' ... '"> </span>
<span class="cursor-pointer hover-color" @click="showFullText = true">Read more</span>
</p>

<p
v-if="parsedText.length < postLengthLimit || showFullText"
class="card-text text-break"
class="card-text text-break quote-text"
v-html="parsedText"
></p>
</div>
Expand Down
4 changes: 4 additions & 0 deletions public/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ a:hover {
font-style: italic;
}

.quote-text {
cursor: pointer;
}

.sidebar-card-body {
padding-top: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion utils/ipfsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export async function getWorkingUrl(url) {
}
}
} else if (url.startsWith("ar://")) {
const arweaveUrl = url.replace("ar://", "https://arweave.net/")
const arweaveUrl = url.replace("ar://", this.$config.arweaveGateway)

try {
const response = await axios.head(arweaveUrl, { signal: AbortSignal.timeout(abortTimeout) })
Expand Down
8 changes: 4 additions & 4 deletions utils/textUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function getAllImagesFromText(text) {
} else {
for (let i = 0; i < imageLinks.length; i++) {
if (imageLinks[i].startsWith('ar://')) {
imageLinks[i] = imageLinks[i].replace('ar://', 'https://arweave.net/')
imageLinks[i] = imageLinks[i].replace('ar://', this.$config.arweaveGateway)
} else if (imageLinks[i].startsWith('ipfs://')) {
imageLinks[i] = imageLinks[i].replace('ipfs://', 'https://ipfs.io/ipfs/')
}
Expand Down Expand Up @@ -137,7 +137,7 @@ export function getImageFromText(text) {
} else {
for (let i = 0; i < imageLinks.length; i++) {
if (imageLinks[i].startsWith('ar://')) {
imageLinks[i] = imageLinks[i].replace('ar://', 'https://arweave.net/')
imageLinks[i] = imageLinks[i].replace('ar://', this.$config.arweaveGateway)
} else if (imageLinks[i].startsWith('ipfs://')) {
imageLinks[i] = imageLinks[i].replace('ipfs://', 'https://ipfs.io/ipfs/')
}
Expand Down Expand Up @@ -412,7 +412,7 @@ export function imgParsing(text) {
return text.replace(imageRegex, function (url) {
let newUrl = url
if (url.startsWith('ar://')) {
newUrl = url.replace('ar://', 'https://arweave.net/')
newUrl = url.replace('ar://', this.$config.arweaveGateway)
} else if (url.startsWith('ipfs://')) {
newUrl = url.replace('ipfs://', 'https://ipfs.io/ipfs/')
}
Expand All @@ -437,7 +437,7 @@ export function imgWithoutExtensionParsing(text) {

return text.replace(imageRegex, function (url) {
if (url.startsWith('ar://')) {
url = url.replace('ar://', 'https://arweave.net/')
url = url.replace('ar://', this.$config.arweaveGateway)
} else if (url.startsWith('ipfs://')) {
url = url.replace('ipfs://', 'https://ipfs.io/ipfs/')
}
Expand Down

0 comments on commit bcbc970

Please sign in to comment.