Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Nov 7, 2022
1 parent 073be0a commit c43bbde
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
10 changes: 10 additions & 0 deletions layouts/header/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1591,4 +1591,14 @@ emoji-picker {
5%, 100% {
transform: translate(0, 0);
}
}
.tweet .tweet-header-name {
max-width: 300px;
display: inline-block;
overflow: hidden;
vertical-align: middle;
}
.tweet-top-text {
overflow: hidden;
max-width: 500px;
}
4 changes: 2 additions & 2 deletions layouts/profile/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ async function renderProfile() {

updateSelection();

document.getElementById('profile-bio').innerHTML = escapeHTML(pageUser.description).replace(/\n/g, '<br>').replace(/((http|https|ftp):\/\/[\w?=.\/-;#~%-]+(?![\w\s?&.\/;#~%"=-]*>))/g, '<a href="$1">$1</a>').replace(/(?<!\w)@([\w+]{1,15}\b)/g, `<a href="https://twitter.com/$1">@$1</a>`).replace(/(?<!\w)#([\w+]+\b)/g, `<a href="https://twitter.com/hashtag/$1">#$1</a>`);
document.getElementById('profile-bio').innerHTML = escapeHTML(pageUser.description).replace(/\n\n\n\n/g, "\n").replace(/\n/g, '<br>').replace(/((http|https|ftp):\/\/[\w?=.\/-;#~%-]+(?![\w\s?&.\/;#~%"=-]*>))/g, '<a href="$1">$1</a>').replace(/(?<!\w)@([\w+]{1,15}\b)/g, `<a href="https://twitter.com/$1">@$1</a>`).replace(/(?<!\w)#([\w+]+\b)/g, `<a href="https://twitter.com/hashtag/$1">#$1</a>`);
let textWithoutLinks = pageUser.description.replace(/(?:https?|ftp):\/\/[\n\S]+/g, '').replace(/(?<!\w)@([\w+]{1,15}\b)/g, '');
let isEnglish = textWithoutLinks.length < 1 ? {languages:[{language:LANGUAGE, percentage:100}]} : await chrome.i18n.detectLanguage(textWithoutLinks);
isEnglish = isEnglish.languages[0] && isEnglish.languages[0].percentage > 60 && isEnglish.languages[0].language.startsWith(LANGUAGE);
Expand Down Expand Up @@ -841,7 +841,7 @@ async function renderProfile() {
if(pageUser.location) {
let location = document.createElement('span');
location.classList.add('profile-additional-thing', 'profile-additional-location');
location.innerText = pageUser.location;
location.innerText = pageUser.location.replace(/\n\n\n\n/g, "\n");
additionalInfo.appendChild(location);
if(vars.enableTwemoji) twemoji.parse(location);
}
Expand Down
9 changes: 6 additions & 3 deletions layouts/profile/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,8 @@ a:hover,
line-height: 1;
word-wrap: break-word;
margin: 0;
text-rendering: optimizeLegibility
text-rendering: optimizeLegibility;
overflow: hidden;
}

.piu-a {
Expand Down Expand Up @@ -951,7 +952,8 @@ a:hover,
font-weight: 400;
line-height: 20px;
margin-bottom: 10px;
word-wrap: break-word
word-wrap: break-word;
overflow: hidden;
}

#tweet-nav[hidden] {
Expand Down Expand Up @@ -1277,7 +1279,8 @@ a:hover,
border: 1px solid var(--border);
border-radius: 5px;
background: var(--background-color);
font-size: 14px
font-size: 14px;
overflow: hidden;
}

#tweet-to:hover {
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Old Twitter Layout (2022)",
"description": "__MSG_ext_description__",
"version": "1.6.4.6",
"version": "1.6.4.7",
"manifest_version": 3,
"homepage_url": "https://github.com/dimdenGD/OldTwitter",
"background": {
Expand Down

0 comments on commit c43bbde

Please sign in to comment.