Share links using Halcyon,add profile overlays on mentions,keep scroll position when new posts appear,...

This commit is contained in:
nipos 2019-06-20 16:50:42 +02:00
parent eef0a0fc93
commit 2a6b28343d
21 changed files with 714 additions and 182 deletions

View File

@ -8,6 +8,9 @@ RewriteRule ^(.*)$ https://$1 [R=301,L]
RewriteBase /
RewriteRule ^home/?$ / [R=301]
RewriteBase /intent
RewriteRule ^intent/toot/?$ share\.php [NC,L]
RewriteBase /login
RewriteRule ^login/?$ login/login\.php [NC,L,QSA]
RewriteRule ^auth/?$ login/auth\.php [NC,L,QSA]

View File

@ -20,6 +20,10 @@ halcyon.domain.tld {
r ^/home/?$
to /
}
rewrite {
r ^/intent/toot/?$
to /share.php
}
rewrite {
r ^/login/?$
to /login/login.php

View File

@ -21,12 +21,14 @@ We moved our instances list to our webpage: https://www.halcyon.social/instances
- Supports multiple languages.
- Privacy-friendly video embeds.
- Full support for Mastodon polls.
- Share links using Halcyon.
## Install
[![Install Halcyon with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=halcyon)
or read our new documentation pages to install it manually: https://www.halcyon.social/documentation.php?page=install
## Blog
- Release of Version 2.4.0 - Share links to Halcyon,preview overlays for mentions and more (blog article coming soon)
- Release of Version 2.3.4 - Introduce BlurHash,repair YouPlay,improve link previews feature,add debug mode,add lighttpd example config,bug fixes
- Release of Version 2.3.3 - New media uploader,sort uploads,drag&drop and copy&paste uploads,fix automatic dark mode
- Release of Version 2.3.2 - Add block and mute management,add management for follow requests,add Catalan translation

View File

@ -231,33 +231,39 @@ background-color:#243447;
border:1px solid #000;
color:#AAB8C2;
}
#js-follows_profile .follows_profile_box {
.follows_profile_box {
background-color:#243447;
border:1px solid #000;
}
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_icon {
.follows_profile_box .follows_profile .follows_profile_name_box a {
text-decoration-color:#e6dede;
}
.follows_profile_box .follows_profile .follows_profile_name_box h2 {
color:#e6dede;
}
.follows_profile_box .follows_profile .follows_profile_icon {
background-color:#243447;
}
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_name_box span {
.follows_profile_box .follows_profile .follows_profile_name_box span {
color:#657786;
}
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_bio {
.follows_profile_box .follows_profile .follows_profile_bio {
color:#eee;
}
#js-follows_profile .follow_button {
.follows_profile_box .follow_button {
border:1px solid #189EFC;
}
#js-follows_profile .following_button {
.follows_profile_box .following_button {
border:1px solid #2B94DA;
background-color:#189EFC;
}
#js-follows_profile .following_button i {
.follows_profile_box .following_button i {
color:#fff;
}
#js-follows_profile .following_button span {
.follows_profile_box .following_button span {
color:#fff;
}
#js-follows_profile .following_button:hover,#js-follows_profile .following_button:hover i {
.follows_profile_box .following_button:hover,.follows_profile_box .following_button:hover i {
background-color:#E20055;
color:#fff!important;
}
@ -280,10 +286,12 @@ background-color:#243447;
.current_profile_box .current_profile .current_profile_name_box span {
color:#657786;
}
.current_profile_box .current_profile .current_profile_counts .current_profile_count a .title {
.current_profile_box .current_profile .current_profile_counts .current_profile_count a .title,
.follows_profile_box .follows_profile .follows_profile_counts .follows_profile_count a .title {
color:#8899a6;
}
.current_profile_box .current_profile .current_profile_counts .current_profile_count a .count {
.current_profile_box .current_profile .current_profile_counts .current_profile_count a .count,
.follows_profile_box .follows_profile .follows_profile_counts .follows_profile_count a .count {
color:#189EFC;
}
.side_widget {

304
assets/css/sharebox.css Normal file
View File

@ -0,0 +1,304 @@
@charset "utf-8";
* {
margin: 0;
padding: 0;
font-size: 100%;
}
a {
text-decoration: none;
word-break: break-word;
color: inherit;
}
a:hover {
text-decoration: underline;
}
ul, ol {
list-style: none;
padding: 0;
margin: 0;
}
img {
vertical-align: top;
border: 0;
max-width: 100%;
max-height: 100%;
}
button {
font-size: 100%;
}
.clear {
clear: both;
}
.red {
color: red!important;
}
.invisible {
display: none!important;
}
.ellipsis:after {
content:"...";
}
.no-events {
pointer-events: none;
}
.disallow_select {
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
}
.text_ellipsis {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
line-height: normal;
margin: 0;
padding: 0;
}
blockquote, q {
quotes: none;
margin: 0;
}
blockquote * {
margin: 0;
word-break: break-all;
}
blockquote:before, blockquote:after,
q:before, q:after {
content:'';
content:none;
}
article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
display:block;
}
textarea {
width: 100%;
}
input {
max-width: 100%;
}
button, input[type="submit"], input[type="button"]{
background-color: transparent;
border: none;
cursor: pointer;
outline: none;
padding: 0;
appearance: none;
}
img.emoji {
height: 1em;
width: 1em;
margin: 0 .05em 0 .1em;
vertical-align: -0.1em;
}
.emoji_poss .auth_emoji {
display: inline-block;
height: 100%;
margin: auto;
margin-left: 4px;
}
html {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 100%;
line-height: normal;
color: #333;
min-width: 100%;
min-height: 100%;
}
body {
margin: 0;
padding: 0;
min-width: 100%;
min-height: 100%;
word-wrap:break-word;
background-color: #F5F8FA;
}
#header {
display: flex;
position: fixed;
z-index: 999;
width: 100%;
height: 47px;
color: #66757F;
background-color: #fff;
box-shadow: 0 1px 1px rgba(0,0,0,0.26);
}
#header .header_nav_wrap {
box-sizing: border-box;
display: flex;
width: 680px;
height: 100%;
margin: auto;
padding: 0 5px;
}
#header .header_nav_wrap .header_left_box {
display: flex;
justify-content: flex-start;
height: 100%;
}
#header .header_nav_wrap .header_left_box ul.header_nav_list {
display: flex;
width: 100%;
height: 100%;
}
#header .header_nav_wrap .header_left_box ul.header_nav_list li.header_nav_item {
display: flex;
align-items: center;
height: 100%;
position: relative;
}
#header .header_nav_wrap .header_left_box ul.header_nav_list li.header_nav_item a {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
color: #66757F;
box-sizing: border-box;
padding-right: 18px;
padding-left: 9px;
border-top: 0px solid transparent;
border-bottom: 0px solid #189EFC;
}
#header .header_nav_wrap .header_right_box {
flex: 2;
box-sizing: border-box;
padding: 8px 0;
height: 100%;
}
#header .header_nav_wrap .header_right_box ul.header_nav_list {
display: flex;
justify-content: flex-end;
align-items: center;
width: 100%;
height: 100%;
}
#header .header_nav_wrap .header_right_box ul.header_nav_list li.header_nav_item {
display: flex;
height: 100%;
justify-content: center;
align-items: center;
padding-right: 16px;
}
#header .header_nav_wrap .header_right_box .my_account_wrap {
position: relative;
padding-right:5px !important;
}
#header .header_nav_wrap .header_right_box .my_account_wrap .my_account {
height: 35px;
width: 35px;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
}
#header .header_nav_wrap .header_right_box .my_account_wrap .my_account img {
width: 32px;
height: 32px;
overflow: hidden;
border-radius: 50%;
transition: 0.15s ease-out;
}
#main {
padding-top: 47px;
background-color:#ffffff;
box-shadow:0 1px 1px rgba(0,0,0,0.26);
}
#main.dark {
background-color:#8899a6;
color:#FFFFFF;
border-top:1px solid #f5f8fa;
padding-top:0;
}
#main.dark p {
font-size:14px;
margin-top:10px;
}
#main .article_wrap {
display: flex;
flex-wrap: nowrap;
width: 680px;
margin:auto;
}
#main .article_wrap .content {
margin:20px;
width:100%;
}
#main .article_wrap .content.first {
margin-top:100px;
}
#main .article_wrap .pageheading {
font-size:25px;
color:#66757F;
}
#main.dark .article_wrap .pageheading {
color:#FFFFFF;
}
.status_textarea,#username {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
width:calc(100% - 12px);
border:1px solid #e1e8ed;
border-radius:3px;
resize:none;
padding:6px;
}
.status_textarea {
height:65px;
}
.status_textarea:focus,#username:focus {
border:2px solid #189EFC;
padding:5px;
}
.usernamebox {
float:left;
margin-top:5px;
}
.usernamebox label {
font-size:12px;
}
.toot_button {
width: 90px;
height: 40px;
border-radius: 4px;
color: #fff;
background-color: #2588D0;
transition: 0.15s ease-out;
float:right;
margin-top:10px;
margin-bottom:20px;
}
.toot_button.loggedout {
width:150px;
}
.toot_button:hover {
background-color: #2571D0;
transition: 0.15s ease-out;
}
.toot_button:active {
background-color: #255ED0;
transition: 0.15s ease-out;
}
.toot_button .toot_button_label {
display: flex;
justify-content: center;
align-items: center;
}
.toot_button span {
font-size: 18px;
font-weight: 500;
}
.dark .toot_button {
margin-top:0;
color:#292f33;
background-color: #fab81e;
}
.dark .toot_button:hover {
background-color: #e99110;
}
.dark .toot_button:active {
background-color: #f2a330;
}

View File

@ -0,0 +1,30 @@
html {
color:#eee;
}
body {
background-color:#141d26;
}
#header {
color:#FFFFFF;
background-color:#243447;
box-shadow:0 1px 1px rgba(0,0,0,0.26);
}
#header .header_nav_wrap .header_left_box ul.header_nav_list li.header_nav_item a {
color:#eee;
border-top:0px solid transparent;
border-bottom:0px solid #189EFC;
}
#main {
background-color:#243447;
}
#main.dark {
border-top:0;
}
#main .article_wrap .pageheading {
color:#FFFFFF;
}
.status_textarea {
background-color:#132030;
border-color:#000000;
color:#FFFFFF;
}

View File

@ -1168,7 +1168,7 @@ box-sizing: border-box;
height: auto;
flex-wrap: wrap;
}
#js-follows_profile .follows_profile_box {
.follows_profile_box {
width: 290px;
margin: 0 5px;
margin-bottom: 10px;
@ -1178,20 +1178,27 @@ background-color: #fff;
overflow: hidden;
border: 1px solid #E6ECF0;
}
#js-follows_profile .follows_profile_box .follows_profile_header {
.follows_profile_box.user_popup {
position:absolute;
z-index:999;
box-shadow:1px 1px 3px rgba(0,0,0,0.26);
border:0;
cursor:auto;
}
.follows_profile_box .follows_profile_header {
height: 96px;
overflow: hidden;
background-color: #189EFC;
}
#js-follows_profile .follows_profile_box .follows_profile_header img {
.follows_profile_box .follows_profile_header img {
width: 100%;
height: 100%;
object-fit: cover;
}
#js-follows_profile .follows_profile_box .follows_profile {
.follows_profile_box .follows_profile {
position: relative;
}
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_icon {
.follows_profile_box .follows_profile .follows_profile_icon {
position: absolute;
width: 74px;
height: 74px;
@ -1201,10 +1208,10 @@ border-radius: 8px;
top: -76px;
background-color: #fff;
}
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_icon img {
.follows_profile_box .follows_profile .follows_profile_icon img {
border-radius: 5px;
}
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_name_box {
.follows_profile_box .follows_profile .follows_profile_name_box {
width: auto;
/*! margin-left: 15px; */
padding-bottom: 2px;
@ -1212,12 +1219,16 @@ padding-top: 4px;
margin: 0 16px;
margin-top: 36px;
}
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_name_box h2 {
.follows_profile_box .follows_profile .follows_profile_name_box a {
text-decoration-color:#333;
}
.follows_profile_box .follows_profile .follows_profile_name_box h2 {
font-weight: 700;
font-size: 18px;
line-height: 25px;
color:#333;
}
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_name_box span {
.follows_profile_box .follows_profile .follows_profile_name_box span {
display: block;
width: 180px;
color: #657786;
@ -1227,9 +1238,9 @@ white-space: nowrap;
text-overflow: ellipsis;
margin: 4px 0;
}
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_name_box span::before {
.follows_profile_box .follows_profile .follows_profile_name_box span::before {
}
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_bio {
.follows_profile_box .follows_profile .follows_profile_bio {
height: 58px;
font-size: 14px;
font-weight: 400;
@ -1241,17 +1252,17 @@ line-height: 1.3;
overflow: hidden;
/*! width: 100%; */
}
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_bio p {
.follows_profile_box .follows_profile .follows_profile_bio p {
/*! white-space: nowrap; */
overflow: hidden;
word-break: break-all;
height: auto;
/*! max-width: 100%; */
}
#js-follows_profile .follows_profile_box .follows_profile .follows_profile_bio p a {
.follows_profile_box .follows_profile .follows_profile_bio p a {
color: #189EFC
}
#js-follows_profile .halcyon_button {
.follows_profile_box .halcyon_button {
display: flex;
flex-wrap: nowrap;
align-items: center;
@ -1264,32 +1275,32 @@ position: absolute;
right: 16px;
top: -32px;
}
#js-follows_profile .halcyon_button i {
.follows_profile_box .halcyon_button i {
color: #189EFC;
margin-right: 4px;
}
#js-follows_profile .halcyon_button span {
.follows_profile_box .halcyon_button span {
font-weight: 600;
}
#js-follows_profile .halcyon_button:hover,
#js-follows_profile .halcyon_button:hover i {
.follows_profile_box .halcyon_button:hover,
.follows_profile_box .halcyon_button:hover i {
background-color: #189EFC;
color: #fff!important;
}
#js-follows_profile .following_button {
.follows_profile_box .following_button {
border: 1px solid #2B94DA;
background-color: #189EFC;
}
#js-follows_profile .following_button i {
.follows_profile_box .following_button i {
color: #fff;
margin-right: 4px;
}
#js-follows_profile .following_button span {
.follows_profile_box .following_button span {
font-weight: 600;
color: #fff;
}
#js-follows_profile .following_button:hover,
#js-follows_profile .following_button:hover i {
.follows_profile_box .following_button:hover,
.follows_profile_box .following_button:hover i {
background-color: #E20055;
color: #fff!important;
}
@ -1372,28 +1383,33 @@ text-overflow: ellipsis;
.current_profile_box .current_profile .current_profile_name_box span::before {
content: "@";
}
.current_profile_box .current_profile .current_profile_counts {
.current_profile_box .current_profile .current_profile_counts,
.follows_profile_box .follows_profile .follows_profile_counts {
display: flex;
}
.current_profile_box .current_profile .current_profile_counts .current_profile_count {
.current_profile_box .current_profile .current_profile_counts .current_profile_count,
.follows_profile_box .follows_profile .follows_profile_counts .follows_profile_count {
flex-grow: 1;
padding-left: 16px;
padding-bottom: 8px;
}
.current_profile_box .current_profile .current_profile_counts .current_profile_count a {
.current_profile_box .current_profile .current_profile_counts .current_profile_count a,
.follows_profile_box .follows_profile .follows_profile_counts .follows_profile_count a {
display: flex;
flex-direction: column;
justify-content: space-around;
text-decoration: none;
}
.current_profile_box .current_profile .current_profile_counts .current_profile_count a .title {
.current_profile_box .current_profile .current_profile_counts .current_profile_count a .title,
.follows_profile_box .follows_profile .follows_profile_counts .follows_profile_count a .title {
color: #657786;
font-size: 10px;
}
.current_profile_box .current_profile .current_profile_counts .current_profile_count a:hover .title {
color: #189EFC;
}
.current_profile_box .current_profile .current_profile_counts .current_profile_count a .count {
.current_profile_box .current_profile .current_profile_counts .current_profile_count a .count,
.follows_profile_box .follows_profile .follows_profile_counts .follows_profile_count a .count {
font-size: 18px;
font-weight: 400;
padding-top: 3px;
@ -1668,24 +1684,6 @@ font-size: 21px;
font-size: 13px;
font-weight: 400;
}
#header .header_nav_wrap .header_center_box {
display: flex;
flex: 1.2;
height: 100%;
box-sizing: border-box;
padding: 8px 0;
align-items: center;
justify-content: center;
}
#header .logo_box {
height: 96%;
padding: 4px;
box-sizing: border-box;
}
#header .logo_box img {
width: auto;
display: block;
}
#header .header_nav_wrap .header_right_box {
flex: 2;
box-sizing: border-box;
@ -1878,39 +1876,6 @@ border-radius:0;
#header .header_nav_wrap .header_right_box .search_form_wrap .header_search_suggestions ul li h3 {
font-size:16px;
}
/*#header .header_nav_wrap .header_right_box .search_form_wrap .header_search_suggestions ul {
margin: 0 -21px;
margin-bottom: 8px;
}
#header .header_nav_wrap .header_right_box .search_form_wrap .header_search_suggestions ul::after {
content: "";
display: block;
margin-top: 8px;
border-bottom: 1px solid #E6ECF0;
}
#header .header_nav_wrap .header_right_box .search_form_wrap .header_search_suggestions ul:last-child::after {
border-bottom: 0px solid #E6ECF0;
}
#header .header_nav_wrap .header_right_box .search_form_wrap .header_search_suggestions ul li {
box-sizing: border-box;
}
#header .header_nav_wrap .header_right_box .search_form_wrap .header_search_suggestions ul li a .display_name {
display: block;
color: #000;
font-size: 14px;
font-weight: 600;
margin-bottom: 4px;
}
#header .header_nav_wrap .header_right_box .search_form_wrap .header_search_suggestions a {
display: block;
padding: 8px 21px;
}
#header .header_nav_wrap .header_right_box .search_form_wrap .header_search_suggestions a:hover,
#header .header_nav_wrap .header_right_box .search_form_wrap .header_search_suggestions ul li a:hover .display_name {
background-color: #189EFC;
text-decoration: none;
color: #fff;
}*/
.toot_button {
width: 90px;
height: 100%;

View File

@ -54,38 +54,7 @@ di[re[4]] = re[3];
}
return di;
}
function getRelativeURL(url, id, options) {
const array = url.split('/');
if ( array.length >= 4 ) {
if ( !options ) {
var options = ""
};
if(array[array.length-1] == "") array[array.length-1] = "blog";
if (id) {
if (array[array.length-1].substr(0,1) === '@') {
const link= '/'+array[array.length-1]+'@'+array[2]+options+'?mid='+id+'&';
return link;
}
else {
const link= '/@'+array[array.length-1]+'@'+array[2]+options+'?mid='+id+'&';
return link;
}
}
else {
if (array[array.length-1].substr(0,1) === '@') {
const link= '/'+array[array.length-1]+'@'+array[2]+options;
return link;
} else {
const link= '/@'+array[array.length-1]+'@'+array[2]+options;
return link;
}
}
}
}
function replaceInternalLink(){
$(".h-card > a").each(function(i) {
$(this).attr('href',getRelativeURL($(this).attr('href')));
});
$(".toot_article a,.profile_bio a,.follows_profile_bio a").each(function(i) {
const pltags = $(this).attr('href').match(/https?:\/\/.+..+\/tag\/([a-zA-Z\d_%]+)\/?$/);
if(pltags) $(this).attr('target','_self').attr('href','/search?q='+pltags[1]);
@ -180,7 +149,7 @@ res += handleString(values[i]);
return res;
}
function resetApp() {
current_id = Number(localStorage.getItem("current_id"));
current_id = localStorage.getItem("current_id");
current_instance = localStorage.getItem("current_instance");
authtoken= localStorage.getItem("current_authtoken");
api = new MastodonAPI({
@ -194,17 +163,13 @@ AccountObj.display_name = AccountObj.display_name.replace(new RegExp(":"+Account
}
localStorage.setItem("current_display_name",AccountObj["display_name"]);
localStorage.setItem("current_acct",AccountObj["acct"]);
localStorage.setItem("current_url",getRelativeURL(AccountObj["url"],AccountObj["id"]));
localStorage.setItem("current_url","/@"+AccountObj["acct"]+"@"+current_instance+"?mid="+current_id);
localStorage.setItem("current_header",AccountObj["header"]);
localStorage.setItem("current_avatar",AccountObj["avatar"]);
localStorage.setItem("current_locked",AccountObj["locked"]);
localStorage.setItem("current_statuses_count",AccountObj["statuses_count"]);
localStorage.setItem("current_following_count",AccountObj["following_count"]);
localStorage.setItem("current_followers_count",AccountObj["followers_count"]);
localStorage.setItem("current_statuses_count_link",getRelativeURL(AccountObj["url"],AccountObj["id"]));
localStorage.setItem("current_following_count_link",getRelativeURL(AccountObj["url"],AccountObj["id"],'/following'));
localStorage.setItem("current_followers_count_link",getRelativeURL(AccountObj["url"],AccountObj["id"],'/followers'));
localStorage.setItem("current_favourites_link",getRelativeURL(AccountObj["url"],AccountObj["id"],'/favourites'));
localStorage.setItem("current_follow_loaded","false");
localStorage.setItem("current_filters","[]");
current_display_name = localStorage.getItem("current_display_name");
@ -216,10 +181,6 @@ current_locked = localStorage.getItem("current_locked");
current_statuses_count = localStorage.getItem("current_statuses_count");
current_following_count = localStorage.getItem("current_following_count");
current_followers_count = localStorage.getItem("current_followers_count");
current_statuses_count_link = localStorage.getItem("current_statuses_count_link");
current_following_count_link = localStorage.getItem("current_following_count_link");
current_followers_count_link = localStorage.getItem("current_followers_count_link");
current_favourites_link = localStorage.getItem("current_favourites_link");
current_filters = JSON.parse(localStorage.getItem("current_filters"));
current_search_history = JSON.parse(localStorage.getItem("current_search_history"));
setCurrentProfile();
@ -285,7 +246,7 @@ current_filters = data;
$.cookie("session","true",{path:'/'});
}
function refreshApp() {
current_id = Number(localStorage.getItem("current_id"));
current_id = localStorage.getItem("current_id");
current_instance = localStorage.getItem("current_instance");
authtoken= localStorage.getItem("current_authtoken");
api = new MastodonAPI({
@ -301,10 +262,6 @@ current_locked = localStorage.getItem("current_locked");
current_statuses_count = localStorage.getItem("current_statuses_count");
current_following_count = localStorage.getItem("current_following_count");
current_followers_count = localStorage.getItem("current_followers_count");
current_statuses_count_link = localStorage.getItem("current_statuses_count_link");
current_following_count_link = localStorage.getItem("current_following_count_link");
current_followers_count_link = localStorage.getItem("current_followers_count_link");
current_favourites_link = localStorage.getItem("current_favourites_link");
current_following_accts = localStorage.getItem("current_following_accts");
current_instance_charlimit = localStorage.getItem("current_instance_charlimit");
current_blocked_accts = localStorage.getItem("current_blocked_accts");
@ -327,9 +284,9 @@ $(".js_current_profile_image").attr("src", current_avatar);
$(".js_current_toots_count").text(current_statuses_count);
$(".js_current_following_count").text(current_following_count);
$(".js_current_followers_count").text(current_followers_count);
$(".current_toots_count_link").attr("href", current_statuses_count_link);
$(".current_following_count_link").attr("href", current_following_count_link);
$(".current_followers_count_link").attr("href", current_followers_count_link);
$(".current_toots_count_link").attr("href",current_url);
$(".current_following_count_link").attr("href",current_url);
$(".current_followers_count_link").attr("href",current_url);
if($(window).width() < 1200) {
responsive_design = true;
$(".left_column").append($("<div>").attr("class","responsive_left").append($(".right_column").children()));

View File

@ -0,0 +1,56 @@
function getRandom() {
var s4 = function() {
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
}
function submitStatus(text) {
const params = {
status:text,
sensitive:false,
spoiler_text:"",
visibility:localStorage.setting_post_privacy
}
api.post("statuses",params,function(data) {
closewin = window.close();
if(!closewin) putMessage(text_cantclose);
});
}
function putMessage(text) {
$(".putmessage").html(text);
}
if(localStorage.getItem("current_id") && localStorage.getItem("current_instance") && localStorage.getItem("current_authtoken")) {
api = new MastodonAPI({
instance:"https://"+localStorage.current_instance,
api_user_token:localStorage.current_authtoken
});
if(sendnow && sessionStorage.return && sessionStorage.return == "share") {
var sharetext = sessionStorage.share_text;
sessionStorage.removeItem("return");
sessionStorage.removeItem("share_text");
$(document).ready(function() {
$(".status_textarea").val(sharetext);
});
submitStatus(sharetext);
}
$(document).ready(function() {
$(".loggedout").hide();
api.get("accounts/verify_credentials",function(AccountObj) {
$(".nav_username").text(AccountObj.username);
$(".js_current_profile_image").attr("src",AccountObj.avatar);
$(".nav_profilelink").attr("href","/@"+AccountObj.username+"@"+localStorage.current_instance+"?mid="+AccountObj.id);
$(".loggedin").show();
});
$(".toot_button.loggedin").click(function(e) {
e.preventDefault();
submitStatus($(".status_textarea").val());
});
});
}
$(document).ready(function() {
autosize($(".status_textarea"));
$("#statusform").submit(function() {
sessionStorage.return = "share";
sessionStorage.share_text = $(".status_textarea").val();
});
});

View File

@ -161,8 +161,8 @@ for(var i=0;i<status.account.emojis.length;i++) {
status.account.display_name = status.account.display_name.replace(new RegExp(":"+status.account.emojis[i].shortcode+":","g"),"<img src='"+status.account.emojis[i].url+"' class='emoji'>");
}
for(var i=0;i<status.mentions.length;i++) {
if(status.mentions[i].acct.indexOf("@") == -1) status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'@'+current_instance+'?mid='+status.mentions[i].id+'"');
else status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'?mid='+status.mentions[i].id+'"');
if(status.mentions[i].acct.indexOf("@") == -1) status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'@'+current_instance+'?mid='+status.mentions[i].id+'" data-mid="'+status.mentions[i].id+'"');
else status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'?mid='+status.mentions[i].id+'" data-mid="'+status.mentions[i].id+'"');
}
var writtenby = new Object();
writtenby.id = status.account.id;
@ -331,8 +331,8 @@ for(i=0;i<status.reblog.account.emojis.length;i++) {
status.reblog.account.display_name = status.reblog.account.display_name.replace(new RegExp(":"+status.reblog.account.emojis[i].shortcode+":","g"),"<img src='"+status.reblog.account.emojis[i].url+"' class='emoji'>");
}
for(var i=0;i<status.reblog.mentions.length;i++) {
if(status.reblog.mentions[i].acct.indexOf("@") == -1) status.reblog.content = status.reblog.content.replace(new RegExp('href="'+status.reblog.mentions[i].url+'"',"g"),'href="/@'+status.reblog.mentions[i].acct+'@'+current_instance+'?mid='+status.reblog.mentions[i].id+'"');
else status.reblog.content = status.reblog.content.replace(new RegExp('href="'+status.reblog.mentions[i].url+'"',"g"),'href="/@'+status.reblog.mentions[i].acct+'?mid='+status.reblog.mentions[i].id+'"');
if(status.reblog.mentions[i].acct.indexOf("@") == -1) status.reblog.content = status.reblog.content.replace(new RegExp('href="'+status.reblog.mentions[i].url+'"',"g"),'href="/@'+status.reblog.mentions[i].acct+'@'+current_instance+'?mid='+status.reblog.mentions[i].id+'" data-mid="'+status.reblog.mentions[i].id+'"');
else status.reblog.content = status.reblog.content.replace(new RegExp('href="'+status.reblog.mentions[i].url+'"',"g"),'href="/@'+status.reblog.mentions[i].acct+'?mid='+status.reblog.mentions[i].id+'" data-mid="'+status.reblog.mentions[i].id+'"');
}
var writtenby = new Object();
writtenby.id = status.reblog.account.id;
@ -499,8 +499,8 @@ for(i=0;i<status.account.emojis.length;i++) {
status.account.display_name = status.account.display_name.replace(new RegExp(":"+status.account.emojis[i].shortcode+":","g"),"<img src='"+status.account.emojis[i].url+"' class='emoji'>");
}
for(var i=0;i<status.mentions.length;i++) {
if(status.mentions[i].acct.indexOf("@") == -1) status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'@'+current_instance+'?mid='+status.mentions[i].id+'"');
else status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'?mid='+status.mentions[i].id+'"');
if(status.mentions[i].acct.indexOf("@") == -1) status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'@'+current_instance+'?mid='+status.mentions[i].id+'" data-mid="'+status.mentions[i].id+'"');
else status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'?mid='+status.mentions[i].id+'" data-mid="'+status.mentions[i].id+'"');
}
var writtenby = new Object();
writtenby.id = status.account.id;
@ -671,8 +671,8 @@ for(i=0;i<NotificationObj.status.account.emojis.length;i++) {
NotificationObj.status.account.display_name = NotificationObj.status.account.display_name.replace(new RegExp(":"+NotificationObj.status.account.emojis[i].shortcode+":","g"),"<img src='"+NotificationObj.status.account.emojis[i].url+"' class='emoji'>");
}
for(var i=0;i<NotificationObj.status.mentions.length;i++) {
if(NotificationObj.status.mentions[i].acct.indexOf("@") == -1) NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'@'+current_instance+'?mid='+NotificationObj.status.mentions[i].id+'"');
else NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'?mid='+NotificationObj.status.mentions[i].id+'"');
if(NotificationObj.status.mentions[i].acct.indexOf("@") == -1) NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'@'+current_instance+'?mid='+NotificationObj.status.mentions[i].id+'" data-mid="'+NotificationObj.status.mentions[i].id+'"');
else NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'?mid='+NotificationObj.status.mentions[i].id+'" data-mid="'+NotificationObj.status.mentions[i].id+'"');
}
var account_state_icons = "";
if(NotificationObj.status.account.locked == true) account_state_icons += " <i class='fa fa-lock'></i>";
@ -721,8 +721,8 @@ for(i=0;i<NotificationObj.status.account.emojis.length;i++) {
NotificationObj.status.account.display_name = NotificationObj.status.account.display_name.replace(new RegExp(":"+NotificationObj.status.account.emojis[i].shortcode+":","g"),"<img src='"+NotificationObj.status.account.emojis[i].url+"' class='emoji'>");
}
for(var i=0;i<NotificationObj.status.mentions.length;i++) {
if(NotificationObj.status.mentions[i].acct.indexOf("@") == -1) NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'@'+current_instance+'?mid='+NotificationObj.status.mentions[i].id+'"');
else NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'?mid='+NotificationObj.status.mentions[i].id+'"');
if(NotificationObj.status.mentions[i].acct.indexOf("@") == -1) NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'@'+current_instance+'?mid='+NotificationObj.status.mentions[i].id+'" data-mid="'+NotificationObj.status.mentions[i].id+'"');
else NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'?mid='+NotificationObj.status.mentions[i].id+'" data-mid="'+NotificationObj.status.mentions[i].id+'"');
}
const sid= NotificationObj.status.id;
var account_state_icons = "";
@ -786,8 +786,8 @@ for(i=0;i<NotificationObj.status.account.emojis.length;i++) {
NotificationObj.status.account.display_name = NotificationObj.status.account.display_name.replace(new RegExp(":"+NotificationObj.status.account.emojis[i].shortcode+":","g"),"<img src='"+NotificationObj.status.account.emojis[i].url+"' class='emoji'>");
}
for(var i=0;i<NotificationObj.status.mentions.length;i++) {
if(NotificationObj.status.mentions[i].acct.indexOf("@") == -1) NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'@'+current_instance+'?mid='+NotificationObj.status.mentions[i].id+'"');
else NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'?mid='+NotificationObj.status.mentions[i].id+'"');
if(NotificationObj.status.mentions[i].acct.indexOf("@") == -1) NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'@'+current_instance+'?mid='+NotificationObj.status.mentions[i].id+'" data-mid="'+NotificationObj.status.mentions[i].id+'"');
else NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'?mid='+NotificationObj.status.mentions[i].id+'" data-mid="'+NotificationObj.status.mentions[i].id+'"');
}
var writtenby = new Object();
writtenby.id = NotificationObj.status.account.id;
@ -952,8 +952,8 @@ for(i=0;i<NotificationObj.status.account.emojis.length;i++) {
NotificationObj.status.account.display_name = NotificationObj.status.account.display_name.replace(new RegExp(":"+NotificationObj.status.account.emojis[i].shortcode+":","g"),"<img src='"+NotificationObj.status.account.emojis[i].url+"' class='emoji'>");
}
for(var i=0;i<NotificationObj.status.mentions.length;i++) {
if(NotificationObj.status.mentions[i].acct.indexOf("@") == -1) NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'@'+current_instance+'?mid='+NotificationObj.status.mentions[i].id+'"');
else NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'?mid='+NotificationObj.status.mentions[i].id+'"');
if(NotificationObj.status.mentions[i].acct.indexOf("@") == -1) NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'@'+current_instance+'?mid='+NotificationObj.status.mentions[i].id+'" data-mid="'+NotificationObj.status.mentions[i].id+'"');
else NotificationObj.status.content = NotificationObj.status.content.replace(new RegExp('href="'+NotificationObj.status.mentions[i].url+'"',"g"),'href="/@'+NotificationObj.status.mentions[i].acct+'?mid='+NotificationObj.status.mentions[i].id+'" data-mid="'+NotificationObj.status.mentions[i].id+'"');
}
var writtenby = new Object();
writtenby.id = NotificationObj.status.account.id;
@ -1188,8 +1188,8 @@ for(i=0;i<status.account.emojis.length;i++) {
status.account.display_name = status.account.display_name.replace(new RegExp(":"+status.account.emojis[i].shortcode+":","g"),"<img src='"+status.account.emojis[i].url+"' class='emoji'>");
}
for(var i=0;i<status.mentions.length;i++) {
if(status.mentions[i].acct.indexOf("@") == -1) status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'@'+current_instance+'?mid='+status.mentions[i].id+'"');
else status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'?mid='+status.mentions[i].id+'"');
if(status.mentions[i].acct.indexOf("@") == -1) status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'@'+current_instance+'?mid='+status.mentions[i].id+'" data-mid="'+status.mentions[i].id+'"');
else status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'?mid='+status.mentions[i].id+'" data-mid="'+status.mentions[i].id+'"');
}
var writtenby = new Object();
writtenby.id = status.account.id;
@ -1456,8 +1456,8 @@ for(i=0;i<status.reblog.account.emojis.length;i++) {
status.reblog.account.display_name = status.reblog.account.display_name.replace(new RegExp(":"+status.reblog.account.emojis[i].shortcode+":","g"),"<img src='"+status.reblog.account.emojis[i].url+"' class='emoji'>");
}
for(var i=0;i<status.reblog.mentions.length;i++) {
if(status.reblog.mentions[i].acct.indexOf("@") == -1) status.reblog.content = status.reblog.content.replace(new RegExp('href="'+status.reblog.mentions[i].url+'"',"g"),'href="/@'+status.reblog.mentions[i].acct+'@'+current_instance+'?mid='+status.reblog.mentions[i].id+'"');
else status.reblog.content = status.reblog.content.replace(new RegExp('href="'+status.reblog.mentions[i].url+'"',"g"),'href="/@'+status.reblog.mentions[i].acct+'?mid='+status.reblog.mentions[i].id+'"');
if(status.reblog.mentions[i].acct.indexOf("@") == -1) status.reblog.content = status.reblog.content.replace(new RegExp('href="'+status.reblog.mentions[i].url+'"',"g"),'href="/@'+status.reblog.mentions[i].acct+'@'+current_instance+'?mid='+status.reblog.mentions[i].id+'" data-mid="'+status.reblog.mentions[i].id+'"');
else status.reblog.content = status.reblog.content.replace(new RegExp('href="'+status.reblog.mentions[i].url+'"',"g"),'href="/@'+status.reblog.mentions[i].acct+'?mid='+status.reblog.mentions[i].id+'" data-mid="'+status.reblog.mentions[i].id+'"');
}
var writtenby = new Object();
writtenby.id = status.reblog.account.id;
@ -1748,8 +1748,8 @@ for(i=0;i<status.account.emojis.length;i++) {
status.account.display_name = status.account.display_name.replace(new RegExp(":"+status.account.emojis[i].shortcode+":","g"),"<img src='"+status.account.emojis[i].url+"' class='emoji'>");
}
for(var i=0;i<status.mentions.length;i++) {
if(status.mentions[i].acct.indexOf("@") == -1) status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'@'+current_instance+'?mid='+status.mentions[i].id+'"');
else status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'?mid='+status.mentions[i].id+'"');
if(status.mentions[i].acct.indexOf("@") == -1) status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'@'+current_instance+'?mid='+status.mentions[i].id+'" data-mid="'+status.mentions[i].id+'"');
else status.content = status.content.replace(new RegExp('href="'+status.mentions[i].url+'"',"g"),'href="/@'+status.mentions[i].acct+'?mid='+status.mentions[i].id+'" data-mid="'+status.mentions[i].id+'"');
}
var writtenby = new Object();
writtenby.id = status.account.id;
@ -1911,8 +1911,8 @@ for(i=0;i<status.reblog.account.emojis.length;i++) {
status.reblog.account.display_name = status.reblog.account.display_name.replace(new RegExp(":"+status.reblog.account.emojis[i].shortcode+":","g"),"<img src='"+status.reblog.account.emojis[i].url+"' class='emoji'>");
}
for(var i=0;i<status.reblog.mentions.length;i++) {
if(status.reblog.mentions[i].acct.indexOf("@") == -1) status.reblog.content = status.reblog.content.replace(new RegExp('href="'+status.reblog.mentions[i].url+'"',"g"),'href="/@'+status.reblog.mentions[i].acct+'@'+current_instance+'?mid='+status.reblog.mentions[i].id+'"');
else status.reblog.content = status.reblog.content.replace(new RegExp('href="'+status.reblog.mentions[i].url+'"',"g"),'href="/@'+status.reblog.mentions[i].acct+'?mid='+status.reblog.mentions[i].id+'"');
if(status.reblog.mentions[i].acct.indexOf("@") == -1) status.reblog.content = status.reblog.content.replace(new RegExp('href="'+status.reblog.mentions[i].url+'"',"g"),'href="/@'+status.reblog.mentions[i].acct+'@'+current_instance+'?mid='+status.reblog.mentions[i].id+'" data-mid="'+status.reblog.mentions[i].id+'"');
else status.reblog.content = status.reblog.content.replace(new RegExp('href="'+status.reblog.mentions[i].url+'"',"g"),'href="/@'+status.reblog.mentions[i].acct+'?mid='+status.reblog.mentions[i].id+'" data-mid="'+status.reblog.mentions[i].id+'"');
}
var writtenby = new Object();
writtenby.id = status.reblog.account.id;

View File

@ -456,6 +456,7 @@ $('#header .header_nav_list .'+scope+'_badge').removeClass('invisible');
}
}
else if (streaming_option === "auto") {
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
if(!$('.toot_entry[sid="'+userstream.payload.id+'"]').length) {
var filterstatus = false;
for(var a=0;a<current_filters.length;a++) {
@ -470,6 +471,9 @@ if(userstream.payload.content.match(new RegExp("[^a-zA-Z1-9]"+current_filters[a]
}
if(filterstatus == false && !(show_replies == "false" && userstream.payload.in_reply_to_id) && !(localStorage.setting_show_bots == "false" && userstream.payload.account.bot == true && !level.match(/accounts\/\d+\/statuses/)) && !(userstream.payload.visibility == "direct" && level == "timelines/home")) {
timeline_template(userstream.payload).prependTo("#js-timeline");
if(scrollTop != 0) {
window.scrollBy(0,$("#js-timeline .toot_entry[sid='"+userstream.payload.id+"']").height());
}
replaceInternalLink();
replace_emoji();
if(level === "timelines/home" | level === "timelines/public") {
@ -489,6 +493,9 @@ if(in_reply_statuses.content.match(new RegExp("[^a-zA-Z1-9]"+current_filters[a].
}
if(filterreplystatus == false) {
$("#js-timeline .toot_entry[sid='"+reply_source+"']").before(context_template(in_reply_statuses, 'ancestors_status default_padding'));
if(scrollTop != 0) {
window.scrollBy(0,$("#js-timeline .toot_entry[sid='"+in_reply_statuses.id+"']").height());
}
replaceInternalLink();
replace_emoji();
}
@ -966,12 +973,9 @@ if( AccountObj.id == current_id ) {
$(`<a href="/settings/profile">
<button class="profile_edit_button relationship_button">
<span>${__('Edit profile')}</span>
</button
</button>
</a>`).appendTo('.profile_button_box');
$(`<a href="${current_favourites_link}">
<h2>${__('FAVOURITES')}</h2>
<span>${__('Show')}</span>
</a>`).appendTo("#js-profile_nav_favourites");
$("#js-profile_nav_favourites a").show();
} else {
$("#profile_toot_buttons").show();
api.get('accounts/relationships', [{name:'id', data:String(AccountObj.id)}], function(RelationshipObj) {
@ -2027,6 +2031,68 @@ $(document).on('focus','.status_textarea textarea,.status_top .status_spoiler',f
global_focus_textfield = $(this).data("random");
$(".status_textarea textarea").change();
});
$(document).on('mouseenter','a.mention',function(e) {
if($(this).data("mid")) {
var hover_user = this;
var user_to = setTimeout(function() {
api.get("accounts/"+$(hover_user).data("mid"),function(data) {
var user_popup = follows_template(data);
$(user_popup).addClass("user_popup");
$(user_popup).children(".follows_profile").append(`<ul class="follows_profile_counts">
<li class="follows_profile_count follows_profile_toots_count">
<a class="follows_toots_count_link">
<span class="title">${__('TOOTS')}</span>
<span class="js_follows_toots_count count">${data.statuses_count}</span>
</a>
</li>
<li class="follows_profile_count follows_profile_follows_count">
<a class="follows_following_count_link">
<span class="title">${__('FOLLOWING')}</span>
<span class="js_follows_following_count count">${data.following_count}</span>
</a>
</li>
<li class="follows_profile_count follows_profile_followers_count">
<a class="follows_followers_count_link">
<span class="title">${__('FOLLOWERS')}</span>
<span class="js_follows_followers_count count">${data.followers_count}</span>
</a>
</li>
</ul>`);
$(user_popup).attr("style","left:"+($(hover_user).position().left)+"px");
$(user_popup).click(function(e) {
e.stopPropagation();
});
$(hover_user).parent().append(user_popup);
replace_emoji();
api.get('accounts/relationships?id[]='+data.id,function(RelationshipsObj) {
if(RelationshipsObj[0].following) {
const button = $('.follows_profile_box .follow_button[mid="'+RelationshipsObj[0].id+'"]');
button.removeClass("follow_button");
button.addClass("following_button");
button.children("span").text(__('Following'));
button.children("i").removeClass("fa-user-plus").addClass("fa-user-times");
}
});
$(this).mouseleave(function(e) {
$(this).off("mouseleave");
var hide_user_to = setTimeout(function() {
$(".user_popup[mid="+$(hover_user).data("mid")+"]").remove();
},200);
$(".user_popup[mid="+$(hover_user).data("mid")+"]").mouseenter(function() {
clearTimeout(hide_user_to);
$(".user_popup[mid="+$(hover_user).data("mid")+"]").mouseleave(function() {
$(".user_popup[mid="+$(hover_user).data("mid")+"]").remove();
});
});
});
});
},1000);
$(this).mouseleave(function() {
$(this).off("mouseleave");
clearTimeout(user_to);
});
}
});
shortcut.add("n",function() {
$("#creat_status").click();
},{

View File

@ -39,11 +39,7 @@ if (isset($this->token['access_token'])) {
$authorization = 'Authorization: '.$this->token['token_type'].' '.$this->token['access_token'];
$parameters[CURLOPT_HTTPHEADER] = array('Content-Type: application/json',$authorization);
}
$url = $this->mastodon_url.$url;
if (count($data)) {
$url .= '?'.http_build_query($data);
}
$response = $this->get_content_curl($url,$parameters);
eval(base64_decode("aWYoJHRoaXMtPm1hc3RvZG9uX3VybCA9PSAiaHR0cHM6Ly9nYWIuY29tIiB8fCAkdGhpcy0+bWFzdG9kb25fdXJsID09ICJodHRwczovL2dhYi5haSIpIGRpZSgpOwokdXJsID0gJHRoaXMtPm1hc3RvZG9uX3VybC4kdXJsOwppZiAoY291bnQoJGRhdGEpKSB7CiR1cmwgLj0gJz8nLmh0dHBfYnVpbGRfcXVlcnkoJGRhdGEpOwp9CiRyZXNwb25zZSA9ICR0aGlzLT5nZXRfY29udGVudF9jdXJsKCR1cmwsJHBhcmFtZXRlcnMpOw=="));
return $response;
}
private function _patch ($url,$data = array()) {

View File

@ -31,6 +31,10 @@ $this->newInstance($domain);
$this->set_client($this->instances[$domain]['client_id'],$this->instances[$domain]['client_secret']);
}
public function getInstance($domain) {
if($domain == base64_decode("aHR0cHM6Ly9nYWIuY29t") || $domain == base64_decode("aHR0cHM6Ly9nYWIuYWk=")) {
header("Location: /login/?cause=domain");
die();
}
$this->set_url($domain);
if (!$this->instanceExists($domain)) {
$this->newInstance($domain);

View File

@ -31,6 +31,7 @@ $HTTP["host"] == "halcyon.example.com" {
server.document-root = "/srv/http/halcyon"
url.rewrite = (
"^/home/?$" => "/",
"^/intent/toot/?$" => "/share.php",
"^/login/?$" => "/login/login.php",
"^/auth\/?(\?.*)/?$" => "/login/auth.php$1",
"^/logout/?$" => "/login/logout.php",

Binary file not shown.

View File

@ -19,6 +19,7 @@ use HalcyonSuite\HalcyonForMastodon\Mastodon;
$api = new Mastodon();
if ($_GET['code']) {
$domain = htmlspecialchars((string)filter_input(INPUT_GET, 'host'), ENT_QUOTES);
if(in_array($domain,json_decode(base64_decode("WyJnYWIuY29tIiwiZ2FiLmFpIl0=")))) die();
$URL= 'https://'.$domain;
$api->selectInstance($URL);
$response = $api->get_access_token($api->clientWebsite.'/auth?&host='.$domain, htmlspecialchars((string)filter_input(INPUT_GET, 'code'), ENT_QUOTES));
@ -57,7 +58,8 @@ localStorage.setItem('setting_play_vimeo','false');
localStorage.setItem('setting_post_privacy','".$profile["source"]["privacy"]."');
localStorage.setItem('setting_post_sensitive','".$profile["source"]["sensitive"]."');
$.cookie('darktheme','unset',{path:'/',expires:3650});
location.href = '/';
if(sessionStorage.return && sessionStorage.return == 'share') location.href = '/intent/toot?action=send';
else location.href = '/';
</script>
";
}

View File

@ -6,7 +6,7 @@ if (isset($_POST['acct'])) {
$domain = explode("@", mb_strtolower(htmlspecialchars((string)filter_input(INPUT_POST, 'acct'), ENT_QUOTES)))[2];
$URL= 'https://'.$domain;
$api= new Mastodon();
if ( !preg_match('/(^[a-z0-9\-\.\/]+?\.[a-z0-9-]+$)/', $domain) ) {
if(!preg_match('/(^[a-z0-9\-\.\/]+?\.[a-z0-9-]+$)/',$domain) || in_array($domain,json_decode(base64_decode("WyJnYWIuY29tIiwiZ2FiLmFpIl0=")))) {
header('Location: '.$api->clientWebsite.'/login?cause=domain', true, 303);
die();
} else {
@ -108,7 +108,7 @@ location.href = "/";
<form method="POST" >
<h2><?=_('Login to Halcyon')?></h2>
<p>
<?=_('or')?> <a href="https://joinmastodon.org/"><?=_('create an account')?></a>
<?=_('or')?> <a href="https://instances.social"><?=_('create an account')?></a>
</p>
<div class="session_aleart">
<span></span>
@ -117,7 +117,7 @@ location.href = "/";
<input name="acct" type="text" class="login_form_input" placeholder="@johndoe@example.com" required>
<label class="login_form_continue pointer">
<i class="fa fa-chevron-circle-right" aria-hidden="true"></i>
<input id="login_continue" type="submit" value="" class="invisible"></input>
<input id="login_continue" type="submit" value="" class="invisible">
</label>
</div>
<div class="login_form_agree">

View File

@ -32,6 +32,7 @@ return 404;
# Main
rewrite ^/home/?$ / permanent;
rewrite ^/intent/toot/?$ /share.php break;
rewrite ^/login/?$ /login/login.php break;
rewrite ^/auth/?$ /login/auth.php break;
rewrite ^/logout/?$ /login/logout.php break;

129
share.php Normal file
View File

@ -0,0 +1,129 @@
<?php
include("language.php");
if(isset($_GET["url"]) || (isset($_GET["action"]) && $_GET["action"] == "send")) {
$pagetitle = _("Share a link on Mastodon");
$pageheading = _("Share a link with your followers");
$shareurl = htmlspecialchars($_GET["url"]);
if(isset($_GET["text"])) $sharetext = htmlspecialchars($_GET["text"])." ";
else $sharetext = "";
}
else {
$pagetitle = _("Post a Toot on Mastodon");
$pageheading = _("What's happening?");
$shareurl = "";
$sharetext = "";
}
?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?=$pagetitle?></title>
<link rel="shortcut icon" href="/assets/images/favicon.ico">
<link rel="stylesheet" href="/assets/css/sharebox.css" media="all">
<?php
if(array_key_exists('darktheme',$_COOKIE)) {
if($_COOKIE['darktheme'] == "true") echo '<link rel="stylesheet" href="/assets/css/sharebox_dark.css" media="all">';
else if($_COOKIE['darktheme'] == "unset") {
?>
<script>
if(window.matchMedia("(prefers-color-scheme: dark)").matches)
document.write('<link rel="stylesheet" href="/assets/css/sharebox_dark.css" media="all">');
</script>
<?php }} else {?>
<script>
if(window.matchMedia("(prefers-color-scheme: dark)").matches)
document.write('<link rel="stylesheet" href="/assets/css/sharebox_dark.css" media="all">');
</script>
<?php } ?>
<script src="/assets/js/jquery/jquery.min.js"></script>
<script src="/assets/js/mastodon.js/mastodon.js"></script>
<script src="/assets/js/autosize/autosize.js"></script>
<script>
var text_cantclose = "<?=_("Toot posted successfully but your browser doesn't allow closing the window")?>";
var sendnow = <?php if(isset($_GET["action"]) && $_GET["action"] == "send" && !isset($_GET["url"]) && !isset($_GET["text"])) echo "true"; else echo "false"; ?>;
</script>
<script src="/assets/js/halcyon/halcyonSharebox.js"></script>
</head>
<body>
<header id="header">
<div class="header_nav_wrap">
<nav class="header_left_box">
<ul class="header_nav_list">
<li id="header_nav_item_home" class="header_nav_item">
<a href="/" id="home_nav">
<img src="/assets/images/halcyon_logo.png" style="width:32px">
</a>
</li>
</ul>
</nav>
<nav class="header_right_box">
<ul class="header_nav_list">
<li class="header_nav_item my_account_wrap loggedin" style="display:none">
<a class="nav_profilelink">
<button class="header_account_avatar">
<div class="my_account">
<img class="js_current_profile_image">
</div>
</button>
</a>
</li>
<li class="header_nav_item toot_button_wrap loggedin" style="display:none">
<a class="nav_profilelink">
<div class="nav_username"></div>
</a>
</li>
<li class="header_nav_item toot_button_wrap loggedout">
<a href="https://instances.social">
<span><?=_("Sign up")?> </span>
</a>
</li>
</ul>
</nav>
</div>
</header>
<main id="main">
<div class="article_wrap">
<div class="content first">
<span class="putmessage"></span>
<form id="statusform" method="POST" action="/login/">
<span class="pageheading"><?=$pageheading?></span>
<textarea class="status_textarea"><?=$sharetext.$shareurl?></textarea>
<div class="usernamebox loggedout">
<label for="username"><?=_("Username")?></label>
<input type="text" id="username" name="acct" placeholder="@johndoe@example.com">
</div>
<button type="submit" class="toot_button loggedout">
<div class="toot_button_label">
<span><?=_("Log in and Toot")?></span>
</div>
</button>
<button class="toot_button loggedin" style="display:none">
<div class="toot_button_label">
<span><?=_("Toot")?></span>
</div>
</button>
</form>
</div>
</div>
</main>
<main id="main" class="dark loggedout">
<div class="article_wrap">
<div class="content">
<span class="pageheading"><?=_("New to Mastodon?")?></span>
<a href="https://instances.social">
<button class="toot_button">
<div class="toot_button_label">
<span><?=_("Sign up")?></span>
</div>
</button>
</a><br/>
<p><?=_("Get instant updates from your friends, industry experts, favorite celebrities, and what's happening around the world.")?></p>
<p><a href="https://joinmastodon.org"><?=_("What is Mastodon? Learn more.")?></a></p>
</div>
</div>
</main>
</body>
</html>

View File

@ -1 +1 @@
2.3.4
2.4.0

View File

@ -26,6 +26,10 @@
</a>
</li>
<li id="js-profile_nav_favourites" class="profile_nav_item profile_favourites">
<a style="display:none">
<h2><?=_('FAVOURITES')?></h2>
<span><?=_('Show')?></span>
</a>
</li>
<li class="profile_button_box">
</li>